(function(){({initialize:function(){this.initializeHsslCheck()},debug:function(){let i=!1;return typeof DFM_AD_MODS_DEBUG<"u"&&(i=!0),i},checkForBangPremiumOffer:function(){let i,e,o=window.blueConicClient.profile.getProfile();this.debug()&&console.log("DEBUG: blueconic profile = "+o);let l=["bang_accept_premium_offer","bang_accept_premium_offer_date"];this.debug()&&console.log("DEBUG: blueconic premium offer properties = "+l),o.loadValues(l,this,function(){if(i=o.getValue("bang_accept_premium_offer"),e=o.getValue("bang_accept_premium_offer_date"),i==="yes"&&e.length>0){const n=new Date(e),s=new Date,c=7200*60*1e3;s-n>c===!1?localStorage.setItem("hhsl","access"):localStorage.removeItem("hhsl")}})},initializeHsslCheck:function(){this.debug()&&console.log("DEBUG: initializeHsslCheck success");let i=!1,e=this,t;typeof DFM_AD_MODS_LEVEL<"u"&&(t=parseInt(DFM_AD_MODS_LEVEL[0])),this.debug()&&console.log("DEBUG: hhslFromOptions "+t),document.addEventListener("onLoginSuccess",function(o){i=!0,e.debug()&&console.log("DEBUG: onLoginSuccess is true")}),typeof window.blueConicClient<"u"&&typeof window.blueConicClient.event<"u"&&typeof window.blueConicClient.event.subscribe<"u"?(e.debug()&&console.log("DEBUG: blueconic detected and not undefined; running checkForBangPremiumOffer"),e.checkForBangPremiumOffer()):(e.debug()&&console.log("DEBUG: blueconic not loaded, adding event listener"),window.addEventListener("onBlueConicLoaded",function(){e.checkForBangPremiumOffer()},!1)),document.addEventListener("onHasAccess",function(o){e.debug()&&console.log("DEBUG: onHasAccess event listener hit");let l=[];typeof t<"u"&&l.push(t),e.debug()&&console.log("DEBUG: hhsl level is "+l);let n,s=o.detail.MG2AccountData.DigitalAccess.Subscription.HouseHoldSubscriptionLevel;e.debug()&&console.log("DEBUG: hhsl level is "+s),typeof s<"u"&&l.includes(s)?n=!0:n=!1,e.debug()&&console.log("DEBUG: hhslAccess "+n),n===!0?(localStorage.setItem("hhsl","access"),e.debug()&&console.log("DEBUG: setting localStorage item for hhsl")):(localStorage.removeItem("hhsl"),e.debug()&&console.log("DEBUG: removing localStorage item for hhsl")),i&&n===!0&&window.location.reload()})}}).initialize()})(); ; let domainToNumberMap={"dailypress.com":"197837618","courant.com":"197837617","mcall.com":"197837616","orlandosentinel.com":"197837614","sun-sentinel.com":"197837613","pilotonline.com":"197837701","bostonherald.com":"239876507","advocate-news.com":"239876509","chicoer.com":"239876509","dailydemocrat.com":"239876509","marinij.com":"239876509","mendocinobeacon.com":"239876509","montereyherald.com":"239876509","orovillemr.com":"239876509","paradisepost.com":"239876509","record-bee.com":"239876509","redbluffdailynews.com":"239876509","santacruzsentinel.com":"239876509","thereporter.com":"239876509","timesheraldonline.com":"239876509","times-standard.com":"239876509","ukiahdailyjournal.com":"239876509","willitsnews.com":"239876509","morningjournal.com":"239876511","news-herald.com":"239876511","dailylocal.com":"239876512","delcotimes.com":"239876512","mainlinemedianews.com":"239876512","pottsmerc.com":"239876512","readingeagle.com":"239876512","thereporteronline.com":"239876512","timesherald.com":"239876512","trentonian.com":"239876512","twincities.com":"239876515","denverpost.com":"239876503","lowellsun.com":"239876505","nashobavalleyvoice.com":"239876505","sentinelandenterprise.com":"239876505","dailytribune.com":"239876508","macombdaily.com":"239876508","pressandguide.com":"239876508","themorningsun.com":"239876508","thenewsherald.com":"239876508","theoaklandpress.com":"239876508","voicenews.com":"239876508","dailyfreeman.com":"239876510","oneidadispatch.com":"239876510","saratogian.com":"239876510","troyrecord.com":"239876510","eastbaytimes.com":"239876506","mercurynews.com":"239876506","siliconvalley.com":"239876506","coloradohometownweekly.com":"239876513","dailycamera.com":"239876513","timescall.com":"239876513","bocopreps.com":"239876513","broomfieldenterprise.com":"239876513","buffzone.com":"239876513","canoncitydailyrecord.com":"239876513","eptrail.com":"239876513","lamarledger.com":"239876513","reporterherald.com":"239876513","akronnewsreporter.com":"239876513","brushnewstribune.com":"239876513","julesburgadvocate.com":"239876513","fortmorgantimes.com":"239876513","burlington-record.com":"239876513","southplattesentinel.com":"239876513","journal-advocate.com":"239876513","greeleytribune.com":"239876513","dailybreeze.com":"239876514","dailybulletin.com":"239876514","nydailynews.com":"197837700","excelsiorcalifornia.com":"239876514","ocregister.com":"239876514","pasadenastarnews.com":"239876514","pressenterprise.com":"239876514","presstelegram.com":"239876514","redlandsdailyfacts.com":"239876514","sbsun.com":"239876514","sgvtribune.com":"239876514","whittierdailynews.com":"239876514","dailynews.com":"239876514","baltimoresun.com":"197837615","capitalgazette.com":"197837619","chicagotribune.com":"197837611","sandiegouniontribune.com":"239876514","republicanherald.com":"239876516","standardspeaker.com":"239876516","citizensvoice.com":"239876516","thetimes-tribune.com":"239876516","wcexaminer.com":"239876516","petalumanews.com":"239876517","pressdemocrat.com":"239876517","sonomanews.com":"239876517"};let currentDomain=window.location.hostname.toLowerCase().replace(/^(www\.|preprod\.|staging\.|develop\.)/,'');let TRIB_DOMAINS=['mcall.com','courant.com','sun-sentinel.com','orlandosentinel.com','growthspotter.com','dailypress.com','pilotonline.com','nydailynews.com','baltimoresun.com','capitalgazette.com','chicagotribune.com'];const isTrib=TRIB_DOMAINS.includes(currentDomain);let gtmId=isTrib?"ma89701":"ma23578";let matherId=domainToNumberMap[currentDomain]||null;(function(cid,mkt,config,domain){var ml=document.createElement('script');var s=document.getElementsByTagName('script')[0]||document.head;var cb;try{if(!(cb=localStorage._matherVer)){throw false;}}catch(e){cb=Math.round(new Date()/1.0368e9);}ml.type='text/javascript';ml.async=true;ml.defer=true;ml.id='_mljs';ml.src=('https:'==window.location.protocol?'https':'http')+'://'+(domain||'js.matheranalytics.com/s')+'/'+cid+'/'+mkt+'/'+(config?config+'/': '')+'ml.js?cb='+cb;s.parentNode.insertBefore(ml,s);})(gtmId,matherId,'wp'); ; /*! For license information please see mng-digisubs.sophi.bundle.js.LICENSE.txt */ (()=>{var e={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;ia)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|y(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(q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(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=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):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(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 f(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 y(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 J(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:J(e).length;t=(""+t).toLowerCase(),o=!0}}function w(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 C(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(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 m(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,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 T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(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<=_)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=y,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),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 A(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return v(this,e,t,n);case"base64":return b(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(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 _=4096;function N(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 k(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 D(e,t,n,r,o){F(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 U(e,t,n,r,o){F(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 x(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 B(e,t,n,r,i){return t=+t,n>>>=0,i||x(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||x(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||L(e,t,this.length);let r=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,n||L(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||L(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(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||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Z(function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(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||K(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||L(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||L(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||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||L(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||L(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||L(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||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Z(function(e){W(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||K(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||K(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||L(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(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){k(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){k(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||k(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||k(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||k(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||k(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||k(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=Z(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=Z(function(e,t=0){return U(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);k(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);k(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||k(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||k(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||k(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||k(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||k(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=Z(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=Z(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return B(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 F(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 H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||K(t,e.length-(n+1))}(r,o,i)}function W(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,n){if(Math.floor(e)!==e)throw W(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("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=j(String(n)):"bigint"==typeof n&&(o=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(o=j(o)),o+="n"),r+=` It must be ${t}. Received ${o}`,r},RangeError);const X=/[^+/0-9A-Za-z-_]/g;function J(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(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(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 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 Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},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,f=n?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-l)-1,h>>=-l,l+=s;l>0;i=256*i+e[t+d],d+=f,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-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,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,y=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?f/c:f*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+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*y}},5172(e){e.exports=function(e,t){this.v=e,this.k=t},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,f={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,f.n=n,u}};function h(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]<=h&&((o=e<2&&hr||r>p)&&(i[4]=e,i[5]=r,f.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&&h(l,p),a=l,s=p;(n=a<2?t:s)||!d;){i||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.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=f.n<0)?s:e.call(r,f))!==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 f(){}n=Object.getPrototypeOf;var h=[][a]?n(n([][a]())):(r(n={},a,function(){return this}),n),p=f.prototype=l.prototype=Object.create(h);function y(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return d.prototype=f,r(p,"constructor",f),r(f,"constructor",d),d.displayName="GeneratorFunction",r(f,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:y}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,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},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},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},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 f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"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:f,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,o){return(f(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},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},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},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)}},3612(e,t,n){"use strict";var r,o,i,a,s;n.d(t,{A:()=>c}),window.authentication_config.sessionManagementEnabled="1"===window.authentication_config.sessionManagement;const c={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,enableReaderDashboardv2:!!window.authentication_config&&"1"===window.authentication_config.enableReaderDashboardv2,enableDashboardCancel:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardCancel,enableDashboardBenefitHub:!!window.authentication_config&&"1"===window.authentication_config.enableDashboardBenefitHub,enableEngageArticleGifting:"1"===(null===(r=window.authentication_config)||void 0===r?void 0:r.articleSharingEnabled)&&"1"===(null===(o=window.authentication_config)||void 0===o?void 0:o.isEngageArticleSharing),enableGiftedArticlesLink:"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.articleSharingEnabled)&&"1"!==(null===(a=window.authentication_config)||void 0===a?void 0:a.isEngageArticleSharing),enableSavedArticlesLink:"1"===(null===(s=window.authentication_config)||void 0===s?void 0:s.articleSavingEnabled),prosperstackClientid:window.authentication_config?window.authentication_config.prosperstackClientid:"",enableUpgradeSubscription:!!window.authentication_config&&"1"===window.authentication_config.enableUpgradeSubscription,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,updatePaymentEnabled:!!window.authentication_config&&"1"===window.authentication_config.enableUpdatePayment}}},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)})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 a(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function s(e,t){for(var n=0;nqi,hasStandardBrowserEnv:()=>$i,hasStandardBrowserWebWorkerEnv:()=>Zi,navigator:()=>zi,origin:()=>Qi});var l=n(4756);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&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 m(this,void 0,void 0,function(){return E(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 m(this,void 0,void 0,function(){var n,r,o,i;return E(this,function(a){switch(a.label){case 0:return n=void 0===this.storageHandler?b:this.storageHandler,r=v+"-"+t,null===(o=n.getItemSync(r))?[2]:(i=JSON.parse(o)).id!==this.id?[3,2]:[4,S.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(r),S.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],i=0;;){var a=r.keySync(i);if(null===a)break;o.push(a),i++}for(var s=!1,c=0;c(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;_=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;ae=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw z("The input to be decoded is not correctly encoded.",Y,e)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let e=0;e0)return;if(t){if(0!==e)throw z("".concat(n," must be a non-negative number"),Y,o);return}throw z("".concat(n," must be a positive number"),Y,o)}catch(e){if(r)throw de(e.message,r,o);throw e}}function ge(e,t,n,r){try{if("string"!=typeof e)throw z("".concat(t," must be a string"),q,r);if(0===e.length)throw z("".concat(t," must not be empty"),Y,r)}catch(e){if(n)throw de(e.message,n,r);throw e}}function me(e){!function(e,t){if(Ke(e)!==t)throw function(e){let t='"response" content-type must be ';for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2){const e=r.pop();"".concat(r.join(", "),", or ").concat(e)}else 2===r.length?"".concat(r[0]," or ").concat(r[1]):r[0];return de(t,dt,e)}(e,t)}(e,"application/json")}function Ee(){return ce(crypto.getRandomValues(new Uint8Array(32)))}function Ae(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new ue("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"RSASSA-PKCS1-v1_5":return function(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new ue("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}(e);case"ECDSA":return function(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new ue("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new ue("unsupported CryptoKey algorithm name",{cause:e})}}function Se(e){const t=null==e?void 0:e[Z];return"number"==typeof t&&Number.isFinite(t)?t:0}function ve(e){const t=null==e?void 0:e[Q];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function be(){return Math.floor(Date.now()/1e3)}function Re(e){if("object"!=typeof e||null===e)throw z('"as" must be an object',q);ge(e.issuer,'"as.issuer"')}function Te(e){if("object"!=typeof e||null===e)throw z('"client" must be an object',q);ge(e.client_id,'"client.client_id"')}function Oe(e){return ge(e,'"clientSecret"'),(t,n,r,o)=>{r.set("client_id",n.client_id),r.set("client_secret",e)}}function _e(e,t){const{key:n,kid:r}=e instanceof CryptoKey?{key:o}:(null==o?void 0:o.key)instanceof CryptoKey?(void 0!==o.kid&&ge(o.kid,'"kid"'),{key:o.key,kid:o.kid}):{};var o;return function(e,t){if(function(e,t){if(!(e instanceof CryptoKey))throw z("".concat(t," must be a CryptoKey"),q)}(e,t),"private"!==e.type)throw z("".concat(t," must be a private CryptoKey"),Y)}(n,'"clientPrivateKey.key"'),async(e,o,i,a)=>{var s;const c={alg:Ae(n),kid:r},u=function(e,t){const n=be()+Se(t);return{jti:Ee(),aud:e.issuer,exp:n+60,iat:n,nbf:n,iss:t.client_id,sub:t.client_id}}(e,o);null==t||null===t[te]||void 0===s||s.call(t,c,u),i.set("client_id",o.client_id),i.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),i.set("client_assertion",await async function(e,t,n){if(!n.usages.includes("sign"))throw z('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Y);const r="".concat(ce(ie(JSON.stringify(e))),".").concat(ce(ie(JSON.stringify(t)))),o=ce(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:vt(e)};case"RSA-PSS":switch(St(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new ue("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return St(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new ue("unsupported CryptoKey algorithm name",{cause:e})}(n),n,ie(r)));return"".concat(r,".").concat(o)}(c,u,n))}}const Ne=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch(e){return null}};function Ie(e,t){if(t&&"https:"!==e.protocol)throw de("only requests to HTTPS are allowed",ht,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw de("only HTTP and HTTPS requests are allowed",pt,e)}function Ce(e,t,n,r){let o;if("string"!=typeof e||!Ne(e))throw de("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),void 0===e?mt:Et,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Ie(o,r),o}function Pe(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Ce(e.mtls_endpoint_aliases[t],t,n,r):Ce(e[t],t,n,r)}class Le extends Error{constructor(e,t){var n;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"error",void 0),H(this,"status",void 0),H(this,"error_description",void 0),H(this,"response",void 0),this.name=this.constructor.name,this.code=at,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}class ke extends Error{constructor(e,t){var n,r;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"error",void 0),H(this,"error_description",void 0),this.name=this.constructor.name,this.code=ct,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=null!==t.cause.get("error_description")&&void 0!==n?n:void 0,null===Error.captureStackTrace||void 0===r||r.call(Error,this,this.constructor)}}class De extends Error{constructor(e,t){var n;super(e,t),H(this,"cause",void 0),H(this,"code",void 0),H(this,"response",void 0),H(this,"status",void 0),this.name=this.constructor.name,this.code=it,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}const Ue="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",xe="("+Ue+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',Be="("+Ue+")\\s*=\\s*("+Ue+")",Me=new RegExp("^[,\\s]*("+Ue+")"),He=new RegExp("^[,\\s]*"+xe+"[,\\s]*(.*)"),Ge=new RegExp("^[,\\s]*"+Be+"[,\\s]*(.*)"),je=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Fe(e,t,n){if(e.status!==t){let t;var r;if(function(e){let t;if(function(e){if(!V(e,Response))throw z('"response" must be an instance of Response',q);const t=e.headers.get("www-authenticate");if(null===t)return;const n=[];let r=t;for(;r;){var o;let t=r.match(Me);const i=null===t||void 0===o?void 0:o[1].toLowerCase();if(!i)return;const a=r.substring(t[0].length);if(a&&!a.match(/^[\s,]/))return;const s=a.match(/^\s+(.*)$/),c=!!s;s?s[1]:void 0;const u={};let l;if(c)for(;r;){let n,o;if(r.match(He)){if([,n,o,r]=t,o.includes("\\"))try{JSON.parse('"'.concat(o,'"'))}catch(e){}u[n.toLowerCase()]=o}else{if(!r.match(Ge)){if(r.match(je)){if(Object.keys(u).length)break;[,l,r]=t;break}return}[,n,o,r]=t,u[n.toLowerCase()]=o}}else 0;const d={scheme:i,parameters:u};l&&(d.token68=l),n.push(d)}return n.length?n:void 0}(e))throw new De("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}(e),await async function(e){if(e.status>399&&e.status<500){At(e),me(e);try{const t=await e.clone().json();if(fe(t)&&"string"==typeof t.error&&t.error.length)return t}catch(e){}}}(e))throw await(null===e.body||void 0===r?void 0:r.cancel()),new Le("server responded with an error in the response body",{cause:t,response:e});throw de('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),ft,e)}}function We(e){if(!Qe.has(e))throw z('"options.DPoP" is not a valid DPoPHandle',Y)}function Ke(e){var t;return null===e.headers.get("content-type")||void 0===t?void 0:t.split(";")[0]}async function Xe(e,t,n,r,o,i,a){return await n(e,t,o,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((null==a?void 0:a[ee])||fetch)(r.href,{body:o,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:pe(r,null==a?void 0:a.signal)})}async function Je(e,t,n,r,o,i){var a;const s=Pe(e,"token_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==i?void 0:i[$]));o.set("grant_type",r);const c=he(null==i?void 0:i.headers);c.set("accept","application/json"),void 0!==(null==i?void 0:i.DPoP)&&(We(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Xe(e,t,n,s,o,c,i);return null==i||null===i.DPoP||void 0===a||a.cacheNonce(u,s),u}const Ve=new WeakMap,Ye=new WeakMap;function qe(e){if(!e.id_token)return;const t=Ve.get(e);if(!t)throw z('"ref" was already garbage collected or did not resolve from the proper sources',Y);return t}async function ze(e,t,n,r,o,i){if(Re(e),Te(t),!V(n,Response))throw z('"response" must be an instance of Response',q);await Fe(n,200,"Token Endpoint"),At(n);const a=await _t(n);if(ge(a.access_token,'"response" body "access_token" property',lt,{body:a}),ge(a.token_type,'"response" body "token_type" property',lt,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;we(e,!0,'"response" body "expires_in" property',lt,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&ge(a.refresh_token,'"response" body "refresh_token" property',lt,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw de('"response" body "scope" property must be a string',lt,{body:a});if(void 0!==a.id_token){ge(a.id_token,'"response" body "id_token" property',lt,{body:a});const i=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&i.push("auth_time"),void 0!==t.default_max_age&&(we(t.default_max_age,!0,'"client.default_max_age"'),i.push("auth_time")),null!=r&&r.length&&i.push(...r);const{claims:s,jwt:c}=await async function(e,t,n,r,o){let i,a,{0:s,1:c,length:u}=e.split(".");if(5===u){if(void 0===o)throw new ue("JWE decryption is not configured",{cause:e});await o(e),({0:s,1:c,length:u}=e.split("."))}if(3!==u)throw de("Invalid JWT",lt,e);try{JSON.parse(ie(ce(s)))}catch(e){throw de("failed to parse JWT Header body as base64url encoded JSON",ut,e)}if(!fe(i))throw de("JWT Header must be a top level object",lt,e);if(t(i),void 0!==i.crit)throw new ue('no JWT "crit" header parameter extensions are supported',{cause:{header:i}});try{JSON.parse(ie(ce(c)))}catch(e){throw de("failed to parse JWT Payload body as base64url encoded JSON",ut,e)}if(!fe(a))throw de("JWT Payload must be a top level object",lt,e);const l=be()+n;if(void 0!==a.exp){if("number"!=typeof a.exp)throw de('unexpected JWT "exp" (expiration time) claim type',lt,{claims:a});if(a.exp<=l-r)throw de('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',yt,{claims:a,now:l,tolerance:r,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw de('unexpected JWT "iat" (issued at) claim type',lt,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw de('unexpected JWT "iss" (issuer) claim type',lt,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw de('unexpected JWT "nbf" (not before) claim type',lt,{claims:a});if(a.nbf>l+r)throw de('unexpected JWT "nbf" (not before) claim value',yt,{claims:a,now:l,tolerance:r,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw de('unexpected JWT "aud" (audience) claim type',lt,{claims:a});return{header:i,claims:a,jwt:e}}(a.id_token,bt.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),Se(t),ve(t),o).then(nt.bind(void 0,i)).then(Ze.bind(void 0,e)).then($e.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw de('ID Token "aud" (audience) claim includes additional untrusted audiences',wt,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw de('unexpected ID Token "azp" (authorized party) claim value',wt,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&we(s.auth_time,!0,'ID Token "auth_time" (authentication time)',lt,{claims:s}),Ye.set(n,c),Ve.set(a,s)}if(void 0!==(null==i?void 0:i[a.token_type]))i[a.token_type](n,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new ue("unsupported `token_type` value",{cause:{body:a}});return a}function $e(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw de('unexpected JWT "aud" (audience) claim value',wt,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw de('unexpected JWT "aud" (audience) claim value',wt,{expected:e,claims:t.claims,claim:"aud"});return t}function Ze(e,t){var n,r;const o=null!==(null===e[It]||void 0===r?void 0:r.call(e,t))&&void 0!==n?n:e.issuer;if(t.claims.iss!==o)throw de('unexpected JWT "iss" (issuer) claim value',wt,{expected:o,claims:t.claims,claim:"iss"});return t}const Qe=new WeakSet,et=Symbol(),tt={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function nt(e,t){for(const n of e)if(void 0===t.claims[n])throw de('JWT "'.concat(n,'" (').concat(tt[n],") claim missing"),lt,{claims:t.claims});return t}const rt=Symbol(),ot=Symbol();const it="OAUTH_WWW_AUTHENTICATE_CHALLENGE",at="OAUTH_RESPONSE_BODY_ERROR",st="OAUTH_UNSUPPORTED_OPERATION",ct="OAUTH_AUTHORIZATION_RESPONSE_ERROR",ut="OAUTH_PARSE_ERROR",lt="OAUTH_INVALID_RESPONSE",dt="OAUTH_RESPONSE_IS_NOT_JSON",ft="OAUTH_RESPONSE_IS_NOT_CONFORM",ht="OAUTH_HTTP_REQUEST_FORBIDDEN",pt="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",yt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",wt="OAUTH_JWT_CLAIM_COMPARISON_FAILED",gt="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",mt="OAUTH_MISSING_SERVER_METADATA",Et="OAUTH_INVALID_SERVER_METADATA";function At(e){if(e.bodyUsed)throw z('"response" body has been used already',Y)}function St(e){const{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new ue("unsupported ".concat(t.name," modulusLength"),{cause:e})}function vt(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new ue("unsupported ECDSA namedCurve",{cause:e})}}function bt(e,t,n,r){if(void 0===e)if(Array.isArray(t)){if(!t.includes(r.alg))throw de('unexpected JWT "alg" header parameter',lt,{header:r,expected:t,reason:"authorization server metadata"})}else{if(void 0===n)throw de('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if("string"==typeof n?r.alg!==n:"function"==typeof n?!n(r.alg):!n.includes(r.alg))throw de('unexpected JWT "alg" header parameter',lt,{header:r,expected:n,reason:"default value"})}else if("string"==typeof e?r.alg!==e:!e.includes(r.alg))throw de('unexpected JWT "alg" header parameter',lt,{header:r,expected:e,reason:"client configuration"})}function Rt(e,t){const{0:n,length:r}=e.getAll(t);if(r>1)throw de('"'.concat(t,'" parameter must be provided only once'),lt);return n}const Tt=Symbol(),Ot=Symbol();async function _t(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me;try{await e.json()}catch(t){throw n(e),de('failed to parse "response" body as JSON',ut,t)}if(!fe(t))throw de('"response" body must be a top level object',lt,{body:t});return t}const Nt=Symbol(),It=Symbol(),Ct=new TextEncoder,Pt=new TextDecoder;function Lt(e){const t=new Uint8Array(e.length);for(let n=0;n127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=r}return t}function kt(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:"algorithm.name"," must be ").concat(e))},xt=(e,t)=>e.name===t;function Bt(e,t){var n;if(e.hash,parseInt(n.name.slice(4),10)!==t)throw Ut("SHA-".concat(t),"algorithm.hash")}function Mt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o2){const t=r.pop();e+="one of type ".concat(r.join(", "),", or ").concat(t,".")}else 2===r.length?e+="one of type ".concat(r[0]," or ").concat(r[1],"."):e+="of type ".concat(r[0],".");if(null==t)e+=" Received ".concat(t);else if("function"==typeof t&&t.name)e+=" Received function ".concat(t.name);else if("object"==typeof t&&null!=t){var i;null!==(i=t.constructor)&&void 0!==i&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const Ht=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),H(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),H(this,"claim",void 0),H(this,"reason",void 0),H(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}H(jt,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Ft extends Gt{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"unspecified",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unspecified";super(e,{cause:{claim:n,reason:r,payload:t}}),H(this,"code","ERR_JWT_EXPIRED"),H(this,"claim",void 0),H(this,"reason",void 0),H(this,"payload",void 0),this.claim=n,this.reason=r,this.payload=t}}H(Ft,"code","ERR_JWT_EXPIRED");class Wt extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}H(Wt,"code","ERR_JOSE_ALG_NOT_ALLOWED");class Kt extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JOSE_NOT_SUPPORTED")}}H(Kt,"code","ERR_JOSE_NOT_SUPPORTED"),H(class extends Gt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED"),H(class extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Xt extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JWS_INVALID")}}H(Xt,"code","ERR_JWS_INVALID");class Jt extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JWT_INVALID")}}H(Jt,"code","ERR_JWT_INVALID"),H(class extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Vt extends Gt{constructor(){super(...arguments),H(this,"code","ERR_JWKS_INVALID")}}H(Vt,"code","ERR_JWKS_INVALID");class Yt extends Gt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}H(Yt,"code","ERR_JWKS_NO_MATCHING_KEY");class qt extends Gt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),H(this,Symbol.asyncIterator,void 0),H(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}H(qt,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class zt extends Gt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWKS_TIMEOUT")}}H(zt,"code","ERR_JWKS_TIMEOUT");class $t extends Gt{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),H(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}H($t,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Zt=e=>{if("CryptoKey"===(null==e?void 0:e[Symbol.toStringTag]))return!0;try{return e instanceof CryptoKey}catch(e){return!1}},Qt=e=>"KeyObject"===(null==e?void 0:e[Symbol.toStringTag]),en=e=>Zt(e)||Qt(e);function tn(e,t,n){try{return Dt(e)}catch(e){throw new n("Failed to base64url decode the ".concat(t))}}function nn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const rn=e=>nn(e)&&"string"==typeof e.kty;async function on(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r3&&void 0!==arguments[3]&&arguments[3];un||(un=new WeakMap);let o=un.get(e);if(null!=o&&o[n])return o[n];const i=await sn(j(j({},t),{},{alg:n}));return r&&Object.freeze(e),o?o[n]=i:un.set(e,{[n]:i}),i};const dn=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n{const t=e.data[e.pos++];if(128&t){const n=127&t;let r=0;for(let t=0;t{if(e.data[e.pos++]!==t)throw new Error(n)},pn=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},yn=(e,t,n)=>{var r;const o=(e=>kt(e.replace(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g,"")))(e);let i=n;return null!=t&&null!==(r=t.startsWith)&&void 0!==r&&r.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=e=>{const t={data:e,pos:0};return function(e){hn(e,48,"Invalid PKCS#8 structure"),fn(e),hn(e,2,"Expected version field");const t=fn(e);e.pos+=t,hn(e,48,"Expected algorithm identifier");fn(e);e.pos}(t),(e=>{const t=(e=>{hn(e,6,"Expected algorithm OID");const t=fn(e);return pn(e,t)})(e);if(dn(t,[43,101,110]))return"X25519";if(!dn(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");hn(e,6,"Expected curve OID");const n=fn(e),r=pn(e,n);for(const{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(dn(r,t))return e;throw new Error("Unsupported named curve")})(t)}),(async(e,t,n,r)=>{var o;let i,a;const s="spki"===e,c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const e=r.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new Kt("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new Kt('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,null!==(o=null==r?void 0:r.extractable)&&void 0!==o?o:!!s,a)})("pkcs8",o,t,i)},wn=e=>null==e?void 0:e[Symbol.toStringTag],gn=(e,t,n)=>{if(void 0!==t.use){let e;switch(n){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(e,'" when present'))}if(void 0!==t.alg&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var r,o;let i;switch(!0){case"sign"===n||"verify"===n:case"dir"===e:case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===n?"wrapKey":"unwrapKey":n;break;case"encrypt"===n&&e.startsWith("RSA"):i="wrapKey";break;case"decrypt"===n:i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&!1===(null===(r=t.key_ops)||void 0===r||null===(o=r.includes)||void 0===o?void 0:o.call(r,i)))throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};var mn,En;let An,Sn;if("undefined"==typeof navigator||null===(mn=navigator.userAgent)||void 0===mn||null===(En=mn.startsWith)||void 0===En||!En.call(mn,"Mozilla/5.0 ")){const e="v6.8.3";Sn="".concat("openid-client","/").concat(e),An={"user-agent":Sn}}const vn=e=>bn.get(e);let bn,Rn;function Tn(e){return void 0!==e?Oe(e):(Rn||(Rn=new WeakMap),(e,t,n,r)=>{let o;return(o=Rn.get(t))||(function(e,t){if("string"!=typeof e)throw In("".concat(t," must be a string"),Nn);if(0===e.length)throw In("".concat(t," must not be empty"),_n)}(t.client_secret,'"metadata.client_secret"'),o=Oe(t.client_secret),Rn.set(t,o)),o(e,t,n,r)})}const On=ee,_n="ERR_INVALID_ARG_VALUE",Nn="ERR_INVALID_ARG_TYPE";function In(e,t,n){const r=new TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}class Cn extends Error{constructor(e,t){var n;super(e,t),H(this,"code",void 0),this.name=this.constructor.name,this.code=null==t?void 0:t.code,null===Error.captureStackTrace||void 0===n||n.call(Error,this,this.constructor)}}function Pn(e,t,n){return new Cn(e,{cause:t,code:n})}function Ln(e){if(e instanceof TypeError||e instanceof Cn||e instanceof Le||e instanceof ke||e instanceof De)throw e;if(e instanceof le)switch(e.code){case ht:throw Pn("only requests to HTTPS are allowed",e,e.code);case pt:throw Pn("only requests to HTTP or HTTPS are allowed",e,e.code);case ft:throw Pn("unexpected HTTP response status code",e.cause,e.code);case dt:throw Pn("unexpected response content-type",e.cause,e.code);case ut:throw Pn("parsing error occured",e,e.code);case lt:throw Pn("invalid response encountered",e,e.code);case wt:throw Pn("unexpected JWT claim value encountered",e,e.code);case gt:throw Pn("unexpected JSON attribute value encountered",e,e.code);case yt:throw Pn("JWT timestamp claim value failed validation",e,e.code);default:throw Pn(e.message,e,e.code)}if(e instanceof ue)throw Pn("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Pn("runtime operation error",e,st);case"NotSupportedError":throw Pn("runtime unsupported operation",e,st);case"TimeoutError":throw Pn("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Pn("operation aborted",e,"OAUTH_ABORT")}throw new Cn("something went wrong",{cause:e})}async function kn(e,t,n,r,o){const i=await async function(e,t){var n,r;if(!(e instanceof URL))throw In('"server" must be an instance of URL',Nn);const o=!e.href.includes("/.well-known/"),i=null!==(null==t?void 0:t.timeout)&&void 0!==n?n:30,a=AbortSignal.timeout(1e3*i),s=await(o?async function(e,t){return async function(e,t,n,r){if(!(e instanceof URL))throw z('"'.concat("issuerIdentifier",'" must be an instance of URL'),q);Ie(e,!0!==(null==r?void 0:r[$]));const o=n(new URL(e.href)),i=he(null==r?void 0:r.headers);return i.set("accept","application/json"),((null==r?void 0:r[ee])||fetch)(o.href,{body:void 0,headers:Object.fromEntries(i.entries()),method:"GET",redirect:"manual",signal:pe(o,null==r?void 0:r.signal)})}(e,0,e=>{switch(null==t?void 0:t.algorithm){case void 0:case"oidc":!function(e){e.pathname=ye("".concat(e.pathname,"/").concat(".well-known/openid-configuration"))}(e);break;case"oauth2":!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];"/"===e.pathname?e.pathname=t:e.pathname=ye("".concat(t,"/").concat(n?e.pathname:e.pathname.replace(/(\/)$/,"")))}(e,".well-known/oauth-authorization-server");break;default:throw z('"options.algorithm" must be "oidc" (default), or "oauth2"',Y)}return e},t)}(e,{algorithm:null==t?void 0:t.algorithm,[ee]:null==t?void 0:t[On],[$]:null==t||null===t.execute||void 0===r?void 0:r.includes(jn),signal:a,headers:new Headers(An)}):((null==t?void 0:t[On])||fetch)((Ie(e,null==t||null===t.execute||void 0===c||!c.includes(jn)),e.href),{headers:Object.fromEntries(new Headers(j({accept:"application/json"},An)).entries()),body:void 0,method:"GET",redirect:"manual",signal:a})).then(e=>async function(e,t){const n=e;if(!(n instanceof URL)&&n!==Nt)throw z('"expectedIssuerIdentifier" must be an instance of URL',q);if(!V(t,Response))throw z('"response" must be an instance of Response',q);if(200!==t.status)throw de('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',ft,t);At(t);const r=await _t(t);if(ge(r.issuer,'"response" body "issuer" property',lt,{body:r}),n!==Nt&&new URL(r.issuer).href!==n.href)throw de('"response" body "issuer" property does not match the expected value',gt,{expected:n.href,body:r,attribute:"issuer"});return r}(Nt,e)).catch(Ln);var c;return o&&new URL(s.issuer).href!==e.href&&(function(e,t,n){return!("https://login.microsoftonline.com"!==e.origin||null!=n&&n.algorithm&&"oidc"!==n.algorithm||(t[Dn]=!0,0))}(e,s,t)||function(e,t){return!(!e.hostname.endsWith(".b2clogin.com")||null!=t&&t.algorithm&&"oidc"!==t.algorithm)}(e,t)||(()=>{throw new Cn("discovered metadata issuer does not match the expected issuer",{code:gt,cause:{expected:e.href,body:s,attribute:"issuer"}})})()),s}(e,o),a=new Un(i,t,n,r);let s=vn(a);if(null!=o&&o[On]&&(s.fetch=o[On]),null!=o&&o.timeout&&(s.timeout=o.timeout),null!=o&&o.execute)for(const e of o.execute)e(a);return a}new TextDecoder;const Dn=Symbol();class Un{constructor(e,t,n,r){var o,i,a,s,c;if("string"!=typeof t||!t.length)throw In('"clientId" must be a non-empty string',Nn);if("string"==typeof n&&(n={client_secret:n}),void 0!==(null===(o=n)||void 0===o?void 0:o.client_id)&&t!==n.client_id)throw In('"clientId" and "metadata.client_id" must be the same',_n);const u=j(j({},structuredClone(n)),{},{client_id:t});let l;u[Z]=null!==(i=null===(a=n)||void 0===a?void 0:a[Z])&&void 0!==i?i:0,u[Q]=null!==(s=null===(c=n)||void 0===c?void 0:c[Q])&&void 0!==s?s:30,l=r||("string"==typeof u.client_secret&&u.client_secret.length?Tn(u.client_secret):(e,t,n,r)=>{n.set("client_id",t.client_id)});let d=Object.freeze(u);const f=structuredClone(e);Dn in e&&(f[It]=t=>{let{claims:{tid:n}}=t;return e.issuer.replace("{tenantid}",n)});let h=Object.freeze(f);bn||(bn=new WeakMap),bn.set(this,{__proto__:null,as:h,c:d,auth:l,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(vn(this).as);return function(e){Object.defineProperties(e,function(e){return{supportsPKCE:{__proto__:null,value(){var t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"S256";return!0===(null===(t=e.code_challenge_methods_supported)||void 0===t?void 0:t.includes(n))}}}}(e))}(e),e}clientMetadata(){return structuredClone(vn(this).c)}get timeout(){return vn(this).timeout}set timeout(e){vn(this).timeout=e}get[On](){return vn(this).fetch}set[On](e){vn(this).fetch=e}}function xn(e){Object.defineProperties(e,function(e){let t;if(void 0!==e.expires_in){const t=new Date;t.setSeconds(t.getSeconds()+e.expires_in),t.getTime()}return{expiresIn:{__proto__:null,value(){if(t){const e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return qe(this)}catch(e){return}}}}}(e))}async function Bn(e,t,n){var r;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=null===e.headers.get("retry-after")||void 0===r?void 0:r.trim();if(void 0===i)return;let a;if(/^\d+$/.test(i))parseInt(i,10);else{const e=new Date(i);if(Number.isFinite(e.getTime())){const t=new Date,n=e.getTime()-t.getTime();n>0&&Math.ceil(n/1e3)}}if(o&&!Number.isFinite(a))throw new le("invalid Retry-After header value",{cause:e});a>t&&await Mn(a-t,n)}function Mn(e,t){return new Promise((n,r)=>{const o=e=>{try{t.throwIfAborted()}catch(e){return void r(e)}if(e<=0)return void n();const i=Math.min(e,5);setTimeout(()=>o(e-i),1e3*i)};o(e)})}async function Hn(e,t){Vn(e);const{as:n,c:r,auth:o,fetch:i,tlsOnly:a,timeout:s}=vn(e);return async function(e,t,n,r,o){Re(e),Te(t);const i=Pe(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,!0!==(null==o?void 0:o[$])),a=new URLSearchParams(r);a.set("client_id",t.client_id);const s=he(null==o?void 0:o.headers);return s.set("accept","application/json"),Xe(e,t,n,i,a,s,o)}(n,r,o,t,{[ee]:i,[$]:!a,headers:new Headers(An),signal:Yn(s)}).then(e=>async function(e,t,n){if(Re(e),Te(t),!V(n,Response))throw z('"response" must be an instance of Response',q);await Fe(n,200,"Backchannel Authentication Endpoint"),At(n);const r=await _t(n);ge(r.auth_req_id,'"response" body "auth_req_id" property',lt,{body:r});let o="number"!=typeof r.expires_in?parseFloat(r.expires_in):r.expires_in;return we(o,!0,'"response" body "expires_in" property',lt,{body:r}),r.expires_in=o,void 0!==r.interval&&we(r.interval,!1,'"response" body "interval" property',lt,{body:r}),r}(n,r,e)).catch(Ln)}async function Gn(e,t,n,r){var o,i;Vn(e),new URLSearchParams(n);let a=null!==t.interval&&void 0!==o?o:5;const s=null!==(null==r?void 0:r.signal)&&void 0!==i?i:AbortSignal.timeout(1e3*t.expires_in);try{await Mn(a,s)}catch(e){Ln(e)}const{as:c,c:u,auth:l,fetch:d,tlsOnly:f,nonRepudiation:h,timeout:p,decrypt:y}=vn(e),w=(o,i)=>Gn(e,j(j({},t),{},{interval:o}),n,j(j({},r),{},{signal:s,flag:i})),g=await async function(e,t,n,r,o){Re(e),Te(t),ge(r,'"authReqId"');const i=new URLSearchParams(null==o?void 0:o.additionalParameters);return i.set("auth_req_id",r),Je(e,t,n,"urn:openid:params:grant-type:ciba",i,o)}(c,u,l,t.auth_req_id,{[ee]:d,[$]:!f,additionalParameters:n,DPoP:null==r?void 0:r.DPoP,headers:new Headers(An),signal:s.aborted?s:Yn(p)}).catch(Ln);var m;if(503===g.status&&g.headers.has("retry-after"))return await Bn(g,a,s,!0),await(null===g.body||void 0===m?void 0:m.cancel()),w(a);const E=async function(e,t,n,r){return ze(e,t,n,void 0,null==r?void 0:r[ne],null==r?void 0:r.recognizedTokenTypes)}(c,u,g,{[ne]:y});let A;try{await E}catch(e){if(qn(e,r))return w(a,zn);if(e instanceof Le)switch(e.error){case"slow_down":0;case"authorization_pending":return await Bn(e.response,a,s),w(a)}Ln(e)}return A.id_token&&await(null==h?void 0:h(g)),xn(A),A}function jn(e){vn(e).tlsOnly=!1}async function Fn(e,t,n,r,o){if(Vn(e),!((null==o?void 0:o.flag)===zn||t instanceof URL||function(e){try{return"Request"===Object.getPrototypeOf(e)[Symbol.toStringTag]}catch(e){return!1}}(t)))throw In('"currentUrl" must be an instance of URL, or Request',Nn);let i,a;const{as:s,c,auth:u,fetch:l,tlsOnly:d,jarm:f,hybrid:h,nonRepudiation:p,timeout:y,decrypt:w,implicit:g}=vn(e);if((null==o?void 0:o.flag)===zn)o.authResponse,o.redirectUri;else{if(!(t instanceof URL)){const e=t;switch(new URL(t.url),e.method){case"GET":break;case"POST":const n=new URLSearchParams(await async function(e){if("POST"!==e.method)throw z("form_post responses are expected to use the POST method",Y,{cause:e});if("application/x-www-form-urlencoded"!==Ke(e))throw z("form_post responses are expected to use the application/x-www-form-urlencoded content-type",Y,{cause:e});return async function(e){if(e.bodyUsed)throw z("form_post Request instances must contain a readable body",Y,{cause:e});return e.text()}(e)}(e));if(h)t.hash=n.toString();else for(const[e,r]of n.entries())t.searchParams.append(e,r);break;default:throw In("unexpected Request HTTP method",_n)}}switch(function(e){return new URL(e).search="",e.hash="",e.href}(t),!0){case!!f:await f(t,null==n?void 0:n.expectedState);break;case!!h:await h(t,null==n?void 0:n.expectedNonce,null==n?void 0:n.expectedState,null==n?void 0:n.maxAge);break;case!!g:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{(function(e,t,n,r){if(Re(e),Te(t),n instanceof URL&&n.searchParams,!(n instanceof URLSearchParams))throw z('"parameters" must be an instance of URLSearchParams, or URL',q);if(Rt(n,"response"))throw de('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',lt,{parameters:n});const o=Rt(n,"iss"),i=Rt(n,"state");if(!o&&e.authorization_response_iss_parameter_supported)throw de('response parameter "iss" (issuer) missing',lt,{parameters:n});if(o&&o!==e.issuer)throw de('unexpected "iss" (issuer) response parameter value',lt,{expected:e.issuer,parameters:n});switch(r){case void 0:case Ot:if(void 0!==i)throw de('unexpected "state" response parameter encountered',lt,{expected:void 0,parameters:n});break;case Tt:break;default:if(ge(r,'"expectedState" argument'),i!==r)throw de(void 0===i?'response parameter "state" missing':'unexpected "state" response parameter value',lt,{expected:r,parameters:n})}if(Rt(n,"error"))throw new ke("authorization response from the server is an error",{cause:n});const a=Rt(n,"id_token"),s=Rt(n,"token");if(void 0!==a||void 0!==s)throw new ue("implicit and hybrid flows are not supported");return new URLSearchParams(n),Qe.add(c),c;var c})(s,c,t.searchParams,null==n?void 0:n.expectedState)}catch(e){Ln(e)}}}const m=await async function(e,t,n,r,o,i,a){if(Re(e),Te(t),!Qe.has(r))throw z('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Y);ge(o,'"redirectUri"');const s=Rt(r,"code");if(!s)throw de('no authorization code in "callbackParameters"',lt);const c=new URLSearchParams(null==a?void 0:a.additionalParameters);return c.set("redirect_uri",o),c.set("code",s),i!==et&&(ge(i,'"codeVerifier"'),c.set("code_verifier",i)),Je(e,t,n,"authorization_code",c,a)}(s,c,u,i,a,(null==n?void 0:n.pkceCodeVerifier)||et,{additionalParameters:r,[ee]:l,[$]:!d,DPoP:null==o?void 0:o.DPoP,headers:new Headers(An),signal:Yn(y)}).catch(Ln);"string"!=typeof(null==n?void 0:n.expectedNonce)&&"number"!=typeof(null==n?void 0:n.maxAge)||(n.idTokenExpected=!0);const E=async function(e,t,n,r){return"string"==typeof(null==r?void 0:r.expectedNonce)||"number"==typeof(null==r?void 0:r.maxAge)||null!=r&&r.requireIdToken?async function(e,t,n,r,o,i,a){const s=[];switch(r){case void 0:0;break;case rt:break;default:ge(r,'"expectedNonce" argument'),s.push("nonce")}switch(null!=o||t.default_max_age,o){case void 0:0;break;case ot:break;default:we(o,!0,'"maxAge" argument'),s.push("auth_time")}const c=await ze(e,t,n,s,i,a);ge(c.id_token,'"response" body "id_token" property',lt,{body:c});const u=qe(c);if(o!==ot){const e=be()+Se(t),n=ve(t);if(u.auth_time+o{let n;return"urn:ietf:params:oauth:grant-type:token-exchange"===t&&{n_a:()=>{}},async function(e,t,n,r){return ze(e,t,n,void 0,null==r?void 0:r[ne],null==r?void 0:r.recognizedTokenTypes)}(o,i,e,{[ne]:l,recognizedTokenTypes:n})}).catch(Ln);return xn(d),d}async function Zn(e,t,n){if(!nn(e))throw new Xt("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Xt('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Xt("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Xt("JWS Payload missing");if("string"!=typeof e.signature)throw new Xt("JWS Signature missing or incorrect type");if(void 0!==e.header&&!nn(e.header))throw new Xt("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const t=Dt(e.protected);JSON.parse(Pt.decode(t))}catch(e){throw new Xt("JWS Protected Header is invalid")}if(!function(){for(var e=arguments.length,t=new Array(e),n=0;n"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let i;void 0!==n?new Map([...Object.entries(n),...t.entries()]):t;for(const t of r.crit){if(!i.has(t))throw new Kt('Extension Header Parameter "'.concat(t,'" is not recognized'));if(void 0===o[t])throw new e('Extension Header Parameter "'.concat(t,'" is missing'));if(i.get(t)&&void 0===r[t])throw new e('Extension Header Parameter "'.concat(t,'" MUST be integrity protected'))}return new Set(r.crit)}(Xt,new Map([["b64",!0]]),null==n?void 0:n.crit,r,o);let a=!0;if(i.has("b64")&&(r.b64,"boolean"!=typeof a))throw new Xt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Xt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw new TypeError('"'.concat("algorithms",'" option must be an array of strings'));if(t)return new Set(t)}(0,n.algorithms);if(c&&!c.has(s))throw new Wt('"alg" (Algorithm) Header Parameter value not allowed');if(a){if("string"!=typeof e.payload)throw new Xt("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Xt("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(await t(r,e),!0),function(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((e,t,n)=>{if(!(t instanceof Uint8Array)){if(rn(t)){if((e=>"oct"===e.kty&&"string"==typeof e.k)(t)&&gn(e,t,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!en(t))throw new TypeError(Ht(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw new TypeError("".concat(wn(t),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((e,t,n)=>{if(rn(t))switch(n){case"decrypt":case"sign":if((e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d))(t)&&gn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv)(t)&&gn(e,t,n))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!en(t))throw new TypeError(Ht(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw new TypeError("".concat(wn(t),' instances for asymmetric algorithms must not be of type "secret"'));if("public"===t.type)switch(n){case"sign":throw new TypeError("".concat(wn(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(wn(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if("private"===t.type)switch(n){case"verify":throw new TypeError("".concat(wn(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(wn(t),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}(s,t,"verify");const l=function(){for(var e=arguments.length,t=new Array(e),n=0;n{let{length:n}=t;return e+n},0),o=new Uint8Array(r);let i=0;for(const e of t)o.set(e,i),e.length;return o}(void 0!==e.protected?Lt(e.protected):new Uint8Array,Lt("."),"string"==typeof e.payload?a?Lt(e.payload):Ct.encode(e.payload):e.payload),d=tn(e.signature,"signature",Xt),f=await async function(e,t){if(e instanceof Uint8Array)return e;if(Zt(e))return e;if(Qt(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return((e,t)=>{un||(un=new WeakMap);let n=un.get(e);if(null!=n&&n[t])return n[t];const r="public"===e.type,o=!!r;let i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError(cn)}e.toCryptoKey(e.asymmetricKeyType,o,r?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw new TypeError(cn);e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError(cn);e.toCryptoKey(e.asymmetricKeyType,o,[r?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":0;break;case"RS256":case"PS256":case"RSA-OAEP-256":0;break;case"RS384":case"PS384":case"RSA-OAEP-384":0;break;case"RS512":case"PS512":case"RSA-OAEP-512":0;break;default:throw new TypeError(cn)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},o,r?["encrypt"]:["decrypt"]);e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},o,[r?"verify":"sign"])}if("ec"===e.asymmetricKeyType){var a;const n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(null===e.asymmetricKeyDetails||void 0===a?void 0:a.namedCurve);if(!n)throw new TypeError(cn);const i={ES256:"P-256",ES384:"P-384",ES512:"P-521"};i[t]&&n===i[t]&&e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[r?"verify":"sign"]),t.startsWith("ECDH-ES")&&e.toCryptoKey({name:"ECDH",namedCurve:n},o,r?[]:["deriveBits"])}if(!i)throw new TypeError(cn);return n?n[t]=i:un.set(e,{[t]:i}),i})(e,t)}catch(e){if(e instanceof TypeError)throw e}let n=e.export({format:"jwk"});return ln(e,n,t)}if(rn(e))return e.k?Dt(e.k):ln(e,e,t,!0);throw new Error("unreachable")}(t,s);if(!await async function(e,t,n,r){const o=await on(e,t,"verify");!function(e,t){if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if("number"!=typeof n||n<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}}(e,o);const i=function(e,t){const n="SHA-".concat(e.slice(-3));switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new Kt("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}}(e,o.algorithm);try{return await crypto.subtle.verify(i,o,n,r)}catch(e){return!1}}(s,f,d,l))throw new $t;let h;a?tn(e.payload,"payload",Xt):"string"==typeof e.payload?Ct.encode(e.payload):e.payload;const p={payload:h};return void 0!==e.protected&&(p.protectedHeader=r),void 0!==e.header&&(p.unprotectedHeader=e.header),u?j(j({},p),{},{key:f}):p}const Qn=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function er(e){const t=Qn.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let r;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":Math.round(3600*n);break;case"day":case"days":case"d":Math.round(86400*n);break;case"week":case"weeks":case"w":Math.round(604800*n);break;default:Math.round(31557600*n)}return"-"===t[1]||"ago"===t[4]?-r:r}const tr=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());function nr(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{JSON.parse(Pt.decode(t))}catch(e){}if(!nn(n))throw new Jt("JWT Claims Set must be a top-level JSON object");const{typ:o}=r;if(o&&("string"!=typeof e.typ||tr(e.typ)!==tr(o)))throw new jt('unexpected "typ" JWT header value',n,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r,l=[...i];void 0!==u&&l.push("iat"),void 0!==c&&l.push("aud"),void 0!==s&&l.push("sub"),void 0!==a&&l.push("iss");for(const e of new Set(l.reverse()))if(!(e in n))throw new jt('missing required "'.concat(e,'" claim'),n,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new jt('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new jt('unexpected "sub" claim value',n,"sub","check_failed");if(c&&!("string"==typeof n.aud?f.includes(d):Array.isArray(d)&&f.some(Set.prototype.has.bind(new Set(d)))))throw new jt('unexpected "aud" claim value',n,"aud","check_failed");var d,f;let h;switch(typeof r.clockTolerance){case"string":er(r.clockTolerance);break;case"number":r.clockTolerance;break;case"undefined":0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:p}=r,y=(p||new Date,Math.floor(w.getTime()/1e3));var w;if((void 0!==n.iat||u)&&"number"!=typeof n.iat)throw new jt('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new jt('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>y+h)throw new jt('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new jt('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=y-h)throw new Ft('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const e=y-n.iat;if(e-h>("number"==typeof u?u:er(u)))throw new Ft('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-h)throw new jt('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}function rr(e){return nn(e)}var or,ir,ar=new WeakMap,sr=new WeakMap;class cr{constructor(e){if(B(this,ar,void 0),B(this,sr,new WeakMap),!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(rr)}(e))throw new Vt("JSON Web Key Set malformed");M(ar,this,structuredClone(e))}jwks(){return x(ar,this)}async getKey(e,t){const{alg:n,kid:r}=j(j({},e),null==t?void 0:t.header),o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new Kt('Unsupported "alg" value for a JSON Web Key Set')}}(n),i=x(ar,this).keys.filter(e=>{let t=o===e.kty;if(t&&"string"==typeof r&&r===e.kid,!t||"string"!=typeof e.alg&&"AKP"!==o||n===e.alg,t&&"string"==typeof e.use&&"sig"===e.use,t&&Array.isArray(e.key_ops)&&e.key_ops.includes("verify"),t)switch(n){case"ES256":"P-256"===e.crv;break;case"ES384":"P-384"===e.crv;break;case"ES512":"P-521"===e.crv;break;case"Ed25519":case"EdDSA":"Ed25519"===e.crv}return t}),{0:a,length:s}=i;if(0===s)throw new Yt;if(1!==s){const e=new qt,t=x(sr,this);throw e[Symbol.asyncIterator]=function(e){return function(){return new W(e.apply(this,arguments))}}(function*(){for(const e of i)try{yield yield D(ur(t,e,n))}catch(e){}}),e}return ur(x(sr,this),a,n)}}async function ur(e,t,n){const r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[n]){const e=await async function(e,t){if(!nn(e))throw new TypeError("JWK must be an object");let n;switch(null!=t||e.alg,null!=n||e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Dt(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Kt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return sn(j(j({},e),{},{alg:t,ext:n}));case"AKP":if("string"!=typeof e.alg||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return sn(j(j({},e),{},{ext:n}));case"EC":case"OKP":return sn(j(j({},e),{},{alg:t,ext:n}));default:throw new Kt('Unsupported "kty" (Key Type) Parameter value')}}(j(j({},t),{},{ext:!0}),n);if(e instanceof Uint8Array||"public"!==e.type)throw new Vt("JSON Web Key Set members must be public keys");r[n]=e}return r[n]}function lr(e){const t=new cr(e),n=async(e,n)=>t.getKey(e,n);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let dr;if("undefined"==typeof navigator||null===(or=navigator.userAgent)||void 0===or||null===(ir=or.startsWith)||void 0===ir||!ir.call(or,"Mozilla/5.0 ")){const e="v6.2.2";dr="".concat("jose","/").concat(e)}const fr=Symbol(),hr=Symbol();var pr=new WeakMap,yr=new WeakMap,wr=new WeakMap,gr=new WeakMap,mr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,Sr=new WeakMap,vr=new WeakMap,br=new WeakMap;class Rr{constructor(e,t){if(B(this,pr,void 0),B(this,yr,void 0),B(this,wr,void 0),B(this,gr,void 0),B(this,mr,void 0),B(this,Er,void 0),B(this,Ar,void 0),B(this,Sr,void 0),B(this,vr,void 0),B(this,br,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var n,r;M(pr,this,new URL(e.href)),M(yr,this,"number"==typeof(null==t?void 0:t.timeoutDuration)?null==t?void 0:t.timeoutDuration:5e3),M(wr,this,"number"==typeof(null==t?void 0:t.cooldownDuration)?null==t?void 0:t.cooldownDuration:3e4),M(gr,this,"number"==typeof(null==t?void 0:t.cacheMaxAge)?null==t?void 0:t.cacheMaxAge:6e5),M(Ar,this,new Headers(null==t?void 0:t.headers)),dr&&!x(Ar,this).has("User-Agent")&&x(Ar,this).set("User-Agent",dr),x(Ar,this).has("accept")||(x(Ar,this).set("accept","application/json"),x(Ar,this).append("accept","application/jwk-set+json")),M(Sr,this,null==t?void 0:t[fr]),void 0!==(null==t?void 0:t[hr])&&(M(br,this,null==t?void 0:t[hr]),null==t?void 0:t[hr],x(gr,this),"object"==typeof n&&null!==n&&"uat"in n&&"number"==typeof n.uat&&!(Date.now()-n.uat>=r)&&"jwks"in n&&nn(n.jwks)&&Array.isArray(n.jwks.keys)&&Array.prototype.every.call(n.jwks.keys,nn)&&(M(mr,this,x(br,this).uat),M(vr,this,lr(x(br,this).jwks))))}pendingFetch(){return!!x(Er,this)}coolingDown(){return"number"==typeof x(mr,this)&&Date.now()3&&void 0!==arguments[3]?arguments[3]:fetch;const o=await r(e,{method:"GET",signal:n,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new zt;throw e});if(200!==o.status)throw new Gt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await o.json()}catch(e){throw new Gt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(x(pr,this).href,x(Ar,this),AbortSignal.timeout(x(yr,this)),x(Sr,this)).then(e=>{M(vr,this,lr(e)),x(br,this)&&(x(br,this).uat=Date.now(),x(br,this).jwks=e),M(mr,this,Date.now()),M(Er,this,void 0)}).catch(e=>{throw M(Er,this,void 0),e})),await x(Er,this)}}const Tr=["mfaToken"],Or=["mfaToken"];var _r,Nr,Ir,Cr,Pr,Lr,kr,Dr,Ur,xr,Br,Mr,Hr,Gr,jr,Fr,Wr=class extends Error{constructor(e,t){super(t),H(this,"code",void 0),this.name="NotSupportedError",this.code=e}},Kr=class extends Error{constructor(e,t,n){super(t),H(this,"cause",void 0),H(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Xr=class extends Kr{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},Jr=class extends Kr{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},Vr=class extends Kr{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Yr=class extends Kr{constructor(e,t){super("token_by_password_error",e,t),this.name="TokenByPasswordError"}},qr=class extends Kr{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},zr=class extends Kr{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},$r=class extends Error{constructor(e){super(e),H(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Zr=class extends Kr{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),H(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Qr=class extends Kr{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},eo=class extends Kr{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},to=class extends Kr{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},no=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),H(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function ro(e){return Object.entries(e).filter(e=>{let[,t]=e;return void 0!==t}).reduce((e,t)=>j(j({},e),{},{[t[0]]:t[1]}),{})}var oo=class extends Error{constructor(e,t,n){super(t),H(this,"cause",void 0),H(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},io=class extends oo{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},ao=class extends oo{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},so=class extends oo{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},co=class extends oo{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function uo(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var lo=(_r=new WeakMap,Nr=new WeakMap,Ir=new WeakMap,class{constructor(e){var t;B(this,_r,void 0),B(this,Nr,void 0),B(this,Ir,void 0),M(_r,this,"https://".concat(e.domain)),M(Nr,this,e.clientId),M(Ir,this,null!==(t=e.customFetch)&&void 0!==t?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(x(_r,this),"/mfa/authenticators"),{mfaToken:n}=e,r=await x(Ir,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const e=await r.json();throw new io(e.error_description||"Failed to list authenticators",e)}return(await r.json()).map(uo)}async enrollAuthenticator(e){const t="".concat(x(_r,this),"/mfa/associate"),{mfaToken:n}=e,r=F(e,Tr),o={authenticator_types:r.authenticatorTypes};"oobChannels"in r&&(o.oob_channels=r.oobChannels),"phoneNumber"in r&&r.phoneNumber&&(o.phone_number=r.phoneNumber),"email"in r&&r.email&&(o.email=r.email);const i=await x(Ir,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new ao(e.error_description||"Failed to enroll authenticator",e)}return function(e){if("otp"===e.authenticator_type)return{authenticatorType:"otp",secret:e.secret,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes,id:e.id};if("oob"===e.authenticator_type)return{authenticatorType:"oob",oobChannel:e.oob_channel,oobCode:e.oob_code,bindingMethod:e.binding_method,id:e.id,barcodeUri:e.barcode_uri,recoveryCodes:e.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(e.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,r="".concat(x(_r,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),o=await x(Ir,this).call(this,r,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const e=await o.json();throw new so(e.error_description||"Failed to delete authenticator",e)}}async challengeAuthenticator(e){const t="".concat(x(_r,this),"/mfa/challenge"),{mfaToken:n}=e,r=F(e,Or),o={mfa_token:n,client_id:x(Nr,this),challenge_type:r.challengeType};r.authenticatorId&&(o.authenticator_id=r.authenticatorId);const i=await x(Ir,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!i.ok){const e=await i.json();throw new co(e.error_description||"Failed to challenge authenticator",e)}return function(e){const t={challengeType:e.challenge_type};return void 0!==e.oob_code&&(t.oobCode=e.oob_code),void 0!==e.binding_method&&(t.bindingMethod=e.binding_method),t}(await i.json())}}),fo=class e{constructor(e,t,n,r,o,i,a){H(this,"accessToken",void 0),H(this,"idToken",void 0),H(this,"refreshToken",void 0),H(this,"expiresAt",void 0),H(this,"scope",void 0),H(this,"claims",void 0),H(this,"authorizationDetails",void 0),H(this,"tokenType",void 0),H(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=n,this.refreshToken=r,this.expiresAt=t,this.scope=o,this.claims=i,this.authorizationDetails=a}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,r=new e(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return r.tokenType=t.token_type,r.issuedTokenType=t.issued_token_type,r}},ho=(Cr=new WeakMap,Pr=new WeakMap,Lr=new WeakMap,class{constructor(e,t){B(this,Cr,new Map),B(this,Pr,void 0),B(this,Lr,void 0),M(Lr,this,Math.max(1,Math.floor(e))),M(Pr,this,Math.max(0,Math.floor(t)))}get(e){const t=x(Cr,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return x(Cr,this).delete(e),x(Cr,this).set(e,t),t.value;x(Cr,this).delete(e)}}set(e,t){for(x(Cr,this).has(e)&&x(Cr,this).delete(e),x(Cr,this).set(e,{value:t,expiresAt:Date.now()+x(Pr,this)});x(Cr,this).size>x(Lr,this);){const e=x(Cr,this).keys().next().value;if(void 0===e)break;x(Cr,this).delete(e)}}}),po=new Map;function yo(e){return{ttlMs:1e3*("number"==typeof(null==e?void 0:e.ttl)?e.ttl:600),maxEntries:"number"==typeof(null==e?void 0:e.maxEntries)&&e.maxEntries>0?e.maxEntries:100}}var wo=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,r=e.ttlMs,"".concat(n,":").concat(r));var n,r;let o=(i=t,po.get(i));var i;return o||(o=new ho(e.maxEntries,e.ttlMs),po.set(t,o)),o}static createJwksCache(){return{}}},go="openid profile email offline_access",mo=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function Eo(e){if(null==e)throw new zr("subject_token is required");if("string"!=typeof e)throw new zr("subject_token must be a string");if(0===e.trim().length)throw new zr("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new zr("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new zr("subject_token must not include the 'Bearer ' prefix")}function Ao(e,t){if(t)for(const[n,r]of Object.entries(t))if(!mo.has(n))if(Array.isArray(r)){if(r.length>20)throw new zr("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));r.forEach(t=>{e.append(n,t)})}else e.append(n,r)}var So="urn:ietf:params:oauth:token-type:access_token";kr=new WeakMap,Dr=new WeakMap,Ur=new WeakMap,xr=new WeakMap,Br=new WeakMap,Mr=new WeakMap,Hr=new WeakMap,Gr=new WeakMap,jr=new WeakMap,Fr=new WeakSet;function vo(){const e=x(xr,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(x(xr,this).useMtls?"1":"0")}async function bo(e){const t=await k(Fr,this,_o).call(this),n=new Un(e,x(xr,this).clientId,x(xr,this).clientSecret,t);return n[On]=x(Br,this),n}async function Ro(){if(x(kr,this)&&x(Dr,this))return{configuration:x(kr,this),serverMetadata:x(Dr,this)};const e=k(Fr,this,vo).call(this),t=x(Hr,this).get(e);if(t)return M(Dr,this,t.serverMetadata),M(kr,this,await k(Fr,this,bo).call(this,t.serverMetadata)),{configuration:x(kr,this),serverMetadata:x(Dr,this)};const n=x(Gr,this).get(e);if(n){const e=await n;return M(Dr,this,e.serverMetadata),M(kr,this,await k(Fr,this,bo).call(this,e.serverMetadata)),{configuration:x(kr,this),serverMetadata:x(Dr,this)}}const r=(async()=>{const t=await k(Fr,this,_o).call(this),n=await kn(new URL("https://".concat(x(xr,this).domain)),x(xr,this).clientId,{use_mtls_endpoint_aliases:x(xr,this).useMtls},t,{[On]:x(Br,this)}),r=n.serverMetadata();return x(Hr,this).set(e,{serverMetadata:r}),{configuration:n,serverMetadata:r}})(),o=r.then(e=>{let{serverMetadata:t}=e;return{serverMetadata:t}});o.catch(()=>{}),x(Gr,this).set(e,o);try{const{configuration:e,serverMetadata:t}=await r;M(kr,this,e),M(Dr,this,t),x(kr,this)[On]=x(Br,this)}finally{x(Gr,this).delete(e)}return{configuration:x(kr,this),serverMetadata:x(Dr,this)}}async function To(e){var t,n;const{configuration:r}=await k(Fr,this,Ro).call(this);if("audience"in e||"resource"in e)throw new zr("audience and resource parameters are not supported for Token Vault exchanges");Eo(e.subjectToken);const o=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:null!==e.subjectTokenType&&void 0!==t?t:So,requested_token_type:null!==e.requestedTokenType&&void 0!==n?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&o.append("login_hint",e.loginHint),e.scope&&o.append("scope",e.scope),Ao(o,e.extra);try{const e=await $n(r,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",o);return fo.fromTokenEndpointResponse(e)}catch(t){throw new zr("Failed to exchange token for connection '".concat(e.connection,"'."),t)}}async function Oo(e){const{configuration:t}=await k(Fr,this,Ro).call(this);Eo(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),Ao(n,e.extra);try{const e=await $n(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return fo.fromTokenEndpointResponse(e)}catch(t){throw new zr("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),t)}}async function _o(){return x(Ur,this)||M(Ur,this,(async()=>{if(!x(xr,this).clientSecret&&!x(xr,this).clientAssertionSigningKey&&!x(xr,this).useMtls)throw new no;if(x(xr,this).useMtls)return(e,t,n,r)=>{n.set("client_id",t.client_id)};let e=x(xr,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||await async function(e,t){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return yn(e,t,void 0)}(e,x(xr,this).clientAssertionSigningAlg||"RS256"),e?function(e){return _e(e,void 0)}(e):Tn(x(xr,this).clientSecret)})().catch(e=>{throw M(Ur,this,void 0),e})),x(Ur,this)}async function No(e){const{configuration:t}=await k(Fr,this,Ro).call(this),n=Ee(),r=await function(e){return async function(e){return ge(e,"codeVerifier"),ce(await crypto.subtle.digest("SHA-256",ie(e)))}(e)}(n),o=ro(j(j({},x(xr,this).authorizationParams),null==e?void 0:e.authorizationParams)),i=new URLSearchParams(j(j({scope:go},o),{},{client_id:x(xr,this).clientId,code_challenge:r,code_challenge_method:"S256"}));return{authorizationUrl:null!=e&&e.pushedAuthorizationRequests?await Jn(t,i):await Xn(t,i),codeVerifier:n}}function Io(e,t){return function(){return e.apply(t,arguments)}}const{toString:Co}=Object.prototype,{getPrototypeOf:Po}=Object,{iterator:Lo,toStringTag:ko}=Symbol,Do=(Uo=Object.create(null),e=>{const t=Co.call(e);return Uo[t]||(Uo[t]=t.slice(8,-1).toLowerCase())});var Uo;const xo=e=>(e=e.toLowerCase(),t=>Do(t)===e),Bo=e=>t=>typeof t===e,{isArray:Mo}=Array,Ho=Bo("undefined");function Go(e){return null!==e&&!Ho(e)&&null!==e.constructor&&!Ho(e.constructor)&&Wo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const jo=xo("ArrayBuffer");const Fo=Bo("string"),Wo=Bo("function"),Ko=Bo("number"),Xo=e=>null!==e&&"object"==typeof e,Jo=e=>{if("object"!==Do(e))return!1;const t=Po(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ko in e||Lo in e)},Vo=xo("Date"),Yo=xo("File"),qo=xo("Blob"),zo=xo("FileList");const $o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},Zo=void 0!==$o.FormData?$o.FormData:void 0,Qo=xo("URLSearchParams"),[ei,ti,ni,ri]=["ReadableStream","Request","Response","Headers"].map(xo);function oi(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),Mo(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const ai="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,si=e=>!Ho(e)&&e!==ai;const ci=(ui="undefined"!=typeof Uint8Array&&Po(Uint8Array),e=>ui&&e instanceof ui);var ui;const li=xo("HTMLFormElement"),di=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fi=xo("RegExp"),hi=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};oi(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const pi=xo("AsyncFunction"),yi=(wi="function"==typeof setImmediate,gi=Wo(ai.postMessage),wi?setImmediate:gi?(mi=`axios@${Math.random()}`,Ei=[],ai.addEventListener("message",({source:e,data:t})=>{e===ai&&t===mi&&Ei.length&&Ei.shift()()},!1),e=>{Ei.push(e),ai.postMessage(mi,"*")}):e=>setTimeout(e));var wi,gi,mi,Ei;const Ai="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ai):"undefined"!=typeof process&&process.nextTick||yi,Si={isArray:Mo,isArrayBuffer:jo,isBuffer:Go,isFormData:e=>{if(!e)return!1;if(Zo&&e instanceof Zo)return!0;const t=Po(e);if(!t||t===Object.prototype)return!1;if(!Wo(e.append))return!1;const n=Do(e);return"formdata"===n||"object"===n&&Wo(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&jo(e.buffer),t},isString:Fo,isNumber:Ko,isBoolean:e=>!0===e||!1===e,isObject:Xo,isPlainObject:Jo,isEmptyObject:e=>{if(!Xo(e)||Go(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ei,isRequest:ti,isResponse:ni,isHeaders:ri,isUndefined:Ho,isDate:Vo,isFile:Yo,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:qo,isRegExp:fi,isFunction:Wo,isStream:e=>Xo(e)&&Wo(e.pipe),isURLSearchParams:Qo,isTypedArray:ci,isFileList:zo,forEach:oi,merge:function e(...t){const{caseless:n,skipUndefined:r}=si(this)&&this||{},o={},i=(t,i)=>{if("__proto__"===i||"constructor"===i||"prototype"===i)return;const a=n&&ii(o,i)||i,s=di(o,a)?o[a]:void 0;Jo(s)&&Jo(t)?o[a]=e(s,t):Jo(t)?o[a]=e({},t):Mo(t)?o[a]=t.slice():r&&Ho(t)||(o[a]=t)};for(let e=0,n=t.length;e(oi(t,(t,r)=>{n&&Wo(t)?Object.defineProperty(e,r,{__proto__:null,value:Io(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{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),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,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&&Po(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Do,kindOfTest:xo,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(Mo(e))return e;let t=e.length;if(!Ko(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Lo]).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:li,hasOwnProperty:di,hasOwnProp:di,reduceDescriptors:hi,freezeMethods:e=>{hi(e,(t,n)=>{if(Wo(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];Wo(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 Mo(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:ii,global:ai,isContextDefined:si,isSpecCompliantForm:function(e){return!!(e&&Wo(e.append)&&"FormData"===e[ko]&&e[Lo])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Xo(e)){if(t.indexOf(e)>=0)return;if(Go(e))return e;if(!("toJSON"in e)){t[r]=e;const o=Mo(e)?[]:{};return oi(e,(e,t)=>{const i=n(e,r+1);!Ho(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:pi,isThenable:e=>e&&(Xo(e)||Wo(e))&&Wo(e.then)&&Wo(e.catch),setImmediate:yi,asap:Ai,isIterable:e=>null!=e&&Wo(e[Lo])},vi=Si.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"]),bi=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]&&vi[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};(Object.getOwnPropertyDescriptor(bi,"name")||{}).writable||Object.defineProperty(bi,"name",{value:"default",configurable:!0});const Ri=Symbol("internals"),Ti=/[^\x09\x20-\x7E\x80-\xFF]/g;function Oi(e){return e&&String(e).trim().toLowerCase()}function _i(e){return!1===e||null==e?e:Si.isArray(e)?e.map(_i):function(e){let t=0,n=e.length;for(;tt;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(Ti,""))}function Ni(e,t,n,r,o){return Si.isFunction(r)?r.call(this,t,n):(o&&(t=n),Si.isString(t)?Si.isString(r)?-1!==t.indexOf(r):Si.isRegExp(r)?r.test(t):void 0:void 0)}class Ii{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oi(t);if(!o)throw new Error("header name must be a non-empty string");const i=Si.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=_i(e))}const i=(e,t)=>Si.forEach(e,(e,n)=>o(e,n,t));if(Si.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Si.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(bi(e),t);else if(Si.isObject(e)&&Si.isIterable(e)){let n,r,o={};for(const t of e){if(!Si.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Si.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=Oi(e)){const n=Si.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(Si.isFunction(t))return t.call(this,e,n);if(Si.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oi(e)){const n=Si.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ni(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oi(e)){const o=Si.findKey(n,e);!o||t&&!Ni(0,n[o],o,t)||(delete n[o],r=!0)}}return Si.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&&!Ni(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Si.forEach(this,(r,o)=>{const i=Si.findKey(n,o);if(i)return t[i]=_i(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]=_i(r),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Si.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Si.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[Ri]=this[Ri]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oi(e);t[r]||(!function(e,t){const n=Si.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Si.isArray(e)?e.forEach(r):r(e),this}}Ii.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Si.reduceDescriptors(Ii.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Si.freezeMethods(Ii);const Ci=Ii;function Pi(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Si.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof Ci&&(e=e.toJSON()),r.push(e),Si.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);Si.isUndefined(r)||(t[n]=r)});else{if(!Si.isPlainObject(e)&&function(e){if(Si.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Si.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?"[REDACTED ****]":o(i);Si.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}class Li extends Error{static from(e,t,n,r,o,i){const a=new Li(e.message,t||e.code,n,r,o);return a.cause=e,a.name=e.name,null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Si.hasOwnProp(e,"redact")?e.redact:void 0,n=Si.isArray(t)&&t.length>0?Pi(e,t):Si.toJSONObject(e);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:n,code:this.code,status:this.status}}}Li.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Li.ERR_BAD_OPTION="ERR_BAD_OPTION",Li.ECONNABORTED="ECONNABORTED",Li.ETIMEDOUT="ETIMEDOUT",Li.ECONNREFUSED="ECONNREFUSED",Li.ERR_NETWORK="ERR_NETWORK",Li.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Li.ERR_DEPRECATED="ERR_DEPRECATED",Li.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Li.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Li.ERR_CANCELED="ERR_CANCELED",Li.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Li.ERR_INVALID_URL="ERR_INVALID_URL",Li.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ki=Li;var Di=n(8287).hp;function Ui(e){return Si.isPlainObject(e)||Si.isArray(e)}function xi(e){return Si.endsWith(e,"[]")?e.slice(0,-2):e}function Bi(e,t,n){return e?e.concat(t).map(function(e,t){return e=xi(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Mi=Si.toFlatObject(Si,{},null,function(e){return/^is[A-Z]/.test(e)});const Hi=function(e,t,n){if(!Si.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Si.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Si.isUndefined(t[e])})).metaTokens,o=n.visitor||d,i=n.dots,a=n.indexes,s=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?100:n.maxDepth,u=s&&Si.isSpecCompliantForm(t);if(!Si.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Si.isDate(e))return e.toISOString();if(Si.isBoolean(e))return e.toString();if(!u&&Si.isBlob(e))throw new ki("Blob is not supported. Use a Buffer instead.");return Si.isArrayBuffer(e)||Si.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Di.from(e):e}function d(e,n,o){let s=e;if(Si.isReactNative(t)&&Si.isReactNativeBlob(e))return t.append(Bi(o,n,i),l(e)),!1;if(e&&!o&&"object"==typeof e)if(Si.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Si.isArray(e)&&function(e){return Si.isArray(e)&&!e.some(Ui)}(e)||(Si.isFileList(e)||Si.endsWith(n,"[]"))&&(s=Si.toArray(e)))return n=xi(n),s.forEach(function(e,r){!Si.isUndefined(e)&&null!==e&&t.append(!0===a?Bi([n],r,i):null===a?n:n+"[]",l(e))}),!1;return!!Ui(e)||(t.append(Bi(o,n,i),l(e)),!1)}const f=[],h=Object.assign(Mi,{defaultVisitor:d,convertValue:l,isVisitable:Ui});if(!Si.isObject(e))throw new TypeError("data must be an object");return function e(n,r,i=0){if(!Si.isUndefined(n)){if(i>c)throw new ki("Object is too deeply nested ("+i+" levels). Max depth: "+c,ki.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),Si.forEach(n,function(n,a){!0===(!(Si.isUndefined(n)||null===n)&&o.call(t,n,Si.isString(a)?a.trim():a,r,h))&&e(n,r?r.concat(a):[a],i+1)}),f.pop()}}(e),t};function Gi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ji(e,t){this._pairs=[],e&&Hi(e,this,t)}const Fi=ji.prototype;Fi.append=function(e,t){this._pairs.push([e,t])},Fi.toString=function(e){const t=e?function(t){return e.call(this,t,Gi)}:Gi;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const Wi=ji;function Ki(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Xi(e,t,n){if(!t)return e;const r=n&&n.encode||Ki,o=Si.isFunction(n)?{serialize:n}:n,i=o&&o.serialize;let a;if(a=i?i(t,o):Si.isURLSearchParams(t)?t.toString():new Wi(t,o).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const Ji=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){Si.forEach(this.handlers,function(t){null!==t&&e(t)})}},Vi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Yi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Wi,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qi="undefined"!=typeof window&&"undefined"!=typeof document,zi="object"==typeof navigator&&navigator||void 0,$i=qi&&(!zi||["ReactNative","NativeScript","NS"].indexOf(zi.product)<0),Zi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Qi=qi&&window.location.href||"http://localhost",ea={...e,...Yi};const ta=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&&Si.isArray(r)?r.length:i,s)return Si.hasOwnProp(r,i)?r[i]=Si.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a;r[i]&&Si.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Si.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 Si.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null},na=(e,t)=>null!=e&&Si.hasOwnProp(e,t)?e[t]:void 0;const ra={transitional:Vi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Si.isObject(e);o&&Si.isHTMLForm(e)&&(e=new FormData(e));if(Si.isFormData(e))return r?JSON.stringify(ta(e)):e;if(Si.isArrayBuffer(e)||Si.isBuffer(e)||Si.isStream(e)||Si.isFile(e)||Si.isBlob(e)||Si.isReadableStream(e))return e;if(Si.isArrayBufferView(e))return e.buffer;if(Si.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=na(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Hi(e,new ea.classes.URLSearchParams,{visitor:function(e,t,n,r){return ea.isNode&&Si.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=Si.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=na(this,"env"),r=n&&n.FormData;return Hi(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Si.isString(e))try{return(t||JSON.parse)(e),Si.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=na(this,"transitional")||ra.transitional,n=t&&t.forcedJSONParsing,r=na(this,"responseType"),o="json"===r;if(Si.isResponse(e)||Si.isReadableStream(e))return e;if(e&&Si.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,na(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw ki.from(e,ki.ERR_BAD_RESPONSE,this,null,na(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ea.classes.FormData,Blob:ea.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Si.forEach(["delete","get","head","post","put","patch","query"],e=>{ra.headers[e]={}});const oa=ra;function ia(e,t){const n=this||oa,r=t||n,o=Ci.from(r.headers);let i=r.data;return Si.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function aa(e){return!(!e||!e.__CANCEL__)}const sa=class extends ki{constructor(e,t,n){super(e??"canceled",ki.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function ca(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ki("Request failed with status code "+n.status,n.status>=400&&n.status<500?ki.ERR_BAD_REQUEST:ki.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ua=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)]},da=(e,t,n=3)=>{let r=0;const o=ua(50,250);return la(n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=null!=a?Math.min(i,a):i,c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);e({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})},n)},fa=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ha=e=>(...t)=>Si.asap(()=>e(...t)),pa=ea.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ea.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ea.origin),ea.navigator&&/(msie|trident)/i.test(ea.navigator.userAgent)):()=>!0,ya=ea.hasStandardBrowserEnv?{write(e,t,n,r,o,i,a){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Si.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Si.isString(r)&&s.push(`path=${r}`),Si.isString(o)&&s.push(`domain=${o}`),!0===i&&s.push("secure"),Si.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;nnull,remove(){}};function wa(e,t,n){let r=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));var o;return e&&(r||!1===n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ga=e=>e instanceof Ci?{...e}:e;function ma(e,t){t=t||{};const n=Object.create(null);function r(e,t,n,r){return Si.isPlainObject(e)&&Si.isPlainObject(t)?Si.merge.call({caseless:r},e,t):Si.isPlainObject(t)?Si.merge({},t):Si.isArray(t)?t.slice():t}function o(e,t,n,o){return Si.isUndefined(t)?Si.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Si.isUndefined(t))return r(void 0,t)}function a(e,t){return Si.isUndefined(t)?Si.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Si.hasOwnProp(t,i)?r(n,o):Si.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!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,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(ga(e),ga(t),0,!0)};return Si.forEach(Object.keys({...e,...t}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=Si.hasOwnProp(c,r)?c[r]:o,a=i(Si.hasOwnProp(e,r)?e[r]:void 0,Si.hasOwnProp(t,r)?t[r]:void 0,r);Si.isUndefined(a)&&i!==s||(n[r]=a)}),n}const Ea=["content-type","content-length"];const Aa=e=>{const t=ma({},e),n=e=>Si.hasOwnProp(t,e)?t[e]:void 0,r=n("data");let o=n("withXSRFToken");const i=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const c=n("auth"),u=n("baseURL"),l=n("allowAbsoluteUrls"),d=n("url");var f;if(t.headers=s=Ci.from(s),t.url=Xi(wa(u,d,l),e.params,e.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(f=c.password,encodeURIComponent(f).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))):""))),Si.isFormData(r)&&(ea.hasStandardBrowserEnv||ea.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):Si.isFunction(r.getHeaders)&&function(e,t,n){"content-only"===n?Object.entries(t).forEach(([t,n])=>{Ea.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(s,r.getHeaders(),n("formDataHeaderPolicy"))),ea.hasStandardBrowserEnv){Si.isFunction(o)&&(o=o(t));if(!0===o||null==o&&pa(t.url)){const e=i&&a&&ya.read(a);e&&s.set(i,e)}}return t};(Object.getOwnPropertyDescriptor(Aa,"name")||{}).writable||Object.defineProperty(Aa,"name",{value:"default",configurable:!0});const Sa="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=Aa(e);let o=r.data;const i=Ci.from(r.headers).normalize();let a,s,c,u,l,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function p(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function w(){if(!y)return;const r=Ci.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());ca(function(e){t(e),p()},function(e){n(e),p()},{data:d&&"text"!==d&&"json"!==d?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&y.responseURL.startsWith("file:"))&&setTimeout(w)},y.onabort=function(){y&&(n(new ki("Request aborted",ki.ECONNABORTED,e,y)),p(),y=null)},y.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new ki(r,ki.ERR_NETWORK,e,y);o.event=t||null,n(o),p(),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Vi;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ki(t,o.clarifyTimeoutError?ki.ETIMEDOUT:ki.ECONNABORTED,e,y)),p(),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Si.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Si.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),d&&"json"!==d&&(y.responseType=r.responseType),h&&([c,l]=da(h,!0),y.addEventListener("progress",c)),f&&y.upload&&([s,u]=da(f),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(a=t=>{y&&(n(!t||t.type?new sa(null,e,y):t),y.abort(),p(),y=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}(r.url);!g||ea.protocols.includes(g)?y.send(o||null):n(new ki("Unsupported protocol "+g+":",ki.ERR_BAD_REQUEST,e))})},va=(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 ki?t:new sa(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new ki(`timeout of ${t}ms exceeded`,ki.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=()=>Si.asap(a),s}},ba=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of Ra(e))yield*ba(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})};var Oa=n(8287).hp;const _a="1.16.0",{isFunction:Na}=Si,Ia=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ca=e=>{const t=Si.global??globalThis,{ReadableStream:n,TextEncoder:r}=t;e=Si.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:i,Response:a}=e,s=o?Na(o):"function"==typeof fetch,c=Na(i),u=Na(a);if(!s)return!1;const l=s&&Na(n),d=s&&("function"==typeof r?(f=new r,e=>f.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var f;const h=c&&l&&Ia(()=>{let e=!1;const t=new i(ea.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),p=u&&l&&Ia(()=>Si.isReadableStream(new a("").body)),y={stream:p&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!y[e]&&(y[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ki(`Response type '${e}' is not supported`,ki.ERR_NOT_SUPPORT,n)})});const w=async(e,t)=>{const n=Si.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(Si.isBlob(e))return e.size;if(Si.isSpecCompliantForm(e)){const t=new i(ea.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Si.isArrayBufferView(e)||Si.isArrayBuffer(e)?e.byteLength:(Si.isURLSearchParams(e)&&(e+=""),Si.isString(e)?(await d(e)).byteLength:void 0)})(t)};return async e=>{let{url:t,method:n,data:s,signal:u,cancelToken:l,timeout:d,onDownloadProgress:f,onUploadProgress:g,responseType:m,headers:E,withCredentials:A="same-origin",fetchOptions:S,maxContentLength:v,maxBodyLength:b}=Aa(e);const R=Si.isNumber(v)&&v>-1,T=Si.isNumber(b)&&b>-1;let O=o||fetch;m=m?(m+"").toLowerCase():"text";let _=va([u,l&&l.toAbortSignal()],d),N=null;const I=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let C;try{if(R&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length;const t=r.length;for(let n=0;n=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(e-=2,n+=2)}let n=0,o=t-1;const i=e=>e>=2&&37===r.charCodeAt(e-2)&&51===r.charCodeAt(e-1)&&(68===r.charCodeAt(e)||100===r.charCodeAt(e));o>=0&&(61===r.charCodeAt(o)?(n++,o--):i(o)&&(n++,o-=3)),1===n&&o>=0&&(61===r.charCodeAt(o)||i(o))&&n++;const a=3*Math.floor(e/4)-(n||0);return a>0?a:0}if(void 0!==Oa&&"function"==typeof Oa.byteLength)return Oa.byteLength(r,"utf8");let o=0;for(let e=0,t=r.length;e=55296&&n<=56319&&e+1=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o}(t);if(n>v)throw new ki("maxContentLength size of "+v+" exceeded",ki.ERR_BAD_RESPONSE,e,N)}if(T&&"get"!==n&&"head"!==n){const t=await w(E,s);if("number"==typeof t&&isFinite(t)&&t>b)throw new ki("Request body larger than maxBodyLength limit",ki.ERR_BAD_REQUEST,e,N)}if(g&&h&&"get"!==n&&"head"!==n&&0!==(C=await w(E,s))){let e,n=new i(t,{method:"POST",body:s,duplex:"half"});if(Si.isFormData(s)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=fa(C,da(ha(g)));s=Ta(n.body,65536,e,t)}}Si.isString(A)||(A=A?"include":"omit");const o=c&&"credentials"in i.prototype;if(Si.isFormData(s)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/"+_a,!1);const u={...S,signal:_,method:n.toUpperCase(),headers:E.normalize().toJSON(),body:s,duplex:"half",credentials:o?A:void 0};N=c&&new i(t,u);let l=await(c?O(N,S):O(t,u));if(R){const t=Si.toFiniteNumber(l.headers.get("content-length"));if(null!=t&&t>v)throw new ki("maxContentLength size of "+v+" exceeded",ki.ERR_BAD_RESPONSE,e,N)}const d=p&&("stream"===m||"response"===m);if(p&&l.body&&(f||R||d&&I)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=l[e]});const n=Si.toFiniteNumber(l.headers.get("content-length")),[r,o]=f&&fa(n,da(ha(f),!0))||[];let i=0;const s=t=>{if(R&&(i=t,i>v))throw new ki("maxContentLength size of "+v+" exceeded",ki.ERR_BAD_RESPONSE,e,N);r&&r(t)};l=new a(Ta(l.body,65536,s,()=>{o&&o(),I&&I()}),t)}m=m||"text";let P=await y[Si.findKey(y,m)||"text"](l,e);if(R&&!p&&!d){let t;if(null!=P&&("number"==typeof P.byteLength?t=P.byteLength:"number"==typeof P.size?t=P.size:"string"==typeof P&&(t="function"==typeof r?(new r).encode(P).byteLength:P.length)),"number"==typeof t&&t>v)throw new ki("maxContentLength size of "+v+" exceeded",ki.ERR_BAD_RESPONSE,e,N)}return!d&&I&&I(),await new Promise((t,n)=>{ca(t,n,{data:P,headers:Ci.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:N})})}catch(t){if(I&&I(),_&&_.aborted&&_.reason instanceof ki){const n=_.reason;throw n.config=e,N&&(n.request=N),t!==n&&(n.cause=t),n}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ki("Network Error",ki.ERR_NETWORK,e,N,t&&t.response),{cause:t.cause||t});throw ki.from(t,t&&t.code,e,N,t&&t.response)}}},Pa=new Map,La=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=Pa;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:Ca(t)),u=s;return s},ka=(La(),{http:null,xhr:Sa,fetch:{get:La}});Si.forEach(ka,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Da=e=>`- ${e}`,Ua=e=>Si.isFunction(e)||null===e||!1===e;const xa={getAdapter:function(e,t){e=Si.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(Da).join("\n"):" "+Da(e[0]):"as no adapter specified";throw new ki("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:ka};function Ba(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new sa(null,e)}function Ma(e){Ba(e),e.headers=Ci.from(e.headers),e.data=ia.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return xa.getAdapter(e.adapter||oa.adapter,e)(e).then(function(t){Ba(e),e.response=t;try{t.data=ia.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Ci.from(t.headers),t},function(t){if(!aa(t)&&(Ba(e),t&&t.response)){e.response=t.response;try{t.response.data=ia.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Ci.from(t.response.headers)}return Promise.reject(t)})}const Ha={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ha[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ga={};Ha.transitional=function(e,t,n){function r(e,t){return"[Axios v"+_a+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new ki(r(o," has been removed"+(t?" in "+t:"")),ki.ERR_DEPRECATED);return t&&!Ga[o]&&(Ga[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)}},Ha.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const ja={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ki("options must be an object",ki.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new ki("option "+i+" must be "+n,ki.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ki("Unknown option "+i,ki.ERR_BAD_OPTION)}},validators:Ha},Fa=ja.validators;class Wa{constructor(e){this.defaults=e||{},this.interceptors={request:new Ji,response:new Ji}}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=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),o=-1===r?"":n.slice(r+1);String(e.stack).endsWith(o)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ma(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&ja.assertOptions(n,{silentJSONParsing:Fa.transitional(Fa.boolean),forcedJSONParsing:Fa.transitional(Fa.boolean),clarifyTimeoutError:Fa.transitional(Fa.boolean),legacyInterceptorReqResOrdering:Fa.transitional(Fa.boolean)},!1),null!=r&&(Si.isFunction(r)?t.paramsSerializer={serialize:r}:ja.assertOptions(r,{encode:Fa.function,serialize:Fa.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ja.assertOptions(t,{baseUrl:Fa.spelling("baseURL"),withXsrfToken:Fa.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Si.merge(o.common,o[t.method]);o&&Si.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete o[e]}),t.headers=Ci.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||Vi;n&&n.legacyInterceptorReqResOrdering?a.unshift(e.fulfilled,e.rejected):a.push(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=[Ma.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 sa(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 Xa(function(t){e=t});return{token:t,cancel:e}}}const Ja=Xa;const Va={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(Va).forEach(([e,t])=>{Va[t]=e});const Ya=Va;const qa=function e(t){const n=new Ka(t),r=Io(Ka.prototype.request,n);return Si.extend(r,Ka.prototype,n,{allOwnKeys:!0}),Si.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ma(t,n))},r}(oa);qa.Axios=Ka,qa.CanceledError=sa,qa.CancelToken=Ja,qa.isCancel=aa,qa.VERSION=_a,qa.toFormData=Hi,qa.AxiosError=ki,qa.Cancel=qa.CanceledError,qa.all=function(e){return Promise.all(e)},qa.spread=function(e){return function(t){return e.apply(null,t)}},qa.isAxiosError=function(e){return Si.isObject(e)&&!0===e.isAxiosError},qa.mergeConfig=ma,qa.AxiosHeaders=Ci,qa.formToJSON=e=>ta(Si.isHTMLForm(e)?new FormData(e):e),qa.getAdapter=xa.getAdapter,qa.HttpStatusCode=Ya,qa.default=qa;var za=n(3612);const $a={log:function(){if(za.A.debug){for(var e,t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{}).timeout,r=Date.now();if(this.readyResolved&&!0===this.readyValue)return $a.log("BlueConicUtils | blueConicReady | returning cached value:",this.readyValue),Promise.resolve(!0);if(this.readyPromise)return $a.log("BlueConicUtils | blueConicReady | returning existing promise"),this.readyPromise;var o=null!=n?n:e.DEFAULT_TIMEOUT;return $a.log("BlueConicUtils | blueConicReady | checking BC readiness"),this.readyPromise=new Promise(function(e){var n,i=setTimeout(function(){t.readyResolved||($a.log("BlueConicUtils | blueConicReady | timeout at:",(Date.now()-r)/1e3,"s"),t.resolveReady(!1,e))},o);if(null!==(n=window.blueConicClient)&&void 0!==n&&n.profile)return $a.log("BlueConicUtils | blueConicReady | BC already ready"),void t.resolveReady(!0,e);var a=function(){var n;if(!t.readyResolved)if(null!==(n=window.blueConicClient)&&void 0!==n&&n.event){$a.log("BlueConicUtils | blueConicReady | BC client detected");var o=window.blueConicClient.event.subscribe(window.blueConicClient.event.onReady,{},function(){clearTimeout(i),$a.log("BlueConicUtils | blueConicReady | onReady fired at:",(Date.now()-r)/1e3,"s"),null==o||o(),t.resolveReady(!0,e)})}else setTimeout(a,500)};a()}),this.readyPromise}},{key:"resolveReady",value:function(e,t){this.readyResolved||($a.log("BlueConicUtils | blueConicReady | resolved with:",e),this.readyResolved=!0,this.readyValue=e,t(e),!1===e&&(this.readyPromise=null,this.readyResolved=!1))}}])}();u(Za,"DEFAULT_TIMEOUT",3e3);new Za;var Qa,es;function ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ns(e){for(var t=1;t2&&(clearInterval(t),e(!0));case 1:case"end":return n.stop()}},n)})),50)}})},us=function(){var e=r(l.mark(function e(t){var n,r,o;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,cs();case 1:return $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)},o=window.dataLayer.some(r),e.abrupt("return",o?n:"");case 2:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),ls=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.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,us(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)}}(),ds=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))})},fs=function(){var e=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,t){return za.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)}}(),hs=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=hs;window.validatePhoneNumber=function(e){return/^[0-9]([0-9 -])*[0-9]$/.test(e)};var ps=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Content ID",e.next=1,us(t);case 1:return n=e.sent,$a.log("utils | contentId: Content ID is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ys=function(){var e=r(l.mark(function e(){var t,n,r=arguments;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"Section",e.next=1,us(t);case 1:return n=e.sent,$a.log("utils | section: Section is ",n),e.abrupt("return",n);case 2:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),ws=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return new Promise(function(t,n){var o={sspw:null,sophiClient:null,engagePaywall:null,engageStatus:null},i=function(){var i=r(l.mark(function r(){var i,a,s,c,u,d,f,h,p,y,w;return l.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"1"!==(null===(i=window.sophi_config)||void 0===i?void 0:i.enableSophiSSPW)){r.next=1;break}if(!document.getElementById("server-paywall")){r.next=1;break}return o.sspw=!0,r.abrupt("return",t({paywall:!0,details:ns({},o)}));case 1:return r.next=2,ls();case 2:return s=r.sent,r.next=3,us("Paywall_Level");case 3:if(c=r.sent,"article"===s&&"free"!==c){r.next=4;break}return r.abrupt("return",t({paywall:!1,details:"article"!==s?"Page type is not an article":"Free article"}));case 4:return r.next=5,fs();case 5:if(!(u=r.sent)||!u.isEntitled){r.next=6;break}return r.abrupt("return",t({paywall:!1,details:"Entitled User"}));case 6:if("premium"!==c){r.next=7;break}return r.abrupt("return",t({paywall:!0,details:"Premium article"}));case 7:if(d=null===(a=window.ConnextUtils)||void 0===a?void 0:a.runningSophi,$a.log("checkPaywallStatus - Sophi is running: ",d),!d){r.next=8;break}window.ConnextUtils.connextAlreadyRan&&window.sophiWallConfig&&!window.sophiWallConfig.error&&"paywall"===window.sophiWallConfig.wallType?(o.sophiClient=!0,o.engageStatus=!0,o.engagePaywall=!0):window.addEventListener("onPaywallShown",function(){return"paywall"===window.sophiWallConfig.wallType&&(o.sophiClient=!0),t({paywall:!0,details:ns({},o)})},{once:!0}),r.next=12;break;case 8:if(d){r.next=12;break}return f=window.ConnextUtils.connextReady("onPaywallShown",!1),h=new Promise(function(t,n){return setTimeout(function(){return n(new Error("No Engage paywall within 10 seconds, resolving as no paywall."))},e)}),r.prev=9,r.next=10,Promise.race([f,h]);case 10:!0===(p=r.sent)?(o.engagePaywall=!0,o.engageStatus="Engage paywall detected"):(o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(p)),r.next=12;break;case 11:r.prev=11,y=r.catch(9),o.engagePaywall=!1,o.engageStatus="Engage response: ".concat(y);case 12:return r.abrupt("return",t({paywall:Object.values(o).some(function(e){return e}),details:ns({},o)}));case 13:r.prev=13,w=r.catch(0),n(w);case 14:case"end":return r.stop()}},r,null,[[0,13],[9,11]])}));return function(){return i.apply(this,arguments)}}();i()})};"undefined"!=typeof window&&(window.MNGAuthentication=window.MNGAuthentication||{},window.MNGAuthentication.checkPaywallStatus=ws);var gs=function(){return c(function e(){var t,n,r,i,a,s;o(this,e),u(this,"simpleHostname",void 0),u(this,"sophiHostname",void 0),u(this,"sophiCallStartTime",void 0),u(this,"section",void 0),u(this,"contentId",void 0),u(this,"visitorType",void 0),this.simpleHostname=as();var c=window.location.hostname;""!==window.sophi_config.sophiHostname?this.sophiHostname=window.sophi_config.sophiHostname:this.sophiHostname=c,this.onDeviceEnabled=!(null===(t=window.authentication_config)||void 0===t||!t.sophiOnDevice)&&"1"===(null===(n=window.authentication_config)||void 0===n?void 0:n.sophiOnDevice),this.sdkEnabled=!(null===(r=window.authentication_config)||void 0===r||!r.sophiSDKEnabled)&&"1"===(null===(i=window.authentication_config)||void 0===i?void 0:i.sophiSDKEnabled),this.useEventListener=!(null===(a=window.sophi_config)||void 0===a||!a.useEventListener)&&(this.sdkEnabled&&"1"===(null===(s=window.sophi_config)||void 0===s?void 0:s.useEventListener)),this.log("site settings: onDeviceEnabled = ".concat(this.onDeviceEnabled,", sdkEnabled = ").concat(this.sdkEnabled))},[{key:"init",value:(s=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.log("Starting normal SDK flow."),this.sdkEnabled){e.next=1;break}return e.abrupt("return");case 1:return e.next=2,this.setupSophiDecision();case 2:if(!e.sent){e.next=3;break}return e.next=3,this.makeSophiCall();case 3:case"end":return e.stop()}},e,this)})),function(){return s.apply(this,arguments)})},{key:"waitForSophiReady",value:(a=r(l.mark(function e(){var t=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.useEventListener){e.next=1;break}return this.log("Not using AB test listener, will call Sophi decision directly."),e.abrupt("return",!1);case 1:return e.abrupt("return",new Promise(function(e){window.addEventListener("sophi.abTests:ready",r(l.mark(function n(){var r,o;return l.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(null===(r=window.sophi)||void 0===r||!r.abTests||"function"!=typeof window.sophi.abTests.getAllExperiments){n.next=2;break}return n.next=1,window.sophi.abTests.getAllExperiments();case 1:o=n.sent,e(o);case 2:t.log("AB Tests loaded successfully!"),e(!1);case 3:case"end":return n.stop()}},n)}))),t.log("Added A/B test listener...")}));case 2:case"end":return e.stop()}},e,this)})),function(){return a.apply(this,arguments)})},{key:"getVisitorType",value:(i=r(l.mark(function e(){var t,n,r;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t="anonymous",e.prev=1,e.next=2,fs();case 2:"isEntitled"in(n=e.sent)&&(t=n.isEntitled?"subscriber":"registered"),"yes"===window.localStorage.getItem("sophiRegiliteUser")&&"anonymous"===t&&(this.log("User is regilite and anonymous. Setting to registered."),t="registered"),e.next=4;break;case 3:e.prev=3,r=e.catch(1),this.error("Unable to determine visitorType Using",t,r);case 4:return window.sophiUserType=t,this.log("visitorType is",t),e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"setupSophiDecision",value:(n=r(l.mark(function e(){var t,n,r,o,i,a,s,c=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!0,n=!1,e.prev=1,!this.useEventListener){e.next=5;break}return e.next=2,this.waitForSophiReady();case 2:if(t=e.sent,!(!this.onDeviceEnabled&&!t||t&&t.length<1)){e.next=3;break}return this.log("experiments variable was not in the expected format.",t),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 3:if(t){e.next=4;break}return this.log("window.sophi.abTests.getAllExperiments is not available"),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 4:n=null===(r=t[0])||void 0===r?void 0:r.assignedGroup,this.log("onSuccess callback:",n);case 5:if(o=function(e){console.error("onError callback, rerunning Connext if silent:",e),c.rerunConnextIfIsSilent()},i=this.section){e.next=7;break}return e.next=6,ys();case 6:i=e.sent;case 7:return this.section=i,e.prev=8,e.next=9,this.getVisitorType();case 9:if(this.visitorType=e.sent,!(this.useEventListener&&"control"===n||"subscriber"===this.visitorType)){e.next=10;break}return this.log("User is in ".concat(n,", and is ").concat(this.visitorType,". Ending sophi flow.")),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 10:return e.next=11,ls();case 11:if("article"===e.sent){e.next=12;break}return this.log("Page type was not article, returning."),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 12:return e.next=13,cs();case 13:return this.useEventListener&&(window.dataLayer.push({event:"sophi_cookie",sophi_type:"".concat(this.simpleHostname,"UserIsInVariantOrHoldout"),sophi_cookie_val:n}),window.sophiCookie=n),e.next=14,ps();case 14:return this.contentId=e.sent,this.log("Content ID ",this.contentId),e.abrupt("return",!0);case 15:return e.prev=15,a=e.catch(8),o(a),e.abrupt("return",!1);case 16:return e.prev=16,s=e.catch(1),this.log("Event listener",s),this.rerunConnextIfIsSilent(),e.abrupt("return",!1);case 17:case"end":return e.stop()}},e,this,[[1,16],[8,15]])})),function(){return n.apply(this,arguments)})},{key:"rerunConnextIfIsSilent",value:(t=r(l.mark(function e(){return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.log("About to call rerunConnextEntitlements."),e.next=1,window.ConnextUtils.rerunConnextEntitlements(!1,!1);case 1:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"handleSophiResponse",value:function(e){var t=Date.now()-this.sophiCallStartTime;this.log("response with response time of ".concat(t," ms: "),e),delete e.trace;var n="";this.useEventListener||(n=window.sophi.dataLayer.assignedGroup,window.sophiCookie=n),(!this.useEventListener&&"variant"===n||this.useEventListener)&&window.dataLayer.push({event:"sophi_decision",sophi_type:"getDecision",sophi_time:t,sophi_response:JSON.stringify(e)}),window.sophiWallConfig=e,this.rerunConnextIfIsSilent()}},{key:"makeSophiCall",value:(e=r(l.mark(function e(){var t=this;return l.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){var n;try{var r=window.sophi.paywall.init({hostname:t.sophiHostname,getContentId:ps});if(t.log("2.0 SDK init complete: ",r),!window.sophi.paywall)return t.log("window.sophi.paywall was undefined. About to run Connext"),void t.rerunConnextIfIsSilent();t.useEventListener&&(window.dataLayer.push({event:"sophi_cookie",sophi_type:"beforeSDKCall",sophi_cookie_val:window.sophiCookie}),t.log("about to call SDK, cookie is ".concat(window.sophiCookie))),t.sophiCallStartTime=Date.now()}catch(e){t.log("logic error 1",e),t.rerunConnextIfIsSilent()}var o=4e3;""!==(null===(n=window.sophi_config)||void 0===n?void 0:n.sophiGetDesicionTimer)&&"number"!=typeof window.sophi_config.sophiGetDesicionTimer&&(o=parseInt(window.sophi_config.sophiGetDesicionTimer,10)),t.log("timer is equal to: ",o),window.sophi.paywall.getDecision({contentId:t.contentId,section:t.section,visitor:t.visitorType,timeout:o}).then(function(n){t.handleSophiResponse(n),e()}).catch(function(n){var r=Date.now()-t.sophiCallStartTime;t.log("error sdk, response time of ".concat(r," ms: "),n),window.dataLayer.push({event:"sophi_error",sophi_time:r,sophi_err_msg:n}),t.rerunConnextIfIsSilent(),e()})}));case 1:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)})},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n