@walkme/sdk
Advanced tools
Comparing version 2.0.4 to 2.0.7
@@ -1,2 +0,2 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";var r,o,a,i,u,c,s,l,d,f,p,v;n.d(t,"i",(function(){return r})),n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"k",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"l",(function(){return v})),n.d(t,"m",(function(){return m})),n.d(t,"n",(function(){return y})),function(e){e.Video="video",e.Article="article",e.Launcher="launcher",e.ShoutOut="shoutOut",e.Shuttle="shuttle",e.SmartWalkThru="smart-walkthru",e.Survey="survey",e.Task="task",e.Course="course",e.Lesson="lesson",e.Walkthru="walkthru",e.Category="category",e.Tab="tab",e.Experiments="experiments",e.SearchProviderUrl="search-provider-url",e.Tag="tag",e.TrackedElement="trackedElement",e.TrackedPage="trackedPage",e.SupportItem="support",e.SearchResult="search-result",e.HelpDesk="helpDesk",e.SmartTipSet="smartTipSet"}(r||(r={})),function(e){e.Help="help",e.Tasks="tasks"}(o||(o={})),function(e){e[e.Walkthru=0]="Walkthru",e[e.Task=1]="Task",e[e.Launcher=2]="Launcher",e[e.LabelGroup=3]="LabelGroup",e[e.Survey=4]="Survey",e[e.AbExperiment=5]="AbExperiment",e[e.Category=6]="Category",e[e.Content=7]="Content",e[e.Collection=8]="Collection",e[e.Shuttle=9]="Shuttle",e[e.Tag=10]="Tag",e[e.ShoutOut=14]="ShoutOut",e[e.ConditionBlock=17]="ConditionBlock",e[e.BusinessSolution=19]="BusinessSolution",e[e.Lesson=20]="Lesson",e[e.Course=21]="Course",e[e.TrackedPage=22]="TrackedPage",e[e.Spotlight=23]="Spotlight",e[e.Tooltip=24]="Tooltip",e[e.TrackedElement=25]="TrackedElement",e[e.SearchProviderUrl=26]="SearchProviderUrl",e[e.Space=27]="Space",e[e.Folder=28]="Folder",e[e.ActionBot=29]="ActionBot",e[e.ActionBotConversation=30]="ActionBotConversation",e[e.Menu=31]="Menu"}(a||(a={})),function(e){e.IDP="idp"}(i||(i={})),function(e){e[e.Play=2]="Play"}(u||(u={})),function(e){e.Verbose="Verbose",e.Debug="Debug",e.Info="Info",e.Warn="Warn",e.Error="Error"}(c||(c={})),function(e){e.Web="web",e.Mac="mac",e.Windows="windows",e.Mock="mock",e.Worker="worker"}(s||(s={})),function(e){e.BeforeOpen="beforeOpen",e.BeforeClose="beforeClose"}(l||(l={})),function(e){e.VisualDesign="visualDesign"}(d||(d={})),function(e){e.ActionClicked="visualDesign.actionClicked"}(f||(f={})),function(e){e.Remote="remote",e.Destroy="destroy",e.PlayShuttle="playShuttle",e.Play="play",e.PlayContent="playContent",e.PlaySWT="playBf",e.PlayWT="playWt",e.OpenMenu="openMenu"}(p||(p={})),function(e){e.APPS_DRAWS="wm-visualDesign-apps-items",e.DRAW_ACTIONS="wm-visualDesign-item-actions"}(v||(v={}));const m=600;var y;!function(e){e.Empty="%",e.Px="px"}(y||(y={}))},function(e,t,n){!function(e,t){for(var n in t)e[n]=t[n]}(t,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";function r(e,t){var n=document.createElement("script");n.async=!0,n.src=e,document.getElementsByTagName("head")[0].appendChild(n),n.onerror=t}n.r(t),n.d(t,"addScript",(function(){return r})),n.d(t,"createSdk",(function(){return u})),n.d(t,"isSelfHosted",(function(){return l})),n.d(t,"getPublicPath",(function(){return f})),n.d(t,"getSdkApplicationsPublicPathWithEntry",(function(){return m})),n.d(t,"rpc",(function(){return A})),n.d(t,"overTheWire",(function(){return R})),n.d(t,"getLocalStorageItem",(function(){return c})),n.d(t,"LogLevel",(function(){return T})),n.d(t,"logger",(function(){return I}));var o=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function u(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},a=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},i=globalThis.sdkInstance,u=function(e){return{init:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,e.apply(void 0,t)];case 1:return i=n.sent(),[2]}}))}))},get content(){return null==i?void 0:i.content},get settings(){return null==i?void 0:i.settings},get storage(){return null==i?void 0:i.storage},get conditions(){return null==i?void 0:i.conditions},get events(){return null==i?void 0:i.events},get language(){return null==i?void 0:i.language},get platform(){return null==i?void 0:i.platform},get apps(){return null==i?void 0:i.apps},get ui(){return null==i?void 0:i.ui},get services(){return null==i?void 0:i.services},get notifications(){return null==i?void 0:i.notifications}}},c=function(e){var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function s(e){return new URL(window.location.href).searchParams.get(e)}function l(){return"true"===s(v)}function d(e){if(e){var t=new URL(window.location.href),n=t.pathname.split("/");return n.splice(0,1),n.splice(-4),t.search="",t.pathname=n.join("/"),"".concat(t.href,"/components")}return"https://cdn.walkme.com"}function f(e){var t=function(){var e=c("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();if("local"===t)return"https://localhost:".concat(9128,"/dist/");var n="".concat(d(e)).concat(e?"/sdk-runtime":"/sdk/player");return"".concat(n,"/").concat(t,"/")}var p,v="selfhosted";function m(){var e=function(){var e=c("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();if("local"===e)return"https://localhost:".concat(9902,"/dist/index.js");if("2"===s("sdk-version")){var t=void 0;t=l()?window.location.href.match(/^(.*?\/components)\//)[1]:"".concat(d(),"/sdk");var n="".concat(t,"/sdk-applications");return"".concat(n,"/").concat(e,"/index.js")}var r="".concat(d(),"/sdk/player");return"".concat(r,"/").concat("1.0","/main.js")}var y=new Uint8Array(16);function g(){if(!p&&!(p="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return p(y)}var h=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var b=function(e){return"string"==typeof e&&h.test(e)},w=[],k=0;k<256;++k)w.push((k+256).toString(16).substr(1));var S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(w[e[t+0]]+w[e[t+1]]+w[e[t+2]]+w[e[t+3]]+"-"+w[e[t+4]]+w[e[t+5]]+"-"+w[e[t+6]]+w[e[t+7]]+"-"+w[e[t+8]]+w[e[t+9]]+"-"+w[e[t+10]]+w[e[t+11]]+w[e[t+12]]+w[e[t+13]]+w[e[t+14]]+w[e[t+15]]).toLowerCase();if(!b(n))throw TypeError("Stringified UUID is invalid");return n};var T,O=function(e,t,n){var r=(e=e||{}).random||(e.rng||g)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return S(r)},P=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function u(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},_=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};!function(e){e.INFO="info",e.ERROR="error"}(T||(T={}));var x,I={log:function(e){var t=e.eventName,n=e.module,r=e.message,o=e.data,a=e.logLevel,i=void 0===a?T.INFO:a,u=e.extra,c=void 0===u?void 0:u;return P(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return l()?[2]:("https://ec.walkme.com",[4,fetch("".concat("https://ec.walkme.com","/event/log"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:n,message:"".concat(t).concat(r?": ".concat(r):""),data:o,level:i,extra:c})})]);case 1:return e.sent(),[2]}}))}))},error:function(e){var t=e.errorType,n=e.errorData,r=e.module,o=e.message,a=void 0===o?void 0:o;return P(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return l()?[2]:[4,I.log({eventName:t,module:r,message:a,data:n||{},logLevel:T.ERROR,extra:(new Error).stack})];case 1:return e.sent(),[2]}}))}))}};function j(){var e={},t=new Map;var n=/(^__|constructor|hasOwnProperty|propertyIsEnumerable|toString|toLocaleString|valueOf|isPrototypeOf)/;var r=function(e){return function e(t,n){return void 0===n&&(n=new Set),!t||n.has(t)?[]:(n.add(t),[Object.keys(Object.getOwnPropertyDescriptors(t)),e(Object.getPrototypeOf(t),n)])}(e).flat(1/0).filter((function(e){return!n.test(e)}))};function o(n,a,i,u,c){return void 0===a&&(a=new Set),void 0===i&&(i="ANONYMOUS"),void 0===u&&(u=null),void 0===c&&(c=0),c>150?(I.error({errorType:"Serializer",message:"Too deep",module:"sdk-utils"}),"##TOO_DEEP##"):function(e,t){return t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e)}(n,a)?"##CIRCULAR_OBJECT##":(a.add(n),Array.isArray(n)?function(e,t,n){return e.map((function(e){return o(e,t,"ANONYMOUS",null,n+1)}))}(n,a,c):"object"==typeof n&&n?function(e,t,n){return r(e).reduce((function(r,a){return r[a]=o(e[a],t,a,e,n+1),r}),{})}(n,a,c):"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);var a="##function##".concat(o,"##").concat(O()),i=n.bind(r);return e[a]=i,t.set(n,a),a}(n,u,i):n)}function a(e,t){return Array.isArray(e)?function(e,t){return e.map((function(e){return a(e,t)}))}(e,t):"object"==typeof e&&e?function(e,t){return Object.entries(e).reduce((function(e,n){var r=n[0],o=n[1];return e[r]=a(o,t),e}),{})}(e,t):/^##function##/.test(e)?function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e,n)}:e}return{serialize:o,deserialize:a,getFunction:function(t){return e[t]}}}!function(e){e.request="request",e.response="response"}(x||(x={}));var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function u(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,u)}c((r=r.apply(e,t||[])).next())}))},C=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};function A(e){var t=j(),n="__sdk__runtime__uniq__me"===e.name?e.name:"".concat(e.name,"##").concat(O()),r={applicationId:n,messageType:x.request},o={applicationId:n,messageType:x.response},a={},i={},u=function(e,t){return s({metadata:E({functionId:e,messageId:O()},r),data:t})},c=function(e){return t.getFunction(e)||a[e]};function s(n){var r=n.metadata,o=n.data;return L(this,void 0,void 0,(function(){return C(this,(function(n){return e.sendMessage({metadata:r,data:t.serialize(o)}),r.messageType===x.request?[2,(a=r.messageId,new Promise((function(e,t){i[a]={resolve:e,reject:t}})))]:[2];var a}))}))}var l=function(e){return void 0===e&&(e="sdk_get_api"),s({metadata:E({functionId:e,messageId:O()},r),data:[]})},d=function(e){return Object.assign(a,e)};return e.receiveMessage((function(e){var r,a,l=void 0===e?{metadata:null,data:[]}:e,d=l.metadata,f=l.data;return L(this,void 0,void 0,(function(){var e,l,p,v;return C(this,(function(m){return d?(e=d.messageType,l=d.messageId,p=d.functionId,function(e){var t=e.requester,r=e.messageType,o=e.functionId,a=e.messageId;return r===x.response?!!i[a]:t!==n&&!!c(o)}({requester:d.applicationId,messageType:e,functionId:p,messageId:l})?(v=t.deserialize(f,u),e===x.response?(d.error?null===(r=i[l])||void 0===r||r.reject(d.error):null===(a=i[l])||void 0===a||a.resolve(v),delete i[l]):function(e,n,r){L(this,void 0,void 0,(function(){var a,i,u,l,d;return C(this,(function(f){switch(f.label){case 0:if(!(a=c(n)))return[3,5];i=void 0,u=void 0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,a.apply(void 0,r)];case 2:return l=f.sent(),i=t.serialize(l),[3,4];case 3:return d=f.sent(),u=t.serialize(d),[3,4];case 4:s({metadata:E(E({messageId:e,functionId:n},o),{error:u}),data:i}),f.label=5;case 5:return[2]}}))}))}(l,p,v),[2]):[2]):[2]}))}))})),"undefined"!=typeof TESTING?{getApi:l,provideResolver:d,serializer:t,onmessages:i}:{getApi:l,provideResolver:d}}var R=A}]))},,,function(e,t,n){"use strict";n.r(t),n.d(t,"TypeName",(function(){return h.i})),n.d(t,"TabType",(function(){return h.h})),n.d(t,"LegacyTypes",(function(){return h.e})),n.d(t,"EndUserMethods",(function(){return h.b})),n.d(t,"Environment",(function(){return h.c})),n.d(t,"LogLevel",(function(){return h.f})),n.d(t,"PlatformType",(function(){return h.g})),n.d(t,"EventTypeName",(function(){return h.d})),n.d(t,"UIItemType",(function(){return h.k})),n.d(t,"UIEventType",(function(){return h.j})),n.d(t,"ActionType",(function(){return h.a})),n.d(t,"UI_STORAGE_KEYS",(function(){return h.l})),n.d(t,"UI_STORAGE_TIME",(function(){return h.m})),n.d(t,"Unit",(function(){return h.n}));let r=globalThis.sdkInstance;const o=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function a(e){return new URL(window.location.href).searchParams.get(e)}function i(){return"true"===a(c)}function u(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}const c="selfhosted";function s(){const e=function(){const e=o("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===a("sdk-version")){let t;t=i()?window.location.href.match(/^(.*?\/components)\//)[1]:u()+"/sdk";return`${t+"/sdk-applications"}/${e}/index.js`}return u()+"/sdk/player"+"/1.0/main.js"}new Uint8Array(16);for(var l=[],d=0;d<256;++d)l.push((d+256).toString(16).substr(1));var f;!function(e){e.INFO="info",e.ERROR="error"}(f||(f={}));var p;!function(e){e.request="request",e.response="response"}(p||(p={}));var v=n(1);const m={name:"sdk-iframe-proxy-client",sendMessage:e=>y().contentWindow.postMessage(e,"*"),receiveMessage:e=>{window.addEventListener("message",t=>{var n;(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.metadata)&&e(t.data)})}},y=()=>document.querySelector("#wm-channel");async function g(){return new Promise(e=>{const t=document.createElement("iframe");t.id="wm-channel",t.src=Object(v.getPublicPath)()+"sdk-proxy.html?platform=web",t.style.display="none",t.addEventListener("load",async()=>{const t=Object(v.rpc)(m).getApi();e(t)}),document.body.appendChild(t)})}var h=n(0);const b=(w=async function(e={mode:"common"}){try{return await("iframe"===e.mode?((null===(r=null===(n=null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.ctx)||void 0===n?void 0:n.get("FeaturesManager"))||void 0===r?void 0:r.isFeatureEnabled("playerSDKV2"))?k:g)():async function(){if(globalThis.sdkInstance)return globalThis.sdkInstance;const e=self;if(!e.__walkmeSDKLazyLoad){e.__walkmeSDKLazyLoad={},e.__walkmeSDKLazyLoad.promise=new Promise(t=>{e.__walkmeSDKLazyLoad.resolve=t,e.__walkmeSDKLazyLoad.reject=t});const t=document.createElement("script");t.src=""+s(),document.body.appendChild(t)}const t=await e.__walkmeSDKLazyLoad.promise;return await t.init(),globalThis.sdkInstance=t,t}())}catch(e){throw console.error(e),e}var t,n,r},{async init(...e){r=await w(...e)},get content(){return null==r?void 0:r.content},get settings(){return null==r?void 0:r.settings},get storage(){return null==r?void 0:r.storage},get conditions(){return null==r?void 0:r.conditions},get events(){return null==r?void 0:r.events},get language(){return null==r?void 0:r.language},get platform(){return null==r?void 0:r.platform},get apps(){return null==r?void 0:r.apps},get ui(){return null==r?void 0:r.ui},get services(){return null==r?void 0:r.services},get notifications(){return null==r?void 0:r.notifications}});var w;t.default=b;async function k(){return await new Promise(e=>{var t;const n=({data:t})=>{"WalkMeApplicationsLoader-PlayerSDKLoaded"===t&&(window.removeEventListener("message",n),e())};(null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.getPlayerSdk)?e():window.addEventListener("message",n)}),globalThis._walkmeInternals.getPlayerSdk()}}])})); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";var r,o,a,i,s,u,c,l,d,f,p,m;n.d(t,"i",(function(){return r})),n.d(t,"h",(function(){return o})),n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"k",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"l",(function(){return m})),n.d(t,"m",(function(){return g})),n.d(t,"n",(function(){return y})),function(e){e.Video="video",e.Article="article",e.Launcher="launcher",e.ShoutOut="shoutOut",e.Shuttle="shuttle",e.SmartWalkThru="smart-walkthru",e.Survey="survey",e.Task="task",e.Course="course",e.Lesson="lesson",e.Walkthru="walkthru",e.Category="category",e.Tab="tab",e.Experiments="experiments",e.SearchProviderUrl="search-provider-url",e.Tag="tag",e.TrackedElement="trackedElement",e.TrackedPage="trackedPage",e.SupportItem="support",e.SearchResult="search-result",e.HelpDesk="helpDesk",e.SmartTipSet="smartTipSet"}(r||(r={})),function(e){e.Help="help",e.Tasks="tasks"}(o||(o={})),function(e){e[e.Walkthru=0]="Walkthru",e[e.Task=1]="Task",e[e.Launcher=2]="Launcher",e[e.LabelGroup=3]="LabelGroup",e[e.Survey=4]="Survey",e[e.AbExperiment=5]="AbExperiment",e[e.Category=6]="Category",e[e.Content=7]="Content",e[e.Collection=8]="Collection",e[e.Shuttle=9]="Shuttle",e[e.Tag=10]="Tag",e[e.ShoutOut=14]="ShoutOut",e[e.ConditionBlock=17]="ConditionBlock",e[e.BusinessSolution=19]="BusinessSolution",e[e.Lesson=20]="Lesson",e[e.Course=21]="Course",e[e.TrackedPage=22]="TrackedPage",e[e.Spotlight=23]="Spotlight",e[e.Tooltip=24]="Tooltip",e[e.TrackedElement=25]="TrackedElement",e[e.SearchProviderUrl=26]="SearchProviderUrl",e[e.Space=27]="Space",e[e.Folder=28]="Folder",e[e.ActionBot=29]="ActionBot",e[e.ActionBotConversation=30]="ActionBotConversation",e[e.Menu=31]="Menu"}(a||(a={})),function(e){e.IDP="idp"}(i||(i={})),function(e){e[e.Play=2]="Play"}(s||(s={})),function(e){e.Verbose="Verbose",e.Debug="Debug",e.Info="Info",e.Warn="Warn",e.Error="Error"}(u||(u={})),function(e){e.Web="web",e.Mac="mac",e.Windows="windows",e.Mock="mock",e.Worker="worker"}(c||(c={})),function(e){e.BeforeOpen="beforeOpen",e.BeforeClose="beforeClose"}(l||(l={})),function(e){e.VisualDesign="visualDesign"}(d||(d={})),function(e){e.ActionClicked="visualDesign.actionClicked"}(f||(f={})),function(e){e.Remote="remote",e.Destroy="destroy",e.PlayShuttle="playShuttle",e.Play="play",e.PlayContent="playContent",e.PlaySWT="playBf",e.PlayWT="playWt",e.OpenMenu="openMenu"}(p||(p={})),function(e){e.APPS_DRAWS="wm-visualDesign-apps-items",e.DRAW_ACTIONS="wm-visualDesign-item-actions"}(m||(m={}));const g=600;var y;!function(e){e.Empty="%",e.Px="px"}(y||(y={}))},function(e,t){!function(e,t){for(var n in t)e[n]=t[n]}(t,function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"addScript",(function(){return E})),n.d(t,"createSdk",(function(){return N})),n.d(t,"isSelfHosted",(function(){return m})),n.d(t,"getPublicPath",(function(){return v})),n.d(t,"getSdkApplicationsPublicPathWithEntry",(function(){return b})),n.d(t,"getSdkUtilsPublicPathWithEntry",(function(){return w})),n.d(t,"rpc",(function(){return A})),n.d(t,"overTheWire",(function(){return L})),n.d(t,"getLocalStorageItem",(function(){return f})),n.d(t,"LogLevel",(function(){return k})),n.d(t,"log",(function(){return T})),n.d(t,"warn",(function(){return I})),n.d(t,"error",(function(){return _})),n.d(t,"logger",(function(){return P})),n.d(t,"rpcLoader",(function(){return R}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}for(var i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,s=function(e){return"string"==typeof e&&i.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l,d=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n}(r)};!function(e){e.request="request",e.response="response"}(l||(l={}));const f=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function p(e){return new URL(window.location.href).searchParams.get(e)}function m(){return"true"===p(h)}function g(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function y(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}function v(e){const t=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();return"local"===t?"https://localhost:9128/dist/":`${y(e)}${e?"/sdk-runtime":"/sdk/player"}/${t}/`}const h="selfhosted";function b(){const e=function(){const e=f("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===p("sdk-version")){let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-applications"}/${e}/index.js`}return y()+"/sdk/player/1.0/main.js"}function w(){const e=function(){const e=f("walkme-sdk-utils-version");return"local"===e?"local":e||"2.0"}();if("local"===e)return"https://localhost:9904/dist/index.js";let t;return t=m()?g():y()+"/sdk",`${t+"/sdk-utils"}/${e}/index.js`}var k;let S,j;async function O({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(!m()){(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"734243a06b0995f2a65d152d18af299515c3e463",sdkBranch:"master",sessionId:S,userGuid:j,extra:a})})}catch(e){}}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(k||(k={}));const T=e=>O(Object.assign(Object.assign({},e),{logLevel:k.INFO})),I=e=>O(Object.assign(Object.assign({},e),{logLevel:k.WARN})),_=e=>O(Object.assign(Object.assign({},e),{logLevel:k.ERROR,extra:(new Error).stack})),P={warn:I,log:T,error:_,setSessionId:(e="noSessionId")=>{S=e},setUserGuid:(e="noUserGuid")=>{j=e}};function A(e){const t=function(){const e={},t=new Map,n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${d()}`,i=n.bind(r);return e[a]=i,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";return{serialize:e=>{let t=0;const i=new Set,s={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:s,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw P.error({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:s,key:c,originalParent:l}=u.shift();if(!(c in s))if(n(e,i))s[c]="##CIRCULAR_OBJECT##";else{i.add(e);const t=r(e,l,c);s[c]=t;for(const n of o(e,t))u.push(n)}}return s.ANONYMOUS},deserialize:function e(t,n){return Array.isArray(t)?((t,n)=>t.map(t=>e(t,n)))(t,n):"object"==typeof t&&t?((t,n)=>Object.entries(t).reduce((t,[r,o])=>(t[r]=e(o,n),t),{}))(t,n):/^##function##/.test(t)?(...e)=>n(t,e):t},getFunction:t=>e[t]}}(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${d()}`,r={applicationId:n,messageType:l.request},o={applicationId:n,messageType:l.response},a={},i={},s=(e,t)=>c({metadata:Object.assign({functionId:e,messageId:d()},r),data:t}),u=e=>t.getFunction(e)||a[e];function c({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===l.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===l.request?(a=n.messageId,new Promise((e,t)=>{i[a]={resolve:e,reject:t}})):Promise.resolve();var a}const f=(e="sdk_get_api")=>c({metadata:Object.assign({functionId:e,messageId:d()},r),data:[]}).then(e=>(P.setSessionId(null==e?void 0:e.sessionId),P.setUserGuid(null==e?void 0:e.userGuid),e)),p=e=>Object.assign(a,e);return e.receiveMessage((function(r){var a,d;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(r))return;const{metadata:f,data:p}=r,{messageType:m,messageId:g,functionId:y,applicationId:v}=f;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===l.response?!!i[o]:e!==n&&!!u(r)}({requester:v,messageType:m,functionId:y,messageId:g}))return;const h=t.deserialize(p,s);m===l.response?(f.error?(P.warn({data:{metadata:f,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(a=i[g])||void 0===a||a.reject(f)):null===(d=i[g])||void 0===d||d.resolve(h),delete i[g]):async function(e,n,r){const a=u(n);if(a){let i,s;try{const e=await a(...r);i=t.serialize(e)}catch(e){s=t.serialize(e)}c({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:s}),data:i})}}(g,y,h)})),"undefined"!=typeof TESTING?{getApi:f,provideResolver:p,serializer:t,onmessages:i}:{getApi:f,provideResolver:p}}const L=A;function E(e,t){const n=document.createElement("script");n.async=!0,n.src=e,document.getElementsByTagName("head")[0].appendChild(n),n.onerror=t}const x=()=>window,R=async e=>(await new Promise(e=>{var t;t=e,x()._walkmeInternals=x()._walkmeInternals||{},Object.assign(x()._walkmeInternals,{__rpc_loader_resolver:t}),E(w(),()=>{})})).rpc(e);let C=globalThis.sdkInstance;const N=e=>({async init(...t){C=await e(...t)},get content(){return null==C?void 0:C.content},get settings(){return null==C?void 0:C.settings},get storage(){return null==C?void 0:C.storage},get conditions(){return null==C?void 0:C.conditions},get events(){return null==C?void 0:C.events},get language(){return null==C?void 0:C.language},get platform(){return null==C?void 0:C.platform},get apps(){return null==C?void 0:C.apps},get ui(){return null==C?void 0:C.ui},get services(){return null==C?void 0:C.services},get notifications(){return null==C?void 0:C.notifications}});(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})()}]))},,,function(e,t,n){"use strict";var r;n.r(t),n.d(t,"TypeName",(function(){return N.i})),n.d(t,"TabType",(function(){return N.h})),n.d(t,"LegacyTypes",(function(){return N.e})),n.d(t,"EndUserMethods",(function(){return N.b})),n.d(t,"Environment",(function(){return N.c})),n.d(t,"LogLevel",(function(){return N.f})),n.d(t,"PlatformType",(function(){return N.g})),n.d(t,"EventTypeName",(function(){return N.d})),n.d(t,"UIItemType",(function(){return N.k})),n.d(t,"UIEventType",(function(){return N.j})),n.d(t,"ActionType",(function(){return N.a})),n.d(t,"UI_STORAGE_KEYS",(function(){return N.l})),n.d(t,"UI_STORAGE_TIME",(function(){return N.m})),n.d(t,"Unit",(function(){return N.n}));var o=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}var i=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var s=function(e){return"string"==typeof e&&i.test(e)},u=[],c=0;c<256;++c)u.push((c+256).toString(16).substr(1));var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};var d,f=function(e,t,n){var r=(e=e||{}).random||(e.rng||a)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return l(r)};!function(e){e.request="request",e.response="response"}(d||(d={}));const p=e=>{var t,n;try{return(null===(n=null===(t=globalThis.walkme)||void 0===t?void 0:t.localStorageOverrides)||void 0===n?void 0:n[e])||globalThis.localStorage.getItem(e)}catch(e){}};function m(e){return new URL(window.location.href).searchParams.get(e)}function g(){return"true"===m(h)}function y(){const e=window.location.href.match(/^(.*?\/components)\//);return e&&e[1]}function v(e){if(e){const e=new URL(window.location.href),t=e.pathname.split("/");return t.splice(0,1),t.splice(-4),e.search="",e.pathname=t.join("/"),e.href+"/components"}return"https://cdn.walkme.com"}const h="selfhosted";function b(){const e=function(){const e=p("walkme-sdk-version");return"local"===e?"local":e||"2.0"}();if("local"===e)return"https://localhost:9902/dist/index.js";if("2"===m("sdk-version")){let t;t=g()?y():v()+"/sdk";return`${t+"/sdk-applications"}/${e}/index.js`}return v()+"/sdk/player"+"/1.0/main.js"}var w;let k,S;async function j({eventName:e,module:t,message:n,data:r,logLevel:o,extra:a}){if(g())return;(null==r?void 0:r.error)instanceof Error&&(r.error=JSON.parse(JSON.stringify(r.error,Object.getOwnPropertyNames(r.error))));try{await fetch("https://ec.walkme.com/event/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:"walkme-sdk",module:t,message:`${e}${n?": "+n:""}`,data:r,level:o,commit:"734243a06b0995f2a65d152d18af299515c3e463",sdkBranch:"master",sessionId:k,userGuid:S,extra:a})})}catch(e){0}}!function(e){e.INFO="info",e.ERROR="error",e.WARN="warn"}(w||(w={}));const O=e=>j(Object.assign(Object.assign({},e),{logLevel:w.WARN})),T=e=>j(Object.assign(Object.assign({},e),{logLevel:w.ERROR,extra:(new Error).stack})),I=(e="noSessionId")=>{k=e},_=(e="noUserGuid")=>{S=e};function P(){const e={},t=new Map;const n=(e,t)=>t.has(e)&&e&&(Array.isArray(e)||"object"==typeof e),r=(n,r,o)=>Array.isArray(n)?[]:"object"==typeof n&&n?{}:"function"==typeof n?function(n,r,o){if(t.has(n))return t.get(n);const a=`##function##${o}##${f()}`,i=n.bind(r);return e[a]=i,t.set(n,a),a}(n,r,Array.isArray(r)?"ANONYMOUS":o):n;function*o(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)yield{obj:e[n],key:n,parent:t,originalParent:e};else if("object"==typeof e&&e)for(const n of function*(e){const t=Object.getOwnPropertyDescriptors(e);for(const e in t)"function"!=typeof t[e].get&&(yield e)}(e))yield{obj:e[n],parent:t,key:n,originalParent:e}}const a="not serializable: https://cdn.walkme.com/sdk/sdk-applications/2.0/docs/index.html#serialization";function i(e,t){return Array.isArray(e)?((e,t)=>e.map(e=>i(e,t)))(e,t):"object"==typeof e&&e?((e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]=i(r,t),e),{}))(e,t):/^##function##/.test(e)?(...n)=>t(e,n):e}return{serialize:e=>{let t=0;const i=new Set,s={},u=function(){let e,t,n=0;return{shift:()=>{const t=null==e?void 0:e.item;return e=null==e?void 0:e.next,n=Math.max(n-1,0),t},push:r=>{n++;const o={item:r};e?(t.next=o,t=t.next):(e=o,t=o)},get length(){return n}}}();for(u.push({obj:e,key:"ANONYMOUS",parent:s,originalParent:{}});u.length;){if(t++,t+u.length>1e5)throw T({eventName:"Serializer",message:a,module:"sdk-utils"}),new Error(a);const{obj:e,parent:s,key:c,originalParent:l}=u.shift();if(!(c in s))if(n(e,i))s[c]="##CIRCULAR_OBJECT##";else{i.add(e);const t=r(e,l,c);s[c]=t;for(const n of o(e,t))u.push(n)}}return s.ANONYMOUS},deserialize:i,getFunction:t=>e[t]}}function A(e){const t=P(),n="__sdk__runtime__uniq__me"===e.name?e.name:`${e.name}##${f()}`,r={applicationId:n,messageType:d.request},o={applicationId:n,messageType:d.response},a={},i={},s=(e,t)=>c({metadata:Object.assign({functionId:e,messageId:f()},r),data:t}),u=e=>t.getFunction(e)||a[e];function c({metadata:n,data:r}){let o;try{o=t.serialize(r)}catch(r){return n.messageType===d.response&&e.sendMessage({metadata:n,data:t.serialize(r)}),Promise.reject(r)}return e.sendMessage({metadata:n,data:o}),n.messageType===d.request?(a=n.messageId,new Promise((e,t)=>{i[a]={resolve:e,reject:t}})):Promise.resolve();var a}const l=(e="sdk_get_api")=>c({metadata:Object.assign({functionId:e,messageId:f()},r),data:[]}).then(e=>(I(null==e?void 0:e.sessionId),_(null==e?void 0:e.userGuid),e)),p=e=>Object.assign(a,e);return e.receiveMessage((function(r){var a,l;if(!function(e){return e&&"object"==typeof e&&"metadata"in e&&"data"in e}(r))return;const{metadata:f,data:p}=r,{messageType:m,messageId:g,functionId:y,applicationId:v}=f;if(!function({requester:e,messageType:t,functionId:r,messageId:o}){return t===d.response?!!i[o]:e!==n&&!!u(r)}({requester:v,messageType:m,functionId:y,messageId:g}))return;const h=t.deserialize(p,s);m===d.response?(f.error?(O({data:{metadata:f,messengerName:e.name},eventName:"rpc",message:"other side rejected",module:"sdk-runtime"}),null===(a=i[g])||void 0===a||a.reject(f)):null===(l=i[g])||void 0===l||l.resolve(h),delete i[g]):async function(e,n,r){const a=u(n);if(a){let i,s;try{const e=await a(...r);i=t.serialize(e)}catch(e){s=t.serialize(e)}c({metadata:Object.assign(Object.assign({messageId:e,functionId:n},o),{error:s}),data:i})}}(g,y,h)})),"undefined"!=typeof TESTING?{getApi:l,provideResolver:p,serializer:t,onmessages:i}:{getApi:l,provideResolver:p}}let L=globalThis.sdkInstance;(()=>{const e=null===(t=window._walkmeInternals)||void 0===t?void 0:t.__rpc_loader_resolver;var t;e&&e({rpc:A})})();var E=n(1);const x={name:"sdk-iframe-proxy-client",sendMessage:e=>{var t;return null===(t=R().contentWindow)||void 0===t?void 0:t.postMessage(e,"*")},receiveMessage:e=>{window.addEventListener("message",t=>{var n;(null===(n=t.data)||void 0===n?void 0:n.metadata)&&e(t.data)})}},R=()=>document.querySelector("#wm-channel");function C(){return new Promise(e=>{const t=document.createElement("iframe");t.id="wm-channel",t.src=Object(E.getPublicPath)()+"sdk-proxy.html?platform=web",t.style.display="none",t.addEventListener("load",()=>{const t=Object(E.rpc)(x).getApi();e(t)}),document.body.appendChild(t)})}var N=n(0);const M=(U=async function(e={mode:"common"}){try{return await("iframe"===e.mode?((null===(r=null===(n=null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.ctx)||void 0===n?void 0:n.get("FeaturesManager"))||void 0===r?void 0:r.isFeatureEnabled("playerSDKV2"))?z:C)():async function(){if(globalThis.sdkInstance)return globalThis.sdkInstance;const e=self;if(!e.__walkmeSDKLazyLoad){e.__walkmeSDKLazyLoad={},e.__walkmeSDKLazyLoad.promise=new Promise(t=>{e.__walkmeSDKLazyLoad.resolve=t,e.__walkmeSDKLazyLoad.reject=t});const t=document.createElement("script");t.src=""+b(),document.body.appendChild(t)}const t=await e.__walkmeSDKLazyLoad.promise;return await t.init(),globalThis.sdkInstance=t,t}())}catch(e){throw console.error(e),e}var t,n,r},{async init(...e){L=await U(...e)},get content(){return null==L?void 0:L.content},get settings(){return null==L?void 0:L.settings},get storage(){return null==L?void 0:L.storage},get conditions(){return null==L?void 0:L.conditions},get events(){return null==L?void 0:L.events},get language(){return null==L?void 0:L.language},get platform(){return null==L?void 0:L.platform},get apps(){return null==L?void 0:L.apps},get ui(){return null==L?void 0:L.ui},get services(){return null==L?void 0:L.services},get notifications(){return null==L?void 0:L.notifications}});var U;t.default=M;async function z(){return await new Promise(e=>{var t;const n=({data:t})=>{"WalkMeApplicationsLoader-PlayerSDKLoaded"===t&&(window.removeEventListener("message",n),e())};(null===(t=globalThis._walkmeInternals)||void 0===t?void 0:t.getPlayerSdk)?e():window.addEventListener("message",n)}),globalThis._walkmeInternals.getPlayerSdk()}}])})); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import { ISdk } from "../../types"; | ||
import type { ISdk } from "../../types"; | ||
export declare function getSDK(): Promise<ISdk>; |
@@ -1,4 +0,4 @@ | ||
import { ISdk } from "../../types"; | ||
import type { ISdk } from "../../types"; | ||
declare const sdk: ISdk; | ||
export default sdk; | ||
export * from "../../types"; |
@@ -0,1 +1,2 @@ | ||
import { rpcLoader } from "./dynamicUtils"; | ||
export * from "./addScript"; | ||
@@ -7,1 +8,2 @@ export * from "./sdkCreator"; | ||
export * from "./logger"; | ||
export { rpcLoader }; |
export declare enum LogLevel { | ||
INFO = "info", | ||
ERROR = "error" | ||
ERROR = "error", | ||
WARN = "warn" | ||
} | ||
declare function sendLog({ eventName, module, message, data, logLevel, extra, }: { | ||
declare type LogArg = { | ||
data?: any; | ||
eventName: any; | ||
module: string; | ||
extra?: string; | ||
message?: string; | ||
data?: any; | ||
logLevel?: string; | ||
extra?: string; | ||
}): Promise<void>; | ||
declare function sendErrorLog({ errorType, errorData, module, message, }: { | ||
errorType: string; | ||
module: string; | ||
message?: string; | ||
errorData?: any; | ||
}): Promise<void>; | ||
}; | ||
export declare const log: (arg: LogArg) => Promise<void>; | ||
export declare const warn: (arg: LogArg) => Promise<void>; | ||
export declare const error: (arg: Omit<LogArg, 'extra'>) => Promise<void>; | ||
export declare const logger: { | ||
log: typeof sendLog; | ||
error: typeof sendErrorLog; | ||
warn: (arg: LogArg) => Promise<void>; | ||
log: (arg: LogArg) => Promise<void>; | ||
error: (arg: Omit<LogArg, 'extra'>) => Promise<void>; | ||
setSessionId: (sid?: string) => void; | ||
setUserGuid: (guid?: string) => void; | ||
}; | ||
export {}; |
@@ -1,7 +0,7 @@ | ||
import { Messenger } from "../../../types/messenger"; | ||
import type { Messenger } from "../../../types/messenger"; | ||
export declare function rpc(messenger: Messenger): { | ||
getApi: (functionId?: string) => Promise<unknown>; | ||
getApi: (functionId?: string) => Promise<any>; | ||
provideResolver: (obj: any) => any; | ||
serializer: { | ||
serialize: (obj: any, seen?: Set<unknown>, key?: string, parent?: any, depth?: number) => any; | ||
serialize: (object: any) => any; | ||
deserialize: (schema: any, sendAction: any) => any; | ||
@@ -12,3 +12,3 @@ getFunction: (functionId: any) => any; | ||
} | { | ||
getApi: (functionId?: string) => Promise<unknown>; | ||
getApi: (functionId?: string) => Promise<any>; | ||
provideResolver: (obj: any) => any; | ||
@@ -15,0 +15,0 @@ serializer?: undefined; |
@@ -0,5 +1,6 @@ | ||
export declare const MAX_ITERATIONS = 100000; | ||
export declare function getSerializer(): { | ||
serialize: (obj: any, seen?: Set<unknown>, key?: string, parent?: any, depth?: number) => any; | ||
serialize: (object: any) => any; | ||
deserialize: (schema: any, sendAction: any) => any; | ||
getFunction: (functionId: any) => any; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { ISdk } from "../../types"; | ||
import type { ISdk } from "../../types"; | ||
export declare const createSdk: (initializor: any) => ISdk; |
export declare function isSelfHosted(): boolean; | ||
export declare function getPublicPath(selfhosted?: boolean): string; | ||
export declare function getSdkApplicationsPublicPathWithEntry(): string; | ||
export declare function getSdkUtilsPublicPathWithEntry(): string; |
import { IPlatformAPI } from "./platform"; | ||
export declare type IPlatformAPI_V1 = IPlatformAPI; | ||
export { IPlatformAPI }; | ||
export * from "./sdk"; |
@@ -1,3 +0,6 @@ | ||
import { IPlatformAPI_V1 } from "./v1"; | ||
import type { IPlatformAPI_V1 } from "./v1"; | ||
export * from "./v1"; | ||
export declare type IPlatformAPI = IPlatformAPI_V1; | ||
export declare type IPlatformAPI = IPlatformAPI_V1 & { | ||
platformApiVersion: number; | ||
platform_launchApplication(applicationName: string): Promise<boolean>; | ||
}; |
@@ -1,5 +0,5 @@ | ||
import { playByIdOptions, ContentItem, TypeName, ContentObject, ConditionTree, LanguageItem, DataOptions, LogLevel } from "../../sdk"; | ||
import { NativeNotificationUIObject, PlatformType, UIItemType, VisualDesign } from "../.."; | ||
import { SettingsFile } from "./settingsFile"; | ||
import { SiteConfig } from "./siteConfig"; | ||
import type { playByIdOptions, ContentItem, TypeName, ContentObject, ConditionTree, LanguageItem, DataOptions, LogLevel } from "../../sdk"; | ||
import type { NativeNotificationUIObject, PlatformType, UIItemType, VisualDesign } from "../.."; | ||
import type { SettingsFile } from "./settingsFile"; | ||
import type { SiteConfig } from "./siteConfig"; | ||
export * from "./settingsFile"; | ||
@@ -6,0 +6,0 @@ export * from "./siteConfig"; |
@@ -61,2 +61,3 @@ export declare type SettingsFile = { | ||
DataFiles: DataFiles; | ||
EnabledApps?: string[]; | ||
}; | ||
@@ -63,0 +64,0 @@ /** |
@@ -1,6 +0,3 @@ | ||
import { IPlatformAPI } from "../platform"; | ||
import { TypeName, ContentCollection, ContentItem, DataOptions } from "./content"; | ||
/** | ||
* IApps | ||
*/ | ||
import type { IPlatformAPI } from "../platform"; | ||
import type { TypeName, ContentCollection, ContentItem, DataOptions } from "./content"; | ||
export interface IApps { | ||
@@ -21,3 +18,3 @@ /** | ||
minPlatformAPIVersion?: number; | ||
init: (mode: string, config: WalkMeAppConfig) => Promise<void>; | ||
init: (mode: string, config: WalkMeAppConfig) => Promise<void> | void; | ||
playById?: (id: number | string, subItemId?: number) => Promise<boolean>; | ||
@@ -28,10 +25,11 @@ createItem?: (title: string, url: string) => ContentItem; | ||
name: string; | ||
init: (p: IPlatformAPI) => Promise<void>; | ||
init: (p: IPlatformAPI) => Promise<void> | void; | ||
getContent?: (options: DataOptions, platformApi: IPlatformAPI) => Promise<Array<WalkMeAppData>>; | ||
} | ||
export interface InitPlatformAPI { | ||
init: (p: IPlatformAPI) => Promise<void>; | ||
init: (p: IPlatformAPI) => Promise<void> | void; | ||
} | ||
export interface WalkMeAppSDK { | ||
getContent?: (data: WalkMeDataCollection) => Promise<Array<WalkMeAppData>>; | ||
[key: keyof any]: any; | ||
} | ||
@@ -61,1 +59,6 @@ export declare type WalkMeDataCollection = { | ||
} | ||
export declare type ApplicationConfig = { | ||
appName: string; | ||
searchTermLauncher?: string; | ||
startHidden?: boolean; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { APPS, PLAY_INITIATORS } from '@walkme/types'; | ||
import type { APPS, PLAY_INITIATORS } from '@walkme/types'; | ||
/** | ||
@@ -3,0 +3,0 @@ * WalkMe Content |
@@ -12,13 +12,13 @@ export * from "./content"; | ||
export * from "./notifications"; | ||
import { IContent } from "./content"; | ||
import { ISettings } from "./settings"; | ||
import { IStorage } from "./storage"; | ||
import { ILanguage } from "./language"; | ||
import { IPlatform } from "./platform"; | ||
import { IEvents } from "./events"; | ||
import { IConditions } from "./conditions"; | ||
import { IApps } from "./apps"; | ||
import { IUI } from "./ui"; | ||
import { IServices } from "./services"; | ||
import { INotifications } from "./notifications"; | ||
import type { IContent } from "./content"; | ||
import type { ISettings } from "./settings"; | ||
import type { IStorage } from "./storage"; | ||
import type { ILanguage } from "./language"; | ||
import type { IPlatform } from "./platform"; | ||
import type { IEvents } from "./events"; | ||
import type { IConditions } from "./conditions"; | ||
import type { IApps } from "./apps"; | ||
import type { IUI } from "./ui"; | ||
import type { IServices } from "./services"; | ||
import type { INotifications } from "./notifications"; | ||
/** | ||
@@ -25,0 +25,0 @@ * This is the interface of the SDK object. |
@@ -1,2 +0,2 @@ | ||
import { PLAY_APP_INITIATOR } from ".."; | ||
import type { PLAY_APP_INITIATOR } from ".."; | ||
export interface IPlatform { | ||
@@ -6,15 +6,22 @@ /** | ||
*/ | ||
PlatformTypes: typeof PlatformType; | ||
closeApp(appGuid: string): Promise<boolean>; | ||
getType(): Promise<PlatformType>; | ||
hideApp(appGuid: string): Promise<boolean>; | ||
kill(): any; | ||
log(message: string, level: LogLevel): any; | ||
logout(): Promise<void>; | ||
openUrl(url: string): any; | ||
refreshApp(appGuid: string): void; | ||
refreshContent(): void; | ||
sendAnalyticsEvent(eventType: string, eventData: Record<string, unknown>): any; | ||
logout(): Promise<void>; | ||
getType(): Promise<PlatformType>; | ||
refreshContent(): void; | ||
hideApp(appGuid: string): Promise<boolean>; | ||
setBadge(name: string, count: number): Promise<void> | void; | ||
showApp(appGuid: string): Promise<boolean>; | ||
closeApp(appGuid: string): Promise<boolean>; | ||
refreshApp(appGuid: string): void; | ||
setBadge(name: string, count: number): Promise<void>; | ||
PlatformTypes: typeof PlatformType; | ||
/** | ||
* Summon an iframe on the specified application (visible or not). | ||
* @param applicationName The codename of the application to invoke. | ||
* The Platform knows how to resolve the name into the URL of | ||
* an entry point. | ||
*/ | ||
launchApplication(applicationName: string): Promise<boolean>; | ||
} | ||
@@ -21,0 +28,0 @@ export declare enum LogLevel { |
@@ -13,2 +13,3 @@ export interface ISettings { | ||
EndUserMethods?: typeof EndUserMethods; | ||
filterEnabledApps(appsNames: string[]): string[]; | ||
} | ||
@@ -15,0 +16,0 @@ export declare type EndUserSettings = { |
@@ -1,2 +0,2 @@ | ||
import { APPS, PLAY_INITIATORS } from '@walkme/types'; | ||
import type { APPS, PLAY_INITIATORS } from '@walkme/types'; | ||
export interface IUI { | ||
@@ -144,3 +144,3 @@ draw(type: UIItemType, item: VisualDesign, appGuid: string, objectId: string, onActionHandler: ActionHandler): Promise<any>; | ||
height: Height; | ||
aspectRatio: number | number; | ||
aspectRatio: number; | ||
aspectRatioLock: boolean; | ||
@@ -147,0 +147,0 @@ } |
{ | ||
"name": "@walkme/sdk", | ||
"version": "2.0.4", | ||
"version": "2.0.7", | ||
"description": "Player SDK", | ||
@@ -21,5 +21,5 @@ "main": "dist/index.js", | ||
"sdk-types": "2.0.2", | ||
"sdk-utils": "^2.0.3" | ||
"sdk-utils": "^2.0.7" | ||
}, | ||
"dependencies": {} | ||
} |
@@ -170,1 +170,30 @@ # WalkMe Player SDK | ||
to 150**. | ||
## Serialization | ||
When the rpc throws this error message: `not serializable`, it means that the number of iterations | ||
executed for serializing the object properties, has exceeded the maximum acceptable number - which is: MAX_ITERATIONS. | ||
This can happen for two main reasons: | ||
1) The object contains more than MAX_ITERATIONS keys overall (including nested keys of course). | ||
2) | ||
- The object has a getter function which returns the execution call of a function. | ||
- This function returns an object. | ||
- Iterating over this object's properties, can trace us back to the original getter function. | ||
- The result is an infinite loop of interations. | ||
#### example: | ||
~~~js | ||
const unresonable = () => ({ | ||
get a() { | ||
return unresonable(); | ||
}, | ||
get b() { | ||
return unresonable(); | ||
}, | ||
}); | ||
~~~ | ||
This object that the `unreasonable` function gives us, without any limitation, can cause the rpc to iterate over its keys forever (or | ||
until he gets a StackOverflowError error). | ||
~~~js | ||
unresonable().a.b.b.a.b.a.b.a.a.a.a.a.a.b.b.b // And on and on... | ||
~~~ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1536571
36
198
7098
3