-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathada-embed2.js
1 lines (1 loc) · 16.9 KB
/
ada-embed2.js
1
!function(){var t,e,r,n,o,i,a={740:function(t,e){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)};e.__esModule=!0,e.createStorage=void 0;var n="Cannot access Web Storage API";e.createStorage=function(t){var e;try{e="local"===t?localStorage:sessionStorage}catch(t){console.warn(n)}var o={setItem:function(t,r){try{null==e||e.setItem(t,JSON.stringify(r))}catch(t){console.warn(n)}},getItem:function(t){try{var r=null==e?void 0:e.getItem(t);return r&&JSON.parse(r)}catch(t){return console.warn(n),null}},removeItem:function(t){try{null==e||e.removeItem(t)}catch(t){console.warn(n)}},clear:function(){try{null==e||e.clear()}catch(t){console.warn(n)}},setFnItem:function(t,e){var n,i=o.getItem("ada-functional-storage")||{},a=r(r({},i),((n={})[t]=e,n));o.setItem("ada-functional-storage",a)},getFnItem:function(t){var e=o.getItem("ada-functional-storage");return e&&e[t]||null}};return o}},110:function(t,e,r){"use strict";e.wG=void 0;var n=r(740);e.wG=(0,n.createStorage)("local"),(0,n.createStorage)("session")},757:function(t,e,r){t.exports=r(666)},226:function(t,e,r){"use strict";r.a(t,(async function(t,e){try{var n=r(736);window.__AdaEmbedLoaderVersion="94aa5047029e7aa32e014222132e5b03dc185eaf",await(0,n.S)(),e()}catch(t){e(t)}}),1)},736:function(t,e,r){"use strict";function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}r.d(e,{S:function(){return E}});var i=r(757),a=r.n(i);function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function f(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function p(t,e,r){return p=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&c(o,r.prototype),o},p.apply(null,arguments)}function h(t){var e="function"==typeof Map?new Map:void 0;return h=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return p(t,arguments,s(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)},h(t)}var d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(i,t);var e,r,n,o=(r=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var o=s(this).constructor;t=Reflect.construct(e,arguments,o)}else t=e.apply(this,arguments);return f(this,t)});function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=o.call(this,t)).name="AdaEmbedLoaderError",e}return e=i,Object.defineProperty(e,"prototype",{writable:!1}),e}(h(Error)),y=function(t){window.__AdaEmbedLoaderInitialActionQueue=window.__AdaEmbedLoaderInitialActionQueue||[];for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return window.__AdaEmbedLoaderInitialActionQueue.push({method:t,arguments:r}),new Promise((function(e){window.addEventListener("__ada-embed-action-resolve-".concat(t),(function(t){e(t.detail)}))}))},v=function(){var t=o(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://static.ada.support/embed-manifest.json");case 2:return e=t.sent,t.abrupt("return",e.json());case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),w="The format of manifest file is incorrect",m=r(110),g=function(t){try{return m.wG.getItem(t)}catch(t){return null}},b=function(t,e){try{m.wG.setItem(t,e)}catch(t){}},_=function(t){if(!function(t){if("object"!==u(t))throw new d(w);if(null===t)throw new d(w);var e=t;if(!Array.isArray(e.versions))throw new d(w);if(!e.versions.length)throw new d(w);if("string"!=typeof e.versions[0].hash)throw new d(w);if(!e.versions[0].hash)throw new d(w);if("number"!=typeof e.versions[0].weight)throw new d(w);if(1!==e.versions.reduce((function(t,e){return t+e.weight}),0))throw new d('The sum of version weights must be "1"');return!0}(t))throw new d(w);var e=JSON.stringify(t);if(e===g("ada-embed-manifest-cache")){var r=g("ada-embed-assigned-version");if(r)return r}for(var n=Math.random(),o=t.versions,i=o[o.length-1].hash,a=0;a<o.length;a+=1){var c=o[a];if(n<=c.weight){i=c.hash;break}}return b("ada-embed-assigned-version",i),b("ada-embed-manifest-cache",e),i},x=function(){var t=o(a().mark((function t(){var e,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0,n=new RegExp("[?&]".concat("__ada-embed-version","=([^&#]*)")).exec(window.location.href),!(e=n?decodeURI(n[1]):null)){t.next=3;break}return t.abrupt("return",e);case 3:if(!window.__AdaEmbedVersion){t.next=5;break}return t.abrupt("return",window.__AdaEmbedVersion);case 5:return t.next=7,v();case 7:return r=t.sent,t.abrupt("return",_(r));case 9:case"end":return t.stop()}var n}),t)})));return function(){return t.apply(this,arguments)}}(),E=function(){var t=o(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!window.__AdaEmbedLoaderScriptLoaded){t.next=2;break}throw new Error("Ada Embed script is included more than once, skipping.");case 2:return window.__AdaEmbedLoaderScriptLoaded=!0,window.adaEmbed={closeCampaign:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["closeCampaign"].concat(e))},start:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["start"].concat(e))},stop:function(){return y("stop")},toggle:function(){return y("toggle")},deleteHistory:function(){return y("deleteHistory")},reset:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["reset"].concat(e))},setMetaFields:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["setMetaFields"].concat(e))},setSensitiveMetaFields:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["setSensitiveMetaFields"].concat(e))},getInfo:function(){return y("getInfo")},createProactive:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["createProactive"].concat(e))},trackEvent:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["trackEvent"].concat(e))},triggerCampaign:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["triggerCampaign"].concat(e))},subscribeEvent:function(t,e){return y("subscribeEvent",t,e)},unsubscribeEvent:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["unsubscribeEvent"].concat(e))},evaluateCampaignConditions:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return y.apply(void 0,["evaluateCampaignConditions"].concat(e))}},t.next=6,x();case 6:void 0,void 0,n=void 0,e=t.sent.slice(0,7),r="https://static.ada.support/embed2.".concat(e,".js"),(n=document.createElement("script")).type="text/javascript",n.async=!0,n.src=r,document.getElementsByTagName("head")[0].appendChild(n);case 8:case"end":return t.stop()}var e,r,n}),t)})));return function(){return t.apply(this,arguments)}}()},666:function(t){var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new A(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function w(){}function m(){}var g={};u(g,i,(function(){return this}));var b=Object.getPrototypeOf,_=b&&b(b(P([])));_&&_!==r&&n.call(_,i)&&(g=_);var x=m.prototype=v.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function P(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:e,done:!0}}return w.prototype=m,u(x,"constructor",m),u(m,"constructor",w),w.displayName=u(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(L.prototype),u(L.prototype,a,(function(){return this})),t.AsyncIterator=L,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new L(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),u(x,c,"Generator"),u(x,i,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(j),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},c={};function u(t){var e=c[t];if(void 0!==e)return e.exports;var r=c[t]={exports:{}};return a[t].call(r.exports,r,r.exports,u),r.exports}t="function"==typeof Symbol?Symbol("webpack then"):"__webpack_then__",e="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",r="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",n=function(t){t&&(t.forEach((function(t){t.r--})),t.forEach((function(t){t.r--?t.r++:t()})))},o=function(t){!--t.r&&t()},i=function(t,e){t?t.push(e):o(e)},u.a=function(a,c,u){var f,s,l,p=u&&[],h=a.exports,d=!0,y=!1,v=function(e,r,n){y||(y=!0,r.r+=e.length,e.map((function(e,o){e[t](r,n)})),y=!1)},w=new Promise((function(t,e){l=e,s=function(){t(h),n(p),p=0}}));w[e]=h,w[t]=function(t,e){if(d)return o(t);f&&v(f,t,e),i(p,t),w.catch(e)},a.exports=w,c((function(a){var c;f=function(a){return a.map((function(a){if(null!==a&&"object"==typeof a){if(a[t])return a;if(a.then){var c=[];a.then((function(t){u[e]=t,n(c),c=0}),(function(t){u[r]=t,n(c),c=0}));var u={};return u[t]=function(t,e){i(c,t),a.catch(e)},u}}var f={};return f[t]=function(t){o(t)},f[e]=a,f}))}(a);var u=function(){return f.map((function(t){if(t[r])throw t[r];return t[e]}))},s=new Promise((function(t,e){(c=function(){t(u)}).r=0,v(f,c,e)}));return c.r?s:u()}),(function(t){t&&l(w[r]=t),s()})),d=!1},u.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return u.d(e,{a:e}),e},u.d=function(t,e){for(var r in e)u.o(e,r)&&!u.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u(226)}();