@customerio/cdp-analytics-browser 0.2.3 → 0.3.1

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.
Files changed (82) hide show
  1. package/dist/cjs/browser/index.js +3 -0
  2. package/dist/cjs/browser/index.js.map +1 -1
  3. package/dist/cjs/browser/standalone-analytics.js +7 -5
  4. package/dist/cjs/browser/standalone-analytics.js.map +1 -1
  5. package/dist/cjs/browser/standalone-interface.js +3 -0
  6. package/dist/cjs/browser/standalone-interface.js.map +1 -0
  7. package/dist/cjs/browser/standalone.js +7 -0
  8. package/dist/cjs/browser/standalone.js.map +1 -1
  9. package/dist/cjs/core/analytics/index.js +2 -1
  10. package/dist/cjs/core/analytics/index.js.map +1 -1
  11. package/dist/cjs/core/buffer/snippet.js +4 -2
  12. package/dist/cjs/core/buffer/snippet.js.map +1 -1
  13. package/dist/cjs/generated/version.js +1 -1
  14. package/dist/cjs/index.js +3 -0
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/cjs/lib/global-analytics-helper.js +34 -0
  17. package/dist/cjs/lib/global-analytics-helper.js.map +1 -0
  18. package/dist/cjs/lib/parse-cdn.js +19 -12
  19. package/dist/cjs/lib/parse-cdn.js.map +1 -1
  20. package/dist/cjs/plugins/in-app-plugin/index.js +28 -18
  21. package/dist/cjs/plugins/in-app-plugin/index.js.map +1 -1
  22. package/dist/pkg/browser/index.js +3 -0
  23. package/dist/pkg/browser/index.js.map +1 -1
  24. package/dist/pkg/browser/standalone-analytics.js +7 -5
  25. package/dist/pkg/browser/standalone-analytics.js.map +1 -1
  26. package/dist/pkg/browser/standalone-interface.js +2 -0
  27. package/dist/pkg/browser/standalone-interface.js.map +1 -0
  28. package/dist/pkg/browser/standalone.js +7 -0
  29. package/dist/pkg/browser/standalone.js.map +1 -1
  30. package/dist/pkg/core/analytics/index.js +2 -1
  31. package/dist/pkg/core/analytics/index.js.map +1 -1
  32. package/dist/pkg/core/buffer/snippet.js +4 -2
  33. package/dist/pkg/core/buffer/snippet.js.map +1 -1
  34. package/dist/pkg/generated/version.js +1 -1
  35. package/dist/pkg/index.js +1 -0
  36. package/dist/pkg/index.js.map +1 -1
  37. package/dist/pkg/lib/global-analytics-helper.js +28 -0
  38. package/dist/pkg/lib/global-analytics-helper.js.map +1 -0
  39. package/dist/pkg/lib/parse-cdn.js +19 -12
  40. package/dist/pkg/lib/parse-cdn.js.map +1 -1
  41. package/dist/pkg/plugins/in-app-plugin/index.js +28 -18
  42. package/dist/pkg/plugins/in-app-plugin/index.js.map +1 -1
  43. package/dist/types/browser/index.d.ts.map +1 -1
  44. package/dist/types/browser/standalone-analytics.d.ts +0 -14
  45. package/dist/types/browser/standalone-analytics.d.ts.map +1 -1
  46. package/dist/types/browser/standalone-interface.d.ts +10 -0
  47. package/dist/types/browser/standalone-interface.d.ts.map +1 -0
  48. package/dist/types/browser/standalone.d.ts.map +1 -1
  49. package/dist/types/core/analytics/index.d.ts +5 -0
  50. package/dist/types/core/analytics/index.d.ts.map +1 -1
  51. package/dist/types/core/buffer/index.d.ts +1 -1
  52. package/dist/types/core/buffer/snippet.d.ts +6 -1
  53. package/dist/types/core/buffer/snippet.d.ts.map +1 -1
  54. package/dist/types/generated/version.d.ts +1 -1
  55. package/dist/types/index.d.ts +2 -1
  56. package/dist/types/index.d.ts.map +1 -1
  57. package/dist/types/lib/global-analytics-helper.d.ts +18 -0
  58. package/dist/types/lib/global-analytics-helper.d.ts.map +1 -0
  59. package/dist/types/lib/parse-cdn.d.ts.map +1 -1
  60. package/dist/types/plugins/in-app-plugin/index.d.ts.map +1 -1
  61. package/dist/umd/646.js +1 -1
  62. package/dist/umd/646.js.gz +0 -0
  63. package/dist/umd/870.js +1 -1
  64. package/dist/umd/870.js.gz +0 -0
  65. package/dist/umd/inAppPlugin.js +1 -1
  66. package/dist/umd/inAppPlugin.js.gz +0 -0
  67. package/dist/umd/index.js +1 -1
  68. package/dist/umd/index.js.gz +0 -0
  69. package/dist/umd/standalone.js +1 -1
  70. package/dist/umd/standalone.js.gz +0 -0
  71. package/package.json +4 -4
  72. package/src/browser/index.ts +3 -0
  73. package/src/browser/standalone-analytics.ts +12 -24
  74. package/src/browser/standalone-interface.ts +11 -0
  75. package/src/browser/standalone.ts +12 -0
  76. package/src/core/analytics/index.ts +7 -1
  77. package/src/core/buffer/snippet.ts +6 -3
  78. package/src/generated/version.ts +1 -1
  79. package/src/index.ts +2 -2
  80. package/src/lib/global-analytics-helper.ts +31 -0
  81. package/src/lib/parse-cdn.ts +14 -7
  82. package/src/plugins/in-app-plugin/index.ts +28 -17
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-analytics-helper.d.ts","sourceRoot":"","sources":["../../../src/lib/global-analytics-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAOlE;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,GAAG,SAAS,CAEjE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,QAEhD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAEpE"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"parse-cdn.d.ts","sourceRoot":"","sources":["../../../src/lib/parse-cdn.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,eAAe,QAAS,MAAM,SAM1C,CAAA;AAED,eAAO,MAAM,MAAM,QAAO,MAgBzB,CAAA;AAED,eAAO,MAAM,sBAAsB,cAGlC,CAAA;AAED;;;;IAII;AACJ,wBAAgB,gBAAgB,IAAI,MAAM,CAuBzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/in-app-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAA+D,MAAM,UAAU,CAAA;AAGnG,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,EAAE,kCAAkC,GAAG,IAAI,GAAG,SAAS,CAAA;IAE7D,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAE7B,cAAc,EAAE,OAAO,GAAG,KAAK,CAAA;CAClC,CAAA;AAED,wBAAgB,WAAW,CACvB,QAAQ,EAAE,mBAAmB,GAC5B,MAAM,CA4KV"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/in-app-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAA+D,MAAM,UAAU,CAAA;AAGnG,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,MAAM,EAAE,kCAAkC,GAAG,IAAI,GAAG,SAAS,CAAA;IAE7D,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAE7B,cAAc,EAAE,OAAO,GAAG,KAAK,CAAA;CAClC,CAAA;AAED,wBAAgB,WAAW,CACvB,QAAQ,EAAE,mBAAmB,GAC5B,MAAM,CAuLV"}
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 r=n(3044),i=n(6955),s=n(2233),o=n(8030),a=n(7948),u=n(1875),c=n(842),l=n(8560),f=n(1218),d=n(8047),p=n(738),g=n(7721);e.exports=function(e){return new Promise((function(t,n){var h,m=e.data,v=e.headers,y=e.responseType,w=e.withXSRFToken;function b(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(m)&&r.isStandardBrowserEnv()&&delete v["Content-Type"];var x=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",S=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(E+":"+S)}var R=a(e.baseURL,e.url);function O(){if(x){var r="getAllResponseHeaders"in x?u(x.getAllResponseHeaders()):null,s={data:y&&"text"!==y&&"json"!==y?x.response:x.responseText,status:x.status,statusText:x.statusText,headers:r,config:e,request:x};i((function(e){t(e),b()}),(function(e){n(e),b()}),s),x=null}}if(x.open(e.method.toUpperCase(),o(R,e.params,e.paramsSerializer),!0),x.timeout=e.timeout,"onloadend"in x?x.onloadend=O:x.onreadystatechange=function(){x&&4===x.readyState&&(0!==x.status||x.responseURL&&0===x.responseURL.indexOf("file:"))&&setTimeout(O)},x.onabort=function(){x&&(n(new f("Request aborted",f.ECONNABORTED,e,x)),x=null)},x.onerror=function(){n(new f("Network Error",f.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new f(t,r.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,x)),x=null},r.isStandardBrowserEnv()&&(w&&r.isFunction(w)&&(w=w(e)),w||!1!==w&&c(R))){var I=e.xsrfHeaderName&&e.xsrfCookieName&&s.read(e.xsrfCookieName);I&&(v[e.xsrfHeaderName]=I)}"setRequestHeader"in x&&r.forEach(v,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete v[t]:x.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(x.withCredentials=!!e.withCredentials),y&&"json"!==y&&(x.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&x.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&x.upload&&x.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(t){x&&(n(!t||t.type?new d(null,e,x):t),x.abort(),x=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),m||!1===m||0===m||""===m||(m=null);var T=p(R);T&&-1===g.protocols.indexOf(T)?n(new f("Unsupported protocol "+T+":",f.ERR_BAD_REQUEST,e)):x.send(m)}))}},5644:function(e,t,n){"use strict";var r=n(3044),i=n(3644),s=n(2215),o=n(2937),a=n(663),u=n(9468);var c=function e(t){var n=new s(t),a=i(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return e(o(t,n))},a}(a);c.Axios=s,c.CanceledError=n(8047),c.CancelToken=n(4089),c.isCancel=n(8041),c.VERSION=n(9241).version,c.toFormData=n(9027),c.AxiosError=n(1218),c.Cancel=c.CanceledError,c.all=function(e){return Promise.all(e)},c.spread=n(783),c.isAxiosError=n(5587),c.formToJSON=function(e){return u(r.isHTMLForm(e)?new FormData(e):e)},e.exports=c,e.exports.default=c},4089:function(e,t,n){"use strict";var r=n(8047);function i(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;this.promise.then((function(e){if(n._listeners){for(var t=n._listeners.length;t-- >0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,i,s){n.reason||(n.reason=new r(e,i,s),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},8047:function(e,t,n){"use strict";var r=n(1218);function i(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(3044).inherits(i,r,{__CANCEL__:!0}),e.exports=i},8041:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:function(e,t,n){"use strict";var r=n(3044),i=n(8030),s=n(946),o=n(6895),a=n(2937),u=n(7948),c=n(7525),l=c.validators;function f(e){this.defaults=e,this.interceptors={request:new s,response:new s}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var i=t.paramsSerializer;void 0!==i&&c.assertOptions(i,{encode:l.function,serialize:l.function},!0),r.isFunction(i)&&(t.paramsSerializer={serialize:i});var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var f,d=[];if(this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)})),!u){var p=[o,void 0];for(Array.prototype.unshift.apply(p,s),p=p.concat(d),f=Promise.resolve(t);p.length;)f=f.then(p.shift(),p.shift());return f}for(var g=t;s.length;){var h=s.shift(),m=s.shift();try{g=h(g)}catch(e){m(e);break}}try{f=o(g)}catch(e){return Promise.reject(e)}for(;d.length;)f=f.then(d.shift(),d.shift());return f},f.prototype.getUri=function(e){e=a(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(a(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},1218:function(e,t,n){"use strict";var r=n(3044);function i(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{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,status:this.response&&this.response.status?this.response.status:null}}});var s=i.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(i,o),Object.defineProperty(s,"isAxiosError",{value:!0}),i.from=function(e,t,n,o,a,u){var c=Object.create(s);return r.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,n,o,a),c.cause=e,c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},946:function(e,t,n){"use strict";var r=n(3044);function i(){this.handlers=[]}i.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},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.clear=function(){this.handlers&&(this.handlers=[])},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},7948:function(e,t,n){"use strict";var r=n(9192),i=n(8762);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},6895:function(e,t,n){"use strict";var r=n(3044),i=n(8556),s=n(8041),o=n(663),a=n(8047),u=n(8868);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,null,e.transformRequest),u(e.headers,"Accept"),u(e.headers,"Content-Type"),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=i.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))}},2937:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isEmptyObject(t)?r.merge({},e):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function u(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||s,i=t(e);r.isUndefined(i)&&t!==u||(n[e]=i)})),n}},6955:function(e,t,n){"use strict";var r=n(1218);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},8556:function(e,t,n){"use strict";var r=n(3044),i=n(663);e.exports=function(e,t,n,s){var o=this||i;return r.forEach(s,(function(r){e=r.call(o,e,t,n)})),e}},663:function(e,t,n){"use strict";var r=n(3044),i=n(8868),s=n(1218),o=n(8560),a=n(9027),u=n(1746),c=n(7721),l=n(9468),f={"Content-Type":"application/x-www-form-urlencoded"};function d(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var p,g={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(p=n(353)),p),transformRequest:[function(e,t){i(t,"Accept"),i(t,"Content-Type");var n,s=t&&t["Content-Type"]||"",o=s.indexOf("application/json")>-1,c=r.isObject(e);if(c&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return o?JSON.stringify(l(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return d(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(c){if(-1!==s.indexOf("application/x-www-form-urlencoded"))return u(e,this.formSerializer).toString();if((n=r.isFileList(e))||s.indexOf("multipart/form-data")>-1){var f=this.env&&this.env.FormData;return a(n?{"files[]":e}:e,f&&new f,this.formSerializer)}}return c||o?(d(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||i)){var o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s.from(e,s.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.classes.FormData,Blob:c.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){g.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){g.headers[e]=r.merge(f)})),e.exports=g},8560:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},5694:function(e,t,n){e.exports=n(1688)},9241:function(e){e.exports={version:"0.28.1"}},3831:function(e,t,n){"use strict";var r=n(9027);function i(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function s(e,t){this._pairs=[],e&&r(e,this,t)}var o=s.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){var t=e?function(t){return e.call(this,t,i)}:i;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")},e.exports=s},3644:function(e){"use strict";e.exports=function(e,t){return function(){return e.apply(t,arguments)}}},8030:function(e,t,n){"use strict";var r=n(3044),i=n(3831);function s(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 o=e.indexOf("#");-1!==o&&(e=e.slice(0,o));var a,u=n&&n.encode||s,c=n&&n.serialize;return(a=c?c(t,n):r.isURLSearchParams(t)?t.toString():new i(t,n).toString(u))&&(e+=(-1===e.indexOf("?")?"?":"&")+a),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 r=n(3044);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,s,o){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(s)&&a.push("domain="+s),!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(){}}},9468:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e){function t(e,n,i,s){var o=e[s++],a=Number.isFinite(+o),u=s>=e.length;return o=!o&&r.isArray(i)?i.length:o,u?(r.hasOwnProperty(i,o)?i[o]=[i[o],n]:i[o]=n,!a):(i[o]&&r.isObject(i[o])||(i[o]=[]),t(e,n,i[o],s)&&r.isArray(i[o])&&(i[o]=function(e){var t,n,r={},i=Object.keys(e),s=i.length;for(t=0;t<s;t++)r[n=i[t]]=e[n];return r}(i[o])),!a)}if(r.isFormData(e)&&r.isFunction(e.entries)){var n={};return r.forEachEntry(e,(function(e,i){t(function(e){return r.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),i,n,0)})),n}return null}},9192:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5587:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},842:function(e,t,n){"use strict";var r=n(3044);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{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=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},8868:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},1875:function(e,t,n){"use strict";var r=n(3044),i=["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,s,o={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.slice(0,s)).toLowerCase(),n=r.trim(e.slice(s+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},738:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},783:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},9027:function(e,t,n){"use strict";var r=n(3044),i=n(1218),s=n(5694);function o(e){return r.isPlainObject(e)||r.isArray(e)}function a(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,n){return e?e.concat(t).map((function(e,t){return e=a(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var c=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,t,n){if(!r.isObject(e))throw new TypeError("target must be an object");t=t||new(s||FormData);var l,f=(n=r.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,d=n.visitor||v,p=n.dots,g=n.indexes,h=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((l=t)&&r.isFunction(l.append)&&"FormData"===l[Symbol.toStringTag]&&l[Symbol.iterator]);if(!r.isFunction(d))throw new TypeError("visitor must be a function");function m(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!h&&r.isBlob(e))throw new i("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?h&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function v(e,n,i){var s=e;if(e&&!i&&"object"==typeof e)if(r.endsWith(n,"{}"))n=f?n:n.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(o)}(e)||r.isFileList(e)||r.endsWith(n,"[]")&&(s=r.toArray(e)))return n=a(n),s.forEach((function(e,i){!r.isUndefined(e)&&t.append(!0===g?u([n],i,p):null===g?n:n+"[]",m(e))})),!1;return!!o(e)||(t.append(u(i,n,p),m(e)),!1)}var y=[],w=Object.assign(c,{defaultVisitor:v,convertValue:m,isVisitable:o});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!r.isUndefined(n)){if(-1!==y.indexOf(n))throw Error("Circular reference detected in "+i.join("."));y.push(n),r.forEach(n,(function(n,s){!0===(!r.isUndefined(n)&&d.call(t,n,r.isString(s)?s.trim():s,i,w))&&e(n,i?i.concat(s):[s])})),y.pop()}}(e),t}},1746:function(e,t,n){"use strict";var r=n(3044),i=n(9027),s=n(7721);e.exports=function(e,t){return i(e,new s.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return s.isNode&&r.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}},7525:function(e,t,n){"use strict";var r=n(9241).version,i=n(1218),s={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){s[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={};s.transitional=function(e,t,n){function s(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new i(s(r," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!o[r]&&(o[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),s=r.length;s-- >0;){var o=r[s],a=t[o];if(a){var u=e[o],c=void 0===u||a(u,o,e);if(!0!==c)throw new i("option "+o+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+o,i.ERR_BAD_OPTION)}},validators:s}},319:function(e){"use strict";e.exports=FormData},1159:function(e,t,n){"use strict";var r=n(3831);e.exports="undefined"!=typeof URLSearchParams?URLSearchParams:r},1279:function(e,t,n){"use strict";e.exports={isBrowser:!0,classes:{URLSearchParams:n(1159),FormData:n(319),Blob},protocols:["http","https","file","blob","url","data"]}},7721:function(e,t,n){"use strict";e.exports=n(1279)},3044:function(e,t,n){"use strict";var r,i=n(3644),s=Object.prototype.toString,o=(r=Object.create(null),function(e){var t=s.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var l=a("ArrayBuffer");function f(e){return"number"==typeof e}function d(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var g=a("Date"),h=a("File"),m=a("Blob"),v=a("FileList");function y(e){return"[object Function]"===s.call(e)}var w=a("URLSearchParams");function b(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var x,E=(x="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return x&&e instanceof x});var S,R=a("HTMLFormElement"),O=(S=Object.prototype.hasOwnProperty,function(e,t){return S.call(e,t)});e.exports={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:f,isObject:d,isPlainObject:p,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:c,isDate:g,isFile:h,isBlob:m,isFunction:y,isStream:function(e){return d(e)&&y(e.pipe)},isURLSearchParams:w,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):u(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?i(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,s,o,a={};if(t=t||{},null==e)return t;do{for(s=(i=Object.getOwnPropertyNames(e)).length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(u(e))return e;var t=e.length;if(!f(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:E,isFileList:v,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:O}},5446:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ee}});class r{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 i(e){Ee.config.logging&&console.log(`Gist: ${e}`)}var s,o=new Uint8Array(16);function a(){if(!s&&!(s="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 s(o)}var u=/^(?:[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 c=function(e){return"string"==typeof e&&u.test(e)},l=[],f=0;f<256;++f)l.push((f+256).toString(16).substr(1));var d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!c(n))throw TypeError("Stringified UUID is invalid");return n};var p=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 i=0;i<16;++i)t[n+i]=r[i];return t}return d(r)};const g="gist.web.isPersistingSession";function h(e,t,n=null){var r=n;r||(r=new Date).setDate(r.getDate()+365);const i={value:t,expiry:r};w().setItem(e,JSON.stringify(i))}function m(e){const t=w().getItem(e);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>new Date(n.expiry).getTime()?(v(e),null):n.value}function v(e){w().removeItem(e)}function y(){const e=sessionStorage.getItem(g);return null===e?(sessionStorage.setItem(g,"true"),!0):"true"===e}function w(){return y()?localStorage:sessionStorage}var b=n(9644),x=n.n(b);const E={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 S(){var e=x().create({baseURL:E.GIST_QUEUE_API_ENDPOINT[Ee.config.env],timeout:2e4});e.defaults.headers.common["X-CIO-Site-Id"]=Ee.config.siteId,e.defaults.headers.common["X-CIO-Client-Platform"]="web";var t=N();return null!=t&&(e.defaults.headers.common["X-Gist-Encoded-User-Token"]=btoa(t)),e}const R="gist.web.userLocale";var O=600,I=!1;const T="gist.web.userQueueNextPullCheck";async function A(){var e;try{if(!I){var t=(new Date).getTime();I=!0;var n={"X-Gist-User-Anonymous":P(),"Content-Language":null!==m(R)?m(R):navigator.language};e=await S().post(`/api/v2/users?timestamp=${t}`,{},{headers:n})}}catch(t){t.response?e=t.response:i(`Error getting user queue: ${t}`)}finally{return I=!1,function(e){if(e&&e.headers){var t=e.headers["x-gist-queue-polling-interval"];t&&t>0&&(O=t)}var n=new Date((new Date).getTime()+1e3*O);h(T,O,n)}(e),e}}const D="gist.web.userToken",C="gist.web.usingGuestUserToken",$="gist.web.guestUserToken";function P(){return null!==m(C)}function N(){return m(D)}function k(){if(null===N()){var e=m($);null==e&&(e=p(),h($,e),i(`Set guest user token "${e}" with expiry date set to 1 year from today`)),h(D,e),h(C,!0),i(`Using anonymous session with token: "${e}"`)}}async function _(){var e=N();return null===e?null:await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t),r=Array.from(new Uint8Array(n));return r.map((e=>e.toString(16).padStart(2,"0"))).join("")}(e)}function U(e){var t="",n="",r="",i=!1,s=!1,o=!1,a=!1,u=null,c=!1,l="#00000033",f=414,d=!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,i=!0),e.properties.gist.routeRuleWeb&&(n=e.properties.gist.routeRuleWeb,s=!0),e.properties.gist.position&&(r=e.properties.gist.position,o=!0),e.properties.gist.scale&&(a=e.properties.gist.scale),e.properties.gist.overlayColor&&(l=e.properties.gist.overlayColor),e.properties.gist.messageWidth&&e.properties.gist.messageWidth>0&&(f=e.properties.gist.messageWidth,d=!0),e.properties.gist.persistent&&(c=!0)),{isEmbedded:i,elementId:t,hasRouteRule:s,routeRule:n,position:r,hasPosition:o,shouldScale:a,campaignId:u,messageWidth:f,overlayColor:l,persistent:c,hasCustomWidth:d}}var L=["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"];const j=e=>new Promise((t=>setTimeout(t,e))),B=["x-gist-top","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"];function F(e,t,n){var r=z(e);if(r){r.classList.add(V(n.instanceId));var s=U(n),o=s.messageWidth+"px";B.includes(e)&&!s.hasCustomWidth&&(o="100%"),L.includes(e)&&(r.style.width=o),q(e)||(r.style.height="0px"),r.innerHTML=function(e,t,n){return function(e,t,n){var r=800;return t.messageWidth>r&&(r=t.messageWidth),`\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 }\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 #x-gist-top.${e},\n #x-gist-bottom.${e},\n #x-gist-floating-top.${e},\n #x-gist-floating-bottom.${e},\n #x-gist-floating-top-left.${e},\n #x-gist-floating-top-right.${e},\n #x-gist-floating-bottom-left.${e},\n #x-gist-floating-bottom-right.${e} {\n transition: height 0.1s ease-in-out;\n }\n @media (max-width: ${r}px) {\n #x-gist-top.${e},\n #x-gist-bottom.${e},\n #x-gist-floating-top.${e},\n #x-gist-floating-bottom.${e},\n #x-gist-floating-top-left.${e},\n #x-gist-floating-top-right.${e},\n #x-gist-floating-bottom-left.${e},\n #x-gist-floating-bottom-right.${e} {\n width: 100% !important;\n }\n }\n </style>\n <div id="gist-embed-container">\n <iframe id="${e}" class="gist-frame" src="${n}"></iframe>\n </div>\n </div>`}(V(t.instanceId),n,e)}(t,n,s)}else i(`Message could not be embedded, elementId ${e} not found.`)}function q(e){var t=z(e);if(t)return t.style&&t.style.height&&"0px"!=t.style.height}function M(e,t){document.body.insertAdjacentHTML("afterbegin",function(e,t){var n=U(t);return function(e,t,n){var r=600;return t.messageWidth>r&&(r=t.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: ${t.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: ${t.messageWidth}px;\n position: absolute;\n border: none;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, height 0.1s 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: ${r}px) {\n .gist-message {\n width: 100%;\n }\n }\n </style>\n <div id="gist-overlay" class="background">\n <iframe id="${e}" class="gist-message" src="${n}"></iframe>\n </div>\n </div>`}(V(t.instanceId),n,e)}(e,t))}function W(){var e=document.querySelector("#gist-embed-message");e&&e.parentNode.removeChild(e)}function V(e){return`gist-${e}`}function H(){var e=document.querySelector(".gist-message");e&&e.classList.add("visible")}function z(e){try{var t=document.querySelector(`#${e}`);return t||null}catch{return null}}async function J(e){i(`Marking broadcast ${e} as seen.`);const t=await G();if(!t)return;const n=await async function(e,t){return m(e).find((e=>e.queueId===t))}(t,e);if(!n)return;const{broadcast:r}=n.properties.gist,s=Q(t,e),o=K(t,e);let a=m(s)||0;if(h(s,a+1),1===r.frequency.count)h(o,!1),i(`Marked broadcast ${e} as seen.`);else{let t=new Date;t.setSeconds(t.getSeconds()+r.frequency.delay),h(o,!1,t),i(`Marked broadcast ${e} as seen, broadcast was seen ${a+1} times, next show date is ${t}.`)}}function X(e){return e.properties&&e.properties.gist&&e.properties.gist.broadcast}async function G(){const e=await _();return e?`gist.web.message.broadcasts.${e}`:null}function Q(e,t){return`${e}.${t}.numberOfTimesShown`}function K(e,t){return`${e}.${t}.shouldShow`}async function Z(){const e=await Y();if(!e)return[];const t=m(e)??[],n=await async function(){const e=await ee();return e?m(e)??[]:[]}();return t.filter((e=>!n.includes(e.queueId)))}async function Y(){const e=await _();return e?`gist.web.message.user.${e}`:null}async function ee(){const e=await _();return e?`gist.web.message.user.${e}.seen`:null}async function te(e){if(Ee.isDocumentVisible){if(Ee.overlayInstanceId)return i(`Message ${Ee.overlayInstanceId} already showing.`),null;var t=U(e);return e.instanceId=p(),e.overlay=!0,e.firstLoad=!0,e.shouldResizeHeight=!0,e.shouldScale=t.shouldScale,e.renderStartTime=(new Date).getTime(),Ee.overlayInstanceId=e.instanceId,Ee.currentMessages.push(e),ae(e)}return i("Document hidden, not showing message now."),null}async function ne(e,t){return Ee.isDocumentVisible?(e.instanceId=p(),e.overlay=!1,e.firstLoad=!0,e.shouldScale=!1,e.elementId=t,e.shouldResizeHeight=!q(t),e.renderStartTime=(new Date).getTime(),Ee.currentMessages.push(e),ae(e,t)):(i("Document hidden, not showing message now."),null)}async function re(e){e?(Ee.messageDismissed(e),e.overlay?await oe(!0,e):se(e)):i(`Message with instance id: ${instanceId} not found`)}async function ie(e){var t=U(e);e?t.persistent&&(i("Persistent message dismissed, logging view"),await ge(e),await ue(e)):i(`Message with instance id: ${instanceId} not found`)}function se(e){var t,n;le(e.instanceId),t=e.elementId,(n=z(t))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function oe(e,t){le(t.instanceId),Ee.overlayInstanceId=null,e?await async function(){var e=document.querySelector(".gist-message");e&&(e.classList.remove("visible"),await j(300)),W()}():W(),0==Ee.currentMessages.length&&(window.removeEventListener("message",pe),window.removeEventListener("touchstart",de))}function ae(e,t=null){if(t&&function(e){var t=z(e);return!(!t||!t.classList.contains("gist-visible"))}(t))return i(`Message ${e.messageId} already showing in element ${t}.`),null;var n,r,s={endpoint:E.ENGINE_API_ENDPOINT[Ee.config.env],siteId:Ee.config.siteId,dataCenter:Ee.config.dataCenter,messageId:e.messageId,instanceId:e.instanceId,livePreview:!1,properties:e.properties},o=`${E.GIST_VIEW_ENDPOINT[Ee.config.env]}/index.html?options=${n=JSON.stringify(s),r=btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)}))),encodeURIComponent(r)}`;return window.addEventListener("message",pe),window.addEventListener("touchstart",de),t?(L.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);i("Top & bottom elements injected into page")}(t),F(t,o,e)):M(o,e),e}async function ue(e){i(`Message shown, logging view for: ${e.messageId}`);var t={};null!=e.queueId?(await ge(e),t=await async function(e){try{return await S().post(`/api/v1/logs/queue/${e}`)}catch(e){return e.response}}(e.queueId)):t=await async function(e){try{return await S().post(`/api/v1/logs/message/${e}`)}catch(e){return e.response}}(e.messageId),200===t.status?i("Message view logged"):i(`Problem logging message: ${t.status}`)}function ce(e){return Ee.currentMessages.find((t=>t.instanceId===e))}function le(e){Ee.currentMessages=Ee.currentMessages.filter((t=>t.instanceId!==e))}function fe(e,t){le(e),Ee.currentMessages.push(t)}function de(e){}async function pe(e){if(e.data.gist){var t=e.data.gist.instanceId,n=ce(t);if(!n)return;var r=U(n);switch(e.data.gist.method){case"routeLoaded":var s=.001*((new Date).getTime()-n.renderStartTime);i(`Engine render for message: ${n.messageId} timer elapsed in ${s.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(H,100)}else W()}(n):(f=n.elementId,(d=z(f))&&d.classList.add("gist-visible")),Ee.messageShown(n),r.persistent?i("Persistent message shown, skipping logging view"):await ue(n),n.firstLoad=!1),fe(t,n);break;case"tap":var o=e.data.gist.parameters.action,a=e.data.gist.parameters.name;if(Ee.messageAction(n,o,a),e.data.gist.parameters.system&&!r.persistent){await re(n);break}try{if((l=new URL(o))&&"gist:"===l.protocol)switch(l.href.replace("gist://","").split("?")[0]){case"close":await re(n),await ie(n),await async function(e){X(e)&&(i(`Logging broadcast dismissed locally for: ${e.queueId}`),await async function(e){i(`Marking broadcast ${e} as dismissed.`);const t=await G();if(!t)return;h(K(t,e),!1),i(`Marked broadcast ${e} as dismissed and will not show again.`)}(e.queueId))}(n),await ye();break;case"showMessage":var u=l.searchParams.get("messageId"),c=l.searchParams.get("properties");u&&(c&&(c=JSON.parse(atob(c))),await Ee.showMessage({messageId:u,properties:c}));break;case"loadPage":var l;(l=l.href.substring(l.href.indexOf("?url=")+5))&&(l.startsWith("https://")||l.startsWith("http://")||l.startsWith("/")?window.location.href=l:window.location.href=window.location+l)}}catch(e){}break;case"routeChanged":n.currentRoute=e.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),fe(t,n),i(`Route changed to: ${n.currentRoute}`);break;case"sizeChanged":i(`Size Changed Width: ${e.data.gist.parameters.width} - Height: ${e.data.gist.parameters.height}`),n.elementId&&!n.shouldResizeHeight||function(e,t){var n=z(e.elementId?e.elementId:V(e.instanceId));if(n){var r=n.style;if(t.height>0)if(t.height>window.innerHeight){var i=1-(t.height/window.innerHeight-1);e.shouldScale&&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`}}(n,e.data.gist.parameters);break;case"titleChanged":i(`Overlay title changed to: ${e.data.gist.parameters.title}`),function(e,t){var n=z(V(e));n&&(n.title=t)}(t,e.data.gist.parameters.title);break;case"eventDispatched":Ee.events.dispatch("eventDispatched",{name:e.data.gist.parameters.name,payload:e.data.gist.parameters.payload});break;case"error":case"routeError":Ee.messageError(n),Ee.overlayInstanceId?oe(!1,n):se(n)}}var f,d}async function ge(e){i(`Logging user message view locally for: ${e.queueId}`),X(e)?await J(e.queueId):await async function(e){const t=await ee();if(!t)return;const n=m(t)??[];n.push(e),h(t,n)}(e.queueId)}var he=(e,t)=>e().then((e=>new Promise((t=>setTimeout(t,e))))(t).then((()=>he(e,t)))),me=!1;async function ve(){me?ye():(!async function(){var e=`G${p().substring(0,8)}`,t=document.createElement("div");t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),await j(5e3),ne({messageId:""},e)}(),N()?(i("Queue watcher started"),me=!0,he((()=>new Promise((()=>async function(){if(N())if(Ee.isDocumentVisible)if(null===m(T)){var e=await A(),t=[];e?(200===e.status||204===e.status?(i("200 response, updating local store."),async function(e){const t=await Y();if(!t)return;h(t,e.filter((e=>!(e.properties&&e.properties.gist&&e.properties.gist.broadcast))),new Date(Date.now()+36e5))}(t=e.data),async function(e){const t=await G();if(!t)return;const n=new Date;n.setDate(n.getDate()+30),h(t,e.filter(X),n)}(t)):304===e.status&&i("304 response, using local store."),await ye()):i("There was an error while checking message queue.")}else i("Next queue pull scheduled for later.");else i("Document not visible, skipping queue check.");else i("User token reset, skipping queue check.")}()))),1e3)):i("User token not setup, queue not started."))}async function ye(){var e=await async function(){const e=await G();return e?(m(e)??[]).filter((t=>{const{broadcast:n}=t.properties.gist,r=m(K(e,t.queueId))??!0,i=m(Q(e,t.queueId))||0,s=0===n.frequency.count;return r&&(s||i<n.frequency.count)})):[]}(),t=await Z(),n=e.concat(t);i(`Messages in local queue: ${n.length}`);var r=n.sort(((e,t)=>e.priority-t.priority));for(const e of r)await we(e)}async function we(e){var t=U(e);if(t.hasRouteRule){var n=Ee.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var r=t.routeRule;if(i(`Verifying route against rule: ${r}`),!new RegExp(r).test(n))return i(`Route ${n} does not match rule.`),!1}return t.hasPosition&&(e.position=t.position),t.isEmbedded?await ne(e,t.elementId):await te(e)}const be="cioPreviewId";function xe(){const e=new URLSearchParams(window.location.search).get(be);var t;return e&&(t=!1,sessionStorage.setItem(g,t),Ee.setUserToken(e),i(`Preview mode enabled with user token: ${e}`)),!y()}var Ee=class{static async setup(e){this.events=new r,this.config={useAnonymousSession:void 0!==e.useAnonymousSession&&e.useAnonymousSession,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,this.config.isPreviewSession=xe(),i(`Setup complete on ${this.config.env} environment.`),!this.config.isPreviewSession&&this.config.useAnonymousSession&&k(),await ve(),document.addEventListener("visibilitychange",(async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await ye())}),!1)}static async setCurrentRoute(e){this.currentRoute=e,i(`Current route set to: ${e}`),await ye()}static async setUserToken(e,t){this.config.isPreviewSession||(!function(e,t){void 0===t&&(t=new Date).setDate(t.getDate()+30),h(D,e,t),P()&&(v(T),v(C)),i(`Set user token "${e}" with expiry date set to ${t}`)}(e,t),await ve())}static setUserLocale(e){var t;h(R,t=e),i(`Set user locate to "${t}"`)}static async clearUserToken(){this.config.isPreviewSession||(v(D),i("Cleared user token"),this.config.useAnonymousSession&&k(),await ve())}static async dismissMessage(e){var t=ce(e);await re(t),await ie(t),await ye()}static async embedMessage(e,t){var n=await ne(e,t);return n?n.instanceId:null}static async showMessage(e){var t=await te(e);return t?t.instanceId:null}static messageShown(e){i(`Message shown: ${e.messageId}`),this.events.dispatch("messageShown",e)}static messageDismissed(e){null!==e&&(i(`Message dismissed: ${e.messageId}`),this.events.dispatch("messageDismissed",e))}static messageError(e){i(`Message error: ${e.messageId}`),this.events.dispatch("messageError",e)}static messageAction(e,t,n){i(`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 r=n(5446).Z;e.exports=r},1688:function(e){e.exports="object"==typeof self?self.FormData:window.FormData}}]);
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 r=n(3044),i=n(6955),s=n(2233),o=n(8030),a=n(7948),u=n(1875),c=n(842),l=n(8560),f=n(1218),d=n(8047),p=n(738),g=n(7721);e.exports=function(e){return new Promise((function(t,n){var h,m=e.data,v=e.headers,y=e.responseType,w=e.withXSRFToken;function b(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(m)&&r.isStandardBrowserEnv()&&delete v["Content-Type"];var x=new XMLHttpRequest;if(e.auth){var E=e.auth.username||"",S=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(E+":"+S)}var R=a(e.baseURL,e.url);function I(){if(x){var r="getAllResponseHeaders"in x?u(x.getAllResponseHeaders()):null,s={data:y&&"text"!==y&&"json"!==y?x.response:x.responseText,status:x.status,statusText:x.statusText,headers:r,config:e,request:x};i((function(e){t(e),b()}),(function(e){n(e),b()}),s),x=null}}if(x.open(e.method.toUpperCase(),o(R,e.params,e.paramsSerializer),!0),x.timeout=e.timeout,"onloadend"in x?x.onloadend=I:x.onreadystatechange=function(){x&&4===x.readyState&&(0!==x.status||x.responseURL&&0===x.responseURL.indexOf("file:"))&&setTimeout(I)},x.onabort=function(){x&&(n(new f("Request aborted",f.ECONNABORTED,e,x)),x=null)},x.onerror=function(){n(new f("Network Error",f.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||l;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new f(t,r.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,e,x)),x=null},r.isStandardBrowserEnv()&&(w&&r.isFunction(w)&&(w=w(e)),w||!1!==w&&c(R))){var O=e.xsrfHeaderName&&e.xsrfCookieName&&s.read(e.xsrfCookieName);O&&(v[e.xsrfHeaderName]=O)}"setRequestHeader"in x&&r.forEach(v,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete v[t]:x.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(x.withCredentials=!!e.withCredentials),y&&"json"!==y&&(x.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&x.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&x.upload&&x.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(t){x&&(n(!t||t.type?new d(null,e,x):t),x.abort(),x=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),m||!1===m||0===m||""===m||(m=null);var T=p(R);T&&-1===g.protocols.indexOf(T)?n(new f("Unsupported protocol "+T+":",f.ERR_BAD_REQUEST,e)):x.send(m)}))}},5644:function(e,t,n){"use strict";var r=n(3044),i=n(3644),s=n(2215),o=n(2937),a=n(663),u=n(9468);var c=function e(t){var n=new s(t),a=i(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return e(o(t,n))},a}(a);c.Axios=s,c.CanceledError=n(8047),c.CancelToken=n(4089),c.isCancel=n(8041),c.VERSION=n(9241).version,c.toFormData=n(9027),c.AxiosError=n(1218),c.Cancel=c.CanceledError,c.all=function(e){return Promise.all(e)},c.spread=n(783),c.isAxiosError=n(5587),c.formToJSON=function(e){return u(r.isHTMLForm(e)?new FormData(e):e)},e.exports=c,e.exports.default=c},4089:function(e,t,n){"use strict";var r=n(8047);function i(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;this.promise.then((function(e){if(n._listeners){for(var t=n._listeners.length;t-- >0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,i,s){n.reason||(n.reason=new r(e,i,s),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},i.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},8047:function(e,t,n){"use strict";var r=n(1218);function i(e,t,n){r.call(this,null==e?"canceled":e,r.ERR_CANCELED,t,n),this.name="CanceledError"}n(3044).inherits(i,r,{__CANCEL__:!0}),e.exports=i},8041:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},2215:function(e,t,n){"use strict";var r=n(3044),i=n(8030),s=n(946),o=n(6895),a=n(2937),u=n(7948),c=n(7525),l=c.validators;function f(e){this.defaults=e,this.interceptors={request:new s,response:new s}}f.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:l.transitional(l.boolean),forcedJSONParsing:l.transitional(l.boolean),clarifyTimeoutError:l.transitional(l.boolean)},!1);var i=t.paramsSerializer;void 0!==i&&c.assertOptions(i,{encode:l.function,serialize:l.function},!0),r.isFunction(i)&&(t.paramsSerializer={serialize:i});var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var f,d=[];if(this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)})),!u){var p=[o,void 0];for(Array.prototype.unshift.apply(p,s),p=p.concat(d),f=Promise.resolve(t);p.length;)f=f.then(p.shift(),p.shift());return f}for(var g=t;s.length;){var h=s.shift(),m=s.shift();try{g=h(g)}catch(e){m(e);break}}try{f=o(g)}catch(e){return Promise.reject(e)}for(;d.length;)f=f.then(d.shift(),d.shift());return f},f.prototype.getUri=function(e){e=a(this.defaults,e);var t=u(e.baseURL,e.url);return i(t,e.params,e.paramsSerializer)},r.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(a(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}f.prototype[e]=t(),f.prototype[e+"Form"]=t(!0)})),e.exports=f},1218:function(e,t,n){"use strict";var r=n(3044);function i(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}r.inherits(i,Error,{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,status:this.response&&this.response.status?this.response.status:null}}});var s=i.prototype,o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){o[e]={value:e}})),Object.defineProperties(i,o),Object.defineProperty(s,"isAxiosError",{value:!0}),i.from=function(e,t,n,o,a,u){var c=Object.create(s);return r.toFlatObject(e,c,(function(e){return e!==Error.prototype})),i.call(c,e.message,t,n,o,a),c.cause=e,c.name=e.name,u&&Object.assign(c,u),c},e.exports=i},946:function(e,t,n){"use strict";var r=n(3044);function i(){this.handlers=[]}i.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},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.clear=function(){this.handlers&&(this.handlers=[])},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},7948:function(e,t,n){"use strict";var r=n(9192),i=n(8762);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},6895:function(e,t,n){"use strict";var r=n(3044),i=n(8556),s=n(8041),o=n(663),a=n(8047),u=n(8868);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,null,e.transformRequest),u(e.headers,"Accept"),u(e.headers,"Content-Type"),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return c(e),t.data=i.call(e,t.data,t.headers,t.status,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,t.response.status,e.transformResponse))),Promise.reject(t)}))}},2937:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e,t){t=t||{};var n={};function i(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isEmptyObject(t)?r.merge({},e):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(e[n],t[n])}function o(e){if(!r.isUndefined(t[e]))return i(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:i(void 0,e[n]):i(void 0,t[n])}function u(n){return n in t?i(e[n],t[n]):n in e?i(void 0,e[n]):void 0}var c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||s,i=t(e);r.isUndefined(i)&&t!==u||(n[e]=i)})),n}},6955:function(e,t,n){"use strict";var r=n(1218);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new r("Request failed with status code "+n.status,[r.ERR_BAD_REQUEST,r.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}},8556:function(e,t,n){"use strict";var r=n(3044),i=n(663);e.exports=function(e,t,n,s){var o=this||i;return r.forEach(s,(function(r){e=r.call(o,e,t,n)})),e}},663:function(e,t,n){"use strict";var r=n(3044),i=n(8868),s=n(1218),o=n(8560),a=n(9027),u=n(1746),c=n(7721),l=n(9468),f={"Content-Type":"application/x-www-form-urlencoded"};function d(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var p,g={transitional:o,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(p=n(353)),p),transformRequest:[function(e,t){i(t,"Accept"),i(t,"Content-Type");var n,s=t&&t["Content-Type"]||"",o=s.indexOf("application/json")>-1,c=r.isObject(e);if(c&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return o?JSON.stringify(l(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return d(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();if(c){if(-1!==s.indexOf("application/x-www-form-urlencoded"))return u(e,this.formSerializer).toString();if((n=r.isFileList(e))||s.indexOf("multipart/form-data")>-1){var f=this.env&&this.env.FormData;return a(n?{"files[]":e}:e,f&&new f,this.formSerializer)}}return c||o?(d(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||g.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(e&&r.isString(e)&&(n&&!this.responseType||i)){var o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s.from(e,s.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:c.classes.FormData,Blob:c.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){g.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){g.headers[e]=r.merge(f)})),e.exports=g},8560:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},5694:function(e,t,n){e.exports=n(1688)},9241:function(e){e.exports={version:"0.28.1"}},3831:function(e,t,n){"use strict";var r=n(9027);function i(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function s(e,t){this._pairs=[],e&&r(e,this,t)}var o=s.prototype;o.append=function(e,t){this._pairs.push([e,t])},o.toString=function(e){var t=e?function(t){return e.call(this,t,i)}:i;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")},e.exports=s},3644:function(e){"use strict";e.exports=function(e,t){return function(){return e.apply(t,arguments)}}},8030:function(e,t,n){"use strict";var r=n(3044),i=n(3831);function s(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 o=e.indexOf("#");-1!==o&&(e=e.slice(0,o));var a,u=n&&n.encode||s,c=n&&n.serialize;return(a=c?c(t,n):r.isURLSearchParams(t)?t.toString():new i(t,n).toString(u))&&(e+=(-1===e.indexOf("?")?"?":"&")+a),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 r=n(3044);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,s,o){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(s)&&a.push("domain="+s),!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(){}}},9468:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e){function t(e,n,i,s){var o=e[s++],a=Number.isFinite(+o),u=s>=e.length;return o=!o&&r.isArray(i)?i.length:o,u?(r.hasOwnProperty(i,o)?i[o]=[i[o],n]:i[o]=n,!a):(i[o]&&r.isObject(i[o])||(i[o]=[]),t(e,n,i[o],s)&&r.isArray(i[o])&&(i[o]=function(e){var t,n,r={},i=Object.keys(e),s=i.length;for(t=0;t<s;t++)r[n=i[t]]=e[n];return r}(i[o])),!a)}if(r.isFormData(e)&&r.isFunction(e.entries)){var n={};return r.forEachEntry(e,(function(e,i){t(function(e){return r.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),i,n,0)})),n}return null}},9192:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},5587:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},842:function(e,t,n){"use strict";var r=n(3044);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{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=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},8868:function(e,t,n){"use strict";var r=n(3044);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},1875:function(e,t,n){"use strict";var r=n(3044),i=["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,s,o={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.slice(0,s)).toLowerCase(),n=r.trim(e.slice(s+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o}},738:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},783:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},9027:function(e,t,n){"use strict";var r=n(3044),i=n(1218),s=n(5694);function o(e){return r.isPlainObject(e)||r.isArray(e)}function a(e){return r.endsWith(e,"[]")?e.slice(0,-2):e}function u(e,t,n){return e?e.concat(t).map((function(e,t){return e=a(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var c=r.toFlatObject(r,{},null,(function(e){return/^is[A-Z]/.test(e)}));e.exports=function(e,t,n){if(!r.isObject(e))throw new TypeError("target must be an object");t=t||new(s||FormData);var l,f=(n=r.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!r.isUndefined(t[e])}))).metaTokens,d=n.visitor||v,p=n.dots,g=n.indexes,h=(n.Blob||"undefined"!=typeof Blob&&Blob)&&((l=t)&&r.isFunction(l.append)&&"FormData"===l[Symbol.toStringTag]&&l[Symbol.iterator]);if(!r.isFunction(d))throw new TypeError("visitor must be a function");function m(e){if(null===e)return"";if(r.isDate(e))return e.toISOString();if(!h&&r.isBlob(e))throw new i("Blob is not supported. Use a Buffer instead.");return r.isArrayBuffer(e)||r.isTypedArray(e)?h&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function v(e,n,i){var s=e;if(e&&!i&&"object"==typeof e)if(r.endsWith(n,"{}"))n=f?n:n.slice(0,-2),e=JSON.stringify(e);else if(r.isArray(e)&&function(e){return r.isArray(e)&&!e.some(o)}(e)||r.isFileList(e)||r.endsWith(n,"[]")&&(s=r.toArray(e)))return n=a(n),s.forEach((function(e,i){!r.isUndefined(e)&&t.append(!0===g?u([n],i,p):null===g?n:n+"[]",m(e))})),!1;return!!o(e)||(t.append(u(i,n,p),m(e)),!1)}var y=[],w=Object.assign(c,{defaultVisitor:v,convertValue:m,isVisitable:o});if(!r.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!r.isUndefined(n)){if(-1!==y.indexOf(n))throw Error("Circular reference detected in "+i.join("."));y.push(n),r.forEach(n,(function(n,s){!0===(!r.isUndefined(n)&&d.call(t,n,r.isString(s)?s.trim():s,i,w))&&e(n,i?i.concat(s):[s])})),y.pop()}}(e),t}},1746:function(e,t,n){"use strict";var r=n(3044),i=n(9027),s=n(7721);e.exports=function(e,t){return i(e,new s.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,i){return s.isNode&&r.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}},7525:function(e,t,n){"use strict";var r=n(9241).version,i=n(1218),s={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){s[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={};s.transitional=function(e,t,n){function s(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,a){if(!1===e)throw new i(s(r," has been removed"+(t?" in "+t:"")),i.ERR_DEPRECATED);return t&&!o[r]&&(o[r]=!0,console.warn(s(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,a)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new i("options must be an object",i.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),s=r.length;s-- >0;){var o=r[s],a=t[o];if(a){var u=e[o],c=void 0===u||a(u,o,e);if(!0!==c)throw new i("option "+o+" must be "+c,i.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new i("Unknown option "+o,i.ERR_BAD_OPTION)}},validators:s}},319:function(e){"use strict";e.exports=FormData},1159:function(e,t,n){"use strict";var r=n(3831);e.exports="undefined"!=typeof URLSearchParams?URLSearchParams:r},1279:function(e,t,n){"use strict";e.exports={isBrowser:!0,classes:{URLSearchParams:n(1159),FormData:n(319),Blob},protocols:["http","https","file","blob","url","data"]}},7721:function(e,t,n){"use strict";e.exports=n(1279)},3044:function(e,t,n){"use strict";var r,i=n(3644),s=Object.prototype.toString,o=(r=Object.create(null),function(e){var t=s.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function a(e){return e=e.toLowerCase(),function(t){return o(t)===e}}function u(e){return Array.isArray(e)}function c(e){return void 0===e}var l=a("ArrayBuffer");function f(e){return"number"==typeof e}function d(e){return null!==e&&"object"==typeof e}function p(e){if("object"!==o(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var g=a("Date"),h=a("File"),m=a("Blob"),v=a("FileList");function y(e){return"[object Function]"===s.call(e)}var w=a("URLSearchParams");function b(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var x,E=(x="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return x&&e instanceof x});var S,R=a("HTMLFormElement"),I=(S=Object.prototype.hasOwnProperty,function(e,t){return S.call(e,t)});e.exports={isArray:u,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:f,isObject:d,isPlainObject:p,isEmptyObject:function(e){return e&&0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype},isUndefined:c,isDate:g,isFile:h,isBlob:m,isFunction:y,isStream:function(e){return d(e)&&y(e.pipe)},isURLSearchParams:w,isStandardBrowserEnv:function(){var e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):u(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?i(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var i,s,o,a={};if(t=t||{},null==e)return t;do{for(s=(i=Object.getOwnPropertyNames(e)).length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:o,kindOfTest:a,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(u(e))return e;var t=e.length;if(!f(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},isTypedArray:E,isFileList:v,forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var i=n.value;t.call(e,i[0],i[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:I}},5446:function(e,t,n){"use strict";n.d(t,{Z:function(){return Oe}});class r{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 i(e){Oe.config.logging&&console.log(`Gist: ${e}`)}var s,o=new Uint8Array(16);function a(){if(!s&&!(s="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 s(o)}var u=/^(?:[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 c=function(e){return"string"==typeof e&&u.test(e)},l=[],f=0;f<256;++f)l.push((f+256).toString(16).substr(1));var d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!c(n))throw TypeError("Stringified UUID is invalid");return n};var p=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 i=0;i<16;++i)t[n+i]=r[i];return t}return d(r)};const g="gist.web.isPersistingSession";function h(e,t,n=null){var r=n;r||(r=new Date).setDate(r.getDate()+365);const i={value:t,expiry:r};w().setItem(e,JSON.stringify(i))}function m(e){const t=w().getItem(e);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>new Date(n.expiry).getTime()?(v(e),null):n.value}function v(e){w().removeItem(e)}function y(){const e=sessionStorage.getItem(g);return null===e?(sessionStorage.setItem(g,"true"),!0):"true"===e}function w(){return y()?localStorage:sessionStorage}var b=n(9644),x=n.n(b);const E={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/3.0",dev:"https://renderer.gist.build/3.0",local:"http://app.local.gist.build:8080/web"}};function S(){var e=x().create({baseURL:E.GIST_QUEUE_API_ENDPOINT[Oe.config.env],timeout:2e4});e.defaults.headers.common["X-CIO-Site-Id"]=Oe.config.siteId,e.defaults.headers.common["X-CIO-Client-Platform"]="web";var t=k();return null!=t&&(e.defaults.headers.common["X-Gist-Encoded-User-Token"]=btoa(t)),e}const R="gist.web.userLocale";var I=600,O=!1;const T="gist.web.userQueueNextPullCheck";async function A(){var e;try{if(!O){var t=(new Date).getTime();O=!0;var n={"X-Gist-User-Anonymous":P(),"Content-Language":null!==m(R)?m(R):navigator.language};e=await S().post(`/api/v2/users?timestamp=${t}`,{},{headers:n})}}catch(t){t.response?e=t.response:i(`Error getting user queue: ${t}`)}finally{O=!1,function(e){if(e&&e.headers){var t=e.headers["x-gist-queue-polling-interval"];t&&t>0&&(I=t)}var n=new Date((new Date).getTime()+1e3*I);h(T,I,n)}(e)}return e}const D="gist.web.userToken",$="gist.web.usingGuestUserToken",C="gist.web.guestUserToken";function P(){return null!==m($)}function k(){return m(D)}function N(){if(null===k()){var e=m(C);null==e&&(e=p(),h(C,e),i(`Set guest user token "${e}" with expiry date set to 1 year from today`)),h(D,e),h($,!0),i(`Using anonymous session with token: "${e}"`)}}async function _(){var e=k();return null===e?null:await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t),r=Array.from(new Uint8Array(n));return r.map((e=>e.toString(16).padStart(2,"0"))).join("")}(e)}function L(e){const t={isEmbedded:!1,elementId:"",hasRouteRule:!1,routeRule:"",position:"",hasPosition:!1,shouldScale:!1,campaignId:null,messageWidth:414,overlayColor:"#00000033",persistent:!1,exitClick:!1,hasCustomWidth:!1},n=e?.properties?.gist;return n?{isEmbedded:!!n.elementId,elementId:n.elementId||"",hasRouteRule:!!n.routeRuleWeb,routeRule:n.routeRuleWeb||"",position:n.position||"",hasPosition:!!n.position,shouldScale:!!n.scale,campaignId:n.campaignId??null,messageWidth:n.messageWidth>0?n.messageWidth:t.messageWidth,hasCustomWidth:n.messageWidth>0,overlayColor:n.overlayColor||t.overlayColor,persistent:!!n.persistent,exitClick:!!n.exitClick}:t}var j=["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"];const U=e=>new Promise((t=>setTimeout(t,e))),q=["x-gist-top","x-gist-bottom","x-gist-floating-top","x-gist-floating-bottom"];function B(e,t,n,r){var s=X(e);if(s){var o=z(n.instanceId);s.classList.add(o);var a=L(n),u=a.messageWidth+"px";q.includes(e)&&!a.hasCustomWidth&&(u="100%"),j.includes(e)&&(s.style.width=u),F(e)||(s.style.height="0px"),s.innerHTML=function(e,t,n){return function(e,t,n){var r=800;return t.messageWidth>r&&(r=t.messageWidth),`\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 }\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 #x-gist-top.${e},\n #x-gist-bottom.${e},\n #x-gist-floating-top.${e},\n #x-gist-floating-bottom.${e},\n #x-gist-floating-top-left.${e},\n #x-gist-floating-top-right.${e},\n #x-gist-floating-bottom-left.${e},\n #x-gist-floating-bottom-right.${e} {\n transition: height 0.1s ease-in-out;\n }\n @media (max-width: ${r}px) {\n #x-gist-top.${e},\n #x-gist-bottom.${e},\n #x-gist-floating-top.${e},\n #x-gist-floating-bottom.${e},\n #x-gist-floating-top-left.${e},\n #x-gist-floating-top-right.${e},\n #x-gist-floating-bottom-left.${e},\n #x-gist-floating-bottom-right.${e} {\n width: 100% !important;\n }\n }\n </style>\n <div id="gist-embed-container">\n <iframe id="${e}" class="gist-frame" src="${n}"></iframe>\n </div>\n </div>`}(z(t.instanceId),n,e)}(t,n,a),W(o,r)}else i(`Message could not be embedded, elementId ${e} not found.`)}function F(e){var t=X(e);if(t)return t.style&&t.style.height&&"0px"!=t.style.height}function M(e,t,n){document.body.insertAdjacentHTML("afterbegin",function(e,t){var n=L(t);return function(e,t,n){var r=600;return t.messageWidth>r&&(r=t.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: ${t.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: ${t.messageWidth}px;\n position: absolute;\n border: none;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, height 0.1s 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: ${r}px) {\n .gist-message {\n width: 100%;\n }\n }\n </style>\n <div id="gist-overlay" class="background">\n <iframe id="${e}" class="gist-message" src="${n}"></iframe>\n </div>\n </div>`}(z(t.instanceId),n,e)}(e,t)),W(z(t.instanceId),n)}function W(e,t){const n=document.getElementById(e);n&&(n.onload=function(){!function(e,t){const n=document.getElementById(e);n&&n.contentWindow&&n.contentWindow.postMessage({options:t},"*")}(e,t)})}function V(e){var t=L(e),n=document.querySelector("#gist-overlay");if(n){n.classList.add("visible");var r=document.querySelector(".gist-message");e.position?r.classList.add(e.position):r.classList.add("center"),setTimeout(J,100),t.exitClick&&setTimeout((()=>function(e){var t=document.querySelector("#gist-overlay");t&&t.addEventListener("click",(function(){Oe.dismissMessage(e)}))}(e.instanceId)),1e3)}else H()}function H(){var e=document.querySelector("#gist-embed-message");e&&e.parentNode.removeChild(e)}function z(e){return`gist-${e}`}function J(){var e=document.querySelector(".gist-message");e&&e.classList.add("visible")}function X(e){try{var t=document.querySelector(`#${e}`);return t||null}catch{return null}}async function G(e,t){return m(e).find((e=>e.queueId===t))}function Q(e){return e.properties&&e.properties.gist&&e.properties.gist.broadcast}async function K(){const e=await _();return e?`gist.web.message.broadcasts.${e}`:null}function Z(e,t){return`${e}.${t}.numberOfTimesShown`}function Y(e,t){return`${e}.${t}.shouldShow`}async function ee(){const e=await te();if(!e)return[];const t=m(e)??[],n=await async function(){const e=await ne();return e?m(e)??[]:[]}();return t.filter((e=>!n.includes(e.queueId)))}async function te(){const e=await _();return e?`gist.web.message.user.${e}`:null}async function ne(){const e=await _();return e?`gist.web.message.user.${e}.seen`:null}async function re(e){const t=await _();return t?`gist.web.message.user.${t}.message.${e}.loading`:null}async function ie(e){if(Oe.isDocumentVisible){if(Oe.overlayInstanceId)return i(`Message ${Oe.overlayInstanceId} already showing.`),null;var t=L(e);return e.instanceId=p(),e.overlay=!0,e.firstLoad=!0,e.shouldResizeHeight=!0,e.shouldScale=t.shouldScale,e.renderStartTime=(new Date).getTime(),Oe.overlayInstanceId=e.instanceId,Oe.currentMessages.push(e),le(e)}return i("Document hidden, not showing message now."),null}async function se(e,t){return Oe.isDocumentVisible?(e.instanceId=p(),e.overlay=!1,e.firstLoad=!0,e.shouldScale=!1,e.elementId=t,e.shouldResizeHeight=!F(t),e.renderStartTime=(new Date).getTime(),Oe.currentMessages.push(e),le(e,t)):(i("Document hidden, not showing message now."),null)}async function oe(e){e?(Oe.messageDismissed(e),e.overlay?await ce(!0,e):ue(e)):i(`Message with instance id: ${e.instanceId} not found`)}async function ae(e){var t=L(e);e?t.persistent&&(i("Persistent message dismissed, logging view"),await ve(e),await fe(e)):i(`Message with instance id: ${e.instanceId} not found`)}function ue(e){var t,n;pe(e.instanceId),t=e.elementId,(n=X(t))&&(n.classList.remove("gist-visible"),n.style.removeProperty("height"),n.innerHTML="")}async function ce(e,t){pe(t.instanceId),Oe.overlayInstanceId=null,e?await async function(){var e=document.querySelector(".gist-message");e&&(e.classList.remove("visible"),await U(300)),H()}():H(),0==Oe.currentMessages.length&&(window.removeEventListener("message",me),window.removeEventListener("touchstart",he))}function le(e,t=null){if(t&&function(e){var t=X(e);return!(!t||!t.classList.contains("gist-visible"))}(t))return i(`Message ${e.messageId} already showing in element ${t}.`),null;var n={endpoint:E.ENGINE_API_ENDPOINT[Oe.config.env],siteId:Oe.config.siteId,dataCenter:Oe.config.dataCenter,messageId:e.messageId,instanceId:e.instanceId,livePreview:!1,properties:e.properties},r=`${E.GIST_VIEW_ENDPOINT[Oe.config.env]}/index.html`;return window.addEventListener("message",me),window.addEventListener("touchstart",he),t?(j.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);i("Top & bottom elements injected into page")}(t),B(t,r,e,n)):M(r,e,n),e}async function fe(e){i(`Message shown, logging view for: ${e.messageId}`);var t={};null!=e.queueId?(await ve(e),t=await async function(e){try{return await S().post(`/api/v1/logs/queue/${e}`)}catch(e){return e.response}}(e.queueId)):t=await async function(e){try{return await S().post(`/api/v1/logs/message/${e}`)}catch(e){return e.response}}(e.messageId),200===t.status?i("Message view logged"):i(`Problem logging message: ${t.status}`)}function de(e){return Oe.currentMessages.find((t=>t.instanceId===e))}function pe(e){Oe.currentMessages=Oe.currentMessages.filter((t=>t.instanceId!==e))}function ge(e,t){pe(e),Oe.currentMessages.push(t)}function he(){}async function me(e){if(e.data.gist){var t=e.data.gist.instanceId,n=de(t);if(!n)return;var r=L(n);switch(e.data.gist.method){case"routeLoaded":var s=.001*((new Date).getTime()-n.renderStartTime);i(`Engine render for message: ${n.messageId} timer elapsed in ${s.toFixed(3)} seconds`),async function(e){const t=await re(e);if(!t)return!1;v(t)}(n.queueId),n.currentRoute=e.data.gist.parameters.route,n.firstLoad&&(n.overlay?V(n):(f=n.elementId,(d=X(f))&&d.classList.add("gist-visible")),Oe.messageShown(n),r.persistent?i("Persistent message shown, skipping logging view"):await fe(n),n.firstLoad=!1),ge(t,n);break;case"tap":var o=e.data.gist.parameters.action,a=e.data.gist.parameters.name;if(Oe.messageAction(n,o,a),e.data.gist.parameters.system&&!r.persistent){await oe(n);break}try{var u=new URL(o);if(u&&"gist:"===u.protocol)switch(u.href.replace("gist://","").split("?")[0]){case"close":await oe(n),await ae(n),await ye(n),await Ee();break;case"showMessage":var c=u.searchParams.get("messageId"),l=u.searchParams.get("properties");c&&(l&&(l=JSON.parse(atob(l))),await Oe.showMessage({messageId:c,properties:l}));break;case"loadPage":(u=u.href.substring(u.href.indexOf("?url=")+5))&&(u.startsWith("https://")||u.startsWith("http://")||u.startsWith("/")?window.location.href=u:window.location.href=window.location+u)}}catch{}break;case"routeChanged":n.currentRoute=e.data.gist.parameters.route,n.renderStartTime=(new Date).getTime(),ge(t,n),i(`Route changed to: ${n.currentRoute}`);break;case"sizeChanged":i(`Size Changed Width: ${e.data.gist.parameters.width} - Height: ${e.data.gist.parameters.height}`),n.elementId&&!n.shouldResizeHeight||function(e,t){var n=X(e.elementId?e.elementId:z(e.instanceId));if(n){var r=n.style;if(t.height>0)if(t.height>window.innerHeight){var i=1-(t.height/window.innerHeight-1);e.shouldScale&&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`}}(n,e.data.gist.parameters);break;case"titleChanged":i(`Overlay title changed to: ${e.data.gist.parameters.title}`),function(e,t){var n=X(z(e));n&&(n.title=t)}(t,e.data.gist.parameters.title);break;case"eventDispatched":Oe.events.dispatch("eventDispatched",{name:e.data.gist.parameters.name,payload:e.data.gist.parameters.payload});break;case"error":case"routeError":Oe.messageError(n),Oe.overlayInstanceId?ce(!1,n):ue(n)}}var f,d}async function ve(e){i(`Logging user message view locally for: ${e.queueId}`),Q(e)?await async function(e){i(`Marking broadcast ${e} as seen.`);const t=await K();if(!t)return;const n=await G(t,e);if(!n)return;const{broadcast:r}=n.properties.gist,s=Z(t,e),o=Y(t,e);let a=m(s)||0;if(h(s,a+1),1===r.frequency.count)h(o,!1),i(`Marked broadcast ${e} as seen.`);else{let t=new Date;t.setSeconds(t.getSeconds()+r.frequency.delay),h(o,!1,t),i(`Marked broadcast ${e} as seen, broadcast was seen ${a+1} times, next show date is ${t}.`)}}(e.queueId):await async function(e){const t=await ne();if(!t)return;const n=m(t)??[];n.push(e),h(t,n)}(e.queueId)}async function ye(e){Q(e)&&(i(`Logging broadcast dismissed locally for: ${e.queueId}`),await async function(e){i(`Marking broadcast ${e} as dismissed.`);const t=await K();if(!t)return;const n=await G(t,e);if(!n)return;const{broadcast:r}=n.properties.gist;if(!0===r.frequency.ignoreDismiss)return void i(`Broadcast ${e} is set to ignore dismiss.`);h(Y(t,e),!1),i(`Marked broadcast ${e} as dismissed and will not show again.`)}(e.queueId))}var we=(e,t)=>e().then((e=>new Promise((t=>setTimeout(t,e))))(t).then((()=>we(e,t)))),be=!1;async function xe(){be?Ee():(!async function(){var e=`G${p().substring(0,8)}`,t=document.createElement("div");t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),await U(5e3),se({messageId:""},e)}(),k()?(i("Queue watcher started"),be=!0,we((()=>new Promise((()=>async function(){if(k())if(Oe.isDocumentVisible)if(null===m(T)){var e=await A(),t=[];e?(200===e.status||204===e.status?(i("200 response, updating local store."),async function(e){const t=await te();if(!t)return;h(t,e.filter((e=>!(e.properties&&e.properties.gist&&e.properties.gist.broadcast))),new Date(Date.now()+36e5))}(t=e.data),async function(e){const t=await K();if(!t)return;const n=new Date;n.setDate(n.getDate()+30),h(t,e.filter(Q),n)}(t)):304===e.status&&i("304 response, using local store."),await Ee()):i("There was an error while checking message queue.")}else i("Next queue pull scheduled for later.");else i("Document not visible, skipping queue check.");else i("User token reset, skipping queue check.")}()))),1e3)):i("User token not setup, queue not started."))}async function Ee(){var e=await async function(){const e=await K();return e?(m(e)??[]).filter((t=>{const{broadcast:n}=t.properties.gist,r=m(Y(e,t.queueId))??!0,i=m(Z(e,t.queueId))||0,s=0===n.frequency.count;return r&&(s||i<n.frequency.count)})):[]}(),t=await ee(),n=e.concat(t);i(`Messages in local queue: ${n.length}`);var r=n.sort(((e,t)=>e.priority-t.priority));for(const e of r)await Se(e)}async function Se(e){var t=L(e);if(t.hasRouteRule){var n=Oe.currentRoute;null==n&&(n=new URL(window.location.href).pathname);var r=t.routeRule;if(i(`Verifying route against rule: ${r}`),!new RegExp(r).test(n))return i(`Route ${n} does not match rule.`),!1}if(t.hasPosition&&(e.position=t.position),t.persistent||function(e){if(!Q(e))return!1;const{broadcast:t}=e.properties.gist;return 0===t.frequency.delay&&0===t.frequency.count}(e)||!await async function(e){const t=await re(e);return!!t&&null!==m(t)}(e.queueId)){var s=!1;return(s=t.isEmbedded?await se(e,t.elementId):await ie(e))&&async function(e){const t=await re(e);if(!t)return!1;h(t,!0,new Date(Date.now()+5e3))}(e.queueId),s}return i(`Not showing message with queueId ${e.queueId} because its already loading.`),!1}const Re="cioPreviewId";function Ie(){const e=new URLSearchParams(window.location.search).get(Re);var t;return e&&(t=!1,sessionStorage.setItem(g,t),Oe.setUserToken(e),i(`Preview mode enabled with user token: ${e}`)),!y()}var Oe=class{static async setup(e){this.events=new r,this.config={useAnonymousSession:void 0!==e.useAnonymousSession&&e.useAnonymousSession,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,this.config.isPreviewSession=Ie(),i(`Setup complete on ${this.config.env} environment.`),!this.config.isPreviewSession&&this.config.useAnonymousSession&&N(),await xe(),document.addEventListener("visibilitychange",(async()=>{"hidden"===document.visibilityState?this.isDocumentVisible=!1:(this.isDocumentVisible=!0,await Ee())}),!1)}static async setCurrentRoute(e){this.currentRoute=e,i(`Current route set to: ${e}`),await Ee()}static async setUserToken(e,t){this.config.isPreviewSession||(!function(e,t){void 0===t&&(t=new Date).setDate(t.getDate()+30),h(D,e,t),P()&&(v(T),v($)),i(`Set user token "${e}" with expiry date set to ${t}`)}(e,t),await xe())}static setUserLocale(e){var t;h(R,t=e),i(`Set user locate to "${t}"`)}static async clearUserToken(){this.config.isPreviewSession||(v(D),i("Cleared user token"),this.config.useAnonymousSession&&N(),await xe())}static async dismissMessage(e){var t=de(e);await oe(t),await ae(t),await ye(t),await Ee()}static async embedMessage(e,t){var n=await se(e,t);return n?n.instanceId:null}static async showMessage(e){var t=await ie(e);return t?t.instanceId:null}static messageShown(e){i(`Message shown: ${e.messageId}`),this.events.dispatch("messageShown",e)}static messageDismissed(e){null!==e&&(i(`Message dismissed: ${e.messageId}`),this.events.dispatch("messageDismissed",e))}static messageError(e){i(`Message error: ${e.messageId}`),this.events.dispatch("messageError",e)}static messageAction(e,t,n){i(`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 r=n(5446).Z;e.exports=r},1688:function(e){e.exports="object"==typeof self?self.FormData:window.FormData}}]);
Binary file
package/dist/umd/870.js CHANGED
@@ -1 +1 @@
1
- (self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[870],{2870:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.Store=r.matches=r.transform=void 0;var o=e(4303);Object.defineProperty(r,"transform",{enumerable:!0,get:function(){return n(o).default}});var i=e(2370);Object.defineProperty(r,"matches",{enumerable:!0,get:function(){return n(i).default}});var u=e(1444);Object.defineProperty(r,"Store",{enumerable:!0,get:function(){return n(u).default}})},2370:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(e(7843));function i(t,r){if(!Array.isArray(t))return!0===u(t,r);var e=t[0];switch(e){case"!":return!i(t[1],r);case"or":for(var n=1;n<t.length;n++)if(i(t[n],r))return!0;return!1;case"and":for(n=1;n<t.length;n++)if(!i(t[n],r))return!1;return!0;case"=":case"!=":return function(t,r,e,n){s(t)&&(t=i(t,n));s(r)&&(r=i(r,n));"object"==typeof t&&"object"==typeof r&&(t=JSON.stringify(t),r=JSON.stringify(r));switch(e){case"=":return t===r;case"!=":return t!==r;default:throw new Error("Invalid operator in compareItems: ".concat(e))}}(u(t[1],r),u(t[2],r),e,r);case"<=":case"<":case">":case">=":return function(t,r,e,n){s(t)&&(t=i(t,n));s(r)&&(r=i(r,n));if("number"!=typeof t||"number"!=typeof r)return!1;switch(e){case"<=":return t<=r;case">=":return t>=r;case"<":return t<r;case">":return t>r;default:throw new Error("Invalid operator in compareNumbers: ".concat(e))}}(u(t[1],r),u(t[2],r),e,r);case"in":return function(t,r,e){return void 0!==r.find((function(r){return u(r,e)===t}))}(u(t[1],r),u(t[2],r),r);case"contains":return function(t,r){if("string"!=typeof t||"string"!=typeof r)return!1;return-1!==t.indexOf(r)}(u(t[1],r),u(t[2],r));case"match":return function(t,r){if("string"!=typeof t||"string"!=typeof r)return!1;return function(t,r){var e,n;t:for(;t.length>0;){var o=void 0,i=void 0;if(o=(e=c(t)).star,i=e.chunk,t=e.pattern,o&&""===i)return!0;var u=a(i,r),s=u.t,f=u.ok,p=u.err;if(p)return!1;if(!f||!(0===s.length||t.length>0)){if(o)for(var l=0;l<r.length;l++){if(s=(n=a(i,r.slice(l+1))).t,f=n.ok,p=n.err,f){if(0===t.length&&s.length>0)continue;r=s;continue t}if(p)return!1}return!1}r=s}return 0===r.length}(r,t)}(u(t[1],r),u(t[2],r));case"lowercase":var o=u(t[1],r);return"string"!=typeof o?null:o.toLowerCase();case"typeof":return typeof u(t[1],r);case"length":return function(t){if(null===t)return 0;if(!Array.isArray(t)&&"string"!=typeof t)return NaN;return t.length}(u(t[1],r));default:throw new Error("FQL IR could not evaluate for token: ".concat(e))}}function u(t,r){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,o.default)(r,t)}function s(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function c(t){for(var r={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),r.star=!0;var e,n=!1;t:for(e=0;e<t.length;e++)switch(t[e]){case"\\":e+1<t.length&&e++;break;case"[":n=!0;break;case"]":n=!1;break;case"*":if(!n)break t}return r.chunk=t.slice(0,e),r.pattern=t.slice(e),r}function a(t,r){for(var e,n,o={t:"",ok:!1,err:!1};t.length>0;){if(0===r.length)return o;switch(t[0]){case"[":var i=r[0];r=r.slice(1);var u=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(u=!1,t=t.slice(1));for(var s=!1,c=0;;){if(t.length>0&&"]"===t[0]&&c>0){t=t.slice(1);break}var a,p="";if(a=(e=f(t)).char,t=e.newChunk,e.err)return o;if(p=a,"-"===t[0]&&(p=(n=f(t.slice(1))).char,t=n.newChunk,n.err))return o;a<=i&&i<=p&&(s=!0),c++}if(s!==u)return o;break;case"?":r=r.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return o.err=!0,o;default:if(t[0]!==r[0])return o;r=r.slice(1),t=t.slice(1)}}return o.t=r,o.ok=!0,o.err=!1,o}function f(t){var r={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(r.err=!0,r):(r.char=t[0],r.newChunk=t.slice(1),0===r.newChunk.length&&(r.err=!0),r)}r.default=function(t,r){if(!r)throw new Error("No matcher supplied!");switch(r.type){case"all":return!0;case"fql":return function(t,r){if(!t)return!1;try{t=JSON.parse(t)}catch(r){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(r))}var e=i(t,r);if("boolean"!=typeof e)return!1;return e}(r.ir,t);default:throw new Error("Matcher of type ".concat(r.type," unsupported."))}}},1444:function(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var r=[],e=0,n=this.rules;e<n.length;e++){var o=n[e];o.destinationName!==t&&void 0!==o.destinationName||r.push(o)}return r},t}();r.default=e},4303:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(e(2263)),i=n(e(7843)),u=n(e(5500)),s=e(2341),c=e(4966);function a(t,r){for(var e in r.drop)if(r.drop.hasOwnProperty(e)){var n=""===e?t:(0,i.default)(t,e);if("object"==typeof n&&null!==n)for(var o=0,u=r.drop[e];o<u.length;o++){delete n[u[o]]}}}function f(t,r){for(var e in r.allow)if(r.allow.hasOwnProperty(e)){var n=""===e?t:(0,i.default)(t,e);if("object"==typeof n&&null!==n)for(var o in n)n.hasOwnProperty(o)&&-1===r.allow[e].indexOf(o)&&delete n[o]}}function p(t,r){var e=JSON.parse(JSON.stringify(t));for(var n in r.map)if(r.map.hasOwnProperty(n)){var o=r.map[n],u=n.split("."),a=void 0;if(u.length>1?(u.pop(),a=(0,i.default)(e,u.join("."))):a=t,"object"==typeof a){if(o.copy){var f=(0,i.default)(e,o.copy);void 0!==f&&(0,s.dset)(t,n,f)}else if(o.move){var p=(0,i.default)(e,o.move);void 0!==p&&(0,s.dset)(t,n,p),(0,c.unset)(t,o.move)}else o.hasOwnProperty("set")&&(0,s.dset)(t,n,o.set);if(o.to_string){var l=(0,i.default)(t,n);if("string"==typeof l||"object"==typeof l&&null!==l)continue;void 0!==l?(0,s.dset)(t,n,JSON.stringify(l)):(0,s.dset)(t,n,"undefined")}}}}function l(t,r){return!(r.sample.percent<=0)&&(r.sample.percent>=1||(r.sample.path?function(t,r){var e=(0,i.default)(t,r.sample.path),n=(0,o.default)(JSON.stringify(e)),s=-64,c=[];v(n.slice(0,8),c);for(var a=0,f=0;f<64&&1!==c[f];f++)a++;if(0!==a){var p=[];v(n.slice(9,16),p),s-=a,c.splice(0,a),p.splice(64-a),c=c.concat(p)}return c[63]=0===c[63]?1:0,(0,u.default)(parseInt(c.join(""),2),s)<r.sample.percent}(t,r):(e=r.sample.percent,Math.random()<=e)));var e}function v(t,r){for(var e=0;e<8;e++)for(var n=t[e],o=128;o>=1;o/=2)n-o>=0?(n-=o,r.push(1)):r.push(0)}r.default=function(t,r){for(var e=t,n=0,o=r;n<o.length;n++){var i=o[n];switch(i.type){case"drop":return null;case"drop_properties":a(e,i.config);break;case"allow_properties":f(e,i.config);break;case"sample_event":if(l(e,i.config))break;return null;case"map_properties":p(e,i.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(i.type,'" is unsupported.'))}}return e}},4966:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.unset=void 0;var o=n(e(7843));r.unset=function(t,r){if((0,o.default)(t,r)){for(var e=r.split("."),n=e.pop();e.length&&"\\"===e[e.length-1].slice(-1);)n=e.pop().slice(0,-1)+"."+n;for(;e.length;)t=t[r=e.shift()];return delete t[n]}return!0}},3304:function(t){"use strict";var r="function"==typeof Float64Array?Float64Array:void 0;t.exports=r},7382:function(t,r,e){"use strict";var n,o=e(5569),i=e(3304),u=e(8482);n=o()?i:u,t.exports=n},8482:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},6322:function(t,r,e){"use strict";var n,o=e(2508),i=e(5679),u=e(882);n=o()?i:u,t.exports=n},882:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},5679:function(t){"use strict";var r="function"==typeof Uint16Array?Uint16Array:void 0;t.exports=r},4773:function(t,r,e){"use strict";var n,o=e(9773),i=e(3004),u=e(3078);n=o()?i:u,t.exports=n},3078:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},3004:function(t){"use strict";var r="function"==typeof Uint32Array?Uint32Array:void 0;t.exports=r},7980:function(t,r,e){"use strict";var n,o=e(8114),i=e(6737),u=e(3357);n=o()?i:u,t.exports=n},3357:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},6737:function(t){"use strict";var r="function"==typeof Uint8Array?Uint8Array:void 0;t.exports=r},2684:function(t){"use strict";var r="function"==typeof Float64Array?Float64Array:null;t.exports=r},5569:function(t,r,e){"use strict";var n=e(3876);t.exports=n},3876:function(t,r,e){"use strict";var n=e(1448),o=e(2684);t.exports=function(){var t,r;if("function"!=typeof o)return!1;try{r=new o([1,3.14,-3.14,NaN]),t=n(r)&&1===r[0]&&3.14===r[1]&&-3.14===r[2]&&r[3]!=r[3]}catch(r){t=!1}return t}},9048:function(t,r,e){"use strict";var n=e(3763);t.exports=n},3763:function(t){"use strict";var r=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&r.call(t,e)}},7009:function(t,r,e){"use strict";var n=e(6784);t.exports=n},6784:function(t){"use strict";t.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},3123:function(t,r,e){"use strict";var n=e(8481);t.exports=n},8481:function(t,r,e){"use strict";var n=e(7009)();t.exports=function(){return n&&"symbol"==typeof Symbol.toStringTag}},2508:function(t,r,e){"use strict";var n=e(3403);t.exports=n},3403:function(t,r,e){"use strict";var n=e(768),o=e(9668),i=e(187);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},187:function(t){"use strict";var r="function"==typeof Uint16Array?Uint16Array:null;t.exports=r},9773:function(t,r,e){"use strict";var n=e(2822);t.exports=n},2822:function(t,r,e){"use strict";var n=e(2744),o=e(3899),i=e(746);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},746:function(t){"use strict";var r="function"==typeof Uint32Array?Uint32Array:null;t.exports=r},8114:function(t,r,e){"use strict";var n=e(8066);t.exports=n},8066:function(t,r,e){"use strict";var n=e(8279),o=e(3443),i=e(2731);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},2731:function(t){"use strict";var r="function"==typeof Uint8Array?Uint8Array:null;t.exports=r},1448:function(t,r,e){"use strict";var n=e(1453);t.exports=n},1453:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Float64Array;t.exports=function(t){return o&&t instanceof Float64Array||"[object Float64Array]"===n(t)}},9331:function(t,r,e){"use strict";var n=e(7980),o={uint16:e(6322),uint8:n};t.exports=o},5902:function(t,r,e){"use strict";var n=e(4106);t.exports=n},4106:function(t,r,e){"use strict";var n,o,i=e(9331);(o=new i.uint16(1))[0]=4660,n=52===new i.uint8(o.buffer)[0],t.exports=n},768:function(t,r,e){"use strict";var n=e(3823);t.exports=n},3823:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint16Array;t.exports=function(t){return o&&t instanceof Uint16Array||"[object Uint16Array]"===n(t)}},2744:function(t,r,e){"use strict";var n=e(2326);t.exports=n},2326:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint32Array;t.exports=function(t){return o&&t instanceof Uint32Array||"[object Uint32Array]"===n(t)}},8279:function(t,r,e){"use strict";var n=e(208);t.exports=n},208:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint8Array;t.exports=function(t){return o&&t instanceof Uint8Array||"[object Uint8Array]"===n(t)}},6315:function(t){"use strict";t.exports=1023},3105:function(t){"use strict";t.exports=2146435072},6988:function(t){"use strict";t.exports=-1023},9777:function(t){"use strict";t.exports=1023},3690:function(t){"use strict";t.exports=-1074},2918:function(t,r,e){"use strict";var n=e(4772).NEGATIVE_INFINITY;t.exports=n},4165:function(t){"use strict";var r=Number.POSITIVE_INFINITY;t.exports=r},6488:function(t){"use strict";t.exports=22250738585072014e-324},9668:function(t){"use strict";t.exports=65535},3899:function(t){"use strict";t.exports=4294967295},3443:function(t){"use strict";t.exports=255},7011:function(t,r,e){"use strict";var n=e(812);t.exports=n},812:function(t,r,e){"use strict";var n=e(4165),o=e(2918);t.exports=function(t){return t===n||t===o}},1883:function(t,r,e){"use strict";var n=e(1797);t.exports=n},1797:function(t){"use strict";t.exports=function(t){return t!=t}},513:function(t,r,e){"use strict";var n=e(5760);t.exports=n},5760:function(t){"use strict";t.exports=function(t){return Math.abs(t)}},6871:function(t,r,e){"use strict";var n=e(7838),o=e(1921),i=e(2490),u=[0,0];t.exports=function(t,r){var e,s;return n(u,t),e=u[0],e&=2147483647,s=o(r),i(e|=s&=2147483648,u[1])}},5848:function(t,r,e){"use strict";var n=e(6871);t.exports=n},5500:function(t,r,e){"use strict";var n=e(8397);t.exports=n},8397:function(t,r,e){"use strict";var n=e(4165),o=e(2918),i=e(6315),u=e(9777),s=e(6988),c=e(3690),a=e(1883),f=e(7011),p=e(5848),l=e(4948),v=e(8478),y=e(7838),h=e(2490),d=[0,0],x=[0,0];t.exports=function(t,r){var e,g;return 0===t||a(t)||f(t)?t:(l(d,t),r+=d[1],(r+=v(t=d[0]))<c?p(0,t):r>u?t<0?o:n:(r<=s?(r+=52,g=2220446049250313e-31):g=1,y(x,t),e=x[0],e&=2148532223,g*h(e|=r+i<<20,x[1])))}},4772:function(t,r,e){"use strict";var n=e(7548);t.exports=n},7548:function(t){"use strict";t.exports=Number},8478:function(t,r,e){"use strict";var n=e(4500);t.exports=n},4500:function(t,r,e){"use strict";var n=e(1921),o=e(3105),i=e(6315);t.exports=function(t){var r=n(t);return(r=(r&o)>>>20)-i|0}},2490:function(t,r,e){"use strict";var n=e(9639);t.exports=n},4445:function(t,r,e){"use strict";var n,o,i;!0===e(5902)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},t.exports=n},9639:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(4445),u=new o(1),s=new n(u.buffer),c=i.HIGH,a=i.LOW;t.exports=function(t,r){return s[c]=t,s[a]=r,u[0]}},5646:function(t,r,e){"use strict";var n;n=!0===e(5902)?1:0,t.exports=n},1921:function(t,r,e){"use strict";var n=e(6285);t.exports=n},6285:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(5646),u=new o(1),s=new n(u.buffer);t.exports=function(t){return u[0]=t,s[i]}},4948:function(t,r,e){"use strict";var n=e(9422);t.exports=n},9422:function(t,r,e){"use strict";var n=e(8857);t.exports=function(t,r){return 1===arguments.length?n([0,0],t):n(t,r)}},8857:function(t,r,e){"use strict";var n=e(6488),o=e(7011),i=e(1883),u=e(513);t.exports=function(t,r){return i(r)||o(r)?(t[0]=r,t[1]=0,t):0!==r&&u(r)<n?(t[0]=4503599627370496*r,t[1]=-52,t):(t[0]=r,t[1]=0,t)}},7838:function(t,r,e){"use strict";var n=e(4010);t.exports=n},5782:function(t,r,e){"use strict";var n,o,i;!0===e(5902)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},t.exports=n},4010:function(t,r,e){"use strict";var n=e(4903);t.exports=function(t,r){return 1===arguments.length?n([0,0],t):n(t,r)}},4903:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(5782),u=new o(1),s=new n(u.buffer),c=i.HIGH,a=i.LOW;t.exports=function(t,r){return u[0]=r,t[0]=s[c],t[1]=s[a],t}},6208:function(t,r,e){"use strict";var n,o=e(3123),i=e(7407),u=e(4210);n=o()?u:i,t.exports=n},7407:function(t,r,e){"use strict";var n=e(173);t.exports=function(t){return n.call(t)}},4210:function(t,r,e){"use strict";var n=e(9048),o=e(1403),i=e(173);t.exports=function(t){var r,e,u;if(null==t)return i.call(t);e=t[o],r=n(t,o);try{t[o]=void 0}catch(r){return i.call(t)}return u=i.call(t),r?t[o]=e:delete t[o],u}},173:function(t){"use strict";var r=Object.prototype.toString;t.exports=r},1403:function(t){"use strict";var r="function"==typeof Symbol?Symbol.toStringTag:"";t.exports=r},7843:function(t){t.exports=function(t,r,e,n,o){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)t=t?t[r[n]]:o;return t===o?e:t}},2341:function(t,r){r.dset=function(t,r,e){r.split&&(r=r.split("."));for(var n,o,i=0,u=r.length,s=t;i<u&&"__proto__"!==(o=r[i++])&&"constructor"!==o&&"prototype"!==o;)s=s[o]=i===u?e:typeof(n=s[o])==typeof r?n:0*r[i]!=0||~(""+r[i]).indexOf(".")?{}:[]}},2263:function(t,r,e){"use strict";e.r(r),e.d(r,{default:function(){return i}});for(var n=[],o=0;o<64;)n[o]=0|4294967296*Math.sin(++o%Math.PI);function i(t){var r,e,i,u=[r=1732584193,e=4023233417,~r,~e],s=[],c=unescape(encodeURI(t))+"€",a=c.length;for(t=--a/4+2|15,s[--t]=8*a;~a;)s[a>>2]|=c.charCodeAt(a)<<8*a--;for(o=c=0;o<t;o+=16){for(a=u;c<64;a=[i=a[3],r+((i=a[0]+[r&e|~r&i,i&r|~i&e,r^e^i,e^(r|~i)][a=c>>4]+n[c]+~~s[o|15&[c,5*c+1,3*c+5,7*c][a]])<<(a=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*a+c++%4])|i>>>-a),r,e])r=0|a[1],e=a[2];for(c=4;c;)u[--c]+=a[c]}for(t="";c<32;)t+=(u[c>>3]>>4*(1^c++)&15).toString(16);return t}}}]);
1
+ (self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[870],{2870:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.Store=r.matches=r.transform=void 0;var o=e(4303);Object.defineProperty(r,"transform",{enumerable:!0,get:function(){return n(o).default}});var i=e(2370);Object.defineProperty(r,"matches",{enumerable:!0,get:function(){return n(i).default}});var u=e(1444);Object.defineProperty(r,"Store",{enumerable:!0,get:function(){return n(u).default}})},2370:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(e(7843));function i(t,r){if(!Array.isArray(t))return!0===u(t,r);var e=t[0];switch(e){case"!":return!i(t[1],r);case"or":for(var n=1;n<t.length;n++)if(i(t[n],r))return!0;return!1;case"and":for(n=1;n<t.length;n++)if(!i(t[n],r))return!1;return!0;case"=":case"!=":return function(t,r,e,n){s(t)&&(t=i(t,n));s(r)&&(r=i(r,n));"object"==typeof t&&"object"==typeof r&&(t=JSON.stringify(t),r=JSON.stringify(r));switch(e){case"=":return t===r;case"!=":return t!==r;default:throw new Error("Invalid operator in compareItems: ".concat(e))}}(u(t[1],r),u(t[2],r),e,r);case"<=":case"<":case">":case">=":return function(t,r,e,n){s(t)&&(t=i(t,n));s(r)&&(r=i(r,n));if("number"!=typeof t||"number"!=typeof r)return!1;switch(e){case"<=":return t<=r;case">=":return t>=r;case"<":return t<r;case">":return t>r;default:throw new Error("Invalid operator in compareNumbers: ".concat(e))}}(u(t[1],r),u(t[2],r),e,r);case"in":return function(t,r,e){return void 0!==r.find((function(r){return u(r,e)===t}))}(u(t[1],r),u(t[2],r),r);case"contains":return function(t,r){if("string"!=typeof t||"string"!=typeof r)return!1;return-1!==t.indexOf(r)}(u(t[1],r),u(t[2],r));case"match":return function(t,r){if("string"!=typeof t||"string"!=typeof r)return!1;return function(t,r){var e,n;t:for(;t.length>0;){var o=void 0,i=void 0;if(o=(e=c(t)).star,i=e.chunk,t=e.pattern,o&&""===i)return!0;var u=a(i,r),s=u.t,f=u.ok,p=u.err;if(p)return!1;if(!f||!(0===s.length||t.length>0)){if(o)for(var l=0;l<r.length;l++){if(s=(n=a(i,r.slice(l+1))).t,f=n.ok,p=n.err,f){if(0===t.length&&s.length>0)continue;r=s;continue t}if(p)return!1}return!1}r=s}return 0===r.length}(r,t)}(u(t[1],r),u(t[2],r));case"lowercase":var o=u(t[1],r);return"string"!=typeof o?null:o.toLowerCase();case"typeof":return typeof u(t[1],r);case"length":return function(t){if(null===t)return 0;if(!Array.isArray(t)&&"string"!=typeof t)return NaN;return t.length}(u(t[1],r));default:throw new Error("FQL IR could not evaluate for token: ".concat(e))}}function u(t,r){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,o.default)(r,t)}function s(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function c(t){for(var r={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),r.star=!0;var e,n=!1;t:for(e=0;e<t.length;e++)switch(t[e]){case"\\":e+1<t.length&&e++;break;case"[":n=!0;break;case"]":n=!1;break;case"*":if(!n)break t}return r.chunk=t.slice(0,e),r.pattern=t.slice(e),r}function a(t,r){for(var e,n,o={t:"",ok:!1,err:!1};t.length>0;){if(0===r.length)return o;switch(t[0]){case"[":var i=r[0];r=r.slice(1);var u=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(u=!1,t=t.slice(1));for(var s=!1,c=0;;){if(t.length>0&&"]"===t[0]&&c>0){t=t.slice(1);break}var a,p="";if(a=(e=f(t)).char,t=e.newChunk,e.err)return o;if(p=a,"-"===t[0]&&(p=(n=f(t.slice(1))).char,t=n.newChunk,n.err))return o;a<=i&&i<=p&&(s=!0),c++}if(s!==u)return o;break;case"?":r=r.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return o.err=!0,o;default:if(t[0]!==r[0])return o;r=r.slice(1),t=t.slice(1)}}return o.t=r,o.ok=!0,o.err=!1,o}function f(t){var r={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(r.err=!0,r):(r.char=t[0],r.newChunk=t.slice(1),0===r.newChunk.length&&(r.err=!0),r)}r.default=function(t,r){if(!r)throw new Error("No matcher supplied!");switch(r.type){case"all":return!0;case"fql":return function(t,r){if(!t)return!1;try{t=JSON.parse(t)}catch(r){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(r))}var e=i(t,r);if("boolean"!=typeof e)return!1;return e}(r.ir,t);default:throw new Error("Matcher of type ".concat(r.type," unsupported."))}}},1444:function(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var r=[],e=0,n=this.rules;e<n.length;e++){var o=n[e];o.destinationName!==t&&void 0!==o.destinationName||r.push(o)}return r},t}();r.default=e},4303:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});var o=n(e(2263)),i=n(e(7843)),u=n(e(5500)),s=e(2341),c=e(4966);function a(t,r){p(t,r.drop,(function(t,r){r.forEach((function(r){return delete t[r]}))}))}function f(t,r){p(t,r.allow,(function(t,r){Object.keys(t).forEach((function(e){r.includes(e)||delete t[e]}))}))}function p(t,r,e){Object.entries(r).forEach((function(r){var n=r[0],o=r[1],u=function(t){"object"==typeof t&&null!==t&&e(t,o)},s=""===n?t:(0,i.default)(t,n);Array.isArray(s)?s.forEach(u):u(s)}))}function l(t,r){var e=JSON.parse(JSON.stringify(t));for(var n in r.map)if(r.map.hasOwnProperty(n)){var o=r.map[n],u=n.split("."),a=void 0;if(u.length>1?(u.pop(),a=(0,i.default)(e,u.join("."))):a=t,"object"==typeof a){if(o.copy){var f=(0,i.default)(e,o.copy);void 0!==f&&(0,s.dset)(t,n,f)}else if(o.move){var p=(0,i.default)(e,o.move);void 0!==p&&(0,s.dset)(t,n,p),(0,c.unset)(t,o.move)}else o.hasOwnProperty("set")&&(0,s.dset)(t,n,o.set);if(o.to_string){var l=(0,i.default)(t,n);if("string"==typeof l||"object"==typeof l&&null!==l)continue;void 0!==l?(0,s.dset)(t,n,JSON.stringify(l)):(0,s.dset)(t,n,"undefined")}}}}function v(t,r){return!(r.sample.percent<=0)&&(r.sample.percent>=1||(r.sample.path?function(t,r){var e=(0,i.default)(t,r.sample.path),n=(0,o.default)(JSON.stringify(e)),s=-64,c=[];y(n.slice(0,8),c);for(var a=0,f=0;f<64&&1!==c[f];f++)a++;if(0!==a){var p=[];y(n.slice(9,16),p),s-=a,c.splice(0,a),p.splice(64-a),c=c.concat(p)}return c[63]=0===c[63]?1:0,(0,u.default)(parseInt(c.join(""),2),s)<r.sample.percent}(t,r):(e=r.sample.percent,Math.random()<=e)));var e}function y(t,r){for(var e=0;e<8;e++)for(var n=t[e],o=128;o>=1;o/=2)n-o>=0?(n-=o,r.push(1)):r.push(0)}r.default=function(t,r){for(var e=t,n=0,o=r;n<o.length;n++){var i=o[n];switch(i.type){case"drop":return null;case"drop_properties":a(e,i.config);break;case"allow_properties":f(e,i.config);break;case"sample_event":if(v(e,i.config))break;return null;case"map_properties":l(e,i.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(i.type,'" is unsupported.'))}}return e}},4966:function(t,r,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.unset=void 0;var o=n(e(7843));r.unset=function(t,r){if((0,o.default)(t,r)){for(var e=r.split("."),n=e.pop();e.length&&"\\"===e[e.length-1].slice(-1);)n=e.pop().slice(0,-1)+"."+n;for(;e.length;)t=t[r=e.shift()];return delete t[n]}return!0}},3304:function(t){"use strict";var r="function"==typeof Float64Array?Float64Array:void 0;t.exports=r},7382:function(t,r,e){"use strict";var n,o=e(5569),i=e(3304),u=e(8482);n=o()?i:u,t.exports=n},8482:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},6322:function(t,r,e){"use strict";var n,o=e(2508),i=e(5679),u=e(882);n=o()?i:u,t.exports=n},882:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},5679:function(t){"use strict";var r="function"==typeof Uint16Array?Uint16Array:void 0;t.exports=r},4773:function(t,r,e){"use strict";var n,o=e(9773),i=e(3004),u=e(3078);n=o()?i:u,t.exports=n},3078:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},3004:function(t){"use strict";var r="function"==typeof Uint32Array?Uint32Array:void 0;t.exports=r},7980:function(t,r,e){"use strict";var n,o=e(8114),i=e(6737),u=e(3357);n=o()?i:u,t.exports=n},3357:function(t){"use strict";t.exports=function(){throw new Error("not implemented")}},6737:function(t){"use strict";var r="function"==typeof Uint8Array?Uint8Array:void 0;t.exports=r},2684:function(t){"use strict";var r="function"==typeof Float64Array?Float64Array:null;t.exports=r},5569:function(t,r,e){"use strict";var n=e(3876);t.exports=n},3876:function(t,r,e){"use strict";var n=e(1448),o=e(2684);t.exports=function(){var t,r;if("function"!=typeof o)return!1;try{r=new o([1,3.14,-3.14,NaN]),t=n(r)&&1===r[0]&&3.14===r[1]&&-3.14===r[2]&&r[3]!=r[3]}catch(r){t=!1}return t}},9048:function(t,r,e){"use strict";var n=e(3763);t.exports=n},3763:function(t){"use strict";var r=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&r.call(t,e)}},7009:function(t,r,e){"use strict";var n=e(6784);t.exports=n},6784:function(t){"use strict";t.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},3123:function(t,r,e){"use strict";var n=e(8481);t.exports=n},8481:function(t,r,e){"use strict";var n=e(7009)();t.exports=function(){return n&&"symbol"==typeof Symbol.toStringTag}},2508:function(t,r,e){"use strict";var n=e(3403);t.exports=n},3403:function(t,r,e){"use strict";var n=e(768),o=e(9668),i=e(187);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},187:function(t){"use strict";var r="function"==typeof Uint16Array?Uint16Array:null;t.exports=r},9773:function(t,r,e){"use strict";var n=e(2822);t.exports=n},2822:function(t,r,e){"use strict";var n=e(2744),o=e(3899),i=e(746);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},746:function(t){"use strict";var r="function"==typeof Uint32Array?Uint32Array:null;t.exports=r},8114:function(t,r,e){"use strict";var n=e(8066);t.exports=n},8066:function(t,r,e){"use strict";var n=e(8279),o=e(3443),i=e(2731);t.exports=function(){var t,r;if("function"!=typeof i)return!1;try{r=new i(r=[1,3.14,-3.14,o+1,o+2]),t=n(r)&&1===r[0]&&3===r[1]&&r[2]===o-2&&0===r[3]&&1===r[4]}catch(r){t=!1}return t}},2731:function(t){"use strict";var r="function"==typeof Uint8Array?Uint8Array:null;t.exports=r},1448:function(t,r,e){"use strict";var n=e(1453);t.exports=n},1453:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Float64Array;t.exports=function(t){return o&&t instanceof Float64Array||"[object Float64Array]"===n(t)}},9331:function(t,r,e){"use strict";var n=e(7980),o={uint16:e(6322),uint8:n};t.exports=o},5902:function(t,r,e){"use strict";var n=e(4106);t.exports=n},4106:function(t,r,e){"use strict";var n,o,i=e(9331);(o=new i.uint16(1))[0]=4660,n=52===new i.uint8(o.buffer)[0],t.exports=n},768:function(t,r,e){"use strict";var n=e(3823);t.exports=n},3823:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint16Array;t.exports=function(t){return o&&t instanceof Uint16Array||"[object Uint16Array]"===n(t)}},2744:function(t,r,e){"use strict";var n=e(2326);t.exports=n},2326:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint32Array;t.exports=function(t){return o&&t instanceof Uint32Array||"[object Uint32Array]"===n(t)}},8279:function(t,r,e){"use strict";var n=e(208);t.exports=n},208:function(t,r,e){"use strict";var n=e(6208),o="function"==typeof Uint8Array;t.exports=function(t){return o&&t instanceof Uint8Array||"[object Uint8Array]"===n(t)}},6315:function(t){"use strict";t.exports=1023},1686:function(t){"use strict";t.exports=2147483647},3105:function(t){"use strict";t.exports=2146435072},3449:function(t){"use strict";t.exports=2147483648},6988:function(t){"use strict";t.exports=-1023},9777:function(t){"use strict";t.exports=1023},3690:function(t){"use strict";t.exports=-1074},2918:function(t,r,e){"use strict";var n=e(4772).NEGATIVE_INFINITY;t.exports=n},4165:function(t){"use strict";var r=Number.POSITIVE_INFINITY;t.exports=r},6488:function(t){"use strict";t.exports=22250738585072014e-324},9668:function(t){"use strict";t.exports=65535},3899:function(t){"use strict";t.exports=4294967295},3443:function(t){"use strict";t.exports=255},7011:function(t,r,e){"use strict";var n=e(812);t.exports=n},812:function(t,r,e){"use strict";var n=e(4165),o=e(2918);t.exports=function(t){return t===n||t===o}},1883:function(t,r,e){"use strict";var n=e(1797);t.exports=n},1797:function(t){"use strict";t.exports=function(t){return t!=t}},513:function(t,r,e){"use strict";var n=e(5760);t.exports=n},5760:function(t){"use strict";t.exports=function(t){return Math.abs(t)}},5848:function(t,r,e){"use strict";var n=e(677);t.exports=n},677:function(t,r,e){"use strict";var n=e(3449),o=e(1686),i=e(7838),u=e(1921),s=e(2490),c=[0,0];t.exports=function(t,r){var e,a;return i.assign(t,c,1,0),e=c[0],e&=o,a=u(r),s(e|=a&=n,c[1])}},5500:function(t,r,e){"use strict";var n=e(8397);t.exports=n},8397:function(t,r,e){"use strict";var n=e(4165),o=e(2918),i=e(6315),u=e(9777),s=e(6988),c=e(3690),a=e(1883),f=e(7011),p=e(5848),l=e(4948),v=e(8478),y=e(7838),h=e(2490),d=[0,0],x=[0,0];t.exports=function(t,r){var e,b;return 0===t||a(t)||f(t)?t:(l(d,t),r+=d[1],(r+=v(t=d[0]))<c?p(0,t):r>u?t<0?o:n:(r<=s?(r+=52,b=2220446049250313e-31):b=1,y(x,t),e=x[0],e&=2148532223,b*h(e|=r+i<<20,x[1])))}},4772:function(t,r,e){"use strict";var n=e(7548);t.exports=n},7548:function(t){"use strict";t.exports=Number},8478:function(t,r,e){"use strict";var n=e(4500);t.exports=n},4500:function(t,r,e){"use strict";var n=e(1921),o=e(3105),i=e(6315);t.exports=function(t){var r=n(t);return(r=(r&o)>>>20)-i|0}},2490:function(t,r,e){"use strict";var n=e(9639);t.exports=n},4445:function(t,r,e){"use strict";var n,o,i;!0===e(5902)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},t.exports=n},9639:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(4445),u=new o(1),s=new n(u.buffer),c=i.HIGH,a=i.LOW;t.exports=function(t,r){return s[c]=t,s[a]=r,u[0]}},5646:function(t,r,e){"use strict";var n;n=!0===e(5902)?1:0,t.exports=n},1921:function(t,r,e){"use strict";var n=e(6285);t.exports=n},6285:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(5646),u=new o(1),s=new n(u.buffer);t.exports=function(t){return u[0]=t,s[i]}},9024:function(t,r,e){"use strict";var n=e(6488),o=e(7011),i=e(1883),u=e(513);t.exports=function(t,r,e,s){return i(t)||o(t)?(r[s]=t,r[s+e]=0,r):0!==t&&u(t)<n?(r[s]=4503599627370496*t,r[s+e]=-52,r):(r[s]=t,r[s+e]=0,r)}},4948:function(t,r,e){"use strict";var n=e(7576),o=e(9422);n(o,"assign",e(9024)),t.exports=o},9422:function(t,r,e){"use strict";var n=e(9024);t.exports=function(t){return n(t,[0,0],1,0)}},7838:function(t,r,e){"use strict";var n=e(4010);t.exports=n},5782:function(t,r,e){"use strict";var n,o,i;!0===e(5902)?(o=1,i=0):(o=0,i=1),n={HIGH:o,LOW:i},t.exports=n},4010:function(t,r,e){"use strict";var n=e(4903);t.exports=function(t,r){return 1===arguments.length?n([0,0],t):n(t,r)}},4903:function(t,r,e){"use strict";var n=e(4773),o=e(7382),i=e(5782),u=new o(1),s=new n(u.buffer),c=i.HIGH,a=i.LOW;t.exports=function(t,r){return u[0]=r,t[0]=s[c],t[1]=s[a],t}},7576:function(t,r,e){"use strict";var n=e(7063);t.exports=n},7063:function(t,r,e){"use strict";var n=e(6691);t.exports=function(t,r,e){n(t,r,{configurable:!1,enumerable:!1,writable:!1,value:e})}},2073:function(t){"use strict";var r=Object.defineProperty;t.exports=r},1680:function(t){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null;t.exports=r},1471:function(t,r,e){"use strict";var n=e(1680);t.exports=function(){try{return n({},"x",{}),!0}catch(t){return!1}}},6691:function(t,r,e){"use strict";var n,o=e(1471),i=e(2073),u=e(1309);n=o()?i:u,t.exports=n},1309:function(t){"use strict";var r=Object.prototype,e=r.toString,n=r.__defineGetter__,o=r.__defineSetter__,i=r.__lookupGetter__,u=r.__lookupSetter__;t.exports=function(t,s,c){var a,f,p,l;if("object"!=typeof t||null===t||"[object Array]"===e.call(t))throw new TypeError("invalid argument. First argument must be an object. Value: `"+t+"`.");if("object"!=typeof c||null===c||"[object Array]"===e.call(c))throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+c+"`.");if((f="value"in c)&&(i.call(t,s)||u.call(t,s)?(a=t.__proto__,t.__proto__=r,delete t[s],t[s]=c.value,t.__proto__=a):t[s]=c.value),p="get"in c,l="set"in c,f&&(p||l))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return p&&n&&n.call(t,s,c.get),l&&o&&o.call(t,s,c.set),t}},6208:function(t,r,e){"use strict";var n,o=e(3123),i=e(7407),u=e(4210);n=o()?u:i,t.exports=n},7407:function(t,r,e){"use strict";var n=e(173);t.exports=function(t){return n.call(t)}},4210:function(t,r,e){"use strict";var n=e(9048),o=e(1403),i=e(173);t.exports=function(t){var r,e,u;if(null==t)return i.call(t);e=t[o],r=n(t,o);try{t[o]=void 0}catch(r){return i.call(t)}return u=i.call(t),r?t[o]=e:delete t[o],u}},173:function(t){"use strict";var r=Object.prototype.toString;t.exports=r},1403:function(t){"use strict";var r="function"==typeof Symbol?Symbol.toStringTag:"";t.exports=r},7843:function(t){t.exports=function(t,r,e,n,o){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)t=t?t[r[n]]:o;return t===o?e:t}},2341:function(t,r){r.dset=function(t,r,e){r.split&&(r=r.split("."));for(var n,o,i=0,u=r.length,s=t;i<u&&"__proto__"!==(o=r[i++])&&"constructor"!==o&&"prototype"!==o;)s=s[o]=i===u?e:typeof(n=s[o])==typeof r?n:0*r[i]!=0||~(""+r[i]).indexOf(".")?{}:[]}},2263:function(t,r,e){"use strict";e.r(r),e.d(r,{default:function(){return i}});for(var n=[],o=0;o<64;)n[o]=0|4294967296*Math.sin(++o%Math.PI);function i(t){var r,e,i,u=[r=1732584193,e=4023233417,~r,~e],s=[],c=unescape(encodeURI(t))+"€",a=c.length;for(t=--a/4+2|15,s[--t]=8*a;~a;)s[a>>2]|=c.charCodeAt(a)<<8*a--;for(o=c=0;o<t;o+=16){for(a=u;c<64;a=[i=a[3],r+((i=a[0]+[r&e|~r&i,i&r|~i&e,r^e^i,e^(r|~i)][a=c>>4]+n[c]+~~s[o|15&[c,5*c+1,3*c+5,7*c][a]])<<(a=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*a+c++%4])|i>>>-a),r,e])r=0|a[1],e=a[2];for(c=4;c;)u[--c]+=a[c]}for(t="";c<32;)t+=(u[c>>3]>>4*(1^c++)&15).toString(16);return t}}}]);
Binary file
@@ -1 +1 @@
1
- (self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[288],{398:function(e,n,i){"use strict";i.r(n),i.d(n,{InAppEvents:function(){return t},InAppPlugin:function(){return u}});var t,o=i(5163);!function(e){e.MessageOpened="in-app:message-opened",e.MessageDismissed="in-app:message-dismissed",e.MessageError="in-app:message-error",e.MessageAction="in-app:message-action"}(t||(t={}));var s,r=Object.values(t);!function(e){e.Metric="Report Delivery Event",e.Content="Report Content Event",e.Opened="opened",e.Clicked="clicked",e.ViewedContent="viewed_content",e.ClickedContent="clicked_content"}(s||(s={}));var a="in_app_content";function d(e,n){return new CustomEvent(e,{detail:n})}var v=i(6646),l=i.n(v);function u(e){var n,i=this,v=!1,u=!1,c=new EventTarget;function p(){v&&!u&&(n.on("reset",m),e.events&&(r.forEach((function(n){c.addEventListener(n,null==e?void 0:e.events)})),["messageShown","messageDismissed","messageError"].forEach((function(e){l().events.on(e,(function(n){var i,o;c.dispatchEvent(d(function(e){switch(e){case"messageShown":return t.MessageOpened;case"messageDismissed":return t.MessageDismissed;case"messageError":return t.MessageError;case"messageAction":return t.MessageAction;default:return""}}(e),{messageId:n.messageId,deliveryId:null===(o=null===(i=n.properties)||void 0===i?void 0:i.gist)||void 0===o?void 0:o.campaignId}))}))}))),l().events.on("messageShown",(function(e){var i,t,o,r,d,v,l,u,c=null===(t=null===(i=null==e?void 0:e.properties)||void 0===i?void 0:i.gist)||void 0===t?void 0:t.campaignId;if(void 0===c||""==c){var p=null===(d=null===(r=null===(o=null==e?void 0:e.properties)||void 0===o?void 0:o.gist)||void 0===r?void 0:r.broadcast)||void 0===d?void 0:d.broadcastIdInt;if(p){var m=null===(u=null===(l=null===(v=null==e?void 0:e.properties)||void 0===v?void 0:v.gist)||void 0===l?void 0:l.broadcast)||void 0===u?void 0:u.templateId;n.track(s.Content,{actionType:s.ViewedContent,contentId:p,templateId:m,contentType:a})}}else n.track(s.Metric,{deliveryId:c,metric:s.Opened})})),l().events.on("messageAction",(function(i){var o,r,v,u,p,m,g,f,h,I,y;if("gist://close"!=i.action){var k=null===(v=null===(r=null===(o=null==i?void 0:i.message)||void 0===o?void 0:o.properties)||void 0===r?void 0:r.gist)||void 0===v?void 0:v.campaignId;if(void 0!==k&&""!=k)return n.track(s.Metric,{deliveryId:k,metric:s.Clicked,actionName:i.name,actionValue:i.action}),void(e.events&&c.dispatchEvent(d(t.MessageAction,{messageId:i.message.messageId,deliveryId:k,action:i.action,name:i.name,actionName:i.name,actionValue:i.action,message:{dismiss:function(){var e;l().dismissMessage(null===(e=null==i?void 0:i.message)||void 0===e?void 0:e.instanceId)}}})));var C=null===(g=null===(m=null===(p=null===(u=null==i?void 0:i.message)||void 0===u?void 0:u.properties)||void 0===p?void 0:p.gist)||void 0===m?void 0:m.broadcast)||void 0===g?void 0:g.broadcastIdInt;if(C){var b=null===(y=null===(I=null===(h=null===(f=null==i?void 0:i.message)||void 0===f?void 0:f.properties)||void 0===h?void 0:h.gist)||void 0===I?void 0:I.broadcast)||void 0===y?void 0:y.templateId;n.track(s.Content,{actionType:s.ClickedContent,contentId:C,templateId:b,contentType:a,actionName:i.name,actionValue:i.action})}}})),l().events.on("eventDispatched",(function(e){var i,t,o;if("analytics:track"==e.name){var s=null===(i=e.payload)||void 0===i?void 0:i.event;if(void 0===s||""==s)return;n.track(s,null===(t=e.payload)||void 0===t?void 0:t.properties,null===(o=e.payload)||void 0===o?void 0:o.options)}})))}function m(e){return(0,o.mG)(this,void 0,Promise,(function(){return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return[4,l().clearUserToken()];case 1:return n.sent(),[2,e]}}))}))}function g(e){return(0,o.mG)(this,void 0,Promise,(function(){var i;return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return v?"string"==typeof(i=n.user().id())&&i.length>0?[4,l().setUserToken(i)]:[3,2]:[2,e];case 1:return t.sent(),[3,4];case 2:return[4,l().clearUserToken()];case 3:t.sent(),t.label=4;case 4:return[2,e]}}))}))}var f={name:"Customer.io In-App Plugin",type:"before",version:"0.0.1",isLoaded:function(){return u},load:function(t,s){return(0,o.mG)(i,void 0,void 0,(function(){return(0,o.Jh)(this,(function(i){switch(i.label){case 0:return n=s,null==e.siteId||""==e.siteId?(o="siteId is required. Can't initialize.",console.error("[Customer.io In-App Plugin] ".concat(o)),[2,t]):[4,l().setup({siteId:e.siteId,env:e._env?e._env:"prod",logging:e._logging,useAnonymousSession:e.anonymousInApp})];case 1:return i.sent(),v=!0,[4,g(t)];case 2:return i.sent(),p(),u=!0,[2,Promise.resolve()]}var o}))}))},identify:g,page:function(e){var n,i,t,s,r;return(0,o.mG)(this,void 0,Promise,(function(){var a;return(0,o.Jh)(this,(function(o){return u?("string"==typeof(a=null!==(t=null===(i=null===(n=e.event)||void 0===n?void 0:n.properties)||void 0===i?void 0:i.name)&&void 0!==t?t:null===(r=null===(s=e.event)||void 0===s?void 0:s.properties)||void 0===r?void 0:r.url)&&a.length>0&&l().setCurrentRoute(a),[2,e]):[2,e]}))}))},unload:function(){return(0,o.mG)(i,void 0,void 0,(function(){return(0,o.Jh)(this,(function(n){return e.events&&r.forEach((function(n){c.removeEventListener(n,null==e?void 0:e.events)})),[2]}))}))}};return f}}}]);
1
+ (self.webpackChunk_customerio_cdp_analytics_browser=self.webpackChunk_customerio_cdp_analytics_browser||[]).push([[288],{398:function(e,n,i){"use strict";i.r(n),i.d(n,{InAppEvents:function(){return t},InAppPlugin:function(){return c}});var t,o=i(5163);!function(e){e.MessageOpened="in-app:message-opened",e.MessageDismissed="in-app:message-dismissed",e.MessageError="in-app:message-error",e.MessageAction="in-app:message-action"}(t||(t={}));var s,r=Object.values(t);!function(e){e.Metric="Report Delivery Event",e.Content="Report Content Event",e.Opened="opened",e.Clicked="clicked",e.ViewedContent="viewed_content",e.ClickedContent="clicked_content"}(s||(s={}));var a="in_app_content";function d(e,n){return new CustomEvent(e,{detail:n})}var l=i(6646),v=i.n(l);function c(e){var n,i=this,l=!1,c=!1,u=new EventTarget;function p(){l&&!c&&(n.on("reset",m),e.events&&(r.forEach((function(n){u.addEventListener(n,null==e?void 0:e.events)})),["messageDismissed","messageError"].forEach((function(e){v().events.on(e,(function(n){var i,o;u.dispatchEvent(d(function(e){switch(e){case"messageShown":return t.MessageOpened;case"messageDismissed":return t.MessageDismissed;case"messageError":return t.MessageError;case"messageAction":return t.MessageAction;default:return""}}(e),{messageId:n.messageId,deliveryId:null===(o=null===(i=n.properties)||void 0===i?void 0:i.gist)||void 0===o?void 0:o.campaignId}))}))}))),v().events.on("messageShown",(function(i){var o,r,l,c,p,m,g,f,I=null===(r=null===(o=null==i?void 0:i.properties)||void 0===o?void 0:o.gist)||void 0===r?void 0:r.campaignId;if(e.events&&u.dispatchEvent(d(t.MessageOpened,{messageId:null==i?void 0:i.messageId,deliveryId:I,message:{dismiss:function(){v().dismissMessage(null==i?void 0:i.instanceId)}}})),void 0===I||""==I){var h=null===(p=null===(c=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.gist)||void 0===c?void 0:c.broadcast)||void 0===p?void 0:p.broadcastIdInt;if(h){var y=null===(f=null===(g=null===(m=null==i?void 0:i.properties)||void 0===m?void 0:m.gist)||void 0===g?void 0:g.broadcast)||void 0===f?void 0:f.templateId;n.track(s.Content,{actionType:s.ViewedContent,contentId:h,templateId:y,contentType:a})}}else n.track(s.Metric,{deliveryId:I,metric:s.Opened})})),v().events.on("messageAction",(function(i){var o,r,l,c,p,m,g,f,I,h,y,k=null===(l=null===(r=null===(o=null==i?void 0:i.message)||void 0===o?void 0:o.properties)||void 0===r?void 0:r.gist)||void 0===l?void 0:l.campaignId;if(e.events&&u.dispatchEvent(d(t.MessageAction,{messageId:i.message.messageId,deliveryId:k,action:i.action,name:i.name,actionName:i.name,actionValue:i.action,message:{dismiss:function(){v().dismissMessage(i.message.instanceId)}}})),"gist://close"!=i.action)if(void 0===k||""==k){var C=null===(g=null===(m=null===(p=null===(c=null==i?void 0:i.message)||void 0===c?void 0:c.properties)||void 0===p?void 0:p.gist)||void 0===m?void 0:m.broadcast)||void 0===g?void 0:g.broadcastIdInt;if(C){var E=null===(y=null===(h=null===(I=null===(f=null==i?void 0:i.message)||void 0===f?void 0:f.properties)||void 0===I?void 0:I.gist)||void 0===h?void 0:h.broadcast)||void 0===y?void 0:y.templateId;n.track(s.Content,{actionType:s.ClickedContent,contentId:C,templateId:E,contentType:a,actionName:i.name,actionValue:i.action})}}else n.track(s.Metric,{deliveryId:k,metric:s.Clicked,actionName:i.name,actionValue:i.action})})),v().events.on("eventDispatched",(function(e){var i,t,o;if("analytics:track"==e.name){var s=null===(i=e.payload)||void 0===i?void 0:i.event;if(void 0===s||""==s)return;n.track(s,null===(t=e.payload)||void 0===t?void 0:t.properties,null===(o=e.payload)||void 0===o?void 0:o.options)}})))}function m(e){return(0,o.mG)(this,void 0,Promise,(function(){return(0,o.Jh)(this,(function(n){switch(n.label){case 0:return[4,v().clearUserToken()];case 1:return n.sent(),[2,e]}}))}))}function g(e){return(0,o.mG)(this,void 0,Promise,(function(){var i;return(0,o.Jh)(this,(function(t){switch(t.label){case 0:return l?"string"==typeof(i=n.user().id())&&i.length>0?[4,v().setUserToken(i)]:[3,2]:[2,e];case 1:return t.sent(),[3,4];case 2:return[4,v().clearUserToken()];case 3:t.sent(),t.label=4;case 4:return[2,e]}}))}))}var f={name:"Customer.io In-App Plugin",type:"before",version:"0.0.1",isLoaded:function(){return c},load:function(t,s){return(0,o.mG)(i,void 0,void 0,(function(){return(0,o.Jh)(this,(function(i){switch(i.label){case 0:return n=s,null==e.siteId||""==e.siteId?(o="siteId is required. Can't initialize.",console.error("[Customer.io In-App Plugin] ".concat(o)),[2,t]):[4,v().setup({siteId:e.siteId,env:e._env?e._env:"prod",logging:e._logging,useAnonymousSession:e.anonymousInApp})];case 1:return i.sent(),l=!0,[4,g(t)];case 2:return i.sent(),p(),c=!0,[2,Promise.resolve()]}var o}))}))},identify:g,page:function(e){var n,i,t,s,r;return(0,o.mG)(this,void 0,Promise,(function(){var a;return(0,o.Jh)(this,(function(o){return c?("string"==typeof(a=null!==(t=null===(i=null===(n=e.event)||void 0===n?void 0:n.properties)||void 0===i?void 0:i.name)&&void 0!==t?t:null===(r=null===(s=e.event)||void 0===s?void 0:s.properties)||void 0===r?void 0:r.url)&&a.length>0&&v().setCurrentRoute(a),[2,e]):[2,e]}))}))},unload:function(){return(0,o.mG)(i,void 0,void 0,(function(){return(0,o.Jh)(this,(function(n){return e.events&&r.forEach((function(n){u.removeEventListener(n,null==e?void 0:e.events)})),[2]}))}))}};return f}}}]);
Binary file