@customerio/cdp-analytics-browser 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/cjs/generated/version.js +1 -1
- package/dist/cjs/lib/parse-cdn.js +1 -1
- package/dist/cjs/lib/parse-cdn.js.map +1 -1
- package/dist/pkg/generated/version.js +1 -1
- package/dist/pkg/lib/parse-cdn.js +1 -1
- package/dist/pkg/lib/parse-cdn.js.map +1 -1
- package/dist/types/core/buffer/index.d.ts +1 -1
- package/dist/types/generated/version.d.ts +1 -1
- package/dist/types/lib/parse-cdn.d.ts.map +1 -1
- package/dist/umd/646.js +1 -1
- package/dist/umd/646.js.gz +0 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/standalone.js +1 -1
- package/dist/umd/standalone.js.gz +0 -0
- package/package.json +3 -3
- package/src/generated/version.ts +1 -1
- package/src/lib/parse-cdn.ts +2 -1
package/README.md
CHANGED
|
@@ -19,3 +19,18 @@ document.body?.addEventListener('click', () => {
|
|
|
19
19
|
analytics.track('document body clicked!')
|
|
20
20
|
})
|
|
21
21
|
```
|
|
22
|
+
|
|
23
|
+
## Other Regions
|
|
24
|
+
|
|
25
|
+
If you're in our [EU data center](https://customer.io/docs/accounts-and-workspaces/data-centers/) you will need to specify an alternate endpoint:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { AnalyticsBrowser } from '@customerio/cdp-analytics-browser'
|
|
29
|
+
|
|
30
|
+
const analytics = AnalyticsBrowser.load({
|
|
31
|
+
cdnURL: 'https://cdp-eu.customer.io',
|
|
32
|
+
writeKey: '<YOUR_WRITE_KEY>'
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
analytics.identify('hello world')
|
|
36
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getLegacyAJSPath = exports.getNextIntegrationsURL = exports.getCDN = exports.setGlobalCDNUrl = void 0;
|
|
4
4
|
var embedded_write_key_1 = require("./embedded-write-key");
|
|
5
|
-
var analyticsScriptRegex = /(https
|
|
5
|
+
var analyticsScriptRegex = /(https:\/\/[\w.-]+)\/(?:analytics\.js\/v1|v1\/analytics-js\/snippet)\/[\w-]+\/(analytics\.(?:min)\.js)/;
|
|
6
6
|
var getCDNUrlFromScriptTag = function () {
|
|
7
7
|
var cdn;
|
|
8
8
|
var scripts = Array.prototype.slice.call(document.querySelectorAll('script'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-cdn.js","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAEvD,IAAM,oBAAoB,GACxB,
|
|
1
|
+
{"version":3,"file":"parse-cdn.js","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAEvD,IAAM,oBAAoB,GACxB,wGAAwG,CAAA;AAE1G,IAAM,sBAAsB,GAAG;IAC7B,IAAI,GAAuB,CAAA;IAC3B,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CACxC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACpC,CAAA;IACD,OAAO,CAAC,OAAO,CAAC,UAAC,CAAC;;QAChB,IAAM,GAAG,GAAG,MAAA,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAA;QACvC,IAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE7C,IAAI,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;YACvB,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;SAChB;IACH,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,IAAI,UAA8B,CAAA,CAAC,uCAAuC;AAC1E,IAAM,eAAe,GAAG;;IACtB,IAAM,MAAM,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAA,MAAM,CAAC,SAAS,0CAAE,IAAI,CAAA;IACnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAEM,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG,CAAA;KAC5B;IACD,UAAU,GAAG,GAAG,CAAA;AAClB,CAAC,CAAA;AALY,QAAA,eAAe,mBAK3B;AAEM,IAAM,MAAM,GAAG;IACpB,IAAM,YAAY,GAAG,eAAe,EAAE,CAAA;IAEtC,IAAI,YAAY;QAAE,OAAO,YAAY,CAAA;IAErC,IAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAA;IAEjD,IAAI,gBAAgB,EAAE;QACpB,OAAO,gBAAgB,CAAA;KACxB;SAAM;QACL,+DAA+D;QAC/D,yCAAyC;QACzC,0CAA0C;QAC1C,gDAAgD;QAChD,OAAO,yBAAyB,CAAA;KACjC;AACH,CAAC,CAAA;AAhBY,QAAA,MAAM,UAgBlB;AAEM,IAAM,sBAAsB,GAAG;IACpC,IAAM,GAAG,GAAG,IAAA,cAAM,GAAE,CAAA;IACpB,OAAO,UAAG,GAAG,6BAA0B,CAAA;AACzC,CAAC,CAAA;AAHY,QAAA,sBAAsB,0BAGlC;AAED;;;;IAII;AACJ,SAAgB,gBAAgB;;IAC9B,IAAM,QAAQ,GAAG,MAAA,IAAA,qCAAgB,GAAE,mCAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAA;IAEjE,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CACxC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACpC,CAAA;IACD,IAAI,IAAI,GAAuB,SAAS,CAAA;IAExC,KAAgB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO,EAAE;QAApB,IAAM,CAAC,gBAAA;QACV,IAAM,GAAG,GAAG,MAAA,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAA;QACvC,IAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE7C,IAAI,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;YACvB,IAAI,GAAG,GAAG,CAAA;YACV,MAAK;SACN;KACF;IAED,IAAI,IAAI,EAAE;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;KAChE;IAED,OAAO,kDAA2C,QAAQ,0BAAuB,CAAA;AACnF,CAAC;AAvBD,4CAuBC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { embeddedWriteKey } from './embedded-write-key';
|
|
2
|
-
var analyticsScriptRegex = /(https
|
|
2
|
+
var analyticsScriptRegex = /(https:\/\/[\w.-]+)\/(?:analytics\.js\/v1|v1\/analytics-js\/snippet)\/[\w-]+\/(analytics\.(?:min)\.js)/;
|
|
3
3
|
var getCDNUrlFromScriptTag = function () {
|
|
4
4
|
var cdn;
|
|
5
5
|
var scripts = Array.prototype.slice.call(document.querySelectorAll('script'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-cdn.js","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,IAAM,oBAAoB,GACxB,
|
|
1
|
+
{"version":3,"file":"parse-cdn.js","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,IAAM,oBAAoB,GACxB,wGAAwG,CAAA;AAE1G,IAAM,sBAAsB,GAAG;IAC7B,IAAI,GAAuB,CAAA;IAC3B,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CACxC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACpC,CAAA;IACD,OAAO,CAAC,OAAO,CAAC,UAAC,CAAC;;QAChB,IAAM,GAAG,GAAG,MAAA,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAA;QACvC,IAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE7C,IAAI,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;YACvB,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;SAChB;IACH,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,IAAI,UAA8B,CAAA,CAAC,uCAAuC;AAC1E,IAAM,eAAe,GAAG;;IACtB,IAAM,MAAM,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAA,MAAM,CAAC,SAAS,0CAAE,IAAI,CAAA;IACnD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,GAAW;IACzC,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG,CAAA;KAC5B;IACD,UAAU,GAAG,GAAG,CAAA;AAClB,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAM,YAAY,GAAG,eAAe,EAAE,CAAA;IAEtC,IAAI,YAAY;QAAE,OAAO,YAAY,CAAA;IAErC,IAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAA;IAEjD,IAAI,gBAAgB,EAAE;QACpB,OAAO,gBAAgB,CAAA;KACxB;SAAM;QACL,+DAA+D;QAC/D,yCAAyC;QACzC,0CAA0C;QAC1C,gDAAgD;QAChD,OAAO,yBAAyB,CAAA;KACjC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,IAAM,sBAAsB,GAAG;IACpC,IAAM,GAAG,GAAG,MAAM,EAAE,CAAA;IACpB,OAAO,UAAG,GAAG,6BAA0B,CAAA;AACzC,CAAC,CAAA;AAED;;;;IAII;AACJ,MAAM,UAAU,gBAAgB;;IAC9B,IAAM,QAAQ,GAAG,MAAA,gBAAgB,EAAE,mCAAI,MAAM,CAAC,SAAS,CAAC,SAAS,CAAA;IAEjE,IAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CACxC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CACpC,CAAA;IACD,IAAI,IAAI,GAAuB,SAAS,CAAA;IAExC,KAAgB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO,EAAE;QAApB,IAAM,CAAC,gBAAA;QACV,IAAM,GAAG,GAAG,MAAA,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,mCAAI,EAAE,CAAA;QACvC,IAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE7C,IAAI,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;YACvB,IAAI,GAAG,GAAG,CAAA;YACV,MAAK;SACN;KACF;IAED,IAAI,IAAI,EAAE;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;KAChE;IAED,OAAO,kDAA2C,QAAQ,0BAAuB,CAAA;AACnF,CAAC"}
|
|
@@ -75,7 +75,7 @@ export declare class AnalyticsBuffered implements PromiseLike<[Analytics, Contex
|
|
|
75
75
|
register: (...args: import("../plugin").Plugin[]) => Promise<Context>;
|
|
76
76
|
deregister: (...args: string[]) => Promise<Context>;
|
|
77
77
|
user: () => Promise<import("../user").User>;
|
|
78
|
-
readonly VERSION = "0.0.
|
|
78
|
+
readonly VERSION = "0.0.3";
|
|
79
79
|
private _createMethod;
|
|
80
80
|
/**
|
|
81
81
|
* These are for methods that where determining when the method gets "flushed" is not important.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-cdn.d.ts","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-cdn.d.ts","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,eAAe,QAAS,MAAM,SAK1C,CAAA;AAED,eAAO,MAAM,MAAM,QAAO,MAgBzB,CAAA;AAED,eAAO,MAAM,sBAAsB,cAGlC,CAAA;AAED;;;;IAII;AACJ,wBAAgB,gBAAgB,IAAI,MAAM,CAuBzC"}
|
package/dist/umd/646.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[646],{9644:function(e,t,n){e.exports=n(5644)},353:function(e,t,n){"use strict";var s=n(3044),r=n(6955),i=n(2233),o=n(8030),a=n(7948),u=n(1875),c=n(842),d=n(8618);e.exports=function(e){return new Promise((function(t,n){var l=e.data,f=e.headers,p=e.responseType;s.isFormData(l)&&delete f["Content-Type"];var g=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var v=a(e.baseURL,e.url);function y(){if(g){var s="getAllResponseHeaders"in g?u(g.getAllResponseHeaders()):null,i={data:p&&"text"!==p&&"json"!==p?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:s,config:e,request:g};r(t,n,i),g=null}}if(g.open(e.method.toUpperCase(),o(v,e.params,e.paramsSerializer),!0),g.timeout=e.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(d("Request aborted",e,"ECONNABORTED",g)),g=null)},g.onerror=function(){n(d("Network Error",e,null,g)),g=null},g.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(d(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},s.isStandardBrowserEnv()){var w=(e.withCredentials||c(v))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;w&&(f[e.xsrfHeaderName]=w)}"setRequestHeader"in g&&s.forEach(f,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete f[t]:g.setRequestHeader(t,e)})),s.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),p&&"json"!==p&&(g.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&g.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){g&&(g.abort(),n(e),g=null)})),l||(l=null),g.send(l)}))}},5644:function(e,t,n){"use strict";var s=n(3044),r=n(3644),i=n(2215),o=n(2937);function a(e){var t=new i(e),n=r(i.prototype.request,t);return s.extend(n,i.prototype,t),s.extend(n,t),n}var u=a(n(1439));u.Axios=i,u.create=function(e){return a(o(u.defaults,e))},u.Cancel=n(6714),u.CancelToken=n(4089),u.isCancel=n(8041),u.all=function(e){return Promise.all(e)},u.spread=n(783),u.isAxiosError=n(5587),e.exports=u,e.exports.default=u},6714:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4089:function(e,t,n){"use strict";var s=n(6714);function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new s(e),t(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r((function(t){e=t})),cancel:e}},e.exports=r},8041:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:function(e,t,n){"use strict";var s=n(3044),r=n(8030),i=n(946),o=n(6895),a=n(2937),u=n(7525),c=u.validators;function d(e){this.defaults=e,this.interceptors={request:new i,response:new i}}d.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var n=[],s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var r,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!s){var d=[o,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(i),r=Promise.resolve(e);d.length;)r=r.then(d.shift(),d.shift());return r}for(var l=e;n.length;){var f=n.shift(),p=n.shift();try{l=f(l)}catch(e){p(e);break}}try{r=o(l)}catch(e){return Promise.reject(e)}for(;i.length;)r=r.then(i.shift(),i.shift());return r},d.prototype.getUri=function(e){return e=a(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},s.forEach(["delete","get","head","options"],(function(e){d.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),s.forEach(["post","put","patch"],(function(e){d.prototype[e]=function(t,n,s){return this.request(a(s||{},{method:e,url:t,data:n}))}})),e.exports=d},946:function(e,t,n){"use strict";var s=n(3044);function r(){this.handlers=[]}r.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){s.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=r},7948:function(e,t,n){"use strict";var s=n(9192),r=n(8762);e.exports=function(e,t){return e&&!s(t)?r(e,t):t}},8618:function(e,t,n){"use strict";var s=n(1935);e.exports=function(e,t,n,r,i){var o=new Error(e);return s(o,t,n,r,i)}},6895:function(e,t,n){"use strict";var s=n(3044),r=n(8556),i=n(8041),o=n(1439);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=r.call(e,e.data,e.headers,e.transformRequest),e.headers=s.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),s.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return a(e),t.data=r.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=r.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},1935:function(e){"use strict";e.exports=function(e,t,n,s,r){return e.config=t,n&&(e.code=n),e.request=s,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},2937:function(e,t,n){"use strict";var s=n(3044);e.exports=function(e,t){t=t||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return s.isPlainObject(e)&&s.isPlainObject(t)?s.merge(e,t):s.isPlainObject(t)?s.merge({},t):s.isArray(t)?t.slice():t}function c(r){s.isUndefined(t[r])?s.isUndefined(e[r])||(n[r]=u(void 0,e[r])):n[r]=u(e[r],t[r])}s.forEach(r,(function(e){s.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),s.forEach(i,c),s.forEach(o,(function(r){s.isUndefined(t[r])?s.isUndefined(e[r])||(n[r]=u(void 0,e[r])):n[r]=u(void 0,t[r])})),s.forEach(a,(function(s){s in t?n[s]=u(e[s],t[s]):s in e&&(n[s]=u(void 0,e[s]))}));var d=r.concat(i).concat(o).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===d.indexOf(e)}));return s.forEach(l,c),n}},6955:function(e,t,n){"use strict";var s=n(8618);e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(s("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8556:function(e,t,n){"use strict";var s=n(3044),r=n(1439);e.exports=function(e,t,n){var i=this||r;return s.forEach(n,(function(n){e=n.call(i,e,t)})),e}},1439:function(e,t,n){"use strict";var s=n(3044),r=n(8868),i=n(1935),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(353)),u),transformRequest:[function(e,t){return r(t,"Accept"),r(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)?e:s.isArrayBufferView(e)?e.buffer:s.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):s.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(s.isString(e))try{return(t||JSON.parse)(e),s.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&s.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),s.forEach(["post","put","patch"],(function(e){c.headers[e]=s.merge(o)})),e.exports=c},3644:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),s=0;s<n.length;s++)n[s]=arguments[s];return e.apply(t,n)}}},8030:function(e,t,n){"use strict";var s=n(3044);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(s.isURLSearchParams(t))i=t.toString();else{var o=[];s.forEach(t,(function(e,t){null!=e&&(s.isArray(e)?t+="[]":e=[e],s.forEach(e,(function(e){s.isDate(e)?e=e.toISOString():s.isObject(e)&&(e=JSON.stringify(e)),o.push(r(t)+"="+r(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},8762:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2233:function(e,t,n){"use strict";var s=n(3044);e.exports=s.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),s.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),s.isString(r)&&a.push("path="+r),s.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},9192:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},5587:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},842:function(e,t,n){"use strict";var s=n(3044);e.exports=s.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var s=e;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=s.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},8868:function(e,t,n){"use strict";var s=n(3044);e.exports=function(e,t){s.forEach(e,(function(n,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[s])}))}},1875:function(e,t,n){"use strict";var s=n(3044),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,o={};return e?(s.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=s.trim(e.substr(0,i)).toLowerCase(),n=s.trim(e.substr(i+1)),t){if(o[t]&&r.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},783:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7525:function(e,t,n){"use strict";var s=n(4078),r={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){r[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={},o=s.version.split(".");function a(e,t){for(var n=t?t.split("."):o,s=e.split("."),r=0;r<3;r++){if(n[r]>s[r])return!0;if(n[r]<s[r])return!1}return!1}r.transitional=function(e,t,n){var r=t&&a(t);function o(e,t){return"[Axios v"+s.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,s,a){if(!1===e)throw new Error(o(s," has been removed in "+t));return r&&!i[s]&&(i[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var s=Object.keys(e),r=s.length;r-- >0;){var i=s[r],o=t[i];if(o){var a=e[i],u=void 0===a||o(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:r}},3044:function(e,t,n){"use strict";var s=n(3644),r=Object.prototype.toString;function i(e){return"[object Array]"===r.call(e)}function o(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==r.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===r.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===r.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===r.call(e)},isFile:function(e){return"[object File]"===r.call(e)},isBlob:function(e){return"[object Blob]"===r.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,s){u(t[s])&&u(n)?t[s]=e(t[s],n):u(n)?t[s]=e({},n):i(n)?t[s]=n.slice():t[s]=n}for(var s=0,r=arguments.length;s<r;s++)d(arguments[s],n);return t},extend:function(e,t,n){return d(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},4078:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},9859:function(e,t,n){"use strict";n.d(t,{Z:function(){return se}});class s{on(e,t){var n=this[e];n?n.push(t):this[e]=[t]}dispatch(e,t){var n=this[e];n&&n.forEach((e=>e(t)))}}function r(e){se.config.logging&&console.log(`Gist: ${e}`)}function i(e,t,n){const s={value:t,expiry:n};localStorage.setItem(e,JSON.stringify(s))}function o(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),s=new Date,r=new Date(n.expiry);return s.getTime()>r.getTime()?(localStorage.removeItem(e),null):n.value}function a(e){localStorage.removeItem(e)}var u,c=new Uint8Array(16);function d(){if(!u&&!(u="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 u(c)}var l=/^(?:[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 f=function(e){return"string"==typeof e&&l.test(e)},p=[],g=0;g<256;++g)p.push((g+256).toString(16).substr(1));var h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase();if(!f(n))throw TypeError("Stringified UUID is invalid");return n};var m=function(e,t,n){var s=(e=e||{}).random||(e.rng||d)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=s[r];return t}return h(s)};const v="gist.web.userToken",y="gist.web.guestUserToken",w="gist.web.usingGuestUserToken";function b(){return o(v)}function x(){var e=new Date;if(e.setDate(e.getDate()+365),null===b()){var t=o(y);null==t&&(t=m(),i(y,t,e),r(`Set guest user token "${t}" with expiry date set to 1 year from today`)),i(v,t,e),i(w,!0,e)}}var I=n(9644),E=n.n(I);const S={ENGINE_API_ENDPOINT:{prod:"https://engine.api.gist.build",dev:"https://engine.api.dev.gist.build",local:"http://engine.api.local.gist.build:82"},GIST_QUEUE_API_ENDPOINT:{prod:"https://gist-queue-consumer-api.cloud.gist.build",dev:"https://gist-queue-consumer-api.cloud.dev.gist.build",local:"http://api.local.gist.build:86"},GIST_VIEW_ENDPOINT:{prod:"https://renderer.gist.build/2.0",dev:"https://renderer.gist.build/2.0",local:"http://app.local.gist.build:8080/web"}};function k(){var e={"X-CIO-Site-Id":se.config.siteId,"X-CIO-Datacenter":se.config.dataCenter},t=b();return null!=t&&(e["X-Gist-Encoded-User-Token"]=btoa(t)),E().create({baseURL:S.GIST_QUEUE_API_ENDPOINT[se.config.env],timeout:2e4,headers:e})}function C(e){var t="",n="",s="",r=!1,i=!1,o=!1,a=!1,u=null,c=!1,d="#00000033",l=414,f=!1;return e.properties&&e.properties.gist&&(e.properties.gist.campaignId&&(u=e.properties.gist.campaignId),e.properties.gist.elementId&&(t=e.properties.gist.elementId,r=!0),e.properties.gist.routeRuleWeb&&(n=e.properties.gist.routeRuleWeb,i=!0),e.properties.gist.position&&(s=e.properties.gist.position,o=!0),e.properties.gist.scale&&(a=e.properties.gist.scale),e.properties.gist.overlayColor&&(d=e.properties.gist.overlayColor),e.properties.gist.messageWidth&&e.properties.gist.messageWidth>0&&(l=e.properties.gist.messageWidth,f=!0),e.properties.gist.persistent&&(c=!0)),{isEmbedded:r,elementId:t,hasRouteRule:i,routeRule:n,position:s,hasPosition:o,shouldScale:a,campaignId:u,messageWidth:l,overlayColor:d,persistent:c,hasCustomWidth:f}}const T=e=>new Promise((t=>setTimeout(t,e)));function R(e,t,s){var i=D(e);i?(j(e)||(i.style.height="0px"),i.innerHTML=function(e,t){const s=["x-gist-bottom","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"];var r=C(t),i=800;r.messageWidth>i&&(i=r.messageWidth);var o=r.messageWidth+"px";s.includes(r.elementId)&&!r.hasCustomWidth&&(o="100%");var a=n(2429);return a=(a=(a=(a=a.replace("'${topBottomMessageWidth}'",o)).replace("'${cornersMessageWidth}'",o)).replace("'${maxWidth}'",i+"px")).replace("${url}",e)}(t,s)):r(`Message could not be embedded, elementId ${e} not found.`)}function j(e){var t=D(e);if(t)return t.style&&t.style.height&&"0px"!=t.style.height}function N(e,t,n){var s=D(e);if(s){var r=s.style;if(t.height>0)if(t.height>window.innerHeight){var i=1-(t.height/window.innerHeight-1);n&&i>=.4?(r.height=`${t.height}px`,r.transform=`translateX(-50%) translateY(-50%) scale(${i})`):r.height=`${window.innerHeight}px`}else r.height=`${t.height}px`}}function $(e,t){document.body.insertAdjacentHTML("beforeend",function(e,t){var s=C(t),r=600;s.messageWidth>r&&(r=s.messageWidth);var i=n(2820);return i=(i=(i=(i=(i=i.replace("'${messageWidth}'",s.messageWidth+"px")).replace("'${maxWidth}'",r+"px")).replace("'${overlayColor}'",s.overlayColor)).replace("${url}",e)).replace("${instanceId}",t.instanceId)}(e,t))}function O(){var e=document.querySelector("#gist-embed-message");e&&e.parentNode.removeChild(e)}function P(){var e=document.querySelector("#gist-message");e&&e.classList.add("visible")}function D(e){try{var t=document.querySelector(`#${e}`);return t||null}catch{return null}}var A=["x-gist-top","x-gist-floating-top","x-gist-bottom","x-gist-floating-bottom","x-gist-floating-bottom-left","x-gist-floating-bottom-right","x-gist-floating-top-left","x-gist-floating-top-right"];var U=[];async function L(e){if(se.isDocumentVisible){if(se.overlayInstanceId)return r(`Message ${se.overlayInstanceId} already showing.`),null;var t=C(e);return e.instanceId=m(),e.overlay=!0,e.firstLoad=!0,e.shouldResizeHeight=!0,e.shouldScale=t.shouldScale,e.renderStartTime=(new Date).getTime(),se.overlayInstanceId=e.instanceId,se.currentMessages.push(e),H(e)}return r("Document hidden, not showing message now."),null}async function q(e,t){return se.isDocumentVisible?(e.instanceId=m(),e.overlay=!1,e.firstLoad=!0,e.shouldScale=!1,e.elementId=t,e.shouldResizeHeight=!j(t),e.renderStartTime=(new Date).getTime(),se.currentMessages.push(e),H(e,t)):(r("Document hidden, not showing message now."),null)}async function M(e){e?(se.messageDismissed(e),e.overlay?await B(!0,e):_(e)):r(`Message with instance id: ${instanceId} not found`)}async function W(e){var t=C(e);e?t.persistent&&(r("Persistent message dismissed, logging view"),await V(e)):r(`Message with instance id: ${instanceId} not found`)}function _(e){var t,n;G(e.instanceId),t=e.elementId,(n=D(t))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function B(e,t){G(t.instanceId),se.overlayInstanceId=null,e?await async function(){var e=document.querySelector("#gist-message");e&&(e.classList.remove("visible"),await T(300)),O()}():O(),0==se.currentMessages.length&&(window.removeEventListener("message",X),window.removeEventListener("touchstart",F))}function H(e,t=null){if(t&&function(e){var t=D(e);return!(!t||!t.classList.contains("gist-visible"))}(t))return r(`Message ${e.messageId} already showing in element ${t}.`),null;var n,s,i={endpoint:S.ENGINE_API_ENDPOINT[se.config.env],siteId:se.config.siteId,dataCenter:se.config.dataCenter,messageId:e.messageId,instanceId:e.instanceId,livePreview:!1,properties:e.properties},o=`${S.GIST_VIEW_ENDPOINT[se.config.env]}/index.html?options=${n=JSON.stringify(i),s=btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))),encodeURIComponent(s)}`;return window.addEventListener("message",X),window.addEventListener("touchstart",F),t?(A.includes(t)&&function(e){const t=document.createElement("div");t.id=e,"x-gist-top"===e?document.body.insertBefore(t,document.body.firstChild):document.body.insertAdjacentElement("beforeend",t);r("Top & bottom elements injected into page")}(t),R(t,o,e)):$(o,e),e}async function V(e){r(`Message shown, logging view for: ${e.messageId}`);var t={};200===(t=null!=e.queueId?await async function(e){try{return await k().post(`/api/v1/logs/queue/${e}`)}catch(e){return e.response}}(e.queueId):await async function(e){try{return await k().post(`/api/v1/logs/message/${e}`)}catch(e){return e.response}}(e.messageId)).status?r("Message view logged"):r(`Problem logging message: ${t.status}`)}function z(e){return se.currentMessages.find((t=>t.instanceId===e))}function G(e){se.currentMessages=se.currentMessages.filter((t=>t.instanceId!==e))}function J(e,t){G(e),se.currentMessages.push(t)}function F(e){}async function X(e){if(e.data.gist){var t=e.data.gist.instanceId,n=z(t);if(!n)return;var s=C(n);switch(e.data.gist.method){case"routeLoaded":var i=.001*((new Date).getTime()-n.renderStartTime);r(`Engine render for message: ${n.messageId} timer elapsed in ${i.toFixed(3)} seconds`),n.currentRoute=e.data.gist.parameters.route,n.firstLoad&&(U.push(n),n.overlay?function(e){var t=document.querySelector("#gist-overlay");if(t){t.classList.add("visible");var n=document.querySelector("#gist-message");e.position?n.classList.add(e.position):n.classList.add("center"),setTimeout(P,100)}else O()}(n):(l=n.elementId,(f=D(l))&&f.classList.add("gist-visible")),se.messageShown(n),s.persistent?r("Persistent message shown, skipping logging view"):await V(n),n.firstLoad=!1),J(t,n);break;case"tap":var o=e.data.gist.parameters.action,a=e.data.gist.parameters.name;if(se.messageAction(n,o,a),e.data.gist.parameters.system&&!s.persistent){await M(n);break}try{if((d=new URL(o))&&"gist:"===d.protocol)switch(d.href.replace("gist://","").split("?")[0]){case"close":await M(n),await W(n),await te();break;case"showMessage":var u=d.searchParams.get("messageId"),c=d.searchParams.get("properties");u&&(c&&(c=JSON.parse(atob(c))),await se.showMessage({messageId:u,properties:c}));break;case"loadPage":var d;(d=d.href.substring(d.href.indexOf("?url=")+5))&&(d.startsWith("https://")||d.startsWith("http://")||d.startsWith("/")?window.location.href=d:window.location.href=window.location+d)}}catch(e){}break;case"routeChanged":n.currentRoute=e.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),J(t,n),r(`Route changed to: ${n.currentRoute}`);break;case"sizeChanged":r(`Size Changed Width: ${e.data.gist.parameters.width} - Height: ${e.data.gist.parameters.height}`),n.elementId&&n.shouldResizeHeight?N(n.elementId,e.data.gist.parameters,n.shouldScale):N("gist-message",e.data.gist.parameters,n.shouldScale);break;case"error":case"routeError":se.messageError(n),se.overlayInstanceId?B(!1,n):_(n)}}var l,f}const Q="gist.web.userQueue";var Z=(e,t)=>e().then((e=>new Promise((t=>setTimeout(t,e))))(t).then((()=>Z(e,t)))),K=!1,Y=[];async function ee(){K?await te():(!async function(){var e=`G${m().substring(0,8)}`,t=document.createElement("div");t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),await T(5e3),q({messageId:""},e)}(),b()?(r("Queue watcher started"),K=!0,Z((()=>new Promise((()=>async function(){if(b())if(se.isDocumentVisible){var e=await async function(){try{return await k().post("/api/v1/users",{})}catch(e){return e.response}}(),t=[];if(e){if(200===e.status||204===e.status){var n=new Date((new Date).getTime()+6e4);i(Q,e.data,n),t=e.data}else 304===e.status&&(t=o(Q));t&&t.length>0?(r(`Message queue checked for user ${b()}, ${t.length} messages found.`),Y=t,await te()):(Y=[],r("No messages for user token."))}else r("There was an error while checking message queue.")}else r("Document not visible, skipping queue check.");else r("User token reset, skipping queue check.")}()))),1e4)):r("User token not setup, queue not started."))}async function te(){r(`Messages in local queue: ${Y.length}`);var e=[],t=Y.sort(((e,t)=>e.priority-t.priority));for(const i of t){if(!await ne(i)){var n=e.find((e=>e.queueId===i.queueId)),s=se.currentMessages.find((e=>e.queueId===i.queueId));n||s?r(`Message with queueId: ${i.queueId} already in queue, discarding.`):e.push(i)}}Y=e}async function ne(e){if(!function(e){return void 0!==U.find((t=>t.queueId===e.queueId))}(e)){var t=C(e);if(t.hasRouteRule){var n=se.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var s=t.routeRule;if(r(`Verifying route against rule: ${s}`),!new RegExp(s).test(n))return r(`Route ${n} does not match rule.`),!1}return t.hasPosition&&(e.position=t.position),t.isEmbedded?await q(e,t.elementId):await L(e)}r(`Message with ${e.queueId} has been shown before, skipping.`)}var se=class{static async setup(e){this.events=new s,this.config={useGuestSession:void 0!==e.useGuestSession&&e.useGuestSession,siteId:e.siteId,dataCenter:e.dataCenter,env:void 0===e.env?"prod":e.env,logging:void 0!==e.logging&&e.logging,experiments:void 0!==e.experiments&&e.experiments},this.currentMessages=[],this.overlayInstanceId=null,this.currentRoute=null,this.isDocumentVisible=!0,r(`Setup complete on ${this.config.env} environment.`),this.config.useGuestSession&&x(),await ee(),document.addEventListener("visibilitychange",(async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await te())}),!1)}static async setCurrentRoute(e){this.currentRoute=e,r(`Current route set to: ${e}`),await te()}static async setUserToken(e,t){!function(e,t){void 0===t&&(t=new Date).setDate(t.getDate()+30),i(v,e,t),a(w),r(`Set user token "${e}" with expiry date set to ${t}`)}(e,t),await ee()}static async clearUserToken(){a(v),r("Cleared user token"),this.config.useGuestSession&&x(),await ee()}static async dismissMessage(e){var t=z(e);await M(t),await W(t),await te()}static async embedMessage(e,t){return(await q(e,t)).instanceId}static async showMessage(e){var t=await L(e);return t?t.instanceId:null}static messageShown(e){r(`Message shown: ${e.messageId}`),this.events.dispatch("messageShown",e)}static messageDismissed(e){null!==e&&(r(`Message dismissed: ${e.messageId}`),this.events.dispatch("messageDismissed",e))}static messageError(e){r(`Message error: ${e.messageId}`),this.events.dispatch("messageError",e)}static messageAction(e,t,n){r(`Message action: ${e.currentRoute}, ${t} with name ${n} on ${e.instanceId}`),this.events.dispatch("messageAction",{message:e,action:t,name:n})}}},6646:function(e,t,n){const s=n(9859).Z;e.exports=s},2429:function(e){e.exports='<div id="gist-embed"> <style>#x-gist-floating-top,#x-gist-floating-top-left,#x-gist-floating-top-right{position:fixed;top:0;z-index:1000000}#x-gist-floating-bottom,#x-gist-floating-bottom-left,#x-gist-floating-bottom-right{position:fixed;bottom:0;z-index:1000000}#x-gist-bottom,#x-gist-floating-bottom,#x-gist-floating-top,#x-gist-top{left:50%;transform:translate(-50%,0);width:\'${topBottomMessageWidth}\'}#x-gist-floating-bottom-left,#x-gist-floating-bottom-right,#x-gist-floating-top-left,#x-gist-floating-top-right{width:\'${cornersMessageWidth}\'}#x-gist-floating-bottom-right,#x-gist-floating-top-right{right:0}#gist-embed{position:relative;height:100%;width:100%}#gist-embed-container{position:relative;height:100%;width:100%}#gist-embed-container .gist-frame{height:100%;width:100%;border:none}@media (max-width:\'${maxWidth}\'){#x-gist-bottom,#x-gist-floating-bottom,#x-gist-floating-bottom-left,#x-gist-floating-bottom-right,#x-gist-floating-top,#x-gist-floating-top-left,#x-gist-floating-top-right{width:100%}}</style> <div id="gist-embed-container"> <iframe class="gist-frame" src="${url}"></iframe> </div> </div>'},2820:function(e){e.exports='<div id="gist-embed-message"> <style>#gist-overlay.background{position:fixed;z-index:9999999998;left:0;top:0;width:100%;height:100%;background-color:\'${overlayColor}\';visibility:hidden}#gist-overlay.background.visible{visibility:visible}#gist-overlay.background.is-blacked-out{display:block}#gist-message{width:\'${messageWidth}\';position:absolute;border:none;opacity:0;transition:opacity .3s ease-in-out;z-index:9999999999;left:50%;transform:translateX(-50%)}#gist-message.visible{opacity:1}#gist-message.center{transform:translate(-50%,-50%);top:50%}#gist-message.bottom{bottom:0}#gist-message.top{top:0}@media (max-width:\'${maxWidth}\'){#gist-message{width:100%}}</style> <div id="gist-overlay" class="background"> <iframe id="gist-message" class="message" src="${url}"></iframe> </div> </div>'}}]);
|
|
1
|
+
(self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[646],{9644:function(e,t,n){e.exports=n(5644)},353:function(e,t,n){"use strict";var s=n(3044),r=n(6955),i=n(2233),o=n(8030),a=n(7948),u=n(1875),c=n(842),d=n(8618);e.exports=function(e){return new Promise((function(t,n){var l=e.data,f=e.headers,p=e.responseType;s.isFormData(l)&&delete f["Content-Type"];var g=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var v=a(e.baseURL,e.url);function y(){if(g){var s="getAllResponseHeaders"in g?u(g.getAllResponseHeaders()):null,i={data:p&&"text"!==p&&"json"!==p?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:s,config:e,request:g};r(t,n,i),g=null}}if(g.open(e.method.toUpperCase(),o(v,e.params,e.paramsSerializer),!0),g.timeout=e.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(y)},g.onabort=function(){g&&(n(d("Request aborted",e,"ECONNABORTED",g)),g=null)},g.onerror=function(){n(d("Network Error",e,null,g)),g=null},g.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(d(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},s.isStandardBrowserEnv()){var w=(e.withCredentials||c(v))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;w&&(f[e.xsrfHeaderName]=w)}"setRequestHeader"in g&&s.forEach(f,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete f[t]:g.setRequestHeader(t,e)})),s.isUndefined(e.withCredentials)||(g.withCredentials=!!e.withCredentials),p&&"json"!==p&&(g.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&g.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&g.upload&&g.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){g&&(g.abort(),n(e),g=null)})),l||(l=null),g.send(l)}))}},5644:function(e,t,n){"use strict";var s=n(3044),r=n(3644),i=n(2215),o=n(2937);function a(e){var t=new i(e),n=r(i.prototype.request,t);return s.extend(n,i.prototype,t),s.extend(n,t),n}var u=a(n(1439));u.Axios=i,u.create=function(e){return a(o(u.defaults,e))},u.Cancel=n(6714),u.CancelToken=n(4089),u.isCancel=n(8041),u.all=function(e){return Promise.all(e)},u.spread=n(783),u.isAxiosError=n(5587),e.exports=u,e.exports.default=u},6714:function(e){"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4089:function(e,t,n){"use strict";var s=n(6714);function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new s(e),t(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r((function(t){e=t})),cancel:e}},e.exports=r},8041:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:function(e,t,n){"use strict";var s=n(3044),r=n(8030),i=n(946),o=n(6895),a=n(2937),u=n(7525),c=u.validators;function d(e){this.defaults=e,this.interceptors={request:new i,response:new i}}d.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var n=[],s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var r,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!s){var d=[o,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(i),r=Promise.resolve(e);d.length;)r=r.then(d.shift(),d.shift());return r}for(var l=e;n.length;){var f=n.shift(),p=n.shift();try{l=f(l)}catch(e){p(e);break}}try{r=o(l)}catch(e){return Promise.reject(e)}for(;i.length;)r=r.then(i.shift(),i.shift());return r},d.prototype.getUri=function(e){return e=a(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},s.forEach(["delete","get","head","options"],(function(e){d.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),s.forEach(["post","put","patch"],(function(e){d.prototype[e]=function(t,n,s){return this.request(a(s||{},{method:e,url:t,data:n}))}})),e.exports=d},946:function(e,t,n){"use strict";var s=n(3044);function r(){this.handlers=[]}r.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){s.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=r},7948:function(e,t,n){"use strict";var s=n(9192),r=n(8762);e.exports=function(e,t){return e&&!s(t)?r(e,t):t}},8618:function(e,t,n){"use strict";var s=n(1935);e.exports=function(e,t,n,r,i){var o=new Error(e);return s(o,t,n,r,i)}},6895:function(e,t,n){"use strict";var s=n(3044),r=n(8556),i=n(8041),o=n(1439);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=r.call(e,e.data,e.headers,e.transformRequest),e.headers=s.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),s.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return a(e),t.data=r.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=r.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},1935:function(e){"use strict";e.exports=function(e,t,n,s,r){return e.config=t,n&&(e.code=n),e.request=s,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},2937:function(e,t,n){"use strict";var s=n(3044);e.exports=function(e,t){t=t||{};var n={},r=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function u(e,t){return s.isPlainObject(e)&&s.isPlainObject(t)?s.merge(e,t):s.isPlainObject(t)?s.merge({},t):s.isArray(t)?t.slice():t}function c(r){s.isUndefined(t[r])?s.isUndefined(e[r])||(n[r]=u(void 0,e[r])):n[r]=u(e[r],t[r])}s.forEach(r,(function(e){s.isUndefined(t[e])||(n[e]=u(void 0,t[e]))})),s.forEach(i,c),s.forEach(o,(function(r){s.isUndefined(t[r])?s.isUndefined(e[r])||(n[r]=u(void 0,e[r])):n[r]=u(void 0,t[r])})),s.forEach(a,(function(s){s in t?n[s]=u(e[s],t[s]):s in e&&(n[s]=u(void 0,e[s]))}));var d=r.concat(i).concat(o).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===d.indexOf(e)}));return s.forEach(l,c),n}},6955:function(e,t,n){"use strict";var s=n(8618);e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(s("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8556:function(e,t,n){"use strict";var s=n(3044),r=n(1439);e.exports=function(e,t,n){var i=this||r;return s.forEach(n,(function(n){e=n.call(i,e,t)})),e}},1439:function(e,t,n){"use strict";var s=n(3044),r=n(8868),i=n(1935),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(353)),u),transformRequest:[function(e,t){return r(t,"Accept"),r(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)?e:s.isArrayBufferView(e)?e.buffer:s.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):s.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(s.isString(e))try{return(t||JSON.parse)(e),s.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&s.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),s.forEach(["post","put","patch"],(function(e){c.headers[e]=s.merge(o)})),e.exports=c},3644:function(e){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),s=0;s<n.length;s++)n[s]=arguments[s];return e.apply(t,n)}}},8030:function(e,t,n){"use strict";var s=n(3044);function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(s.isURLSearchParams(t))i=t.toString();else{var o=[];s.forEach(t,(function(e,t){null!=e&&(s.isArray(e)?t+="[]":e=[e],s.forEach(e,(function(e){s.isDate(e)?e=e.toISOString():s.isObject(e)&&(e=JSON.stringify(e)),o.push(r(t)+"="+r(e))})))})),i=o.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},8762:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},2233:function(e,t,n){"use strict";var s=n(3044);e.exports=s.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),s.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),s.isString(r)&&a.push("path="+r),s.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},9192:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},5587:function(e){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},842:function(e,t,n){"use strict";var s=n(3044);e.exports=s.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var s=e;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=s.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},8868:function(e,t,n){"use strict";var s=n(3044);e.exports=function(e,t){s.forEach(e,(function(n,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[s])}))}},1875:function(e,t,n){"use strict";var s=n(3044),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,o={};return e?(s.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=s.trim(e.substr(0,i)).toLowerCase(),n=s.trim(e.substr(i+1)),t){if(o[t]&&r.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},783:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7525:function(e,t,n){"use strict";var s=n(4078),r={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){r[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={},o=s.version.split(".");function a(e,t){for(var n=t?t.split("."):o,s=e.split("."),r=0;r<3;r++){if(n[r]>s[r])return!0;if(n[r]<s[r])return!1}return!1}r.transitional=function(e,t,n){var r=t&&a(t);function o(e,t){return"[Axios v"+s.version+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,s,a){if(!1===e)throw new Error(o(s," has been removed in "+t));return r&&!i[s]&&(i[s]=!0,console.warn(o(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,a)}},e.exports={isOlderVersion:a,assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var s=Object.keys(e),r=s.length;r-- >0;){var i=s[r],o=t[i];if(o){var a=e[i],u=void 0===a||o(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:r}},3044:function(e,t,n){"use strict";var s=n(3644),r=Object.prototype.toString;function i(e){return"[object Array]"===r.call(e)}function o(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==r.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===r.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.call(null,e[r],r,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===r.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:o,isDate:function(e){return"[object Date]"===r.call(e)},isFile:function(e){return"[object File]"===r.call(e)},isBlob:function(e){return"[object Blob]"===r.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,s){u(t[s])&&u(n)?t[s]=e(t[s],n):u(n)?t[s]=e({},n):i(n)?t[s]=n.slice():t[s]=n}for(var s=0,r=arguments.length;s<r;s++)d(arguments[s],n);return t},extend:function(e,t,n){return d(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},4078:function(e){"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},7447:function(e,t,n){"use strict";n.d(t,{Z:function(){return ce}});class s{on(e,t){var n=this[e];n?n.push(t):this[e]=[t]}dispatch(e,t){var n=this[e];n&&n.forEach((e=>e(t)))}}function r(e){ce.config.logging&&console.log(`Gist: ${e}`)}function i(e,t,n){const s={value:t,expiry:n};localStorage.setItem(e,JSON.stringify(s))}function o(e){const t=localStorage.getItem(e);if(!t)return null;const n=JSON.parse(t),s=new Date,r=new Date(n.expiry);return s.getTime()>r.getTime()?(localStorage.removeItem(e),null):n.value}function a(e){localStorage.removeItem(e)}var u,c=new Uint8Array(16);function d(){if(!u&&!(u="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 u(c)}var l=/^(?:[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 f=function(e){return"string"==typeof e&&l.test(e)},p=[],g=0;g<256;++g)p.push((g+256).toString(16).substr(1));var h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase();if(!f(n))throw TypeError("Stringified UUID is invalid");return n};var m=function(e,t,n){var s=(e=e||{}).random||(e.rng||d)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=s[r];return t}return h(s)};const v="gist.web.userToken",y="gist.web.guestUserToken",w="gist.web.usingGuestUserToken";function b(){return o(v)}function x(){var e=new Date;if(e.setDate(e.getDate()+365),null===b()){var t=o(y);null==t&&(t=m(),i(y,t,e),r(`Set guest user token "${t}" with expiry date set to 1 year from today`)),i(v,t,e),i(w,!0,e)}}var I=n(9644),E=n.n(I);const S={ENGINE_API_ENDPOINT:{prod:"https://engine.api.gist.build",dev:"https://engine.api.dev.gist.build",local:"http://engine.api.local.gist.build:82"},GIST_QUEUE_API_ENDPOINT:{prod:"https://gist-queue-consumer-api.cloud.gist.build",dev:"https://gist-queue-consumer-api.cloud.dev.gist.build",local:"http://api.local.gist.build:86"},GIST_VIEW_ENDPOINT:{prod:"https://renderer.gist.build/2.0",dev:"https://renderer.gist.build/2.0",local:"http://app.local.gist.build:8080/web"}};function k(){var e={"X-CIO-Site-Id":ce.config.siteId,"X-CIO-Datacenter":ce.config.dataCenter},t=b();return null!=t&&(e["X-Gist-Encoded-User-Token"]=btoa(t)),E().create({baseURL:S.GIST_QUEUE_API_ENDPOINT[ce.config.env],timeout:2e4,headers:e})}var T=600,C=!1;const R="gist.web.userQueueNextPullCheck";async function j(){var e;try{if(!C){var t=(new Date).getTime();C=!0,e=await k().post(`/api/v1/users?timestamp=${t}`,{})}}catch(t){t.response?e=t.response:r(`Error getting user queue: ${t}`)}finally{return C=!1,function(e){if(e&&e.headers){var t=e.headers["x-gist-queue-polling-interval"];t&&t>0&&(T=t)}var n=new Date((new Date).getTime()+1e3*T);i(R,T,n)}(e),e}}function N(e){var t="",n="",s="",r=!1,i=!1,o=!1,a=!1,u=null,c=!1,d="#00000033",l=414,f=!1;return e.properties&&e.properties.gist&&(e.properties.gist.campaignId&&(u=e.properties.gist.campaignId),e.properties.gist.elementId&&(t=e.properties.gist.elementId,r=!0),e.properties.gist.routeRuleWeb&&(n=e.properties.gist.routeRuleWeb,i=!0),e.properties.gist.position&&(s=e.properties.gist.position,o=!0),e.properties.gist.scale&&(a=e.properties.gist.scale),e.properties.gist.overlayColor&&(d=e.properties.gist.overlayColor),e.properties.gist.messageWidth&&e.properties.gist.messageWidth>0&&(l=e.properties.gist.messageWidth,f=!0),e.properties.gist.persistent&&(c=!0)),{isEmbedded:r,elementId:t,hasRouteRule:i,routeRule:n,position:s,hasPosition:o,shouldScale:a,campaignId:u,messageWidth:l,overlayColor:d,persistent:c,hasCustomWidth:f}}const O=e=>new Promise((t=>setTimeout(t,e)));function $(e,t,n){var s=L(e);s?(P(e)||(s.style.height="0px"),s.innerHTML=function(e,t){return function(e,t){var n=800;e.messageWidth>n&&(n=e.messageWidth);var s=e.messageWidth+"px";return["x-gist-top","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"].includes(e.elementId)&&!e.hasCustomWidth&&(s="100%"),`\n <div id="gist-embed">\n <style>\n #x-gist-floating-top, #x-gist-floating-top-left, #x-gist-floating-top-right {\n position: fixed;\n top: 0px;\n z-index: 1000000;\n }\n #x-gist-floating-bottom, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n position: fixed;\n bottom: 0px;\n z-index: 1000000;\n }\n #x-gist-bottom, #x-gist-top, #x-gist-floating-top, #x-gist-floating-bottom {\n left: 50%;\n transform: translate(-50%, 0%);\n width: ${s};\n }\n #x-gist-floating-top-left, #x-gist-floating-top-right, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n width: ${s};\n }\n #x-gist-floating-top-right, #x-gist-floating-bottom-right {\n right: 0px;\n }\n #gist-embed {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container {\n position: relative;\n height: 100%;\n width: 100%;\n }\n #gist-embed-container .gist-frame {\n height: 100%;\n width: 100%;\n border: none;\n }\n @media (max-width: ${n}px) {\n #x-gist-top, #x-gist-bottom, #x-gist-floating-top, #x-gist-floating-bottom, #x-gist-floating-top-left, #x-gist-floating-top-right, #x-gist-floating-bottom-left, #x-gist-floating-bottom-right {\n width: 100%;\n }\n }\n </style>\n <div id="gist-embed-container">\n <iframe class="gist-frame" src="${t}"></iframe>\n </div>\n </div>`}(N(t),e)}(t,n)):r(`Message could not be embedded, elementId ${e} not found.`)}function P(e){var t=L(e);if(t)return t.style&&t.style.height&&"0px"!=t.style.height}function D(e,t,n){var s=L(e);if(s){var r=s.style;if(t.height>0)if(t.height>window.innerHeight){var i=1-(t.height/window.innerHeight-1);n&&i>=.4?(r.height=`${t.height}px`,r.transform=`translateX(-50%) translateY(-50%) scale(${i})`):r.height=`${window.innerHeight}px`}else r.height=`${t.height}px`}}function q(e,t){document.body.insertAdjacentHTML("beforeend",function(e,t){return function(e,t){var n=600;return e.messageWidth>n&&(n=e.messageWidth),`\n <div id="gist-embed-message">\n <style>\n #gist-overlay.background {\n position: fixed;\n z-index: 9999999998;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: ${e.overlayColor};\n visibility: hidden;\n }\n #gist-overlay.background.visible {\n visibility: visible;\n }\n #gist-overlay.background.is-blacked-out {\n display: block;\n }\n #gist-message {\n width: ${e.messageWidth}px;\n position: absolute;\n border: none;\n opacity: 0;\n transition: opacity 0.3s ease-in-out;\n z-index: 9999999999;\n left: 50%;\n transform: translateX(-50%);\n }\n #gist-message.visible {\n opacity: 1;\n pointer-events: auto;\n }\n #gist-message.center {\n transform: translate(-50%, -50%);\n top: 50%;\n }\n #gist-message.bottom {\n bottom: 0;\n }\n #gist-message.top {\n top: 0;\n }\n @media (max-width: ${n}px) {\n #gist-message {\n width: 100%;\n }\n }\n </style>\n <div id="gist-overlay" class="background">\n <iframe id="gist-message" class="message" src="${t}"></iframe>\n </div>\n </div>`}(N(t),e)}(e,t))}function A(){var e=document.querySelector("#gist-embed-message");e&&e.parentNode.removeChild(e)}function U(){var e=document.querySelector("#gist-message");e&&e.classList.add("visible")}function L(e){try{var t=document.querySelector(`#${e}`);return t||null}catch{return null}}var M=["x-gist-top","x-gist-floating-top","x-gist-bottom","x-gist-floating-bottom","x-gist-floating-bottom-left","x-gist-floating-bottom-right","x-gist-floating-top-left","x-gist-floating-top-right"];var _=[];async function B(e){if(ce.isDocumentVisible){if(ce.overlayInstanceId)return r(`Message ${ce.overlayInstanceId} already showing.`),null;var t=N(e);return e.instanceId=m(),e.overlay=!0,e.firstLoad=!0,e.shouldResizeHeight=!0,e.shouldScale=t.shouldScale,e.renderStartTime=(new Date).getTime(),ce.overlayInstanceId=e.instanceId,ce.currentMessages.push(e),J(e)}return r("Document hidden, not showing message now."),null}async function W(e,t){return ce.isDocumentVisible?(e.instanceId=m(),e.overlay=!1,e.firstLoad=!0,e.shouldScale=!1,e.elementId=t,e.shouldResizeHeight=!P(t),e.renderStartTime=(new Date).getTime(),ce.currentMessages.push(e),J(e,t)):(r("Document hidden, not showing message now."),null)}async function H(e){e?(ce.messageDismissed(e),e.overlay?await G(!0,e):z(e)):r(`Message with instance id: ${instanceId} not found`)}async function V(e){var t=N(e);e?t.persistent&&(r("Persistent message dismissed, logging view"),await F(e)):r(`Message with instance id: ${instanceId} not found`)}function z(e){var t,n;Q(e.instanceId),t=e.elementId,(n=L(t))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function G(e,t){Q(t.instanceId),ce.overlayInstanceId=null,e?await async function(){var e=document.querySelector("#gist-message");e&&(e.classList.remove("visible"),await O(300)),A()}():A(),0==ce.currentMessages.length&&(window.removeEventListener("message",Y),window.removeEventListener("touchstart",K))}function J(e,t=null){if(t&&function(e){var t=L(e);return!(!t||!t.classList.contains("gist-visible"))}(t))return r(`Message ${e.messageId} already showing in element ${t}.`),null;var n,s,i={endpoint:S.ENGINE_API_ENDPOINT[ce.config.env],siteId:ce.config.siteId,dataCenter:ce.config.dataCenter,messageId:e.messageId,instanceId:e.instanceId,livePreview:!1,properties:e.properties},o=`${S.GIST_VIEW_ENDPOINT[ce.config.env]}/index.html?options=${n=JSON.stringify(i),s=btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))),encodeURIComponent(s)}`;return window.addEventListener("message",Y),window.addEventListener("touchstart",K),t?(M.includes(t)&&function(e){const t=document.createElement("div");t.id=e,"x-gist-top"===e?document.body.insertBefore(t,document.body.firstChild):document.body.insertAdjacentElement("beforeend",t);r("Top & bottom elements injected into page")}(t),$(t,o,e)):q(o,e),e}async function F(e){r(`Message shown, logging view for: ${e.messageId}`);var t={};null!=e.queueId?(!function(e){_.push(e);var t=ue();null!=t&&t.length>0&&ae(t.filter((t=>t.queueId!==e.queueId)))}(e),t=await async function(e){try{return await k().post(`/api/v1/logs/queue/${e}`)}catch(e){return e.response}}(e.queueId)):t=await async function(e){try{return await k().post(`/api/v1/logs/message/${e}`)}catch(e){return e.response}}(e.messageId),200===t.status?r("Message view logged"):r(`Problem logging message: ${t.status}`)}function X(e){return ce.currentMessages.find((t=>t.instanceId===e))}function Q(e){ce.currentMessages=ce.currentMessages.filter((t=>t.instanceId!==e))}function Z(e,t){Q(e),ce.currentMessages.push(t)}function K(e){}async function Y(e){if(e.data.gist){var t=e.data.gist.instanceId,n=X(t);if(!n)return;var s=N(n);switch(e.data.gist.method){case"routeLoaded":var i=.001*((new Date).getTime()-n.renderStartTime);r(`Engine render for message: ${n.messageId} timer elapsed in ${i.toFixed(3)} seconds`),n.currentRoute=e.data.gist.parameters.route,n.firstLoad&&(n.overlay?function(e){var t=document.querySelector("#gist-overlay");if(t){t.classList.add("visible");var n=document.querySelector("#gist-message");e.position?n.classList.add(e.position):n.classList.add("center"),setTimeout(U,100)}else A()}(n):(l=n.elementId,(f=L(l))&&f.classList.add("gist-visible")),ce.messageShown(n),s.persistent?r("Persistent message shown, skipping logging view"):await F(n),n.firstLoad=!1),Z(t,n);break;case"tap":var o=e.data.gist.parameters.action,a=e.data.gist.parameters.name;if(ce.messageAction(n,o,a),e.data.gist.parameters.system&&!s.persistent){await H(n);break}try{if((d=new URL(o))&&"gist:"===d.protocol)switch(d.href.replace("gist://","").split("?")[0]){case"close":await H(n),await V(n),await ie();break;case"showMessage":var u=d.searchParams.get("messageId"),c=d.searchParams.get("properties");u&&(c&&(c=JSON.parse(atob(c))),await ce.showMessage({messageId:u,properties:c}));break;case"loadPage":var d;(d=d.href.substring(d.href.indexOf("?url=")+5))&&(d.startsWith("https://")||d.startsWith("http://")||d.startsWith("/")?window.location.href=d:window.location.href=window.location+d)}}catch(e){}break;case"routeChanged":n.currentRoute=e.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),Z(t,n),r(`Route changed to: ${n.currentRoute}`);break;case"sizeChanged":r(`Size Changed Width: ${e.data.gist.parameters.width} - Height: ${e.data.gist.parameters.height}`),n.elementId&&n.shouldResizeHeight?D(n.elementId,e.data.gist.parameters,n.shouldScale):D("gist-message",e.data.gist.parameters,n.shouldScale);break;case"error":case"routeError":ce.messageError(n),ce.overlayInstanceId?G(!1,n):z(n)}}var l,f}const ee="gist.web.userQueue";var te=(e,t)=>e().then((e=>new Promise((t=>setTimeout(t,e))))(t).then((()=>te(e,t)))),ne=!1,se=[];async function re(){ne?await ie():(!async function(){var e=`G${m().substring(0,8)}`,t=document.createElement("div");t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),await O(5e3),W({messageId:""},e)}(),b()?(r("Queue watcher started"),ne=!0,te((()=>new Promise((()=>async function(){if(b())if(ce.isDocumentVisible)if(null===o(R)){var e=await j(),t=[];e?(200===e.status||204===e.status?(r("200 response, updating local store."),ae(t=e.data)):304===e.status&&(r("304 response, using local store."),t=ue()),t&&t.length>0?(r(`Message queue checked for user ${b()}, ${t.length} messages found.`),se=t,await ie()):(se=[],r("No messages for user token."))):r("There was an error while checking message queue.")}else r("Next queue pull scheduled for later");else r("Document not visible, skipping queue check.");else r("User token reset, skipping queue check.")}()))),1e3)):r("User token not setup, queue not started."))}async function ie(){r(`Messages in local queue: ${se.length}`);var e=[],t=se.sort(((e,t)=>e.priority-t.priority));for(const i of t){if(!await oe(i)){var n=e.find((e=>e.queueId===i.queueId)),s=ce.currentMessages.find((e=>e.queueId===i.queueId));n||s?r(`Message with queueId: ${i.queueId} already in queue, discarding.`):e.push(i)}}se=e}async function oe(e){if(!function(e){return void 0!==_.find((t=>t.queueId===e.queueId))}(e)){var t=N(e);if(t.hasRouteRule){var n=ce.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var s=t.routeRule;if(r(`Verifying route against rule: ${s}`),!new RegExp(s).test(n))return r(`Route ${n} does not match rule.`),!1}return t.hasPosition&&(e.position=t.position),t.isEmbedded?await W(e,t.elementId):await B(e)}r(`Message with ${e.queueId} has been shown before, skipping.`)}function ae(e){var t=new Date((new Date).getTime()+36e5);i(ee,e,t)}function ue(){return o(ee)}var ce=class{static async setup(e){this.events=new s,this.config={useGuestSession:void 0!==e.useGuestSession&&e.useGuestSession,siteId:e.siteId,dataCenter:e.dataCenter,env:void 0===e.env?"prod":e.env,logging:void 0!==e.logging&&e.logging,experiments:void 0!==e.experiments&&e.experiments},this.currentMessages=[],this.overlayInstanceId=null,this.currentRoute=null,this.isDocumentVisible=!0,r(`Setup complete on ${this.config.env} environment.`),this.config.useGuestSession&&x(),await re(),document.addEventListener("visibilitychange",(async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await ie())}),!1)}static async setCurrentRoute(e){this.currentRoute=e,r(`Current route set to: ${e}`),await ie()}static async setUserToken(e,t){!function(e,t){void 0===t&&(t=new Date).setDate(t.getDate()+30),i(v,e,t),a(w),r(`Set user token "${e}" with expiry date set to ${t}`)}(e,t),await re()}static async clearUserToken(){a(v),r("Cleared user token"),this.config.useGuestSession&&x(),await re()}static async dismissMessage(e){var t=X(e);await H(t),await V(t),await ie()}static async embedMessage(e,t){var n=await W(e,t);return n?n.instanceId:null}static async showMessage(e){var t=await B(e);return t?t.instanceId:null}static messageShown(e){r(`Message shown: ${e.messageId}`),this.events.dispatch("messageShown",e)}static messageDismissed(e){null!==e&&(r(`Message dismissed: ${e.messageId}`),this.events.dispatch("messageDismissed",e))}static messageError(e){r(`Message error: ${e.messageId}`),this.events.dispatch("messageError",e)}static messageAction(e,t,n){r(`Message action: ${e.currentRoute}, ${t} with name ${n} on ${e.instanceId}`),this.events.dispatch("messageAction",{message:e,action:t,name:n})}}},6646:function(e,t,n){const s=n(7447).Z;e.exports=s}}]);
|
package/dist/umd/646.js.gz
CHANGED
|
Binary file
|