Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack should not warn import usage, when import is unreachable (e.g. guarded by if statement) #14814

Open
eps1lon opened this issue Nov 24, 2021 · 13 comments · May be fixed by #15497
Open

webpack should not warn import usage, when import is unreachable (e.g. guarded by if statement) #14814

eps1lon opened this issue Nov 24, 2021 · 13 comments · May be fixed by #15497

Comments

@eps1lon
Copy link

eps1lon commented Nov 24, 2021

Bug report

What is the current behavior?

Bundling

import * as React from "react";
if (React.useId !== undefined) {
  // do something with React.useId
}

will currently warn with export 'useId' (imported as 'React') was not found in 'react' (or crash if strictExportPresence is enabled).

If the current behavior is a bug, please provide the steps to reproduce.

  1. Clone https://github.com/eps1lon/webpack-export-shim
  2. yarn start:webpack

What is the expected behavior?

No warning in this case (just like Node.js and browsers with ES modules support. The repro repository has steps to verify the above code is safe in an ES module browser and Node.js).
We want to write code that works for both React 17 and React 18 (or rather provides improved behavior for React 18). However, this warning makes using the library very disruptive and even impossible if you have strictExportPresence enabled (like Create React App has): mui/material-ui#29860.
The warning should probably apply to unconditional usage but in our case we have usage guarded with Module.namedExport !== undefined. This seems statically analyzeable and safe to disable the warning for every usage in that block).

Other relevant information:
webpack version: npm:5.64.3
Node.js version: 16.13.0
Operating System: Ubuntu 20.04.3 LTS
Additional tools: Chrome Version 96.0.4664.45

@vankop
Copy link
Member

vankop commented Nov 24, 2021

The warning should probably apply to unconditional usage but in our case we have usage guarded with Module.namedExport !== undefined

guarding make sense, not sure that this will be implemented..

@vankop
Copy link
Member

vankop commented Nov 24, 2021

for now you can do something like:

if ("useId" in React) {
  // do something with React["useId".toString()]
}

but thats will bundle all React..

@eps1lon
Copy link
Author

eps1lon commented Nov 24, 2021

guarding make sense, not sure that this will be implemented..

In the absence of it, the warning shouldn't exist considering bundlers don't guard against any other missing property access. A type system is much better equipped to handle these issues.

but thats will bundle all React..

That's generally not an issue since react is relatively small and you oftentimes use most of the module anyway.

@sgrobert
Copy link

Hi there,

Just to add, these two bugs will crash a Vercel setup. So hope that this bug can be resolved soon.

  1. ./node_modules/@mui/utils/esm/useId.js
    Attempted import error: 'useId' is not exported from 'react' (imported as 'React').

  2. ./node_modules/@mui/utils/esm/useId.js
    Attempted import error: 'useId' is not exported from 'react' (imported as 'React').


Thank you.

@indykish
Copy link

Fix

strictExportPresence: false

Solves this.

Are there any better ideas?

Is webpack coming up with a patch?

@alexander-akait
Copy link
Member

We will fix it, no need to duplicate, just wait

@indykish
Copy link

We will fix it, no need to duplicate, just wait

Thank you, looking forward.

@sgrobert
Copy link

Hi there,

Just to add, these two bugs will crash a Vercel setup. So hope that this bug can be resolved soon.

  1. ./node_modules/@mui/utils/esm/useId.js
    Attempted import error: 'useId' is not exported from 'react' (imported as 'React').
  2. ./node_modules/@mui/utils/esm/useId.js
    Attempted import error: 'useId' is not exported from 'react' (imported as 'React').

Thank you.


Adding some further context on the Vercel breakage if it helps the team as well:

Screenshot 2021-11-25 at 6 29 07 PM

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[179],{60400:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var a=/\((.*)\)/.exec(this.toString());return a?a[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(a,b){return b=this.concat.apply([],this),a>1&&b.some(Array.isArray)?b.flat(a-1):b},Array.prototype.flatMap=function(a,b){return this.map(a,b).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(a){if("function"!=typeof a)return this.then(a,a);var b=this.constructor||Promise;return this.then(function(c){return b.resolve(a()).then(function(){return c})},function(c){return b.resolve(a()).then(function(){throw c})})})},96086:function(a){"use strict";var b=Object.assign.bind(Object);a.exports=b,a.exports.default=a.exports},56007:function(a,b){"use strict";function c(a,b){return null!=b&&"undefined"!=typeof Symbol&&b[Symbol.hasInstance]?b[Symbol.hasInstance](a):a instanceof b}Object.defineProperty(b,"__esModule",{value:!0}),b.isEqualNode=f,b.default=function(){var a=null;return{mountedInstances:new Set(),updateHead:function(b){var c=a=Promise.resolve().then(function(){if(c===a){a=null;var d={};b.forEach(function(a){if("link"===a.type&&a.props["data-optimized-fonts"]){if(document.querySelector("style[data-href=\"".concat(a.props["data-href"],"\"]")))return;a.props.href=a.props["data-href"],a.props["data-href"]=void 0}var b=d[a.type]||[];b.push(a),d[a.type]=b});var g=d.title?d.title[0]:null,h="";if(g){var i=g.props.children;h="string"==typeof i?i:Array.isArray(i)?i.join(""):""}h!==document.title&&(document.title=h),["meta","base","link","style","script"].forEach(function(a){!function(a,b){for(var c,d=document.getElementsByTagName("head")[0],g=d.querySelector("meta[name=next-head-count]"),h=Number(g.content),i=[],j=0,k=g.previousElementSibling;j<h;j++,k=(null==k?void 0:k.previousElementSibling)||null)(null==k?void 0:null===(c=k.tagName)|| void 0===c?void 0:c.toLowerCase())===a&&i.push(k);var l=b.map(e).filter(function(a){for(var b=0,c=i.length;b<c;b++)if(f(i[b],a))return i.splice(b,1),!1;return!0});i.forEach(function(a){var b;return null===(b=a.parentNode)|| void 0===b?void 0:b.removeChild(a)}),l.forEach(function(a){return d.insertBefore(a,g)}),g.content=(h-i.length+l.length).toString()}(a,d[a]||[])})}})}}},b.DOMAttributeNames=void 0;var d={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function e(a){var b=a.type,c=a.props,e=document.createElement(b);for(var f in c)if(c.hasOwnProperty(f)&&"children"!==f&&"dangerouslySetInnerHTML"!==f&& void 0!==c[f]){var g=d[f]||f.toLowerCase();"script"===b&&("async"===g||"defer"===g||"noModule"===g)?e[g]=!!c[f]:e.setAttribute(g,c[f])}var h=c.children,i=c.dangerouslySetInnerHTML;return i?e.innerHTML=i.__html||"":h&&(e.textContent="string"==typeof h?h:Array.isArray(h)?h.join(""):""),e}function f(a,b){if(c(a,HTMLElement)&&c(b,HTMLElement)){var d=b.getAttribute("nonce");if(d&&!a.getAttribute("nonce")){var e=b.cloneNode(!0);return e.setAttribute("nonce",""),e.nonce=d,d===a.nonce&&a.isEqualNode(e)}}return a.isEqualNode(b)}b.DOMAttributeNames=d},77339:function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l=(d=c(28520))&&d.__esModule?d:{default:d};function m(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function n(a){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(a)}function o(a,b){return null!=b&&"undefined"!=typeof Symbol&&b[Symbol.hasInstance]?b[Symbol.hasInstance](a):a instanceof b}function p(a,b){return(p=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}Object.defineProperty(b,"__esModule",{value:!0}),b.initNext=function(){return ja.apply(this,arguments)},b.render=la,b.renderError=ma,b.emitter=b.router=b.version=void 0,c(60400);var q=L(c(67294)),r=L(c(73935)),s=c(8771),t=c(8404),u=L(c(35660)),v=c(63462),w=c(76273),x=c(78689),y=c(50466),z=c(88027),A=c(63794),B=c(32207),C=L(c(56007)),D=L(c(95181)),E=L(c(59302)),F=c(48982),G=c(90387),H=L(c(80676)),I=c(77813);function J(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(j){c(j);return}h.done?b(i):Promise.resolve(i).then(d,e)}function K(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var f=a.apply(b,c);function g(a){J(f,d,e,g,h,"next",a)}function h(a){J(f,d,e,g,h,"throw",a)}g(void 0)})}}function L(a){return a&&a.__esModule?a:{default:a}}function M(a){for(var b=arguments,c=1;c<arguments.length;c++)!function(c){var d=null!=b[c]?b[c]:{},e=Object.keys(d);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(d).filter(function(a){return Object.getOwnPropertyDescriptor(d,a).enumerable}))),e.forEach(function(b){var c,e,f;c=a,e=b,f=d[b],e in c?Object.defineProperty(c,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):c[e]=f})}(c);return a}var N=JSON.parse(document.getElementById("__NEXT_DATA__").textContent);window.__NEXT_DATA__=N,b.version="12.0.4";var O=function(a){return[].slice.call(a)},P=N.props,Q=N.err,R=N.page,S=N.query,T=N.buildId,U=N.assetPrefix,V=N.runtimeConfig,W=N.dynamicIds,X=N.isFallback,Y=N.locale,Z=N.locales,$=N.domainLocales,_=N.isPreview;N.rsc;var aa=N.defaultLocale,ba=U||"";c.p="".concat(ba,"/_next/"),z.setConfig({serverRuntimeConfig:{},publicRuntimeConfig:V||{}});var ca=A.getURL();w.hasBasePath(ca)&&(ca=w.delBasePath(ca)),N.scriptLoader&&(0,c(20699).zD)(N.scriptLoader);var da=new D.default(T,ba),ea=function(a){var b,c=function(a){if(Array.isArray(a))return a}(b=a)||function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c}(b,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),d=c[0],e=c[1];return da.routeLoader.onEntrypoint(d,e)};window.__NEXT_P&&window.__NEXT_P.map(function(a){return setTimeout(function(){return ea(a)},0)}),window.__NEXT_P=[],window.__NEXT_P.push=ea;var fa=C.default(),ga=document.getElementById("__next");b.router=f,fa.getIsSsr=function(){return f.isSsr};var ha=function(a){!function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&p(a,b)}(g,a);var b,c,d,e=function(a){var b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}();return function(){var c,d,e,f,g=n(a);if(b){var h=n(this).constructor;f=Reflect.construct(g,arguments,h)}else f=g.apply(this,arguments);return d=this,(e=f)&&("object"==((c=e)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)||"function"==typeof e)?e:(function(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a})(d)}}(g);function g(){return!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,g),e.apply(this,arguments)}return b=g,c=[{key:"componentDidCatch",value:function(a,b){this.props.fn(a,b)}},{key:"componentDidMount",value:function(){this.scrollToHash(),f.isSsr&&"/404"!==R&&"/_error"!==R&&(X||N.nextExport&&(x.isDynamicRoute(f.pathname)||location.search||!1)||P&&P.__N_SSG&&(location.search||!1))&&f.replace(f.pathname+"?"+String(y.assign(y.urlQueryToSearchParams(f.query),new URLSearchParams(location.search))),ca,{_h:1,shallow:!X})}},{key:"componentDidUpdate",value:function(){this.scrollToHash()}},{key:"scrollToHash",value:function(){var a=location.hash;if(a=a&&a.substring(1)){var b=document.getElementById(a);b&&setTimeout(function(){return b.scrollIntoView()},0)}}},{key:"render",value:function(){return this.props.children}}],m(b.prototype,c),d&&m(b,d),g}(q.default.Component),ia=u.default();function ja(){return(ja=K(l.default.mark(function a(c){var d,e,j,k,m,n,o,p;return l.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return d=void 0===c?{}:c,e=Q,a.prev=3,a.next=6,da.routeLoader.whenEntrypoint("/_app");case 6:if(!("error"in(j=a.sent))){a.next=9;break}throw j.error;case 9:k=j.component,m=j.exports,g=k,n=m&&m.reportWebVitals,h=function(a){var b,c=a.id,d=a.name,e=a.startTime,f=a.value,g=a.duration,h=a.entryType,i=a.entries,j="".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+10e11);i&&i.length&&(b=i[0].startTime);var k={id:c||j,name:d,startTime:e||b,value:null==f?g:f,label:"mark"===h||"measure"===h?"custom":"web-vital"};null==n||n(k),I.trackWebVitalMetric(k)},a.next=17;break;case 17:return a.next=19,da.routeLoader.whenEntrypoint(R);case 19:a.t0=a.sent;case 20:if(!("error"in(o=a.t0))){a.next=23;break}throw o.error;case 23:i=o.component,a.next=28;break;case 28:a.next=33;break;case 30:a.prev=30,a.t1=a.catch(3),e=H.default(a.t1)?a.t1:new Error(a.t1+"");case 33:if(!window.__NEXT_PRELOADREADY){a.next=37;break}return a.next=37,window.__NEXT_PRELOADREADY(W);case 37:return b.router=f=G.createRouter(R,S,ca,{initialProps:P,pageLoader:da,App:g,Component:i,wrapApp:sa,err:e,isFallback:Boolean(X),subscription:function(a,b,c){return la(Object.assign({},a,{App:b,scroll:c}))},locale:Y,locales:Z,defaultLocale:aa,domainLocales:$,isPreview:_}),la(p={App:g,initial:!0,Component:i,props:P,err:e}),a.abrupt("return",ia);case 44:return a.abrupt("return",{emitter:ia,renderCtx:p});case 45:case"end":return a.stop()}},a,null,[[3,30]])}))).apply(this,arguments)}function ka(){return(ka=K(l.default.mark(function a(b){var c;return l.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!b.err){a.next=4;break}return a.next=3,ma(b);case 3:return a.abrupt("return");case 4:return a.prev=4,a.next=7,ta(b);case 7:a.next=17;break;case 9:if(a.prev=9,a.t0=a.catch(4),!(c=o(a.t0,Error)?a.t0:new Error(a.t0+"")).cancelled){a.next=14;break}throw c;case 14:return a.next=17,ma(M({},b,{err:c}));case 17:case"end":return a.stop()}},a,null,[[4,9]])}))).apply(this,arguments)}function la(a){return ka.apply(this,arguments)}function ma(a){var b=a.App,d=a.err;return console.error(d),console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"),da.loadPage("/_error").then(function(a){var b=a.page,d=a.styleSheets;return(null==k?void 0:k.Component)===b?Promise.resolve().then(function(){return(function(a){if(a&&a.__esModule)return a;var b={};if(null!=a){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}}return b.default=a,b})(c(89185))}).then(function(a){return{ErrorComponent:a.default,styleSheets:[]}}):{ErrorComponent:b,styleSheets:d}}).then(function(c){var e=c.ErrorComponent,g=c.styleSheets,h=sa(b);return Promise.resolve(a.props?a.props:A.loadGetInitialProps(b,{Component:e,AppTree:h,router:f,ctx:{err:d,pathname:R,query:S,asPath:ca,AppTree:h}})).then(function(b){return ta(M({},a,{err:d,Component:e,styleSheets:g,props:b}))})})}b.emitter=ia;var na=!0;function oa(){A.ST&&(performance.mark("afterHydrate"),performance.measure("Next.js-before-hydration","navigationStart","beforeRender"),performance.measure("Next.js-hydration","beforeRender","afterHydrate"),h&&performance.getEntriesByName("Next.js-hydration").forEach(h),qa())}function pa(){if(A.ST){performance.mark("afterRender");var a=performance.getEntriesByName("routeChange","mark");a.length&&(performance.measure("Next.js-route-change-to-render",a[0].name,"beforeRender"),performance.measure("Next.js-render","beforeRender","afterRender"),h&&(performance.getEntriesByName("Next.js-render").forEach(h),performance.getEntriesByName("Next.js-route-change-to-render").forEach(h)),qa(),["Next.js-route-change-to-render","Next.js-render"].forEach(function(a){return performance.clearMeasures(a)}))}}function qa(){["beforeRender","afterHydrate","afterRender","routeChange"].forEach(function(a){return performance.clearMarks(a)})}function ra(a){var b=a.children;return q.default.createElement(ha,{fn:function(a){return ma({App:g,err:a}).catch(function(a){return console.error("Error rendering page: ",a)})}},q.default.createElement(v.RouterContext.Provider,{value:G.makePublicRouterInstance(f)},q.default.createElement(t.HeadManagerContext.Provider,{value:fa},q.default.createElement(s.StyleRegistry,null,b))))}var sa=function(a){return function(b){var c=M({},b,{Component:i,err:Q,router:f});return q.default.createElement(ra,null,q.default.createElement(a,Object.assign({},c)))}};function ta(a){var b,c=function(){if(!o)return!1;var a=O(document.querySelectorAll("style[data-n-href]")),b=new Set(a.map(function(a){return a.getAttribute("data-n-href")})),c=document.querySelector("noscript[data-n-css]"),d=null==c?void 0:c.getAttribute("data-n-css");return o.forEach(function(a){var c=a.href,e=a.text;if(!b.has(c)){var f=document.createElement("style");f.setAttribute("data-n-href",c),f.setAttribute("media","x"),d&&f.setAttribute("nonce",d),document.head.appendChild(f),f.appendChild(document.createTextNode(e))}}),!0},d=function(){if(o&&!s){for(var b=new Set(o.map(function(a){return a.href})),c=O(document.querySelectorAll("style[data-n-href]")),d=c.map(function(a){return a.getAttribute("data-n-href")}),e=0;e<d.length;++e)b.has(d[e])?c[e].removeAttribute("media"):c[e].setAttribute("media","x");var f=document.querySelector("noscript[data-n-css]");f&&o.forEach(function(a){var b=a.href,c=document.querySelector("style[data-n-href=\"".concat(b,"\"]"));c&&(f.parentNode.insertBefore(c,f.nextSibling),f=c)}),O(document.querySelectorAll("link[data-n-p]")).forEach(function(a){a.parentNode.removeChild(a)})}a.scroll&&window.scrollTo(a.scroll.x,a.scroll.y)},g=function(){b()},h=a.App,i=a.Component,l=a.props,m=a.err,n=a.__N_RSC,o="initial"in a?void 0:a.styleSheets;i=i||k.Component,l=l||k.props;var p=M({},l,{Component:n?j:i,err:m,router:f});k=p;var s=!1,t=new Promise(function(a,c){e&&e(),b=function(){e=null,a()},e=function(){s=!0,e=null;var a=new Error("Cancel rendering route");a.cancelled=!0,c(a)}});c();var u=q.default.createElement(q.default.Fragment,null,q.default.createElement(va,{callback:d}),q.default.createElement(ra,null,q.default.createElement(h,Object.assign({},p)),q.default.createElement(B.Portal,{type:"next-route-announcer"},q.default.createElement(F.RouteAnnouncer,null))));return!function(a,b){A.ST&&performance.mark("beforeRender");var c=b(na?oa:pa);na?(r.default.hydrate(c,a),na=!1):r.default.render(c,a)}(ga,function(a){return q.default.createElement(ua,{callbacks:[a,g]},u)}),t}function ua(a){var b=a.callbacks,c=a.children;return q.default.useLayoutEffect(function(){return b.forEach(function(a){return a()})},[b]),q.default.useEffect(function(){E.default(h)},[]),c}function va(a){var b=a.callback;return q.default.useLayoutEffect(function(){return b()},[b]),null}},22870:function(a,b,c){"use strict";var d=c(77339);window.next={version:d.version,get router(){return d.router},emitter:d.emitter,render:d.render,renderError:d.renderError},d.initNext().catch(console.error)},82392:function(a,b){"use strict";function c(a){return a.endsWith("/")&&"/"!==a?a.slice(0,-1):a}Object.defineProperty(b,"__esModule",{value:!0}),b.removePathTrailingSlash=c,b.normalizePathTrailingSlash=void 0,b.normalizePathTrailingSlash=c},95181:function(a,b,c){"use strict";function d(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var e,f=c(76273),g=(e=c(73891))&&e.__esModule?e:{default:e},h=c(78689),i=c(36305),j=c(82392),k=c(22669),l=function(){var a,b,c;function e(a,b){!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,e),this.routeLoader=k.createRouteLoader(b),this.buildId=a,this.assetPrefix=b,this.promisedSsgManifest=new Promise(function(a){window.__SSG_MANIFEST?a(window.__SSG_MANIFEST):window.__SSG_MANIFEST_CB=function(){a(window.__SSG_MANIFEST)}})}return a=e,b=[{key:"getPageList",value:function(){return k.getClientBuildManifest().then(function(a){return a.sortedPages})}},{key:"getMiddlewareList",value:function(){return k.getMiddlewareManifest()}},{key:"getDataHref",value:function(a){var b=a.href,c=a.asPath,d=a.ssg,e=a.rsc,k=a.locale,l=this,m=i.parseRelativeUrl(b),n=m.pathname,o=m.query,p=m.search,q=i.parseRelativeUrl(c),r=q.pathname,s=function(a){if("/"!==a[0])throw new Error("Route name should start with a \"/\", got \"".concat(a,"\""));return"/"===a?a:a.replace(/\/$/,"")}(n),t=function(a){if(e)return a+"?__flight__";var b=g.default(j.removePathTrailingSlash(f.addLocale(a,k)),".json");return f.addBasePath("/_next/data/".concat(l.buildId).concat(b).concat(d?"":p))},u=h.isDynamicRoute(s),v=u?f.interpolateAs(n,r,o).result:"";return u?v&&t(v):t(s)}},{key:"_isSsg",value:function(a){return this.promisedSsgManifest.then(function(b){return b.has(a)})}},{key:"loadPage",value:function(a){return this.routeLoader.loadRoute(a).then(function(a){if("component"in a)return{page:a.component,mod:a.exports,styleSheets:a.styles.map(function(a){return{href:a.href,text:a.content}})};throw a.error})}},{key:"prefetch",value:function(a){return this.routeLoader.prefetch(a)}}],d(a.prototype,b),c&&d(a,c),e}();b.default=l},59302:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var d,e=c(38745),f=location.href,g=!1;function h(a){d&&d(a);var b=function(){fetch(g,{body:e,method:"POST",credentials:"omit",keepalive:!0}).catch(console.error)},c={dsn:"5dcfMsM2ywNPDi1NOOKkAs6sWYj",id:a.id,page:window.__NEXT_DATA__.page,href:f,event_name:a.name,value:a.value.toString(),speed:"connection"in navigator&&navigator.connection&&"effectiveType"in navigator.connection?navigator.connection.effectiveType:""},e=new Blob([new URLSearchParams(c).toString()],{type:"application/x-www-form-urlencoded"}),g="https://vitals.vercel-insights.com/v1/vitals",h=navigator.sendBeacon&&navigator.sendBeacon.bind(navigator);try{h(g,e)||b()}catch(i){b()}}b.default=function(a){d=a,g||(g=!0,e.getCLS(h),e.getFID(h),e.getFCP(h),e.getLCP(h),e.getTTFB(h))}},32207:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.Portal=void 0;var d,e=(d=c(67294))&&d.__esModule?d:{default:d},f=c(73935);b.Portal=function(a){var b,c=a.children,d=a.type,g=e.default.useRef(null),h=function(a){if(Array.isArray(a))return a}(b=e.default.useState())||function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c}(b,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),i=h[1];return e.default.useEffect(function(){return g.current=document.createElement(d),document.body.appendChild(g.current),i({}),function(){g.current&&document.body.removeChild(g.current)}},[d]),g.current?f.createPortal(c,g.current):null}},9311:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.cancelIdleCallback=b.requestIdleCallback=void 0;var c="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(a){var b=Date.now();return setTimeout(function(){a({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-b))}})},1)};b.requestIdleCallback=c;var d="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(a){return clearTimeout(a)};b.cancelIdleCallback=d},48982:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.RouteAnnouncer=g,b.default=void 0;var d,e=(d=c(67294))&&d.__esModule?d:{default:d},f=c(90387);function g(){var a,b=f.useRouter().asPath,c=function(a){if(Array.isArray(a))return a}(a=e.default.useState(""))||function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c}(a,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),d=c[0],g=c[1],h=e.default.useRef(!1);return e.default.useEffect(function(){if(!h.current){h.current=!0;return}if(document.title)g(document.title);else{var a,c=document.querySelector("h1");g((null!==(a=null==c?void 0:c.innerText)&& void 0!==a?a:null==c?void 0:c.textContent)||b)}},[b]),e.default.createElement("p",{"aria-live":"assertive",id:"__next-route-announcer__",role:"alert",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},d)}b.default=g},22669:function(a,b,c){"use strict";var d;Object.defineProperty(b,"__esModule",{value:!0}),b.markAssetError=i,b.isAssetError=function(a){return a&&h in a},b.getClientBuildManifest=k,b.getMiddlewareManifest=function(){return self.__MIDDLEWARE_MANIFEST?Promise.resolve(self.__MIDDLEWARE_MANIFEST):j(new Promise(function(a){var b=self.__MIDDLEWARE_MANIFEST_CB;self.__MIDDLEWARE_MANIFEST_CB=function(){a(self.__MIDDLEWARE_MANIFEST),b&&b()}}),3800,i(new Error("Failed to load client middleware manifest")))},b.createRouteLoader=function(a){var b=function(a){var b,c,d=h.get(a);return d||(document.querySelector("script[src^=\"".concat(a,"\"]"))?Promise.resolve():(h.set(a,d=(b=a,new Promise(function(a,d){(c=document.createElement("script")).onload=a,c.onerror=function(){return d(i(new Error("Failed to load script: ".concat(b))))},c.crossOrigin=void 0,c.src=b,document.body.appendChild(c)}))),d))},c=function(a){var b=k.get(a);return b||k.set(a,b=fetch(a).then(function(b){if(!b.ok)throw new Error("Failed to load stylesheet: ".concat(a));return b.text().then(function(b){return{href:a,content:b}})}).catch(function(a){throw i(a)})),b},d=new Map(),h=new Map(),k=new Map(),m=new Map();return{whenEntrypoint:function(a){return f(a,d)},onEntrypoint:function(a,b){(b?Promise.resolve().then(function(){return b()}).then(function(a){return{component:a&&a.default||a,exports:a}},function(a){return{error:a}}):Promise.resolve(void 0)).then(function(b){var c=d.get(a);c&&"resolve"in c?b&&(d.set(a,b),c.resolve(b)):(b?d.set(a,b):d.delete(a),m.delete(a))})},loadRoute:function(e,g){var h=this;return f(e,m,function(){var f=h;return j(l(a,e).then(function(a){var f=a.scripts,g=a.css;return Promise.all([d.has(e)?[]:Promise.all(f.map(b)),Promise.all(g.map(c)),])}).then(function(a){return f.whenEntrypoint(e).then(function(b){return{entrypoint:b,styles:a[1]}})}),3800,i(new Error("Route did not complete loading: ".concat(e)))).then(function(a){var b=a.entrypoint,c=a.styles,d=Object.assign({styles:c},b);return"error"in b?b:d}).catch(function(a){if(g)throw a;return{error:a}})})},prefetch:function(b){var c,d=this;return(c=navigator.connection)&&(c.saveData||/2g/.test(c.effectiveType))?Promise.resolve():l(a,b).then(function(a){return Promise.all(g?a.scripts.map(function(a){var b,c,d;return b=a,c="script",new Promise(function(a,e){var f="\n      link[rel=\"prefetch\"][href^=\"".concat(b,"\"],\n      link[rel=\"preload\"][href^=\"").concat(b,"\"],\n      script[src^=\"").concat(b,"\"]");if(document.querySelector(f))return a();d=document.createElement("link"),c&&(d.as=c),d.rel="prefetch",d.crossOrigin=void 0,d.onload=a,d.onerror=e,d.href=b,document.head.appendChild(d)})}):[])}).then(function(){var a=d;e.requestIdleCallback(function(){return a.loadRoute(b,!0).catch(function(){})})}).catch(function(){})}}},(d=c(73891))&&d.__esModule;var e=c(9311);function f(a,b,c){var d,e=b.get(a);if(e)return"future"in e?e.future:Promise.resolve(e);var f=new Promise(function(a){d=a});return b.set(a,e={resolve:d,future:f}),c?c().then(function(a){return d(a),a}).catch(function(c){throw b.delete(a),c}):f}var g=function(a){try{return a=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||a.relList.supports("prefetch")}catch(b){return!1}}(),h=Symbol("ASSET_LOAD_ERROR");function i(a){return Object.defineProperty(a,h,{})}function j(a,b,c){return new Promise(function(d,f){var g=!1;a.then(function(a){g=!0,d(a)}).catch(f),e.requestIdleCallback(function(){return setTimeout(function(){g||f(c)},b)})})}function k(){return self.__BUILD_MANIFEST?Promise.resolve(self.__BUILD_MANIFEST):j(new Promise(function(a){var b=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=function(){a(self.__BUILD_MANIFEST),b&&b()}}),3800,i(new Error("Failed to load client build manifest")))}function l(a,b){return k().then(function(c){if(!(b in c))throw i(new Error("Failed to lookup route: ".concat(b)));var d=c[b].map(function(b){return a+"/_next/"+encodeURI(b)});return{scripts:d.filter(function(a){return a.endsWith(".js")}),css:d.filter(function(a){return a.endsWith(".css")})}})}},90387:function(a,b,c){"use strict";function d(a,b,c){return(d=!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(a){return!1}}()?function(a,b,c){var d=[null];d.push.apply(d,b);var f=new(Function.bind.apply(a,d))();return c&&e(f,c.prototype),f}:Reflect.construct).apply(null,arguments)}function e(a,b){return(e=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}function f(a){return(function(a){if(Array.isArray(a)){for(var b=0,c=new Array(a.length);b<a.length;b++)c[b]=a[b];return c}})(a)||(function(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)})(a)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance")})()}Object.defineProperty(b,"__esModule",{value:!0}),Object.defineProperty(b,"Router",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(b,"withRouter",{enumerable:!0,get:function(){return k.default}}),b.useRouter=function(){return g.default.useContext(i.RouterContext)},b.createRouter=function(){for(var a=arguments.length,b=new Array(a),c=0;c<a;c++)b[c]=arguments[c];return m.router=d(h.default,f(b)),m.readyCallbacks.forEach(function(a){return a()}),m.readyCallbacks=[],m.router},b.makePublicRouterInstance=function(a){var b=a,c={},d=!0,e=!1,g=void 0;try{for(var i,j=n[Symbol.iterator]();!(d=(i=j.next()).done);d=!0){var k=i.value;if("object"==typeof b[k]){c[k]=Object.assign(Array.isArray(b[k])?[]:{},b[k]);continue}c[k]=b[k]}}catch(l){e=!0,g=l}finally{try{d||null==j.return||j.return()}finally{if(e)throw g}}return c.events=h.default.events,o.forEach(function(a){c[a]=function(){for(var c,d=arguments.length,e=new Array(d),g=0;g<d;g++)e[g]=arguments[g];return(c=b)[a].apply(c,f(e))}}),c},b.default=void 0;var g=l(c(67294)),h=l(c(76273)),i=c(63462),j=l(c(80676)),k=l(c(38981));function l(a){return a&&a.__esModule?a:{default:a}}var m={router:null,readyCallbacks:[],ready:function(a){if(this.router)return a();this.readyCallbacks.push(a)}},n=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales",],o=["push","replace","reload","back","prefetch","beforePopState",];function p(){if(!m.router){var a="No router instance found.\nYou should only use \"next/router\" on the client side of your app.\n";throw new Error(a)}return m.router}Object.defineProperty(m,"events",{get:function(){return h.default.events}}),n.forEach(function(a){Object.defineProperty(m,a,{get:function(){return p()[a]}})}),o.forEach(function(a){m[a]=function(){for(var b,c=arguments.length,d=new Array(c),e=0;e<c;e++)d[e]=arguments[e];return(b=p())[a].apply(b,f(d))}}),["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete",].forEach(function(a){m.ready(function(){h.default.events.on(a,function(){for(var b,c=arguments.length,d=new Array(c),e=0;e<c;e++)d[e]=arguments[e];var g="on".concat(a.charAt(0).toUpperCase()).concat(a.substring(1)),h=m;if(h[g])try{(b=h)[g].apply(b,f(d))}catch(i){console.error("Error when running the Router event: ".concat(g)),console.error(j.default(i)?"".concat(i.message,"\n").concat(i.stack):i+"")}})})}),b.default=m},20699:function(a,b,c){"use strict";function d(a,b){return(function(a){if(Array.isArray(a))return a})(a)||(function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c})(a,b)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")})()}b.zD=function(a){a.forEach(k)},(function(a){if(a&&a.__esModule)return a;var b={};if(null!=a){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}}b.default=a})(c(67294)),c(8404);var e=c(56007),f=c(9311),g=new Map(),h=new Set(),i=["onLoad","dangerouslySetInnerHTML","children","onError","strategy",],j=function(a){var b=a.src,c=a.id,f=a.onLoad,j=void 0===f?function(){}:f,k=a.dangerouslySetInnerHTML,l=a.children,m=void 0===l?"":l,n=a.strategy,o=a.onError,p=c||b;if(!(p&&h.has(p))){if(g.has(b)){h.add(p),g.get(b).then(j,o);return}var q=document.createElement("script"),r=new Promise(function(a,b){q.addEventListener("load",function(b){a(),j&&j.call(this,b)}),q.addEventListener("error",function(a){b(a)})}).catch(function(a){o&&o(a)});b&&g.set(b,r),h.add(p),k?q.innerHTML=k.__html||"":m?q.textContent="string"==typeof m?m:Array.isArray(m)?m.join(""):"":b&&(q.src=b);var s=!0,t=!1,u=void 0;try{for(var v,w=Object.entries(a)[Symbol.iterator]();!(s=(v=w.next()).done);s=!0){var x=d(v.value,2),y=x[0],z=x[1];if(!(void 0===z||i.includes(y))){var A=e.DOMAttributeNames[y]||y.toLowerCase();q.setAttribute(A,z)}}}catch(B){t=!0,u=B}finally{try{s||null==w.return||w.return()}finally{if(t)throw u}}q.setAttribute("data-nscript",void 0===n?"afterInteractive":n),document.body.appendChild(q)}};function k(a){var b=a.strategy,c=void 0===b?"afterInteractive":b;"afterInteractive"===c?j(a):"lazyOnload"===c&&window.addEventListener("load",function(){f.requestIdleCallback(function(){return j(a)})})}},77813:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.trackWebVitalMetric=function(a){f.push(a),e.forEach(function(b){return b(a)})},b.useExperimentalWebVitalsReport=function(a){var b=d.useRef(0);d.useEffect(function(){for(var c=function(c){a(c),b.current=f.length},d=b.current;d<f.length;d++)c(f[d]);return e.add(c),function(){e.delete(c)}},[a])},b.webVitalsCallbacks=void 0;var d=c(67294),e=new Set();b.webVitalsCallbacks=e;var f=[]},38981:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(a){var b=function(b){return e.default.createElement(a,Object.assign({router:f.useRouter()},b))};return b.getInitialProps=a.getInitialProps,b.origGetInitialProps=a.origGetInitialProps,b};var d,e=(d=c(67294))&&d.__esModule?d:{default:d},f=c(90387)},89185:function(a,b,c){"use strict";function d(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function e(a){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(a)}function f(a,b){return(f=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var g=i(c(67294)),h=i(c(5443));function i(a){return a&&a.__esModule?a:{default:a}}var j={400:"Bad Request",404:"This page could not be found",405:"Method Not Allowed",500:"Internal Server Error"};function k(a){var b=a.res,c=a.err;return{statusCode:b&&b.statusCode?b.statusCode:c?c.statusCode:404}}var l=function(a){!function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&f(a,b)}(l,a);var b,c,i,k=function(a){var b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}();return function(){var c,d,f,g,h=e(a);if(b){var i=e(this).constructor;g=Reflect.construct(h,arguments,i)}else g=h.apply(this,arguments);return d=this,(f=g)&&("object"==((c=f)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)||"function"==typeof f)?f:(function(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a})(d)}}(l);function l(){return!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,l),k.apply(this,arguments)}return b=l,c=[{key:"render",value:function(){var a=this.props.statusCode,b=this.props.title||j[a]||"An unexpected error has occurred";return g.default.createElement("div",{style:m.error},g.default.createElement(h.default,null,g.default.createElement("title",null,a?"".concat(a,": ").concat(b):"Application error: a client-side exception has occurred")),g.default.createElement("div",null,g.default.createElement("style",{dangerouslySetInnerHTML:{__html:"body { margin: 0 }"}}),a?g.default.createElement("h1",{style:m.h1},a):null,g.default.createElement("div",{style:m.desc},g.default.createElement("h2",{style:m.h2},this.props.title||a?b:g.default.createElement(g.default.Fragment,null,"Application error: a client-side exception has occurred (see the browser console for more information)"),"."))))}}],d(b.prototype,c),i&&d(b,i),l}(g.default.Component);l.displayName="ErrorPage",l.getInitialProps=k,l.origGetInitialProps=k,b.default=l;var m={error:{color:"#000",background:"#fff",fontFamily:"-apple-system, BlinkMacSystemFont, Roboto, \"Segoe UI\", \"Fira Sans\", Avenir, \"Helvetica Neue\", \"Lucida Grande\", sans-serif",height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},desc:{display:"inline-block",textAlign:"left",lineHeight:"49px",height:"49px",verticalAlign:"middle"},h1:{display:"inline-block",borderRight:"1px solid rgba(0, 0, 0,.3)",margin:0,marginRight:"20px",padding:"10px 23px 10px 0",fontSize:"24px",fontWeight:500,verticalAlign:"top"},h2:{fontSize:"14px",fontWeight:"normal",lineHeight:"inherit",margin:0,padding:0}}},22227:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.AmpStateContext=void 0;var d,e=((d=c(67294))&&d.__esModule?d:{default:d}).default.createContext({});b.AmpStateContext=e},13240:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.isInAmpMode=g,b.useAmp=function(){return g(e.default.useContext(f.AmpStateContext))};var d,e=(d=c(67294))&&d.__esModule?d:{default:d},f=c(22227);function g(a){var b=void 0===a?{}:a,c=b.ampFirst,d=b.hybrid,e=b.hasQuery;return void 0!==c&&c|| void 0!==d&&d&& void 0!==e&&e}},8404:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.HeadManagerContext=void 0;var d,e=((d=c(67294))&&d.__esModule?d:{default:d}).default.createContext({});b.HeadManagerContext=e},5443:function(a,b,c){"use strict";function d(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}Object.defineProperty(b,"__esModule",{value:!0}),b.defaultHead=k,b.default=void 0;var e,f=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}}return b.default=a,b}(c(67294)),g=(e=c(55188))&&e.__esModule?e:{default:e},h=c(22227),i=c(8404),j=c(13240);function k(a){var b=[f.default.createElement("meta",{charSet:"utf-8"})];return void 0!==a&&a||b.push(f.default.createElement("meta",{name:"viewport",content:"width=device-width"})),b}function l(a,b){return"string"==typeof b||"number"==typeof b?a:b.type===f.default.Fragment?a.concat(f.default.Children.toArray(b.props.children).reduce(function(a,b){return"string"==typeof b||"number"==typeof b?a:a.concat(b)},[])):a.concat(b)}var m=["name","httpEquiv","charSet","itemProp"];function n(a,b){var c,e,g,h;return a.reduce(function(a,b){var c=f.default.Children.toArray(b.props.children);return a.concat(c)},[]).reduce(l,[]).reverse().concat(k(b.inAmpMode)).filter((c=new Set(),e=new Set(),g=new Set(),h={},function(a){var b=!0,d=!1;if(a.key&&"number"!=typeof a.key&&a.key.indexOf("$")>0){d=!0;var f=a.key.slice(a.key.indexOf("$")+1);c.has(f)?b=!1:c.add(f)}switch(a.type){case"title":case"base":e.has(a.type)?b=!1:e.add(a.type);break;case"meta":for(var i=0,j=m.length;i<j;i++){var k=m[i];if(a.props.hasOwnProperty(k))if("charSet"===k)g.has(k)?b=!1:g.add(k);else{var l=a.props[k],n=h[k]||new Set();("name"!==k||!d)&&n.has(l)?b=!1:(n.add(l),h[k]=n)}}break}return b})).reverse().map(function(a,c){var e=a.key||c;if(!b.inAmpMode&&"link"===a.type&&a.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(function(b){return a.props.href.startsWith(b)})){var g=function(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{},e=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),e.forEach(function(b){d(a,b,c[b])})}return a}({},a.props||{});return g["data-href"]=g.href,g.href=void 0,g["data-optimized-fonts"]=!0,f.default.cloneElement(a,g)}return f.default.cloneElement(a,{key:e})})}b.default=function(a){var b=a.children,c=f.useContext(h.AmpStateContext),d=f.useContext(i.HeadManagerContext);return f.default.createElement(g.default,{reduceComponentsToState:n,headManager:d,inAmpMode:j.isInAmpMode(c)},b)}},94317:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.normalizeLocalePath=function(a,b){var c,d=a.split("/");return(b||[]).some(function(b){return!!d[1]&&d[1].toLowerCase()===b.toLowerCase()&&(c=b,d.splice(1,1),a=d.join("/")||"/",!0)}),{pathname:a,detectedLocale:c}}},35660:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(){var a=Object.create(null);return{on:function(b,c){(a[b]||(a[b]=[])).push(c)},off:function(b,c){a[b]&&a[b].splice(a[b].indexOf(c)>>>0,1)},emit:function(b){for(var c=arguments.length,d=new Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];(a[b]||[]).slice().map(function(a){var b;a.apply(void 0,function(a){if(Array.isArray(a)){for(var b=0,c=new Array(a.length);b<a.length;b++)c[b]=a[b];return c}}(b=d)||function(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}(b)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}())})}}}},63462:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.RouterContext=void 0;var d,e=((d=c(67294))&&d.__esModule?d:{default:d}).default.createContext(null);b.RouterContext=e},76273:function(a,b,c){"use strict";var d,e=(d=c(28520))&&d.__esModule?d:{default:d};function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(j){c(j);return}h.done?b(i):Promise.resolve(i).then(d,e)}function g(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var g=a.apply(b,c);function h(a){f(g,d,e,h,i,"next",a)}function i(a){f(g,d,e,h,i,"throw",a)}h(void 0)})}}function h(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function i(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function j(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{},d=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),d.forEach(function(b){i(a,b,c[b])})}return a}function k(a,b){return(function(a){if(Array.isArray(a))return a})(a)||(function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c})(a,b)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")})()}Object.defineProperty(b,"__esModule",{value:!0}),b.getDomainLocale=function(a,b,c,d){return!1},b.addLocale=B,b.delLocale=C,b.hasBasePath=E,b.addBasePath=F,b.delBasePath=G,b.isLocalURL=H,b.interpolateAs=I,b.resolveHref=K,b.default=void 0;var l=c(82392),m=c(22669),n=z(c(80676)),o=c(74522),p=c(94317),q=z(c(35660)),r=c(63794),s=c(78689),t=c(36305),u=c(50466),v=z(c(72431)),w=c(33888),x=c(64095),y=c(49820);function z(a){return a&&a.__esModule?a:{default:a}}function A(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}function B(a,b,c){return a}function C(a,b){return a}function D(a){var b=a.indexOf("?"),c=a.indexOf("#");return(b> -1||c> -1)&&(a=a.substring(0,b> -1?b:c)),a}function E(a){return""===(a=D(a))||a.startsWith("/")}function F(a){return(function(a,b){if(!a.startsWith("/")||!b)return a;var c=D(a);return l.normalizePathTrailingSlash("".concat(b).concat(c))+a.substr(c.length)})(a,"")}function G(a){return(a=a.slice(0)).startsWith("/")||(a="/".concat(a)),a}function H(a){if(a.startsWith("/")||a.startsWith("#")||a.startsWith("?"))return!0;try{var b=r.getLocationOrigin(),c=new URL(a,b);return c.origin===b&&E(c.pathname)}catch(d){return!1}}function I(a,b,c){var d="",e=x.getRouteRegex(a),f=e.groups,g=(b!==a?w.getRouteMatcher(e)(b):"")||c;d=a;var h=Object.keys(f);return h.every(function(a){var b=g[a]||"",c=f[a],e=c.repeat,h=c.optional,i="[".concat(e?"...":"").concat(a,"]");return h&&(i="".concat(b?"":"/","[").concat(i,"]")),e&&!Array.isArray(b)&&(b=[b]),(h||a in g)&&(d=d.replace(i,e?b.map(function(a){return encodeURIComponent(a)}).join("/"):encodeURIComponent(b))||"/")})||(d=""),{params:h,result:d}}function J(a,b){var c={};return Object.keys(a).forEach(function(d){b.includes(d)||(c[d]=a[d])}),c}function K(a,b,c){var d,e="string"==typeof b?b:r.formatWithValidation(b),f=e.match(/^[a-zA-Z]{1,}:\/\//),g=f?e.substr(f[0].length):e;if((g.split("?")[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href passed to next/router: ".concat(e,", repeated forward-slashes (//) or backslashes \\ are not valid in the href"));var h=r.normalizeRepeatedSlashes(g);e=(f?f[0]:"")+h}if(!H(e))return c?[e]:e;try{d=new URL(e.startsWith("#")?a.asPath:a.pathname,"http://n")}catch(i){d=new URL("/","http://n")}try{var j=new URL(e,d);j.pathname=l.normalizePathTrailingSlash(j.pathname);var k="";if(s.isDynamicRoute(j.pathname)&&j.searchParams&&c){var m=u.searchParamsToUrlQuery(j.searchParams),n=I(j.pathname,j.pathname,m),o=n.result,p=n.params;o&&(k=r.formatWithValidation({pathname:o,hash:j.hash,query:J(m,p)}))}var q=j.origin===d.origin?j.href.slice(j.origin.length):j.href;return c?[q,k||q]:q}catch(t){return c?[e]:e}}function L(a){var b=r.getLocationOrigin();return a.startsWith(b)?a.substring(b.length):a}function M(a,b,c){var d=k(K(a,b,!0),2),e=d[0],f=d[1],g=r.getLocationOrigin(),h=e.startsWith(g),i=f&&f.startsWith(g);e=L(e),f=f?L(f):f;var j=h?e:F(e),l=c?L(K(a,c)):f||e;return{url:j,as:i?l:F(l)}}function N(a,b){var c=l.removePathTrailingSlash(o.denormalizePagePath(a));return"/404"===c||"/_error"===c?a:(b.includes(c)||b.some(function(b){if(s.isDynamicRoute(b)&&x.getRouteRegex(b).re.test(c))return a=b,!0}),l.removePathTrailingSlash(a))}var O=Symbol("SSG_DATA_NOT_FOUND");function P(a,b,c){return fetch(a,{credentials:"same-origin"}).then(function(d){if(!d.ok){if(b>1&&d.status>=500)return P(a,b-1,c);if(404===d.status)return d.json().then(function(a){if(a.notFound)return{notFound:O};throw new Error("Failed to load static props")});throw new Error("Failed to load static props")}return c.text?d.text():d.json()})}function Q(a,b,c,d,e){var f=new URL(a,window.location.href).href;return void 0!==d[f]?d[f]:d[f]=P(a,b?3:1,{text:c}).catch(function(a){throw b||m.markAssetError(a),a}).then(function(a){return e||delete d[f],a}).catch(function(a){throw delete d[f],a})}var R=function(){var a,b,c;function d(a,b,c,e){var f,g=e.initialProps,h=e.pageLoader,i=e.App,j=e.wrapApp,k=e.Component,m=e.err,n=e.subscription,o=e.isFallback,p=e.locale,q=e.locales,u=e.defaultLocale,v=e.domainLocales,w=e.isPreview,x=this;!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,d),this.sdc={},this.sdr={},this.sde={},this._idx=0,this.onPopState=function(a){var b,c=a.state;if(!c){var d=x.pathname,e=x.query;x.changeState("replaceState",r.formatWithValidation({pathname:F(d),query:e}),r.getURL());return}if(c.__N){var f=c.url,g=c.as,h=c.options,i=c.idx;x._idx=i;var j=t.parseRelativeUrl(f).pathname;x.isSsr&&g===x.asPath&&j===x.pathname||x._bps&&!x._bps(c)||x.change("replaceState",f,g,Object.assign({},h,{shallow:h.shallow&&x._shallow,locale:h.locale||x.defaultLocale}),b)}},this.route=l.removePathTrailingSlash(a),this.components={},"/_error"!==a&&(this.components[this.route]={Component:k,initial:!0,props:g,err:m,__N_SSG:g&&g.__N_SSG,__N_SSP:g&&g.__N_SSP,__N_RSC:!!(null===(f=k)|| void 0===f?void 0:f.__next_rsc__)}),this.components["/_app"]={Component:i,styleSheets:[]},this.events=d.events,this.pageLoader=h,this.pathname=a,this.query=b;var y=s.isDynamicRoute(a)&&self.__NEXT_DATA__.autoExport;if(this.asPath=y?a:c,this.basePath="",this.sub=n,this.clc=null,this._wrapApp=j,this.isSsr=!0,this.isFallback=o,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp|| !y&&!self.location.search),this.isPreview=!!w,this.isLocaleDomain=!1,"//"!==c.substr(0,2)){var z={locale:p};z._shouldResolveHref=c!==a,this.changeState("replaceState",r.formatWithValidation({pathname:F(a),query:b}),r.getURL(),z)}window.addEventListener("popstate",this.onPopState)}return a=d,b=[{key:"reload",value:function(){window.location.reload()}},{key:"back",value:function(){window.history.back()}},{key:"push",value:function(a,b,c){var d;return a=(d=M(this,a,b)).url,b=d.as,this.change("pushState",a,b,void 0===c?{}:c)}},{key:"replace",value:function(a,b,c){var d;return a=(d=M(this,a,b)).url,b=d.as,this.change("replaceState",a,b,void 0===c?{}:c)}},{key:"change",value:function(a,b,c,f,h){return g(e.default.mark(function g(){var i,k,o,p,q,u,v,y,z,A,K,L,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,o,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(H(b)){e.next=3;break}return window.location.href=b,e.abrupt("return",!1);case 3:i=f._h||f._shouldResolveHref||D(b)===D(c),f._h&&(this.isReady=!0),k=this.locale,e.next=18;break;case 18:if(f._h||(this.isSsr=!1),r.ST&&performance.mark("routeChange"),u={shallow:q=void 0!==(p=f.shallow)&&p},this._inFlightRoute&&this.abortComponentLoad(this._inFlightRoute,u),c=F(B(E(c)?G(c):c,f.locale,this.defaultLocale)),v=C(E(c)?G(c):c,this.locale),this._inFlightRoute=c,y=k!==this.locale,!(!f._h&&this.onlyAHashChange(v)&&!y)){e.next=35;break}return this.asPath=v,d.events.emit("hashChangeStart",c,u),this.changeState(a,b,c,f),this.scrollToHash(v),this.notify(this.components[this.route],null),d.events.emit("hashChangeComplete",c,u),e.abrupt("return",!0);case 35:return A=(z=t.parseRelativeUrl(b)).pathname,K=z.query,e.prev=38,e.next=42,Promise.all([this.pageLoader.getPageList(),m.getClientBuildManifest(),this.pageLoader.getMiddlewareList(),]);case 42:L=(Q=e.sent)[0],P=(R=Q[1]).__rewrites,e.next=52;break;case 48:return e.prev=48,e.t0=e.catch(38),window.location.href=c,e.abrupt("return",!1);case 52:if(this.urlIsNew(v)||y||(a="replaceState"),S=c,A=A?l.removePathTrailingSlash(G(A)):A,i&&"/_error"!==A&&(f._shouldResolveHref=!0,z.pathname=N(A,L),z.pathname!==A&&(A=z.pathname,z.pathname=F(A),b=r.formatWithValidation(z))),H(c)){e.next=61;break}e.next=59;break;throw new Error("Invalid href: \"".concat(b,"\" and as: \"").concat(c,"\", received relative href and external as")+"\nSee more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as");case 59:return window.location.href=c,e.abrupt("return",!1);case 61:return S=C(G(S),this.locale),e.next=64,this._preflightRequest({as:c,cache:!0,pages:L,pathname:A,query:K});case 64:if("rewrite"!==(T=e.sent).type){e.next=69;break}K=j({},K,T.parsedAs.query),S=T.asPath,A=T.resolvedHref,z.pathname=T.resolvedHref,b=r.formatWithValidation(z),e.next=81;break;case 69:if(!("redirect"===T.type&&T.newAs)){e.next=73;break}return e.abrupt("return",this.change(a,T.newUrl,T.newAs,f));case 73:if(!("redirect"===T.type&&T.destination)){e.next=78;break}return window.location.href=T.destination,e.abrupt("return",new Promise(function(){}));case 78:if("refresh"!==T.type){e.next=81;break}return window.location.href=c,e.abrupt("return",new Promise(function(){}));case 81:if(U=l.removePathTrailingSlash(A),!s.isDynamicRoute(U)){e.next=97;break}if(W=(V=t.parseRelativeUrl(S)).pathname,X=x.getRouteRegex(U),Y=w.getRouteMatcher(X)(W),Z=U===W,$=Z?I(U,W,K):{},!(!Y||Z&&!$.result)){e.next=96;break}if(!((_=Object.keys(X.groups).filter(function(a){return!K[a]})).length>0)){e.next=94;break}throw new Error((Z?"The provided `href` (".concat(b,") value is missing query values (").concat(_.join(", "),") to be interpolated properly. "):"The provided `as` value (".concat(W,") is incompatible with the `href` value (").concat(U,"). "))+"Read more: https://nextjs.org/docs/messages/".concat(Z?"href-interpolation-failed":"incompatible-href-as"));case 94:e.next=97;break;case 96:Z?c=r.formatWithValidation(Object.assign({},V,{pathname:$.result,query:J(K,$.params)})):Object.assign(K,Y);case 97:return d.events.emit("routeChangeStart",c,u),e.prev=98,e.next=102,this.getRouteInfo(U,A,K,c,S,u);case 102:if(ca=(ba=e.sent).error,da=ba.props,ea=ba.__N_SSG,fa=ba.__N_SSP,!((ea||fa)&&da)){e.next=129;break}if(!(da.pageProps&&da.pageProps.__N_REDIRECT)){e.next=114;break}if(!((ga=da.pageProps.__N_REDIRECT).startsWith("/")&& !1!==da.pageProps.__N_REDIRECT_BASE_PATH)){e.next=112;break}return(ha=t.parseRelativeUrl(ga)).pathname=N(ha.pathname,L),ja=(ia=M(this,ga,ga)).url,ka=ia.as,e.abrupt("return",this.change(a,ja,ka,f));case 112:return window.location.href=ga,e.abrupt("return",new Promise(function(){}));case 114:if(this.isPreview=!!da.__N_PREVIEW,da.notFound!==O){e.next=129;break}return e.prev=117,e.next=120,this.fetchComponent("/404");case 120:la="/404",e.next=126;break;case 123:e.prev=123,e.t1=e.catch(117),la="/_error";case 126:return e.next=128,this.getRouteInfo(la,la,K,c,S,{shallow:!1});case 128:ba=e.sent;case 129:return d.events.emit("beforeHistoryChange",c,u),this.changeState(a,b,c,f),f._h&&"/_error"===A&&(null===(o=self.__NEXT_DATA__.props)|| void 0===o?void 0:null===(aa=o.pageProps)|| void 0===aa?void 0:aa.statusCode)===500&&(null==da?void 0:da.pageProps)&&(da.pageProps.statusCode=500),ma=f.shallow&&this.route===U,oa=null!==(na=f.scroll)&& void 0!==na?na:!ma,pa=oa?{x:0,y:0}:null,e.next=138,this.set(U,A,K,v,ba,null!=h?h:pa).catch(function(a){if(a.cancelled)ca=ca||a;else throw a});case 138:if(!ca){e.next=141;break}throw d.events.emit("routeChangeError",ca,v,u),ca;case 141:return d.events.emit("routeChangeComplete",c,u),e.abrupt("return",!0);case 146:if(e.prev=146,e.t2=e.catch(98),!(n.default(e.t2)&&e.t2.cancelled)){e.next=150;break}return e.abrupt("return",!1);case 150:throw e.t2;case 151:case"end":return e.stop()}},g,this,[[38,48],[98,146],[117,123]])}).bind(this))()}},{key:"changeState",value:function(a,b,c,d){var e=void 0===d?{}:d;("pushState"!==a||r.getURL()!==c)&&(this._shallow=e.shallow,window.history[a]({url:b,as:c,options:e,__N:!0,idx:this._idx="pushState"!==a?this._idx:this._idx+1},"",c))}},{key:"handleRouteInfoError",value:function(a,b,c,f,h,i){return g(e.default.mark(function g(){var j,k,l,o,p;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.cancelled){e.next=2;break}throw a;case 2:if(!(m.isAssetError(a)||i)){e.next=6;break}throw d.events.emit("routeChangeError",a,f,h),window.location.href=f,A();case 6:if(e.prev=6,!(void 0===j|| void 0===k)){e.next=18;break}return e.next=14,this.fetchComponent("/_error");case 14:j=(o=e.sent).page,k=o.styleSheets;case 18:if((p={props:l,Component:j,styleSheets:k,err:a,error:a}).props){e.next=30;break}return e.prev=20,e.next=23,this.getInitialProps(j,{err:a,pathname:b,query:c});case 23:p.props=e.sent,e.next=30;break;case 26:e.prev=26,e.t0=e.catch(20),console.error("Error in error page `getInitialProps`: ",e.t0),p.props={};case 30:return e.abrupt("return",p);case 33:return e.prev=33,e.t1=e.catch(6),e.abrupt("return",this.handleRouteInfoError(n.default(e.t1)?e.t1:new Error(e.t1+""),b,c,f,h,!0));case 36:case"end":return e.stop()}},g,this,[[6,33],[20,26]])}).bind(this))()}},{key:"getRouteInfo",value:function(a,b,c,d,f,h){return g(e.default.mark(function g(){var i,j,k,l,m,o,p,q,s,t,u,v,w,x;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=this,j=this.components[a],!(h.shallow&&j&&this.route===a)){e.next=5;break}return e.abrupt("return",j);case 5:if(k=void 0,!j||"initial"in j||(k=j),e.t0=k,e.t0){e.next=12;break}return e.next=11,this.fetchComponent(a).then(function(a){return{Component:a.page,styleSheets:a.styleSheets,__N_SSG:a.mod.__N_SSG,__N_SSP:a.mod.__N_SSP,__N_RSC:!!a.page.__next_rsc__}});case 11:e.t0=e.sent;case 12:m=(l=e.t0).Component,o=l.__N_SSG,p=l.__N_SSP,q=l.__N_RSC,e.next=18;break;case 18:return(o||p||q)&&(s=this.pageLoader.getDataHref({href:r.formatWithValidation({pathname:b,query:c}),asPath:f,ssg:o,rsc:q,locale:this.locale})),e.next=22,this._getData(function(){return o||p?Q(s,i.isSsr,!1,o?i.sdc:i.sdr,!!o&&!i.isPreview):i.getInitialProps(m,{pathname:b,query:c,asPath:d,locale:i.locale,locales:i.locales,defaultLocale:i.defaultLocale})});case 22:if(t=e.sent,!q){e.next=31;break}return u=this,e.next=27,this._getData(function(){return u._getFlightData(s)});case 27:w=(v=e.sent).fresh,x=v.data,t.pageProps=Object.assign(t.pageProps,{__flight_serialized__:x,__flight_fresh__:w});case 31:return l.props=t,this.components[a]=l,e.abrupt("return",l);case 36:return e.prev=36,e.t1=e.catch(0),e.abrupt("return",this.handleRouteInfoError(n.default(e.t1)?e.t1:new Error(e.t1+""),b,c,d,h));case 39:case"end":return e.stop()}},g,this,[[0,36]])}).bind(this))()}},{key:"set",value:function(a,b,c,d,e,f){return this.isFallback=!1,this.route=a,this.pathname=b,this.query=c,this.asPath=d,this.notify(e,f)}},{key:"beforePopState",value:function(a){this._bps=a}},{key:"onlyAHashChange",value:function(a){if(!this.asPath)return!1;var b=k(this.asPath.split("#"),2),c=b[0],d=b[1],e=k(a.split("#"),2),f=e[0],g=e[1];return!!g&&c===f&&d===g||c===f&&d!==g}},{key:"scrollToHash",value:function(a){var b=k(a.split("#"),2)[1];if(""===b||"top"===b){window.scrollTo(0,0);return}var c=document.getElementById(b);if(c){c.scrollIntoView();return}var d=document.getElementsByName(b)[0];d&&d.scrollIntoView()}},{key:"urlIsNew",value:function(a){return this.asPath!==a}},{key:"prefetch",value:function(a,b,c){var d=void 0===b?a:b,f=void 0===c?{}:c;return g(e.default.mark(function b(){var c,g,h,i,k,m,n,o,p,q,s;return e.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=this,h=(g=t.parseRelativeUrl(a)).pathname,i=g.query,b.next=6,this.pageLoader.getPageList();case 6:k=b.sent,m=d,b.next=21;break;case 13:n=(o=b.sent).__rewrites,m=C(G((p=v.default(F(B(d,this.locale)),k,n,g.query,function(a){return N(a,k)},this.locales)).asPath),this.locale),p.matchedPage&&p.resolvedHref&&(h=p.resolvedHref,g.pathname=h,a=r.formatWithValidation(g)),b.next=22;break;case 21:g.pathname=N(g.pathname,k),g.pathname!==h&&(h=g.pathname,g.pathname=h,a=r.formatWithValidation(g));case 22:b.next=24;break;return b.abrupt("return");case 24:return b.next=26,this._preflightRequest({as:F(d),cache:!0,pages:k,pathname:h,query:i});case 26:return"rewrite"===(q=b.sent).type&&(g.pathname=q.resolvedHref,h=q.resolvedHref,i=j({},i,q.parsedAs.query),m=q.asPath,a=r.formatWithValidation(g)),s=l.removePathTrailingSlash(h),b.next=31,Promise.all([this.pageLoader._isSsg(s).then(function(b){return!!b&&Q(c.pageLoader.getDataHref({href:a,asPath:m,ssg:!0,locale:void 0!==f.locale?f.locale:c.locale}),!1,!1,c.sdc,!0)}),this.pageLoader[f.priority?"loadPage":"prefetch"](s),]);case 31:case"end":return b.stop()}},b,this)}).bind(this))()}},{key:"fetchComponent",value:function(a){return g(e.default.mark(function b(){var c,d,f,g,h;return e.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return c=this,d=!1,f=this.clc=function(){d=!0},g=function(){if(d){var b=new Error("Abort fetching component for route: \"".concat(a,"\""));throw b.cancelled=!0,b}f===c.clc&&(c.clc=null)},b.prev=4,b.next=7,this.pageLoader.loadPage(a);case 7:return h=b.sent,g(),b.abrupt("return",h);case 12:throw b.prev=12,b.t0=b.catch(4),g(),b.t0;case 16:case"end":return b.stop()}},b,this,[[4,12]])}).bind(this))()}},{key:"_getData",value:function(a){var b=this,c=!1,d=function(){c=!0};return this.clc=d,a().then(function(a){if(d===b.clc&&(b.clc=null),c){var e=new Error("Loading initial props cancelled");throw e.cancelled=!0,e}return a})}},{key:"_getFlightData",value:function(a){var b=this,c=new URL(a,window.location.href).href;return!this.isPreview&&this.sdc[c]?Promise.resolve({fresh:!1,data:this.sdc[c]}):Q(a,!0,!0,this.sdc,!1).then(function(a){return b.sdc[c]=a,{fresh:!0,data:a}})}},{key:"_preflightRequest",value:function(a){return g(e.default.mark(function b(){var c,d,f,g,h,i,j,m,n,o,q,r,s;return e.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return d=C(E(a.as)?G(a.as):a.as,this.locale),b.next=4,this.pageLoader.getMiddlewareList();case 4:if(g=(f=b.sent).some(function(a){var b=k(a,2),c=b[0],e=b[1];return w.getRouteMatcher(y.getMiddlewareRegex(c,!e))(d)})){b.next=8;break}return b.abrupt("return",{type:"next"});case 8:return b.next=10,this._getPreflightData({preflightHref:a.as,shouldCache:a.cache});case 10:if(!(null===(c=(h=b.sent).rewrite)|| void 0===c?void 0:c.startsWith("/"))){b.next=18;break}return i=t.parseRelativeUrl(p.normalizeLocalePath(E(h.rewrite)?G(h.rewrite):h.rewrite,this.locales).pathname),j=l.removePathTrailingSlash(i.pathname),a.pages.includes(j)?(m=!0,n=j):(n=N(j,a.pages))!==i.pathname&&a.pages.includes(n)&&(m=!0),b.abrupt("return",{type:"rewrite",asPath:i.pathname,parsedAs:i,matchedPage:m,resolvedHref:n});case 18:if(!h.redirect){b.next=24;break}if(!h.redirect.startsWith("/")){b.next=23;break}return r=(q=M(this,o=l.removePathTrailingSlash(p.normalizeLocalePath(E(h.redirect)?G(h.redirect):h.redirect,this.locales).pathname),o)).url,s=q.as,b.abrupt("return",{type:"redirect",newUrl:r,newAs:s});case 23:return b.abrupt("return",{type:"redirect",destination:h.redirect});case 24:if(!(h.refresh&&!h.ssr)){b.next=26;break}return b.abrupt("return",{type:"refresh"});case 26:return b.abrupt("return",{type:"next"});case 27:case"end":return b.stop()}},b,this)}).bind(this))()}},{key:"_getPreflightData",value:function(a){var b=this,c=this,d=a.preflightHref,e=a.shouldCache,f=void 0!==e&&e,g=new URL(d,window.location.href).href;return!this.isPreview&&f&&this.sde[g]?Promise.resolve(this.sde[g]):fetch(d,{method:"HEAD",credentials:"same-origin",headers:{"x-middleware-preflight":"1"}}).then(function(a){if(!a.ok)throw new Error("Failed to preflight request");return{redirect:a.headers.get("Location"),refresh:a.headers.has("x-middleware-refresh"),rewrite:a.headers.get("x-middleware-rewrite"),ssr:!!a.headers.get("x-middleware-ssr")}}).then(function(a){return f&&(b.sde[g]=a),a}).catch(function(a){throw delete c.sde[g],a})}},{key:"getInitialProps",value:function(a,b){var c=this.components["/_app"].Component,d=this._wrapApp(c);return b.AppTree=d,r.loadGetInitialProps(c,{AppTree:d,Component:a,router:this,ctx:b})}},{key:"abortComponentLoad",value:function(a,b){this.clc&&(d.events.emit("routeChangeError",A(),a,b),this.clc(),this.clc=null)}},{key:"notify",value:function(a,b){return this.sub(a,this.components["/_app"].Component,b)}}],h(a.prototype,b),c&&h(a,c),d}();R.events=q.default(),b.default=R},4611:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.formatUrl=function(a){var b=a.auth,c=a.hostname,f=a.protocol||"",g=a.pathname||"",h=a.hash||"",i=a.query||"",j=!1;b=b?encodeURIComponent(b).replace(/%3A/i,":")+"@":"",a.host?j=b+a.host:c&&(j=b+(~c.indexOf(":")?"[".concat(c,"]"):c),a.port&&(j+=":"+a.port)),i&&"object"==typeof i&&(i=String(d.urlQueryToSearchParams(i)));var k=a.search||i&&"?".concat(i)||"";return f&&":"!==f.substr(-1)&&(f+=":"),a.slashes||(!f||e.test(f))&& !1!==j?(j="//"+(j||""),g&&"/"!==g[0]&&(g="/"+g)):j||(j=""),h&&"#"!==h[0]&&(h="#"+h),k&&"?"!==k[0]&&(k="?"+k),g=g.replace(/[?#]/g,encodeURIComponent),k=k.replace("#","%23"),"".concat(f).concat(j).concat(g).concat(k).concat(h)};var d=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}}return b.default=a,b}(c(50466)),e=/https?|ftp|gopher|file/},73891:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(a,b){return("/"===a?"/index":/^\/index(\/|$)/.test(a)?"/index".concat(a):"".concat(a))+(void 0===b?"":b)}},49820:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getMiddlewareRegex=function(a,b){var c=void 0===b||b,e=d.getParametrizedRoute(a),f=c?"(?!_next).*":"",g=c?"(?:(/.*)?)":"";return"routeKeys"in e?"/"===e.parameterizedRoute?{groups:{},namedRegex:"^/".concat(f,"$"),re:new RegExp("^/".concat(f,"$")),routeKeys:{}}:{groups:e.groups,namedRegex:"^".concat(e.namedParameterizedRoute).concat(g,"$"),re:new RegExp("^".concat(e.parameterizedRoute).concat(g,"$")),routeKeys:e.routeKeys}:"/"===e.parameterizedRoute?{groups:{},re:new RegExp("^/".concat(f,"$"))}:{groups:{},re:new RegExp("^".concat(e.parameterizedRoute).concat(g,"$"))}};var d=c(64095)},78689:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.isDynamicRoute=function(a){return c.test(a)};var c=/\/\[[^/]+?\](?=\/|$)/},36305:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.parseRelativeUrl=function(a,b){var c=new URL(d.getLocationOrigin()),f=b?new URL(b,c):c,g=new URL(a,f),h=g.pathname,i=g.searchParams,j=g.search,k=g.hash,l=g.href,m=g.origin;if(m!==c.origin)throw new Error("invariant: invalid relative URL, router received ".concat(a));return{pathname:h,query:e.searchParamsToUrlQuery(i),search:j,hash:k,href:l.slice(c.origin.length)}};var d=c(63794),e=c(50466)},50466:function(a,b){"use strict";function c(a){return"string"!=typeof a&&("number"!=typeof a||isNaN(a))&&"boolean"!=typeof a?"":String(a)}Object.defineProperty(b,"__esModule",{value:!0}),b.searchParamsToUrlQuery=function(a){var b={};return a.forEach(function(a,c){void 0===b[c]?b[c]=a:Array.isArray(b[c])?b[c].push(a):b[c]=[b[c],a]}),b},b.urlQueryToSearchParams=function(a){var b=new URLSearchParams();return Object.entries(a).forEach(function(a){var d,e=function(a){if(Array.isArray(a))return a}(d=a)||function(a,b){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!b||c.length!==b);d=!0);}catch(i){e=!0,f=i}finally{try{d||null==h.return||h.return()}finally{if(e)throw f}}return c}(d,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}(),f=e[0],g=e[1];Array.isArray(g)?g.forEach(function(a){return b.append(f,c(a))}):b.set(f,c(g))}),b},b.assign=function(a){for(var b=arguments.length,c=new Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];return c.forEach(function(b){Array.from(b.keys()).forEach(function(b){return a.delete(b)}),b.forEach(function(b,c){return a.append(c,b)})}),a}},33888:function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getRouteMatcher=function(a){var b=a.re,c=a.groups;return function(a){var e=b.exec(a);if(!e)return!1;var f=function(a){try{return decodeURIComponent(a)}catch(b){throw new d.DecodeError("failed to decode param")}},g={};return Object.keys(c).forEach(function(a){var b=c[a],d=e[b.pos];void 0!==d&&(g[a]=~d.indexOf("/")?d.split("/").map(function(a){return f(a)}):b.repeat?[f(d)]:f(d))}),g}};var d=c(63794)},64095:function(a,b){"use strict";function c(a){var b=(a.replace(/\/$/,"")||"/").slice(1).split("/"),c={},d=1;return{parameterizedRoute:b.map(function(a){if(a.startsWith("[")&&a.endsWith("]")){var b,e,f,g=((e=(b=a.slice(1,-1)).startsWith("[")&&b.endsWith("]"))&&(b=b.slice(1,-1)),(f=b.startsWith("..."))&&(b=b.slice(3)),{key:b,repeat:f,optional:e}),h=g.key,i=g.optional,j=g.repeat;return c[h]={pos:d++,repeat:j,optional:i},j?i?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}return"/".concat(a.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&"))}).join(""),groups:c}}Object.defineProperty(b,"__esModule",{value:!0}),b.getParametrizedRoute=c,b.getRouteRegex=function(a){var b=c(a);return"routeKeys"in b?{re:new RegExp("^".concat(b.parameterizedRoute,"(?:/)?$")),groups:b.groups,routeKeys:b.routeKeys,namedRegex:"^".concat(b.namedParameterizedRoute,"(?:/)?$")}:{re:new RegExp("^".concat(b.parameterizedRoute,"(?:/)?$")),groups:b.groups}}},88027:function(a,b){"use strict";var c;Object.defineProperty(b,"__esModule",{value:!0}),b.setConfig=function(a){c=a},b.default=void 0,b.default=function(){return c}},55188:function(a,b,c){"use strict";function d(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function e(a){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(a)}function f(a,b){return(f=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var g=function(a){!function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&f(a,b)}(i,a);var b,c,g,h=function(a){var b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}();return function(){var c,d,f,g,h=e(a);if(b){var i=e(this).constructor;g=Reflect.construct(h,arguments,i)}else g=h.apply(this,arguments);return d=this,(f=g)&&("object"==((c=f)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)||"function"==typeof f)?f:(function(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a})(d)}}(i);function i(a){var b;return!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,i),(b=h.call(this,a)).emitChange=function(){if(b._hasHeadManager){var a;b.props.headManager.updateHead(b.props.reduceComponentsToState(function(a){if(Array.isArray(a)){for(var b=0,c=new Array(a.length);b<a.length;b++)c[b]=a[b];return c}}(a=b.props.headManager.mountedInstances)||function(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}(),b.props))}},b._hasHeadManager=b.props.headManager&&b.props.headManager.mountedInstances,b}return c=[{key:"componentDidMount",value:function(){this._hasHeadManager&&this.props.headManager.mountedInstances.add(this),this.emitChange()}},{key:"componentDidUpdate",value:function(){this.emitChange()}},{key:"componentWillUnmount",value:function(){this._hasHeadManager&&this.props.headManager.mountedInstances.delete(this),this.emitChange()}},{key:"render",value:function(){return null}}],d((b=i).prototype,c),g&&d(b,g),i}(function(a){if(a&&a.__esModule)return a;var b={};if(null!=a){for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(a,c):{};d.get||d.set?Object.defineProperty(b,c,d):b[c]=a[c]}}return b.default=a,b}(c(67294)).Component);b.default=g},63794:function(a,b,c){"use strict";var d,e=(d=c(28520))&&d.__esModule?d:{default:d};function f(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(j){c(j);return}h.done?b(i):Promise.resolve(i).then(d,e)}function g(a,b,c){return(g=!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(a){return!1}}()?function(a,b,c){var d=[null];d.push.apply(d,b);var e=new(Function.bind.apply(a,d))();return c&&i(e,c.prototype),e}:Reflect.construct).apply(null,arguments)}function h(a){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)})(a)}function i(a,b){return(i=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a})(a,b)}function j(a){var b="function"==typeof Map?new Map():void 0;return(j=function(a){var c;if(null===a||(c=a,-1===Function.toString.call(c).indexOf("[native code]")))return a;if("function"!=typeof a)throw new TypeError("Super expression must either be null or a function");if(void 0!==b){if(b.has(a))return b.get(a);b.set(a,d)}function d(){return g(a,arguments,h(this).constructor)}return d.prototype=Object.create(a.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),i(d,a)})(a)}Object.defineProperty(b,"__esModule",{value:!0}),b.execOnce=function(a){var b,c=!1;return function(){for(var d,e=arguments.length,f=new Array(e),g=0;g<e;g++)f[g]=arguments[g];return c||(c=!0,b=a.apply(void 0,function(a){if(Array.isArray(a)){for(var b=0,c=new Array(a.length);b<a.length;b++)c[b]=a[b];return c}}(d=f)||function(a){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a))return Array.from(a)}(d)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}())),b}},b.getLocationOrigin=m,b.getURL=function(){var a=window.location.href,b=m();return a.substring(b.length)},b.getDisplayName=n,b.isResSent=o,b.normalizeRepeatedSlashes=function(a){var b=a.split("?");return b[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(b[1]?"?".concat(b.slice(1).join("?")):"")},b.loadGetInitialProps=p,b.formatWithValidation=function(a){return k.formatUrl(a)},b.HtmlContext=b.ST=b.SP=b.urlObjectKeys=void 0;var k=c(4611),l=c(67294);function m(){var a=window.location,b=a.protocol,c=a.hostname,d=a.port;return"".concat(b,"//").concat(c).concat(d?":"+d:"")}function n(a){return"string"==typeof a?a:a.displayName||a.name||"Unknown"}function o(a){return a.finished||a.headersSent}function p(a,b){return q.apply(this,arguments)}function q(){return(q=(function(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var g=a.apply(b,c);function h(a){f(g,d,e,h,i,"next",a)}function i(a){f(g,d,e,h,i,"throw",a)}h(void 0)})}})(e.default.mark(function a(b,c){var d,f,g;return e.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:a.next=5;break;case 5:if(d=c.res||c.ctx&&c.ctx.res,b.getInitialProps){a.next=13;break}if(!(c.ctx&&c.Component)){a.next=12;break}return a.next=10,p(c.Component,c.ctx);case 10:return a.t0=a.sent,a.abrupt("return",{pageProps:a.t0});case 12:return a.abrupt("return",{});case 13:return a.next=15,b.getInitialProps(c);case 15:if(f=a.sent,!(d&&o(d))){a.next=18;break}return a.abrupt("return",f);case 18:if(f){a.next=21;break}throw g="\"".concat(n(b),".getInitialProps()\" should resolve to an object. But found \"").concat(f,"\" instead."),new Error(g);case 21:return a.abrupt("return",f);case 23:case"end":return a.stop()}},a)}))).apply(this,arguments)}b.urlObjectKeys=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes",];var r="undefined"!=typeof performance;b.SP=r;var s=r&&"function"==typeof performance.mark&&"function"==typeof performance.measure;b.ST=s;var t=function(a){!function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&i(a,b)}(c,a);var b=function(a){var b=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}();return function(){var c,d,e,f,g=h(a);if(b){var i=h(this).constructor;f=Reflect.construct(g,arguments,i)}else f=g.apply(this,arguments);return d=this,(e=f)&&("object"==((c=e)&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c)||"function"==typeof e)?e:(function(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a})(d)}}(c);function c(){return!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,c),b.apply(this,arguments)}return c}(j(Error));b.DecodeError=t;var u=l.createContext(null);b.HtmlContext=u},38745:function(a){a.exports=(function(){var a={770:function(a,b){!function(a,c){c(b)}(this,function(a){"use strict";var b,c,d,e,f=function(a,b){return{name:a,value:void 0===b?-1:b,delta:0,entries:[],id:"v2-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+10e11)}},g=function(a,b){try{if(PerformanceObserver.supportedEntryTypes.includes(a)){if("first-input"===a&&!("PerformanceEventTiming"in self))return;var c=new PerformanceObserver(function(a){return a.getEntries().map(b)});return c.observe({type:a,buffered:!0}),c}}catch(d){}},h=function(a,b){var c=function c(d){"pagehide"!==d.type&&"hidden"!==document.visibilityState||(a(d),b&&(removeEventListener("visibilitychange",c,!0),removeEventListener("pagehide",c,!0)))};addEventListener("visibilitychange",c,!0),addEventListener("pagehide",c,!0)},i=function(a){addEventListener("pageshow",function(b){b.persisted&&a(b)},!0)},j=function(a,b,c){var d;return function(e){b.value>=0&&(e||c)&&(b.delta=b.value-(d||0),(b.delta|| void 0===d)&&(d=b.value,a(b)))}},k=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},m=function(){h(function(a){k=a.timeStamp},!0)},n=function(){return k<0&&(k=l(),m(),i(function(){setTimeout(function(){k=l(),m()},0)})),{get firstHiddenTime(){return k}}},o=function(a,b){var c,d=n(),e=f("FCP"),h=function(a){"first-contentful-paint"===a.name&&(l&&l.disconnect(),a.startTime<d.firstHiddenTime&&(e.value=a.startTime,e.entries.push(a),c(!0)))},k=performance.getEntriesByName&&performance.getEntriesByName("first-contentful-paint")[0],l=k?null:g("paint",h);(k||l)&&(c=j(a,e,b),k&&h(k),i(function(d){c=j(a,e=f("FCP"),b),requestAnimationFrame(function(){requestAnimationFrame(function(){e.value=performance.now()-d.timeStamp,c(!0)})})}))},p=!1,q=-1,r={passive:!0,capture:!0},s=new Date,t=function(a,e){b||(b=e,c=a,d=new Date,w(removeEventListener),u())},u=function(){if(c>=0&&c<d-s){var a={entryType:"first-input",name:b.type,target:b.target,cancelable:b.cancelable,startTime:b.timeStamp,processingStart:b.timeStamp+c};e.forEach(function(b){b(a)}),e=[]}},v=function(a){if(a.cancelable){var b,c,d,e,f,g=(a.timeStamp>10e11?new Date:performance.now())-a.timeStamp;"pointerdown"==a.type?(b=g,c=a,d=function(){t(b,c),f()},e=function(){f()},f=function(){removeEventListener("pointerup",d,r),removeEventListener("pointercancel",e,r)},addEventListener("pointerup",d,r),addEventListener("pointercancel",e,r)):t(g,a)}},w=function(a){["mousedown","keydown","touchstart","pointerdown"].forEach(function(b){return a(b,v,r)})},x=new Set;a.getCLS=function(a,b){p||(o(function(a){q=a.value}),p=!0);var c,d=function(b){q> -1&&a(b)},e=f("CLS",0),k=0,l=[],m=function(a){if(!a.hadRecentInput){var b=l[0],d=l[l.length-1];k&&a.startTime-d.startTime<1000&&a.startTime-b.startTime<5000?(k+=a.value,l.push(a)):(k=a.value,l=[a]),k>e.value&&(e.value=k,e.entries=l,c())}},n=g("layout-shift",m);n&&(c=j(d,e,b),h(function(){n.takeRecords().map(m),c(!0)}),i(function(){k=0,q=-1,c=j(d,e=f("CLS",0),b)}))},a.getFCP=o,a.getFID=function(a,d){var k,l=n(),m=f("FID"),o=function(a){a.startTime<l.firstHiddenTime&&(m.value=a.processingStart-a.startTime,m.entries.push(a),k(!0))},p=g("first-input",o);k=j(a,m,d),p&&h(function(){p.takeRecords().map(o),p.disconnect()},!0),p&&i(function(){var g;k=j(a,m=f("FID"),d),e=[],c=-1,b=null,w(addEventListener),g=o,e.push(g),u()})},a.getLCP=function(a,b){var c,d=n(),e=f("LCP"),k=function(a){var b=a.startTime;b<d.firstHiddenTime&&(e.value=b,e.entries.push(a)),c()},l=g("largest-contentful-paint",k);if(l){c=j(a,e,b);var m=function(){x.has(e.id)||(l.takeRecords().map(k),l.disconnect(),x.add(e.id),c(!0))};["keydown","click"].forEach(function(a){addEventListener(a,m,{once:!0,capture:!0})}),h(m,!0),i(function(d){c=j(a,e=f("LCP"),b),requestAnimationFrame(function(){requestAnimationFrame(function(){e.value=performance.now()-d.timeStamp,x.add(e.id),c(!0)})})})}},a.getTTFB=function(a){var b,c=f("TTFB");b=function(){try{var b=performance.getEntriesByType("navigation")[0]||function(){var a=performance.timing,b={entryType:"navigation",startTime:0};for(var c in a)"navigationStart"!==c&&"toJSON"!==c&&(b[c]=Math.max(a[c]-a.navigationStart,0));return b}();if(c.value=c.delta=b.responseStart,c.value<0)return;c.entries=[b],a(c)}catch(d){}},"complete"===document.readyState?setTimeout(b,0):addEventListener("pageshow",b)},Object.defineProperty(a,"__esModule",{value:!0})})}},b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={exports:{}},f=!0;try{a[d].call(e.exports,e,e.exports,c),f=!1}finally{f&&delete b[d]}return e.exports}return c.ab="//",c(770)})()},80676:function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(a){return"object"==typeof a&&null!==a&&"name"in a&&"message"in a}},74522:function(a,b){"use strict";function c(a){return a.replace(/\\/g,"/")}Object.defineProperty(b,"__esModule",{value:!0}),b.normalizePathSep=c,b.denormalizePagePath=function(a){return(a=c(a)).startsWith("/index/")?a=a.slice(6):"/index"===a&&(a="/"),a}},28520:function(a){var b=function(a){"use strict";var b,c=Object.prototype,d=c.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},f=e.iterator||"@@iterator",g=e.asyncIterator||"@@asyncIterator",h=e.toStringTag||"@@toStringTag";function i(a,b,c,d){var e=b&&b.prototype instanceof o?b:o,f=Object.create(e.prototype),g=new B(d||[]);return f._invoke=x(a,c,g),f}function j(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(d){return{type:"throw",arg:d}}}a.wrap=i;var k="suspendedStart",l="executing",m="completed",n={};function o(){}function p(){}function q(){}var r={};r[f]=function(){return this};var s=Object.getPrototypeOf,t=s&&s(s(C([])));t&&t!==c&&d.call(t,f)&&(r=t);var u=q.prototype=o.prototype=Object.create(r);function v(a){["next","throw","return"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}function w(a,b){var c;function e(c,f,g,h){var i=j(a[c],a,f);if("throw"===i.type)h(i.arg);else{var k=i.arg,l=k.value;return l&&"object"==typeof l&&d.call(l,"__await")?b.resolve(l.__await).then(function(a){e("next",a,g,h)},function(a){e("throw",a,g,h)}):b.resolve(l).then(function(a){k.value=a,g(k)},function(a){return e("throw",a,g,h)})}}this._invoke=function(a,d){function f(){return new b(function(b,c){e(a,d,b,c)})}return c=c?c.then(f,f):f()}}function x(a,b,c){var d=k;return function(e,f){if(d===l)throw new Error("Generator is already running");if(d===m){if("throw"===e)throw f;return D()}for(c.method=e,c.arg=f;;){var g=c.delegate;if(g){var h=y(g,c);if(h){if(h===n)continue;return h}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(d===k)throw d=m,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);d=l;var i=j(a,b,c);if("normal"===i.type){if(d=c.done?m:"suspendedYield",i.arg===n)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(d=m,c.method="throw",c.arg=i.arg)}}}function y(a,c){var d=a.iterator[c.method];if(d===b){if(c.delegate=null,"throw"===c.method){if(a.iterator.return&&(c.method="return",c.arg=b,y(a,c),"throw"===c.method))return n;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return n}var e=j(d,a.iterator,c.arg);if("throw"===e.type)return c.method="throw",c.arg=e.arg,c.delegate=null,n;var f=e.arg;return f?f.done?(c[a.resultName]=f.value,c.next=a.nextLoc,"return"!==c.method&&(c.method="next",c.arg=b),c.delegate=null,n):f:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,n)}function z(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function A(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function B(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(z,this),this.reset(!0)}function C(a){if(a){var c=a[f];if(c)return c.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var e=-1,g=function c(){for(;++e<a.length;)if(d.call(a,e))return c.value=a[e],c.done=!1,c;return c.value=b,c.done=!0,c};return g.next=g}}return{next:D}}function D(){return{value:b,done:!0}}return p.prototype=u.constructor=q,q.constructor=p,q[h]=p.displayName="GeneratorFunction",a.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===p||"GeneratorFunction"===(b.displayName||b.name))},a.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,q):(a.__proto__=q,h in a||(a[h]="GeneratorFunction")),a.prototype=Object.create(u),a},a.awrap=function(a){return{__await:a}},v(w.prototype),w.prototype[g]=function(){return this},a.AsyncIterator=w,a.async=function(b,c,d,e,f){void 0===f&&(f=Promise);var g=new w(i(b,c,d,e),f);return a.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},v(u),u[h]="Generator",u[f]=function(){return this},u.toString=function(){return"[object Generator]"},a.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},a.values=C,B.prototype={constructor:B,reset:function(a){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(A),!a)for(var c in this)"t"===c.charAt(0)&&d.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=b)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function(a){if(this.done)throw a;var c=this;function e(d,e){return h.type="throw",h.arg=a,c.next=d,e&&(c.method="next",c.arg=b),!!e}for(var f=this.tryEntries.length-1;f>=0;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return e("end");if(g.tryLoc<=this.prev){var i=d.call(g,"catchLoc"),j=d.call(g,"finallyLoc");if(i&&j){if(this.prev<g.catchLoc)return e(g.catchLoc,!0);if(this.prev<g.finallyLoc)return e(g.finallyLoc)}else if(i){if(this.prev<g.catchLoc)return e(g.catchLoc,!0)}else if(j){if(this.prev<g.finallyLoc)return e(g.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(a,b){for(var c=this.tryEntries.length-1;c>=0;--c){var e=this.tryEntries[c];if(e.tryLoc<=this.prev&&d.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var f=e;break}}f&&("break"===a||"continue"===a)&&f.tryLoc<=b&&b<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return(g.type=a,g.arg=b,f)?(this.method="next",this.next=f.finallyLoc,n):this.complete(g)},complete:function(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),n},finish:function(a){for(var b=this.tryEntries.length-1;b>=0;--b){var c=this.tryEntries[b];if(c.finallyLoc===a)return this.complete(c.completion,c.afterLoc),A(c),n}},"catch":function(a){for(var b=this.tryEntries.length-1;b>=0;--b){var c=this.tryEntries[b];if(c.tryLoc===a){var d=c.completion;if("throw"===d.type){var e=d.arg;A(c)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(a,c,d){return this.delegate={iterator:C(a),resultName:c,nextLoc:d},"next"===this.method&&(this.arg=b),n}},a}(a.exports);try{regeneratorRuntime=b}catch(c){Function("r","regeneratorRuntime = r")(b)}},34155:function(a){var b,c,d,e=a.exports={};function f(){throw new Error("setTimeout has not been defined")}function g(){throw new Error("clearTimeout has not been defined")}function h(a){if(b===setTimeout)return setTimeout(a,0);if((b===f||!b)&&setTimeout)return b=setTimeout,setTimeout(a,0);try{return b(a,0)}catch(c){try{return b.call(null,a,0)}catch(d){return b.call(this,a,0)}}}!function(){try{b="function"==typeof setTimeout?setTimeout:f}catch(a){b=f}try{c="function"==typeof clearTimeout?clearTimeout:g}catch(d){c=g}}();var i=[],j=!1,k=-1;function l(){j&&d&&(j=!1,d.length?i=d.concat(i):k=-1,i.length&&m())}function m(){if(!j){var a=h(l);j=!0;for(var b=i.length;b;){for(d=i,i=[];++k<b;)d&&d[k].run();k=-1,b=i.length}d=null,j=!1,(function(a){if(c===clearTimeout)return clearTimeout(a);if((c===g||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(a);try{c(a)}catch(b){try{return c.call(null,a)}catch(d){return c.call(this,a)}}})(a)}}function n(a,b){this.fun=a,this.array=b}function o(){}e.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];i.push(new n(a,b)),1!==i.length||j||h(m)},n.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=o,e.addListener=o,e.once=o,e.off=o,e.removeListener=o,e.removeAllListeners=o,e.emit=o,e.prependListener=o,e.prependOnceListener=o,e.listeners=function(a){return[]},e.binding=function(a){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(a){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},69887:function(a){"use strict";a.exports=function(a){for(var b=5381,c=a.length;c;)b=33*b^a.charCodeAt(--c);return b>>>0}},15919:function(a,b,c){"use strict";b.__esModule=!0,b.useStyleRegistry=b.createStyleRegistry=b.StyleRegistry=void 0;var d=c(28122);b.StyleRegistry=d.StyleRegistry,b.createStyleRegistry=d.createStyleRegistry,b.useStyleRegistry=d.useStyleRegistry},39035:function(a,b,c){"use strict";b.__esModule=!0,b.computeId=function(a,b){if(!b)return"jsx-"+a;var c=String(b),d=a+c;return f[d]||(f[d]="jsx-"+(0,e.default)(a+"-"+c)),f[d]},b.computeSelector=function(a,b){"undefined"==typeof window&&(b=b.replace(/\/style/gi,"\\/style"));var c=a+b;return f[c]||(f[c]=b.replace(/__jsx-style-dynamic-selector/g,a)),f[c]};var d,e=(d=c(69887))&&d.__esModule?d:{"default":d},f={}},44287:function(a,b,c){"use strict";var d=c(34155);function e(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}b.__esModule=!0,b.default=void 0;var f=void 0!==d&&d.env&&!0,g=function(a){return"[object String]"===Object.prototype.toString.call(a)},h=function(){function a(a){var b=void 0===a?{}:a,c=b.name,d=void 0===c?"stylesheet":c,e=b.optimizeForSpeed,h=void 0===e?f:e,j=b.isBrowser;i(g(d),"`name` must be a string"),this._name=d,this._deletedRulePlaceholder="#"+d+"-deleted-rule____{}",i("boolean"==typeof h,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=h,this._isBrowser=void 0===j?"undefined"!=typeof window:j,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var k=this._isBrowser&&document.querySelector("meta[property=\"csp-nonce\"]");this._nonce=k?k.getAttribute("content"):null}var b,c,d,h=a.prototype;return h.setOptimizeForSpeed=function(a){i("boolean"==typeof a,"`setOptimizeForSpeed` accepts a boolean"),i(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=a,this.inject()},h.isOptimizeForSpeed=function(){return this._optimizeForSpeed},h.inject=function(){var a=this;if(i(!this._injected,"sheet already injected"),this._injected=!0,this._isBrowser&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(f||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(b,c){return"number"==typeof c?a._serverSheet.cssRules[c]={cssText:b}:a._serverSheet.cssRules.push({cssText:b}),c},deleteRule:function(b){a._serverSheet.cssRules[b]=null}}},h.getSheetForTag=function(a){if(a.sheet)return a.sheet;for(var b=0;b<document.styleSheets.length;b++)if(document.styleSheets[b].ownerNode===a)return document.styleSheets[b]},h.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},h.insertRule=function(a,b){if(i(g(a),"`insertRule` accepts only strings"),!this._isBrowser)return"number"!=typeof b&&(b=this._serverSheet.cssRules.length),this._serverSheet.insertRule(a,b),this._rulesCount++;if(this._optimizeForSpeed){var c=this.getSheet();"number"!=typeof b&&(b=c.cssRules.length);try{c.insertRule(a,b)}catch(d){return f||console.warn("StyleSheet: illegal rule: \n\n"+a+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var e=this._tags[b];this._tags.push(this.makeStyleTag(this._name,a,e))}return this._rulesCount++},h.replaceRule=function(a,b){if(this._optimizeForSpeed||!this._isBrowser){var c=this._isBrowser?this.getSheet():this._serverSheet;if(b.trim()||(b=this._deletedRulePlaceholder),!c.cssRules[a])return a;c.deleteRule(a);try{c.insertRule(b,a)}catch(d){f||console.warn("StyleSheet: illegal rule: \n\n"+b+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),c.insertRule(this._deletedRulePlaceholder,a)}}else{var e=this._tags[a];i(e,"old rule at index `"+a+"` not found"),e.textContent=b}return a},h.deleteRule=function(a){if(!this._isBrowser){this._serverSheet.deleteRule(a);return}if(this._optimizeForSpeed)this.replaceRule(a,"");else{var b=this._tags[a];i(b,"rule at index `"+a+"` not found"),b.parentNode.removeChild(b),this._tags[a]=null}},h.flush=function(){this._injected=!1,this._rulesCount=0,this._isBrowser?(this._tags.forEach(function(a){return a&&a.parentNode.removeChild(a)}),this._tags=[]):this._serverSheet.cssRules=[]},h.cssRules=function(){var a=this;return this._isBrowser?this._tags.reduce(function(b,c){return c?b=b.concat(Array.prototype.map.call(a.getSheetForTag(c).cssRules,function(b){return b.cssText===a._deletedRulePlaceholder?null:b})):b.push(null),b},[]):this._serverSheet.cssRules},h.makeStyleTag=function(a,b,c){b&&i(g(b),"makeStyleTag acceps only strings as second parameter");var d=document.createElement("style");this._nonce&&d.setAttribute("nonce",this._nonce),d.type="text/css",d.setAttribute("data-"+a,""),b&&d.appendChild(document.createTextNode(b));var e=document.head||document.getElementsByTagName("head")[0];return c?e.insertBefore(d,c):e.appendChild(d),d},c=[{key:"length",get:function(){return this._rulesCount}}],e((b=a).prototype,c),d&&e(b,d),a}();function i(a,b){if(!a)throw new Error("StyleSheet: "+b+".")}b.default=h},28122:function(a,b,c){"use strict";b.__esModule=!0,b.createStyleRegistry=l,b.StyleRegistry=function(a){var b=a.registry,c=a.children,d=(0,e.useContext)(k),f=(0,e.useState)(function(){return d||b||l()})[0];return e.default.createElement(k.Provider,{value:f},c)},b.useStyleRegistry=function(){return(0,e.useContext)(k)},b.StyleSheetContext=b.StyleSheetRegistry=void 0;var d,e=function(a){if(a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{"default":a};var b=h();if(b&&b.has(a))return b.get(a);var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a)if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;f&&(f.get||f.set)?Object.defineProperty(c,e,f):c[e]=a[e]}return c.default=a,b&&b.set(a,c),c}(c(67294)),f=(d=c(44287))&&d.__esModule?d:{"default":d},g=c(39035);function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap();return h=function(){return a},a}var i=function(){function a(a){var b=void 0===a?{}:a,c=b.styleSheet,d=void 0===c?null:c,e=b.optimizeForSpeed,g=void 0!==e&&e,h=b.isBrowser;this._sheet=d||new f.default({name:"styled-jsx",optimizeForSpeed:g}),this._sheet.inject(),d&&"boolean"==typeof g&&(this._sheet.setOptimizeForSpeed(g),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._isBrowser=void 0===h?"undefined"!=typeof window:h,this._fromServer=void 0,this._indices={},this._instancesCounts={}}var b=a.prototype;return b.add=function(a){var b=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(a.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._isBrowser&&!this._fromServer&&(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(a,b){return a[b]=0,a},{}));var c=this.getIdAndRules(a),d=c.styleId,e=c.rules;if(d in this._instancesCounts){this._instancesCounts[d]+=1;return}var f=e.map(function(a){return b._sheet.insertRule(a)}).filter(function(a){return -1!==a});this._indices[d]=f,this._instancesCounts[d]=1},b.remove=function(a){var b=this,c=this.getIdAndRules(a).styleId;if(j(c in this._instancesCounts,"styleId: `"+c+"` not found"),this._instancesCounts[c]-=1,this._instancesCounts[c]<1){var d=this._fromServer&&this._fromServer[c];d?(d.parentNode.removeChild(d),delete this._fromServer[c]):(this._indices[c].forEach(function(a){return b._sheet.deleteRule(a)}),delete this._indices[c]),delete this._instancesCounts[c]}},b.update=function(a,b){this.add(b),this.remove(a)},b.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},b.cssRules=function(){var a=this,b=this._fromServer?Object.keys(this._fromServer).map(function(b){return[b,a._fromServer[b]]}):[],c=this._sheet.cssRules();return b.concat(Object.keys(this._indices).map(function(b){return[b,a._indices[b].map(function(a){return c[a].cssText}).join(a._optimizeForSpeed?"":"\n")]}).filter(function(a){return Boolean(a[1])}))},b.styles=function(a){var b,c;return b=this.cssRules(),void 0===(c=a)&&(c={}),b.map(function(a){var b=a[0],d=a[1];return e.default.createElement("style",{id:"__"+b,key:"__"+b,nonce:c.nonce?c.nonce:void 0,dangerouslySetInnerHTML:{__html:d}})})},b.getIdAndRules=function(a){var b=a.children,c=a.dynamic,d=a.id;if(c){var e=(0,g.computeId)(d,c);return{styleId:e,rules:Array.isArray(b)?b.map(function(a){return(0,g.computeSelector)(e,a)}):[(0,g.computeSelector)(e,b)]}}return{styleId:(0,g.computeId)(d),rules:Array.isArray(b)?b:[b]}},b.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll("[id^=\"__jsx-\"]")).reduce(function(a,b){return a[b.id.slice(2)]=b,a},{})},a}();function j(a,b){if(!a)throw new Error("StyleSheetRegistry: "+b+".")}b.StyleSheetRegistry=i;var k=(0,e.createContext)(null);function l(){return new i()}b.StyleSheetContext=k},8771:function(a,b,c){a.exports=c(15919)},72431:function(){}},function(a){a.O(0,[9774],function(){return a(a.s=22870)}),_N_E=a.O()}])


Cheers! And looking forward to the fix! Thank you!

@eps1lon
Copy link
Author

eps1lon commented Jan 16, 2022

@sgrobert How did you make it crash with NextJS? Could you share a cloneable repository I can take a look at?

Even with strictExportPresence: true, NextJS will compile the original code just fine.

Workaround for library authors faced with the same issue:

Instead of accessing potentially unavailable exports from a namespace import via static keys (e.g. React.useId) you can use a simple computed key. Webpack does not seem to attempt to figure out what specific export one wants to access i.e. const maybeReactUseId = React['useId' + ''] does not produce compilation warnings/errors.

@sgrobert
Copy link

sgrobert commented Jan 16, 2022

Hi @eps1lon,

I think this matter was previously resolved with the recent patch updates.

Thank you for reaching out on this matter! ;)

@vankop vankop changed the title export '...' (imported as '...') was not found in '...' is disruptive when used for (peer)dependencies webpack should not warn import usage, when import is unreachable (e.g. guarded by if statement) Feb 2, 2022
@vankop vankop linked a pull request Mar 9, 2022 that will close this issue
@ghost
Copy link

ghost commented Nov 17, 2022

Any updates on when this will be fixed? We are running into this with our consumption of @radix-ui/react-tooltip.

@nickiaconis
Copy link

Workaround for library authors faced with the same issue:

Instead of accessing potentially unavailable exports from a namespace import via static keys (e.g. React.useId) you can use a simple computed key. Webpack does not seem to attempt to figure out what specific export one wants to access i.e. const maybeReactUseId = React['useId' + ''] does not produce compilation warnings/errors.

I've found that downstream bundlers have a tendency to remove the unnecessary string concatenation. It appears that React['useId'.toString()] (as seen in this commit to floating-ui) survives subsequent bundling, so I'd recommend library authors use this instead.

@alexander-akait
Copy link
Member

Yeah, just make it non analyzable 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Priority - High
Development

Successfully merging a pull request may close this issue.

7 participants