PageSourceSearch

https://www.porsche.com/pcom-homepage/_astro/phn-header_3.entry.BnCYMBjn.js

js porsche.com collected 2026-09-24 08:24:54 UTC 243,664 bytes, 8 lines download raw bytes

1import{r as Uo,c as oi,s as da,h as W,H as zo,g as ri,F as ua}from"./header.astro_astro_type_script_index_0_lang.DmwYJpv_.js";import{s as Kn,i as pa,c as ma,e as ii}from"./helper-CKediG_O.CdviESET.js";import{D as fa,m as Wo,o as _n,A as jo,n as R,G as Ce,g as lt,i as ai,u as ga,v as si,I as lr,p as hr,a as ya,w as wa,N as ht,b as dt,x as dr,y as ci,t as ur,E as li,z as va,V as ba,d as ka,k as _a,c as Ca,s as Ea}from"./global-data-layer-service-DcEz210F.C_BvDhe1.js";import{f as Sa,e as Nt,N as Dt,S as Ta}from"./content-service-CpItA8z_.BSNiaKjL.js";import{t as xa,b as Pa,f as go}from"./breakpoint-4Nm2fawI.CYolRIwG.js";import{w as he}from"./window-service-CFh7Fx7I.1Jhf6lXA.js";import{n as yt}from"./nav-content-store-e8Dg5Lcb.C-_c0c6H.js";import{s as hi,l as Ra}from"./shop-helper-9_F6mrmj.mSz0a-JG.js";import{routerStore as Be}from"./router-store-BiOGjwn4.BG-SGxjl.js";import{i as Ia,a as Aa}from"./logo-Bgsphcb-.5xKSUZfL.js";import{R as ut}from"./routing-key-BPOnuKCK.BLGE0Npx.js";class Oa{error(e,n){console.error(n),ii(n,e)}}var Le=new Oa;const La="newrelic",Na="dsm-poc-singapore",Da="cayenne-range",Ua="country-redirect-modal",za="configure-on",Wa="light-nav",yn=Ca({features:{}});class ja{constructor(){this.env="local",this.isNewRelicEnabled=()=>this.isFeatureEnabled(La),this.hasPorscheAtJewelsPOC=()=>this.isFeatureEnabled(Na),this.isCayenneRangeEnabled=()=>this.isFeatureEnabled(Da),this.isCountryRedirectModalEnabled=()=>this.isFeatureEnabled(Ua),this.isConfigureOnEnabled=()=>this.isFeatureEnabled(za),this.isLightNavEnabled=()=>this.isFeatureEnabled(Wa)}get features(){return yn.state.features}getBffEndpoint(){const e=lt(this.env),{locale:n}=R.state,o=n.includes("CN")?e.BFF_CN_ENDPOINT:e.BFF_ENDPOINT;return new URL(`/toggles/header?env=${this.env}`,o).toString()}async loadRemoteToggles(){const e=this.getBffEndpoint();try{const n=await fetch(e);if(!n.ok)throw new Error(await n.text());yn.state.features=await n.json()}catch(n){throw new ht(`Load Feature Toggles failed with error: ${String(n)} - ${e}`,dt.GENERAL)}}getUrlFeatureToggleOverride(e){if(typeof window>"u")return null;const n=new URLSearchParams(window.location.search).get(e);return n==="true"?!0:n==="false"?!1:null}isFeatureEnabled(e){const n=this.getUrlFeatureToggleOverride(e);return n!==null?n:this.features[e]?.enabled??!1}async setFeatures(e){this.env=e;try{await this.loadRemoteToggles()}catch(n){Le.error("INIT_APP_CONFIG",n),yn.state.features={}}}}var di=new ja;async function Ka(t){const e=lt(R.state.env),n={method:"GET",headers:{"X-Trace-Id":crypto.randomUUID(),Authorization:`${t}`,Accept:"application/json",Env:R.state.env}};let o;try{o=await fetch(_a(`${e?.BFF_ENDPOINT}/user-information`),n)}catch(r){const i=`Get User information request failed in Frontend with error: ${JSON.stringify(r.message)}`;throw new ht(i,dt.GENERAL)}if(o.status===Ta.unauthorized)throw new ht("AccessToken has expired",dt.UNAUTHORIZED);if(!o.ok){const r=`Get User information request failed in Frontend with error: ${o.status} ${o.statusText}`;throw new ht(r,dt.GENERAL)}return o.json()}function q(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}function tn(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(t):o?o.value:e.get(t)}function pr(t,e,n,o,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}function ui(t,e){this.v=t,this.k=e}function mr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function N(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Ma(t){return new ui(t,0)}function pi(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function f(t,e){return t.get(N(t,e))}function L(t,e,n){pi(t,e),e.set(t,n)}function x(t,e,n){return t.set(N(t,e),n),n}function mi(t,e){pi(t,e),e.add(t)}function b(t,e,n){return(e=(function(o){var r=(function(i,a){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}
1return(a==="string"?String:Number)(i)})(o,"string");return typeof r=="symbol"?r:r+""})(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fr(Object(n),!0).forEach(function(o){b(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fr(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function gr(t,e){if(t==null)return{};var n,o,r=(function(a,s){if(a==null)return{};var c={};for(var h in a)if({}.hasOwnProperty.call(a,h)){if(s.indexOf(h)!==-1)continue;c[h]=a[h]}return c})(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function oe(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,o){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var i,a,s,c,h=[],l=!0,d=!1;try{if(s=(r=r.call(n)).next,o===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=s.call(r)).done)&&(h.push(i.value),h.length!==o);l=!0);}catch(u){d=!0,a=u}finally{try{if(!l&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(d)throw a}}return h}})(t,e)||(function(n,o){if(n){if(typeof n=="string")return mr(n,o);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mr(n,o):void 0}})(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Ha(t){return function(){return new Ut(t.apply(this,arguments))}}function Ut(t){var e,n;function o(i,a){try{var s=t[i](a),c=s.value,h=c instanceof ui;Promise.resolve(h?c.v:c).then(function(l){if(h){var d=i==="return"&&c.k?i:"next";if(!c.k||l.done)return o(d,l);l=t[d](l).value}r(!!s.done,l)},function(l){o("throw",l)})}catch(l){r(2,l)}}function r(i,a){i===2?e.reject(a):e.resolve({value:a,done:i}),(e=e.next)?o(e.key,e.arg):n=null}this._invoke=function(i,a){return new Promise(function(s,c){var h={key:i,arg:a,resolve:s,reject:c,next:null};n?n=n.next=h:(e=n=h,o(i,a))})},typeof t.return!="function"&&(this.return=void 0)}typeof SuppressedError=="function"&&SuppressedError,Ut.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Ut.prototype.next=function(t){return this._invoke("next",t)},Ut.prototype.throw=function(t){return this._invoke("throw",t)},Ut.prototype.return=function(t){return this._invoke("return",t)};const Za={timeoutInSeconds:60},yo=1e4,yr="memory",wo={name:"auth0-spa-js",version:"2.21.1"},fi=()=>Date.now(),G="default";class z extends Error{constructor(e,n){super(n),this.error=e,this.error_description=n,Object.setPrototypeOf(this,z.prototype)}static fromPayload(e){let n=e.error,o=e.error_description;return new z(n,o)}}class Ko extends z{constructor(e,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(e,n),this.state=o,this.appState=r,Object.setPrototypeOf(this,Ko.prototype)}}class Mo extends z{constructor(e,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(e,n),this.connection=o,this.state=r,this.appState=i,Object.setPrototypeOf(this,Mo.prototype)}}class kt extends z{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,kt.prototype)}}class Ho extends kt{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Ho.prototype)}}class Zo extends z{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,Zo.prototype)}}class Jo extends z{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,Jo.prototype)}}class wt extends z{constructor(e,n,o,r){super(e,n),this.mfa_token=o,this.mfa_requirements=r,Object.setPrototypeOf(this,wt.prototype)}}class Ln extends z{constructor(e,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(Cn(e,["default"]),"', scope: '").concat(Cn(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,Ln.prototype)}}class Fo extends z{constructor(e,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(Cn(e,["default"]),"', missing scope: '").concat(Cn(n),"')")),this.audience=e,this.scope=n,Object.setPrototypeOf(this,Fo.prototype)}}class Nn extends z{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,Nn.prototype)}}function Cn(t){return t&&!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).includes(t)?t:""}const En=()=>window.crypto,St=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";for(;e.length<43;){const n=En().getRandomValues(new Uint8Array(43-e.length));for(const o of n)e.length<43&&o<198&&(e+=t[o%66])}return e},Mn=t=>btoa(t),Ja=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],vo=function(t){let e=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(t).reduce((n,o)=>
vendor: 7,087 bytes, line 2
2{if(e&&o==="env")return n;const r=Ja.find(i=>i.key===o);return r&&r.type.includes(typeof t[o])&&(n[o]=t[o]),n},{})},zt=t=>{var e=t.clientId,n=q(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:e},n))).toString()},wr=async t=>await En().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),vr=t=>(e=>decodeURIComponent(atob(e).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),br=t=>{const e=new Uint8Array(t);return(n=>{const o={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>o[r])})(window.btoa(String.fromCharCode(...Array.from(e))))};var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gi={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});var Fa=(function(){function t(){var e=this;this.locked=new Map,this.addToLocked=function(n,o){var r=e.locked.get(n);r===void 0?o===void 0?e.locked.set(n,[]):e.locked.set(n,[o]):o!==void 0&&(r.unshift(o),e.locked.set(n,r))},this.isLocked=function(n){return e.locked.has(n)},this.lock=function(n){return new Promise(function(o,r){e.isLocked(n)?e.addToLocked(n,o):(e.addToLocked(n),o())})},this.unlock=function(n){var o=e.locked.get(n);if(o!==void 0&&o.length!==0){var r=o.pop();e.locked.set(n,o),r!==void 0&&setTimeout(r,0)}else e.locked.delete(n)}}return t.getInstance=function(){return t.instance===void 0&&(t.instance=new t),t.instance},t})();Go.default=function(){return Fa.getInstance()};var ce=qe&&qe.__awaiter||function(t,e,n,o){return new(n||(n=Promise))(function(r,i){function a(h){try{c(o.next(h))}catch(l){i(l)}}function s(h){try{c(o.throw(h))}catch(l){i(l)}}function c(h){h.done?r(h.value):new n(function(l){l(h.value)}).then(a,s)}c((o=o.apply(t,e||[])).next())})},le=qe&&qe.__generator||function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(h){return(function(l){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,o=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||l[0]!==6&&l[0]!==2)){a=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(l[0]===6&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(d){l=[6,d],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}})([c,h])}}},Tt=qe;Object.defineProperty(gi,"__esModule",{value:!0});var $e=Go,Hn="browser-tabs-lock-key",nn={key:function(t){return ce(Tt,void 0,void 0,function(){return le(this,function(e){throw new Error("Unsupported")})})},getItem:function(t){return ce(Tt,void 0,void 0,function(){return le(this,function(e){throw new Error("Unsupported")})})},clear:function(){return ce(Tt,void 0,void 0,function(){return le(this,function(t){return[2,window.localStorage.clear()]})})},removeItem:function(t){return ce(Tt,void 0,void 0,function(){return le(this,function(e){throw new Error("Unsupported")})})},setItem:function(t,e){return ce(Tt,void 0,void 0,function(){return le(this,function(n){throw new Error("Unsupported")})})},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function Zn(t){return new Promise(function(e){return setTimeout(e,t)})}function Jn(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",o=0;o<t;o++)n+=e[Math.floor(61*Math.random())];return n}var Ga=(function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Jn(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=e,t.waiters===void 0&&(t.waiters=[])}return t.prototype.acquireLock=function(e,n){return n===void 0&&(n=5e3),ce(this,void 0,void 0,function(){var o,r,i,a,s,c,h;return le(this,function(l){switch(l.label){case 0:o=Date.now()+Jn(4),r=Date.now()+n,i=Hn+"-"+e,a=this.storageHandler===void 0?nn:this.storageHandler,l.label=1;case 1:return Date.now()<r?[4,Zn(30)]:[3,8];case 2:return l.sent(),a.getItemSync(i)!==null?[3,5]:(s=this.id+"-"+e+"-"+o,[4,Zn(Math.floor(25*Math.random()))]);case 3:return l.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:o,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,Zn(30)];case 4:return l.sent(),(c=a.getItemSync(i))!==null&&(h=JSON.parse(c)).id===this.id&&h.iat===o?(this.acquiredIatSet.add(o),this.refreshLockWhileAcquired(i,o),[2,!0]):[3,7];case 5:return t.lockCorrector(this.storageHandler===void 0?nn:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:l.sent(),l.label=7;case 7:return o=Date.now()+Jn(4),[3,1];case 8:return[2,!1]}})})},t.prototype.refreshLockWhileAcquired=function(e,n){return ce(this,void 0,void 0,function(){var o=this;return le(this,function(r){return setTimeout(function(){return ce(o,void 0,void 0,function(){var i,a,s;return le(this,function(c){switch(c.label){case 0:return[4,$e.default().lock(n)];case 1:return c.sent(),this.acquiredIatSet.has(n)?(i=this.storageHandler===void 0?nn:this.storageHandler,(a=i.getItemSync(e))===null?($e.default().unlock(n),[2]):((s=JSON.parse(a)).timeRefreshed=Date.now(),i.setItemSync(e,JSON.stringify(s)),$e.default().unlock(n),this.refreshLockWhileAcquired(e,n),[2])):($e.default().unlock(n),[2])}})})},1e3),[2]})})},t.prototype.waitForSomethingToChange=function(e){return ce(this,void 0,void 0,function(){return le(this,function(n){switch(n.label){case 0:return[4,new Promise(function(o){var r=!1,i=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),t.removeFromWaiting(s),clearTimeout(c),a=!0),!r){r=!0;var h=50-(Date.now()-i);h>0?setTimeout(o,h):o(null)}}window.addEventListener("storage",s),t.addToWaiting(s);var c=setTimeout(s,Math.max(0,e-Date.now()))})];case 1:return n.sent(),[2]}})})},t.addToWaiting=function(e){this.removeFromWaiting(e),t.waiters!==void 0&&t.waiters.push(e)},t.removeFromWaiting=function(e){t.waiters!==void 0&&(t.waiters=t.waiters.filter(function(n){return n!==e}))},t.notifyWaiters=function(){t.waiters!==void 0&&t.waiters.slice().forEac
2h(function(e){return e()})},t.prototype.releaseLock=function(e){return ce(this,void 0,void 0,function(){return le(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,n.sent()]}})})},t.prototype.releaseLock__private__=function(e){return ce(this,void 0,void 0,function(){var n,o,r,i;return le(this,function(a){switch(a.label){case 0:return n=this.storageHandler===void 0?nn:this.storageHandler,o=Hn+"-"+e,(r=n.getItemSync(o))===null?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,$e.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),$e.default().unlock(i.iat),t.notifyWaiters(),a.label=2;case 2:return[2]}})})},t.lockCorrector=function(e){for(var n=Date.now()-5e3,o=e,r=[],i=0;;){var a=o.keySync(i);if(a===null)break;r.push(a),i++}for(var s=!1,c=0;c<r.length;c++){var h=r[c];if(h.includes(Hn)){var l=o.getItemSync(h);if(l!==null){var d=JSON.parse(l);(d.timeRefreshed===void 0&&d.timeAcquired<n||d.timeRefreshed!==void 0&&d.timeRefreshed<n)&&(o.removeItemSync(h),s=!0)}}}s&&t.notifyWaiters()},t.waiters=void 0,t})(),Va=gi.default=Ga;class Xa{async runWithLock(e,n,o){const r=new AbortController,i=setTimeout(()=>r.abort(),n);try{return await navigator.locks.request(e,{mode:"exclusive",signal:r.signal},async a=>{if(clearTimeout(i),!a)throw new Error("Lock not available");return await o()})}catch(a){throw clearTimeout(i),a?.name==="AbortError"?new kt:a}}}class Ya{constructor(){this.activeLocks=new Set,this.lock=new Va,this.pagehideHandler=()=>{this.activeLocks.forEach(e=>this.lock.releaseLock(e)),this.activeLocks.clear()}}async runWithLock(e,n,o){let r=!1;for(let i=0;i<10&&!r;i++)r=await this.lock.acquireLock(e,n);if(!r)throw new kt;this.activeLocks.add(e),this.activeLocks.size===1&&typeof window<"u"&&window.addEventListener("pagehide",this.pagehideHandler);try{return await o()}finally{this.activeLocks.delete(e),await this.lock.releaseLock(e),this.activeLocks.size===0&&typeof window<"u"&&window.removeEventListener("pagehide",this.pagehideHandler)}}}function Ba(){return typeof navigator<"u"&&typeof((t=navigator.locks)===null||t===void 0?void 0:t.request)=="function"?new Xa:new Ya;var t}let Fn=null;const qa=new TextEncoder,Qa=new TextDecoder;function Kt(t){return typeof t=="string"?qa.encode(t):Qa.decode(t)}function kr(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new es(`${t.name} modulusLength must be at least 2048 bits`)}async function $a(t,e,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const o=`${Mt(Kt(JSON.stringify(t)))}.${Mt(Kt(JSON.stringify(e)))}`;return`${o}.${Mt(await crypto.subtle.sign((function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return kr(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return kr(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new Ge})(n),n,Kt(o)))}`}let bo;Uint8Array.prototype.toBase64?bo=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):bo=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let o=0;o<e.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,e.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Mt(t){return bo(t)}class Ge extends Error{constructor(e){var n;super(e??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class es extends Error{constructor(e){var n;super(e),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function ts(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Ge("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Ge("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Ge("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Ge("unsupported CryptoKey algorithm name")}}function yi(t){return t instanceof CryptoKey}function wi(t){return yi(t)&&t.type==="public"}async function ns(t,e,n,o,r,i){const a=t?.privateKey,s=t?.publicKey;if(!yi(c=a)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!wi(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');
2if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(o!==void 0&&typeof o!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');return $a({alg:ts(a),typ:"dpop+jwt",jwk:await vi(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:o,htu:e,ath:r?Mt(await crypto.subtle.digest("SHA-256",Kt(r))):void 0}),a)}async function vi(t){const{kty:e,e:n,n:o,x:r,y:i,crv:a}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:a,e:n,n:o,x:r,y:i}}const bi="dpop-nonce",os=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","urn:okta:params:oauth:grant-type:webauthn","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function rs(){return(async function(t,e){var n;let o;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":o={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":o={name:"Ed25519"};break;default:throw new Ge}return crypto.subtle.generateKey(o,(n=e?.extractable)!==null&&n!==void 0&&n,["sign","verify"])})("ES256",{extractable:!1})}function is(t){return(async function(e){if(!wi(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await vi(e);let o;switch(n.kty){case"EC":o={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":o={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":o={e:n.e,kty:n.kty,n:n.n};break;default:throw new Ge("unsupported JWK kty")}return Mt(await crypto.subtle.digest({name:"SHA-256"},Kt(JSON.stringify(o))))})(t.publicKey)}function as(t){let e=t.keyPair,n=t.url,o=t.method,r=t.nonce,i=t.accessToken;const a=(function(s){const c=new URL(s);return c.search="",c.hash="",c.href})(n);return ns(e,a,o,r,i)}const ko=(t,e)=>new Promise(function(n,o){const r=new MessageChannel;r.port1.onmessage=function(i){i.data.error?o(new Error(i.data.error)):n(i.data),r.port1.close()},e.postMessage(t,[r.port2])}),ki=(t,e,n)=>{const o=new AbortController;let r;return e.signal=o.signal,Promise.race([fetch(t,e),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},ss=async function(t,e,n,o,r,i){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:yo;return r?(async(s,c,h,l,d,u,p,g,y)=>ko({type:"refresh",auth:{audience:c,scope:h},timeout:d,fetchUrl:s,fetchOptions:l,useFormData:p,useMrrt:g,skipTokenStorage:y},u))(t,e,n,o,a,r,i,arguments.length>7?arguments[7]:void 0,arguments.length>8?arguments[8]:void 0):(async(s,c,h)=>{const l=await ki(s,c,h);return{ok:l.ok,json:await l.json(),headers:(d=l.headers,[...d].reduce((u,p)=>{let g=oe(p,2),y=g[0],w=g[1];return u[y]=w,u},{}))};var d})(t,o,a)};async function _i(t,e,n,o,r,i,a,s,c,h,l){if(c){const S=await c.generateProof({url:t,method:r.method||"GET",nonce:await c.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:S})}let d,u=null;for(let S=0;S<3;S++)try{d=await ss(t,n,o,r,i,a,e,s,l),u=null;break}catch(P){u=P}if(u)throw u;const p=d.json,g=p.error,y=p.error_description,w=q(p,["error","error_description"]),m=d,v=m.headers,_=m.ok;let C;if(c&&(C=v[bi],C&&await c.setNonce(C)),!_){const S=y||"HTTP error. Unable to fetch ".concat(t);if(g==="mfa_required")throw new wt(g,S,w.mfa_token,w.mfa_requirements);if(g==="missing_refresh_token")throw new Ln(n,o);if(g==="use_dpop_nonce"){if(!c||!C||h)throw new Nn(C);return _i(t,e,n,o,r,i,a,s,c,!0,l)}throw new z(g||"request_error",S)}return w}async function _r(t,e,n){var o=t.baseUrl,r=t.timeout,i=t.audience,a=t.scope,s=t.auth0Client,c=t.useFormData,h=t.useMrrt,l=t.dpop,d=q(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const u=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",p=d.grant_type==="urn:okta:params:oauth:grant-type:webauthn",g=d.grant_type==="refresh_token"&&h,y=u||p||g,w=Object.assign(Object.assign(Object.assign({},d),y&&i&&{audience:i}),y&&a&&{scope:a}),m=p||!c,v=m?JSON.stringify(w):zt(w),_=(C=d.grant_type,os.includes(C));var C;return await _i("".concat(o,"/oauth/token"),r,i||G,a,{method:"POST",body:v,headers:{"Content-Type":m?"application/json":"application/x-www-form-urlencoded","Auth0-Client":btoa(JSON.stringify(vo(s||wo)))}},e,c,h,_?l:void 0,void 0,n)}const wn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return(o=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(o))).join(" ");var o},xt=(t,e,n)=>{let o;return n&&(o=t[n]),o||(o=t[G]),wn(o,e)},Ve="@@auth0spajs@@",ot="@@user@@";class Q{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ve,o=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=o,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(
2Boolean).join("::")}static fromKey(e){const n=oe(e.split("::"),4),o=n[0],r=n[1],i=n[2],a=n[3];return new Q({clientId:r,scope:a,audience:i},o)}static fromCacheEntry(e){const n=e.scope,o=e.audience,r=e.client_id;return new Q({scope:n,audience:o,clientId:r})}}class cs{set(e,n){localStorage.setItem(e,JSON.stringify(n))}get(e){const n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith(Ve))}}class Ci{constructor(){this.enclosedCache=(function(){let e={};return{set(n,o){e[n]=o},get(n){const o=e[n];if(o)return o},remove(n){delete e[n]},allKeys:()=>Object.keys(e)}})()}}class ls{constructor(e,n,o){this.cache=e,this.keyManifest=n,this.nowProvider=o||fi}async setIdToken(e,n,o){var r;const i=this.getIdTokenCacheKey(e);await this.cache.set(i,{id_token:n,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(e){const n=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!n&&e.scope&&e.audience){const o=await this.get(e);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var i;let a=await this.cache.get(e.toKey()),s=e;if(!a){const l=await this.getCacheKeys();if(!l)return;const d=this.matchExistingCacheKey(e,l);if(d&&(a=await this.cache.get(d),s=Q.fromKey(d)),!a&&o&&r!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!a)return;const c=await this.nowProvider(),h=Math.floor(c/1e3);return a.expiresAt-n<h?a.body.refresh_token?this.modifiedCachedEntry(a,s):(await this.cache.remove(s.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(s.toKey()))):a.body}async modifiedCachedEntry(e,n){const o={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},r={body:o,expiresAt:e.expiresAt};return await this.cache.set(n.toKey(),r),{refresh_token:o.refresh_token,audience:o.audience,scope:o.scope}}async set(e){var n;const o=new Q({clientId:e.client_id,scope:e.scope,audience:e.audience}),r=await this.wrapCacheEntry(e);await this.cache.set(o.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(o.toKey()))}async remove(e,n,o){const r=new Q({clientId:e,scope:o,audience:n});await this.cache.remove(r.toKey())}async stripRefreshToken(e){var n;const o=await this.getCacheKeys();if(o)for(const r of o){const i=await this.cache.get(r);((n=i?.body)===null||n===void 0?void 0:n.refresh_token)===e&&(delete i.body.refresh_token,await this.cache.set(r,i))}}async clear(e){var n;const o=await this.getCacheKeys();o&&(await o.filter(r=>!e||r.includes(e)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(e){const n=await this.nowProvider();return{body:e,expiresAt:Math.floor(n/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new Q({clientId:e},Ve,ot).toKey()}matchExistingCacheKey(e,n){return n.filter(o=>{var r;const i=Q.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),s=((r=e.scope)===null||r===void 0?void 0:r.split(" "))||[],c=i.scope&&s.reduce((h,l)=>h&&a.has(l),!0);return i.prefix===Ve&&i.clientId===e.clientId&&i.audience===e.audience&&c})[0]}async getEntryWithRefreshToken(e,n){var o;for(const r of n){const i=Q.fromKey(r);if(i.prefix===Ve&&i.clientId===e.clientId){const a=await this.cache.get(r);if(!((o=a?.body)===null||o===void 0)&&o.refresh_token)return{refresh_token:a.body.refresh_token,audience:a.body.audience,scope:a.body.scope}}}}async getRefreshTokensByAudience(e,n){var o;const r=await this.getCacheKeys();if(!r)return[];const i=new Set;for(const a of r){const s=Q.fromKey(a);if(s.prefix===Ve&&s.clientId===n&&s.audience===e){const c=await this.cache.get(a);!((o=c?.body)===null||o===void 0)&&o.refresh_token&&i.add(c.body.refresh_token)}}return Array.from(i)}async updateEntry(e,n){var o;const r=await this.getCacheKeys();if(r)for(const i of r){const a=await this.cache.get(i);((o=a?.body)===null||o===void 0?void 0:o.refresh_token)===e&&(a.body.refresh_token=n,await this.cache.set(i,a))}}}class hs{constructor(e,n,o){this.storage=e,this.clientId=n,this.cookieDomain=o,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Pt=t=>typeof t=="number",ds=["iss","aud","exp","nbf","iat","jti","azp","
2nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],us=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const a=i.split("."),s=oe(a,3),c=s[0],h=s[1],l=s[2];if(a.length!==3||!c||!h||!l)throw new Error("ID token could not be decoded");const d=JSON.parse(vr(h)),u={__raw:i},p={};return Object.keys(d).forEach(g=>{u[g]=d[g],ds.includes(g)||(p[g]=d[g])}),{encoded:{header:c,payload:h,signature:l},header:JSON.parse(vr(c)),claims:u,user:p}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(t.iss,'", found "').concat(e.claims.iss,'"'));if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(e.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but was not one of "').concat(e.claims.aud.join(", "),'"'));if(e.claims.aud.length>1){if(!e.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(e.claims.azp!==t.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(t.aud,'", found "').concat(e.claims.azp,'"'))}}else if(e.claims.aud!==t.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(t.aud,'" but found "').concat(e.claims.aud,'"'));if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(t.nonce,'", found "').concat(e.claims.nonce,'"'))}if(t.max_age&&!Pt(e.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(e.claims.exp==null||!Pt(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Pt(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(e.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(e.claims.nbf!=null&&Pt(e.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(e.claims.nbf-n),o<i)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (".concat(o,") is before ").concat(i))}if(e.claims.auth_time!=null&&Pt(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+n),o>i)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (".concat(o,") is after last auth at ").concat(i))}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==e.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(e.claims.org_id,'"'))}else{const a=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==e.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(e.claims.org_name,'"'))}}return e};var Ft=qe&&qe.__assign||function(){return Ft=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ft.apply(this,arguments)};function Rt(t,e){if(!e)return"";var n="; "+t;return e===!0?n:n+"="+e}function ps(t,e,n){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decode
2URIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(o){if(typeof o.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}return Rt("Expires",o.expires?o.expires.toUTCString():"")+Rt("Domain",o.domain)+Rt("Path",o.path)+Rt("Secure",o.secure)+Rt("SameSite",o.sameSite)})(n)}function ms(){return(function(t){for(var e={},n=t?t.split("; "):[],o=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");a.charAt(0)==='"'&&(a=a.slice(1,-1));try{e[i[0].replace(o,decodeURIComponent)]=a.replace(o,decodeURIComponent)}catch{}}return e})(document.cookie)}var fs=function(t){return ms()[t]};function Ei(t,e,n){document.cookie=ps(t,e,Ft({path:"/"},n))}var Si=Ei,Ti=function(t,e){Ei(t,"",Ft(Ft({},e),{expires:-1}))};const rt={get(t){const e=fs(t);if(e!==void 0)return JSON.parse(e)},save(t,e,n){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),n?.daysUntilExpire&&(o.expires=n.daysUntilExpire),n?.cookieDomain&&(o.domain=n.cookieDomain),Si(t,JSON.stringify(e),o)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),Ti(t,n)}},Gn="_legacy_",gs={get(t){return rt.get(t)||rt.get("".concat(Gn).concat(t))},save(t,e,n){let o={};window.location.protocol==="https:"&&(o={secure:!0}),n?.daysUntilExpire&&(o.expires=n.daysUntilExpire),n?.cookieDomain&&(o.domain=n.cookieDomain),Si("".concat(Gn).concat(t),JSON.stringify(e),o),rt.save(t,e,n)},remove(t,e){let n={};e?.cookieDomain&&(n.domain=e.cookieDomain),Ti(t,n),rt.remove(t,e),rt.remove("".concat(Gn).concat(t),e)}},ys={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Fe;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Fe||(Fe={}));function ws(t,e,n){var o=e===void 0?null:e,r=(function(c,h){var l=atob(c);if(h){for(var d=new Uint8Array(l.length),u=0,p=l.length;u<p;++u)d[u]=l.charCodeAt(u);return String.fromCharCode.apply(null,new Uint16Array(d.buffer))}return l})(t,n!==void 0&&n),i=r.indexOf(`
3`,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var Cr,Er,Sr,Vn,vs=(Cr="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7ZnVuY3Rpb24gZShlLHQpeyhudWxsPT10fHx0PmUubGVuZ3RoKSYmKHQ9ZS5sZW5ndGgpO2Zvcih2YXIgcj0wLG89QXJyYXkodCk7cjx0O3IrKylvW3JdPWVbcl07cmV0dXJuIG99ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBmdW5jdGlvbihlKXtpZihBcnJheS5pc0FycmF5KGUpKXJldHVybiBlfSh0KXx8ZnVuY3Rpb24oZSx0KXt2YXIgcj1udWxsPT1lP251bGw6InVuZGVmaW5lZCIhPXR5cGVvZiBTeW1ib2wmJmVbU3ltYm9sLml0ZXJhdG9yXXx8ZVsiQEBpdGVyYXRvciJdO2lmKG51bGwhPXIpe3ZhciBvLG4scyxpLGE9W10sYz0hMCxsPSExO3RyeXtpZihzPShyPXIuY2FsbChlKSkubmV4dCwwPT09dCl7aWYoT2JqZWN0KHIpIT09cilyZXR1cm47Yz0hMX1lbHNlIGZvcig7IShjPShvPXMuY2FsbChyKSkuZG9uZSkmJihhLnB1c2goby52YWx1ZSksYS5sZW5ndGghPT10KTtjPSEwKTt9Y2F0Y2goZSl7bD0hMCxuPWV9ZmluYWxseXt0cnl7aWYoIWMmJm51bGwhPXIucmV0dXJuJiYoaT1yLnJldHVybigpLE9iamVjdChpKSE9PWkpKXJldHVybn1maW5hbGx5e2lmKGwpdGhyb3cgbn19cmV0dXJuIGF9fSh0LHIpfHxmdW5jdGlvbih0LHIpe2lmKHQpe2lmKCJzdHJpbmciPT10eXBlb2YgdClyZXR1cm4gZSh0LHIpO3ZhciBvPXt9LnRvU3RyaW5nLmNhbGwodCkuc2xpY2UoOCwtMSk7cmV0dXJuIk9iamVjdCI9PT1vJiZ0LmNvbnN0cnVjdG9yJiYobz10LmNvbnN0cnVjdG9yLm5hbWUpLCJNYXAiPT09b3x8IlNldCI9PT1vP0FycmF5LmZyb20odCk6IkFyZ3VtZW50cyI9PT1vfHwvXig/OlVpfEkpbnQoPzo4fDE2fDMyKSg/OkNsYW1wZWQpP0FycmF5JC8udGVzdChvKT9lKHQscik6dm9pZCAwfX0odCxyKXx8ZnVuY3Rpb24oKXt0aHJvdyBuZXcgVHlwZUVycm9yKCJJbnZhbGlkIGF0dGVtcHQgdG8gZGVzdHJ1Y3R1cmUgbm9uLWl0ZXJhYmxlIGluc3RhbmNlLlxuSW4gb3JkZXIgdG8gYmUgaXRlcmFibGUsIG5vbi1hcnJheSBvYmplY3RzIG11c3QgaGF2ZSBhIFtTeW1ib2wuaXRlcmF0b3JdKCkgbWV0aG9kLiIpfSgpfWNsYXNzIHIgZXh0ZW5kcyBFcnJvcntjb25zdHJ1Y3RvcihlLHQpe3N1cGVyKHQpLHRoaXMuZXJyb3I9ZSx0aGlzLmVycm9yX2Rlc2NyaXB0aW9uPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsci5wcm90b3R5cGUpfXN0YXRpYyBmcm9tUGF5bG9hZChlKXtsZXQgdD1lLmVycm9yLG89ZS5lcnJvcl9kZXNjcmlwdGlvbjtyZXR1cm4gbmV3IHIodCxvKX19Y2xhc3MgbyBleHRlbmRzIHJ7Y29uc3RydWN0b3IoZSx0KXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIiwiTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyIuY29uY2F0KG4oZSxbImRlZmF1bHQiXSksIicsIHNjb3BlOiAnIikuY29uY2F0KG4odCksIicpIikpLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXQsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsby5wcm90b3R5cGUpfX1mdW5jdGlvbiBuKGUpe3JldHVybiBlJiYhKGFyZ3VtZW50cy5sZW5ndGg+MSYmdm9pZCAwIT09YXJndW1lbnRzWzFdP2FyZ3VtZW50c1sxXTpbXSkuaW5jbHVkZXMoZSk/ZToiIn0iZnVuY3Rpb24iPT10eXBlb2YgU3VwcHJlc3NlZEVycm9yJiZTdXBwcmVzc2VkRXJyb3I7Y29uc3Qgcz1lPT57dmFyIHQ9ZS5jbGllbnRJZCxyPWZ1bmN0aW9uKGUsdCl7dmFyIHI9e307Zm9yKHZhciBvIGluIGUpT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGUsbykmJnQuaW5kZXhPZihvKTwwJiYocltvXT1lW29dKTtpZihudWxsIT1lJiYiZnVuY3Rpb24iPT10eXBlb2YgT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scyl7dmFyIG49MDtmb3Iobz1PYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKGUpO248by5sZW5ndGg7bisrKXQuaW5kZXhPZihvW25dKTwwJiZPYmplY3QucHJvdG90eXBlLnByb3BlcnR5SXNFbnVtZXJhYmxlLmNhbGwoZSxvW25dKSYmKHJbb1tuXV09ZVtvW25dXSl9cmV0dXJuIHJ9KGUsWyJjbGllbnRJZCJdKTtyZXR1cm4gbmV3IFVSTFNlYXJjaFBhcmFtcygoZT0+T2JqZWN0LmtleXMoZSkuZmlsdGVyKHQ9PnZvaWQgMCE9PWVbdF0pLnJlZHVjZSgodCxyKT0+T2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHQpLHtbcl06ZVtyXX0pLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmc
3oKX07bGV0IGk9e30sYT1udWxsO2NvbnN0IGM9KGUsdCk9PiIiLmNvbmNhdChlLCJ8IikuY29uY2F0KHQpLGw9KGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSx1PWU9PntPYmplY3QuZW50cmllcyhpKS5mb3JFYWNoKHI9PntsZXQgbz10KHIsMiksbj1vWzBdO29bMV09PT1lJiZkZWxldGUgaVtuXX0pfSxmPWU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0sZD1hc3luYyBlPT57bGV0IHIsbixhPWUuZGF0YSx1PWEudGltZW91dCxkPWEuYXV0aCxoPWEuZmV0Y2hVcmwscD1hLmZldGNoT3B0aW9ucyx5PWEudXNlRm9ybURhdGEsZz1hLnVzZU1ycnQsYj1hLnNraXBUb2tlblN0b3JhZ2UsTz10KGUucG9ydHMsMSlbMF0saz17fTtjb25zdCBtPWR8fHt9LGo9bS5hdWRpZW5jZSx2PW0uc2NvcGU7dHJ5e2NvbnN0IGU9eT9mKHAuYm9keSk6SlNPTi5wYXJzZShwLmJvZHkpO2lmKCFlLnJlZnJlc2hfdG9rZW4mJiJyZWZyZXNoX3Rva2VuIj09PWUuZ3JhbnRfdHlwZSl7aWYobj0oKGUsdCk9PmlbYyhlLHQpXSkoaix2KSwhbiYmZyl7Y29uc3QgZT1pLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT4hIU9iamVjdC5rZXlzKGkpLmZpbmQocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBvPWwodCxyKSxuPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLHM9ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm4uaW5jbHVkZXMoZSkpO3JldHVybiBvJiZzfX0pKSh2LGopO2UmJiF0JiYobj1lKX1pZighbil0aHJvdyBuZXcgbyhqLHYpO3AuYm9keT15P3MoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LGUpLHtyZWZyZXNoX3Rva2VuOm59KSl9bGV0IGEsZDsiZnVuY3Rpb24iPT10eXBlb2YgQWJvcnRDb250cm9sbGVyJiYoYT1uZXcgQWJvcnRDb250cm9sbGVyLHAuc2lnbmFsPWEuc2lnbmFsKTt0cnl7ZD1hd2FpdCBQcm9taXNlLnJhY2UoWyhNPXUsbmV3IFByb21pc2UoZT0+c2V0VGltZW91dChlLE0pKSksZmV0Y2goaCxPYmplY3QuYXNzaWduKHt9LHApKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIE8ucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFkKXJldHVybiBhJiZhLmFib3J0KCksdm9pZCBPLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2lmKFM9ZC5oZWFkZXJzLGs9Wy4uLlNdLnJlZHVjZSgoZSxyKT0+e2xldCBvPXQociwyKSxuPW9bMF0scz1vWzFdO3JldHVybiBlW25dPXMsZX0se30pLHI9YXdhaXQgZC5qc29uKCksYilyZXR1cm4gZGVsZXRlIHIucmVmcmVzaF90b2tlbix2b2lkIE8ucG9zdE1lc3NhZ2Uoe29rOmQub2ssanNvbjpyLGhlYWRlcnM6a30pO3IucmVmcmVzaF90b2tlbj8oZyYmKGkubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLF89bix3PXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhpKS5mb3JFYWNoKGU9PntsZXQgcj10KGUsMiksbz1yWzBdO3JbMV09PT1fJiYoaVtvXT13KX0pKSwoKGUsdCxyKT0+e2lbYyh0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLGosdiksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIGlbYyhlLHQpXX0pKGosdiksTy5wb3N0TWVzc2FnZSh7b2s6ZC5vayxqc29uOnIsaGVhZGVyczprfSl9Y2F0Y2goZSl7Ty5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6a30pfXZhciBfLHcsUyxNfSxoPWFzeW5jIGU9PntsZXQgcj1lLmRhdGEsbz1yLnRpbWVvdXQsbj1yLmF1dGgsYT1yLmZldGNoVXJsLGM9ci5mZXRjaE9wdGlvbnMsZD1yLnVzZUZvcm1EYXRhLGg9dChlLnBvcnRzLDEpWzBdO2NvbnN0IHA9KG58fHt9KS5hdWRpZW5jZTt0cnl7Y29uc3QgZT0oZT0+e2NvbnN0IHI9bmV3IFNldDtyZXR1cm4gT2JqZWN0LmVud
3HJpZXMoaSkuZm9yRWFjaChvPT57bGV0IG49dChvLDIpLHM9blswXSxpPW5bMV07bChlLHMpJiZyLmFkZChpKX0pLEFycmF5LmZyb20ocil9KShwKTtpZigwPT09ZS5sZW5ndGgpcmV0dXJuIHZvaWQgaC5wb3N0TWVzc2FnZSh7b2s6ITB9KTtjb25zdCByPWQ/ZihjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtmb3IoY29uc3QgdCBvZiBlKXtjb25zdCBlPWQ/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3Rva2VuOnR9KSk6SlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihPYmplY3QuYXNzaWduKHt9LHIpLHt0b2tlbjp0fSkpO2xldCBuLGksbCxmOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihuPW5ldyBBYm9ydENvbnRyb2xsZXIsaT1uLnNpZ25hbCk7dHJ5e2Y9YXdhaXQgUHJvbWlzZS5yYWNlKFtuZXcgUHJvbWlzZShlPT57bD1zZXRUaW1lb3V0KGUsbyl9KSxmZXRjaChhLE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxjKSx7Ym9keTplLHNpZ25hbDppfSkpXSkuZmluYWxseSgoKT0+Y2xlYXJUaW1lb3V0KGwpKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBoLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZilyZXR1cm4gbiYmbi5hYm9ydCgpLHZvaWQgaC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtpZighZi5vayl7bGV0IGU7dHJ5e2NvbnN0IHQ9SlNPTi5wYXJzZShhd2FpdCBmLnRleHQoKSk7ZT10LmVycm9yX2Rlc2NyaXB0aW9ufWNhdGNoKGUpe31yZXR1cm4gdm9pZCBoLnBvc3RNZXNzYWdlKHtlcnJvcjplfHwiSFRUUCBlcnJvciAiLmNvbmNhdChmLnN0YXR1cyl9KX11KHQpfWgucG9zdE1lc3NhZ2Uoe29rOiEwfSl9Y2F0Y2goZSl7aC5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfHwiVW5rbm93biBlcnJvciBkdXJpbmcgdG9rZW4gcmV2b2NhdGlvbiJ9KX19LHA9KGUsdCk9PntpZighYSlyZXR1cm4hMTt0cnl7Y29uc3Qgcj1uZXcgVVJMKGEpLm9yaWdpbixvPW5ldyBVUkwoZS5mZXRjaFVybCk7cmV0dXJuIG8ub3JpZ2luPT09ciYmby5wYXRobmFtZT09PXR9Y2F0Y2goZSl7cmV0dXJuITF9fTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixlPT57Y29uc3Qgcj1lLmRhdGEsbz10KGUucG9ydHMsMSlbMF07aWYoISgidHlwZSJpbiByKXx8ImluaXQiIT09ci50eXBlKXJldHVybiJ0eXBlImluIHImJiJjbGVhciI9PT1yLnR5cGU/KGk9e30sdm9pZChudWxsPT1vfHxvLnBvc3RNZXNzYWdlKHtvazohMH0pKSk6InR5cGUiaW4gciYmInJldm9rZSI9PT1yLnR5cGU/cChyLCIvb2F1dGgvcmV2b2tlIik/dm9pZCBoKGUpOnZvaWQobnVsbD09b3x8by5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ImludmFsaWRfZmV0Y2hfdXJsIixlcnJvcl9kZXNjcmlwdGlvbjoiVW5hdXRob3JpemVkIGZldGNoIFVSTCJ9LGhlYWRlcnM6e319KSk6dm9pZCgiZmV0Y2hVcmwiaW4gciYmcChyLCIvb2F1dGgvdG9rZW4iKT9kKGUpOm51bGw9PW98fG8ucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOiJpbnZhbGlkX2ZldGNoX3VybCIsZXJyb3JfZGVzY3JpcHRpb246IlVuYXV0aG9yaXplZCBmZXRjaCBVUkwifSxoZWFkZXJzOnt9fSkpO2lmKG51bGw9PT1hKXRyeXtuZXcgVVJMKHIuYWxsb3dlZEJhc2VVcmwpLGE9ci5hbGxvd2VkQmFzZVVybH1jYXRjaChlKXtyZXR1cm59fSl9KCk7Cgo=",Er=null,Sr=!1,function(t){return Vn=Vn||ws(Cr,Er,Sr),new Worker(Vn,t)});const Xn={};class bs{constructor(e,n){this.cache=e,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var n;const o=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);o.add(e),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(e){const n=await this.cache.get(this.manifestKey);if(n){const o=new Set(n.keys);return o.delete(e),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return"".concat(Ve,"::").concat(e)}}const Tr="auth0.is.authenticated",ks={memory:()=>new Ci().enclosedCache,localstorage:()=>new cs},xr=t=>ks[t],Pr=t=>{const e=t.openUrl,n=t.onRedirect,o=q(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:e===!1||e?e:n})},Rr=(t,e)=>{const n=e?.split(" ")||[];return(t?.split(" ")||[]).every(o=>n.includes(o))},We={NONCE:"nonce",KEYPAIR:"keypair"};class _s{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,o)=>{e.onupgradeneeded=()=>Object.values(We).forEach(r=>e.result.createObjectStore(r)),e.onerror=()=>o(e.error),e.onsuccess=()=>n(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,n,o){const r=o((await this.getDbHandle()).transaction(e,n).objectStore(e));return new Promise((i,a)=>{r.onsuccess=()=>i(r.result),r.onerror=()=>a(r.error)})}buildKey(e){const n=e?"_".concat(e):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(e,n){return this.save(We.NONCE,this.buildKey(n),e)}setKeyPair(e){return this.save(We.KEYPAIR,this.buildKey(),e)}async save(e,n,o){await this.executeDbRequest(e,"readwrite",r=>r.put(o,n))}findNonce(e){return this.find(We.NONCE,this.buildKey(e))}findKeyPair(){return this.find(We.KEYPAIR,this.buildKey())}find(e,n){return this.executeDbRequest(e,"readonly",o=>o.get(n))}async deleteBy(e,n){const o=await this.executeDbRequest(e,"readonly",r=>r.getAllKeys());await Promise.all(o?.filter(n).map(r=>this.executeDbRequest(e,"readwrite",i=>i.delete(r)))||[])}deleteByClientId(e,n){return this.deleteBy(e,o=>
3typeof o=="string"&&o.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(We.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(We.KEYPAIR,this.clientId)}}class Cs{constructor(e){this.storage=new _s(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,n){return this.storage.setNonce(e,n)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await rs(),await this.storage.setKeyPair(e)),e}async generateProof(e){const n=await this.getOrGenerateKeyPair();return as(Object.assign({keyPair:n},e))}async calculateThumbprint(){return is(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var it;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(it||(it={}));class Es{constructor(e,n){this.hooks=n,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,n){if(n){if(this.isAbsoluteUrl(n))return n;if(e)return"".concat(e.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,n){if(!this.config.baseUrl)return new Request(e,n);const o=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(o,e):o;return new Request(r,n)}setAuthorizationHeader(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:it.Bearer;e.headers.set("authorization","".concat(o," ").concat(n))}async setDpopProofHeader(e,n){if(!this.config.dpopNonceId)return;const o=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:e.method,nonce:o,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,n){const o=await this.getAccessToken(n);let r,i;typeof o=="string"?(r=this.config.dpopNonceId?it.DPoP:it.Bearer,i=o):(r=o.token_type,i=o.access_token),this.setAuthorizationHeader(e,i,r),r===it.DPoP&&await this.setDpopProofHeader(e,i)}getHeader(e,n){return Array.isArray(e)?new Headers(e).get(n)||"":typeof e.get=="function"?e.get(n)||"":e[n]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const n=this.getHeader(e.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(e,n){const o=this.getHeader(e.headers,bi);if(o&&await this.hooks.setDpopNonce(o),!this.hasUseDpopNonceError(e))return e;if(!o||!n.onUseDpopNonceError)throw new Nn(o);return n.onUseDpopNonceError()}async internalFetchWithAuth(e,n,o,r){const i=this.buildBaseRequest(e,n);await this.prepareRequest(i,r);const a=await this.config.fetch(i);return this.handleResponse(a,o)}fetchWithAuth(e,n,o){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),o)};return this.internalFetchWithAuth(e,n,r,o)}}class Ss{constructor(e,n){this.myAccountFetcher=e,this.apiBase=n}async connectAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async completeAccount(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:connected_accounts"]});return this._handleResponse(n)}async getFactors(){const e=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/factors"),{method:"GET"},{scope:["read:me:factors"]});return(await this._handleResponse(e)).factors}async getAuthenticationMethods(e){const n=e?"?".concat(new URLSearchParams({type:e})):"",o=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods").concat(n),{method:"GET"},{scope:["read:me:authentication_methods"]});return(await this._handleResponse(o)).authentication_methods}async getAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"GET"},{scope:["read:me:authentication_methods"]});return this._handleResponse(n)}async deleteAuthenticationMethod(e){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"DELETE"},{scope:["delete:me:authentication_methods"]});n.ok||await this._handleResponse(n)}async updateAuthenticationMethod(e,n){const o=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods/").concat(encodeURIComponent(e)),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)},{scope:["update:me:authentication_methods"]});return this._handleResponse(o)}async enrollmentChallenge(e){var n;const o=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/authentication-methods"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},{scope:["create:me:authentication_methods"]}),r=await this._handleResponse(o),i=(n=o.headers.get("location"))!==null&&n!==void 0?n:"",a=decodeURIComponent(i.split("/").pop()||"");return Object.assign(Object.assign({},r),{id:a,location:i})}async enrollmentVerify(e){const n=e,o=n.location,r=q(n,["location","type"]),i=await this.myAccountFetcher.fetchWithAuth("".concat(o,"/verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},{scope:["create:me:authentication_methods"]});return this._handleResponse(i)}async _handleResponse(e){let n;try{n=await e.text(),n=JSON.parse(n)}catch(o){throw new Sn({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:n||String(o)})}if(e.ok)return n;throw new Sn(n)}}
3class Sn extends Error{constructor(e){let n=e.type,o=e.status,r=e.title,i=e.detail,a=e.validation_errors;super(i),this.name="MyAccountApiError",this.type=n,this.status=o,this.title=r,this.detail=i,this.validation_errors=a,Object.setPrototypeOf(this,Sn.prototype)}}const Ts={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},xs="http://auth0.com/oauth/grant-type/mfa-otp",Ps="http://auth0.com/oauth/grant-type/mfa-oob",Rs="http://auth0.com/oauth/grant-type/mfa-recovery-code";var on,Yn;let _o;(typeof navigator>"u"||(on=navigator.userAgent)===null||on===void 0||(Yn=on.startsWith)===null||Yn===void 0||!Yn.call(on,"Mozilla/5.0 "))&&(_o="".concat("oauth4webapi","/").concat("v3.8.6"));function _t(t,e){if(t==null)return!1;try{return t instanceof e||Object.getPrototypeOf(t)[Symbol.toStringTag]===e.prototype[Symbol.toStringTag]}catch{return!1}}const V="ERR_INVALID_ARG_VALUE",$="ERR_INVALID_ARG_TYPE";function D(t,e,n){const o=new TypeError(t,{cause:n});return Object.assign(o,{code:e}),o}const re=Symbol(),Co=Symbol(),Eo=Symbol(),pe=Symbol(),xe=Symbol(),Is=new TextEncoder,As=new TextDecoder;function pt(t){return typeof t=="string"?Is.encode(t):As.decode(t)}let So,xi;Uint8Array.prototype.toBase64?So=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):So=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const n=[];for(let o=0;o<e.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,e.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Xe(t){return typeof t=="string"?xi(t):So(t)}xi=Uint8Array.fromBase64?t=>{try{return Uint8Array.fromBase64(t,{alphabet:"base64url"})}catch(e){throw D("The input to be decoded is not correctly encoded.",V,e)}}:t=>{try{const e=atob(t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}catch(e){throw D("The input to be decoded is not correctly encoded.",V,e)}};class te extends Error{constructor(e,n){var o;super(e,n),b(this,"code",void 0),this.name=this.constructor.name,this.code=Po,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Vo extends Error{constructor(e,n){var o;super(e,n),b(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n?.code),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function T(t,e,n){return new Vo(t,{code:e,cause:n})}function Os(t,e){if((function(n,o){if(!(n instanceof CryptoKey))throw D("".concat(o," must be a CryptoKey"),$)})(t,e),t.type!=="private")throw D("".concat(e," must be a private CryptoKey"),V)}function Tn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Dn(t){_t(t,Headers)&&(t=Object.fromEntries(t.entries()));const e=new Headers(t??{});if(_o&&!e.has("user-agent")&&e.set("user-agent",_o),e.has("authorization"))throw D('"options.headers" must not include the "authorization" header name',V);return e}function Pi(t,e){if(e!==void 0){if(typeof e=="function"&&(e=e(t.href)),!(e instanceof AbortSignal))throw D('"options.signal" must return or be an instance of AbortSignal',$);return e}}function Ir(t){return t.includes("//")?t.replace("//","/"):t}async function Ls(t,e){return(async function(n,o,r,i){if(!(n instanceof URL))throw D('"'.concat(o,'" must be an instance of URL'),$);Xo(n,i?.[re]!==!0);const a=r(new URL(n.href)),s=Dn(i?.headers);return s.set("accept","application/json"),(i?.[pe]||fetch)(a.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:Pi(a,i?.signal)})})(t,"issuerIdentifier",n=>{switch(e?.algorithm){case void 0:case"oidc":(function(o,r){o.pathname=Ir("".concat(o.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(o,r){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];o.pathname==="/"?o.pathname=r:o.pathname=Ir("".concat(r,"/").concat(i?o.pathname:o.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw D('"options.algorithm" must be "oidc" (default), or "oauth2"',V)}return n},e)}function De(t,e,n,o,r){try{if(typeof t!="number"||!Number.isFinite(t))throw D("".concat(n," must be a number"),$,r);if(t>0)return;if(e){if(t!==0)throw D("".concat(n," must be a non-negative number"),V,r);return}throw D("".concat(n," must be a positive number"),V,r)}catch(i){throw o?T(i.message,o,r):i}}function M(t,e,n,o){try{if(typeof t!="string")throw D("".concat(e," must be a string"),$,o);if(t.length===0)throw D("".concat(e," must not be empty"),V,o)}catch(r){throw n?T(r.message,n,o):r}}function Ri(t){(function(e,n){if(Li(e)!==n)throw(function(o){let r='"response" content-type must be ';for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(a.length>2){const c=a.pop();r+="".concat(a.join(", "),", or ").concat(c)}else a.length===2?r+="".concat(a[0]," or ").concat(a[1]):r+=a[0];return T(r,Di,o)})(e,n)})(t,"application/json")}function Ii(){return Xe(crypto.getRandomValues(new Uint8Array(32)))}function Ns(t){switch(t.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 te("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);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 te("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}})(t);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 te("unsupported EcKeyAlgorithm namedCurve",{cause:e})}})(t);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return t.algorithm.name;case"EdDSA":return"Ed25519";default:throw new te("unsupported CryptoKey algorithm name",{cause:t})}}function xn(t){const e=t?.[Co];return typeof e=="number"&&Number.isFinite(e)?e:0}
3function To(t){const e=t?.[Eo];return typeof e=="number"&&Number.isFinite(e)&&Math.sign(e)!==-1?e:30}function Pn(){return Math.floor(Date.now()/1e3)}function de(t){if(typeof t!="object"||t===null)throw D('"as" must be an object',$);M(t.issuer,'"as.issuer"')}function ue(t){if(typeof t!="object"||t===null)throw D('"client" must be an object',$);M(t.client_id,'"client.client_id"')}function Ar(t){return M(t,'"clientSecret"'),(e,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",t)}}function Ds(t,e){const n=(i=t)instanceof CryptoKey?{key:i}:i?.key instanceof CryptoKey?(i.kid!==void 0&&M(i.kid,'"kid"'),{key:i.key,kid:i.kid}):{},o=n.key,r=n.kid;var i;return Os(o,'"clientPrivateKey.key"'),async(a,s,c,h)=>{const l={alg:Ns(o),kid:r},d=(function(u,p){const g=Pn()+xn(p);return{jti:Ii(),aud:u.issuer,exp:g+60,iat:g,nbf:g,iss:p.client_id,sub:p.client_id}})(a,s);c.set("client_id",s.client_id),c.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),c.set("client_assertion",await(async function(u,p,g){if(!g.usages.includes("sign"))throw D('CryptoKey instances used for signing assertions must include "sign" in their "usages"',V);const y="".concat(Xe(pt(JSON.stringify(u))),".").concat(Xe(pt(JSON.stringify(p)))),w=Xe(await crypto.subtle.sign((function(m){switch(m.algorithm.name){case"ECDSA":return{name:m.algorithm.name,hash:ec(m)};case"RSA-PSS":switch(Nr(m),m.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:m.algorithm.name,saltLength:parseInt(m.algorithm.hash.name.slice(-3),10)>>3};default:throw new te("unsupported RSA-PSS hash name",{cause:m})}case"RSASSA-PKCS1-v1_5":return Nr(m),m.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return m.algorithm.name}throw new te("unsupported CryptoKey algorithm name",{cause:m})})(g),g,pt(y)));return"".concat(y,".").concat(w)})(l,d,o))}}const Us=URL.parse?(t,e)=>URL.parse(t,e):(t,e)=>{try{return new URL(t,e)}catch{return null}};function Xo(t,e){if(e&&t.protocol!=="https:")throw T("only requests to HTTPS are allowed",Ui,t);if(t.protocol!=="https:"&&t.protocol!=="http:")throw T("only HTTP and HTTPS requests are allowed",zi,t)}function Or(t,e,n,o){let r;if(typeof t!="string"||!(r=Us(t)))throw T("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(e,'"'):'"as.'.concat(e,'"')),t===void 0?Qs:$s,{attribute:n?"mtls_endpoint_aliases.".concat(e):e});return Xo(r,o),r}function Xt(t,e,n,o){return n&&t.mtls_endpoint_aliases&&e in t.mtls_endpoint_aliases?Or(t.mtls_endpoint_aliases[e],e,n,o):Or(t[e],e,n,o)}
3class Un extends Error{constructor(e,n){var o;super(e,n),b(this,"cause",void 0),b(this,"code",void 0),b(this,"error",void 0),b(this,"status",void 0),b(this,"error_description",void 0),b(this,"response",void 0),this.name=this.constructor.name,this.code=Bs,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Ai extends Error{constructor(e,n){var o,r;super(e,n),b(this,"cause",void 0),b(this,"code",void 0),b(this,"error",void 0),b(this,"error_description",void 0),this.name=this.constructor.name,this.code=qs,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(o=n.cause.get("error_description"))!==null&&o!==void 0?o:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Yo extends Error{constructor(e,n){var o;super(e,n),b(this,"cause",void 0),b(this,"code",void 0),b(this,"response",void 0),b(this,"status",void 0),this.name=this.constructor.name,this.code=Ys,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}const Rn="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",zs="("+Rn+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',Ws="("+Rn+")\\s*=\\s*("+Rn+")",js=new RegExp("^[,\\s]*("+Rn+")"),Ks=new RegExp("^[,\\s]*"+zs+"[,\\s]*(.*)"),Ms=new RegExp("^[,\\s]*"+Ws+"[,\\s]*(.*)"),Hs=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Bo(t,e,n){if(t.status!==e){let r;var o;throw(function(i){let a;if(a=(function(s){if(!_t(s,Response))throw D('"response" must be an instance of Response',$);const c=s.headers.get("www-authenticate");if(c===null)return;const h=[];let l=c;for(;l;){var d;let y=l.match(js);const w=(d=y)===null||d===void 0?void 0:d[1].toLowerCase();if(!w)return;const m=l.substring(y[0].length);if(m&&!m.match(/^[\s,]/))return;const v=m.match(/^\s+(.*)$/),_=!!v;l=v?v[1]:void 0;const C={};let S;if(_)for(;l;){let E,A;if(y=l.match(Ks)){var u=oe(y,4);if(E=u[1],A=u[2],l=u[3],A.includes("\\"))try{A=JSON.parse('"'.concat(A,'"'))}catch{}C[E.toLowerCase()]=A}else{if(!(y=l.match(Ms))){if(y=l.match(Hs)){if(Object.keys(C).length)break;var p=oe(y,3);S=p[1],l=p[2];break}return}var g=oe(y,4);E=g[1],A=g[2],l=g[3],C[E.toLowerCase()]=A}}else l=m||void 0;const P={scheme:w,parameters:C};S&&(P.token68=S),h.push(P)}return h.length?h:void 0})(i))throw new Yo("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:a,response:i})})(t),(r=await(async function(i){if(i.status>399&&i.status<500){Bt(i),Ri(i);try{const a=await i.clone().json();if(Tn(a)&&typeof a.error=="string"&&a.error.length)return a}catch{}}})(t))?(await((o=t.body)===null||o===void 0?void 0:o.cancel()),new Un("server responded with an error in the response body",{cause:r,response:t})):T('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),$o,t)}}function Oi(t){if(!Qo.has(t))throw D('"options.DPoP" is not a valid DPoPHandle',V)}function Li(t){var e;return(e=t.headers.get("content-type"))===null||e===void 0?void 0:e.split(";")[0]}async function qo(t,e,n,o,r,i,a){return await n(t,e,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(a?.[pe]||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:Pi(o,a?.signal)})}async function Yt(t,e,n,o,r,i){var a;const s=Xt(t,"token_endpoint",e.use_mtls_endpoint_aliases,i?.[re]!==!0);r.set("grant_type",o);const c=Dn(i?.headers);c.set("accept","application/json"),i?.DPoP!==void 0&&(Oi(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const h=await qo(t,e,n,s,r,c,i);return i==null||(a=i.DPoP)===null||a===void 0||a.cacheNonce(h,s),h}const Ni=new WeakMap,Zs=new WeakMap;function xo(t){if(!t.id_token)return;const e=Ni.get(t);if(!e)throw D('"ref" was already garbage collected or did not resolve from the proper sources',V);return e}async function vt(t,e,n,o,r,i){if(de(t),ue(e),!_t(n,Response))throw D('"response" must be an instance of Response',$);await Bo(n,200,"Token Endpoint"),Bt(n);const a=await zn(n);if(M(a.access_token,'"response" body "access_token" property',I,{body:a}),M(a.token_type,'"response" body "token_type" property',I,{body:a}),a.token_type=a.token_type.toLowerCase(),a.expires_in!==void 0){let s=typeof a.expires_in!="number"?parseFloat(a.expires_in):a.expires_in;De(s,!0,'"response" body "expires_in" property',I,{body:a}),a.expires_in=s}if(a.refresh_token!==void 0&&M(a.refresh_token,'"response" body "refresh_token" property',I,{body:a}),a.scope!==void 0&&typeof a.scope!="string")throw T('"response" body "scope" property must be a string',I,{body:a});if(a.id_token!==void 0){M(a.id_token,'"response" body "id_token" property',I,{body:a});const s=["aud","exp","iat","iss","sub"];e.require_auth_time===!0&&s.push("auth_time"),e.default_max_age!==void 0&&(De(e.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),o!=null&&o.length&&s.push(...o);const c=await(async function(d,u,p,g,y){let w,m,v=d.split("."),_=v[0],C=v[1],S=v.length;if(S===5){if(y===void 0)throw new te("JWE decryption is not configured",{cause:d});var P=(d=await y(d)).split(".");_=P[0],C=P[1],S=P.length}if(S!==3)throw T("Invalid JWT",I,d);try{w=JSON.parse(pt(Xe(_)))}catch(A){throw T("failed to parse JWT Header body as base64url encoded JSON",In,A)}if(!Tn(w))throw T("JWT Header must be a top level object",I,d);if(u(w),w.crit!==void 0)throw new te('no JWT "crit" header parameter extensions are supported',{cause:{header:w}});try{m=JSON.parse(pt(Xe(C)))}catch(A){throw T("failed to parse JWT Payload body as base64url encoded JSON",In,A)}if(!Tn(m))throw T("JWT Payload must be a top level object",I,d);const E=Pn()+p;if(m.exp!==void 0){if(typeof m.exp!="number")throw T('unexpected JWT "exp" (expiration time) claim type',I,{claims:m});if(m.exp<=E-g)throw T('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Gt,{claims:m,now:E,tolerance:g,claim:"exp"})}if(m.iat!==void 0&&typeof m.iat!="number")throw T('unexpected JWT "iat" (issued at) claim type',I,{claims:m});if(m.iss!==void 0&&typeof m.iss!="string")throw T('unexpected JWT "iss" (issuer) claim type',I,{claims:m});if(m.nbf!==void 0){if(typeof m.nbf!="number")throw T('unexpected JWT "nbf" (not before) claim type',I,{claims:m});if(m.nbf>E+g)throw T('unexpected JWT "nbf" (not before) claim value',Gt,{claims:m,now:E,tolerance:g,claim:"nbf"})}if(m.aud!==void 0&&typeof m.aud!="string"&&!Array.isArray(m.aud))throw T('unexpected JWT "aud" (audience) claim type',I,{claims:m});return{header:w,claims:m,jwt:d}})(a.id_token,nc.bind(void 0,e.id_token_signed_response_alg,t.id_token_signing_alg_values_supported,"RS256"),xn(e),To(e),r).then(Vs.bind(void 0,s)).then(Fs.bind(void 0,t)).then(Js.bind(void 0,e.client_id)),h=c.claims,l=c.jwt;if(Array.isArray(h.aud)&&h.aud.length!==1){if(h.azp===void 0)throw T('ID Token "aud" (audience) claim includes additional untrusted audiences',Ee,{claims:h,claim:"aud"});if(h.azp!==e.client_id)throw T('unexpected ID Token "azp" (authorized party) claim value',Ee,{expected:e.client_id,claims:h,claim:"azp"})}h.auth_time!==void 0&&De(h.auth_time,!0,'ID Token "auth_time" (authentication time)',I,{claims:h}),Zs.set(n,l),Ni.set(a,h)}if(i?.[a.token_type]!==void 0)i[a.token_type](n,a);else if(a.token_type!=="dpop"&&a.token_type!=="bearer")throw new te("unsupported `token_type` value",{cause:{body:a}});return a}function Js(t,e){if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t))throw T('unexpected JWT "aud" (audience) claim value',Ee,{expected:t,claims:e.claims,claim:"aud"})}else if(e.claims.aud!==t)throw T('unexpected JWT "aud" (audience) claim value',Ee,{expected:t,claims:e.claims,claim:"aud"});return e}function Fs(t,e){var n,o;const r=(n=(o=t[Wi])===null||o===void 0?void 0:o.call(t,e))!==null&&n!==void 0?n:t.issuer;if(e.claims.iss!==r)throw T('unexpected JWT "iss" (issuer) claim value',Ee,{expected:r,claims:e.claims,claim:"iss"});return e}const Qo=new WeakSet,Lr=Symbol(),Gs={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 Vs(t,e){for(const n of t)if(e.claims[n]===void 0)throw T('JWT "'.concat(n,'" (').concat(Gs[n],") claim missing"),I,{claims:e.claims});return e}const Bn=Symbol(),qn=Symbol();async function Xs(t,e,n,o){return typeof o?.expectedNonce=="string"||typeof o?.maxAge=="number"||o!=null&&o.requireIdToken?(async function(r,i,a,s,c,h,l){const d=[];switch(s){case void 0:s=Bn;break;case Bn:break;default:M(s,'"expectedNonce" argument'),d.push("nonce")}switch(c!=null||(c=i.default_max_age),c){case void 0:c=qn;break;case qn:break;default:De(c,!0,'"maxAge" argument'),d.push("auth_time")}const u=await vt(r,i,a,d,h,l);M(u.id_token,'"response" body "id_token" property',I,{body:u});const p=xo(u);if(c!==qn){const g=Pn()+xn(i),y=To(i);if(p.auth_time+c<g-y)throw T("too much time has elapsed since the last End-User authentication",Gt,{claims:p,now:g,tolerance:y,claim:"auth_time"})}if(s===Bn){if(p.nonce!==void 0)throw T('unexpected ID Token "nonce" claim value',Ee,{expected:void 0,claims:p,claim:"nonce"})}else if(p.nonce!==s)throw T('unexpected ID Token "nonce" claim value',Ee,{expected:s,claims:p,claim:"nonce"});return u})(t,e,n,o.expectedNonce,o.maxAge,o[xe],o.recognizedTokenTypes):(async function(r,i,a,s,c){const h=await vt(r,i,a,void 0,s,c),l=xo(h);if(l){if(i.default_max_age!==void 0){De(i.default_max_age,!0,'"client.default_max_age"');const d=Pn()+xn(i),u=To(i);if(l.auth_time+i.default_max_age<d-u)throw T("too much time has elapsed since the last End-User authentication",Gt,{claims:l,now:d,tolerance:u,claim:"auth_time"})}if(l.nonce!==void 0)throw T('unexpected ID Token "nonce" claim value',Ee,{expected:void 0,claims:l,claim:"nonce"})}return h})(t,e,n,o?.[xe],o?.recognizedTokenTypes)}const Ys="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Bs="OAUTH_RESPONSE_BODY_ERROR",Po="OAUTH_UNSUPPORTED_OPERATION",qs="OAUTH_AUTHORIZATION_RESPONSE_E
3RROR",In="OAUTH_PARSE_ERROR",I="OAUTH_INVALID_RESPONSE",Di="OAUTH_RESPONSE_IS_NOT_JSON",$o="OAUTH_RESPONSE_IS_NOT_CONFORM",Ui="OAUTH_HTTP_REQUEST_FORBIDDEN",zi="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Gt="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",Ee="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Ro="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",Qs="OAUTH_MISSING_SERVER_METADATA",$s="OAUTH_INVALID_SERVER_METADATA";function Bt(t){if(t.bodyUsed)throw D('"response" body has been used already',V)}function Nr(t){const e=t.algorithm;if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new te("unsupported ".concat(e.name," modulusLength"),{cause:t})}function ec(t){switch(t.algorithm.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new te("unsupported ECDSA namedCurve",{cause:t})}}async function tc(t){if(t.method!=="POST")throw D("form_post responses are expected to use the POST method",V,{cause:t});if(Li(t)!=="application/x-www-form-urlencoded")throw D("form_post responses are expected to use the application/x-www-form-urlencoded content-type",V,{cause:t});return(async function(e){if(e.bodyUsed)throw D("form_post Request instances must contain a readable body",V,{cause:e});return e.text()})(t)}function nc(t,e,n,o){if(t===void 0)if(Array.isArray(e)){if(!e.includes(o.alg))throw T('unexpected JWT "alg" header parameter',I,{header:o,expected:e,reason:"authorization server metadata"})}else{if(n===void 0)throw T('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:t,issuer:e,fallback:n});if(typeof n=="string"?o.alg!==n:typeof n=="function"?!n(o.alg):!n.includes(o.alg))throw T('unexpected JWT "alg" header parameter',I,{header:o,expected:n,reason:"default value"})}else if(typeof t=="string"?o.alg!==t:!t.includes(o.alg))throw T('unexpected JWT "alg" header parameter',I,{header:o,expected:t,reason:"client configuration"})}function Je(t,e){const n=t.getAll(e),o=n[0];if(n.length>1)throw T('"'.concat(e,'" parameter must be provided only once'),I);return o}const oc=Symbol(),rc=Symbol();function ic(t,e,n,o){if(de(t),ue(e),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw D('"parameters" must be an instance of URLSearchParams, or URL',$);if(Je(n,"response"))throw T('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',I,{parameters:n});const r=Je(n,"iss"),i=Je(n,"state");if(!r&&t.authorization_response_iss_parameter_supported)throw T('response parameter "iss" (issuer) missing',I,{parameters:n});if(r&&r!==t.issuer)throw T('unexpected "iss" (issuer) response parameter value',I,{expected:t.issuer,parameters:n});switch(o){case void 0:case rc:if(i!==void 0)throw T('unexpected "state" response parameter encountered',I,{expected:void 0,parameters:n});break;case oc:break;default:if(M(o,'"expectedState" argument'),i!==o)throw T(i===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',I,{expected:o,parameters:n})}if(Je(n,"error"))throw new Ai("authorization response from the server is an error",{cause:n});const a=Je(n,"id_token"),s=Je(n,"token");if(a!==void 0||s!==void 0)throw new te("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Qo.add(c),c;var c}async function zn(t){let e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ri;try{e=await t.json()}catch(o){throw n(t),T('failed to parse "response" body as JSON',In,o)}if(!Tn(e))throw T('"response" body must be a top level object',I,{body:e});return e}const Qn=Symbol(),Wi=Symbol(),Dr=new TextEncoder,Vt=new TextDecoder;function $n(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");e[n]=o}return e}function ji(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);const e=atob(t),n=new Uint8Array(e.length);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);return n}function Wn(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof t=="string"?t:Vt.decode(t),{alphabet:"base64url"});let e=t;e instanceof Uint8Array&&(e=Vt.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/");try{return ji(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}const Oe=function(t){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name"," must be ").concat(t))},et=(t,e)=>t.name===e;function eo(t,e){var n;if(n=t.hash,parseInt(n.name.slice(4),10)!==e)throw Oe("SHA-".concat(e),"algorithm.hash")}
3function ac(t,e,n){switch(e){case"HS256":case"HS384":case"HS512":if(!et(t.algorithm,"HMAC"))throw Oe("HMAC");eo(t.algorithm,parseInt(e.slice(2),10));break;case"RS256":case"RS384":case"RS512":if(!et(t.algorithm,"RSASSA-PKCS1-v1_5"))throw Oe("RSASSA-PKCS1-v1_5");eo(t.algorithm,parseInt(e.slice(2),10));break;case"PS256":case"PS384":case"PS512":if(!et(t.algorithm,"RSA-PSS"))throw Oe("RSA-PSS");eo(t.algorithm,parseInt(e.slice(2),10));break;case"Ed25519":case"EdDSA":if(!et(t.algorithm,"Ed25519"))throw Oe("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!et(t.algorithm,e))throw Oe(e);break;case"ES256":case"ES384":case"ES512":{if(!et(t.algorithm,"ECDSA"))throw Oe("ECDSA");const o=(function(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}})(e);if(t.algorithm.namedCurve!==o)throw Oe(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(o,r){if(!o.usages.includes(r))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(r,"."))})(t,n)}function Ki(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];if((o=o.filter(Boolean)).length>2){const a=o.pop();t+="one of type ".concat(o.join(", "),", or ").concat(a,".")}else o.length===2?t+="one of type ".concat(o[0]," or ").concat(o[1],"."):t+="of type ".concat(o[0],".");if(e==null)t+=" Received ".concat(e);else if(typeof e=="function"&&e.name)t+=" Received function ".concat(e.name);else if(typeof e=="object"&&e!=null){var i;(i=e.constructor)!==null&&i!==void 0&&i.name&&(t+=" Received an instance of ".concat(e.constructor.name))}return t}const Ur=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return Ki("Key for the ".concat(t," algorithm must be "),e,...o)};class F extends Error{constructor(e,n){var o;super(e,n),b(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}b(F,"code","ERR_JOSE_GENERIC");class ae extends F{constructor(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:o,reason:r,payload:n}}),b(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),b(this,"claim",void 0),b(this,"reason",void 0),b(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}b(ae,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Io extends F{constructor(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(e,{cause:{claim:o,reason:r,payload:n}}),b(this,"code","ERR_JWT_EXPIRED"),b(this,"claim",void 0),b(this,"reason",void 0),b(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}b(Io,"code","ERR_JWT_EXPIRED");class Mi extends F{constructor(){super(...arguments),b(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}b(Mi,"code","ERR_JOSE_ALG_NOT_ALLOWED");class ee extends F{constructor(){super(...arguments),b(this,"code","ERR_JOSE_NOT_SUPPORTED")}}b(ee,"code","ERR_JOSE_NOT_SUPPORTED");b(class extends F{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),b(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");b(class extends F{constructor(){super(...arguments),b(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class Z extends F{constructor(){super(...arguments),b(this,"code","ERR_JWS_INVALID")}}b(Z,"code","ERR_JWS_INVALID");class er extends F{constructor(){super(...arguments),b(this,"code","ERR_JWT_INVALID")}}
3b(er,"code","ERR_JWT_INVALID");b(class extends F{constructor(){super(...arguments),b(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class tr extends F{constructor(){super(...arguments),b(this,"code","ERR_JWKS_INVALID")}}b(tr,"code","ERR_JWKS_INVALID");class nr extends F{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),b(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}b(nr,"code","ERR_JWKS_NO_MATCHING_KEY");class Hi extends F{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),b(this,Symbol.asyncIterator,void 0),b(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}b(Hi,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class Zi extends F{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),b(this,"code","ERR_JWKS_TIMEOUT")}}b(Zi,"code","ERR_JWKS_TIMEOUT");class Ji extends F{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),b(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}b(Ji,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Fi=t=>{if(t?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return t instanceof CryptoKey}catch{return!1}},Gi=t=>t?.[Symbol.toStringTag]==="KeyObject",zr=t=>Fi(t)||Gi(t);function Wr(t,e,n){try{return Wn(t)}catch{throw new n("Failed to base64url decode the ".concat(e))}}function Ue(t){if(typeof(e=t)!="object"||e===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;var e;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}const Ao=t=>Ue(t)&&typeof t.kty=="string";async function sc(t,e,n){if(e instanceof Uint8Array){if(!t.startsWith("HS"))throw new TypeError((function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return Ki("Key must be ",o,...i)})(e,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",e,{hash:"SHA-".concat(t.slice(-3)),name:"HMAC"},!1,[n])}return ac(e,t,n),e}async function cc(t,e,n,o){const r=await sc(t,e,"verify");(function(a,s){if(a.startsWith("RS")||a.startsWith("PS")){const c=s.algorithm.modulusLength;if(typeof c!="number"||c<2048)throw new TypeError("".concat(a," requires key modulusLength to be 2048 bits or larger"))}})(t,r);const i=(function(a,s){const c="SHA-".concat(a.slice(-3));switch(a){case"HS256":case"HS384":case"HS512":return{hash:c,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:c,name:"RSA-PSS",saltLength:parseInt(a.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:c,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:c,name:"ECDSA",namedCurve:s.namedCurve};
3case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:a};default:throw new ee("alg ".concat(a," is not supported either by JOSE or your javascript runtime"))}})(t,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch{return!1}}const rn='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function vn(t){var e,n;if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const o=(function(s){let c,h;switch(s.kty){case"AKP":switch(s.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":c={name:s.alg},h=s.priv?["sign"]:["verify"];break;default:throw new ee(rn)}break;case"RSA":switch(s.alg){case"PS256":case"PS384":case"PS512":c={name:"RSA-PSS",hash:"SHA-".concat(s.alg.slice(-3))},h=s.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":c={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(s.alg.slice(-3))},h=s.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":c={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(s.alg.slice(-3),10)||1)},h=s.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new ee(rn)}break;case"EC":switch(s.alg){case"ES256":case"ES384":case"ES512":c={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[s.alg]},h=s.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":c={name:"ECDH",namedCurve:s.crv},h=s.d?["deriveBits"]:[];break;default:throw new ee(rn)}break;
3case"OKP":switch(s.alg){case"Ed25519":case"EdDSA":c={name:"Ed25519"},h=s.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":c={name:s.crv},h=s.d?["deriveBits"]:[];break;default:throw new ee(rn)}break;default:throw new ee('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:c,keyUsages:h}})(t),r=o.algorithm,i=o.keyUsages,a=k({},t);return a.kty!=="AKP"&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,r,(e=t.ext)!==null&&e!==void 0?e:!t.d&&!t.priv,(n=t.key_ops)!==null&&n!==void 0?n:i)}const tt="given KeyObject instance cannot be used for this algorithm";let Ne;const jr=async function(t,e,n){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Ne||(Ne=new WeakMap);let r=Ne.get(t);if(r!=null&&r[n])return r[n];const i=await vn(k(k({},e),{},{alg:n}));return o&&Object.freeze(t),r?r[n]=i:Ne.set(t,{[n]:i}),i};async function lc(t,e){if(t instanceof Uint8Array||Fi(t))return t;if(Gi(t)){if(t.type==="secret")return t.export();if("toCryptoKey"in t&&typeof t.toCryptoKey=="function")try{return((o,r)=>{Ne||(Ne=new WeakMap);let i=Ne.get(o);if(i!=null&&i[r])return i[r];const a=o.type==="public",s=!!a;let c;if(o.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError(tt)}c=o.toCryptoKey(o.asymmetricKeyType,s,a?[]:["deriveBits"])}if(o.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError(tt);c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}switch(o.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==o.asymmetricKeyType.toUpperCase())throw new TypeError(tt);c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="rsa"){let l;switch(r){case"RSA-OAEP":l="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":l="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":l="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":l="SHA-512";break;default:throw new TypeError(tt)}if(r.startsWith("RSA-OAEP"))return o.toCryptoKey({name:"RSA-OAEP",hash:l},s,a?["encrypt"]:["decrypt"]);c=o.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:l},s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="ec"){var h;const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((h=o.asymmetricKeyDetails)===null||h===void 0?void 0:h.namedCurve);if(!l)throw new TypeError(tt);const d={ES256:"P-256",ES384:"P-384",ES512:"P-521"};d[r]&&l===d[r]&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:l},s,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(c=o.toCryptoKey({name:"ECDH",namedCurve:l},s,a?[]:["deriveBits"]))}if(!c)throw new TypeError(tt);return i?i[r]=c:Ne.set(o,{[r]:c}),c})(t,e)}catch(o){if(o instanceof TypeError)throw o}let n=t.export({format:"jwk"});return jr(t,n,e)}if(Ao(t))return t.k?Wn(t.k):jr(t,t,e,!0);throw new Error("unreachable")}const to=(t,e)=>{if(t.byteLength!==e.length)return!1;for(let n=0;n<t.byteLength;n++)if(t[n]!==e[n])return!1;return!0},Ht=t=>{const e=t.data[t.pos++];if(128&e){const n=127&e;let o=0;for(let r=0;r<n;r++)o=o<<8|t.data[t.pos++];return o}return e},Zt=(t,e,n)=>{if(t.data[t.pos++]!==e)throw new Error(n)},Kr=(t,e)=>{const n=t.data.subarray(t.pos,t.pos+e);return t.pos+=e,n},hc=t=>{const e=(r=>{Zt(r,6,"Expected algorithm OID");const i=Ht(r);return Kr(r,i)})(t);if(to(e,[43,101,110]))return"X25519";if(!to(e,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");Zt(t,6,"Expected curve OID");const n=Ht(t),o=Kr(t,n);for(const r 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]}]){const i=r.name,a=r.oid;if(to(o,a))return i}throw new Error("Unsupported named curve")},dc=async(t,e,n,o)=>{var r;let i,a;const s=()=>["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=s();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=s();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=["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=s();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const c=o.getNamedCurve(e);i=c==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:c}}catch{throw new ee("Invalid or unsupported key format")}a=["deriveBits"];break;
3case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=s();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=s();break;default:throw new ee('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(t,e,i,(r=o?.extractable)!==null&&r!==void 0?r:!1,a)},uc=(t,e,n)=>{var o;const r=((a,s)=>ji(a.replace(s,"")))(t,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let i=n;return e!=null&&(o=e.startsWith)!==null&&o!==void 0&&o.call(e,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=a=>{const s={data:a,pos:0};return(function(c){Zt(c,48,"Invalid PKCS#8 structure"),Ht(c),Zt(c,2,"Expected version field");const h=Ht(c);c.pos+=h,Zt(c,48,"Expected algorithm identifier"),Ht(c)})(s),hc(s)}),dc("pkcs8",r,e,i)},nt=t=>t?.[Symbol.toStringTag],no=(t,e,n)=>{if(e.use!==void 0){let i;switch(n){case"sign":case"verify":i="sig";break;case"encrypt":case"decrypt":i="enc"}if(e.use!==i)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(i,'" when present'))}if(e.alg!==void 0&&e.alg!==t)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(t,'" when present'));if(Array.isArray(e.key_ops)){var o,r;let i;switch(!0){case n==="verify":case t==="dir":case t.includes("CBC-HS"):i=n;break;case t.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(t):i=!t.includes("GCM")&&t.endsWith("KW")?"unwrapKey":n;break;case n==="encrypt":i="wrapKey";break;case n==="decrypt":i=t.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&((o=e.key_ops)===null||o===void 0||(r=o.includes)===null||r===void 0?void 0:r.call(o,i))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function pc(t,e,n){switch(t.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((o,r,i)=>{if(!(r instanceof Uint8Array)){if(Ao(r)){if((a=>a.kty==="oct"&&typeof a.k=="string")(r)&&no(o,r,i))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(!zr(r))throw new TypeError(Ur(o,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError("".concat(nt(r),' instances for symmetric algorithms must be of type "secret"'))}})(t,e,n);break;default:((o,r,i)=>{if(Ao(r))switch(i){case"decrypt":case"sign":if((a=>a.kty!=="oct"&&(a.kty==="AKP"&&typeof a.priv=="string"||typeof a.d=="string"))(r)&&no(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((a=>a.kty!=="oct"&&a.d===void 0&&a.priv===void 0)(r)&&no(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!zr(r))throw new TypeError(Ur(o,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError("".concat(nt(r),' instances for asymmetric algorithms must not be of type "secret"'));if(r.type==="public")switch(i){case"sign":throw new TypeError("".concat(nt(r),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(nt(r),' instances for asymmetric algorithm decryption must be of type "private"'))}if(r.type==="private")switch(i){case"verify":throw new TypeError("".concat(nt(r),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(nt(r),' instances for asymmetric algorithm encryption must be of type "public"'))}})(t,e,n)}}var an,oo;let we,Mr;(typeof navigator>"u"||(an=navigator.userAgent)===null||an===void 0||(oo=an.startsWith)===null||oo===void 0||!oo.call(an,"Mozilla/5.0 "))&&(Mr="".concat("openid-client","/").concat("v6.8.4"),we={"user-agent":Mr});const J=t=>bn.get(t);let bn,sn;function Vi(t){return t!==void 0?Ar(t):(sn||(sn=new WeakMap),(e,n,o,r)=>{let i;return(i=sn.get(n))||((function(a,s){if(typeof a!="string")throw ve("".concat(s," must be a string"),Qt);if(a.length===0)throw ve("".concat(s," must not be empty"),qt)})(n.client_secret,'"metadata.client_secret"'),i=Ar(n.client_secret),sn.set(n,i)),i(e,n,o,r)})}const ye=pe,qt="ERR_INVALID_ARG_VALUE",Qt="ERR_INVALID_ARG_TYPE";function ve(t,e,n){const o=new TypeError(t,{cause:n});return Object.assign(o,{code:e}),o}function mc(t){return(async function(e){return M(e,"codeVerifier"),Xe(await crypto.subtle.digest("SHA-256",pt(e)))})(t)}function fc(){return Ii()}
3class An extends Error{constructor(e,n){var o;super(e,n),b(this,"code",void 0),this.name=this.constructor.name,this.code=n?.code,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Y(t,e,n){return new An(t,{cause:e,code:n})}function X(t){if(t instanceof TypeError||t instanceof An||t instanceof Un||t instanceof Ai||t instanceof Yo)throw t;if(t instanceof Vo)switch(t.code){case Ui:throw Y("only requests to HTTPS are allowed",t,t.code);case zi:throw Y("only requests to HTTP or HTTPS are allowed",t,t.code);case $o:throw Y("unexpected HTTP response status code",t.cause,t.code);case Di:throw Y("unexpected response content-type",t.cause,t.code);case In:throw Y("parsing error occured",t,t.code);case I:throw Y("invalid response encountered",t,t.code);case Ee:throw Y("unexpected JWT claim value encountered",t,t.code);case Ro:throw Y("unexpected JSON attribute value encountered",t,t.code);case Gt:throw Y("JWT timestamp claim value failed validation",t,t.code);default:throw Y(t.message,t,t.code)}if(t instanceof te)throw Y("unsupported operation",t,t.code);if(t instanceof DOMException)switch(t.name){case"OperationError":throw Y("runtime operation error",t,Po);case"NotSupportedError":throw Y("runtime unsupported operation",t,Po);case"TimeoutError":throw Y("operation timed out",t,"OAUTH_TIMEOUT");case"AbortError":throw Y("operation aborted",t,"OAUTH_ABORT")}throw new An("something went wrong",{cause:t})}async function gc(t,e,n,o,r){const i=await(async function(c,h){var l,d;if(!(c instanceof URL))throw ve('"server" must be an instance of URL',Qt);const u=!c.href.includes("/.well-known/"),p=(l=h?.timeout)!==null&&l!==void 0?l:30,g=AbortSignal.timeout(1e3*p),y=await(u?Ls(c,{algorithm:h?.algorithm,[pe]:h?.[ye],[re]:h==null||(d=h.execute)===null||d===void 0?void 0:d.includes(Jr),signal:g,headers:new Headers(we)}):(h?.[ye]||fetch)((Xo(c,h==null||(w=h.execute)===null||w===void 0||!w.includes(Jr)),c.href),{headers:Object.fromEntries(new Headers(k({accept:"application/json"},we)).entries()),body:void 0,method:"GET",redirect:"manual",signal:g})).then(m=>(async function(v,_){const C=v;if(!(C instanceof URL)&&C!==Qn)throw D('"expectedIssuerIdentifier" must be an instance of URL',$);if(!_t(_,Response))throw D('"response" must be an instance of Response',$);if(_.status!==200)throw T('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',$o,_);Bt(_);const S=await zn(_);if(M(S.issuer,'"response" body "issuer" property',I,{body:S}),C!==Qn&&new URL(S.issuer).href!==C.href)throw T('"response" body "issuer" property does not match the expected value',Ro,{expected:C.href,body:S,attribute:"issuer"});return S})(Qn,m)).catch(X);var w;return u&&new URL(y.issuer).href!==c.href&&((function(m,v,_){return!(m.origin!=="https://login.microsoftonline.com"||_!=null&&_.algorithm&&_.algorithm!=="oidc"||(v[Xi]=!0,0))})(c,y,h)||(function(m,v){return!(!m.hostname.endsWith(".b2clogin.com")||v!=null&&v.algorithm&&v.algorithm!=="oidc")})(c,h)||(()=>{throw new An("discovered metadata issuer does not match the expected issuer",{code:Ro,cause:{expected:c.href,body:y,attribute:"issuer"}})})()),y})(t,r),a=new bt(i,e,n,o);let s=J(a);if(r!=null&&r[ye]&&(s.fetch=r[ye]),r!=null&&r.timeout&&(s.timeout=r.timeout),r!=null&&r.execute)for(const c of r.execute)c(a);return a}new TextDecoder;const Xi=Symbol();class bt{constructor(e,n,o,r){var i,a,s,c,h;if(typeof n!="string"||!n.length)throw ve('"clientId" must be a non-empty string',Qt);if(typeof o=="string"&&(o={client_secret:o}),((i=o)===null||i===void 0?void 0:i.client_id)!==void 0&&n!==o.client_id)throw ve('"clientId" and "metadata.client_id" must be the same',qt);const l=k(k({},structuredClone(o)),{},{client_id:n});let d;l[Co]=(a=(s=o)===null||s===void 0?void 0:s[Co])!==null&&a!==void 0?a:0,l[Eo]=(c=(h=o)===null||h===void 0?void 0:h[Eo])!==null&&c!==void 0?c:30,d=r||(typeof l.client_secret=="string"&&l.client_secret.length?Vi(l.client_secret):(y,w,m,v)=>{m.set("client_id",w.client_id)});let u=Object.freeze(l);const p=structuredClone(e);Xi in e&&(p[Wi]=y=>{let w=y.claims.tid;return e.issuer.replace("{tenantid}",w)});let g=Object.freeze(p);bn||(bn=new WeakMap),bn.set(this,{__proto__:null,as:g,c:u,auth:d,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const e=structuredClone(J(this).as);return(function(n){Object.defineProperties(n,(function(o){return{supportsPKCE:{__proto__:null,value(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=o.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(i))===!0}}}})(n))})(e),e}clientMetadata(){return structuredClone(J(this).c)}get timeout(){return J(this).timeout}set timeout(e){J(this).timeout=e}get[ye](){return J(this).fetch}set[ye](e){J(this).fetch=e}}function $t(t){Object.defineProperties(t,(function(e){let n;if(e.expires_in!==void 0){const o=new Date;o.setSeconds(o.getSeconds()+e.expires_in),n=o.getTime()}
3return{expiresIn:{__proto__:null,value(){if(n){const o=Date.now();return n>o?Math.floor((n-o)/1e3):0}}},claims:{__proto__:null,value(){try{return xo(this)}catch{return}}}}})(t))}async function Hr(t,e,n){var o;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const i=(o=t.headers.get("retry-after"))===null||o===void 0?void 0:o.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const s=new Date(i);if(Number.isFinite(s.getTime())){const c=new Date,h=s.getTime()-c.getTime();h>0&&(a=Math.ceil(h/1e3))}}if(r&&!Number.isFinite(a))throw new Vo("invalid Retry-After header value",{cause:t});a>e&&await Yi(a-e,n)}function Yi(t,e){return new Promise((n,o)=>{const r=i=>{try{e.throwIfAborted()}catch(s){return void o(s)}if(i<=0)return void n();const a=Math.min(i,5);setTimeout(()=>r(i-a),1e3*a)};r(t)})}async function Zr(t,e){Pe(t);const n=J(t),o=n.as,r=n.c,i=n.auth,a=n.fetch,s=n.tlsOnly,c=n.timeout;return(async function(h,l,d,u,p){de(h),ue(l);const g=Xt(h,"backchannel_authentication_endpoint",l.use_mtls_endpoint_aliases,p?.[re]!==!0),y=new URLSearchParams(u);y.set("client_id",l.client_id);const w=Dn(p?.headers);return w.set("accept","application/json"),qo(h,l,d,g,y,w,p)})(o,r,i,e,{[pe]:a,[re]:!s,headers:new Headers(we),signal:Qe(c)}).then(h=>(async function(l,d,u){if(de(l),ue(d),!_t(u,Response))throw D('"response" must be an instance of Response',$);await Bo(u,200,"Backchannel Authentication Endpoint"),Bt(u);const p=await zn(u);M(p.auth_req_id,'"response" body "auth_req_id" property',I,{body:p});let g=typeof p.expires_in!="number"?parseFloat(p.expires_in):p.expires_in;return De(g,!0,'"response" body "expires_in" property',I,{body:p}),p.expires_in=g,p.interval!==void 0&&De(p.interval,!1,'"response" body "interval" property',I,{body:p}),p})(o,r,h)).catch(X)}async function Bi(t,e,n,o){var r,i;Pe(t),n=new URLSearchParams(n);let a=(r=e.interval)!==null&&r!==void 0?r:5;const s=(i=o?.signal)!==null&&i!==void 0?i:AbortSignal.timeout(1e3*e.expires_in);try{await Yi(a,s)}catch(E){X(E)}const c=J(t),h=c.as,l=c.c,d=c.auth,u=c.fetch,p=c.tlsOnly,g=c.nonRepudiation,y=c.timeout,w=c.decrypt,m=(E,A)=>Bi(t,k(k({},e),{},{interval:E}),n,k(k({},o),{},{signal:s,flag:A})),v=(function(E,A){const j=Qe(A);if(!j)return{signal:E,cleanup(){}};const H=new AbortController,K=ie=>{const Et=ie.target;H.abort(Et.reason)};return E.aborted?H.abort(E.reason):j.aborted?H.abort(j.reason):(E.addEventListener("abort",K,{once:!0}),j.addEventListener("abort",K,{once:!0})),{signal:H.signal,cleanup(){E.removeEventListener("abort",K),j.removeEventListener("abort",K)}}})(s,y),_=await(async function(E,A,j,H,K){de(E),ue(A),M(H,'"authReqId"');const ie=new URLSearchParams(K?.additionalParameters);return ie.set("auth_req_id",H),Yt(E,A,j,"urn:openid:params:grant-type:ciba",ie,K)})(h,l,d,e.auth_req_id,{[pe]:u,[re]:!p,additionalParameters:n,DPoP:o?.DPoP,headers:new Headers(we),signal:v.signal}).catch(X).finally(v.cleanup);var C;if(_.status===503&&_.headers.has("retry-after"))return await Hr(_,a,s,!0),await((C=_.body)===null||C===void 0?void 0:C.cancel()),m(a);const S=(async function(E,A,j,H){return vt(E,A,j,void 0,H?.[xe],H?.recognizedTokenTypes)})(h,l,_,{[xe]:w});let P;try{P=await S}catch(E){if(Ct(E,o))return m(a,Se);if(E instanceof Un)switch(E.error){case"slow_down":a+=5;case"authorization_pending":return await Hr(E.response,a,s),m(a)}X(E)}return P.id_token&&await g?.(_),$t(P),P}function Jr(t){J(t).tlsOnly=!1}async function qi(t,e,n,o,r){if(Pe(t),!(r?.flag===Se||e instanceof URL||(function(E,A){try{return Object.getPrototypeOf(E)[Symbol.toStringTag]===A}catch{return!1}})(e,"Request")))throw ve('"currentUrl" must be an instance of URL, or Request',Qt);let i,a;const s=J(t),c=s.as,h=s.c,l=s.auth,d=s.fetch,u=s.tlsOnly,p=s.jarm,g=s.hybrid,y=s.nonRepudiation,w=s.timeout,m=s.decrypt,v=s.implicit;if(r?.flag===Se)i=r.authResponse,a=r.redirectUri;else{if(!(e instanceof URL)){const E=e;switch(e=new URL(e.url),E.method){case"GET":break;case"POST":const A=new URLSearchParams(await tc(E));if(g)e.hash=A.toString();else for(const j of A.entries()){var _=oe(j,2);const H=_[0],K=_[1];e.searchParams.append(H,K)}break;default:throw ve("unexpected Request HTTP method",qt)}}switch(a=(function(E){return(E=new URL(E)).search="",E.hash="",E.href})(e),!0){case!!p:i=await p(e,n?.expectedState);break;case!!g:i=await g(e,n?.expectedNonce,n?.expectedState,n?.maxAge);break;case!!v:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=ic(c,h,e.searchParams,n?.expectedState)}catch(E){X(E)}}}const C=await(async function(E,A,j,H,K,ie,Et){if(de(E),ue(A),!Qo.has(H))throw D('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',V);M(K,'"redirectUri"');const cr=Je(H,"code");if(!cr)throw T('no authorization code in "callbackParameters"',I);const en=new URLSearchParams(Et?.additionalParameters);
3return en.set("redirect_uri",K),en.set("code",cr),ie!==Lr&&(M(ie,'"codeVerifier"'),en.set("code_verifier",ie)),Yt(E,A,j,"authorization_code",en,Et)})(c,h,l,i,a,n?.pkceCodeVerifier||Lr,{additionalParameters:o,[pe]:d,[re]:!u,DPoP:r?.DPoP,headers:new Headers(we),signal:Qe(w)}).catch(X);typeof n?.expectedNonce!="string"&&typeof n?.maxAge!="number"||(n.idTokenExpected=!0);const S=Xs(c,h,C,{expectedNonce:n?.expectedNonce,maxAge:n?.maxAge,requireIdToken:n?.idTokenExpected,[xe]:m});let P;try{P=await S}catch(E){if(Ct(E,r))return qi(t,void 0,n,o,k(k({},r),{},{flag:Se,authResponse:i,redirectUri:a}));X(E)}return P.id_token&&await y?.(C),$t(P),P}async function Qi(t,e,n,o){Pe(t),n=new URLSearchParams(n);const r=J(t),i=r.as,a=r.c,s=r.auth,c=r.fetch,h=r.tlsOnly,l=r.nonRepudiation,d=r.timeout,u=r.decrypt,p=await(async function(w,m,v,_,C){de(w),ue(m),M(_,'"refreshToken"');const S=new URLSearchParams(C?.additionalParameters);return S.set("refresh_token",_),Yt(w,m,v,"refresh_token",S,C)})(i,a,s,e,{[pe]:c,[re]:!h,additionalParameters:n,DPoP:o?.DPoP,headers:new Headers(we),signal:Qe(d)}).catch(X),g=(async function(w,m,v,_){return vt(w,m,v,void 0,_?.[xe],_?.recognizedTokenTypes)})(i,a,p,{[xe]:u});let y;try{y=await g}catch(w){if(Ct(w,o))return Qi(t,e,n,k(k({},o),{},{flag:Se}));X(w)}return y.id_token&&await l?.(p),$t(y),y}async function $i(t,e,n){Pe(t),e=new URLSearchParams(e);const o=J(t),r=o.as,i=o.c,a=o.auth,s=o.fetch,c=o.tlsOnly,h=o.timeout,l=await(async function(p,g,y,w,m){return de(p),ue(g),Yt(p,g,y,"client_credentials",new URLSearchParams(w),m)})(r,i,a,e,{[pe]:s,[re]:!c,DPoP:n?.DPoP,headers:new Headers(we),signal:Qe(h)}).catch(X),d=(async function(p,g,y,w){return vt(p,g,y,void 0,void 0,void 0)})(r,i,l);let u;try{u=await d}catch(p){if(Ct(p,n))return $i(t,e,k(k({},n),{},{flag:Se}));X(p)}return $t(u),u}function Oo(t,e){Pe(t);const n=J(t),o=n.as,r=n.c,i=n.tlsOnly,a=n.hybrid,s=n.jarm,c=n.implicit,h=Xt(o,"authorization_endpoint",!1,i);if((e=new URLSearchParams(e)).has("client_id")||e.set("client_id",r.client_id),!e.has("request_uri")&&!e.has("request")){if(e.has("response_type")||e.set("response_type",a?"code id_token":c?"id_token":"code"),c&&!e.has("nonce"))throw ve("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",qt);s&&e.set("response_mode","jwt")}for(const d of e.entries()){var l=oe(d,2);const u=l[0],p=l[1];h.searchParams.append(u,p)}return h}async function ea(t,e,n){Pe(t);const o=Oo(t,e),r=J(t),i=r.as,a=r.c,s=r.auth,c=r.fetch,h=r.tlsOnly,l=r.timeout,d=await(async function(g,y,w,m,v){var _;de(g),ue(y);const C=Xt(g,"pushed_authorization_request_endpoint",y.use_mtls_endpoint_aliases,v?.[re]!==!0),S=new URLSearchParams(m);S.set("client_id",y.client_id);const P=Dn(v?.headers);P.set("accept","application/json"),v?.DPoP!==void 0&&(Oi(v.DPoP),await v.DPoP.addProof(C,P,"POST"));const E=await qo(g,y,w,C,S,P,v);return v==null||(_=v.DPoP)===null||_===void 0||_.cacheNonce(E,C),E})(i,a,s,o.searchParams,{[pe]:c,[re]:!h,DPoP:n?.DPoP,headers:new Headers(we),signal:Qe(l)}).catch(X),u=(async function(g,y,w){if(de(g),ue(y),!_t(w,Response))throw D('"response" must be an instance of Response',$);await Bo(w,201,"Pushed Authorization Request Endpoint"),Bt(w);const m=await zn(w);M(m.request_uri,'"response" body "request_uri" property',I,{body:m});let v=typeof m.expires_in!="number"?parseFloat(m.expires_in):m.expires_in;return De(v,!0,'"response" body "expires_in" property',I,{body:m}),m.expires_in=v,m})(i,a,d);let p;try{p=await u}catch(g){if(Ct(g,n))return ea(t,e,k(k({},n),{},{flag:Se}));X(g)}return Oo(t,{request_uri:p.request_uri})}function Pe(t){if(!(t instanceof bt))throw ve('"config" must be an instance of Configuration',Qt);if(Object.getPrototypeOf(t)!==bt.prototype)throw ve("subclassing Configuration is not allowed",qt)}function Qe(t){return t?AbortSignal.timeout(1e3*t):void 0}function Ct(t,e){return!(e==null||!e.DPoP||e.flag===Se)&&(function(n){if(n instanceof Yo){const o=n.cause,r=o[0];return o.length===1&&r.scheme==="dpop"&&r.parameters.error==="use_dpop_nonce"}return n instanceof Un&&n.error==="use_dpop_nonce"})(t)}Object.freeze(bt.prototype);const Se=Symbol();async function mt(t,e,n,o){Pe(t);const r=J(t),i=r.as,a=r.c,s=r.auth,c=r.fetch,h=r.tlsOnly,l=r.timeout,d=r.decrypt,u=r.nonRepudiation,p=await(async function(m,v,_,C,S,P){return de(m),ue(v),M(C,'"grantType"'),Yt(m,v,_,C,new URLSearchParams(S),P)})(i,a,s,e,new URLSearchParams(n),{[pe]:c,[re]:!h,DPoP:o?.DPoP,headers:new Headers(we),signal:Qe(l)}).catch(X);let g;e==="urn:ietf:params:oauth:grant-type:token-exchange"&&(g={n_a:()=>{}});const y=(async function(m,v,_,C){return vt(m,v,_,void 0,C?.[xe],C?.recognizedTokenTypes)})(i,a,p,{[xe]:d,recognizedTokenTypes:g});let w;try{w=await y}catch(m){if(Ct(m,o))return mt(t,e,n,k(k({},o),{},{flag:Se}));X(m)}return w.id_token&&await u?.(p),$t(w),w}async function yc(t,e,n){if(!Ue(t))throw new Z("Flattened JWS must be an object");
3if(t.protected===void 0&&t.header===void 0)throw new Z('Flattened JWS must have either of the "protected" or "header" members');if(t.protected!==void 0&&typeof t.protected!="string")throw new Z("JWS Protected Header incorrect type");if(t.payload===void 0)throw new Z("JWS Payload missing");if(typeof t.signature!="string")throw new Z("JWS Signature missing or incorrect type");if(t.header!==void 0&&!Ue(t.header))throw new Z("JWS Unprotected Header incorrect type");let o={};if(t.protected)try{const y=Wn(t.protected);o=JSON.parse(Vt.decode(y))}catch{throw new Z("JWS Protected Header is invalid")}if(!(function(){for(var y=arguments.length,w=new Array(y),m=0;m<y;m++)w[m]=arguments[m];const v=w.filter(Boolean);if(v.length===0||v.length===1)return!0;let _;for(const C of v){const S=Object.keys(C);if(_&&_.size!==0)for(const P of S){if(_.has(P))return!1;_.add(P)}else _=new Set(S)}return!0})(o,t.header))throw new Z("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r=k(k({},o),t.header),i=(function(y,w,m,v,_){if(_.crit!==void 0&&v?.crit===void 0)throw new y('"crit" (Critical) Header Parameter MUST be integrity protected');if(!v||v.crit===void 0)return new Set;if(!Array.isArray(v.crit)||v.crit.length===0||v.crit.some(S=>typeof S!="string"||S.length===0))throw new y('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let C;C=m!==void 0?new Map([...Object.entries(m),...w.entries()]):w;for(const S of v.crit){if(!C.has(S))throw new ee('Extension Header Parameter "'.concat(S,'" is not recognized'));if(_[S]===void 0)throw new y('Extension Header Parameter "'.concat(S,'" is missing'));if(C.get(S)&&v[S]===void 0)throw new y('Extension Header Parameter "'.concat(S,'" MUST be integrity protected'))}return new Set(v.crit)})(Z,new Map([["b64",!0]]),n?.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new Z('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const s=r.alg;if(typeof s!="string"||!s)throw new Z('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&(function(y,w){if(w!==void 0&&(!Array.isArray(w)||w.some(m=>typeof m!="string")))throw new TypeError('"'.concat(y,'" option must be an array of strings'));if(w)return new Set(w)})("algorithms",n.algorithms);if(c&&!c.has(s))throw new Mi('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof t.payload!="string")throw new Z("JWS Payload must be a string")}else if(typeof t.payload!="string"&&!(t.payload instanceof Uint8Array))throw new Z("JWS Payload must be a string or an Uint8Array instance");let h=!1;typeof e=="function"&&(e=await e(o,t),h=!0),pc(s,e,"verify");const l=(function(){for(var y=arguments.length,w=new Array(y),m=0;m<y;m++)w[m]=arguments[m];const v=w.reduce((S,P)=>S+P.length,0),_=new Uint8Array(v);let C=0;for(const S of w)_.set(S,C),C+=S.length;return _})(t.protected!==void 0?$n(t.protected):new Uint8Array,$n("."),typeof t.payload=="string"?a?$n(t.payload):Dr.encode(t.payload):t.payload),d=Wr(t.signature,"signature",Z),u=await lc(e,s);if(!await cc(s,u,d,l))throw new Ji;let p;p=a?Wr(t.payload,"payload",Z):typeof t.payload=="string"?Dr.encode(t.payload):t.payload;const g={payload:p};return t.protected!==void 0&&(g.protectedHeader=o),t.header!==void 0&&(g.unprotectedHeader=t.header),h?k(k({},g),{},{key:u}):g}const wc=86400,vc=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Fr(t){const e=vc.exec(t);if(!e||e[4]&&e[1])throw new TypeError("Invalid time period format");const n=parseFloat(e[2]);let o;switch(e[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(n*wc);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return e[1]==="-"||e[4]==="ago"?-o:o}const Gr=t=>t.includes("/")?t.toLowerCase():"application/".concat(t.toLowerCase());function bc(t,e){let n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{n=JSON.parse(Vt.decode(e))}catch{}if(!Ue(n))throw new er("JWT Claims Set must be a top-level JSON object");const r=o.typ;
3if(r&&(typeof t.typ!="string"||Gr(t.typ)!==Gr(r)))throw new ae('unexpected "typ" JWT header value',n,"typ","check_failed");const i=o.requiredClaims,a=i===void 0?[]:i,s=o.issuer,c=o.subject,h=o.audience,l=o.maxTokenAge,d=[...a];l!==void 0&&d.push("iat"),h!==void 0&&d.push("aud"),c!==void 0&&d.push("sub"),s!==void 0&&d.push("iss");for(const v of new Set(d.reverse()))if(!(v in n))throw new ae('missing required "'.concat(v,'" claim'),n,v,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new ae('unexpected "iss" claim value',n,"iss","check_failed");if(c&&n.sub!==c)throw new ae('unexpected "sub" claim value',n,"sub","check_failed");if(h&&(u=n.aud,p=typeof h=="string"?[h]:h,!(typeof u=="string"?p.includes(u):Array.isArray(u)&&p.some(Set.prototype.has.bind(new Set(u))))))throw new ae('unexpected "aud" claim value',n,"aud","check_failed");var u,p;let g;switch(typeof o.clockTolerance){case"string":g=Fr(o.clockTolerance);break;case"number":g=o.clockTolerance;break;case"undefined":g=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const y=o.currentDate,w=(m=y||new Date,Math.floor(m.getTime()/1e3));var m;if((n.iat!==void 0||l)&&typeof n.iat!="number")throw new ae('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new ae('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>w+g)throw new ae('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new ae('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=w-g)throw new Io('"exp" claim timestamp check failed',n,"exp","check_failed")}if(l){const v=w-n.iat;if(v-g>(typeof l=="number"?l:Fr(l)))throw new Io('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(v<0-g)throw new ae('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function kc(t,e,n){var o;const r=await(async function(a,s,c){if(a instanceof Uint8Array&&(a=Vt.decode(a)),typeof a!="string")throw new Z("Compact JWS must be a string or Uint8Array");const h=a.split("."),l=h[0],d=h[1],u=h[2];if(h.length!==3)throw new Z("Invalid Compact JWS");const p=await yc({payload:d,protected:l,signature:u},s,c),g={payload:p.payload,protectedHeader:p.protectedHeader};return typeof s=="function"?k(k({},g),{},{key:p.key}):g})(t,e,n);if((o=r.protectedHeader.crit)!==null&&o!==void 0&&o.includes("b64")&&r.protectedHeader.b64===!1)throw new er("JWTs MUST NOT use unencoded payload");const i={payload:bc(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof e=="function"?k(k({},i),{},{key:r.key}):i}function _c(t){return Ue(t)}var cn,ro,ln=new WeakMap,io=new WeakMap;class Cc{constructor(e){if(L(this,ln,void 0),L(this,io,new WeakMap),!(function(n){return n&&typeof n=="object"&&Array.isArray(n.keys)&&n.keys.every(_c)})(e))throw new tr("JSON Web Key Set malformed");x(ln,this,structuredClone(e))}jwks(){return f(ln,this)}async getKey(e,n){const o=k(k({},e),n?.header),r=o.alg,i=o.kid,a=(function(l){switch(typeof l=="string"&&l.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new ee('Unsupported "alg" value for a JSON Web Key Set')}})(r),s=f(ln,this).keys.filter(l=>{let d=a===l.kty;if(d&&typeof i=="string"&&(d=i===l.kid),!d||typeof l.alg!="string"&&a!=="AKP"||(d=r===l.alg),d&&typeof l.use=="string"&&(d=l.use==="sig"),d&&Array.isArray(l.key_ops)&&(d=l.key_ops.includes("verify")),d)switch(r){case"ES256":d=l.crv==="P-256";break;case"ES384":d=l.crv==="P-384";break;case"ES512":d=l.crv==="P-521";break;
3case"Ed25519":case"EdDSA":d=l.crv==="Ed25519"}return d}),c=s[0],h=s.length;if(h===0)throw new nr;if(h!==1){const l=new Hi,d=f(io,this);throw l[Symbol.asyncIterator]=Ha(function*(){for(const u of s)try{yield yield Ma(Vr(d,u,r))}catch{}}),l}return Vr(f(io,this),c,r)}}async function Vr(t,e,n){const o=t.get(e)||t.set(e,{}).get(e);if(o[n]===void 0){const r=await(async function(i,a,s){var c;if(!Ue(i))throw new TypeError("JWK must be an object");let h;switch(a!=null||(a=i.alg),h!=null||(h=(c=void 0)!==null&&c!==void 0?c:i.ext),i.kty){case"oct":if(typeof i.k!="string"||!i.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Wn(i.k);case"RSA":if("oth"in i&&i.oth!==void 0)throw new ee('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return vn(k(k({},i),{},{alg:a,ext:h}));case"AKP":if(typeof i.alg!="string"||!i.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(a!==void 0&&a!==i.alg)throw new TypeError("JWK alg and alg option value mismatch");return vn(k(k({},i),{},{ext:h}));case"EC":case"OKP":return vn(k(k({},i),{},{alg:a,ext:h}));default:throw new ee('Unsupported "kty" (Key Type) Parameter value')}})(k(k({},e),{},{ext:!0}),n);if(r instanceof Uint8Array||r.type!=="public")throw new tr("JSON Web Key Set members must be public keys");o[n]=r}return o[n]}function Xr(t){const e=new Cc(t),n=async(o,r)=>e.getKey(o,r);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(e.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let Lo;(typeof navigator>"u"||(cn=navigator.userAgent)===null||cn===void 0||(ro=cn.startsWith)===null||ro===void 0||!ro.call(cn,"Mozilla/5.0 "))&&(Lo="".concat("jose","/").concat("v6.2.3"));const ta=Symbol(),kn=Symbol();var ao=new WeakMap,so=new WeakMap,co=new WeakMap,hn=new WeakMap,je=new WeakMap,ke=new WeakMap,Re=new WeakMap,lo=new WeakMap,Ke=new WeakMap,Me=new WeakMap;class Ec{constructor(e,n){if(L(this,ao,void 0),L(this,so,void 0),L(this,co,void 0),L(this,hn,void 0),L(this,je,void 0),L(this,ke,void 0),L(this,Re,void 0),L(this,lo,void 0),L(this,Ke,void 0),L(this,Me,void 0),!(e instanceof URL))throw new TypeError("url must be an instance of URL");var o,r;x(ao,this,new URL(e.href)),x(so,this,typeof n?.timeoutDuration=="number"?n?.timeoutDuration:5e3),x(co,this,typeof n?.cooldownDuration=="number"?n?.cooldownDuration:3e4),x(hn,this,typeof n?.cacheMaxAge=="number"?n?.cacheMaxAge:6e5),x(Re,this,new Headers(n?.headers)),Lo&&!f(Re,this).has("User-Agent")&&f(Re,this).set("User-Agent",Lo),f(Re,this).has("accept")||(f(Re,this).set("accept","application/json"),f(Re,this).append("accept","application/jwk-set+json")),x(lo,this,n?.[ta]),n?.[kn]!==void 0&&(x(Me,this,n?.[kn]),o=n?.[kn],r=f(hn,this),typeof o=="object"&&o!==null&&"uat"in o&&typeof o.uat=="number"&&!(Date.now()-o.uat>=r)&&"jwks"in o&&Ue(o.jwks)&&Array.isArray(o.jwks.keys)&&Array.prototype.every.call(o.jwks.keys,Ue)&&(x(je,this,f(Me,this).uat),x(Ke,this,Xr(f(Me,this).jwks))))}pendingFetch(){return!!f(ke,this)}coolingDown(){return typeof f(je,this)=="number"&&Date.now()<f(je,this)+f(co,this)}fresh(){return typeof f(je,this)=="number"&&Date.now()<f(je,this)+f(hn,this)}jwks(){var e;return(e=f(Ke,this))===null||e===void 0?void 0:e.jwks()}async getKey(e,n){f(Ke,this)&&this.fresh()||await this.reload();try{return await f(Ke,this).call(this,e,n)}catch(o){if(o instanceof nr&&this.coolingDown()===!1)return await this.reload(),f(Ke,this).call(this,e,n);throw o}}async reload(){f(ke,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&x(ke,this,void 0),f(ke,this)||x(ke,this,(async function(e,n,o){const i=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(e,{method:"GET",signal:o,redirect:"manual",headers:n}).catch(a=>{throw a.name==="TimeoutError"?new Zi:a});if(i.status!==200)throw new F("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new F("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(f(ao,this).href,f(Re,this),AbortSignal.timeout(f(so,this)),f(lo,this)).then(e=>{x(Ke,this,Xr(e)),f(Me,this)&&(f(Me,this).uat=Date.now(),f(Me,this).jwks=e),x(je,this,Date.now()),x(ke,this,void 0)}).catch(e=>{throw x(ke,this,void 0),e})),await f(ke,this)}}const Sc=["mfaToken"],Tc=["mfaToken"];var He,dn,Ze,It,At,Ot,un,pn,ne,mn,fn,se,me,at,O,fe,Lt,Jt,ft,gn,U,Yr=class extends 
3Error{constructor(t,e){super(e),b(this,"code",void 0),this.name="NotSupportedError",this.code=t}},be=class extends Error{constructor(t,e,n){super(e),b(this,"cause",void 0),b(this,"code",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},xc=class extends be{constructor(t,e){super("token_by_code_error",t,e),this.name="TokenByCodeError"}},Pc=class extends be{constructor(t,e){super("token_by_client_credentials_error",t,e),this.name="TokenByClientCredentialsError"}},Rc=class extends be{constructor(t,e){super("token_by_refresh_token_error",t,e),this.name="TokenByRefreshTokenError"}},Ic=class extends be{constructor(t,e){super("token_by_password_error",t,e),this.name="TokenByPasswordError"}},ho=class extends be{constructor(t,e){super("token_for_connection_error",t,e),this.name="TokenForConnectionErrorCode"}},ge=class extends be{constructor(t,e){super("token_exchange_error",t,e),this.name="TokenExchangeError"}},Ie=class extends Error{constructor(t){super(t),b(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},uo=class extends be{constructor(t){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",t),b(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},Ac=class extends be{constructor(t){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",t),this.name="BuildAuthorizationUrlError"}},Oc=class extends be{constructor(t){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",t),this.name="BuildLinkUserUrlError"}},Lc=class extends be{constructor(t){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",t),this.name="BuildUnlinkUserUrlError"}},Nc=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),b(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function No(t){return Object.entries(t).filter(e=>oe(e,2)[1]!==void 0).reduce((e,n)=>k(k({},e),{},{[n[0]]:n[1]}),{})}var jn=class extends Error{constructor(t,e,n){super(e),b(this,"cause",void 0),b(this,"code",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},na=class extends jn{constructor(t,e){super("mfa_list_authenticators_error",t,e),this.name="MfaListAuthenticatorsError"}},oa=class extends jn{constructor(t,e){super("mfa_enrollment_error",t,e),this.name="MfaEnrollmentError"}},Dc=class extends jn{constructor(t,e){super("mfa_delete_authenticator_error",t,e),this.name="MfaDeleteAuthenticatorError"}},ra=class extends jn{constructor(t,e){super("mfa_challenge_error",t,e),this.name="MfaChallengeError"}};function Uc(t){return{id:t.id,authenticatorType:t.authenticator_type,active:t.active,name:t.name,oobChannels:t.oob_channels,type:t.type}}var zc=(He=new WeakMap,dn=new WeakMap,Ze=new WeakMap,class{constructor(t){var e;L(this,He,void 0),L(this,dn,void 0),L(this,Ze,void 0),x(He,this,"https://".concat(t.domain)),x(dn,this,t.clientId),x(Ze,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)})}async listAuthenticators(t){const e="".concat(f(He,this),"/mfa/authenticators"),n=t.mfaToken,o=await f(Ze,this).call(this,e,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const r=await o.json();throw new na(r.error_description||"Failed to list authenticators",r)}return(await o.json()).map(Uc)}async enrollAuthenticator(t){const e="".concat(f(He,this),"/mfa/associate"),n=t.mfaToken,o=gr(t,Sc),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await f(Ze,this).call(this,e,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new oa(a.error_description||"Failed to enroll authenticator",a)}
3return(function(a){if(a.authenticator_type==="otp")return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if(a.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(a.authenticator_type))})(await i.json())}async deleteAuthenticator(t){const e=t.authenticatorId,n=t.mfaToken,o="".concat(f(He,this),"/mfa/authenticators/").concat(encodeURIComponent(e)),r=await f(Ze,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const i=await r.json();throw new Dc(i.error_description||"Failed to delete authenticator",i)}}async challengeAuthenticator(t){const e="".concat(f(He,this),"/mfa/challenge"),n=t.mfaToken,o=gr(t,Tc),r={mfa_token:n,client_id:f(dn,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await f(Ze,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new ra(a.error_description||"Failed to challenge authenticator",a)}return(function(a){const s={challengeType:a.challenge_type};return a.oob_code!==void 0&&(s.oobCode=a.oob_code),a.binding_method!==void 0&&(s.bindingMethod=a.binding_method),s})(await i.json())}}),or=class extends Error{constructor(t,e,n){super(e),b(this,"cause",void 0),b(this,"code",void 0),this.code=t,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Wc=class extends or{constructor(t,e){super("passkey_register_error",t,e),this.name="PasskeyRegisterError"}},jc=class extends or{constructor(t,e){super("passkey_challenge_error",t,e),this.name="PasskeyChallengeError"}},Kc=class extends or{constructor(t,e){super("passkey_get_token_error",t,e),this.name="PasskeyGetTokenError"}},Mc=(It=new WeakMap,At=new WeakMap,Ot=new WeakMap,un=new WeakMap,pn=new WeakSet,class{constructor(t){var e;mi(this,pn),L(this,It,void 0),L(this,At,void 0),L(this,Ot,void 0),L(this,un,void 0),x(It,this,"https://".concat(t.domain)),x(At,this,t.clientId),x(Ot,this,(e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)}),x(un,this,t.grantRequest)}async register(t){const e="".concat(f(It,this),"/passkey/register"),n=k(k(k(k(k(k(k(k({},t.email&&{email:t.email}),t.name&&{name:t.name}),t.phoneNumber&&{phone_number:t.phoneNumber}),t.username&&{username:t.username}),t.givenName&&{given_name:t.givenName}),t.familyName&&{family_name:t.familyName}),t.nickname&&{nickname:t.nickname}),t.picture&&{picture:t.picture}),o={client_id:f(At,this),user_profile:n};t.realm&&(o.realm=t.realm),t.organization&&(o.organization=t.organization),t.userMetadata&&(o.user_metadata=t.userMetadata);const r=await f(Ot,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){const s=await N(pn,this,Br).call(this,r);throw new Wc(s.error_description||"Failed to request signup challenge",s)}return{authSession:(a=await r.json()).auth_session,authnParamsPublicKey:k({},a.authn_params_public_key)};var a}async challenge(t){const e="".concat(f(It,this),"/passkey/challenge"),n={client_id:f(At,this)};t!=null&&t.realm&&(n.realm=t.realm),t!=null&&t.organization&&(n.organization=t.organization);const o=await f(Ot,this).call(this,e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const a=await N(pn,this,Br).call(this,o);throw new jc(a.error_description||"Failed to request login challenge",a)}return{authSession:(i=await o.json()).auth_session,authnParamsPublicKey:k({},i.authn_params_public_key)};var i}async getTokenByPasskey(t){const e=new URLSearchParams({auth_session:t.authSession,authn_response:JSON.stringify(t.credential)});t.realm&&e.append("realm",t.realm),t.scope&&e.append("scope",t.scope),t.audience&&e.append("audience",t.audience),t.organization&&e.append("organization",t.organization);try{return await f(un,this).call(this,"urn:okta:params:oauth:grant-type:webauthn",e)}catch(n){throw new Kc(n.error_description||"Failed to exchange passkey credential for tokens.",n)}}});async function Br(t){try{return await t.json()}catch{return{error:"unknown_error",error_description:"HTTP ".concat(t.status," ").concat(t.statusText)}}}var _e=class ia{constructor(e,n,o,r,i,a,s){b(this,"accessToken",void 0),b(this,"idToken",void 0),b(this,"refreshToken",void 0),b(this,"expiresAt",void 0),b(this,"scope",void 0),b(this,"claims",void 0),b(this,"authorizationDetail
3s",void 0),b(this,"tokenType",void 0),b(this,"issuedTokenType",void 0),this.accessToken=e,this.idToken=o,this.refreshToken=r,this.expiresAt=n,this.scope=i,this.claims=a,this.authorizationDetails=s}static fromTokenEndpointResponse(e){const n=e.id_token?e.claims():void 0,o=new ia(e.access_token,Math.floor(Date.now()/1e3)+Number(e.expires_in),e.id_token,e.refresh_token,e.scope,n,e.authorization_details);return o.tokenType=e.token_type,o.issuedTokenType=e.issued_token_type,o}},Hc=(ne=new WeakMap,mn=new WeakMap,fn=new WeakMap,class{constructor(t,e){L(this,ne,new Map),L(this,mn,void 0),L(this,fn,void 0),x(fn,this,Math.max(1,Math.floor(t))),x(mn,this,Math.max(0,Math.floor(e)))}get(t){const e=f(ne,this).get(t);if(e){if(!(Date.now()>=e.expiresAt))return f(ne,this).delete(t),f(ne,this).set(t,e),e.value;f(ne,this).delete(t)}}set(t,e){for(f(ne,this).has(t)&&f(ne,this).delete(t),f(ne,this).set(t,{value:e,expiresAt:Date.now()+f(mn,this)});f(ne,this).size>f(fn,this);){const n=f(ne,this).keys().next().value;if(n===void 0)break;f(ne,this).delete(n)}}}),qr=new Map;function Qr(t){return{ttlMs:1e3*(typeof t?.ttl=="number"?t.ttl:600),maxEntries:typeof t?.maxEntries=="number"&&t.maxEntries>0?t.maxEntries:100}}var $r=class{static createDiscoveryCache(t){const e=(n=t.maxEntries,o=t.ttlMs,"".concat(n,":").concat(o));var n,o;let r=(i=e,qr.get(i));var i;return r||(r=new Hc(t.maxEntries,t.ttlMs),qr.set(e,r)),r}static createJwksCache(){return{}}},Do="openid profile email offline_access",Zc=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 aa(t){if(t==null)throw new ge("subject_token is required");if(typeof t!="string")throw new ge("subject_token must be a string");if(t.trim().length===0)throw new ge("subject_token cannot be blank or whitespace");if(t!==t.trim())throw new ge("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(t))throw new ge("subject_token must not include the 'Bearer ' prefix")}function sa(t,e){if(e)for(const o of Object.entries(e)){var n=oe(o,2);const r=n[0],i=n[1];if(!Zc.has(r))if(Array.isArray(i)){if(i.length>20)throw new ge("Parameter '".concat(r,"' exceeds maximum array size of ").concat(20));i.forEach(a=>{t.append(r,a)})}else t.append(r,i)}}var ca="urn:ietf:params:oauth:token-type:access_token",Jc=(se=new WeakMap,me=new WeakMap,at=new WeakMap,O=new WeakMap,fe=new WeakMap,Lt=new WeakMap,Jt=new WeakMap,ft=new WeakMap,gn=new WeakMap,U=new WeakSet,class{constructor(t){var e,n,o,r;if(mi(this,U),L(this,se,void 0),L(this,me,void 0),L(this,at,void 0),L(this,O,void 0),L(this,fe,void 0),L(this,Lt,void 0),L(this,Jt,void 0),L(this,ft,void 0),L(this,gn,void 0),b(this,"mfa",void 0),b(this,"passkey",void 0),x(O,this,t),t.useMtls&&!t.customFetch)throw new Yr("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");x(fe,this,(function(a,s){if(s.enabled===!1)return a;const c={name:s.name,version:s.version},h=btoa(JSON.stringify(c));return async(l,d)=>{const u=l instanceof Request?new Headers(l.headers):new Headers;return d!=null&&d.headers&&new Headers(d.headers).forEach((p,g)=>{u.set(g,p)}),u.set("Auth0-Client",h),a(l,k(k({},d),{},{headers:u}))}})((e=t.customFetch)!==null&&e!==void 0?e:function(){return fetch(...arguments)},((n=t.telemetry)==null?void 0:n.enabled)===!1?n:{enabled:!0,name:(o=n?.name)!==null&&o!==void 0?o:"@auth0/auth0-auth-js",version:(r=n?.version)!==null&&r!==void 0?r:"1.7.0"}));const i=Qr(t.discoveryCache);x(Jt,this,$r.createDiscoveryCache(i)),x(ft,this,new Map),x(gn,this,$r.createJwksCache()),this.mfa=new zc({domain:f(O,this).domain,clientId:f(O,this).clientId,customFetch:f(fe,this)}),this.passkey=new Mc({domain:f(O,this).domain,clientId:f(O,this).clientId,customFetch:f(fe,this),grantRequest:async(a,s)=>{const c=(await N(U,this,B).call(this)).configuration,h=await mt(c,a,s);return _e.fromTokenEndpointResponse(h)}})}async getServerMetadata(){return(await N(U,this,B).call(this)).serverMetadata}async buildAuthorizationUrl(t){const e=(await N(U,this,B).call(this)).serverMetadata;if(t!=null&&t.pushedAuthorizationRequests&&!e.pushed_authorization_request_endpoint)throw new Yr("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await N(U,this,po).call(this,t)}catch(n){throw new Ac(n)}}async buildLinkUserUrl(t){try{const e=await N(U,this,po).call(this,{authorizationParams:k(k({},t.authorizationParams),{},{requested_connection:t.connection,requested_connection_scope:t.connectionScope,scope:"openid link_account offline_access",id_token_hint:t.idToken})});return{linkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new Oc(e)}}async buildUnlinkUserUrl(t){try{const e=await N(U,this,po).call(this,{authorizationParams:k(k({},t.authorizationParams),{},{requested_connection:t.connection,scope:"openid unlink_account",id_token_hint:t.idToken})});return{unlinkUserUrl:e.authorizationUrl,codeVerifier:e.codeVerifier}}catch(e){throw new Lc(e)}}async backchannelAuthentication(t){const e=await N(U,this,B).call(this),n=e.configuration,o=e.serverMetadata,r=No(k(k({},f(O,this).authorizationParams),t?.authorizationParams)),i=new URLSearchParams(k(k({scope:Do},r),{},{client_id:f(O,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));t.requestedExpiry&&i.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetail
3s&&i.append("authorization_details",JSON.stringify(t.authorizationDetails));try{const a=await Zr(n,i),s=await Bi(n,a);return _e.fromTokenEndpointResponse(s)}catch(a){throw new uo(a)}}async initiateBackchannelAuthentication(t){const e=await N(U,this,B).call(this),n=e.configuration,o=e.serverMetadata,r=No(k(k({},f(O,this).authorizationParams),t?.authorizationParams)),i=new URLSearchParams(k(k({scope:Do},r),{},{client_id:f(O,this).clientId,binding_message:t.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:o.issuer,sub:t.loginHint.sub})}));t.requestedExpiry&&i.append("requested_expiry",t.requestedExpiry.toString()),t.authorizationDetails&&i.append("authorization_details",JSON.stringify(t.authorizationDetails));try{const a=await Zr(n,i);return{authReqId:a.auth_req_id,expiresIn:a.expires_in,interval:a.interval}}catch(a){throw new uo(a)}}async backchannelAuthenticationGrant(t){let e=t.authReqId;const n=(await N(U,this,B).call(this)).configuration,o=new URLSearchParams({auth_req_id:e});try{const r=await mt(n,"urn:openid:params:grant-type:ciba",o);return _e.fromTokenEndpointResponse(r)}catch(r){throw new uo(r)}}async getTokenForConnection(t){var e;if(t.refreshToken&&t.accessToken)throw new ho("Either a refresh or access token should be specified, but not both.");const n=(e=t.accessToken)!==null&&e!==void 0?e:t.refreshToken;if(!n)throw new ho("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:t.connection,subjectToken:n,subjectTokenType:t.accessToken?ca:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:t.loginHint})}catch(o){throw o instanceof ge?new ho(o.message,o.cause):o}}async exchangeToken(t){return"connection"in t?N(U,this,Gc).call(this,t):N(U,this,Vc).call(this,t)}async getTokenByCode(t,e){const n=(await N(U,this,B).call(this)).configuration;try{const o=await qi(n,t,{pkceCodeVerifier:e.codeVerifier});return _e.fromTokenEndpointResponse(o)}catch(o){throw new xc("There was an error while trying to request a token.",o)}}async getTokenByRefreshToken(t){const e=(await N(U,this,B).call(this)).configuration,n=new URLSearchParams;t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope);try{const o=await Qi(e,t.refreshToken,n);return _e.fromTokenEndpointResponse(o)}catch(o){throw new Rc("The access token has expired and there was an error while trying to refresh it.",o)}}async getTokenByPassword(t){const e=(await N(U,this,B).call(this)).configuration,n=new URLSearchParams({username:t.username,password:t.password});t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),t.realm&&n.append("realm",t.realm);let o=e;if(t.auth0ForwardedFor){const r=await N(U,this,rr).call(this);o=new bt(e.serverMetadata(),f(O,this).clientId,f(O,this).clientSecret,r),o[ye]=(i,a)=>f(fe,this).call(this,i,k(k({},a),{},{headers:k(k({},a.headers),{},{"auth0-forwarded-for":t.auth0ForwardedFor})}))}try{const r=await mt(o,"password",n);return _e.fromTokenEndpointResponse(r)}catch(r){throw new Ic("There was an error while trying to request a token.",r)}}async getTokenByClientCredentials(t){const e=(await N(U,this,B).call(this)).configuration;try{const n=new URLSearchParams({audience:t.audience});t.organization&&n.append("organization",t.organization);const o=await $i(e,n);return _e.fromTokenEndpointResponse(o)}catch(n){throw new Pc("There was an error while trying to request a token.",n)}}async buildLogoutUrl(t){const e=await N(U,this,B).call(this),n=e.configuration;if(!e.serverMetadata.end_session_endpoint){const o=new URL("https://".concat(f(O,this).domain,"/v2/logout"));return o.searchParams.set("returnTo",t.returnTo),o.searchParams.set("client_id",f(O,this).clientId),o}return(function(o,r){Pe(o);const i=J(o),a=i.as,s=i.c,c=Xt(a,"end_session_endpoint",!1,i.tlsOnly);(r=new URLSearchParams(r)).has("client_id")||r.set("client_id",s.client_id);for(const l of r.entries()){var h=oe(l,2);const d=h[0],u=h[1];c.searchParams.append(d,u)}return c})(n,{post_logout_redirect_uri:t.returnTo})}async verifyLogoutToken(t){const e=(await N(U,this,B).call(this)).serverMetadata,n=Qr(f(O,this).discoveryCache),o=e.jwks_uri;f(Lt,this)||x(Lt,this,(function(i,a){const s=new Ec(i,a),c=async(h,l)=>s.getKey(h,l);return Object.defineProperties(c,{coolingDown:{get:()=>s.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>s.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>s.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>s.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>s.jwks(),enumerable:!0,configurable:!1,writable:!1}}),c})(new URL(o),{cacheMaxAge:n.ttlMs,[ta]:f(fe,this),[kn]:f(gn,this)}));const r=(await kc(t.logoutToken,f(Lt,this),{issuer:e.issuer,audience:f(O,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]})).payload;if(!("sid"in r)&&!("sub"in r))throw new Ie('either "sid" or "sub" (or both) claims must be present');
3if("sid"in r&&typeof r.sid!="string")throw new Ie('"sid" claim must be a string');if("sub"in r&&typeof r.sub!="string")throw new Ie('"sub" claim must be a string');if("nonce"in r)throw new Ie('"nonce" claim is prohibited');if(!("events"in r))throw new Ie('"events" claim is missing');if(typeof r.events!="object"||r.events===null)throw new Ie('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in r.events))throw new Ie('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof r.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new Ie('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:r.sid,sub:r.sub}}});function Fc(){const t=f(O,this).domain.toLowerCase();return"".concat(t,"|mtls:").concat(f(O,this).useMtls?"1":"0")}async function ei(t){const e=await N(U,this,rr).call(this),n=new bt(t,f(O,this).clientId,f(O,this).clientSecret,e);return n[ye]=f(fe,this),n}async function B(){if(f(se,this)&&f(me,this))return{configuration:f(se,this),serverMetadata:f(me,this)};const t=N(U,this,Fc).call(this),e=f(Jt,this).get(t);if(e)return x(me,this,e.serverMetadata),x(se,this,await N(U,this,ei).call(this,e.serverMetadata)),{configuration:f(se,this),serverMetadata:f(me,this)};const n=f(ft,this).get(t);if(n){const i=await n;return x(me,this,i.serverMetadata),x(se,this,await N(U,this,ei).call(this,i.serverMetadata)),{configuration:f(se,this),serverMetadata:f(me,this)}}const o=(async()=>{const i=await N(U,this,rr).call(this),a=await gc(new URL("https://".concat(f(O,this).domain)),f(O,this).clientId,{use_mtls_endpoint_aliases:f(O,this).useMtls},i,{[ye]:f(fe,this)}),s=a.serverMetadata();return f(Jt,this).set(t,{serverMetadata:s}),{configuration:a,serverMetadata:s}})(),r=o.then(i=>({serverMetadata:i.serverMetadata}));r.catch(()=>{}),f(ft,this).set(t,r);try{const i=await o,a=i.configuration,s=i.serverMetadata;x(se,this,a),x(me,this,s),f(se,this)[ye]=f(fe,this)}finally{f(ft,this).delete(t)}return{configuration:f(se,this),serverMetadata:f(me,this)}}async function Gc(t){var e,n;const o=(await N(U,this,B).call(this)).configuration;if("audience"in t||"resource"in t)throw new ge("audience and resource parameters are not supported for Token Vault exchanges");aa(t.subjectToken);const r=new URLSearchParams({connection:t.connection,subject_token:t.subjectToken,subject_token_type:(e=t.subjectTokenType)!==null&&e!==void 0?e:ca,requested_token_type:(n=t.requestedTokenType)!==null&&n!==void 0?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});t.loginHint&&r.append("login_hint",t.loginHint),t.scope&&r.append("scope",t.scope),sa(r,t.extra);try{const i=await mt(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return _e.fromTokenEndpointResponse(i)}catch(i){throw new ge("Failed to exchange token for connection '".concat(t.connection,"'."),i)}}async function Vc(t){const e=(await N(U,this,B).call(this)).configuration;aa(t.subjectToken);const n=new URLSearchParams({subject_token_type:t.subjectTokenType,subject_token:t.subjectToken});t.audience&&n.append("audience",t.audience),t.scope&&n.append("scope",t.scope),t.requestedTokenType&&n.append("requested_token_type",t.requestedTokenType),t.organization&&n.append("organization",t.organization),sa(n,t.extra);try{const o=await mt(e,"urn:ietf:params:oauth:grant-type:token-exchange",n);return _e.fromTokenEndpointResponse(o)}catch(o){throw new ge("Failed to exchange token of type '".concat(t.subjectTokenType,"'").concat(t.audience?" for audience '".concat(t.audience,"'"):"","."),o)}}async function rr(){return f(at,this)||x(at,this,(async()=>{if(!f(O,this).clientSecret&&!f(O,this).clientAssertionSigningKey&&!f(O,this).useMtls)throw new Nc;if(f(O,this).useMtls)return(e,n,o,r)=>{o.set("client_id",n.client_id)};let t=f(O,this).clientAssertionSigningKey;return!t||t instanceof CryptoKey||(t=await(async function(e,n,o){if(typeof e!="string"||e.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return uc(e,n,o)})(t,f(O,this).clientAssertionSigningAlg||"RS256")),t?(function(e,n){return Ds(e)})(t):Vi(f(O,this).clientSecret)})().catch(t=>{throw x(at,this,void 0),t})),f(at,this)}async function po(t){const e=(await N(U,this,B).call(this)).configuration,n=fc(),o=await mc(n),r=No(k(k({},f(O,this).authorizationParams),t?.authorizationParams)),i=new URLSearchParams(k(k({scope:Do},r),{}
3,{client_id:f(O,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:t!=null&&t.pushedAuthorizationRequests?await ea(e,i):await Oo(e,i),codeVerifier:n}}class ze extends z{constructor(e,n){super(e,n),Object.setPrototypeOf(this,ze.prototype)}static fromPayload(e){let n=e.error,o=e.error_description;return new ze(n,o)}}class On extends ze{constructor(e,n){super(e,n),Object.setPrototypeOf(this,On.prototype)}}class ir extends ze{constructor(e,n){super(e,n),Object.setPrototypeOf(this,ir.prototype)}}class ar extends ze{constructor(e,n){super(e,n),Object.setPrototypeOf(this,ar.prototype)}}class st extends ze{constructor(e,n){super(e,n),Object.setPrototypeOf(this,st.prototype)}}class sr extends ze{constructor(e,n){super(e,n),Object.setPrototypeOf(this,sr.prototype)}}class Xc{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=e}set(e,n){this.cleanup(),this.contexts.set(e,Object.assign(Object.assign({},n),{createdAt:Date.now()}))}get(e){const n=this.contexts.get(e);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(e)}}remove(e){this.contexts.delete(e)}cleanup(){const e=Date.now();for(const o of this.contexts){var n=oe(o,2);const r=n[0];e-n[1].createdAt>this.ttlMs&&this.contexts.delete(r)}}get size(){return this.contexts.size}}class Yc{constructor(e,n){this.authJsMfaClient=e,this.auth0Client=n,this.contextManager=new Xc}setMFAAuthDetails(e,n,o,r){this.contextManager.set(e,{scope:n,audience:o,mfaRequirements:r})}async getAuthenticators(e){var n,o;const r=this.contextManager.get(e);if(!(!((n=r?.mfaRequirements)===null||n===void 0)&&n.challenge)||r.mfaRequirements.challenge.length===0)throw new On("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const i=r.mfaRequirements.challenge.map(a=>a.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:e})).filter(a=>!!a.type&&i.includes(a.type))}catch(a){throw a instanceof na?new On((o=a.cause)===null||o===void 0?void 0:o.error,a.message):a}}async enroll(e){var n;const o=(function(r){const i=Ts[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:i.authenticatorTypes},i.oobChannels&&{oobChannels:i.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})})(e);try{return await this.authJsMfaClient.enrollAuthenticator(o)}catch(r){throw r instanceof oa?new ir((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(e){var n;try{const o={challengeType:e.challengeType,mfaToken:e.mfaToken};return e.authenticatorId&&(o.authenticatorId=e.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(o)}catch(o){throw o instanceof ra?new ar((n=o.cause)===null||n===void 0?void 0:n.error,o.message):o}}async getEnrollmentFactors(e){const n=this.contextManager.get(e);if(!n||!n.mfaRequirements)throw new sr("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(e){const n=this.contextManager.get(e.mfaToken);if(!n)throw new st("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const o=(function(a){return"otp"in a&&a.otp?xs:"oobCode"in a&&a.oobCode?Ps:"recoveryCode"in a&&a.recoveryCode?Rs:void 0})(e);if(!o)throw new st("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,i=n.audience;try{const a=await this.auth0Client._requestTokenForMfa({grant_type:o,mfaToken:e.mfaToken,scope:r,audience:i,otp:e.otp,oob_code:e.oobCode,binding_code:e.bindingCode,recovery_code:e.recoveryCode});return this.contextManager.remove(e.mfaToken),a}catch(a){if(a instanceof wt)this.setMFAAuthDetails(a.mfa_token,r,i,a.mfa_requirements);else if(a instanceof st)throw new st(a.error,a.error_description);throw a}}}
3class ct extends Error{constructor(e,n,o){super(n),this.name="PasskeyError",this.code=e,this.cause=o,Object.setPrototypeOf(this,ct.prototype)}}var Wt,jt;class Bc{constructor(e,n){Wt.set(this,void 0),jt.set(this,void 0),pr(this,Wt,e),pr(this,jt,n)}async signup(e){if(!window.PublicKeyCredential)throw new ct("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e.scope,o=e.audience,r=q(e,["scope","audience"]),i=await tn(this,Wt,"f").register(r),a=(s=i.authnParamsPublicKey,Object.assign(Object.assign({},s),{challenge:mo(s.challenge),user:Object.assign(Object.assign({},s.user),{id:mo(s.user.id)}),pubKeyCredParams:s.pubKeyCredParams,authenticatorSelection:s.authenticatorSelection}));var s;const c=await navigator.credentials.create({publicKey:a});if(!c)throw new ct("passkey_cancelled","Passkey creation was cancelled or no credential was returned.");const h=(function(l){var d;const u=l.response;return{id:l.id,rawId:Ae(l.rawId),type:l.type,authenticatorAttachment:(d=l.authenticatorAttachment)!==null&&d!==void 0?d:void 0,response:{clientDataJSON:Ae(u.clientDataJSON),attestationObject:Ae(u.attestationObject)},clientExtensionResults:l.getClientExtensionResults()}})(c);return tn(this,jt,"f")._requestTokenForPasskey({authSession:i.authSession,credential:h,realm:r.realm,organization:r.organization,scope:n,audience:o})}async login(e){if(!window.PublicKeyCredential)throw new ct("passkey_not_supported","WebAuthn is not supported in this browser.");const n=e||{},o=n.scope,r=n.audience,i=q(n,["scope","audience"]),a=await tn(this,Wt,"f").challenge(Object.keys(i).length>0?i:void 0),s=(c=a.authnParamsPublicKey,Object.assign(Object.assign({},c),{challenge:mo(c.challenge)}));var c;const h=await navigator.credentials.get({publicKey:s});if(!h)throw new ct("passkey_cancelled","Passkey authentication was cancelled or no credential was returned.");const l=(function(d){var u;const p=d.response;return{id:d.id,rawId:Ae(d.rawId),type:d.type,authenticatorAttachment:(u=d.authenticatorAttachment)!==null&&u!==void 0?u:void 0,response:{clientDataJSON:Ae(p.clientDataJSON),authenticatorData:Ae(p.authenticatorData),signature:Ae(p.signature),userHandle:p.userHandle?Ae(p.userHandle):void 0},clientExtensionResults:d.getClientExtensionResults()}})(h);return tn(this,jt,"f")._requestTokenForPasskey({authSession:a.authSession,credential:l,realm:i.realm,organization:i.organization,scope:o,audience:r})}}function Ae(t){const e=new Uint8Array(t),n=Array.from(e,o=>String.fromCharCode(o)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mo(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),o=atob(n),r=new Uint8Array(o.length);for(let i=0;i<o.length;i++)r[i]=o.charCodeAt(i);return r.buffer}Wt=new WeakMap,jt=new WeakMap;class qc{constructor(e){let n,o;if(this.userCache=new Ci().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!En())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(En().subtle===void 0)throw new Error(`
4      auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
5    `)})(),this.lockManager=(Fn||(Fn=Ba()),Fn),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)o=e.cache;else{if(n=e.cacheLocation||yr,!xr(n))throw new Error('Invalid cache location "'.concat(n,'"'));o=xr(n)()}var r;this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:yo,this.cookieStorage=e.legacySameSiteCookie===!1?rt:gs,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(h=>"auth0.".concat(h,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const i=e.useCookiesForTransactions?this.cookieStorage:ys;var a;this.scope=(function(h,l){for(var d=arguments.length,u=new Array(d>2?d-2:0),p=2;p<d;p++)u[p-2]=arguments[p];if(typeof h!="object")return{[G]:wn(l,h,...u)};let g={[G]:wn(l,...u)};
5return Object.keys(h).forEach(y=>{const w=h[y];g[y]=wn(l,w,...u)}),g})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new hs(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||fi,this.cacheManager=new ls(o,o.allKeys?void 0:new bs(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Cs(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=((h,l)=>h?h.startsWith("https://")?h:"https://".concat(h,"/"):"".concat(l,"/"))(this.options.issuer,this.domainUrl);const s="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:h=>{var l;return this.getTokenSilently({authorizationParams:{scope:(l=h?.scope)===null||l===void 0?void 0:l.join(" "),audience:s},detailedResponse:!0})}}));this.myAccount=new Ss(c,s),this.authJsClient=new Jc({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Yc(this.authJsClient.mfa,this),this.passkey=new Bc(this.authJsClient.passkey,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n===yr&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new vs,this.worker.postMessage({type:"init",allowedBaseUrl:this.domainUrl}))}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(e){const n=this.options.auth0Client||wo,o=vo(n,!0),r=encodeURIComponent(btoa(JSON.stringify(o)));return"".concat(this.domainUrl).concat(e,"&auth0Client=").concat(r)}_authorizeUrl(e){return this._url("/authorize?".concat(zt(e)))}async _verifyIdToken(e,n,o){const r=await this.nowProvider();return us({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:n,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(e){return new URLSearchParams(window.location.search).get(e)||void 0}_clearSessionTransferTokenFromUrl(e){try{const n=new URL(window.location.href);n.searchParams.has(e)&&(n.searchParams.delete(e),window.history.replaceState({},"",n.toString()))}catch{}}_applySessionTransferToken(e){const n=this.options.sessionTransferTokenQueryParamName;if(!n||e.session_transfer_token)return e;const o=this._extractSessionTransferToken(n);return o?(this._clearSessionTransferTokenFromUrl(n),Object.assign(Object.assign({},e),{session_transfer_token:o})):e}async _prepareAuthorizeUrl(e,n,o){var r;const i=Mn(St()),a=Mn(St()),s=St(),c=await wr(s),h=br(c),l=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),d=((p,g,y,w,m,v,_,C,S)=>Object.assign(Object.assign(Object.assign({client_id:p.clientId},p.authorizationParams),y),{scope:xt(g,y.scope,y.audience),response_type:"code",response_mode:C||"query",state:w,nonce:m,redirect_uri:_||p.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256",dpop_jkt:S}))(this.options,this.scope,e,i,a,h,e.redirect_uri||this.options.authorizationParams.redirect_uri||o,n?.response_mode,l),u=this._authorizeUrl(d);return{nonce:a,code_verifier:s,scope:d.scope,audience:d.audience||G,redirect_uri:d.redirect_uri,state:i,url:u}}async loginWithPopup(e,n){var o;if(e=e||{},!(n=n||{}).popup&&(n.popup=(c=>{const h=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup","left=".concat(h,",top=").concat(l,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new Jo;const r=this._applySessionTransferToken(e.authorizationParams||{}),i=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const a=await((c,h)=>new Promise((l,d)=>{let u;const p=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(p),clearTimeout(g),window.removeEventListener("message",u,!1),d(new Zo(c.popup)))},1e3),g=setTimeout(()=>{clearInterval(p),d(new Ho(c.popup)),window.removeEventListener("message",u,!1)},1e3*(c.timeoutInSeconds||60));u=function(y){if(y.origin===h&&y.data&&y.data.type==="authorization_response"){if(clearTimeout(g),clearInterval(p),window.removeEventListener("message",u,!1),c.closePopup!==!1&&c.popup.close(),y.data.response.error)return d(z.fromPayload(y.data.response));l(y.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new URL(i.url).origin);if(i.state!==a.state)throw new z("state_mismatch","Invalid state");const s=((o=e.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:a.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organization:s})}async getUser(){var e;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;const n=await this._getIdTokenFromCache();return(e=n?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(){var e;const n=Pr(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}
5),o=n.openUrl,r=n.fragment,i=n.appState,a=q(n,["openUrl","fragment","appState"]),s=((e=a.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,c=this._applySessionTransferToken(a.authorizationParams||{}),h=await this._prepareAuthorizeUrl(c),l=h.url,d=q(h,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:i,response_type:Fe.Code}),s&&{organization:s}));const u=r?"".concat(l,"#").concat(r):l;o?await o(u):window.location.assign(u)}async handleRedirectCallback(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new z("missing_transaction","Invalid state");this.transactionManager.remove();const o=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const i=new URLSearchParams(r);return{state:i.get("state"),code:i.get("code")||void 0,connect_code:i.get("connect_code")||void 0,error:i.get("error")||void 0,error_description:i.get("error_description")||void 0}})(e.join(""));return n.response_type===Fe.ConnectCode?this._handleConnectAccountRedirectCallback(o,n):this._handleLoginRedirectCallback(o,n)}async _handleLoginRedirectCallback(e,n){const o=e.code,r=e.state,i=e.error,a=e.error_description;if(i)throw new Ko(i,a||i,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new z("state_mismatch","Invalid state");const s=n.organization,c=n.nonce,h=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o},h?{redirect_uri:h}:{}),{nonceIn:c,organization:s}),{appState:n.appState,response_type:Fe.Code}}async _handleConnectAccountRedirectCallback(e,n){const o=e.connect_code,r=e.state,i=e.error,a=e.error_description;if(i)throw new Mo(i,a||i,n.connection,r,n.appState);if(!o)throw new z("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new z("state_mismatch","Invalid state");const s=await this.myAccount.completeAccount({auth_session:n.auth_session,connect_code:o,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},s),{appState:n.appState,response_type:Fe.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(Tr))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(Tr)}try{await this.getTokenSilently(e)}catch{}}async getTokenSilently(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,o;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:xt(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((o=e.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})}),i=await((a,s)=>{let c=Xn[s];return c||(c=a().finally(()=>{delete Xn[s],c=null}),Xn[s]=c),c})(()=>this._getTokenSilently(r),"".concat(this.options.clientId,"::").concat(r.authorizationParams.audience,"::").concat(r.authorizationParams.scope));return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const n=e.cacheMode,o=q(e,["cacheMode"]);if(n!=="off"){const s=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||G,clientId:this.options.clientId,cacheMode:n});if(s)return s}if(n==="cache-only")return;const r=(i=this.options.clientId,a=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;try{return await this.lockManager.runWithLock(r,5e3,async()=>{if(n!=="off"){const p=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||G,clientId:this.options.clientId});if(p)return p}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),c=s.id_token,h=s.token_type,l=s.access_token,d=s.oauthTokenScope,u=s.expires_in;return Object.assign(Object.assign({id_token:c,token_type:h,access_token:l},d?{scope:d}:null),{expires_in:u})})}catch(s){if(this._isInteractiveError(s)&&this.options.interactiveErrorHandler==="popup")return await this._handleInteractiveErrorWithPopup(o);throw s}}_isInteractiveError(e){return e instanceof wt||e instanceof z&&this._isIframeMfaError(e)}_isIframeMfaError(e){return e.error==="login_required"&&e.error_description==="Multifactor authentication required"}async _handleInteractiveErrorWithPopup(e){try{await this.loginWithPopup({authorizationParams:e.authorizationParams});const n=await this._getEntryFromCache({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||G,clientId:this.options.clientId});if(!n)throw new z("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return n}catch(n){throw n}}async getTokenWithPopup(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var o,r;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:xt(this.scope,(o=e.authorizationParams)===null||o===void 0?void 0:o.scope,((r=e.authorizationParams)===null||r===void 0?void 0:r.audie
5nce)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},Za),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new Q({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||G,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const n=e.logoutParams||{},o=n.federated,r=q(n,["federated"]),i=o?"&federated":"";return this._url("/v2/logout?".concat(zt(Object.assign({clientId:e.clientId},r))))+i}async revokeRefreshToken(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.options.useRefreshTokens)return;const n=e.audience||this.options.authorizationParams.audience||G,o=await this.cacheManager.getRefreshTokensByAudience(n,this.options.clientId);await(async function(r,i){let a=r.baseUrl,s=r.timeout,c=r.auth0Client,h=r.useFormData,l=r.refreshTokens,d=r.audience,u=r.client_id,p=r.onRefreshTokenRevoked;const g=s||yo,y="refresh_token",w="".concat(a,"/oauth/revoke"),m={"Content-Type":h?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(vo(c||wo)))};if(i){const _={client_id:u,token_type_hint:y},C=h?zt(_):JSON.stringify(_);try{return await ko({type:"revoke",timeout:g,fetchUrl:w,fetchOptions:{method:"POST",body:C,headers:m},useFormData:h,auth:{audience:d??G}},i)}catch(S){throw new z("revoke_error",S.message)}}for(const _ of l){const C={client_id:u,token_type_hint:y,token:_},S=h?zt(C):JSON.stringify(C),P=await ki(w,{method:"POST",body:S,headers:m},g);if(!P.ok){let E,A;try{var v=JSON.parse(await P.text());E=v.error,A=v.error_description}catch{}throw new z(E||"revoke_error",A||"HTTP error ".concat(P.status))}await p?.(_)}})({baseUrl:this.domainUrl,timeout:this.httpTimeoutMs,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,client_id:this.options.clientId,refreshTokens:o,audience:n,onRefreshTokenRevoked:r=>this.cacheManager.stripRefreshToken(r)},this.worker)}async logout(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;const o=Pr(e),r=o.openUrl,i=q(o,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove(ot);try{await((n=this.dpop)===null||n===void 0?void 0:n.clear())}catch{}if(this.worker)try{await ko({type:"clear"},this.worker)}catch{}const a=this._buildLogoutUrl(i);r?await r(a):r!==!1&&window.location.assign(a)}async _getTokenFromIFrame(e){const n=(o=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(o));var o;try{return await this.lockManager.runWithLock(n,5e3,async()=>{const r=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!r.organization&&(r.organization=i);const a=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin),s=a.url,c=a.state,h=a.nonce,l=a.code_verifier,d=a.redirect_uri,u=a.scope,p=a.audience;if(window.crossOriginIsolated)throw new z("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const g=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let y;try{y=new URL(this.domainUrl).origin}catch{y=this.domainUrl}const w=await(function(v,_){let C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((S,P)=>{const E=window.document.createElement("iframe");E.setAttribute("width","0"),E.setAttribute("height","0"),E.style.display="none";const A=()=>{window.document.body.contains(E)&&(window.document.body.removeChild(E),window.removeEventListener("message",j,!1))};let j;const H=setTimeout(()=>{P(new kt),A()},1e3*C);j=function(K){if(K.origin!=_||!K.data||K.data.type!=="authorization_response")return;const ie=K.source;ie&&ie.close(),K.data.response.error?P(z.fromPayload(K.data.response)):S(K.data.response),clearTimeout(H),window.removeEventListener("message",j,!1),setTimeout(A,2e3)},window.addEventListener("message",j,!1),window.document.body.appendChild(E),E.setAttribute("src",v)})})(s,y,g);if(c!==w.state)throw new z("state_mismatch","Invalid state");const m=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:l,code:w.code,grant_type:"authorization_code",redirect_uri:d,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}
5),{nonceIn:h,organization:r.organization});return Object.assign(Object.assign({},m),{scope:u,oauthTokenScope:m.scope,audience:p})})}catch(r){throw r.error==="login_required"&&(r instanceof z&&this._isIframeMfaError(r)&&this.options.interactiveErrorHandler==="popup"||this.logout({openUrl:!1})),r}}async _getTokenUsingRefreshToken(e){var n,o;const r=await this.cacheManager.get(new Q({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||G,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new Ln(e.authorizationParams.audience||G,e.authorizationParams.scope)}const i=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,s=((u,p,g,y)=>{var w;if(u&&g&&y){if(p.audience!==g)return p.scope;const m=y.split(" "),v=((w=p.scope)===null||w===void 0?void 0:w.split(" "))||[],_=v.every(C=>m.includes(C));return m.length>=v.length&&_?y:p.scope}return p.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const u=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:i}),a&&{timeout:a}),{scopesToRequest:s});if(u.refresh_token&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,u.refresh_token),this.options.useMrrt&&(c=r?.audience,h=r?.scope,l=e.authorizationParams.audience,d=e.authorizationParams.scope,(c!==l||!Rr(d,h))&&!Rr(s,u.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const p=((g,y)=>{const w=g?.split(" ")||[],m=y?.split(" ")||[];return w.filter(v=>m.indexOf(v)==-1).join(",")})(s,u.scope);throw new Fo(e.authorizationParams.audience||"default",p)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||G})}catch(u){if(u.message){if(u.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),u;if((u.message.includes("Missing Refresh Token")||u.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e)}throw u instanceof wt&&this.mfa.setMFAAuthDetails(u.mfa_token,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,(o=e.authorizationParams)===null||o===void 0?void 0:o.audience,u.mfa_requirements),u}var c,h,l,d}async _saveEntryInCache(e){const n=e.id_token,o=e.decodedToken,r=q(e,["id_token","decodedToken"]);this.userCache.set(ot,{id_token:n,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||G,n=this.scope[e],o=await this.cacheManager.getIdToken(new Q({clientId:this.options.clientId,audience:e,scope:n})),r=this.userCache.get(ot);return o&&o.id_token===r?.id_token?r:(this.userCache.set(ot,o),o)}async _getEntryFromCache(e){let n=e.scope,o=e.audience,r=e.clientId,i=e.cacheMode;const a=await this.cacheManager.get(new Q({scope:n,audience:o,clientId:r}),60,this.options.useMrrt,i);if(a&&a.access_token){const s=a.token_type,c=a.access_token,h=a.oauthTokenScope,l=a.expires_in,d=await this._getIdTokenFromCache();return d&&Object.assign(Object.assign({id_token:d.id_token,token_type:s||"Bearer",access_token:c},h?{scope:h}:null),{expires_in:l})}}async _requestToken(e,n){var o,r;const i=n||{},a=i.nonceIn,s=i.organization,c=i.scopesToRequest,h=await _r(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:c||e.scope}),this.worker),l=await this._verifyIdToken(h.id_token,a,s);if(e.grant_type==="authorization_code"){const d=await this._getIdTokenFromCache();!((r=(o=d?.decodedToken)===null||o===void 0?void 0:o.claims)===null||r===void 0)&&r.sub&&d.decodedToken.claims.sub!==l.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(ot))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},h),{decodedToken:l,scope:e.scope,audience:e.audience||G}),h.scope?{oauthTokenScope:h.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(s||l.claims.org_id),Object.assign(Object.assign({},h),{decodedToken:l})}_buildTokenExchangeParams(e){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type}),e.actor_token&&{actor_token:e.actor_token}),e.actor_token_type&&{actor_token_type:e.actor_token_type}
5),{scope:xt(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}async loginWithCustomTokenExchange(e){return this._requestToken(this._buildTokenExchangeParams(e))}async customTokenExchange(e){const n=await _r(Object.assign(Object.assign({},this._buildTokenExchangeParams(e)),{baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,dpop:this.dpop}),this.worker,!0);return n.id_token&&await this._verifyIdToken(n.id_token,void 0,e.organization),n}async exchangeToken(e){return this.loginWithCustomTokenExchange(e)}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,n){return this._assertDpop(this.dpop),this.dpop.setNonce(e,n)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new Es(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var o;return this.getTokenSilently({authorizationParams:{scope:(o=n?.scope)===null||o===void 0?void 0:o.join(" "),audience:n?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,e.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(e){const n=e.openUrl,o=e.appState,r=e.connection,i=e.scopes,a=e.authorization_params,s=e.redirectUri,c=s===void 0?this.options.authorizationParams.redirect_uri||window.location.origin:s;if(!r)throw new Error("connection is required");const h=Mn(St()),l=St(),d=await wr(l),u=br(d),p=await this.myAccount.connectAccount({connection:r,scopes:i,redirect_uri:c,state:h,code_challenge:u,code_challenge_method:"S256",authorization_params:a}),g=p.connect_uri,y=p.connect_params,w=p.auth_session;this.transactionManager.create({state:h,code_verifier:l,auth_session:w,redirect_uri:c,appState:o,connection:r,response_type:Fe.ConnectCode});const m=new URL(g);m.searchParams.set("ticket",y.ticket),n?await n(m.toString()):window.location.assign(m)}async _requestTokenForPasskey(e){const n=e.audience||this.options.authorizationParams.audience,o=e.organization||this.options.authorizationParams.organization;return this._requestToken(Object.assign(Object.assign(Object.assign({grant_type:"urn:okta:params:oauth:grant-type:webauthn",auth_session:e.authSession,authn_response:e.credential},e.realm&&{realm:e.realm}),o&&{organization:o}),{scope:xt(this.scope,e.scope,n),audience:n}))}async _requestTokenForMfa(e,n){const o=e.mfaToken,r=q(e,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:o}),n)}}function Qc(t){const e={clientId:t.IDENTITY_CLIENT_ID,domain:t.IDENTITY_PROVIDER_URL,authorizationParams:{audience:t.IDENTITY_AUDIENCE,scope:t.IDENTITY_USER_SCOPES},legacySameSiteCookie:!1};return new qc(e)}var Te;(function(t){t.INIT="INIT_AUTHENTICATION",t.TOKEN_RECEIVED="TOKEN_RECEIVED",t.TOKEN_RECEIVED_ERROR="TOKEN_RECEIVED_ERROR",t.PREPARE_LOGOUT="PREPARE_LOGOUT",t.PREPARE_LOGIN_WITH_REDIRECT="PREPARE_LOGIN_WITH_REDIRECT",t.PREPARE_GET_TOKEN_SILENTLY="PREPARE_GET_TOKEN_SILENTLY",t.LEGACY_LOGOUT="LEGACY_LOGOUT",t.LOGOUT_DEFAULT_PREVENTED="LOGOUT_DEFAULT_PREVENTED",t.LOGIN_DEFAULT_PREVENTED="LOGIN_DEFAULT_PREVENTED",t.ACCOUNT_LOGIN="ACCOUNT_LOGIN",t.ACCOUNT_LOGIN_DEFAULT_PREVENTED="ACCOUNT_LOGIN_DEFAULT_PREVENTED",t.UPDATED_USER_STATE="UPDATED_USER_STATE",t.UPDATED_USER_STATE_ERROR="UPDATED_USER_STATE_ERROR",t.UNKNOWN="UNKNOWN"})(Te||(Te={}));function $c(t){he.authenticationState=t}const el="PHN_AUTHENTICATION";function gt(t){$c(t?.eventType??Te.UNKNOWN),window.dispatchEvent(new CustomEvent(el,{detail:t}))}function tl(t){window.dispatchEvent(new CustomEvent("getToken",{detail:{token:t}}))}var Ye;(function(t){t.LOGIN="login",t.LOGOUT="logout"})(Ye||(Ye={}));function nl(t){if(!t)return"";const{firstName:e,lastName:n}=t;return[e,n].filter(ai).join(" ")}async function ol(t){let e=ci,n,o;try{const r=await Ka(t);if(r==null)throw new ht("Invalid user data object extracted from user profile response",dt.NO_RESULTS);go.state.savedSearchesCount=r.savedSearches,go.state.savedVehiclesCount=r.savedVehicles,R.state.unreadMessagesCount=r.unreadMessages;const{userData:i}=r;e=nl(i)||dr,n=r.userData?.userId??"",o=r.userData?.ciamId??"",e&&(Ce.getInstance().setUser(n,o,ur(e)),Ce.getInstance().pushDataLayerEvent(li.IDS_LOAD)),gt({eventType:Te.UPDATED_USER_STATE,state:e})}catch(r){throw(!(r instanceof ht)||r.type!==dt.UNAUTHORIZED)&&(e=dr),R.state.unreadMessagesCount=va,R.state.loggedInState=e,gt({eventType:Te.UPDATED_USER_STATE_ERROR,state:e,error:r}),r}R.state.loggedInState=e,Ce.getInstance().setUser(n,o,ur(e))}function fo(){const t=sessionStorage.getItem("phn-flow")?.replace("navi-","");return t===Ye.LOGIN||t===Ye.LOGOUT?t:null}function ti(){sessionStorage.removeItem("phn-flow")}function rl(){const t="phn-session-transfer-error",e=sessionStorage.getItem(t);e&&(Nt({type:Dt.NAVIGATION_SESSION_TRANSFER_ERROR,options:{sessionTransferError:e}}),sessionStorage.removeItem(t))}async function ni(t){try{gt({eventType:Te.PREPARE_GET_TOKEN_SILENTLY}),rl();const n=await Qc(t).getTokenSilently({authorizationParams:{audience:t.IDENTITY_AUDIENCE,scope:t.IDENTITY_USER_SCOPES}});return tl(n),gt({eventType:Te.TOKEN_RECEIVED,token:n}),fo()===Ye.LOGIN&&(Nt({type:Dt.NAVIGATION_LOGIN_SUCCESS}),ti()),n}catch(e){if(fo()===Ye.LOGIN){Nt({type:Dt.NAVIGATION_LOGIN_ERROR,options:{error:e}});const n="phn-login-redirect-error",o=sessionStorage.getItem(n);o&&(Nt({type:Dt.NAVIGATION_LOGIN_REDIRECT_ERROR,options:{redirectError:o}}),sessionStorage.removeItem(n))}else fo()===Ye.LOGOUT&&Nt({type:Dt.NAVIGATION_LOGOUT_SUCCESS});return ti(),gt({eventType:Te.TOKEN_RECEIVED_ERROR,error:e}),{token:null,error:JSON.stringify(e)}}}class la{constructor(e){this.delay=e,this.timer=null}set(e){this.cancel(),this.timer=setTimeout(()=>{e(),this.cancel()},this.delay)}cancel(){this.timer!==null&&(clearTimeout(this.timer),typeof this.timer.unref=="function"&&this.timer.unref(),this.timer=null)}}function il(){setTimeout(()=>{gt({eventType:Te.INIT,state:ci})}),he.version=ba,Ce.getInstance().pushDataLayerEvent(li.GENERAL_LOAD)}function al(t){ii(t)}function sl(t){try{return new URL(t).hostname==="local.porsche.com"}catch{return!1}}function cl(t){const{env:e}=R.state;if(e!==Ea.PRODUCTION&&typeof window<"u"){const o=new URLSearchParams(window.location.search).get("drawer_version");if(o)return`${t}/${o}`}return sl(t)?t:`${t}/latest`}const ll=()=>{const t=lt(R.state.env),e=cl(t.PHN_DRAWER_CDN_URL);return W(ua,null,W("script",{type:"module",src:`${e}/navigation-drawer.esm.js`}),W("script",{type:"nomodule",src:`${e}/navigation-drawer.js`}))},hl=()=>"@keyframes translate-forward-in-animation{from{translate:0 12px}to{translate:0 0px}}@keyframes fade-in-animation{from{opacity:0;background-color:rgba(0, 0, 0, 0)}to{opacity:1;background-color:rgba(0, 0, 0, 0.6)}}@keyframes translate-in-from-left{from{translate:calc(var(--isLTR, 1) * -1000px)}to{translate:0px}}@keyframes slideDown{from{max-block-size:0}to{max-block-size:1000px}}@keyframes slideUp{from{max-block-size:1000px}to{max-block-size:0}}@keyframes slideLeft{from{max-inline-size:0}to{max-inline-size:1000px}}@keyframes slideRight{from{max-inline-size:1000px}to{max-inline-size:0}}@keyframes darken{from{background-color:rgba(0, 0, 0, 0)}to{background-color:rgba(0, 0, 0, 0.8)}}@keyframes lighten{from{background-color:rgba(0, 0, 0, 0.8)}to{background-color:rgba(0, 0, 0, 0)}}@keyframes fadeInFromBottom{0%{opacity:0;inset-block-start:36px}100%{opacity:1;
5inset-block-start:0px}}@keyframes fadeInFromTop{0%{opacity:0;inset-block-end:36px}100%{opacity:1;inset-block-end:0px}}@keyframes fadeOutToTop{0%{opacity:1;inset-block-end:0px}100%{opacity:0;inset-block-end:16px}}@keyframes slideLeftDoubleDrawer{from{inset-inline-end:-1000px}to{inset-inline-end:0px}}@keyframes slideRightDoubleDrawer{from{inset-inline-end:0px}to{inset-inline-end:-1000px}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{to{opacity:0}}.translate-forward-animation-in{opacity:1}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-in{animation:translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-out,.translate-backward-animation-out{animation:fadeOut 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-backward-animation-in{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.mobile-transition-forward{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}.phn-flex-col{display:flex;flex-direction:column}.phn-flex-row{display:flex;flex-direction:row}.phn-align-center{align-items:center}.phn-justify-around{justify-content:space-around}.phn-justify-between{justify-content:space-between}.phn-flex-wrap{flex-wrap:wrap}.tooltip{position:relative;display:inline-block}.tooltip-text{visibility:hidden;inline-size:inherit;white-space:nowrap;background-color:#404044;border-radius:2px;font-size:13px;color:#fff;text-align:center;padding-block:0px;padding-inline:4px;position:absolute;z-index:100;inset-inline-start:50%;transform:translateX(calc(var(--isLTR, 1) * -50%))}.tooltip:hover .tooltip-text{visibility:visible}.tooltip-text.level0_icon{inset-block-end:-1.7em}.tooltip-text.search_icon{inset-block-end:-1.65em}.tooltip-text.shop_icon{inset-block-end:-1.5em}.tooltip-text.finder_icon{inset-block-end:-1.5em}.tooltip-text.logo{inset-block-end:-1.5em}.tooltip-text.account_icon{inset-block-end:-1.5em}:host{--isLTR:1;display:block;visibility:visible;position:static;z-index:500}:host :dir(rtl){--isLTR:-1}:host .header{min-block-size:4.125rem}@media (min-width: 480px){:host .header{min-block-size:5rem}}@media (min-width: 760px){:host .header{min-block-size:4.5625rem}}@media (min-width: 1000px){:host .header{min-block-size:4.75rem}}@media (min-width: 1300px){:host .header{min-block-size:5.125rem}}@media (min-width: 1920px){:host .limited-width{max-inline-size:160rem;margin-block:0;margin-inline:auto}}",dl=class{constructor(t){Uo(this,t),this.navigationDidLoad=oi(this,"navigationDidLoad",7),this.locale=fa,this.env="",this.clientId="",this.pageName="",this.theme=Wo.light,this.mode=_n.navbar,this.limitedWidth="true",this.app=jo.default,this.initialRoutingPath="",this.displayLogoOnly=!1,this.numberOfShoppingItems=0,this.wishlistItemsNumber=0,this.hasCountrySelector=!1,this.shopInformation='{ "wishlistItemsNumber": 0, "numberOfShoppingItems": 0, "subTotal": "0" }',this.authOptions="{}",this.hideShowOnScroll=!1,this.loadingContent=!1,this.receivedContent=!1,this.breakpoint=he.getBreakpoint(),this.eventPreventedTimeout=new la(0),this.loadedToggles=!1}async localeWatchHandler(){if(R.state.locale=this.locale,this.warnOnUnsupportedLocale(),this.isLocaleUnsupported()){this.receivedContent=!1,this.loadingContent=!1,Ce.getInstance().setLocale(this.locale);return}await this.initNavContentStore(),Ce.getInstance().setLocale(this.locale)}pageNameWatchHandler(){R.state.pageName=this.pageName,Ce.getInstance().setPageName(this.pageName)}async newEnvReceived(){await this.initEnvironment(),!this.isLocaleUnsupported()&&(await this.initNavContentStore(),ni(lt(R.state.env)))}appWatcher(t){R.state.app=Kn(t)}watchShopVariable(t,e,n){const o=JSON.parse(t);hi.set(n,o)}initialRoutingPathWatcher(t){R.state.initialRoutingPath=t}themeWatcher(t){R.state.theme=t}modeWatcher(t){R.state.mode=t}auth0Watcher(t){this.setAuthConfig(JSON.parse(t),lt(R.state.env))}
5resizeHandler(){this.breakpoint=he.getBreakpoint(),Be.state.breakpoint=he.getBreakpoint()}async newAuthMessageReceived(t){if(ai(t.detail?.token))try{await ol(t.detail.token)}catch(e){Le.error("INIT_USER_DATA",e)}}handleUserCentricsInitalization(){try{this.checkMarketingConsent()}catch(t){Le.error("INIT_COOKIE_CONSENT",t)}}navigationLoadedHandler({detail:t}){he.navigationLoaded=t,t&&this.navigationDidLoad.emit()}checkMarketingConsent(){he.maybeCheckMarketingConsent()}async initEnvironment(){R.state.env=ga(this.env),R.state.app=Kn(this.app),R.state.locale=this.locale,R.state.pageName=this.pageName,R.state.initialRoutingPath=this.initialRoutingPath,Ce.getInstance().setEnvironment(R.state.env),R.state.theme=this.theme,R.state.mode=this.mode;const t=lt(R.state.env),e=JSON.parse(this.authOptions),n=JSON.parse(this.shopInformation);if(this.setAuthConfig(e,t),Ra({shopInformation:n}),this.isLocaleUnsupported()){this.loadedToggles=!0;return}ni(t),await di.setFeatures(R.state.env),this.loadedToggles=!0}setAuthConfig(t,e){t.redirectUrl!==void 0&&t.redirectUrl!==""&&(e.IDENTITY_REDIRECT_URI=t.redirectUrl),t.logoutCallback!==void 0&&t.logoutCallback!==""&&(e.IDENTITY_LOGOUT_CALLBACK=t.logoutCallback),R.state.authOptions=t}async initNavContentStore(){const t=this.receivedContent;this.receivedContent=!1,this.loadingContent=!0;try{const e=this.locale,n=R.state.env,o=await Sa(this.app);this.locale===e&&R.state.env===n&&(Object.assign(yt.state,o),this.receivedContent=!0)}catch(e){Le.error("FETCH_CONTENT",e),t&&(this.receivedContent=!0)}this.loadingContent=!1}componentWillLoad(){pa(),da(al),Ce.getInstance().setDefaultProperties(this.locale,this.pageName),window.ncs=yt,this.warnOnUnsupportedLocale(),this.isLocaleUnsupported()?this.initEnvironment():this.initEnvironment().then(async()=>this.initNavContentStore());const t=document.createElement("style");t.textContent=`
6     phn-header + * {
7      isolation: isolate;
8     }`,document.head.appendChild(t)}componentDidLoad(){try{const t=new URLSearchParams(window.location.search);if(t.has("cs_locale")||t.has("cs_referer")){const e=new URL(window.location.href);xa(t.get("cs_locale"),t.get("cs_referer")),e.searchParams.delete("cs_locale"),e.searchParams.delete("cs_referer"),window.history.replaceState({},"",e.toString())}}catch(t){Le.error("TRACK_COUNTRY_SELECTOR_REDIRECT",t)}try{this.checkMarketingConsent()}catch(t){Le.error("INIT_COOKIE_CONSENT",t)}il()}disconnectedCallback(){this.eventPreventedTimeout.cancel()}hasLimitedWidth(){return this.mode===_n.hero&&this.limitedWidth==="true"}isLocaleUnsupported(){return!Ia(this.locale)}shouldDisplayLogoOnly(){return this.displayLogoOnly||this.isLocaleUnsupported()}warnOnUnsupportedLocale(){this.isLocaleUnsupported()&&console.error(`[phn-header] Unsupported locale "${this.locale}". Falling back to a logo-only header. Provide one of the supported locales to render the full navigation.`)}render(){return this.loadedToggles?W(zo,{class:this.mode==="navbar"?"light scheme-light":`${this.theme} scheme-${this.theme}`},W("nav",{class:this.hasLimitedWidth()?"header limited-width":"header"},W(ll,null),W("phn-wrapper",{theme:this.theme,mode:this.mode,locale:this.locale,loadingContent:this.loadingContent,receivedContent:this.receivedContent,breakpoint:this.breakpoint,app:Kn(this.app),displayLogoOnly:this.shouldDisplayLogoOnly(),limitedWidth:this.hasLimitedWidth(),hideShowOnScroll:this.hideShowOnScroll,hasCountrySelector:this.hasCountrySelector}))):W("div",null)}static get assetsDirs(){return["auth"]}static get watchers(){return{locale:[{localeWatchHandler:0}],pageName:[{pageNameWatchHandler:0}],env:[{newEnvReceived:0}],app:[{appWatcher:0}],shopInformation:[{watchShopVariable:0}],initialRoutingPath:[{initialRoutingPathWatcher:0}],theme:[{themeWatcher:0}],mode:[{modeWatcher:0}],authOptions:[{auth0Watcher:0}]}}};dl.style=hl();async function ul(t,e,n=he.getBreakpoint()>=ka.s){if(t===null)return null;const o=Array.isArray(t),r=o?t?.[0]:t,i=async h=>{const l=await he.waitForElement(r,h);return typeof l?.componentOnReady=="function"&&await l.componentOnReady(),l},a=o?t.slice(1).map(i):[await i()],s=new Promise(h=>e.set(()=>h(null)));let c;return Promise.race([Promise.all([...a,n&&new Promise(h=>{c=pl(h),window.addEventListener("finishedAnimation",c)}).finally(()=>window.removeEventListener("finishedAnimation",c))]),s])}function pl(t){return()=>t(null)}async function ha(t){await customElements.whenDefined(t);const e=si(t);return typeof e.componentOnReady=="function"&&await e.componentOnReady(),e}
8async function ml(t){try{await(await ha("phn-nd-navigation-drawer-initiater")).openDrawer(t)}catch(e){Le.error("open-navigation-drawer",e)}}async function fl(){try{await(await ha("phn-nd-navigation-drawer-initiater")).closeDrawer()}catch(t){Le.error("close-navigation-drawer",t)}}function gl(){return!yl()}function yl(){return Be.state.routingKeyPointer===ut.LEVEL_ZERO.valueOf()&&Be.state.animatingPointer===ut.LEVEL_ZERO.valueOf()}function wl(){return Be.state.animatingPointer===ut.LEVEL_ZERO.valueOf()&&Be.state.routingKeyPointer>=0}const vl=1500,bl=()=>`@keyframes translate-forward-in-animation{from{translate:0 12px}to{translate:0 0px}}@keyframes fade-in-animation{from{opacity:0;background-color:rgba(0, 0, 0, 0)}to{opacity:1;background-color:rgba(0, 0, 0, 0.6)}}@keyframes translate-in-from-left{from{translate:calc(var(--isLTR, 1) * -1000px)}to{translate:0px}}@keyframes slideDown{from{max-block-size:0}to{max-block-size:1000px}}@keyframes slideUp{from{max-block-size:1000px}to{max-block-size:0}}@keyframes slideLeft{from{max-inline-size:0}to{max-inline-size:1000px}}@keyframes slideRight{from{max-inline-size:1000px}to{max-inline-size:0}}@keyframes darken{from{background-color:rgba(0, 0, 0, 0)}to{background-color:rgba(0, 0, 0, 0.8)}}@keyframes lighten{from{background-color:rgba(0, 0, 0, 0.8)}to{background-color:rgba(0, 0, 0, 0)}}@keyframes fadeInFromBottom{0%{opacity:0;inset-block-start:36px}100%{opacity:1;
8inset-block-start:0px}}@keyframes fadeInFromTop{0%{opacity:0;inset-block-end:36px}100%{opacity:1;inset-block-end:0px}}@keyframes fadeOutToTop{0%{opacity:1;inset-block-end:0px}100%{opacity:0;inset-block-end:16px}}@keyframes slideLeftDoubleDrawer{from{inset-inline-end:-1000px}to{inset-inline-end:0px}}@keyframes slideRightDoubleDrawer{from{inset-inline-end:0px}to{inset-inline-end:-1000px}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{to{opacity:0}}.translate-forward-animation-in.sc-phn-level-0{opacity:1}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-in.sc-phn-level-0{animation:translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-out.sc-phn-level-0,.translate-backward-animation-out.sc-phn-level-0{animation:fadeOut 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-backward-animation-in.sc-phn-level-0{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.mobile-transition-forward.sc-phn-level-0{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}.phn-flex-col.sc-phn-level-0{display:flex;flex-direction:column}.phn-flex-row.sc-phn-level-0{display:flex;flex-direction:row}.phn-align-center.sc-phn-level-0{align-items:center}.phn-justify-around.sc-phn-level-0{justify-content:space-around}.phn-justify-between.sc-phn-level-0{justify-content:space-between}.phn-flex-wrap.sc-phn-level-0{flex-wrap:wrap}.tooltip.sc-phn-level-0{position:relative;display:inline-block}.tooltip-text.sc-phn-level-0{visibility:hidden;inline-size:inherit;white-space:nowrap;background-color:#404044;border-radius:2px;font-size:13px;color:#fff;text-align:center;padding-block:0px;padding-inline:4px;position:absolute;z-index:100;inset-inline-start:50%;transform:translateX(calc(var(--isLTR, 1) * -50%))}.tooltip.sc-phn-level-0:hover .tooltip-text.sc-phn-level-0{visibility:visible}.tooltip-text.level0_icon.sc-phn-level-0{inset-block-end:-1.7em}.tooltip-text.search_icon.sc-phn-level-0{inset-block-end:-1.65em}.tooltip-text.shop_icon.sc-phn-level-0{inset-block-end:-1.5em}.tooltip-text.finder_icon.sc-phn-level-0{inset-block-end:-1.5em}.tooltip-text.logo.sc-phn-level-0{inset-block-end:-1.5em}.tooltip-text.account_icon.sc-phn-level-0{inset-block-end:-1.5em}.sc-phn-level-0-h{display:block}.hero_light-theme.themed-background.sc-phn-level-0-h{background:linear-gradient(to bottom, rgba(224, 224, 224, 0.9) 0%, rgba(224, 224, 224, 0.9) 20%, rgba(224, 224, 224, 0.852589) 26.67%, rgba(225, 225, 225, 0.768225) 33.33%, rgba(226, 226, 226, 0.668116) 40%, rgba(227, 227, 227, 0.557309) 46.67%, rgba(228, 228, 228, 0.442691) 53.33%, rgba(229, 229, 229, 0.331884) 60%, rgba(230, 230, 230, 0.231775) 66.67%, rgba(231, 231, 231, 0.147411) 73.33%, rgba(232, 232, 232, 0.0816599) 80%, rgba(232, 232, 232, 0.03551) 86.67%, rgba(232, 232, 232, 0.0086472) 93.33%, rgba(232, 232, 232, 0) 100%)}@media (min-width: 0px){.hero_light-theme.themed-background.sc-phn-level-0-h{block-size:72px}}@media (min-width: 760px){.hero_light-theme.themed-background.sc-phn-level-0-h{block-size:148px}}.hero_light-theme.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{color:black}.hero_dark-theme.themed-background.sc-phn-level-0-h{background:linear-gradient(to bottom, hsla(0, 0%, 0%, 0.8) 0%, hsla(0, 0%, 0%, 0.8) 8.1%, hsla(0, 0%, 0%, 0.8) 15.5%, hsla(0, 0%, 0%, 0.8) 22.5%, hsla(0, 0%, 0%, 0.78) 29%, hsla(0, 0%, 0%, 0.73) 35.3%, hsla(0, 0%, 0%, 0.67) 41.2%, hsla(0, 0%, 0%, 0.6) 47.1%, hsla(0, 0%, 0%, 0.52) 52.9%, hsla(0, 0%, 0%, 0.44) 58.8%, hsla(0, 0%, 0%, 0.33) 64.7%, hsla(0, 0%, 0%, 0.22) 71%, hsla(0, 0%, 0%, 0.12) 77.5%, hsla(0, 0%, 0%, 0.05) 84.5%, hsla(0, 0%, 0%, 0.011) 91.9%, hsla(0, 0%, 0%, 0) 100%)}@media (min-width: 0px){.hero_dark-theme.themed-background.sc-phn-level-0-h{block-size:72px}}@media (min-width: 760px){.hero_dark-theme.themed-background.sc-phn-level-0-h{block-size:148px}}.hero_dark-theme.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{color:white}.navbar-theme.themed-background.sc-phn-level-0-h{background:white;border-block-end:1px solid #e3e4e5}.navbar-theme.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{color:black}.transparent_dark-theme.themed-background.sc-phn-level-0-h{background:transparent}.transparent_dark-theme.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{color:white}.transparent_light-theme.themed-background.sc-phn-level-0-h{background:transparent}.transparent_light-theme.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{color:white}.sc-phn-level-0-h{--phn-header-height:4.125rem}@media (min-width: 480px){.sc-phn-level-0-h{--phn-header-height:5rem}}@media (min-width: 760px){.sc-phn-level-0-h{--phn-header-height:4.5625rem}}@media (min-width: 1000px){.sc-phn-level-0-h{--phn-header-height:4.75rem}}@media (min-width: 1300px){.sc-phn-level-0-h{--phn-header-height:5.125rem}}.hero_light-theme.sc-phn-level-0-h,.hero_dark-theme.sc-phn-level-0-h{--phn-header-height:4.5rem}@media (min-width: 760px){.hero_light-theme.sc-phn-level-0-h,.hero_dark-theme.sc-phn-level-0-h{--phn-header-height:9.25rem}}@media (min-width: 1920px){.sc-phn-level-0-h header.limited-width.sc-phn-level-0{padding-block:0 calc(50vw - 2560px);padding-inline:calc(50vw - 2560px)}}.hide-show-on-scroll.sc-phn-level-0-h{position:fixed;inline-size:100%;transform:translateY(var(--country-correction, 0%));transition:transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);will-change:transform}.hide-show-on-scroll.hide.sc-phn-level-0-h{transform:translateY(-100%)}.hide-show-on-scroll.hide.sc-phn-level-0-h phn-country-redirect-modal.sc-phn-level-0{inset-block-start:calc(clamp(8px, 0.5vw + 6px, 16px) + var(--phn-header-height)) !important}.hide-show-on-scroll.navi-opened.sc-phn-level-0-h{inset-block-start:var(--country-height, 0px)}.hide-show-on-scroll.initial-country-load.sc-phn-level-0-h{inset-block-start:0}.sc-phn-level-0-h header.sc-phn-level-0{margin:0 var(--pds-internal-gr
8id-margin, 0);display:grid;padding:0 calc(50% - var(--pds-internal-grid-margin, 0px) - 1280px);grid-gap:clamp(16px, 1.25vw + 12px, 36px);max-width:var(--pds-internal-grid-width-max, 2560px);min-width:var(--pds-internal-grid-width-min, 320px);box-sizing:content-box;grid-template-columns:[full-start] minmax(0, var(--pds-internal-grid-outer-column, calc(var(--pds-internal-grid-safe-zone) - clamp(16px, 1.25vw + 12px, 36px)))) [wide-start extended-start basic-start narrow-start] repeat(6, minmax(0, 1fr)) [narrow-end basic-end extended-end wide-end] minmax(0, var(--pds-internal-grid-outer-column, calc(var(--pds-internal-grid-safe-zone) - clamp(16px, 1.25vw + 12px, 36px)))) [full-end];--pds-internal-grid-safe-zone:max(22px, 10.625vw - 12px);--pds-grid-basic-span-one-half:span 3;--pds-grid-basic-span-one-third:span 2;--pds-grid-narrow-span-one-half:span 3;--pds-grid-basic-span-two-thirds:span 4;--pds-grid-extended-span-one-half:span 3}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0{grid-template-columns:[full-start] minmax(0, var(--pds-internal-grid-outer-column, calc(var(--pds-internal-grid-safe-zone) - clamp(16px, 1.25vw + 12px, 36px)))) [wide-start] minmax(0, 1fr) [extended-start] minmax(0, 1fr) [basic-start] repeat(2, minmax(0, 1fr)) [narrow-start] repeat(8, minmax(0, 1fr)) [narrow-end] repeat(2, minmax(0, 1fr)) [basic-end] minmax(0, 1fr) [extended-end] minmax(0, 1fr) [wide-end] minmax(0, var(--pds-internal-grid-outer-column, calc(var(--pds-internal-grid-safe-zone) - clamp(16px, 1.25vw + 12px, 36px)))) [full-end];--pds-internal-grid-safe-zone:calc(5vw - 16px);--pds-grid-basic-span-one-half:span 6;--pds-grid-basic-span-one-third:span 4;--pds-grid-narrow-span-one-half:span 4;--pds-grid-basic-span-two-thirds:span 8;--pds-grid-extended-span-one-half:span 7}}@media (min-width: 1920px){.sc-phn-level-0-h header.sc-phn-level-0{--pds-internal-grid-safe-zone:min(50vw - 880px, 400px)}}.sc-phn-level-0-h header.sc-phn-level-0{font-family:"Porsche Next", "Arial Narrow", Arial, "Heiti SC", SimHei, sans-serif;font-weight:400;color:var(--_color-canvas, light-dark(#fff, hsl(225, 66.7%, 1.2%)));block-size:4.125rem}@media (min-width: 480px){.sc-phn-level-0-h header.sc-phn-level-0{block-size:5rem}}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0{block-size:4.5625rem}}@media (min-width: 1000px){.sc-phn-level-0-h header.sc-phn-level-0{block-size:4.75rem}}@media (min-width: 1300px){.sc-phn-level-0-h header.sc-phn-level-0{block-size:5.125rem;flex-direction:row}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0{block-size:100%;display:flex;justify-content:center;align-items:center;position:relative;grid-column:wide-start/wide-end}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .level-0-content-logo.sc-phn-level-0{display:flex;align-items:center}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .level-0-content-icons.sc-phn-level-0{position:absolute;inline-size:100%}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 phn-burger-button.sc-phn-level-0,.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 phn-level-0-icons.sc-phn-level-0,.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 phn-logo.sc-phn-level-0,.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .skeleton-container.sc-phn-level-0{flex:1;display:flex}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .skeleton-container.crest-skeleton.sc-phn-level-0{justify-content:center}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 phn-logo.sc-phn-level-0{justify-content:center;z-index:1;transform:translate3d(0, 0, 0)}@media (min-width: 1300px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 phn-logo.sc-phn-level-0{z-index:1}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone.sc-phn-level-0{inline-size:7.75rem;block-size:1.5rem;border-radius:0.25rem}@keyframes skeleton{from{background-position-x:100%}to{background-position-x:-100%}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone.sc-phn-level-0{display:block;border-radius:4px;background:transparent linear-gradient(to right, var(--_color-frosted, light-dark(hsla(240, 5%, 70%, 0.148), hsla(240, 2%, 43%, 0.228))) 0%, var(--_color-frosted-strong, light-dark(hsla(236, 6.5%, 42%, 0.236), hsla(240, 1.5%, 61.8%, 0.302))) 50%, var(--_color-frosted, light-dark(hsla(240, 5%, 70%, 0.148), hsla(240, 2%, 43%, 0.228))) 100%) 0 0/200% 100%;animation:skeleton 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;color-scheme:light}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone.sc-phn-level-0{inline-size:18rem}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone-dark.sc-phn-level-0{inline-size:7.75rem;block-size:1.5rem;border-radius:0.25rem}@keyframes skeleton{from{background-position-x:100%}to{background-position-x:-100%}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone-dark.sc-phn-level-0{display:block;border-radius:4px;background:transparent linear-gradient(to right, var(--_color-frosted, light-dark(hsla(240, 5%, 70%, 0.148), hsla(240, 2%, 43%, 0.228))) 0%, var(--_color-frosted-strong, light-dark(hsla(236, 6.5%, 42%, 0.236), hsla(240, 1.5%, 61.8%, 0.302))) 50%, var(--_color-frosted, light-dark(hsla(240, 5%, 70%, 0.148), hsla(240, 2%, 43%, 0.228))) 100%) 0 0/200% 100%;animation:skeleton 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;color-scheme:dark}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .label-bone-dark.sc-phn-level-0{inline-size:18rem}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone.sc-phn-level-0{inline-size:1.403125rem;block-size:1.8125rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='22.45px' height='29px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23eeeff2' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195
8513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center}@media (min-width: 480px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone.sc-phn-level-0{inline-size:1.6875rem;block-size:2.25rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='27px' height='36px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23eeeff2' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone.sc-phn-level-0{inline-size:1.75rem;block-size:2.25rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='28px' height='36px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23eeeff2' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195
8513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 1000px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone.sc-phn-level-0{inline-size:1.9375rem;block-size:2.5625rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='31px' height='41px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23eeeff2' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 1300px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone.sc-phn-level-0{inline-size:2rem;block-size:2.6875rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='32px' height='43px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23eeeff2' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195
8513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone-dark.sc-phn-level-0{inline-size:1.403125rem;block-size:1.8125rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='22.45px' height='29px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23212225' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center}@media (min-width: 480px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone-dark.sc-phn-level-0{inline-size:1.6875rem;block-size:2.25rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='27px' height='36px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23212225' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195
8513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 760px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone-dark.sc-phn-level-0{inline-size:1.75rem;block-size:2.25rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='28px' height='36px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23212225' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 1000px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone-dark.sc-phn-level-0{inline-size:1.9375rem;block-size:2.5625rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='31px' height='41px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23212225' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195
8513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}@media (min-width: 1300px){.sc-phn-level-0-h header.sc-phn-level-0 .level-0-content.sc-phn-level-0 .crest-bone-dark.sc-phn-level-0{inline-size:2rem;block-size:2.6875rem;background-image:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='32px' height='43px' viewBox='0 0 29 37' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Ecrest-path-pixel-perfect-3%3C/title%3E%3Cg id='Design-Focus' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='832-skeleton-hn-1366' transform='translate(-130.000000, -39.000000)' fill='%23212225' fill-rule='nonzero'%3E%3Cg id='Crest-bones' transform='translate(78.000000, 0.000000)'%3E%3Cpath d='M80.8612951,41.6891698 C79.3593022,41.0929534 77.8195513,40.5958533 76.2520235,40.2010916 C74.092052,39.6781633 71.8946453,39.3227949 69.6795438,39.1381787 C68.6125828,39.0425165 67.6096394,39.0106291 66.4786608,39 L66.4679912,39 C65.4010302,39 64.3340692,39 63.2671082,39.1381787 C61.0520067,39.3227949 58.8545999,39.6781633 56.6946284,40.2010916 C55.1285058,40.5930516 53.5918758,41.093847 52.0960265,41.6997989 L52,41.6997989 C52,41.6997989 52.1813834,52.8710141 52.3200883,58.3981614 C52.3624958,60.0288438 52.6613178,61.6428163 53.2056659,63.1812698 C53.83596,64.927843 54.6779771,66.5912102 55.7130243,68.1344441 C56.7974563,69.7321996 58.1093136,71.164397 59.6074319,72.3860959 C60.1877267,72.8817079 60.8047619,73.3329574 61.4532745,73.7359954 C62.4748439,74.3534515 63.5453697,74.8866836 64.6541575,75.3303648 C65.0062546,75.4791727 65.3263429,75.6279805 65.6144224,75.7236426 C65.9077386,75.8428333 66.2112826,75.9353298 66.5213392,76 C66.8313958,75.9353298 67.1349399,75.8428333 67.4282561,75.7236426 C67.7163355,75.6279805 68.0364238,75.4791727 68.3991906,75.3303648 C69.4899033,74.8845355 70.542531,74.3513317 71.5467255,73.7359954 C72.1928274,73.3294237 72.8096114,72.8783579 73.3925681,72.3860959 C74.8933275,71.167176 76.2055628,69.7345659 77.2869757,68.1344441 C78.3220229,66.5912102 79.16404,64.927843 79.7943341,63.1812698 C80.3386822,61.6428163 80.6375042,60.0288438 80.6799117,58.3981614 C80.8186166,52.8710141 81,41.6997989 81,41.6997989 L80.8612951,41.6891698 Z' id='crest-path-pixel-perfect-3'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}}.sc-phn-level-0-h header.sc-phn-level-0 phn-crest.sc-phn-level-0{z-index:1;transform:translate3d(0, 0, 0)}@media (min-width: 1300px){.sc-phn-level-0-h header.sc-phn-level-0 phn-crest.sc-phn-level-0{z-index:1}}.sc-phn-level-0-h header.sc-phn-level-0 .burger-button.sc-phn-level-0:focus{outline-width:2px;outline-style:solid;outline-offset:1px;outline-color:var(--_color-focus, light-dark(#1a44ea, #1a44ea))}.sc-phn-level-0-h .main-content.sc-phn-level-0{inline-size:1.25rem}.sc-phn-level-0-h .main-content.sc-phn-level-0:focus{outline-style:none}.sc-phn-level-0-h .sr-only.sc-phn-level-0{position:absolute;inline-size:0.0625rem;block-size:0.0625rem;white-space:nowrap;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%)}.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{inline-size:1.5rem}@media (min-width: 760px){.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{inline-size:1.5rem}}@media (min-width: 1000px){.sc-phn-level-0-h phn-p-icon.sc-phn-level-0{inline-size:1.5rem}}
8.sc-phn-level-0-h:not(:has(.contextual-icons)) phn-level-0-icons.sc-phn-level-0{place-content:center}`,kl=class{constructor(t){Uo(this,t),this.navigationLoaded=oi(this,"navigationLoaded",7),this.loadingContent=!1,this.receivedContent=!1,this.theme=Wo.light,this.mode=_n.navbar,this.app=jo.default,this.displayLogoOnly=!1,this.limitedWidth=!1,this.hasCountrySelector=!1,this.usingKeyboard=!1,this.scrolledPastHeader=!1,this.isNavigationLoaded=!1,this.isLoading=!1,this.isAccountHoveredOn=!1,this.eventController=new AbortController,this.drawerTimeout=new la(vl)}getCountryHeight(){this.setCountryHeightCorrection(!1)}hideShowOnScrollWatcher(t){this.connectedCallback(),t||this.eventController.abort()}loadingContentWatcher(){this.setNavigationLoaded()}breakpointWatcher(){this.updateRoutingKeyPointerOfMobileLevel1(),this.setNavigationLoaded()}receivedContentWatcher(){this.setNavigationLoaded()}showCountryRecommenderWatcher(t){t?this.setCountryHeightCorrection():(this.el.style.removeProperty("--country-correction"),this.el.style.removeProperty("--country-height"))}setCountryHeightCorrection(t=!0){const e=si("phn-country-recommender");e?(t?Promise.all(e.getAnimations().map(n=>n.finished)):Promise.resolve()).then(()=>{this.recommenderHeight=e.offsetHeight,this.el.style.setProperty("--country-height",`${this.recommenderHeight}px`)}):setTimeout(()=>this.setCountryHeightCorrection(),50)}scrollHandler(){this.scrolledPastHeader=this.el.getBoundingClientRect().bottom<=0}handleKeyDown(t){t.key==="Escape"&&(this.usingKeyboard=!0,R.state.usingKeyboard=!0,fl())}handleClick(t){this.usingKeyboard=lr(t),R.state.usingKeyboard=lr(t)}async handleOpenDrawer(t){await this.openDrawer(t.detail)}componentWillLoad(){this.setNavigationLoaded()}updateRoutingKeyPointerOfMobileLevel1(){Be.state.routingKeyPointer===ut.LEVEL_ONE.valueOf()&&(Be.state.routingKeyPointer=hr(this.breakpoint)?ut.LEVEL_TWO:ut.LEVEL_ONE)}setNavigationLoaded(){this.isNavigationLoaded=!this.loadingContent,this.navigationLoaded.emit(this.isNavigationLoaded)}async openDrawer(t){const{initialRoutingKey:e,isKeyboardClick:n}=t;this.isLoading=!0,this.usingKeyboard=n,R.state.usingKeyboard=n;const o="phn-nd-backdrop",r=e===""?R.state.initialRoutingPath:e;this.openMenuDrawer(r??"");try{await ul([this.el,".drawer",o],this.drawerTimeout)}finally{this.isLoading=!1}}openMenuDrawer(t){ml(t)}connectedCallback(){this.hideShowOnScroll&&setTimeout(()=>{try{let o=function(){e||(requestAnimationFrame(n),e=!0)},r=function(){const i=window.scrollY;if(this.isLoading){this.el.classList.add("navi-opened"),e=!1;return}this.el.classList.remove("navi-opened"),Math.abs(i-t)>3&&(i>t?(this.el.classList.add("hide"),this.el.dataset.pinned="false",this.el.dispatchEvent(new CustomEvent("headerPinned",{composed:!0,detail:!1})),this.el.classList.contains("initial-country-load")&&this.el.addEventListener("transitionend",()=>this.el.classList.remove("initial-country-load"),{once:!0})):(this.el.classList.remove("hide"),this.el.dataset.pinned="true",this.el.dispatchEvent(new CustomEvent("headerPinned",{composed:!0,detail:!0})))),this.showCountryRecommender&&this.el.style.setProperty("--country-correction",`-${Math.min(this.recommenderHeight??0,i)}px`),t=i,e=!1},t=window.scrollY,e=!1;const n=r.bind(this);this.initialShowCountryRecommender&&(t!==0&&this.el.classList.add("initial-country-load"),this.setCountryHeightCorrection()),window.addEventListener("scroll",o,{passive:!0,signal:this.eventController.signal})}catch{}},1e3)}disconnectedCallback(){this.drawerTimeout.cancel(),this.eventController.abort()}getLogoSize(){return this.breakpoint>=Pa.m?"medium":"small"}getLogo(){const{shop:t,level0:e,crest:n}=yt.state;return W("div",{class:"level-0-content-logo tooltip"},W("phn-logo",{app:this.app,theme:this.theme,mode:this.mode,size:this.getLogoSize(),breakpoint:this.breakpoint}),n&&hr(this.breakpoint)?W("span",{class:"tooltip-text logo"},Aa(this.locale,this.app,t,e)):null)}render(){const{countryRedirectModal:t}=yt.state,e=di.isCountryRedirectModalEnabled()&&t!==null&&R.state.pageName==="home";return W(zo,{key:"34b0e1b5ded05d39c309559ac0c46e3bbb823bd0",class:`${ma(this.mode,this.theme)}-theme themed-background ${this.hideShowOnScroll?"hide-show-on-scroll":"default"}`},W("header",{key:"aeb645ba6bae19608c2ecd61aa4af45131715a76",class:this.limitedWidth?"limited-width":""},gl()||wl()?W("phn-backdrop",{style:this.isLoading?{display:"none"}:{}}):null,W("div",{key:"6b9cff6669ddc7acf9d0193cf986efb00ab3f15f",class:"level-0-content"},this.displayLogoOnly?this.getLogo():W("div",{class:"level-0-content-icons"},W("phn-level-0-icons",{hasCountrySelector:this.hasCountrySelector,breakpoint:this.breakpoint,isLoading:this.isLoading,isNavigationLoaded:this.isNavigationLoaded},this.getLogo())),e?W("phn-country-redirect-modal",{content:t}):null)))}get el(){return ri(this)}static get watchers(){return{hideShowOnScroll:[{hideShowOnScrollWatcher:0}],loadingContent:[{loadingContentWatcher:0}],breakpoint:[{breakpointWatcher:0}],receivedContent:[{receivedContentWatcher:0}],showCountryRecommender:[{showCountryRecommenderWatcher:0}]}}};
8kl.style=bl();const _l=()=>{const t={navContent:{...yt.state},navStateContent:{...R.state},shopStoreContent:{...hi.state},finderStoreContent:{...go.state},featureToggleStateStore:{...yn.state}};return W("phn-nd-navigation-drawer-initiater",{...t})},Cl=()=>"@keyframes translate-forward-in-animation{from{translate:0 12px}to{translate:0 0px}}@keyframes fade-in-animation{from{opacity:0;background-color:rgba(0, 0, 0, 0)}to{opacity:1;background-color:rgba(0, 0, 0, 0.6)}}@keyframes translate-in-from-left{from{translate:calc(var(--isLTR, 1) * -1000px)}to{translate:0px}}@keyframes slideDown{from{max-block-size:0}to{max-block-size:1000px}}@keyframes slideUp{from{max-block-size:1000px}to{max-block-size:0}}@keyframes slideLeft{from{max-inline-size:0}to{max-inline-size:1000px}}@keyframes slideRight{from{max-inline-size:1000px}to{max-inline-size:0}}@keyframes darken{from{background-color:rgba(0, 0, 0, 0)}to{background-color:rgba(0, 0, 0, 0.8)}}@keyframes lighten{from{background-color:rgba(0, 0, 0, 0.8)}to{background-color:rgba(0, 0, 0, 0)}}@keyframes fadeInFromBottom{0%{opacity:0;inset-block-start:36px}100%{opacity:1;
8inset-block-start:0px}}@keyframes fadeInFromTop{0%{opacity:0;inset-block-end:36px}100%{opacity:1;inset-block-end:0px}}@keyframes fadeOutToTop{0%{opacity:1;inset-block-end:0px}100%{opacity:0;inset-block-end:16px}}@keyframes slideLeftDoubleDrawer{from{inset-inline-end:-1000px}to{inset-inline-end:0px}}@keyframes slideRightDoubleDrawer{from{inset-inline-end:0px}to{inset-inline-end:-1000px}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{to{opacity:0}}.translate-forward-animation-in.sc-phn-wrapper{opacity:1}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-in.sc-phn-wrapper{animation:translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-forward-animation-out.sc-phn-wrapper,.translate-backward-animation-out.sc-phn-wrapper{animation:fadeOut 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.translate-backward-animation-in.sc-phn-wrapper{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}@media (prefers-reduced-motion: no-preference){.mobile-transition-forward.sc-phn-wrapper{animation:fadeIn 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), translate-forward-in-animation 0.25s cubic-bezier(0.25, 0.1, 0.25, 1)}}.phn-flex-col.sc-phn-wrapper{display:flex;flex-direction:column}.phn-flex-row.sc-phn-wrapper{display:flex;flex-direction:row}.phn-align-center.sc-phn-wrapper{align-items:center}.phn-justify-around.sc-phn-wrapper{justify-content:space-around}.phn-justify-between.sc-phn-wrapper{justify-content:space-between}.phn-flex-wrap.sc-phn-wrapper{flex-wrap:wrap}.tooltip.sc-phn-wrapper{position:relative;display:inline-block}.tooltip-text.sc-phn-wrapper{visibility:hidden;inline-size:inherit;white-space:nowrap;background-color:#404044;border-radius:2px;font-size:13px;color:#fff;text-align:center;padding-block:0px;padding-inline:4px;position:absolute;z-index:100;inset-inline-start:50%;transform:translateX(calc(var(--isLTR, 1) * -50%))}.tooltip.sc-phn-wrapper:hover .tooltip-text.sc-phn-wrapper{visibility:visible}.tooltip-text.level0_icon.sc-phn-wrapper{inset-block-end:-1.7em}.tooltip-text.search_icon.sc-phn-wrapper{inset-block-end:-1.65em}.tooltip-text.shop_icon.sc-phn-wrapper{inset-block-end:-1.5em}.tooltip-text.finder_icon.sc-phn-wrapper{inset-block-end:-1.5em}.tooltip-text.logo.sc-phn-wrapper{inset-block-end:-1.5em}.tooltip-text.account_icon.sc-phn-wrapper{inset-block-end:-1.5em}.sc-phn-wrapper-h{display:block}.sc-phn-wrapper-h .limit-stretch.sc-phn-wrapper{box-sizing:content-box;margin-block:0;margin-inline:0.5vw}.sc-phn-wrapper-h .main-content.sc-phn-wrapper{inline-size:20px}.sc-phn-wrapper-h .main-content.sc-phn-wrapper:focus{outline-style:none}.sc-phn-wrapper-h .screenreader-only.sc-phn-wrapper{position:absolute;inline-size:1px;block-size:1px;white-space:nowrap;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%)}.sc-phn-wrapper-h:has(phn-country-recommender) .hide-show-on-scroll.hide.sc-phn-wrapper{transform:translateY(calc(-100% - var(--country-height, 0px)))}.sc-phn-wrapper-h phn-nd-navigation-drawer-initiater.sc-phn-wrapper{color-scheme:light}",El=class{constructor(t){Uo(this,t),this.loadingContent=!1,this.receivedContent=!1,this.theme=Wo.light,this.mode=_n.navbar,this.app=jo.default,this.displayLogoOnly=!1,this.limitedWidth=!1,this.hasCountrySelector=!1,this.showCountryRecommender=he.redirected,this.countryRecommenderClosed=!1,this.handleContentBlur=e=>{const n=ya(e.currentTarget);n!==null&&n.removeAttribute("tabIndex")}}componentWillLoad(){this.el.style.setProperty("--scrollbar-width",he.getScrollbarWidth()),wa(this.el)}render(){const{countryRecommender:t}=yt.state,e=this.showCountryRecommender&&!this.countryRecommenderClosed&&this.receivedContent;return W(zo,{key:"aa82106e190c4336cd93828d8a3369c21f56a02a"},e?W("phn-country-recommender",{locale:this.locale,content:t,role:"region","aria-label":"Change recommended Region or Language",onBannerClosed:()=>{this.countryRecommenderClosed=!0}}):null,W("phn-level-0",{key:"2675a682b8d8da84afb4d7635544d7ca08aff4e6",theme:this.theme,mode:this.mode,locale:this.locale,loadingContent:this.loadingContent,receivedContent:this.receivedContent,breakpoint:this.breakpoint,app:this.app,displayLogoOnly:this.displayLogoOnly,limitedWidth:this.limitedWidth,hideShowOnScroll:this.hideShowOnScroll,hasCountrySelector:this.hasCountrySelector,initialShowCountryRecommender:this.showCountryRecommender,showCountryRecommender:e}),this.displayLogoOnly?null:W(_l,null),W("div",{key:"b104b9e8f2457acb7176d1534caafa3edbc9f2be",id:"main",class:"main-content",onBlur:this.handleContentBlur}))}get el(){return ri(this)}};El.style=Cl();export{dl as phn_header,kl as phn_level_0,El as phn_wrapper};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.