UNPKG

@dodgeball/trust-sdk-client

Version:
1 lines 84.9 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(function(){return(()=>{var e={669:(e,t,n)=>{e.exports=n(609)},448:(e,t,n)=>{"use strict";var r=n(867),o=n(26),i=n(372),s=n(327),a=n(97),u=n(109),c=n(985),l=n(61),f=n(655),d=n(263);e.exports=function(e){return new Promise((function(t,n){var h,p=e.data,g=e.headers,v=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}r.isFormData(p)&&delete g["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",S=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(m+":"+S)}var E=a(e.baseURL,e.url);function _(){if(b){var r="getAllResponseHeaders"in b?u(b.getAllResponseHeaders()):null,i={data:v&&"text"!==v&&"json"!==v?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:e,request:b};o((function(e){t(e),y()}),(function(e){n(e),y()}),i),b=null}}if(b.open(e.method.toUpperCase(),s(E,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=_:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(_)},b.onabort=function(){b&&(n(l("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",e,null,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var w=(e.withCredentials||c(E))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;w&&(g[e.xsrfHeaderName]=w)}"setRequestHeader"in b&&r.forEach(g,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete g[t]:b.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),v&&"json"!==v&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){b&&(n(!e||e&&e.type?new d("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),p||(p=null),b.send(p)}))}},609:(e,t,n)=>{"use strict";var r=n(867),o=n(849),i=n(321),s=n(185),a=function e(t){var n=new i(t),a=o(i.prototype.request,n);return r.extend(a,i.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(655));a.Axios=i,a.Cancel=n(263),a.CancelToken=n(972),a.isCancel=n(502),a.VERSION=n(288).version,a.all=function(e){return Promise.all(e)},a.spread=n(713),a.isAxiosError=n(268),e.exports=a,e.exports.default=a},263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},972:(e,t,n)=>{"use strict";var r=n(263);function o(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){var t,r=n._listeners.length;for(t=0;t<r;t++)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){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(867),o=n(327),i=n(782),s=n(572),a=n(185),u=n(875),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!r){var l=[s,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=e;n.length;){var d=n.shift(),h=n.shift();try{f=d(f)}catch(e){h(e);break}}try{o=s(f)}catch(e){return Promise.reject(e)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(867);function o(){this.handlers=[]}o.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},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},97:(e,t,n)=>{"use strict";var r=n(793),o=n(303);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},61:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},572:(e,t,n)=>{"use strict";var r=n(867),o=n(527),i=n(502),s=n(655),a=n(263);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),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||s.adapter)(e).then((function(t){return u(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},185:(e,t,n)=>{"use strict";var r=n(867);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function s(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function u(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength: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]||i,o=t(e);r.isUndefined(o)&&t!==u||(n[e]=o)})),n}},26:(e,t,n)=>{"use strict";var r=n(61);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},527:(e,t,n)=>{"use strict";var r=n(867),o=n(655);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},655:(e,t,n)=>{"use strict";var r=n(867),o=n(16),i=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(448)),u),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(0,JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||c.transitional,n=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||o&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(s)})),e.exports=c},288:e=>{e.exports={version:"0.24.0"}},849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},327:(e,t,n)=>{"use strict";var r=n(867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},372:(e,t,n)=>{"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&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(){}}},793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},985:(e,t,n)=>{"use strict";var r=n(867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(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=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},16:(e,t,n)=>{"use strict";var r=n(867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},109:(e,t,n)=>{"use strict";var r=n(867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},875:(e,t,n)=>{"use strict";var r=n(288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},867:(e,t,n)=>{"use strict";var r=n(849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:u,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:c,isStream:function(e){return a(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:l,merge:function e(){var t={};function n(n,r){u(t[r])&&u(n)?t[r]=e(t[r],n):u(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},646:function(e){e.exports=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}return function t(n,r){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=e({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},o=0;o<t.length;o++){var i=t[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=n.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()},465:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",s="[object Boolean]",a="[object Date]",u="[object Function]",c="[object GeneratorFunction]",l="[object Map]",f="[object Number]",d="[object Object]",h="[object Promise]",p="[object RegExp]",g="[object Set]",v="[object String]",y="[object Symbol]",b="[object WeakMap]",m="[object ArrayBuffer]",S="[object DataView]",E="[object Float32Array]",_="[object Float64Array]",w="[object Int8Array]",O="[object Int16Array]",I="[object Int32Array]",T="[object Uint8Array]",L="[object Uint8ClampedArray]",A="[object Uint16Array]",D="[object Uint32Array]",k=/\w*$/,x=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,N={};N[i]=N["[object Array]"]=N[m]=N[S]=N[s]=N[a]=N[E]=N[_]=N[w]=N[O]=N[I]=N[l]=N[f]=N[d]=N[p]=N[g]=N[v]=N[y]=N[T]=N[L]=N[A]=N[D]=!0,N["[object Error]"]=N[u]=N[b]=!1;var P="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,C="object"==typeof self&&self&&self.Object===Object&&self,j=P||C||Function("return this")(),U=t&&!t.nodeType&&t,M=U&&e&&!e.nodeType&&e,V=M&&M.exports===U;function B(e,t){return e.set(t[0],t[1]),e}function F(e,t){return e.add(t),e}function q(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function H(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function K(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function G(e,t){return function(n){return e(t(n))}}function Y(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var J,z=Array.prototype,$=Function.prototype,X=Object.prototype,Q=j["__core-js_shared__"],W=(J=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",Z=$.toString,ee=X.hasOwnProperty,te=X.toString,ne=RegExp("^"+Z.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=V?j.Buffer:void 0,oe=j.Symbol,ie=j.Uint8Array,se=G(Object.getPrototypeOf,Object),ae=Object.create,ue=X.propertyIsEnumerable,ce=z.splice,le=Object.getOwnPropertySymbols,fe=re?re.isBuffer:void 0,de=G(Object.keys,Object),he=je(j,"DataView"),pe=je(j,"Map"),ge=je(j,"Promise"),ve=je(j,"Set"),ye=je(j,"WeakMap"),be=je(Object,"create"),me=Fe(he),Se=Fe(pe),Ee=Fe(ge),_e=Fe(ve),we=Fe(ye),Oe=oe?oe.prototype:void 0,Ie=Oe?Oe.valueOf:void 0;function Te(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Le(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function De(e){this.__data__=new Le(e)}function ke(e,t,n){var r=e[t];ee.call(e,t)&&qe(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function xe(e,t){for(var n=e.length;n--;)if(qe(e[n][0],t))return n;return-1}function Re(e,t,n,r,o,h,b){var x;if(r&&(x=h?r(e,o,h,b):r(e)),void 0!==x)return x;if(!Je(e))return e;var R=He(e);if(R){if(x=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,x)}else{var P=Me(e),C=P==u||P==c;if(Ge(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(P==d||P==i||C&&!h){if(H(e))return h?e:{};if(x=function(e){return"function"!=typeof e.constructor||Be(e)?{}:Je(t=se(e))?ae(t):{};var t}(C?{}:e),!t)return function(e,t){return Pe(e,Ue(e),t)}(e,function(e,t){return e&&Pe(t,ze(t),e)}(x,e))}else{if(!N[P])return h?e:{};x=function(e,t,n,r){var o,i=e.constructor;switch(t){case m:return Ne(e);case s:case a:return new i(+e);case S:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case E:case _:case w:case O:case I:case T:case L:case A:case D:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){return q(t?n(K(e),!0):K(e),B,new e.constructor)}(e,r,n);case f:case v:return new i(e);case p:return function(e){var t=new e.constructor(e.source,k.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return function(e,t,n){return q(t?n(Y(e),!0):Y(e),F,new e.constructor)}(e,r,n);case y:return o=e,Ie?Object(Ie.call(o)):{}}}(e,P,Re,t)}}b||(b=new De);var j=b.get(e);if(j)return j;if(b.set(e,x),!R)var U=n?function(e){return function(e,t,n){var r=t(e);return He(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,ze,Ue)}(e):ze(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n););}(U||e,(function(o,i){U&&(o=e[i=o]),ke(x,i,Re(o,t,n,r,i,e,b))})),x}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Pe(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=r?r(n[s],e[s],s,n,e):void 0;ke(n,s,void 0===a?e[s]:a)}return n}function Ce(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function je(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Je(e)||(t=e,W&&W in t))&&(Ye(e)||H(e)?ne:x).test(Fe(e));var t}(n)?n:void 0}Te.prototype.clear=function(){this.__data__=be?be(null):{}},Te.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Te.prototype.get=function(e){var t=this.__data__;if(be){var n=t[e];return n===r?void 0:n}return ee.call(t,e)?t[e]:void 0},Te.prototype.has=function(e){var t=this.__data__;return be?void 0!==t[e]:ee.call(t,e)},Te.prototype.set=function(e,t){return this.__data__[e]=be&&void 0===t?r:t,this},Le.prototype.clear=function(){this.__data__=[]},Le.prototype.delete=function(e){var t=this.__data__,n=xe(t,e);return!(n<0||(n==t.length-1?t.pop():ce.call(t,n,1),0))},Le.prototype.get=function(e){var t=this.__data__,n=xe(t,e);return n<0?void 0:t[n][1]},Le.prototype.has=function(e){return xe(this.__data__,e)>-1},Le.prototype.set=function(e,t){var n=this.__data__,r=xe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Te,map:new(pe||Le),string:new Te}},Ae.prototype.delete=function(e){return Ce(this,e).delete(e)},Ae.prototype.get=function(e){return Ce(this,e).get(e)},Ae.prototype.has=function(e){return Ce(this,e).has(e)},Ae.prototype.set=function(e,t){return Ce(this,e).set(e,t),this},De.prototype.clear=function(){this.__data__=new Le},De.prototype.delete=function(e){return this.__data__.delete(e)},De.prototype.get=function(e){return this.__data__.get(e)},De.prototype.has=function(e){return this.__data__.has(e)},De.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Le){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ae(r)}return n.set(e,t),this};var Ue=le?G(le,Object):function(){return[]},Me=function(e){return te.call(e)};function Ve(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||R.test(e))&&e>-1&&e%1==0&&e<t}function Be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Fe(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qe(e,t){return e===t||e!=e&&t!=t}(he&&Me(new he(new ArrayBuffer(1)))!=S||pe&&Me(new pe)!=l||ge&&Me(ge.resolve())!=h||ve&&Me(new ve)!=g||ye&&Me(new ye)!=b)&&(Me=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?Fe(n):void 0;if(r)switch(r){case me:return S;case Se:return l;case Ee:return h;case _e:return g;case we:return b}return t});var He=Array.isArray;function Ke(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ye(e)}var Ge=fe||function(){return!1};function Ye(e){var t=Je(e)?te.call(e):"";return t==u||t==c}function Je(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ze(e){return Ke(e)?function(e,t){var n=He(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ke(e)}(e)&&ee.call(e,"callee")&&(!ue.call(e,"callee")||te.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var s in e)!t&&!ee.call(e,s)||o&&("length"==s||Ve(s,r))||n.push(s);return n}(e):function(e){if(!Be(e))return de(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Re(e,!0,!0)}},433:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDodgeball=t.Dodgeball=void 0;var u=n(855),c=n(915),l=n(441),f=n(833),d=a(n(532)),h=a(n(652)),p=a(n(646)),g=a(n(465)),v=n(614),y=function(){function e(e,t){var n,r=this;if(this.publicKey="",this.seenSteps={},this.integrationLoader=null,this.integrations=[],this.areIntegrationsLoaded=!1,this.onIntegrationsLoaded=[],this.isSourcing=!1,this.onSource=[],this.sourceToken="",this.sourceTokenExpiry=0,this.refreshSourceTokenHandle=null,this.sessionHelperIsLoaded=!1,this.sessionHelperIframe=null,this.onSessionHelper=[],this.useSessionFallback=!1,null==e||0===(null==e?void 0:e.length))throw new u.DodgeballMissingConfigError("publicApiKey",e);if(this.publicKey=e,this.config=Object.assign((0,g.default)(c.DEFAULT_CONFIG),(0,g.default)(t||{})),Object.keys(u.DodgeballApiVersion).indexOf(this.config.apiVersion)<0)throw new u.DodgeballInvalidConfigError("config.apiVersion",this.config.apiVersion,Object.keys(u.DodgeballApiVersion));var a=null!==(n=this.config.logLevel)&&void 0!==n?n:l.LogLevel.INFO;if(Object.keys(l.LogLevel).indexOf(a)<0)throw new u.DodgeballInvalidConfigError("config.logLevel",a,Object.keys(l.LogLevel));l.Logger.filterLevel=l.Severity[a],this.identifier=new d.default({cookiesEnabled:!this.config.disableCookies,apiUrl:this.config.apiUrl,apiVersion:this.config.apiVersion,publicKey:this.publicKey}),l.Logger.trace("Dodgeball constructor called").log(),this.config.isEnabled&&setTimeout((function(){return o(r,void 0,void 0,(function(){var e,t,n,r,a,c,d,p,g,y,b,m,S=this;return i(this,(function(E){switch(E.label){case 0:return(e="undefined"!=typeof document?document.querySelector("script[data-dodgeball]"):null)?[4,new Promise((function(t){e.addEventListener("load",(function(){"undefined"!=typeof window&&(window.hasOwnProperty("_dodgeball_init_conf")||t(window._dodgeball_init_conf)),t({requestId:(0,v.v4)(),libs:[]})}))}))]:[3,2];case 1:return t=E.sent(),[3,4];case 2:return[4,(0,f.getInitializationConfig)({url:this.config.apiUrl,token:this.publicKey,version:this.config.apiVersion})];case 3:t=E.sent(),E.label=4;case 4:return(null==t?void 0:t.hasOwnProperty("libs"))?(this.integrationLoader=new h.default({requireSrc:t.requireSrc,parentContext:{publicKey:this.publicKey,config:this.config,clearScreen:this.clearScreen.bind(this)}}),t&&t.libs?[4,this.integrationLoader.loadIntegrations(t.libs,t.requestId)]:[3,6]):[3,11];case 5:(n=E.sent())&&(this.integrations=s(s([],this.integrations,!0),n,!0)),E.label=6;case 6:if(this.areIntegrationsLoaded=!0,!(this.onIntegrationsLoaded.length>0))return[3,10];r=0,a=this.onIntegrationsLoaded,E.label=7;case 7:return r<a.length?[4,(0,a[r])()]:[3,10];case 8:E.sent(),E.label=9;case 9:return r++,[3,7];case 10:return(c=this.identifier.getSource())?(this.sourceToken=c.token,this.sourceTokenExpiry=null!==(m=c.expiry)&&void 0!==m?m:0,this.registerSourceTokenRefresh()):setTimeout((function(){return o(S,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.generateSourceToken()];case 1:return e.sent(),[2]}}))}))}),0),this.config.sessionId&&this.integrationLoader.filterIntegrationsByPurpose(this.integrations,u.IntegrationPurpose.OBSERVE).forEach((function(e){e.observe({sessionId:S.config.sessionId,userId:S.config.userId,sourceToken:S.sourceToken})})),[3,12];case 11:l.Logger.error("Error Loading Initialization Configuration.",t).log(),E.label=12;case 12:return"undefined"!=typeof document&&this.config.enableCrossDomainSession?(d=navigator.userAgent,p=d.indexOf("Chrome")>-1,g=d.indexOf("Safari")>-1,p&&g&&(g=!1),g?(this.sessionHelperIsLoaded=!0,this.useSessionFallback=!0,this.onSessionHelper.length>0&&(this.onSessionHelper.forEach((function(e){e()})),this.onSessionHelper=[])):((y=document.getElementById("_db-sessionUtil"))?(this.sessionHelperIsLoaded=!0,this.onSessionHelper.length>0&&(this.onSessionHelper.forEach((function(e){e()})),this.onSessionHelper=[])):(b=(0,f.constructApiUrl)(this.config.apiUrl,this.config.apiVersion),(y=document.createElement("iframe")).setAttribute("id","_db-sessionUtil"),y.setAttribute("src","".concat(b,"sessionUtil?publicKey=").concat(this.publicKey)),y.setAttribute("style","display: none;"),y.setAttribute("sandbox","allow-scripts allow-same-origin"),y.addEventListener("load",(function(){S.sessionHelperIsLoaded=!0,setTimeout((function(){S.onSessionHelper.length>0&&(S.onSessionHelper.forEach((function(e){e()})),S.onSessionHelper=[])}),0)})),y.addEventListener("error",(function(){l.Logger.error("Error Loading Session Helper. Using fallback").log(),S.sessionHelperIsLoaded=!0,S.useSessionFallback=!0,setTimeout((function(){S.onSessionHelper.length>0&&(S.onSessionHelper.forEach((function(e){e()})),S.onSessionHelper=[])}),0)})),document.body.appendChild(y)),this.sessionHelperIframe=y)):(this.sessionHelperIsLoaded=!0,this.useSessionFallback=!0,this.onSessionHelper.length>0&&(this.onSessionHelper.forEach((function(e){e()})),this.onSessionHelper=[])),[2]}}))}))}),0)}return e.prototype.isSourceTokenValid=function(){return this.sourceTokenExpiry>Date.now()},e.prototype.registerSourceTokenRefresh=function(){var e=this;this.refreshSourceTokenHandle&&clearTimeout(this.refreshSourceTokenHandle);var t=this.sourceTokenExpiry-6e4-Date.now();(isNaN(t)||t<c.MIN_TOKEN_REFRESH_INTERVAL_MS)&&(t=c.MIN_TOKEN_REFRESH_INTERVAL_MS),this.refreshSourceTokenHandle=setTimeout((function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.generateSourceToken()];case 1:return e.sent(),[2]}}))}))}),t)},e.prototype.sendSessionUtilMessage=function(e){var t=this,n=function(){var n,r;if(t.useSessionFallback)switch(e.type){case c.DodgeballSessionMessageType.GET_SESSION:var o=null;if(t.config.disableCookies)o=window.localStorage.getItem(e.key);else{var i=p.default.get(c.DODGEBALL_SESSION_KEY);if(i)try{var s=JSON.parse(i);s.expiry>Date.now()?o=s.sessionId:p.default.remove(c.DODGEBALL_SESSION_KEY)}catch(e){p.default.remove(c.DODGEBALL_SESSION_KEY)}}window.postMessage({type:"_DB_GET_RESPONSE",key:e.key,value:o},window.origin);break;case c.DodgeballSessionMessageType.SET_SESSION:if(t.config.disableCookies)window.localStorage.setItem(e.key,e.value);else{var a=window.location.hostname.split(".").slice(-2);p.default.set(c.DODGEBALL_SESSION_KEY,e.value,{domain:a.join("."),expires:365})}break;case c.DodgeballSessionMessageType.CLEAR_SESSION:t.config.disableCookies?window.localStorage.removeItem(e.key):p.default.remove(c.DODGEBALL_SESSION_KEY)}else null===(r=null===(n=t.sessionHelperIframe)||void 0===n?void 0:n.contentWindow)||void 0===r||r.postMessage(e,t.config.apiUrl)};this.sessionHelperIsLoaded?n():this.onSessionHelper.push(n)},e.prototype.generateSourceToken=function(){return o(this,void 0,void 0,(function(){var e,t=this;return i(this,(function(n){return e=function(){return o(t,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=this.integrationLoader.filterIntegrationsByPurpose(this.integrations,u.IntegrationPurpose.IDENTIFY),[4,this.identifier.generateSourceToken(e)];case 1:return t=n.sent(),this.sourceToken=t.token,this.sourceTokenExpiry=t.expiry,this.registerSourceTokenRefresh(),this.isSourcing=!1,this.onSource.length>0&&(this.onSource.forEach((function(e){e()})),this.onSource=[]),[2]}}))}))},[2,new Promise((function(n,r){return o(t,void 0,void 0,(function(){var t,s,a=this;return i(this,(function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),this.isSourcing?[3,4]:(this.isSourcing=!0,this.areIntegrationsLoaded?[4,e()]:[3,2]);case 1:return t=u.sent(),n(t),[3,3];case 2:this.onIntegrationsLoaded.push((function(){return o(a,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e()];case 1:return t=r.sent(),n(t),[2]}}))}))})),u.label=3;case 3:return[3,5];case 4:this.onSource.push((function(){n(a.sourceToken)})),u.label=5;case 5:return[3,7];case 6:return s=u.sent(),l.Logger.error("Error Generating Source Token",s).log(),this.isSourcing=!1,r(s),[3,7];case 7:return[2]}}))}))}))]}))}))},e.prototype.filterSeenSteps=function(e){var t=this;return e.filter((function(e){return!t.seenSteps[e.id]}))},e.prototype.handleVerificationStep=function(e,t,n,s){return o(this,void 0,void 0,(function(){var a,c,d,h,p=this;return i(this,(function(g){switch(g.label){case 0:if(this.seenSteps[t.id]=t,!t.name)return[3,8];l.Logger.trace("Handle Verification Step - About to load:",{step:t}).log(),g.label=1;case 1:return g.trys.push([1,7,,8]),[4,this.integrationLoader.loadIntegration(r({},t),t.id)];case 2:return a=g.sent(),this.integrations.indexOf(a)<0&&this.integrations.push(a),delete t.content,l.Logger.info("Handle Verification Step - Loaded integration",{integration:a.name}).log(),a.purposes.includes(u.IntegrationPurpose.OBSERVE)&&this.config.sessionId?[4,this.getSourceToken()]:[3,4];case 3:c=g.sent(),a.observe({sessionId:this.config.sessionId,userId:this.config.userId,sourceToken:c}),s(),g.label=4;case 4:return a.purposes.includes(u.IntegrationPurpose.IDENTIFY)&&(a.identify(),s()),a.purposes.includes(u.IntegrationPurpose.QUALIFY)&&(a.qualify(n),s()),a.purposes.includes(u.IntegrationPurpose.EXECUTE)?[4,this.getSourceToken()]:[3,6];case 5:d=g.sent(),a.execute(t,n,(function(n,r){return void 0===r&&(r=!0),s(),r?(0,f.setVerificationResponse)(p.config.apiUrl,p.publicKey,d,p.config.apiVersion,e,t.verificationStepId,n):Promise.resolve(null)}),(function(){return o(p,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n.onError?[4,n.onError((0,u.cancelError)())]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))})),g.label=6;case 6:return[3,8];case 7:return h=g.sent(),l.Logger.error("Handle Verification Step - Could not process step:",h).setParameters({step:t}).log(),[3,8];case 8:return[2]}}))}))},e.prototype.verifyTimeDelta=function(e,t){var n=null==t?void 0:t.maxDuration;return!n||Date.now()-e.valueOf()<n},e.prototype.handleVerificationOutcome=function(e,t,n){o(this,void 0,void 0,(function(){var r,s,a,c,d,h,p,g,v,y=this;return i(this,(function(b){switch(b.label){case 0:if(l.Logger.trace("Handle Verification Outcome - Called",{verification:e}).log(),(null==e?void 0:e.id)||l.Logger.error("Handle Verification Outcome - Verification has no id").log(),!this.config.isEnabled)return[3,4];r=!1,s=0,a=!0,c=new Date,d=n.pollingInterval,h=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)},p=function(){var p,b,m,S,E,_,w;return i(this,(function(O){switch(O.label){case 0:return s>0?[4,new Promise((function(e){return setTimeout(e,d)}))]:[3,5];case 1:O.sent(),s>n.numAtInitialPollingInterval&&(p=Math.min(n.maxPollingInterval,n.pollingInterval*Math.pow(2,Math.max(0,s-n.numAtInitialPollingInterval))),d=p/2+h(0,p/2)),O.label=2;case 2:return O.trys.push([2,4,,5]),l.Logger.trace("Handle Verification Outcome - Querying Verification Status").log(),[4,(0,f.queryVerification)(g.config.apiUrl,g.publicKey,g.config.apiVersion,e)];case 3:return b=O.sent(),e=b.verification,[3,5];case 4:return m=O.sent(),l.Logger.error("Error Querying Verification Status.",m).log(),[3,5];case 5:if(r=!g.isRunning(e),s+=1,r)return[3,8];S=g.filterSeenSteps(null!==(v=e.nextSteps)&&void 0!==v?v:[]),O.label=6;case 6:return S&&S.length>0?[4,new Promise((function(n){return o(y,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.handleVerificationStep(e,S[0],t,n)];case 1:return r.sent(),S=this.filterSeenSteps(S),[2]}}))}))}))]:[3,8];case 7:return O.sent(),s=1,d=n.pollingInterval,c=new Date,[3,6];case 8:return g.isAllowed(e)?a?t.onApproved?[4,t.onApproved(e)]:[3,10]:[3,11]:[3,18];case 9:O.sent(),O.label=10;case 10:return[3,17];case 11:E=g.integrationLoader.filterIntegrationsByPurpose(g.integrations,u.IntegrationPurpose.EXECUTE),_=0,w=E,O.label=12;case 12:return _<w.length?[4,w[_].cleanup()]:[3,15];case 13:O.sent(),O.label=14;case 14:return _++,[3,12];case 15:return t.onVerified?[4,t.onVerified(e)]:[3,17];case 16:O.sent(),O.label=17;case 17:return[3,34];case 18:return g.isDenied(e)?(g.clearScreen(),t.onDenied?[4,t.onDenied(e)]:[3,20]):[3,21];case 19:O.sent(),O.label=20;case 20:return[3,34];case 21:return g.isRunning(e)?e.status!==u.VerificationStatus.BLOCKED?[3,24]:t.onBlocked?[4,t.onBlocked(e)]:[3,23]:[3,27];case 22:O.sent(),O.label=23;case 23:return[3,26];case 24:return t.onPending?[4,t.onPending(e)]:[3,26];case 25:O.sent(),O.label=26;case 26:return[3,34];case 27:return g.isUndecided(e)?t.onUndecided?[4,t.onUndecided(e)]:[3,29]:[3,30];case 28:O.sent(),O.label=29;case 29:return[3,34];case 30:return g.hasError(e)?(g.clearScreen(),t.onError?[4,t.onError((0,u.systemError)(e.error))]:[3,32]):[3,33];case 31:O.sent(),O.label=32;case 32:return[3,34];case 33:g.isCancelled(e)||((null==e?void 0:e.status)?l.Logger.error("Unknown Verification State:\nStatus:".concat(null==e?void 0:e.status,"\nOutcome:").concat(null==e?void 0:e.outcome)).log():l.Logger.error("Error Retrieving Verification:",e).log()),O.label=34;case 34:return a=!1,[2]}}))},g=this,b.label=1;case 1:return r||0!=s&&!this.verifyTimeDelta(c,n)?[3,3]:[5,p()];case 2:return b.sent(),[3,1];case 3:return[2];case 4:return t.onApproved?[4,t.onApproved(e)]:[3,6];case 5:b.sent(),b.label=6;case 6:return[2]}}))}))},e.prototype.clearScreen=function(){for(var e=0,t=this.integrationLoader.filterIntegrationsByPurpose(this.integrations,u.IntegrationPurpose.EXECUTE);e<t.length;e++){var n=t[e];Object.getPrototypeOf(n).constructor.removeModal&&Object.getPrototypeOf(n).constructor.removeModal()}},e.prototype.track=function(e,t){var n=this;try{if(this.config.sessionId=e,this.config.userId=t,this.config.isEnabled&&e){var r=function(){o(n,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return[4,this.getSourceToken()];case 1:return n=r.sent(),this.integrationLoader.filterIntegrationsByPurpose(this.integrations,u.IntegrationPurpose.OBSERVE).forEach((function(r){r.observe({sessionId:e,userId:t,sourceToken:n})})),[2]}}))}))};this.areIntegrationsLoaded?r():this.onIntegrationsLoaded.push(r)}}catch(e){l.Logger.error("Error Updating Observers",e).log()}},e.prototype.attachIdentifierMetadata=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){try{return t=this.integrationLoader.filterIntegrationsByPurpose(this.integrations,u.IntegrationPurpose.IDENTIFY),[2,this.identifier.saveSourceTokenMetadata(e,t)]}catch(e){return l.Logger.error("Error Attaching Metadata",e).log(),[2,Promise.reject(e)]}return[2]}))}))},e.prototype.getSourceToken=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){try{return[2,new Promise((function(n){return o(t,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return this.config.isEnabled?this.isSourceTokenValid()?[4,this.attachIdentifierMetadata(this.sourceToken)]:[3,2]:[3,4];case 1:return r.sent(),e&&e(this.sourceToken),n(this.sourceToken),[3,3];case 2:e?this.onSource.push(function(){return o(t,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.attachIdentifierMetadata(this.sourceToken)];case 1:return t.sent(),e(this.sourceToken),n(this.sourceToken),[2]}}))}))}.bind(this)):this.onSource.push(function(){return o(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.attachIdentifierMetadata(this.sourceToken)];case 1:return e.sent(),n(this.sourceToken),[2]}}))}))}.bind(this)),o(t,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.generateSourceToken()];case 1:return e.sent(),[2]}}))})),r.label=3;case 3:return[3,5];case 4:e&&e(c.DISABLED_SOURCE_TOKEN),n(c.DISABLED_SOURCE_TOKEN),r.label=5;case 5:return[2]}}))}))}))]}catch(e){return[2,Promise.reject(e)]}return[2]}))}))},e.prototype.refreshSourceToken=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){try{return[2,new Promise((function(n){return o(t,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this.config.isEnabled?[4,this.identifier.expireSourceToken()]:[3,3];case 1:return r.sent(),[4,this.getSourceToken()];case 2:return t=r.sent(),e&&e(t),n(t),[3,4];case 3:e&&e(c.DISABLED_SOURCE_TOKEN),n(c.DISABLED_SOURCE_TOKEN),r.label=4;case 4:return[2]}}))}))}))]}catch(e){return[2,Promise.reject(e)]}return[2]}))}))},e.prototype.handleVerification=function(e,t,n){var r=(0,g.default)(c.DEFAULT_VERIFICATION_OPTIONS);r.maxDuration=n?n.maxDuration:r.maxDuration,this.handleVerificationOutcome(e,t,r)},e.prototype.isRunning=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.PENDING||(null==e?void 0:e.status)===u.VerificationStatus.BLOCKED},e.prototype.isAllowed=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.COMPLETE&&(null==e?void 0:e.outcome)===u.VerificationOutcome.APPROVED},e.prototype.isDenied=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.COMPLETE&&(null==e?void 0:e.outcome)===u.VerificationOutcome.DENIED},e.prototype.isUndecided=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.COMPLETE&&(null==e?void 0:e.outcome)===u.VerificationOutcome.PENDING},e.prototype.isCancelled=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.COMPLETE&&(null==e?void 0:e.outcome)===u.VerificationOutcome.ERROR},e.prototype.hasError=function(e){return(null==e?void 0:e.status)===u.VerificationStatus.FAILED&&(null==e?void 0:e.outcome)===u.VerificationOutcome.ERROR},e.prototype.getSession=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(n){try{return[2,new Promise((function(n){return o(t,void 0,void 0,(function(){var t=this;return i(this,(function(r){return this.config.isEnabled?"undefined"!=typeof window&&(window.addEventListener("message",(function(r){var o,i;if((null===(o=r.data)||void 0===o?void 0:o.type)===c.DodgeballSessionMessageType.GET_SESSION_RESPONSE&&(null===(i=r.data)||void 0===i?void 0:i.key)===c.DODGEBALL_SESSION_KEY){var s=null,a=0;try{var u=JSON.parse(r.data.value);s=u.sessionId,a=u.expiry}catch(e){s=r.data.value}a&&a<Date.now()&&(t.clearSession(),s=null),e&&e(s),n(s)}})),this.sendSessionUtilMessage({type:c.DodgeballSessionMessageType.GET_SESSION,key:c.DODGEBALL_SESSION_KEY})):(e&&e(c.DISABLED_SESSION_ID),n(c.DISABLED_SESSION_ID)),[2]}))}))}))]}catch(e){return[2,Promise.reject(e)]}return[2]}))}))},e.prototype.setSession=function(e,t){this.sendSessionUtilMessage({type:c.DodgeballSessionMessageType.SET_SESSION,key:c.DODGEBALL_SESSION_KEY,value:JSON.stringify({sessionId:e,expiry:null!=t?t:0})})},e.prototype.clearSession=function(){this.sendSessionUtilMessage({type:c.DodgeballSessionMessageType.CLEAR_SESSION,key:c.DODGEBALL_SESSION_KEY})},e}();t.Dodgeball=y,t.useDodgeball=function(e,t){if("undefined"!=typeof window){if(window.hasOwnProperty("dodgeball"))return window.dodgeball;var n=new y(e,t);return window.dodgeball=n,n}return new y(e,t)}},532:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(646)),a=n(833),u=n(441),c=function(){function e(e){var t=e.cookiesEnabled,n=e.apiUrl,r=e.apiVersion,o=e.publicKey;e.clientUrl,this.cookieName="_dodgeballId",this.cookiesEnabled=!0,this.cookiesEnabled=t,this.apiUrl=n,this.apiVersion=r,this.publicKey=o,this.cookieName="_db-".concat((0,a.getMd5)([this.publicKey,this.apiUrl]))}return e.prototype.getSource=function(){var e=null;if(this.cookiesEnabled?e=s.default.get(this.cookieName):"undefined"!=typeof window&&window.localStorage&&(e=window.localStorage.getItem(this.cookieName)),null==e)return null;try{var t=JSON.parse(e);return t.expiry>Date.now()?t:(this.saveSource(null),null)}catch(e){return null}},e.prototype.saveSource=function(e){this.cookiesEnabled?null!=e&&