/*! For license information please see mng-digisubs.main.bundle.js.LICENSE.txt */ (()=>{var e={251:(e,t)=>{t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,c=(1<>1,l=-7,d=n?o-1:0,h=n?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-l)-1,f>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),i-=u}return(f?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+f]=255&s,f+=p,s/=256,o-=8);for(a=a<0;e[n+f]=255&a,f+=p,a/=256,u-=8);e[n+f-p]|=128*g}},579:(e,t,n)=>{var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,n)=>{var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,a){return new o(r().w(e,t,n,i),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791:(e,t,n)=>{var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,a,s){try{var c=t[e](o),u=c.value;return u instanceof r?n.resolve(u.v).then(function(e){i("next",e,a,s)},function(e){i("throw",e,a,s)}):n.resolve(u).then(function(e){c.value=e,a(c)},function(e){return i("throw",e,a,s)})}catch(e){s(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return a=a?a.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},3612:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog}},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633:(e,t,n)=>{var r=n(5172),o=n(6993),i=n(5869),a=n(887),s=n(1791),c=n(4373),u=n(579);function l(){"use strict";var t=o(),n=t.m(l),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(h(t)?a:i)(p(e),t,n,r,o)},keys:c,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5546:e=>{function t(n,r,o,i){var a=Object.defineProperty;try{a({},"",{})}catch(n){a=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5869:(e,t,n)=>{var r=n(887);e.exports=function(e,t,n,o,i){var a=r(e,t,n,o,i);return a.next().then(function(e){return e.done?e.value:a.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},6993:(e,t,n)=>{var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.toStringTag||"@@toStringTag";function c(e,o,i,a){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return r(c,"_invoke",function(e,r,o){var i,a,s,c=0,l=o||[],d=!1,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return i=e,a=0,s=t,h.n=n,u}};function f(e,r){for(a=e,s=r,n=0;!d&&c&&!o&&n3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=e<2&&fr||r>p)&&(i[4]=e,i[5]=r,h.n=p,a=0))}if(o||e>1)return u;throw d=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,s)):h.n=s:h.v=s);try{if(c=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(d=h.n<0)?s:e.call(r,h))!==u)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:n,done:d}}}(e,i,a),!0),c}var u={};function l(){}function d(){}function h(){}n=Object.getPrototypeOf;var f=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=h.prototype=l.prototype=Object.create(f);function g(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=h,r(p,"constructor",h),r(h,"constructor",d),d.displayName="GeneratorFunction",r(h,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:g}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,c)),l=0,d=c>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,s=0,c=r-o;sc?c:s+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=i[a],r[i.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i{"use strict";const r=n(7526),o=n(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=s(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?s(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=s(t);for(let r=0;r=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,o){let i,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let r=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let a;for(r>i/2&&(r=i/2),a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=n){let n,r,s,c;switch(a){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],s=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&s)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=a}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return v(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function R(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function U(e,t,n,r,o){H(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function x(e,t,n,r,o){H(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function B(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||_(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||X(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||_(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=q(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=n-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=q(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||X(t,e.length-(n+1))}(r,o,i)}function j(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=K(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const $=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function q(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,c,"next",e)}function c(e){t(a,o,i,s,c,"throw",e)}s(void 0)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>$t,hasStandardBrowserEnv:()=>Qt,hasStandardBrowserWebWorkerEnv:()=>en,navigator:()=>qt,origin:()=>tn});var o=n(4756),i=n(3612);const a={log:function(){if(i.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=Array(t);n{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,y.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),y.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var c=!1,u=0;uDate.now();class v extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,v.prototype)}static fromPayload({error:e,error_description:t}){return new v(e,t)}}class O extends v{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,O.prototype)}}class I extends v{constructor(e,t,n,r,o=null){super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,I.prototype)}}class T extends v{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,T.prototype)}}class N extends T{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,N.prototype)}}class R extends v{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,R.prototype)}}class C extends v{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,C.prototype)}}class L extends v{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${P(e,["default"])}', scope: '${P(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,L.prototype)}}class k extends v{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${P(e,["default"])}', missing scope: '${P(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,k.prototype)}}class _ extends v{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,_.prototype)}}function P(e,t=[]){return e&&!t.includes(e)?e:""}const U=()=>window.crypto,x=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(U().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},B=e=>btoa(e),D=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],M=e=>Object.keys(e).reduce((t,n)=>{const r=D.find(e=>e.key===n);return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t},{}),G=e=>{var{clientId:t}=e,n=p(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},F=async e=>{const t=U().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},K=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),H=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},j=new TextEncoder,X=new TextDecoder;function W(e){return"string"==typeof e?j.encode(e):X.decode(e)}function Y(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new Z(`${e.name} modulusLength must be at least 2048 bits`)}let V;if(Uint8Array.prototype.toBase64)V=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;V=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},oe=async(e,t,n,r,o,i,a=1e4,s)=>o?(async(e,t,n,r,o,i,a,s)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s},u=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(c,[n.port2])});var c,u})(e,t,n,r,a,o,i,s):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([re(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,a);async function ie(e,t,n,r,o,i,a,s,c,u){if(c){const t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let l,d=null;for(let c=0;c<3;c++)try{l=await oe(e,n,r,o,i,a,t,s),d=null;break}catch(e){d=e}if(d)throw d;const h=l.json,{error:f,error_description:g}=h,m=p(h,["error","error_description"]),{headers:w,ok:y}=l;let A;if(c&&(A=w["dpop-nonce"],A&&await c.setNonce(A)),!y){const l=g||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===f)throw new C(f,l,m.mfa_token);if("missing_refresh_token"===f)throw new L(n,r);if("use_dpop_nonce"===f){if(!c||!A||u)throw new _(A);return ie(e,t,n,r,o,i,a,s,c,!0)}throw new v(f||"request_error",l)}return m}async function ae(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,l=p(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const d="urn:ietf:params:oauth:grant-type:token-exchange"===l.grant_type,h="refresh_token"===l.grant_type&&c,f=Object.assign(Object.assign(Object.assign(Object.assign({},l),d&&o&&{audience:o}),d&&i&&{scope:i}),h&&{audience:o,scope:i}),g=s?G(f):JSON.stringify(f),m=(w=l.grant_type,ne.includes(w));var w;return await ie(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:g,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(M(a||b)))}},t,s,c,m?u:void 0)}const se=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},ce=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),se(r,t)};class ue{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new ue({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new ue({scope:t,audience:n,clientId:r})}}class le{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}class de{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class he{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||S}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!o&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const a=await this.nowProvider(),s=Math.floor(a/1e3);return i.expiresAt-t!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new ue({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=ue.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=ue.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}}class fe{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const pe=e=>"number"==typeof e,ge=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var me=w(function(e,t){var n=g&&g.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nEe.get(e)||Ee.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),ye(`_legacy_${e}`,JSON.stringify(t),r),Ee.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Ae(e,n),Ee.remove(e,t),Ee.remove(`_legacy_${e}`,t)}},Se={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var ve;!function(e){e.Code="code",e.ConnectCode="connect_code"}(ve||(ve={}));var Oe,Ie=function(e){return Oe=Oe||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const Re={memory:()=>(new de).enclosedCache,localstorage:()=>new le},Ce=e=>Re[e],Le=e=>{const{openUrl:t,onRedirect:n}=e,r=p(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},ke=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},_e={NONCE:"nonce",KEYPAIR:"keypair"};class Pe{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(_e).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(_e.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(_e.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(_e.NONCE,this.buildKey(e))}findKeyPair(){return this.find(_e.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(_e.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(_e.KEYPAIR,this.clientId)}}class Ue{constructor(e){this.storage=new Pe(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){const i=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t);return ee(e,i,n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Q(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await te(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new J("unsupported JWK kty")}return z(await crypto.subtle.digest({name:"SHA-256"},W(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var xe;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(xe||(xe={}));class Be{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=xe.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?xe.DPoP:xe.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===xe.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new _(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class De{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new Me({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new Me(t)}}class Me extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,Me.prototype)}}const Ge=new A;class Fe{constructor(e){let t,n;if(this.userCache=(new de).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await Ge.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!U())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===U().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!Ce(t))throw new Error(`Invalid cache location "${t}"`);n=Ce(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Ee:be,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:Se;var o;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:se(t,e,...n)};let r={default:se(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=se(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new fe(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||S,this.cacheManager=new he(n,n.allKeys?void 0:new Ne(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Ue(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl);const i=`${this.domainUrl}/me/`,a=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:i},detailedResponse:!0})}));this.myAccountApi=new De(a,i),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Ie)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||b)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${G(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(K(r)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],ge.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(K(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!pe(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!pe(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!pe(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&pe(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),ro)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=B(x()),i=B(x()),a=x(),s=await F(a),c=H(s),u=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),l=((e,t,n,r,o,i,a,s,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:ce(t,n.scope,n.audience),response_type:"code",response_mode:s||"query",state:r,nonce:o,redirect_uri:a||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),d=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(e=>new Promise((t,n)=>{let r;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new R(e.popup)))},1e3),i=setTimeout(()=>{clearInterval(o),n(new N(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),e.popup.close(),a.data.response.error)return n(v.fromPayload(a.data.response));t(a.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==o.state)throw new v("state_mismatch","Invalid state");const i=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:i})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=Le(e),{openUrl:r,fragment:o,appState:i}=n,a=p(n,["openUrl","fragment","appState"]),s=(null===(t=a.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:u}=c,l=p(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i,response_type:ve.Code}),s&&{organization:s}));const d=o?`${u}#${o}`:u;r?await r(d):window.location.assign(d)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new v("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===ve.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new O(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new v("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:ve.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new I(o,i||o,t.connection,r,t.appState);if(!n)throw new v("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new v("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:ve.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ce(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=Te[t];return n||(n=e().finally(()=>{delete Te[t],n=null}),Te[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=p(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!await(async(e,t=3)=>{for(let n=0;nGe.acquireLock(r,5e3),10))throw new T;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},a?{scope:a}:null),{expires_in:s})}finally{await Ge.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ce(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},E),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new ue({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=p(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${G(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=Le(e),{openUrl:r}=n,o=p(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:a,redirect_uri:s,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new v("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let l;try{l=new URL(this.domainUrl).origin}catch(e){l=this.domainUrl}const d=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",s,!1))};let s;const c=setTimeout(()=>{o(new T),a()},1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(v.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,l,n);if(o!==d.state)throw new v("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:d.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},h),{scope:c,oauthTokenScope:h.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new ue({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new L(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(u.refresh_token&&this.options.useMrrt&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,u.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,a=null==t?void 0:t.scope,s=e.authorizationParams.audience,c=e.authorizationParams.scope,i===s&&ke(c,a)||ke(o,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,u.scope);throw new k(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}var i,a,s,c}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=p(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new ue({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new ue({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){const{nonceIn:n,organization:r,scopesToRequest:o}=t||{},i=await ae(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:o||e.scope}),this.worker),a=await this._verifyIdToken(i.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:e.scope,audience:e.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:ce(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new Be(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,authorization_params:o,redirectUri:i=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const a=B(x()),s=x(),c=await F(s),u=H(c),{connect_uri:l,connect_params:d,auth_session:h}=await this.myAccountApi.connectAccount({connection:r,redirect_uri:i,state:a,code_challenge:u,code_challenge_method:"S256",authorization_params:o});this.transactionManager.create({state:a,code_verifier:s,auth_session:h,redirect_uri:i,appState:n,connection:r,response_type:ve.ConnectCode});const f=new URL(l);f.searchParams.set("ticket",d.ticket),t?await t(f.toString()):window.location.assign(f)}}function Ke(e,t){return function(){return e.apply(t,arguments)}}const{toString:He}=Object.prototype,{getPrototypeOf:je}=Object,{iterator:Xe,toStringTag:We}=Symbol,Ye=(Ve=Object.create(null),e=>{const t=He.call(e);return Ve[t]||(Ve[t]=t.slice(8,-1).toLowerCase())});var Ve;const ze=e=>(e=e.toLowerCase(),t=>Ye(t)===e),Je=e=>t=>typeof t===e,{isArray:Ze}=Array,$e=Je("undefined");function qe(e){return null!==e&&!$e(e)&&null!==e.constructor&&!$e(e.constructor)&&tt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Qe=ze("ArrayBuffer");const et=Je("string"),tt=Je("function"),nt=Je("number"),rt=e=>null!==e&&"object"==typeof e,ot=e=>{if("object"!==Ye(e))return!1;const t=je(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||We in e||Xe in e)},it=ze("Date"),at=ze("File"),st=ze("Blob"),ct=ze("FileList"),ut=ze("URLSearchParams"),[lt,dt,ht,ft]=["ReadableStream","Request","Response","Headers"].map(ze);function pt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ze(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,wt=e=>!$e(e)&&e!==mt;const yt=(At="undefined"!=typeof Uint8Array&&je(Uint8Array),e=>At&&e instanceof At);var At;const Et=ze("HTMLFormElement"),bt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),St=ze("RegExp"),vt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};pt(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Ot=ze("AsyncFunction"),It=(Tt="function"==typeof setImmediate,Nt=tt(mt.postMessage),Tt?setImmediate:Nt?(Rt=`axios@${Math.random()}`,Ct=[],mt.addEventListener("message",({source:e,data:t})=>{e===mt&&t===Rt&&Ct.length&&Ct.shift()()},!1),e=>{Ct.push(e),mt.postMessage(Rt,"*")}):e=>setTimeout(e));var Tt,Nt,Rt,Ct;const Lt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(mt):"undefined"!=typeof process&&process.nextTick||It,kt={isArray:Ze,isArrayBuffer:Qe,isBuffer:qe,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||tt(e.append)&&("formdata"===(t=Ye(e))||"object"===t&&tt(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qe(e.buffer),t},isString:et,isNumber:nt,isBoolean:e=>!0===e||!1===e,isObject:rt,isPlainObject:ot,isEmptyObject:e=>{if(!rt(e)||qe(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:lt,isRequest:dt,isResponse:ht,isHeaders:ft,isUndefined:$e,isDate:it,isFile:at,isBlob:st,isRegExp:St,isFunction:tt,isStream:e=>rt(e)&&tt(e.pipe),isURLSearchParams:ut,isTypedArray:yt,isFileList:ct,forEach:pt,merge:function e(){const{caseless:t,skipUndefined:n}=wt(this)&&this||{},r={},o=(o,i)=>{const a=t&>(r,i)||i;ot(r[a])&&ot(o)?r[a]=e(r[a],o):ot(o)?r[a]=e({},o):Ze(o)?r[a]=o.slice():n&&$e(o)||(r[a]=o)};for(let e=0,t=arguments.length;e(pt(t,(t,r)=>{n&&tt(t)?e[r]=Ke(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&je(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ye,kindOfTest:ze,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ze(e))return e;let t=e.length;if(!nt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Xe]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Et,hasOwnProperty:bt,hasOwnProp:bt,reduceDescriptors:vt,freezeMethods:e=>{vt(e,(t,n)=>{if(tt(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];tt(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ze(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:gt,global:mt,isContextDefined:wt,isSpecCompliantForm:function(e){return!!(e&&tt(e.append)&&"FormData"===e[We]&&e[Xe])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(rt(e)){if(t.indexOf(e)>=0)return;if(qe(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ze(e)?[]:{};return pt(e,(e,t)=>{const i=n(e,r+1);!$e(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ot,isThenable:e=>e&&(rt(e)||tt(e))&&tt(e.then)&&tt(e.catch),setImmediate:It,asap:Lt,isIterable:e=>null!=e&&tt(e[Xe])};function _t(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}kt.inherits(_t,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:kt.toJSONObject(this.config),code:this.code,status:this.status}}});const Pt=_t.prototype,Ut={};["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(e=>{Ut[e]={value:e}}),Object.defineProperties(_t,Ut),Object.defineProperty(Pt,"isAxiosError",{value:!0}),_t.from=(e,t,n,r,o,i)=>{const a=Object.create(Pt);kt.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return _t.call(a,s,c,n,r,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const xt=_t;var Bt=n(8287).hp;function Dt(e){return kt.isPlainObject(e)||kt.isArray(e)}function Mt(e){return kt.endsWith(e,"[]")?e.slice(0,-2):e}function Gt(e,t,n){return e?e.concat(t).map(function(e,t){return e=Mt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ft=kt.toFlatObject(kt,{},null,function(e){return/^is[A-Z]/.test(e)});const Kt=function(e,t,n){if(!kt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!kt.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&kt.isSpecCompliantForm(t);if(!kt.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(kt.isDate(e))return e.toISOString();if(kt.isBoolean(e))return e.toString();if(!s&&kt.isBlob(e))throw new xt("Blob is not supported. Use a Buffer instead.");return kt.isArrayBuffer(e)||kt.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Bt.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(kt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(kt.isArray(e)&&function(e){return kt.isArray(e)&&!e.some(Dt)}(e)||(kt.isFileList(e)||kt.endsWith(n,"[]"))&&(s=kt.toArray(e)))return n=Mt(n),s.forEach(function(e,r){!kt.isUndefined(e)&&null!==e&&t.append(!0===a?Gt([n],r,i):null===a?n:n+"[]",c(e))}),!1;return!!Dt(e)||(t.append(Gt(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Ft,{defaultVisitor:u,convertValue:c,isVisitable:Dt});if(!kt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!kt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),kt.forEach(n,function(n,i){!0===(!(kt.isUndefined(n)||null===n)&&o.call(t,n,kt.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Ht(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function jt(e,t){this._pairs=[],e&&Kt(e,this,t)}const Xt=jt.prototype;Xt.append=function(e,t){this._pairs.push([e,t])},Xt.toString=function(e){const t=e?function(t){return e.call(this,t,Ht)}:Ht;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Wt=jt;function Yt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Vt(e,t,n){if(!t)return e;const r=n&&n.encode||Yt;kt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):kt.isURLSearchParams(t)?t.toString():new Wt(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const zt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){kt.forEach(this.handlers,function(t){null!==t&&e(t)})}},Jt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Zt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Wt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},$t="undefined"!=typeof window&&"undefined"!=typeof document,qt="object"==typeof navigator&&navigator||void 0,Qt=$t&&(!qt||["ReactNative","NativeScript","NS"].indexOf(qt.product)<0),en="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tn=$t&&window.location.href||"http://localhost",nn={...e,...Zt};const rn=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&kt.isArray(r)?r.length:i,s)return kt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&kt.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&kt.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return kt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const on={transitional:Jt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=kt.isObject(e);o&&kt.isHTMLForm(e)&&(e=new FormData(e));if(kt.isFormData(e))return r?JSON.stringify(rn(e)):e;if(kt.isArrayBuffer(e)||kt.isBuffer(e)||kt.isStream(e)||kt.isFile(e)||kt.isBlob(e)||kt.isReadableStream(e))return e;if(kt.isArrayBufferView(e))return e.buffer;if(kt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Kt(e,new nn.classes.URLSearchParams,{visitor:function(e,t,n,r){return nn.isNode&&kt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=kt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Kt(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(kt.isString(e))try{return(t||JSON.parse)(e),kt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||on.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(kt.isResponse(e)||kt.isReadableStream(e))return e;if(e&&kt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw xt.from(e,xt.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:nn.classes.FormData,Blob:nn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};kt.forEach(["delete","get","head","post","put","patch"],e=>{on.headers[e]={}});const an=on,sn=kt.toObjectSet(["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"]),cn=Symbol("internals");function un(e){return e&&String(e).trim().toLowerCase()}function ln(e){return!1===e||null==e?e:kt.isArray(e)?e.map(ln):String(e)}function dn(e,t,n,r,o){return kt.isFunction(r)?r.call(this,t,n):(o&&(t=n),kt.isString(t)?kt.isString(r)?-1!==t.indexOf(r):kt.isRegExp(r)?r.test(t):void 0:void 0)}class hn{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=un(t);if(!o)throw new Error("header name must be a non-empty string");const i=kt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=ln(e))}const i=(e,t)=>kt.forEach(e,(e,n)=>o(e,n,t));if(kt.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(kt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&sn[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(kt.isObject(e)&&kt.isIterable(e)){let n,r,o={};for(const t of e){if(!kt.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?kt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=un(e)){const n=kt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(kt.isFunction(t))return t.call(this,e,n);if(kt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=un(e)){const n=kt.findKey(this,e);return!(!n||void 0===this[n]||t&&!dn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=un(e)){const o=kt.findKey(n,e);!o||t&&!dn(0,n[o],o,t)||(delete n[o],r=!0)}}return kt.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!dn(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return kt.forEach(this,(r,o)=>{const i=kt.findKey(n,o);if(i)return t[i]=ln(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();a!==o&&delete t[o],t[a]=ln(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return kt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&kt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[cn]=this[cn]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=un(e);t[r]||(!function(e,t){const n=kt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return kt.isArray(e)?e.forEach(r):r(e),this}}hn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),kt.reduceDescriptors(hn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),kt.freezeMethods(hn);const fn=hn;function pn(e,t){const n=this||an,r=t||n,o=fn.from(r.headers);let i=r.data;return kt.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function gn(e){return!(!e||!e.__CANCEL__)}function mn(e,t,n){xt.call(this,null==e?"canceled":e,xt.ERR_CANCELED,t,n),this.name="CanceledError"}kt.inherits(mn,xt,{__CANCEL__:!0});const wn=mn;function yn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new xt("Request failed with status code "+n.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const An=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[a];o||(o=c),n[i]=s,r[i]=c;let l=a,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout(()=>{r=null,a(n)},i-s)))},()=>n&&a(n)]},bn=(e,t,n=3)=>{let r=0;const o=An(50,250);return En(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,c=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},Sn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},vn=e=>(...t)=>kt.asap(()=>e(...t)),On=nn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,nn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(nn.origin),nn.navigator&&/(msie|trident)/i.test(nn.navigator.userAgent)):()=>!0,In=nn.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];kt.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),kt.isString(r)&&s.push(`path=${r}`),kt.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),kt.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Tn(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Nn=e=>e instanceof fn?{...e}:e;function Rn(e,t){t=t||{};const n={};function r(e,t,n,r){return kt.isPlainObject(e)&&kt.isPlainObject(t)?kt.merge.call({caseless:r},e,t):kt.isPlainObject(t)?kt.merge({},t):kt.isArray(t)?t.slice():t}function o(e,t,n,o){return kt.isUndefined(t)?kt.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!kt.isUndefined(t))return r(void 0,t)}function a(e,t){return kt.isUndefined(t)?kt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,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:s,headers:(e,t,n)=>o(Nn(e),Nn(t),0,!0)};return kt.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,a=i(e[r],t[r],r);kt.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Cn=e=>{const t=Rn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=fn.from(a),t.url=Vt(Tn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),kt.isFormData(n))if(nn.hasStandardBrowserEnv||nn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(kt.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&a.set(e,n)})}if(nn.hasStandardBrowserEnv&&(r&&kt.isFunction(r)&&(r=r(t)),r||!1!==r&&On(t.url))){const e=o&&i&&In.read(i);e&&a.set(o,e)}return t},Ln="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Cn(e);let o=r.data;const i=fn.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:f}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=fn.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());yn(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new xt("Request aborted",xt.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new xt(r,xt.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Jt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new xt(t,o.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&kt.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),kt.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),f&&([c,l]=bn(f,!0),g.addEventListener("progress",c)),h&&g.upload&&([s,u]=bn(h),g.upload.addEventListener("progress",s),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{g&&(n(!t||t.type?new wn(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const w=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);w&&-1===nn.protocols.indexOf(w)?n(new xt("Unsupported protocol "+w+":",xt.ERR_BAD_REQUEST,e)):g.send(o||null)})},kn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof xt?t:new wn(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new xt(`timeout ${t} of ms exceeded`,xt.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>kt.asap(a),s}},_n=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Pn(e))yield*_n(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:xn}=kt,Bn=(({Request:e,Response:t})=>({Request:e,Response:t}))(kt.global),{ReadableStream:Dn,TextEncoder:Mn}=kt.global,Gn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Fn=e=>{e=kt.merge.call({skipUndefined:!0},Bn,e);const{fetch:t,Request:n,Response:r}=e,o=t?xn(t):"function"==typeof fetch,i=xn(n),a=xn(r);if(!o)return!1;const s=o&&xn(Dn),c=o&&("function"==typeof Mn?(u=new Mn,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&s&&Gn(()=>{let e=!1;const t=new n(nn.origin,{body:new Dn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=a&&s&&Gn(()=>kt.isReadableStream(new r("").body)),h={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new xt(`Response type '${e}' is not supported`,xt.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=kt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(kt.isBlob(e))return e.size;if(kt.isSpecCompliantForm(e)){const t=new n(nn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return kt.isArrayBufferView(e)||kt.isArrayBuffer(e)?e.byteLength:(kt.isURLSearchParams(e)&&(e+=""),kt.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:p,onDownloadProgress:g,onUploadProgress:m,responseType:w,headers:y,withCredentials:A="same-origin",fetchOptions:E}=Cn(e),b=t||fetch;w=w?(w+"").toLowerCase():"text";let S=kn([c,u&&u.toAbortSignal()],p),v=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let I;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(I=await f(y,s))){let e,t=new n(o,{method:"POST",body:s,duplex:"half"});if(kt.isFormData(s)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=Sn(I,bn(vn(m)));s=Un(t.body,65536,e,n)}}kt.isString(A)||(A=A?"include":"omit");const t=i&&"credentials"in n.prototype,c={...E,signal:S,method:a.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:t?A:void 0};v=i&&new n(o,c);let u=await(i?b(v,E):b(o,c));const p=d&&("stream"===w||"response"===w);if(d&&(g||p&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=kt.toFiniteNumber(u.headers.get("content-length")),[n,o]=g&&Sn(t,bn(vn(g),!0))||[];u=new r(Un(u.body,65536,n,()=>{o&&o(),O&&O()}),e)}w=w||"text";let T=await h[kt.findKey(h,w)||"text"](u,e);return!p&&O&&O(),await new Promise((t,n)=>{yn(t,n,{data:T,headers:fn.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:v})})}catch(t){if(O&&O(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new xt("Network Error",xt.ERR_NETWORK,e,v),{cause:t.cause||t});throw xt.from(t,t&&t.code,e,v)}}},Kn=new Map,Hn=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let a,s,c=i.length,u=Kn;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Fn(t)),u=s;return s},jn=(Hn(),{http:null,xhr:Ln,fetch:{get:Hn}});kt.forEach(jn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Xn=e=>`- ${e}`,Wn=e=>kt.isFunction(e)||null===e||!1===e;const Yn={getAdapter:function(e,t){e=kt.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Xn).join("\n"):" "+Xn(e[0]):"as no adapter specified";throw new xt("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:jn};function Vn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wn(null,e)}function zn(e){Vn(e),e.headers=fn.from(e.headers),e.data=pn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Yn.getAdapter(e.adapter||an.adapter,e)(e).then(function(t){return Vn(e),t.data=pn.call(e,e.transformResponse,t),t.headers=fn.from(t.headers),t},function(t){return gn(t)||(Vn(e),t&&t.response&&(t.response.data=pn.call(e,e.transformResponse,t.response),t.response.headers=fn.from(t.response.headers))),Promise.reject(t)})}const Jn="1.13.2",Zn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Zn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const $n={};Zn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new xt(r(o," has been removed"+(t?" in "+t:"")),xt.ERR_DEPRECATED);return t&&!$n[o]&&($n[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Zn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const qn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new xt("options must be an object",xt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new xt("option "+i+" must be "+n,xt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new xt("Unknown option "+i,xt.ERR_BAD_OPTION)}},validators:Zn},Qn=qn.validators;class er{constructor(e){this.defaults=e||{},this.interceptors={request:new zt,response:new zt}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Rn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&qn.assertOptions(n,{silentJSONParsing:Qn.transitional(Qn.boolean),forcedJSONParsing:Qn.transitional(Qn.boolean),clarifyTimeoutError:Qn.transitional(Qn.boolean)},!1),null!=r&&(kt.isFunction(r)?t.paramsSerializer={serialize:r}:qn.assertOptions(r,{encode:Qn.function,serialize:Qn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),qn.assertOptions(t,{baseUrl:Qn.spelling("baseURL"),withXsrfToken:Qn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&kt.merge(o.common,o[t.method]);o&&kt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=fn.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!s){const e=[zn.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new wn(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new nr(function(t){e=t});return{token:t,cancel:e}}}const rr=nr;const or={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(or).forEach(([e,t])=>{or[t]=e});const ir=or;const ar=function e(t){const n=new tr(t),r=Ke(tr.prototype.request,n);return kt.extend(r,tr.prototype,n,{allOwnKeys:!0}),kt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Rn(t,n))},r}(an);ar.Axios=tr,ar.CanceledError=wn,ar.CancelToken=rr,ar.isCancel=gn,ar.VERSION=Jn,ar.toFormData=Kt,ar.AxiosError=xt,ar.Cancel=ar.CanceledError,ar.all=function(e){return Promise.all(e)},ar.spread=function(e){return function(t){return e.apply(null,t)}},ar.isAxiosError=function(e){return kt.isObject(e)&&!0===e.isAxiosError},ar.mergeConfig=Rn,ar.AxiosHeaders=fn,ar.formToJSON=e=>rn(kt.isHTMLForm(e)?new FormData(e):e),ar.getAdapter=Yn.getAdapter,ar.HttpStatusCode=ir,ar.default=ar;const sr=ar,cr={AUTH0_SUB_COOKIE_KEY:"auth0_sub",ENTITLEMENT_COOKIE_KEY:"mng-entitlements",LOCAL_STORAGE_SESSION_KEY:"__MNG_Session",REGWALL_USER_IS_SUBSCRIBED:"regwallUserIsSubscribed",USER_IS_LOWA:"entitled",SLO_FLAG:"slo_flag",AB_TESTING_COOKIE:"_matheriSegs",ARTICLES_REMAINING_KEY:"articlesRemaining",USER_PROFILE_HASH:"user-profile"};var ur=function(){var e=window.location.href;return new URL(e)},lr=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=ur().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},hr=function(){var e=dr();return".".concat(e)},fr=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(a.log("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=d(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},pr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=dr(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=d(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},gr=function(e){return function(e,t){if("string"!=typeof e)throw new h("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new h(`Invalid token specified: missing part #${n+1}`);let o;try{o=f(r)}catch(e){throw new h(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new h(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},mr=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=dr().split(".")[0],e.prev=1,e.next=2,sr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 2:if(!(r=e.sent).data){e.next=3;break}return a.log("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 3:return e.abrupt("return",!1);case 4:return e.prev=4,s=e.catch(1),a.log("Apple Sub Check: Request Failure: ",s),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),wr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,sr({method:"get",url:"".concat(i.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":i.A.entitlementsApiKey}});case 1:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),yr=function(){return"complete"===document.readyState},Ar=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(yr())t();else{a.log("UIHandler: ","Waiting for the body to load...");var i=setInterval(r(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=yr()),document.querySelector("body")&&n&&(clearInterval(i),t(!0));case 1:case"end":return r.stop()}},r)})),200)}})},Er=function(){return new Promise(function(e){if(("interactive"===document.readyState||yr())&&window.dataLayer)a.log("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{a.log("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},br=function(){return new Promise(function(e){if("interactive"!==document.readyState&&"complete"!==document.readyState||!window.MG2DL){a.log("Utils mg2DataLayerLoaded:","Waiting for MG2DL to load...");var t=setInterval(function(){window.MG2DL&&window.MG2DL.length>0&&(clearInterval(t),e(!0))},50)}else a.log("Utils mg2DataLayerLoaded:","Document is in interactive state, resolving."),e()})},Sr=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Er();case 1:if(a.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",a.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return a.log("Utils dataLayerLoop: look for this element ",e),e[t]?(a.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(a.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},!window.dataLayer.some(r)){e.next=2;break}return e.abrupt("return",n);case 2:return e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),vr=function(){var e=r(o.mark(function e(){var t,n,r,i=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:[],e.next=1,Er();case 1:if(a.log("Utils getMultipleDataLayerObjects: looking for these keys ",t),window.dataLayer=window.dataLayer||[],n={},a.log("Utils getDataLayerObjects: dataLayer length",window.dataLayer.length),r=function(e){a.log("Utils dataLayerLoop: look for this element ",e);var r=!1;return t.forEach(function(t){void 0!==e[t]?(a.log("Utils dataLayerLoop: found ".concat(t,":"),e[t]),n[t]=e[t],r=!0):a.log("Utils dataLayerLoop: ".concat(t," not found in this element"))}),t.every(function(e){return void 0!==n[e]})?(a.log("Utils dataLayerLoop: all requested keys found, stopping search"),!0):r},!(window.dataLayer.some(r)&&Object.keys(n).length>0)){e.next=2;break}return a.log("Utils getDataLayerObjects: final result",n),e.abrupt("return",n);case 2:return a.log("Utils getDataLayerObjects: none of the keys were found"),e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Or=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Page Type",e.next=1,Sr(t);case 1:return n=e.sent,a.log("utils | pageType: page type is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Ir=function(){return new Promise(function(e){a.log("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){a.log("blueConicReady | onReady fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a.log("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)},3e3)})},Tr=function(){return new Promise(function(e){a.log("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(a.log("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},function(){a.log("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),a.log("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)},3e3)})},Nr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){a.log("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout(function(){clearTimeout(n),a.log("blueConicLoaded | onBlueConicLoaded timeout, resolving false for load status."),t(!1)},1e4);void 0!==window.blueConicClient&&void 0!==window.blueConicClient.event&&void 0!==window.blueConicClient.event.subscribe?(a.log("blueConicLoaded | BC object already loaded"),e?t(Ir()):(clearTimeout(n),t())):(a.log('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(o.mark(function r(){var i;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a.log("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=2;break}return a.log("blueConicLoaded | waiting for blueConicReady..."),r.next=1,Ir();case 1:i=r.sent,clearTimeout(n),t(i),r.next=3;break;case 2:clearTimeout(n),t();case 3:case"end":return r.stop()}},r)})),!1))})},Rr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Nr(!0);case 1:if(!e.sent){e.next=4;break}return e.next=2,Tr();case 2:if(e.sent){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Cr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]&&l[0],n=!1,i=["MICH LOWA","OHIO LOWA","PENN LOWA","NY LOWA","BOSTON LOWA","NORCAL LOWA","TWIN CITIES LOWA","DENV/PMP LOWA","SCNG LOWA","BANG LOWA","AMC LOWA","HC LOWA","GS LOWA","ORL LOWA","SS LOWA","NNDP LOWA","VP LOWA","NYDN LOWA","BAL LOWA","CG LOWA","CHI LOWA"],e.next=1,Nr(!0);case 1:if(!e.sent){e.next=3;break}if(s=window.blueConicClient.getSegments(),a.log("bcLowaCheck | BC segments for users: ",s),!(s.filter(function(e){return i.includes(e.name)}).length>0)){e.next=3;break}return e.next=2,Rr();case 2:(c=e.sent)&&(n=!0,r=c);case 3:return t&&n&&Lr(),u={isSub:n},r&&(u.uuid=r),e.abrupt("return",u);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Lr=function(){fr("bc_lowa_status",1,{path:"/",domain:hr(),expires:7,secure:!0})},kr=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(a.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(a.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};a.log("utils | Event: authentication ready: ",r),e(r)}catch(e){a.log(e),t(e)}},!1))})},_r=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return i.A.entitlementsEnabled?void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.entitlementsReady?(a.log("Entitlements already present:",window.MNGAuthentication.entitlementsReady),void e(window.MNGAuthentication.entitlementsReady)):void window.addEventListener("entitlementsReady",function(n){try{var r=n.detail||{};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=r,a.log("Received entitlementsReady event:",r),e(r)}catch(e){a.error("Error handling entitlementsReady event:",e),t(e)}},{once:!0}):(a.log("Entitlements disabled in settings."),void e(!1))}));case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Pr=function(){pr(cr.AUTH0_SUB_COOKIE_KEY),pr("mng-jwt-decoded"),localStorage.removeItem(cr.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){a.log("Clearing entitlements...");try{pr(cr.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){a.log("Failed to delete legacy cookie: ",e)}try{pr(cr.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:dr(),expires:365,secure:!0})}catch(e){a.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(cr.LOCAL_STORAGE_SESSION_KEY)}catch(e){a.log("Failed to remove local storage: ",e)}}()},Ur=function(){var e=ur();return!["local","develop","preprod","trbdev"].some(function(t){return e.origin.includes(t)})},xr=function(e){a.log("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),a.log("Storage Object removed : ",e))},Br=function(e){a.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return a.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Br;var Dr;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var Mr=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Dr){e.next=1;break}return e.abrupt("return",Dr);case 1:return t=i.A.auth0Domain,n=i.A.auth0ClientId,Dr=new Fe({domain:t,clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{audience:"access-extension",scope:"openid email profile user_metadata app_metadata offline_access"}}),e.abrupt("return",Dr);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Gr=function(e){a.log("utils | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,a.log("utils | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),a.log("utils | Dispatched authenticationReady event!")},Fr=function(e){if(void 0!==window.authentication_config){var t=window.authentication_config,n=Object.keys(t).filter(function(n){return n.includes(e)&&"1"===t[n]});return a.log("checkOneTapOptions: enabled options",n),n.length>0}return!1},Kr=function(e){return Number.isInteger(Number(e))};var Hr=function(e){i.A.datadogEnabled&&window.DD_RUM.addTiming(e)};var jr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Nr();case 1:return e.next=2,kr();case 2:return e.abrupt("return",new Promise(function(e){a.log("ANALYTICS: inside BCregwall events");var t=ur();t.searchParams.delete("regwall");var n=blueConicClient.profile.getProfile();localStorage.setItem("regwallSuccess","yes"),localStorage.setItem("regwallEvent","yes"),n.setValue("bang_reg_wall_status","Y"),n.setValue("regwall_newspaper",t.host),n.setValue("regwall_success_date",new Date),n.setValue("regwall_success","yes"),blueConicClient.profile.updateProfile(),e(!0)}));case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Xr=function(){var e=r(o.mark(function e(t){var n,r,i,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{void 0!==(n=gr(t))&&n&&(a.log("ANALYTICS: Partner Access: JWT found"),r=n.entitlement_entitled,i=n.entitlement_source,s=n.entitlement_organizationTrackingId,c=n.entitlement_organizationType,a.log("ANALYTICS: Partner Access Event: Entitled: ".concat(r," and source: ").concat(i)),r&&"partner-access"===i&&(a.log("ANALYTICS: GA event for partner access"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"partnerAccess",partner:"".concat(s,"|").concat(c)})))}catch(e){a.log("ANALYTICS: Failed to send Partner Access event: ",e)}case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),Wr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{"yes"===localStorage.getItem("regwallEvent")&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"regwall_success"}),a.log("ANALYTICS: GA/ datalayer ",window.dataLayer),localStorage.removeItem("regwallEvent"))}catch(e){a.log("ANALYTICS: Failed to send Regwall Succuss Event: ",e)}case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Yr=function(){var e=r(o.mark(function e(t,n){var r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n.entitlements&&(r=gr(n.entitlements.token)),a.log("ANALYTICS: user state variables are: ",t,n.userState),i="known"===t&&n.userState?r&&r.entitlement_entitled?"comp"===r.entitlement_level||"freeTrial"===r.entitlement_level?"subscriber-".concat(r.entitlement_level):"".concat(n.userState).concat(r.entitlement_serviceCode?"-".concat(r.entitlement_serviceCode):""):n.userState:"known"!==t||n.userState?"unknown"===t||"unknown-default"===t||"unknown-fail"===t&&"noEntitlements"===n.userState?t:t&&n.userState?r&&r.entitlement_entitled?"".concat(n.userState).concat(r.entitlement_serviceCode?"-".concat(r.entitlement_serviceCode):""):n.userState:"noState":"known-entitlements-failed",a.log("ANALYTICS: user state is ",i),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Auth0State_event",Auth0State:i});case 1:case"end":return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}(),Vr=function(){var e=r(o.mark(function e(){var t,n,r,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,kr();case 1:n=e.sent,r=n.isAuthenticated,i=r,e.next=!0===i?2:!1===i?3:i===cr.USER_IS_LOWA?4:5;break;case 2:return t="known",e.abrupt("continue",6);case 3:return t="unknown",e.abrupt("continue",6);case 4:return t=cr.USER_IS_LOWA,e.abrupt("continue",6);case 5:return t="unknown-default",e.abrupt("continue",6);case 6:return e.abrupt("return",t);case 7:return e.prev=7,s=e.catch(0),a.log("ANALYTICS: Error during onAuthReadyAnalytics: ",s),e.abrupt("return","unknown-fail");case 8:case"end":return e.stop()}},e,null,[[0,7]])}));return function(){return e.apply(this,arguments)}}(),zr=function(e){try{window.dataLayer.push({event:e}),a.log("ANALYTICS: ".concat(e," event")),a.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){a.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}},Jr=function(e){try{var t={};Object.keys(e).forEach(function(n){t[n]=e[n]}),0!==Object.keys(t).length&&window.dataLayer.push(t),a.log("ANALYTICS: ".concat(e.event," event")),a.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){a.log("ANALYTICS: Failed to send ".concat(e.event," event: "),t)}},Zr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={event:"one_tap_login",gotGroup:t,gotExperiment:e};switch(e){case"placement":n.gotDisplayPosition=window.authentication_config["got".concat(t,"ModalPosition")];break;case"scrolling":n.gotScrollDepthPercentage=window.authentication_config["got".concat(t,"GroupDepth")],n.gotDisplayPosition=window.authentication_config["got".concat(t,"GroupDelayPosition")];break;case"delayTime":n.gotTimeUntilDisplay=Math.floor(Kr(window.authentication_config["got".concat(t,"GroupTime")])?parseInt(window.authentication_config["got".concat(t,"GroupTime")],10):1);break;default:return n.event}return n},$r=function(e){try{var t={googleonetap:"one_tap_login",viafoura_signup:"viafoura_signup_success",viafoura_login:"viafoura_login_success"}[e];"one_tap_login"===t?(n=localStorage.getItem("abcdLocal"),r=localStorage.getItem("abcdeLocal"),o=Fr("GroupEnabled"),i=Fr("GroupDelayEnabled"),s=Fr("GroupTimeDelayEnabled"),c=Fr("got".concat(n,"GroupEnabled")),u=Fr("got".concat(r,"GroupDelayEnabled")),l=Fr("got".concat(n,"GroupTimeDelayEnabled")),d=/Windows|Macintosh|Mac OS X|Linux/.test(navigator.userAgent),n&&o&&c&&!i&&d&&!s?(a.log("ANALYTICS: Position event enabled"),Jr(Zr("placement",n))):r&&!o&&i&&u&&!s?(a.log("ANALYTICS: Scroll delay enabled"),Jr(Zr("scrolling",r))):n&&!o&&!i&&s&&l?(a.log("ANALYTICS: Time delay enabled"),Jr(Zr("delayTime",n))):(a.log("ANALYTICS: No custom event detected"),zr(Zr("default")))):zr(t)}catch(e){a.log("ANALYTICS: Event not setup",e)}var n,r,o,i,s,c,u,l,d},qr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=!1,e.next=1,_r();case 1:if(!(n=e.sent)||!n.token){e.next=2;break}return r=n.token,i=n.isEntitled,s=n.adfree,a.log("ANALYTICS: entitlements options: ",i,s),!0===s&&a.log("ANALYTICS: user state: found ad free",s),!0===i?(a.log("ANALYTICS: user state: found subscriber"),t="subscriber"):(a.log("ANALYTICS: user state: LINA"),t="lina"),Xr(r),e.abrupt("return",{userState:t,entitlements:n});case 2:return e.abrupt("return","noEntitlements");case 3:return e.prev=3,c=e.catch(0),a.log("ANALYTICS:",c),e.abrupt("return","entitlementError");case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}(),Qr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Nr();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),eo=function(){var e=r(o.mark(function e(){var t,n,r,i,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("sspwG2iMeterEvent: initializing sspwG2iMeterEvent function"),e.next=1,Or();case 1:if("article"===e.sent){e.next=2;break}return a.log("sspwG2iMeterEvent: not an article page"),e.abrupt("return");case 2:return e.next=3,vr(["Byline","Page Title","Section","Paywall_Level"]);case 3:if(!("free"!==(t=e.sent).Paywall_Level&&"1"===window.sophi_config.enableSophiSSPW||"premium"===t.Paywall_Level&&"1"===window.authentication_config.serverEntitlements)){e.next=5;break}return n="NOWALL",(r=document.getElementById("server-paywall"))&&("server-paywall"===r.id?n="SSPW":"server-regwall"===r.id&&(n="SSRW")),i="1"===window.sophi_config.enableSophiSSPW?"sophi":"sspw",s={event:"g2i_meter_stop",eng_author:t.Byline||"",title:t["Page Title"]||"",section:t.Section||"",eng_action_type:"sophi"===i?"Sophi_SSPW":"SSPWV1",eng_action_name:n},a.log("sspwG2iMeterEvent: article data found on dataLayer: ",t),e.next=4,br();case 4:window.MG2DL=window.MG2DL||[],window.MG2DL.push(s),a.log("sspwG2iMeterEvent: event pushed to MG2DL: ",window.MG2DL),e.next=6;break;case 5:a.log("sspwG2iMeterEvent: event not pushed, criteria not met");case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const to={onLoadAnalytics:function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("ANALYTICS: Start Analytics"),Wr(),window.MNGAuthentication.postAuthEvents=[],window.MNGAuthentication.preAuthGTMEvents=[],window.MNGAuthentication.postAuthEvents.push($r),!((t=ur()).pathname.startsWith("/logout")||t.pathname.startsWith("/login")||t.pathname.startsWith("/callback"))){e.next=1;break}return e.abrupt("return");case 1:return Qr(),e.next=2,Vr();case 2:return n=e.sent,e.next=3,qr();case 3:r=e.sent,Yr(n,r),"1"!==window.authentication_config.serverEntitlements&&"1"!==window.sophi_config.enableSophiSSPW||(a.log("ANALYTICS: SSPW is active, setting up analytics events."),eo());case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),blueConicRegwallEvents:jr,callPreparedGTMEvent:zr,callCustomGTMEvent:Jr};var no=function(){try{var e=localStorage.getItem(cr.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){a.log("Unable to get session from local storage: ",e)}return"{}"},ro=function(e){try{a.log("Setting local storage session",e),localStorage.setItem(cr.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){a.log("Unable to save session from local storage: ",e)}},oo=function(e){try{fr(cr.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:hr(),expires:365,secure:!0})}catch(e){a.log("Unable to save session to cookie storage: ",e)}},io=function(){var e=r(o.mark(function e(){var t,n,r,s,c,u,l,d,h,f,p,g,m,w,y,A,E,b;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.A.sessionServer,n="".concat(t,"/api/session"),a.log("Checking server session: ",n),e.next=1,sr.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return h=r.data.entitlementTokenDecoded,f=r.data,p=f.accessToken,g=f.idToken,m=f.entitlementToken,w=null!==(s=null==h?void 0:h.entitlement_expiry)&&void 0!==s?s:null,y=null!==(c=null==h?void 0:h.entitlement_source)&&void 0!==c?c:null,A=null!==(u=null==h?void 0:h.entitlement_entitled)&&void 0!==u?u:null,E=null!==(l=null==h?void 0:h.entitlement_extras_adfree)&&void 0!==l?l:null,b=null!==(d=null==h?void 0:h.entitlement_level)&&void 0!==d?d:null,ro(JSON.stringify({accessToken:p,idToken:g,entitlementToken:m,expiration:w,entitlementSource:y,isEntitled:A,adFree:E,entitlementLevel:b})),""!==m&&"string"==typeof m&&oo(m),e.abrupt("return",{accessToken:p,idToken:g,entitlementToken:m,expiration:w,entitlementSource:y,isEntitled:A,adFree:E,entitlementLevel:b});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ao=function(){var e=r(o.mark(function e(t){var n,r,s;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=i.A.sessionServer,r="".concat(n,"/api/session"),a.log("Updating server session: ",r),e.next=1,sr.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,s=e.catch(0),a.log("Failed to update session server: ",s);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),so=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=i.A.sessionServer,n="".concat(t,"/api/session"),a.log("Deleting server session: ",n),e.next=1,sr.delete(n,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,r=e.catch(0),a.log("Failed to delete server session: ",r);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),co=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,h,f,p,g,m,w,y,A,E,b,S,v,O,I,T,N,R,C,L;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("Inside getSession"),e.prev=1,d=no(),a.log("Session: __MNG_Session = ",d),h=JSON.parse(d),f=h.accessToken,p=h.idToken,g=h.entitlementToken,m=h.expiration,w=h.entitlementSource,y=h.isEntitled,A=h.adFree,E=h.entitlementLevel,n=f,t=p,r=g,i=m,s=w,c=y,u=A,l=E,a.log("Session: check both tokens: ",t,r),void 0!==p&&void 0!==g&&null!==p&&null!==g){e.next=3;break}return a.log("Session: missing id or entitlements, try session server"),e.next=2,io();case 2:b=e.sent,S=b.accessToken,v=b.idToken,O=b.entitlementToken,I=b.expiration,T=b.entitlementSource,N=b.isEntitled,R=b.adFree,C=b.entitlementLevel,n=S,t=v,r=O,i=I,s=T,c=N,u=R,l=C;case 3:e.next=5;break;case 4:e.prev=4,L=e.catch(1),a.log("Failed to get session: ",L);case 5:return a.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:s,isEntitled:c,adFree:u,entitlementLevel:l});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),uo=function(){var e=r(o.mark(function e(t){var n,r,i,s,c,u,l,d,h,f,p,g,m,w,y,A,E,b,S,v,O,I,T,N,R,C,L,k,_;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=no(),r=JSON.parse(n),i=r.accessToken,s=void 0===i?null:i,c=r.idToken,u=void 0===c?null:c,l=r.entitlementToken,d=void 0===l?null:l,h=r.expiration,f=void 0===h?null:h,p=r.entitlementSource,g=void 0===p?null:p,m=r.isEntitled,w=void 0===m?null:m,y=r.adFree,A=void 0===y?null:y,E=r.entitlementLevel,b=void 0===E?null:E,S=t.accessToken,v=t.idToken,O=t.entitlementToken,I=t.expiration,T=t.entitlementSource,N=t.isEntitled,R=t.adFree,C=t.entitlementLevel,L={accessToken:null==S?s:S,idToken:null==v?u:v,entitlementToken:null==O?d:O,expiration:null==I?f:I,entitlementSource:null==T?g:T,isEntitled:null==N?w:N,adFree:null==R?A:R,entitlementLevel:null==C?b:C},a.log("Current session data: ",r),a.log("New session data: ",t),a.log("Updated session data:",L),k=JSON.stringify(L),ro(k),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&oo(L.entitlementToken),n===k){e.next=1;break}return e.next=1,ao(L);case 1:e.next=3;break;case 2:e.prev=2,_=e.catch(0),a.log("Unable to save session: ",_);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),lo=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("Ending session..."),Pr(),e.next=1,so();case 1:localStorage.removeItem(cr.LOCAL_STORAGE_SESSION_KEY);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ho=function(){return"logout"===(ur().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var fo=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Mr();case 1:n=e.sent,a.log("Calling Auth0 logout..."),n.logout({returnTo:t});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),po=function(){return"undefined"==typeof CnnXt?(a.log("Connext was not loaded."),!1):Connext.Storage.GetUserState()},go=function(){a.log("Check for SS paywall Cookie");var e=window.location.hostname,t=document.cookie.split(";").find(function(e){return e.trim().startsWith("vip-go-seg=vc-v1__has_access")});if(/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.?)+[a-zA-Z]{2,6}$/.test(e)&&t){a.log("SS paywall Cookie found, removing it");var n=t.split("=")[0].trim();document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e),document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}},mo=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("Attempting to logout..."),go(),!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,lo();case 1:e.next=3;break;case 2:Pr();case 3:return e.prev=3,a.log("Cycling through logout callbacks..."),t=window.MNGAuthentication.logoutCallbacks.map(function(e){return e()}),e.next=4,Promise.all(t);case 4:a.log("Finished cycling through logout callbacks."),e.next=6;break;case 5:e.prev=5,u=e.catch(3),a.log("Failed to cycle through logout callbacks: ",u);case 6:Object.keys(window.localStorage).filter(function(e){return e.includes("auth0")}).forEach(function(e){window.localStorage.removeItem(e),a.log("Removed Auth0 storage object...")}),xr("hhsl"),xr("userNewsLetterData"),xr(cr.REGWALL_USER_IS_SUBSCRIBED),xr(cr.USER_PROFILE_HASH),n=ur(),i=window.location.origin;try{n.searchParams.get("returnURL")&&(s=decodeURIComponent(n.searchParams.get("returnURL")),i=s)}catch(e){a.log(e),i=window.location.origin}return i=new URL(i),e.next=7,window.ConnextUtils.connextReady("onInit",!1);case 7:if(!e.sent){e.next=14;break}if(a.log("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),a.log("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),c=i,i.origin!==window.location.origin&&(c=new URL(window.location.origin)).searchParams.append("returnAfterLogout",i),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",c),!Ur()){e.next=8;break}a.log("About to call Connext Logout..."),setTimeout(function(){Connext.Logout()},500),e.next=13;break;case 8:if("Logged In"!==po()){e.next=12;break}if(a.log("Connext user state is logged in, setting timeout..."),setTimeout(r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("Connext took too long to logout, calling auth0 logout..."),e.next=1,fo(i);case 1:case"end":return e.stop()}},e)})),8e3),"function"!=typeof Connext._logout){e.next=10;break}return a.log("About to call Connext _logout..."),e.next=9,Connext._logout();case 9:e.next=11;break;case 10:return a.log("About to call Connext Logout..."),e.next=11,Connext.Logout();case 11:e.next=13;break;case 12:return a.log("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=13,fo(i);case 13:e.next=15;break;case 14:return a.log("Connext Logout was NOT called"),e.next=15,fo(i);case 15:case"end":return e.stop()}},e,null,[[3,5]])}));return function(){return e.apply(this,arguments)}}(),wo=function(){var e=0;for(var t in window.localStorage){var n=2*window.localStorage[t].length/1024/1024;!Number.isNaN(n)&&window.localStorage.hasOwnProperty(t)&&(e+=n)}return e},yo=function(){window.MNGAuthentication.preAuthGTMEvents.forEach(function(e){return zr(e)}),a.log("Cycled through preauth GTM events.")},Ao=function(){var e=r(o.mark(function e(t,n,r,i,s){var c,u,d,h,f,p,g,m,w,y,A,E,b;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("Attempting to login..."),wo()>4.5&&window.localStorage.clear(),yo(),i&&(c=[],u=window.localStorage.getItem("callbackEvents"),d=JSON.parse(u),c=d&&d.length>0?l(new Set([].concat(l(i),l(d)))):i,window.localStorage.setItem("callbackEvents",JSON.stringify(c))),h=null,e.next=1,Mr();case 1:if(f=e.sent,p=ur(),g=p.origin,m=new URL("".concat(g,"/callback")),w={},p.searchParams.get("regwall")&&(p.searchParams.get("returnUrl")&&(y=p.searchParams.get("returnUrl")),p.searchParams.get("auth_redirect")&&(y=p.searchParams.get("auth_redirect"))),p.pathname.startsWith("/login")||p.pathname.startsWith("/callback")?p.searchParams.get("returnUrl")?m.searchParams.set("auth_redirect",p.searchParams.get("returnUrl")):s&&m.searchParams.set("auth_redirect",s):m.searchParams.set("auth_redirect",p.toString()),y&&"regwall"!==t&&m.searchParams.set("auth_redirect",y),"true"===p.searchParams.get("close-after-finish")&&m.searchParams.set("close-after-finish","true"),"true"!==p.searchParams.get("ssl")){e.next=4;break}if(!window.authentication_config.sessionManagementEnabled){e.next=3;break}return e.next=2,lo();case 2:e.next=4;break;case 3:Pr();case 4:return null!==(h=p.searchParams.get("login-with"))?w.connection=h:n&&(w.connection=n),A="none",t&&"regwall"===t&&(m.searchParams.set("regwall","true"),A="signUp",a.log("Logging in with regwall")),t&&(m.searchParams.set("loginsource",t),a.log("Logging in with ".concat(t))),r&&(w.login_hint=r),w.redirect_uri=m.toString(),w.initialScreen=A,"googleonetap"!==t&&(w.prompt="select_account"),null!==(E=p.searchParams.get("ampRegiWall"))&&(b=window.location.hostname,w.ampRegiWall=E,w.sourceDomain=b.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.",""),w.initialScreen="signUp",w.preferenceId=p.searchParams.get("prefId")),e.next=5,f.loginWithRedirect({authorizationParams:w});case 5:case"end":return e.stop()}},e)}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),Eo=function(){return new Promise(function(e){var t=setTimeout(function(){e()},8e3);try{var n=window.localStorage.getItem("callbackEvents"),r=JSON.parse(n);if(!r||0===r.length)return void e();a.log("Adding listeners to events we need to wait for...");var o=r.map(function(e){return t=e,new Promise(function(e){a.log("Adding event to wait for: ",t),window.addEventListener(t,function(n){try{var r=n.detail||{};a.log("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){a.log(t),e()}},!1)});var t});Promise.all(o).then(function(){clearTimeout(t),e()})}catch(t){a.log("Failed to wait for callback events",t),e()}})};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var bo=function(){var e=r(o.mark(function e(){var t,n,i,s,c,u,l,d,h,f,p,g,m,w,y,A,E,b,S,v,O,I;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(go(),t=ur(),n=!1,i=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),s=t.searchParams.get("redirect_uri")||"",s.includes("applenews")?(a.log("This is Apple prelogin flow."),(c=new URL(s))?(c.searchParams.append("post-apple-login","true"),a.log("Post callback Apple redirect URL is ".concat(c)),Ao(!1,!1,!1,[],c)):Ao()):i.includes("post-apple-login")&&(a.log("This is Apple Callback flow."),n=!0,(u=new URL(decodeURIComponent(i))).searchParams.delete("post-apple-login"),i=u),a.log("Handling post login callback..."),!(l=t.searchParams.get("error_description"))){e.next=2;break}if("shouldAutoLogin"!==l){e.next=1;break}return e.abrupt("return",Ao(!1,!1,!1,!1,i));case 1:n&&alert("There was an error in logging you in, please try again.");case 2:return e.next=3,Mr();case 3:return d=e.sent,e.next=4,d.handleRedirectCallback();case 4:return e.next=5,d.getIdTokenClaims();case 5:return h=e.sent,e.next=6,d.getUser();case 6:return f=e.sent,a.log("Auth0 user profile: ",f),p=h.__raw,e.next=7,d.getTokenSilently();case 7:return g=e.sent,e.prev=8,a.log("Cycling through login callbacks..."),e.next=9,Eo();case 9:return m=window.MNGAuthentication.oidcLoginCallbacks.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(p));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=10,Promise.all(m);case 10:a.log("Finished cycling through login callbacks."),e.next=12;break;case 11:e.prev=11,v=e.catch(8),a.log("Failed to cycle through login callbacks: ",v);case 12:if(w={accessToken:g,userId:f.sub,email:f.email,picture:f.picture},y=!1,A="",!n){e.next=17;break}return e.prev=13,e.next=14,wr(w.userId);case 14:return A=e.sent,a.log("Encrypted apple uuid is: ".concat(A)),e.next=15,mr(A);case 15:y=e.sent,a.log("Apple sub status is: ".concat(y)),e.next=17;break;case 16:e.prev=16,O=e.catch(13),a.log("Apple sub check error: ".concat(O)),alert("There was an error in logging you in, please try again.");case 17:if(xr(cr.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=18;break}return a.log("Saving idToken to session server"),e.next=18,uo({idToken:p,accessToken:g});case 18:if(!t.searchParams.get("close-after-finish")){e.next=19;break}return e.abrupt("return",window.close());case 19:if(!t.search.includes("loginsource")){e.next=20;break}return E=t.searchParams.get("loginsource"),b=window.MNGAuthentication.postAuthEvents.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(E));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=20,Promise.all(b);case 20:return e.prev=20,S=new URL(i),n&&y&&S.searchParams.append("access_token",A),a.log("Apple redirect URL:",S),e.abrupt("return",window.location.assign(S));case 21:return e.prev=21,I=e.catch(20),a.log("Failed to redirect after authentication: ",I),window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 22:case"end":return e.stop()}},e,null,[[8,11],[13,16],[20,21]])}));return function(){return e.apply(this,arguments)}}(),So=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("ANALYTICS: fireBC events"),e.next=1,jr();case 1:a.log("ANALYTICS: bc values should be filled");case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),vo=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,d,h,f,p,g;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,kr();case 1:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=4;break}return e.prev=2,s=gr(n),c=s.email,u=s.picture,l=s.sub,d=s.name,h=s.nickname,f=s.connection_source,p=null===(i=s.user_metadata)||void 0===i||null===(i=i.customProfile)||void 0===i?void 0:i.nickname,l.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:p||h||d,email:c,picture:u,userId:l,connectionSource:f});case 3:e.prev=3,g=e.catch(2),a.log("Unable to parse idToken: ",n," Error: ",g);case 4:return e.abrupt("return",{authenticated:r});case 5:case"end":return e.stop()}},e,null,[[2,3]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.login=Ao,window.MNGAuthentication.logout=mo,window.MNGAuthentication.getUserInfo=vo;var Oo=function(){var e=r(o.mark(function e(){var t,n,c,u,l,d,h,f,p,g,m,w,y;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ur(),n=!1,c="",u=!1,l={},ho()&&window.ConnextUtils.rerunConnextEntitlements(!0),t.searchParams.get("returnAfterLogout")&&(d=decodeURIComponent(t.searchParams.get("returnAfterLogout")),window.location.assign(d)),t.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),h=function(){var e=r(o.mark(function e(){var t,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,Mr();case 1:return t=e.sent,e.next=2,t.getIdTokenClaims();case 2:return l=e.sent,e.next=3,t.isAuthenticated();case 3:if(n=e.sent,c="object"===s(l)?l.__raw:"",r=lr(cr.ENTITLEMENT_COOKIE_KEY),n||!r){e.next=5;break}return e.next=4,t.getTokenSilently();case 4:u=e.sent;case 5:e.next=7;break;case 6:e.prev=6,i=e.catch(0),a.log("Unable to verify user has active auth0 session: ",i);case 7:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),!t.pathname.startsWith("/logout")){e.next=2;break}return a.log("Page is logout. Routing to logout function..."),e.next=1,mo();case 1:return e.abrupt("return");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=3,h();case 3:if(""===c){e.next=5;break}if(f=null,p=JSON.parse(window.localStorage.getItem(cr.LOCAL_STORAGE_SESSION_KEY)),"{}"!==no()){e.next=4;break}return p&&(f=p.jwt),e.next=4,uo({idToken:c,entitlementToken:f});case 4:e.next=8;break;case 5:return e.prev=5,e.next=6,co();case 6:g=e.sent,c=g.idToken,(n="string"==typeof c)&&(l=gr(c)),e.next=8;break;case 7:e.prev=7,y=e.catch(5),a.log("Unable to initialize session: ",y);case 8:e.next=10;break;case 9:return e.next=10,h();case 10:if(n||u||!i.A.blueconicEnabled||!i.A.bcLowaSegements){e.next=12;break}return e.next=11,Cr(!0);case 11:(m=e.sent).isSub&&(n=cr.USER_IS_LOWA,l={sub:m.uuid});case 12:if(Gr({isAuthenticated:n,idToken:c,accessToken:u,claims:l}),Hr("authenticationReady"),!0===n?(a.log("User is authenticated."),t.searchParams.get("auth_redirect")&&(a.log("Auth Redirect is present, sending user to auth redirect..."),(w=t.searchParams.get("auth_redirect")).endsWith("#")&&(w=w.slice(0,w.length)),window.location.assign(w)),t.pathname.startsWith("/login")&&!ho()&&(a.log("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(t.origin))):a.log("User is not authenticated."),t.pathname.startsWith("/login")&&!ho()?(a.log("Page is login. Attempting to log user in..."),Ao()):a.log("Page is not login or Connext state is present"),!t.pathname.startsWith("/callback")||!t.searchParams.get("regwall")){e.next=14;break}return a.log("Page is callback with regwall param. Routing to regwall receiver..."),e.next=13,So();case 13:a.log("Now login from regwall"),Ao(),e.next=15;break;case 14:if(!t.pathname.startsWith("/callback")){e.next=15;break}return a.log("Page is callback without regwall param. Routing to callback receiver..."),e.next=15,bo();case 15:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.init=Oo;const Io={init:Oo};var To=function(e,t){return new Promise(function(n){try{"undefined"==typeof CnnXt&&(a.log("Connext was not loaded."),n(!1)),a.log("connext subscribeToNewsletter","about to call Cnnxt NewsletterSubscribe with pref id ".concat(t," and email ").concat(e)),CnnXt.API.NewsletterSubscribe({email:e,id:t,onSuccess:function(){a.log("Signed user up to newsletter: ",t),n(!0)},onError:function(e){a.log("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){a.log("subscribeToNewsletter Error:",e),n(!1)}})};var No=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("Google token ",t),n=gr(t.credential),e.prev=1,zr("one_tap_click"),localStorage.setItem("regwallSuccess","yes"),!i.A.newsletterId){e.next=2;break}return a.log("About to call Connext's subscribeToNewsletter function"),e.next=2,To(n.email,i.A.newsletterId);case 2:e.next=4;break;case 3:e.prev=3,r=e.catch(1),a.log("Error: ",r);case 4:return a.log("About to login with onetap flow..."),e.next=5,window.MNGAuthentication.login("googleonetap",i.A.useTribMainGoogle?"Trib-Google":"google-oauth2",n.email);case 5:case"end":return e.stop()}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),Ro=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:google.accounts.id.initialize({client_id:i.A.googleClientId,callback:No,auto_select:!1,cancel_on_tap_outside:!1}),a.log("Showing the onetap modal..."),google.accounts.id.prompt(function(e){var t;e.isDisplayed()?t="one_tap_displayed":e.isSkippedMoment()?t="one_tap_cancel":e.isNotDisplayed()&&"suppressed_by_user"===e.j&&(t="one_tap_auto_hide"),zr(t)});case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const Co={init:function(){var e=r(o.mark(function e(){var t,n,r,s,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i.A.oneTapEnabled){e.next=1;break}return e.abrupt("return");case 1:return e.next=2,kr();case 2:if(t=e.sent,n=t.isAuthenticated,r=ur(),n!==cr.USER_IS_LOWA){e.next=5;break}return e.next=3,Rr();case 3:if(!(s=e.sent)||s.includes("google")){e.next=4;break}return e.abrupt("return");case 4:e.next=6;break;case 5:if(!(n||r.pathname.startsWith("/login")||r.pathname.startsWith("/logout")||r.pathname.startsWith("/callback"))){e.next=6;break}return e.abrupt("return");case 6:return e.next=7,Ar();case 7:return a.log("onetap loading..."),c=new Date,e.next=8,Ro(c);case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a.log("Settings: ",i.A),Io.init(),to.onLoadAnalytics(),e.next=1,Co.init();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.main.bundle.js.map; /*! For license information please see mng-digisubs.connext.bundle.js.LICENSE.txt */ (()=>{var e={251:(e,t)=>{t.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<>1,l=-7,d=n?o-1:0,h=n?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-l)-1,f>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=h,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),i-=u}return(f?-1:1)*s*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,l=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+f]=255&a,f+=p,a/=256,o-=8);for(s=s<0;e[n+f]=255&s,f+=p,s/=256,u-=8);e[n+f-p]|=128*g}},579:(e,t,n)=>{var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,n)=>{var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,s){return new o(r().w(e,t,n,i),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791:(e,t,n)=>{var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,s,a){try{var c=t[e](o),u=c.value;return u instanceof r?n.resolve(u.v).then(function(e){i("next",e,s,a)},function(e){i("throw",e,s,a)}):n.resolve(u).then(function(e){c.value=e,s(c)},function(e){return i("throw",e,s,a)})}catch(e){a(e)}}var s;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return s=s?s.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},3612:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog}},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633:(e,t,n)=>{var r=n(5172),o=n(6993),i=n(5869),s=n(887),a=n(1791),c=n(4373),u=n(579);function l(){"use strict";var t=o(),n=t.m(l),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:a,async:function(e,t,n,r,o){return(h(t)?s:i)(p(e),t,n,r,o)},keys:c,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5546:e=>{function t(n,r,o,i){var s=Object.defineProperty;try{s({},"",{})}catch(n){s=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?s?s(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5869:(e,t,n)=>{var r=n(887);e.exports=function(e,t,n,o,i){var s=r(e,t,n,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},6993:(e,t,n)=>{var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function c(e,o,i,s){var a=o&&o.prototype instanceof l?o:l,c=Object.create(a.prototype);return r(c,"_invoke",function(e,r,o){var i,s,a,c=0,l=o||[],d=!1,h={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return i=e,s=0,a=t,h.n=n,u}};function f(e,r){for(s=e,a=r,n=0;!d&&c&&!o&&n3?(o=p===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=f&&((o=e<2&&fr||r>p)&&(i[4]=e,i[5]=r,h.n=p,s=0))}if(o||e>1)return u;throw d=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===l&&f(l,p),s=l,a=p;(n=s<2?t:a)||!d;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(c=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((n=(d=h.n<0)?a:e.call(r,h))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:n,done:d}}}(e,i,s),!0),c}var u={};function l(){}function d(){}function h(){}n=Object.getPrototypeOf;var f=[][s]?n(n([][s]())):(r(n={},s,function(){return this}),n),p=h.prototype=l.prototype=Object.create(f);function g(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=h,r(p,"constructor",h),r(h,"constructor",d),d.displayName="GeneratorFunction",r(h,a,"GeneratorFunction"),r(p),r(p,a,"Generator"),r(p,s,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:g}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=a(e),s=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),l=0,d=c>0?s-4:s;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=16383,a=0,c=r-o;ac?c:a+s));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=i[s],r[i.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i{"use strict";const r=n(7526),o=n(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?a(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:Y(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Z(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,o){let i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let r=-1;for(i=n;ia&&(n=a-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let s;for(r>i/2&&(r=i/2),s=0;s>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+s<=n){let n,r,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],a=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=s}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(i,s),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return A(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function R(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function U(e,t,n,r,o){H(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function x(e,t,n,r,o){H(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function B(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,i){return t=+t,n>>>=0,i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=q(function(e){X(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||_(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||_(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=q(function(e){X(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||_(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!r){P(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=q(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=0,i=1,s=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}let o=n-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=q(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return M(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return M(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new G.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){X(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||j(t,e.length-(n+1))}(r,o,i)}function X(e,t){if("number"!=typeof e)throw new G.ERR_INVALID_ARG_TYPE(t,"number",e)}function j(e,t,n){if(Math.floor(e)!==e)throw X(e,n),new G.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new G.ERR_BUFFER_OUT_OF_BOUNDS;throw new G.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),F("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),F("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=K(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=K(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let s=0;s55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const $=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function q(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var s=e.apply(n,r);function a(e){t(s,o,i,a,c,"next",e)}function c(e){t(s,o,i,a,c,"throw",e)}a(void 0)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>zt,hasStandardBrowserEnv:()=>Zt,hasStandardBrowserWebWorkerEnv:()=>$t,navigator:()=>Jt,origin:()=>qt});var o=n(4756);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}function d(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var a=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,a,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?s:this.storageHandler,o=i+"-"+t,null===(a=n.getItemSync(o))?[2]:(c=JSON.parse(a)).id!==this.id?[3,2]:[4,g.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),g.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],s=0;;){var a=r.keySync(s);if(null===a)break;o.push(a),s++}for(var c=!1,u=0;uDate.now();class A extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,A.prototype)}static fromPayload({error:e,error_description:t}){return new A(e,t)}}class b extends A{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,b.prototype)}}class S extends A{constructor(e,t,n,r,o=null){super(e,t),this.connection=n,this.state=r,this.appState=o,Object.setPrototypeOf(this,S.prototype)}}class O extends A{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,O.prototype)}}class v extends O{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,v.prototype)}}class I extends A{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,I.prototype)}}class T extends A{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,T.prototype)}}class N extends A{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${L(e,["default"])}', scope: '${L(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,N.prototype)}}class R extends A{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${L(e,["default"])}', missing scope: '${L(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,R.prototype)}}class C extends A{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,C.prototype)}}function L(e,t=[]){return e&&!t.includes(e)?e:""}const k=()=>window.crypto,_=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(k().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},P=e=>btoa(e),U=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],x=e=>Object.keys(e).reduce((t,n)=>{const r=U.find(e=>e.key===n);return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t},{}),B=e=>{var{clientId:t}=e,n=d(e,["clientId"]);return new URLSearchParams((e=>Object.keys(e).filter(t=>void 0!==e[t]).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{}))(Object.assign({client_id:t},n))).toString()},D=async e=>{const t=k().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},M=e=>(e=>decodeURIComponent(atob(e).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),G=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},F=new TextEncoder,K=new TextDecoder;function H(e){return"string"==typeof e?F.encode(e):K.decode(e)}function X(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new V(`${e.name} modulusLength must be at least 2048 bits`)}let j;if(Uint8Array.prototype.toBase64)j=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;j=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},te=async(e,t,n,r,o,i,s=1e4,a)=>o?(async(e,t,n,r,o,i,s,a)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:s,useMrrt:a},u=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},u.postMessage(c,[n.port2])});var c,u})(e,t,n,r,s,o,i,a):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([ee(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,s);async function ne(e,t,n,r,o,i,s,a,c,u){if(c){const t=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let l,h=null;for(let c=0;c<3;c++)try{l=await te(e,n,r,o,i,s,t,a),h=null;break}catch(e){h=e}if(h)throw h;const f=l.json,{error:p,error_description:g}=f,m=d(f,["error","error_description"]),{headers:w,ok:y}=l;let E;if(c&&(E=w["dpop-nonce"],E&&await c.setNonce(E)),!y){const l=g||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===p)throw new T(p,l,m.mfa_token);if("missing_refresh_token"===p)throw new N(n,r);if("use_dpop_nonce"===p){if(!c||!E||u)throw new C(E);return ne(e,t,n,r,o,i,s,a,c,!0)}throw new A(p||"request_error",l)}return m}async function re(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:s,useFormData:a,useMrrt:c,dpop:u}=e,l=d(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const h="urn:ietf:params:oauth:grant-type:token-exchange"===l.grant_type,f="refresh_token"===l.grant_type&&c,p=Object.assign(Object.assign(Object.assign(Object.assign({},l),h&&o&&{audience:o}),h&&i&&{scope:i}),f&&{audience:o,scope:i}),g=a?B(p):JSON.stringify(p),m=(w=l.grant_type,Q.includes(w));var w;return await ne(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:g,headers:{"Content-Type":a?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(x(s||y)))}},t,a,c,m?u:void 0)}const oe=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},ie=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),oe(r,t)};class se{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new se({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new se({scope:t,audience:n,clientId:r})}}class ae{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}class ce{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}}class ue{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||E}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!o&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const s=await this.nowProvider(),a=Math.floor(s/1e3);return i.expiresAt-t!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new se({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=se.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],s=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&s})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=se.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}}class le{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const de=e=>"number"==typeof e,he=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var fe=p(function(e,t){var n=h&&h.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;nwe.get(e)||we.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),ge(`_legacy_${e}`,JSON.stringify(t),r),we.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),me(e,n),we.remove(e,t),we.remove(`_legacy_${e}`,t)}},Ee={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Ae;!function(e){e.Code="code",e.ConnectCode="connect_code"}(Ae||(Ae={}));var be,Se=function(e){return be=be||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const Ie={memory:()=>(new ce).enclosedCache,localstorage:()=>new ae},Te=e=>Ie[e],Ne=e=>{const{openUrl:t,onRedirect:n}=e,r=d(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},Re=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},Ce={NONCE:"nonce",KEYPAIR:"keypair"};class Le{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(Ce).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(Ce.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(Ce.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(Ce.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Ce.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(Ce.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Ce.KEYPAIR,this.clientId)}}class ke{constructor(e){this.storage=new Le(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){const i=function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t);return $(e,i,n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Z(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await q(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new Y("unsupported JWK kty")}return W(await crypto.subtle.digest({name:"SHA-256"},H(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var _e;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(_e||(_e={}));class Pe{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=_e.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?_e.DPoP:_e.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===_e.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new C(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}class Ue{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new xe({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new xe(t)}}class xe extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,xe.prototype)}}const Be=new m;class De{constructor(e){let t,n;if(this.userCache=(new ce).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await Be.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!k())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===k().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!Te(t))throw new Error(`Invalid cache location "${t}"`);n=Te(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?we:ye,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:Ee;var o;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:oe(t,e,...n)};let r={default:oe(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=oe(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new le(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||E,this.cacheManager=new ue(n,n.allKeys?void 0:new ve(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new ke(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=((e,t)=>e?e.startsWith("https://")?e:`https://${e}/`:`${t}/`)(this.options.issuer,this.domainUrl);const i=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:i},detailedResponse:!0})}));this.myAccountApi=new Ue(s,i),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Se)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||y)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${B(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(M(r)),s={__raw:e},a={};return Object.keys(i).forEach(e=>{s[e]=i[e],he.includes(e)||(a[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(M(n)),claims:s,user:a}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!de(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!de(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!de(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&de(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),ro)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=P(_()),i=P(_()),s=_(),a=await D(s),c=G(a),u=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),l=((e,t,n,r,o,i,s,a,c)=>Object.assign(Object.assign(Object.assign({client_id:e.clientId},e.authorizationParams),n),{scope:ie(t,n.scope,n.audience),response_type:"code",response_mode:a||"query",state:r,nonce:o,redirect_uri:s||e.authorizationParams.redirect_uri,code_challenge:i,code_challenge_method:"S256",dpop_jkt:c}))(this.options,this.scope,e,o,i,c,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,null==t?void 0:t.response_mode,u),d=this._authorizeUrl(l);return{nonce:i,code_verifier:s,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(e=>new Promise((t,n)=>{let r;const o=setInterval(()=>{e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new I(e.popup)))},1e3),i=setTimeout(()=>{clearInterval(o),n(new v(e.popup)),window.removeEventListener("message",r,!1)},1e3*(e.timeoutInSeconds||60));r=function(s){if(s.data&&"authorization_response"===s.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),e.popup.close(),s.data.response.error)return n(A.fromPayload(s.data.response));t(s.data.response)}},window.addEventListener("message",r)}))(Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==o.state)throw new A("state_mismatch","Invalid state");const i=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:i})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=Ne(e),{openUrl:r,fragment:o,appState:i}=n,s=d(n,["openUrl","fragment","appState"]),a=(null===(t=s.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=c,l=d(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},l),{appState:i,response_type:Ae.Code}),a&&{organization:a}));const h=o?`${u}#${o}`:u;r?await r(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new A("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===Ae.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new b(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new A("state_mismatch","Invalid state");const s=t.organization,a=t.nonce,c=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},c?{redirect_uri:c}:{}),{nonceIn:a,organization:s}),{appState:t.appState,response_type:Ae.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new S(o,i||o,t.connection,r,t.appState);if(!n)throw new A("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new A("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},s),{appState:t.appState,response_type:Ae.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(e){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ie(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=Oe[t];return n||(n=e().finally(()=>{delete Oe[t],n=null}),Oe[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=d(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!await(async(e,t=3)=>{for(let n=0;nBe.acquireLock(r,5e3),10))throw new O;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:s,expires_in:a}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},s?{scope:s}:null),{expires_in:a})}finally{await Be.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:ie(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},w),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new se({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=d(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${B(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=Ne(e),{openUrl:r}=n,o=d(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:s,redirect_uri:a,scope:c,audience:u}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new A("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let l;try{l=new URL(this.domainUrl).origin}catch(e){l=this.domainUrl}const d=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const s=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",a,!1))};let a;const c=setTimeout(()=>{o(new O),s()},1e3*n);a=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(A.fromPayload(e.data.response)):r(e.data.response),clearTimeout(c),window.removeEventListener("message",a,!1),setTimeout(s,2e3)},window.addEventListener("message",a,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,l,n);if(o!==d.state)throw new A("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:a,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},h),{scope:c,oauthTokenScope:h.scope,audience:u})}catch(e){throw"login_required"===e.error&&this.logout({openUrl:!1}),e}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new se({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new N(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],s=i.every(t=>e.includes(t));return e.length>=i.length&&s?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(u.refresh_token&&this.options.useMrrt&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,u.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,s=null==t?void 0:t.scope,a=e.authorizationParams.audience,c=e.authorizationParams.scope,i===a&&Re(c,s)||Re(o,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,u.scope);throw new R(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(t){if((t.message.indexOf("Missing Refresh Token")>-1||t.message&&t.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw t}var i,s,a,c}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=d(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new se({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new se({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){const{nonceIn:n,organization:r,scopesToRequest:o}=t||{},i=await re(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:o||e.scope}),this.worker),s=await this._verifyIdToken(i.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:s,scope:e.scope,audience:e.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||s.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:s})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:ie(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new Pe(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,authorization_params:o,redirectUri:i=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const s=P(_()),a=_(),c=await D(a),u=G(c),{connect_uri:l,connect_params:d,auth_session:h}=await this.myAccountApi.connectAccount({connection:r,redirect_uri:i,state:s,code_challenge:u,code_challenge_method:"S256",authorization_params:o});this.transactionManager.create({state:s,code_verifier:a,auth_session:h,redirect_uri:i,appState:n,connection:r,response_type:Ae.ConnectCode});const f=new URL(l);f.searchParams.set("ticket",d.ticket),t?await t(f.toString()):window.location.assign(f)}}function Me(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ge}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:Ke,toStringTag:He}=Symbol,Xe=(je=Object.create(null),e=>{const t=Ge.call(e);return je[t]||(je[t]=t.slice(8,-1).toLowerCase())});var je;const We=e=>(e=e.toLowerCase(),t=>Xe(t)===e),Ye=e=>t=>typeof t===e,{isArray:Ve}=Array,ze=Ye("undefined");function Je(e){return null!==e&&!ze(e)&&null!==e.constructor&&!ze(e.constructor)&&qe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ze=We("ArrayBuffer");const $e=Ye("string"),qe=Ye("function"),Qe=Ye("number"),et=e=>null!==e&&"object"==typeof e,tt=e=>{if("object"!==Xe(e))return!1;const t=Fe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||He in e||Ke in e)},nt=We("Date"),rt=We("File"),ot=We("Blob"),it=We("FileList"),st=We("URLSearchParams"),[at,ct,ut,lt]=["ReadableStream","Request","Response","Headers"].map(We);function dt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Ve(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const ft="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,pt=e=>!ze(e)&&e!==ft;const gt=(mt="undefined"!=typeof Uint8Array&&Fe(Uint8Array),e=>mt&&e instanceof mt);var mt;const wt=We("HTMLFormElement"),yt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Et=We("RegExp"),At=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};dt(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const bt=We("AsyncFunction"),St=(Ot="function"==typeof setImmediate,vt=qe(ft.postMessage),Ot?setImmediate:vt?(It=`axios@${Math.random()}`,Tt=[],ft.addEventListener("message",({source:e,data:t})=>{e===ft&&t===It&&Tt.length&&Tt.shift()()},!1),e=>{Tt.push(e),ft.postMessage(It,"*")}):e=>setTimeout(e));var Ot,vt,It,Tt;const Nt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ft):"undefined"!=typeof process&&process.nextTick||St,Rt={isArray:Ve,isArrayBuffer:Ze,isBuffer:Je,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||qe(e.append)&&("formdata"===(t=Xe(e))||"object"===t&&qe(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Ze(e.buffer),t},isString:$e,isNumber:Qe,isBoolean:e=>!0===e||!1===e,isObject:et,isPlainObject:tt,isEmptyObject:e=>{if(!et(e)||Je(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:at,isRequest:ct,isResponse:ut,isHeaders:lt,isUndefined:ze,isDate:nt,isFile:rt,isBlob:ot,isRegExp:Et,isFunction:qe,isStream:e=>et(e)&&qe(e.pipe),isURLSearchParams:st,isTypedArray:gt,isFileList:it,forEach:dt,merge:function e(){const{caseless:t,skipUndefined:n}=pt(this)&&this||{},r={},o=(o,i)=>{const s=t&&ht(r,i)||i;tt(r[s])&&tt(o)?r[s]=e(r[s],o):tt(o)?r[s]=e({},o):Ve(o)?r[s]=o.slice():n&&ze(o)||(r[s]=o)};for(let e=0,t=arguments.length;e(dt(t,(t,r)=>{n&&qe(t)?e[r]=Me(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&Fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Xe,kindOfTest:We,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ve(e))return e;let t=e.length;if(!Qe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ke]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:wt,hasOwnProperty:yt,hasOwnProp:yt,reduceDescriptors:At,freezeMethods:e=>{At(e,(t,n)=>{if(qe(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];qe(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ve(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ht,global:ft,isContextDefined:pt,isSpecCompliantForm:function(e){return!!(e&&qe(e.append)&&"FormData"===e[He]&&e[Ke])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(et(e)){if(t.indexOf(e)>=0)return;if(Je(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Ve(e)?[]:{};return dt(e,(e,t)=>{const i=n(e,r+1);!ze(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:bt,isThenable:e=>e&&(et(e)||qe(e))&&qe(e.then)&&qe(e.catch),setImmediate:St,asap:Nt,isIterable:e=>null!=e&&qe(e[Ke])};function Ct(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}Rt.inherits(Ct,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:Rt.toJSONObject(this.config),code:this.code,status:this.status}}});const Lt=Ct.prototype,kt={};["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(e=>{kt[e]={value:e}}),Object.defineProperties(Ct,kt),Object.defineProperty(Lt,"isAxiosError",{value:!0}),Ct.from=(e,t,n,r,o,i)=>{const s=Object.create(Lt);Rt.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Ct.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const _t=Ct;var Pt=n(8287).hp;function Ut(e){return Rt.isPlainObject(e)||Rt.isArray(e)}function xt(e){return Rt.endsWith(e,"[]")?e.slice(0,-2):e}function Bt(e,t,n){return e?e.concat(t).map(function(e,t){return e=xt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Dt=Rt.toFlatObject(Rt,{},null,function(e){return/^is[A-Z]/.test(e)});const Mt=function(e,t,n){if(!Rt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Rt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Rt.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Rt.isSpecCompliantForm(t);if(!Rt.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Rt.isDate(e))return e.toISOString();if(Rt.isBoolean(e))return e.toString();if(!a&&Rt.isBlob(e))throw new _t("Blob is not supported. Use a Buffer instead.");return Rt.isArrayBuffer(e)||Rt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Pt.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Rt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Rt.isArray(e)&&function(e){return Rt.isArray(e)&&!e.some(Ut)}(e)||(Rt.isFileList(e)||Rt.endsWith(n,"[]"))&&(a=Rt.toArray(e)))return n=xt(n),a.forEach(function(e,r){!Rt.isUndefined(e)&&null!==e&&t.append(!0===s?Bt([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!Ut(e)||(t.append(Bt(o,n,i),c(e)),!1)}const l=[],d=Object.assign(Dt,{defaultVisitor:u,convertValue:c,isVisitable:Ut});if(!Rt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Rt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Rt.forEach(n,function(n,i){!0===(!(Rt.isUndefined(n)||null===n)&&o.call(t,n,Rt.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Gt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ft(e,t){this._pairs=[],e&&Mt(e,this,t)}const Kt=Ft.prototype;Kt.append=function(e,t){this._pairs.push([e,t])},Kt.toString=function(e){const t=e?function(t){return e.call(this,t,Gt)}:Gt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ht=Ft;function Xt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jt(e,t,n){if(!t)return e;const r=n&&n.encode||Xt;Rt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Rt.isURLSearchParams(t)?t.toString():new Ht(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Wt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Rt.forEach(this.handlers,function(t){null!==t&&e(t)})}},Yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ht,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},zt="undefined"!=typeof window&&"undefined"!=typeof document,Jt="object"==typeof navigator&&navigator||void 0,Zt=zt&&(!Jt||["ReactNative","NativeScript","NS"].indexOf(Jt.product)<0),$t="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qt=zt&&window.location.href||"http://localhost",Qt={...e,...Vt};const en=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&Rt.isArray(r)?r.length:i,a)return Rt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Rt.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Rt.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return Rt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const tn={transitional:Yt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Rt.isObject(e);o&&Rt.isHTMLForm(e)&&(e=new FormData(e));if(Rt.isFormData(e))return r?JSON.stringify(en(e)):e;if(Rt.isArrayBuffer(e)||Rt.isBuffer(e)||Rt.isStream(e)||Rt.isFile(e)||Rt.isBlob(e)||Rt.isReadableStream(e))return e;if(Rt.isArrayBufferView(e))return e.buffer;if(Rt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Mt(e,new Qt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Qt.isNode&&Rt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Rt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Mt(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Rt.isString(e))try{return(t||JSON.parse)(e),Rt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||tn.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Rt.isResponse(e)||Rt.isReadableStream(e))return e;if(e&&Rt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw _t.from(e,_t.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:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Rt.forEach(["delete","get","head","post","put","patch"],e=>{tn.headers[e]={}});const nn=tn,rn=Rt.toObjectSet(["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"]),on=Symbol("internals");function sn(e){return e&&String(e).trim().toLowerCase()}function an(e){return!1===e||null==e?e:Rt.isArray(e)?e.map(an):String(e)}function cn(e,t,n,r,o){return Rt.isFunction(r)?r.call(this,t,n):(o&&(t=n),Rt.isString(t)?Rt.isString(r)?-1!==t.indexOf(r):Rt.isRegExp(r)?r.test(t):void 0:void 0)}class un{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=sn(t);if(!o)throw new Error("header name must be a non-empty string");const i=Rt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=an(e))}const i=(e,t)=>Rt.forEach(e,(e,n)=>o(e,n,t));if(Rt.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Rt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&rn[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Rt.isObject(e)&&Rt.isIterable(e)){let n,r,o={};for(const t of e){if(!Rt.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Rt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=sn(e)){const n=Rt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Rt.isFunction(t))return t.call(this,e,n);if(Rt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=sn(e)){const n=Rt.findKey(this,e);return!(!n||void 0===this[n]||t&&!cn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=sn(e)){const o=Rt.findKey(n,e);!o||t&&!cn(0,n[o],o,t)||(delete n[o],r=!0)}}return Rt.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!cn(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Rt.forEach(this,(r,o)=>{const i=Rt.findKey(n,o);if(i)return t[i]=an(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=an(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Rt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Rt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[on]=this[on]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=sn(e);t[r]||(!function(e,t){const n=Rt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Rt.isArray(e)?e.forEach(r):r(e),this}}un.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Rt.reduceDescriptors(un.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Rt.freezeMethods(un);const ln=un;function dn(e,t){const n=this||nn,r=t||n,o=ln.from(r.headers);let i=r.data;return Rt.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function hn(e){return!(!e||!e.__CANCEL__)}function fn(e,t,n){_t.call(this,null==e?"canceled":e,_t.ERR_CANCELED,t,n),this.name="CanceledError"}Rt.inherits(fn,_t,{__CANCEL__:!0});const pn=fn;function gn(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const mn=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]},yn=(e,t,n=3)=>{let r=0;const o=mn(50,250);return wn(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},En=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},An=e=>(...t)=>Rt.asap(()=>e(...t)),bn=Qt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Qt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0,Sn=Qt.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Rt.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Rt.isString(r)&&a.push(`path=${r}`),Rt.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),Rt.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function On(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const vn=e=>e instanceof ln?{...e}:e;function In(e,t){t=t||{};const n={};function r(e,t,n,r){return Rt.isPlainObject(e)&&Rt.isPlainObject(t)?Rt.merge.call({caseless:r},e,t):Rt.isPlainObject(t)?Rt.merge({},t):Rt.isArray(t)?t.slice():t}function o(e,t,n,o){return Rt.isUndefined(t)?Rt.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Rt.isUndefined(t))return r(void 0,t)}function s(e,t){return Rt.isUndefined(t)?Rt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(vn(e),vn(t),0,!0)};return Rt.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);Rt.isUndefined(s)&&i!==a||(n[r]=s)}),n}const Tn=e=>{const t=In({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=ln.from(s),t.url=jt(On(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Rt.isFormData(n))if(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Rt.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(Qt.hasStandardBrowserEnv&&(r&&Rt.isFunction(r)&&(r=r(t)),r||!1!==r&&bn(t.url))){const e=o&&i&&Sn.read(i);e&&s.set(o,e)}return t},Nn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Tn(e);let o=r.data;const i=ln.from(r.headers).normalize();let s,a,c,u,l,{responseType:d,onUploadProgress:h,onDownloadProgress:f}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function m(){if(!g)return;const r=ln.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());gn(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=m:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(m)},g.onabort=function(){g&&(n(new _t("Request aborted",_t.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new _t(r,_t.ERR_NETWORK,e,g);o.event=t||null,n(o),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Yt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new _t(t,o.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Rt.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Rt.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),f&&([c,l]=yn(f,!0),g.addEventListener("progress",c)),h&&g.upload&&([a,u]=yn(h),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new pn(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const w=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);w&&-1===Qt.protocols.indexOf(w)?n(new _t("Unsupported protocol "+w+":",_t.ERR_BAD_REQUEST,e)):g.send(o||null)})},Rn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof _t?t:new pn(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new _t(`timeout ${t} of ms exceeded`,_t.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>Rt.asap(s),a}},Cn=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Ln(e))yield*Cn(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:_n}=Rt,Pn=(({Request:e,Response:t})=>({Request:e,Response:t}))(Rt.global),{ReadableStream:Un,TextEncoder:xn}=Rt.global,Bn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Dn=e=>{e=Rt.merge.call({skipUndefined:!0},Pn,e);const{fetch:t,Request:n,Response:r}=e,o=t?_n(t):"function"==typeof fetch,i=_n(n),s=_n(r);if(!o)return!1;const a=o&&_n(Un),c=o&&("function"==typeof xn?(u=new xn,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&Bn(()=>{let e=!1;const t=new n(Qt.origin,{body:new Un,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=s&&a&&Bn(()=>Rt.isReadableStream(new r("").body)),h={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new _t(`Response type '${e}' is not supported`,_t.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Rt.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Rt.isBlob(e))return e.size;if(Rt.isSpecCompliantForm(e)){const t=new n(Qt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Rt.isArrayBufferView(e)||Rt.isArrayBuffer(e)?e.byteLength:(Rt.isURLSearchParams(e)&&(e+=""),Rt.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:p,onDownloadProgress:g,onUploadProgress:m,responseType:w,headers:y,withCredentials:E="same-origin",fetchOptions:A}=Tn(e),b=t||fetch;w=w?(w+"").toLowerCase():"text";let S=Rn([c,u&&u.toAbortSignal()],p),O=null;const v=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let I;try{if(m&&l&&"get"!==s&&"head"!==s&&0!==(I=await f(y,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(Rt.isFormData(a)&&(e=t.headers.get("content-type"))&&y.setContentType(e),t.body){const[e,n]=En(I,yn(An(m)));a=kn(t.body,65536,e,n)}}Rt.isString(E)||(E=E?"include":"omit");const t=i&&"credentials"in n.prototype,c={...A,signal:S,method:s.toUpperCase(),headers:y.normalize().toJSON(),body:a,duplex:"half",credentials:t?E:void 0};O=i&&new n(o,c);let u=await(i?b(O,A):b(o,c));const p=d&&("stream"===w||"response"===w);if(d&&(g||p&&v)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Rt.toFiniteNumber(u.headers.get("content-length")),[n,o]=g&&En(t,yn(An(g),!0))||[];u=new r(kn(u.body,65536,n,()=>{o&&o(),v&&v()}),e)}w=w||"text";let T=await h[Rt.findKey(h,w)||"text"](u,e);return!p&&v&&v(),await new Promise((t,n)=>{gn(t,n,{data:T,headers:ln.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(v&&v(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new _t("Network Error",_t.ERR_NETWORK,e,O),{cause:t.cause||t});throw _t.from(t,t&&t.code,e,O)}}},Mn=new Map,Gn=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=Mn;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Dn(t)),u=a;return a},Fn=(Gn(),{http:null,xhr:Nn,fetch:{get:Gn}});Rt.forEach(Fn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Kn=e=>`- ${e}`,Hn=e=>Rt.isFunction(e)||null===e||!1===e;const Xn={getAdapter:function(e,t){e=Rt.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Kn).join("\n"):" "+Kn(e[0]):"as no adapter specified";throw new _t("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Fn};function jn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pn(null,e)}function Wn(e){jn(e),e.headers=ln.from(e.headers),e.data=dn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Xn.getAdapter(e.adapter||nn.adapter,e)(e).then(function(t){return jn(e),t.data=dn.call(e,e.transformResponse,t),t.headers=ln.from(t.headers),t},function(t){return hn(t)||(jn(e),t&&t.response&&(t.response.data=dn.call(e,e.transformResponse,t.response),t.response.headers=ln.from(t.response.headers))),Promise.reject(t)})}const Yn="1.13.2",Vn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const zn={};Vn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Yn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new _t(r(o," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!zn[o]&&(zn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Vn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Jn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new _t("option "+i+" must be "+n,_t.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _t("Unknown option "+i,_t.ERR_BAD_OPTION)}},validators:Vn},Zn=Jn.validators;class $n{constructor(e){this.defaults=e||{},this.interceptors={request:new Wt,response:new Wt}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=In(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Jn.assertOptions(n,{silentJSONParsing:Zn.transitional(Zn.boolean),forcedJSONParsing:Zn.transitional(Zn.boolean),clarifyTimeoutError:Zn.transitional(Zn.boolean)},!1),null!=r&&(Rt.isFunction(r)?t.paramsSerializer={serialize:r}:Jn.assertOptions(r,{encode:Zn.function,serialize:Zn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Jn.assertOptions(t,{baseUrl:Zn.spelling("baseURL"),withXsrfToken:Zn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Rt.merge(o.common,o[t.method]);o&&Rt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ln.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,d=0;if(!a){const e=[Wn.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new pn(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new Qn(function(t){e=t});return{token:t,cancel:e}}}const er=Qn;const tr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tr).forEach(([e,t])=>{tr[t]=e});const nr=tr;const rr=function e(t){const n=new qn(t),r=Me(qn.prototype.request,n);return Rt.extend(r,qn.prototype,n,{allOwnKeys:!0}),Rt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(In(t,n))},r}(nn);rr.Axios=qn,rr.CanceledError=pn,rr.CancelToken=er,rr.isCancel=hn,rr.VERSION=Yn,rr.toFormData=Mt,rr.AxiosError=_t,rr.Cancel=rr.CanceledError,rr.all=function(e){return Promise.all(e)},rr.spread=function(e){return function(t){return e.apply(null,t)}},rr.isAxiosError=function(e){return Rt.isObject(e)&&!0===e.isAxiosError},rr.mergeConfig=In,rr.AxiosHeaders=ln,rr.formToJSON=e=>en(Rt.isHTMLForm(e)?new FormData(e):e),rr.getAdapter=Xn.getAdapter,rr.HttpStatusCode=nr,rr.default=rr;const or=rr;var ir=n(3612);const sr={log:function(){if(ir.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=cr().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},dr=function(){var e=lr();return".".concat(e)},hr=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(sr.log("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=c(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},fr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=lr(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=c(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},pr=function(e){return function(e,t){if("string"!=typeof e)throw new u("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new u(`Invalid token specified: missing part #${n+1}`);let o;try{o=l(r)}catch(e){throw new u(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new u(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},gr=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=lr().split(".")[0],e.prev=1,e.next=2,or({method:"get",url:"".concat(ir.A.entitlementsEndpoint,"apple/subscription-check/").concat(n),params:{access_token:t}});case 2:if(!(r=e.sent).data){e.next=3;break}return sr.log("Apple Sub Check: Request successful: ",r.data),e.abrupt("return","subscribed"===r.data.status);case 3:return e.abrupt("return",!1);case 4:return e.prev=4,i=e.catch(1),sr.log("Apple Sub Check: Request Failure: ",i),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),mr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,or({method:"get",url:"".concat(ir.A.entitlementsEndpoint,"auth0/users/").concat(encodeURIComponent(t)),headers:{"X-Api-Key":ir.A.entitlementsApiKey}});case 1:return n=e.sent,e.abrupt("return",n.data.encryptedUuid);case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),wr=function(){return"complete"===document.readyState},yr=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){var n=!0;if(wr())t();else{sr.log("UIHandler: ","Waiting for the body to load...");var i=setInterval(r(o.mark(function r(){return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:e&&(n=wr()),document.querySelector("body")&&n&&(clearInterval(i),t(!0));case 1:case"end":return r.stop()}},r)})),200)}})},Er=function(){return new Promise(function(e){sr.log("blueConicReady | Waiting for BC to be ready."),window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){sr.log("blueConicReady | onReady fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),sr.log("blueConicReady | onReady timeout, BC onReady unknown."),e(!1)},3e3)})},Ar=function(){return new Promise(function(e){sr.log("blueConicProfileReady | Waiting for BC Profile to be ready."),window.blueConicClient&&(window.blueConicClient.getSegments||window.blueConicClient.profile)&&(sr.log("blueConicProfileReady | BC getSegments is ready."),e(!0)),window.blueConicClient.event.subscribe(window.blueConicClient.event.onBeforeInteractions,{},function(){sr.log("blueConicProfileReady | onBeforeInteractions fired, BC profile is ready."),e(!0)});var t=setTimeout(function(){clearTimeout(t),sr.log("blueConicProfileReady | onBeforeInteractions timeout, BC profile readiness unknown"),e(!1)},3e3)})},br=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){sr.log("blueConicLoaded | waitTillBCReady is ".concat(e));var n=setTimeout(function(){clearTimeout(n),sr.log("blueConicLoaded | onBlueConicLoaded timeout, resolving false for load status."),t(!1)},1e4);void 0!==window.blueConicClient&&void 0!==window.blueConicClient.event&&void 0!==window.blueConicClient.event.subscribe?(sr.log("blueConicLoaded | BC object already loaded"),e?t(Er()):(clearTimeout(n),t())):(sr.log('blueConicLoaded | BC not loaded, waiting for "onBlueConicLoaded" event'),window.addEventListener("onBlueConicLoaded",r(o.mark(function r(){var i;return o.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(sr.log("blueConicLoaded | onBlueConicLoaded event fired."),!e){r.next=2;break}return sr.log("blueConicLoaded | waiting for blueConicReady..."),r.next=1,Er();case 1:i=r.sent,clearTimeout(n),t(i),r.next=3;break;case 2:clearTimeout(n),t();case 3:case"end":return r.stop()}},r)})),!1))})},Sr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,br(!0);case 1:if(!e.sent){e.next=4;break}return e.next=2,Ar();case 2:if(e.sent){e.next=3;break}return e.abrupt("return",!1);case 3:return e.abrupt("return",blueConicClient.profile.getProfile().getValue("Auth0_ID"));case 4:return e.abrupt("return",!1);case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Or=function(){var e=r(o.mark(function e(){var t,n,r,i,s,a,c,u=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=u.length>0&&void 0!==u[0]&&u[0],n=!1,i=["MICH LOWA","OHIO LOWA","PENN LOWA","NY LOWA","BOSTON LOWA","NORCAL LOWA","TWIN CITIES LOWA","DENV/PMP LOWA","SCNG LOWA","BANG LOWA","AMC LOWA","HC LOWA","GS LOWA","ORL LOWA","SS LOWA","NNDP LOWA","VP LOWA","NYDN LOWA","BAL LOWA","CG LOWA","CHI LOWA"],e.next=1,br(!0);case 1:if(!e.sent){e.next=3;break}if(s=window.blueConicClient.getSegments(),sr.log("bcLowaCheck | BC segments for users: ",s),!(s.filter(function(e){return i.includes(e.name)}).length>0)){e.next=3;break}return e.next=2,Sr();case 2:(a=e.sent)&&(n=!0,r=a);case 3:return t&&n&&vr(),c={isSub:n},r&&(c.uuid=r),e.abrupt("return",c);case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),vr=function(){hr("bc_lowa_status",1,{path:"/",domain:dr(),expires:7,secure:!0})},Ir=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(sr.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(sr.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};sr.log("utils | Event: authentication ready: ",r),e(r)}catch(e){sr.log(e),t(e)}},!1))})},Tr=function(){fr(ar.AUTH0_SUB_COOKIE_KEY),fr("mng-jwt-decoded"),localStorage.removeItem(ar.USER_STORAGE_HASH),sessionStorage.removeItem("dashboard-state"),function(){sr.log("Clearing entitlements...");try{fr(ar.ENTITLEMENT_COOKIE_KEY,{path:"/"})}catch(e){sr.log("Failed to delete legacy cookie: ",e)}try{fr(ar.ENTITLEMENT_COOKIE_KEY,{path:"/",domain:lr(),expires:365,secure:!0})}catch(e){sr.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(ar.LOCAL_STORAGE_SESSION_KEY)}catch(e){sr.log("Failed to remove local storage: ",e)}}()},Nr=function(){var e=cr();return!["local","develop","preprod","trbdev"].some(function(t){return e.origin.includes(t)})},Rr=function(e){sr.log("Removing storageObject : ",e),void 0!==window.localStorage.getItem(e)&&(window.localStorage.removeItem(e),sr.log("Storage Object removed : ",e))},Cr=function(e){sr.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return sr.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=Cr;var Lr;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var kr=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Lr){e.next=1;break}return e.abrupt("return",Lr);case 1:return t=ir.A.auth0Domain,n=ir.A.auth0ClientId,Lr=new De({domain:t,clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{audience:"access-extension",scope:"openid email profile user_metadata app_metadata offline_access"}}),e.abrupt("return",Lr);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),_r=function(e){sr.log("utils | auth event dispathed");var t=new CustomEvent("authenticationReady",{detail:e});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.authenticationReady=e,sr.log("utils | Dispatching authenticationReady Event: ",t),window.dispatchEvent(t),sr.log("utils | Dispatched authenticationReady event!")};var Pr=function(e){ir.A.datadogEnabled&&window.DD_RUM.addTiming(e)};function Ur(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var xr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,br();case 1:return e.next=2,Ir();case 2:return e.abrupt("return",new Promise(function(e){sr.log("ANALYTICS: inside BCregwall events");var t=cr();t.searchParams.delete("regwall");var n=blueConicClient.profile.getProfile();localStorage.setItem("regwallSuccess","yes"),localStorage.setItem("regwallEvent","yes"),n.setValue("bang_reg_wall_status","Y"),n.setValue("regwall_newspaper",t.host),n.setValue("regwall_success_date",new Date),n.setValue("regwall_success","yes"),blueConicClient.profile.updateProfile(),e(!0)}));case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Br=function(e){try{window.dataLayer.push({event:e}),sr.log("ANALYTICS: ".concat(e," event")),sr.log("ANALYTICS: GA/ datalayer ",window.dataLayer)}catch(t){sr.log("ANALYTICS: Failed to send ".concat(e," event: "),t)}};var Dr=function(){try{var e=localStorage.getItem(ar.LOCAL_STORAGE_SESSION_KEY);return"string"==typeof e?e:"{}"}catch(e){sr.log("Unable to get session from local storage: ",e)}return"{}"},Mr=function(e){try{sr.log("Setting local storage session",e),localStorage.setItem(ar.LOCAL_STORAGE_SESSION_KEY,e)}catch(e){sr.log("Unable to save session from local storage: ",e)}},Gr=function(e){try{hr(ar.ENTITLEMENT_COOKIE_KEY,e,{path:"/",domain:dr(),expires:365,secure:!0})}catch(e){sr.log("Unable to save session to cookie storage: ",e)}},Fr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,a,c,u,l,d,h,f,p,g,m,w,y,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=ir.A.sessionServer,n="".concat(t,"/api/session"),sr.log("Checking server session: ",n),e.next=1,or.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return l=r.data.entitlementTokenDecoded,d=r.data,h=d.accessToken,f=d.idToken,p=d.entitlementToken,g=null!==(i=null==l?void 0:l.entitlement_expiry)&&void 0!==i?i:null,m=null!==(s=null==l?void 0:l.entitlement_source)&&void 0!==s?s:null,w=null!==(a=null==l?void 0:l.entitlement_entitled)&&void 0!==a?a:null,y=null!==(c=null==l?void 0:l.entitlement_extras_adfree)&&void 0!==c?c:null,E=null!==(u=null==l?void 0:l.entitlement_level)&&void 0!==u?u:null,Mr(JSON.stringify({accessToken:h,idToken:f,entitlementToken:p,expiration:g,entitlementSource:m,isEntitled:w,adFree:y,entitlementLevel:E})),""!==p&&"string"==typeof p&&Gr(p),e.abrupt("return",{accessToken:h,idToken:f,entitlementToken:p,expiration:g,entitlementSource:m,isEntitled:w,adFree:y,entitlementLevel:E});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Kr=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=ir.A.sessionServer,r="".concat(n,"/api/session"),sr.log("Updating server session: ",r),e.next=1,or.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,i=e.catch(0),sr.log("Failed to update session server: ",i);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Hr=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t=ir.A.sessionServer,n="".concat(t,"/api/session"),sr.log("Deleting server session: ",n),e.next=1,or.delete(n,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,r=e.catch(0),sr.log("Failed to delete server session: ",r);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),Xr=function(){var e=r(o.mark(function e(){var t,n,r,i,s,a,c,u,l,d,h,f,p,g,m,w,y,E,A,b,S,O,v,I,T,N,R,C;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(sr.log("Inside getSession"),e.prev=1,l=Dr(),sr.log("Session: __MNG_Session = ",l),d=JSON.parse(l),h=d.accessToken,f=d.idToken,p=d.entitlementToken,g=d.expiration,m=d.entitlementSource,w=d.isEntitled,y=d.adFree,E=d.entitlementLevel,n=h,t=f,r=p,i=g,s=m,a=w,c=y,u=E,sr.log("Session: check both tokens: ",t,r),void 0!==f&&void 0!==p&&null!==f&&null!==p){e.next=3;break}return sr.log("Session: missing id or entitlements, try session server"),e.next=2,Fr();case 2:A=e.sent,b=A.accessToken,S=A.idToken,O=A.entitlementToken,v=A.expiration,I=A.entitlementSource,T=A.isEntitled,N=A.adFree,R=A.entitlementLevel,n=b,t=S,r=O,i=v,s=I,a=T,c=N,u=R;case 3:e.next=5;break;case 4:e.prev=4,C=e.catch(1),sr.log("Failed to get session: ",C);case 5:return sr.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:s,isEntitled:a,adFree:c,entitlementLevel:u});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),jr=function(){var e=r(o.mark(function e(t){var n,r,i,s,a,c,u,l,d,h,f,p,g,m,w,y,E,A,b,S,O,v,I,T,N,R,C,L,k;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=Dr(),r=JSON.parse(n),i=r.accessToken,s=void 0===i?null:i,a=r.idToken,c=void 0===a?null:a,u=r.entitlementToken,l=void 0===u?null:u,d=r.expiration,h=void 0===d?null:d,f=r.entitlementSource,p=void 0===f?null:f,g=r.isEntitled,m=void 0===g?null:g,w=r.adFree,y=void 0===w?null:w,E=r.entitlementLevel,A=void 0===E?null:E,b=t.accessToken,S=t.idToken,O=t.entitlementToken,v=t.expiration,I=t.entitlementSource,T=t.isEntitled,N=t.adFree,R=t.entitlementLevel,C={accessToken:null==b?s:b,idToken:null==S?c:S,entitlementToken:null==O?l:O,expiration:null==v?h:v,entitlementSource:null==I?p:I,isEntitled:null==T?m:T,adFree:null==N?y:N,entitlementLevel:null==R?A:R},sr.log("Current session data: ",r),sr.log("New session data: ",t),sr.log("Updated session data:",C),L=JSON.stringify(C),Mr(L),""!==C.entitlementToken&&"string"==typeof C.entitlementToken&&Gr(C.entitlementToken),n===L){e.next=1;break}return e.next=1,Kr(C);case 1:e.next=3;break;case 2:e.prev=2,k=e.catch(0),sr.log("Unable to save session: ",k);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Wr=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return sr.log("Ending session..."),Tr(),e.next=1,Hr();case 1:localStorage.removeItem(ar.LOCAL_STORAGE_SESSION_KEY);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),Yr=function(){return"logout"===(cr().searchParams.get("state")||"").toLowerCase()};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.logoutCallbacks=[];var Vr=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,kr();case 1:n=e.sent,sr.log("Calling Auth0 logout..."),n.logout({returnTo:t});case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),zr=function(){return"undefined"==typeof CnnXt?(sr.log("Connext was not loaded."),!1):Connext.Storage.GetUserState()},Jr=function(){sr.log("Check for SS paywall Cookie");var e=window.location.hostname,t=document.cookie.split(";").find(function(e){return e.trim().startsWith("vip-go-seg=vc-v1__has_access")});if(/^(?!:\/\/)([a-zA-Z0-9-_]{1,63}\.?)+[a-zA-Z]{2,6}$/.test(e)&&t){sr.log("SS paywall Cookie found, removing it");var n=t.split("=")[0].trim();document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=").concat(e),document.cookie="".concat(n,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}},Zr=function(){var e=r(o.mark(function e(){var t,n,i,s,a,c;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(sr.log("Attempting to logout..."),Jr(),!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,Wr();case 1:e.next=3;break;case 2:Tr();case 3:return e.prev=3,sr.log("Cycling through logout callbacks..."),t=window.MNGAuthentication.logoutCallbacks.map(function(e){return e()}),e.next=4,Promise.all(t);case 4:sr.log("Finished cycling through logout callbacks."),e.next=6;break;case 5:e.prev=5,c=e.catch(3),sr.log("Failed to cycle through logout callbacks: ",c);case 6:Object.keys(window.localStorage).filter(function(e){return e.includes("auth0")}).forEach(function(e){window.localStorage.removeItem(e),sr.log("Removed Auth0 storage object...")}),Rr("hhsl"),Rr("userNewsLetterData"),Rr(ar.REGWALL_USER_IS_SUBSCRIBED),Rr(ar.USER_PROFILE_HASH),n=cr(),i=window.location.origin;try{n.searchParams.get("returnURL")&&(s=decodeURIComponent(n.searchParams.get("returnURL")),i=s)}catch(e){sr.log(e),i=window.location.origin}return i=new URL(i),e.next=7,window.ConnextUtils.connextReady("onInit",!1);case 7:if(!e.sent){e.next=14;break}if(sr.log("Auth | Silent mode enabled ",Connext.GetOptions().Silentmode),sr.log("Auth | Run connext manually if Silent Mode is on."),window.ConnextUtils.rerunConnextEntitlements(!0),a=i,i.origin!==window.location.origin&&(a=new URL(window.location.origin)).searchParams.append("returnAfterLogout",i),window.history.replaceState({additionalInformation:"Updated the URL to prevent another login cycle"},"Home",a),!Nr()){e.next=8;break}sr.log("About to call Connext Logout..."),setTimeout(function(){Connext.Logout()},500),e.next=13;break;case 8:if("Logged In"!==zr()){e.next=12;break}if(sr.log("Connext user state is logged in, setting timeout..."),setTimeout(r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return sr.log("Connext took too long to logout, calling auth0 logout..."),e.next=1,Vr(i);case 1:case"end":return e.stop()}},e)})),8e3),"function"!=typeof Connext._logout){e.next=10;break}return sr.log("About to call Connext _logout..."),e.next=9,Connext._logout();case 9:e.next=11;break;case 10:return sr.log("About to call Connext Logout..."),e.next=11,Connext.Logout();case 11:e.next=13;break;case 12:return sr.log("Connext user state is logged out, not calling it, going to auth0 logout."),e.next=13,Vr(i);case 13:e.next=15;break;case 14:return sr.log("Connext Logout was NOT called"),e.next=15,Vr(i);case 15:case"end":return e.stop()}},e,null,[[3,5]])}));return function(){return e.apply(this,arguments)}}(),$r=function(){var e=0;for(var t in window.localStorage){var n=2*window.localStorage[t].length/1024/1024;!Number.isNaN(n)&&window.localStorage.hasOwnProperty(t)&&(e+=n)}return e},qr=function(){window.MNGAuthentication.preAuthGTMEvents.forEach(function(e){return Br(e)}),sr.log("Cycled through preauth GTM events.")},Qr=function(){var e=r(o.mark(function e(t,n,r,i,s){var a,c,u,l,d,h,f,p,g,m,w,y,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return sr.log("Attempting to login..."),$r()>4.5&&window.localStorage.clear(),qr(),i&&(a=[],c=window.localStorage.getItem("callbackEvents"),u=JSON.parse(c),a=u&&u.length>0?Ur(new Set([].concat(Ur(i),Ur(u)))):i,window.localStorage.setItem("callbackEvents",JSON.stringify(a))),l=null,e.next=1,kr();case 1:if(d=e.sent,h=cr(),f=h.origin,p=new URL("".concat(f,"/callback")),g={},h.searchParams.get("regwall")&&(h.searchParams.get("returnUrl")&&(m=h.searchParams.get("returnUrl")),h.searchParams.get("auth_redirect")&&(m=h.searchParams.get("auth_redirect"))),h.pathname.startsWith("/login")||h.pathname.startsWith("/callback")?h.searchParams.get("returnUrl")?p.searchParams.set("auth_redirect",h.searchParams.get("returnUrl")):s&&p.searchParams.set("auth_redirect",s):p.searchParams.set("auth_redirect",h.toString()),m&&"regwall"!==t&&p.searchParams.set("auth_redirect",m),"true"===h.searchParams.get("close-after-finish")&&p.searchParams.set("close-after-finish","true"),"true"!==h.searchParams.get("ssl")){e.next=4;break}if(!window.authentication_config.sessionManagementEnabled){e.next=3;break}return e.next=2,Wr();case 2:e.next=4;break;case 3:Tr();case 4:return null!==(l=h.searchParams.get("login-with"))?g.connection=l:n&&(g.connection=n),w="none",t&&"regwall"===t&&(p.searchParams.set("regwall","true"),w="signUp",sr.log("Logging in with regwall")),t&&(p.searchParams.set("loginsource",t),sr.log("Logging in with ".concat(t))),r&&(g.login_hint=r),g.redirect_uri=p.toString(),g.initialScreen=w,"googleonetap"!==t&&(g.prompt="select_account"),null!==(y=h.searchParams.get("ampRegiWall"))&&(E=window.location.hostname,g.ampRegiWall=y,g.sourceDomain=E.replace("www.","").replace("preprod.","").replace("develop.","").replace("staging.",""),g.initialScreen="signUp",g.preferenceId=h.searchParams.get("prefId")),e.next=5,d.loginWithRedirect({authorizationParams:g});case 5:case"end":return e.stop()}},e)}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),eo=function(){return new Promise(function(e){var t=setTimeout(function(){e()},8e3);try{var n=window.localStorage.getItem("callbackEvents"),r=JSON.parse(n);if(!r||0===r.length)return void e();sr.log("Adding listeners to events we need to wait for...");var o=r.map(function(e){return t=e,new Promise(function(e){sr.log("Adding event to wait for: ",t),window.addEventListener(t,function(n){try{var r=n.detail||{};sr.log("Event: ".concat(t,"} ready: "),r),e(r)}catch(t){sr.log(t),e()}},!1)});var t});Promise.all(o).then(function(){clearTimeout(t),e()})}catch(t){sr.log("Failed to wait for callback events",t),e()}})};window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.oidcLoginCallbacks=[];var to=function(){var e=r(o.mark(function e(){var t,n,i,s,a,c,u,l,d,h,f,p,g,m,w,y,E,A,b,S,O,v;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(Jr(),t=cr(),n=!1,i=t.searchParams.get("auth_redirect")||"https://".concat(window.location.host),s=t.searchParams.get("redirect_uri")||"",s.includes("applenews")?(sr.log("This is Apple prelogin flow."),(a=new URL(s))?(a.searchParams.append("post-apple-login","true"),sr.log("Post callback Apple redirect URL is ".concat(a)),Qr(!1,!1,!1,[],a)):Qr()):i.includes("post-apple-login")&&(sr.log("This is Apple Callback flow."),n=!0,(c=new URL(decodeURIComponent(i))).searchParams.delete("post-apple-login"),i=c),sr.log("Handling post login callback..."),!(u=t.searchParams.get("error_description"))){e.next=2;break}if("shouldAutoLogin"!==u){e.next=1;break}return e.abrupt("return",Qr(!1,!1,!1,!1,i));case 1:n&&alert("There was an error in logging you in, please try again.");case 2:return e.next=3,kr();case 3:return l=e.sent,e.next=4,l.handleRedirectCallback();case 4:return e.next=5,l.getIdTokenClaims();case 5:return d=e.sent,e.next=6,l.getUser();case 6:return h=e.sent,sr.log("Auth0 user profile: ",h),f=d.__raw,e.next=7,l.getTokenSilently();case 7:return p=e.sent,e.prev=8,sr.log("Cycling through login callbacks..."),e.next=9,eo();case 9:return g=window.MNGAuthentication.oidcLoginCallbacks.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(f));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=10,Promise.all(g);case 10:sr.log("Finished cycling through login callbacks."),e.next=12;break;case 11:e.prev=11,S=e.catch(8),sr.log("Failed to cycle through login callbacks: ",S);case 12:if(m={accessToken:p,userId:h.sub,email:h.email,picture:h.picture},w=!1,y="",!n){e.next=17;break}return e.prev=13,e.next=14,mr(m.userId);case 14:return y=e.sent,sr.log("Encrypted apple uuid is: ".concat(y)),e.next=15,gr(y);case 15:w=e.sent,sr.log("Apple sub status is: ".concat(w)),e.next=17;break;case 16:e.prev=16,O=e.catch(13),sr.log("Apple sub check error: ".concat(O)),alert("There was an error in logging you in, please try again.");case 17:if(Rr(ar.REGWALL_USER_IS_SUBSCRIBED),!window.authentication_config.sessionManagementEnabled){e.next=18;break}return sr.log("Saving idToken to session server"),e.next=18,jr({idToken:f,accessToken:p});case 18:if(!t.searchParams.get("close-after-finish")){e.next=19;break}return e.abrupt("return",window.close());case 19:if(!t.search.includes("loginsource")){e.next=20;break}return E=t.searchParams.get("loginsource"),A=window.MNGAuthentication.postAuthEvents.map(function(){var e=r(o.mark(function e(t){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(E));case 1:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()),e.next=20,Promise.all(A);case 20:return e.prev=20,b=new URL(i),n&&w&&b.searchParams.append("access_token",y),sr.log("Apple redirect URL:",b),e.abrupt("return",window.location.assign(b));case 21:return e.prev=21,v=e.catch(20),sr.log("Failed to redirect after authentication: ",v),window.location.assign(new URL(window.location.origin)),e.abrupt("return","Finished execution, please await result...");case 22:case"end":return e.stop()}},e,null,[[8,11],[13,16],[20,21]])}));return function(){return e.apply(this,arguments)}}(),no=function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return sr.log("ANALYTICS: fireBC events"),e.next=1,xr();case 1:sr.log("ANALYTICS: bc values should be filled");case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ro=function(){var e=r(o.mark(function e(){var t,n,r,i,s,a,c,u,l,d,h,f,p;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Ir();case 1:if(t=e.sent,n=t.idToken,r=t.isAuthenticated,""===n){e.next=4;break}return e.prev=2,s=pr(n),a=s.email,c=s.picture,u=s.sub,l=s.name,d=s.nickname,h=s.connection_source,f=null===(i=s.user_metadata)||void 0===i||null===(i=i.customProfile)||void 0===i?void 0:i.nickname,u.split("|").pop(),e.abrupt("return",{authenticated:r,nickname:f||d||l,email:a,picture:c,userId:u,connectionSource:h});case 3:e.prev=3,p=e.catch(2),sr.log("Unable to parse idToken: ",n," Error: ",p);case 4:return e.abrupt("return",{authenticated:r});case 5:case"end":return e.stop()}},e,null,[[2,3]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.login=Qr,window.MNGAuthentication.logout=Zr,window.MNGAuthentication.getUserInfo=ro;var oo=function(){var e=r(o.mark(function e(){var t,n,s,a,c,u,l,d,h,f,p,g,m;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=cr(),n=!1,s="",a=!1,c={},Yr()&&window.ConnextUtils.rerunConnextEntitlements(!0),t.searchParams.get("returnAfterLogout")&&(u=decodeURIComponent(t.searchParams.get("returnAfterLogout")),window.location.assign(u)),t.searchParams.has("entitlement_jwt")&&(window.authentication_config.sessionManagementEnabled=!1),l=function(){var e=r(o.mark(function e(){var t,r,u;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,kr();case 1:return t=e.sent,e.next=2,t.getIdTokenClaims();case 2:return c=e.sent,e.next=3,t.isAuthenticated();case 3:if(n=e.sent,s="object"===i(c)?c.__raw:"",r=ur(ar.ENTITLEMENT_COOKIE_KEY),n||!r){e.next=5;break}return e.next=4,t.getTokenSilently();case 4:a=e.sent;case 5:e.next=7;break;case 6:e.prev=6,u=e.catch(0),sr.log("Unable to verify user has active auth0 session: ",u);case 7:case"end":return e.stop()}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),!t.pathname.startsWith("/logout")){e.next=2;break}return sr.log("Page is logout. Routing to logout function..."),e.next=1,Zr();case 1:return e.abrupt("return");case 2:if(!window.authentication_config.sessionManagementEnabled){e.next=9;break}return e.next=3,l();case 3:if(""===s){e.next=5;break}if(d=null,h=JSON.parse(window.localStorage.getItem(ar.LOCAL_STORAGE_SESSION_KEY)),"{}"!==Dr()){e.next=4;break}return h&&(d=h.jwt),e.next=4,jr({idToken:s,entitlementToken:d});case 4:e.next=8;break;case 5:return e.prev=5,e.next=6,Xr();case 6:f=e.sent,s=f.idToken,(n="string"==typeof s)&&(c=pr(s)),e.next=8;break;case 7:e.prev=7,m=e.catch(5),sr.log("Unable to initialize session: ",m);case 8:e.next=10;break;case 9:return e.next=10,l();case 10:if(n||a||!ir.A.blueconicEnabled||!ir.A.bcLowaSegements){e.next=12;break}return e.next=11,Or(!0);case 11:(p=e.sent).isSub&&(n=ar.USER_IS_LOWA,c={sub:p.uuid});case 12:if(_r({isAuthenticated:n,idToken:s,accessToken:a,claims:c}),Pr("authenticationReady"),!0===n?(sr.log("User is authenticated."),t.searchParams.get("auth_redirect")&&(sr.log("Auth Redirect is present, sending user to auth redirect..."),(g=t.searchParams.get("auth_redirect")).endsWith("#")&&(g=g.slice(0,g.length)),window.location.assign(g)),t.pathname.startsWith("/login")&&!Yr()&&(sr.log("Page is login. The user is already logged in and Connext Logout param is not present... Redirecting..."),window.location.assign(t.origin))):sr.log("User is not authenticated."),t.pathname.startsWith("/login")&&!Yr()?(sr.log("Page is login. Attempting to log user in..."),Qr()):sr.log("Page is not login or Connext state is present"),!t.pathname.startsWith("/callback")||!t.searchParams.get("regwall")){e.next=14;break}return sr.log("Page is callback with regwall param. Routing to regwall receiver..."),e.next=13,no();case 13:sr.log("Now login from regwall"),Qr(),e.next=15;break;case 14:if(!t.pathname.startsWith("/callback")){e.next=15;break}return sr.log("Page is callback without regwall param. Routing to callback receiver..."),e.next=15,to();case 15:case"end":return e.stop()}},e,null,[[5,7]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication.init=oo;var io=function(e,t){return new Promise(function(n){try{"undefined"==typeof CnnXt&&(sr.log("Connext was not loaded."),n(!1)),sr.log("connext subscribeToNewsletter","about to call Cnnxt NewsletterSubscribe with pref id ".concat(t," and email ").concat(e)),CnnXt.API.NewsletterSubscribe({email:e,id:t,onSuccess:function(){sr.log("Signed user up to newsletter: ",t),n(!0)},onError:function(e){sr.log("subscribeToNewsletter error: ",e),n(!1)}})}catch(e){sr.log("subscribeToNewsletter Error:",e),n(!1)}})},so=function(){document.addEventListener("click",function(e){if(e.target.classList.contains("connext-login")){var t=window.location.href,n=new URL(t),r=n.origin,o=new URL("".concat(r,"/login"));o.searchParams.set("returnUrl",n.toString()),window.location.assign(o)}})},ao=function(){Nr()||document.addEventListener("onInit",function(){if("undefined"!=typeof Connext){var e,t,n,r=Connext;t="Logout",n=function(){return function(){alert("Warning! You called Connext.Logout() directly! Calling MNGAuthentication.logout() next."),window.MNGAuthentication.logout()}},(e=r)._logout=Connext.Logout,e[t]=n(e[t])}})},co=function(e){try{"string"==typeof e&&hr(ar.AUTH0_SUB_COOKIE_KEY,e,{domain:dr(),path:"/",expires:365,secure:!0})}catch(e){sr.log("Failed to set auth0_sub cookie: ",e)}},uo=function(e){if(!ur(ar.AUTH0_SUB_COOKIE_KEY))try{var t=e.claims;if(null==t||"object"!==i(t)&&!Object.keys(t).includes("sub"))return;var n=t.sub;co(n)}catch(e){sr.log("Failed to set auth0_sub: ",e)}},lo=function(e){try{if("string"==typeof e){var t=pr(e).sub;co(t)}else sr.log("Could not set auth0_sub on login, idToken was not available.")}catch(e){sr.log("Failed to set auth0_sub on login: ",e)}},ho=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=window.localStorage.getItem("newsletter_to_subscribe"))){e.next=4;break}return e.next=1,window.ConnextUtils.connextReady("onFinish");case 1:return e.next=2,ro();case 2:return n=e.sent,r=n.email,sr.log("CONNEXT: about to sign up ".concat(r," to ").concat(t)),e.next=3,io(r,t);case 3:window.localStorage.removeItem("newsletter_to_subscribe"),sr.log("CONNEXT: newsletter_to_subscribe value removed from local storage.");case 4:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();const fo={init:function(){var e=r(o.mark(function e(){var t;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return so(),ao(),ho(),MNGAuthentication.oidcLoginCallbacks.push(lo),window.ConnextUtils.runConnextIfSilent(),e.next=1,Ir();case 1:t=e.sent,uo(t);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}()};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return fo.init(),e.next=1,yr(!0);case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.connext.bundle.js.map; /*! For license information please see mng-digisubs.entitlements.bundle.js.LICENSE.txt */ (()=>{var e={251:(e,t)=>{t.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<>1,l=-7,f=n?o-1:0,d=n?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+e[t+f],f+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+f],f+=d,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=u}return(h?-1:1)*s*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,E=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*c-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&a,h+=p,a/=256,o-=8);for(s=s<0;e[n+h]=255&s,h+=p,s/=256,u-=8);e[n+h-p]|=128*E}},579:(e,t,n)=>{var r=n(3738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,n)=>{var r=n(6993),o=n(1791);e.exports=function(e,t,n,i,s){return new o(r().w(e,t,n,i),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},1791:(e,t,n)=>{var r=n(5172),o=n(5546);e.exports=function e(t,n){function i(e,o,s,a){try{var c=t[e](o),u=c.value;return u instanceof r?n.resolve(u.v).then(function(e){i("next",e,s,a)},function(e){i("throw",e,s,a)}):n.resolve(u).then(function(e){c.value=e,s(c)},function(e){return i("throw",e,s,a)})}catch(e){a(e)}}var s;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,t,r){function o(){return new n(function(t,n){i(e,r,t,n)})}return s=s?s.then(o,o):o()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},3612:(e,t,n)=>{"use strict";n.d(t,{A:()=>r}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const r={debug:!!window.authentication_config.debug,sessionServer:window.authentication_config?window.authentication_config.sessionServer:"",entitlementsEnabled:!!window.authentication_config&&"1"===window.authentication_config.entitlementsEnabled,dropdownEnabled:!!window.authentication_config&&"1"===window.authentication_config.dropdownEnabled,enableReaderDashboardLink:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardLink,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",oneTapEnabled:!!window.authentication_config&&"1"===window.authentication_config.oneTapEnabled,useTribMainGoogle:!!window.authentication_config&&"1"===window.authentication_config.useTribMainGoogle,isAdfreeArticle:!!window.authentication_config&&"1"===window.authentication_config.isAdfreeArticle,auth0Domain:window.authentication_config?window.authentication_config.auth0Domain:"",auth0ClientId:window.authentication_config?window.authentication_config.auth0ClientId:"",entitlementsEndpoint:window.authentication_config?window.authentication_config.entitlementsEndpoint:"",entitlementsApiKey:window.authentication_config?window.authentication_config.entitlementsAPIKey:"",linaCheckOnArticles:!!window.authentication_config&&window.authentication_config.linaCheckOnArticles,serverEntitlements:!!window.authentication_config&&window.authentication_config.serverEntitlements,googleClientId:window.authentication_config?window.authentication_config.googleClientId:"",newsletterId:window.authentication_config?window.authentication_config.newsletterId:0,connextStorageKey:"",auth0SubKey:"auth0_sub",auth0Authenticated:"auth0.is.authenticated",secret:window.authentication_config?window.authentication_config.pluginSecret:"",newslettersEnabled:!!window.authentication_config&&"1"===window.authentication_config.newslettersEnabled,bcLowaSegements:!!window.authentication_config.bcLowaSegements&&"1"===window.authentication_config.bcLowaSegements,blueconicEnabled:!!window.authentication_config.blueconicEnabled&&"1"===window.authentication_config.blueconicEnabled,datadogEnabled:!!window.authentication_config.enableDatadog&&"1"===window.authentication_config.enableDatadog}},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4373:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4633:(e,t,n)=>{var r=n(5172),o=n(6993),i=n(5869),s=n(887),a=n(1791),c=n(4373),u=n(579);function l(){"use strict";var t=o(),n=t.m(l),f=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,h[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,u(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=l=function(){return{wrap:function(e,n,r,o){return t.w(p(e),n,r,o&&o.reverse())},isGeneratorFunction:d,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:a,async:function(e,t,n,r,o){return(d(t)?s:i)(p(e),t,n,r,o)},keys:c,values:u}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5546:e=>{function t(n,r,o,i){var s=Object.defineProperty;try{s({},"",{})}catch(n){s=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?s?s(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},5869:(e,t,n)=>{var r=n(887);e.exports=function(e,t,n,o,i){var s=r(e,t,n,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},6993:(e,t,n)=>{var r=n(5546);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function c(e,o,i,s){var a=o&&o.prototype instanceof l?o:l,c=Object.create(a.prototype);return r(c,"_invoke",function(e,r,o){var i,s,a,c=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,a=t,d.n=n,u}};function h(e,r){for(s=e,a=r,n=0;!f&&c&&!o&&n3?(o=p===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=e<2&&hr||r>p)&&(i[4]=e,i[5]=r,d.n=p,s=0))}if(o||e>1)return u;throw f=!0,r}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,p),s=l,a=p;(n=s<2?t:a)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,a)):d.n=a:d.v=a);try{if(c=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((n=(f=d.n<0)?a:e.call(r,d))!==u)break}catch(e){i=t,s=1,a=e}finally{c=1}}return{value:n,done:f}}}(e,i,s),!0),c}var u={};function l(){}function f(){}function d(){}n=Object.getPrototypeOf;var h=[][s]?n(n([][s]())):(r(n={},s,function(){return this}),n),p=d.prototype=l.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return f.prototype=d,r(p,"constructor",d),r(d,"constructor",f),f.displayName="GeneratorFunction",r(d,a,"GeneratorFunction"),r(p),r(p,a,"Generator"),r(p,s,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:c,m:E}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=a(e),s=i[0],c=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,c)),l=0,f=c>0?s-4:s;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===c&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],s=16383,a=0,c=r-o;ac?c:a+s));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=i[s],r[i.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var r,o=[],i=t;i{"use strict";const r=n(7526),o=n(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|E(e,t);let r=a(n);const o=r.write(e,t);o!==n&&(r=r.slice(0,o));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return c.from(r,t,n);const o=function(e){if(c.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?a(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),a(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function E(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(o)return r?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function A(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return v(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){let i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let r=-1;for(i=n;ia&&(n=a-c),i=n;i>=0;i--){let n=!0;for(let r=0;ro&&(r=o):r=o;const i=t.length;let s;for(r>i/2&&(r=i/2),s=0;s>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function R(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function b(e,t,n){n=Math.min(e.length,n);const r=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+s<=n){let n,r,a,c;switch(s){case 1:t<128&&(i=t);break;case 2:n=e[o+1],128==(192&n)&&(c=(31&t)<<6|63&n,c>127&&(i=c));break;case 3:n=e[o+1],r=e[o+2],128==(192&n)&&128==(192&r)&&(c=(15&t)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:n=e[o+1],r=e[o+2],a=e[o+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),o+=s}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(r,o)):Uint8Array.prototype.set.call(r,t,o);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,o)}o+=t.length}return r},c.byteLength=E,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,n,r,o){if(q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;let i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0);const a=Math.min(i,s),u=this.slice(r,o),l=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return O(this,e,t,n);case"base64":return N(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function v(e,t,n){let r="";n=Math.min(e.length,n);for(let o=t;or)&&(n=r);let o="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function k(e,t,n,r,o){X(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,n}function x(e,t,n,r,o){X(t,r,o,e,n,7);let i=Number(t&BigInt(4294967295));e[n+7]=i,i>>=8,e[n+6]=i,i>>=8,e[n+5]=i,i>>=8,e[n+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s>>=8,e[n+2]=s,s>>=8,e[n+1]=s,s>>=8,e[n]=s,n+8}function D(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function G(e,t,n,r,i){return t=+t,n>>>=0,i||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||U(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||U(e,t,this.length);let r=this[e+--t],o=1;for(;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Q(function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||U(e,t,this.length);let r=this[e],o=1,i=0;for(;++i=o&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||U(e,t,this.length);let r=t,o=1,i=this[e+--r];for(;r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Q(function(e){K(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||j(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||U(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=1,i=0;for(this[t]=255&e;++i>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}let o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Q(function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Q(function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}let o=0,i=1,s=0;for(this[t]=255&e;++o>>=0,!r){const r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}let o=n-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Q(function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Q(function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return G(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return G(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function X(e,t,n,r,o,i){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new F.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||j(t,e.length-(n+1))}(r,o,i)}function K(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function j(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new F.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}_("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),_("ERR_OUT_OF_RANGE",function(e,t,n){let r=`The value of "${e}" is out of range.`,o=n;return Number.isInteger(n)&&Math.abs(n)>2**32?o=H(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=H(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const Y=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const r=e.length;let o=null;const i=[];for(let s=0;s55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Y,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,n,r){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let o=0;o<16;++o)t[r+o]=e[n]+e[o]}return t}();function Q(e){return"undefined"==typeof BigInt?z:e}function z(){throw new Error("BigInt not supported")}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function r(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var s=e.apply(n,r);function a(e){t(s,o,i,a,c,"next",e)}function c(e){t(s,o,i,a,c,"throw",e)}a(void 0)})}}n.r(e),n.d(e,{hasBrowserEnv:()=>Me,hasStandardBrowserEnv:()=>xe,hasStandardBrowserWebWorkerEnv:()=>De,navigator:()=>ke,origin:()=>Pe});var o=n(4756);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var s=n(3612);const a={log:function(){if(s.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;re.length)&&(t=e.length);for(var n=0,r=Array(t);n{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}(t)}catch(e){return atob(t)}}l.prototype.name="InvalidTokenError","function"==typeof SuppressedError&&SuppressedError;var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function p(e,t){return e(t={exports:{}},t.exports),t.exports}var E=p(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}});h(E);var A=h(p(function(e,t){var n=d&&d.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},r=d&&d.__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]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var a=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,a,c;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?s:this.storageHandler,o=i+"-"+t,null===(a=n.getItemSync(o))?[2]:(c=JSON.parse(a)).id!==this.id?[3,2]:[4,E.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(o),E.default().unlock(c.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],s=0;;){var a=r.keySync(s);if(null===a)break;o.push(a),s++}for(var c=!1,u=0;u(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;g=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const t=N.call(e);return v[t]||(v[t]=t.slice(8,-1).toLowerCase())});var v;const C=e=>(e=e.toLowerCase(),t=>I(t)===e),L=e=>t=>typeof t===e,{isArray:B}=Array,U=L("undefined");function M(e){return null!==e&&!U(e)&&null!==e.constructor&&!U(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const k=C("ArrayBuffer");const x=L("string"),D=L("function"),P=L("number"),G=e=>null!==e&&"object"==typeof e,F=e=>{if("object"!==I(e))return!1;const t=T(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||b in e||R in e)},_=C("Date"),H=C("File"),X=C("Blob"),K=C("FileList"),j=C("URLSearchParams"),[Y,W,V,J]=["ReadableStream","Request","Response","Headers"].map(C);function q(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),B(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,z=e=>!U(e)&&e!==Q;const ee=(te="undefined"!=typeof Uint8Array&&T(Uint8Array),e=>te&&e instanceof te);var te;const ne=C("HTMLFormElement"),re=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),oe=C("RegExp"),ie=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};q(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const se=C("AsyncFunction"),ae=(ce="function"==typeof setImmediate,ue=D(Q.postMessage),ce?setImmediate:ue?(le=`axios@${Math.random()}`,fe=[],Q.addEventListener("message",({source:e,data:t})=>{e===Q&&t===le&&fe.length&&fe.shift()()},!1),e=>{fe.push(e),Q.postMessage(le,"*")}):e=>setTimeout(e));var ce,ue,le,fe;const de="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Q):"undefined"!=typeof process&&process.nextTick||ae,he={isArray:B,isArrayBuffer:k,isBuffer:M,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||D(e.append)&&("formdata"===(t=I(e))||"object"===t&&D(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&k(e.buffer),t},isString:x,isNumber:P,isBoolean:e=>!0===e||!1===e,isObject:G,isPlainObject:F,isEmptyObject:e=>{if(!G(e)||M(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Y,isRequest:W,isResponse:V,isHeaders:J,isUndefined:U,isDate:_,isFile:H,isBlob:X,isRegExp:oe,isFunction:D,isStream:e=>G(e)&&D(e.pipe),isURLSearchParams:j,isTypedArray:ee,isFileList:K,forEach:q,merge:function e(){const{caseless:t,skipUndefined:n}=z(this)&&this||{},r={},o=(o,i)=>{const s=t&&Z(r,i)||i;F(r[s])&&F(o)?r[s]=e(r[s],o):F(o)?r[s]=e({},o):B(o)?r[s]=o.slice():n&&U(o)||(r[s]=o)};for(let e=0,t=arguments.length;e(q(t,(t,r)=>{n&&D(t)?e[r]=O(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&T(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:I,kindOfTest:C,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(B(e))return e;let t=e.length;if(!P(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[R]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ne,hasOwnProperty:re,hasOwnProp:re,reduceDescriptors:ie,freezeMethods:e=>{ie(e,(t,n)=>{if(D(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];D(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return B(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Z,global:Q,isContextDefined:z,isSpecCompliantForm:function(e){return!!(e&&D(e.append)&&"FormData"===e[b]&&e[R])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(G(e)){if(t.indexOf(e)>=0)return;if(M(e))return e;if(!("toJSON"in e)){t[r]=e;const o=B(e)?[]:{};return q(e,(e,t)=>{const i=n(e,r+1);!U(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:se,isThenable:e=>e&&(G(e)||D(e))&&D(e.then)&&D(e.catch),setImmediate:ae,asap:de,isIterable:e=>null!=e&&D(e[R])};function pe(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}he.inherits(pe,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:he.toJSONObject(this.config),code:this.code,status:this.status}}});const Ee=pe.prototype,Ae={};["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(e=>{Ae[e]={value:e}}),Object.defineProperties(pe,Ae),Object.defineProperty(Ee,"isAxiosError",{value:!0}),pe.from=(e,t,n,r,o,i)=>{const s=Object.create(Ee);he.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return pe.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const ge=pe;var we=n(8287).hp;function ye(e){return he.isPlainObject(e)||he.isArray(e)}function me(e){return he.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(e,t){return e=me(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Oe=he.toFlatObject(he,{},null,function(e){return/^is[A-Z]/.test(e)});const Ne=function(e,t,n){if(!he.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=he.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!he.isUndefined(t[e])})).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&he.isSpecCompliantForm(t);if(!he.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(he.isDate(e))return e.toISOString();if(he.isBoolean(e))return e.toString();if(!a&&he.isBlob(e))throw new ge("Blob is not supported. Use a Buffer instead.");return he.isArrayBuffer(e)||he.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):we.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(he.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(he.isArray(e)&&function(e){return he.isArray(e)&&!e.some(ye)}(e)||(he.isFileList(e)||he.endsWith(n,"[]"))&&(a=he.toArray(e)))return n=me(n),a.forEach(function(e,r){!he.isUndefined(e)&&null!==e&&t.append(!0===s?Se([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!ye(e)||(t.append(Se(o,n,i),c(e)),!1)}const l=[],f=Object.assign(Oe,{defaultVisitor:u,convertValue:c,isVisitable:ye});if(!he.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!he.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),he.forEach(n,function(n,i){!0===(!(he.isUndefined(n)||null===n)&&o.call(t,n,he.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])}),l.pop()}}(e),t};function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Re(e,t){this._pairs=[],e&&Ne(e,this,t)}const be=Re.prototype;be.append=function(e,t){this._pairs.push([e,t])},be.toString=function(e){const t=e?function(t){return e.call(this,t,Te)}:Te;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Ie=Re;function ve(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ce(e,t,n){if(!t)return e;const r=n&&n.encode||ve;he.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):he.isURLSearchParams(t)?t.toString():new Ie(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Le=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){he.forEach(this.handlers,function(t){null!==t&&e(t)})}},Be={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Me="undefined"!=typeof window&&"undefined"!=typeof document,ke="object"==typeof navigator&&navigator||void 0,xe=Me&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),De="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Pe=Me&&window.location.href||"http://localhost",Ge={...e,...Ue};const Fe=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&he.isArray(r)?r.length:i,a)return he.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&he.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&he.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r{t(function(e){return he.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null};const _e={transitional:Be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=he.isObject(e);o&&he.isHTMLForm(e)&&(e=new FormData(e));if(he.isFormData(e))return r?JSON.stringify(Fe(e)):e;if(he.isArrayBuffer(e)||he.isBuffer(e)||he.isStream(e)||he.isFile(e)||he.isBlob(e)||he.isReadableStream(e))return e;if(he.isArrayBufferView(e))return e.buffer;if(he.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ne(e,new Ge.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ge.isNode&&he.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=he.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ne(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(he.isString(e))try{return(t||JSON.parse)(e),he.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_e.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(he.isResponse(e)||he.isReadableStream(e))return e;if(e&&he.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw ge.from(e,ge.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:Ge.classes.FormData,Blob:Ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch"],e=>{_e.headers[e]={}});const He=_e,Xe=he.toObjectSet(["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"]),Ke=Symbol("internals");function je(e){return e&&String(e).trim().toLowerCase()}function Ye(e){return!1===e||null==e?e:he.isArray(e)?e.map(Ye):String(e)}function We(e,t,n,r,o){return he.isFunction(r)?r.call(this,t,n):(o&&(t=n),he.isString(t)?he.isString(r)?-1!==t.indexOf(r):he.isRegExp(r)?r.test(t):void 0:void 0)}class Ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=je(t);if(!o)throw new Error("header name must be a non-empty string");const i=he.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ye(e))}const i=(e,t)=>he.forEach(e,(e,n)=>o(e,n,t));if(he.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(he.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Xe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(he.isObject(e)&&he.isIterable(e)){let n,r,o={};for(const t of e){if(!he.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?he.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=je(e)){const n=he.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(he.isFunction(t))return t.call(this,e,n);if(he.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=je(e)){const n=he.findKey(this,e);return!(!n||void 0===this[n]||t&&!We(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=je(e)){const o=he.findKey(n,e);!o||t&&!We(0,n[o],o,t)||(delete n[o],r=!0)}}return he.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!We(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return he.forEach(this,(r,o)=>{const i=he.findKey(n,o);if(i)return t[i]=Ye(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ye(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return he.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&he.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Ke]=this[Ke]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=je(e);t[r]||(!function(e,t){const n=he.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return he.isArray(e)?e.forEach(r):r(e),this}}Ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),he.reduceDescriptors(Ve.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),he.freezeMethods(Ve);const Je=Ve;function qe(e,t){const n=this||He,r=t||n,o=Je.from(r.headers);let i=r.data;return he.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function $e(e){return!(!e||!e.__CANCEL__)}function Ze(e,t,n){ge.call(this,null==e?"canceled":e,ge.ERR_CANCELED,t,n),this.name="CanceledError"}he.inherits(Ze,ge,{__CANCEL__:!0});const Qe=Ze;function ze(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ge("Request failed with status code "+n.status,[ge.ERR_BAD_REQUEST,ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const et=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]},nt=(e,t,n=3)=>{let r=0;const o=et(50,250);return tt(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},rt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ot=e=>(...t)=>he.asap(()=>e(...t)),it=Ge.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ge.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ge.origin),Ge.navigator&&/(msie|trident)/i.test(Ge.navigator.userAgent)):()=>!0,st=Ge.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];he.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),he.isString(r)&&a.push(`path=${r}`),he.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),he.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function at(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ct=e=>e instanceof Je?{...e}:e;function ut(e,t){t=t||{};const n={};function r(e,t,n,r){return he.isPlainObject(e)&&he.isPlainObject(t)?he.merge.call({caseless:r},e,t):he.isPlainObject(t)?he.merge({},t):he.isArray(t)?t.slice():t}function o(e,t,n,o){return he.isUndefined(t)?he.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!he.isUndefined(t))return r(void 0,t)}function s(e,t){return he.isUndefined(t)?he.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(ct(e),ct(t),0,!0)};return he.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);he.isUndefined(s)&&i!==a||(n[r]=s)}),n}const lt=e=>{const t=ut({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Je.from(s),t.url=Ce(at(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),he.isFormData(n))if(Ge.hasStandardBrowserEnv||Ge.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(he.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(Ge.hasStandardBrowserEnv&&(r&&he.isFunction(r)&&(r=r(t)),r||!1!==r&&it(t.url))){const e=o&&i&&st.read(i);e&&s.set(o,e)}return t},ft="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=lt(e);let o=r.data;const i=Je.from(r.headers).normalize();let s,a,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let E=new XMLHttpRequest;function A(){if(!E)return;const r=Je.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders());ze(function(e){t(e),p()},function(e){n(e),p()},{data:f&&"text"!==f&&"json"!==f?E.response:E.responseText,status:E.status,statusText:E.statusText,headers:r,config:e,request:E}),E=null}E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout,"onloadend"in E?E.onloadend=A:E.onreadystatechange=function(){E&&4===E.readyState&&(0!==E.status||E.responseURL&&0===E.responseURL.indexOf("file:"))&&setTimeout(A)},E.onabort=function(){E&&(n(new ge("Request aborted",ge.ECONNABORTED,e,E)),E=null)},E.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new ge(r,ge.ERR_NETWORK,e,E);o.event=t||null,n(o),E=null},E.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Be;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ge(t,o.clarifyTimeoutError?ge.ETIMEDOUT:ge.ECONNABORTED,e,E)),E=null},void 0===o&&i.setContentType(null),"setRequestHeader"in E&&he.forEach(i.toJSON(),function(e,t){E.setRequestHeader(t,e)}),he.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),f&&"json"!==f&&(E.responseType=r.responseType),h&&([c,l]=nt(h,!0),E.addEventListener("progress",c)),d&&E.upload&&([a,u]=nt(d),E.upload.addEventListener("progress",a),E.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{E&&(n(!t||t.type?new Qe(null,e,E):t),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===Ge.protocols.indexOf(g)?n(new ge("Unsupported protocol "+g+":",ge.ERR_BAD_REQUEST,e)):E.send(o||null)})},dt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof ge?t:new Qe(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new ge(`timeout ${t} of ms exceeded`,ge.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>he.asap(s),a}},ht=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of pt(e))yield*ht(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:At}=he,gt=(({Request:e,Response:t})=>({Request:e,Response:t}))(he.global),{ReadableStream:wt,TextEncoder:yt}=he.global,mt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},St=e=>{e=he.merge.call({skipUndefined:!0},gt,e);const{fetch:t,Request:n,Response:r}=e,o=t?At(t):"function"==typeof fetch,i=At(n),s=At(r);if(!o)return!1;const a=o&&At(wt),c=o&&("function"==typeof yt?(u=new yt,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&mt(()=>{let e=!1;const t=new n(Ge.origin,{body:new wt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=s&&a&&mt(()=>he.isReadableStream(new r("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ge(`Response type '${e}' is not supported`,ge.ERR_NOT_SUPPORT,n)})});const h=async(e,t)=>{const r=he.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(he.isBlob(e))return e.size;if(he.isSpecCompliantForm(e)){const t=new n(Ge.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return he.isArrayBufferView(e)||he.isArrayBuffer(e)?e.byteLength:(he.isURLSearchParams(e)&&(e+=""),he.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:p,onDownloadProgress:E,onUploadProgress:A,responseType:g,headers:w,withCredentials:y="same-origin",fetchOptions:m}=lt(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let O=dt([c,u&&u.toAbortSignal()],p),N=null;const T=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let R;try{if(A&&l&&"get"!==s&&"head"!==s&&0!==(R=await h(w,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(he.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=rt(R,nt(ot(A)));a=Et(t.body,65536,e,n)}}he.isString(y)||(y=y?"include":"omit");const t=i&&"credentials"in n.prototype,c={...m,signal:O,method:s.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?y:void 0};N=i&&new n(o,c);let u=await(i?S(N,m):S(o,c));const p=f&&("stream"===g||"response"===g);if(f&&(E||p&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=he.toFiniteNumber(u.headers.get("content-length")),[n,o]=E&&rt(t,nt(ot(E),!0))||[];u=new r(Et(u.body,65536,n,()=>{o&&o(),T&&T()}),e)}g=g||"text";let b=await d[he.findKey(d,g)||"text"](u,e);return!p&&T&&T(),await new Promise((t,n)=>{ze(t,n,{data:b,headers:Je.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:N})})}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ge("Network Error",ge.ERR_NETWORK,e,N),{cause:t.cause||t});throw ge.from(t,t&&t.code,e,N)}}},Ot=new Map,Nt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=Ot;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:St(t)),u=a;return a},Tt=(Nt(),{http:null,xhr:ft,fetch:{get:Nt}});he.forEach(Tt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Rt=e=>`- ${e}`,bt=e=>he.isFunction(e)||null===e||!1===e;const It={getAdapter:function(e,t){e=he.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(Rt).join("\n"):" "+Rt(e[0]):"as no adapter specified";throw new ge("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:Tt};function vt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qe(null,e)}function Ct(e){vt(e),e.headers=Je.from(e.headers),e.data=qe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return It.getAdapter(e.adapter||He.adapter,e)(e).then(function(t){return vt(e),t.data=qe.call(e,e.transformResponse,t),t.headers=Je.from(t.headers),t},function(t){return $e(t)||(vt(e),t&&t.response&&(t.response.data=qe.call(e,e.transformResponse,t.response),t.response.headers=Je.from(t.response.headers))),Promise.reject(t)})}const Lt="1.13.2",Bt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Bt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ut={};Bt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Lt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new ge(r(o," has been removed"+(t?" in "+t:"")),ge.ERR_DEPRECATED);return t&&!Ut[o]&&(Ut[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Bt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Mt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ge("options must be an object",ge.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new ge("option "+i+" must be "+n,ge.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ge("Unknown option "+i,ge.ERR_BAD_OPTION)}},validators:Bt},kt=Mt.validators;class xt{constructor(e){this.defaults=e||{},this.interceptors={request:new Le,response:new Le}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ut(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Mt.assertOptions(n,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),null!=r&&(he.isFunction(r)?t.paramsSerializer={serialize:r}:Mt.assertOptions(r,{encode:kt.function,serialize:kt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Mt.assertOptions(t,{baseUrl:kt.spelling("baseURL"),withXsrfToken:kt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&he.merge(o.common,o[t.method]);o&&he.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Je.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!a){const e=[Ct.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new Qe(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;const t=new Pt(function(t){e=t});return{token:t,cancel:e}}}const Gt=Pt;const Ft={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ft).forEach(([e,t])=>{Ft[t]=e});const _t=Ft;const Ht=function e(t){const n=new Dt(t),r=O(Dt.prototype.request,n);return he.extend(r,Dt.prototype,n,{allOwnKeys:!0}),he.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ut(t,n))},r}(He);Ht.Axios=Dt,Ht.CanceledError=Qe,Ht.CancelToken=Gt,Ht.isCancel=$e,Ht.VERSION=Lt,Ht.toFormData=Ne,Ht.AxiosError=ge,Ht.Cancel=Ht.CanceledError,Ht.all=function(e){return Promise.all(e)},Ht.spread=function(e){return function(t){return e.apply(null,t)}},Ht.isAxiosError=function(e){return he.isObject(e)&&!0===e.isAxiosError},Ht.mergeConfig=ut,Ht.AxiosHeaders=Je,Ht.formToJSON=e=>Fe(he.isHTMLForm(e)?new FormData(e):e),Ht.getAdapter=It.getAdapter,Ht.HttpStatusCode=_t,Ht.default=Ht;const Xt=Ht,Kt="auth0_sub",jt="mng-entitlements",Yt="__MNG_Session",Wt="regwallUserIsSubscribed";var Vt=function(){var e=window.location.href;return new URL(e)},Jt=function(e){for(var t="".concat(e,"="),n=decodeURIComponent(document.cookie).split(";"),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=Vt().hostname;if(e&&"string"==typeof e&&e.length>0&&(t=e,e.includes("vipdev.lndo.site")))return"".concat(e.split(".")[0],".com");var n=t.split(".");return"".concat(n[n.length-2],".").concat(n[n.length-1])},$t=function(){var e=qt();return".".concat(e)},Zt=function(e,t,n){var r="".concat(e,"=").concat(t,";");void 0!==n?(a.log("Setting cookie with options: ",n),Object.entries(n).forEach(function(e){var t=u(e,2),n=t[0],o=t[1];if("expires"===n){var i=new Date;i.setTime(i.getTime()+24*o*60*60*1e3),r+="expires=".concat(i.toUTCString(),";")}else r+="".concat(n,"=").concat(o,";")})):r+="path=/;",document.cookie=r},Qt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="".concat(e,"= ;expires= Thu, 01 Jan 1970 00:00:00 GMT;"),o=qt(),i=[o,"www".concat(o),".www".concat(o)];n&&i.push(n),Object.entries(t).forEach(function(e){var t=u(e,2),n=t[0],o=t[1];r+="".concat(n,"=").concat(o,";")}),0===Object.keys(t).length&&(r+="path=/;"),document.cookie=r,i.forEach(function(e){document.cookie=r.concat("domain=",e,";")})},zt=function(){return Vt().host.replace(/^(?:www\.|develop\.|staging\.|preprod\.)/,"").replace("vipdev.lndo.site","com")},en=function(e){return function(e,t){if("string"!=typeof e)throw new l("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new l(`Invalid token specified: missing part #${n+1}`);let o;try{o=f(r)}catch(e){throw new l(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new l(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(e)},tn=function(){return"complete"===document.readyState},nn=function(){return new Promise(function(e){if(("interactive"===document.readyState||tn())&&window.dataLayer)a.log("Utils digisubsDataLayerLoaded: ","Document is in interactive state, resolving."),e();else{a.log("Utils digisubsDataLayerLoaded: ","Waiting for the dataLayer to load...");var t=setInterval(r(o.mark(function n(){return o.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:window.dataLayer&&window.dataLayer.length>2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},rn=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,nn();case 1:if(a.log("Utils getDataLayerObject: looking for this dataLayer object ",t),window.dataLayer=window.dataLayer||[],n="",a.log("Utils getDataLayerObject: here is dataLayer length ",window.dataLayer.length),r=function(e){return a.log("Utils dataLayerLoop: look for this element ",e),e[t]?(a.log("Utils dataLayerLoop: found ",e[t]),n=e[t],e[t]):(a.log("Utils dataLayerLoop: dataLayer search ",!1),!1)},!window.dataLayer.some(r)){e.next=2;break}return e.abrupt("return",n);case 2:return e.abrupt("return",!1);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),on=function(){var e=r(o.mark(function e(){var t,n,r=arguments;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Page Type",e.next=1,rn(t);case 1:return n=e.sent,a.log("utils | pageType: page type is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),sn=function(){return new Promise(function(e,t){void 0!==window.MNGAuthentication&&void 0!==window.MNGAuthentication.authenticationReady?(a.log("utils | Authentication already ready: ",window.MNGAuthentication.authenticationReady),e(window.MNGAuthentication.authenticationReady)):(a.log("utils | Adding authenticationReady listener..."),window.addEventListener("authenticationReady",function(n){try{var r=n.detail||{};a.log("utils | Event: authentication ready: ",r),e(r)}catch(e){a.log(e),t(e)}},!1))})},an=function(){a.log("Clearing entitlements...");try{Qt(jt,{path:"/"})}catch(e){a.log("Failed to delete legacy cookie: ",e)}try{Qt(jt,{path:"/",domain:qt(),expires:365,secure:!0})}catch(e){a.log("Failed to delete entitlements cookie: ",e)}try{window.localStorage.removeItem(Yt)}catch(e){a.log("Failed to remove local storage: ",e)}},cn=function(e){a.log("starting simpleEmailValidation");if(!e)return{valid:!1,message:"Please enter an email."};if(!/^(([^<>()[\]\\.,;:\s@']+(\.[^<>()[\]\\.,;:\s@']+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(e))return{valid:!1,message:"Please enter a valid email."};var t=e.match(/\.([^.\n\s]*)$/)[1].toUpperCase(),n=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIDS","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"].includes(t);return a.log("simpleEmailValidation: ","TLD search ".concat(n)),!1===n?{valid:!1,message:"Please enter a valid email domain."}:-1===["zzz.pl"].findIndex(function(t){return t===e.split("@")[1]})?{valid:!0,message:"Valid"}:{valid:!1,message:"Please enter a valid email."}};window.simpleEmailValidation=cn;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var un=function(e){s.A.datadogEnabled&&window.DD_RUM.addTiming(e)};var ln=function(){try{var e=localStorage.getItem(Yt);return"string"==typeof e?e:"{}"}catch(e){a.log("Unable to get session from local storage: ",e)}return"{}"},fn=function(e){try{a.log("Setting local storage session",e),localStorage.setItem(Yt,e)}catch(e){a.log("Unable to save session from local storage: ",e)}},dn=function(e){try{Zt(jt,e,{path:"/",domain:$t(),expires:365,secure:!0})}catch(e){a.log("Unable to save session to cookie storage: ",e)}},hn=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w,y,m,S;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.A.sessionServer,n="".concat(t,"/api/session"),a.log("Checking server session: ",n),e.next=1,Xt.get(n,{withCredentials:!0});case 1:if(!(r=e.sent).data){e.next=2;break}return d=r.data.entitlementTokenDecoded,h=r.data,p=h.accessToken,E=h.idToken,A=h.entitlementToken,g=null!==(i=null==d?void 0:d.entitlement_expiry)&&void 0!==i?i:null,w=null!==(c=null==d?void 0:d.entitlement_source)&&void 0!==c?c:null,y=null!==(u=null==d?void 0:d.entitlement_entitled)&&void 0!==u?u:null,m=null!==(l=null==d?void 0:d.entitlement_extras_adfree)&&void 0!==l?l:null,S=null!==(f=null==d?void 0:d.entitlement_level)&&void 0!==f?f:null,fn(JSON.stringify({accessToken:p,idToken:E,entitlementToken:A,expiration:g,entitlementSource:w,isEntitled:y,adFree:m,entitlementLevel:S})),""!==A&&"string"==typeof A&&dn(A),e.abrupt("return",{accessToken:p,idToken:E,entitlementToken:A,expiration:g,entitlementSource:w,isEntitled:y,adFree:m,entitlementLevel:S});case 2:return e.abrupt("return",{accessToken:null,idToken:null,entitlementToken:null,expiration:null,entitlementSource:null,isEntitled:null,adFree:null,entitlementLevel:null});case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),pn=function(){var e=r(o.mark(function e(t){var n,r,i;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=s.A.sessionServer,r="".concat(n,"/api/session"),a.log("Updating server session: ",r),e.next=1,Xt.post(r,t,{withCredentials:!0});case 1:e.next=3;break;case 2:e.prev=2,i=e.catch(0),a.log("Failed to update session server: ",i);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),En=function(){var e=r(o.mark(function e(){var t,n,r,i,s,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,N,T,R,b,I,v,C,L;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("Inside getSession"),e.prev=1,f=ln(),a.log("Session: __MNG_Session = ",f),d=JSON.parse(f),h=d.accessToken,p=d.idToken,E=d.entitlementToken,A=d.expiration,g=d.entitlementSource,w=d.isEntitled,y=d.adFree,m=d.entitlementLevel,n=h,t=p,r=E,i=A,s=g,c=w,u=y,l=m,a.log("Session: check both tokens: ",t,r),void 0!==p&&void 0!==E&&null!==p&&null!==E){e.next=3;break}return a.log("Session: missing id or entitlements, try session server"),e.next=2,hn();case 2:S=e.sent,O=S.accessToken,N=S.idToken,T=S.entitlementToken,R=S.expiration,b=S.entitlementSource,I=S.isEntitled,v=S.adFree,C=S.entitlementLevel,n=O,t=N,r=T,i=R,s=b,c=I,u=v,l=C;case 3:e.next=5;break;case 4:e.prev=4,L=e.catch(1),a.log("Failed to get session: ",L);case 5:return a.log("Returning session: ",t,n,r),e.abrupt("return",{accessToken:n,idToken:t,entitlementToken:r,expiration:i,entitlementSource:s,isEntitled:c,adFree:u,entitlementLevel:l});case 6:case"end":return e.stop()}},e,null,[[1,4]])}));return function(){return e.apply(this,arguments)}}(),An=function(){var e=r(o.mark(function e(t){var n,r,i,s,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,N,T,R,b,I,v,C,L,B,U;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=ln(),r=JSON.parse(n),i=r.accessToken,s=void 0===i?null:i,c=r.idToken,u=void 0===c?null:c,l=r.entitlementToken,f=void 0===l?null:l,d=r.expiration,h=void 0===d?null:d,p=r.entitlementSource,E=void 0===p?null:p,A=r.isEntitled,g=void 0===A?null:A,w=r.adFree,y=void 0===w?null:w,m=r.entitlementLevel,S=void 0===m?null:m,O=t.accessToken,N=t.idToken,T=t.entitlementToken,R=t.expiration,b=t.entitlementSource,I=t.isEntitled,v=t.adFree,C=t.entitlementLevel,L={accessToken:null==O?s:O,idToken:null==N?u:N,entitlementToken:null==T?f:T,expiration:null==R?h:R,entitlementSource:null==b?E:b,isEntitled:null==I?g:I,adFree:null==v?y:v,entitlementLevel:null==C?S:C},a.log("Current session data: ",r),a.log("New session data: ",t),a.log("Updated session data:",L),B=JSON.stringify(L),fn(B),""!==L.entitlementToken&&"string"==typeof L.entitlementToken&&dn(L.entitlementToken),n===B){e.next=1;break}return e.next=1,pn(L);case 1:e.next=3;break;case 2:e.prev=2,U=e.catch(0),a.log("Unable to save session: ",U);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),gn=function(){var e=window.localStorage.getItem(Yt);return JSON.parse(e)},wn=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,En();case 1:return t=e.sent,e.abrupt("return",t);case 2:return n=gn(),e.abrupt("return",n);case 3:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),yn=function(e){Zt(jt,e,{path:"/",domain:$t(),expires:365,secure:!0})},mn=function(){var e=r(o.mark(function e(t){var n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,yn(t),a.log("About to decode token before saving: ",t),n=en(t),!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,An({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level});case 1:e.next=3;break;case 2:window.localStorage.setItem(Yt,JSON.stringify({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level}));case 3:e.next=5;break;case 4:e.prev=4,r=e.catch(0),a.log("Entitlements: Failed to save token: ",r);case 5:case"end":return e.stop()}},e,null,[[0,4]])}));return function(t){return e.apply(this,arguments)}}(),Sn=function(){var e=r(o.mark(function e(t){var n,r,i,c,u,l,f,d,h,p,E,A,g,w;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!window.authentication_config.sessionManagementEnabled){e.next=2;break}return e.next=1,En();case 1:"string"==typeof(r=e.sent).idToken&&""!==r.idToken&&(i=en(r.idToken),n=void 0!==i&&i.email_verified),e.next=4;break;case 2:return e.next=3,sn();case 3:c=e.sent,(u=c.idToken)&&""!==u&&(n=en(u).email_verified);case 4:if(a.log("Entitlements: refresh JWT start..."),t){e.next=5;break}return e.abrupt("return",new Error("No token to refresh"));case 5:return a.log("Entitlements refresh: entitlement token: ",t),a.log("Entitlements refresh: auth0 verified: ",n),l={jwt:t,verified:n},f="".concat(s.A.entitlementsEndpoint,"session/refresh"),e.prev=6,e.next=7,$.ajax({type:"POST",url:f,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":s.A.entitlementsApiKey},data:JSON.stringify(l)});case 7:if("boolean"!=typeof(d=e.sent).success){e.next=10;break}if(!d.success){e.next=8;break}h=null===(p=d.data)||void 0===p?void 0:p.jwt,e.next=9;break;case 8:throw E=d.error||{},A=E.message||E.error||"Entitlements API returned an unknown error",new Error("API error: ".concat(A));case 9:e.next=11;break;case 10:h=d.jwt;case 11:return a.log("Entitlements: Request successful: ",h),e.next=12,mn(h);case 12:return e.abrupt("return",h);case 13:if(e.prev=13,g=e.catch(6),a.error("Entitlements: Create Token Failure: ",g),an(),!window.authentication_config.sessionManagementEnabled){e.next=17;break}return e.prev=14,e.next=15,An({entitlementToken:null});case 15:e.next=17;break;case 16:e.prev=16,w=e.catch(14),a.error("Entitlements: Save Session Failure during error handling: ",w);case 17:throw new Error("Entitlements Refresh failure");case 18:case"end":return e.stop()}},e,null,[[6,13],[14,16]])}));return function(t){return e.apply(this,arguments)}}(),On=function(){var e=r(o.mark(function e(t){var n,r,c,u,l,f,d,h,p,E;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a.log("Entitlements: create token start..."),a.log("Entitlements: createToken payload with ",t),"object"===i(t)||"string"==typeof t.sub){e.next=1;break}throw new Error("No user info to create token");case 1:if(n=window.location.hostname,r=qt(n),t.sub&&(c=t.sub),t.idToken&&(u=t.idToken),u||c){e.next=2;break}throw new Error("No idToken or uuid provided.");case 2:return l={publication:r.replace("vipdev.lndo.site","com"),requestSource:"website"},u?l.idToken=u:c&&(l.uuid=c),f="".concat(s.A.entitlementsEndpoint,"session/create"),a.log("Entitlements: create payload",l),e.prev=3,e.next=4,$.ajax({type:"POST",url:f,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":s.A.entitlementsApiKey},data:JSON.stringify(l)});case 4:if("boolean"!=typeof(d=e.sent).success){e.next=6;break}if(d.success){e.next=5;break}return e.abrupt("return",new Error("Entitlements | API returned no JWT"));case 5:h=d.data.jwt,a.log("Entitlements: Token Created: ",h),e.next=7;break;case 6:h=d.jwt;case 7:return e.next=8,mn(h);case 8:return e.abrupt("return",h);case 9:if(e.prev=9,p=e.catch(3),a.log("Entitlements: Create Token Failure: ",p),an(),!window.authentication_config.sessionManagementEnabled){e.next=13;break}return e.prev=10,e.next=11,An({entitlementToken:null});case 11:e.next=13;break;case 12:e.prev=12,E=e.catch(10),a.error("Entitlements: Save Session Failure during error handling: ",E);case 13:throw new Error("Entitlements Refresh failure");case 14:case"end":return e.stop()}},e,null,[[3,9],[10,12]])}));return function(t){return e.apply(this,arguments)}}(),Nn=function(){var e=r(o.mark(function e(){var t,n,r;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,wn();case 1:if((t=e.sent)&&t.entitlementToken){e.next=2;break}return e.abrupt("return",!1);case 2:if(!((n=Date.now()/1e3) ").concat(t.expiration)),e.abrupt("return",Sn(t.entitlementToken));case 4:return e.prev=4,r=e.catch(0),a.log("Entitlements: Local Storage: Error processing token: ",r.message),e.abrupt("return",!1);case 5:case"end":return e.stop()}},e,null,[[0,4]])}));return function(){return e.apply(this,arguments)}}(),Tn=function(){var e=r(o.mark(function e(){var t,n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=Jt(jt)){e.next=1;break}return e.abrupt("return",!1);case 1:return a.log("checkCookiesForToken, Refreshing token, ".concat(t)),e.next=2,Sn(t);case 2:return e.abrupt("return",e.sent);case 3:return e.prev=3,n=e.catch(0),a.log("Entitlements: Cookie: Error processing token: ",n.message),e.abrupt("return",!1);case 4:case"end":return e.stop()}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}(),Rn=function(e){a.log("Attempting to broadcast entitlements ready...",e);try{var t={token:e};if(e){a.log("About to decode token before broadcasting: ",e);var n=en(e);!function(e){var t=Jt("mng-jwt-decoded");t&&t===e||Zt("mng-jwt-decoded",JSON.stringify(e),{path:"/",domain:$t(),expires:365,secure:!0})}(n),t=Object.assign(t,{isEntitled:n.entitlement_entitled,adfree:n.entitlement_extras_adfree||!1,subscriptionLevel:n.entitlement_level})}var r=new CustomEvent("entitlementsReady",{detail:t});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=t,a.log("Dispatching entitlementsReady Event: ",r),window.dispatchEvent(r),a.log("Dispatched entitlementsReady event"),un("entitlementsReady")}catch(e){var o={token:""};o=Object.assign(o,{isEntitled:"unknown",adfree:"unknown",subscriptionLevel:"unknown"});var i=new CustomEvent("entitlementsReady",{detail:o});window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.entitlementsReady=o,a.log("Dispatching entitlementsReady EMPTY Event: ",i),window.dispatchEvent(i),a.log("Dispatched entitlementsReady EMPTY event"),a.log("Error: ",e)}},bn=function(){var e=r(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=1,On({idToken:t});case 1:e.next=3;break;case 2:e.prev=2,n=e.catch(0),a.log("Entitlements error during oidc login callback: ",n);case 3:case"end":return e.stop()}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),In=function(){void 0!==window.MNGAuthentication&&Array.isArray(window.MNGAuthentication.oidcLoginCallbacks)&&window.MNGAuthentication.oidcLoginCallbacks.push(bn)},vn=function(e){var t=e.searchParams.get("entitlement_jwt");a.log("Webview JWT param provided: ",t),yn(t);var n=en(t);window.localStorage.setItem(Yt,JSON.stringify({entitlementToken:t,expiration:n.entitlement_expiry,entitlementSource:n.entitlement_source,isEntitled:n.entitlement_entitled,adFree:n.entitlement_extras_adfree||!1,entitlementLevel:n.entitlement_level}))},Cn=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=window.localStorage.getItem(Wt),n=Jt(Kt),r=Vt(),i=zt(),!(c=Jt("clearEntCache"))&&!r.searchParams.has("newUser")){e.next=6;break}return u="".concat(s.A.entitlementsEndpoint,"session/create"),e.next=1,sn();case 1:return l=e.sent,f={uuid:l.claims.auth0Id,publication:i},e.prev=2,e.next=3,$.ajax({type:"DELETE",url:u,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Api-Key":s.A.entitlementsApiKey},data:JSON.stringify(f)});case 3:e.sent&&(a.log("loggedOutNewSubscriberActions","Entitlements: Cache cleared"),Qt("clearEntCache")),e.next=5;break;case 4:e.prev=4,g=e.catch(2),a.log("loggedOutNewSubscriberActions","Entitlements: Cache clear Failure - ".concat(g.message));case 5:e.next=7;break;case 6:a.log("loggedOutNewSubscriberActions","There is no clearEntCache cookie");case 7:if(a.log("loggedOutNewSubscriberActions","Checking if this is a new regwall subscriber"),!(c||"false"===t&&r.searchParams.has("newUser")&&n)){e.next=10;break}return d=!1,h={sub:n,email_verified:!0},e.next=8,On(h);case 8:if((p=e.sent)&&""!==p&&(E=en(p),A=E.entitlement_entitled,d=A),a.log("loggedOutNewSubscriberActions","New regwall user is entitled: ".concat(d)),!d){e.next=9;break}return window.localStorage.setItem(Wt,"true"),window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",!0);case 9:case 10:return e.abrupt("return",!1);case 11:return e.prev=11,w=e.catch(0),a.log("loggedOutNewSubscriberActions error",w),e.abrupt("return",!1);case 12:case"end":return e.stop()}},e,null,[[0,11],[2,4]])}));return function(){return e.apply(this,arguments)}}();window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.isUserAdFree=function(){var e=JSON.parse(window.localStorage.getItem(Yt));return null!=e?(a.log("Ad Free Check: : ",e.adFree),e.idToken&&e.adFree||s.A.isAdfreeArticle):s.A.isAdfreeArticle},window.MNGAuthentication.isUserSubscriber=function(){var e=JSON.parse(window.localStorage.getItem(Yt));return null!=e&&(a.log("Subscriber Check: : ",e.isEntitled),e.isEntitled)};var Ln=function(){var e=r(o.mark(function e(){var t,n,r,i,c,u,l,f,d,h,p,E,A,g,w,y,m,S,O,N;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!s.A.entitlementsEnabled){e.next=39;break}return e.next=1,Cn();case 1:if(!e.sent){e.next=2;break}return e.abrupt("return",Rn(!1));case 2:return t=window.location,n=new URL(t.href),e.next=3,sn();case 3:if(r=e.sent,i=r.idToken,c=r.accessToken,u=r.isAuthenticated,l=r.claims,In(),e.prev=4,!n.searchParams.has("newUser")){e.next=8;break}if("string"!=typeof i||""===i){e.next=7;break}return e.next=5,On({idToken:i});case 5:if(!(f=e.sent)){e.next=6;break}return a.log("Entitlements Init: Created new token for new subscriber"),e.abrupt("return",Rn(f));case 6:e.next=8;break;case 7:a.log("New subscription, no idToken.");case 8:e.next=10;break;case 9:e.prev=9,e.catch(4),a.log("Not a new subscriber.");case 10:try{n.searchParams.has("entitlement_jwt")&&vn(n)}catch(e){a.log("Error during webview JWT retrieval: ",e)}return e.prev=11,e.next=12,Nn();case 12:if(!((d=e.sent)instanceof Error)){e.next=13;break}throw d;case 13:d&&(f=d,a.log("Entitlements Init: Local Storage Token exists")),e.next=15;break;case 14:e.prev=14,y=e.catch(11),a.log("Error during Local Storage Token check: ",y);case 15:if(e.prev=15,f){e.next=18;break}return e.next=16,Tn();case 16:if(!((h=e.sent)instanceof Error)){e.next=17;break}throw h;case 17:h&&(f=h,a.log("Entitlements Init: Cookie Token exists"));case 18:e.next=20;break;case 19:e.prev=19,m=e.catch(15),a.log("Error during Cookie Token check: ",m);case 20:if(!u&&f&&(a.log("Entitled-only flow: User is not authenticated but entitlement token exists."),en(f).entitlement_entitled?(a.log("PageSuite flow: User is not authenticated but is subscriber. Access token is ".concat(c)),c?MNGAuthentication.login():a.log("PageSuite flow: No Access token.")):a.log("Entitled-only flow: User is not entitled.")),u){e.next=21;break}return a.log("User is not logged in, skipping entitlement flow."),e.abrupt("return",Rn(!1));case 21:if(!s.A.bcLowaSegements||u!==s.A.USER_IS_LOWA||f){e.next=25;break}return e.prev=22,a.log("About to check entitlements based on BC"),p={sub:l.sub},e.next=23,On(p);case 23:f=e.sent,!window.authentication_config.sessionManagementEnabled&&s.A.serverEntitlements&&f&&(a.log("Entitlements fetched, about to reload to refresh entitlement cookie for server."),window.location.reload()),e.next=25;break;case 24:e.prev=24,S=e.catch(22),a.log("BC sub segment check failed: ",S);case 25:if(e.prev=25,!f){e.next=31;break}if(!s.A.linaCheckOnArticles){e.next=30;break}if(E=en(f),A=E.entitlement_entitled,g=E.iat,a.log("LINA check: isEntitled: ".concat(A,", token created at: ").concat(g)),!(s.A.linaCheckOnArticles&&!A&&Date.now()/1e3-new Date(g)>45)){e.next=30;break}if(a.log("Checking entitlements again for LINA user."),""===i){e.next=29;break}return e.next=26,On({idToken:i});case 26:if(!(w=e.sent)){e.next=28;break}return a.log("Entitlements Init: Created new token for LINA user"),e.next=27,on();case 27:return"article"===e.sent&&window.ConnextUtils.rerunConnextEntitlements(),e.abrupt("return",Rn(w));case 28:e.next=30;break;case 29:a.log("LINA check, no idToken.");case 30:return e.abrupt("return",Rn(f));case 31:e.next=33;break;case 32:e.prev=32,O=e.catch(25),a.log("LINA check error: ",O);case 33:if(e.prev=33,"string"!=typeof i||""===i){e.next=36;break}return e.next=34,On({idToken:i});case 34:if(!(f=e.sent)){e.next=35;break}return a.log("Entitlements Init: Created new token"),e.abrupt("return",Rn(f));case 35:e.next=37;break;case 36:a.log("No OIDC ID Token. Not creating a new entitlements token.");case 37:e.next=39;break;case 38:e.prev=38,N=e.catch(33),a.log("Unable to create token during initialize: ",N);case 39:return e.abrupt("return",Rn(!1));case 40:case"end":return e.stop()}},e,null,[[4,9],[11,14],[15,19],[22,24],[25,32],[33,38]])}));return function(){return e.apply(this,arguments)}}();const Bn={init:Ln};(function(){var e=r(o.mark(function e(){return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,Bn.init();case 1:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}})()()})()})(); //# sourceMappingURL=mng-digisubs.entitlements.bundle.js.map;