https://www.ewtn.com/_next/static/chunks/13-e8d5747f6a96eb6b.js?dpl=dpl_7C5yDYvifvbANpE3vAxDVs1qnh1d
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13],{1605:e=>{"use strict";e.exports=Function.prototype.call},1818:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return i}});class r{constructor(e,t,r){this.prev=null,this.next=null,this.key=e,this.data=t,this.size=r}}class n{constructor(){this.prev=null,this.next=null}}class i{constructor(e,t){this.cache=new Map,this.totalSize=0,this.maxSize=e,this.calculateSize=t,this.head=new n,this.tail=new n,this.head.next=this.tail,this.tail.prev=this.head}addToHead(e){e.prev=this.head,e.next=this.head.next,this.head.next.prev=e,this.head.next=e}removeNode(e){e.prev.next=e.next,e.next.prev=e.prev}moveToHead(e){this.removeNode(e),this.addToHead(e)}removeTail(){let e=this.tail.prev;return this.removeNode(e),e}set(e,t){let n=(null==this.calculateSize?void 0:this.calculateSize.call(this,t))??1;if(n>this.maxSize)return void console.warn("Single item size exceeds maxSize");let i=this.cache.get(e);if(i)i.data=t,this.totalSize=this.totalSize-i.size+n,i.size=n,this.moveToHead(i);else{let i=new r(e,t,n);this.cache.set(e,i),this.addToHead(i),this.totalSize+=n}for(;this.totalSize>this.maxSize&&this.cache.size>0;){let e=this.removeTail();this.cache.delete(e.key),this.totalSize-=e.size}}has(e){return this.cache.has(e)}get(e){let t=this.cache.get(e);if(t)return this.moveToHead(t),t.data}*[Symbol.iterator](){let e=this.head.next;for(;e&&e!==this.tail;){let t=e;yield[t.key,t.data],e=e.next}}remove(e){let t=this.cache.get(e);t&&(this.removeNode(t),this.cache.delete(e),this.totalSize-=t.size)}get size(){return this.cache.size}get currentSize(){return this.totalSize}}},1986:(e,t,r)=>{"use strict";var n,i=r(24991),o=r(45779);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&o&&o(Object.prototype,"__proto__"),s=Object,c=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?i([a.get]):"function"==typeof c&&function(e){return c(null==e?e:s(e))}},4378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return o}});let n=r(81790),i=r(85671);function o(e,t,r,o){if(!t||t===r)return e;let a=e.toLowerCase();return!o&&((0,i.pathHasPrefix)(a,"/api")||(0,i.pathHasPrefix)(a,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},5305:(e,t,r)=>{"use strict";var n=r(89908),i=r(60243),o=r(1605);e.exports=r(78918)||n.call(o,i)},5580:e=>{"use strict";e.exports=Error},6518:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(89908).call(n,i)},6879:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"afterTaskAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(28743).createAsyncLocalStorage)()},11868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{HeadersAdapter:function(){return o},ReadonlyHeadersError:function(){return i}});let n=r(40991);class i extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new i}}class o extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,i){if("symbol"==typeof r)return n.ReflectAdapter.get(t,r,i);let o=r.toLowerCase(),a=Object.keys(e).find(e=>e.toLowerCase()===o);if(void 0!==a)return n.ReflectAdapter.get(t,a,i)},set(t,r,i,o){if("symbol"==typeof r)return n.ReflectAdapter.set(t,r,i,o);let a=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===a);return n.ReflectAdapter.set(t,s??r,i,o)},has(t,r){if("symbol"==typeof r)return n.ReflectAdapter.has(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0!==o&&n.ReflectAdapter.has(t,o)},deleteProperty(t,r){if("symbol"==typeof r)return n.ReflectAdapter.deleteProperty(t,r);let i=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===i);return void 0===o||n.ReflectAdapter.deleteProperty(t,o)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return i.callable;default:return n.ReflectAdapter.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new o(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];
1return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}},12072:(e,t)=>{"use strict";function r(e,t,r){if(e)for(let o of(r&&(r=r.toLowerCase()),e)){var n,i;if(t===(null==(n=o.domain)?void 0:n.split(":",1)[0].toLowerCase())||r===o.defaultLocale.toLowerCase()||(null==(i=o.locales)?void 0:i.some(e=>e.toLowerCase()===r)))return o}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return r}})},12696:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(var i in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==n||!0!==a.enumerable)return!1}return!0}},13024:e=>{"use strict";e.exports=Math.round},13758:(e,t,r)=>{"use strict";var n=r(63908).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=f,this.end=y,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=m,this.end=g,t=3;break;default:this.write=b,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function h(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function m(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function w(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=p,s.prototype.text=h,s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},14219:(e,t,r)=>{"use strict";var n;n={value:!0},n={enumerable:!0,get:function(){return d}};let i=r(46713),o=r(91604),a=r(34569),s=r(36224),c=r(69029),u=r(50635),l=r(3969);function d(){let e="draftMode",t=o.workAsyncStorage.getStore(),r=i.workUnitAsyncStorage.getStore();switch((!t||!r)&&(0,i.throwForMissingRequestStore)(e),r.type){case"prerender-runtime":return(0,a.delayUntilRuntimeStage)(r,h(r.draftMode,t));case"request":return h(r.draftMode,t);case"cache":case"private-cache":case"unstable-cache":let n=(0,i.getDraftModeProviderForCacheScope)(t,r);if(n)return h(n,t);case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return h(null,t);default:return r}}function h(e,t){let r,n=null!=e?e:p,i=f.get(n);
1return i||(r=y(e),f.set(n,r),r)}r(40991);let p={},f=new WeakMap;function y(e){let t=new m(e),r=Promise.resolve(t);return Object.defineProperty(r,"isEnabled",{get:()=>t.isEnabled,enumerable:!0,configurable:!0}),r.enable=t.enable.bind(t),r.disable=t.disable.bind(t),r}class m{get isEnabled(){return null!==this._provider&&this._provider.isEnabled}enable(){b("draftMode().enable()",this.enable),null!==this._provider&&this._provider.enable()}disable(){b("draftMode().disable()",this.disable),null!==this._provider&&this._provider.disable()}constructor(e){this._provider=e}}function g(e,t){let r=e?'Route "'.concat(e,'" '):"This route ";return Object.defineProperty(Error("".concat(r,"used ").concat(t,". ")+"`draftMode()` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis"),"__NEXT_ERROR_CODE",{value:"E377",enumerable:!1,configurable:!0})}function b(e,t){let r=o.workAsyncStorage.getStore(),n=i.workUnitAsyncStorage.getStore();if(r){if((null==n?void 0:n.phase)==="after")throw Object.defineProperty(Error("Route ".concat(r.route,' used "').concat(e,'" inside `after`. The enabled status of draftMode can be read inside `after` but you cannot enable or disable draftMode. See more info here: https://nextjs.org/docs/app/api-reference/functions/after')),"__NEXT_ERROR_CODE",{value:"E348",enumerable:!1,configurable:!0});if(r.dynamicShouldError)throw Object.defineProperty(new c.StaticGenBailoutError("Route ".concat(r.route,' with `dynamic = "error"` couldn\'t be rendered statically because it used `').concat(e,"`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering")),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(n)switch(n.type){case"cache":case"private-cache":{var s,d;let n=Object.defineProperty(Error("Route ".concat(r.route,' used "').concat(e,'" inside "use cache". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E246",enumerable:!1,configurable:!0});throw Error.captureStackTrace(n,t),null!=(d=(s=r).invalidDynamicUsageError)||(s.invalidDynamicUsageError=n),n}case"unstable-cache":throw Object.defineProperty(Error("Route ".concat(r.route,' used "').concat(e,'" inside a function cached with "unstable_cache(...)". The enabled status of draftMode can be read in caches but you must not enable or disable draftMode inside a cache. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache')),"__NEXT_ERROR_CODE",{value:"E259",enumerable:!1,configurable:!0});case"prerender":case"prerender-runtime":{let t=Object.defineProperty(Error("Route ".concat(r.route," used ").concat(e," without first calling `await connection()`. See more info here: https://nextjs.org/docs/messages/next-prerender-sync-headers")),"__NEXT_ERROR_CODE",{value:"E126",enumerable:!1,configurable:!0});return(0,a.abortAndThrowOnSynchronousRequestDataAccess)(r.route,e,t,n)}case"prerender-client":let i="`draftMode`";throw Object.defineProperty(new l.InvariantError("".concat(i," must not be used within a client component. Next.js should be preventing ").concat(i," from being included in client components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,a.postponeWithTracking)(r.route,e,n.dynamicTracking);case"prerender-legacy":n.revalidate=0;let o=Object.defineProperty(new u.DynamicServerError("Route ".concat(r.route," couldn't be rendered statically because it used `").concat(e,"`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error")),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.dynamicUsageDescription=e,r.dynamicUsageStack=o.stack,o;case"request":(0,a.trackDynamicDataInDynamicRender)(n)}}}(0,s.createDedupedByCallsiteServerErrorLoggerDev)(g)},17024:e=>{"use strict";e.exports=TypeError},17709:(e,t,r)=>{"use strict";var n;n={value:!0},Object.defineProperty(t,"U",{enumerable:!0,get:function(){return f}});let i=r(74897),o=r(97384),a=r(91604),s=r(46713),c=r(34569),u=r(69029),l=r(56380),d=r(36224),h=r(37183),p=r(3969);function f(){let e="cookies",t=a.workAsyncStorage.getStore(),r=s.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,h.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error("Route ".concat(t.route,' used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after')),"__NEXT_ERROR_CODE",{value:"E88",enumerable:!1,
1configurable:!0});if(t.forceStatic)return w(y());if(t.dynamicShouldError)throw Object.defineProperty(new u.StaticGenBailoutError("Route ".concat(t.route,' with `dynamic = "error"` couldn\'t be rendered statically because it used `cookies`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering')),"__NEXT_ERROR_CODE",{value:"E549",enumerable:!1,configurable:!0});if(r)switch(r.type){case"cache":var n,o;let a=Object.defineProperty(Error("Route ".concat(t.route,' used "cookies" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E398",enumerable:!1,configurable:!0});throw Error.captureStackTrace(a,f),null!=(o=(n=t).invalidDynamicUsageError)||(n.invalidDynamicUsageError=a),a;case"unstable-cache":throw Object.defineProperty(Error("Route ".concat(t.route,' used "cookies" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "cookies" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache')),"__NEXT_ERROR_CODE",{value:"E157",enumerable:!1,configurable:!0});case"prerender":return g(t,r);case"prerender-client":let s="`cookies`";throw Object.defineProperty(new p.InvariantError("".concat(s," must not be used within a client component. Next.js should be preventing ").concat(s," from being included in client components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,c.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,c.throwToInterruptStaticGeneration)(e,t,r);case"prerender-runtime":return(0,c.delayUntilRuntimeStage)(r,b(r.cookies));case"private-cache":return w(r.cookies);case"request":return(0,c.trackDynamicDataInDynamicRender)(r),w((0,i.areCookiesMutableInCurrentPhase)(r)?r.userspaceMutableCookies:r.cookies)}}(0,s.throwForMissingRequestStore)(e)}function y(){return i.RequestCookiesAdapter.seal(new o.RequestCookies(new Headers({})))}r(40991);let m=new WeakMap;function g(e,t){let r=m.get(t);if(r)return r;let n=(0,l.makeHangingPromise)(t.renderSignal,e.route,"`cookies()`");return m.set(t,n),n}function b(e){let t=m.get(e);if(t)return t;let r=Promise.resolve(e);return m.set(e,r),r}function w(e){let t=m.get(e);if(t)return t;let r=Promise.resolve(e);return m.set(e,r),Object.defineProperties(r,{[Symbol.iterator]:{value:e[Symbol.iterator]?e[Symbol.iterator].bind(e):v.bind(e)},size:{get:()=>e.size},get:{value:e.get.bind(e)},getAll:{value:e.getAll.bind(e)},has:{value:e.has.bind(e)},set:{value:e.set.bind(e)},delete:{value:e.delete.bind(e)},clear:{value:"function"==typeof e.clear?e.clear.bind(e):E.bind(e,r)},toString:{value:e.toString.bind(e)}}),r}function _(e,t){let r=e?'Route "'.concat(e,'" '):"This route ";return Object.defineProperty(Error("".concat(r,"used ").concat(t,". ")+"`cookies()` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis"),"__NEXT_ERROR_CODE",{value:"E223",enumerable:!1,configurable:!0})}function v(){return this.getAll().map(e=>[e.name,e]).values()}function E(e){for(let e of this.getAll())this.delete(e.name);return e}(0,d.createDedupedByCallsiteServerErrorLoggerDev)(_)},18493:e=>{"use strict";e.exports=Object},18652:e=>{"use strict";e.exports=Math.min},20613:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_SUFFIX:function(){return f},APP_DIR_ALIAS:function(){return N},CACHE_ONE_YEAR:function(){return P},DOT_NEXT_ALIAS:function(){return j},ESLINT_DEFAULT_DIRS:function(){return ee},GSP_NO_RETURNED_VALUE:function(){return G}
1,GSSP_COMPONENT_MEMBER_ERROR:function(){return Y},GSSP_NO_RETURNED_VALUE:function(){return X},HTML_CONTENT_TYPE_HEADER:function(){return n},INFINITE_CACHE:function(){return T},INSTRUMENTATION_HOOK_FILENAME:function(){return x},JSON_CONTENT_TYPE_HEADER:function(){return i},MATCHED_PATH_HEADER:function(){return s},MIDDLEWARE_FILENAME:function(){return R},MIDDLEWARE_LOCATION_REGEXP:function(){return O},NEXT_BODY_SUFFIX:function(){return g},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return k},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return w},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return _},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return A},NEXT_CACHE_TAGS_HEADER:function(){return b},NEXT_CACHE_TAG_MAX_ITEMS:function(){return E},NEXT_CACHE_TAG_MAX_LENGTH:function(){return S},NEXT_DATA_SUFFIX:function(){return y},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return a},NEXT_META_SUFFIX:function(){return m},NEXT_QUERY_PARAM_PREFIX:function(){return o},NEXT_RESUME_HEADER:function(){return v},NON_STANDARD_NODE_ENV:function(){return Z},PAGES_DIR_ALIAS:function(){return C},PRERENDER_REVALIDATE_HEADER:function(){return c},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return u},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return F},ROOT_DIR_ALIAS:function(){return I},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return K},RSC_ACTION_ENCRYPTION_ALIAS:function(){return W},RSC_ACTION_PROXY_ALIAS:function(){return M},RSC_ACTION_VALIDATE_ALIAS:function(){return U},RSC_CACHE_WRAPPER_ALIAS:function(){return L},RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS:function(){return H},RSC_MOD_REF_PROXY_ALIAS:function(){return D},RSC_PREFETCH_SUFFIX:function(){return l},RSC_SEGMENTS_DIR_SUFFIX:function(){return d},RSC_SEGMENT_SUFFIX:function(){return h},RSC_SUFFIX:function(){return p},SERVER_PROPS_EXPORT_ERROR:function(){return J},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return B},SERVER_PROPS_SSG_CONFLICT:function(){return $},SERVER_RUNTIME:function(){return et},SSG_FALLBACK_EXPORT_ERROR:function(){return Q},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return q},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return z},TEXT_PLAIN_CONTENT_TYPE_HEADER:function(){return r},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return V},WEBPACK_LAYERS:function(){return en},WEBPACK_RESOURCE_QUERIES:function(){return ei}});let r="text/plain",n="text/html; charset=utf-8",i="application/json; charset=utf-8",o="nxtP",a="nxtI",s="x-matched-path",c="x-prerender-revalidate",u="x-prerender-revalidate-if-generated",l=".prefetch.rsc",d=".segments",h=".segment.rsc",p=".rsc",f=".action",y=".json",m=".meta",g=".body",b="x-next-cache-tags",w="x-next-revalidated-tags",_="x-next-revalidate-tag-token",v="next-resume",E=128,S=256,A=1024,k="_N_T_",P=31536e3,T=0xfffffffe,R="middleware",O=`(?:src/)?${R}`,x="instrumentation",C="private-next-pages",j="private-dot-next",I="private-next-root-dir",N="private-next-app-dir",D="private-next-rsc-mod-ref-proxy",U="private-next-rsc-action-validate",M="private-next-rsc-server-reference",L="private-next-rsc-cache-wrapper",H="private-next-rsc-track-dynamic-import",W="private-next-rsc-action-encryption",K="private-next-rsc-action-client-wrapper",F="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",q="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",B="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",$="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",z="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",J="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",G="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",X="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",V="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",Y="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",Z='You are using a non-standard "NODE_ENV" value in y
1our environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',Q="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",ee=["app","pages","components","lib","src"],et={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},er={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"},en={...er,GROUP:{builtinReact:[er.reactServerComponents,er.actionBrowser],serverOnly:[er.reactServerComponents,er.actionBrowser,er.instrument,er.middleware],neutralTarget:[er.apiNode,er.apiEdge],clientOnly:[er.serverSideRendering,er.appPagesBrowser],bundled:[er.reactServerComponents,er.actionBrowser,er.serverSideRendering,er.appPagesBrowser,er.shared,er.instrument,er.middleware],appPages:[er.reactServerComponents,er.serverSideRendering,er.appPagesBrowser,er.actionBrowser]}},ei={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},20725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"URLPattern",{enumerable:!0,get:function(){return r}});let r="undefined"==typeof URLPattern?void 0:URLPattern},21253:e=>{"use strict";e.exports=ReferenceError},21585:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bgBlack:function(){return P},bgBlue:function(){return x},bgCyan:function(){return j},bgGreen:function(){return R},bgMagenta:function(){return C},bgRed:function(){return T},bgWhite:function(){return I},bgYellow:function(){return O},black:function(){return m},blue:function(){return _},bold:function(){return u},cyan:function(){return S},dim:function(){return l},gray:function(){return k},green:function(){return b},hidden:function(){return f},inverse:function(){return p},italic:function(){return d},magenta:function(){return v},purple:function(){return E},red:function(){return g},reset:function(){return c},strikethrough:function(){return y},underline:function(){return h},white:function(){return A},yellow:function(){return w}});let{env:n,stdout:i}=(null==(r=globalThis)?void 0:r.process)??{},o=n&&!n.NO_COLOR&&(n.FORCE_COLOR||(null==i?void 0:i.isTTY)&&!n.CI&&"dumb"!==n.TERM),a=(e,t,r,n)=>{let i=e.substring(0,n)+r,o=e.substring(n+t.length),s=o.indexOf(t);return~s?i+a(o,t,r,s):i+o},s=(e,t,r=e)=>o?n=>{let i=""+n,o=i.indexOf(t,e.length);return~o?e+a(i,t,r,o)+t:e+i+t}:String,c=o?e=>`\x1b[0m${e}\x1b[0m`:String,u=s("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),l=s("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),d=s("\x1b[3m","\x1b[23m"),h=s("\x1b[4m","\x1b[24m"),p=s("\x1b[7m","\x1b[27m"),f=s("\x1b[8m","\x1b[28m"),y=s("\x1b[9m","\x1b[29m"),m=s("\x1b[30m","\x1b[39m"),g=s("\x1b[31m","\x1b[39m"),b=s("\x1b[32m","\x1b[39m"),w=s("\x1b[33m","\x1b[39m"),_=s("\x1b[34m","\x1b[39m"),v=s("\x1b[35m","\x1b[39m"),E=s("\x1b[38;2;173;127;168m","\x1b[39m"),S=s("\x1b[36m","\x1b[39m"),A=s("\x1b[37m","\x1b[39m"),k=s("\x1b[90m","\x1b[39m"),P=s("\x1b[40m","\x1b[49m"),T=s("\x1b[41m","\x1b[49m"),R=s("\x1b[42m","\x1b[49m"),O=s("\x1b[43m","\x1b[49m"),x=s("\x1b[44m","\x1b[49m"),C=s("\x1b[45m","\x1b[49m"),j=s("\x1b[46m","\x1b[49m"),I=s("\x1b[47m","\x1b[49m")},22309:(e,t,r)=>{"use strict";var n=r(69572),i=r(24991),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},22709:(e,t,r)=>{"use strict";var n=r(12696);e.exports=function(){return n()&&!!Symbol.toStringTag}},22908:(e,t)=>{"use strict";function r(e,t){let r;if((null==t?void 0:t.host)&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getHostname",{enumerable:!0,get:function(){return r}})},23451:e=>{"use strict";let t=(function*(){}).constructor;e.exports=()=>t},24705:module=>{var __dirname="/";!function(){var __webpack_modules__={950:function(__unused_webpack_module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return -1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(e),function(t){r[t]=e[t]}
1),forEach(globals,function(t){e[t]&&(r[t]=e[t])});var o=Object_keys(r),a=n.call(r,this.code);return forEach(Object_keys(r),function(t){(t in e||-1===indexOf(o,t))&&(e[t]=r[t])}),forEach(globals,function(t){t in e||defineProp(e,t,r[t])}),document.body.removeChild(t),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(r){e[r]=t[r]}),r},forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}}),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}}};"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var __nested_webpack_exports__={};__webpack_modules__[950](0,__nested_webpack_exports__),module.exports=__nested_webpack_exports__}()},24991:(e,t,r)=>{"use strict";var n=r(89908),i=r(17024),o=r(1605),a=r(5305);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return a(n,o,e)}},25959:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{PageSignatureError:function(){return r},RemovedPageError:function(){return n},RemovedUAError:function(){return i}});class r extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form: 2 3 export function middleware(request, event) { 4 return NextResponse.redirect('/new-location') 5 } 6 7 Read more: https://nextjs.org/docs/messages/middleware-new-signature 8 `)}}class n extends Error{constructor(){super(`The request.page has been deprecated in favour of \`URLPattern\`. 9 Read more: https://nextjs.org/docs/messages/middleware-request-page 10 `)}}class i extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function. 11 Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent 12 `)}}},26585:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},26809:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(27287).createAsyncLocalStorage)()},27287:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new n}function a(e){return i?i.bind(e):n.bind(e)}function s(){return i?i.snapshot():function(e,...t){return e(...t)}}},28743:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return a},createAsyncLocalStorage:function(){return o},createSnapshot:function(){return s}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let i="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function o(){return i?new i:new n}function a(e){return i?i.bind(e):n.bind(e)}function s(){return i?i.snapshot():function(e,...t){return e(...t)}}},30065:(e,t,r)=>{"use strict";var n=r(26585);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},30676:(e,t,r)=>{"use strict";var n=r(74614),i=r(37364),o=r(1986);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},33512:(e,t,r)=>{"use strict";var n=r(42714),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},33594:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(12696);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},33601:(e,t)=>{"use strict";
12Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"InvariantError",{enumerable:!0,get:function(){return r}});class r extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},34569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{Postpone:function(){return T},PreludeState:function(){return Y},abortAndThrowOnSynchronousRequestDataAccess:function(){return A},abortOnSynchronousPlatformIOAccess:function(){return E},accessedDynamicData:function(){return D},annotateDynamicAccess:function(){return K},consumeDynamicAccess:function(){return U},createDynamicTrackingState:function(){return y},createDynamicValidationState:function(){return m},createHangingInputAbortSignal:function(){return W},createRenderInBrowserAbortSignal:function(){return H},delayUntilRuntimeStage:function(){return ee},formatDynamicAPIAccesses:function(){return M},getFirstDynamicReason:function(){return g},isDynamicPostpone:function(){return x},isPrerenderInterruptedError:function(){return N},logDisallowedDynamicError:function(){return Z},markCurrentScopeAsDynamic:function(){return b},postponeWithTracking:function(){return R},throwIfDisallowedDynamic:function(){return Q},throwToInterruptStaticGeneration:function(){return w},trackAllowedDynamicAccess:function(){return X},trackDynamicDataInDynamicRender:function(){return _},trackSynchronousPlatformIOAccessInDev:function(){return S},trackSynchronousRequestDataAccessInDev:function(){return P},useDynamicRouteParams:function(){return F},warnOnSyncDynamicError:function(){return k}});let n=p(r(21238)),i=r(50635),o=r(69029),a=r(46713),s=r(91604),c=r(5638
120),u=r(72843),l=r(44089),d=r(24650),h=r(3969);function p(e){return e&&e.__esModule?e:{default:e}}let f="function"==typeof n.default.unstable_postpone;function y(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function m(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function g(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function b(e,t,r){if(t)switch(t.type){case"cache":case"unstable-cache":case"private-cache":return}if(!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new o.StaticGenBailoutError("Route ".concat(e.route,' with `dynamic = "error"` couldn\'t be rendered statically because it used `').concat(r,"`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering")),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(t)switch(t.type){case"prerender-ppr":return R(e.route,r,t.dynamicTracking);case"prerender-legacy":t.revalidate=0;let n=Object.defineProperty(new i.DynamicServerError("Route ".concat(e.route," couldn't be rendered statically because it used ").concat(r,". See more info here: https://nextjs.org/docs/messages/dynamic-server-error")),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}function w(e,t,r){let n=Object.defineProperty(new i.DynamicServerError("Route ".concat(t.route," couldn't be rendered statically because it used `").concat(e,"`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error")),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function _(e){switch(e.type){case"cache":case"unstable-cache":case"private-cache":return}}function v(e,t,r){let n=I("Route ".concat(e," needs to bail out of prerendering at this point because it used ").concat(t,"."));r.controller.abort(n);let i=r.dynamicTracking;i&&i.dynamicAccesses.push({stack:i.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function E(e,t,r,n){let i=n.dynamicTracking;v(e,t,n),i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}function S(e){e.prerenderPhase=!1}function A(e,t,r,n){if(!1===n.controller.signal.aborted){v(e,t,n);let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}throw I("Route ".concat(e," needs to bail out of prerendering at this point because it used ").concat(t,"."))}function k(e){e.syncDynamicErrorWithStack&&console.error(e.syncDynamicErrorWithStack)}let P=S;function T(e){let{reason:t,route:r}=e,n=a.workUnitAsyncStorage.getStore();R(r,t,n&&"prerender-ppr"===n.type?n.dynamicTracking:null)}function R(e,t,r){L(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),n.default.unstable_postpone(O(e,t))}function O(e,t){return"Route ".concat(e," needs to bail out of prerendering at this point because it used ").concat(t,". ")+"React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error"}function x(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&C(e.message)}function C(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===C(O("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let j="NEXT_PRERENDER_INTERRUPTED";function I(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=j,t}function N(e){return"object"==typeof e&&null!==e&&e.digest===j&&"name"in e&&"message"in e&&e instanceof Error}function D(e){return e.length>0}function U(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function M(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(e=>{let{expression:t,stack:r}=e;return r=r.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),"Dynamic API Usage Debug - ".concat(t,":\n").concat(r)})}function L(){if(!f)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,
12configurable:!0})}function H(){let e=new AbortController;return e.abort(Object.defineProperty(new d.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),e.signal}function W(e){switch(e.type){case"prerender":case"prerender-runtime":let t=new AbortController;if(e.cacheSignal)e.cacheSignal.inputReady().then(()=>{t.abort()});else{let r=(0,a.getRuntimeStagePromise)(e);r?r.then(()=>(0,l.scheduleOnNextTick)(()=>t.abort())):(0,l.scheduleOnNextTick)(()=>t.abort())}return t.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function K(e,t){let r=t.dynamicTracking;r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:e})}function F(e){let t=s.workAsyncStorage.getStore(),r=a.workUnitAsyncStorage.getStore();if(t&&r)switch(r.type){case"prerender-client":case"prerender":{let i=r.fallbackRouteParams;i&&i.size>0&&n.default.use((0,c.makeHangingPromise)(r.renderSignal,t.route,e));break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n&&n.size>0)return R(t.route,e,r.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new h.InvariantError("`".concat(e,"` was called during a runtime prerender. Next.js should be preventing ").concat(e," from being included in server components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new h.InvariantError("`".concat(e,"` was called inside a cache scope. Next.js should be preventing ").concat(e," from being included in server components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}let q=/\n\s+at Suspense \(<anonymous>\)/,B="body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6",$=new RegExp("\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:".concat(B,") \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ").concat(u.ROOT_LAYOUT_BOUNDARY_NAME," \\([^\\n]*\\)")),z=new RegExp("\\n\\s+at ".concat(u.METADATA_BOUNDARY_NAME,"[\\n\\s]")),J=new RegExp("\\n\\s+at ".concat(u.VIEWPORT_BOUNDARY_NAME,"[\\n\\s]")),G=new RegExp("\\n\\s+at ".concat(u.OUTLET_BOUNDARY_NAME,"[\\n\\s]"));function X(e,t,r,n){if(!G.test(t)){if(z.test(t)){r.hasDynamicMetadata=!0;return}if(J.test(t)){r.hasDynamicViewport=!0;return}if($.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}else if(q.test(t)){r.hasAllowedDynamic=!0;return}else{if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let i=V('Route "'.concat(e.route,'": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense'),t);return void r.dynamicErrors.push(i)}}}function V(e,t){let r=null,n=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n.stack=n.name+": "+e+(null!=r?r:t),n}var Y=function(e){return e[e.Full=0]="Full",e[e.Empty=1]="Empty",e[e.Errored=2]="Errored",e}({});function Z(e,t){console.error(t),e.dev||(e.hasReadableErrorStacks?console.error('To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running `next dev`, then open "'.concat(e.route,'" in your browser to investigate the error.')):console.error('To get a more detailed stack trace and pinpoint the issue, try one of the following:\n - Start the app in development mode by running `next dev`, then open "'.concat(e.route,'" in your browser to investigate the error.\n - Rerun the production build with `next build --debug-prerender` to generate better stack traces.')))}function Q(e,t,r,n){if(0!==t){if(r.hasSuspenseAboveBody)return;if(n.syncDynamicErrorWithStack)throw Z(e,n.syncDynamicErrorWithStack),new o.StaticGenBailoutError;let i=r.dynamicErrors;if(i.length>0){for(let t=0;t<i.length;t++)Z(e,i[t]);throw new o.StaticGenBailoutError}if(r.hasDynamicViewport)throw console.error('Route "'.concat(e.route,'" has a `generateViewport` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport')),new o.StaticGenBailoutError;if(1===t)throw console.error('Route "'.concat(e.route,'" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.')),new o.StaticGenBailoutError}else if(!1===r.hasAllowedDynamic&&r.hasDynamicMetadata)throw console.error('Route "'.concat(e.route,'" has a `generateMetadata` that depends on Request data (`cookies()`, etc...) or uncached external data (`fetch(...)`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata')),new o.StaticGenBailoutError}function ee(e,t){return e.runtimeStagePromise?e.runtimeStagePromise.then(()=>t):t}},35655:(e,t,r)=>{var n,i="/";(()=>{var o={226:function(i,o){!function(a,s){"use strict";var c="",u="?",l="function",d="undefined",h="object",p="string",f="major",y="model",m="name",g="type",b="vendor",w="version",_="architecture",v="console",E="mobile",S="tablet",A="smarttv",k="wearable",P="embedded",T=350,R="Amazon",O="Apple",x="ASUS",C="BlackBerry",j="Browser",I="Chrome",N="Firefox",D="Google",U="Huawei",M="LG",L="Microsoft",H="Motorola",W="Opera",K="Samsung",F="Sharp",q="Sony",B="Xiaomi",$="Zebra",z="Facebook",J="Chromium OS",G="Mac OS",X=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},V=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},Y=function(e,t){return typeof e===p&&-1!==Z(t).indexOf(Z(e))},Z=function(e){return e.toLowerCase()},Q=function(e){return typeof e===p?e.replace(/[^\d\.]/g,c).split(".")[0]:void 0},ee=function(e,t){if(typeof e===p)return e=e.replace(/^\s\s*/,c),typeof t===d?e:e.substring(0,T)},et=function(e,t){for(var r,n,i,o,a,c,u=0;u<t.length&&!a;){var d=t[u],p=t[u+1];for(r=n=0;r<d.length&&!a&&d[r];)if(a=d[r++].exec(e))for(i=0;i<p.length;i++)c=a[++n],typeof(o=p[i])===h&&o.length>0?2===o.length?typeof o[1]==l?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3===o.length?typeof o[1]!==l||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[
vendor: 1,664 bytes, line 12
121],o[2]):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):s:4===o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):s):this[o]=c||s;u+=2}},er=function(e,t){for(var r in t)if(typeof t[r]===h&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(Y(t[r][n],e))return r===u?s:r}else if(Y(t[r],e))return r===u?s:r;return e},en={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ei={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[m,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[m,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[m,w],[/opios[\/ ]+([\w\.]+)/i],[w,[m,W+" Mini"]],[/\bopr\/([\w\.]+)/i],[w,[m,W]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[m,w],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[m,"UC"+j]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[w,[m,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[w,[m,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[m,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[m,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[m,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[m,/(.+
vendor: 6,124 bytes, line 12
12)/,"$1 Secure "+j],w],[/\bfocus\/([\w\.]+)/i],[w,[m,N+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[m,W+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[m,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[m,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[m,W+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[m,"MIUI "+j]],[/fxios\/([-\w\.]+)/i],[w,[m,N]],[/\bqihu|(qi?ho?o?|360)browser/i],[[m,"360 "+j]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[m,/(.+)/,"$1 "+j],w],[/(comodo_dragon)\/([\w\.]+)/i],[[m,/_/g," "],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[m,w],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[m],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[m,z],w],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[m,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[m,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[m,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[m,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[m,I+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[m,"Android "+j]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[m,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[m,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,m],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[m,[w,er,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[m,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[m,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[m,N+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[m,w],[/(cobalt)\/([\w\.]+)/i],[m,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Z]],[/((?:i[346]|x)86)[;\)]/i],[[_,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[_,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[_,/ower/,c,Z]],[/(sun4\w)[;\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[_,Z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[y,[b,K],[g,S]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[y,[b,K],[g,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[y,[b,O],[g,E]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[y,[b,O],[g,S]],[/(macintosh);/i],[y,[b,O]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[y,[b,F],[g,E]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[y,[b,U],[g,S]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[y,[b,U],[g,E]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[y,/_/g," "],[b,B],[g,E]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[y,/_/g," "],[b,B],[g,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[y,[b,"OPPO"],[g,E]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[y,[b,"Vivo"],[g,E]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[y,[b,"Realme"],[g,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[y,[b,H],[g,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[y,[b,H],[g,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[y,[b,M],[g,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[y,[b,M],[g,E]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[y,[b,"Lenovo"],[g,S]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[y,/_/g," "],[b,"Nokia"],[g,E]],[/(pixel c)\b/i],[y,[b,D],[g,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[y,[b,D],[g,E]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[y,[b,q],[g,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[y,"Xperia Tablet"],[b,q],[g,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[y,[b,"OnePlus"],[g,E]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[y,[b,R],[g,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[y,/(.+)/g,"Fire Phone $1"],[b,R],[g,E]],[/(playbook);[-\w\),; ]+(rim)/i],[y,b,[g,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[y,[b,C],[g,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[y,[b,x],[g,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[y,[b,x],[g,E]],[/(nexus 9)/i],[y,[b,"HTC"],[g,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[y,/_/g," "],[g,E]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[y,[b,"Acer"],[g,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[y,[b,"Meizu"],[g,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asu
vendor: 1,886 bytes, line 12
12s)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,y,[g,E]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,y,[g,S]],[/(surface duo)/i],[y,[b,L],[g,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[y,[b,"Fairphone"],[g,E]],[/(u304aa)/i],[y,[b,"AT&T"],[g,E]],[/\bsie-(\w*)/i],[y,[b,"Siemens"],[g,E]],[/\b(rct\w+) b/i],[y,[b,"RCA"],[g,S]],[/\b(venue[\d ]{2,7}) b/i],[y,[b,"Dell"],[g,S]],[/\b(q(?:mv|ta)\w+) b/i],[y,[b,"Verizon"],[g,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[y,[b,"Barnes & Noble"],[g,S]],[/\b(tm\d{3}\w+) b/i],[y,[b,"NuVision"],[g,S]],[/\b(k88) b/i],[y,[b,"ZTE"],[g,S]],[/\b(nx\d{3}j) b/i],[y,[b,"ZTE"],[g,E]],[/\b(gen\d{3}) b.+49h/i],[y,[b,"Swiss"],[g,E]],[/\b(zur\d{3}) b/i],[y,[b,"Swiss"],[g,S]],[/\b((zeki)?tb.*\b) b/i],[y,[b,"Zeki"],[g,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],y,[g,S]],[/\b(ns-?\w{0,9}) b/i],[y,[b,"Insignia"],[g,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[y,[b,"NextBook"],[g,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],y,[g,E]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],y,[g,E]],[/\b(ph-1) /i],[y,[b,"Essential"],[g,E]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[y,[b,"Envizen"],[g,S]],[/\b(trio[-\w\. ]+) b/i],[y,[b,"MachSpeed"],[g,S]],[/\btu_(1491) b/i],[y,[b,"Rotor"],[g,S]],[/(shield[\w ]+) b/i],[y,[b,"Nvidia"],[g,S]],[/(sprint) (\w+)/i],[b,y,[g,E]],[/(kin\.[onetw]{3})/i],[[y,/\./g," "],[b,L],[g,E]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[y,[b,$],[g,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[y,[b,$],[g,E]],[/smart-tv.+(samsung)/i],[b,[g,A]
vendor: 5,757 bytes, line 12
12],[/hbbtv.+maple;(\d+)/i],[[y,/^/,"SmartTV"],[b,K],[g,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,M],[g,A]],[/(apple) ?tv/i],[b,[y,O+" TV"],[g,A]],[/crkey/i],[[y,I+"cast"],[b,D],[g,A]],[/droid.+aft(\w)( bui|\))/i],[y,[b,R],[g,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[y,[b,F],[g,A]],[/(bravia[\w ]+)( bui|\))/i],[y,[b,q],[g,A]],[/(mitv-\w{5}) bui/i],[y,[b,B],[g,A]],[/Hbbtv.*(technisat) (.*);/i],[b,y,[g,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,ee],[y,ee],[g,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,y,[g,v]],[/droid.+; (shield) bui/i],[y,[b,"Nvidia"],[g,v]],[/(playstation [345portablevi]+)/i],[y,[b,q],[g,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[y,[b,L],[g,v]],[/((pebble))app/i],[b,y,[g,k]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[y,[b,O],[g,k]],[/droid.+; (glass) \d/i],[y,[b,D],[g,k]],[/droid.+; (wt63?0{2,3})\)/i],[y,[b,$],[g,k]],[/(quest( 2| pro)?)/i],[y,[b,z],[g,k]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[g,P]],[/(aeobc)\b/i],[y,[b,R],[g,P]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[y,[g,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[y,[g,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,E]],[/(android[-\w\. ]{0,9});.+buil/i],[y,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[m,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[m,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[m,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,m]],os:[[/microsoft (windows) (vista|xp)/i],[m,w],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[m,[w,er,en]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[m,"Windows"],[w,er,en]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[m,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[m,G],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,m],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[m,w],[/\(bb(10);/i],[w,[m,C]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[m,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[m,N+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[m,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[m,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[m,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[m,J],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[m,w],[/(sunos) ?([\w\.\d]*)/i],[[m,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[m,w]]},eo=function(e,t){if(typeof e===h&&(t=e,e=s),!(this instanceof eo))return new eo(e,t).getResult();var r=typeof a!==d&&a.navigator?a.navigator:s,n=e||(r&&r.userAgent?r.userAgent:c),i=r&&r.userAgentData?r.userAgentData:s,o=t?X(ei,t):ei,u=r&&r.userAgent==n;return this.getBrowser=function(){var e={};return e[m]=s,e[w]=s,et.call(e,n,o.browser),e[f]=Q(e[w]),u&&r&&r.brave&&typeof r.brave.isBrave==l&&(e[m]="Brave"),e},this.getCPU=function(){var e={};return e[_]=s,et.call(e,n,o.cpu),e},this.getDevice=function(){var e={};return e[b]=s,e[y]=s,e[g]=s,et.call(e,n,o.device),u&&!e[g]&&i&&i.mobile&&(e[g]=E),u&&"Macintosh"==e[y]&&r&&typeof r.standalone!==d&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e[y]="iPad",e[g]=S),e},this.getEngine=function(){var e={};return e[m]=s,e[w]=s,et.call(e,n,o.engine),e},this.getOS=function(){var e={};return e[m]=s,e[w]=s,et.call(e,n,o.os),u&&!e[m]&&i&&"Unknown"!=i.platform&&(e[m]=i.platform.replace(/chrome os/i,J).replace(/macos/i,G)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===p&&e.length>T?ee(e,T):e,this},this.setUA(n),this};eo.VERSION="1.0.35",eo.BROWSER=V([m,w,f]),eo.CPU=V([_]),eo.DEVICE=V([y,b,g,v,E,A,S,k,P]),eo.ENGINE=eo.OS=V([m,w]),typeof o!==d?("object"!==d&&i.exports&&(o=i.exports=eo),o.UAParser=eo):"function"===l&&r.amdO?void 0===(n=(function(){return eo}).call(t,r,t,e))||(e.exports=n):typeof a!==d&&(a.UAParser=eo);var ea=typeof a!==d&&(a.jQuery||a.Zepto);if(ea&&!ea.ua){var es=new eo;ea.ua=es.getResult(),ea.ua.get=function(){return es.getUA()},ea.ua.set=function(e){es.setUA(e);var t=es.getResult();for(var r in t)ea.ua[r]=t[r]}}}("object"==typeof window?window:this)}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}},n=!0;
12try{o[e].call(r.exports,r,r.exports,s),n=!1}finally{n&&delete a[e]}return r.exports}s.ab=i+"/",e.exports=s(226)})()},35834:(e,t,r)=>{var n="/",i=r(37811);!function(){var t={782:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function a(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let s,c;if("string"==typeof t&&i(t,"not ")?(s="must not be",t=t.replace(/^not /,"")):s="must be",o(e," argument"))c=`The ${e} ${s} ${n(t,"type")}`;else{let r=a(e,".")?"property":"argument";c=`The "${e}" ${r} ${s} ${n(t,"type")}`}return c+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),a=r(337);r(782)(l,o);for(var s=n(a.prototype),c=0;c<s.length;c++){var u=s[c];l.prototype[u]||(l.prototype[u]=a.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||i.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},889:function(e,t,r){"use strict";e.exports=i;var n=r(170);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(782)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},709:function(e,t,n){"use strict";e.exports=O,O.ReadableState=R,n(361).EventEmitter;var o,a,s,c,u,l=function(e,t){return e.listeners(t).length},d=n(678),h=n(300).Buffer,p=r.g.Uint8Array||function(){};function f(e){return h.from(e)}function y(e){return h.isBuffer(e)||e instanceof p}var m=n(837);a=m&&m.debuglog?m.debuglog("stream"):function(){};var g=n(379),b=n(25),w=n(776).getHighWaterMark,_=n(646).q,v=_.ERR_INVALID_ARG_TYPE,E=_.ERR_STREAM_PUSH_AFTER_EOF,S=_.ERR_METHOD_NOT_IMPLEMENT
vendor: 21,107 bytes, line 12
12ED,A=_.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(782)(O,d);var k=b.errorOrDestroy,P=["error","close","destroy","pause","resume"];function T(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function R(e,t,r){o=o||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=w(this,e,"readableHighWaterMark",r),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(s||(s=n(704).s),this.decoder=new s(e.encoding),this.encoding=e.encoding)}function O(e){if(o=o||n(403),!(this instanceof O))return new O(e);var t=this instanceof o;this._readableState=new R(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),d.call(this)}function x(e,t,r,n,i){a("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,U(e,s);else if(i||(o=j(s,t)),o)k(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===h.prototype||(t=f(t)),n)s.endEmitted?k(e,new A):C(e,s,t,!0);else if(s.ended)k(e,new E);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?C(e,s,t,!1):H(e,s)):C(e,s,t,!1)}else n||(s.reading=!1,H(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function C(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),H(e,t)}function j(e,t){var r;return y(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=b.destroy,O.prototype._undestroy=b.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=h.from(e,t),t=""),r=!0),x(this,e,t,!1,r)},O.prototype.unshift=function(e){return x(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){s||(s=n(704).s);var t=new s(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var I=0x40000000;function N(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function D(e,t){if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&(t.highWaterMark=N(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function U(e,t){if(a("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?M(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}}function M(e){var t=e._readableState;a("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(a("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(L,e))}function L(e){var t=e._readableState;a("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,z(e)}function H(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(W,e,t))}function W(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(a("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function K(e){return function(){var t=e._readableState;a("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(e,"data")&&(t.flowing=!0,z(e))}}function F(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function q(e){a("readable nexttick read 0"),e.read(0)}function B(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick($,e,t))}function $(e,t){a("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),z(e),t.flowing&&!t.reading&&e.read(0)}function z(e){var t=e._readableState;for(a("flow",t.flowing);t.flowing&&null!==e.read(););}function J(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function G(e){var t=e._readableState;a("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(X,t,e))}function X(e,t){if(a("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}O.prototype.read=function(e){a("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return a("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?G(this):M(this),null;if(0===(e=D(e,r))&&r.ended)return 0===r.length&&G(this),null;var i=r.needReadable;return a("need readable",i),(0===r.length||r.length-e<r.highWaterMark)&&a("length less than watermark",i=!0),r.ended||r.reading?a("reading or ended",i=!1):i&&(a("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=D(n,r))),null===(t=e>0?J(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&G(this)),null!==t&&this.emit("data",t),t},O.prototype._read=function(e){k(this,new S("_read()"))},O.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,a("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?g:c;function s(e,t){a("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function c(){a("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",s);var u=K(r);e.on("drain",u);var d=!1;function h(){a("cleanup"),e.removeListener("close",y),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",f),e.removeListener("unpipe",s),r.removeListener("end",c),r.removeListener("end",g),r.removeListener("data",p),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function p(t){a("ondata");var i=e.write(t);a("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!d&&(a("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){a("onerror",t),g(),e.removeListener("error",f),0===l(e,"error")&&k(e,t)}function y(){e.removeListener("finish",m),g()}function m(){a("onfinish"),e.removeListener("close",y),g()}function g(){a("unpipe"),r.unpipe(e)}return r.on("data",p),T(e,"error",f),e.once("close",y),e.once("finish",m),e.emit("pipe",r),n.flowing||(a("pipe resume"),r.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=V(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=d.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,a("on readable",n.length,n.reading),n.length?M(this):n.reading||i.nextTick(q,this)),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=d.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(F,this),r},O.prototype.removeAllListeners=function(e){var t=d.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(F,this),t},O.prototype.resume=function(){var e=this._readableState;return e.flowing||(a("resume"),e.flowing=!e.readableListening,B(this,e)),e.paused=!1,this},O.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(a("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){if(a("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!=i)(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<P.length;o++)e.on(P[o],this.emit.bind(this,P[o]));return this._read=function(t){a("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=n(871)),c(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=J,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===u&&(u=n(727)),u(O,e,t)})},170:function(e,t,r){"use strict";e.exports=l;var n=r(646).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(403);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,r){h(e,t,r)})}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(782)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},337:function(e,t,n){"use strict";function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){$(t,e)}}e.exports=R,R.WritableState=T;var a,s,c={deprecate:n(769)},u=n(678),l=n(300).Buffer,d=r.g.Uint8Array||function(){};function h(e){return l.from(e)}function p(e){return l.isBuffer(e)||e instanceof d}var f=n(25),y=n(776).getHighWaterMark,m=n(646).q,g=m.ERR_INVALID_ARG_TYPE,b=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_MULTIPLE_CALLBACK,_=m.ERR_STREAM_CANNOT_PIPE,v=m.ERR_STREAM_DESTROYED,E=m.ERR_STREAM_NULL_VALUES,S=m.ERR_STREAM_WRITE_AFTER_END,A=m.ERR_UNKNOWN_ENCODING,k=f.errorOrDestroy;function P(){}function T(e,t,r){a=a||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof a),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=y(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){U(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function R(e){var t=this instanceof(a=a||n(403));if(!t&&!s.call(R,this))return new R(e);this._writableState=new T(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function O(e,t){var r=new S;k(e,r),i.nextTick(t,r)}function x(e,t,r,n){var o;return null===r?o=new E:"string"==typeof r||t.objectMode||(o=new g("chunk",["string","Buffer"],r)),!o||(k(e,o),i.nextTick(n,o),!1)}function C(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}function j(e,t,r,n,i,o){if(!r){var a=C(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,s,n,i,o);return c}function I(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function N(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(q,e,t),e._writableState.errorEmitted=!0,k(e,n)):(o(n),e._writableState.errorEmitted=!0,k(e,n),q(e,t))}function D(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function U(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new w;if(D(r),t)N(e,r,n,t,o);else{var a=W(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||H(e,r),n?i.nextTick(M,e,r,a,o):M(e,r,a,o)}}function M(e,t,r,n){r||L(e,t),t.pendingcb--,n(),q(e,t)}function L(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function H(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,I(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,d=t.objectMode?1:c.length;if(I(e,t,!1,d,c,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function W(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function K(e,t){e._final(function(r){t.pendingcb--,r&&k(e,r),t.prefinished=!0,e.emit("prefinish"),q(e,t)})}function F(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(K,e,t)))}function q(e,t){var r=W(t);if(r&&(F(e,t),0===t.pendingcb)&&(t.finished=!0,e.emit("finish"),t.autoDestroy)){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function B(e,t,r){t.ending=!0,q(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function $(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}n(782)(R,u),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===R&&e&&e._writableState instanceof T}})):s=function(e){return e instanceof this},R.prototype.pipe=function(){k(this,new _)},R.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&p(e);return o&&!l.isBuffer(e)&&(e=h(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=P),n.ending?O(this,r):(o||x(this,n,e,r))&&(n.pendingcb++,i=j(this,n,o,e,t,r)),i},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||H(this,e))},R.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new A(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,r){r(new b("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||B(this,n,r),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=f.destroy,R.prototype._undestroy=f.undestroy,R.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,a=r(698),s=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function f(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[p].read();null!==r&&(e[d]=null,e[s]=null,e[c]=null,t(f(r,!1)))}}function m(e){i.nextTick(y,e)}function g(e,t){return function(r,n){e.then(function(){if(t[l])return void r(f(void 0,!0));t[h](r,n)},n)}}var b=Object.getPrototypeOf(function(){}
12),w=Object.setPrototypeOf((n(o={get stream(){return this[p]},next:function(){var e,t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(f(void 0,!0));if(this[p].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[u]?r(t[u]):e(f(void 0,!0))})});var n=this[d];if(n)e=new Promise(g(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(f(o,!1));e=new Promise(this[h])}return this[d]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){if(e)return void r(e);t(f(void 0,!0))})})}),o),b);e.exports=function(e){var t,r=Object.create(w,(n(t={},p,{value:e,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,h,{value:function(e,t){var n=r[p].read();n?(r[d]=null,r[s]=null,r[c]=null,e(f(n,!1))):(r[s]=e,r[c]=t)},writable:!0}),t));return r[d]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];null!==t&&(r[d]=null,r[s]=null,r[c]=null,t(e)),r[u]=e;return}var n=r[s];null!==n&&(r[d]=null,r[s]=null,r[c]=null,n(f(void 0,!0))),r[l]=!0}),e.on("readable",m.bind(null,r)),r}},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),e}var u=r(300).Buffer,l=r(837).inspect,d=l&&l.custom||"inspect";function h(e,t,r){u.prototype.copy.call(e,t,r)}e.exports=function(){function e(){a(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)h(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:d,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){n(e,t),r(e)}function r(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this,s=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return s||c?o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(n,this,e)):i.nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?a._writableState?a._writableState.errorEmitted?i.nextTick(r,a):(a._writableState.errorEmitted=!0,i.nextTick(t,a,e)):i.nextTick(t,a,e):o?(i.nextTick(r,a),o(e)):i.nextTick(r,a)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},698:function(e,t,r){"use strict";
12var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function o(){}function a(e){return e.setHeader&&"function"==typeof e.abort}function s(e,t,r){if("function"==typeof t)return s(e,null,t);t||(t={}),r=i(r||o);var c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=function(){e.writable||h()},d=e._writableState&&e._writableState.finished,h=function(){u=!1,d=!0,c||r.call(e)},p=e._readableState&&e._readableState.endEmitted,f=function(){c=!1,p=!0,u||r.call(e)},y=function(t){r.call(e,t)},m=function(){var t;return c&&!p?(e._readableState&&e._readableState.ended||(t=new n),r.call(e,t)):u&&!d?(e._writableState&&e._writableState.ended||(t=new n),r.call(e,t)):void 0},g=function(){e.req.on("finish",h)};return a(e)?(e.on("complete",h),e.on("abort",m),e.req?g():e.on("request",g)):u&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",f),e.on("finish",h),!1!==t.error&&e.on("error",y),e.on("close",m),function(){e.removeListener("complete",h),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",h),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("end",f),e.removeListener("error",y),e.removeListener("close",m)}}e.exports=s},727:function(e,t,r){"use strict";function n(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){r(e);return}s.done?t(c):Promise.resolve(c).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,c,"next",e)}function c(e){n(a,i,o,s,c,"throw",e)}s(void 0)})}}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=r(646).q.ERR_INVALID_ARG_TYPE;e.exports=function(e,t,r){if(t&&"function"==typeof t.next)n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new c("iterable",["Iterable"],t);var n,o=new e(a({objectMode:!0},r)),s=!1;function u(){return l.apply(this,arguments)}function l(){return(l=i(function*(){try{var e=yield n.next(),t=e.value;e.done?o.push(null):o.push((yield t))?u():s=!1}catch(e){o.destroy(e)}})).apply(this,arguments)}return o._read=function(){s||(s=!0,u())},o}},442:function(e,t,r){"use strict";function n(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i,o=r(646).q,a=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function u(e){return e.setHeader&&"function"==typeof e.abort}function l(e,t,o,a){a=n(a);var c=!1;e.on("close",function(){c=!0}),void 0===i&&(i=r(698)),i(e,{readable:t,writable:o},function(e){if(e)return a(e);c=!0,a()});var l=!1;return function(t){if(!c&&!l){if(l=!0,u(e))return e.abort();if("function"==typeof e.destroy)return e.destroy();a(t||new s("pipe"))}}}function d(e){e()}function h(e,t){return e.pipe(t)}function p(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():c}e.exports=function(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=p(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a("streams");var o=r.map(function(t,n){var a=n<r.length-1;return l(t,a,n>0,function(t){e||(e=t),t&&o.forEach(d),a||(o.forEach(d),i(e))})});return r.reduce(h)}},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}e.exports={getHighWaterMark:function(e,t,r,o){var a=i(t,o,r);
vendor: 5,665 bytes, line 12
12if(null!=a){if(!(isFinite(a)&&Math.floor(a)===a)||a<0)throw new n(o?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function a(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function s(e){var t;switch(this.encoding=a(e),this.encoding){case"utf16le":this.text=f,this.end=y,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=m,this.end=g,t=3;break;default:this.write=b,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function h(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function m(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function w(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=p,s.prototype.text=h,s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},769:function(e){function t(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}
12e.exports=function e(e,r){if(t("noDeprecation"))return e;var n=!1;return function(){if(!n){if(t("throwDeprecation"))throw Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return e.apply(this,arguments)}}},300:function(e){"use strict";e.exports=r(65273)},361:function(e){"use strict";e.exports=r(69975)},781:function(e){"use strict";e.exports=r(69975).EventEmitter},837:function(e){"use strict";e.exports=r(97608)}},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}},i=!0;try{t[e](n,n.exports,a),i=!1}finally{i&&delete o[e]}return n.exports}a.ab=n+"/",e.exports=a(173)}()},36224:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createDedupedByCallsiteServerErrorLoggerDev",{enumerable:!0,get:function(){return u}});let n=o(r(21238));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=o?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n}let a={current:null},s="function"==typeof n.cache?n.cache:e=>e,c=console.warn;function u(e){return function(...t){c(e(...t))}}s(e=>{try{c(a.current)}finally{a.current=null}})},36470:e=>{"use strict";e.exports=EvalError},36481:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ACTION_HEADER:function(){return n},FLIGHT_HEADERS:function(){return d},NEXT_ACTION_NOT_FOUND_HEADER:function(){return b},NEXT_DID_POSTPONE_HEADER:function(){return f},NEXT_HMR_REFRESH_HASH_COOKIE:function(){return c},NEXT_HMR_REFRESH_HEADER:function(){return s},NEXT_IS_PRERENDER_HEADER:function(){return g},NEXT_REWRITTEN_PATH_HEADER:function(){return y},NEXT_REWRITTEN_QUERY_HEADER:function(){return m},NEXT_ROUTER_PREFETCH_HEADER:function(){return o},NEXT_ROUTER_SEGMENT_PREFETCH_HEADER:function(){return a},NEXT_ROUTER_STALE_TIME_HEADER:function(){return p},NEXT_ROUTER_STATE_TREE_HEADER:function(){return i},NEXT_RSC_UNION_QUERY:function(){return h},NEXT_URL:function(){return u},RSC_CONTENT_TYPE_HEADER:function(){return l},RSC_HEADER:function(){return r}});let r="rsc",n="next-action",i="next-router-state-tree",o="next-router-prefetch",a="next-router-segment-prefetch",s="next-hmr-refresh",c="__next_hmr_refresh_hash__",u="next-url",l="text/x-component",d=[r,i,o,s,a],h="_rsc",p="x-nextjs-stale-time",f="x-nextjs-postponed",y="x-nextjs-rewritten-path",m="x-nextjs-rewritten-query",g="x-nextjs-prerender",b="x-nextjs-action-not-found";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36807:(e,t,r)=>{"use strict";r.d(t,{CB:()=>c,Il:()=>o,UC:()=>s,Z9:()=>a});var n=r(37811);function i(e){return e&&!e.startsWith("/")?`/${e}`:e}function o(e){return e&&!e.endsWith("/")?`${e}/`:e}function a(e){return e&&e.startsWith("/")?e.substring(1,e.length):e}let s=e=>e.endsWith("/")?e.slice(0,-1):e,c=e=>{let t=n.env.NEXT_PUBLIC_BASE_PATH;return t?o(i(t))+a(e):e}},37183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isRequestAPICallableInsideAfter:function(){return c},throwForSearchParamsAccessInUseCache:function(){return s},throwWithStaticGenerationBailoutError:function(){return o},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return a}});let n=r(69029),i=r(78179);function o(e,t){throw Object.defineProperty(new n.StaticGenBailoutError("Route ".concat(e," couldn't be rendered statically because it used ").concat(t,". See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering")),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,
12configurable:!0})}function a(e,t){throw Object.defineProperty(new n.StaticGenBailoutError("Route ".concat(e,' with `dynamic = "error"` couldn\'t be rendered statically because it used ').concat(t,". See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering")),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function s(e,t){var r,n;let i=Object.defineProperty(Error("Route ".concat(e.route,' used "searchParams" inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await "searchParams" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E779",enumerable:!1,configurable:!0});throw Error.captureStackTrace(i,t),null!=(n=(r=e).invalidDynamicUsageError)||(r.invalidDynamicUsageError=i),i}function c(){let e=i.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},37332:(e,t,r)=>{"use strict";let n,i,o,a,s,c,u,l,d;r.d(t,{OF:()=>a$});var h,p,f,y,m,g,b,w,_,v,E=r(98173),S=r(88557),A=r(63459);let k="openid profile email offline_access",P=0,T=30,R=300,O=100,x=!0,C=300;var j=r(32837);if("undefined"==typeof navigator||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){let e="oauth4webapi",t="v3.8.4";n=`${e}/${t}`}function I(e,t){if(null==e)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}let N="ERR_INVALID_ARG_VALUE",D="ERR_INVALID_ARG_TYPE";function U(e,t,r){let n=TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}let M=Symbol(),L=Symbol(),H=Symbol(),W=Symbol(),K=Symbol(),F=Symbol();Symbol();let q=new TextEncoder,B=new TextDecoder;function $(e){return"string"==typeof e?q.encode(e):B.decode(e)}if(Uint8Array.prototype.toBase64)i=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{let e=32768;i=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let r=[];for(let n=0;n<t.byteLength;n+=e)r.push(String.fromCharCode.apply(null,t.subarray(n,n+e)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function z(e){return"string"==typeof e?o(e):i(e)}o=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(e){throw U("The input to be decoded is not correctly encoded.",N,e)}}:e=>{try{let t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}catch(e){throw U("The input to be decoded is not correctly encoded.",N,e)}};class J extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=tS,Error.captureStackTrace?.(this,this.constructor)}}class G extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}}function X(e,t,r){return new G(e,{code:t,cause:r})}async function V(e){let t;switch(e.kty){case"EC":t={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":t={crv:e.crv,kty:e.kty,x:e.x};break;case"AKP":t={alg:e.alg,kty:e.kty,pub:e.pub};break;case"RSA":t={e:e.e,kty:e.kty,n:e.n};break;default:throw new J("unsupported JWK key type",{cause:e})}return z(await crypto.subtle.digest("SHA-256",$(JSON.stringify(t))))}function Y(e,t){if(!(e instanceof CryptoKey))throw U(`${t} must be a CryptoKey`,D)}function Z(e,t){if(Y(e,t),"private"!==e.type)throw U(`${t} must be a private CryptoKey`,N)}function Q(e,t){if(Y(e,t),"public"!==e.type)throw U(`${t} must be a public CryptoKey`,N)}function ee(e){return!(null===e||"object"!=typeof e||Array.isArray(e))}function et(e){I(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(n&&!t.has("user-agent")&&t.set("user-agent",n),t.has("authorization"))throw U('"options.headers" must not include the "authorization" header name',N);return t}function er(e,t){if(void 0!==t){if("function"==typeof t&&(t=t(e.href)),!(t instanceof AbortSignal))throw U('"options.signal" must return or be an instance of AbortSignal',D);return t}}function en(e){return e.includes("//")?e.replace("//","/"):e}function ei(e,t,r=!1){return"/"===e.pathname?e.pathname=t:e.pathname=en(`${t}/${r?e.pathname:e.pathname.replace(/(\/)$/,"")}`),e}function eo(e,t){return e.pathname=en(`${e.pathname}/${t}`),e}async function ea(e,t,r,n){if(!(e instanceof URL))throw U(`"${t}" must be an instance of URL`,D);eM(e,n?.[M]!==!0);let i=r(new URL(e.href)),o=et(n?.headers);return o.set("accept","application/json"),(n?.[W]||fetch)(i.href,{body:void 0,headers:Object.fromEntries(o.entries()),method:"GET",redirect:"manual",signal:er(i,n?.signal)}
12)}async function es(e,t){return ea(e,"issuerIdentifier",e=>{switch(t?.algorithm){case void 0:case"oidc":eo(e,".well-known/openid-configuration");break;case"oauth2":ei(e,".well-known/oauth-authorization-server");break;default:throw U('"options.algorithm" must be "oidc" (default), or "oauth2"',N)}return e},t)}function ec(e,t,r,n,i){try{if("number"!=typeof e||!Number.isFinite(e))throw U(`${r} must be a number`,D,i);if(e>0)return;if(t){if(0!==e)throw U(`${r} must be a non-negative number`,N,i);return}throw U(`${r} must be a positive number`,N,i)}catch(e){if(n)throw X(e.message,n,i);throw e}}function eu(e,t,r,n){try{if("string"!=typeof e)throw U(`${t} must be a string`,D,n);if(0===e.length)throw U(`${t} must not be empty`,N,n)}catch(e){if(r)throw X(e.message,r,n);throw e}}async function el(e,t){let r=e;if(!(r instanceof URL)&&r!==tQ)throw U('"expectedIssuerIdentifier" must be an instance of URL',D);if(!I(t,Response))throw U('"response" must be an instance of Response',D);if(200!==t.status)throw X('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',tR,t);tL(t);let n=await tZ(t);if(eu(n.issuer,'"response" body "issuer" property',tP,{body:n}),r!==tQ&&new URL(n.issuer).href!==r.href)throw X('"response" body "issuer" property does not match the expected value',tI,{expected:r.href,body:n,attribute:"issuer"});return n}function ed(e){ep(e,"application/json")}function eh(e,...t){let r='"response" content-type must be ';if(t.length>2){let e=t.pop();r+=`${t.join(", ")}, or ${e}`}else 2===t.length?r+=`${t[0]} or ${t[1]}`:r+=t[0];return X(r,tT,e)}function ep(e,t){if(e9(e)!==t)throw eh(e,t)}function ef(){return z(crypto.getRandomValues(new Uint8Array(32)))}function ey(){return ef()}function em(){return ef()}function eg(){return ef()}async function eb(e){return eu(e,"codeVerifier"),z(await crypto.subtle.digest("SHA-256",$(e)))}function ew(e){return e instanceof CryptoKey?{key:e}:e?.key instanceof CryptoKey?(void 0!==e.kid&&eu(e.kid,'"kid"'),{key:e.key,kid:e.kid}):{}}function e_(e){switch(e.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new J("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function ev(e){switch(e.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new J("unsupported RsaHashedKeyAlgorithm hash name",{cause:e})}}function eE(e){switch(e.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new J("unsupported EcKeyAlgorithm namedCurve",{cause:e})}}function eS(e){switch(e.algorithm.name){case"RSA-PSS":return e_(e);case"RSASSA-PKCS1-v1_5":return ev(e);case"ECDSA":return eE(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new J("unsupported CryptoKey algorithm name",{cause:e})}}function eA(e){let t=e?.[L];return"number"==typeof t&&Number.isFinite(t)?t:0}function ek(e){let t=e?.[H];return"number"==typeof t&&Number.isFinite(t)&&-1!==Math.sign(t)?t:30}function eP(){return Math.floor(Date.now()/1e3)}function eT(e){if("object"!=typeof e||null===e)throw U('"as" must be an object',D);eu(e.issuer,'"as.issuer"')}function eR(e){if("object"!=typeof e||null===e)throw U('"client" must be an object',D);eu(e.client_id,'"client.client_id"')}function eO(e){return eu(e,'"clientSecret"'),(t,r,n,i)=>{n.set("client_id",r.client_id),n.set("client_secret",e)}}function ex(e,t){let r=eP()+eA(t);return{jti:ef(),aud:e.issuer,exp:r+60,iat:r,nbf:r,iss:t.client_id,sub:t.client_id}}function eC(e,t){let{key:r,kid:n}=ew(e);return Z(r,'"clientPrivateKey.key"'),async(e,i,o,a)=>{let s={alg:eS(r),kid:n},c=ex(e,i);t?.[K]?.(s,c),o.set("client_id",i.client_id),o.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),o.set("client_assertion",await eI(s,c,r))}}function ej(){return(e,t,r,n)=>{r.set("client_id",t.client_id)}}async function eI(e,t,r){if(!r.usages.includes("sign"))throw U('CryptoKey instances used for signing assertions must include "sign" in their "usages"',N);
12let n=`${z($(JSON.stringify(e)))}.${z($(JSON.stringify(t)))}`,i=z(await crypto.subtle.sign(tK(r),r,$(n)));return`${n}.${i}`}async function eN(e,t){let{kty:r,e:n,n:i,x:o,y:s,crv:c,pub:u}=await crypto.subtle.exportKey("jwk",e),l={kty:r,e:n,n:i,x:o,y:s,crv:c,pub:u};return"AKP"===r&&(l.alg=t),a.set(e,l),l}async function eD(e,t){return(a||=new WeakMap).get(e)||eN(e,t)}let eU=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function eM(e,t){if(t&&"https:"!==e.protocol)throw X("only requests to HTTPS are allowed",tO,e);if("https:"!==e.protocol&&"http:"!==e.protocol)throw X("only HTTP and HTTPS requests are allowed",tx,e)}function eL(e,t,r,n){let i;if("string"!=typeof e||!(i=eU(e)))throw X(`authorization server metadata does not contain a valid ${r?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,void 0===e?tN:tD,{attribute:r?`mtls_endpoint_aliases.${t}`:t});return eM(i,n),i}function eH(e,t,r,n){return r&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?eL(e.mtls_endpoint_aliases[t],t,r,n):eL(e[t],t,r,n)}async function eW(e,t,r,n,i){eT(e),eR(t);let o=eH(e,"pushed_authorization_request_endpoint",t.use_mtls_endpoint_aliases,i?.[M]!==!0),a=new URLSearchParams(n);a.set("client_id",t.client_id);let s=et(i?.headers);s.set("accept","application/json"),i?.DPoP!==void 0&&(e4(i.DPoP),await i.DPoP.addProof(o,s,"POST"));let c=await e7(e,t,r,o,a,s,i);return i?.DPoP?.cacheNonce(c,o),c}class eK{#e;#t;#r;#n;#i;#o;#a;constructor(e,t,r){if(Z(t?.privateKey,'"DPoP.privateKey"'),Q(t?.publicKey,'"DPoP.publicKey"'),!t.publicKey.extractable)throw U('"DPoP.publicKey.extractable" must be true',N);this.#i=r?.[K],this.#n=eA(e),this.#t=t.privateKey,this.#r=t.publicKey,tl.add(this)}#s(e){this.#o||=new Map;let t=this.#o.get(e);return t&&(this.#o.delete(e),this.#o.set(e,t)),t}#c(e,t){this.#o||=new Map,this.#o.delete(e),100===this.#o.size&&this.#o.delete(this.#o.keys().next().value),this.#o.set(e,t)}async calculateThumbprint(){if(!this.#a){let e=await crypto.subtle.exportKey("jwk",this.#r);this.#a||=await V(e)}return this.#a}async addProof(e,t,r,n){let i=eS(this.#t);this.#e||={alg:i,typ:"dpop+jwt",jwk:await eD(this.#r,i)};let o=this.#s(e.origin),a={iat:eP()+this.#n,jti:ef(),htm:r,nonce:o,htu:`${e.origin}${e.pathname}`,ath:n?z(await crypto.subtle.digest("SHA-256",$(n))):void 0};this.#i?.(this.#e,a),t.set("dpop",await eI(this.#e,a,this.#t))}cacheNonce(e,t){try{let r=e.headers.get("dpop-nonce");r&&this.#c(t.origin,r)}catch{}}}function eF(e){if(e instanceof ez){let{0:t,length:r}=e.cause;return 1===r&&"dpop"===t.scheme&&"use_dpop_nonce"===t.parameters.error}return e instanceof eB&&"use_dpop_nonce"===e.error}function eq(e,t,r){return new eK(e,t,r)}class eB extends Error{cause;code;error;status;error_description;response;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=tE,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),Error.captureStackTrace?.(this,this.constructor)}}class e$ extends Error{cause;code;error;error_description;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=tA,this.cause=t.cause,this.error=t.cause.get("error"),this.error_description=t.cause.get("error_description")??void 0,Error.captureStackTrace?.(this,this.constructor)}}class ez extends Error{cause;code;response;status;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=tv,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),Error.captureStackTrace?.(this,this.constructor)}}let eJ="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",eG="[a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2}",eX="("+eJ+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',eV="("+eJ+")\\s*=\\s*("+eJ+")",eY=RegExp("^[,\\s]*("+eJ+")"),eZ=RegExp("^[,\\s]*"+eX+"[,\\s]*(.*)"),eQ=RegExp("^[,\\s]*"+eV+"[,\\s]*(.*)"),e0=RegExp("^("+eG+")(?:$|[,\\s])(.*)");function e1(e){if(!I(e,Response))throw U('"response" must be an instance of Response',D);let t=e.headers.get("www-authenticate");if(null===t)return;let r=[],n=t;for(;n;){let e,t=n.match(eY),i=t?.["1"].toLowerCase();if(!i)return;let o=n.substring(t[0].length);if(o&&!o.match(/^[\s,]/))return;let a=o.match(/^\s+(.*)$/),s=!!a;n=a?a[1]:void 0;let c={};if(s)for(;n;){let r,i;
12if(t=n.match(eZ)){if([,r,i,n]=t,i.includes("\\"))try{i=JSON.parse(`"${i}"`)}catch{}c[r.toLowerCase()]=i;continue}if(t=n.match(eQ)){[,r,i,n]=t,c[r.toLowerCase()]=i;continue}if(t=n.match(e0)){if(Object.keys(c).length)break;[,e,n]=t;break}return}else n=o||void 0;let u={scheme:i,parameters:c};e&&(u.token68=e),r.push(u)}if(r.length)return r}async function e2(e,t,r){if(eT(e),eR(t),!I(r,Response))throw U('"response" must be an instance of Response',D);await e3(r,201,"Pushed Authorization Request Endpoint"),tL(r);let n=await tZ(r);eu(n.request_uri,'"response" body "request_uri" property',tP,{body:n});let i="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return ec(i,!0,'"response" body "expires_in" property',tP,{body:n}),n.expires_in=i,n}async function e6(e){if(e.status>399&&e.status<500){tL(e),ed(e);try{let t=await e.clone().json();if(ee(t)&&"string"==typeof t.error&&t.error.length)return t}catch{}}}async function e3(e,t,r){if(e.status!==t){let t;if(ta(e),t=await e6(e))throw await e.body?.cancel(),new eB("server responded with an error in the response body",{cause:t,response:e});throw X(`"response" is not a conform ${r} response (unexpected HTTP status code)`,tR,e)}}function e4(e){if(!tl.has(e))throw U('"options.DPoP" is not a valid DPoPHandle',N)}async function e5(e,t,r,n,i,o){if(eu(e,'"accessToken"'),!(r instanceof URL))throw U('"url" must be an instance of URL',D);eM(r,o?.[M]!==!0),n=et(n),o?.DPoP&&(e4(o.DPoP),await o.DPoP.addProof(r,n,t.toUpperCase(),e)),n.set("authorization",`${n.has("dpop")?"DPoP":"Bearer"} ${e}`);let a=await (o?.[W]||fetch)(r.href,{duplex:I(i,ReadableStream)?"half":void 0,body:i,headers:Object.fromEntries(n.entries()),method:t,redirect:"manual",signal:er(r,o?.signal)});return o?.DPoP?.cacheNonce(a,r),a}async function e8(e,t,r,n,i,o){let a=await e5(e,t,r,n,i,o);return ta(a),a}function e9(e){return e.headers.get("content-type")?.split(";")[0]}async function e7(e,t,r,n,i,o,a){return await r(e,t,i,o),o.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),(a?.[W]||fetch)(n.href,{body:i,headers:Object.fromEntries(o.entries()),method:"POST",redirect:"manual",signal:er(n,a?.signal)})}async function te(e,t,r,n,i,o){let a=eH(e,"token_endpoint",t.use_mtls_endpoint_aliases,o?.[M]!==!0);i.set("grant_type",n);let s=et(o?.headers);s.set("accept","application/json"),o?.DPoP!==void 0&&(e4(o.DPoP),await o.DPoP.addProof(a,s,"POST"));let c=await e7(e,t,r,a,i,s,o);return o?.DPoP?.cacheNonce(c,a),c}async function tt(e,t,r,n,i){eT(e),eR(t),eu(n,'"refreshToken"');let o=new URLSearchParams(i?.additionalParameters);return o.set("refresh_token",n),te(e,t,r,"refresh_token",o,i)}Symbol();let tr=new WeakMap,tn=new WeakMap;function ti(e){if(!e.id_token)return;let t=tr.get(e);if(!t)throw U('"ref" was already garbage collected or did not resolve from the proper sources',N);return t}async function to(e,t,r,n,i,o){if(eT(e),eR(t),!I(r,Response))throw U('"response" must be an instance of Response',D);await e3(r,200,"Token Endpoint"),tL(r);let a=await tZ(r);if(eu(a.access_token,'"response" body "access_token" property',tP,{body:a}),eu(a.token_type,'"response" body "token_type" property',tP,{body:a}),a.token_type=a.token_type.toLowerCase(),void 0!==a.expires_in){let e="number"!=typeof a.expires_in?parseFloat(a.expires_in):a.expires_in;ec(e,!0,'"response" body "expires_in" property',tP,{body:a}),a.expires_in=e}if(void 0!==a.refresh_token&&eu(a.refresh_token,'"response" body "refresh_token" property',tP,{body:a}),void 0!==a.scope&&"string"!=typeof a.scope)throw X('"response" body "scope" property must be a string',tP,{body:a});if(void 0!==a.id_token){eu(a.id_token,'"response" body "id_token" property',tP,{body:a});let o=["aud","exp","iat","iss","sub"];!0===t.require_auth_time&&o.push("auth_time"),void 0!==t.default_max_age&&(ec(t.default_max_age,!0,'"client.default_max_age"'),o.push("auth_time")),n?.length&&o.push(...n);let{claims:s,jwt:c}=await tF(a.id_token,tq.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),eA(t),ek(t),i).then(ty.bind(void 0,o)).then(tu.bind(void 0,e)).then(tc.bind(void 0,t.client_id));if(Array.isArray(s.aud)&&1!==s.aud.length){if(void 0===s.azp)throw X('ID Token "aud" (audience) claim includes additional untrusted audiences',tj,{claims:s,claim:"aud"});if(s.azp!==t.client_id)throw X('unexpected ID Token "azp" (authorized party) claim value',tj,{expected:t.client_id,claims:s,claim:"azp"})}void 0!==s.auth_time&&ec(s.auth_time,!0,'ID Token "auth_time" (authentication time)',tP,{claims:s}),tn.set(r,c),tr.set(a,s)}
12if(o?.[a.token_type]!==void 0)o[a.token_type](r,a);else if("dpop"!==a.token_type&&"bearer"!==a.token_type)throw new J("unsupported `token_type` value",{cause:{body:a}});return a}function ta(e){let t;if(t=e1(e))throw new ez("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:t,response:e})}async function ts(e,t,r,n){return to(e,t,r,void 0,n?.[F],n?.recognizedTokenTypes)}function tc(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw X('unexpected JWT "aud" (audience) claim value',tj,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw X('unexpected JWT "aud" (audience) claim value',tj,{expected:e,claims:t.claims,claim:"aud"});return t}function tu(e,t){let r=e[t0]?.(t)??e.issuer;if(t.claims.iss!==r)throw X('unexpected JWT "iss" (issuer) claim value',tj,{expected:r,claims:t.claims,claim:"iss"});return t}let tl=new WeakSet;function td(e){return tl.add(e),e}let th=Symbol();async function tp(e,t,r,n,i,o,a){if(eT(e),eR(t),!tl.has(n))throw U('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',N);eu(i,'"redirectUri"');let s=tB(n,"code");if(!s)throw X('no authorization code in "callbackParameters"',tP);let c=new URLSearchParams(a?.additionalParameters);return c.set("redirect_uri",i),c.set("code",s),o!==th&&(eu(o,'"codeVerifier"'),c.set("code_verifier",o)),te(e,t,r,"authorization_code",c,a)}let tf={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 ty(e,t){for(let r of e)if(void 0===t.claims[r])throw X(`JWT "${r}" (${tf[r]}) claim missing`,tP,{claims:t.claims});return t}let tm=Symbol(),tg=Symbol();async function tb(e,t,r,n){return"string"==typeof n?.expectedNonce||"number"==typeof n?.maxAge||n?.requireIdToken?tw(e,t,r,n.expectedNonce,n.maxAge,n[F],n.recognizedTokenTypes):t_(e,t,r,n?.[F],n?.recognizedTokenTypes)}async function tw(e,t,r,n,i,o,a){let s=[];switch(n){case void 0:n=tm;break;case tm:break;default:eu(n,'"expectedNonce" argument'),s.push("nonce")}switch(i??=t.default_max_age){case void 0:i=tg;break;case tg:break;default:ec(i,!0,'"maxAge" argument'),s.push("auth_time")}let c=await to(e,t,r,s,o,a);eu(c.id_token,'"response" body "id_token" property',tP,{body:c});let u=ti(c);if(i!==tg){let e=eP()+eA(t),r=ek(t);if(u.auth_time+i<e-r)throw X("too much time has elapsed since the last End-User authentication",tC,{claims:u,now:e,tolerance:r,claim:"auth_time"})}if(n===tm){if(void 0!==u.nonce)throw X('unexpected ID Token "nonce" claim value',tj,{expected:void 0,claims:u,claim:"nonce"})}else if(u.nonce!==n)throw X('unexpected ID Token "nonce" claim value',tj,{expected:n,claims:u,claim:"nonce"});return c}async function t_(e,t,r,n,i){let o=await to(e,t,r,void 0,n,i),a=ti(o);if(a){if(void 0!==t.default_max_age){ec(t.default_max_age,!0,'"client.default_max_age"');let e=eP()+eA(t),r=ek(t);if(a.auth_time+t.default_max_age<e-r)throw X("too much time has elapsed since the last End-User authentication",tC,{claims:a,now:e,tolerance:r,claim:"auth_time"})}if(void 0!==a.nonce)throw X('unexpected ID Token "nonce" claim value',tj,{expected:void 0,claims:a,claim:"nonce"})}return o}let tv="OAUTH_WWW_AUTHENTICATE_CHALLENGE",tE="OAUTH_RESPONSE_BODY_ERROR",tS="OAUTH_UNSUPPORTED_OPERATION",tA="OAUTH_AUTHORIZATION_RESPONSE_ERROR",tk="OAUTH_PARSE_ERROR",tP="OAUTH_INVALID_RESPONSE",tT="OAUTH_RESPONSE_IS_NOT_JSON",tR="OAUTH_RESPONSE_IS_NOT_CONFORM",tO="OAUTH_HTTP_REQUEST_FORBIDDEN",tx="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",tC="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",tj="OAUTH_JWT_CLAIM_COMPARISON_FAILED",tI="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",tN="OAUTH_MISSING_SERVER_METADATA",tD="OAUTH_INVALID_SERVER_METADATA";async function tU(e,t,r,n,i,o){return eT(e),eR(t),eu(n,'"grantType"'),te(e,t,r,n,new URLSearchParams(i),o)}async function tM(e,t,r,n){return to(e,t,r,void 0,n?.[F],n?.recognizedTokenTypes)}function tL(e){if(e.bodyUsed)throw U('"response" body has been used already',N)}function tH(e){let{algorithm:t}=e;if("number"!=typeof t.modulusLength||t.modulusLength<2048)throw new J(`unsupported ${t.name} modulusLength`,{cause:e})}function tW(e){let{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new J("unsupported ECDSA namedCurve",{cause:e})}}function tK(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:tW(e)};case"RSA-PSS":switch(tH(e),e.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:e.algorithm.name,saltLength:parseInt(e.algorithm.hash.name.slice(-3),10)>>3};default:throw new J("unsupported RSA-PSS hash name",{cause:e})}case"RSASSA-PKCS1-v1_5":return tH(e),e.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return e.algorithm.name}throw new J("unsupported CryptoKey algorithm name",{cause:e})}async function tF(e,t,r,n,i){let o,a,{0:s,1:c,length:u}=e.split(".");if(5===u)if(void 0!==i)e=await i(e),{0:s,1:c,length:u}=e.split(".");else throw new J("JWE decryption is not configured",{cause:e});if(3!==u)throw X("Invalid JWT",tP,e);try{o=JSON.parse($(z(s)))}catch(e){throw X("failed to parse JWT Header body as base64url encoded JSON",tk,e)}if(!ee(o))throw X("JWT Header must be a top level object",tP,e);if(t(o),void 0!==o.crit)throw new J('no JWT "crit" header parameter extensions are supported',{cause:{header:o}});try{a=JSON.parse($(z(c)))}catch(e){throw X("failed to parse JWT Payload body as base64url encoded JSON",tk,e)}if(!ee(a))throw X("JWT Payload must be a top level object",tP,e);let l=eP()+r;if(void 0!==a.exp){if("number"!=typeof a.exp)throw X('unexpected JWT "exp" (expiration time) claim type',tP,{claims:a});if(a.exp<=l-n)throw X('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',tC,{claims:a,now:l,tolerance:n,claim:"exp"})}if(void 0!==a.iat&&"number"!=typeof a.iat)throw X('unexpected JWT "iat" (issued at) claim type',tP,{claims:a});if(void 0!==a.iss&&"string"!=typeof a.iss)throw X('unexpected JWT "iss" (issuer) claim type',tP,{claims:a});if(void 0!==a.nbf){if("number"!=typeof a.nbf)throw X('unexpected JWT "nbf" (not before) claim type',tP,{claims:a});if(a.nbf>l+n)throw X('unexpected JWT "nbf" (not before) claim value',tC,{claims:a,now:l,tolerance:n,claim:"nbf"})}if(void 0!==a.aud&&"string"!=typeof a.aud&&!Array.isArray(a.aud))throw X('unexpected JWT "aud" (audience) claim type',tP,{claims:a});return{header:o,claims:a,jwt:e}}function tq(e,t,r,n){if(void 0!==e){if("string"==typeof e?n.alg!==e:!e.includes(n.alg))throw X('unexpected JWT "alg" header parameter',tP,{header:n,expected:e,reason:"client configuration"});return}if(Array.isArray(t)){if(!t.includes(n.alg))throw X('unexpected JWT "alg" header parameter',tP,{header:n,expected:t,reason:"authorization server metadata"});return}if(void 0!==r){if("string"==typeof r?n.alg!==r:"function"==typeof r?!r(n.alg):!r.includes(n.alg))throw X('unexpected JWT "alg" header parameter',tP,{header:n,expected:r,reason:"default value"});return}throw X('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:r})}function tB(e,t){let{0:r,length:n}=e.getAll(t);if(n>1)throw X(`"${t}" parameter must be provided only once`,tP);return r}let t$=Symbol(),tz=Symbol();function tJ(e,t,r,n){if(eT(e),eR(t),r instanceof URL&&(r=r.searchParams),!(r instanceof URLSearchParams))throw U('"parameters" must be an instance of URLSearchParams, or URL',D);if(tB(r,"response"))throw X('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',tP,{parameters:r});let i=tB(r,"iss"),o=tB(r,"state");if(!i&&e.authorization_response_iss_parameter_supported)throw X('response parameter "iss" (issuer) missing',tP,{parameters:r});if(i&&i!==e.issuer)throw X('unexpected "iss" (issuer) response parameter value',tP,{expected:e.issuer,parameters:r});switch(n){case void 0:case tz:if(void 0!==o)throw X('unexpected "state" response parameter encountered',tP,{expected:void 0,parameters:r});break;case t$:break;default:if(eu(n,'"expectedState" argument'),o!==n)throw X(void 0===o?'response parameter "state" missing':'unexpected "state" response parameter value',tP,{expected:n,parameters:r})}if(tB(r,"error"))throw new e$("authorization response from the server is an error",{cause:r});let a=tB(r,"id_token"),s=tB(r,"token");if(void 0!==a||void 0!==s)throw new J("implicit and hybrid flows are not supported");return td(new URLSearchParams(r))}async function tG(e,t,r,n,i){eT(e),eR(t);let o=eH(e,"backchannel_authentication_endpoint",t.use_mtls_endpoint_aliases,i?.[M]!==!0),a=new URLSearchParams(n);a.set("client_id",t.client_id);let s=et(i?.headers);return s.set("accept","application/json"),e7(e,t,r,o,a,s,i)}async function tX(e,t,r){if(eT(e),eR(t),!I(r,Response))throw U('"response" must be an instance of Response',D);
12await e3(r,200,"Backchannel Authentication Endpoint"),tL(r);let n=await tZ(r);eu(n.auth_req_id,'"response" body "auth_req_id" property',tP,{body:n});let i="number"!=typeof n.expires_in?parseFloat(n.expires_in):n.expires_in;return ec(i,!0,'"response" body "expires_in" property',tP,{body:n}),n.expires_in=i,void 0!==n.interval&&ec(n.interval,!1,'"response" body "interval" property',tP,{body:n}),n}async function tV(e,t,r,n,i){eT(e),eR(t),eu(n,'"authReqId"');let o=new URLSearchParams(i?.additionalParameters);return o.set("auth_req_id",n),te(e,t,r,"urn:openid:params:grant-type:ciba",o,i)}async function tY(e,t,r,n){return to(e,t,r,void 0,n?.[F],n?.recognizedTokenTypes)}async function tZ(e,t=ed){let r;try{r=await e.json()}catch(r){throw t(e),X('failed to parse "response" body as JSON',tk,r)}if(!ee(r))throw X('"response" body must be a top level object',tP,{body:r});return r}let tQ=Symbol(),t0=Symbol();var t1=r(37811);function t2(){return"string"==typeof globalThis.EdgeRuntime}let t6=async e=>{let t=e?.delay??100,r=e?.jitter??!0,n=t;r&&(n=t*(.5+.5*Math.random())),await new Promise(e=>setTimeout(e,n))};async function t3(e,t){if(!t?.isDPoPEnabled)return await e();try{let r=await e();if(r instanceof Response&&400===r.status)try{let n=await r.clone().json();if("use_dpop_nonce"===n.error)return await t6(t),await e()}catch{}return r}catch(r){if(eF(r))return await t6(t),await e();throw r}}function t4(e,t){if(t2())return!0;try{let r="test-data-for-key-pair-validation",n=(0,j.createSign)("sha256");n.update(r);let i=n.sign(e),o=(0,j.createVerify)("sha256");if(o.update(r),!o.verify(t,i))return console.warn("WARNING: Private and public keys do not form a valid key pair - signature verification failed. Please ensure the keys are properly paired and in the correct format. DPoP will be disabled and bearer authentication will be used instead."),!1;return!0}catch(e){return console.warn(`WARNING: Failed to validate key pair compatibility. This may indicate invalid key format, mismatched algorithms, or corrupted key data. DPoP will be disabled and bearer authentication will be used instead. Error: ${e instanceof Error?e.message:String(e)}`),!1}}function t5(e){let t=e.useDPoP||!1;if(!t)return{dpopKeyPair:void 0,dpopOptions:void 0};let r=e.dpopOptions?.clockTolerance??(t1.env.AUTH0_DPOP_CLOCK_TOLERANCE?parseInt(t1.env.AUTH0_DPOP_CLOCK_TOLERANCE,10):T);if(r>R){let e=t1.env.AUTH0_DPOP_CLOCK_TOLERANCE_MAX_PROD?parseInt(t1.env.AUTH0_DPOP_CLOCK_TOLERANCE_MAX_PROD,10):R;if(r>e)throw Error(`clockTolerance of ${r}s exceeds maximum allowed ${e}s in production. This could significantly weaken DPoP replay attack protection. Set AUTH0_DPOP_CLOCK_TOLERANCE_MAX_PROD environment variable to override this limit in production.`);console.warn(`WARNING: clockTolerance of ${r}s exceeds recommended maximum of ${R}s. This may weaken DPoP security by allowing replay attacks within a wider time window. Consider synchronizing server clocks using NTP instead of increasing tolerance.`)}let n={clockSkew:e.dpopOptions?.clockSkew??(t1.env.AUTH0_DPOP_CLOCK_SKEW?parseInt(t1.env.AUTH0_DPOP_CLOCK_SKEW,10):P),clockTolerance:r,retry:{delay:e.dpopOptions?.retry?.delay??(t1.env.AUTH0_RETRY_DELAY?parseInt(t1.env.AUTH0_RETRY_DELAY,10):O),jitter:e.dpopOptions?.retry?.jitter??(t1.env.AUTH0_RETRY_JITTER?"true"===t1.env.AUTH0_RETRY_JITTER:x)}};if(n.retry&&"number"==typeof n.retry.delay&&n.retry.delay<0)throw Error("Retry delay must be non-negative");if(e.dpopKeyPair)return{dpopKeyPair:e.dpopKeyPair,dpopOptions:n};if(t){let e=t1.env.AUTH0_DPOP_PRIVATE_KEY,t=t1.env.AUTH0_DPOP_PUBLIC_KEY;if(t2()&&(e||t))return console.warn("WARNING: Running in Edge Runtime environment. DPoP keypair loading from environment variables is not supported due to limited Node.js crypto API access. DPoP has been disabled. To use DPoP in Edge Runtime, provide a pre-generated keypair via the dpopKeyPair option."),{dpopKeyPair:void 0,dpopOptions:void 0};if(e&&t)try{let r=(0,j.createPrivateKey)(e),i=(0,j.createPublicKey)(t);if("ec"!==r.asymmetricKeyType)throw Error(`DPoP private key must be an Elliptic Curve key for ES256 algorithm, got: ${r.asymmetricKeyType}`);if("ec"!==i.asymmetricKeyType)throw Error(`DPoP public key must be an Elliptic Curve key for ES256 algorithm, got: ${i.asymmetricKeyType}`);let o=r.asymmetricKeyDetails,a=i.asymmetricKeyDetails;if(o?.namedCurve!=="prime256v1")throw Error(`DPoP private key must use P-256 curve (prime256v1) for ES256 algorithm, got: ${o?.namedCurve}`);if(a?.namedCurve!=="prime256v1")throw Error(`DPoP public key must use P-256 curve (prime256v1) for ES256 algorithm, got: ${a?.namedCurve}`);
12if(!t4(r,i))return console.warn("WARNING: DPoP key pair validation failed. DPoP has been completely disabled. Falling back to bearer authentication. Please verify your key pair configuration."),{dpopKeyPair:void 0,dpopOptions:void 0};let s=r.toCryptoKey("ES256",!1,["sign"]),c=i.toCryptoKey("ES256",!1,["verify"]);return{dpopKeyPair:{privateKey:s,publicKey:c},dpopOptions:n}}catch(e){console.warn(`WARNING: Failed to load DPoP keypair from environment variables. Please ensure AUTH0_DPOP_PUBLIC_KEY and AUTH0_DPOP_PRIVATE_KEY contain valid ES256 keys in PEM format. Error: ${e instanceof Error?e.message:String(e)}`)}e&&t||console.warn("WARNING: useDPoP is set to true but dpopKeyPair is not provided. DPoP will not be used and protected requests will use bearer authentication instead. To enable DPoP, provide a dpopKeyPair in the Auth0Client options or set AUTH0_DPOP_PUBLIC_KEY and AUTH0_DPOP_PRIVATE_KEY environment variables.")}return{dpopKeyPair:void 0,dpopOptions:n}}let t8=e=>e instanceof Request||e.headers instanceof Headers||"boolean"==typeof e.bodyUsed;function t9(e){if(!e.scope)return k;
12if("object"==typeof e.scope&&!t7(e.scope,e.audience)){let t=e.audience;return{...e.scope,[t]:k}}return e.scope}function t7(e,t){if(e){if("string"==typeof e)return e;if(!t)throw new A.AJ("When defining scope as a Map, an audience is required to look up the correct scope.");return e[t]}}function re(e,t){return{accessToken:e.accessToken,expiresAt:e.expiresAt,audience:t.audience,scope:e.scope,requestedScope:e.requestedScope,...e.token_type&&{token_type:e.token_type}}}function rt(e,t){return{...t,accessToken:e?.accessToken,expiresAt:e?.expiresAt,scope:e?.scope,requestedScope:e?.requestedScope,audience:e?.audience,...e?.token_type&&{token_type:e.token_type}}}function rr(e){return e?e.trim().split(" ").filter(Boolean):[]}let rn=(e,t,r={})=>{if(e===t)return!0;if(!e||!t)return!1;let n=new Set(rr(e)),i=new Set(rr(t)),o=Array.from(i).every(e=>n.has(e));return r.strict?o&&n.size===i.size:o};function ri(e,t){return Array.from(new Set([...e?rr(e):[],...t?rr(t):[]])).join(" ")}function ro(e,t){let r=t.matchMode??"requestedScope",n=e?.accessTokens;if(!n||0===n.length)return;let i=n.filter(e=>e.audience===t.audience&&rn("scope"===r?e.scope:e.requestedScope??e.scope,t.scope,{strict:"scope"===r}));if(0!==i.length)return i.sort((e,t)=>{let r=new Set(rr(e.scope)),n=new Set(rr(t.scope));return r.size-n.size}),i[0]}function ra(e,t,r,n){let i=!e.audience||e.audience===(t.tokenSet.audience??n.audience),o=!e.requestedScope||rn(t.tokenSet.requestedScope??r,e.requestedScope);return i&&o}function rs(e,t){if(e.accessToken!==t.tokenSet.accessToken||e.expiresAt!==t.tokenSet.expiresAt||e.refreshToken!==t.tokenSet.refreshToken)return{tokenSet:e}}function rc(e,t,r,n){return{accessTokens:e.accessTokens?.map(e=>e===r?re({...t,requestedScope:ri(e.requestedScope,t.requestedScope),scope:t.scope},{audience:n}):e)}}function ru(e,t,r){return{accessTokens:[...e.accessTokens||[],re(t,{audience:r})]}}function rl(e,t,r,n){if(t.accessToken!==r.accessToken)return{accessTokens:e.accessTokens?.map(e=>e===r?re(t,{audience:n}):e)}}function rd(e,t,r,n){let i=ro(e,{scope:n,audience:r,matchMode:"requestedScope"});if(i){let n=rl(e,t,i,r);return rh(e,t,n)}if(i=ro(e,{scope:t.scope,audience:r,matchMode:"scope"})){let n=rc(e,t,i,r);return rh(e,t,n)}{let n=ru(e,t,r);return rh(e,t,n)}}function rh(e,t,r){if(r)return{accessTokens:r.accessTokens,tokenSet:{...e.tokenSet,idToken:t.idToken,refreshToken:t.refreshToken}}}function rp(e,t,r){let n=t7(r.scope,t.audience??r.audience);if(ra(t,e,n,r))return rs(t,e);let i=t.audience??r.audience,o=t.requestedScope??n??void 0;if(i)return rd(e,t,i,o)}function rf(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}let ry=(e,...t)=>rf("Key must be ",e,...t),rm=(e,t,...r)=>rf(`Key for the ${e} algorithm must be `,t,...r),rg=new TextEncoder,rb=new TextDecoder,rw=0x100000000;function r_(...e){let t=new Uint8Array(e.reduce((e,{length:t})=>e+t,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}function rv(e,t,r){if(t<0||t>=rw)throw RangeError(`value must be >= 0 and <= ${rw-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function rE(e){let t=Math.floor(e/rw),r=e%rw,n=new Uint8Array(8);return rv(n,t,0),rv(n,r,4),n}function rS(e){let t=new Uint8Array(4);return rv(t,e),t}function rA(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function rk(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,r=[];for(let n=0;n<e.length;n+=t)r.push(String.fromCharCode.apply(null,e.subarray(n,n+t)));return btoa(r.join(""))}function rP(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function rT(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:rb.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=rb.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return rP(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function rR(e){let t=e;return("string"==typeof t&&(t=rg.encode(t)),Uint8Array.prototype.toBase64)?t.toBase64({alphabet:"base64url",omitPadding:!0}):rk(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function rO(e){if(!rx(e))throw Error("CryptoKey instance expected")}let rx=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},rC=e=>e?.[Symbol.toStringTag]==="KeyObject",rj=e=>rx(e)||rC(e);async function rI(e){if(rC(e))if("secret"!==e.type)return e.export({format:"jwk"});
12else e=e.export();if(e instanceof Uint8Array)return{kty:"oct",k:rR(e)};if(!rx(e))throw TypeError(ry(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw TypeError("non-extractable CryptoKey cannot be exported as a JWK");let{ext:t,key_ops:r,alg:n,use:i,...o}=await crypto.subtle.exportKey("jwk",e);return"AKP"===o.kty&&(o.alg=n),o}async function rN(e){return rI(e)}async function rD(e,t){let r=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(r,t))}class rU extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class rM extends rU{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class rL extends rU{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(e,t,r="unspecified",n="unspecified"){super(e,{cause:{claim:r,reason:n,payload:t}}),this.claim=r,this.reason=n,this.payload=t}}class rH extends rU{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class rW extends rU{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class rK extends rU{static code="ERR_JWE_DECRYPTION_FAILED";code="ERR_JWE_DECRYPTION_FAILED";constructor(e="decryption operation failed",t){super(e,t)}}class rF extends rU{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}class rq extends rU{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class rB extends rU{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class r$ extends rU{static code="ERR_JWK_INVALID";code="ERR_JWK_INVALID"}class rz extends rU{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"}class rJ extends rU{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t)}}class rG extends rU{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t)}}class rX extends rU{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(e="request timed out",t){super(e,t)}}class rV extends rU{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(e="signature verification failed",t){super(e,t)}}let rY=e=>"object"==typeof e&&null!==e;function rZ(e){if(!rY(e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let rQ=e=>rZ(e)&&"string"==typeof e.kty,r0=e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d),r1=e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv,r2=e=>"oct"===e.kty&&"string"==typeof e.k,r6=(e,t)=>{if("string"!=typeof e||!e)throw new r$(`${t} missing or invalid`)};async function r3(e,t){let r,n;if(rQ(e))r=e;else if(rj(e))r=await rN(e);else throw TypeError(ry(e,"CryptoKey","KeyObject","JSON Web Key"));if("sha256"!==(t??="sha256")&&"sha384"!==t&&"sha512"!==t)throw TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');switch(r.kty){case"AKP":r6(r.alg,'"alg" (Algorithm) Parameter'),r6(r.pub,'"pub" (Public key) Parameter'),n={alg:r.alg,kty:r.kty,pub:r.pub};break;case"EC":r6(r.crv,'"crv" (Curve) Parameter'),r6(r.x,'"x" (X Coordinate) Parameter'),r6(r.y,'"y" (Y Coordinate) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":r6(r.crv,'"crv" (Subtype of Key Pair) Parameter'),r6(r.x,'"x" (Public Key) Parameter'),n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":r6(r.e,'"e" (Exponent) Parameter'),r6(r.n,'"n" (Modulus) Parameter'),n={e:r.e,kty:r.kty,n:r.n};break;case"oct":r6(r.k,'"k" (Key Value) Parameter'),n={k:r.k,kty:r.kty};break;default:throw new rW('"kty" (Key Type) Parameter missing or unsupported')}let i=rA(JSON.stringify(n));return rR(await rD(t,i))}let r4=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},r5=e=>({data:e,pos:0}),r8=e=>{let t=e.data[e.pos++];if(128&t){let r=127&t,n=0;for(let t=0;t<r;t++)n=n<<8|e.data[e.pos++];return n}return t},r9=(e,t,r)=>{if(e.data[e.pos++]!==t)throw Error(r)},r7=(e,t)=>{let r=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,r},ne=e=>{r9(e,6,"Expected algorithm OID");let t=r8(e);return r7(e,t)};function nt(e){r9(e,48,"Invalid PKCS#8 structure"),r8(e),r9(e,2,"Expected version field");let t=r8(e);e.pos+=t,r9(e,48,"Expected algorithm identifier");let r=r8(e);return{algIdStart:e.pos,algIdLength:r}}let nr=e=>{let t=ne(e);if(r4(t,[43,101,110]))return"X25519";if(!r4(t,[42,134,72,206,61,2,1]))throw Error("Unsupported key algorithm");r9(e,6,"Expected curve OID");let r=r8(e),n=r7(e,r);for(let{name:e,oid:t}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(r4(n,t))return e;throw Error("Unsupported named curve")},nn=async(e,t,r,n)=>{let i,o,a="spki"===e,s=()=>a?["verify"]:["sign"],c=()=>a?["encrypt","wrapKey"]:["decrypt","unwrapKey"];switch(r){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},o=s();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},o=s();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},o=c();break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:({ES256:"P-256",ES384:"P-384",ES512:"P-521"})[r]},o=s();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{let e=n.getNamedCurve(t);i="X25519"===e?{name:"X25519"}:{name:"ECDH",namedCurve:e}}catch(e){throw new rW("Invalid or unsupported key format")}o=a?[]:["deriveBits"];break;
12case"Ed25519":case"EdDSA":i={name:"Ed25519"},o=s();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:r},o=s();break;default:throw new rW('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,n?.extractable??!!a,o)},ni=(e,t)=>rP(e.replace(t,"")),no=(e,t,r)=>{let n=ni(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g),i=r;return t?.startsWith?.("ECDH-ES")&&((i||={}).getNamedCurve=e=>{let t=r5(e);return nt(t),nr(t)}),nn("pkcs8",n,t,i)};function na(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new rW('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new rW('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new rW('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;
12case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new rW('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new rW('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}async function ns(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=na(e),n={...e};return"AKP"!==n.kty&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,t,e.ext??(!e.d&&!e.priv),e.key_ops??r)}async function nc(e,t,r){if("string"!=typeof e||0!==e.indexOf("-----BEGIN PRIVATE KEY-----"))throw TypeError('"pkcs8" must be PKCS#8 formatted string');return no(e,t,r)}async function nu(e,t,r){let n;if(!rZ(e))throw TypeError("JWK must be an object");switch(t??=e.alg,n??=r?.extractable??e.ext,e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw TypeError('missing "k" (Key Value) Parameter value');return rT(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new rW('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return ns({...e,alg:t,ext:n});case"AKP":if("string"!=typeof e.alg||!e.alg)throw TypeError('missing "alg" (Algorithm) Parameter value');if(void 0!==t&&t!==e.alg)throw TypeError("JWK alg and alg option value mismatch");return ns({...e,ext:n});case"EC":case"OKP":return ns({...e,alg:t,ext:n});default:throw new rW('Unsupported "kty" (Key Type) Parameter value')}}function nl(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new rW('Unsupported "alg" value for a JSON Web Key Set')}}function nd(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(nh)}function nh(e){return rZ(e)}class np{#u;#l=new WeakMap;constructor(e){if(!nd(e))throw new rz("JSON Web Key Set malformed");this.#u=structuredClone(e)}jwks(){return this.#u}async getKey(e,t){let{alg:r,kid:n}={...e,...t?.header},i=nl(r),o=this.#u.keys.filter(e=>{let t=i===e.kty;if(t&&"string"==typeof n&&(t=n===e.kid),t&&("string"==typeof e.alg||"AKP"===i)&&(t=r===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(r){case"ES256":t="P-256"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;
12case"Ed25519":case"EdDSA":t="Ed25519"===e.crv}return t}),{0:a,length:s}=o;if(0===s)throw new rJ;if(1!==s){let e=new rG,t=this.#l;throw e[Symbol.asyncIterator]=async function*(){for(let e of o)try{yield await nf(t,e,r)}catch{}},e}return nf(this.#l,a,r)}}async function nf(e,t,r){let n=e.get(t)||e.set(t,{}).get(t);if(void 0===n[r]){let e=await nu({...t,ext:!0},r);if(e instanceof Uint8Array||"public"!==e.type)throw new rz("JSON Web Key Set members must be public keys");n[r]=e}return n[r]}function ny(e){let t=new np(e),r=async(e,r)=>t.getKey(e,r);return Object.defineProperties(r,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),r}function nm(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}if("undefined"==typeof navigator||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){let e="jose",t="v6.1.3";s=`${e}/${t}`}let ng=Symbol();async function nb(e,t,r,n=fetch){let i=await n(e,{method:"GET",signal:r,redirect:"manual",headers:t}).catch(e=>{if("TimeoutError"===e.name)throw new rX;throw e});if(200!==i.status)throw new rU("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new rU("Failed to parse the JSON Web Key Set HTTP response as JSON")}}let nw=Symbol();function n_(e,t){return!("object"!=typeof e||null===e||!("uat"in e)||"number"!=typeof e.uat||Date.now()-e.uat>=t)&&"jwks"in e&&!!rZ(e.jwks)&&!!Array.isArray(e.jwks.keys)&&!!Array.prototype.every.call(e.jwks.keys,rZ)}class nv{#d;#h;#p;#f;#y;#m;#g;#b;#w;#_;constructor(e,t){if(!(e instanceof URL))throw TypeError("url must be an instance of URL");this.#d=new URL(e.href),this.#h="number"==typeof t?.timeoutDuration?t?.timeoutDuration:5e3,this.#p="number"==typeof t?.cooldownDuration?t?.cooldownDuration:3e4,this.#f="number"==typeof t?.cacheMaxAge?t?.cacheMaxAge:6e5,this.#g=new Headers(t?.headers),s&&!this.#g.has("User-Agent")&&this.#g.set("User-Agent",s),this.#g.has("accept")||(this.#g.set("accept","application/json"),this.#g.append("accept","application/jwk-set+json")),this.#b=t?.[ng],t?.[nw]!==void 0&&(this.#_=t?.[nw],n_(t?.[nw],this.#f)&&(this.#y=this.#_.uat,this.#w=ny(this.#_.jwks)))}pendingFetch(){return!!this.#m}coolingDown(){return"number"==typeof this.#y&&Date.now()<this.#y+this.#p}fresh(){return"number"==typeof this.#y&&Date.now()<this.#y+this.#f}jwks(){return this.#w?.jwks()}async getKey(e,t){this.#w&&this.fresh()||await this.reload();try{return await this.#w(e,t)}catch(r){if(r instanceof rJ&&!1===this.coolingDown())return await this.reload(),this.#w(e,t);throw r}}async reload(){this.#m&&nm()&&(this.#m=void 0),this.#m||=nb(this.#d.href,this.#g,AbortSignal.timeout(this.#h),this.#b).then(e=>{this.#w=ny(e),this.#_&&(this.#_.uat=Date.now(),this.#_.jwks=e),this.#y=Date.now(),this.#m=void 0}).catch(e=>{throw this.#m=void 0,e}),await this.#m}}function nE(e,t){let r=new nv(e,t),n=async(e,t)=>r.getKey(e,t);return Object.defineProperties(n,{coolingDown:{get:()=>r.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>r.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>r.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>r.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>r.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function nS(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};
12case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new rW(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function nA(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}let nk=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`),nP=(e,t)=>e.name===t;function nT(e){return parseInt(e.name.slice(4),10)}function nR(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function nO(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function nx(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":{if(!nP(e.algorithm,"HMAC"))throw nk("HMAC");let r=parseInt(t.slice(2),10);if(nT(e.algorithm.hash)!==r)throw nk(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!nP(e.algorithm,"RSASSA-PKCS1-v1_5"))throw nk("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(nT(e.algorithm.hash)!==r)throw nk(`SHA-${r}`,"algorithm.hash");break}
12case"PS256":case"PS384":case"PS512":{if(!nP(e.algorithm,"RSA-PSS"))throw nk("RSA-PSS");let r=parseInt(t.slice(2),10);if(nT(e.algorithm.hash)!==r)throw nk(`SHA-${r}`,"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!nP(e.algorithm,"Ed25519"))throw nk("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!nP(e.algorithm,t))throw nk(t);break;case"ES256":case"ES384":case"ES512":{if(!nP(e.algorithm,"ECDSA"))throw nk("ECDSA");let r=nR(t);if(e.algorithm.namedCurve!==r)throw nk(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}nO(e,r)}function nC(e,t,r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!nP(e.algorithm,"AES-GCM"))throw nk("AES-GCM");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw nk(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!nP(e.algorithm,"AES-KW"))throw nk("AES-KW");let r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw nk(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":break;default:throw nk("ECDH or X25519")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!nP(e.algorithm,"PBKDF2"))throw nk("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!nP(e.algorithm,"RSA-OAEP"))throw nk("RSA-OAEP");let r=parseInt(t.slice(9),10)||1;if(nT(e.algorithm.hash)!==r)throw nk(`SHA-${r}`,"algorithm.hash");break}default:throw TypeError("CryptoKey does not support this operation")}nO(e,r)}async function nj(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(ry(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return nx(t,e,r),t}async function nI(e,t,r,n){let i=await nj(e,t,"verify");nA(e,i);let o=nS(e,i.algorithm);try{return await crypto.subtle.verify(o,i,r,n)}catch{return!1}}function nN(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(!t||0===t.size){t=new Set(r);continue}for(let e of r){if(t.has(e))return!1;t.add(e)}}return!0}let nD=e=>e?.[Symbol.toStringTag],nU=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let n;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):n=r;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):n=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):n="wrapKey";break;case"decrypt"===r:n=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(n&&t.key_ops?.includes?.(n)===!1)throw TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},nM=(e,t,r)=>{if(!(t instanceof Uint8Array)){if(rQ(t)){if(r2(t)&&nU(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!rj(t))throw TypeError(rm(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${nD(t)} instances for symmetric algorithms must be of type "secret"`)}},nL=(e,t,r)=>{if(rQ(t))switch(r){case"decrypt":case"sign":if(r0(t)&&nU(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(r1(t)&&nU(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!rj(t))throw TypeError(rm(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${nD(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${nD(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${nD(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${nD(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${nD(t)} instances for asymmetric algorithm encryption must be of type "public"`)}};function nH(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":nM(e,t,r);break;default:nL(e,t,r)}}function nW(e,t,r,n,i){let o;if(void 0!==i.crit&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');for(let a of(o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t,n.crit)){if(!o.has(a))throw new rW(`Extension Header Parameter "${a}" is not recognized`);if(void 0===i[a])throw new e(`Extension Header Parameter "${a}" is missing`);if(o.get(a)&&void 0===n[a])throw new e(`Extension Header Parameter "${a}" MUST be integrity protected`)}return new Set(n.crit)}function nK(e,t){if(void 0!==t&&(!Array.isArray(t)||t.some(e=>"string"!=typeof e)))throw TypeError(`"${e}
12" option must be an array of strings`);if(t)return new Set(t)}let nF=async(e,t,r,n=!1)=>{let i=(c||=new WeakMap).get(e);if(i?.[r])return i[r];let o=await ns({...t,alg:r});return n&&Object.freeze(e),i?i[r]=o:c.set(e,{[r]:o}),o},nq=(e,t)=>{let r,n=(c||=new WeakMap).get(e);if(n?.[t])return n[t];let i="public"===e.type,o=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}r=e.toCryptoKey(e.asymmetricKeyType,o,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError("given KeyObject instance cannot be used for this algorithm");r=e.toCryptoKey(e.asymmetricKeyType,o,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError("given KeyObject instance cannot be used for this algorithm");r=e.toCryptoKey(e.asymmetricKeyType,o,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let n;switch(t){case"RSA-OAEP":n="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":n="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":n="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":n="SHA-512";break;default:throw TypeError("given KeyObject instance cannot be used for this algorithm")}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:n},o,i?["encrypt"]:["decrypt"]);r=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:n},o,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let n=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!n)throw TypeError("given KeyObject instance cannot be used for this algorithm");"ES256"===t&&"P-256"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[i?"verify":"sign"])),"ES384"===t&&"P-384"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[i?"verify":"sign"])),"ES512"===t&&"P-521"===n&&(r=e.toCryptoKey({name:"ECDSA",namedCurve:n},o,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(r=e.toCryptoKey({name:"ECDH",namedCurve:n},o,i?[]:["deriveBits"]))}if(!r)throw TypeError("given KeyObject instance cannot be used for this algorithm");return n?n[t]=r:c.set(e,{[t]:r}),r};async function nB(e,t){if(e instanceof Uint8Array||rx(e))return e;if(rC(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return nq(e,t)}catch(e){if(e instanceof TypeError)throw e}let r=e.export({format:"jwk"});return nF(e,r,t)}if(rQ(e))return e.k?rT(e.k):nF(e,e,t,!0);throw Error("unreachable")}async function n$(e,t,r){let n,i;if(!rZ(e))throw new rq("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new rq('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new rq("JWS Protected Header incorrect type");if(void 0===e.payload)throw new rq("JWS Payload missing");if("string"!=typeof e.signature)throw new rq("JWS Signature missing or incorrect type");if(void 0!==e.header&&!rZ(e.header))throw new rq("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{let t=rT(e.protected);o=JSON.parse(rb.decode(t))}catch{throw new rq("JWS Protected Header is invalid")}if(!nN(o,e.header))throw new rq("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let a={...o,...e.header},s=nW(rq,new Map([["b64",!0]]),r?.crit,o,a),c=!0;if(s.has("b64")&&"boolean"!=typeof(c=o.b64))throw new rq('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=a;if("string"!=typeof u||!u)throw new rq('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=r&&nK("algorithms",r.algorithms);if(l&&!l.has(u))throw new rH('"alg" (Algorithm) Header Parameter value not allowed');if(c){if("string"!=typeof e.payload)throw new rq("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new rq("JWS Payload must be a string or an Uint8Array instance");let d=!1;"function"==typeof t&&(t=await t(o,e),d=!0),nH(u,t,"verify");let h=r_(void 0!==e.protected?rA(e.protected):new Uint8Array,rA("."),"string"==typeof e.payload?c?rA(e.payload):rg.encode(e.payload):e.payload);try{n=rT(e.signature)}catch{throw new rq("Failed to base64url decode the signature")}let p=await nB(t,u);if(!await nI(u,p,n,h))throw new rV;if(c)try{i=rT(e.payload)}catch{throw new rq("Failed to base64url decode the payload")}else i="string"==typeof e.payload?rg.encode(e.payload):e.payload;let f={payload:i};return(void 0!==e.protected&&(f.protectedHeader=o),void 0!==e.header&&(f.unprotectedHeader=e.header),d)?{...f,key:p}:f}async function nz(e,t,r){if(e instanceof Uint8Array&&(e=rb.decode(e)),"string"!=typeof e)throw new rq("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new rq("Invalid Compact JWS");let s=await n$({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}let nJ=e=>
12Math.floor(e.getTime()/1e3),nG=60,nX=3600,nV=86400,nY=604800,nZ=0x1e187e0,nQ=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function n0(e){let t,r=nQ.exec(e);if(!r||r[4]&&r[1])throw TypeError("Invalid time period format");let n=parseFloat(r[2]);switch(r[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":t=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":t=Math.round(n*nG);break;case"hour":case"hours":case"hr":case"hrs":case"h":t=Math.round(n*nX);break;case"day":case"days":case"d":t=Math.round(n*nV);break;case"week":case"weeks":case"w":t=Math.round(n*nY);break;default:t=Math.round(n*nZ)}return"-"===r[1]||"ago"===r[4]?-t:t}function n1(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}let n2=e=>e.includes("/")?e.toLowerCase():`application/${e.toLowerCase()}`,n6=(e,t)=>"string"==typeof e?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));function n3(e,t,r={}){let n,i;try{n=JSON.parse(rb.decode(t))}catch{}if(!rZ(n))throw new rB("JWT Claims Set must be a top-level JSON object");let{typ:o}=r;if(o&&("string"!=typeof e.typ||n2(e.typ)!==n2(o)))throw new rM('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:s,subject:c,audience:u,maxTokenAge:l}=r,d=[...a];for(let e of(void 0!==l&&d.push("iat"),void 0!==u&&d.push("aud"),void 0!==c&&d.push("sub"),void 0!==s&&d.push("iss"),new Set(d.reverse())))if(!(e in n))throw new rM(`missing required "${e}" claim`,n,e,"missing");if(s&&!(Array.isArray(s)?s:[s]).includes(n.iss))throw new rM('unexpected "iss" claim value',n,"iss","check_failed");if(c&&n.sub!==c)throw new rM('unexpected "sub" claim value',n,"sub","check_failed");if(u&&!n6(n.aud,"string"==typeof u?[u]:u))throw new rM('unexpected "aud" claim value',n,"aud","check_failed");switch(typeof r.clockTolerance){case"string":i=n0(r.clockTolerance);break;case"number":i=r.clockTolerance;break;case"undefined":i=0;break;default:throw TypeError("Invalid clockTolerance option type")}let{currentDate:h}=r,p=nJ(h||new Date);if((void 0!==n.iat||l)&&"number"!=typeof n.iat)throw new rM('"iat" claim must be a number',n,"iat","invalid");if(void 0!==n.nbf){if("number"!=typeof n.nbf)throw new rM('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>p+i)throw new rM('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(void 0!==n.exp){if("number"!=typeof n.exp)throw new rM('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=p-i)throw new rL('"exp" claim timestamp check failed',n,"exp","check_failed")}if(l){let e=p-n.iat;if(e-i>("number"==typeof l?l:n0(l)))throw new rL('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(e<0-i)throw new rM('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}class n4{#v;constructor(e){if(!rZ(e))throw TypeError("JWT Claims Set MUST be an object");this.#v=structuredClone(e)}data(){return rg.encode(JSON.stringify(this.#v))}get iss(){return this.#v.iss}set iss(e){this.#v.iss=e}get sub(){return this.#v.sub}
12set sub(e){this.#v.sub=e}get aud(){return this.#v.aud}set aud(e){this.#v.aud=e}set jti(e){this.#v.jti=e}set nbf(e){"number"==typeof e?this.#v.nbf=n1("setNotBefore",e):e instanceof Date?this.#v.nbf=n1("setNotBefore",nJ(e)):this.#v.nbf=nJ(new Date)+n0(e)}set exp(e){"number"==typeof e?this.#v.exp=n1("setExpirationTime",e):e instanceof Date?this.#v.exp=n1("setExpirationTime",nJ(e)):this.#v.exp=nJ(new Date)+n0(e)}set iat(e){void 0===e?this.#v.iat=nJ(new Date):e instanceof Date?this.#v.iat=n1("setIssuedAt",nJ(e)):"string"==typeof e?this.#v.iat=n1("setIssuedAt",nJ(new Date)+n0(e)):this.#v.iat=n1("setIssuedAt",e)}}async function n5(e,t,r){let n=await nz(e,t,r);if(n.protectedHeader.crit?.includes("b64")&&!1===n.protectedHeader.b64)throw new rB("JWTs MUST NOT use unencoded payload");let i={payload:n3(n.protectedHeader,n.payload,r),protectedHeader:n.protectedHeader};return"function"==typeof t?{...i,key:n.key}:i}if("undefined"==typeof navigator||!navigator.userAgent?.startsWith?.("Mozilla/5.0 ")){let e="openid-client",t="v6.8.2";u={"user-agent":`${e}/${t}`}}let n8=e=>l.get(e);function n9(e){return void 0!==e?eO(e):(d||=new WeakMap,(e,t,r,n)=>{let i;return(i=d.get(t))||(n7(t.client_secret,'"metadata.client_secret"'),i=eO(t.client_secret),d.set(t,i)),i(e,t,r,n)})}function n7(e,t){if("string"!=typeof e)throw io(`${t} must be a string`,ii);if(0===e.length)throw io(`${t} must not be empty`,ir)}function ie(){return ej()}let it=W,ir="ERR_INVALID_ARG_VALUE",ii="ERR_INVALID_ARG_TYPE";function io(e,t,r){let n=TypeError(e,{cause:r});return Object.assign(n,{code:t}),n}class ia extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=t?.code,Error.captureStackTrace?.(this,this.constructor)}}function is(e,t,r){return new ia(e,{cause:t,code:r})}function ic(e){if(e instanceof TypeError||e instanceof ia||e instanceof eB||e instanceof e$||e instanceof ez)throw e;if(e instanceof G)switch(e.code){case tO:throw is("only requests to HTTPS are allowed",e,e.code);case tx:throw is("only requests to HTTP or HTTPS are allowed",e,e.code);case tR:throw is("unexpected HTTP response status code",e.cause,e.code);case tT:throw is("unexpected response content-type",e.cause,e.code);case tk:throw is("parsing error occured",e,e.code);case tP:throw is("invalid response encountered",e,e.code);case tj:throw is("unexpected JWT claim value encountered",e,e.code);case tI:throw is("unexpected JSON attribute value encountered",e,e.code);case tC:throw is("JWT timestamp claim value failed validation",e,e.code);default:throw is(e.message,e,e.code)}if(e instanceof J)throw is("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw is("runtime operation error",e,tS);case"NotSupportedError":throw is("runtime unsupported operation",e,tS);case"TimeoutError":throw is("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw is("operation aborted",e,"OAUTH_ABORT")}throw new ia("something went wrong",{cause:e})}function iu(e){return{supportsPKCE:{__proto__:null,value:(t="S256")=>e.code_challenge_methods_supported?.includes(t)===!0}}}function il(e){Object.defineProperties(e,iu(e))}new TextDecoder;let id=Symbol();class ih{constructor(e,t,r,n){let i;if("string"!=typeof t||!t.length)throw io('"clientId" must be a non-empty string',ii);if("string"==typeof r&&(r={client_secret:r}),r?.client_id!==void 0&&t!==r.client_id)throw io('"clientId" and "metadata.client_id" must be the same',ir);let o={...structuredClone(r),client_id:t};o[L]=r?.[L]??0,o[H]=r?.[H]??30,i=n||("string"==typeof o.client_secret&&o.client_secret.length?n9(o.client_secret):ie());let a=Object.freeze(o),s=structuredClone(e);id in e&&(s[t0]=({claims:{tid:t}})=>e.issuer.replace("{tenantid}",t));let c=Object.freeze(s);(l||=new WeakMap).set(this,{__proto__:null,as:c,c:a,auth:i,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(n8(this).as);return il(e),e}clientMetadata(){return structuredClone(n8(this).c)}get timeout(){return n8(this).timeout}set timeout(e){n8(this).timeout=e}get[it](){return n8(this).fetch}set[it](e){n8(this).fetch=e}}function ip(e){let t;if(void 0!==e.expires_in){let r=new Date;r.setSeconds(r.getSeconds()+e.expires_in),t=r.getTime()}
12return{expiresIn:{__proto__:null,value(){if(t){let e=Date.now();return t>e?Math.floor((t-e)/1e3):0}}},claims:{__proto__:null,value(){try{return ti(this)}catch{return}}}}}function iy(e){Object.defineProperties(e,ip(e))}async function im(e,t,r,n=!1){let i,o=e.headers.get("retry-after")?.trim();if(void 0!==o){if(/^\d+$/.test(o))i=parseInt(o,10);else{let e=new Date(o);if(Number.isFinite(e.getTime())){let t=new Date,r=e.getTime()-t.getTime();r>0&&(i=Math.ceil(r/1e3))}}if(n&&!Number.isFinite(i))throw new G("invalid Retry-After header value",{cause:e});i>t&&await ig(i-t,r)}}function ig(e,t){return new Promise((r,n)=>{let i=e=>{try{t.throwIfAborted()}catch(e){n(e);return}if(e<=0)return void r();let o=Math.min(e,5);setTimeout(()=>i(e-o),1e3*o)};i(e)})}async function ib(e,t){iv(e);let{as:r,c:n,auth:i,fetch:o,tlsOnly:a,timeout:s}=n8(e);return tG(r,n,i,t,{[W]:o,[M]:!a,headers:new Headers(u),signal:iE(s)}).then(e=>tX(r,n,e)).catch(ic)}async function iw(e,t,r,n){let i;iv(e),r=new URLSearchParams(r);let o=t.interval??5,a=n?.signal??AbortSignal.timeout(1e3*t.expires_in);try{await ig(o,a)}catch(e){ic(e)}let{as:s,c,auth:l,fetch:d,tlsOnly:h,nonRepudiation:p,timeout:f,decrypt:y}=n8(e),m=(i,o)=>iw(e,{...t,interval:i},r,{...n,signal:a,flag:o}),g=await tV(s,c,l,t.auth_req_id,{[W]:d,[M]:!h,additionalParameters:r,DPoP:n?.DPoP,headers:new Headers(u),signal:a.aborted?a:iE(f)}).catch(ic);if(503===g.status&&g.headers.has("retry-after"))return await im(g,o,a,!0),await g.body?.cancel(),m(o);let b=tY(s,c,g,{[F]:y});try{i=await b}catch(e){if(iS(e,n))return m(o,iA);if(e instanceof eB)switch(e.error){case"slow_down":o+=5;case"authorization_pending":return await im(e.response,o,a),m(o)}ic(e)}return i.id_token&&await p?.(g),iy(i),i}function i_(e){n8(e).tlsOnly=!1}function iv(e){if(!(e instanceof ih))throw io('"config" must be an instance of Configuration',ii);if(Object.getPrototypeOf(e)!==ih.prototype)throw io("subclassing Configuration is not allowed",ir)}function iE(e){return e?AbortSignal.timeout(1e3*e):void 0}function iS(e,t){return!!t?.DPoP&&t.flag!==iA&&eF(e)}Object.freeze(ih.prototype);let iA=Symbol(),ik={rE:"4.15.0"};!function(e){e.SUBJECT_TYPE_REFRESH_TOKEN="urn:ietf:params:oauth:token-type:refresh_token",e.SUBJECT_TYPE_ACCESS_TOKEN="urn:ietf:params:oauth:token-type:access_token"}(h||(h={}));let iP="urn:ietf:params:oauth:grant-type:token-exchange";function iT(e,t,r=[]){let n=new URLSearchParams,i={...e,...t};return Object.entries(i).forEach(([e,t])=>{r&&(r.includes(e)||null==t)||("scope"===e&&"object"==typeof t&&(t=t7(t,i.audience)),t&&n.set(e,String(t)))}),n}!function(e){e.CODE="code",e.CONNECT_CODE="connect_code"}(p||(p={}));var iR=r(95287);let iO="http://auth0.com/oauth/grant-type/mfa-otp",ix="http://auth0.com/oauth/grant-type/mfa-oob",iC="http://auth0.com/oauth/grant-type/mfa-rec
12overy-code";function ij(e){return{id:e.id,authenticatorType:e.authenticator_type,type:e.type,active:e.active,name:e.name,phoneNumber:e.phone_number,oobChannel:e.oob_channel,createdAt:e.created_at,lastAuthenticatedAt:e.last_auth}}function iI(e){return{challengeType:e.challenge_type,oobCode:e.oob_code,bindingMethod:e.binding_method}}function iN(e){let t={authenticatorType:e.authenticator_type,id:e.id,recoveryCodes:e.recovery_codes};if("otp"===e.authenticator_type)return{...t,authenticatorType:"otp",secret:e.secret,barcodeUri:e.barcode_uri};if("oob"===e.authenticator_type)return{...t,authenticatorType:"oob",oobChannel:e.oob_channel,name:e.name,oobCode:e.oob_code,bindingMethod:e.binding_method,barcodeUri:e.barcode_uri};throw Error(`Unknown authenticator type: ${e.authenticator_type}`)}function iD(e,t){let r=e;if("oob"!==t)return[{authenticatorTypes:["otp"]},null];{if(!r.oobChannels||!Array.isArray(r.oobChannels))return[null,S.NextResponse.json({error:"invalid_request",error_description:"Missing or invalid oobChannels for OOB enrollment"},{status:400})];let e="string"==typeof r.phoneNumber&&""!==r.phoneNumber?r.phoneNumber:void 0,t="string"==typeof r.email&&""!==r.email?r.email:void 0;return[{authenticatorTypes:["oob"],oobChannels:r.oobChannels,phoneNumber:e,email:t},null]}}let iU=(e,t)=>{let r=new URLSearchParams;if(r.append("mfa_token",t),"otp"in e&&e.otp)r.append("otp",e.otp);else if("oobCode"in e&&"bindingCode"in e&&e.oobCode&&e.bindingCode)r.append("oob_code",e.oobCode),r.append("binding_code",e.bindingCode);else if("recoveryCode"in e&&e.recoveryCode)r.append("recovery_code",e.recoveryCode);else throw new iR.uz("invalid_request","At least one verification credential required (otp, oobCode+bindingCode, or recoveryCode)");return r},iM=e=>{if(e.has("otp"))return iO;if(e.has("oob_code")&&e.has("binding_code"))return ix;if(e.has("recovery_code"))return iC;throw new iR.uz("invalid_request","No verification credential provided")};function iL(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function iH(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function iW(e){if(!e)return;let[[t,r],...n]=iH(e),{domain:i,expires:o,httponly:a,maxage:s,path:c,samesite:u,secure:l,partitioned:d,priority:h}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));return iK({name:t,value:decodeURIComponent(r),domain:i,...o&&{expires:new Date(o)},...a&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:c,...u&&{sameSite:iq(u)},...l&&{secure:!0},...h&&{priority:i$(h)},...d&&{partitioned:!0}})}function iK(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}var iF=["strict","lax","none"];function iq(e){return e=e.toLowerCase(),iF.includes(e)?e:void 0}var iB=["low","medium","high"];function i$(e){return e=e.toLowerCase(),iB.includes(e)?e:void 0}function iz(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}function u(){return"="!==(r=e.charAt(s))&&";"!==r&&","!==r}for(;s<e.length;){for(t=s,o=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&u();)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}var iJ=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of iH(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}
12has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>iL(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>iL(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},iG=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:iz(i)){let t=iW(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,iV({name:t,value:r,...n})),iX(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(iL).join("; ")}};function iX(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=iL(r);t.append("set-cookie",e)}}function iV(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}let iY=()=>{if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw Error("unable to locate global object")},iZ=async(e,t,r,n,i)=>{let{crypto:{subtle:o}}=iY();return new Uint8Array(await o.deriveBits({name:"HKDF",hash:`SHA-${e.substr(3)}`,salt:r,info:n},await o.importKey("raw",t,"HKDF",!1,["deriveBits"]),i<<3))};function iQ(e){switch(e){case"sha256":case"sha384":case"sha512":case"sha1":return e;default:throw TypeError('unsupported "digest" value')}}function i0(e,t){if("string"==typeof e)return new TextEncoder().encode(e);if(!(e instanceof Uint8Array))throw TypeError(`"${t}"" must be an instance of Uint8Array or a string`);return e}function i1(e){let t=i0(e,"ikm");if(!t.byteLength)throw TypeError('"ikm" must be at least one byte in length');return t}function i2(e){let t=i0(e,"info");if(t.byteLength>1024)throw TypeError('"info" must not contain more than 1024 bytes');return t}function i6(e,t){if("number"!=typeof e||!Number.isInteger(e)||e<1)throw TypeError('"keylen" must be a positive integer');if(e>255*(parseInt(t.substr(3),10)>>3||20))throw TypeError('"keylen" too large');return e}async function i3(e,t,r,n,i){return iZ(iQ(e),i1(t),i0(r,"salt"),i2(n),i6(i,e))}let i4=Symbol();function i5(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new rW(`Unsupported JWE Algorithm: ${e}`)}}let i8=e=>crypto.getRandomValues(new Uint8Array(i5(e)>>3));function i9(e,t){if(t.length<<3!==i5(e))throw new rF("Invalid Initialization Vector length")}function i7(e,t){let r=e.byteLength<<3;if(r!==t)throw new rF(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)}async function oe(e,t,r,n,i){if(!(r instanceof Uint8Array))throw TypeError(ry(r,"Uint8Array"));let o=parseInt(e.slice(1,4),10),a=await crypto.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await crypto.subtle.importKey("raw",r.subarray(0,o>>3),{hash:`SHA-${o<<1}`,name:"HMAC"},!1,["sign"]),c=new Uint8Array(await crypto.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=r_(i,n,c,rE(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await crypto.subtle.sign("HMAC",s,u)).slice(0,o>>3)),iv:n}}async function ot(e,t,r,n,i){let o;r instanceof Uint8Array?o=await crypto.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(nC(r,e,"encrypt"),o=r);let a=new Uint8Array(await crypto.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s,iv:n}}async function or(e,t,r,n,i){if(!rx(r)&&!(r instanceof Uint8Array))throw TypeError(ry(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(n?i9(e,n):n=i8(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&i7(r,parseInt(e.slice(-3),10)),oe(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&i7(r,parseInt(e.slice(1,4),10)),ot(e,t,r,n,i);default:throw new rW("Unsupported JWE Content Encryption Algorithm")}}function on(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw TypeError(`Invalid key size for alg: ${t}`)}function oi(e,t,r){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"AES-KW",!0,[r]):(nC(e,t,r),e)}async function oo(e,t,r){let n=await oi(t,e,"wrapKey");on(n,e);
12let i=await crypto.subtle.importKey("raw",r,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",i,n,"AES-KW"))}async function oa(e,t,r){let n=await oi(t,e,"unwrapKey");on(n,e);let i=await crypto.subtle.unwrapKey("raw",r,n,"AES-KW",{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.exportKey("raw",i))}function os(e){return r_(rS(e.length),e)}async function oc(e,t,r){let n=t>>3,i=32,o=Math.ceil(n/32),a=new Uint8Array(32*o);for(let t=1;t<=o;t++){let n=new Uint8Array(4+e.length+r.length);n.set(rS(t),0),n.set(e,4),n.set(r,4+e.length);let o=await rD("sha256",n);a.set(o,(t-1)*i)}return a.slice(0,n)}async function ou(e,t,r,n,i=new Uint8Array,o=new Uint8Array){nC(e,"ECDH"),nC(t,"ECDH","deriveBits");let a=os(rA(r)),s=os(i),c=os(o),u=r_(a,s,c,rS(n),new Uint8Array);return oc(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,ol(e))),n,u)}function ol(e){return"X25519"===e.algorithm.name?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3}function od(e){switch(e.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return"X25519"===e.algorithm.name}}function oh(e,t){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]):(nC(e,t,"deriveBits"),e)}let op=(e,t)=>r_(rA(e),Uint8Array.of(0),t);async function of(e,t,r,n){if(!(e instanceof Uint8Array)||e.length<8)throw new rF("PBES2 Salt Input must be 8 or more octets");let i=op(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s=await oh(n,t);return new Uint8Array(await crypto.subtle.deriveBits(a,s,o))}async function oy(e,t,r,n=2048,i=crypto.getRandomValues(new Uint8Array(16))){let o=await of(i,e,n,t);return{encryptedKey:await oo(e.slice(-6),o,r),p2c:n,p2s:rR(i)}}async function om(e,t,r,n,i){let o=await of(i,e,n,t);return oa(e.slice(-6),o,r)}let og=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new rW(`alg ${e} is not supported either by JOSE or your javascript runtime`)}};async function ob(e,t,r){return nC(t,e,"encrypt"),nA(e,t),new Uint8Array(await crypto.subtle.encrypt(og(e),t,r))}async function ow(e,t,r){return nC(t,e,"decrypt"),nA(e,t),new Uint8Array(await crypto.subtle.decrypt(og(e),t,r))}function o_(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new rW(`Unsupported JWE Algorithm: ${e}`)}}let ov=e=>crypto.getRandomValues(new Uint8Array(o_(e)>>3));async function oE(e,t){if(!(e instanceof Uint8Array))throw TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw TypeError("Second argument must be a buffer");let r={name:"HMAC",hash:"SHA-256"},n=await crypto.subtle.generateKey(r,!1,["sign"]),i=new Uint8Array(await crypto.subtle.sign(r,n,e)),o=new Uint8Array(await crypto.subtle.sign(r,n,t)),a=0,s=-1;for(;++s<32;)a|=i[s]^o[s];return 0===a}async function oS(e,t,r,n,i,o){let a,s;if(!(t instanceof Uint8Array))throw TypeError(ry(t,"Uint8Array"));let c=parseInt(e.slice(1,4),10),u=await crypto.subtle.importKey("raw",t.subarray(c>>3),"AES-CBC",!1,["decrypt"]),l=await crypto.subtle.importKey("raw",t.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),d=r_(o,n,r,rE(o.length<<3)),h=new Uint8Array((await crypto.subtle.sign("HMAC",l,d)).slice(0,c>>3));try{a=await oE(i,h)}catch{}if(!a)throw new rK;try{s=new Uint8Array(await crypto.subtle.decrypt({iv:n,name:"AES-CBC"},u,r))}catch{}if(!s)throw new rK;return s}async function oA(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await crypto.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(nC(t,e,"decrypt"),a=t);try{return new Uint8Array(await crypto.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,r_(r,i)))}catch{throw new rK}}async function ok(e,t,r,n,i,o){if(!rx(t)&&!(t instanceof Uint8Array))throw TypeError(ry(t,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));if(!n)throw new rF("JWE Initialization Vector missing");if(!i)throw new rF("JWE Authentication Tag missing");switch(i9(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&i7(t,parseInt(e.slice(-3),10)),oS(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&i7(t,parseInt(e.slice(1,4),10)),oA(e,t,r,n,i,o);default:throw new rW("Unsupported JWE Content Encryption Algorithm")}}async function oP(e,t,r,n){let i=e.slice(0,7),o=await or(i,r,t,n,new Uint8Array);return{encryptedKey:o.ciphertext,iv:rR(o.iv),tag:rR(o.tag)}}async function oT(e,t,r,n,i){return ok(e.slice(0,7),t,r,n,i,new Uint8Array)}async function oR(e,t,r,n,i={}){let o,a,s;switch(e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let c;if(rO(r),!od(r))throw new rW("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu:u,apv:l}=i;c=i.epk?await nB(i.epk,e):(await crypto.subtle.generateKey(r.algorithm,!0,["deriveBits"])).privateKey;let{x:d,y:h,crv:p,kty:f}=await rN(c),y=await ou(r,c,"ECDH-ES"===e?t:e,"ECDH-ES"===e?o_(t):parseInt(e.slice(-5,-2),10),u,l);if(a={epk:{x:d,crv:p,kty:f}},"EC"===f&&(a.epk.y=h),u&&(a.apu=rR(u)),l&&(a.apv=rR(l)),"ECDH-ES"===e){s=y;break}s=n||ov(t);let m=e.slice(-6);o=await oo(m,y,s);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||ov(t),rO(r),o=await ob(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||ov(t);let{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await oy(e,r,s,c,u));break}
12case"A128KW":case"A192KW":case"A256KW":s=n||ov(t),o=await oo(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||ov(t);let{iv:c}=i;({encryptedKey:o,...a}=await oP(e,r,s,c));break}default:throw new rW('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}class oO{#E;#S;#A;#k;#P;#T;#R;#O;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("plaintext must be an instance of Uint8Array");this.#E=e}setKeyManagementParameters(e){if(this.#O)throw TypeError("setKeyManagementParameters can only be called once");return this.#O=e,this}setProtectedHeader(e){if(this.#S)throw TypeError("setProtectedHeader can only be called once");return this.#S=e,this}setSharedUnprotectedHeader(e){if(this.#A)throw TypeError("setSharedUnprotectedHeader can only be called once");return this.#A=e,this}setUnprotectedHeader(e){if(this.#k)throw TypeError("setUnprotectedHeader can only be called once");return this.#k=e,this}setAdditionalAuthenticatedData(e){return this.#P=e,this}setContentEncryptionKey(e){if(this.#T)throw TypeError("setContentEncryptionKey can only be called once");return this.#T=e,this}setInitializationVector(e){if(this.#R)throw TypeError("setInitializationVector can only be called once");return this.#R=e,this}async encrypt(e,t){let r,n,i,o,a,s;if(!this.#S&&!this.#k&&!this.#A)throw new rF("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!nN(this.#S,this.#k,this.#A))throw new rF("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let c={...this.#S,...this.#k,...this.#A};if(nW(rF,new Map,t?.crit,this.#S,c),void 0!==c.zip)throw new rW('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:u,enc:l}=c;if("string"!=typeof u||!u)throw new rF('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof l||!l)throw new rF('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');if(this.#T&&("dir"===u||"ECDH-ES"===u))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${u}`);nH("dir"===u?l:u,e,"encrypt");{let i,o=await nB(e,u);({cek:n,encryptedKey:r,parameters:i}=await oR(u,l,o,this.#T,this.#O)),i&&(t&&i4 in t?this.#k?this.#k={...this.#k,...i}:this.setUnprotectedHeader(i):this.#S?this.#S={...this.#S,...i}:this.setProtectedHeader(i))}if(this.#S?a=rA(o=rR(JSON.stringify(this.#S))):(o="",a=new Uint8Array),this.#P){let e=rA(s=rR(this.#P));i=r_(a,rA("."),e)}else i=a;let{ciphertext:d,tag:h,iv:p}=await or(l,this.#E,n,this.#R,i),f={ciphertext:rR(d)};return p&&(f.iv=rR(p)),h&&(f.tag=rR(h)),r&&(f.encrypted_key=rR(r)),s&&(f.aad=s),this.#S&&(f.protected=o),this.#A&&(f.unprotected=this.#A),this.#k&&(f.header=this.#k),f}}class ox{#x;constructor(e){this.#x=new oO(e)}setContentEncryptionKey(e){return this.#x.setContentEncryptionKey(e),this}setInitializationVector(e){return this.#x.setInitializationVector(e),this}setProtectedHeader(e){return this.#x.setProtectedHeader(e),this}setKeyManagementParameters(e){return this.#x.setKeyManagementParameters(e),this}async encrypt(e,t){let r=await this.#x.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class oC{#T;#R;#O;#S;#C;#j;#I;#N;constructor(e={}){this.#N=new n4(e)}setIssuer(e){return this.#N.iss=e,this}setSubject(e){return this.#N.sub=e,this}setAudience(e){return this.#N.aud=e,this}setJti(e){return this.#N.jti=e,this}setNotBefore(e){return this.#N.nbf=e,this}setExpirationTime(e){return this.#N.exp=e,this}setIssuedAt(e){return this.#N.iat=e,this}setProtectedHeader(e){if(this.#S)throw TypeError("setProtectedHeader can only be called once");return this.#S=e,this}setKeyManagementParameters(e){if(this.#O)throw TypeError("setKeyManagementParameters can only be called once");return this.#O=e,this}setContentEncryptionKey(e){if(this.#T)throw TypeError("setContentEncryptionKey can only be called once");return this.#T=e,this}setInitializationVector(e){if(this.#R)throw TypeError("setInitializationVector can only be called once");return this.#R=e,this}replicateIssuerAsHeader(){return this.#C=!0,this}replicateSubjectAsHeader(){return this.#j=!0,this}replicateAudienceAsHeader(){return this.#I=!0,this}async encrypt(e,t){let r=new ox(this.#N.data());return this.#S&&(this.#C||this.#j||this.#I)&&(this.#S={...this.#S,iss:this.#C?this.#N.iss:void 0,sub:this.#j?this.#N.sub:void 0,aud:this.#I?this.#N.aud:void 0}),r.setProtectedHeader(this.#S),this.#R&&r.setInitializationVector(this.#R),this.#T&&r.setContentEncryptionKey(this.#T),this.#O&&r.setKeyManagementParameters(this.#O),r.encrypt(e,t)}}async function oj(e,t,r,n,i){switch(e){case"dir":if(void 0!==r)throw new rF("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new rF("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{let i,o;if(!rZ(n.epk))throw new rF('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(rO(t),!od(t))throw new rW("ECDH with the provided key is not allowed or not supported by your javascript runtime");let a=await nu(n.epk,e);if(rO(a),void 0!==n.apu){if("string"!=typeof n.apu)throw new rF('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{i=rT(n.apu)}catch{throw new rF("Failed to base64url decode the apu")}}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new rF('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{o=rT(n.apv)}catch{throw new rF("Failed to base64url decode the apv")}}let s=await ou(a,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?o_(n.enc):parseInt(e.slice(-5,-2),10),i,o);if("ECDH-ES"===e)return s;if(void 0===r)throw new rF("JWE Encrypted Key missing");return oa(e.slice(-6),s,r)}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new rF("JWE Encrypted Key missing");return rO(t),ow(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{let o;if(void 0===r)throw new rF("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new rF('JOSE Header "p2c" (PBES2 Count) missing or invalid');let a=i?.maxPBES2Count||1e4;if(n.p2c>a)throw new rF('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new rF('JOSE Header "p2s" (PBES2 Salt) missing or invalid');try{o=rT(n.p2s)}catch{throw new rF("Failed to base64url decode the p2s")}return om(e,t,r,n.p2c,o)}
12case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new rF("JWE Encrypted Key missing");return oa(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{let i,o;if(void 0===r)throw new rF("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new rF('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new rF('JOSE Header "tag" (Authentication Tag) missing or invalid');try{i=rT(n.iv)}catch{throw new rF("Failed to base64url decode the iv")}try{o=rT(n.tag)}catch{throw new rF("Failed to base64url decode the tag")}return oT(e,t,r,i,o)}default:throw new rW('Invalid or unsupported "alg" (JWE Algorithm) header value')}}async function oI(e,t,r){let n,i,o,a,s,c,u;if(!rZ(e))throw new rF("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new rF("JOSE Header missing");if(void 0!==e.iv&&"string"!=typeof e.iv)throw new rF("JWE Initialization Vector incorrect type");if("string"!=typeof e.ciphertext)throw new rF("JWE Ciphertext missing or incorrect type");if(void 0!==e.tag&&"string"!=typeof e.tag)throw new rF("JWE Authentication Tag incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new rF("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new rF("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new rF("JWE AAD incorrect type");if(void 0!==e.header&&!rZ(e.header))throw new rF("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!rZ(e.unprotected))throw new rF("JWE Per-Recipient Unprotected Header incorrect type");if(e.protected)try{let t=rT(e.protected);n=JSON.parse(rb.decode(t))}catch{throw new rF("JWE Protected Header is invalid")}if(!nN(n,e.header,e.unprotected))throw new rF("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let l={...n,...e.header,...e.unprotected};if(nW(rF,new Map,r?.crit,n,l),void 0!==l.zip)throw new rW('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg:d,enc:h}=l;if("string"!=typeof d||!d)throw new rF("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof h||!h)throw new rF("missing JWE Encryption Algorithm (enc) in JWE Header");let p=r&&nK("keyManagementAlgorithms",r.keyManagementAlgorithms),f=r&&nK("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(p&&!p.has(d)||!p&&d.startsWith("PBES2"))throw new rH('"alg" (Algorithm) Header Parameter value not allowed');if(f&&!f.has(h))throw new rH('"enc" (Encryption Algorithm) Header Parameter value not allowed');if(void 0!==e.encrypted_key)try{i=rT(e.encrypted_key)}catch{throw new rF("Failed to base64url decode the encrypted_key")}let y=!1;"function"==typeof t&&(t=await t(n,e),y=!0),nH("dir"===d?h:d,t,"decrypt");let m=await nB(t,d);try{o=await oj(d,m,i,l,r)}catch(e){if(e instanceof TypeError||e instanceof rF||e instanceof rW)throw e;o=ov(h)}if(void 0!==e.iv)try{a=rT(e.iv)}catch{throw new rF("Failed to base64url decode the iv")}if(void 0!==e.tag)try{s=rT(e.tag)}catch{throw new rF("Failed to base64url decode the tag")}let g=void 0!==e.protected?rA(e.protected):new Uint8Array;c=void 0!==e.aad?r_(g,rA("."),rA(e.aad)):g;try{u=rT(e.ciphertext)}catch{throw new rF("Failed to base64url decode the ciphertext")}let b={plaintext:await ok(h,o,u,a,s,c)};if(void 0!==e.protected&&(b.protectedHeader=n),void 0!==e.aad)try{b.additionalAuthenticatedData=rT(e.aad)}catch{throw new rF("Failed to base64url decode the aad")}return(void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),y)?{...b,key:m}:b}async function oN(e,t,r){if(e instanceof Uint8Array&&(e=rb.decode(e)),"string"!=typeof e)throw new rF("Compact JWE must be a string or Uint8Array");let{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new rF("Invalid Compact JWE");let u=await oI({ciphertext:a,iv:o||void 0,protected:n,tag:s||void 0,encrypted_key:i||void 0},t,r),l={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...l,key:u.key}:l}async function oD(e,t,r){let n=await oN(e,t,r),i=n3(n.protectedHeader,n.plaintext,r),{protectedHeader:o}=n;
12if(void 0!==o.iss&&o.iss!==i.iss)throw new rM('replicated "iss" claim header parameter mismatch',i,"iss","mismatch");if(void 0!==o.sub&&o.sub!==i.sub)throw new rM('replicated "sub" claim header parameter mismatch',i,"sub","mismatch");if(void 0!==o.aud&&JSON.stringify(o.aud)!==JSON.stringify(i.aud))throw new rM('replicated "aud" claim header parameter mismatch',i,"aud","mismatch");let a={payload:i,protectedHeader:o};return"function"==typeof t?{...a,key:n.key}:a}let oU="A256GCM",oM="dir",oL="sha256",oH=32,oW="JWE CEK";async function oK(e,t,r,n){let i=await i3(oL,t,"",oW,oH);return(await new oC(e).setProtectedHeader({enc:oU,alg:oM,...n}).setExpirationTime(r).encrypt(i)).toString()}async function oF(e,t,r,n){try{let n=await i3(oL,t,"",oW,oH);return await oD(e,n,{...r,clockTolerance:15})}catch(e){if(n)throw e;if("ERR_JWE_DECRYPTION_FAILED"===e.code||"ERR_JWT_EXPIRED"===e.code)return null;throw e}}let oq=e=>i3("sha256",e,"","JWS Cookie Signing",oH);async function oB(e,t,r){if(!t)return;let[n,i]=t.split("."),o={protected:rR(JSON.stringify({alg:"HS256",b64:!1,crit:["b64"]})),payload:`${e}=${n}`,signature:i},a=await oq(r);try{return await n$(o,a,{algorithms:["HS256"]}),n}catch(e){return}}let o$=3500,oz="__",oJ=RegExp(`${oz}(\\d+)$`),oG=/\.(\d+)$/,oX=(e,t)=>{let r=t?oG.exec(e):oJ.exec(e);if(r)return parseInt(r[1],10)},oV=(e,t,r)=>{let n=new RegExp(r?`^${t}${oG.source}$`:`^${t}${oz}\\d+$`);return e.getAll().filter(e=>n.test(e.name))};function oY(e,t,r,n,i){let{transient:o,...a}=r,s={...a};if(o&&delete s.maxAge,new TextEncoder().encode(t).length<=o$){i.set(e,t,s),n.set(e,t),oV(n,e).forEach(e=>{o1(i,e.name,{path:s.path,domain:s.domain}),n.delete(e.name)});return}let c=0,u=0;for(;c<t.length;){let r=t.slice(c,c+o$),o=`${e}${oz}${u}`;i.set(o,r,s),n.set(o,r),c+=o$,u++}let l=oV(n,e).length-u;if(l>0)for(let t=0;t<l;t++){let r=u+t,o=`${e}${oz}${r}`;o1(i,o,{path:s.path,domain:s.domain}),n.delete(o)}o1(i,e,{path:s.path,domain:s.domain}),n.delete(e)}function oZ(e,t,r){let n=t.get(e);if(n?.value)return n.value;let i=oV(t,e,r).sort((e,t)=>oX(e.name,r)-oX(t.name,r));if(0===i.length)return;let o=oX(i[i.length-1].name,r);return i.length!==o+1?void console.warn(`Incomplete chunked cookie '${e}': Found ${i.length} chunks, expected ${o+1}`):i.map(e=>e.value).join("")}function oQ(e,t,r,n,i){o1(r,e,i),oV(t,e,n).forEach(e=>{o1(r,e.name,i)})}function o0(e){e.headers.set("Cache-Control","private, no-cache, no-store, must-revalidate, max-age=0"),e.headers.set("Pragma","no-cache"),e.headers.set("Expires","0")}function o1(e,t,r){let n={maxAge:0};r?.domain&&(n.domain=r.domain),r?.path&&(n.path=r.path),e.set(t,"",n)}async function o2(e,t,r,n,i,o){let a={mfaToken:e,audience:t,scope:r,mfaRequirements:n,createdAt:Date.now()};return await oK(a,i,Math.floor(Date.now()/1e3)+o)}async function o6(e,t){try{return(await oF(e,t,void 0,!0)).payload}catch(e){if("ERR_JWT_EXPIRED"===e.code)throw new A.l$;throw new A.nX}}function o3(e){if(!e||"object"!=typeof e)return!1;let t=e;return"mfa_required"===t.error||"mfa_required"===t.code}function o4(e){if(!e||"object"!=typeof e)return{mfa_token:void 0,error_description:void 0,mfa_requirements:void 0};let t=e,r=t.cause;return{mfa_token:r?.mfa_token??t.mfa_token,error_description:t.error_description,mfa_requirements:r?.mfa_requirements??t.mfa_requirements}}function o5(e){return e instanceof A.l$||e instanceof A.nX?401:e instanceof A.tY||e instanceof A.zA||e instanceof A.$A||e instanceof A.cp||e instanceof A.uz?400:e instanceof A.W9?403:500}function o8(e){e instanceof A.Fp||(e=new A.gz({code:"server_error",message:e instanceof Error?e.message:"Internal server error"}));let t=e,r=o5(t),n=t.toJSON?.()??{error:t.code||"server_error",error_description:t.message||"Internal server error"};return S.NextResponse.json(n,{status:r})}function o9(e){let t=e.headers.get("Authorization");if(!t||!t.startsWith("Bearer "))throw new A.tY("Missing or invalid Authorization header");return t.substring(7)}function o7(e){let t=new URL(e.url).searchParams.get("mfa_token");return t&&""!==t?t:o9(e)}function ae(e){return"string"==typeof e&&""!==e}function at(e,t){if(!ae(e))throw new A.tY(`Missing or invalid ${t}`);return e}function ar(e,t){if(!e||!Array.isArray(e)||0===e.length)throw new A.tY(`Missing or invalid ${t}`);return e}function an(e){let t=e,r="otp"in t&&"string"==typeof t.otp&&""!==t.otp,n="oobCode"in t&&"string"==typeof t.oobCode&&""!==t.oobCode&&"bindingCode"in t&&"string"==typeof t.bindingCode&&""!==t.bindingCode,i="recoveryCode"in t&&"string"==typeof t.recoveryCode&&""!==t.recoveryCode;if(!r&&!n&&!i)throw new A.tY("Missing verification credential (otp, oobCode+bindingCode, or recoveryCode required)");return t}async function ai(e){try{return await e.json()}catch(e){throw new A.tY("Invalid JSON in request body")}}var ao=r(36807);let aa=new Set(["accept","accept-language","content-language","content-type","user-agent","cache-control","if-match","if-none-match","if-modified-since","if-unmodified-since","etag","x-request-id","x-correlation-id","traceparent","tracestate","x-forwarded-for","x-forwarded-host","x-forwarded-proto","x-real-ip","origin","access-control-request-method","access-control-request-headers"]),as=new Set(["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade"]);function ac(e){let t=new Headers;
12return e.headers.forEach((e,r)=>{let n=r.toLowerCase();aa.has(n)&&!as.has(n)&&t.set(r,e)}),t}function au(e){let t=new Headers;return e.headers.forEach((e,r)=>{let n=r.toLowerCase();as.has(n)||t.set(r,e)}),t}function al(e,t){let r=t.targetBaseUrl,n=e.nextUrl.pathname.startsWith(t.proxyPath)?e.nextUrl.pathname.slice(t.proxyPath.length):e.nextUrl.pathname;n&&!n.startsWith("/")&&(n="/"+n);let i=new URL(r.replace(/\/$/,"")),o=i.pathname,a=o;if(n&&"/"!==n){let e=o.split("/").filter(Boolean),t=n.split("/").filter(Boolean),r=0,i=Math.min(e.length,t.length);for(let n=i;n>=1;n--){let i=e.slice(-n),o=t.slice(0,n);if(i.every((e,t)=>e===o[t])){r=n;break}}let s=t.slice(r);if(s.length>0){let e="/"===o||o.endsWith("/")?"":"/";a=o+e+s.join("/")}}let s=new URL(i.origin+a);return e.nextUrl.searchParams.forEach((e,t)=>{s.searchParams.set(t,e)}),s}function ad(e,t){let r;try{r=new URL(e,t)}catch(e){return}if(r.origin===t.origin)return r}class ah{constructor(e,t){this.hooks=t,this.config={...e,fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))}}isAbsoluteUrl(e){try{return new URL(e),!0}catch{return!1}}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e??{}):this.hooks.getAccessToken(e??{})}buildBaseRequest(e,t){let r;return r=e instanceof Request?e.url:e instanceof URL?e.toString():this.config.baseUrl&&!this.isAbsoluteUrl(e)?this.buildUrl(this.config.baseUrl,e):e,new Request(r,t)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}async internalFetchWithAuth(e,t,r,n){let i,o,a=this.buildBaseRequest(e,t),s=await this.getAccessToken(n);"string"==typeof s?(i=!!this.config.dpopHandle,o=s):(i=!!this.config.dpopHandle&&s.token_type?.toLowerCase()==="dpop",o=s.accessToken);try{return await e8(o,a.method,new URL(a.url),a.headers,a.body,{...this.config.httpOptions(),[W]:(e,t)=>this.config.fetch(e,t),[M]:this.config.allowInsecureRequests||!1,...i&&{DPoP:this.config.dpopHandle}})}catch(e){if(eF(e)&&r.onUseDpopNonceError)return r.onUseDpopNonceError();throw e}}isRequestInit(e){return!!e&&"object"==typeof e&&!["refresh","scope","audience"].some(t=>Object.prototype.hasOwnProperty.call(e,t))}fetchWithAuth(e,t,r){let n,i;2==arguments.length&&void 0!==t?this.isRequestInit(t)?(n=t,i=void 0):(n=void 0,i=t):(n=t,i=r);let o={onUseDpopNonceError:async()=>{let t=this.config.retryConfig??{delay:100,jitter:!0},r=t.delay??100;t.jitter&&(r*=.5+.5*Math.random()),await new Promise(e=>setTimeout(e,r));try{return await this.internalFetchWithAuth(e,n,{...o,onUseDpopNonceError:void 0},i)}catch(e){if(eF(e)){let t=Error(`DPoP nonce error persisted after retry: ${e.message}`);throw t.code=e.code||"dpop_nonce_retry_failed",t}throw e}}};return this.internalFetchWithAuth(e,n,o,i)}}let ap=["sub","name","nickname","given_name","family_name","picture","email","email_verified","org_id"];function af(e){return Object.keys(e).reduce((t,r)=>(ap.includes(r)&&(t[r]=e[r]),t),{})}var ay=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};let am=["client_id","redirect_uri","response_type","code_challenge","code_challenge_method","state","nonce"],ag="urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",ab="http://auth0.com/oauth/token-type/federated-connection-access-token";function aw(e,t){return new URL((0,ao.Z9)((0,ao.CB)(e)),(0,ao.Il)(t))}class a_{constructor(e){f.add(this),this.proxyFetchers={},this.fetch=e.fetch||fetch,this.jwksCache=e.jwksCache||{},this.allowInsecureRequests=e.allowInsecureRequests??!1,this.httpTimeout=e.httpTimeout??5e3,this.httpOptions=()=>{let t=new Headers;if(e.enableTelemetry??!0){let e="nextjs-auth0",r=ik.rE;t.set("User-Agent",`${e}/${r}`),t.set("Auth0-Client",av(JSON.stringify({name:e,version:r})))}return{signal:AbortSignal.timeout(this.httpTimeout),headers:t}},this.allowInsecureRequests&&console.warn("allowInsecureRequests is enabled in a production environment. This is not recommended."),this.transactionStore=e.transactionStore,this.sessionStore=e.sessionStore,this.domain=e.domain,this.clientMetadata={client_id:e.clientId},e.dpopOptions&&("number"==typeof e.dpopOptions.clockSkew&&(this.clientMetadata[L]=e.dpopOptions.clockSkew),"number"==typeof e.dpopOptions.clockTolerance&&(this.clientMetadata[H]=e.dpopOptions.clockTolerance)),this.dpopOptions=e.dpopOptions,this.clientSecret=e.clientSecret,this.authorizationParameters=e.authorizationParameters||{scope:k},this.pushedAuthorizationRequests=e.pushedAuthorizationRequests??!1,this.clientAssertionSigningKey=e.clientAssertionSigningKey,this.clientAssertionSigningAlg=e.clientAssertionSigningAlg||"RS256",this.authorizationParameters.scope=t9(this.authorizationParameters);let t=t7(this.authorizationParameters.scope,this.authorizationParameters.audience)?.split(" ").map(e=>e.trim());if(!t||!t.includes("openid"))throw Error("The 'openid' scope must be included in the set of scopes. See https://auth0.com/docs");this.appBaseUrl=e.appBaseUrl,this.signInReturnToPath=e.signInReturnToPath||"/";let r=["auto","oidc","v2"],n=e.logoutStrategy||"auto";r.includes(n)||(console.error(`Invalid logoutStrategy: ${n}
12. Must be one of: ${r.join(", ")}. Defaulting to "auto"`),n="auto"),this.logoutStrategy=n,this.includeIdTokenHintInOIDCLogoutUrl=e.includeIdTokenHintInOIDCLogoutUrl??!0,this.beforeSessionSaved=e.beforeSessionSaved,this.onCallback=e.onCallback||this.defaultOnCallback,this.routes=e.routes,this.enableAccessTokenEndpoint=e.enableAccessTokenEndpoint??!0,this.noContentProfileResponseWhenUnauthenticated=e.noContentProfileResponseWhenUnauthenticated??!1,this.enableConnectAccountEndpoint=e.enableConnectAccountEndpoint??!1,this.useDPoP=e.useDPoP??!1,this.mfaTokenTtl=e.mfaTokenTtl??C,e.useDPoP&&e.dpopKeyPair&&(this.dpopKeyPair=e.dpopKeyPair)}async handler(e){let{pathname:t}=e.nextUrl,r=e.nextUrl.basePath;r&&t.startsWith(r)&&(t=t.slice(r.length)||"/");let n=(0,ao.UC)(t),i=e.method;if("GET"===i&&n===this.routes.login)return this.handleLogin(e);{if("GET"===i&&n===this.routes.logout)return this.handleLogout(e);if("GET"===i&&n===this.routes.callback)return this.handleCallback(e);if("GET"===i&&n===this.routes.profile)return this.handleProfile(e);if("GET"===i&&n===this.routes.accessToken&&this.enableAccessTokenEndpoint)return this.handleAccessToken(e);if("POST"===i&&n===this.routes.backChannelLogout)return this.handleBackChannelLogout(e);if("GET"===i&&n===this.routes.connectAccount&&this.enableConnectAccountEndpoint)return this.handleConnectAccount(e);if("GET"===i&&n===this.routes.mfaAuthenticators)return this.handleGetAuthenticators(e);if("POST"===i&&n===this.routes.mfaChallenge)return this.handleChallenge(e);if("POST"===i&&n===this.routes.mfaEnroll)return this.handleEnroll(e);if("POST"===i&&n===this.routes.mfaVerify)return this.handleVerify(e);if(n.startsWith("/me/"))return this.handleMyAccount(e);if(n.startsWith("/my-org/"))return this.handleMyOrg(e);let t=S.NextResponse.next(),r=await this.sessionStore.get(e.cookies);return r&&(await this.sessionStore.set(e.cookies,t.cookies,{...r}),o0(t)),t}}async startInteractiveLogin(e={}){let t=aw(this.routes.callback,this.appBaseUrl),r=this.signInReturnToPath;if(e.returnTo){let t=new URL(this.authorizationParameters.redirect_uri||this.appBaseUrl),n=ad(e.returnTo,t);n&&(r=n.pathname+n.search+n.hash)}let n="S256",i=ey(),o=await eb(i),a=em(),s=eg(),c=iT(this.authorizationParameters,e.authorizationParameters,am);if(c.set("client_id",this.clientMetadata.client_id),c.set("redirect_uri",t.toString()),c.set("response_type",p.CODE),c.set("code_challenge",o),c.set("code_challenge_method",n),c.set("state",a),c.set("nonce",s),this.dpopKeyPair)try{let e=await rN(this.dpopKeyPair.publicKey),t=await r3(e);c.set("dpop_jkt",t)}catch(e){throw new A.cf(A.rf.DPOP_JKT_CALCULATION_FAILED,"DPoP is enabled but failed to calculate key thumbprint (dpop_jkt). This is required for secure DPoP binding. Please check your key configuration.",e instanceof Error?e:void 0)}let u={nonce:s,maxAge:this.authorizationParameters.max_age,codeVerifier:i,responseType:p.CODE,state:a,returnTo:r,scope:c.get("scope")||void 0,audience:c.get("audience")||void 0},[l,d]=await this.authorizationUrl(c);if(l)return new S.NextResponse("An error occurred while trying to initiate the login request.",{status:500});let h=S.NextResponse.redirect(d.toString());return await this.transactionStore.save(h.cookies,u),h}async handleLogin(e){let{returnTo:t,...r}=Object.fromEntries(e.nextUrl.searchParams.entries()),n={authorizationParameters:r,returnTo:t};return this.startInteractiveLogin(n)}async handleLogout(e){let t,r=await this.sessionStore.get(e.cookies),[n,i]=await this.discoverAuthorizationServerMetadata();if(n){let t=new S.NextResponse("An error occurred while trying to initiate the logout request.",{status:500});return await this.sessionStore.delete(e.cookies,t.cookies),await this.transactionStore.deleteAll(e.cookies,t.cookies),t}let o=e.nextUrl.searchParams.get("returnTo")||this.appBaseUrl,a=e.nextUrl.searchParams.has("federated"),s=()=>{let e=new URL("/v2/logout",this.issuer);return e.searchParams.set("returnTo",o),e.searchParams.set("client_id",this.clientMetadata.client_id),a&&e.searchParams.set("federated",""),S.NextResponse.redirect(e)},c=()=>{let e=new URL(i.end_session_endpoint);return e.searchParams.set("client_id",this.clientMetadata.client_id),e.searchParams.set("post_logout_redirect_uri",o),r?.internal.sid&&e.searchParams.set("logout_hint",r.internal.sid),this.includeIdTokenHintInOIDCLogoutUrl&&r?.tokenSet.idToken&&e.searchParams.set("id_token_hint",r.tokenSet.idToken),a&&e.searchParams.set("federated",""),S.NextResponse.redirect(e)};if("v2"===this.logoutStrategy)t=s();else if("oidc"===this.logoutStrategy){if(!i.end_session_endpoint){let t=new S.NextResponse("OIDC RP-Initiated Logout is not supported by the authorization server. Enable it or use a different logout strategy.",{status:500});return await this.sessionStore.delete(e.cookies,t.cookies),await this.transactionStore.deleteAll(e.cookies,t.cookies),t}t=c()}else i.end_session_endpoint?t=c():(console.warn("The Auth0 client does not have RP-initiated logout enabled, the user will be redirected to the `/v2/logout` endpoint instead. Learn how to enable it here: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0#enable-endpoint-discovery"),t=s());return await this.sessionStore.delete(e.cookies,t.cookies),o0(t),await this.transactionStore.deleteAll(e.cookies,t.cookies),t}async handleCallback(e){let t,r,n,i,o,a=e.nextUrl.searchParams.get("state");if(!a)return this.handleCallbackError(new A.mv,{},e);let s=await this.transactionStore.get(e.cookies,a);if(!s)return this.onCallback(new A.Pp,{},null);let c=s.payload,u={responseType:c.responseType,returnTo:c.returnTo};if(c.responseType===p.CONNECT_CODE){let t=await this.sessionStore.get(e.cookies);if(!t)return this.handleCallbackError(new A.Q4({code:A.Yn.MISSING_SESSION,message:"The user does not have an active session."}),u,e,a);let[r,n]=await this.getTokenSet(t,{audience:`${this.issuer}/me/`,scope:"create:me:connected_accounts"});if(r)return this.handleCallbackError(r,u,e,a);let[i,o]=await this.completeConnectAccount({tokenSet:n.tokenSet,authSession:c.authSession,connectCode:e.nextUrl.searchParams.get("connect_code"),redirectUri:aw(this.routes.callback,this.appBaseUrl).toString(),codeVerifier:c.codeVerifier});if(i)return this.handleCallbackError(i,u,e,a);let s=await this.onCallback(null,{...u,connectedAccount:o},t);return await this.transactionStore.delete(s.cookies,a),s}let[l,d]=await this.discoverAuthorizationServerMetadata();if(l)return this.handleCallbackError(l,u,e,a);try{t=tJ(d,this.clientMetadata,e.nextUrl.searchParams,c.state)}catch(t){return this.handleCallbackError(new A.yi({cause:new A.gz({code:t.error,message:t.error_description})}),u,e,a)}try{n=aw(this.routes.callback,this.appBaseUrl);let e=this.useDPoP&&this.dpopKeyPair?eq(this.clientMetadata,this.dpopKeyPair):void 0;i=async()=>tp(d,this.clientMetadata,await this.getClientAuth(),t,n.toString(),c.codeVerifier,{...this.httpOptions(),[W]:this.fetch,[M]:this.allowInsecureRequests,...e&&{DPoP:e}}),r=await t3(i,{isDPoPEnabled:!!e,...this.dpopOptions?.retry})}catch(t){return this.handleCallbackError(new A.S$(t.message),u,e,a)}try{o=await tb(d,this.clientMetadata,r,{expectedNonce:c.nonce,maxAge:c.maxAge,requireIdToken:!0})}catch(t){return this.handleCallbackError(new A.nc({cause:new A.gz({code:t.error,message:t.error_description})}),u,e,a)}let h=ti(o),f={user:h,tokenSet:{accessToken:o.access_token,idToken:o.id_token,scope:o.scope,requestedScope:c.scope,audience:c.audience,refreshToken:o.refresh_token,expiresAt:Math.floor(Date.now()/1e3)+Number(o.expires_in)},internal:{sid:h.sid,createdAt:Math.floor(Date.now()/1e3)}},y=await this.onCallback(null,u,f);return f=await this.finalizeSession(f,o.id_token),await this.sessionStore.set(e.co
12okies,y.cookies,f,!0),o0(y),await this.transactionStore.delete(y.cookies,a),y}async handleProfile(e){let t=await this.sessionStore.get(e.cookies);if(!t)return this.noContentProfileResponseWhenUnauthenticated?new S.NextResponse(null,{status:204}):new S.NextResponse(null,{status:401});let r=S.NextResponse.json(t?.user);return o0(r),r}async handleGetAuthenticators(e){try{let t=o7(e),r=await this.mfaGetAuthenticators(t);return S.NextResponse.json(r)}catch(e){return o8(e)}}async handleChallenge(e){try{let t=await ai(e),r=at(t.mfaToken,"mfaToken"),n=at(t.challengeType,"challengeType"),i=t.authenticatorId?at(t.authenticatorId,"authenticatorId"):void 0,o=await this.mfaChallenge(r,n,i);return S.NextResponse.json(o)}catch(e){return o8(e)}}async handleEnroll(e){try{let t=await ai(e),r=t,n=at(r.mfaToken,"mfaToken"),i=ar(r.authenticatorTypes,"authenticatorTypes")[0],[o,a]=iD(t,i);if(a)return a;let s=await this.mfaEnroll(n,o);return S.NextResponse.json(s)}catch(e){return o8(e)}}async handleVerify(e){try{let t=await ai(e),r=t;at(r.mfaToken,"mfaToken");let n=an(t),i=await this.mfaVerify(n),o=S.NextResponse.json(i);return await this.sessionStore.get(e.cookies)&&await this.cacheTokenFromMfaVerify(i,r.mfaToken,e.cookies,o.cookies),o}catch(e){return o8(e)}}async handleAccessToken(e){let t=await this.sessionStore.get(e.cookies),r=e.nextUrl.searchParams.get("audience"),n=e.nextUrl.searchParams.get("scope");if(!t)return S.NextResponse.json({error:{message:"The user does not have an active session.",code:A.Pi.MISSING_SESSION}},{status:401});let[i,o]=await this.getTokenSet(t,{scope:n,audience:r});if(i)return i instanceof A.W9?ay(this,f,"m",w).call(this,e,t,i):S.NextResponse.json({error:{message:i.message,code:i.code}},{status:401});let{tokenSet:a}=o,s=Math.floor(Date.now()/1e3),c="number"==typeof a.expiresAt?a.expiresAt:0,u=Math.max(0,c-s),l=S.NextResponse.json({token:a.accessToken,scope:a.scope,expires_at:c,expires_in:u,...a.token_type&&{token_type:a.token_type}});return await ay(this,f,"m",b).call(this,e,l,t,o),l}async handleBackChannelLogout(e){if(!this.sessionStore.store)return new S.NextResponse("A session data store is not configured.",{status:500});if(!this.sessionStore.store.deleteByLogoutToken)return new S.NextResponse("Back-channel logout is not supported by the session data store.",{status:500});let t=new URLSearchParams(await e.text()).get("logout_token");if(!t)return new S.NextResponse("Missing `logout_token` in the request body.",{status:400});let[r,n]=await this.verifyLogoutToken(t);return r?new S.NextResponse(r.message,{status:400}):(await this.sessionStore.store.deleteByLogoutToken(n),new S.NextResponse(null,{status:204}))}async handleConnectAccount(e){let t=await this.sessionStore.get(e.cookies),r=e.nextUrl.searchParams.get("connection"),n=e.nextUrl.searchParams.get("returnTo")??void 0,i=e.nextUrl.searchParams.getAll("scopes"),o=Object.fromEntries([...e.nextUrl.searchParams.entries()].filter(([e])=>"connection"!==e&&"returnTo"!==e&&"scopes"!==e));if(!r)return new S.NextResponse("A connection is required.",{status:400});if(!t)return new S.NextResponse("The user does not have an active session.",{status:401});let[a,s]=await this.getTokenSet(t,{scope:"create:me:connected_accounts",audience:`${this.issuer}/me/`});if(a)return a instanceof A.W9?ay(this,f,"m",w).call(this,e,t,a):new S.NextResponse("Failed to retrieve a connected account access token.",{status:401});let{tokenSet:c}=s,u={connection:r,authorizationParams:o,returnTo:n};i.length>0&&(u.scopes=i);let[l,d]=await this.connectAccount({tokenSet:c,...u});return l?new S.NextResponse(l.message,{status:l.cause?.status??500}):(await ay(this,f,"m",b).call(this,e,d,t,s),d)}async handleMyAccount(e){return ay(this,f,"m",g).call(this,e,{proxyPath:"/me",targetBaseUrl:`${this.issuer}/me/v1`,audience:`${this.issuer}/me/`,scope:e.headers.get("scope")})}async handleMyOrg(e){return ay(this,f,"m",g).call(this,e,{proxyPath:"/my-org",targetBaseUrl:`${this.issuer}/my-org`,audience:`${this.issuer}/my-org/`,scope:e.headers.get("scope")})}async getTokenSet(e,t={}){let r=ri(t7(this.authorizationParameters.scope,t.audience??this.authorizationParameters.audience),t.scope),n=ay(this,f,"m",y).call(this,e,{scope:r,audie
12nce:t.audience??this.authorizationParameters.audience});if(!n.refreshToken&&!n.accessToken)return[new A.oc(A.Pi.MISSING_REFRESH_TOKEN,"No access token found and a refresh token was not provided. The user needs to re-authenticate."),null];if(!n.refreshToken&&n.accessToken&&n.expiresAt&&n.expiresAt<=Date.now()/1e3)return[new A.oc(A.Pi.MISSING_REFRESH_TOKEN,"The access token has expired and a refresh token was not provided. The user needs to re-authenticate."),null];if(n.refreshToken&&(t.refresh||!n.expiresAt||n.expiresAt<=Date.now()/1e3)){let[e,i]=await ay(this,f,"m",_).call(this,n,{audience:t.audience,scope:t.scope?r:void 0,requestedScope:r});return e?[e,null]:[null,{tokenSet:i.updatedTokenSet,idTokenClaims:i.idTokenClaims}]}return[null,{tokenSet:n,idTokenClaims:void 0}]}async backchannelAuthentication(e){let[t,r]=await this.discoverAuthorizationServerMetadata();if(t)return[t,null];if(!r.backchannel_authentication_endpoint)return[new A.yr,null];let n=iT(this.authorizationParameters,e.authorizationParams,am);n.get("scope")||n.set("scope",k),n.set("client_id",this.clientMetadata.client_id),n.set("binding_message",e.bindingMessage),n.set("login_hint",JSON.stringify({format:"iss_sub",iss:r.issuer,sub:e.loginHint.sub})),e.requestedExpiry&&n.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&n.append("authorization_details",JSON.stringify(e.authorizationDetails));let[i,o]=await this.getOpenIdClientConfig();if(i)return[i,null];try{let e=await ib(o,n),t=await iw(o,e),r=Math.floor(Date.now()/1e3)+Number(t.expires_in);return[null,{tokenSet:{accessToken:t.access_token,idToken:t.id_token,scope:t.scope,refreshToken:t.refresh_token,expiresAt:r},idTokenClaims:t.claims(),authorizationDetails:t.authorization_details}]}catch(e){return[new A.Rg({cause:new A.gz({code:e.error,message:e.error_description})}),null]}}async discoverAuthorizationServerMetadata(){if(this.authorizationServerMetadata)return[null,this.authorizationServerMetadata];let e=new URL(this.issuer);try{let t=await es(e,{...this.httpOptions(),[W]:this.fetch,[M]:this.allowInsecureRequests}).then(t=>el(e,t));return this.authorizationServerMetadata=t,[null,t]}catch(t){return console.error(`An error occurred while performing the discovery request. issuer=${e.toString()}, error:`,t),[new A.P3("Discovery failed for the OpenID Connect configuration."),null]}}async defaultOnCallback(e,t){return e?new S.NextResponse(e.message,{status:500}):S.NextResponse.redirect(aw(t.returnTo||"/",this.appBaseUrl))}async handleCallbackError(e,t,r,n){let i=await this.onCallback(e,t,null);return n&&await this.transactionStore.delete(i.cookies,n),i}async verifyLogoutToken(e){let[t,r]=await this.discoverAuthorizationServerMetadata();if(t)return[t,null];let n="RS256",i=nE(new URL(r.jwks_uri),{[nw]:this.jwksCache}),{payload:o}=await n5(e,i,{issuer:r.issuer,audience:this.clientMetadata.client_id,algorithms:[n],requiredClaims:["iat"]});return"sid"in o||"sub"in o?"sid"in o&&"string"!=typeof o.sid?[new A.pp('"sid" claim must be a string'),null]:"sub"in o&&"string"!=typeof o.sub?[new A.pp('"sub" claim must be a string'),null]:"nonce"in o?[new A.pp('"nonce" claim is prohibited'),null]:"events"in o?"object"!=typeof o.events||null===o.events?[new A.pp('"events" claim must be an object'),null]:"http://schemas.openid.net/event/backchannel-logout"in o.events?"object"!=typeof o.events["http://schemas.openid.net/event/backchannel-logout"]?[new A.pp('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object'),null]:[null,{sid:o.sid,sub:o.sub}]:[new A.pp('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim'),null]:[new A.pp('"events" claim is missing'),null]:[new A.pp('either "sid" or "sub" (or both) claims must be present'),null]}async authorizationUrl(e){let[t,r]=await this.discoverAuthorizationServerMetadata();if(t)return[t,null];if(this.pushedAuthorizationRequests&&!r.pushed_authorization_request_endpoint)return console.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"),[Error("The authorization server does not support pushed authorization requests."),null];let n=new URL(r.authorization_endpoint);if(this.pushedAuthorizationRequests){let t,i=await eW(r,this.clientMetadata,await this.getClientAuth(),e,{...this.httpOptions(),[W]:this.fetch,[M]:this.allowInsecureRequests});try{t=await e2(r,this.clientMetadata,i)}catch(e){return[new A.yi({cause:new A.gz({code:e.error,message:e.error_description}),message:"An error occurred while pushing the authorization request."}),null]}return n.searchParams.set("request_uri",t.request_uri),n.searchParams.set("client_id",this.clientMetadata.client_id),[null,n]}return n.search=e.toString(),[null,n]}async getClientAuth(){if(!this.clientSecret&&!this.clientAssertionSigningKey)throw Error("The client secret or client assertion signing key must be provided.");let e=this.clientAssertionSigningKey;return e&&"string"==typeof e&&(e=await nc(e,this.clientAssertionSigningAlg)),e?eC(e):eO(this.clientSecret)}get issuer(){return this.domain.startsWith("http://")||this.domain.startsWith("https://")?this.domain:`https://${this.domain}`}async getConnectionTokenSet(e,t,r){if(!e.refreshToken&&(!t||t.expiresAt<=Date.now()/1e3))return[new A.dx(A.W$.MISSING_REFRESH_TOKEN,"A refresh token was not present, Connection Access Token requires a refresh token. The user needs to re-authenticate."),null];if(e.refreshToken&&(!t||t.expiresAt<=Date.now()/1e3)){let t,n=new URLSearchParams;n.append("connection",r.connection);let i=r.subject_token_type??h.SUBJECT_TYPE_REFRESH_TOKEN,o=i===h.SUBJECT_TYPE_ACCESS_TOKEN?e.accessToken:e.refreshToken;n.append("subject_token_type",i),n.append("subject_token",o),n.append("requested_token_type",ab),r.login_hint&&n.append("login_hint",r.login_hint);let[a,s]=await this.discoverAuthorizationServerMetadata();if(a)return[a,null];let c=this.useDPoP&&this.dpopKeyPair?eq(this.clientMetadata,this.dpopKeyPair):void 0,u=async()=>tU(s,this.clientMetadata,await this.getClientAuth(),ag,n,{[W]:this.fetch,[M]:this.allowInsecureRequests,...c&&{DPoP:c}}),l=async()=>{let e=await u();return tM(s,this.clientMetadata,e)};try{t=await t3(l,{isDPoPEnabled:!!(this.useDPoP&&this.dpopKeyPair),...this.dpopOptions?.retry})}catch(e){return[new A.dx(A.W$.FAILED_TO_EXCHANGE,"There was an error trying to exchange the refresh token for a connection access token.",new A.gz({code:e.error,message:e.error_description})),null]}return[null,{accessToken:t.access_token,expiresAt:Math.floor(Date.now()/1e3)+Number(t.expires_in),scope:t.scope,connection:r.connection}]}return[null,t]}validateSubjectTokenType(e){if(e.length<10)return new A.A7(A.VE.INVALID_SUBJECT_TOKEN_TYPE,`Invalid subject_token_type: must be at least 10 characters. Received ${e.length} characters.`);if(e.length>100)return new A.A7(A.VE.INVALID_SUBJECT_TOKEN_TYPE,`Invalid subject_token_type: must be at most 100 characters. Received ${e.length} characters.`);let t=!1;try{new URL(e),t=!0}catch{}let r=/^urn:[a-z0-9][a-z0-9-]{0,31}:[a-z0-9()+,\-.:=@;$_!*'%/?#]+$/i.test(e);return t||r?null:new A.A7(A.VE.INVALID_SUBJECT_TOKEN_TYPE,`Invalid subject_token_type: must be a valid URI (URL or URN format). Received: "${e}"`)}async customTokenExchange(e){let t;if(!e.subjectToken||""===e.subjectToken.trim())return[new A.A7(A.VE.MISSING_SUBJECT_TOKEN,"The subject_token is required and cannot be empty."),null];let r=this.validateSubjectTokenType(e.subjectTokenType);if(r)return[r,null];if(e.actorToken&&!e.actorTokenType)return[new A.A7(A.VE.MISSING_ACTOR_TOKEN_TYPE,"The actor_token_type is required when actor_token is provided."),null];
12let[n,i]=await this.discoverAuthorizationServerMetadata();if(n)return[new A.A7(A.VE.EXCHANGE_FAILED,"Failed to discover authorization server metadata.",new A.gz({code:"discovery_error",message:n.message})),null];let o=ri(k,e.scope),a=new URLSearchParams;if(a.append("subject_token",e.subjectToken),a.append("subject_token_type",e.subjectTokenType),a.append("scope",o),e.audience&&a.append("audience",e.audience),e.organization&&a.append("organization",e.organization),e.actorToken&&e.actorTokenType&&(a.append("actor_token",e.actorToken),a.append("actor_token_type",e.actorTokenType)),e.additionalParameters)for(let[t,r]of Object.entries(e.additionalParameters))null!=r&&a.append(t,String(r));let s=this.useDPoP&&this.dpopKeyPair?eq(this.clientMetadata,this.dpopKeyPair):void 0,c=async()=>{let e=await tU(i,this.clientMetadata,await this.getClientAuth(),iP,a,{[W]:this.fetch,[M]:this.allowInsecureRequests,...s&&{DPoP:s}});return tM(i,this.clientMetadata,e)};try{t=await t3(c,{isDPoPEnabled:!!(this.useDPoP&&this.dpopKeyPair),...this.dpopOptions?.retry})}catch(e){return[new A.A7(A.VE.EXCHANGE_FAILED,"There was an error trying to exchange the token.",new A.gz({code:e.error??"unknown_error",message:e.error_description??e.message})),null]}return[null,{accessToken:t.access_token,idToken:t.id_token,refreshToken:t.refresh_token,tokenType:t.token_type??"Bearer",expiresIn:Number(t.expires_in),scope:t.scope}]}async finalizeSession(e,t){return this.beforeSessionSaved?e={...await this.beforeSessionSaved(e,t??null),internal:e.internal}:e.user=af(e.user),e}async connectAccount(e){let t=aw(this.routes.callback,this.appBaseUrl),r=this.signInReturnToPath;if(e.returnTo){let t=new URL(this.authorizationParameters.redirect_uri||this.appBaseUrl),n=ad(e.returnTo,t);n&&(r=n.pathname+n.search+n.hash)}let n="S256",i=ey(),o=await eb(i),a=em(),[s,c]=await this.createConnectAccountTicket({tokenSet:e.tokenSet,connection:e.connection,redirectUri:t.toString(),state:a,codeChallenge:o,codeChallengeMethod:n,scopes:e.scopes,authorizationParams:e.authorizationParams});if(s)return[s,null];let u={codeVerifier:i,responseType:p.CONNECT_CODE,state:a,returnTo:r,authSession:c.authSession},l=S.NextResponse.redirect(`${c.connectUri}?ticket=${encodeURIComponent(c.connectParams.ticket)}`);return await this.transactionStore.save(l.cookies,u),[null,l]}async createConnectAccountTicket(e){try{let t=new URL("/me/v1/connected-accounts/connect",this.issuer),r=await this.fetcherFactory({useDPoP:this.useDPoP,getAccessToken:async()=>({accessToken:e.tokenSet.accessToken,expiresAt:e.tokenSet.expiresAt||0,scope:e.tokenSet.scope,token_type:e.tokenSet.token_type}),fetch:this.fetch}),n=this.httpOptions();new Headers(n.headers).set("Content-Type","application/json");let i={connection:e.connection,redirect_uri:e.redirectUri,state:e.state,code_challenge:e.codeChallenge,code_challenge_method:e.codeChallengeMethod,scopes:e.scopes,authorization_params:e.authorizationParams},o=await r.fetchWithAuth(t.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok)return aE(o,A.Yn.FAILED_TO_INITIATE);let{connect_uri:a,connect_params:s,auth_session:c,expires_in:u}=await o.json();return[null,{connectUri:a,connectParams:s,authSession:c,expiresIn:u}]}catch(t){let e="An unexpected error occurred while trying to initiate the connect account flow.";return t instanceof A.cf&&(e=t.message),[new A.Q4({code:A.Yn.FAILED_TO_INITIATE,message:e}),null]}}async completeConnectAccount(e){let t=new URL("/me/v1/connected-accounts/complete",this.issuer);try{let r=this.httpOptions();new Headers(r.headers).set("Content-Type","application/json");let n=await this.fetcherFactory({useDPoP:this.useDPoP,getAccessToken:async()=>({accessToken:e.tokenSet.accessToken,expiresAt:e.tokenSet.expiresAt||0,scope:e.tokenSet.scope,token_type:e.tokenSet.token_type}),fetch:this.fetch}),i={auth_session:e.authSession,connect_code:e.connectCode,redirect_uri:e.redirectUri,code_verifier:e.codeVerifier},o=await n.fetchWithAuth(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok)return aE(o,A.Yn.FAILED_TO_COMPLETE);let{id:a,connection:s,access_type:c,scopes:u,created_at:l,expires_at:d}=await o.json();return[null,{id:a,connection:s,accessType:c,scopes:u,createdAt:l,expiresAt:d}]}catch(e){return[new A.Q4({code:A.Yn.FAILED_TO_COMPLETE,message:"An unexpected error occurred while trying to complete the connect account flow."}),null]}}async getOpenIdClientConfig(){let[e,t]=await this.discoverAuthorizationServerMetadata();if(e)return[e,null];let r=new ih(t,this.clientMetadata.client_id,{},await this.getClientAuth()),n=new Headers(this.httpOptions().headers);return r[it]=(...e)=>{let t=new Headers(e[1].headers);return this.fetch(e[0],{...e[1],body:e[1].body,headers:new Headers([...n,...t])})},r.timeout=this.httpTimeout,this.allowInsecureRequests&&i_(r),[null,r]}async fetcherFactory(e){if(this.useDPoP&&!this.dpopKeyPair)throw new A.cf(A.rf.DPOP_CONFIGURATION_ERROR,"DPoP is enabled but no keypair is configured.");let[t,r]=await this.discoverAuthorizationServerMetadata();if(t)throw t;return new ah({dpopHandle:this.useDPoP&&(e.useDPoP??!0)?eq(this.clientMetadata,this.dpopKeyPair):void 0,httpOptions:this.httpOptions,allowInsecureRequests:this.allowInsecureRequests,retryConfig:this.dpopOptions?.retry,fetch:e.fetch,getAccessToken:e.getAccessToken,baseUrl:e.baseUrl},{getAccessToken:e.getAccessToken,isDpopEnabled:()=>e.useDPoP??this.useDPoP??!1})}async mfaGetAuthenticators(e){let t=await o6(e,this.sessionStore.secret),r=t.mfaToken,n=new URL("/mfa/authenticators",this.issuer).toString(),i=this.httpOptions();i.headers.set("Authorization",`Bearer ${r}`);try{let e=await this.fetch(n,{method:"GET",...i});if(!e.ok){let t=await e.json().catch(()=>({error:"unknown_error",error_description:"Failed to retrieve authenticators"}));throw new A.$A(t.error||"unknown_error",t.error_description||"Failed to retrieve authenticators",t.error?t:void 0)}let r=(await e.json()).map(ij),o=new Set((t.mfaRequirements?.challenge??[]).map(e=>e.type.toLowerCase()));if(0===o.size)return r;return r.filter(e=>e.type&&o.has(e.type.toLowerCase()))}catch(e){if(e instanceof A.$A)throw e;throw new A.$A("unexpected_error","Unexpected error during authenticator retrieval",void 0)}}async mfaChallenge(e,t,r){let n=await o6(e,this.sessionStore.secret);
12if(0===new Set((n.mfaRequirements?.challenge??[]).map(e=>e.type.toLowerCase())).size)throw new A.zA("No MFA challenge types available in mfa_requirements");let i=n.mfaToken,o=new URL("/mfa/challenge",this.issuer).toString(),a=this.httpOptions();a.headers.set("Content-Type","application/json");try{let e={client_id:this.clientMetadata.client_id,challenge_type:t,mfa_token:i};this.clientSecret&&(e.client_secret=this.clientSecret),r&&(e.authenticator_id=r);let n=await this.fetch(o,{method:"POST",body:JSON.stringify(e),...a});if(!n.ok){let e=await n.json().catch(()=>({error:"unknown_error",error_description:"Failed to initiate MFA challenge"}));throw new A.cp(e.error||"unknown_error",e.error_description||"Failed to initiate MFA challenge",e.error?e:void 0)}let s=await n.json();return iI(s)}catch(e){if(e instanceof A.cp)throw e;throw new A.cp("unexpected_error","Unexpected error during MFA challenge",void 0)}}async mfaEnroll(e,t){let r=(await o6(e,this.sessionStore.secret)).mfaToken,n=new URL("/mfa/associate",this.issuer).toString(),i=this.httpOptions();i.headers.set("Authorization",`Bearer ${r}`),i.headers.set("Content-Type","application/json");let o={authenticator_types:t.authenticatorTypes};if("oobChannels"in t){let e=t;o.oob_channels=e.oobChannels,e.phoneNumber&&(o.phone_number=e.phoneNumber),e.email&&(o.email=e.email)}try{let e=await this.fetch(n,{method:"POST",body:JSON.stringify(o),...i});if(!e.ok){let t=await e.json().catch(()=>({error:"unknown_error",error_description:"Failed to enroll authenticator"}));throw new A.Mj(t.error||"unknown_error",t.error_description||"Failed to enroll authenticator",t.error?t:void 0)}let t=await e.json();return iN(t)}catch(e){if(e instanceof A.Mj)throw e;throw new A.Mj("unexpected_error","Unexpected error during MFA enrollment",void 0)}}async mfaVerify(e){let t,{mfaToken:r,audience:n,scope:i}=await o6(e.mfaToken,this.sessionStore.secret),[o,a]=await this.discoverAuthorizationServerMetadata();if(o)throw new A.uz("discovery_error","Failed to discover authorization server metadata",void 0);let s=iU(e,r),c=iM(s),u=this.useDPoP&&this.dpopKeyPair?eq(this.clientMetadata,this.dpopKeyPair):void 0;try{t=await t3(async()=>{let e=await tU(a,this.clientMetadata,await this.getClientAuth(),c,s,{...this.httpOptions(),[W]:this.fetch,[M]:this.allowInsecureRequests,...u&&{DPoP:u}});return tM(a,this.clientMetadata,e)},{isDPoPEnabled:!!(this.useDPoP&&this.dpopKeyPair),...this.dpopOptions?.retry})}catch(t){if("mfa_required"===t.error){let e=t.cause&&"object"==typeof t.cause?t.cause:t,r=await o2(e.mfa_token,n,i,e.mfa_requirements,this.sessionStore.secret,C);throw new A.W9(e.error_description||"Additional MFA factor required",r,e.mfa_requirements,new A.gz({code:"mfa_required",message:e.error_description}))}let e=t.cause&&"object"==typeof t.cause?t.cause:t;throw new A.uz(e.error||"unknown_error",e.error_description||t.message||"MFA verification failed",e.error?e:void 0)}return{...t,token_type:t.token_type?t.token_type.charAt(0).toUpperCase()+t.token_type.slice(1):"Bearer"}}async cacheTokenFromMfaVerify(e,t,r,n){let i=await this.sessionStore.get(r);if(!i)throw new A.uz(A.Pi.MISSING_SESSION,"The user does not have an active session.");let{audience:o}=await o6(t,this.sessionStore.secret);i.accessTokens=i.accessTokens||[],i.accessTokens.push({accessToken:e.access_token,scope:e.scope,audience:o||"",expiresAt:Math.floor(Date.now()/1e3)+Number(e.expires_in),token_type:e.token_type}),await this.sessionStore.set(r,n,i)}}f=new WeakSet,y=function(e,t){let r,n=e.tokenSet,i=t.audience,o=t.scope,a=!i||i===(n.audience||this.authorizationParameters.audience),s=!o||rn(n.requestedScope||t7(this.authorizationParameters.scope,i),o);return a&&s?n:(i&&(r=ro(e,{scope:o,audience:i})),rt(r,n))},m=async function(e,t){let r=ac(e),n=al(e,t);r.set("host",n.host);try{let e=await this.fetch(n.toString(),{method:"OPTIONS",headers:r});return new S.NextResponse(null,{status:e.status,headers:au(e)})}catch(e){return new S.NextResponse(e.cause||e.message||"Preflight request failed",{status:500})}},g=async function(e,t){let r,n=await this.sessionStore.get(e.cookies);if(!n)return new S.NextResponse("The user does not have an active session.",{status:401});if("OPTIONS"===e.method&&e.headers.has("access-control-request-method"))return ay(this,f,"m",m).call(this,e,t);let i=ac(e),o=this.useDPoP?e.clone():e,a=al(e,t);i.set("host",a.host);let s=o.body?await o.arrayBuffer():void 0,c=async e=>{let[t,i]=await this.getTokenSet(n,{audience:e.audience,scope:e.scope});if(t)throw t;return r=i,i.tokenSet},u=this.proxyFetchers[t.audience];u?u.getAccessToken=c:(u=await this.fetcherFactory({useDPoP:this.useDPoP,fetch:this.fetch,getAccessToken:c}),this.proxyFetchers[t.audience]=u);try{let c=await u.fetchWithAuth(a.toString(),{method:o.method,headers:i,body:s}
12,{scope:t.scope,audience:t.audience}),l=new S.NextResponse(c.body,{status:c.status,statusText:c.statusText,headers:au(c)});return r&&await ay(this,f,"m",b).call(this,e,l,n,r),l}catch(t){if(t instanceof A.W9)return ay(this,f,"m",w).call(this,e,n,t);if(t instanceof A.oc&&t.code===A.Pi.MISSING_REFRESH_TOKEN)return new S.NextResponse(t.message,{status:401});return new S.NextResponse(t.cause||t.message||"An error occurred while proxying the request.",{status:500})}},b=async function(e,t,r,n){let i=rp(r,n.tokenSet,{scope:this.authorizationParameters?.scope??k,audience:this.authorizationParameters?.audience});if(i){n.idTokenClaims&&(r.user=n.idTokenClaims);let o=await this.finalizeSession({...r,...i},n.tokenSet.idToken);await this.sessionStore.set(e.cookies,t.cookies,o),o0(t)}},w=async function(e,t,r){let n=S.NextResponse.json(r.toJSON(),{status:403});return await this.sessionStore.set(e.cookies,n.cookies,t),o0(n),n},_=async function(e,t){let r,[n,i]=await this.discoverAuthorizationServerMetadata();if(n)return[n,null];let o=new URLSearchParams;t.scope&&o.append("scope",t.scope),t.audience&&o.append("audience",t.audience);let a=this.useDPoP&&this.dpopKeyPair?eq(this.clientMetadata,this.dpopKeyPair):void 0,s=async()=>tt(i,this.clientMetadata,await this.getClientAuth(),e.refreshToken,{...this.httpOptions(),[W]:this.fetch,[M]:this.allowInsecureRequests,additionalParameters:o,...a&&{DPoP:a}}),c=e=>ts(i,this.clientMetadata,e);try{r=await t3(async()=>{let e=await s();return await c(e)},{isDPoPEnabled:!!(this.useDPoP&&this.dpopKeyPair),...this.dpopOptions?.retry})}catch(e){if(o3(e)){let{mfa_token:r,error_description:n,mfa_requirements:i}=o4(e);if(!r)return console.error("MFA required but no mfa_token - user needs to re-authenticate"),[new A.W9(n??"Multi-factor authentication is required. Please log in again.","",i,new A.gz({code:e.error,message:e.error_description})),null];{let o=await o2(r,t.audience||"",t.requestedScope,i,this.sessionStore.secret,this.mfaTokenTtl);return[new A.W9(n??"Multi-factor authentication is required.",o,i,new A.gz({code:e.error,message:e.error_description})),null]}}return[new A.oc(A.Pi.FAILED_TO_REFRESH_TOKEN,"The access token has expired and there was an error while trying to refresh it.",new A.gz({code:e.error,message:e.error_description})),null]}let u=ti(r),l=Math.floor(Date.now()/1e3)+Number(r.expires_in),d={...e,accessToken:r.access_token,idToken:r.id_token,scope:r.scope,requestedScope:t.requestedScope,expiresAt:l,audience:e.audience||t.audience||void 0,...r.token_type&&{token_type:r.token_type}};return r.refresh_token?d.refreshToken=r.refresh_token:d.refreshToken=e.refreshToken,[null,{updatedTokenSet:d,idTokenClaims:u}]};let av=e=>{let t=new TextEncoder().encode(e),r=32768,n=[];for(let e=0;e<t.length;e+=r)n.push(String.fromCharCode.apply(null,t.subarray(e,e+r)));return btoa(n.join(""))};async function aE(e,t){let r=t===A.Yn.FAILED_TO_INITIATE?"initiate":"complete";try{let n=await e.json();return[new A.Q4({code:t,message:`The request to ${r} the connect account flow failed with status ${e.status}.`,cause:new A.Uv({type:n.type,title:n.title,detail:n.detail,status:e.status,validationErrors:n.validation_errors})}),null]}catch(n){return[new A.Q4({code:t,message:`The request to ${r} the connect account flow failed with status ${e.status}.`}),null]}}function aS(e){let t;try{let r=e.nextUrl;if(!r)return;"string"==typeof r.basePath&&r.basePath&&(t={basePath:r.basePath}),("string"==typeof r.locale||"string"==typeof r.defaultLocale)&&(t={...t||{},i18n:{locales:r.locale?[r.locale]:[],defaultLocale:r.defaultLocale}}),"boolean"==typeof r.trailingSlash&&(t={...t||{},trailingSlash:r.trailingSlash})}catch{}return t&&Object.keys(t).length?t:void 0}function aA(e){if(e instanceof S.NextRequest)return e;let t=aS(e),r={method:e.method,headers:e.headers,body:e.body,duplex:e.duplex??"half"};return t&&(r.nextConfig=t),new S.NextRequest(e.url,r)}function ak(e){if(e instanceof S.NextResponse)return e;let t=new Headers(e.headers),r=new S.NextResponse(e.body,{status:e.status,statusText:e.statusText,headers:t});try{"url"in e&&e.url&&(r.url=e.url)}catch{}return r}let aP=e=>t=>async(r,n)=>{let i=r instanceof Request?aA(r):r,o=await e.getSession();if(!o||!o.user)return S.NextResponse.json({error:"not_authenticated",description:"The user does not have an active session or is not authenticated"},{status:401});let a=await t(i,n);return a instanceof S.NextResponse?a:new S.NextResponse(a.body,a)},aT=e=>t=>async(r,n)=>{let i=await e.getSession(r);if(!i||!i.user)return void n.status(401).json({error:"not_authenticated",description:"The user does not have an active session or is not authenticated"});await t(r,n)},aR=(e,t)=>(n,i={})=>async o=>{let a=await e.getSession();if(!a?.user){let e="function"==typeof i.returnTo?await i.returnTo(o):i.returnTo,{redirect:n}=await Promise.resolve().then(r.bind(r,42235));n(`${t.loginUrl}${e?`?returnTo=${encodeURIComponent(e)}`:""}`)}return n(o)},aO=(e,t)=>
12({getServerSideProps:r,returnTo:n}={})=>async i=>{let o=await e.getSession(i.req);if(!o?.user)return{redirect:{destination:`${t.loginUrl}?returnTo=${encodeURIComponent(n||i.resolvedUrl)}`,permanent:!1}};let a={props:{}};if(r&&(a=await r(i)),a.props instanceof Promise){let e=await a.props;return{...a,props:{user:o.user,...e}}}return{...a,props:{user:o.user,...a.props}}};class ax{constructor(e){this.authClient=e}async getAuthenticators(e){return this.authClient.mfaGetAuthenticators(e.mfaToken)}async challenge(e){return this.authClient.mfaChallenge(e.mfaToken,e.challengeType,e.authenticatorId)}async enroll(e){let{mfaToken:t,...r}=e;return this.authClient.mfaEnroll(t,r)}async verify(e,t,n){if(e instanceof S.NextRequest){if(!t||!n)throw TypeError("verify(req, res, options): All three arguments required for Pages Router");let r=await this.authClient.mfaVerify(n);return await this.authClient.cacheTokenFromMfaVerify(r,n.mfaToken,e.cookies,t.cookies),r}{if(void 0!==t||void 0!==n)throw TypeError("verify(options): Only one argument allowed for App Router");let i=await this.authClient.mfaVerify(e),{cookies:o}=await Promise.resolve().then(r.bind(r,98173)),a=await o();return await this.authClient.cacheTokenFromMfaVerify(i,e.mfaToken,a,a),i}}}let aC="__session";class aj{constructor({secret:e,rolling:t=!0,absoluteDuration:r=259200,inactivityDuration:n=86400,store:i,cookieOptions:o}){this.secret=e,this.rolling=t,this.absoluteDuration=r,this.inactivityDuration=n,this.store=i,this.sessionCookieName=o?.name??aC,this.cookieConfig={httpOnly:!0,sameSite:o?.sameSite??"lax",secure:o?.secure??!1,path:o?.path??"/",domain:o?.domain,transient:o?.transient}}epoch(){return Date.now()/1e3|0}calculateMaxAge(e){if(!this.rolling)return this.absoluteDuration;let t=this.epoch(),r=Math.min(t+this.inactivityDuration,e+this.absoluteDuration)-t;return r>0?r:0}}let aI="appSession";function aN(e){if(e.protectedHeader.iat){let t=e;return aU(t.protectedHeader,t.payload)}return e.payload}function aD(e){if(e.header?.iat){let t=e;return aU(t.header,t.data)}return e}function aU(e,t){let r=t.user;return{user:r,tokenSet:{idToken:t.idToken??void 0,accessToken:t.accessToken??void 0,scope:t.accessTokenScope,refreshToken:t.refreshToken,expiresAt:t.accessTokenExpiresAt},internal:{sid:r.sid,createdAt:e.iat}}}let aM=()=>{let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")};class aL extends aj{constructor({secret:e,store:t,rolling:r,absoluteDuration:n,inactivityDuration:i,cookieOptions:o}){super({secret:e,rolling:r,absoluteDuration:n,inactivityDuration:i,cookieOptions:o}),this.store=t}async get(e){let t=e.get(this.sessionCookieName)||e.get(aI);if(!t||!t.value)return null;let r=null;try{let e=await oF(t.value,this.secret);if(null===e)return null;r=e.payload.id}catch(e){if("ERR_JWE_INVALID"===e.code){let e=await oB(t.name,t.value,this.secret);if(!e)return null;r=e}}if(!r)return null;let n=await this.store.get(r);return n?aD(n):null}async set(e,t,r,n=!1){let i=null,o=e.get(this.sessionCookieName)?.value;if(o){let e=await oF(o,this.secret);e&&(i=e.payload.id)}i&&n&&(await this.store.delete(i),i=aM()),i||(i=aM());let a=this.calculateMaxAge(r.internal.createdAt),s=this.epoch()+a,c=await oK({id:i},this.secret,s);t.set(this.sessionCookieName,c.toString(),{...this.cookieConfig,maxAge:a}),await this.store.set(i,r),e.set(this.sessionCookieName,c.toString()),this.sessionCookieName!==aI&&e.has(aI)&&o1(t,aI,{domain:this.cookieConfig.domain,path:this.cookieConfig.path})}async delete(e,t){let r=e.get(this.sessionCookieName)?.value;if(o1(t,this.sessionCookieName,{domain:this.cookieConfig.domain,path:this.cookieConfig.path}),!r)return;let n=await oF(r,this.secret);n&&await this.store.delete(n.payload.id)}}class aH extends aj{constructor({secret:e,rolling:t,absoluteDuration:r,inactivityDuration:n,cookieOptions:i}){super({secret:e,rolling:t,absoluteDuration:r,inactivityDuration:n,cookieOptions:i}),this.connectionTokenSetsCookieName="__FC"}async get(e){let t=oZ(this.sessionCookieName,e)??oZ(aI,e,!0);if(!t)return null;let r=await oF(t,this.secret);
12if(!r)return null;let n=aN(r),i=this.getConnectionTokenSetsCookies(e),o=[];for(let e of i){let t=await oF(e.value,this.secret);t&&o.push(t.payload)}return{...n,...o.length?{connectionTokenSets:o}:{}}}async set(e,t,r){let{connectionTokenSets:n,...i}=r,o=this.calculateMaxAge(r.internal.createdAt),a=this.epoch()+o,s=(await oK(i,this.secret,a)).toString(),c={...this.cookieConfig,maxAge:o};oY(this.sessionCookieName,s,c,e,t),n?.length&&await Promise.all(n.map((r,n)=>this.storeInCookie(e,t,r,`${this.connectionTokenSetsCookieName}_${n}`,o))),oZ(aI,e,!0)&&oQ(aI,e,t,!0,{domain:this.cookieConfig.domain,path:this.cookieConfig.path})}async delete(e,t){let r={domain:this.cookieConfig.domain,path:this.cookieConfig.path};oQ(this.sessionCookieName,e,t,!1,r),this.getConnectionTokenSetsCookies(e).forEach(e=>o1(t,e.name,r))}async storeInCookie(e,t,r,n,i){let o=Math.floor(Date.now()/1e3+i),a=await oK(r,this.secret,o),s=a.toString();t.set(n,a.toString(),{...this.cookieConfig,maxAge:i}),e.set(n,s);let c=new iG(new Headers);c.set(n,s,{...this.cookieConfig,maxAge:i}),new TextEncoder().encode(c.toString()).length>=4096&&(n===this.sessionCookieName?console.warn(`The ${n} cookie size exceeds 4096 bytes, which may cause issues in some browsers. Consider removing any unnecessary custom claims from the access token or the user profile. Alternatively, you can use a stateful session implementation to store the session data in a data store.`):console.warn(`The ${n} cookie size exceeds 4096 bytes, which may cause issues in some browsers. You can use a stateful session implementation to store the session data in a data store.`))}getConnectionTokenSetsCookies(e){return e.getAll().filter(e=>e.name.startsWith(this.connectionTokenSetsCookieName))}}let aW="__txn_";class aK{constructor({secret:e,cookieOptions:t,enableParallelTransactions:r}){this.secret=e,this.transactionCookiePrefix=t?.prefix??aW,this.cookieOptions={httpOnly:!0,sameSite:t?.sameSite??"lax",secure:t?.secure??!1,path:t?.path??"/",domain:t?.domain,maxAge:t?.maxAge||3600},this.enableParallelTransactions=r??!0}getTransactionCookieName(e){return this.enableParallelTransactions?`${this.transactionCookiePrefix}${e}`:`${this.transactionCookiePrefix}`}getCookiePrefix(){return this.transactionCookiePrefix}async save(e,t,r){if(!t.state)throw Error("Transaction state is required");if(r&&!this.enableParallelTransactions){let e=this.getTransactionCookieName(t.state);if(r.get(e))return void console.warn("A transaction is already in progress. Only one transaction is allowed when parallel transactions are disabled.")}let n=this.cookieOptions.maxAge,i=Math.floor(Date.now()/1e3+n),o=await oK(t,this.secret,i);e.set(this.getTransactionCookieName(t.state),o.toString(),this.cookieOptions)}async get(e,t){let r=this.getTransactionCookieName(t),n=e.get(r)?.value;return n?oF(n,this.secret):null}async delete(e,t){o1(e,this.getTransactionCookieName(t),{domain:this.cookieOptions.domain,path:this.cookieOptions.path})}async deleteAll(e,t){let r=this.getCookiePrefix(),n={domain:this.cookieOptions.domain,path:this.cookieOptions.path};e.getAll().forEach(e=>{e.name.startsWith(r)&&o1(t,e.name,n)})}}var aF=r(37811),aq=function(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},aB=function(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class a${constructor(e={}){v.set(this,void 0),aq(this,v,e,"f");let{domain:t,clientId:r,clientSecret:n,appBaseUrl:i,secret:o,clientAssertionSigningKey:a}=this.validateAndExtractRequiredOptions(e);this.domain=t;let s=e.clientAssertionSigningAlg||aF.env.AUTH0_CLIENT_ASSERTION_SIGNING_ALG,{dpopKeyPair:c,dpopOptions:u}=t5(e),l=this.resolveMfaTokenTtl(e.mfaTokenTtl,aF.env.AUTH0_MFA_TOKEN_TTL),d=aF.env.NEXT_PUBLIC_BASE_PATH,h={name:e.session?.cookie?.name??"__session",secure:e.session?.cookie?.secure??"true"===aF.env.AUTH0_COOKIE_SECURE,sameSite:e.session?.cookie?.sameSite??aF.env.AUTH0_COOKIE_SAME_SITE??"lax",path:e.session?.cookie?.path??aF.env.AUTH0_COOKIE_PATH??d??"/",transient:e.session?.cookie?.transient??"true"===aF.env.AUTH0_COOKIE_TRANSIENT,domain:e.session?.cookie?.domain??aF.env.AUTH0_COOKIE_DOMAIN},p={prefix:e.transactionCookie?.prefix??"__txn_",secure:e.transactionCookie?.secure??!1,sameSite:e.transactionCookie?.sameSite??"lax",path:e.transactionCookie?.path??d??"/",maxAge:e.transactionCookie?.maxAge??3600};if(i){let{protocol:e}=new URL(i);"https:"===e&&(h.secure=!0,p.secure=!0)}this.routes={login:aF.env.NEXT_PUBLIC_LOGIN_ROUTE||"/auth/login",logout:"/auth/logout",callback:"/auth/callback",backChannelLogout:"/auth/backchannel-logout",profile:aF.env.NEXT_PUBLIC_PROFILE_ROUTE||"/auth/profile",accessToken:aF.env.NEXT_PUBLIC_ACCESS_TOKEN_ROUTE||"/auth/access-token",connectAccount:"/auth/connect",mfaAuthenticators:aF.env.NEXT_PUBLIC_MFA_AUTHENTICATORS_ROUTE||"/auth/mfa/authenticators",mfaChallenge:aF.env.NEXT_PUBLIC_MFA_CHALLENGE_ROUTE||"/auth/mfa/challenge",mfaVerify:aF.env.NEXT_PUBLIC_MFA_VERIFY_ROUTE||"/auth/mfa/verify",mfaEnroll:aF.env.NEXT_PUBLIC_MFA_ENROLL_ROUTE||"/auth/mfa/enroll",...e.routes},this.transactionStore=new aK({secret:o,cookieOptions:p,enableParallelTransactions:e.enableParallelTransactions??!0}),this.sessionStore=e.sessionStore?new aL({...e.session,secret:o,store:e.sessionStore,cookieOptions:h}):new aH({...e.session,secret:o,cookieOptions:h}),this.authClient=new a_({transactionStore:this.transactionStore,sessionStore:this.sessionStore,domain:t,clientId:r,clientSecret:n,clientAssertionSigningKey:a,clientAssertionSigningAlg:s,authorizationParameters:e.authorizationParameters,pushedAuthorizationRequests:e.pushedAuthorizationRequests,appBaseUrl:i,secret:o,signInReturnToPath:e.signInReturnToPath,logoutStrategy:e.logoutStrategy,includeIdTokenHintInOIDCLogoutUrl:e.includeIdTokenHintInOIDCLogoutUrl,beforeSessionSaved:e.beforeSessionSaved,onCallback:e.onCallback,routes:this.routes,allowInsecureRequests:e.allowInsecureRequests,httpTimeout:e.httpTimeout,enableTelemetry:e.enableTelemetry,enableAccessTokenEndpoint:e.enableAccessTokenEndpoint,noContentProfileResponseWhenUnauthenticated:e.noContentProfileResponseWhenUnauthenticated,enableConnectAccountEndpoint:e.enableConnectAccountEndpoint,useDPoP:e.useDPoP||!1,dpopKeyPair:e.dpopKeyPair||c,dpopOptions:e.dpopOptions||u,mfaTokenTtl:l})}middleware(e){return this.authClient.handler.bind(this.authClient)(aA(e))}async getSession(e){if(e){if(e instanceof Request){let t=aA(e);return this.sessionStore.get(t.cookies)}return this.sessionStore.get(this.createRequestCookies(e))}
12return this.sessionStore.get(await (0,E.cookies)())}async getAccessToken(e,t,r){let n,i,o={refresh:!1},a={};if(e&&(e instanceof Request||"object"==typeof e.headers)){if(n=e,i=t,a={...o,...r??{}},!i)throw TypeError("getAccessToken(req, res): The 'res' argument is missing. Both 'req' and 'res' must be provided together for Pages Router or middleware usage.")}else{if(void 0!==t||void 0!==r)throw TypeError("getAccessToken: Invalid arguments. Valid signatures are getAccessToken(), getAccessToken(options), or getAccessToken(req, res, options).");a={...o,...e??{}}}return this.executeGetAccessToken(n,i,a)}async executeGetAccessToken(e,t,r){let n=e?await this.getSession(e):await this.getSession();if(!n)throw new A.oc(A.Pi.MISSING_SESSION,"The user does not have an active session.");let[i,o]=await this.authClient.getTokenSet(n,r);if(i)throw i instanceof A.W9&&await this.saveToSession(n,e,t),i;let{tokenSet:a,idTokenClaims:s}=o,c=rp(n,a,{scope:aB(this,v,"f").authorizationParameters?.scope??k,audience:aB(this,v,"f").authorizationParameters?.audience});if(c){s&&(n.user=s);let r=await this.authClient.finalizeSession({...n,...c},a.idToken);await this.saveToSession(r,e,t)}return{token:a.accessToken,scope:a.scope,expiresAt:a.expiresAt,token_type:a.token_type,audience:a.audience}}async getAccessTokenForConnection(e,t,r){let n=t instanceof Request?aA(t):t,i=n?await this.get
12Session(n):await this.getSession();if(!i)throw new A.dx(A.W$.MISSING_SESSION,"The user does not have an active session.");let o=i.connectionTokenSets?.find(t=>t.connection===e.connection),[a,s]=await this.authClient.getConnectionTokenSet(i.tokenSet,o,e);if(null!==a)throw a;if(s&&(!o||s.accessToken!==o.accessToken||s.expiresAt!==o.expiresAt||s.scope!==o.scope)){let t;t=o?i.connectionTokenSets?.map(t=>t.connection===e.connection?s:t):[...i.connectionTokenSets||[],s],await this.saveToSession({...i,connectionTokenSets:t},n,r)}return{token:s.accessToken,scope:s.scope,expiresAt:s.expiresAt}}async customTokenExchange(e){let[t,r]=await this.authClient.customTokenExchange(e);if(null!==t)throw t;return r}get mfa(){return this._mfa||(this._mfa=new ax(this.authClient)),this._mfa}async updateSession(e,t,r){if(e instanceof Request&&!(e instanceof S.NextRequest)&&(e=aA(e)),t&&t instanceof Response&&!(t instanceof S.NextResponse)&&(t=ak(t)),t){let n=e;if(!r)throw Error("The session data is missing.");if(n instanceof S.NextRequest&&t instanceof S.NextResponse){let e=await this.get
12Session(n);if(!e)throw Error("The user is not authenticated.");await this.sessionStore.set(n.cookies,t.cookies,{...r,internal:{...e.internal}})}else{let e=await this.getSession(n);if(!e)throw Error("The user is not authenticated.");let i=new Headers,o=new iG(i),a=r,s=this.createRequestCookies(n),c=t;await this.sessionStore.set(s,o,{...a,internal:{...e.internal}});let u=[],l={};for(let[e,t]of i.entries())"set-cookie"===e.toLowerCase()?u.push(t):l[e]=t;for(let[e,t]of(u.length>0&&c.setHeader("set-cookie",u),Object.entries(l)))c.setHeader(e,t)}}else{let t=await this.getSession();if(!t)throw Error("The user is not authenticated.");let r=e;if(!r)throw Error("The session data is missing.");await this.sessionStore.set(await (0,E.cookies)(),await (0,E.cookies)(),{...r,internal:{...t.internal}})}}createRequestCookies(e){let t=new Headers;for(let r in e.headers)if(Array.isArray(e.headers[r]))for(let n of e.headers[r])t.append(r,n);else t.append(r,e.headers[r]??"");return new iJ(t)}async startInteractiveLogin(e={}){return this.authClient.startInteractiveLogin(e)}async getTokenByBackchannelAuth(e){let[t,r]=await this.authClient.backchannelAuthentication(e);if(t)throw t;return r}
12async connectAccount(e){if(!await this.getSession())throw new A.Q4({code:A.Yn.MISSING_SESSION,message:"The user does not have an active session."});let t={audience:`${this.issuer}/me/`,scope:"create:me:connected_accounts"},r=await this.getAccessToken(t),[n,i]=await this.authClient.connectAccount({...e,tokenSet:{accessToken:r.token,expiresAt:r.expiresAt,scope:t.scope,audience:r.audience}});if(n)throw n;return i}withPageAuthRequired(e,t){let r={loginUrl:this.routes.login},n=aR(this,r),i=aO(this,r);return"function"==typeof e?n(e,t):i(e)}withApiAuthRequired(e){let t=aT(this),r=aP(this);return(n,i)=>t8(n)?r(e)(n,i):t(e)(n,i)}async saveToSession(e,t,r){if(t&&r)if(t8(t)&&r instanceof S.NextResponse){let n=aA(t);await this.sessionStore.set(n.cookies,r.cookies,e)}else{let n=new Headers,i=new iG(n),o=r;for(let r of(await this.sessionStore.set(this.createRequestCookies(t),i,e),n.getSetCookie()))o.appendHeader("set-cookie",r);for(let[e,t]of n.entries())"set-cookie"!==e.toLowerCase()&&o.setHeader(e,t)}else try{await this.sessionStore.set(await (0,E.cookies)(),await (0,E.cookies)(),e)}catch(e){}}validateAndExtractRequiredOptions(e){let t={domain:e.domain??aF.env.AUTH0_DOMAIN,clientId:e.clientId??aF.env.AUTH0_CLIENT_ID,appBaseUrl:e.appBaseUrl??aF.env.APP_BASE_URL,secret:e.secret??aF.env.AUTH0_SECRET},r=e.clientSecret??aF.env.AUTH0_CLIENT_SECRET,n=e.clientAssertionSigningKey??aF.env.AUTH0_CLIENT_ASSERTION_SIGNING_KEY,i=!!(r||n),o=Object.entries(t).filter(([,e])=>!e).map(([e])=>e);if(i||o.push("clientAuthentication"),o.length){let e={domain:"AUTH0_DOMAIN",clientId:"AUTH0_CLIENT_ID",appBaseUrl:"APP_BASE_URL",secret:"AUTH0_SECRET"},t="WARNING: Not all required options were provided when creating an instance of Auth0Client. Ensure to provide all missing options, either by passing it to the Auth0Client constructor, or by setting the corresponding environment variable.\n";o.forEach(r=>{"clientAuthentication"===r?t+=`Missing: clientAuthentication: Set either AUTH0_CLIENT_SECRET env var or AUTH0_CLIENT_ASSERTION_SIGNING_KEY env var, or pass clientSecret or clientAssertionSigningKey in options 13`:e[r]?t+=`Missing: ${r}: Set ${e[r]} env var or pass ${r} in options 14`:t+=`Missing: ${r} 15`}),console.error(t.trim())}return{...t,clientSecret:r,clientAssertionSigningKey:n}}async createFetcher(e,t){let r=e instanceof Request?aA(e):e,n=r?await this.get
15Session(r):await this.getSession();if(!n)throw new A.oc(A.Pi.MISSING_SESSION,"The user does not have an active session.");let i=async e=>{let[t,r]=await this.authClient.getTokenSet(n,e||{});if(t)throw t;return r.tokenSet};return await this.authClient.fetcherFactory({...t,getAccessToken:i})}resolveMfaTokenTtl(e,t){let r=C;if(void 0!==e)return Number.isFinite(e)&&e>0?e:(console.warn(`[auth0-nextjs] Invalid mfaTokenTtl option value: ${e}. Using default: ${r} seconds.`),r);if(void 0!==t){let e=parseInt(t,10);if(Number.isFinite(e)&&e>0)return e;console.warn(`[auth0-nextjs] Invalid AUTH0_MFA_TOKEN_TTL environment variable: ${t}. Using default: ${r} seconds.`)}return r}get issuer(){return this.domain.startsWith("http://")||this.domain.startsWith("https://")?this.domain:`https://${this.domain}`}}v=new WeakMap},37364:(e,t,r)=>{"use strict";e.exports=r(18493).getPrototypeOf||null},38126:function(e){!function(t,r,n){e.exports=n(),e.exports.default=n()}(0,0,function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xa2":"cent","\xa3":"pound","\xa4":"currency","\xa5":"yen","\xa9":"(c)","\xaa":"a","\xae":"(r)","\xba":"o","\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"AE","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"TH","\xdf":"ss","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"ae","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"th","\xff":"y","Ä":"A","Ä":"a","Ä":"A","Ä":"a","Ä":"A","Ä
":"a","Ä":"C","Ä":"c","Ä":"C","Ä":"c","Ä":"D","Ä":"d","Ä":"DJ","Ä":"dj","Ä":"E","Ä":"e","Ä":"E","Ä":"e","Ä":"e","Ä":"e","Ä":"E","Ä":"e","Ä":"G","Ä":"g","Ä¢":"G","Ä£":"g","Ĩ":"I","Ä©":"i","Ī":"i","Ä«":"i","Ä®":"I","į":"i","İ":"I","ı":"i","Ķ":"k","Ä·":"k","Ä»":"L","ļ":"l","Ľ":"L","ľ":"l","Å":"L","Å":"l","Å":"N","Å":"n","Å
":"N","Å":"n","Å":"N","Å":"n","Å":"O","Å":"o","Å":"O","Å":"o","Å":"OE","Å":"oe","Å":"R","Å":"r","Å":"R","Å":"r","Å":"S","Å":"s","Å":"S","Å":"s","Å ":"S","Å¡":"s","Å¢":"T","Å£":"t","Ť":"T","Å¥":"t","Ũ":"U","Å©":"u","Ū":"u","Å«":"u","Å®":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Å´":"W","ŵ":"w","Ŷ":"Y","Å·":"y","Ÿ":"Y","Ź":"Z","ź":"z","Å»":"Z","ż":"z","Ž":"Z","ž":"z","Æ":"E","Æ":"f","Æ ":"O","Æ¡":"o","Ư":"U","ư":"u","Ç":"LJ","Ç":"lj","Ç":"NJ","Ç":"nj","È":"S","È":"s","È":"T","È":"t","É":"e","Ë":"o","Î":"A","Î":"E","Î":"H","Î":"I","Î":"O","Î":"Y","Î":"W","Î":"i","Î":"A","Î":"B","Î":"G","Î":"D","Î":"E","Î":"Z","Î":"H","Î":"8","Î":"I","Î":"K","Î":"L","Î":"M","Î":"N","Î":"3","Î":"O","Î ":"P","Ρ":"R","Σ":"S","Τ":"T","Î¥":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","Î":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","Ï":"p","Ï":"r","Ï":"s","Ï":"s","Ï":"t","Ï
":"y","Ï":"f","Ï":"x","Ï":"ps","Ï":"w","Ï":"i","Ï":"y","Ï":"o","Ï":"y","Ï":"w","Ð":"Yo","Ð":"DJ","Ð":"Ye","Ð":"I","Ð":"Yi","Ð":"J","Ð":"LJ","Ð":"NJ","Ð":"C","Ð":"DZ","Ð":"A","Ð":"B","Ð":"V","Ð":"G","Ð":"D","Ð":"E","Ð":"Zh","Ð":"Z","Ð":"I","Ð":"J","Ð":"K","Ð":"L","Ð":"M","Ð":"N","Ð":"O","Ð":"P","Ð ":"R","С":"S","Т":"T","У":"U","Ф":"F","Ð¥":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Ð":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","Ñ":"r","Ñ":"s","Ñ":"t","Ñ":"u","Ñ":"f","Ñ
":"h","Ñ":"c","Ñ":"ch","Ñ":"sh","Ñ":"sh","Ñ":"u","Ñ":"y","Ñ":"","Ñ":"e","Ñ":"yu","Ñ":"ya","Ñ":"yo","Ñ":"dj","Ñ":"ye","Ñ":"i","Ñ":"yi","Ñ":"j","Ñ":"lj","Ñ":"nj","Ñ":"c","Ñ":"u","Ñ":"dz","Ò":"G","Ò":"g","Ò":"GH","Ò":"gh","Ò":"KH","Ò":"kh","Ò¢":"NG","Ò£":"ng","Ò®":"UE","Ò¯":"ue","Ò°":"U","Ò±":"u","Òº":"H","Ò»":"h","Ó":"AE","Ó":"ae","Ó¨"
15:"OE","Ó©":"oe","Ô±":"A","Ô²":"B","Ô³":"G","Ô´":"D","Ôµ":"E","Ô¶":"Z","Ô·":"E\'","Ô¸":"Y\'","Ô¹":"T\'","Ôº":"JH","Ô»":"I","Ô¼":"L","Ô½":"X","Ô¾":"C\'","Ô¿":"K","Õ":"H","Õ":"D\'","Õ":"GH","Õ":"TW","Õ":"M","Õ
":"Y","Õ":"N","Õ":"SH","Õ":"CH","Õ":"P","Õ":"J","Õ":"R\'","Õ":"S","Õ":"V","Õ":"T","Õ":"R","Õ":"C","Õ":"P\'","Õ":"Q\'","Õ":"O\'\'","Õ":"F","Ö":"EV","Ø¡":"a","Ø¢":"aa","Ø£":"a","ؤ":"u","Ø¥":"i","ئ":"e","ا":"a","ب":"b","Ø©":"h","ت":"t","Ø«":"th","ج":"j","Ø":"h","Ø®":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","Ø´":"sh","ص":"s","ض":"dh","Ø·":"t","ظ":"z","ع":"a","غ":"gh","Ù":"f","Ù":"q","Ù":"k","Ù":"l","Ù
":"m","Ù":"n","Ù":"h","Ù":"w","Ù":"a","Ù":"y","Ù":"an","Ù":"on","Ù":"en","Ù":"a","Ù":"u","Ù":"e","Ù":"","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Ù¾":"p","Ú":"ch","Ú":"zh","Ú©":"k","Ú¯":"g","Û":"y","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9","฿":"baht","á":"a","á":"b","á":"g","á":"d","á":"e","á":"v","á":"z","á":"t","á":"i","á":"k","á":"l","á":"m","á":"n","á":"o","á":"p","á":"zh","á ":"r","á¡":"s","á¢":"t","á£":"u","á¤":"f","á¥":"k","á¦":"gh","á§":"q","á¨":"sh","á©":"ch","áª":"ts","á«":"dz","á¬":"ts","á":"ch","á®":"kh","á¯":"j","á°":"h","á¹¢":"S","á¹£":"s","áº":"W","áº":"w","áº":"W","áº":"w","áº":"W","áº
":"w","áº":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","áº":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","á»":"E","á»":"e","á»":"E","á»":"e","á»":"E","á»
":"e","á»":"E","á»":"e","á»":"I","á»":"i","á»":"I","á»":"i","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á»":"O","á»":"o","á» ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","á»§":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","á»":"u","á»®":"U","ữ":"u","á»°":"U","á»±":"u","Ỳ":"Y","ỳ":"y","á»´":"Y","ỵ":"y","á»¶":"Y","á»·":"y","Ỹ":"Y","ỹ":"y","â":"-","â":"\'","â":"\'","â":"\\"","â":"\\"","â":"\\"","â ":"+","â¢":"*","â¦":"...","â ":"ecu","â¢":"cruzeiro","â£":"french franc","â¤":"lira","â¥":"mill","â¦":"naira","â§":"peseta","â¨":"rupee","â©":"won","âª":"new shequel","â«":"dong","â¬":"euro","â":"kip","â®":"tugrik","â¯":"drachma","â°":"penny","â±":"peso","â²":"guarani","â³":"austral","â´":"hryvnia","âµ":"cedi","â¸":"kazakhstani tenge","â¹":"indian rupee","âº":"turkish lira","â½":"russian ruble","â¿":"bitcoin","â ":"sm","â¢":"tm","â":"d","â":"delta","â":"sum","â":"infinity","â¥":"love","å
":"yuan","å":"yen","ï·¼":"rial","ﻵ":"laa","ï»·":"laa","ﻹ":"lai","ï»»":"la"}'),t=JSON.parse('{"bg":{"Ð":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","Ñ":"ts","Ñ":"sht","Ñ":"a","Ñ":"y"},"de":{"\xc4":"AE","\xe4":"ae","\xd6":"OE","\xf6":"oe","\xdc":"UE","\xfc":"ue","\xdf":"ss","%":"prozent","&":"und","|":"oder","â":"summe","â":"unendlich","â¥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xa2":"centavos","\xa3":"libras","\xa4":"moneda","â£":"francos","â":"suma","â":"infinito","â¥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xa2":"centime","\xa3":"livre","\xa4":"devise","â£":"franc","â":"somme","â":"infini","â¥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xa2":"centavo","â":"soma","\xa3":"libra","â":"infinito","â¥":"amor"},"uk":{"Ð":"Y","и":"y","Ð":"Y","й":"y","Ц":"Ts","Ñ":"ts","Ð¥":"Kh","Ñ
":"kh","Щ":"Shch","Ñ":"shch","Ð":"H","г":"h"},"vi":{"Ä":"D","Ä":"d"},"da":{"\xd8":"OE","\xf8":"oe","\xc5":"AA","\xe5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xf8rre end"},"nb":{"&":"og","\xc5":"AA","\xc6":"AE","\xd8":"OE","\xe5":"aa","\xe6":"ae","\xf8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xc5":"AA","\xc4":"AE","\xd6":"OE","\xe5":"aa","\xe4":"ae","\xf6":"oe"}}');function r(r,n){if("string"!=typeof r)throw Error("slugify: string argument expected");var i=t[(n="string"==typeof n?{replacement:n}:n||{}).locale]||{},o=void 0===n.replacement?"-":n.replacement,a=void 0===n.trim||n.trim,s=r.normalize().split("").reduce(function(t,r){var a=i[r];return void 0===a&&(a=e[r]),void 0===a&&(a=r),a===o&&(a=" "),t+a.replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return n.strict&&(s=s.replace(/[^A-Za-z0-9\s]/g,"")),a&&(s=s.trim()),s=s.replace(/\s+/g,o),n.lower&&(s=s.toLowerCase()),s}return r.extend=function(t){Object.assign(e,t)},r})},38920:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{if(a(e))return!1;return n.call(e),!0}catch(e){return!1}},c=Object.prototype.toString,u="[object Object]",l="[object Function]",d="[object GeneratorFunction]",h="[object HTMLAllCollection]",p="[object HTML document.all class]",f="[object HTMLCollection]",y="function"==typeof Symbol&&!!Symbol.toStringTag,m=!(0 in[,]),g=function(){return!1};if("object"==typeof document){var b=document.all;
15c.call(b)===c.call(document.all)&&(g=function(e){if((m||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return(t===h||t===p||t===f||t===u)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(g(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(g(e))return!0;if(!e||"function"!=typeof e&&"object"!=typeof e)return!1;if(y)return s(e);if(a(e))return!1;var t=c.call(e);return(t===l||t===d||!!/^\[object HTML/.test(t))&&s(e)}},40991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return r}});class r{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},42714:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},42951:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},43612:e=>{"use strict";e.exports=Math.abs},44089:(e,t,r)=>{"use strict";var n=r(37811);Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{atLeastOneTask:function(){return a},scheduleImmediate:function(){return o},scheduleOnNextTick:function(){return i},waitAtLeastOneReactRenderTask:function(){return s}});let i=e=>{Promise.resolve().then(()=>{n.nextTick(e)})},o=e=>{setImmediate(e)};function a(){return new Promise(e=>o(e))}function s(){return new Promise(e=>setImmediate(e))}},44209:(e,t,r)=>{"use strict";function n(e,t){return Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),e}Object.defineProperty(t,"__esModule",{value:!0}),n(r(48467),t)},45779:(e,t,r)=>{"use strict";var n=r(6879);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},46068:(e,t,r)=>{"use strict";var n;n={value:!0},n={enumerable:!0,get:function(){return p}};let i=r(11868),o=r(91604),a=r(46713),s=r(34569),c=r(69029),u=r(56380),l=r(36224),d=r(37183),h=r(3969);function p(){let e="headers",t=o.workAsyncStorage.getStore(),r=a.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,d.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error("Route ".concat(t.route,' used "headers" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "headers" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after')),"__NEXT_ERROR_CODE",{value:"E367",enumerable:!1,configurable:!0});if(t.forceStatic)return m(i.HeadersAdapter.seal(new Headers({})));if(r){var n,u,l,f;switch(r.type){case"cache":{let e=Object.defineProperty(Error("Route ".concat(t.route,' used "headers" inside "use cache". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E304",enumerable:!1,configurable:!0});throw Error.captureStackTrace(e,p),null!=(u=(n=t).invalidDynamicUsageError)||(n.invalidDynamicUsageError=e),e}case"private-cache":{let e=Object.defineProperty(Error("Route ".concat(t.route,' used "headers" inside "use cache: private". Accessing "headers" inside a private cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E742",enumerable:!1,
15configurable:!0});throw Error.captureStackTrace(e,p),null!=(f=(l=t).invalidDynamicUsageError)||(l.invalidDynamicUsageError=e),e}case"unstable-cache":throw Object.defineProperty(Error("Route ".concat(t.route,' used "headers" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "headers" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache')),"__NEXT_ERROR_CODE",{value:"E127",enumerable:!1,configurable:!0})}}if(t.dynamicShouldError)throw Object.defineProperty(new c.StaticGenBailoutError("Route ".concat(t.route,' with `dynamic = "error"` couldn\'t be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering')),"__NEXT_ERROR_CODE",{value:"E525",enumerable:!1,configurable:!0});if(r)switch(r.type){case"prerender":case"prerender-runtime":return y(t,r);case"prerender-client":let o="`headers`";throw Object.defineProperty(new h.InvariantError("".concat(o," must not be used within a client component. Next.js should be preventing ").concat(o," from being included in client components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});case"prerender-ppr":return(0,s.postponeWithTracking)(t.route,e,r.dynamicTracking);case"prerender-legacy":return(0,s.throwToInterruptStaticGeneration)(e,t,r);case"request":return(0,s.trackDynamicDataInDynamicRender)(r),m(r.headers)}}(0,a.throwForMissingRequestStore)(e)}r(40991);let f=new WeakMap;function y(e,t){let r=f.get(t);if(r)return r;let n=(0,u.makeHangingPromise)(t.renderSignal,e.route,"`headers()`");return f.set(t,n),n}function m(e){let t=f.get(e);if(t)return t;let r=Promise.resolve(e);return f.set(e,r),Object.defineProperties(r,{append:{value:e.append.bind(e)},delete:{value:e.delete.bind(e)},get:{value:e.get.bind(e)},has:{value:e.has.bind(e)},set:{value:e.set.bind(e)},getSetCookie:{value:e.getSetCookie.bind(e)},forEach:{value:e.forEach.bind(e)},keys:{value:e.keys.bind(e)},values:{value:e.values.bind(e)},entries:{value:e.entries.bind(e)},[Symbol.iterator]:{value:e[Symbol.iterator].bind(e)}}),r}function g(e,t){let r=e?'Route "'.concat(e,'" '):"This route ";return Object.defineProperty(Error("".concat(r,"used ").concat(t,". ")+"`headers()` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis"),"__NEXT_ERROR_CODE",{value:"E277",enumerable:!1,configurable:!0})}(0,l.createDedupedByCallsiteServerErrorLoggerDev)(g)},46713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getCacheSignal:function(){return f},getDraftModeProviderForCacheScope:function(){return p},getHmrRefreshHash:function(){return l},getPrerenderResumeDataCache:function(){return c},getRenderResumeDataCache:function(){return u},getRuntimeStagePromise:function(){return y},getServerComponentsHmrCache:function(){return h},isHmrRefresh:function(){return d},throwForMissingRequestStore:function(){return a},throwInvariantForMissingStore:function(){return s},workUnitAsyncStorage:function(){return n.workUnitAsyncStorageInstance}});let n=r(59704),i=r(36481),o=r(33601);function a(e){throw Object.defineProperty(Error(`\`${e}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`),"__NEXT_ERROR_CODE",{value:"E251",enumerable:!1,configurable:!0})}function s(){throw Object.defineProperty(new o.InvariantError("Expected workUnitAsyncStorage to have a store."),"__NEXT_ERROR_CODE",{value:"E696",enumerable:!1,configurable:!0})}function c(e){switch(e.type){case"prerender":case"prerender-runtime":case"prerender-ppr":case"prerender-client":return e.prerenderResumeDataCache;case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return null;default:return e}}function u(e){switch(e.type){case"request":return e.renderResumeDataCache;case"prerender":case"prerender-runtime":case"prerender-client":if(e.renderResumeDataCache)return e.renderResumeDataCache;case"prerender-ppr":return e.prerenderResumeDataCache;case"cache":case"private-cache":case"unstable-cache":case"prerender-legacy":return null;default:return e}}function l(e,t){if(e.dev)switch(t.type){case"cache":case"private-cache":case"prerender":case"prerender-runtime":return t.hmrRefreshHash;case"request":var r;return null==(r=t.cookies.get(i.NEXT_HMR_REFRESH_HASH_COOKIE))?void 0:r.value}}function d(e,t){if(e.dev)switch(t.type){case"cache":case"private-cache":case"request":return t.isHmrRefresh??!1}return!1}function h(e,t){if(e.dev)switch(t.type){case"cache":case"private-cache":case"request":return t.serverComponentsHmrCache}}function p(e,t){if(e.isDraftMode)switch(t.type){case"cache":case"private-cache":case"unstable-cache":case"prerender-runtime":case"request":return t.draftMode}}function f(e){switch(e.type){case"prerender":case"prerender-client":case"prerender-runtime":return e.cacheSignal;case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return null;default:return e}}function y(e){switch(e.type){case"prerender-runtime":case"private-cache":return e.runtimeStagePromise;case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"unstable-cache":return null;default:return e}}},46778:(e,t,r)=>{"use strict";
15var n=r(22309),i=r(90176),o=n("RegExp.prototype.exec"),a=r(17024);e.exports=function(e){if(!i(e))throw new a("`regex` must be a RegExp");return function(t){return null!==o(e,t)}}},47502:e=>{"use strict";e.exports=Math.floor},47550:(e,t)=>{"use strict";function r(){throw Object.defineProperty(Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'),"__NEXT_ERROR_CODE",{value:"E183",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageResponse",{enumerable:!0,get:function(){return r}})},48467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"after",{enumerable:!0,get:function(){return i}});let n=r(91604);function i(e){let t=n.workAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"),"__NEXT_ERROR_CODE",{value:"E468",enumerable:!1,configurable:!0});let{afterContext:r}=t;return r.after(e)}},49544:(e,t,r)=>{"use strict";var n=r(38920),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},c=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};function u(e){return"[object Array]"===i.call(e)}e.exports=function(e,t,r){var i;if(!n(t))throw TypeError("iterator must be a function");arguments.length>=3&&(i=r),u(e)?a(e,t,i):"string"==typeof e?s(e,t,i):c(e,t,i)}},50635:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DynamicServerError:function(){return n},isDynamicServerError:function(){return i}});let r="DYNAMIC_SERVER_USAGE";class n extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=r}}function i(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},50710:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isBot:function(){return o},userAgent:function(){return s},userAgentFromString:function(){return a}});let n=i(r(35655));function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}function a(e){return{...(0,n.default)(e),isBot:void 0!==e&&o(e)}}function s({headers:e}){return a(e.get("user-agent")||void 0)}},52609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bootstrap:function(){return c},error:function(){return l},event:function(){return f},info:function(){return p},prefixes:function(){return o},ready:function(){return h},trace:function(){return y},wait:function(){return u},warn:function(){return d},warnOnce:function(){return g}});let n=r(21585),i=r(1818),o={wait:(0,n.white)((0,n.bold)("â")),error:(0,n.red)((0,n.bold)("⨯")),warn:(0,n.yellow)((0,n.bold)("â ")),ready:"â²",info:(0,n.white)((0,n.bold)(" ")),event:(0,n.green)((0,n.bold)("â")),trace:(0,n.magenta)((0,n.bold)("\xbb"))},a={log:"log",warn:"warn",error:"error"};function s(e,...t){(""===t[0]||void 0===t[0])&&1===t.length&&t.shift();let r=e in a?a[e]:"log",n=o[e];0===t.length?console[r](""):1===t.length&&"string"==typeof t[0]?console[r](" "+n+" "+t[0]):console[r](" "+n,...t)}function c(...e){console.log(" "+e.join(" "))}function u(...e){s("wait",...e)}function l(...e){s("error",...e)}function d(...e){s("warn",...e)}function h(...e){s("ready",...e)}function p(...e){s("info",...e)}function f(...e){s("event",...e)}function y(...e){s("trace",...e)}let m=new i.LRUCache(1e4,e=>e.length);function g(...e){let t=e.join(" ");m.has(t)||(m.set(t,t),d(...e))}},54324:(e,t,r)=>{"use strict";var n=r(89908),i=r(60243),o=r(5305);e.exports=function(){return o(n,i,arguments)}},54854:(e,t,r)=>{"use strict";
15Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{INTERNALS:function(){return s},NextRequest:function(){return c}});let n=r(97562),i=r(85740),o=r(25959),a=r(97384),s=Symbol("internal request");class c extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);(0,i.validateURL)(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let o=new n.NextURL(r,{headers:(0,i.toNodeOutgoingHttpHeaders)(this.headers),nextConfig:t.nextConfig});this[s]={cookies:new a.RequestCookies(this.headers),nextUrl:o,url:o.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[s].cookies}get nextUrl(){return this[s].nextUrl}get page(){throw new o.RemovedPageError}get ua(){throw new o.RemovedUAError}get url(){return this[s].url}}},55942:e=>{"use strict";e.exports=URIError},56380:(e,t)=>{"use strict";function r(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{isHangingPromiseRejectionError:function(){return r},makeDevtoolsIOAwarePromise:function(){return c},makeHangingPromise:function(){return a}});let n="HANGING_PROMISE_REJECTION";class i extends Error{constructor(e,t){super(`During prerendering, ${t} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${e}".`),this.route=e,this.expression=t,this.digest=n}}let o=new WeakMap;function a(e,t,r){if(e.aborted)return Promise.reject(new i(t,r));{let n=new Promise((n,a)=>{let s=a.bind(null,new i(t,r)),c=o.get(e);if(c)c.push(s);else{let t=[s];o.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e<t.length;e++)t[e]()},{once:!0})}});return n.catch(s),n}}function s(){}function c(e){return new Promise(t=>{setTimeout(()=>{t(e)},0)})}},57462:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},57793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return i}});let n=r(85671);function i(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},59704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workUnitAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(27287).createAsyncLocalStorage)()},60243:e=>{"use strict";e.exports=Function.prototype.apply},61063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return n.actionAsyncStorageInstance}});let n=r(63086)},61860:(e,t,r)=>{"use strict";var n=r(91886);e.exports=function(e){return!!n(e)}},61946:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,n=Math.max,i="[object Function]",o=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r},a=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r},s=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};e.exports=function(e){var c,u=this;if("function"!=typeof u||r.apply(u)!==i)throw TypeError(t+u);for(var l=a(arguments,1),d=function(){if(this instanceof c){var t=u.apply(this,o(l,arguments));return Object(t)===t?t:this}return u.apply(e,o(l,arguments))},h=n(0,u.length-l.length),p=[],f=0;f<h;f++)p[f]="$"+f;if(c=Function("binder","return function ("+s(p,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var y=function(){};y.prototype=u.prototype,c.prototype=new y,y.prototype=null}return c}},63086:(e,t,r)=>{"use strict";
15Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(27287).createAsyncLocalStorage)()},63459:(e,t,r)=>{"use strict";r.d(t,{oc:()=>_,Pi:()=>n,dx:()=>v,W$:()=>i,nc:()=>m,S$:()=>y,yi:()=>f,Rg:()=>w,yr:()=>b,pp:()=>g,Q4:()=>k,Yn:()=>s,A7:()=>E,VE:()=>o,cf:()=>S,rf:()=>a,P3:()=>l,AJ:()=>p,tY:()=>P.tY,Pp:()=>h,cp:()=>P.cp,Mj:()=>P.Mj,$A:()=>P.$A,zA:()=>P.zA,W9:()=>P.W9,l$:()=>P.l$,nX:()=>P.nX,uz:()=>P.uz,mv:()=>d,Uv:()=>A,gz:()=>u,Fp:()=>c.F});var n,i,o,a,s,c=r(89308);class u extends c.F{constructor({code:e,message:t}){super(t??"An error occurred while interacting with the authorization server."),this.name="OAuth2Error",this.code=e}}class l extends c.F{constructor(e){super(e??"Discovery failed for the OpenID Connect configuration."),this.code="discovery_error",this.name="DiscoveryError"}}class d extends c.F{constructor(e){super(e??"The state parameter is missing."),this.code="missing_state",this.name="MissingStateError"}}class h extends c.F{constructor(e){super(e??"The state parameter is invalid."),this.code="invalid_state",this.name="InvalidStateError"}}class p extends c.F{constructor(e){super(e??"The configuration is invalid."),this.code="invalid_configuration",this.name="InvalidConfigurationError"}}class f extends c.F{constructor({cause:e,message:t}){super(t??"An error occurred during the authorization flow."),this.code="authorization_error",this.cause=e,this.name="AuthorizationError"}}class y extends c.F{constructor(e){super(e??"An error occurred while preparing or performing the authorization code grant request."),this.code="authorization_code_grant_request_error",this.name="AuthorizationCodeGrantRequestError"}}class m extends c.F{constructor({cause:e,message:t}){super(t??"An error occurred while trying to exchange the authorization code."),this.code="authorization_code_grant_error",this.cause=e,this.name="AuthorizationCodeGrantError"}}class g extends c.F{constructor(e){super(e??"An error occurred while completing the backchannel logout request."),this.code="backchannel_logout_error",this.name="BackchannelLogoutError"}}class b extends c.F{constructor(){super("The authorization server does not support backchannel authentication. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-client-initiated-backchannel-authentication"),this.code="backchannel_authentication_not_supported_error",this.name="BackchannelAuthenticationNotSupportedError"}}class w extends c.F{constructor({cause:e}){super("There was an error when trying to use Client-Initiated Backchannel Authentication."),this.code="backchannel_authentication_error",this.cause=e,this.name="BackchannelAuthenticationError"}}!function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_REFRESH_TOKEN="failed_to_refresh_token"}(n||(n={}));class _ extends c.F{constructor(e,t,r){super(t),this.name="AccessTokenError",this.code=e,this.cause=r}}!function(e){e.MISSING_SESSION="missing_session",e.MISSING_REFRESH_TOKEN="missing_refresh_token",e.FAILED_TO_EXCHANGE="failed_to_exchange_refresh_token"}(i||(i={}));class v extends c.F{constructor(e,t,r){super(t),this.name="AccessTokenForConnectionError",this.code=e,this.cause=r}}!function(e){e.MISSING_SUBJECT_TOKEN="missing_subject_token",e.INVALID_SUBJECT_TOKEN_TYPE="invalid_subject_token_type",e.MISSING_ACTOR_TOKEN_TYPE="missing_actor_token_type",e.EXCHANGE_FAILED="exchange_failed"}(o||(o={}));class E extends c.F{constructor(e,t,r){super(t),this.name="CustomTokenExchangeError",this.code=e,this.cause=r}}!function(e){e.DPOP_JKT_CALCULATION_FAILED="dpop_jkt_calculation_failed",e.DPOP_KEY_EXPORT_FAILED="dpop_key_export_failed",e.DPOP_CONFIGURATION_ERROR="dpop_configuration_error"}(a||(a={}));class S extends c.F{constructor(e,t,r){super(t),this.name="DPoPError",this.code=e,this.cause=r}}class A extends c.F{constructor({type:e,title:t,detail:r,status:n,validationErrors:i}){super(`${t}: ${r}`),this.name="MyAccountApiError",this.code="my_account_api_error",this.type=e,this.title=t,this.detail=r,this.status=n,this.validationErrors=i}}!function(e){e.MISSING_SESSION="missing_session",e.FAILED_TO_INITIATE="failed_to_initiate",e.FAILED_TO_COMPLETE="failed_to_complete"}(s||(s={}));class k extends c.F{constructor({code:e,message:t,cause:r}
15){super(t),this.name="ConnectAccountError",this.code=e,this.cause=r}}var P=r(95287)},63554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return a}});let n=r(73445),i=r(57793),o=r(85671);function a(e,t){var r,a;let{basePath:s,i18n:c,trailingSlash:u}=null!=(r=t.nextConfig)?r:{},l={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):u};s&&(0,o.pathHasPrefix)(l.pathname,s)&&(l.pathname=(0,i.removePathPrefix)(l.pathname,s),l.basePath=s);let d=l.pathname;if(l.pathname.startsWith("/_next/data/")&&l.pathname.endsWith(".json")){let e=l.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");l.buildId=e[0],d="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(l.pathname=d)}if(c){let e=t.i18nProvider?t.i18nProvider.analyze(l.pathname):(0,n.normalizeLocalePath)(l.pathname,c.locales);l.locale=e.detectedLocale,l.pathname=null!=(a=e.pathname)?a:l.pathname,!e.detectedLocale&&l.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(d):(0,n.normalizeLocalePath)(d,c.locales)).detectedLocale&&(l.locale=e.detectedLocale)}return l}},63655:(e,t,r)=>{"use strict";var n=r(69572),i=r(71342),o=r(96971)(),a=r(45779),s=r(17024),c=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>0xffffffff||c(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in e&&a){var l=a(e,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},63908:(e,t,r)=>{var n=r(65273),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},68682:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextResponse",{enumerable:!0,get:function(){return d}});let n=r(97384),i=r(97562),o=r(85740),a=r(40991),s=r(97384),c=Symbol("internal response"),u=new Set([301,302,303,307,308]);function l(e,t){var r;if(null==e||null==(r=e.request)?void 0:r.headers){if(!(e.request.headers instanceof Headers))throw Object.defineProperty(Error("request.headers must be an instance of Headers"),"__NEXT_ERROR_CODE",{value:"E119",enumerable:!1,configurable:!0});let r=[];for(let[n,i]of e.request.headers)t.set("x-middleware-request-"+n,i),r.push(n);t.set("x-middleware-override-headers",r.join(","))}}class d extends Response{constructor(e,t={}){super(e,t);let r=this.headers,u=new Proxy(new s.ResponseCookies(r),{get(e,i,o){switch(i){case"delete":case"set":return(...o)=>{let a=Reflect.apply(e[i],e,o),c=new Headers(r);return a instanceof s.ResponseCookies&&r.set("x-middleware-set-cookie",a.getAll().map(e=>(0,n.stringifyCookie)(e)).join(",")),l(t,c),a};default:return a.ReflectAdapter.get(e,i,o)}}});this[c]={cookies:u,url:t.url?new i.NextURL(t.url,{headers:(0,o.toNodeOutgoingHttpHeaders)(r),nextConfig:t.nextConfig}):void 0}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,url:this.url,body:this.body,bodyUsed:this.bodyUsed,headers:Object.fromEntries(this.headers),ok:this.ok,redirected:this.redirected,status:this.status,statusText:this.statusText,type:this.type}}get cookies(){return this[c].cookies}static json(e,t){let r=Response.json(e,t);return new d(r.body,r)}static redirect(e,t){let r="number"==typeof t?t:(null==t?void 0:t.status)??307;if(!u.has(r))throw Object.defineProperty(RangeError('Failed to execute "redirect" on "response": Invalid status code'),"__NEXT_ERROR_CODE",{value:"E529",enumerable:!1,
15configurable:!0});let n="object"==typeof t?t:{},i=new Headers(null==n?void 0:n.headers);return i.set("Location",(0,o.validateURL)(e)),new d(null,{...n,headers:i,status:r})}static rewrite(e,t){let r=new Headers(null==t?void 0:t.headers);return r.set("x-middleware-rewrite",(0,o.validateURL)(e)),l(t,r),new d(null,{...t,headers:r})}static next(e){let t=new Headers(null==e?void 0:e.headers);return t.set("x-middleware-next","1"),l(e,t),new d(null,{...e,headers:t})}}},69029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{StaticGenBailoutError:function(){return n},isStaticGenBailoutError:function(){return i}});let r="NEXT_STATIC_GEN_BAILOUT";class n extends Error{constructor(...e){super(...e),this.code=r}}function i(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69572:(e,t,r)=>{"use strict";var n,i=r(18493),o=r(5580),a=r(36470),s=r(71945),c=r(21253),u=r(81819),l=r(17024),d=r(55942),h=r(43612),p=r(47502),f=r(93854),y=r(18652),m=r(76534),g=r(13024),b=r(30065),w=Function,_=function(e){try{return w('"use strict"; return ('+e+").constructor;")()}catch(e){}},v=r(45779),E=r(57462),S=function(){throw new l},A=v?function(){try{return arguments.callee,S}catch(e){try{return v(arguments,"callee").get}catch(e){return S}}}():S,k=r(33594)(),P=r(30676),T=r(37364),R=r(74614),O=r(60243),x=r(1605),C={},j="undefined"!=typeof Uint8Array&&P?P(Uint8Array):n,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&P?P([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":w,"%GeneratorFunction%":C,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
15IteratorPrototype%":k&&P?P(P([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&P?P(new Map()[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&P?P(new Set()[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&P?P(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":u,"%ThrowTypeError%":A,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":d,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":x,"%Function.prototype.apply%":O,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":T,"%Math.abs%":h,"%Math.floor%":p,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":b,"%Reflect.getPrototypeOf%":R};if(P)try{null.error}catch(e){var N=P(P(e));I["%Error.prototype%"]=N}var D=function e(t){var r;if("%AsyncFunction%"===t)r=_("async function () {}");else if("%GeneratorFunction%"===t)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=_("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return I[t]=r,r},U={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},M=r(89908),L=r(6518),H=M.call(x,Array.prototype.concat),W=M.call(O,Array.prototype.splice),K=M.call(x,String.prototype.replace),F=M.call(x,String.prototype.slice),q=M.call(x,RegExp.prototype.exec),B=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$=/\\(\\)?/g,z=function(e){var t=F(e,0,1),r=F(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return K(e,B,function(e,t,r,i){n[n.length]=r?K(i,$,"$1"):t||e}),n},J=function(e,t){var r,n=e;if(L(U,n)&&(n="%"+(r=U[n])[0]+"%"),L(I,n)){var i=I[n];if(i===C&&(i=D(n)),void 0===i&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=z(e),n=r.length>0?r[0]:"",i=J("%"+n+"%",t),o=i.name,a=i.value,s=!1,c=i.alias;c&&(n=c[0],W(r,H([0,1],c)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],f=F(p,0,1),y=F(p,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==p&&h||(s=!0),n+="."+p,L(I,o="%"+n+"%"))a=I[o];
15else if(null!=a){if(!(p in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&d+1>=r.length){var m=v(a,p);a=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else h=L(a,p),a=a[p];h&&!s&&(I[o]=a)}}return a}},69975:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function i(e){console&&console.warn&&console.warn(e)}t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=b,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(c(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=u(e))>0&&s.length>o&&!s.warned){s.warned=!0;var o,a,s,l=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,i(l)}return e}function d(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?g(i):y(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function g(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function b(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}_(e,t,o,{once:!0}),"error"!==t&&w(e,i,{once:!0})})}function w(e,t,r){"function"==typeof e.on&&_(e,"error",t,r)}function _(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else for(var u=c.length,l=y(c,u),r=0;r<u;++r)n(l[r],this,t);return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit
15("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():m(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},71342:(e,t,r)=>{"use strict";var n=r(57462),i=r(81819),o=r(17024),a=r(45779);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(n)n(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===s&&d?d.enumerable:!s,value:r,writable:null===c&&d?d.writable:!c});else if(!l&&(s||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[t]=r}},71735:(e,t,r)=>{"use strict";var n=r(63655),i=r(57462),o=r(24991),a=r(54324);e.exports=function(e){var t=o(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:a}):e.exports.apply=a},71945:e=>{"use strict";e.exports=RangeError},72043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return s}});let n=r(22501),i=r(81790),o=r(89063),a=r(4378);function s(e){let t=(0,a.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,o.addPathSuffix)((0,i.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,i.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,o.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},73445:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});let r=new WeakMap;function n(e,t){let n;if(!t)return{pathname:e};let i=r.get(t);i||(i=t.map(e=>e.toLowerCase()),r.set(t,i));let o=e.split("/",2);if(!o[1])return{pathname:e};let a=o[1].toLowerCase(),s=i.indexOf(a);return s<0?{pathname:e}:(n=t[s],{pathname:e=e.slice(n.length+1)||"/",detectedLocale:n})}},74614:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},74897:(e,t,r)=>{"use strict";
15Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{MutableRequestCookiesAdapter:function(){return d},ReadonlyRequestCookiesError:function(){return a},RequestCookiesAdapter:function(){return s},appendMutableCookies:function(){return l},areCookiesMutableInCurrentPhase:function(){return p},createCookiesWithMutableAccessCheck:function(){return h},getModifiedCookieValues:function(){return u},responseCookiesToRequestCookies:function(){return y}});let n=r(97384),i=r(40991),o=r(91604);class a extends Error{constructor(){super("Cookies can only be modified in a Server Action or Route Handler. Read more: https://nextjs.org/docs/app/api-reference/functions/cookies#options")}static callable(){throw new a}}class s{static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"clear":case"delete":case"set":return a.callable;default:return i.ReflectAdapter.get(e,t,r)}}})}}let c=Symbol.for("next.mutated.cookies");function u(e){let t=e[c];return t&&Array.isArray(t)&&0!==t.length?t:[]}function l(e,t){let r=u(t);if(0===r.length)return!1;let i=new n.ResponseCookies(e),o=i.getAll();for(let e of r)i.set(e);for(let e of o)i.set(e);return!0}class d{static wrap(e,t){let r=new n.ResponseCookies(new Headers);for(let t of e.getAll())r.set(t);let a=[],s=new Set,u=()=>{let e=o.workAsyncStorage.getStore();if(e&&(e.pathWasRevalidated=!0),a=r.getAll().filter(e=>s.has(e.name)),t){let e=[];for(let t of a){let r=new n.ResponseCookies(new Headers);r.set(t),e.push(r.toString())}t(e)}},l=new Proxy(r,{get(e,t,r){switch(t){case c:return a;case"delete":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.delete(...t),l}finally{u()}};case"set":return function(...t){s.add("string"==typeof t[0]?t[0]:t[0].name);try{return e.set(...t),l}finally{u()}};default:return i.ReflectAdapter.get(e,t,r)}}});return l}}function h(e){let t=new Proxy(e.mutableCookies,{get(r,n,o){switch(n){case"delete":return function(...n){return f(e,"cookies().delete"),r.delete(...n),t};case"set":return function(...n){return f(e,"cookies().set"),r.set(...n),t};default:return i.ReflectAdapter.get(r,n,o)}}});return t}function p(e){return"action"===e.phase}function f(e,t){if(!p(e))throw new a}function y(e){let t=new n.RequestCookies(new Headers);for(let r of e.getAll())t.set(r);return t}},75698:(e,t,r)=>{"use strict";var n=r(22309),i=r(46778)(/^\s*(?:function)?\*/),o=r(22709)(),a=r(30676),s=n("Object.prototype.toString"),c=n("Function.prototype.toString"),u=r(23451);e.exports=function(e){if("function"!=typeof e)return!1;if(i(c(e)))return!0;if(!o)return"[object GeneratorFunction]"===s(e);if(!a)return!1;var t=u();return t&&a(e)===t.prototype}},76534:e=>{"use strict";e.exports=Math.pow},78179:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"afterTaskAsyncStorage",{enumerable:!0,get:function(){return n.afterTaskAsyncStorageInstance}});let n=r(6978)},78918:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},81819:e=>{"use strict";e.exports=SyntaxError},81851:(e,t,r)=>{"use strict";var n=r(22709)(),i=r(22309)("Object.prototype.toString"),o=function(e){return(!n||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},83718:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"connection",{enumerable:!0,get:function(){return u}});let n=r(91604),i=r(46713),o=r(34569),a=r(69029),s=r(56380),c=r(37183);function u(){let e="connection",t=n.workAsyncStorage.getStore(),r=i.workUnitAsyncStorage.getStore();if(t){if(r&&"after"===r.phase&&!(0,c.isRequestAPICallableInsideAfter)())throw Object.defineProperty(Error("Route ".concat(t.route,' used "connection" inside "after(...)". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but "after(...)" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after')),"__NEXT_ERROR_CODE",{value:"E186",enumerable:!1,
15configurable:!0});if(t.forceStatic)return Promise.resolve(void 0);if(t.dynamicShouldError)throw Object.defineProperty(new a.StaticGenBailoutError("Route ".concat(t.route,' with `dynamic = "error"` couldn\'t be rendered statically because it used `connection`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering')),"__NEXT_ERROR_CODE",{value:"E562",enumerable:!1,configurable:!0});if(r){var l,d,h,p;switch(r.type){case"cache":{let e=Object.defineProperty(Error("Route ".concat(t.route,' used "connection" inside "use cache". The `connection()` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E752",enumerable:!1,configurable:!0});throw Error.captureStackTrace(e,u),null!=(d=(l=t).invalidDynamicUsageError)||(l.invalidDynamicUsageError=e),e}case"private-cache":{let e=Object.defineProperty(Error("Route ".concat(t.route,' used "connection" inside "use cache: private". The `connection()` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache')),"__NEXT_ERROR_CODE",{value:"E753",enumerable:!1,configurable:!0});throw Error.captureStackTrace(e,u),null!=(p=(h=t).invalidDynamicUsageError)||(h.invalidDynamicUsageError=e),e}case"unstable-cache":throw Object.defineProperty(Error("Route ".concat(t.route,' used "connection" inside a function cached with "unstable_cache(...)". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache')),"__NEXT_ERROR_CODE",{value:"E1",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-runtime":return(0,s.makeHangingPromise)(r.renderSignal,t.route,"`connection()`");case"prerender-ppr":return(0,o.postponeWithTracking)(t.route,"connection",r.dynamicTracking);case"prerender-legacy":return(0,o.throwToInterruptStaticGeneration)("connection",t,r);case"request":return(0,o.trackDynamicDataInDynamicRender)(r),Promise.resolve(void 0)}}}(0,i.throwForMissingRequestStore)(e)}},85446:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},85740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{fromNodeOutgoingHttpHeaders:function(){return i},normalizeNextQueryParam:function(){return c},splitCookiesString:function(){return o},toNodeOutgoingHttpHeaders:function(){return a},validateURL:function(){return s}});let n=r(20613);function i(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function o(e){var t,r,n,i,o,a=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}function u(){return"="!==(r=e.charAt(s))&&";"!==r&&","!==r}for(;s<e.length;){for(t=s,o=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&u();)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}function a(e){let t={},r=[];if(e)for(let[n,i]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...o(i)),t[n]=1===r.length?r[0]:r):t[n]=i;return t}function s(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}
vendor: 4,448 bytes, line 15
15),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function c(e){for(let t of[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}},88329:(e,t,r)=>{"use strict";var n=r(81851),i=r(75698),o=r(91886),a=r(61860);function s(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=s(Object.prototype.toString),d=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(c)var f=s(BigInt.prototype.valueOf);if(u)var y=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function b(e){return"[object Set]"===l(e)}function w(e){return"[object WeakMap]"===l(e)}function _(e){return"[object WeakSet]"===l(e)}function v(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function S(e){return"[object DataView]"===l(e)}function A(e){return"undefined"!=typeof DataView&&(S.working?S(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(b.working?b(e):e instanceof Set)},w.working="undefined"!=typeof WeakMap&&w(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(w.working?w(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),t.isWeakSet=function(e){return _(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),t.isArrayBuffer=E,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function P(e){return"[object SharedArrayBuffer]"===l(e)}function T(e){return void 0!==k&&(void 0===P.working&&(P.working=P(new k)),P.working?P(e):e instanceof k)}function R(e){return m(e,d)}function O(e){return m(e,h)}function x(e){return m(e,p)}function C(e){return c&&m(e,f)}function j(e){return u&&m(e,y)}t.isSharedArrayBuffer=T,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=R,t.isStringObject=O,t.isBooleanObject=x,t.isBigIntObject=C,t.isSymbolObject=j,t.isBoxedPrimitive=function(e){return R(e)||O(e)||x(e)||C(e)||j(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||T(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},88557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ImageResponse:function(){return n.ImageResponse},NextRequest:function(){return i.NextRequest},NextResponse:function(){return o.NextResponse},URLPattern:function(){return s.URLPattern},after:function(){return c.after},connection:function(){return u.connection}
15,unstable_rootParams:function(){return l.unstable_rootParams},userAgent:function(){return a.userAgent},userAgentFromString:function(){return a.userAgentFromString}});let n=r(47550),i=r(54854),o=r(68682),a=r(50710),s=r(20725),c=r(44209),u=r(83718),l=r(90015)},89063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return i}});let n=r(84743);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:o}=(0,n.parsePath)(e);return""+r+t+i+o}},89308:(e,t,r)=>{"use strict";r.d(t,{F:()=>n});class n extends Error{}},89908:(e,t,r)=>{"use strict";var n=r(61946);e.exports=Function.prototype.bind||n},90015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getRootParam:function(){return y},unstable_rootParams:function(){return h}});let n=r(3969),i=r(34569),o=r(91604),a=r(46713),s=r(56380),c=r(19833),u=r(61063),l=r(52609),d=new WeakMap;async function h(){(0,l.warnOnce)("`unstable_rootParams()` is deprecated and will be removed in an upcoming major release. Import specific root params from `next/root-params` instead.");let e=o.workAsyncStorage.getStore();if(!e)throw Object.defineProperty(new n.InvariantError("Missing workStore in unstable_rootParams"),"__NEXT_ERROR_CODE",{value:"E615",enumerable:!1,configurable:!0});let t=a.workUnitAsyncStorage.getStore();if(!t)throw Object.defineProperty(Error("Route ".concat(e.route," used `unstable_rootParams()` in Pages Router. This API is only available within App Router.")),"__NEXT_ERROR_CODE",{value:"E641",enumerable:!1,configurable:!0});switch(t.type){case"cache":case"unstable-cache":throw Object.defineProperty(Error("Route ".concat(e.route,' used `unstable_rootParams()` inside `"use cache"` or `unstable_cache`. Support for this API inside cache scopes is planned for a future version of Next.js.')),"__NEXT_ERROR_CODE",{value:"E642",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return p(t.rootParams,e,t);case"private-cache":case"prerender-runtime":case"request":return Promise.resolve(t.rootParams);default:return t}}function p(e,t,r){switch(r.type){case"prerender-client":{let e="`unstable_rootParams`";throw Object.defineProperty(new n.InvariantError("".concat(e," must not be used within a client component. Next.js should be preventing ").concat(e," from being included in client components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0})}case"prerender":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i)){let n=d.get(e);if(n)return n;let i=(0,s.makeHangingPromise)(r.renderSignal,t.route,"`unstable_rootParams`");return d.set(e,i),i}}break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n){for(let i in e)if(n.has(i))return f(e,n,t,r)}}}return Promise.resolve(e)}function f(e,t,r,n){let o=d.get(e);if(o)return o;let a={...e},s=Promise.resolve(a);return d.set(e,s),Object.keys(e).forEach(o=>{c.wellKnownProperties.has(o)||(t.has(o)?Object.defineProperty(a,o,{get(){let e=(0,c.describeStringPropertyAccess)("unstable_rootParams",o);"prerender-ppr"===n.type?(0,i.postponeWithTracking)(r.route,e,n.dynamicTracking):(0,i.throwToInterruptStaticGeneration)(e,r,n)},enumerable:!0}):s[o]=e[o])}),s}function y(e){let t="`import('next/root-params').".concat(e,"()`"),r=o.workAsyncStorage.getStore();if(!r)throw Object.defineProperty(new n.InvariantError("Missing workStore in ".concat(t)),"__NEXT_ERROR_CODE",{value:"E764",enumerable:!1,configurable:!0});let i=a.workUnitAsyncStorage.getStore();if(!i)throw Object.defineProperty(Error("Route ".concat(r.route," used ").concat(t," outside of a Server Component. This is not allowed.")),"__NEXT_ERROR_CODE",{value:"E774",enumerable:!1,configurable:!0});let s=u.actionAsyncStorage.getStore();if(s){if(s.isAppRoute)throw Object.defineProperty(Error("Route ".concat(r.route," used ").concat(t," inside a Route Handler. Support for this API in Route Handlers is planned for a future version of Next.js.")),"__NEXT_ERROR_CODE",{value:"E765",enumerable:!1,
15configurable:!0});if(s.isAction&&"action"===i.phase)throw Object.defineProperty(Error("".concat(t," was used inside a Server Action. This is not supported. Functions from 'next/root-params' can only be called in the context of a route.")),"__NEXT_ERROR_CODE",{value:"E766",enumerable:!1,configurable:!0})}switch(i.type){case"unstable-cache":case"cache":throw Object.defineProperty(Error("Route ".concat(r.route," used ").concat(t,' inside `"use cache"` or `unstable_cache`. Support for this API inside cache scopes is planned for a future version of Next.js.')),"__NEXT_ERROR_CODE",{value:"E760",enumerable:!1,configurable:!0});case"prerender":case"prerender-client":case"prerender-ppr":case"prerender-legacy":return m(e,r,i,t)}return Promise.resolve(i.rootParams[e])}function m(e,t,r,i){if("prerender-client"===r.type)throw Object.defineProperty(new n.InvariantError("".concat(i," must not be used within a client component. Next.js should be preventing ").concat(i," from being included in client components statically, but did not in this case.")),"__NEXT_ERROR_CODE",{value:"E693",enumerable:!1,configurable:!0});let o=r.rootParams;switch(r.type){case"prerender":if(r.fallbackRouteParams&&r.fallbackRouteParams.has(e))return(0,s.makeHangingPromise)(r.renderSignal,t.route,i);break;case"prerender-ppr":if(r.fallbackRouteParams&&r.fallbackRouteParams.has(e))return g(e,t,r,i)}return Promise.resolve(o[e])}async function g(e,t,r,n){let o=(0,c.describeStringPropertyAccess)(n,e);switch(r.type){case"prerender-ppr":return(0,i.postponeWithTracking)(t.route,o,r.dynamicTracking);case"prerender-legacy":return(0,i.throwToInterruptStaticGeneration)(o,t,r)}}},90176:(e,t,r)=>{"use strict";var n,i=r(22309),o=r(22709)(),a=r(6518),s=r(45779);if(o){var c=i("RegExp.prototype.exec"),u={},l=function(){throw u},d={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(d[Symbol.toPrimitive]=l),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&a(t,"value")))return!1;try{c(e,d)}catch(e){return e===u}}}else{var h=i("Object.prototype.toString"),p="[object RegExp]";n=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&h(e)===p}}e.exports=n},91535:e=>{"use strict";var t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of n(o))i.call(e,c)||c===a||t(e,c,{get:()=>o[c],enumerable:!(s=r(o,c))||s.enumerable});return e},a=e=>o(t({},"__esModule",{value:!0}),e),s={};function c(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function u(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){if(!e)return;let[[t,r],...n]=u(e),{domain:i,expires:o,httponly:a,maxage:s,path:c,samesite:l,secure:h,partitioned:f,priority:m}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));return d({name:t,value:decodeURIComponent(r),domain:i,...o&&{expires:new Date(o)},...a&&{httpOnly:!0},..."string"==typeof s&&{maxAge:Number(s)},path:c,...l&&{sameSite:p(l)},...h&&{secure:!0},...m&&{priority:y(m)},...f&&{partitioned:!0}})}function d(e){let t={};for(let r in e)e[r]&&(t[r]=e[r]);return t}((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(s,{RequestCookies:()=>g,ResponseCookies:()=>b,parseCookie:()=>u,parseSetCookie:()=>l,stringifyCookie:()=>c}),e.exports=a(s);var h=["strict","lax","none"];function p(e){return e=e.toLowerCase(),h.includes(e)?e:void 0}var f=["low","medium","high"];function y(e){return e=e.toLowerCase(),f.includes(e)?e:void 0}function m(e){if(!e)return[];var t,r,n,i,o,a=[],s=0;function c(){for(;s<e.length&&/\s/.test(e.charAt(s));)s+=1;return s<e.length}function u(){return"="!==(r=e.charAt(s))&&";"!==r&&","!==r}for(;s<e.length;){for(t=s,o=!1;c();)if(","===(r=e.charAt(s))){for(n=s,s+=1,c(),i=s;s<e.length&&u();)s+=1;s<e.length&&"="===e.charAt(s)?(o=!0,s=i,a.push(e.substring(t,n)),t=s):s=n+1}else s+=1;(!o||s>=e.length)&&a.push(e.substring(t,e.length))}return a}var g=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of u(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}
15has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>c(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>c(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},b=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:m(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,_({name:t,value:r,...n})),w(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(c).join("; ")}};function w(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=c(r);t.append("set-cookie",e)}}function _(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}},91604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(26809)},91886:(e,t,r)=>{"use strict";var n=r(49544),i=r(33512),o=r(71735),a=r(22309),s=r(45779),c=r(30676),u=a("Object.prototype.toString"),l=r(22709)(),d="undefined"==typeof globalThis?r.g:globalThis,h=i(),p=a("String.prototype.slice"),f=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return -1},y={__proto__:null};l&&s&&c?n(h,function(e){var t=new d[e];if(Symbol.toStringTag in t&&c){var r=c(t),n=s(r,Symbol.toStringTag);if(!n&&r&&(n=s(c(r),Symbol.toStringTag)),n&&n.get){var i=o(n.get);y["$"+e]=i}}}):n(h,function(e){var t=new d[e],r=t.slice||t.set;if(r){var n=o(r);y["$"+e]=n}});var m=function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=p(n,1))}catch(e){}}),t},g=function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=p(n,1)}catch(e){}}),t};e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=p(u(e),8,-1);return f(h,t)>-1?t:"Object"===t&&g(e)}return s?m(e):null}},93854:e=>{"use strict";e.exports=Math.max},95287:(e,t,r)=>{"use strict";r.d(t,{$A:()=>a,Mj:()=>l,W9:()=>d,cp:()=>s,l$:()=>h,nX:()=>p,tY:()=>o,uz:()=>c,zA:()=>u});var n=r(89308);class i extends n.F{toJSON(){return{error:this.error,error_description:this.error_description}}get code(){return this.error}}class o extends n.F{constructor(e){super(e),this.code="invalid_request",Object.setPrototypeOf(this,o.prototype),this.name="InvalidRequestError"}toJSON(){return{error:this.code,error_description:this.message}}}class a extends i{constructor(e,t,r){super(t),this.name="MfaGetAuthenticatorsError",this.error=e,this.error_description=t,this.cause=r,Object.setPrototypeOf(this,a.prototype)}}class s extends i{constructor(e,t,r){super(t),this.name="MfaChallengeError",this.error=e,this.error_description=t,this.cause=r,Object.setPrototypeOf(this,s.prototype)}}class c extends i{constructor(e,t,r){super(t),this.name="MfaVerifyError",this.error=e,this.error_description=t,this.cause=r,Object.setPrototypeOf(this,c.prototype)}}class u extends n.F{constructor(e){super(e),this.code="mfa_no_available_factors",this.error="mfa_no_available_factors",this.name="MfaNoAvailableFactorsError",this.error_description=e,Object.setPrototypeOf(this,u.prototype)}}class l extends i{constructor(e,t,r){super(t),this.name="MfaEnrollmentError",this.error=e,this.error_description=t,this.cause=r,Object.setPrototypeOf(this,l.prototype)}}class d extends n.F{constructor(e,t,r,n){super(e),this.code="mfa_required",this.error="mfa_required",this.name="MfaRequiredError",this.error_description=e,this.mfa_token=t,this.mfa_requirements=r,this.cause=n}toJSON(){return{error:this.error,error_description:this.error_description,mfa_token:this.mfa_token,...this.mfa_requirements&&{mfa_requirements:this.mfa_requirements}}}}class h extends n.F{constructor(){super("MFA token has expired. Please restart the MFA flow."),this.code="mfa_token_expired",this.name="MfaTokenExpiredError"}}
15class p extends n.F{constructor(){super("MFA token is invalid."),this.code="mfa_token_invalid",this.name="MfaTokenInvalidError"}}},96971:(e,t,r)=>{"use strict";var n=r(57462),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},97384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=r(91535)},97562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NextURL",{enumerable:!0,get:function(){return l}});let n=r(12072),i=r(72043),o=r(22908),a=r(63554),s=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function c(e,t){return new URL(String(e).replace(s,"localhost"),t&&String(t).replace(s,"localhost"))}let u=Symbol("NextURLInternal");class l{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[u]={url:c(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,i,s;let c=(0,a.getNextPathnameInfo)(this[u].url.pathname,{nextConfig:this[u].options.nextConfig,parseData:!0,i18nProvider:this[u].options.i18nProvider}),l=(0,o.getHostname)(this[u].url,this[u].options.headers);this[u].domainLocale=this[u].options.i18nProvider?this[u].options.i18nProvider.detectDomainLocale(l):(0,n.detectDomainLocale)(null==(t=this[u].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,l);let d=(null==(r=this[u].domainLocale)?void 0:r.defaultLocale)||(null==(s=this[u].options.nextConfig)||null==(i=s.i18n)?void 0:i.defaultLocale);this[u].url.pathname=c.pathname,this[u].defaultLocale=d,this[u].basePath=c.basePath??"",this[u].buildId=c.buildId,this[u].locale=c.locale??d,this[u].trailingSlash=c.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[u].basePath,buildId:this[u].buildId,defaultLocale:this[u].options.forceLocale?void 0:this[u].defaultLocale,locale:this[u].locale,pathname:this[u].url.pathname,trailingSlash:this[u].trailingSlash})}formatSearch(){return this[u].url.search}get buildId(){return this[u].buildId}set buildId(e){this[u].buildId=e}get locale(){return this[u].locale??""}set locale(e){var t,r;if(!this[u].locale||!(null==(r=this[u].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[u].locale=e}get defaultLocale(){return this[u].defaultLocale}get domainLocale(){return this[u].domainLocale}get searchParams(){return this[u].url.searchParams}get host(){return this[u].url.host}set host(e){this[u].url.host=e}get hostname(){return this[u].url.hostname}set hostname(e){this[u].url.hostname=e}get port(){return this[u].url.port}set port(e){this[u].url.port=e}get protocol(){return this[u].url.protocol}set protocol(e){this[u].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[u].url=c(e),this.analyze()}get origin(){return this[u].url.origin}get pathname(){return this[u].url.pathname}set pathname(e){this[u].url.pathname=e}get hash(){return this[u].url.hash}set hash(e){this[u].url.hash=e}get search(){return this[u].url.search}set search(e){this[u].url.search=e}get password(){return this[u].url.password}set password(e){this[u].url.password=e}get username(){return this[u].url.username}set username(e){this[u].url.username=e}get basePath(){return this[u].basePath}set basePath(e){this[u].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new l(String(this),this[u].options)}}},97608:(e,t,r)=>{var n=r(37811),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!S(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,i=n.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<i;s=n[++r])v(s)||!P(s)?a+=" "+s:a+=" "+u(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;s=RegExp("^"+(c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase())+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),_(r)?n.showHidden=r:r&&t._extend(n,r),A(n.showHidden)&&(n.showHidden=!1),A(n.depth)&&(n.depth=2),A(n.colors)&&(n.colors=!1),A(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),p(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function d(e,t){return e}function h(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function p(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o=r.inspect(n,e);return S(o)||(o=p(e,o,n)),o}var a=f(e,r);if(a)return a;var s=Object.keys(r),c=h(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),R(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return y(r);if(0===s.length){if(O(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(R(r))return y(r)}var l="",d=!1,_=["{","}"];if(w(r)&&(d=!0,_=["[","]"]),O(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),k(r)&&(l=" "+RegExp.prototype.toString.call(r)),T(r)&&(l=" "+Date.prototype.toUTCString.call(r)),R(r)&&(l=" "+y(r)),0===s.length&&(!d||0==r.length))return _[0]+l+_[1];if(n<0)if(k(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");else return e.stylize("[Object]","special");return e.seen.push(r),i=d?m(e,r,n,c,s):s.map(function(t){return g(e,r,n,c,t,d)}),e.seen.pop(),b(i,l,_)}function f(e,t){if(A(t))return e.stylize("undefined","undefined");if(S(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";
15return e.stylize(r,"string")}return E(t)?e.stylize(""+t,"number"):_(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)N(t,String(a))?o.push(g(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))}),o}function g(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),N(n,i)||(a="["+i+"]"),!s&&(0>e.seen.indexOf(c.value)?(s=v(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),A(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function b(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function w(e){return Array.isArray(e)}function _(e){return"boolean"==typeof e}function v(e){return null===e}function E(e){return"number"==typeof e}function S(e){return"string"==typeof e}function A(e){return void 0===e}function k(e){return P(e)&&"[object RegExp]"===x(e)}function P(e){return"object"==typeof e&&null!==e}function T(e){return P(e)&&"[object Date]"===x(e)}function R(e){return P(e)&&("[object Error]"===x(e)||e instanceof Error)}function O(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function C(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(88329),t.isArray=w,t.isBoolean=_,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=E,t.isString=S,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=A,t.isRegExp=k,t.types.isRegExp=k,t.isObject=P,t.isDate=T,t.types.isDate=T,t.isError=R,t.types.isNativeError=R,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(85446);var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(42951),t._extend=function(e,t){if(!t||!P(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var D="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function U(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(D&&e[D]){var t=e[D];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,D,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),D&&Object.defineProperty(t,D,{value:t,enumerable:!1,writable:!1,
15configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=D,t.callbackify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then(function(e){n.nextTick(a.bind(null,null,e))},function(e){n.nextTick(U.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},98173:(e,t,r)=>{"use strict";r.d(t,{cookies:()=>n.U});var n=r(17709);r(46068),r(14219)}}]);
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.