@paroicms/site-generator-plugin 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/{gen-backend → backend}/dist/commands/generator-session.js +13 -4
  2. package/backend/dist/commands/validate-recaptcha-response.js +20 -0
  3. package/backend/dist/context.js +5 -0
  4. package/{gen-backend → backend}/dist/data-format.js +2 -1
  5. package/{gen-backend → backend}/dist/generator/fake-content-generator/generate-fake-content.js +1 -1
  6. package/{gen-backend/dist/plugin.js → backend/dist/index.js} +10 -5
  7. package/{gen-backend → backend}/prompts/predefined-fields.json +9 -2
  8. package/frontend/dist/frontend.mjs +122 -0
  9. package/package.json +20 -40
  10. package/gen-backend/dist/context.js +0 -8
  11. package/gen-backend/dist/generator/helpers/esm-module.helper.js +0 -6
  12. package/gen-front/dist/gen-front.mjs +0 -166
  13. /package/{gen-backend → backend}/ddl/site-generator.ddl.sql +0 -0
  14. /package/{gen-backend → backend}/dist/commands/execute-command.js +0 -0
  15. /package/{gen-backend → backend}/dist/db/db-init.js +0 -0
  16. /package/{gen-backend → backend}/dist/db/db-read.queries.js +0 -0
  17. /package/{gen-backend → backend}/dist/db/db-write.queries.js +0 -0
  18. /package/{gen-backend → backend}/dist/db/ddl-migration.js +0 -0
  19. /package/{gen-backend → backend}/dist/db/formatters.js +0 -0
  20. /package/{gen-backend → backend}/dist/generator/fake-content-generator/content-helpers.js +0 -0
  21. /package/{gen-backend → backend}/dist/generator/fake-content-generator/content-report.js +0 -0
  22. /package/{gen-backend → backend}/dist/generator/fake-content-generator/create-database-with-fake-content.js +0 -0
  23. /package/{gen-backend → backend}/dist/generator/fake-content-generator/create-node-contents.js +0 -0
  24. /package/{gen-backend → backend}/dist/generator/fake-content-generator/fake-content-types.js +0 -0
  25. /package/{gen-backend → backend}/dist/generator/fake-content-generator/fill-lnodes.js +0 -0
  26. /package/{gen-backend → backend}/dist/generator/fake-content-generator/fill-site-fields.js +0 -0
  27. /package/{gen-backend → backend}/dist/generator/fake-content-generator/fill-taxonomy-fields.js +0 -0
  28. /package/{gen-backend → backend}/dist/generator/fake-content-generator/invoke-generate-fake-content.js +0 -0
  29. /package/{gen-backend → backend}/dist/generator/helpers/js-utils.js +0 -0
  30. /package/{gen-backend → backend}/dist/generator/lib/calling-llm-anthropic.js +0 -0
  31. /package/{gen-backend → backend}/dist/generator/lib/calling-llm-mistral.js +0 -0
  32. /package/{gen-backend → backend}/dist/generator/lib/common-types.js +0 -0
  33. /package/{gen-backend → backend}/dist/generator/lib/create-prompt.js +0 -0
  34. /package/{gen-backend → backend}/dist/generator/lib/debug-utils.js +0 -0
  35. /package/{gen-backend → backend}/dist/generator/lib/images-lib.js +0 -0
  36. /package/{gen-backend → backend}/dist/generator/lib/llm-invoke-types.js +0 -0
  37. /package/{gen-backend → backend}/dist/generator/lib/llm-tokens.js +0 -0
  38. /package/{gen-backend → backend}/dist/generator/lib/llm-utils.js +0 -0
  39. /package/{gen-backend → backend}/dist/generator/lib/markdown-bulleted-list-parser.js +0 -0
  40. /package/{gen-backend → backend}/dist/generator/lib/parse-llm-response.js +0 -0
  41. /package/{gen-backend → backend}/dist/generator/lib/prompt-template.js +0 -0
  42. /package/{gen-backend → backend}/dist/generator/lib/session-utils.js +0 -0
  43. /package/{gen-backend → backend}/dist/generator/lib/tasks.js +0 -0
  44. /package/{gen-backend → backend}/dist/generator/lib/utils.js +0 -0
  45. /package/{gen-backend → backend}/dist/generator/llm-queries/invoke-message-guard.js +0 -0
  46. /package/{gen-backend → backend}/dist/generator/llm-queries/invoke-new-site-analysis.js +0 -0
  47. /package/{gen-backend → backend}/dist/generator/llm-queries/invoke-update-site-schema.js +0 -0
  48. /package/{gen-backend → backend}/dist/generator/site-generator/common-template-creator.js +0 -0
  49. /package/{gen-backend → backend}/dist/generator/site-generator/document-template-creator.js +0 -0
  50. /package/{gen-backend → backend}/dist/generator/site-generator/id-key-provider.js +0 -0
  51. /package/{gen-backend → backend}/dist/generator/site-generator/jt-site-schema-helpers.js +0 -0
  52. /package/{gen-backend → backend}/dist/generator/site-generator/site-generator.js +0 -0
  53. /package/{gen-backend → backend}/dist/generator/site-generator/template-creator-types.js +0 -0
  54. /package/{gen-backend → backend}/dist/generator/site-generator/template-helpers.js +0 -0
  55. /package/{gen-backend → backend}/dist/generator/site-generator/theme-creator.js +0 -0
  56. /package/{gen-backend → backend}/dist/generator/site-generator/theme-css.js +0 -0
  57. /package/{gen-backend → backend}/dist/generator/site-schema-generator/analysis-types.js +0 -0
  58. /package/{gen-backend → backend}/dist/generator/site-schema-generator/create-l10n.js +0 -0
  59. /package/{gen-backend → backend}/dist/generator/site-schema-generator/create-site-schema.js +0 -0
  60. /package/{gen-backend → backend}/dist/generator/site-schema-generator/default-pages.js +0 -0
  61. /package/{gen-backend → backend}/dist/lib/create-raw-context.js +0 -0
  62. /package/{gen-backend → backend}/dist/lib/internal-types.js +0 -0
  63. /package/{gen-backend → backend}/dist/lib/site-remover.js +0 -0
  64. /package/{gen-backend → backend}/images/im01.webp +0 -0
  65. /package/{gen-backend → backend}/images/im02.webp +0 -0
  66. /package/{gen-backend → backend}/images/im03.webp +0 -0
  67. /package/{gen-backend → backend}/images/im04.webp +0 -0
  68. /package/{gen-backend → backend}/images/im05.webp +0 -0
  69. /package/{gen-backend → backend}/images/im06.webp +0 -0
  70. /package/{gen-backend → backend}/images/im07.webp +0 -0
  71. /package/{gen-backend → backend}/images/im08.webp +0 -0
  72. /package/{gen-backend → backend}/images/im09.webp +0 -0
  73. /package/{gen-backend → backend}/images/im10.webp +0 -0
  74. /package/{gen-backend → backend}/images/im11.webp +0 -0
  75. /package/{gen-backend → backend}/images/im12.webp +0 -0
  76. /package/{gen-backend → backend}/prompts/0-context.md +0 -0
  77. /package/{gen-backend → backend}/prompts/generate-fake-content-multiple-documents.md +0 -0
  78. /package/{gen-backend → backend}/prompts/generate-fake-content-multiple-parts.md +0 -0
  79. /package/{gen-backend → backend}/prompts/generate-fake-content-single.md +0 -0
  80. /package/{gen-backend → backend}/prompts/initial-1-analysis.md +0 -0
  81. /package/{gen-backend → backend}/prompts/initial-2-fields.md +0 -0
  82. /package/{gen-backend → backend}/prompts/message-guard.md +0 -0
  83. /package/{gen-backend → backend}/prompts/update-site-schema-1-write-details.md +0 -0
  84. /package/{gen-backend → backend}/prompts/update-site-schema-2-execute.md +0 -0
  85. /package/{gen-front/dist/gen-front.css → frontend/dist/frontend.css} +0 -0
@@ -1,166 +0,0 @@
1
- var oN=Object.defineProperty;var uN=(t,n,i)=>n in t?oN(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i;var w=(t,n,i)=>uN(t,typeof n!="symbol"?n+"":n,i);function Zv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pf={exports:{}},ls={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var ey;function cN(){if(ey)return ls;ey=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,l,u){var f=null;if(u!==void 0&&(f=""+u),l.key!==void 0&&(f=""+l.key),"key"in l){u={};for(var d in l)d!=="key"&&(u[d]=l[d])}else u=l;return l=u.ref,{$$typeof:t,type:a,key:f,ref:l!==void 0?l:null,props:u}}return ls.Fragment=n,ls.jsx=i,ls.jsxs=i,ls}var ty;function fN(){return ty||(ty=1,pf.exports=cN()),pf.exports}var S=fN();const ce=t=>typeof t=="string",os=()=>{let t,n;const i=new Promise((a,l)=>{t=a,n=l});return i.resolve=t,i.reject=n,i},ny=t=>t==null?"":""+t,dN=(t,n,i)=>{t.forEach(a=>{n[a]&&(i[a]=n[a])})},hN=/###/g,iy=t=>t&&t.indexOf("###")>-1?t.replace(hN,"."):t,ry=t=>!t||ce(t),gs=(t,n,i)=>{const a=ce(n)?n.split("."):n;let l=0;for(;l<a.length-1;){if(ry(t))return{};const u=iy(a[l]);!t[u]&&i&&(t[u]=new i),Object.prototype.hasOwnProperty.call(t,u)?t=t[u]:t={},++l}return ry(t)?{}:{obj:t,k:iy(a[l])}},ay=(t,n,i)=>{const{obj:a,k:l}=gs(t,n,Object);if(a!==void 0||n.length===1){a[l]=i;return}let u=n[n.length-1],f=n.slice(0,n.length-1),d=gs(t,f,Object);for(;d.obj===void 0&&f.length;)u=`${f[f.length-1]}.${u}`,f=f.slice(0,f.length-1),d=gs(t,f,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${u}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${u}`]=i},pN=(t,n,i,a)=>{const{obj:l,k:u}=gs(t,n,Object);l[u]=l[u]||[],l[u].push(i)},bo=(t,n)=>{const{obj:i,k:a}=gs(t,n);if(i&&Object.prototype.hasOwnProperty.call(i,a))return i[a]},mN=(t,n,i)=>{const a=bo(t,i);return a!==void 0?a:bo(n,i)},Qv=(t,n,i)=>{for(const a in n)a!=="__proto__"&&a!=="constructor"&&(a in t?ce(t[a])||t[a]instanceof String||ce(n[a])||n[a]instanceof String?i&&(t[a]=n[a]):Qv(t[a],n[a],i):t[a]=n[a]);return t},Gr=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var gN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const yN=t=>ce(t)?t.replace(/[&<>"'\/]/g,n=>gN[n]):t;class vN{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const i=this.regExpMap.get(n);if(i!==void 0)return i;const a=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,a),this.regExpQueue.push(n),a}}const bN=[" ",",","?","!",";"],xN=new vN(20),SN=(t,n,i)=>{n=n||"",i=i||"";const a=bN.filter(f=>n.indexOf(f)<0&&i.indexOf(f)<0);if(a.length===0)return!0;const l=xN.getRegExp(`(${a.map(f=>f==="?"?"\\?":f).join("|")})`);let u=!l.test(t);if(!u){const f=t.indexOf(i);f>0&&!l.test(t.substring(0,f))&&(u=!0)}return u},Uf=(t,n,i=".")=>{if(!t)return;if(t[n])return Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0;const a=n.split(i);let l=t;for(let u=0;u<a.length;){if(!l||typeof l!="object")return;let f,d="";for(let m=u;m<a.length;++m)if(m!==u&&(d+=i),d+=a[m],f=l[d],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&m<a.length-1)continue;u+=m-u+1;break}l=f}return l},bs=t=>t==null?void 0:t.replace("_","-"),wN={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,n){var i,a;(a=(i=console==null?void 0:console[t])==null?void 0:i.apply)==null||a.call(i,console,n)}};class xo{constructor(n,i={}){this.init(n,i)}init(n,i={}){this.prefix=i.prefix||"i18next:",this.logger=n||wN,this.options=i,this.debug=i.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,i,a,l){return l&&!this.debug?null:(ce(n[0])&&(n[0]=`${a}${this.prefix} ${n[0]}`),this.logger[i](n))}create(n){return new xo(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new xo(this.logger,n)}}var wn=new xo;class zo{constructor(){this.observers={}}on(n,i){return n.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const l=this.observers[a].get(i)||0;this.observers[a].set(i,l+1)}),this}off(n,i){if(this.observers[n]){if(!i){delete this.observers[n];return}this.observers[n].delete(i)}}emit(n,...i){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([l,u])=>{for(let f=0;f<u;f++)l(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,u])=>{for(let f=0;f<u;f++)l.apply(l,[n,...i])})}}class sy extends zo{constructor(n,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const i=this.options.ns.indexOf(n);i>-1&&this.options.ns.splice(i,1)}getResource(n,i,a,l={}){var p,g;const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,f=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;n.indexOf(".")>-1?d=n.split("."):(d=[n,i],a&&(Array.isArray(a)?d.push(...a):ce(a)&&u?d.push(...a.split(u)):d.push(a)));const m=bo(this.data,d);return!m&&!i&&!a&&n.indexOf(".")>-1&&(n=d[0],i=d[1],a=d.slice(2).join(".")),m||!f||!ce(a)?m:Uf((g=(p=this.data)==null?void 0:p[n])==null?void 0:g[i],a,u)}addResource(n,i,a,l,u={silent:!1}){const f=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let d=[n,i];a&&(d=d.concat(f?a.split(f):a)),n.indexOf(".")>-1&&(d=n.split("."),l=i,i=d[1]),this.addNamespaces(i),ay(this.data,d,l),u.silent||this.emit("added",n,i,a,l)}addResources(n,i,a,l={silent:!1}){for(const u in a)(ce(a[u])||Array.isArray(a[u]))&&this.addResource(n,i,u,a[u],{silent:!0});l.silent||this.emit("added",n,i,a)}addResourceBundle(n,i,a,l,u,f={silent:!1,skipCopy:!1}){let d=[n,i];n.indexOf(".")>-1&&(d=n.split("."),l=a,a=i,i=d[1]),this.addNamespaces(i);let m=bo(this.data,d)||{};f.skipCopy||(a=JSON.parse(JSON.stringify(a))),l?Qv(m,a,u):m={...m,...a},ay(this.data,d,m),f.silent||this.emit("added",n,i,a)}removeResourceBundle(n,i){this.hasResourceBundle(n,i)&&delete this.data[n][i],this.removeNamespaces(i),this.emit("removed",n,i)}hasResourceBundle(n,i){return this.getResource(n,i)!==void 0}getResourceBundle(n,i){return i||(i=this.options.defaultNS),this.getResource(n,i)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const i=this.getDataByLanguage(n);return!!(i&&Object.keys(i)||[]).find(l=>i[l]&&Object.keys(i[l]).length>0)}toJSON(){return this.data}}var Fv={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,n,i,a,l){return t.forEach(u=>{var f;n=((f=this.processors[u])==null?void 0:f.process(n,i,a,l))??n}),n}};const ly={},oy=t=>!ce(t)&&typeof t!="boolean"&&typeof t!="number";class So extends zo{constructor(n,i={}){super(),dN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wn.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n,i={interpolation:{}}){const a={...i};if(n==null)return!1;const l=this.resolve(n,a);return(l==null?void 0:l.res)!==void 0}extractFromKey(n,i){let a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let u=i.ns||this.options.defaultNS||[];const f=a&&n.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!SN(n,a,l);if(f&&!d){const m=n.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:n,namespaces:ce(u)?[u]:u};const p=n.split(a);(a!==l||a===l&&this.options.ns.indexOf(p[0])>-1)&&(u=p.shift()),n=p.join(l)}return{key:n,namespaces:ce(u)?[u]:u}}translate(n,i,a){let l=typeof i=="object"?{...i}:i;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(l={...l}),l||(l={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);const u=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:d,namespaces:m}=this.extractFromKey(n[n.length-1],l),p=m[m.length-1];let g=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const v=l.lng||this.language,b=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return b?u?{res:`${p}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:`${p}${g}${d}`:u?{res:d,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:p,usedParams:this.getUsedParamsDetails(l)}:d;const R=this.resolve(n,l);let N=R==null?void 0:R.res;const O=(R==null?void 0:R.usedKey)||d,U=(R==null?void 0:R.exactUsedKey)||d,z=["[object Number]","[object Function]","[object RegExp]"],L=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,G=!this.i18nFormat||this.i18nFormat.handleAsObject,X=l.count!==void 0&&!ce(l.count),F=So.hasDefaultValue(l),pe=X?this.pluralResolver.getSuffix(v,l.count,l):"",fe=l.ordinal&&X?this.pluralResolver.getSuffix(v,l.count,{ordinal:!1}):"",re=X&&!l.ordinal&&l.count===0,ee=re&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${pe}`]||l[`defaultValue${fe}`]||l.defaultValue;let oe=N;G&&!N&&F&&(oe=ee);const xe=oy(oe),ot=Object.prototype.toString.apply(oe);if(G&&oe&&xe&&z.indexOf(ot)<0&&!(ce(L)&&Array.isArray(oe))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ut=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,oe,{...l,ns:m}):`key '${d} (${this.language})' returned an object instead of string.`;return u?(R.res=ut,R.usedParams=this.getUsedParamsDetails(l),R):ut}if(f){const ut=Array.isArray(oe),it=ut?[]:{},rt=ut?U:O;for(const B in oe)if(Object.prototype.hasOwnProperty.call(oe,B)){const Y=`${rt}${f}${B}`;F&&!N?it[B]=this.translate(Y,{...l,defaultValue:oy(ee)?ee[B]:void 0,joinArrays:!1,ns:m}):it[B]=this.translate(Y,{...l,joinArrays:!1,ns:m}),it[B]===Y&&(it[B]=oe[B])}N=it}}else if(G&&ce(L)&&Array.isArray(N))N=N.join(L),N&&(N=this.extendTranslation(N,n,l,a));else{let ut=!1,it=!1;!this.isValidLookup(N)&&F&&(ut=!0,N=ee),this.isValidLookup(N)||(it=!0,N=d);const B=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&it?void 0:N,Y=F&&ee!==N&&this.options.updateMissing;if(it||ut||Y){if(this.logger.log(Y?"updateKey":"missingKey",v,p,d,Y?ee:N),f){const V=this.resolve(d,{...l,keySeparator:!1});V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ne=[];const ke=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ke&&ke[0])for(let V=0;V<ke.length;V++)ne.push(ke[V]);else this.options.saveMissingTo==="all"?ne=this.languageUtils.toResolveHierarchy(l.lng||this.language):ne.push(l.lng||this.language);const E=(V,Q,I)=>{var Se;const ie=F&&I!==N?I:B;this.options.missingKeyHandler?this.options.missingKeyHandler(V,p,Q,ie,Y,l):(Se=this.backendConnector)!=null&&Se.saveMissing&&this.backendConnector.saveMissing(V,p,Q,ie,Y,l),this.emit("missingKey",V,p,Q,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?ne.forEach(V=>{const Q=this.pluralResolver.getSuffixes(V,l);re&&l[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(I=>{E([V],d+I,l[`defaultValue${I}`]||ee)})}):E(ne,d,ee))}N=this.extendTranslation(N,n,l,R,a),it&&N===d&&this.options.appendNamespaceToMissingKey&&(N=`${p}${g}${d}`),(it||ut)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${g}${d}`:d,ut?N:void 0,l))}return u?(R.res=N,R.usedParams=this.getUsedParamsDetails(l),R):N}extendTranslation(n,i,a,l,u){var m,p;if((m=this.i18nFormat)!=null&&m.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const g=ce(n)&&(((p=a==null?void 0:a.interpolation)==null?void 0:p.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(g){const R=n.match(this.interpolator.nestingRegexp);v=R&&R.length}let b=a.replace&&!ce(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),n=this.interpolator.interpolate(n,b,a.lng||this.language||l.usedLng,a),g){const R=n.match(this.interpolator.nestingRegexp),N=R&&R.length;v<N&&(a.nest=!1)}!a.lng&&l&&l.res&&(a.lng=this.language||l.usedLng),a.nest!==!1&&(n=this.interpolator.nest(n,(...R)=>(u==null?void 0:u[0])===R[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${R[0]} in key: ${i[0]}`),null):this.translate(...R,i),a)),a.interpolation&&this.interpolator.reset()}const f=a.postProcess||this.options.postProcess,d=ce(f)?[f]:f;return n!=null&&(d!=null&&d.length)&&a.applyPostProcessor!==!1&&(n=Fv.handle(d,n,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),n}resolve(n,i={}){let a,l,u,f,d;return ce(n)&&(n=[n]),n.forEach(m=>{if(this.isValidLookup(a))return;const p=this.extractFromKey(m,i),g=p.key;l=g;let v=p.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const b=i.count!==void 0&&!ce(i.count),R=b&&!i.ordinal&&i.count===0,N=i.context!==void 0&&(ce(i.context)||typeof i.context=="number")&&i.context!=="",O=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);v.forEach(U=>{var z,L;this.isValidLookup(a)||(d=U,!ly[`${O[0]}-${U}`]&&((z=this.utils)!=null&&z.hasLoadedNamespace)&&!((L=this.utils)!=null&&L.hasLoadedNamespace(d))&&(ly[`${O[0]}-${U}`]=!0,this.logger.warn(`key "${l}" for languages "${O.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(G=>{var pe;if(this.isValidLookup(a))return;f=G;const X=[g];if((pe=this.i18nFormat)!=null&&pe.addLookupKeys)this.i18nFormat.addLookupKeys(X,g,G,U,i);else{let fe;b&&(fe=this.pluralResolver.getSuffix(G,i.count,i));const re=`${this.options.pluralSeparator}zero`,ee=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(X.push(g+fe),i.ordinal&&fe.indexOf(ee)===0&&X.push(g+fe.replace(ee,this.options.pluralSeparator)),R&&X.push(g+re)),N){const oe=`${g}${this.options.contextSeparator}${i.context}`;X.push(oe),b&&(X.push(oe+fe),i.ordinal&&fe.indexOf(ee)===0&&X.push(oe+fe.replace(ee,this.options.pluralSeparator)),R&&X.push(oe+re))}}let F;for(;F=X.pop();)this.isValidLookup(a)||(u=F,a=this.getResource(G,U,F,i))}))})}),{res:a,usedKey:l,exactUsedKey:u,usedLng:f,usedNS:d}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,i,a,l={}){var u;return(u=this.i18nFormat)!=null&&u.getResource?this.i18nFormat.getResource(n,i,a,l):this.resourceStore.getResource(n,i,a,l)}getUsedParamsDetails(n={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=n.replace&&!ce(n.replace);let l=a?n.replace:n;if(a&&typeof n.count<"u"&&(l.count=n.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!a){l={...l};for(const u of i)delete l[u]}return l}static hasDefaultValue(n){const i="defaultValue";for(const a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&i===a.substring(0,i.length)&&n[a]!==void 0)return!0;return!1}}class uy{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wn.create("languageUtils")}getScriptPartFromCode(n){if(n=bs(n),!n||n.indexOf("-")<0)return null;const i=n.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(n){if(n=bs(n),!n||n.indexOf("-")<0)return n;const i=n.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(n){if(ce(n)&&n.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(n)[0]}catch{}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let i;return n.forEach(a=>{if(i)return;const l=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(l))&&(i=l)}),!i&&this.options.supportedLngs&&n.forEach(a=>{if(i)return;const l=this.getScriptPartFromCode(a);if(this.isSupportedCode(l))return i=l;const u=this.getLanguagePartFromCode(a);if(this.isSupportedCode(u))return i=u;i=this.options.supportedLngs.find(f=>{if(f===u)return f;if(!(f.indexOf("-")<0&&u.indexOf("-")<0)&&(f.indexOf("-")>0&&u.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===u||f.indexOf(u)===0&&u.length>1))return f})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(n,i){if(!n)return[];if(typeof n=="function"&&(n=n(i)),ce(n)&&(n=[n]),Array.isArray(n))return n;if(!i)return n.default||[];let a=n[i];return a||(a=n[this.getScriptPartFromCode(i)]),a||(a=n[this.formatLanguageCode(i)]),a||(a=n[this.getLanguagePartFromCode(i)]),a||(a=n.default),a||[]}toResolveHierarchy(n,i){const a=this.getFallbackCodes((i===!1?[]:i)||this.options.fallbackLng||[],n),l=[],u=f=>{f&&(this.isSupportedCode(f)?l.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return ce(n)&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(n))):ce(n)&&u(this.formatLanguageCode(n)),a.forEach(f=>{l.indexOf(f)<0&&u(this.formatLanguageCode(f))}),l}}const cy={zero:0,one:1,two:2,few:3,many:4,other:5},fy={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class NN{constructor(n,i={}){this.languageUtils=n,this.options=i,this.logger=wn.create("pluralResolver"),this.pluralRulesCache={}}addRule(n,i){this.rules[n]=i}clearCache(){this.pluralRulesCache={}}getRule(n,i={}){const a=bs(n==="dev"?"en":n),l=i.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:a,type:l});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let f;try{f=new Intl.PluralRules(a,{type:l})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),fy;if(!n.match(/-|_/))return fy;const m=this.languageUtils.getLanguagePartFromCode(n);f=this.getRule(m,i)}return this.pluralRulesCache[u]=f,f}needsPlural(n,i={}){let a=this.getRule(n,i);return a||(a=this.getRule("dev",i)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(n,i,a={}){return this.getSuffixes(n,a).map(l=>`${i}${l}`)}getSuffixes(n,i={}){let a=this.getRule(n,i);return a||(a=this.getRule("dev",i)),a?a.resolvedOptions().pluralCategories.sort((l,u)=>cy[l]-cy[u]).map(l=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(n,i,a={}){const l=this.getRule(n,a);return l?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${l.select(i)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",i,a))}}const dy=(t,n,i,a=".",l=!0)=>{let u=mN(t,n,i);return!u&&l&&ce(i)&&(u=Uf(t,i,a),u===void 0&&(u=Uf(n,i,a))),u},mf=t=>t.replace(/\$/g,"$$$$");class kN{constructor(n={}){var i;this.logger=wn.create("interpolator"),this.options=n,this.format=((i=n==null?void 0:n.interpolation)==null?void 0:i.format)||(a=>a),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:i,escapeValue:a,useRawValueToEscape:l,prefix:u,prefixEscaped:f,suffix:d,suffixEscaped:m,formatSeparator:p,unescapeSuffix:g,unescapePrefix:v,nestingPrefix:b,nestingPrefixEscaped:R,nestingSuffix:N,nestingSuffixEscaped:O,nestingOptionsSeparator:U,maxReplaces:z,alwaysFormat:L}=n.interpolation;this.escape=i!==void 0?i:yN,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=u?Gr(u):f||"{{",this.suffix=d?Gr(d):m||"}}",this.formatSeparator=p||",",this.unescapePrefix=g?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=b?Gr(b):R||Gr("$t("),this.nestingSuffix=N?Gr(N):O||Gr(")"),this.nestingOptionsSeparator=U||",",this.maxReplaces=z||1e3,this.alwaysFormat=L!==void 0?L:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(i,a)=>(i==null?void 0:i.source)===a?(i.lastIndex=0,i):new RegExp(a,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(n,i,a,l){var R;let u,f,d;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},p=N=>{if(N.indexOf(this.formatSeparator)<0){const L=dy(i,m,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(L,void 0,a,{...l,...i,interpolationkey:N}):L}const O=N.split(this.formatSeparator),U=O.shift().trim(),z=O.join(this.formatSeparator).trim();return this.format(dy(i,m,U,this.options.keySeparator,this.options.ignoreJSONStructure),z,a,{...l,...i,interpolationkey:U})};this.resetRegExp();const g=(l==null?void 0:l.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((R=l==null?void 0:l.interpolation)==null?void 0:R.skipOnVariables)!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:N=>mf(N)},{regex:this.regexp,safeValue:N=>this.escapeValue?mf(this.escape(N)):mf(N)}].forEach(N=>{for(d=0;u=N.regex.exec(n);){const O=u[1].trim();if(f=p(O),f===void 0)if(typeof g=="function"){const z=g(n,u,l);f=ce(z)?z:""}else if(l&&Object.prototype.hasOwnProperty.call(l,O))f="";else if(v){f=u[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${n}`),f="";else!ce(f)&&!this.useRawValueToEscape&&(f=ny(f));const U=N.safeValue(f);if(n=n.replace(u[0],U),v?(N.regex.lastIndex+=f.length,N.regex.lastIndex-=u[0].length):N.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),n}nest(n,i,a={}){let l,u,f;const d=(m,p)=>{const g=this.nestingOptionsSeparator;if(m.indexOf(g)<0)return m;const v=m.split(new RegExp(`${g}[ ]*{`));let b=`{${v[1]}`;m=v[0],b=this.interpolate(b,f);const R=b.match(/'/g),N=b.match(/"/g);(((R==null?void 0:R.length)??0)%2===0&&!N||N.length%2!==0)&&(b=b.replace(/'/g,'"'));try{f=JSON.parse(b),p&&(f={...p,...f})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,O),`${m}${g}${b}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,m};for(;l=this.nestingRegexp.exec(n);){let m=[];f={...a},f=f.replace&&!ce(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;let p=!1;if(l[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(l[1])){const g=l[1].split(this.formatSeparator).map(v=>v.trim());l[1]=g.shift(),m=g,p=!0}if(u=i(d.call(this,l[1].trim(),f),f),u&&l[0]===n&&!ce(u))return u;ce(u)||(u=ny(u)),u||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${n}`),u=""),p&&(u=m.reduce((g,v)=>this.format(g,v,a.lng,{...a,interpolationkey:l[1].trim()}),u.trim())),n=n.replace(l[0],u),this.regexp.lastIndex=0}return n}}const RN=t=>{let n=t.toLowerCase().trim();const i={};if(t.indexOf("(")>-1){const a=t.split("(");n=a[0].toLowerCase().trim();const l=a[1].substring(0,a[1].length-1);n==="currency"&&l.indexOf(":")<0?i.currency||(i.currency=l.trim()):n==="relativetime"&&l.indexOf(":")<0?i.range||(i.range=l.trim()):l.split(";").forEach(f=>{if(f){const[d,...m]=f.split(":"),p=m.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();i[g]||(i[g]=p),p==="false"&&(i[g]=!1),p==="true"&&(i[g]=!0),isNaN(p)||(i[g]=parseInt(p,10))}})}return{formatName:n,formatOptions:i}},hy=t=>{const n={};return(i,a,l)=>{let u=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(u={...u,[l.interpolationkey]:void 0});const f=a+JSON.stringify(u);let d=n[f];return d||(d=t(bs(a),l),n[f]=d),d(i)}},EN=t=>(n,i,a)=>t(bs(i),a)(n);class AN{constructor(n={}){this.logger=wn.create("formatter"),this.options=n,this.init(n)}init(n,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const a=i.cacheInBuiltFormats?hy:EN;this.formats={number:a((l,u)=>{const f=new Intl.NumberFormat(l,{...u});return d=>f.format(d)}),currency:a((l,u)=>{const f=new Intl.NumberFormat(l,{...u,style:"currency"});return d=>f.format(d)}),datetime:a((l,u)=>{const f=new Intl.DateTimeFormat(l,{...u});return d=>f.format(d)}),relativetime:a((l,u)=>{const f=new Intl.RelativeTimeFormat(l,{...u});return d=>f.format(d,u.range||"day")}),list:a((l,u)=>{const f=new Intl.ListFormat(l,{...u});return d=>f.format(d)})}}add(n,i){this.formats[n.toLowerCase().trim()]=i}addCached(n,i){this.formats[n.toLowerCase().trim()]=hy(i)}format(n,i,a,l={}){const u=i.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(d=>d.indexOf(")")>-1)){const d=u.findIndex(m=>m.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,d)].join(this.formatSeparator)}return u.reduce((d,m)=>{var v;const{formatName:p,formatOptions:g}=RN(m);if(this.formats[p]){let b=d;try{const R=((v=l==null?void 0:l.formatParams)==null?void 0:v[l.interpolationkey])||{},N=R.locale||R.lng||l.locale||l.lng||a;b=this.formats[p](d,N,{...g,...l,...R})}catch(R){this.logger.warn(R)}return b}else this.logger.warn(`there was no format function for ${p}`);return d},n)}}const $N=(t,n)=>{t.pending[n]!==void 0&&(delete t.pending[n],t.pendingCount--)};class CN extends zo{constructor(n,i,a,l={}){var u,f;super(),this.backend=n,this.store=i,this.services=a,this.languageUtils=a.languageUtils,this.options=l,this.logger=wn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],(f=(u=this.backend)==null?void 0:u.init)==null||f.call(u,a,l.backend,l)}queueLoad(n,i,a,l){const u={},f={},d={},m={};return n.forEach(p=>{let g=!0;i.forEach(v=>{const b=`${p}|${v}`;!a.reload&&this.store.hasResourceBundle(p,v)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?f[b]===void 0&&(f[b]=!0):(this.state[b]=1,g=!1,f[b]===void 0&&(f[b]=!0),u[b]===void 0&&(u[b]=!0),m[v]===void 0&&(m[v]=!0)))}),g||(d[p]=!0)}),(Object.keys(u).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(u),pending:Object.keys(f),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(m)}}loaded(n,i,a){const l=n.split("|"),u=l[0],f=l[1];i&&this.emit("failedLoading",u,f,i),!i&&a&&this.store.addResourceBundle(u,f,a,void 0,void 0,{skipCopy:!0}),this.state[n]=i?-1:2,i&&a&&(this.state[n]=0);const d={};this.queue.forEach(m=>{pN(m.loaded,[u],f),$N(m,n),i&&m.errors.push(i),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(p=>{d[p]||(d[p]={});const g=m.loaded[p];g.length&&g.forEach(v=>{d[p][v]===void 0&&(d[p][v]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(m=>!m.done)}read(n,i,a,l=0,u=this.retryTimeout,f){if(!n.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:i,fcName:a,tried:l,wait:u,callback:f});return}this.readingCalls++;const d=(p,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(p&&g&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,n,i,a,l+1,u*2,f)},u);return}f(p,g)},m=this.backend[a].bind(this.backend);if(m.length===2){try{const p=m(n,i);p&&typeof p.then=="function"?p.then(g=>d(null,g)).catch(d):d(null,p)}catch(p){d(p)}return}return m(n,i,d)}prepareLoading(n,i,a={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();ce(n)&&(n=this.languageUtils.toResolveHierarchy(n)),ce(i)&&(i=[i]);const u=this.queueLoad(n,i,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(f=>{this.loadOne(f)})}load(n,i,a){this.prepareLoading(n,i,{},a)}reload(n,i,a){this.prepareLoading(n,i,{reload:!0},a)}loadOne(n,i=""){const a=n.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,(f,d)=>{f&&this.logger.warn(`${i}loading namespace ${u} for language ${l} failed`,f),!f&&d&&this.logger.log(`${i}loaded namespace ${u} for language ${l}`,d),this.loaded(n,f,d)})}saveMissing(n,i,a,l,u,f={},d=()=>{}){var m,p,g,v,b;if((p=(m=this.services)==null?void 0:m.utils)!=null&&p.hasLoadedNamespace&&!((v=(g=this.services)==null?void 0:g.utils)!=null&&v.hasLoadedNamespace(i))){this.logger.warn(`did not save key "${a}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if((b=this.backend)!=null&&b.create){const R={...f,isUpdate:u},N=this.backend.create.bind(this.backend);if(N.length<6)try{let O;N.length===5?O=N(n,i,a,l,R):O=N(n,i,a,l),O&&typeof O.then=="function"?O.then(U=>d(null,U)).catch(d):d(null,O)}catch(O){d(O)}else N(n,i,a,l,d,R)}!n||!n[0]||this.store.addResource(n[0],i,a,l)}}}const py=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let n={};if(typeof t[1]=="object"&&(n=t[1]),ce(t[1])&&(n.defaultValue=t[1]),ce(t[2])&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const i=t[3]||t[2];Object.keys(i).forEach(a=>{n[a]=i[a]})}return n},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),my=t=>{var n,i;return ce(t.ns)&&(t.ns=[t.ns]),ce(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),ce(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((i=(n=t.supportedLngs)==null?void 0:n.indexOf)==null?void 0:i.call(n,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},no=()=>{},TN=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(i=>{typeof t[i]=="function"&&(t[i]=t[i].bind(t))})};class xs extends zo{constructor(n={},i){if(super(),this.options=my(n),this.services={},this.logger=wn,this.modules={external:[]},TN(this),i&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,i),this;setTimeout(()=>{this.init(n,i)},0)}}init(n={},i){this.isInitializing=!0,typeof n=="function"&&(i=n,n={}),n.defaultNS==null&&n.ns&&(ce(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const a=py();this.options={...a,...this.options,...my(n)},this.options.interpolation={...a.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const l=p=>p?typeof p=="function"?new p:p:null;if(!this.options.isClone){this.modules.logger?wn.init(l(this.modules.logger),this.options):wn.init(null,this.options);let p;this.modules.formatter?p=this.modules.formatter:p=AN;const g=new uy(this.options);this.store=new sy(this.options.resources,this.options);const v=this.services;v.logger=wn,v.resourceStore=this.store,v.languageUtils=g,v.pluralResolver=new NN(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),p&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(v.formatter=l(p),v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new kN(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new CN(l(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(b,...R)=>{this.emit(b,...R)}),this.modules.languageDetector&&(v.languageDetector=l(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=l(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new So(this.services,this.options),this.translator.on("*",(b,...R)=>{this.emit(b,...R)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,i||(i=no),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.length>0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(p=>{this[p]=(...g)=>this.store[p](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(p=>{this[p]=(...g)=>(this.store[p](...g),this)});const d=os(),m=()=>{const p=(g,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(v),i(g,v)};if(this.languages&&!this.isInitialized)return p(null,this.t.bind(this));this.changeLanguage(this.options.lng,p)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),d}loadResources(n,i=no){var u,f;let a=i;const l=ce(n)?n:this.language;if(typeof n=="function"&&(a=n),!this.options.resources||this.options.partialBundledLanguages){if((l==null?void 0:l.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const d=[],m=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(v=>{v!=="cimode"&&d.indexOf(v)<0&&d.push(v)})};l?m(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>m(g)),(f=(u=this.options.preload)==null?void 0:u.forEach)==null||f.call(u,p=>m(p)),this.services.backendConnector.load(d,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(p)})}else a(null)}reloadResources(n,i,a){const l=os();return typeof n=="function"&&(a=n,n=void 0),typeof i=="function"&&(a=i,i=void 0),n||(n=this.languages),i||(i=this.options.ns),a||(a=no),this.services.backendConnector.reload(n,i,u=>{l.resolve(),a(u)}),l}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Fv.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1)){for(let i=0;i<this.languages.length;i++){const a=this.languages[i];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&this.languages.indexOf(n)<0&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,i){this.isLanguageChangingTo=n;const a=os();this.emit("languageChanging",n);const l=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},u=(d,m)=>{m?this.isLanguageChangingTo===n&&(l(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,a.resolve((...p)=>this.t(...p)),i&&i(d,(...p)=>this.t(...p))},f=d=>{var g,v;!n&&!d&&this.services.languageDetector&&(d=[]);const m=ce(d)?d:d&&d[0],p=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(ce(d)?[d]:d);p&&(this.language||l(p),this.translator.language||this.translator.changeLanguage(p),(v=(g=this.services.languageDetector)==null?void 0:g.cacheUserLanguage)==null||v.call(g,p)),this.loadResources(p,b=>{u(b,p)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(n),a}getFixedT(n,i,a){const l=(u,f,...d)=>{let m;typeof f!="object"?m=this.options.overloadTranslationOptionHandler([u,f].concat(d)):m={...f},m.lng=m.lng||l.lng,m.lngs=m.lngs||l.lngs,m.ns=m.ns||l.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||a||l.keyPrefix);const p=this.options.keySeparator||".";let g;return m.keyPrefix&&Array.isArray(u)?g=u.map(v=>`${m.keyPrefix}${p}${v}`):g=m.keyPrefix?`${m.keyPrefix}${p}${u}`:u,this.t(g,m)};return ce(n)?l.lng=n:l.lngs=n,l.ns=i,l.keyPrefix=a,l}t(...n){var i;return(i=this.translator)==null?void 0:i.translate(...n)}exists(...n){var i;return(i=this.translator)==null?void 0:i.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const a=i.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const f=(d,m)=>{const p=this.services.backendConnector.state[`${d}|${m}`];return p===-1||p===0||p===2};if(i.precheck){const d=i.precheck(this,f);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(a,n)&&(!l||f(u,n)))}loadNamespaces(n,i){const a=os();return this.options.ns?(ce(n)&&(n=[n]),n.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{a.resolve(),i&&i(l)}),a):(i&&i(),Promise.resolve())}loadLanguages(n,i){const a=os();ce(n)&&(n=[n]);const l=this.options.preload||[],u=n.filter(f=>l.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return u.length?(this.options.preload=l.concat(u),this.loadResources(f=>{a.resolve(),i&&i(f)}),a):(i&&i(),Promise.resolve())}dir(n){var l,u;if(n||(n=this.resolvedLanguage||(((l=this.languages)==null?void 0:l.length)>0?this.languages[0]:this.language)),!n)return"rtl";const i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=((u=this.services)==null?void 0:u.languageUtils)||new uy(py());return i.indexOf(a.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},i){return new xs(n,i)}cloneInstance(n={},i=no){const a=n.forkResourceStore;a&&delete n.forkResourceStore;const l={...this.options,...n,isClone:!0},u=new xs(l);if((n.debug!==void 0||n.prefix!==void 0)&&(u.logger=u.logger.clone(n)),["store","services","language"].forEach(d=>{u[d]=this[d]}),u.services={...this.services},u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},a){const d=Object.keys(this.store.data).reduce((m,p)=>(m[p]={...this.store.data[p]},m[p]=Object.keys(m[p]).reduce((g,v)=>(g[v]={...m[p][v]},g),m[p]),m),{});u.store=new sy(d,l),u.services.resourceStore=u.store}return u.translator=new So(u.services,l),u.translator.on("*",(d,...m)=>{u.emit(d,...m)}),u.init(l,i),u.translator.options=l,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const bt=xs.createInstance();bt.createInstance=xs.createInstance;bt.createInstance;bt.dir;bt.init;bt.loadResources;bt.reloadResources;bt.use;bt.changeLanguage;bt.getFixedT;bt.t;bt.exists;bt.setDefaultNamespace;bt.hasLoadedNamespace;bt.loadNamespaces;bt.loadLanguages;var gf={exports:{}},me={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var gy;function ON(){if(gy)return me;gy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function b(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,O={};function U(E,V,Q){this.props=E,this.context=V,this.refs=O,this.updater=Q||R}U.prototype.isReactComponent={},U.prototype.setState=function(E,V){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,V,"setState")},U.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function z(){}z.prototype=U.prototype;function L(E,V,Q){this.props=E,this.context=V,this.refs=O,this.updater=Q||R}var G=L.prototype=new z;G.constructor=L,N(G,U.prototype),G.isPureReactComponent=!0;var X=Array.isArray,F={H:null,A:null,T:null,S:null,V:null},pe=Object.prototype.hasOwnProperty;function fe(E,V,Q,I,ie,Se){return Q=Se.ref,{$$typeof:t,type:E,key:V,ref:Q!==void 0?Q:null,props:Se}}function re(E,V){return fe(E.type,V,void 0,void 0,void 0,E.props)}function ee(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function oe(E){var V={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Q){return V[Q]})}var xe=/\/+/g;function ot(E,V){return typeof E=="object"&&E!==null&&E.key!=null?oe(""+E.key):V.toString(36)}function ut(){}function it(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ut,ut):(E.status="pending",E.then(function(V){E.status==="pending"&&(E.status="fulfilled",E.value=V)},function(V){E.status==="pending"&&(E.status="rejected",E.reason=V)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function rt(E,V,Q,I,ie){var Se=typeof E;(Se==="undefined"||Se==="boolean")&&(E=null);var he=!1;if(E===null)he=!0;else switch(Se){case"bigint":case"string":case"number":he=!0;break;case"object":switch(E.$$typeof){case t:case n:he=!0;break;case g:return he=E._init,rt(he(E._payload),V,Q,I,ie)}}if(he)return ie=ie(E),he=I===""?"."+ot(E,0):I,X(ie)?(Q="",he!=null&&(Q=he.replace(xe,"$&/")+"/"),rt(ie,V,Q,"",function(Fn){return Fn})):ie!=null&&(ee(ie)&&(ie=re(ie,Q+(ie.key==null||E&&E.key===ie.key?"":(""+ie.key).replace(xe,"$&/")+"/")+he)),V.push(ie)),1;he=0;var Ut=I===""?".":I+":";if(X(E))for(var Ge=0;Ge<E.length;Ge++)I=E[Ge],Se=Ut+ot(I,Ge),he+=rt(I,V,Q,Se,ie);else if(Ge=b(E),typeof Ge=="function")for(E=Ge.call(E),Ge=0;!(I=E.next()).done;)I=I.value,Se=Ut+ot(I,Ge++),he+=rt(I,V,Q,Se,ie);else if(Se==="object"){if(typeof E.then=="function")return rt(it(E),V,Q,I,ie);throw V=String(E),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return he}function B(E,V,Q){if(E==null)return E;var I=[],ie=0;return rt(E,I,"","",function(Se){return V.call(Q,Se,ie++)}),I}function Y(E){if(E._status===-1){var V=E._result;V=V(),V.then(function(Q){(E._status===0||E._status===-1)&&(E._status=1,E._result=Q)},function(Q){(E._status===0||E._status===-1)&&(E._status=2,E._result=Q)}),E._status===-1&&(E._status=0,E._result=V)}if(E._status===1)return E._result.default;throw E._result}var ne=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function ke(){}return me.Children={map:B,forEach:function(E,V,Q){B(E,function(){V.apply(this,arguments)},Q)},count:function(E){var V=0;return B(E,function(){V++}),V},toArray:function(E){return B(E,function(V){return V})||[]},only:function(E){if(!ee(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},me.Component=U,me.Fragment=i,me.Profiler=l,me.PureComponent=L,me.StrictMode=a,me.Suspense=m,me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,me.__COMPILER_RUNTIME={__proto__:null,c:function(E){return F.H.useMemoCache(E)}},me.cache=function(E){return function(){return E.apply(null,arguments)}},me.cloneElement=function(E,V,Q){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var I=N({},E.props),ie=E.key,Se=void 0;if(V!=null)for(he in V.ref!==void 0&&(Se=void 0),V.key!==void 0&&(ie=""+V.key),V)!pe.call(V,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&V.ref===void 0||(I[he]=V[he]);var he=arguments.length-2;if(he===1)I.children=Q;else if(1<he){for(var Ut=Array(he),Ge=0;Ge<he;Ge++)Ut[Ge]=arguments[Ge+2];I.children=Ut}return fe(E.type,ie,void 0,void 0,Se,I)},me.createContext=function(E){return E={$$typeof:f,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},me.createElement=function(E,V,Q){var I,ie={},Se=null;if(V!=null)for(I in V.key!==void 0&&(Se=""+V.key),V)pe.call(V,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(ie[I]=V[I]);var he=arguments.length-2;if(he===1)ie.children=Q;else if(1<he){for(var Ut=Array(he),Ge=0;Ge<he;Ge++)Ut[Ge]=arguments[Ge+2];ie.children=Ut}if(E&&E.defaultProps)for(I in he=E.defaultProps,he)ie[I]===void 0&&(ie[I]=he[I]);return fe(E,Se,void 0,void 0,null,ie)},me.createRef=function(){return{current:null}},me.forwardRef=function(E){return{$$typeof:d,render:E}},me.isValidElement=ee,me.lazy=function(E){return{$$typeof:g,_payload:{_status:-1,_result:E},_init:Y}},me.memo=function(E,V){return{$$typeof:p,type:E,compare:V===void 0?null:V}},me.startTransition=function(E){var V=F.T,Q={};F.T=Q;try{var I=E(),ie=F.S;ie!==null&&ie(Q,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(ke,ne)}catch(Se){ne(Se)}finally{F.T=V}},me.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},me.use=function(E){return F.H.use(E)},me.useActionState=function(E,V,Q){return F.H.useActionState(E,V,Q)},me.useCallback=function(E,V){return F.H.useCallback(E,V)},me.useContext=function(E){return F.H.useContext(E)},me.useDebugValue=function(){},me.useDeferredValue=function(E,V){return F.H.useDeferredValue(E,V)},me.useEffect=function(E,V,Q){var I=F.H;if(typeof Q=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return I.useEffect(E,V)},me.useId=function(){return F.H.useId()},me.useImperativeHandle=function(E,V,Q){return F.H.useImperativeHandle(E,V,Q)},me.useInsertionEffect=function(E,V){return F.H.useInsertionEffect(E,V)},me.useLayoutEffect=function(E,V){return F.H.useLayoutEffect(E,V)},me.useMemo=function(E,V){return F.H.useMemo(E,V)},me.useOptimistic=function(E,V){return F.H.useOptimistic(E,V)},me.useReducer=function(E,V,Q){return F.H.useReducer(E,V,Q)},me.useRef=function(E){return F.H.useRef(E)},me.useState=function(E){return F.H.useState(E)},me.useSyncExternalStore=function(E,V,Q){return F.H.useSyncExternalStore(E,V,Q)},me.useTransition=function(){return F.H.useTransition()},me.version="19.1.0",me}var yy;function md(){return yy||(yy=1,gf.exports=ON()),gf.exports}var A=md();const Bf=Zv(A),jN=(t,n,i,a)=>{var u,f,d,m;const l=[i,{code:n,...a||{}}];if((f=(u=t==null?void 0:t.services)==null?void 0:u.logger)!=null&&f.forward)return t.services.logger.forward(l,"warn","react-i18next::",!0);Qi(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),(m=(d=t==null?void 0:t.services)==null?void 0:d.logger)!=null&&m.warn?t.services.logger.warn(...l):console!=null&&console.warn&&console.warn(...l)},vy={},_f=(t,n,i,a)=>{Qi(i)&&vy[i]||(Qi(i)&&(vy[i]=new Date),jN(t,n,i,a))},Xv=(t,n)=>()=>{if(t.isInitialized)n();else{const i=()=>{setTimeout(()=>{t.off("initialized",i)},0),n()};t.on("initialized",i)}},qf=(t,n,i)=>{t.loadNamespaces(n,Xv(t,i))},by=(t,n,i,a)=>{if(Qi(i)&&(i=[i]),t.options.preload&&t.options.preload.indexOf(n)>-1)return qf(t,i,a);i.forEach(l=>{t.options.ns.indexOf(l)<0&&t.options.ns.push(l)}),t.loadLanguages(n,Xv(t,a))},DN=(t,n,i={})=>!n.languages||!n.languages.length?(_f(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(t,{lng:i.lng,precheck:(a,l)=>{var u;if(((u=i.bindI18n)==null?void 0:u.indexOf("languageChanging"))>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!l(a.isLanguageChangingTo,t))return!1}}),Qi=t=>typeof t=="string",MN=t=>typeof t=="object"&&t!==null,LN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,zN={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},UN=t=>zN[t],BN=t=>t.replace(LN,UN);let Kf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:BN};const _N=(t={})=>{Kf={...Kf,...t}},qN=()=>Kf;let Pv;const KN=t=>{Pv=t},VN=()=>Pv,HN={type:"3rdParty",init(t){_N(t.options.react),KN(t)}},GN=A.createContext();class JN{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const YN=(t,n)=>{const i=A.useRef();return A.useEffect(()=>{i.current=t},[t,n]),i.current},Wv=(t,n,i,a)=>t.getFixedT(n,i,a),IN=(t,n,i,a)=>A.useCallback(Wv(t,n,i,a),[t,n,i,a]),Ct=(t,n={})=>{var X,F,pe,fe;const{i18n:i}=n,{i18n:a,defaultNS:l}=A.useContext(GN)||{},u=i||a||VN();if(u&&!u.reportNamespaces&&(u.reportNamespaces=new JN),!u){_f(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const re=(oe,xe)=>Qi(xe)?xe:MN(xe)&&Qi(xe.defaultValue)?xe.defaultValue:Array.isArray(oe)?oe[oe.length-1]:oe,ee=[re,{},!1];return ee.t=re,ee.i18n={},ee.ready=!1,ee}(X=u.options.react)!=null&&X.wait&&_f(u,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const f={...qN(),...u.options.react,...n},{useSuspense:d,keyPrefix:m}=f;let p=l||((F=u.options)==null?void 0:F.defaultNS);p=Qi(p)?[p]:p||["translation"],(fe=(pe=u.reportNamespaces).addUsedNamespaces)==null||fe.call(pe,p);const g=(u.isInitialized||u.initializedStoreOnce)&&p.every(re=>DN(re,u,f)),v=IN(u,n.lng||null,f.nsMode==="fallback"?p:p[0],m),b=()=>v,R=()=>Wv(u,n.lng||null,f.nsMode==="fallback"?p:p[0],m),[N,O]=A.useState(b);let U=p.join();n.lng&&(U=`${n.lng}${U}`);const z=YN(U),L=A.useRef(!0);A.useEffect(()=>{const{bindI18n:re,bindI18nStore:ee}=f;L.current=!0,!g&&!d&&(n.lng?by(u,n.lng,p,()=>{L.current&&O(R)}):qf(u,p,()=>{L.current&&O(R)})),g&&z&&z!==U&&L.current&&O(R);const oe=()=>{L.current&&O(R)};return re&&(u==null||u.on(re,oe)),ee&&(u==null||u.store.on(ee,oe)),()=>{L.current=!1,u&&(re==null||re.split(" ").forEach(xe=>u.off(xe,oe))),ee&&u&&ee.split(" ").forEach(xe=>u.store.off(xe,oe))}},[u,U]),A.useEffect(()=>{L.current&&g&&O(b)},[u,m,g]);const G=[N,u,g];if(G.t=N,G.i18n=u,G.ready=g,g||!g&&!d)return G;throw new Promise(re=>{n.lng?by(u,n.lng,p,()=>re()):qf(u,p,()=>re())})},ZN="ParoiCMS Site Generator",QN="<p>Describe here the data structure of your website: what types of pages it has and in which sections. In a page type, it is also possible to describe lists of sub-parts.</p>",FN="Create a website about… It will include a blog section, a list of pages, and a dedicated section about… that itself contains the following sub-sections: … The home page should contain an image carousel and a list of subparts, each containing an image and a text.",XN="Add a new text field to the page…",PN="Modify the Site Schema",WN="Create a Site Schema",ek="Generate the website",tk="Generate site with sample data (recommended)",nk="Generate an empty site",ik="Open the admin-ui",rk="Open the site",ak="Generated Schema",sk="Tree View",lk="Site Schema",ok="Node Types",uk="Labels",ck="Select language",fk="Explanations",dk="Current Activity",hk="An error occurred: {{ message }}",pk="An error occurred",mk="Start Again",gk="Step {{stepNumber}}: {{kind}}",yk="This step is in progress…",vk="This step failed.",bk="This step had no effect.",xk="No session data available",Sk="Step not found",wk="Welcome to ParoiCMS Site Generator",Nk="Close and start again",kk="Reset Schema",Rk="unknown error",Ek="Create New Site",Ak="Generating your site…",$k="The site is generated",Ck="Email:",Tk="Password:",Ok="I agree",jk="You are about to generate your website.",Dk="Cancel",Mk="Confirm",Lk="Site URL:",zk="Admin URL:",Uk="Copy all information to clipboard",Bk="<p>Welcome to the ParoiCMS Site Generator tool. This tool helps you create a new website with just a few steps.</p><p>To get started, please verify you're human by completing the CAPTCHA below.</p>",_k="Initial Schema Creation",qk="Schema Update",Kk="Site Generation",Vk={initial1:"Analyzing your request for site structure…",initial2:"Choosing from predefined fields…",updating1:"Analyzing your update request…",updating2:"Updating schema structure with changes…",generatingSite:"Building your website…",generatingContent:"Creating sample content for your site…"},Hk="Login Email",Gk="Login Password",Jk="Generated Site",Yk="Your session has expired. Please refresh the page to start a new session.",Ik="Failed to submit your prompt. Please try again.",Zk="Failed to generate the site. Please try again.",Qk='The source code of this generator is available <a href="https://gitlab.com/paroi/opensource/paroicms/-/tree/main/plugins/site-generator-plugin?ref_type=heads" target="_blank">on GitLab</a> — <a href="https://www.paroicms.org/en" target="_blank">ParoiCMS</a> — Contact me <a href="https://paroi.tech/en" target="_blank">here</a>.',Fk="Extend your session",Xk="Failed to refresh your session. Please try again.",Pk="Error connecting to server. Please check your connection and try again.",Wk="Tip: If you want to start over, open the generator in a new tab and close this one.",eR={title:ZN,startInstruction:QN,createPromptPlaceholder:FN,updatePromptPlaceholder:XN,modifySchema:PN,createSchema:WN,generateTheWebsite:ek,generateSiteWithData:tk,generateEmptySite:nk,administration:ik,viewSite:rk,generatedSchema:ak,treeView:sk,siteSchema:lk,nodeTypes:ok,labels:uk,languageSelector:ck,explanation:fk,currentActivity:dk,errorOccurred:hk,unknownErrorOccurred:pk,startAgain:mk,stepTitle:gk,stepPending:yk,stepFailed:vk,stepNoEffect:bk,noSessionData:xk,stepNotFound:Sk,welcomeTitle:wk,reset:Nk,resetSchema:kk,unknownError:Rk,createNewSite:Ek,generatingSite:Ak,siteGenerated:$k,email:Ck,password:Tk,agree:Ok,aboutToGenerateWebsite:jk,cancel:Dk,confirm:Mk,siteUrl:Lk,adminUrl:zk,copyToClipboard:Uk,introduction:Bk,initialSchema:_k,updateSchema:qk,generateSite:Kk,activity:Vk,loginEmail:Hk,loginPassword:Gk,generatedSite:Jk,sessionExpired:Yk,promptSubmissionFailed:Ik,generationFailed:Zk,footerText:Qk,extendYourSession:Fk,sessionRenewalFailed:Xk,errorConnectingToServer:Pk,newTabRestartMessage:Wk},tR="ParoiCMS - Générateur de Site",nR="<p>Décrivez ici la structure des données de votre site web : quels types de pages, dans quelles rubriques. Il est également possible de décrire des listes de sous-parties de pages.</p>",iR="Génère un site web à propos de… Il contiendra une rubrique blog, une liste de pages, une rubrique dédiée à… contenant elle-même les sous-rubriques suivantes : … La page d'accueil doit contenir un carrousel d'images, et une liste de sous-parties contenant chacune une image et un texte.",rR="Ajoute un nouveau champ texte à la page…",aR="Modifier le schéma du site",sR="Créer un schéma de site",lR="Générer le site web",oR="Générer le site avec des données d'exemple (recommandé)",uR="Générer un site vide",cR="Ouvrir l'espace d'administration du site",fR="Ouvrir le site",dR="Schéma généré",hR="Arborescence",pR="Schéma du site",mR="Types de nœuds",gR="Libellés",yR="Sélectionner la langue",vR="Explications",bR="Activité en cours",xR="Une erreur est survenue : {{ message }}",SR="Une erreur est survenue",wR="Recommencer",NR="Étape {{stepNumber}} : {{kind}}",kR="Cette étape est en cours…",RR="Cette étape a échoué.",ER="Cette étape n'a eu aucun effet.",AR="Données de session non disponibles",$R="Étape introuvable",CR="Bienvenue sur le générateur de site ParoiCMS",TR="Fermer et réinitialiser",OR="Réinitialiser le schéma",jR="erreur inconnue",DR="Créer un nouveau site",MR="Génération de votre site…",LR="Le site est généré",zR="Email :",UR="Mot de passe :",BR="J'accepte",_R="Vous êtes sur le point de générer votre site web.",qR="Annuler",KR="Confirmer",VR="URL du site :",HR="URL d'admin :",GR="Copier toutes les informations dans le presse-papier",JR="<p>Bienvenue sur l'outil de génération de site ParoiCMS. Cet outil vous aide à créer un nouveau site web en quelques étapes.</p><p>Pour commencer, veuillez vérifier que vous êtes humain en complétant le CAPTCHA ci-dessous.</p>",YR="Création du schéma initial",IR="Mise à jour du schéma",ZR="Génération du site",QR={initial1:"Analyse de votre demande pour la structure du site…",initial2:"Choix parmi les champs prédéfinis…",updating1:"Analyse de votre demande de mise à jour…",updating2:"Mise à jour de la structure du schéma…",generatingSite:"Construction de votre site web…",generatingContent:"Création de contenu exemple pour votre site…"},FR="Email de connexion",XR="Mot de passe",PR="Site généré",WR="Votre session a expiré. Veuillez rafraîchir la page pour démarrer une nouvelle session.",eE="Échec de l'envoi de votre demande. Veuillez réessayer.",tE="Échec de la génération du site. Veuillez réessayer.",nE='Le code source de ce générateur est disponible <a href="https://gitlab.com/paroi/opensource/paroicms/-/tree/main/plugins/site-generator-plugin?ref_type=heads" target="_blank">sur GitLab</a> — <a href="https://www.paroicms.org/fr" target="_blank">ParoiCMS</a> — Contactez-moi <a href="https://paroi.tech/fr" target="_blank">ici</a>.',iE="Prolonger votre session",rE="Échec du renouvellement de votre session. Veuillez réessayer.",aE="Erreur de connexion au serveur. Veuillez vérifier votre connexion et réessayer.",sE="Astuce : si vous souhaitez repartir de zéro, ouvrez le générateur dans un nouvel onglet et fermez celui-ci.",lE={title:tR,startInstruction:nR,createPromptPlaceholder:iR,updatePromptPlaceholder:rR,modifySchema:aR,createSchema:sR,generateTheWebsite:lR,generateSiteWithData:oR,generateEmptySite:uR,administration:cR,viewSite:fR,generatedSchema:dR,treeView:hR,siteSchema:pR,nodeTypes:mR,labels:gR,languageSelector:yR,explanation:vR,currentActivity:bR,errorOccurred:xR,unknownErrorOccurred:SR,startAgain:wR,stepTitle:NR,stepPending:kR,stepFailed:RR,stepNoEffect:ER,noSessionData:AR,stepNotFound:$R,welcomeTitle:CR,reset:TR,resetSchema:OR,unknownError:jR,createNewSite:DR,generatingSite:MR,siteGenerated:LR,email:zR,password:UR,agree:BR,aboutToGenerateWebsite:_R,cancel:qR,confirm:KR,siteUrl:VR,adminUrl:HR,copyToClipboard:GR,introduction:JR,initialSchema:YR,updateSchema:IR,generateSite:ZR,activity:QR,loginEmail:FR,loginPassword:XR,generatedSite:PR,sessionExpired:WR,promptSubmissionFailed:eE,generationFailed:tE,footerText:nE,extendYourSession:iE,sessionRenewalFailed:rE,errorConnectingToServer:aE,newTabRestartMessage:sE},oE=`<p>Welcome!</p>
18
- <p>ParoiCMS is a CMS for showcase websites. Its core feature is that you define the structure of your website. This tool will help you to do it.</p>
19
- <p>A session identifier will follow you on the tab of your browser, it will be deleted when you close the tab. However, your session data may be retained for debugging purposes.</p>`,uE=`<p>Bienvenue !</p>
20
- <p>ParoiCMS est un CMS pour sites vitrines. Sa fonctionnalité principale est que vous définissez la structure de votre site web. Le générateur vous aidera dans cette tâche.</p>
21
- <p>Un identifiant de session vous suivra dans l'onglet de votre navigateur, il sera supprimé lorsque vous fermerez l'onglet. Mais vos données de session pourront être conservées à des fins de débogage.</p>`,cE=`<p>Congratulations! Your website has been generated. Now you can authenticate on the admin-ui (using the <strong>local account</strong>) and play with it.</p>
22
- <p>Notice that it will be deleted in 48 hours. However, if you want to keep it, then <strong>make a backup</strong>. <em>Each backup is a zip file that contains a full Node.js project, ready to be installed and executed in a local environment.</em></p>
23
- <p>An unattractive theme has been generated. Its purpose is to demonstrate how to write templates for your data structure.</p>
24
- <p>Make sure to copy the information below, as it will be lost once you close this tab.</p>`,fE=`<p>Félicitations ! Votre site web a été généré. Vous pouvez maintenant vous authentifier sur le admin-ui (en utilisant le <strong>compte local</strong>) et l'explorer.</p>
25
- <p>Notez qu'il sera supprimé dans 48 heures. Cependant, si vous souhaitez le conserver, alors <strong>faites une sauvegarde</strong>. <em>Chaque sauvegarde est un fichier zip qui contient un projet Node.js complet, prêt à être installé et exécuté dans un environnement local.</em></p>
26
- <p>Un thème tout moche a été généré. Son but est de montrer comment écrire des templates pour votre structure de données.</p>
27
- <p>Assurez-vous de copier les informations ci-dessous, car elles seront perdues une fois que vous fermerez cet onglet.</p>`,dE={en:{translation:{...eR,introduction:oE,userManual:cE}},fr:{translation:{...lE,introduction:uE,userManual:fE}}};bt.use(HN).init({resources:dE,lng:navigator.language.split("-")[0],fallbackLng:"en",interpolation:{escapeValue:!1}});var yf={exports:{}},us={},vf={exports:{}},bf={};/**
28
- * @license React
29
- * scheduler.production.js
30
- *
31
- * Copyright (c) Meta Platforms, Inc. and affiliates.
32
- *
33
- * This source code is licensed under the MIT license found in the
34
- * LICENSE file in the root directory of this source tree.
35
- */var xy;function hE(){return xy||(xy=1,function(t){function n(B,Y){var ne=B.length;B.push(Y);e:for(;0<ne;){var ke=ne-1>>>1,E=B[ke];if(0<l(E,Y))B[ke]=Y,B[ne]=E,ne=ke;else break e}}function i(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var Y=B[0],ne=B.pop();if(ne!==Y){B[0]=ne;e:for(var ke=0,E=B.length,V=E>>>1;ke<V;){var Q=2*(ke+1)-1,I=B[Q],ie=Q+1,Se=B[ie];if(0>l(I,ne))ie<E&&0>l(Se,I)?(B[ke]=Se,B[ie]=ne,ke=ie):(B[ke]=I,B[Q]=ne,ke=Q);else if(ie<E&&0>l(Se,ne))B[ke]=Se,B[ie]=ne,ke=ie;else break e}}return Y}function l(B,Y){var ne=B.sortIndex-Y.sortIndex;return ne!==0?ne:B.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,d=f.now();t.unstable_now=function(){return f.now()-d}}var m=[],p=[],g=1,v=null,b=3,R=!1,N=!1,O=!1,U=!1,z=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function X(B){for(var Y=i(p);Y!==null;){if(Y.callback===null)a(p);else if(Y.startTime<=B)a(p),Y.sortIndex=Y.expirationTime,n(m,Y);else break;Y=i(p)}}function F(B){if(O=!1,X(B),!N)if(i(m)!==null)N=!0,pe||(pe=!0,ot());else{var Y=i(p);Y!==null&&rt(F,Y.startTime-B)}}var pe=!1,fe=-1,re=5,ee=-1;function oe(){return U?!0:!(t.unstable_now()-ee<re)}function xe(){if(U=!1,pe){var B=t.unstable_now();ee=B;var Y=!0;try{e:{N=!1,O&&(O=!1,L(fe),fe=-1),R=!0;var ne=b;try{t:{for(X(B),v=i(m);v!==null&&!(v.expirationTime>B&&oe());){var ke=v.callback;if(typeof ke=="function"){v.callback=null,b=v.priorityLevel;var E=ke(v.expirationTime<=B);if(B=t.unstable_now(),typeof E=="function"){v.callback=E,X(B),Y=!0;break t}v===i(m)&&a(m),X(B)}else a(m);v=i(m)}if(v!==null)Y=!0;else{var V=i(p);V!==null&&rt(F,V.startTime-B),Y=!1}}break e}finally{v=null,b=ne,R=!1}Y=void 0}}finally{Y?ot():pe=!1}}}var ot;if(typeof G=="function")ot=function(){G(xe)};else if(typeof MessageChannel<"u"){var ut=new MessageChannel,it=ut.port2;ut.port1.onmessage=xe,ot=function(){it.postMessage(null)}}else ot=function(){z(xe,0)};function rt(B,Y){fe=z(function(){B(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(B){switch(b){case 1:case 2:case 3:var Y=3;break;default:Y=b}var ne=b;b=Y;try{return B()}finally{b=ne}},t.unstable_requestPaint=function(){U=!0},t.unstable_runWithPriority=function(B,Y){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ne=b;b=B;try{return Y()}finally{b=ne}},t.unstable_scheduleCallback=function(B,Y,ne){var ke=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ke+ne:ke):ne=ke,B){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=ne+E,B={id:g++,callback:Y,priorityLevel:B,startTime:ne,expirationTime:E,sortIndex:-1},ne>ke?(B.sortIndex=ne,n(p,B),i(m)===null&&B===i(p)&&(O?(L(fe),fe=-1):O=!0,rt(F,ne-ke))):(B.sortIndex=E,n(m,B),N||R||(N=!0,pe||(pe=!0,ot()))),B},t.unstable_shouldYield=oe,t.unstable_wrapCallback=function(B){var Y=b;return function(){var ne=b;b=Y;try{return B.apply(this,arguments)}finally{b=ne}}}}(bf)),bf}var Sy;function pE(){return Sy||(Sy=1,vf.exports=hE()),vf.exports}var xf={exports:{}},wt={};/**
36
- * @license React
37
- * react-dom.production.js
38
- *
39
- * Copyright (c) Meta Platforms, Inc. and affiliates.
40
- *
41
- * This source code is licensed under the MIT license found in the
42
- * LICENSE file in the root directory of this source tree.
43
- */var wy;function mE(){if(wy)return wt;wy=1;var t=md();function n(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(m,p,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:v==null?null:""+v,children:m,containerInfo:p,implementation:g}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,wt.createPortal=function(m,p){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return u(m,p,null,g)},wt.flushSync=function(m){var p=f.T,g=a.p;try{if(f.T=null,a.p=2,m)return m()}finally{f.T=p,a.p=g,a.d.f()}},wt.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},wt.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},wt.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var g=p.as,v=d(g,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,R=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:R}):g==="script"&&a.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:R,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},wt.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=d(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},wt.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,v=d(g,p.crossOrigin);a.d.L(m,g,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},wt.preloadModule=function(m,p){if(typeof m=="string")if(p){var g=d(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},wt.requestFormReset=function(m){a.d.r(m)},wt.unstable_batchedUpdates=function(m,p){return m(p)},wt.useFormState=function(m,p,g){return f.H.useFormState(m,p,g)},wt.useFormStatus=function(){return f.H.useHostTransitionStatus()},wt.version="19.1.0",wt}var Ny;function gE(){if(Ny)return xf.exports;Ny=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),xf.exports=mE(),xf.exports}/**
44
- * @license React
45
- * react-dom-client.production.js
46
- *
47
- * Copyright (c) Meta Platforms, Inc. and affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */var ky;function yE(){if(ky)return us;ky=1;var t=pE(),n=md(),i=gE();function a(e){var r="https://react.dev/errors/"+e;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)r+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var r=e,s=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(s=r.return),e=r.return;while(e)}return r.tag===3?s:null}function f(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function d(e){if(u(e)!==e)throw Error(a(188))}function m(e){var r=e.alternate;if(!r){if(r=u(e),r===null)throw Error(a(188));return r!==e?null:e}for(var s=e,o=r;;){var c=s.return;if(c===null)break;var h=c.alternate;if(h===null){if(o=c.return,o!==null){s=o;continue}break}if(c.child===h.child){for(h=c.child;h;){if(h===s)return d(c),e;if(h===o)return d(c),r;h=h.sibling}throw Error(a(188))}if(s.return!==o.return)s=c,o=h;else{for(var y=!1,x=c.child;x;){if(x===s){y=!0,s=c,o=h;break}if(x===o){y=!0,o=c,s=h;break}x=x.sibling}if(!y){for(x=h.child;x;){if(x===s){y=!0,s=h,o=c;break}if(x===o){y=!0,o=h,s=c;break}x=x.sibling}if(!y)throw Error(a(189))}}if(s.alternate!==o)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?e:r}function p(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=p(e),r!==null)return r;e=e.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),L=Symbol.for("react.consumer"),G=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),fe=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function ot(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Symbol.for("react.client.reference");function it(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ut?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case U:return"Profiler";case O:return"StrictMode";case F:return"Suspense";case pe:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case G:return(e.displayName||"Context")+".Provider";case L:return(e._context.displayName||"Context")+".Consumer";case X:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fe:return r=e.displayName||null,r!==null?r:it(e.type)||"Memo";case re:r=e._payload,e=e._init;try{return it(e(r))}catch{}}return null}var rt=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ke=[],E=-1;function V(e){return{current:e}}function Q(e){0>E||(e.current=ke[E],ke[E]=null,E--)}function I(e,r){E++,ke[E]=e.current,e.current=r}var ie=V(null),Se=V(null),he=V(null),Ut=V(null);function Ge(e,r){switch(I(he,r),I(Se,e),I(ie,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?$g(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=$g(r),e=Cg(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(ie),I(ie,e)}function Fn(){Q(ie),Q(Se),Q(he)}function Po(e){e.memoizedState!==null&&I(Ut,e);var r=ie.current,s=Cg(r,e.type);r!==s&&(I(Se,e),I(ie,s))}function Ks(e){Se.current===e&&(Q(ie),Q(Se)),Ut.current===e&&(Q(Ut),ns._currentValue=ne)}var Wo=Object.prototype.hasOwnProperty,eu=t.unstable_scheduleCallback,tu=t.unstable_cancelCallback,qS=t.unstable_shouldYield,KS=t.unstable_requestPaint,mn=t.unstable_now,VS=t.unstable_getCurrentPriorityLevel,oh=t.unstable_ImmediatePriority,uh=t.unstable_UserBlockingPriority,Vs=t.unstable_NormalPriority,HS=t.unstable_LowPriority,ch=t.unstable_IdlePriority,GS=t.log,JS=t.unstable_setDisableYieldValue,ca=null,Bt=null;function Xn(e){if(typeof GS=="function"&&JS(e),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(ca,e)}catch{}}var _t=Math.clz32?Math.clz32:ZS,YS=Math.log,IS=Math.LN2;function ZS(e){return e>>>=0,e===0?32:31-(YS(e)/IS|0)|0}var Hs=256,Gs=4194304;function $i(e){var r=e&42;if(r!==0)return r;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Js(e,r,s){var o=e.pendingLanes;if(o===0)return 0;var c=0,h=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var x=o&134217727;return x!==0?(o=x&~h,o!==0?c=$i(o):(y&=x,y!==0?c=$i(y):s||(s=x&~e,s!==0&&(c=$i(s))))):(x=o&~h,x!==0?c=$i(x):y!==0?c=$i(y):s||(s=o&~e,s!==0&&(c=$i(s)))),c===0?0:r!==0&&r!==c&&(r&h)===0&&(h=c&-c,s=r&-r,h>=s||h===32&&(s&4194048)!==0)?r:c}function fa(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function QS(e,r){switch(e){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fh(){var e=Hs;return Hs<<=1,(Hs&4194048)===0&&(Hs=256),e}function dh(){var e=Gs;return Gs<<=1,(Gs&62914560)===0&&(Gs=4194304),e}function nu(e){for(var r=[],s=0;31>s;s++)r.push(e);return r}function da(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function FS(e,r,s,o,c,h){var y=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var x=e.entanglements,k=e.expirationTimes,j=e.hiddenUpdates;for(s=y&~s;0<s;){var q=31-_t(s),H=1<<q;x[q]=0,k[q]=-1;var D=j[q];if(D!==null)for(j[q]=null,q=0;q<D.length;q++){var M=D[q];M!==null&&(M.lane&=-536870913)}s&=~H}o!==0&&hh(e,o,0),h!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=h&~(y&~r))}function hh(e,r,s){e.pendingLanes|=r,e.suspendedLanes&=~r;var o=31-_t(r);e.entangledLanes|=r,e.entanglements[o]=e.entanglements[o]|1073741824|s&4194090}function ph(e,r){var s=e.entangledLanes|=r;for(e=e.entanglements;s;){var o=31-_t(s),c=1<<o;c&r|e[o]&r&&(e[o]|=r),s&=~c}}function iu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ru(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function mh(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Zg(e.type))}function XS(e,r){var s=Y.p;try{return Y.p=e,r()}finally{Y.p=s}}var Pn=Math.random().toString(36).slice(2),xt="__reactFiber$"+Pn,Tt="__reactProps$"+Pn,ar="__reactContainer$"+Pn,au="__reactEvents$"+Pn,PS="__reactListeners$"+Pn,WS="__reactHandles$"+Pn,gh="__reactResources$"+Pn,ha="__reactMarker$"+Pn;function su(e){delete e[xt],delete e[Tt],delete e[au],delete e[PS],delete e[WS]}function sr(e){var r=e[xt];if(r)return r;for(var s=e.parentNode;s;){if(r=s[ar]||s[xt]){if(s=r.alternate,r.child!==null||s!==null&&s.child!==null)for(e=Dg(e);e!==null;){if(s=e[xt])return s;e=Dg(e)}return r}e=s,s=e.parentNode}return null}function lr(e){if(e=e[xt]||e[ar]){var r=e.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return e}return null}function pa(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(a(33))}function or(e){var r=e[gh];return r||(r=e[gh]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function ct(e){e[ha]=!0}var yh=new Set,vh={};function Ci(e,r){ur(e,r),ur(e+"Capture",r)}function ur(e,r){for(vh[e]=r,e=0;e<r.length;e++)yh.add(r[e])}var e1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),bh={},xh={};function t1(e){return Wo.call(xh,e)?!0:Wo.call(bh,e)?!1:e1.test(e)?xh[e]=!0:(bh[e]=!0,!1)}function Ys(e,r,s){if(t1(r))if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(r);return;case"boolean":var o=r.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(r);return}}e.setAttribute(r,""+s)}}function Is(e,r,s){if(s===null)e.removeAttribute(r);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttribute(r,""+s)}}function Rn(e,r,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(r,s,""+o)}}var lu,Sh;function cr(e){if(lu===void 0)try{throw Error()}catch(s){var r=s.stack.trim().match(/\n( *(at )?)/);lu=r&&r[1]||"",Sh=-1<s.stack.indexOf(`
52
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
53
- `+lu+e+Sh}var ou=!1;function uu(e,r){if(!e||ou)return"";ou=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(r){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(M){var D=M}Reflect.construct(e,[],H)}else{try{H.call()}catch(M){D=M}e.call(H.prototype)}}else{try{throw Error()}catch(M){D=M}(H=e())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(M){if(M&&D&&typeof M.stack=="string")return[M.stack,D.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),y=h[0],x=h[1];if(y&&x){var k=y.split(`
54
- `),j=x.split(`
55
- `);for(c=o=0;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;for(;c<j.length&&!j[c].includes("DetermineComponentFrameRoot");)c++;if(o===k.length||c===j.length)for(o=k.length-1,c=j.length-1;1<=o&&0<=c&&k[o]!==j[c];)c--;for(;1<=o&&0<=c;o--,c--)if(k[o]!==j[c]){if(o!==1||c!==1)do if(o--,c--,0>c||k[o]!==j[c]){var q=`
56
- `+k[o].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=o&&0<=c);break}}}finally{ou=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?cr(s):""}function n1(e){switch(e.tag){case 26:case 27:case 5:return cr(e.type);case 16:return cr("Lazy");case 13:return cr("Suspense");case 19:return cr("SuspenseList");case 0:case 15:return uu(e.type,!1);case 11:return uu(e.type.render,!1);case 1:return uu(e.type,!0);case 31:return cr("Activity");default:return""}}function wh(e){try{var r="";do r+=n1(e),e=e.return;while(e);return r}catch(s){return`
57
- Error generating stack: `+s.message+`
58
- `+s.stack}}function Qt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nh(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function i1(e){var r=Nh(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),o=""+e[r];if(!e.hasOwnProperty(r)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,h=s.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return c.call(this)},set:function(y){o=""+y,h.call(this,y)}}),Object.defineProperty(e,r,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(y){o=""+y},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Zs(e){e._valueTracker||(e._valueTracker=i1(e))}function kh(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var s=r.getValue(),o="";return e&&(o=Nh(e)?e.checked?"true":"false":e.value),e=o,e!==s?(r.setValue(e),!0):!1}function Qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var r1=/[\n"\\]/g;function Ft(e){return e.replace(r1,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function cu(e,r,s,o,c,h,y,x){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),r!=null?y==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+Qt(r)):e.value!==""+Qt(r)&&(e.value=""+Qt(r)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),r!=null?fu(e,y,Qt(r)):s!=null?fu(e,y,Qt(s)):o!=null&&e.removeAttribute("value"),c==null&&h!=null&&(e.defaultChecked=!!h),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+Qt(x):e.removeAttribute("name")}function Rh(e,r,s,o,c,h,y,x){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),r!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||r!=null))return;s=s!=null?""+Qt(s):"",r=r!=null?""+Qt(r):s,x||r===e.value||(e.value=r),e.defaultValue=r}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=x?e.checked:!!o,e.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y)}function fu(e,r,s){r==="number"&&Qs(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function fr(e,r,s,o){if(e=e.options,r){r={};for(var c=0;c<s.length;c++)r["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=r.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Qt(s),r=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,o&&(e[c].defaultSelected=!0);return}r!==null||e[c].disabled||(r=e[c])}r!==null&&(r.selected=!0)}}function Eh(e,r,s){if(r!=null&&(r=""+Qt(r),r!==e.value&&(e.value=r),s==null)){e.defaultValue!==r&&(e.defaultValue=r);return}e.defaultValue=s!=null?""+Qt(s):""}function Ah(e,r,s,o){if(r==null){if(o!=null){if(s!=null)throw Error(a(92));if(rt(o)){if(1<o.length)throw Error(a(93));o=o[0]}s=o}s==null&&(s=""),r=s}s=Qt(r),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o)}function dr(e,r){if(r){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=r;return}}e.textContent=r}var a1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $h(e,r,s){var o=r.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="":o?e.setProperty(r,s):typeof s!="number"||s===0||a1.has(r)?r==="float"?e.cssFloat=s:e[r]=(""+s).trim():e[r]=s+"px"}function Ch(e,r,s){if(r!=null&&typeof r!="object")throw Error(a(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||r!=null&&r.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var c in r)o=r[c],r.hasOwnProperty(c)&&s[c]!==o&&$h(e,c,o)}else for(var h in r)r.hasOwnProperty(h)&&$h(e,h,r[h])}function du(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var s1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),l1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Fs(e){return l1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var hu=null;function pu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hr=null,pr=null;function Th(e){var r=lr(e);if(r&&(e=r.stateNode)){var s=e[Tt]||null;e:switch(e=r.stateNode,r.type){case"input":if(cu(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),r=s.name,s.type==="radio"&&r!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ft(""+r)+'"][type="radio"]'),r=0;r<s.length;r++){var o=s[r];if(o!==e&&o.form===e.form){var c=o[Tt]||null;if(!c)throw Error(a(90));cu(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(r=0;r<s.length;r++)o=s[r],o.form===e.form&&kh(o)}break e;case"textarea":Eh(e,s.value,s.defaultValue);break e;case"select":r=s.value,r!=null&&fr(e,!!s.multiple,r,!1)}}}var mu=!1;function Oh(e,r,s){if(mu)return e(r,s);mu=!0;try{var o=e(r);return o}finally{if(mu=!1,(hr!==null||pr!==null)&&(Ll(),hr&&(r=hr,e=pr,pr=hr=null,Th(r),e)))for(r=0;r<e.length;r++)Th(e[r])}}function ma(e,r){var s=e.stateNode;if(s===null)return null;var o=s[Tt]||null;if(o===null)return null;s=o[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(a(231,r,typeof s));return s}var En=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gu=!1;if(En)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){gu=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{gu=!1}var Wn=null,yu=null,Xs=null;function jh(){if(Xs)return Xs;var e,r=yu,s=r.length,o,c="value"in Wn?Wn.value:Wn.textContent,h=c.length;for(e=0;e<s&&r[e]===c[e];e++);var y=s-e;for(o=1;o<=y&&r[s-o]===c[h-o];o++);return Xs=c.slice(e,1<o?1-o:void 0)}function Ps(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Ws(){return!0}function Dh(){return!1}function Ot(e){function r(s,o,c,h,y){this._reactName=s,this._targetInst=c,this.type=o,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(s=e[x],this[x]=s?s(h):h[x]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ws:Dh,this.isPropagationStopped=Dh,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ws)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ws)},persist:function(){},isPersistent:Ws}),r}var Ti={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},el=Ot(Ti),ya=g({},Ti,{view:0,detail:0}),o1=Ot(ya),vu,bu,va,tl=g({},ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Su,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==va&&(va&&e.type==="mousemove"?(vu=e.screenX-va.screenX,bu=e.screenY-va.screenY):bu=vu=0,va=e),vu)},movementY:function(e){return"movementY"in e?e.movementY:bu}}),Mh=Ot(tl),u1=g({},tl,{dataTransfer:0}),c1=Ot(u1),f1=g({},ya,{relatedTarget:0}),xu=Ot(f1),d1=g({},Ti,{animationName:0,elapsedTime:0,pseudoElement:0}),h1=Ot(d1),p1=g({},Ti,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),m1=Ot(p1),g1=g({},Ti,{data:0}),Lh=Ot(g1),y1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},b1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x1(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=b1[e])?!!r[e]:!1}function Su(){return x1}var S1=g({},ya,{key:function(e){if(e.key){var r=y1[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Ps(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?v1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Su,charCode:function(e){return e.type==="keypress"?Ps(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ps(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),w1=Ot(S1),N1=g({},tl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zh=Ot(N1),k1=g({},ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Su}),R1=Ot(k1),E1=g({},Ti,{propertyName:0,elapsedTime:0,pseudoElement:0}),A1=Ot(E1),$1=g({},tl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),C1=Ot($1),T1=g({},Ti,{newState:0,oldState:0}),O1=Ot(T1),j1=[9,13,27,32],wu=En&&"CompositionEvent"in window,ba=null;En&&"documentMode"in document&&(ba=document.documentMode);var D1=En&&"TextEvent"in window&&!ba,Uh=En&&(!wu||ba&&8<ba&&11>=ba),Bh=" ",_h=!1;function qh(e,r){switch(e){case"keyup":return j1.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function M1(e,r){switch(e){case"compositionend":return Kh(r);case"keypress":return r.which!==32?null:(_h=!0,Bh);case"textInput":return e=r.data,e===Bh&&_h?null:e;default:return null}}function L1(e,r){if(mr)return e==="compositionend"||!wu&&qh(e,r)?(e=jh(),Xs=yu=Wn=null,mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Uh&&r.locale!=="ko"?null:r.data;default:return null}}var z1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vh(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!z1[e.type]:r==="textarea"}function Hh(e,r,s,o){hr?pr?pr.push(o):pr=[o]:hr=o,r=Kl(r,"onChange"),0<r.length&&(s=new el("onChange","change",null,s,o),e.push({event:s,listeners:r}))}var xa=null,Sa=null;function U1(e){Ng(e,0)}function nl(e){var r=pa(e);if(kh(r))return e}function Gh(e,r){if(e==="change")return r}var Jh=!1;if(En){var Nu;if(En){var ku="oninput"in document;if(!ku){var Yh=document.createElement("div");Yh.setAttribute("oninput","return;"),ku=typeof Yh.oninput=="function"}Nu=ku}else Nu=!1;Jh=Nu&&(!document.documentMode||9<document.documentMode)}function Ih(){xa&&(xa.detachEvent("onpropertychange",Zh),Sa=xa=null)}function Zh(e){if(e.propertyName==="value"&&nl(Sa)){var r=[];Hh(r,Sa,e,pu(e)),Oh(U1,r)}}function B1(e,r,s){e==="focusin"?(Ih(),xa=r,Sa=s,xa.attachEvent("onpropertychange",Zh)):e==="focusout"&&Ih()}function _1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nl(Sa)}function q1(e,r){if(e==="click")return nl(r)}function K1(e,r){if(e==="input"||e==="change")return nl(r)}function V1(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var qt=typeof Object.is=="function"?Object.is:V1;function wa(e,r){if(qt(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var s=Object.keys(e),o=Object.keys(r);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var c=s[o];if(!Wo.call(r,c)||!qt(e[c],r[c]))return!1}return!0}function Qh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fh(e,r){var s=Qh(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=r&&o>=r)return{node:s,offset:r-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Qh(s)}}function Xh(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?Xh(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function Ph(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var r=Qs(e.document);r instanceof e.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)e=r.contentWindow;else break;r=Qs(e.document)}return r}function Ru(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}var H1=En&&"documentMode"in document&&11>=document.documentMode,gr=null,Eu=null,Na=null,Au=!1;function Wh(e,r,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Au||gr==null||gr!==Qs(o)||(o=gr,"selectionStart"in o&&Ru(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Na&&wa(Na,o)||(Na=o,o=Kl(Eu,"onSelect"),0<o.length&&(r=new el("onSelect","select",null,r,s),e.push({event:r,listeners:o}),r.target=gr)))}function Oi(e,r){var s={};return s[e.toLowerCase()]=r.toLowerCase(),s["Webkit"+e]="webkit"+r,s["Moz"+e]="moz"+r,s}var yr={animationend:Oi("Animation","AnimationEnd"),animationiteration:Oi("Animation","AnimationIteration"),animationstart:Oi("Animation","AnimationStart"),transitionrun:Oi("Transition","TransitionRun"),transitionstart:Oi("Transition","TransitionStart"),transitioncancel:Oi("Transition","TransitionCancel"),transitionend:Oi("Transition","TransitionEnd")},$u={},ep={};En&&(ep=document.createElement("div").style,"AnimationEvent"in window||(delete yr.animationend.animation,delete yr.animationiteration.animation,delete yr.animationstart.animation),"TransitionEvent"in window||delete yr.transitionend.transition);function ji(e){if($u[e])return $u[e];if(!yr[e])return e;var r=yr[e],s;for(s in r)if(r.hasOwnProperty(s)&&s in ep)return $u[e]=r[s];return e}var tp=ji("animationend"),np=ji("animationiteration"),ip=ji("animationstart"),G1=ji("transitionrun"),J1=ji("transitionstart"),Y1=ji("transitioncancel"),rp=ji("transitionend"),ap=new Map,Cu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Cu.push("scrollEnd");function on(e,r){ap.set(e,r),Ci(r,[e])}var sp=new WeakMap;function Xt(e,r){if(typeof e=="object"&&e!==null){var s=sp.get(e);return s!==void 0?s:(r={value:e,source:r,stack:wh(r)},sp.set(e,r),r)}return{value:e,source:r,stack:wh(r)}}var Pt=[],vr=0,Tu=0;function il(){for(var e=vr,r=Tu=vr=0;r<e;){var s=Pt[r];Pt[r++]=null;var o=Pt[r];Pt[r++]=null;var c=Pt[r];Pt[r++]=null;var h=Pt[r];if(Pt[r++]=null,o!==null&&c!==null){var y=o.pending;y===null?c.next=c:(c.next=y.next,y.next=c),o.pending=c}h!==0&&lp(s,c,h)}}function rl(e,r,s,o){Pt[vr++]=e,Pt[vr++]=r,Pt[vr++]=s,Pt[vr++]=o,Tu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Ou(e,r,s,o){return rl(e,r,s,o),al(e)}function br(e,r){return rl(e,null,null,r),al(e)}function lp(e,r,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var c=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(c=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,c&&r!==null&&(c=31-_t(s),e=h.hiddenUpdates,o=e[c],o===null?e[c]=[r]:o.push(r),r.lane=s|536870912),h):null}function al(e){if(50<Za)throw Za=0,Uc=null,Error(a(185));for(var r=e.return;r!==null;)e=r,r=e.return;return e.tag===3?e.stateNode:null}var xr={};function I1(e,r,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(e,r,s,o){return new I1(e,r,s,o)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function An(e,r){var s=e.alternate;return s===null?(s=Kt(e.tag,r,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=r,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,r=e.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function op(e,r){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=r,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,r=s.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),e}function sl(e,r,s,o,c,h){var y=0;if(o=e,typeof e=="function")ju(e)&&(y=1);else if(typeof e=="string")y=Qw(e,s,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Kt(31,s,r,c),e.elementType=ee,e.lanes=h,e;case N:return Di(s.children,c,h,r);case O:y=8,c|=24;break;case U:return e=Kt(12,s,r,c|2),e.elementType=U,e.lanes=h,e;case F:return e=Kt(13,s,r,c),e.elementType=F,e.lanes=h,e;case pe:return e=Kt(19,s,r,c),e.elementType=pe,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z:case G:y=10;break e;case L:y=9;break e;case X:y=11;break e;case fe:y=14;break e;case re:y=16,o=null;break e}y=29,s=Error(a(130,e===null?"null":typeof e,"")),o=null}return r=Kt(y,s,r,c),r.elementType=e,r.type=o,r.lanes=h,r}function Di(e,r,s,o){return e=Kt(7,e,o,r),e.lanes=s,e}function Du(e,r,s){return e=Kt(6,e,null,r),e.lanes=s,e}function Mu(e,r,s){return r=Kt(4,e.children!==null?e.children:[],e.key,r),r.lanes=s,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}var Sr=[],wr=0,ll=null,ol=0,Wt=[],en=0,Mi=null,$n=1,Cn="";function Li(e,r){Sr[wr++]=ol,Sr[wr++]=ll,ll=e,ol=r}function up(e,r,s){Wt[en++]=$n,Wt[en++]=Cn,Wt[en++]=Mi,Mi=e;var o=$n;e=Cn;var c=32-_t(o)-1;o&=~(1<<c),s+=1;var h=32-_t(r)+c;if(30<h){var y=c-c%5;h=(o&(1<<y)-1).toString(32),o>>=y,c-=y,$n=1<<32-_t(r)+c|s<<c|o,Cn=h+e}else $n=1<<h|s<<c|o,Cn=e}function Lu(e){e.return!==null&&(Li(e,1),up(e,1,0))}function zu(e){for(;e===ll;)ll=Sr[--wr],Sr[wr]=null,ol=Sr[--wr],Sr[wr]=null;for(;e===Mi;)Mi=Wt[--en],Wt[en]=null,Cn=Wt[--en],Wt[en]=null,$n=Wt[--en],Wt[en]=null}var Rt=null,Ze=null,Ee=!1,zi=null,gn=!1,Uu=Error(a(519));function Ui(e){var r=Error(a(418,""));throw Ea(Xt(r,e)),Uu}function cp(e){var r=e.stateNode,s=e.type,o=e.memoizedProps;switch(r[xt]=e,r[Tt]=o,s){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(s=0;s<Fa.length;s++)be(Fa[s],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":be("invalid",r),Rh(r,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0),Zs(r);break;case"select":be("invalid",r);break;case"textarea":be("invalid",r),Ah(r,o.value,o.defaultValue,o.children),Zs(r)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||r.textContent===""+s||o.suppressHydrationWarning===!0||Ag(r.textContent,s)?(o.popover!=null&&(be("beforetoggle",r),be("toggle",r)),o.onScroll!=null&&be("scroll",r),o.onScrollEnd!=null&&be("scrollend",r),o.onClick!=null&&(r.onclick=Vl),r=!0):r=!1,r||Ui(e)}function fp(e){for(Rt=e.return;Rt;)switch(Rt.tag){case 5:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:Rt=Rt.return}}function ka(e){if(e!==Rt)return!1;if(!Ee)return fp(e),Ee=!0,!1;var r=e.tag,s;if((s=r!==3&&r!==27)&&((s=r===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Wc(e.type,e.memoizedProps)),s=!s),s&&Ze&&Ui(e),fp(e),r===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8)if(s=e.data,s==="/$"){if(r===0){Ze=cn(e.nextSibling);break e}r--}else s!=="$"&&s!=="$!"&&s!=="$?"||r++;e=e.nextSibling}Ze=null}}else r===27?(r=Ze,mi(e.type)?(e=rf,rf=null,Ze=e):Ze=r):Ze=Rt?cn(e.stateNode.nextSibling):null;return!0}function Ra(){Ze=Rt=null,Ee=!1}function dp(){var e=zi;return e!==null&&(Mt===null?Mt=e:Mt.push.apply(Mt,e),zi=null),e}function Ea(e){zi===null?zi=[e]:zi.push(e)}var Bu=V(null),Bi=null,Tn=null;function ei(e,r,s){I(Bu,r._currentValue),r._currentValue=s}function On(e){e._currentValue=Bu.current,Q(Bu)}function _u(e,r,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,o!==null&&(o.childLanes|=r)):o!==null&&(o.childLanes&r)!==r&&(o.childLanes|=r),e===s)break;e=e.return}}function qu(e,r,s,o){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var h=c.dependencies;if(h!==null){var y=c.child;h=h.firstContext;e:for(;h!==null;){var x=h;h=c;for(var k=0;k<r.length;k++)if(x.context===r[k]){h.lanes|=s,x=h.alternate,x!==null&&(x.lanes|=s),_u(h.return,s,e),o||(y=null);break e}h=x.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(a(341));y.lanes|=s,h=y.alternate,h!==null&&(h.lanes|=s),_u(y,s,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Aa(e,r,s,o){e=null;for(var c=r,h=!1;c!==null;){if(!h){if((c.flags&524288)!==0)h=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(a(387));if(y=y.memoizedProps,y!==null){var x=c.type;qt(c.pendingProps.value,y.value)||(e!==null?e.push(x):e=[x])}}else if(c===Ut.current){if(y=c.alternate,y===null)throw Error(a(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ns):e=[ns])}c=c.return}e!==null&&qu(r,e,s,o),r.flags|=262144}function ul(e){for(e=e.firstContext;e!==null;){if(!qt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _i(e){Bi=e,Tn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return hp(Bi,e)}function cl(e,r){return Bi===null&&_i(e),hp(e,r)}function hp(e,r){var s=r._currentValue;if(r={context:r,memoizedValue:s,next:null},Tn===null){if(e===null)throw Error(a(308));Tn=r,e.dependencies={lanes:0,firstContext:r},e.flags|=524288}else Tn=Tn.next=r;return s}var Z1=typeof AbortController<"u"?AbortController:function(){var e=[],r=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){r.aborted=!0,e.forEach(function(s){return s()})}},Q1=t.unstable_scheduleCallback,F1=t.unstable_NormalPriority,at={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ku(){return{controller:new Z1,data:new Map,refCount:0}}function $a(e){e.refCount--,e.refCount===0&&Q1(F1,function(){e.controller.abort()})}var Ca=null,Vu=0,Nr=0,kr=null;function X1(e,r){if(Ca===null){var s=Ca=[];Vu=0,Nr=Gc(),kr={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Vu++,r.then(pp,pp),r}function pp(){if(--Vu===0&&Ca!==null){kr!==null&&(kr.status="fulfilled");var e=Ca;Ca=null,Nr=0,kr=null;for(var r=0;r<e.length;r++)(0,e[r])()}}function P1(e,r){var s=[],o={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){o.status="fulfilled",o.value=r;for(var c=0;c<s.length;c++)(0,s[c])(r)},function(c){for(o.status="rejected",o.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),o}var mp=B.S;B.S=function(e,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&X1(e,r),mp!==null&&mp(e,r)};var qi=V(null);function Hu(){var e=qi.current;return e!==null?e:qe.pooledCache}function fl(e,r){r===null?I(qi,qi.current):I(qi,r.pool)}function gp(){var e=Hu();return e===null?null:{parent:at._currentValue,pool:e}}var Ta=Error(a(460)),yp=Error(a(474)),dl=Error(a(542)),Gu={then:function(){}};function vp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function hl(){}function bp(e,r,s){switch(s=e[s],s===void 0?e.push(r):s!==r&&(r.then(hl,hl),r=s),r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Sp(e),e;default:if(typeof r.status=="string")r.then(hl,hl);else{if(e=qe,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=r,e.status="pending",e.then(function(o){if(r.status==="pending"){var c=r;c.status="fulfilled",c.value=o}},function(o){if(r.status==="pending"){var c=r;c.status="rejected",c.reason=o}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Sp(e),e}throw Oa=r,Ta}}var Oa=null;function xp(){if(Oa===null)throw Error(a(459));var e=Oa;return Oa=null,e}function Sp(e){if(e===Ta||e===dl)throw Error(a(483))}var ti=!1;function Ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ni(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ii(e,r,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ce&2)!==0){var c=o.pending;return c===null?r.next=r:(r.next=c.next,c.next=r),o.pending=r,r=al(e),lp(e,null,s),r}return rl(e,o,r,s),al(e)}function ja(e,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194048)!==0)){var o=r.lanes;o&=e.pendingLanes,s|=o,r.lanes=s,ph(e,s)}}function Iu(e,r){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var c=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?c=h=y:h=h.next=y,s=s.next}while(s!==null);h===null?c=h=r:h=h.next=r}else c=h=r;s={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=r:e.next=r,s.lastBaseUpdate=r}var Zu=!1;function Da(){if(Zu){var e=kr;if(e!==null)throw e}}function Ma(e,r,s,o){Zu=!1;var c=e.updateQueue;ti=!1;var h=c.firstBaseUpdate,y=c.lastBaseUpdate,x=c.shared.pending;if(x!==null){c.shared.pending=null;var k=x,j=k.next;k.next=null,y===null?h=j:y.next=j,y=k;var q=e.alternate;q!==null&&(q=q.updateQueue,x=q.lastBaseUpdate,x!==y&&(x===null?q.firstBaseUpdate=j:x.next=j,q.lastBaseUpdate=k))}if(h!==null){var H=c.baseState;y=0,q=j=k=null,x=h;do{var D=x.lane&-536870913,M=D!==x.lane;if(M?(Ne&D)===D:(o&D)===D){D!==0&&D===Nr&&(Zu=!0),q!==null&&(q=q.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ue=e,ae=x;D=r;var Le=s;switch(ae.tag){case 1:if(ue=ae.payload,typeof ue=="function"){H=ue.call(Le,H,D);break e}H=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=ae.payload,D=typeof ue=="function"?ue.call(Le,H,D):ue,D==null)break e;H=g({},H,D);break e;case 2:ti=!0}}D=x.callback,D!==null&&(e.flags|=64,M&&(e.flags|=8192),M=c.callbacks,M===null?c.callbacks=[D]:M.push(D))}else M={lane:D,tag:x.tag,payload:x.payload,callback:x.callback,next:null},q===null?(j=q=M,k=H):q=q.next=M,y|=D;if(x=x.next,x===null){if(x=c.shared.pending,x===null)break;M=x,x=M.next,M.next=null,c.lastBaseUpdate=M,c.shared.pending=null}}while(!0);q===null&&(k=H),c.baseState=k,c.firstBaseUpdate=j,c.lastBaseUpdate=q,h===null&&(c.shared.lanes=0),fi|=y,e.lanes=y,e.memoizedState=H}}function wp(e,r){if(typeof e!="function")throw Error(a(191,e));e.call(r)}function Np(e,r){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)wp(s[e],r)}var Rr=V(null),pl=V(0);function kp(e,r){e=Bn,I(pl,e),I(Rr,r),Bn=e|r.baseLanes}function Qu(){I(pl,Bn),I(Rr,Rr.current)}function Fu(){Bn=pl.current,Q(Rr),Q(pl)}var ri=0,ge=null,De=null,We=null,ml=!1,Er=!1,Ki=!1,gl=0,La=0,Ar=null,W1=0;function Xe(){throw Error(a(321))}function Xu(e,r){if(r===null)return!1;for(var s=0;s<r.length&&s<e.length;s++)if(!qt(e[s],r[s]))return!1;return!0}function Pu(e,r,s,o,c,h){return ri=h,ge=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,B.H=e===null||e.memoizedState===null?lm:om,Ki=!1,h=s(o,c),Ki=!1,Er&&(h=Ep(r,s,o,c)),Rp(e),h}function Rp(e){B.H=wl;var r=De!==null&&De.next!==null;if(ri=0,We=De=ge=null,ml=!1,La=0,Ar=null,r)throw Error(a(300));e===null||ft||(e=e.dependencies,e!==null&&ul(e)&&(ft=!0))}function Ep(e,r,s,o){ge=e;var c=0;do{if(Er&&(Ar=null),La=0,Er=!1,25<=c)throw Error(a(301));if(c+=1,We=De=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}B.H=sw,h=r(s,o)}while(Er);return h}function ew(){var e=B.H,r=e.useState()[0];return r=typeof r.then=="function"?za(r):r,e=e.useState()[0],(De!==null?De.memoizedState:null)!==e&&(ge.flags|=1024),r}function Wu(){var e=gl!==0;return gl=0,e}function ec(e,r,s){r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~s}function tc(e){if(ml){for(e=e.memoizedState;e!==null;){var r=e.queue;r!==null&&(r.pending=null),e=e.next}ml=!1}ri=0,We=De=ge=null,Er=!1,La=gl=0,Ar=null}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?ge.memoizedState=We=e:We=We.next=e,We}function et(){if(De===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=De.next;var r=We===null?ge.memoizedState:We.next;if(r!==null)We=r,De=e;else{if(e===null)throw ge.alternate===null?Error(a(467)):Error(a(310));De=e,e={memoizedState:De.memoizedState,baseState:De.baseState,baseQueue:De.baseQueue,queue:De.queue,next:null},We===null?ge.memoizedState=We=e:We=We.next=e}return We}function nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function za(e){var r=La;return La+=1,Ar===null&&(Ar=[]),e=bp(Ar,e,r),r=ge,(We===null?r.memoizedState:We.next)===null&&(r=r.alternate,B.H=r===null||r.memoizedState===null?lm:om),e}function yl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return za(e);if(e.$$typeof===G)return St(e)}throw Error(a(438,String(e)))}function ic(e){var r=null,s=ge.updateQueue;if(s!==null&&(r=s.memoCache),r==null){var o=ge.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(r={data:o.data.map(function(c){return c.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),s===null&&(s=nc(),ge.updateQueue=s),s.memoCache=r,s=r.data[r.index],s===void 0)for(s=r.data[r.index]=Array(e),o=0;o<e;o++)s[o]=oe;return r.index++,s}function jn(e,r){return typeof r=="function"?r(e):r}function vl(e){var r=et();return rc(r,De,e)}function rc(e,r,s){var o=e.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var c=e.baseQueue,h=o.pending;if(h!==null){if(c!==null){var y=c.next;c.next=h.next,h.next=y}r.baseQueue=c=h,o.pending=null}if(h=e.baseState,c===null)e.memoizedState=h;else{r=c.next;var x=y=null,k=null,j=r,q=!1;do{var H=j.lane&-536870913;if(H!==j.lane?(Ne&H)===H:(ri&H)===H){var D=j.revertLane;if(D===0)k!==null&&(k=k.next={lane:0,revertLane:0,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null}),H===Nr&&(q=!0);else if((ri&D)===D){j=j.next,D===Nr&&(q=!0);continue}else H={lane:0,revertLane:j.revertLane,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},k===null?(x=k=H,y=h):k=k.next=H,ge.lanes|=D,fi|=D;H=j.action,Ki&&s(h,H),h=j.hasEagerState?j.eagerState:s(h,H)}else D={lane:H,revertLane:j.revertLane,action:j.action,hasEagerState:j.hasEagerState,eagerState:j.eagerState,next:null},k===null?(x=k=D,y=h):k=k.next=D,ge.lanes|=H,fi|=H;j=j.next}while(j!==null&&j!==r);if(k===null?y=h:k.next=x,!qt(h,e.memoizedState)&&(ft=!0,q&&(s=kr,s!==null)))throw s;e.memoizedState=h,e.baseState=y,e.baseQueue=k,o.lastRenderedState=h}return c===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function ac(e){var r=et(),s=r.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=e;var o=s.dispatch,c=s.pending,h=r.memoizedState;if(c!==null){s.pending=null;var y=c=c.next;do h=e(h,y.action),y=y.next;while(y!==c);qt(h,r.memoizedState)||(ft=!0),r.memoizedState=h,r.baseQueue===null&&(r.baseState=h),s.lastRenderedState=h}return[h,o]}function Ap(e,r,s){var o=ge,c=et(),h=Ee;if(h){if(s===void 0)throw Error(a(407));s=s()}else s=r();var y=!qt((De||c).memoizedState,s);y&&(c.memoizedState=s,ft=!0),c=c.queue;var x=Tp.bind(null,o,c,e);if(Ua(2048,8,x,[e]),c.getSnapshot!==r||y||We!==null&&We.memoizedState.tag&1){if(o.flags|=2048,$r(9,bl(),Cp.bind(null,o,c,s,r),null),qe===null)throw Error(a(349));h||(ri&124)!==0||$p(o,r,s)}return s}function $p(e,r,s){e.flags|=16384,e={getSnapshot:r,value:s},r=ge.updateQueue,r===null?(r=nc(),ge.updateQueue=r,r.stores=[e]):(s=r.stores,s===null?r.stores=[e]:s.push(e))}function Cp(e,r,s,o){r.value=s,r.getSnapshot=o,Op(r)&&jp(e)}function Tp(e,r,s){return s(function(){Op(r)&&jp(e)})}function Op(e){var r=e.getSnapshot;e=e.value;try{var s=r();return!qt(e,s)}catch{return!0}}function jp(e){var r=br(e,2);r!==null&&Yt(r,e,2)}function sc(e){var r=jt();if(typeof e=="function"){var s=e;if(e=s(),Ki){Xn(!0);try{s()}finally{Xn(!1)}}}return r.memoizedState=r.baseState=e,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:e},r}function Dp(e,r,s,o){return e.baseState=s,rc(e,De,typeof o=="function"?o:jn)}function tw(e,r,s,o,c){if(Sl(e))throw Error(a(485));if(e=r.action,e!==null){var h={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){h.listeners.push(y)}};B.T!==null?s(!0):h.isTransition=!1,o(h),s=r.pending,s===null?(h.next=r.pending=h,Mp(r,h)):(h.next=s.next,r.pending=s.next=h)}}function Mp(e,r){var s=r.action,o=r.payload,c=e.state;if(r.isTransition){var h=B.T,y={};B.T=y;try{var x=s(c,o),k=B.S;k!==null&&k(y,x),Lp(e,r,x)}catch(j){lc(e,r,j)}finally{B.T=h}}else try{h=s(c,o),Lp(e,r,h)}catch(j){lc(e,r,j)}}function Lp(e,r,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){zp(e,r,o)},function(o){return lc(e,r,o)}):zp(e,r,s)}function zp(e,r,s){r.status="fulfilled",r.value=s,Up(r),e.state=s,r=e.pending,r!==null&&(s=r.next,s===r?e.pending=null:(s=s.next,r.next=s,Mp(e,s)))}function lc(e,r,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do r.status="rejected",r.reason=s,Up(r),r=r.next;while(r!==o)}e.action=null}function Up(e){e=e.listeners;for(var r=0;r<e.length;r++)(0,e[r])()}function Bp(e,r){return r}function _p(e,r){if(Ee){var s=qe.formState;if(s!==null){e:{var o=ge;if(Ee){if(Ze){t:{for(var c=Ze,h=gn;c.nodeType!==8;){if(!h){c=null;break t}if(c=cn(c.nextSibling),c===null){c=null;break t}}h=c.data,c=h==="F!"||h==="F"?c:null}if(c){Ze=cn(c.nextSibling),o=c.data==="F!";break e}}Ui(o)}o=!1}o&&(r=s[0])}}return s=jt(),s.memoizedState=s.baseState=r,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bp,lastRenderedState:r},s.queue=o,s=rm.bind(null,ge,o),o.dispatch=s,o=sc(!1),h=dc.bind(null,ge,!1,o.queue),o=jt(),c={state:r,dispatch:null,action:e,pending:null},o.queue=c,s=tw.bind(null,ge,c,h,s),c.dispatch=s,o.memoizedState=e,[r,s,!1]}function qp(e){var r=et();return Kp(r,De,e)}function Kp(e,r,s){if(r=rc(e,r,Bp)[0],e=vl(jn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var o=za(r)}catch(y){throw y===Ta?dl:y}else o=r;r=et();var c=r.queue,h=c.dispatch;return s!==r.memoizedState&&(ge.flags|=2048,$r(9,bl(),nw.bind(null,c,s),null)),[o,h,e]}function nw(e,r){e.action=r}function Vp(e){var r=et(),s=De;if(s!==null)return Kp(r,s,e);et(),r=r.memoizedState,s=et();var o=s.queue.dispatch;return s.memoizedState=e,[r,o,!1]}function $r(e,r,s,o){return e={tag:e,create:s,deps:o,inst:r,next:null},r=ge.updateQueue,r===null&&(r=nc(),ge.updateQueue=r),s=r.lastEffect,s===null?r.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,r.lastEffect=e),e}function bl(){return{destroy:void 0,resource:void 0}}function Hp(){return et().memoizedState}function xl(e,r,s,o){var c=jt();o=o===void 0?null:o,ge.flags|=e,c.memoizedState=$r(1|r,bl(),s,o)}function Ua(e,r,s,o){var c=et();o=o===void 0?null:o;var h=c.memoizedState.inst;De!==null&&o!==null&&Xu(o,De.memoizedState.deps)?c.memoizedState=$r(r,h,s,o):(ge.flags|=e,c.memoizedState=$r(1|r,h,s,o))}function Gp(e,r){xl(8390656,8,e,r)}function Jp(e,r){Ua(2048,8,e,r)}function Yp(e,r){return Ua(4,2,e,r)}function Ip(e,r){return Ua(4,4,e,r)}function Zp(e,r){if(typeof r=="function"){e=e();var s=r(e);return function(){typeof s=="function"?s():r(null)}}if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Qp(e,r,s){s=s!=null?s.concat([e]):null,Ua(4,4,Zp.bind(null,r,e),s)}function oc(){}function Fp(e,r){var s=et();r=r===void 0?null:r;var o=s.memoizedState;return r!==null&&Xu(r,o[1])?o[0]:(s.memoizedState=[e,r],e)}function Xp(e,r){var s=et();r=r===void 0?null:r;var o=s.memoizedState;if(r!==null&&Xu(r,o[1]))return o[0];if(o=e(),Ki){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[o,r],o}function uc(e,r,s){return s===void 0||(ri&1073741824)!==0?e.memoizedState=r:(e.memoizedState=s,e=eg(),ge.lanes|=e,fi|=e,s)}function Pp(e,r,s,o){return qt(s,r)?s:Rr.current!==null?(e=uc(e,s,o),qt(e,r)||(ft=!0),e):(ri&42)===0?(ft=!0,e.memoizedState=s):(e=eg(),ge.lanes|=e,fi|=e,r)}function Wp(e,r,s,o,c){var h=Y.p;Y.p=h!==0&&8>h?h:8;var y=B.T,x={};B.T=x,dc(e,!1,r,s);try{var k=c(),j=B.S;if(j!==null&&j(x,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var q=P1(k,o);Ba(e,r,q,Jt(e))}else Ba(e,r,o,Jt(e))}catch(H){Ba(e,r,{then:function(){},status:"rejected",reason:H},Jt())}finally{Y.p=h,B.T=y}}function iw(){}function cc(e,r,s,o){if(e.tag!==5)throw Error(a(476));var c=em(e).queue;Wp(e,c,r,ne,s===null?iw:function(){return tm(e),s(o)})}function em(e){var r=e.memoizedState;if(r!==null)return r;r={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:ne},next:null};var s={};return r.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:s},next:null},e.memoizedState=r,e=e.alternate,e!==null&&(e.memoizedState=r),r}function tm(e){var r=em(e).next.queue;Ba(e,r,{},Jt())}function fc(){return St(ns)}function nm(){return et().memoizedState}function im(){return et().memoizedState}function rw(e){for(var r=e.return;r!==null;){switch(r.tag){case 24:case 3:var s=Jt();e=ni(s);var o=ii(r,e,s);o!==null&&(Yt(o,r,s),ja(o,r,s)),r={cache:Ku()},e.payload=r;return}r=r.return}}function aw(e,r,s){var o=Jt();s={lane:o,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null},Sl(e)?am(r,s):(s=Ou(e,r,s,o),s!==null&&(Yt(s,e,o),sm(s,r,o)))}function rm(e,r,s){var o=Jt();Ba(e,r,s,o)}function Ba(e,r,s,o){var c={lane:o,revertLane:0,action:s,hasEagerState:!1,eagerState:null,next:null};if(Sl(e))am(r,c);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=r.lastRenderedReducer,h!==null))try{var y=r.lastRenderedState,x=h(y,s);if(c.hasEagerState=!0,c.eagerState=x,qt(x,y))return rl(e,r,c,0),qe===null&&il(),!1}catch{}finally{}if(s=Ou(e,r,c,o),s!==null)return Yt(s,e,o),sm(s,r,o),!0}return!1}function dc(e,r,s,o){if(o={lane:2,revertLane:Gc(),action:o,hasEagerState:!1,eagerState:null,next:null},Sl(e)){if(r)throw Error(a(479))}else r=Ou(e,s,o,2),r!==null&&Yt(r,e,2)}function Sl(e){var r=e.alternate;return e===ge||r!==null&&r===ge}function am(e,r){Er=ml=!0;var s=e.pending;s===null?r.next=r:(r.next=s.next,s.next=r),e.pending=r}function sm(e,r,s){if((s&4194048)!==0){var o=r.lanes;o&=e.pendingLanes,s|=o,r.lanes=s,ph(e,s)}}var wl={readContext:St,use:yl,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe},lm={readContext:St,use:yl,useCallback:function(e,r){return jt().memoizedState=[e,r===void 0?null:r],e},useContext:St,useEffect:Gp,useImperativeHandle:function(e,r,s){s=s!=null?s.concat([e]):null,xl(4194308,4,Zp.bind(null,r,e),s)},useLayoutEffect:function(e,r){return xl(4194308,4,e,r)},useInsertionEffect:function(e,r){xl(4,2,e,r)},useMemo:function(e,r){var s=jt();r=r===void 0?null:r;var o=e();if(Ki){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[o,r],o},useReducer:function(e,r,s){var o=jt();if(s!==void 0){var c=s(r);if(Ki){Xn(!0);try{s(r)}finally{Xn(!1)}}}else c=r;return o.memoizedState=o.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},o.queue=e,e=e.dispatch=aw.bind(null,ge,e),[o.memoizedState,e]},useRef:function(e){var r=jt();return e={current:e},r.memoizedState=e},useState:function(e){e=sc(e);var r=e.queue,s=rm.bind(null,ge,r);return r.dispatch=s,[e.memoizedState,s]},useDebugValue:oc,useDeferredValue:function(e,r){var s=jt();return uc(s,e,r)},useTransition:function(){var e=sc(!1);return e=Wp.bind(null,ge,e.queue,!0,!1),jt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,r,s){var o=ge,c=jt();if(Ee){if(s===void 0)throw Error(a(407));s=s()}else{if(s=r(),qe===null)throw Error(a(349));(Ne&124)!==0||$p(o,r,s)}c.memoizedState=s;var h={value:s,getSnapshot:r};return c.queue=h,Gp(Tp.bind(null,o,h,e),[e]),o.flags|=2048,$r(9,bl(),Cp.bind(null,o,h,s,r),null),s},useId:function(){var e=jt(),r=qe.identifierPrefix;if(Ee){var s=Cn,o=$n;s=(o&~(1<<32-_t(o)-1)).toString(32)+s,r="«"+r+"R"+s,s=gl++,0<s&&(r+="H"+s.toString(32)),r+="»"}else s=W1++,r="«"+r+"r"+s.toString(32)+"»";return e.memoizedState=r},useHostTransitionStatus:fc,useFormState:_p,useActionState:_p,useOptimistic:function(e){var r=jt();r.memoizedState=r.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=s,r=dc.bind(null,ge,!0,s),s.dispatch=r,[e,r]},useMemoCache:ic,useCacheRefresh:function(){return jt().memoizedState=rw.bind(null,ge)}},om={readContext:St,use:yl,useCallback:Fp,useContext:St,useEffect:Jp,useImperativeHandle:Qp,useInsertionEffect:Yp,useLayoutEffect:Ip,useMemo:Xp,useReducer:vl,useRef:Hp,useState:function(){return vl(jn)},useDebugValue:oc,useDeferredValue:function(e,r){var s=et();return Pp(s,De.memoizedState,e,r)},useTransition:function(){var e=vl(jn)[0],r=et().memoizedState;return[typeof e=="boolean"?e:za(e),r]},useSyncExternalStore:Ap,useId:nm,useHostTransitionStatus:fc,useFormState:qp,useActionState:qp,useOptimistic:function(e,r){var s=et();return Dp(s,De,e,r)},useMemoCache:ic,useCacheRefresh:im},sw={readContext:St,use:yl,useCallback:Fp,useContext:St,useEffect:Jp,useImperativeHandle:Qp,useInsertionEffect:Yp,useLayoutEffect:Ip,useMemo:Xp,useReducer:ac,useRef:Hp,useState:function(){return ac(jn)},useDebugValue:oc,useDeferredValue:function(e,r){var s=et();return De===null?uc(s,e,r):Pp(s,De.memoizedState,e,r)},useTransition:function(){var e=ac(jn)[0],r=et().memoizedState;return[typeof e=="boolean"?e:za(e),r]},useSyncExternalStore:Ap,useId:nm,useHostTransitionStatus:fc,useFormState:Vp,useActionState:Vp,useOptimistic:function(e,r){var s=et();return De!==null?Dp(s,De,e,r):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:ic,useCacheRefresh:im},Cr=null,_a=0;function Nl(e){var r=_a;return _a+=1,Cr===null&&(Cr=[]),bp(Cr,e,r)}function qa(e,r){r=r.props.ref,e.ref=r!==void 0?r:null}function kl(e,r){throw r.$$typeof===v?Error(a(525)):(e=Object.prototype.toString.call(r),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)))}function um(e){var r=e._init;return r(e._payload)}function cm(e){function r(C,$){if(e){var T=C.deletions;T===null?(C.deletions=[$],C.flags|=16):T.push($)}}function s(C,$){if(!e)return null;for(;$!==null;)r(C,$),$=$.sibling;return null}function o(C){for(var $=new Map;C!==null;)C.key!==null?$.set(C.key,C):$.set(C.index,C),C=C.sibling;return $}function c(C,$){return C=An(C,$),C.index=0,C.sibling=null,C}function h(C,$,T){return C.index=T,e?(T=C.alternate,T!==null?(T=T.index,T<$?(C.flags|=67108866,$):T):(C.flags|=67108866,$)):(C.flags|=1048576,$)}function y(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function x(C,$,T,K){return $===null||$.tag!==6?($=Du(T,C.mode,K),$.return=C,$):($=c($,T),$.return=C,$)}function k(C,$,T,K){var P=T.type;return P===N?q(C,$,T.props.children,K,T.key):$!==null&&($.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===re&&um(P)===$.type)?($=c($,T.props),qa($,T),$.return=C,$):($=sl(T.type,T.key,T.props,null,C.mode,K),qa($,T),$.return=C,$)}function j(C,$,T,K){return $===null||$.tag!==4||$.stateNode.containerInfo!==T.containerInfo||$.stateNode.implementation!==T.implementation?($=Mu(T,C.mode,K),$.return=C,$):($=c($,T.children||[]),$.return=C,$)}function q(C,$,T,K,P){return $===null||$.tag!==7?($=Di(T,C.mode,K,P),$.return=C,$):($=c($,T),$.return=C,$)}function H(C,$,T){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Du(""+$,C.mode,T),$.return=C,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return T=sl($.type,$.key,$.props,null,C.mode,T),qa(T,$),T.return=C,T;case R:return $=Mu($,C.mode,T),$.return=C,$;case re:var K=$._init;return $=K($._payload),H(C,$,T)}if(rt($)||ot($))return $=Di($,C.mode,T,null),$.return=C,$;if(typeof $.then=="function")return H(C,Nl($),T);if($.$$typeof===G)return H(C,cl(C,$),T);kl(C,$)}return null}function D(C,$,T,K){var P=$!==null?$.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return P!==null?null:x(C,$,""+T,K);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case b:return T.key===P?k(C,$,T,K):null;case R:return T.key===P?j(C,$,T,K):null;case re:return P=T._init,T=P(T._payload),D(C,$,T,K)}if(rt(T)||ot(T))return P!==null?null:q(C,$,T,K,null);if(typeof T.then=="function")return D(C,$,Nl(T),K);if(T.$$typeof===G)return D(C,$,cl(C,T),K);kl(C,T)}return null}function M(C,$,T,K,P){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return C=C.get(T)||null,x($,C,""+K,P);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return C=C.get(K.key===null?T:K.key)||null,k($,C,K,P);case R:return C=C.get(K.key===null?T:K.key)||null,j($,C,K,P);case re:var ye=K._init;return K=ye(K._payload),M(C,$,T,K,P)}if(rt(K)||ot(K))return C=C.get(T)||null,q($,C,K,P,null);if(typeof K.then=="function")return M(C,$,T,Nl(K),P);if(K.$$typeof===G)return M(C,$,T,cl($,K),P);kl($,K)}return null}function ue(C,$,T,K){for(var P=null,ye=null,te=$,se=$=0,ht=null;te!==null&&se<T.length;se++){te.index>se?(ht=te,te=null):ht=te.sibling;var Re=D(C,te,T[se],K);if(Re===null){te===null&&(te=ht);break}e&&te&&Re.alternate===null&&r(C,te),$=h(Re,$,se),ye===null?P=Re:ye.sibling=Re,ye=Re,te=ht}if(se===T.length)return s(C,te),Ee&&Li(C,se),P;if(te===null){for(;se<T.length;se++)te=H(C,T[se],K),te!==null&&($=h(te,$,se),ye===null?P=te:ye.sibling=te,ye=te);return Ee&&Li(C,se),P}for(te=o(te);se<T.length;se++)ht=M(te,C,se,T[se],K),ht!==null&&(e&&ht.alternate!==null&&te.delete(ht.key===null?se:ht.key),$=h(ht,$,se),ye===null?P=ht:ye.sibling=ht,ye=ht);return e&&te.forEach(function(xi){return r(C,xi)}),Ee&&Li(C,se),P}function ae(C,$,T,K){if(T==null)throw Error(a(151));for(var P=null,ye=null,te=$,se=$=0,ht=null,Re=T.next();te!==null&&!Re.done;se++,Re=T.next()){te.index>se?(ht=te,te=null):ht=te.sibling;var xi=D(C,te,Re.value,K);if(xi===null){te===null&&(te=ht);break}e&&te&&xi.alternate===null&&r(C,te),$=h(xi,$,se),ye===null?P=xi:ye.sibling=xi,ye=xi,te=ht}if(Re.done)return s(C,te),Ee&&Li(C,se),P;if(te===null){for(;!Re.done;se++,Re=T.next())Re=H(C,Re.value,K),Re!==null&&($=h(Re,$,se),ye===null?P=Re:ye.sibling=Re,ye=Re);return Ee&&Li(C,se),P}for(te=o(te);!Re.done;se++,Re=T.next())Re=M(te,C,se,Re.value,K),Re!==null&&(e&&Re.alternate!==null&&te.delete(Re.key===null?se:Re.key),$=h(Re,$,se),ye===null?P=Re:ye.sibling=Re,ye=Re);return e&&te.forEach(function(lN){return r(C,lN)}),Ee&&Li(C,se),P}function Le(C,$,T,K){if(typeof T=="object"&&T!==null&&T.type===N&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case b:e:{for(var P=T.key;$!==null;){if($.key===P){if(P=T.type,P===N){if($.tag===7){s(C,$.sibling),K=c($,T.props.children),K.return=C,C=K;break e}}else if($.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===re&&um(P)===$.type){s(C,$.sibling),K=c($,T.props),qa(K,T),K.return=C,C=K;break e}s(C,$);break}else r(C,$);$=$.sibling}T.type===N?(K=Di(T.props.children,C.mode,K,T.key),K.return=C,C=K):(K=sl(T.type,T.key,T.props,null,C.mode,K),qa(K,T),K.return=C,C=K)}return y(C);case R:e:{for(P=T.key;$!==null;){if($.key===P)if($.tag===4&&$.stateNode.containerInfo===T.containerInfo&&$.stateNode.implementation===T.implementation){s(C,$.sibling),K=c($,T.children||[]),K.return=C,C=K;break e}else{s(C,$);break}else r(C,$);$=$.sibling}K=Mu(T,C.mode,K),K.return=C,C=K}return y(C);case re:return P=T._init,T=P(T._payload),Le(C,$,T,K)}if(rt(T))return ue(C,$,T,K);if(ot(T)){if(P=ot(T),typeof P!="function")throw Error(a(150));return T=P.call(T),ae(C,$,T,K)}if(typeof T.then=="function")return Le(C,$,Nl(T),K);if(T.$$typeof===G)return Le(C,$,cl(C,T),K);kl(C,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,$!==null&&$.tag===6?(s(C,$.sibling),K=c($,T),K.return=C,C=K):(s(C,$),K=Du(T,C.mode,K),K.return=C,C=K),y(C)):s(C,$)}return function(C,$,T,K){try{_a=0;var P=Le(C,$,T,K);return Cr=null,P}catch(te){if(te===Ta||te===dl)throw te;var ye=Kt(29,te,null,C.mode);return ye.lanes=K,ye.return=C,ye}finally{}}}var Tr=cm(!0),fm=cm(!1),tn=V(null),yn=null;function ai(e){var r=e.alternate;I(st,st.current&1),I(tn,e),yn===null&&(r===null||Rr.current!==null||r.memoizedState!==null)&&(yn=e)}function dm(e){if(e.tag===22){if(I(st,st.current),I(tn,e),yn===null){var r=e.alternate;r!==null&&r.memoizedState!==null&&(yn=e)}}else si()}function si(){I(st,st.current),I(tn,tn.current)}function Dn(e){Q(tn),yn===e&&(yn=null),Q(st)}var st=V(0);function Rl(e){for(var r=e;r!==null;){if(r.tag===13){var s=r.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||nf(s)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function hc(e,r,s,o){r=e.memoizedState,s=s(o,r),s=s==null?r:g({},r,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var pc={enqueueSetState:function(e,r,s){e=e._reactInternals;var o=Jt(),c=ni(o);c.payload=r,s!=null&&(c.callback=s),r=ii(e,c,o),r!==null&&(Yt(r,e,o),ja(r,e,o))},enqueueReplaceState:function(e,r,s){e=e._reactInternals;var o=Jt(),c=ni(o);c.tag=1,c.payload=r,s!=null&&(c.callback=s),r=ii(e,c,o),r!==null&&(Yt(r,e,o),ja(r,e,o))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var s=Jt(),o=ni(s);o.tag=2,r!=null&&(o.callback=r),r=ii(e,o,s),r!==null&&(Yt(r,e,s),ja(r,e,s))}};function hm(e,r,s,o,c,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,y):r.prototype&&r.prototype.isPureReactComponent?!wa(s,o)||!wa(c,h):!0}function pm(e,r,s,o){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(s,o),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(s,o),r.state!==e&&pc.enqueueReplaceState(r,r.state,null)}function Vi(e,r){var s=r;if("ref"in r){s={};for(var o in r)o!=="ref"&&(s[o]=r[o])}if(e=e.defaultProps){s===r&&(s=g({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}var El=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function mm(e){El(e)}function gm(e){console.error(e)}function ym(e){El(e)}function Al(e,r){try{var s=e.onUncaughtError;s(r.value,{componentStack:r.stack})}catch(o){setTimeout(function(){throw o})}}function vm(e,r,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function mc(e,r,s){return s=ni(s),s.tag=3,s.payload={element:null},s.callback=function(){Al(e,r)},s}function bm(e){return e=ni(e),e.tag=3,e}function xm(e,r,s,o){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var h=o.value;e.payload=function(){return c(h)},e.callback=function(){vm(r,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){vm(r,s,o),typeof c!="function"&&(di===null?di=new Set([this]):di.add(this));var x=o.stack;this.componentDidCatch(o.value,{componentStack:x!==null?x:""})})}function lw(e,r,s,o,c){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(r=s.alternate,r!==null&&Aa(r,s,c,!0),s=tn.current,s!==null){switch(s.tag){case 13:return yn===null?_c():s.alternate===null&&Qe===0&&(Qe=3),s.flags&=-257,s.flags|=65536,s.lanes=c,o===Gu?s.flags|=16384:(r=s.updateQueue,r===null?s.updateQueue=new Set([o]):r.add(o),Kc(e,o,c)),!1;case 22:return s.flags|=65536,o===Gu?s.flags|=16384:(r=s.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=r):(s=r.retryQueue,s===null?r.retryQueue=new Set([o]):s.add(o)),Kc(e,o,c)),!1}throw Error(a(435,s.tag))}return Kc(e,o,c),_c(),!1}if(Ee)return r=tn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=c,o!==Uu&&(e=Error(a(422),{cause:o}),Ea(Xt(e,s)))):(o!==Uu&&(r=Error(a(423),{cause:o}),Ea(Xt(r,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,o=Xt(o,s),c=mc(e.stateNode,o,c),Iu(e,c),Qe!==4&&(Qe=2)),!1;var h=Error(a(520),{cause:o});if(h=Xt(h,s),Ia===null?Ia=[h]:Ia.push(h),Qe!==4&&(Qe=2),r===null)return!0;o=Xt(o,s),s=r;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=mc(s.stateNode,o,e),Iu(s,e),!1;case 1:if(r=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(di===null||!di.has(h))))return s.flags|=65536,c&=-c,s.lanes|=c,c=bm(c),xm(c,e,s,o),Iu(s,c),!1}s=s.return}while(s!==null);return!1}var Sm=Error(a(461)),ft=!1;function gt(e,r,s,o){r.child=e===null?fm(r,null,s,o):Tr(r,e.child,s,o)}function wm(e,r,s,o,c){s=s.render;var h=r.ref;if("ref"in o){var y={};for(var x in o)x!=="ref"&&(y[x]=o[x])}else y=o;return _i(r),o=Pu(e,r,s,y,h,c),x=Wu(),e!==null&&!ft?(ec(e,r,c),Mn(e,r,c)):(Ee&&x&&Lu(r),r.flags|=1,gt(e,r,o,c),r.child)}function Nm(e,r,s,o,c){if(e===null){var h=s.type;return typeof h=="function"&&!ju(h)&&h.defaultProps===void 0&&s.compare===null?(r.tag=15,r.type=h,km(e,r,h,o,c)):(e=sl(s.type,null,o,r,r.mode,c),e.ref=r.ref,e.return=r,r.child=e)}if(h=e.child,!Nc(e,c)){var y=h.memoizedProps;if(s=s.compare,s=s!==null?s:wa,s(y,o)&&e.ref===r.ref)return Mn(e,r,c)}return r.flags|=1,e=An(h,o),e.ref=r.ref,e.return=r,r.child=e}function km(e,r,s,o,c){if(e!==null){var h=e.memoizedProps;if(wa(h,o)&&e.ref===r.ref)if(ft=!1,r.pendingProps=o=h,Nc(e,c))(e.flags&131072)!==0&&(ft=!0);else return r.lanes=e.lanes,Mn(e,r,c)}return gc(e,r,s,o,c)}function Rm(e,r,s){var o=r.pendingProps,c=o.children,h=e!==null?e.memoizedState:null;if(o.mode==="hidden"){if((r.flags&128)!==0){if(o=h!==null?h.baseLanes|s:s,e!==null){for(c=r.child=e.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;r.childLanes=h&~o}else r.childLanes=0,r.child=null;return Em(e,r,o,s)}if((s&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},e!==null&&fl(r,h!==null?h.cachePool:null),h!==null?kp(r,h):Qu(),dm(r);else return r.lanes=r.childLanes=536870912,Em(e,r,h!==null?h.baseLanes|s:s,s)}else h!==null?(fl(r,h.cachePool),kp(r,h),si(),r.memoizedState=null):(e!==null&&fl(r,null),Qu(),si());return gt(e,r,c,s),r.child}function Em(e,r,s,o){var c=Hu();return c=c===null?null:{parent:at._currentValue,pool:c},r.memoizedState={baseLanes:s,cachePool:c},e!==null&&fl(r,null),Qu(),dm(r),e!==null&&Aa(e,r,o,!0),null}function $l(e,r){var s=r.ref;if(s===null)e!==null&&e.ref!==null&&(r.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(e===null||e.ref!==s)&&(r.flags|=4194816)}}function gc(e,r,s,o,c){return _i(r),s=Pu(e,r,s,o,void 0,c),o=Wu(),e!==null&&!ft?(ec(e,r,c),Mn(e,r,c)):(Ee&&o&&Lu(r),r.flags|=1,gt(e,r,s,c),r.child)}function Am(e,r,s,o,c,h){return _i(r),r.updateQueue=null,s=Ep(r,o,s,c),Rp(e),o=Wu(),e!==null&&!ft?(ec(e,r,h),Mn(e,r,h)):(Ee&&o&&Lu(r),r.flags|=1,gt(e,r,s,h),r.child)}function $m(e,r,s,o,c){if(_i(r),r.stateNode===null){var h=xr,y=s.contextType;typeof y=="object"&&y!==null&&(h=St(y)),h=new s(o,h),r.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=pc,r.stateNode=h,h._reactInternals=r,h=r.stateNode,h.props=o,h.state=r.memoizedState,h.refs={},Ju(r),y=s.contextType,h.context=typeof y=="object"&&y!==null?St(y):xr,h.state=r.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(hc(r,s,y,o),h.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(y=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),y!==h.state&&pc.enqueueReplaceState(h,h.state,null),Ma(r,o,h,c),Da(),h.state=r.memoizedState),typeof h.componentDidMount=="function"&&(r.flags|=4194308),o=!0}else if(e===null){h=r.stateNode;var x=r.memoizedProps,k=Vi(s,x);h.props=k;var j=h.context,q=s.contextType;y=xr,typeof q=="object"&&q!==null&&(y=St(q));var H=s.getDerivedStateFromProps;q=typeof H=="function"||typeof h.getSnapshotBeforeUpdate=="function",x=r.pendingProps!==x,q||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x||j!==y)&&pm(r,h,o,y),ti=!1;var D=r.memoizedState;h.state=D,Ma(r,o,h,c),Da(),j=r.memoizedState,x||D!==j||ti?(typeof H=="function"&&(hc(r,s,H,o),j=r.memoizedState),(k=ti||hm(r,s,k,o,D,j,y))?(q||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(r.flags|=4194308)):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=o,r.memoizedState=j),h.props=o,h.state=j,h.context=y,o=k):(typeof h.componentDidMount=="function"&&(r.flags|=4194308),o=!1)}else{h=r.stateNode,Yu(e,r),y=r.memoizedProps,q=Vi(s,y),h.props=q,H=r.pendingProps,D=h.context,j=s.contextType,k=xr,typeof j=="object"&&j!==null&&(k=St(j)),x=s.getDerivedStateFromProps,(j=typeof x=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(y!==H||D!==k)&&pm(r,h,o,k),ti=!1,D=r.memoizedState,h.state=D,Ma(r,o,h,c),Da();var M=r.memoizedState;y!==H||D!==M||ti||e!==null&&e.dependencies!==null&&ul(e.dependencies)?(typeof x=="function"&&(hc(r,s,x,o),M=r.memoizedState),(q=ti||hm(r,s,q,o,D,M,k)||e!==null&&e.dependencies!==null&&ul(e.dependencies))?(j||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,M,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,M,k)),typeof h.componentDidUpdate=="function"&&(r.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&D===e.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&D===e.memoizedState||(r.flags|=1024),r.memoizedProps=o,r.memoizedState=M),h.props=o,h.state=M,h.context=k,o=q):(typeof h.componentDidUpdate!="function"||y===e.memoizedProps&&D===e.memoizedState||(r.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&D===e.memoizedState||(r.flags|=1024),o=!1)}return h=o,$l(e,r),o=(r.flags&128)!==0,h||o?(h=r.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),r.flags|=1,e!==null&&o?(r.child=Tr(r,e.child,null,c),r.child=Tr(r,null,s,c)):gt(e,r,s,c),r.memoizedState=h.state,e=r.child):e=Mn(e,r,c),e}function Cm(e,r,s,o){return Ra(),r.flags|=256,gt(e,r,s,o),r.child}var yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:gp()}}function bc(e,r,s){return e=e!==null?e.childLanes&~s:0,r&&(e|=nn),e}function Tm(e,r,s){var o=r.pendingProps,c=!1,h=(r.flags&128)!==0,y;if((y=h)||(y=e!==null&&e.memoizedState===null?!1:(st.current&2)!==0),y&&(c=!0,r.flags&=-129),y=(r.flags&32)!==0,r.flags&=-33,e===null){if(Ee){if(c?ai(r):si(),Ee){var x=Ze,k;if(k=x){e:{for(k=x,x=gn;k.nodeType!==8;){if(!x){x=null;break e}if(k=cn(k.nextSibling),k===null){x=null;break e}}x=k}x!==null?(r.memoizedState={dehydrated:x,treeContext:Mi!==null?{id:$n,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},k=Kt(18,null,null,0),k.stateNode=x,k.return=r,r.child=k,Rt=r,Ze=null,k=!0):k=!1}k||Ui(r)}if(x=r.memoizedState,x!==null&&(x=x.dehydrated,x!==null))return nf(x)?r.lanes=32:r.lanes=536870912,null;Dn(r)}return x=o.children,o=o.fallback,c?(si(),c=r.mode,x=Cl({mode:"hidden",children:x},c),o=Di(o,c,s,null),x.return=r,o.return=r,x.sibling=o,r.child=x,c=r.child,c.memoizedState=vc(s),c.childLanes=bc(e,y,s),r.memoizedState=yc,o):(ai(r),xc(r,x))}if(k=e.memoizedState,k!==null&&(x=k.dehydrated,x!==null)){if(h)r.flags&256?(ai(r),r.flags&=-257,r=Sc(e,r,s)):r.memoizedState!==null?(si(),r.child=e.child,r.flags|=128,r=null):(si(),c=o.fallback,x=r.mode,o=Cl({mode:"visible",children:o.children},x),c=Di(c,x,s,null),c.flags|=2,o.return=r,c.return=r,o.sibling=c,r.child=o,Tr(r,e.child,null,s),o=r.child,o.memoizedState=vc(s),o.childLanes=bc(e,y,s),r.memoizedState=yc,r=c);else if(ai(r),nf(x)){if(y=x.nextSibling&&x.nextSibling.dataset,y)var j=y.dgst;y=j,o=Error(a(419)),o.stack="",o.digest=y,Ea({value:o,source:null,stack:null}),r=Sc(e,r,s)}else if(ft||Aa(e,r,s,!1),y=(s&e.childLanes)!==0,ft||y){if(y=qe,y!==null&&(o=s&-s,o=(o&42)!==0?1:iu(o),o=(o&(y.suspendedLanes|s))!==0?0:o,o!==0&&o!==k.retryLane))throw k.retryLane=o,br(e,o),Yt(y,e,o),Sm;x.data==="$?"||_c(),r=Sc(e,r,s)}else x.data==="$?"?(r.flags|=192,r.child=e.child,r=null):(e=k.treeContext,Ze=cn(x.nextSibling),Rt=r,Ee=!0,zi=null,gn=!1,e!==null&&(Wt[en++]=$n,Wt[en++]=Cn,Wt[en++]=Mi,$n=e.id,Cn=e.overflow,Mi=r),r=xc(r,o.children),r.flags|=4096);return r}return c?(si(),c=o.fallback,x=r.mode,k=e.child,j=k.sibling,o=An(k,{mode:"hidden",children:o.children}),o.subtreeFlags=k.subtreeFlags&65011712,j!==null?c=An(j,c):(c=Di(c,x,s,null),c.flags|=2),c.return=r,o.return=r,o.sibling=c,r.child=o,o=c,c=r.child,x=e.child.memoizedState,x===null?x=vc(s):(k=x.cachePool,k!==null?(j=at._currentValue,k=k.parent!==j?{parent:j,pool:j}:k):k=gp(),x={baseLanes:x.baseLanes|s,cachePool:k}),c.memoizedState=x,c.childLanes=bc(e,y,s),r.memoizedState=yc,o):(ai(r),s=e.child,e=s.sibling,s=An(s,{mode:"visible",children:o.children}),s.return=r,s.sibling=null,e!==null&&(y=r.deletions,y===null?(r.deletions=[e],r.flags|=16):y.push(e)),r.child=s,r.memoizedState=null,s)}function xc(e,r){return r=Cl({mode:"visible",children:r},e.mode),r.return=e,e.child=r}function Cl(e,r){return e=Kt(22,e,null,r),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Sc(e,r,s){return Tr(r,e.child,null,s),e=xc(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Om(e,r,s){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r),_u(e.return,r,s)}function wc(e,r,s,o,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:c}:(h.isBackwards=r,h.rendering=null,h.renderingStartTime=0,h.last=o,h.tail=s,h.tailMode=c)}function jm(e,r,s){var o=r.pendingProps,c=o.revealOrder,h=o.tail;if(gt(e,r,o.children,s),o=st.current,(o&2)!==0)o=o&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Om(e,s,r);else if(e.tag===19)Om(e,s,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}switch(I(st,o),c){case"forwards":for(s=r.child,c=null;s!==null;)e=s.alternate,e!==null&&Rl(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=r.child,r.child=null):(c=s.sibling,s.sibling=null),wc(r,!1,c,s,h);break;case"backwards":for(s=null,c=r.child,r.child=null;c!==null;){if(e=c.alternate,e!==null&&Rl(e)===null){r.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}wc(r,!0,s,null,h);break;case"together":wc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Mn(e,r,s){if(e!==null&&(r.dependencies=e.dependencies),fi|=r.lanes,(s&r.childLanes)===0)if(e!==null){if(Aa(e,r,s,!1),(s&r.childLanes)===0)return null}else return null;if(e!==null&&r.child!==e.child)throw Error(a(153));if(r.child!==null){for(e=r.child,s=An(e,e.pendingProps),r.child=s,s.return=r;e.sibling!==null;)e=e.sibling,s=s.sibling=An(e,e.pendingProps),s.return=r;s.sibling=null}return r.child}function Nc(e,r){return(e.lanes&r)!==0?!0:(e=e.dependencies,!!(e!==null&&ul(e)))}function ow(e,r,s){switch(r.tag){case 3:Ge(r,r.stateNode.containerInfo),ei(r,at,e.memoizedState.cache),Ra();break;case 27:case 5:Po(r);break;case 4:Ge(r,r.stateNode.containerInfo);break;case 10:ei(r,r.type,r.memoizedProps.value);break;case 13:var o=r.memoizedState;if(o!==null)return o.dehydrated!==null?(ai(r),r.flags|=128,null):(s&r.child.childLanes)!==0?Tm(e,r,s):(ai(r),e=Mn(e,r,s),e!==null?e.sibling:null);ai(r);break;case 19:var c=(e.flags&128)!==0;if(o=(s&r.childLanes)!==0,o||(Aa(e,r,s,!1),o=(s&r.childLanes)!==0),c){if(o)return jm(e,r,s);r.flags|=128}if(c=r.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),I(st,st.current),o)break;return null;case 22:case 23:return r.lanes=0,Rm(e,r,s);case 24:ei(r,at,e.memoizedState.cache)}return Mn(e,r,s)}function Dm(e,r,s){if(e!==null)if(e.memoizedProps!==r.pendingProps)ft=!0;else{if(!Nc(e,s)&&(r.flags&128)===0)return ft=!1,ow(e,r,s);ft=(e.flags&131072)!==0}else ft=!1,Ee&&(r.flags&1048576)!==0&&up(r,ol,r.index);switch(r.lanes=0,r.tag){case 16:e:{e=r.pendingProps;var o=r.elementType,c=o._init;if(o=c(o._payload),r.type=o,typeof o=="function")ju(o)?(e=Vi(o,e),r.tag=1,r=$m(null,r,o,e,s)):(r.tag=0,r=gc(null,r,o,e,s));else{if(o!=null){if(c=o.$$typeof,c===X){r.tag=11,r=wm(null,r,o,e,s);break e}else if(c===fe){r.tag=14,r=Nm(null,r,o,e,s);break e}}throw r=it(o)||o,Error(a(306,r,""))}}return r;case 0:return gc(e,r,r.type,r.pendingProps,s);case 1:return o=r.type,c=Vi(o,r.pendingProps),$m(e,r,o,c,s);case 3:e:{if(Ge(r,r.stateNode.containerInfo),e===null)throw Error(a(387));o=r.pendingProps;var h=r.memoizedState;c=h.element,Yu(e,r),Ma(r,o,null,s);var y=r.memoizedState;if(o=y.cache,ei(r,at,o),o!==h.cache&&qu(r,[at],s,!0),Da(),o=y.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:y.cache},r.updateQueue.baseState=h,r.memoizedState=h,r.flags&256){r=Cm(e,r,o,s);break e}else if(o!==c){c=Xt(Error(a(424)),r),Ea(c),r=Cm(e,r,o,s);break e}else{switch(e=r.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=cn(e.firstChild),Rt=r,Ee=!0,zi=null,gn=!0,s=fm(r,null,o,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ra(),o===c){r=Mn(e,r,s);break e}gt(e,r,o,s)}r=r.child}return r;case 26:return $l(e,r),e===null?(s=Ug(r.type,null,r.pendingProps,null))?r.memoizedState=s:Ee||(s=r.type,e=r.pendingProps,o=Hl(he.current).createElement(s),o[xt]=r,o[Tt]=e,vt(o,s,e),ct(o),r.stateNode=o):r.memoizedState=Ug(r.type,e.memoizedProps,r.pendingProps,e.memoizedState),null;case 27:return Po(r),e===null&&Ee&&(o=r.stateNode=Mg(r.type,r.pendingProps,he.current),Rt=r,gn=!0,c=Ze,mi(r.type)?(rf=c,Ze=cn(o.firstChild)):Ze=c),gt(e,r,r.pendingProps.children,s),$l(e,r),e===null&&(r.flags|=4194304),r.child;case 5:return e===null&&Ee&&((c=o=Ze)&&(o=zw(o,r.type,r.pendingProps,gn),o!==null?(r.stateNode=o,Rt=r,Ze=cn(o.firstChild),gn=!1,c=!0):c=!1),c||Ui(r)),Po(r),c=r.type,h=r.pendingProps,y=e!==null?e.memoizedProps:null,o=h.children,Wc(c,h)?o=null:y!==null&&Wc(c,y)&&(r.flags|=32),r.memoizedState!==null&&(c=Pu(e,r,ew,null,null,s),ns._currentValue=c),$l(e,r),gt(e,r,o,s),r.child;case 6:return e===null&&Ee&&((e=s=Ze)&&(s=Uw(s,r.pendingProps,gn),s!==null?(r.stateNode=s,Rt=r,Ze=null,e=!0):e=!1),e||Ui(r)),null;case 13:return Tm(e,r,s);case 4:return Ge(r,r.stateNode.containerInfo),o=r.pendingProps,e===null?r.child=Tr(r,null,o,s):gt(e,r,o,s),r.child;case 11:return wm(e,r,r.type,r.pendingProps,s);case 7:return gt(e,r,r.pendingProps,s),r.child;case 8:return gt(e,r,r.pendingProps.children,s),r.child;case 12:return gt(e,r,r.pendingProps.children,s),r.child;case 10:return o=r.pendingProps,ei(r,r.type,o.value),gt(e,r,o.children,s),r.child;case 9:return c=r.type._context,o=r.pendingProps.children,_i(r),c=St(c),o=o(c),r.flags|=1,gt(e,r,o,s),r.child;case 14:return Nm(e,r,r.type,r.pendingProps,s);case 15:return km(e,r,r.type,r.pendingProps,s);case 19:return jm(e,r,s);case 31:return o=r.pendingProps,s=r.mode,o={mode:o.mode,children:o.children},e===null?(s=Cl(o,s),s.ref=r.ref,r.child=s,s.return=r,r=s):(s=An(e.child,o),s.ref=r.ref,r.child=s,s.return=r,r=s),r;case 22:return Rm(e,r,s);case 24:return _i(r),o=St(at),e===null?(c=Hu(),c===null&&(c=qe,h=Ku(),c.pooledCache=h,h.refCount++,h!==null&&(c.pooledCacheLanes|=s),c=h),r.memoizedState={parent:o,cache:c},Ju(r),ei(r,at,c)):((e.lanes&s)!==0&&(Yu(e,r),Ma(r,null,null,s),Da()),c=e.memoizedState,h=r.memoizedState,c.parent!==o?(c={parent:o,cache:o},r.memoizedState=c,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=c),ei(r,at,o)):(o=h.cache,ei(r,at,o),o!==c.cache&&qu(r,[at],s,!0))),gt(e,r,r.pendingProps.children,s),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Ln(e){e.flags|=4}function Mm(e,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Vg(r)){if(r=tn.current,r!==null&&((Ne&4194048)===Ne?yn!==null:(Ne&62914560)!==Ne&&(Ne&536870912)===0||r!==yn))throw Oa=Gu,yp;e.flags|=8192}}function Tl(e,r){r!==null&&(e.flags|=4),e.flags&16384&&(r=e.tag!==22?dh():536870912,e.lanes|=r,Mr|=r)}function Ka(e,r){if(!Ee)switch(e.tailMode){case"hidden":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ie(e){var r=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(r)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,o|=c.subtreeFlags&65011712,o|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,o|=c.subtreeFlags,o|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=o,e.childLanes=s,r}function uw(e,r,s){var o=r.pendingProps;switch(zu(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(r),null;case 1:return Ie(r),null;case 3:return s=r.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),On(at),Fn(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ka(r)?Ln(r):e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,dp())),Ie(r),null;case 26:return s=r.memoizedState,e===null?(Ln(r),s!==null?(Ie(r),Mm(r,s)):(Ie(r),r.flags&=-16777217)):s?s!==e.memoizedState?(Ln(r),Ie(r),Mm(r,s)):(Ie(r),r.flags&=-16777217):(e.memoizedProps!==o&&Ln(r),Ie(r),r.flags&=-16777217),null;case 27:Ks(r),s=he.current;var c=r.type;if(e!==null&&r.stateNode!=null)e.memoizedProps!==o&&Ln(r);else{if(!o){if(r.stateNode===null)throw Error(a(166));return Ie(r),null}e=ie.current,ka(r)?cp(r):(e=Mg(c,o,s),r.stateNode=e,Ln(r))}return Ie(r),null;case 5:if(Ks(r),s=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==o&&Ln(r);else{if(!o){if(r.stateNode===null)throw Error(a(166));return Ie(r),null}if(e=ie.current,ka(r))cp(r);else{switch(c=Hl(he.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof o.is=="string"?c.createElement("select",{is:o.is}):c.createElement("select"),o.multiple?e.multiple=!0:o.size&&(e.size=o.size);break;default:e=typeof o.is=="string"?c.createElement(s,{is:o.is}):c.createElement(s)}}e[xt]=r,e[Tt]=o;e:for(c=r.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===r)break e;for(;c.sibling===null;){if(c.return===null||c.return===r)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r.stateNode=e;e:switch(vt(e,s,o),s){case"button":case"input":case"select":case"textarea":e=!!o.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Ln(r)}}return Ie(r),r.flags&=-16777217,null;case 6:if(e&&r.stateNode!=null)e.memoizedProps!==o&&Ln(r);else{if(typeof o!="string"&&r.stateNode===null)throw Error(a(166));if(e=he.current,ka(r)){if(e=r.stateNode,s=r.memoizedProps,o=null,c=Rt,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}e[xt]=r,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Ag(e.nodeValue,s)),e||Ui(r)}else e=Hl(e).createTextNode(o),e[xt]=r,r.stateNode=e}return Ie(r),null;case 13:if(o=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ka(r),o!==null&&o.dehydrated!==null){if(e===null){if(!c)throw Error(a(318));if(c=r.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));c[xt]=r}else Ra(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ie(r),c=!1}else c=dp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return r.flags&256?(Dn(r),r):(Dn(r),null)}if(Dn(r),(r.flags&128)!==0)return r.lanes=s,r;if(s=o!==null,e=e!==null&&e.memoizedState!==null,s){o=r.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool);var h=null;o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==c&&(o.flags|=2048)}return s!==e&&s&&(r.child.flags|=8192),Tl(r,r.updateQueue),Ie(r),null;case 4:return Fn(),e===null&&Zc(r.stateNode.containerInfo),Ie(r),null;case 10:return On(r.type),Ie(r),null;case 19:if(Q(st),c=r.memoizedState,c===null)return Ie(r),null;if(o=(r.flags&128)!==0,h=c.rendering,h===null)if(o)Ka(c,!1);else{if(Qe!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(h=Rl(e),h!==null){for(r.flags|=128,Ka(c,!1),e=h.updateQueue,r.updateQueue=e,Tl(r,e),r.subtreeFlags=0,e=s,s=r.child;s!==null;)op(s,e),s=s.sibling;return I(st,st.current&1|2),r.child}e=e.sibling}c.tail!==null&&mn()>Dl&&(r.flags|=128,o=!0,Ka(c,!1),r.lanes=4194304)}else{if(!o)if(e=Rl(h),e!==null){if(r.flags|=128,o=!0,e=e.updateQueue,r.updateQueue=e,Tl(r,e),Ka(c,!0),c.tail===null&&c.tailMode==="hidden"&&!h.alternate&&!Ee)return Ie(r),null}else 2*mn()-c.renderingStartTime>Dl&&s!==536870912&&(r.flags|=128,o=!0,Ka(c,!1),r.lanes=4194304);c.isBackwards?(h.sibling=r.child,r.child=h):(e=c.last,e!==null?e.sibling=h:r.child=h,c.last=h)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=mn(),r.sibling=null,e=st.current,I(st,o?e&1|2:e&1),r):(Ie(r),null);case 22:case 23:return Dn(r),Fu(),o=r.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(r.flags|=8192):o&&(r.flags|=8192),o?(s&536870912)!==0&&(r.flags&128)===0&&(Ie(r),r.subtreeFlags&6&&(r.flags|=8192)):Ie(r),s=r.updateQueue,s!==null&&Tl(r,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==s&&(r.flags|=2048),e!==null&&Q(qi),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),r.memoizedState.cache!==s&&(r.flags|=2048),On(at),Ie(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function cw(e,r){switch(zu(r),r.tag){case 1:return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return On(at),Fn(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 26:case 27:case 5:return Ks(r),null;case 13:if(Dn(r),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Ra()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return Q(st),null;case 4:return Fn(),null;case 10:return On(r.type),null;case 22:case 23:return Dn(r),Fu(),e!==null&&Q(qi),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 24:return On(at),null;case 25:return null;default:return null}}function Lm(e,r){switch(zu(r),r.tag){case 3:On(at),Fn();break;case 26:case 27:case 5:Ks(r);break;case 4:Fn();break;case 13:Dn(r);break;case 19:Q(st);break;case 10:On(r.type);break;case 22:case 23:Dn(r),Fu(),e!==null&&Q(qi);break;case 24:On(at)}}function Va(e,r){try{var s=r.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){o=void 0;var h=s.create,y=s.inst;o=h(),y.destroy=o}s=s.next}while(s!==c)}}catch(x){Ue(r,r.return,x)}}function li(e,r,s){try{var o=r.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var h=c.next;o=h;do{if((o.tag&e)===e){var y=o.inst,x=y.destroy;if(x!==void 0){y.destroy=void 0,c=r;var k=s,j=x;try{j()}catch(q){Ue(c,k,q)}}}o=o.next}while(o!==h)}}catch(q){Ue(r,r.return,q)}}function zm(e){var r=e.updateQueue;if(r!==null){var s=e.stateNode;try{Np(r,s)}catch(o){Ue(e,e.return,o)}}}function Um(e,r,s){s.props=Vi(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){Ue(e,r,o)}}function Ha(e,r){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(c){Ue(e,r,c)}}function vn(e,r){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(c){Ue(e,r,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){Ue(e,r,c)}else s.current=null}function Bm(e){var r=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(c){Ue(e,e.return,c)}}function kc(e,r,s){try{var o=e.stateNode;Ow(o,e.type,s,r),o[Tt]=r}catch(c){Ue(e,e.return,c)}}function _m(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mi(e.type)||e.tag===4}function Rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_m(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,r,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,r?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,r):(r=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,r.appendChild(e),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=Vl));else if(o!==4&&(o===27&&mi(e.type)&&(s=e.stateNode,r=null),e=e.child,e!==null))for(Ec(e,r,s),e=e.sibling;e!==null;)Ec(e,r,s),e=e.sibling}function Ol(e,r,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,r?s.insertBefore(e,r):s.appendChild(e);else if(o!==4&&(o===27&&mi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Ol(e,r,s),e=e.sibling;e!==null;)Ol(e,r,s),e=e.sibling}function qm(e){var r=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,c=r.attributes;c.length;)r.removeAttributeNode(c[0]);vt(r,o,s),r[xt]=e,r[Tt]=s}catch(h){Ue(e,e.return,h)}}var zn=!1,Pe=!1,Ac=!1,Km=typeof WeakSet=="function"?WeakSet:Set,dt=null;function fw(e,r){if(e=e.containerInfo,Xc=Ql,e=Ph(e),Ru(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var c=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var y=0,x=-1,k=-1,j=0,q=0,H=e,D=null;t:for(;;){for(var M;H!==s||c!==0&&H.nodeType!==3||(x=y+c),H!==h||o!==0&&H.nodeType!==3||(k=y+o),H.nodeType===3&&(y+=H.nodeValue.length),(M=H.firstChild)!==null;)D=H,H=M;for(;;){if(H===e)break t;if(D===s&&++j===c&&(x=y),D===h&&++q===o&&(k=y),(M=H.nextSibling)!==null)break;H=D,D=H.parentNode}H=M}s=x===-1||k===-1?null:{start:x,end:k}}else s=null}s=s||{start:0,end:0}}else s=null;for(Pc={focusedElem:e,selectionRange:s},Ql=!1,dt=r;dt!==null;)if(r=dt,e=r.child,(r.subtreeFlags&1024)!==0&&e!==null)e.return=r,dt=e;else for(;dt!==null;){switch(r=dt,h=r.alternate,e=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,s=r,c=h.memoizedProps,h=h.memoizedState,o=s.stateNode;try{var ue=Vi(s.type,c,s.elementType===s.type);e=o.getSnapshotBeforeUpdate(ue,h),o.__reactInternalSnapshotBeforeUpdate=e}catch(ae){Ue(s,s.return,ae)}}break;case 3:if((e&1024)!==0){if(e=r.stateNode.containerInfo,s=e.nodeType,s===9)tf(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=r.sibling,e!==null){e.return=r.return,dt=e;break}dt=r.return}}function Vm(e,r,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:oi(e,s),o&4&&Va(5,s);break;case 1:if(oi(e,s),o&4)if(e=s.stateNode,r===null)try{e.componentDidMount()}catch(y){Ue(s,s.return,y)}else{var c=Vi(s.type,r.memoizedProps);r=r.memoizedState;try{e.componentDidUpdate(c,r,e.__reactInternalSnapshotBeforeUpdate)}catch(y){Ue(s,s.return,y)}}o&64&&zm(s),o&512&&Ha(s,s.return);break;case 3:if(oi(e,s),o&64&&(e=s.updateQueue,e!==null)){if(r=null,s.child!==null)switch(s.child.tag){case 27:case 5:r=s.child.stateNode;break;case 1:r=s.child.stateNode}try{Np(e,r)}catch(y){Ue(s,s.return,y)}}break;case 27:r===null&&o&4&&qm(s);case 26:case 5:oi(e,s),r===null&&o&4&&Bm(s),o&512&&Ha(s,s.return);break;case 12:oi(e,s);break;case 13:oi(e,s),o&4&&Jm(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=xw.bind(null,s),Bw(e,s))));break;case 22:if(o=s.memoizedState!==null||zn,!o){r=r!==null&&r.memoizedState!==null||Pe,c=zn;var h=Pe;zn=o,(Pe=r)&&!h?ui(e,s,(s.subtreeFlags&8772)!==0):oi(e,s),zn=c,Pe=h}break;case 30:break;default:oi(e,s)}}function Hm(e){var r=e.alternate;r!==null&&(e.alternate=null,Hm(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&su(r)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Je=null,Dt=!1;function Un(e,r,s){for(s=s.child;s!==null;)Gm(e,r,s),s=s.sibling}function Gm(e,r,s){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(ca,s)}catch{}switch(s.tag){case 26:Pe||vn(s,r),Un(e,r,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Pe||vn(s,r);var o=Je,c=Dt;mi(s.type)&&(Je=s.stateNode,Dt=!1),Un(e,r,s),Pa(s.stateNode),Je=o,Dt=c;break;case 5:Pe||vn(s,r);case 6:if(o=Je,c=Dt,Je=null,Un(e,r,s),Je=o,Dt=c,Je!==null)if(Dt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(s.stateNode)}catch(h){Ue(s,r,h)}else try{Je.removeChild(s.stateNode)}catch(h){Ue(s,r,h)}break;case 18:Je!==null&&(Dt?(e=Je,jg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),ss(e)):jg(Je,s.stateNode));break;case 4:o=Je,c=Dt,Je=s.stateNode.containerInfo,Dt=!0,Un(e,r,s),Je=o,Dt=c;break;case 0:case 11:case 14:case 15:Pe||li(2,s,r),Pe||li(4,s,r),Un(e,r,s);break;case 1:Pe||(vn(s,r),o=s.stateNode,typeof o.componentWillUnmount=="function"&&Um(s,r,o)),Un(e,r,s);break;case 21:Un(e,r,s);break;case 22:Pe=(o=Pe)||s.memoizedState!==null,Un(e,r,s),Pe=o;break;default:Un(e,r,s)}}function Jm(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ss(e)}catch(s){Ue(r,r.return,s)}}function dw(e){switch(e.tag){case 13:case 19:var r=e.stateNode;return r===null&&(r=e.stateNode=new Km),r;case 22:return e=e.stateNode,r=e._retryCache,r===null&&(r=e._retryCache=new Km),r;default:throw Error(a(435,e.tag))}}function $c(e,r){var s=dw(e);r.forEach(function(o){var c=Sw.bind(null,e,o);s.has(o)||(s.add(o),o.then(c,c))})}function Vt(e,r){var s=r.deletions;if(s!==null)for(var o=0;o<s.length;o++){var c=s[o],h=e,y=r,x=y;e:for(;x!==null;){switch(x.tag){case 27:if(mi(x.type)){Je=x.stateNode,Dt=!1;break e}break;case 5:Je=x.stateNode,Dt=!1;break e;case 3:case 4:Je=x.stateNode.containerInfo,Dt=!0;break e}x=x.return}if(Je===null)throw Error(a(160));Gm(h,y,c),Je=null,Dt=!1,h=c.alternate,h!==null&&(h.return=null),c.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)Ym(r,e),r=r.sibling}var un=null;function Ym(e,r){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(r,e),Ht(e),o&4&&(li(3,e,e.return),Va(3,e),li(5,e,e.return));break;case 1:Vt(r,e),Ht(e),o&512&&(Pe||s===null||vn(s,s.return)),o&64&&zn&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var c=un;if(Vt(r,e),Ht(e),o&512&&(Pe||s===null||vn(s,s.return)),o&4){var h=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(o){case"title":h=c.getElementsByTagName("title")[0],(!h||h[ha]||h[xt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=c.createElement(o),c.head.insertBefore(h,c.querySelector("head > title"))),vt(h,o,s),h[xt]=e,ct(h),o=h;break e;case"link":var y=qg("link","href",c).get(o+(s.href||""));if(y){for(var x=0;x<y.length;x++)if(h=y[x],h.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&h.getAttribute("rel")===(s.rel==null?null:s.rel)&&h.getAttribute("title")===(s.title==null?null:s.title)&&h.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(x,1);break t}}h=c.createElement(o),vt(h,o,s),c.head.appendChild(h);break;case"meta":if(y=qg("meta","content",c).get(o+(s.content||""))){for(x=0;x<y.length;x++)if(h=y[x],h.getAttribute("content")===(s.content==null?null:""+s.content)&&h.getAttribute("name")===(s.name==null?null:s.name)&&h.getAttribute("property")===(s.property==null?null:s.property)&&h.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&h.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(x,1);break t}}h=c.createElement(o),vt(h,o,s),c.head.appendChild(h);break;default:throw Error(a(468,o))}h[xt]=e,ct(h),o=h}e.stateNode=o}else Kg(c,e.type,e.stateNode);else e.stateNode=_g(c,o,e.memoizedProps);else h!==o?(h===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):h.count--,o===null?Kg(c,e.type,e.stateNode):_g(c,o,e.memoizedProps)):o===null&&e.stateNode!==null&&kc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Vt(r,e),Ht(e),o&512&&(Pe||s===null||vn(s,s.return)),s!==null&&o&4&&kc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Vt(r,e),Ht(e),o&512&&(Pe||s===null||vn(s,s.return)),e.flags&32){c=e.stateNode;try{dr(c,"")}catch(M){Ue(e,e.return,M)}}o&4&&e.stateNode!=null&&(c=e.memoizedProps,kc(e,c,s!==null?s.memoizedProps:c)),o&1024&&(Ac=!0);break;case 6:if(Vt(r,e),Ht(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(M){Ue(e,e.return,M)}}break;case 3:if(Yl=null,c=un,un=Gl(r.containerInfo),Vt(r,e),un=c,Ht(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{ss(r.containerInfo)}catch(M){Ue(e,e.return,M)}Ac&&(Ac=!1,Im(e));break;case 4:o=un,un=Gl(e.stateNode.containerInfo),Vt(r,e),Ht(e),un=o;break;case 12:Vt(r,e),Ht(e);break;case 13:Vt(r,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Mc=mn()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$c(e,o)));break;case 22:c=e.memoizedState!==null;var k=s!==null&&s.memoizedState!==null,j=zn,q=Pe;if(zn=j||c,Pe=q||k,Vt(r,e),Pe=q,zn=j,Ht(e),o&8192)e:for(r=e.stateNode,r._visibility=c?r._visibility&-2:r._visibility|1,c&&(s===null||k||zn||Pe||Hi(e)),s=null,r=e;;){if(r.tag===5||r.tag===26){if(s===null){k=s=r;try{if(h=k.stateNode,c)y=h.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{x=k.stateNode;var H=k.memoizedProps.style,D=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(M){Ue(k,k.return,M)}}}else if(r.tag===6){if(s===null){k=r;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(M){Ue(k,k.return,M)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;s===r&&(s=null),r=r.return}s===r&&(s=null),r.sibling.return=r.return,r=r.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,$c(e,s))));break;case 19:Vt(r,e),Ht(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,$c(e,o)));break;case 30:break;case 21:break;default:Vt(r,e),Ht(e)}}function Ht(e){var r=e.flags;if(r&2){try{for(var s,o=e.return;o!==null;){if(_m(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var c=s.stateNode,h=Rc(e);Ol(e,h,c);break;case 5:var y=s.stateNode;s.flags&32&&(dr(y,""),s.flags&=-33);var x=Rc(e);Ol(e,x,y);break;case 3:case 4:var k=s.stateNode.containerInfo,j=Rc(e);Ec(e,j,k);break;default:throw Error(a(161))}}catch(q){Ue(e,e.return,q)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var r=e;Im(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),e=e.sibling}}function oi(e,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Vm(e,r.alternate,r),r=r.sibling}function Hi(e){for(e=e.child;e!==null;){var r=e;switch(r.tag){case 0:case 11:case 14:case 15:li(4,r,r.return),Hi(r);break;case 1:vn(r,r.return);var s=r.stateNode;typeof s.componentWillUnmount=="function"&&Um(r,r.return,s),Hi(r);break;case 27:Pa(r.stateNode);case 26:case 5:vn(r,r.return),Hi(r);break;case 22:r.memoizedState===null&&Hi(r);break;case 30:Hi(r);break;default:Hi(r)}e=e.sibling}}function ui(e,r,s){for(s=s&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var o=r.alternate,c=e,h=r,y=h.flags;switch(h.tag){case 0:case 11:case 15:ui(c,h,s),Va(4,h);break;case 1:if(ui(c,h,s),o=h,c=o.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(j){Ue(o,o.return,j)}if(o=h,c=o.updateQueue,c!==null){var x=o.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)wp(k[c],x)}catch(j){Ue(o,o.return,j)}}s&&y&64&&zm(h),Ha(h,h.return);break;case 27:qm(h);case 26:case 5:ui(c,h,s),s&&o===null&&y&4&&Bm(h),Ha(h,h.return);break;case 12:ui(c,h,s);break;case 13:ui(c,h,s),s&&y&4&&Jm(c,h);break;case 22:h.memoizedState===null&&ui(c,h,s),Ha(h,h.return);break;case 30:break;default:ui(c,h,s)}r=r.sibling}}function Cc(e,r){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(e=r.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&$a(s))}function Tc(e,r){e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&$a(e))}function bn(e,r,s,o){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Zm(e,r,s,o),r=r.sibling}function Zm(e,r,s,o){var c=r.flags;switch(r.tag){case 0:case 11:case 15:bn(e,r,s,o),c&2048&&Va(9,r);break;case 1:bn(e,r,s,o);break;case 3:bn(e,r,s,o),c&2048&&(e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&$a(e)));break;case 12:if(c&2048){bn(e,r,s,o),e=r.stateNode;try{var h=r.memoizedProps,y=h.id,x=h.onPostCommit;typeof x=="function"&&x(y,r.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){Ue(r,r.return,k)}}else bn(e,r,s,o);break;case 13:bn(e,r,s,o);break;case 23:break;case 22:h=r.stateNode,y=r.alternate,r.memoizedState!==null?h._visibility&2?bn(e,r,s,o):Ga(e,r):h._visibility&2?bn(e,r,s,o):(h._visibility|=2,Or(e,r,s,o,(r.subtreeFlags&10256)!==0)),c&2048&&Cc(y,r);break;case 24:bn(e,r,s,o),c&2048&&Tc(r.alternate,r);break;default:bn(e,r,s,o)}}function Or(e,r,s,o,c){for(c=c&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var h=e,y=r,x=s,k=o,j=y.flags;switch(y.tag){case 0:case 11:case 15:Or(h,y,x,k,c),Va(8,y);break;case 23:break;case 22:var q=y.stateNode;y.memoizedState!==null?q._visibility&2?Or(h,y,x,k,c):Ga(h,y):(q._visibility|=2,Or(h,y,x,k,c)),c&&j&2048&&Cc(y.alternate,y);break;case 24:Or(h,y,x,k,c),c&&j&2048&&Tc(y.alternate,y);break;default:Or(h,y,x,k,c)}r=r.sibling}}function Ga(e,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var s=e,o=r,c=o.flags;switch(o.tag){case 22:Ga(s,o),c&2048&&Cc(o.alternate,o);break;case 24:Ga(s,o),c&2048&&Tc(o.alternate,o);break;default:Ga(s,o)}r=r.sibling}}var Ja=8192;function jr(e){if(e.subtreeFlags&Ja)for(e=e.child;e!==null;)Qm(e),e=e.sibling}function Qm(e){switch(e.tag){case 26:jr(e),e.flags&Ja&&e.memoizedState!==null&&Xw(un,e.memoizedState,e.memoizedProps);break;case 5:jr(e);break;case 3:case 4:var r=un;un=Gl(e.stateNode.containerInfo),jr(e),un=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ja,Ja=16777216,jr(e),Ja=r):jr(e));break;default:jr(e)}}function Fm(e){var r=e.alternate;if(r!==null&&(e=r.child,e!==null)){r.child=null;do r=e.sibling,e.sibling=null,e=r;while(e!==null)}}function Ya(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var o=r[s];dt=o,Pm(o,e)}Fm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xm(e),e=e.sibling}function Xm(e){switch(e.tag){case 0:case 11:case 15:Ya(e),e.flags&2048&&li(9,e,e.return);break;case 3:Ya(e);break;case 12:Ya(e);break;case 22:var r=e.stateNode;e.memoizedState!==null&&r._visibility&2&&(e.return===null||e.return.tag!==13)?(r._visibility&=-3,jl(e)):Ya(e);break;default:Ya(e)}}function jl(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var s=0;s<r.length;s++){var o=r[s];dt=o,Pm(o,e)}Fm(e)}for(e=e.child;e!==null;){switch(r=e,r.tag){case 0:case 11:case 15:li(8,r,r.return),jl(r);break;case 22:s=r.stateNode,s._visibility&2&&(s._visibility&=-3,jl(r));break;default:jl(r)}e=e.sibling}}function Pm(e,r){for(;dt!==null;){var s=dt;switch(s.tag){case 0:case 11:case 15:li(8,s,r);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:$a(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,dt=o;else e:for(s=e;dt!==null;){o=dt;var c=o.sibling,h=o.return;if(Hm(o),o===s){dt=null;break e}if(c!==null){c.return=h,dt=c;break e}dt=h}}}var hw={getCacheForType:function(e){var r=St(at),s=r.data.get(e);return s===void 0&&(s=e(),r.data.set(e,s)),s}},pw=typeof WeakMap=="function"?WeakMap:Map,Ce=0,qe=null,ve=null,Ne=0,Te=0,Gt=null,ci=!1,Dr=!1,Oc=!1,Bn=0,Qe=0,fi=0,Gi=0,jc=0,nn=0,Mr=0,Ia=null,Mt=null,Dc=!1,Mc=0,Dl=1/0,Ml=null,di=null,yt=0,hi=null,Lr=null,zr=0,Lc=0,zc=null,Wm=null,Za=0,Uc=null;function Jt(){if((Ce&2)!==0&&Ne!==0)return Ne&-Ne;if(B.T!==null){var e=Nr;return e!==0?e:Gc()}return mh()}function eg(){nn===0&&(nn=(Ne&536870912)===0||Ee?fh():536870912);var e=tn.current;return e!==null&&(e.flags|=32),nn}function Yt(e,r,s){(e===qe&&(Te===2||Te===9)||e.cancelPendingCommit!==null)&&(Ur(e,0),pi(e,Ne,nn,!1)),da(e,s),((Ce&2)===0||e!==qe)&&(e===qe&&((Ce&2)===0&&(Gi|=s),Qe===4&&pi(e,Ne,nn,!1)),xn(e))}function tg(e,r,s){if((Ce&6)!==0)throw Error(a(327));var o=!s&&(r&124)===0&&(r&e.expiredLanes)===0||fa(e,r),c=o?yw(e,r):qc(e,r,!0),h=o;do{if(c===0){Dr&&!o&&pi(e,r,0,!1);break}else{if(s=e.current.alternate,h&&!mw(s)){c=qc(e,r,!1),h=!1;continue}if(c===2){if(h=r,e.errorRecoveryDisabledLanes&h)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){r=y;e:{var x=e;c=Ia;var k=x.current.memoizedState.isDehydrated;if(k&&(Ur(x,y).flags|=256),y=qc(x,y,!1),y!==2){if(Oc&&!k){x.errorRecoveryDisabledLanes|=h,Gi|=h,c=4;break e}h=Mt,Mt=c,h!==null&&(Mt===null?Mt=h:Mt.push.apply(Mt,h))}c=y}if(h=!1,c!==2)continue}}if(c===1){Ur(e,0),pi(e,r,0,!0);break}e:{switch(o=e,h=c,h){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:pi(o,r,nn,!ci);break e;case 2:Mt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(c=Mc+300-mn(),10<c)){if(pi(o,r,nn,!ci),Js(o,0,!0)!==0)break e;o.timeoutHandle=Tg(ng.bind(null,o,s,Mt,Ml,Dc,r,nn,Gi,Mr,ci,h,2,-0,0),c);break e}ng(o,s,Mt,Ml,Dc,r,nn,Gi,Mr,ci,h,0,-0,0)}}break}while(!0);xn(e)}function ng(e,r,s,o,c,h,y,x,k,j,q,H,D,M){if(e.timeoutHandle=-1,H=r.subtreeFlags,(H&8192||(H&16785408)===16785408)&&(ts={stylesheets:null,count:0,unsuspend:Fw},Qm(r),H=Pw(),H!==null)){e.cancelPendingCommit=H(ug.bind(null,e,r,h,s,o,c,y,x,k,q,1,D,M)),pi(e,h,y,!j);return}ug(e,r,h,s,o,c,y,x,k)}function mw(e){for(var r=e;;){var s=r.tag;if((s===0||s===11||s===15)&&r.flags&16384&&(s=r.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var c=s[o],h=c.getSnapshot;c=c.value;try{if(!qt(h(),c))return!1}catch{return!1}}if(s=r.child,r.subtreeFlags&16384&&s!==null)s.return=r,r=s;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function pi(e,r,s,o){r&=~jc,r&=~Gi,e.suspendedLanes|=r,e.pingedLanes&=~r,o&&(e.warmLanes|=r),o=e.expirationTimes;for(var c=r;0<c;){var h=31-_t(c),y=1<<h;o[h]=-1,c&=~y}s!==0&&hh(e,s,r)}function Ll(){return(Ce&6)===0?(Qa(0),!1):!0}function Bc(){if(ve!==null){if(Te===0)var e=ve.return;else e=ve,Tn=Bi=null,tc(e),Cr=null,_a=0,e=ve;for(;e!==null;)Lm(e.alternate,e),e=e.return;ve=null}}function Ur(e,r){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Dw(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Bc(),qe=e,ve=s=An(e.current,null),Ne=r,Te=0,Gt=null,ci=!1,Dr=fa(e,r),Oc=!1,Mr=nn=jc=Gi=fi=Qe=0,Mt=Ia=null,Dc=!1,(r&8)!==0&&(r|=r&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=r;0<o;){var c=31-_t(o),h=1<<c;r|=e[c],o&=~h}return Bn=r,il(),s}function ig(e,r){ge=null,B.H=wl,r===Ta||r===dl?(r=xp(),Te=3):r===yp?(r=xp(),Te=4):Te=r===Sm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Gt=r,ve===null&&(Qe=1,Al(e,Xt(r,e.current)))}function rg(){var e=B.H;return B.H=wl,e===null?wl:e}function ag(){var e=B.A;return B.A=hw,e}function _c(){Qe=4,ci||(Ne&4194048)!==Ne&&tn.current!==null||(Dr=!0),(fi&134217727)===0&&(Gi&134217727)===0||qe===null||pi(qe,Ne,nn,!1)}function qc(e,r,s){var o=Ce;Ce|=2;var c=rg(),h=ag();(qe!==e||Ne!==r)&&(Ml=null,Ur(e,r)),r=!1;var y=Qe;e:do try{if(Te!==0&&ve!==null){var x=ve,k=Gt;switch(Te){case 8:Bc(),y=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(r=!0);var j=Te;if(Te=0,Gt=null,Br(e,x,k,j),s&&Dr){y=0;break e}break;default:j=Te,Te=0,Gt=null,Br(e,x,k,j)}}gw(),y=Qe;break}catch(q){ig(e,q)}while(!0);return r&&e.shellSuspendCounter++,Tn=Bi=null,Ce=o,B.H=c,B.A=h,ve===null&&(qe=null,Ne=0,il()),y}function gw(){for(;ve!==null;)sg(ve)}function yw(e,r){var s=Ce;Ce|=2;var o=rg(),c=ag();qe!==e||Ne!==r?(Ml=null,Dl=mn()+500,Ur(e,r)):Dr=fa(e,r);e:do try{if(Te!==0&&ve!==null){r=ve;var h=Gt;t:switch(Te){case 1:Te=0,Gt=null,Br(e,r,h,1);break;case 2:case 9:if(vp(h)){Te=0,Gt=null,lg(r);break}r=function(){Te!==2&&Te!==9||qe!==e||(Te=7),xn(e)},h.then(r,r);break e;case 3:Te=7;break e;case 4:Te=5;break e;case 7:vp(h)?(Te=0,Gt=null,lg(r)):(Te=0,Gt=null,Br(e,r,h,7));break;case 5:var y=null;switch(ve.tag){case 26:y=ve.memoizedState;case 5:case 27:var x=ve;if(!y||Vg(y)){Te=0,Gt=null;var k=x.sibling;if(k!==null)ve=k;else{var j=x.return;j!==null?(ve=j,zl(j)):ve=null}break t}}Te=0,Gt=null,Br(e,r,h,5);break;case 6:Te=0,Gt=null,Br(e,r,h,6);break;case 8:Bc(),Qe=6;break e;default:throw Error(a(462))}}vw();break}catch(q){ig(e,q)}while(!0);return Tn=Bi=null,B.H=o,B.A=c,Ce=s,ve!==null?0:(qe=null,Ne=0,il(),Qe)}function vw(){for(;ve!==null&&!qS();)sg(ve)}function sg(e){var r=Dm(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,r===null?zl(e):ve=r}function lg(e){var r=e,s=r.alternate;switch(r.tag){case 15:case 0:r=Am(s,r,r.pendingProps,r.type,void 0,Ne);break;case 11:r=Am(s,r,r.pendingProps,r.type.render,r.ref,Ne);break;case 5:tc(r);default:Lm(s,r),r=ve=op(r,Bn),r=Dm(s,r,Bn)}e.memoizedProps=e.pendingProps,r===null?zl(e):ve=r}function Br(e,r,s,o){Tn=Bi=null,tc(r),Cr=null,_a=0;var c=r.return;try{if(lw(e,c,r,s,Ne)){Qe=1,Al(e,Xt(s,e.current)),ve=null;return}}catch(h){if(c!==null)throw ve=c,h;Qe=1,Al(e,Xt(s,e.current)),ve=null;return}r.flags&32768?(Ee||o===1?e=!0:Dr||(Ne&536870912)!==0?e=!1:(ci=e=!0,(o===2||o===9||o===3||o===6)&&(o=tn.current,o!==null&&o.tag===13&&(o.flags|=16384))),og(r,e)):zl(r)}function zl(e){var r=e;do{if((r.flags&32768)!==0){og(r,ci);return}e=r.return;var s=uw(r.alternate,r,Bn);if(s!==null){ve=s;return}if(r=r.sibling,r!==null){ve=r;return}ve=r=e}while(r!==null);Qe===0&&(Qe=5)}function og(e,r){do{var s=cw(e.alternate,e);if(s!==null){s.flags&=32767,ve=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!r&&(e=e.sibling,e!==null)){ve=e;return}ve=e=s}while(e!==null);Qe=6,ve=null}function ug(e,r,s,o,c,h,y,x,k){e.cancelPendingCommit=null;do Ul();while(yt!==0);if((Ce&6)!==0)throw Error(a(327));if(r!==null){if(r===e.current)throw Error(a(177));if(h=r.lanes|r.childLanes,h|=Tu,FS(e,s,h,y,x,k),e===qe&&(ve=qe=null,Ne=0),Lr=r,hi=e,zr=s,Lc=h,zc=c,Wm=o,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ww(Vs,function(){return pg(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,c=Y.p,Y.p=2,y=Ce,Ce|=4;try{fw(e,r,s)}finally{Ce=y,Y.p=c,B.T=o}}yt=1,cg(),fg(),dg()}}function cg(){if(yt===1){yt=0;var e=hi,r=Lr,s=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var o=Y.p;Y.p=2;var c=Ce;Ce|=4;try{Ym(r,e);var h=Pc,y=Ph(e.containerInfo),x=h.focusedElem,k=h.selectionRange;if(y!==x&&x&&x.ownerDocument&&Xh(x.ownerDocument.documentElement,x)){if(k!==null&&Ru(x)){var j=k.start,q=k.end;if(q===void 0&&(q=j),"selectionStart"in x)x.selectionStart=j,x.selectionEnd=Math.min(q,x.value.length);else{var H=x.ownerDocument||document,D=H&&H.defaultView||window;if(D.getSelection){var M=D.getSelection(),ue=x.textContent.length,ae=Math.min(k.start,ue),Le=k.end===void 0?ae:Math.min(k.end,ue);!M.extend&&ae>Le&&(y=Le,Le=ae,ae=y);var C=Fh(x,ae),$=Fh(x,Le);if(C&&$&&(M.rangeCount!==1||M.anchorNode!==C.node||M.anchorOffset!==C.offset||M.focusNode!==$.node||M.focusOffset!==$.offset)){var T=H.createRange();T.setStart(C.node,C.offset),M.removeAllRanges(),ae>Le?(M.addRange(T),M.extend($.node,$.offset)):(T.setEnd($.node,$.offset),M.addRange(T))}}}}for(H=[],M=x;M=M.parentNode;)M.nodeType===1&&H.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var K=H[x];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Ql=!!Xc,Pc=Xc=null}finally{Ce=c,Y.p=o,B.T=s}}e.current=r,yt=2}}function fg(){if(yt===2){yt=0;var e=hi,r=Lr,s=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var o=Y.p;Y.p=2;var c=Ce;Ce|=4;try{Vm(e,r.alternate,r)}finally{Ce=c,Y.p=o,B.T=s}}yt=3}}function dg(){if(yt===4||yt===3){yt=0,KS();var e=hi,r=Lr,s=zr,o=Wm;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?yt=5:(yt=0,Lr=hi=null,hg(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(di=null),ru(s),r=r.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(ca,r,void 0,(r.current.flags&128)===128)}catch{}if(o!==null){r=B.T,c=Y.p,Y.p=2,B.T=null;try{for(var h=e.onRecoverableError,y=0;y<o.length;y++){var x=o[y];h(x.value,{componentStack:x.stack})}}finally{B.T=r,Y.p=c}}(zr&3)!==0&&Ul(),xn(e),c=e.pendingLanes,(s&4194090)!==0&&(c&42)!==0?e===Uc?Za++:(Za=0,Uc=e):Za=0,Qa(0)}}function hg(e,r){(e.pooledCacheLanes&=r)===0&&(r=e.pooledCache,r!=null&&(e.pooledCache=null,$a(r)))}function Ul(e){return cg(),fg(),dg(),pg()}function pg(){if(yt!==5)return!1;var e=hi,r=Lc;Lc=0;var s=ru(zr),o=B.T,c=Y.p;try{Y.p=32>s?32:s,B.T=null,s=zc,zc=null;var h=hi,y=zr;if(yt=0,Lr=hi=null,zr=0,(Ce&6)!==0)throw Error(a(331));var x=Ce;if(Ce|=4,Xm(h.current),Zm(h,h.current,y,s),Ce=x,Qa(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(ca,h)}catch{}return!0}finally{Y.p=c,B.T=o,hg(e,r)}}function mg(e,r,s){r=Xt(s,r),r=mc(e.stateNode,r,2),e=ii(e,r,2),e!==null&&(da(e,2),xn(e))}function Ue(e,r,s){if(e.tag===3)mg(e,e,s);else for(;r!==null;){if(r.tag===3){mg(r,e,s);break}else if(r.tag===1){var o=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(di===null||!di.has(o))){e=Xt(s,e),s=bm(2),o=ii(r,s,2),o!==null&&(xm(s,o,r,e),da(o,2),xn(o));break}}r=r.return}}function Kc(e,r,s){var o=e.pingCache;if(o===null){o=e.pingCache=new pw;var c=new Set;o.set(r,c)}else c=o.get(r),c===void 0&&(c=new Set,o.set(r,c));c.has(s)||(Oc=!0,c.add(s),e=bw.bind(null,e,r,s),r.then(e,e))}function bw(e,r,s){var o=e.pingCache;o!==null&&o.delete(r),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,qe===e&&(Ne&s)===s&&(Qe===4||Qe===3&&(Ne&62914560)===Ne&&300>mn()-Mc?(Ce&2)===0&&Ur(e,0):jc|=s,Mr===Ne&&(Mr=0)),xn(e)}function gg(e,r){r===0&&(r=dh()),e=br(e,r),e!==null&&(da(e,r),xn(e))}function xw(e){var r=e.memoizedState,s=0;r!==null&&(s=r.retryLane),gg(e,s)}function Sw(e,r){var s=0;switch(e.tag){case 13:var o=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(r),gg(e,s)}function ww(e,r){return eu(e,r)}var Bl=null,_r=null,Vc=!1,_l=!1,Hc=!1,Ji=0;function xn(e){e!==_r&&e.next===null&&(_r===null?Bl=_r=e:_r=_r.next=e),_l=!0,Vc||(Vc=!0,kw())}function Qa(e,r){if(!Hc&&_l){Hc=!0;do for(var s=!1,o=Bl;o!==null;){if(e!==0){var c=o.pendingLanes;if(c===0)var h=0;else{var y=o.suspendedLanes,x=o.pingedLanes;h=(1<<31-_t(42|e)+1)-1,h&=c&~(y&~x),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,xg(o,h))}else h=Ne,h=Js(o,o===qe?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||fa(o,h)||(s=!0,xg(o,h));o=o.next}while(s);Hc=!1}}function Nw(){yg()}function yg(){_l=Vc=!1;var e=0;Ji!==0&&(jw()&&(e=Ji),Ji=0);for(var r=mn(),s=null,o=Bl;o!==null;){var c=o.next,h=vg(o,r);h===0?(o.next=null,s===null?Bl=c:s.next=c,c===null&&(_r=s)):(s=o,(e!==0||(h&3)!==0)&&(_l=!0)),o=c}Qa(e)}function vg(e,r){for(var s=e.suspendedLanes,o=e.pingedLanes,c=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var y=31-_t(h),x=1<<y,k=c[y];k===-1?((x&s)===0||(x&o)!==0)&&(c[y]=QS(x,r)):k<=r&&(e.expiredLanes|=x),h&=~x}if(r=qe,s=Ne,s=Js(e,e===r?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===r&&(Te===2||Te===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&tu(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||fa(e,s)){if(r=s&-s,r===e.callbackPriority)return r;switch(o!==null&&tu(o),ru(s)){case 2:case 8:s=uh;break;case 32:s=Vs;break;case 268435456:s=ch;break;default:s=Vs}return o=bg.bind(null,e),s=eu(s,o),e.callbackPriority=r,e.callbackNode=s,r}return o!==null&&o!==null&&tu(o),e.callbackPriority=2,e.callbackNode=null,2}function bg(e,r){if(yt!==0&&yt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ul()&&e.callbackNode!==s)return null;var o=Ne;return o=Js(e,e===qe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(tg(e,o,r),vg(e,mn()),e.callbackNode!=null&&e.callbackNode===s?bg.bind(null,e):null)}function xg(e,r){if(Ul())return null;tg(e,r,!0)}function kw(){Mw(function(){(Ce&6)!==0?eu(oh,Nw):yg()})}function Gc(){return Ji===0&&(Ji=fh()),Ji}function Sg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Fs(""+e)}function wg(e,r){var s=r.ownerDocument.createElement("input");return s.name=r.name,s.value=r.value,e.id&&s.setAttribute("form",e.id),r.parentNode.insertBefore(s,r),e=new FormData(e),s.parentNode.removeChild(s),e}function Rw(e,r,s,o,c){if(r==="submit"&&s&&s.stateNode===c){var h=Sg((c[Tt]||null).action),y=o.submitter;y&&(r=(r=y[Tt]||null)?Sg(r.formAction):y.getAttribute("formAction"),r!==null&&(h=r,y=null));var x=new el("action","action",null,o,c);e.push({event:x,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ji!==0){var k=y?wg(c,y):new FormData(c);cc(s,{pending:!0,data:k,method:c.method,action:h},null,k)}}else typeof h=="function"&&(x.preventDefault(),k=y?wg(c,y):new FormData(c),cc(s,{pending:!0,data:k,method:c.method,action:h},h,k))},currentTarget:c}]})}}for(var Jc=0;Jc<Cu.length;Jc++){var Yc=Cu[Jc],Ew=Yc.toLowerCase(),Aw=Yc[0].toUpperCase()+Yc.slice(1);on(Ew,"on"+Aw)}on(tp,"onAnimationEnd"),on(np,"onAnimationIteration"),on(ip,"onAnimationStart"),on("dblclick","onDoubleClick"),on("focusin","onFocus"),on("focusout","onBlur"),on(G1,"onTransitionRun"),on(J1,"onTransitionStart"),on(Y1,"onTransitionCancel"),on(rp,"onTransitionEnd"),ur("onMouseEnter",["mouseout","mouseover"]),ur("onMouseLeave",["mouseout","mouseover"]),ur("onPointerEnter",["pointerout","pointerover"]),ur("onPointerLeave",["pointerout","pointerover"]),Ci("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ci("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ci("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ci("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ci("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),$w=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fa));function Ng(e,r){r=(r&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],c=o.event;o=o.listeners;e:{var h=void 0;if(r)for(var y=o.length-1;0<=y;y--){var x=o[y],k=x.instance,j=x.currentTarget;if(x=x.listener,k!==h&&c.isPropagationStopped())break e;h=x,c.currentTarget=j;try{h(c)}catch(q){El(q)}c.currentTarget=null,h=k}else for(y=0;y<o.length;y++){if(x=o[y],k=x.instance,j=x.currentTarget,x=x.listener,k!==h&&c.isPropagationStopped())break e;h=x,c.currentTarget=j;try{h(c)}catch(q){El(q)}c.currentTarget=null,h=k}}}}function be(e,r){var s=r[au];s===void 0&&(s=r[au]=new Set);var o=e+"__bubble";s.has(o)||(kg(r,e,2,!1),s.add(o))}function Ic(e,r,s){var o=0;r&&(o|=4),kg(s,e,o,r)}var ql="_reactListening"+Math.random().toString(36).slice(2);function Zc(e){if(!e[ql]){e[ql]=!0,yh.forEach(function(s){s!=="selectionchange"&&($w.has(s)||Ic(s,!1,e),Ic(s,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[ql]||(r[ql]=!0,Ic("selectionchange",!1,r))}}function kg(e,r,s,o){switch(Zg(r)){case 2:var c=tN;break;case 8:c=nN;break;default:c=uf}s=c.bind(null,r,s,e),c=void 0,!gu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(c=!0),o?c!==void 0?e.addEventListener(r,s,{capture:!0,passive:c}):e.addEventListener(r,s,!0):c!==void 0?e.addEventListener(r,s,{passive:c}):e.addEventListener(r,s,!1)}function Qc(e,r,s,o,c){var h=o;if((r&1)===0&&(r&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var x=o.stateNode.containerInfo;if(x===c)break;if(y===4)for(y=o.return;y!==null;){var k=y.tag;if((k===3||k===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;x!==null;){if(y=sr(x),y===null)return;if(k=y.tag,k===5||k===6||k===26||k===27){o=h=y;continue e}x=x.parentNode}}o=o.return}Oh(function(){var j=h,q=pu(s),H=[];e:{var D=ap.get(e);if(D!==void 0){var M=el,ue=e;switch(e){case"keypress":if(Ps(s)===0)break e;case"keydown":case"keyup":M=w1;break;case"focusin":ue="focus",M=xu;break;case"focusout":ue="blur",M=xu;break;case"beforeblur":case"afterblur":M=xu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":M=Mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=c1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=R1;break;case tp:case np:case ip:M=h1;break;case rp:M=A1;break;case"scroll":case"scrollend":M=o1;break;case"wheel":M=C1;break;case"copy":case"cut":case"paste":M=m1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=zh;break;case"toggle":case"beforetoggle":M=O1}var ae=(r&4)!==0,Le=!ae&&(e==="scroll"||e==="scrollend"),C=ae?D!==null?D+"Capture":null:D;ae=[];for(var $=j,T;$!==null;){var K=$;if(T=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||T===null||C===null||(K=ma($,C),K!=null&&ae.push(Xa($,K,T))),Le)break;$=$.return}0<ae.length&&(D=new M(D,ue,null,s,q),H.push({event:D,listeners:ae}))}}if((r&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",D&&s!==hu&&(ue=s.relatedTarget||s.fromElement)&&(sr(ue)||ue[ar]))break e;if((M||D)&&(D=q.window===q?q:(D=q.ownerDocument)?D.defaultView||D.parentWindow:window,M?(ue=s.relatedTarget||s.toElement,M=j,ue=ue?sr(ue):null,ue!==null&&(Le=u(ue),ae=ue.tag,ue!==Le||ae!==5&&ae!==27&&ae!==6)&&(ue=null)):(M=null,ue=j),M!==ue)){if(ae=Mh,K="onMouseLeave",C="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ae=zh,K="onPointerLeave",C="onPointerEnter",$="pointer"),Le=M==null?D:pa(M),T=ue==null?D:pa(ue),D=new ae(K,$+"leave",M,s,q),D.target=Le,D.relatedTarget=T,K=null,sr(q)===j&&(ae=new ae(C,$+"enter",ue,s,q),ae.target=T,ae.relatedTarget=Le,K=ae),Le=K,M&&ue)t:{for(ae=M,C=ue,$=0,T=ae;T;T=qr(T))$++;for(T=0,K=C;K;K=qr(K))T++;for(;0<$-T;)ae=qr(ae),$--;for(;0<T-$;)C=qr(C),T--;for(;$--;){if(ae===C||C!==null&&ae===C.alternate)break t;ae=qr(ae),C=qr(C)}ae=null}else ae=null;M!==null&&Rg(H,D,M,ae,!1),ue!==null&&Le!==null&&Rg(H,Le,ue,ae,!0)}}e:{if(D=j?pa(j):window,M=D.nodeName&&D.nodeName.toLowerCase(),M==="select"||M==="input"&&D.type==="file")var P=Gh;else if(Vh(D))if(Jh)P=K1;else{P=_1;var ye=B1}else M=D.nodeName,!M||M.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?j&&du(j.elementType)&&(P=Gh):P=q1;if(P&&(P=P(e,j))){Hh(H,P,s,q);break e}ye&&ye(e,D,j),e==="focusout"&&j&&D.type==="number"&&j.memoizedProps.value!=null&&fu(D,"number",D.value)}switch(ye=j?pa(j):window,e){case"focusin":(Vh(ye)||ye.contentEditable==="true")&&(gr=ye,Eu=j,Na=null);break;case"focusout":Na=Eu=gr=null;break;case"mousedown":Au=!0;break;case"contextmenu":case"mouseup":case"dragend":Au=!1,Wh(H,s,q);break;case"selectionchange":if(H1)break;case"keydown":case"keyup":Wh(H,s,q)}var te;if(wu)e:{switch(e){case"compositionstart":var se="onCompositionStart";break e;case"compositionend":se="onCompositionEnd";break e;case"compositionupdate":se="onCompositionUpdate";break e}se=void 0}else mr?qh(e,s)&&(se="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(se="onCompositionStart");se&&(Uh&&s.locale!=="ko"&&(mr||se!=="onCompositionStart"?se==="onCompositionEnd"&&mr&&(te=jh()):(Wn=q,yu="value"in Wn?Wn.value:Wn.textContent,mr=!0)),ye=Kl(j,se),0<ye.length&&(se=new Lh(se,e,null,s,q),H.push({event:se,listeners:ye}),te?se.data=te:(te=Kh(s),te!==null&&(se.data=te)))),(te=D1?M1(e,s):L1(e,s))&&(se=Kl(j,"onBeforeInput"),0<se.length&&(ye=new Lh("onBeforeInput","beforeinput",null,s,q),H.push({event:ye,listeners:se}),ye.data=te)),Rw(H,e,j,s,q)}Ng(H,r)})}function Xa(e,r,s){return{instance:e,listener:r,currentTarget:s}}function Kl(e,r){for(var s=r+"Capture",o=[];e!==null;){var c=e,h=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||h===null||(c=ma(e,s),c!=null&&o.unshift(Xa(e,c,h)),c=ma(e,r),c!=null&&o.push(Xa(e,c,h))),e.tag===3)return o;e=e.return}return[]}function qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rg(e,r,s,o,c){for(var h=r._reactName,y=[];s!==null&&s!==o;){var x=s,k=x.alternate,j=x.stateNode;if(x=x.tag,k!==null&&k===o)break;x!==5&&x!==26&&x!==27||j===null||(k=j,c?(j=ma(s,h),j!=null&&y.unshift(Xa(s,j,k))):c||(j=ma(s,h),j!=null&&y.push(Xa(s,j,k)))),s=s.return}y.length!==0&&e.push({event:r,listeners:y})}var Cw=/\r\n?/g,Tw=/\u0000|\uFFFD/g;function Eg(e){return(typeof e=="string"?e:""+e).replace(Cw,`
59
- `).replace(Tw,"")}function Ag(e,r){return r=Eg(r),Eg(e)===r}function Vl(){}function Me(e,r,s,o,c,h){switch(s){case"children":typeof o=="string"?r==="body"||r==="textarea"&&o===""||dr(e,o):(typeof o=="number"||typeof o=="bigint")&&r!=="body"&&dr(e,""+o);break;case"className":Is(e,"class",o);break;case"tabIndex":Is(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Is(e,s,o);break;case"style":Ch(e,o,h);break;case"data":if(r!=="object"){Is(e,"data",o);break}case"src":case"href":if(o===""&&(r!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=Fs(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(s==="formAction"?(r!=="input"&&Me(e,r,"name",c.name,c,null),Me(e,r,"formEncType",c.formEncType,c,null),Me(e,r,"formMethod",c.formMethod,c,null),Me(e,r,"formTarget",c.formTarget,c,null)):(Me(e,r,"encType",c.encType,c,null),Me(e,r,"method",c.method,c,null),Me(e,r,"target",c.target,c,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=Fs(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Vl);break;case"onScroll":o!=null&&be("scroll",e);break;case"onScrollEnd":o!=null&&be("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=Fs(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":be("beforetoggle",e),be("toggle",e),Ys(e,"popover",o);break;case"xlinkActuate":Rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Rn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Rn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Rn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Rn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ys(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=s1.get(s)||s,Ys(e,s,o))}}function Fc(e,r,s,o,c,h){switch(s){case"style":Ch(e,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(c.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"children":typeof o=="string"?dr(e,o):(typeof o=="number"||typeof o=="bigint")&&dr(e,""+o);break;case"onScroll":o!=null&&be("scroll",e);break;case"onScrollEnd":o!=null&&be("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Vl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vh.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),r=s.slice(2,c?s.length-7:void 0),h=e[Tt]||null,h=h!=null?h[s]:null,typeof h=="function"&&e.removeEventListener(r,h,c),typeof o=="function")){typeof h!="function"&&h!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(r,o,c);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):Ys(e,s,o)}}}function vt(e,r,s){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":be("error",e),be("load",e);var o=!1,c=!1,h;for(h in s)if(s.hasOwnProperty(h)){var y=s[h];if(y!=null)switch(h){case"src":o=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Me(e,r,h,y,s,null)}}c&&Me(e,r,"srcSet",s.srcSet,s,null),o&&Me(e,r,"src",s.src,s,null);return;case"input":be("invalid",e);var x=h=y=c=null,k=null,j=null;for(o in s)if(s.hasOwnProperty(o)){var q=s[o];if(q!=null)switch(o){case"name":c=q;break;case"type":y=q;break;case"checked":k=q;break;case"defaultChecked":j=q;break;case"value":h=q;break;case"defaultValue":x=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,r));break;default:Me(e,r,o,q,s,null)}}Rh(e,h,x,k,j,y,c,!1),Zs(e);return;case"select":be("invalid",e),o=y=h=null;for(c in s)if(s.hasOwnProperty(c)&&(x=s[c],x!=null))switch(c){case"value":h=x;break;case"defaultValue":y=x;break;case"multiple":o=x;default:Me(e,r,c,x,s,null)}r=h,s=y,e.multiple=!!o,r!=null?fr(e,!!o,r,!1):s!=null&&fr(e,!!o,s,!0);return;case"textarea":be("invalid",e),h=c=o=null;for(y in s)if(s.hasOwnProperty(y)&&(x=s[y],x!=null))switch(y){case"value":o=x;break;case"defaultValue":c=x;break;case"children":h=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(a(91));break;default:Me(e,r,y,x,s,null)}Ah(e,o,c,h),Zs(e);return;case"option":for(k in s)if(s.hasOwnProperty(k)&&(o=s[k],o!=null))switch(k){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Me(e,r,k,o,s,null)}return;case"dialog":be("beforetoggle",e),be("toggle",e),be("cancel",e),be("close",e);break;case"iframe":case"object":be("load",e);break;case"video":case"audio":for(o=0;o<Fa.length;o++)be(Fa[o],e);break;case"image":be("error",e),be("load",e);break;case"details":be("toggle",e);break;case"embed":case"source":case"link":be("error",e),be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(j in s)if(s.hasOwnProperty(j)&&(o=s[j],o!=null))switch(j){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Me(e,r,j,o,s,null)}return;default:if(du(r)){for(q in s)s.hasOwnProperty(q)&&(o=s[q],o!==void 0&&Fc(e,r,q,o,s,void 0));return}}for(x in s)s.hasOwnProperty(x)&&(o=s[x],o!=null&&Me(e,r,x,o,s,null))}function Ow(e,r,s,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,h=null,y=null,x=null,k=null,j=null,q=null;for(M in s){var H=s[M];if(s.hasOwnProperty(M)&&H!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":k=H;default:o.hasOwnProperty(M)||Me(e,r,M,null,o,H)}}for(var D in o){var M=o[D];if(H=s[D],o.hasOwnProperty(D)&&(M!=null||H!=null))switch(D){case"type":h=M;break;case"name":c=M;break;case"checked":j=M;break;case"defaultChecked":q=M;break;case"value":y=M;break;case"defaultValue":x=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(137,r));break;default:M!==H&&Me(e,r,D,M,o,H)}}cu(e,y,x,k,j,q,h,c);return;case"select":M=y=x=D=null;for(h in s)if(k=s[h],s.hasOwnProperty(h)&&k!=null)switch(h){case"value":break;case"multiple":M=k;default:o.hasOwnProperty(h)||Me(e,r,h,null,o,k)}for(c in o)if(h=o[c],k=s[c],o.hasOwnProperty(c)&&(h!=null||k!=null))switch(c){case"value":D=h;break;case"defaultValue":x=h;break;case"multiple":y=h;default:h!==k&&Me(e,r,c,h,o,k)}r=x,s=y,o=M,D!=null?fr(e,!!s,D,!1):!!o!=!!s&&(r!=null?fr(e,!!s,r,!0):fr(e,!!s,s?[]:"",!1));return;case"textarea":M=D=null;for(x in s)if(c=s[x],s.hasOwnProperty(x)&&c!=null&&!o.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:Me(e,r,x,null,o,c)}for(y in o)if(c=o[y],h=s[y],o.hasOwnProperty(y)&&(c!=null||h!=null))switch(y){case"value":D=c;break;case"defaultValue":M=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(a(91));break;default:c!==h&&Me(e,r,y,c,o,h)}Eh(e,D,M);return;case"option":for(var ue in s)if(D=s[ue],s.hasOwnProperty(ue)&&D!=null&&!o.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Me(e,r,ue,null,o,D)}for(k in o)if(D=o[k],M=s[k],o.hasOwnProperty(k)&&D!==M&&(D!=null||M!=null))switch(k){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Me(e,r,k,D,o,M)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ae in s)D=s[ae],s.hasOwnProperty(ae)&&D!=null&&!o.hasOwnProperty(ae)&&Me(e,r,ae,null,o,D);for(j in o)if(D=o[j],M=s[j],o.hasOwnProperty(j)&&D!==M&&(D!=null||M!=null))switch(j){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(a(137,r));break;default:Me(e,r,j,D,o,M)}return;default:if(du(r)){for(var Le in s)D=s[Le],s.hasOwnProperty(Le)&&D!==void 0&&!o.hasOwnProperty(Le)&&Fc(e,r,Le,void 0,o,D);for(q in o)D=o[q],M=s[q],!o.hasOwnProperty(q)||D===M||D===void 0&&M===void 0||Fc(e,r,q,D,o,M);return}}for(var C in s)D=s[C],s.hasOwnProperty(C)&&D!=null&&!o.hasOwnProperty(C)&&Me(e,r,C,null,o,D);for(H in o)D=o[H],M=s[H],!o.hasOwnProperty(H)||D===M||D==null&&M==null||Me(e,r,H,D,o,M)}var Xc=null,Pc=null;function Hl(e){return e.nodeType===9?e:e.ownerDocument}function $g(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cg(e,r){if(e===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&r==="foreignObject"?0:e}function Wc(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ef=null;function jw(){var e=window.event;return e&&e.type==="popstate"?e===ef?!1:(ef=e,!0):(ef=null,!1)}var Tg=typeof setTimeout=="function"?setTimeout:void 0,Dw=typeof clearTimeout=="function"?clearTimeout:void 0,Og=typeof Promise=="function"?Promise:void 0,Mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Og<"u"?function(e){return Og.resolve(null).then(e).catch(Lw)}:Tg;function Lw(e){setTimeout(function(){throw e})}function mi(e){return e==="head"}function jg(e,r){var s=r,o=0,c=0;do{var h=s.nextSibling;if(e.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"){if(0<o&&8>o){s=o;var y=e.ownerDocument;if(s&1&&Pa(y.documentElement),s&2&&Pa(y.body),s&4)for(s=y.head,Pa(s),y=s.firstChild;y;){var x=y.nextSibling,k=y.nodeName;y[ha]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=x}}if(c===0){e.removeChild(h),ss(r);return}c--}else s==="$"||s==="$?"||s==="$!"?c++:o=s.charCodeAt(0)-48;else o=0;s=h}while(s);ss(r)}function tf(e){var r=e.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var s=r;switch(r=r.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":tf(s),su(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function zw(e,r,s,o){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==r.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ha])switch(r){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(r==="input"&&e.type==="hidden"){var h=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=cn(e.nextSibling),e===null)break}return null}function Uw(e,r,s){if(r==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=cn(e.nextSibling),e===null))return null;return e}function nf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Bw(e,r){var s=e.ownerDocument;if(e.data!=="$?"||s.readyState==="complete")r();else{var o=function(){r(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function cn(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return e}var rf=null;function Dg(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(r===0)return e;r--}else s==="/$"&&r++}e=e.previousSibling}return null}function Mg(e,r,s){switch(r=Hl(s),e){case"html":if(e=r.documentElement,!e)throw Error(a(452));return e;case"head":if(e=r.head,!e)throw Error(a(453));return e;case"body":if(e=r.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Pa(e){for(var r=e.attributes;r.length;)e.removeAttributeNode(r[0]);su(e)}var rn=new Map,Lg=new Set;function Gl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _n=Y.d;Y.d={f:_w,r:qw,D:Kw,C:Vw,L:Hw,m:Gw,X:Yw,S:Jw,M:Iw};function _w(){var e=_n.f(),r=Ll();return e||r}function qw(e){var r=lr(e);r!==null&&r.tag===5&&r.type==="form"?tm(r):_n.r(e)}var Kr=typeof document>"u"?null:document;function zg(e,r,s){var o=Kr;if(o&&typeof r=="string"&&r){var c=Ft(r);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),Lg.has(c)||(Lg.add(c),e={rel:e,crossOrigin:s,href:r},o.querySelector(c)===null&&(r=o.createElement("link"),vt(r,"link",e),ct(r),o.head.appendChild(r)))}}function Kw(e){_n.D(e),zg("dns-prefetch",e,null)}function Vw(e,r){_n.C(e,r),zg("preconnect",e,r)}function Hw(e,r,s){_n.L(e,r,s);var o=Kr;if(o&&e&&r){var c='link[rel="preload"][as="'+Ft(r)+'"]';r==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+Ft(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+Ft(s.imageSizes)+'"]')):c+='[href="'+Ft(e)+'"]';var h=c;switch(r){case"style":h=Vr(e);break;case"script":h=Hr(e)}rn.has(h)||(e=g({rel:"preload",href:r==="image"&&s&&s.imageSrcSet?void 0:e,as:r},s),rn.set(h,e),o.querySelector(c)!==null||r==="style"&&o.querySelector(Wa(h))||r==="script"&&o.querySelector(es(h))||(r=o.createElement("link"),vt(r,"link",e),ct(r),o.head.appendChild(r)))}}function Gw(e,r){_n.m(e,r);var s=Kr;if(s&&e){var o=r&&typeof r.as=="string"?r.as:"script",c='link[rel="modulepreload"][as="'+Ft(o)+'"][href="'+Ft(e)+'"]',h=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Hr(e)}if(!rn.has(h)&&(e=g({rel:"modulepreload",href:e},r),rn.set(h,e),s.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(es(h)))return}o=s.createElement("link"),vt(o,"link",e),ct(o),s.head.appendChild(o)}}}function Jw(e,r,s){_n.S(e,r,s);var o=Kr;if(o&&e){var c=or(o).hoistableStyles,h=Vr(e);r=r||"default";var y=c.get(h);if(!y){var x={loading:0,preload:null};if(y=o.querySelector(Wa(h)))x.loading=5;else{e=g({rel:"stylesheet",href:e,"data-precedence":r},s),(s=rn.get(h))&&af(e,s);var k=y=o.createElement("link");ct(k),vt(k,"link",e),k._p=new Promise(function(j,q){k.onload=j,k.onerror=q}),k.addEventListener("load",function(){x.loading|=1}),k.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Jl(y,r,o)}y={type:"stylesheet",instance:y,count:1,state:x},c.set(h,y)}}}function Yw(e,r){_n.X(e,r);var s=Kr;if(s&&e){var o=or(s).hoistableScripts,c=Hr(e),h=o.get(c);h||(h=s.querySelector(es(c)),h||(e=g({src:e,async:!0},r),(r=rn.get(c))&&sf(e,r),h=s.createElement("script"),ct(h),vt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(c,h))}}function Iw(e,r){_n.M(e,r);var s=Kr;if(s&&e){var o=or(s).hoistableScripts,c=Hr(e),h=o.get(c);h||(h=s.querySelector(es(c)),h||(e=g({src:e,async:!0,type:"module"},r),(r=rn.get(c))&&sf(e,r),h=s.createElement("script"),ct(h),vt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(c,h))}}function Ug(e,r,s,o){var c=(c=he.current)?Gl(c):null;if(!c)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(r=Vr(s.href),s=or(c).hoistableStyles,o=s.get(r),o||(o={type:"style",instance:null,count:0,state:null},s.set(r,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Vr(s.href);var h=or(c).hoistableStyles,y=h.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,y),(h=c.querySelector(Wa(e)))&&!h._p&&(y.instance=h,y.state.loading=5),rn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},rn.set(e,s),h||Zw(c,e,s,y.state))),r&&o===null)throw Error(a(528,""));return y}if(r&&o!==null)throw Error(a(529,""));return null;case"script":return r=s.async,s=s.src,typeof s=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Hr(s),s=or(c).hoistableScripts,o=s.get(r),o||(o={type:"script",instance:null,count:0,state:null},s.set(r,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Vr(e){return'href="'+Ft(e)+'"'}function Wa(e){return'link[rel="stylesheet"]['+e+"]"}function Bg(e){return g({},e,{"data-precedence":e.precedence,precedence:null})}function Zw(e,r,s,o){e.querySelector('link[rel="preload"][as="style"]['+r+"]")?o.loading=1:(r=e.createElement("link"),o.preload=r,r.addEventListener("load",function(){return o.loading|=1}),r.addEventListener("error",function(){return o.loading|=2}),vt(r,"link",s),ct(r),e.head.appendChild(r))}function Hr(e){return'[src="'+Ft(e)+'"]'}function es(e){return"script[async]"+e}function _g(e,r,s){if(r.count++,r.instance===null)switch(r.type){case"style":var o=e.querySelector('style[data-href~="'+Ft(s.href)+'"]');if(o)return r.instance=o,ct(o),o;var c=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),ct(o),vt(o,"style",c),Jl(o,s.precedence,e),r.instance=o;case"stylesheet":c=Vr(s.href);var h=e.querySelector(Wa(c));if(h)return r.state.loading|=4,r.instance=h,ct(h),h;o=Bg(s),(c=rn.get(c))&&af(o,c),h=(e.ownerDocument||e).createElement("link"),ct(h);var y=h;return y._p=new Promise(function(x,k){y.onload=x,y.onerror=k}),vt(h,"link",o),r.state.loading|=4,Jl(h,s.precedence,e),r.instance=h;case"script":return h=Hr(s.src),(c=e.querySelector(es(h)))?(r.instance=c,ct(c),c):(o=s,(c=rn.get(h))&&(o=g({},s),sf(o,c)),e=e.ownerDocument||e,c=e.createElement("script"),ct(c),vt(c,"link",o),e.head.appendChild(c),r.instance=c);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(o=r.instance,r.state.loading|=4,Jl(o,s.precedence,e));return r.instance}function Jl(e,r,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,h=c,y=0;y<o.length;y++){var x=o[y];if(x.dataset.precedence===r)h=x;else if(h!==c)break}h?h.parentNode.insertBefore(e,h.nextSibling):(r=s.nodeType===9?s.head:s,r.insertBefore(e,r.firstChild))}function af(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.title==null&&(e.title=r.title)}function sf(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.integrity==null&&(e.integrity=r.integrity)}var Yl=null;function qg(e,r,s){if(Yl===null){var o=new Map,c=Yl=new Map;c.set(s,o)}else c=Yl,o=c.get(s),o||(o=new Map,c.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var h=s[c];if(!(h[ha]||h[xt]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var y=h.getAttribute(r)||"";y=e+y;var x=o.get(y);x?x.push(h):o.set(y,[h])}}return o}function Kg(e,r,s){e=e.ownerDocument||e,e.head.insertBefore(s,r==="title"?e.querySelector("head > title"):null)}function Qw(e,r,s){if(s===1||r.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return e=r.disabled,typeof r.precedence=="string"&&e==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Vg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var ts=null;function Fw(){}function Xw(e,r,s){if(ts===null)throw Error(a(475));var o=ts;if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Vr(s.href),h=e.querySelector(Wa(c));if(h){e=h._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(o.count++,o=Il.bind(o),e.then(o,o)),r.state.loading|=4,r.instance=h,ct(h);return}h=e.ownerDocument||e,s=Bg(s),(c=rn.get(c))&&af(s,c),h=h.createElement("link"),ct(h);var y=h;y._p=new Promise(function(x,k){y.onload=x,y.onerror=k}),vt(h,"link",s),r.instance=h}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(r,e),(e=r.state.preload)&&(r.state.loading&3)===0&&(o.count++,r=Il.bind(o),e.addEventListener("load",r),e.addEventListener("error",r))}}function Pw(){if(ts===null)throw Error(a(475));var e=ts;return e.stylesheets&&e.count===0&&lf(e,e.stylesheets),0<e.count?function(r){var s=setTimeout(function(){if(e.stylesheets&&lf(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s)}}:null}function Il(){if(this.count--,this.count===0){if(this.stylesheets)lf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zl=null;function lf(e,r){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zl=new Map,r.forEach(Ww,e),Zl=null,Il.call(e))}function Ww(e,r){if(!(r.state.loading&4)){var s=Zl.get(e);if(s)var o=s.get(null);else{s=new Map,Zl.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<c.length;h++){var y=c[h];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),o=y)}o&&s.set(null,o)}c=r.instance,y=c.getAttribute("data-precedence"),h=s.get(y)||o,h===o&&s.set(null,c),s.set(y,c),this.count++,o=Il.bind(this),c.addEventListener("load",o),c.addEventListener("error",o),h?h.parentNode.insertBefore(c,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),r.state.loading|=4}}var ns={$$typeof:G,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function eN(e,r,s,o,c,h,y,x){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nu(0),this.hiddenUpdates=nu(null),this.identifierPrefix=o,this.onUncaughtError=c,this.onCaughtError=h,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function Hg(e,r,s,o,c,h,y,x,k,j,q,H){return e=new eN(e,r,s,y,x,k,j,H),r=1,h===!0&&(r|=24),h=Kt(3,null,null,r),e.current=h,h.stateNode=e,r=Ku(),r.refCount++,e.pooledCache=r,r.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:r},Ju(h),e}function Gg(e){return e?(e=xr,e):xr}function Jg(e,r,s,o,c,h){c=Gg(c),o.context===null?o.context=c:o.pendingContext=c,o=ni(r),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=ii(e,o,r),s!==null&&(Yt(s,e,r),ja(s,e,r))}function Yg(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<r?s:r}}function of(e,r){Yg(e,r),(e=e.alternate)&&Yg(e,r)}function Ig(e){if(e.tag===13){var r=br(e,67108864);r!==null&&Yt(r,e,67108864),of(e,67108864)}}var Ql=!0;function tN(e,r,s,o){var c=B.T;B.T=null;var h=Y.p;try{Y.p=2,uf(e,r,s,o)}finally{Y.p=h,B.T=c}}function nN(e,r,s,o){var c=B.T;B.T=null;var h=Y.p;try{Y.p=8,uf(e,r,s,o)}finally{Y.p=h,B.T=c}}function uf(e,r,s,o){if(Ql){var c=cf(o);if(c===null)Qc(e,r,o,Fl,s),Qg(e,o);else if(rN(c,e,r,s,o))o.stopPropagation();else if(Qg(e,o),r&4&&-1<iN.indexOf(e)){for(;c!==null;){var h=lr(c);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var y=$i(h.pendingLanes);if(y!==0){var x=h;for(x.pendingLanes|=2,x.entangledLanes|=2;y;){var k=1<<31-_t(y);x.entanglements[1]|=k,y&=~k}xn(h),(Ce&6)===0&&(Dl=mn()+500,Qa(0))}}break;case 13:x=br(h,2),x!==null&&Yt(x,h,2),Ll(),of(h,2)}if(h=cf(o),h===null&&Qc(e,r,o,Fl,s),h===c)break;c=h}c!==null&&o.stopPropagation()}else Qc(e,r,o,null,s)}}function cf(e){return e=pu(e),ff(e)}var Fl=null;function ff(e){if(Fl=null,e=sr(e),e!==null){var r=u(e);if(r===null)e=null;else{var s=r.tag;if(s===13){if(e=f(r),e!==null)return e;e=null}else if(s===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null)}}return Fl=e,null}function Zg(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(VS()){case oh:return 2;case uh:return 8;case Vs:case HS:return 32;case ch:return 268435456;default:return 32}default:return 32}}var df=!1,gi=null,yi=null,vi=null,is=new Map,rs=new Map,bi=[],iN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Qg(e,r){switch(e){case"focusin":case"focusout":gi=null;break;case"dragenter":case"dragleave":yi=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":is.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":rs.delete(r.pointerId)}}function as(e,r,s,o,c,h){return e===null||e.nativeEvent!==h?(e={blockedOn:r,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[c]},r!==null&&(r=lr(r),r!==null&&Ig(r)),e):(e.eventSystemFlags|=o,r=e.targetContainers,c!==null&&r.indexOf(c)===-1&&r.push(c),e)}function rN(e,r,s,o,c){switch(r){case"focusin":return gi=as(gi,e,r,s,o,c),!0;case"dragenter":return yi=as(yi,e,r,s,o,c),!0;case"mouseover":return vi=as(vi,e,r,s,o,c),!0;case"pointerover":var h=c.pointerId;return is.set(h,as(is.get(h)||null,e,r,s,o,c)),!0;case"gotpointercapture":return h=c.pointerId,rs.set(h,as(rs.get(h)||null,e,r,s,o,c)),!0}return!1}function Fg(e){var r=sr(e.target);if(r!==null){var s=u(r);if(s!==null){if(r=s.tag,r===13){if(r=f(s),r!==null){e.blockedOn=r,XS(e.priority,function(){if(s.tag===13){var o=Jt();o=iu(o);var c=br(s,o);c!==null&&Yt(c,s,o),of(s,o)}});return}}else if(r===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xl(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var s=cf(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);hu=o,s.target.dispatchEvent(o),hu=null}else return r=lr(s),r!==null&&Ig(r),e.blockedOn=s,!1;r.shift()}return!0}function Xg(e,r,s){Xl(e)&&s.delete(r)}function aN(){df=!1,gi!==null&&Xl(gi)&&(gi=null),yi!==null&&Xl(yi)&&(yi=null),vi!==null&&Xl(vi)&&(vi=null),is.forEach(Xg),rs.forEach(Xg)}function Pl(e,r){e.blockedOn===r&&(e.blockedOn=null,df||(df=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,aN)))}var Wl=null;function Pg(e){Wl!==e&&(Wl=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wl===e&&(Wl=null);for(var r=0;r<e.length;r+=3){var s=e[r],o=e[r+1],c=e[r+2];if(typeof o!="function"){if(ff(o||s)===null)continue;break}var h=lr(s);h!==null&&(e.splice(r,3),r-=3,cc(h,{pending:!0,data:c,method:s.method,action:o},o,c))}}))}function ss(e){function r(k){return Pl(k,e)}gi!==null&&Pl(gi,e),yi!==null&&Pl(yi,e),vi!==null&&Pl(vi,e),is.forEach(r),rs.forEach(r);for(var s=0;s<bi.length;s++){var o=bi[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<bi.length&&(s=bi[0],s.blockedOn===null);)Fg(s),s.blockedOn===null&&bi.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var c=s[o],h=s[o+1],y=c[Tt]||null;if(typeof h=="function")y||Pg(s);else if(y){var x=null;if(h&&h.hasAttribute("formAction")){if(c=h,y=h[Tt]||null)x=y.formAction;else if(ff(c)!==null)continue}else x=y.action;typeof x=="function"?s[o+1]=x:(s.splice(o,3),o-=3),Pg(s)}}}function hf(e){this._internalRoot=e}eo.prototype.render=hf.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(a(409));var s=r.current,o=Jt();Jg(s,o,e,r,null,null)},eo.prototype.unmount=hf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;Jg(e.current,2,null,e,null,null),Ll(),r[ar]=null}};function eo(e){this._internalRoot=e}eo.prototype.unstable_scheduleHydration=function(e){if(e){var r=mh();e={blockedOn:null,target:e,priority:r};for(var s=0;s<bi.length&&r!==0&&r<bi[s].priority;s++);bi.splice(s,0,e),s===0&&Fg(e)}};var Wg=n.version;if(Wg!=="19.1.0")throw Error(a(527,Wg,"19.1.0"));Y.findDOMNode=function(e){var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(r),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var sN={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var to=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!to.isDisabled&&to.supportsFiber)try{ca=to.inject(sN),Bt=to}catch{}}return us.createRoot=function(e,r){if(!l(e))throw Error(a(299));var s=!1,o="",c=mm,h=gm,y=ym,x=null;return r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onUncaughtError!==void 0&&(c=r.onUncaughtError),r.onCaughtError!==void 0&&(h=r.onCaughtError),r.onRecoverableError!==void 0&&(y=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(x=r.unstable_transitionCallbacks)),r=Hg(e,1,!1,null,null,s,o,c,h,y,x,null),e[ar]=r.current,Zc(e),new hf(r)},us.hydrateRoot=function(e,r,s){if(!l(e))throw Error(a(299));var o=!1,c="",h=mm,y=gm,x=ym,k=null,j=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(k=s.unstable_transitionCallbacks),s.formState!==void 0&&(j=s.formState)),r=Hg(e,1,!0,r,s??null,o,c,h,y,x,k,j),r.context=Gg(null),s=r.current,o=Jt(),o=iu(o),c=ni(o),c.callback=null,ii(s,c,o),s=o,r.current.lanes=s,da(r,s),xn(r),e[ar]=r.current,Zc(e),new eo(r)},us.version="19.1.0",us}var Ry;function vE(){if(Ry)return yf.exports;Ry=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),yf.exports=yE(),yf.exports}var bE=vE();const xE=Zv(bE),eb=A.createContext(void 0);eb.Provider;function tb(t,n){const i=A.useContext(eb),a=A.useRef(void 0);A.useEffect(()=>{let l,u;a.current?u=a.current.then(f):u=f(),a.current=u;function f(){return t().then(d=>(l=d??(()=>{}),d),i?d=>i.error(d):void 0)}return()=>{if(l){const d=l();i&&(d==null||d.catch(m=>i.error(m)))}else{const d=u.then(m=>m==null?void 0:m());i&&d.catch(m=>i.error(m))}}},n)}var cs={},Ey;function SE(){if(Ey)return cs;Ey=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.parse=f,cs.serialize=p;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,n=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,l=Object.prototype.toString,u=(()=>{const b=function(){};return b.prototype=Object.create(null),b})();function f(b,R){const N=new u,O=b.length;if(O<2)return N;const U=(R==null?void 0:R.decode)||g;let z=0;do{const L=b.indexOf("=",z);if(L===-1)break;const G=b.indexOf(";",z),X=G===-1?O:G;if(L>X){z=b.lastIndexOf(";",L-1)+1;continue}const F=d(b,z,L),pe=m(b,L,F),fe=b.slice(F,pe);if(N[fe]===void 0){let re=d(b,L+1,X),ee=m(b,X,re);const oe=U(b.slice(re,ee));N[fe]=oe}z=X+1}while(z<O);return N}function d(b,R,N){do{const O=b.charCodeAt(R);if(O!==32&&O!==9)return R}while(++R<N);return N}function m(b,R,N){for(;R>N;){const O=b.charCodeAt(--R);if(O!==32&&O!==9)return R+1}return N}function p(b,R,N){const O=(N==null?void 0:N.encode)||encodeURIComponent;if(!t.test(b))throw new TypeError(`argument name is invalid: ${b}`);const U=O(R);if(!n.test(U))throw new TypeError(`argument val is invalid: ${R}`);let z=b+"="+U;if(!N)return z;if(N.maxAge!==void 0){if(!Number.isInteger(N.maxAge))throw new TypeError(`option maxAge is invalid: ${N.maxAge}`);z+="; Max-Age="+N.maxAge}if(N.domain){if(!i.test(N.domain))throw new TypeError(`option domain is invalid: ${N.domain}`);z+="; Domain="+N.domain}if(N.path){if(!a.test(N.path))throw new TypeError(`option path is invalid: ${N.path}`);z+="; Path="+N.path}if(N.expires){if(!v(N.expires)||!Number.isFinite(N.expires.valueOf()))throw new TypeError(`option expires is invalid: ${N.expires}`);z+="; Expires="+N.expires.toUTCString()}if(N.httpOnly&&(z+="; HttpOnly"),N.secure&&(z+="; Secure"),N.partitioned&&(z+="; Partitioned"),N.priority)switch(typeof N.priority=="string"?N.priority.toLowerCase():void 0){case"low":z+="; Priority=Low";break;case"medium":z+="; Priority=Medium";break;case"high":z+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${N.priority}`)}if(N.sameSite)switch(typeof N.sameSite=="string"?N.sameSite.toLowerCase():N.sameSite){case!0:case"strict":z+="; SameSite=Strict";break;case"lax":z+="; SameSite=Lax";break;case"none":z+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${N.sameSite}`)}return z}function g(b){if(b.indexOf("%")===-1)return b;try{return decodeURIComponent(b)}catch{return b}}function v(b){return l.call(b)==="[object Date]"}return cs}SE();var Ay="popstate";function wE(t={}){function n(l,u){let{pathname:f="/",search:d="",hash:m=""}=Wi(l.location.hash.substring(1));return!f.startsWith("/")&&!f.startsWith(".")&&(f="/"+f),Vf("",{pathname:f,search:d,hash:m},u.state&&u.state.usr||null,u.state&&u.state.key||"default")}function i(l,u){let f=l.document.querySelector("base"),d="";if(f&&f.getAttribute("href")){let m=l.location.href,p=m.indexOf("#");d=p===-1?m:m.slice(0,p)}return d+"#"+(typeof u=="string"?u:Ss(u))}function a(l,u){sn(l.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(u)})`)}return kE(n,i,a,t)}function Ye(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function sn(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function NE(){return Math.random().toString(36).substring(2,10)}function $y(t,n){return{usr:t.state,key:t.key,idx:n}}function Vf(t,n,i=null,a){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?Wi(n):n,state:i,key:n&&n.key||a||NE()}}function Ss({pathname:t="/",search:n="",hash:i=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(t+=i.charAt(0)==="#"?i:"#"+i),t}function Wi(t){let n={};if(t){let i=t.indexOf("#");i>=0&&(n.hash=t.substring(i),t=t.substring(0,i));let a=t.indexOf("?");a>=0&&(n.search=t.substring(a),t=t.substring(0,a)),t&&(n.pathname=t)}return n}function kE(t,n,i,a={}){let{window:l=document.defaultView,v5Compat:u=!1}=a,f=l.history,d="POP",m=null,p=g();p==null&&(p=0,f.replaceState({...f.state,idx:p},""));function g(){return(f.state||{idx:null}).idx}function v(){d="POP";let U=g(),z=U==null?null:U-p;p=U,m&&m({action:d,location:O.location,delta:z})}function b(U,z){d="PUSH";let L=Vf(O.location,U,z);i&&i(L,U),p=g()+1;let G=$y(L,p),X=O.createHref(L);try{f.pushState(G,"",X)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;l.location.assign(X)}u&&m&&m({action:d,location:O.location,delta:1})}function R(U,z){d="REPLACE";let L=Vf(O.location,U,z);i&&i(L,U),p=g();let G=$y(L,p),X=O.createHref(L);f.replaceState(G,"",X),u&&m&&m({action:d,location:O.location,delta:0})}function N(U){return RE(U)}let O={get action(){return d},get location(){return t(l,f)},listen(U){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(Ay,v),m=U,()=>{l.removeEventListener(Ay,v),m=null}},createHref(U){return n(l,U)},createURL:N,encodeLocation(U){let z=N(U);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:b,replace:R,go(U){return f.go(U)}};return O}function RE(t,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ye(i,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:Ss(t);return a=a.replace(/ $/,"%20"),!n&&a.startsWith("//")&&(a=i+a),new URL(a,i)}function nb(t,n,i="/"){return EE(t,n,i,!1)}function EE(t,n,i,a){let l=typeof n=="string"?Wi(n):n,u=Gn(l.pathname||"/",i);if(u==null)return null;let f=ib(t);AE(f);let d=null;for(let m=0;d==null&&m<f.length;++m){let p=BE(u);d=zE(f[m],p,a)}return d}function ib(t,n=[],i=[],a=""){let l=(u,f,d)=>{let m={relativePath:d===void 0?u.path||"":d,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};m.relativePath.startsWith("/")&&(Ye(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length));let p=Hn([a,m.relativePath]),g=i.concat(m);u.children&&u.children.length>0&&(Ye(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),ib(u.children,n,g,p)),!(u.path==null&&!u.index)&&n.push({path:p,score:ME(p,u.index),routesMeta:g})};return t.forEach((u,f)=>{var d;if(u.path===""||!((d=u.path)!=null&&d.includes("?")))l(u,f);else for(let m of rb(u.path))l(u,f,m)}),n}function rb(t){let n=t.split("/");if(n.length===0)return[];let[i,...a]=n,l=i.endsWith("?"),u=i.replace(/\?$/,"");if(a.length===0)return l?[u,""]:[u];let f=rb(a.join("/")),d=[];return d.push(...f.map(m=>m===""?u:[u,m].join("/"))),l&&d.push(...f),d.map(m=>t.startsWith("/")&&m===""?"/":m)}function AE(t){t.sort((n,i)=>n.score!==i.score?i.score-n.score:LE(n.routesMeta.map(a=>a.childrenIndex),i.routesMeta.map(a=>a.childrenIndex)))}var $E=/^:[\w-]+$/,CE=3,TE=2,OE=1,jE=10,DE=-2,Cy=t=>t==="*";function ME(t,n){let i=t.split("/"),a=i.length;return i.some(Cy)&&(a+=DE),n&&(a+=TE),i.filter(l=>!Cy(l)).reduce((l,u)=>l+($E.test(u)?CE:u===""?OE:jE),a)}function LE(t,n){return t.length===n.length&&t.slice(0,-1).every((a,l)=>a===n[l])?t[t.length-1]-n[n.length-1]:0}function zE(t,n,i=!1){let{routesMeta:a}=t,l={},u="/",f=[];for(let d=0;d<a.length;++d){let m=a[d],p=d===a.length-1,g=u==="/"?n:n.slice(u.length)||"/",v=wo({path:m.relativePath,caseSensitive:m.caseSensitive,end:p},g),b=m.route;if(!v&&p&&i&&!a[a.length-1].route.index&&(v=wo({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!v)return null;Object.assign(l,v.params),f.push({params:l,pathname:Hn([u,v.pathname]),pathnameBase:VE(Hn([u,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(u=Hn([u,v.pathnameBase]))}return f}function wo(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[i,a]=UE(t.path,t.caseSensitive,t.end),l=n.match(i);if(!l)return null;let u=l[0],f=u.replace(/(.)\/+$/,"$1"),d=l.slice(1);return{params:a.reduce((p,{paramName:g,isOptional:v},b)=>{if(g==="*"){let N=d[b]||"";f=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const R=d[b];return v&&!R?p[g]=void 0:p[g]=(R||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:f,pattern:t}}function UE(t,n=!1,i=!0){sn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,d,m)=>(a.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),a]}function BE(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return sn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),t}}function Gn(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,a=t.charAt(i);return a&&a!=="/"?null:t.slice(i)||"/"}function _E(t,n="/"){let{pathname:i,search:a="",hash:l=""}=typeof t=="string"?Wi(t):t;return{pathname:i?i.startsWith("/")?i:qE(i,n):n,search:HE(a),hash:GE(l)}}function qE(t,n){let i=n.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?i.length>1&&i.pop():l!=="."&&i.push(l)}),i.length>1?i.join("/"):"/"}function Sf(t,n,i,a){return`Cannot include a '${t}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function KE(t){return t.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function gd(t){let n=KE(t);return n.map((i,a)=>a===n.length-1?i.pathname:i.pathnameBase)}function yd(t,n,i,a=!1){let l;typeof t=="string"?l=Wi(t):(l={...t},Ye(!l.pathname||!l.pathname.includes("?"),Sf("?","pathname","search",l)),Ye(!l.pathname||!l.pathname.includes("#"),Sf("#","pathname","hash",l)),Ye(!l.search||!l.search.includes("#"),Sf("#","search","hash",l)));let u=t===""||l.pathname==="",f=u?"/":l.pathname,d;if(f==null)d=i;else{let v=n.length-1;if(!a&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),v-=1;l.pathname=b.join("/")}d=v>=0?n[v]:"/"}let m=_E(l,d),p=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||g)&&(m.pathname+="/"),m}var Hn=t=>t.join("/").replace(/\/\/+/g,"/"),VE=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),HE=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,GE=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function JE(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var ab=["POST","PUT","PATCH","DELETE"];new Set(ab);var YE=["GET",...ab];new Set(YE);var ia=A.createContext(null);ia.displayName="DataRouter";var Uo=A.createContext(null);Uo.displayName="DataRouterState";var sb=A.createContext({isTransitioning:!1});sb.displayName="ViewTransition";var IE=A.createContext(new Map);IE.displayName="Fetchers";var ZE=A.createContext(null);ZE.displayName="Await";var fn=A.createContext(null);fn.displayName="Navigation";var As=A.createContext(null);As.displayName="Location";var dn=A.createContext({outlet:null,matches:[],isDataRoute:!1});dn.displayName="Route";var vd=A.createContext(null);vd.displayName="RouteError";function QE(t,{relative:n}={}){Ye(ra(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:a}=A.useContext(fn),{hash:l,pathname:u,search:f}=$s(t,{relative:n}),d=u;return i!=="/"&&(d=u==="/"?i:Hn([i,u])),a.createHref({pathname:d,search:f,hash:l})}function ra(){return A.useContext(As)!=null}function Ei(){return Ye(ra(),"useLocation() may be used only in the context of a <Router> component."),A.useContext(As).location}var lb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ob(t){A.useContext(fn).static||A.useLayoutEffect(t)}function aa(){let{isDataRoute:t}=A.useContext(dn);return t?uA():FE()}function FE(){Ye(ra(),"useNavigate() may be used only in the context of a <Router> component.");let t=A.useContext(ia),{basename:n,navigator:i}=A.useContext(fn),{matches:a}=A.useContext(dn),{pathname:l}=Ei(),u=JSON.stringify(gd(a)),f=A.useRef(!1);return ob(()=>{f.current=!0}),A.useCallback((m,p={})=>{if(sn(f.current,lb),!f.current)return;if(typeof m=="number"){i.go(m);return}let g=yd(m,JSON.parse(u),l,p.relative==="path");t==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:Hn([n,g.pathname])),(p.replace?i.replace:i.push)(g,p.state,p)},[n,i,u,l,t])}A.createContext(null);function XE(){let{matches:t}=A.useContext(dn),n=t[t.length-1];return n?n.params:{}}function $s(t,{relative:n}={}){let{matches:i}=A.useContext(dn),{pathname:a}=Ei(),l=JSON.stringify(gd(i));return A.useMemo(()=>yd(t,JSON.parse(l),a,n==="path"),[t,l,a,n])}function PE(t,n){return ub(t,n)}function ub(t,n,i,a){var z;Ye(ra(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=A.useContext(fn),{matches:u}=A.useContext(dn),f=u[u.length-1],d=f?f.params:{},m=f?f.pathname:"/",p=f?f.pathnameBase:"/",g=f&&f.route;{let L=g&&g.path||"";cb(m,!g||L.endsWith("*")||L.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${L}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${L}"> to <Route path="${L==="/"?"*":`${L}/*`}">.`)}let v=Ei(),b;if(n){let L=typeof n=="string"?Wi(n):n;Ye(p==="/"||((z=L.pathname)==null?void 0:z.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${L.pathname}" was given in the \`location\` prop.`),b=L}else b=v;let R=b.pathname||"/",N=R;if(p!=="/"){let L=p.replace(/^\//,"").split("/");N="/"+R.replace(/^\//,"").split("/").slice(L.length).join("/")}let O=nb(t,{pathname:N});sn(g||O!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),sn(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let U=iA(O&&O.map(L=>Object.assign({},L,{params:Object.assign({},d,L.params),pathname:Hn([p,l.encodeLocation?l.encodeLocation(L.pathname).pathname:L.pathname]),pathnameBase:L.pathnameBase==="/"?p:Hn([p,l.encodeLocation?l.encodeLocation(L.pathnameBase).pathname:L.pathnameBase])})),u,i,a);return n&&U?A.createElement(As.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},U):U}function WE(){let t=oA(),n=JE(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),i=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=A.createElement(A.Fragment,null,A.createElement("p",null,"💿 Hey developer 👋"),A.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",A.createElement("code",{style:u},"ErrorBoundary")," or"," ",A.createElement("code",{style:u},"errorElement")," prop on your route.")),A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},n),i?A.createElement("pre",{style:l},i):null,f)}var eA=A.createElement(WE,null),tA=class extends A.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?A.createElement(dn.Provider,{value:this.props.routeContext},A.createElement(vd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function nA({routeContext:t,match:n,children:i}){let a=A.useContext(ia);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),A.createElement(dn.Provider,{value:t},i)}function iA(t,n=[],i=null,a=null){if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let l=t,u=i==null?void 0:i.errors;if(u!=null){let m=l.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);Ye(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let f=!1,d=-1;if(i)for(let m=0;m<l.length;m++){let p=l[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=m),p.route.id){let{loaderData:g,errors:v}=i,b=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||b){f=!0,d>=0?l=l.slice(0,d+1):l=[l[0]];break}}}return l.reduceRight((m,p,g)=>{let v,b=!1,R=null,N=null;i&&(v=u&&p.route.id?u[p.route.id]:void 0,R=p.route.errorElement||eA,f&&(d<0&&g===0?(cb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,N=null):d===g&&(b=!0,N=p.route.hydrateFallbackElement||null)));let O=n.concat(l.slice(0,g+1)),U=()=>{let z;return v?z=R:b?z=N:p.route.Component?z=A.createElement(p.route.Component,null):p.route.element?z=p.route.element:z=m,A.createElement(nA,{match:p,routeContext:{outlet:m,matches:O,isDataRoute:i!=null},children:z})};return i&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?A.createElement(tA,{location:i.location,revalidation:i.revalidation,component:R,error:v,children:U(),routeContext:{outlet:null,matches:O,isDataRoute:!0}}):U()},null)}function bd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rA(t){let n=A.useContext(ia);return Ye(n,bd(t)),n}function aA(t){let n=A.useContext(Uo);return Ye(n,bd(t)),n}function sA(t){let n=A.useContext(dn);return Ye(n,bd(t)),n}function xd(t){let n=sA(t),i=n.matches[n.matches.length-1];return Ye(i.route.id,`${t} can only be used on routes that contain a unique "id"`),i.route.id}function lA(){return xd("useRouteId")}function oA(){var a;let t=A.useContext(vd),n=aA("useRouteError"),i=xd("useRouteError");return t!==void 0?t:(a=n.errors)==null?void 0:a[i]}function uA(){let{router:t}=rA("useNavigate"),n=xd("useNavigate"),i=A.useRef(!1);return ob(()=>{i.current=!0}),A.useCallback(async(l,u={})=>{sn(i.current,lb),i.current&&(typeof l=="number"?t.navigate(l):await t.navigate(l,{fromRouteId:n,...u}))},[t,n])}var Ty={};function cb(t,n,i){!n&&!Ty[t]&&(Ty[t]=!0,sn(!1,i))}A.memo(cA);function cA({routes:t,future:n,state:i}){return ub(t,void 0,i,n)}function fA({to:t,replace:n,state:i,relative:a}){Ye(ra(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=A.useContext(fn);sn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=A.useContext(dn),{pathname:f}=Ei(),d=aa(),m=yd(t,gd(u),f,a==="path"),p=JSON.stringify(m);return A.useEffect(()=>{d(JSON.parse(p),{replace:n,state:i,relative:a})},[d,p,a,n,i]),null}function fo(t){Ye(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dA({basename:t="/",children:n=null,location:i,navigationType:a="POP",navigator:l,static:u=!1}){Ye(!ra(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),d=A.useMemo(()=>({basename:f,navigator:l,static:u,future:{}}),[f,l,u]);typeof i=="string"&&(i=Wi(i));let{pathname:m="/",search:p="",hash:g="",state:v=null,key:b="default"}=i,R=A.useMemo(()=>{let N=Gn(m,f);return N==null?null:{location:{pathname:N,search:p,hash:g,state:v,key:b},navigationType:a}},[f,m,p,g,v,b,a]);return sn(R!=null,`<Router basename="${f}"> is not able to match the URL "${m}${p}${g}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:A.createElement(fn.Provider,{value:d},A.createElement(As.Provider,{children:n,value:R}))}function hA({children:t,location:n}){return PE(Hf(t),n)}function Hf(t,n=[]){let i=[];return A.Children.forEach(t,(a,l)=>{if(!A.isValidElement(a))return;let u=[...n,l];if(a.type===A.Fragment){i.push.apply(i,Hf(a.props.children,u));return}Ye(a.type===fo,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ye(!a.props.index||!a.props.children,"An index route cannot have child routes.");let f={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(f.children=Hf(a.props.children,u)),i.push(f)}),i}var ho="get",po="application/x-www-form-urlencoded";function Bo(t){return t!=null&&typeof t.tagName=="string"}function pA(t){return Bo(t)&&t.tagName.toLowerCase()==="button"}function mA(t){return Bo(t)&&t.tagName.toLowerCase()==="form"}function gA(t){return Bo(t)&&t.tagName.toLowerCase()==="input"}function yA(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function vA(t,n){return t.button===0&&(!n||n==="_self")&&!yA(t)}var io=null;function bA(){if(io===null)try{new FormData(document.createElement("form"),0),io=!1}catch{io=!0}return io}var xA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wf(t){return t!=null&&!xA.has(t)?(sn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${po}"`),null):t}function SA(t,n){let i,a,l,u,f;if(mA(t)){let d=t.getAttribute("action");a=d?Gn(d,n):null,i=t.getAttribute("method")||ho,l=wf(t.getAttribute("enctype"))||po,u=new FormData(t)}else if(pA(t)||gA(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||d.getAttribute("action");if(a=m?Gn(m,n):null,i=t.getAttribute("formmethod")||d.getAttribute("method")||ho,l=wf(t.getAttribute("formenctype"))||wf(d.getAttribute("enctype"))||po,u=new FormData(d,t),!bA()){let{name:p,type:g,value:v}=t;if(g==="image"){let b=p?`${p}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else p&&u.append(p,v)}}else{if(Bo(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=ho,a=null,l=po,f=t}return u&&l==="text/plain"&&(f=u,u=void 0),{action:a,method:i.toLowerCase(),encType:l,formData:u,body:f}}function Sd(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}async function wA(t,n){if(t.id in n)return n[t.id];try{let i=await import(t.module);return n[t.id]=i,i}catch(i){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function NA(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function kA(t,n,i){let a=await Promise.all(t.map(async l=>{let u=n.routes[l.route.id];if(u){let f=await wA(u,i);return f.links?f.links():[]}return[]}));return $A(a.flat(1).filter(NA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Oy(t,n,i,a,l,u){let f=(m,p)=>i[p]?m.route.id!==i[p].route.id:!0,d=(m,p)=>{var g;return i[p].pathname!==m.pathname||((g=i[p].route.path)==null?void 0:g.endsWith("*"))&&i[p].params["*"]!==m.params["*"]};return u==="assets"?n.filter((m,p)=>f(m,p)||d(m,p)):u==="data"?n.filter((m,p)=>{var v;let g=a.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(f(m,p)||d(m,p))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((v=i[0])==null?void 0:v.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function RA(t,n,{includeHydrateFallback:i}={}){return EA(t.map(a=>{let l=n.routes[a.route.id];if(!l)return[];let u=[l.module];return l.clientActionModule&&(u=u.concat(l.clientActionModule)),l.clientLoaderModule&&(u=u.concat(l.clientLoaderModule)),i&&l.hydrateFallbackModule&&(u=u.concat(l.hydrateFallbackModule)),l.imports&&(u=u.concat(l.imports)),u}).flat(1))}function EA(t){return[...new Set(t)]}function AA(t){let n={},i=Object.keys(t).sort();for(let a of i)n[a]=t[a];return n}function $A(t,n){let i=new Set;return new Set(n),t.reduce((a,l)=>{let u=JSON.stringify(AA(l));return i.has(u)||(i.add(u),a.push({key:u,link:l})),a},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var CA=new Set([100,101,204,205]);function TA(t,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i.pathname==="/"?i.pathname="_root.data":n&&Gn(i.pathname,n)==="/"?i.pathname=`${n.replace(/\/$/,"")}/_root.data`:i.pathname=`${i.pathname.replace(/\/$/,"")}.data`,i}function fb(){let t=A.useContext(ia);return Sd(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function OA(){let t=A.useContext(Uo);return Sd(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var wd=A.createContext(void 0);wd.displayName="FrameworkContext";function db(){let t=A.useContext(wd);return Sd(t,"You must render this element inside a <HydratedRouter> element"),t}function jA(t,n){let i=A.useContext(wd),[a,l]=A.useState(!1),[u,f]=A.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:p,onMouseLeave:g,onTouchStart:v}=n,b=A.useRef(null);A.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let O=z=>{z.forEach(L=>{f(L.isIntersecting)})},U=new IntersectionObserver(O,{threshold:.5});return b.current&&U.observe(b.current),()=>{U.disconnect()}}},[t]),A.useEffect(()=>{if(a){let O=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(O)}}},[a]);let R=()=>{l(!0)},N=()=>{l(!1),f(!1)};return i?t!=="intent"?[u,b,{}]:[u,b,{onFocus:fs(d,R),onBlur:fs(m,N),onMouseEnter:fs(p,R),onMouseLeave:fs(g,N),onTouchStart:fs(v,R)}]:[!1,b,{}]}function fs(t,n){return i=>{t&&t(i),i.defaultPrevented||n(i)}}function DA({page:t,...n}){let{router:i}=fb(),a=A.useMemo(()=>nb(i.routes,t,i.basename),[i.routes,t,i.basename]);return a?A.createElement(LA,{page:t,matches:a,...n}):null}function MA(t){let{manifest:n,routeModules:i}=db(),[a,l]=A.useState([]);return A.useEffect(()=>{let u=!1;return kA(t,n,i).then(f=>{u||l(f)}),()=>{u=!0}},[t,n,i]),a}function LA({page:t,matches:n,...i}){let a=Ei(),{manifest:l,routeModules:u}=db(),{basename:f}=fb(),{loaderData:d,matches:m}=OA(),p=A.useMemo(()=>Oy(t,n,m,l,a,"data"),[t,n,m,l,a]),g=A.useMemo(()=>Oy(t,n,m,l,a,"assets"),[t,n,m,l,a]),v=A.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let N=new Set,O=!1;if(n.forEach(z=>{var G;let L=l.routes[z.route.id];!L||!L.hasLoader||(!p.some(X=>X.route.id===z.route.id)&&z.route.id in d&&((G=u[z.route.id])!=null&&G.shouldRevalidate)||L.hasClientLoader?O=!0:N.add(z.route.id))}),N.size===0)return[];let U=TA(t,f);return O&&N.size>0&&U.searchParams.set("_routes",n.filter(z=>N.has(z.route.id)).map(z=>z.route.id).join(",")),[U.pathname+U.search]},[f,d,a,l,p,n,t,u]),b=A.useMemo(()=>RA(g,l),[g,l]),R=MA(g);return A.createElement(A.Fragment,null,v.map(N=>A.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...i})),b.map(N=>A.createElement("link",{key:N,rel:"modulepreload",href:N,...i})),R.map(({key:N,link:O})=>A.createElement("link",{key:N,...O})))}function zA(...t){return n=>{t.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var hb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{hb&&(window.__reactRouterVersion="7.6.3")}catch{}function UA({basename:t,children:n,window:i}){let a=A.useRef();a.current==null&&(a.current=wE({window:i,v5Compat:!0}));let l=a.current,[u,f]=A.useState({action:l.action,location:l.location}),d=A.useCallback(m=>{A.startTransition(()=>f(m))},[f]);return A.useLayoutEffect(()=>l.listen(d),[l,d]),A.createElement(dA,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:l})}var pb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mb=A.forwardRef(function({onClick:n,discover:i="render",prefetch:a="none",relative:l,reloadDocument:u,replace:f,state:d,target:m,to:p,preventScrollReset:g,viewTransition:v,...b},R){let{basename:N}=A.useContext(fn),O=typeof p=="string"&&pb.test(p),U,z=!1;if(typeof p=="string"&&O&&(U=p,hb))try{let ee=new URL(window.location.href),oe=p.startsWith("//")?new URL(ee.protocol+p):new URL(p),xe=Gn(oe.pathname,N);oe.origin===ee.origin&&xe!=null?p=xe+oe.search+oe.hash:z=!0}catch{sn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let L=QE(p,{relative:l}),[G,X,F]=jA(a,b),pe=KA(p,{replace:f,state:d,target:m,preventScrollReset:g,relative:l,viewTransition:v});function fe(ee){n&&n(ee),ee.defaultPrevented||pe(ee)}let re=A.createElement("a",{...b,...F,href:U||L,onClick:z||u?n:fe,ref:zA(R,X),target:m,"data-discover":!O&&i==="render"?"true":void 0});return G&&!O?A.createElement(A.Fragment,null,re,A.createElement(DA,{page:L})):re});mb.displayName="Link";var BA=A.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:a="",end:l=!1,style:u,to:f,viewTransition:d,children:m,...p},g){let v=$s(f,{relative:p.relative}),b=Ei(),R=A.useContext(Uo),{navigator:N,basename:O}=A.useContext(fn),U=R!=null&&YA(v)&&d===!0,z=N.encodeLocation?N.encodeLocation(v).pathname:v.pathname,L=b.pathname,G=R&&R.navigation&&R.navigation.location?R.navigation.location.pathname:null;i||(L=L.toLowerCase(),G=G?G.toLowerCase():null,z=z.toLowerCase()),G&&O&&(G=Gn(G,O)||G);const X=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let F=L===z||!l&&L.startsWith(z)&&L.charAt(X)==="/",pe=G!=null&&(G===z||!l&&G.startsWith(z)&&G.charAt(z.length)==="/"),fe={isActive:F,isPending:pe,isTransitioning:U},re=F?n:void 0,ee;typeof a=="function"?ee=a(fe):ee=[a,F?"active":null,pe?"pending":null,U?"transitioning":null].filter(Boolean).join(" ");let oe=typeof u=="function"?u(fe):u;return A.createElement(mb,{...p,"aria-current":re,className:ee,ref:g,style:oe,to:f,viewTransition:d},typeof m=="function"?m(fe):m)});BA.displayName="NavLink";var _A=A.forwardRef(({discover:t="render",fetcherKey:n,navigate:i,reloadDocument:a,replace:l,state:u,method:f=ho,action:d,onSubmit:m,relative:p,preventScrollReset:g,viewTransition:v,...b},R)=>{let N=GA(),O=JA(d,{relative:p}),U=f.toLowerCase()==="get"?"get":"post",z=typeof d=="string"&&pb.test(d),L=G=>{if(m&&m(G),G.defaultPrevented)return;G.preventDefault();let X=G.nativeEvent.submitter,F=(X==null?void 0:X.getAttribute("formmethod"))||f;N(X||G.currentTarget,{fetcherKey:n,method:F,navigate:i,replace:l,state:u,relative:p,preventScrollReset:g,viewTransition:v})};return A.createElement("form",{ref:R,method:U,action:O,onSubmit:a?m:L,...b,"data-discover":!z&&t==="render"?"true":void 0})});_A.displayName="Form";function qA(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gb(t){let n=A.useContext(ia);return Ye(n,qA(t)),n}function KA(t,{target:n,replace:i,state:a,preventScrollReset:l,relative:u,viewTransition:f}={}){let d=aa(),m=Ei(),p=$s(t,{relative:u});return A.useCallback(g=>{if(vA(g,n)){g.preventDefault();let v=i!==void 0?i:Ss(m)===Ss(p);d(t,{replace:v,state:a,preventScrollReset:l,relative:u,viewTransition:f})}},[m,d,p,i,a,n,t,l,u,f])}var VA=0,HA=()=>`__${String(++VA)}__`;function GA(){let{router:t}=gb("useSubmit"),{basename:n}=A.useContext(fn),i=lA();return A.useCallback(async(a,l={})=>{let{action:u,method:f,encType:d,formData:m,body:p}=SA(a,n);if(l.navigate===!1){let g=l.fetcherKey||HA();await t.fetch(g,i,l.action||u,{preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await t.navigate(l.action||u,{preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:i,flushSync:l.flushSync,viewTransition:l.viewTransition})},[t,n,i])}function JA(t,{relative:n}={}){let{basename:i}=A.useContext(fn),a=A.useContext(dn);Ye(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),u={...$s(t||".",{relative:n})},f=Ei();if(t==null){u.search=f.search;let d=new URLSearchParams(u.search),m=d.getAll("index");if(m.some(g=>g==="")){d.delete("index"),m.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();u.search=g?`?${g}`:""}}return(!t||t===".")&&l.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(u.pathname=u.pathname==="/"?i:Hn([i,u.pathname])),Ss(u)}function YA(t,n={}){let i=A.useContext(sb);Ye(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=gb("useViewTransitionState"),l=$s(t,{relative:n.relative});if(!i.isTransitioning)return!1;let u=Gn(i.currentLocation.pathname,a)||i.currentLocation.pathname,f=Gn(i.nextLocation.pathname,a)||i.nextLocation.pathname;return wo(l.pathname,f)!=null||wo(l.pathname,u)!=null}[...CA];function IA(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t instanceof Error)return t.message;switch(typeof t){case"bigint":case"number":case"boolean":return String(t);case"string":return t;case"symbol":return`Symbol(${t.description??""})`;case"object":return String("message"in t?t.message:t);case"function":return`function ${t.name}`;default:return"invalid error type"}}const Cs=t=>Array.isArray(t)?t:[t],ZA=(t,n)=>{const i=[[],[]];for(const a of t)n(a)?i[0].push(a):i[1].push(a);return i},yb=Array,Yi=(t,n)=>t.includes(n),QA=(t,n=0)=>[...new Array(t)].map((i,a)=>a+n),Be=(t,n,i)=>t===void 0?n===void 0?[]:Array.isArray(n)?n:[n]:(Array.isArray(n)?t.push(...n):t.push(n),t),Zi=(t,n)=>n==null?t??[]:t==null?Cs(n):t.concat(n),FA=(...t)=>t.reduce(Zi,[]),Fi=(t,n,i)=>{if(t===void 0)return Array.isArray(n)?n:[n];const a=(i==null?void 0:i.isEqual)??((l,u)=>l===u);for(const l of Cs(n))t.some(u=>a(u,l))||t.push(l);return t},XA=(t,n)=>t.reduce((i,a)=>{const l=a[n];return i[l]=Be(i[l],a),i},{}),Xr=(t,n,i)=>t.length===n.length&&t.every(i!=null&&i.isEqual?(a,l)=>i.isEqual(a,n[l]):(a,l)=>a===n[l]),er=(t,n)=>hn(t)===n,hn=t=>{const n=typeof t;return n==="object"?t===null?"null":"object":n==="function"?"object":n},Jn={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},PA={...Jn,function:"a function"};class WA extends Error{}const nt=t=>Pr(t,WA),Pr=(t,n=Error)=>{throw new n(t)};class e$ extends Error{constructor(){super(...arguments);w(this,"name","ParseError")}}const J=t=>Pr(t,e$),vb=t=>` ${t}`,_e=(t,n)=>{const i={},a=Array.isArray(t);let l=!1;for(const[u,f]of Object.entries(t).entries()){const d=a?n(u,f[1]):n(...f,u);l||(l=typeof d[0]=="number");const m=Array.isArray(d[0])||d.length===0?d:[d];for(const[p,g]of m)typeof p=="object"?i[p.group]=Be(i[p.group],g):i[p]=g}return l?Object.values(i):i},bb=Object.entries,Nn=(t,n)=>t in n,Nd=(t,n)=>n in t;class t${constructor(n){Object.assign(this,n)}}const n$=class{};class xb extends n${}const i$=(t,n)=>{const i={},a={};let l;for(l in t)l in n?i[l]=t[l]:a[l]=t[l];return[i,a]},r$=(t,n)=>i$(t,n)[1],Ts=t=>Object.keys(t).length===0,No=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(n=>[n,t[n]])],a$=(t,n)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)),s$=t=>{const n=Object.keys(t).sort(),i={};for(let a=0;a<n.length;a++)i[n[a]]=t[n[a]];return i},qn=vb("represents an uninitialized value"),l$=t=>Object.values(t).filter(n=>typeof n=="number"?!0:typeof t[n]!="number"),Sb={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},wb=globalThis.File??Blob,Nb={ArrayBuffer,Blob,File:wb,FormData,Headers,Request,Response,URL},o$={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Wr={...Sb,...Nb,...o$,String,Number,Boolean},kd=t=>{var a;let n=Object.getPrototypeOf(t);for(;n!=null&&n.constructor&&(!Nn(n.constructor.name,Wr)||!(t instanceof Wr[n.constructor.name]));)n=Object.getPrototypeOf(n);const i=(a=n==null?void 0:n.constructor)==null?void 0:a.name;if(!(i===void 0||i==="Object"))return i},Gf=t=>typeof t=="object"&&t!==null?kd(t)??"object":hn(t),kt=Array.isArray,u$={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},c$={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},f$={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},d$={...u$,...c$,...f$},Rd=t=>{const n=Object(t).name??null;return n&&Nn(n,Wr)&&Wr[n]===t?n:null},jy=(t,n)=>{let i=t.prototype;for(;i!==null;){if(i===n.prototype)return!0;i=Object.getPrototypeOf(i)}return!1},h$=t=>kb(t,new Map),kb=(t,n)=>{if(typeof t!="object"||t===null)return t;if(n!=null&&n.has(t))return n.get(t);const i=Rd(t.constructor);if(i==="Date")return new Date(t.getTime());if(i&&i!=="Array")return t;const a=Array.isArray(t)?t.slice():Object.create(Object.getPrototypeOf(t)),l=Object.getOwnPropertyDescriptors(t);if(n){n.set(t,a);for(const u in l){const f=l[u];"get"in f||"set"in f||(f.value=kb(f.value,n))}}return Object.defineProperties(a,l),a},p$=t=>{let n=qn;return()=>n===qn?n=t():n},_o=t=>typeof t=="function"&&t.length===0,m$=class extends Function{constructor(...t){const n=t.slice(0,-1),i=t.at(-1);try{super(...n,i)}catch(a){return nt(`Encountered an unexpected error while compiling your definition:
62
- Message: ${a}
63
- Source: (${t.slice(0,-1)}) => {
64
- ${t.at(-1)}
65
- }`)}}};class sa{constructor(n,...[i]){return Object.assign(Object.setPrototypeOf(n.bind((i==null?void 0:i.bind)??this),this.constructor.prototype),i==null?void 0:i.attach)}}const g$=p$(()=>{try{return new Function("return false")()}catch{return!0}});class kn{constructor(){}}const y$=()=>{var t,n,i;try{return(((i=(((n=(t=new Error().stack)==null?void 0:t.split(`
66
- `)[2])==null?void 0:n.trim())||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/))==null?void 0:i[1])||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}};var Lv;const v$=((Lv=globalThis.process)==null?void 0:Lv.env)??{},b$={fileName:y$,env:v$},x$=t=>t[0].toUpperCase()+t.slice(1),Rb=t=>new RegExp(S$(t),typeof t=="string"?"":t.flags),S$=t=>`^(?:${typeof t=="string"?t:t.source})$`,wi={negativeLookahead:t=>`(?!${t})`,nonCapturingGroup:t=>`(?:${t})`},Jf="\\",qo={" ":1,"\n":1," ":1},w$=/^-0\.?0*$/.source,Eb=/[1-9]\d*/.source,N$=/\.\d+/.source,k$=/\.\d*[1-9]/.source,Ab=t=>Rb(wi.negativeLookahead(w$)+wi.nonCapturingGroup("-?"+wi.nonCapturingGroup(wi.nonCapturingGroup("0|"+Eb)+wi.nonCapturingGroup(t.decimalPattern)+"?")+(t.allowDecimalOnly?"|"+t.decimalPattern:"")+"?")),Dy=Ab({decimalPattern:k$,allowDecimalOnly:!1}),R$=Dy.test.bind(Dy),Yf=Ab({decimalPattern:N$,allowDecimalOnly:!0});Yf.test.bind(Yf);const E$=/^-?\d*\.?\d*$/,A$=t=>t.length!==0&&E$.test(t),ko=Rb(wi.negativeLookahead("^-0$")+"-?"+wi.nonCapturingGroup(wi.nonCapturingGroup("0|"+Eb))),$$=ko.test.bind(ko),If=/^-?\d+$/,C$=If.test.bind(If),$b={number:"a number",bigint:"a bigint",integer:"an integer"},Cb=(t,n)=>`'${t}' was parsed as ${$b[n]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,T$=(t,n)=>n==="number"?R$(t):$$(t),O$=(t,n)=>n==="number"?Number(t):Number.parseInt(t),j$=(t,n)=>n==="number"?A$(t):C$(t),D$=(t,n)=>Ed(t,"number",n),M$=(t,n)=>Ed(t,"number",{...n,strict:!0}),L$=(t,n)=>Ed(t,"integer",n),Ed=(t,n,i)=>{const a=O$(t,n);return!Number.isNaN(a)&&j$(t,n)?i!=null&&i.strict?T$(t,n)?a:J(Cb(t,n)):a:i!=null&&i.errorOnFail?J((i==null?void 0:i.errorOnFail)===!0?`Failed to parse ${$b[n]} from '${t}'`:i==null?void 0:i.errorOnFail):void 0},z$=t=>{if(t[t.length-1]!=="n")return;const n=t.slice(0,-1);let i;try{i=BigInt(n)}catch{return}if(ko.test(n))return i;if(If.test(n))return J(Cb(t,"bigint"))},U$="0.46.0",B$={version:U$,filename:b$.fileName(),FileConstructor:wb},Os=B$,My=new Map,Nf=Object.create(null),Zf=t=>{const n=My.get(t);if(n)return n;let i=_$(t);return Nf[i]?i=`${i}${Nf[i]++}`:Nf[i]=1,Os[i]=t,My.set(t,i),i},ws=t=>/^[$A-Z_a-z][\w$]*$/.test(t),_$=t=>{switch(typeof t){case"object":{if(t===null)break;const n=kd(t)??"object";return n[0].toLowerCase()+n.slice(1)}case"function":return ws(t.name)?t.name:"fn";case"symbol":return t.description&&ws(t.description)?t.description:"symbol"}return nt(`Unexpected attempt to register serializable value of type ${hn(t)}`)},Ad=t=>typeof t=="string"?JSON.stringify(t):typeof t=="bigint"?`${t}n`:`${t}`,q$=(t,n={})=>ys(t,{onUndefined:"$ark.undefined",onBigInt:i=>`$ark.bigint-${i}`,...n},[]),ze=(t,n)=>{switch(hn(t)){case"object":const i=t,a=i.constructor.name;return a==="Object"||a==="Array"?(n==null?void 0:n.quoteKeys)===!1?Ro(i,(n==null?void 0:n.indent)??0,""):JSON.stringify(ys(i,ea,[]),null,n==null?void 0:n.indent):Ro(i,(n==null?void 0:n.indent)??0,"");case"symbol":return ea.onSymbol(t);default:return Ad(t)}},Ro=(t,n,i)=>{if(typeof t=="function")return ea.onFunction(t);if(typeof t!="object"||t===null)return Ad(t);const a=i+" ".repeat(n);if(Array.isArray(t)){if(t.length===0)return"[]";const u=t.map(f=>Ro(f,n,a)).join(`,
67
- `+a);return n?`[
68
- ${a}${u}
69
- ${i}]`:`[${u}]`}const l=t.constructor.name;if(l==="Object"){const u=No(t).map(([f,d])=>{const m=typeof f=="symbol"?ea.onSymbol(f):ws(f)?f:JSON.stringify(f),p=Ro(d,n,a);return`${a}${m}: ${p}`});return u.length===0?"{}":n?`{
70
- ${u.join(`,
71
- `)}
72
- ${i}}`:`{${u.join(", ")}}`}return t instanceof Date?js(t):"expression"in t&&typeof t.expression=="string"?t.expression:l},ea={onCycle:()=>"(cycle)",onSymbol:t=>`Symbol(${Zf(t)})`,onFunction:t=>`Function(${Zf(t)})`},ys=(t,n,i)=>{var a,l;switch(hn(t)){case"object":{const u=t;if("toJSON"in u&&typeof u.toJSON=="function")return u.toJSON();if(typeof u=="function")return ea.onFunction(u);if(i.includes(u))return"(cycle)";const f=[...i,u];if(Array.isArray(u))return u.map(m=>ys(m,n,f));if(u instanceof Date)return u.toDateString();const d={};for(const m in u)d[m]=ys(u[m],n,f);for(const m of Object.getOwnPropertySymbols(u))d[((a=n.onSymbol)==null?void 0:a.call(n,m))??m.toString()]=ys(u[m],n,f);return d}case"symbol":return ea.onSymbol(t);case"bigint":return((l=n.onBigInt)==null?void 0:l.call(n,t))??`${t}n`;case"undefined":return n.onUndefined??"undefined";case"string":return t.replaceAll("\\","\\\\");default:return t}},js=t=>{const n=t.getFullYear(),i=t.getMonth(),a=t.getDate(),l=t.getHours(),u=t.getMinutes(),f=t.getSeconds(),d=t.getMilliseconds();if(i===0&&a===1&&l===0&&u===0&&f===0&&d===0)return`${n}`;const m=`${K$[i]} ${a}, ${n}`;if(l===0&&u===0&&f===0&&d===0)return m;let p=t.toLocaleTimeString();const g=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return g&&(p=p.slice(0,-g.length)),d?p+=`.${H$(d,3)}`:V$.test(p)&&(p=p.slice(0,-3)),`${p+g}, ${m}`},K$=["January","February","March","April","May","June","July","August","September","October","November","December"],V$=/:\d\d:00$/,H$=(t,n)=>String(t).padStart(n,"0"),Tb=(t,n,...[i])=>{const a=(i==null?void 0:i.stringifySymbol)??ze;let l=t;switch(typeof n){case"string":l=ws(n)?t===""?n:`${t}.${n}`:`${t}[${JSON.stringify(n)}]`;break;case"number":l=`${t}[${n}]`;break;case"symbol":l=`${t}[${a(n)}]`;break;default:i!=null&&i.stringifyNonKey?l=`${t}[${i.stringifyNonKey(n)}]`:J(`${ze(n)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return l},Ds=(t,...n)=>t.reduce((i,a)=>Tb(i,a,...n),"");class Ob extends yb{constructor(...i){super();w(this,"cache",{});this.push(...i)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let i=0;i<this.length;i++)this.cache.json.push(typeof this[i]=="symbol"?ze(this[i]):this[i]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=Ds(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let i="";const a=[i];for(const l of this)i=Tb(i,l),a.push(i);return this.cache.stringifyAncestors=a}}class G${constructor(n){w(this,"chars");w(this,"i");w(this,"def");this.def=n,this.chars=[...n],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(n){let i="";for(;this.lookahead;){if(n(this,i))if(i[i.length-1]===Jf)i=i.slice(0,-1);else break;i+=this.shift()}return i}shiftUntilLookahead(n){return typeof n=="string"?this.shiftUntil(i=>i.lookahead===n):this.shiftUntil(i=>i.lookahead in n)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in qo))}jumpToIndex(n){this.i=n<0?this.length+n:n}jumpForward(n){this.i+=n}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(n,i){return this.chars.slice(n,i).join("")}lookaheadIs(n){return this.lookahead===n}lookaheadIsIn(n){return this.lookahead in n}}let Qf="$ark",J$=2;for(;Qf in globalThis;)Qf=`$ark${J$++}`;const jb=Qf;globalThis[jb]=Os;const Z=Os,Y$=t=>`${jb}.${t}`,$t=t=>Y$(Zf(t));class Db extends xb{constructor(...i){super();w(this,"argNames");w(this,"body","");w(this,"indentation",0);this.argNames=i;for(const a of i){if(a in this)throw new Error(`Arg name '${a}' would overwrite an existing property on FunctionBody`);this[a]=a}}indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(i,a=!1){return Mb(i,a)}index(i,a=!1){return Lb(`${i}`,a)}line(i){return this.body+=`${" ".repeat(this.indentation)}${i}
73
- `,this}const(i,a){return this.line(`const ${i} = ${a}`),this}let(i,a){return this.line(`let ${i} = ${a}`)}set(i,a){return this.line(`${i} = ${a}`)}if(i,a){return this.block(`if (${i})`,a)}elseIf(i,a){return this.block(`else if (${i})`,a)}else(i){return this.block("else",i)}for(i,a,l=0){return this.block(`for (let i = ${l}; ${i}; i++)`,a)}forIn(i,a){return this.block(`for (const k in ${i})`,a)}block(i,a,l=""){return this.line(`${i} {`),this.indent(),a(this),this.dedent(),this.line(`}${l}`)}return(i=""){return this.line(`return ${i}`)}write(i="anonymous",a=0){return`${i}(${this.argNames.join(", ")}) { ${a?this.body.split(`
74
- `).map(l=>" ".repeat(a)+`${l}`).join(`
75
- `):this.body} }`}compile(){return new m$(...this.argNames,this.body)}}const Ms=t=>er(t,"object")||typeof t=="symbol"?$t(t):Ad(t),Mb=(t,n=!1)=>typeof t=="string"&&ws(t)?`${n?"?":""}.${t}`:Lb(I$(t),n),I$=t=>typeof t=="symbol"?$t(t):JSON.stringify(t),Lb=(t,n=!1)=>`${n?"?.":""}[${t}]`;class kf extends Db{constructor(i){super("data","ctx");w(this,"traversalKind");w(this,"optimistic");this.traversalKind=i.kind,this.optimistic=i.optimistic===!0}invoke(i,a){const l=(a==null?void 0:a.arg)??this.data,u=typeof i=="string"?!0:this.requiresContextFor(i),f=typeof i=="string"?i:i.id;return u?`${this.referenceToId(f,a)}(${l}, ${this.ctx})`:`${this.referenceToId(f,a)}(${l})`}referenceToId(i,a){const l=(a==null?void 0:a.kind)??this.traversalKind,u=`this.${i}${l}`;return a!=null&&a.bind?`${u}.bind(${a==null?void 0:a.bind})`:u}requiresContextFor(i){return this.traversalKind==="Apply"||i.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(i,a,l){const u=this.requiresContextFor(l);return u&&this.line(`${this.ctx}.path.push(${i})`),this.check(l,{arg:a}),u&&this.line(`${this.ctx}.path.pop()`),this}check(i,a){return this.traversalKind==="Allows"?this.if(`!${this.invoke(i,a)}`,()=>this.return(!1)):this.line(this.invoke(i,a))}}const zb=t=>_e(t,(n,i)=>[n,kt(i)?[...i]:i]),Yn=vb("arkKind"),le=(t,n)=>(t==null?void 0:t[Yn])===n,Et=t=>le(t,"root")||le(t,"constraint"),Z$=["unit","proto","domain"],Ko=["required","optional","index","sequence"],Ub=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],$d=[...Ub,...Ko,"structure","predicate"],Vo=["alias","union","morph","unit","intersection","proto","domain"],Q$=[...Vo,...$d],Bb=_e($d,(t,n)=>[n,1]),F$=_e([...Ko,"undeclared"],(t,n)=>[n,1]),_b=_e(Q$,(t,n)=>[n,t]),mo=t=>typeof t=="string"&&t in _b,Eo=t=>_b[t],Cd=t=>Vo.slice(Eo(t)+1);[...Cd("union")];[...Cd("morph")];const Xi=t=>typeof t=="string"||typeof t=="boolean"||t===null?t:typeof t=="number"?Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t:Ms(t),Ho=t=>{let n="{ ";for(const[i,a]of Object.entries(t))n+=`${i}: ${Ms(a)}, `;return n+" }"},Fe=t=>{var i,a,l,u;const n=t;return n.hasAssociatedError&&((i=n.defaults).expected??(i.expected=f=>"description"in f?f.description:n.defaults.description(f)),(a=n.defaults).actual??(a.actual=f=>ze(f)),(l=n.defaults).problem??(l.problem=f=>`must be ${f.expected}${f.actual?` (was ${f.actual})`:""}`),(u=n.defaults).message??(u.message=f=>{if(f.path.length===0)return f.problem;const d=`${f.propString} ${f.problem}`;return d[0]==="["?`value at ${d}`:d})),n};class X$ extends Error{constructor(i,a){super(ze(a,{quoteKeys:!1,indent:4}));w(this,"name","ToJsonSchemaError");w(this,"code");w(this,"context");this.code=i,this.context=a}hasCode(i){return this.code===i}}const P$={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:t=>lt.throw("arrayObject",t),arrayPostfix:t=>lt.throw("arrayPostfix",t),defaultValue:t=>lt.throw("defaultValue",t),domain:t=>lt.throw("domain",t),morph:t=>lt.throw("morph",t),patternIntersection:t=>lt.throw("patternIntersection",t),predicate:t=>lt.throw("predicate",t),proto:t=>lt.throw("proto",t),symbolKey:t=>lt.throw("symbolKey",t),unit:t=>lt.throw("unit",t),date:t=>lt.throw("date",t)}},lt={Error:X$,throw:(...t)=>{throw new lt.Error(...t)},throwInternalOperandError:(t,n)=>nt(`Unexpected JSON Schema input for ${t}: ${ze(n)}`),defaultConfig:P$};Z.config??(Z.config={});const Ff=(t,n)=>{if(!n)return t;const i={...t};let a;for(a in n){const l={...t.keywords};if(a==="keywords"){for(const u in n[a]){const f=n.keywords[u];f!==void 0&&(l[u]=typeof f=="string"?{description:f}:f)}i.keywords=l}else a==="toJsonSchema"?i[a]=qb(t.toJsonSchema,n.toJsonSchema):mo(a)?i[a]={...t[a],...n[a]}:i[a]=n[a]}return i},qb=(t,n)=>{if(!t)return n??{};if(!n)return t;const i={...t};let a;for(a in n)a==="fallback"?i.fallback=W$(t.fallback,n.fallback):i[a]=n[a];return i},W$=(t,n)=>{t=Ly(t),n=Ly(n);const i={};let a;for(a in lt.defaultConfig.fallback)i[a]=n[a]??n.default??t[a]??t.default??lt.defaultConfig.fallback[a];return i},Ly=t=>typeof t=="function"?{default:t}:t??{};var zv,Uv;class ta extends(Uv=xb,zv=Yn,Uv){constructor({prefixPath:i,relativePath:a,...l},u){super();w(this,zv,"error");w(this,"path");w(this,"data");w(this,"nodeConfig");w(this,"input");w(this,"ctx");this.input=l,this.ctx=u,a$(this,l);const f=u.data;l.code==="union"&&(l.errors=l.errors.flatMap(m=>{const p=m.hasCode("union")?m.errors:[m];return!i&&!a?p:p.map(g=>g.transform(v=>({...v,path:FA(i,v.path,a)})))})),this.nodeConfig=u.config[this.code];const d=[...l.path??u.path];a&&d.push(...a),i&&d.unshift(...i),this.path=new Ob(...d),this.data="data"in l?l.data:f}transform(i){return new ta(i({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(i){return this.code===i}get propString(){return Ds(this.path)}get expected(){var a;if(this.input.expected)return this.input.expected;const i=((a=this.meta)==null?void 0:a.expected)??this.nodeConfig.expected;return typeof i=="function"?i(this.input):i}get actual(){var a;if(this.input.actual)return this.input.actual;const i=((a=this.meta)==null?void 0:a.actual)??this.nodeConfig.actual;return typeof i=="function"?i(this.data):i}get problem(){var a;if(this.input.problem)return this.input.problem;const i=((a=this.meta)==null?void 0:a.problem)??this.nodeConfig.problem;return typeof i=="function"?i(this):i}get message(){var a;if(this.input.message)return this.input.message;const i=((a=this.meta)==null?void 0:a.message)??this.nodeConfig.message;return typeof i=="function"?i(this):i}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}}var Bv,_v;class ki extends(_v=yb,Bv=Yn,_v){constructor(i){super();w(this,Bv,"errors");w(this,"ctx");w(this,"byPath",Object.create(null));w(this,"byAncestorPath",Object.create(null));w(this,"count",0);w(this,"mutable",this);this.ctx=i}get flatByPath(){return _e(this.byPath,(i,a)=>[i,a.flat])}get flatProblemsByPath(){return _e(this.byPath,(i,a)=>[i,a.flat.map(l=>l.problem)])}throw(){throw this.toTraversalError()}toTraversalError(){return new e2(this)}add(i){this.includes(i)||this._add(i)}transform(i){const a=new ki(this.ctx);for(const l of this)a.add(i(l));return a}merge(i){for(const a of i)this.includes(a)||this._add(new ta({...a,path:[...this.ctx.path,...a.path]},this.ctx))}affectsPath(i){return this.length===0?!1:i.stringifyAncestors().some(a=>a in this.byPath)||i.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(i=>i.toJSON())]}toString(){return this.join(`
76
- `)}_add(i){const a=this.byPath[i.propString];if(a){if(a.hasCode("union")&&a.errors.length===0)return;const l=i.hasCode("union")&&i.errors.length===0?i:new ta({code:"intersection",errors:a.hasCode("intersection")?[...a.errors,i]:[a,i]},this.ctx),u=this.indexOf(a);this.mutable[u===-1?this.length:u]=l,this.byPath[i.propString]=l,this.addAncestorPaths(i)}else this.byPath[i.propString]=i,this.addAncestorPaths(i),this.mutable.push(i);this.count++}addAncestorPaths(i){for(const a of i.path.stringifyAncestors())this.byAncestorPath[a]=Be(this.byAncestorPath[a],i)}}class e2 extends Error{constructor(i){var n=(...YD)=>(super(...YD),w(this,"name","TraversalError"),this);i.length===1?n(i.summary):n(`
77
- `+i.map(a=>` • ${t2(a)}`).join(`
78
- `)),Object.defineProperty(this,"arkErrors",{value:i,enumerable:!1})}}const t2=t=>t.toString().split(`
79
- `).join(`
80
- `);class Ir{constructor(n,i){w(this,"path",[]);w(this,"errors",new ki(this));w(this,"root");w(this,"config");w(this,"queuedMorphs",[]);w(this,"branches",[]);w(this,"seen",{});this.root=n,this.config=i}get data(){let n=this.root;for(const i of this.path)n=n==null?void 0:n[i];return n}get propString(){return Ds(this.path)}reject(n){return this.error(n),!1}mustBe(n){return this.error(n),!1}error(n){const i=typeof n=="object"?n.code?n:{...n,code:"predicate"}:{code:"predicate",expected:n};return this.errorFromContext(i)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(n){const i={path:new Ob(...this.path),morphs:n};this.currentBranch?this.currentBranch.queuedMorphs.push(i):this.queuedMorphs.push(i)}finalize(n){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?n?n(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(n){return this.errorFromContext(n)}errorFromContext(n){const i=new ta(n,this);return this.currentBranch?this.currentBranch.error=i:this.errors.add(i),i}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const n=this.queuedMorphs;this.queuedMorphs=[];for(const{path:i,morphs:a}of n)this.errors.affectsPath(i)||this.applyMorphsAtPath(i,a)}}applyMorphsAtPath(n,i){const a=n.at(-1);let l;if(a!==void 0){l=this.root;for(let u=0;u<n.length-1;u++)l=l[n[u]]}this.path=[...n];for(const u of i){const f=Et(u),d=u(l===void 0?this.root:l[a],this);if(d instanceof ta){this.errors.add(d);break}if(d instanceof ki){f||this.errors.merge(d);break}l===void 0?this.root=d:l[a]=d,this.applyQueuedMorphs()}}}const In=(t,n,i)=>{if(!i)return n();i.path.push(t);const a=n();return i.path.pop(),a};class Kb extends sa{constructor(i,a){var u;super((f,d,m=this.onFail)=>d?(this.traverseApply(f,d),d.hasError()?d.errors:d.data):this.rootApply(f,m),{attach:i});w(this,"attachments");w(this,"$");w(this,"onFail");w(this,"includesTransform");w(this,"includesContextualPredicate");w(this,"isCyclic");w(this,"allowsRequiresContext");w(this,"rootApplyStrategy");w(this,"contextFreeMorph");w(this,"rootApply");w(this,"referencesById");w(this,"shallowReferences");w(this,"flatRefs");w(this,"flatMorphs");w(this,"allows");w(this,"compiledMeta",r2(this.metaJson));w(this,"precedence",Eo(this.kind));w(this,"precompilation");w(this,"assert",(i,a)=>this(i,a,l=>l.throw()));this.attachments=i,this.$=a,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((f,d)=>a2(f,d.shallowReferences),[this]);const l=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let f=0;f<this.children.length;f++){if(this.includesTransform||(this.includesTransform=this.children[f].includesTransform),this.includesContextualPredicate||(this.includesContextualPredicate=this.children[f].includesContextualPredicate),this.isCyclic||(this.isCyclic=this.children[f].isCyclic),!l){const d=this.children[f].flatRefs;for(let m=0;m<d.length;m++){const p=d[m];if(!this.flatRefs.some(g=>Vb(g,p))){this.flatRefs.push(p);for(const g of p.node.branches)(g.hasKind("morph")||g.hasKind("intersection")&&((u=g.structure)==null?void 0:u.structuralMorph)!==void 0)&&this.flatMorphs.push({path:p.path,propString:p.propString,node:g})}}}Object.assign(this.referencesById,this.children[f].referencesById)}this.flatRefs.sort((f,d)=>f.path.length>d.path.length?1:f.path.length<d.path.length?-1:f.propString>d.propString?1:f.propString<d.propString||f.node.expression<d.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(f=>f.length===1||f.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(f=>f.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?f=>this.traverseAllows(f,new Ir(f,this.$.resolvedConfig)):f=>this.traverseAllows(f)}get shallowMorphs(){return[]}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(a,l)=>{if(this.allows(a))return a;const u=new Ir(a,this.$.resolvedConfig);return this.traverseApply(a,u),u.finalize(l)};case"contextual":return(a,l)=>{const u=new Ir(a,this.$.resolvedConfig);return this.traverseApply(a,u),u.finalize(l)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const i=this.$.resolvedConfig.clone;return(a,l)=>{if(this.allows(a))return this.contextFreeMorph(i&&(typeof a=="object"&&a!==null||typeof a=="function")?i(a):a);const u=new Ir(a,this.$.resolvedConfig);return this.traverseApply(a,u),u.finalize(l)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,nt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}cacheGetter(i,a){return Object.defineProperty(this,i,{value:a}),a}get description(){var i;return this.cacheGetter("description",((i=this.meta)==null?void 0:i.description)??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}traverse(i,a){return this(i,a,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(i){if(!this.includesTransform)return this;const a={};for(const[l,u]of this.innerEntries){const f=this.impl.keys[l];if(f.reduceIo)f.reduceIo(i,a,u);else if(f.child){const d=u;a[l]=kt(d)?d.map(m=>m[i]):d[i]}else a[l]=u}return this.$.node(this.kind,a)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(i){const a=Et(i)?i:this.$.parseDefinition(i);return this.innerHash===a.innerHash}ifEquals(i){return this.equals(i)?this:void 0}hasKind(i){return this.kind===i}assertHasKind(i){return this.kind!==i&&Pr(`${this.kind} node was not of asserted kind ${i}`),this}hasKindIn(...i){return i.includes(this.kind)}assertHasKindIn(...i){return Yi(i,this.kind)||Pr(`${this.kind} node was not one of asserted kinds ${i}`),this}isBasis(){return Yi(Z$,this.kind)}isConstraint(){return Yi($d,this.kind)}isStructural(){return Yi(Ko,this.kind)}isRefinement(){return Yi(Ub,this.kind)}isRoot(){return Yi(Vo,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(i){return this.hasKind("unit")&&this.allows(i)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(i){const a=ps.normalize(i);return this._select(a)}_select(i){let a=ps.applyBoundary[i.boundary??"references"](this);return i.kind&&(a=a.filter(l=>l.kind===i.kind)),i.where&&(a=a.filter(i.where)),ps.applyMethod[i.method??"filter"](a,this,i)}transform(i,a){return this._transform(i,this._createTransformContext(a))}_createTransformContext(i){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:(i==null?void 0:i.prereduced)??!1},undeclaredKeyHandling:void 0,...i}}_transform(i,a){var v;const l=a.bindScope??this.$;if(a.seen[this.id])return this.$.lazilyResolve(a.seen[this.id]);if(((v=a.shouldTransform)==null?void 0:v.call(a,this,a))===!1)return this;let u;a.seen[this.id]=()=>u,this.hasKind("structure")&&this.undeclared!==a.undeclaredKeyHandling&&(a={...a,undeclaredKeyHandling:this.undeclared});const f=_e(this.inner,(b,R)=>{if(!this.impl.keys[b].child)return[b,R];const N=R;if(!kt(N)){const U=N._transform(i,a);return U?[b,U]:[]}if(N.length===0)return[b,R];const O=N.flatMap(U=>U._transform(i,a)??[]);return O.length?[b,O]:[]});delete a.seen[this.id];const d=Object.assign(f,{meta:this.meta}),m=a.selected&&!a.selected.includes(this)?d:i(this.kind,d,a);if(m===null)return null;if(Et(m))return u=m;const p=Object.keys(m);return(p.length===0||p.length===1&&p[0]==="meta")&&!Ts(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in m)?a.undeclaredKeyHandling?{...m,value:Z.intrinsic.unknown}:null:(this.kind==="morph"&&(m.in??(m.in=Z.intrinsic.unknown)),u=l.node(this.kind,m,a.parseOptions))}configureReferences(i,a="references"){const l=ps.normalize(a),u=typeof i=="string"?(p,g)=>({...g,meta:{...g.meta,description:i}}):typeof i=="function"?(p,g)=>({...g,meta:i(g.meta)}):(p,g)=>({...g,meta:{...g.meta,...i}});if(l.boundary==="self")return this.$.node(this.kind,u(this.kind,{...this.inner,meta:this.meta}));const f=this._select(l),d=f&&Cs(f),m=l.boundary==="child"?(p,g)=>g.root.children.includes(p):l.boundary==="shallow"?p=>p.kind!=="structure":()=>!0;return this.$.finalize(this.transform(u,{shouldTransform:m,selected:d}))}}const ps={applyBoundary:{self:t=>[t],child:t=>[...t.children],shallow:t=>[...t.shallowReferences],references:t=>[...t.references]},applyMethod:{filter:t=>t,assertFilter:(t,n,i)=>(t.length===0&&Pr(zy(n,i)),t),find:t=>t[0],assertFind:(t,n,i)=>(t.length===0&&Pr(zy(n,i)),t[0])},normalize:t=>typeof t=="function"?{boundary:"references",method:"filter",where:t}:typeof t=="string"?Nn(t,ps.applyBoundary)?{method:"filter",boundary:t}:{boundary:"references",method:"filter",kind:t}:{boundary:"references",method:"filter",...t}},zy=(t,n)=>`${t} had no references matching ${ze(n)}.`,n2=t=>Ds(t,{stringifyNonKey:n=>n.expression}),i2=/"(\$ark\.[^"]+)"/g,r2=t=>JSON.stringify(t).replaceAll(i2,"$1"),Ni=(t,n)=>({path:t,node:n,propString:n2(t)}),Vb=(t,n)=>t.propString===n.propString&&t.node.equals(n.node),Uy=(t,n)=>Fi(t,n,{isEqual:Vb}),a2=(t,n)=>Fi(t,n,{isEqual:(i,a)=>i.equals(a)});class W extends Array{static init(n,i,a,l){return new W({kind:n,l:i,r:a,path:(l==null?void 0:l.path)??[],optional:(l==null?void 0:l.optional)??!1})}add(n,i,a,l){return this.push({kind:n,l:i,r:a,path:(l==null?void 0:l.path)??[],optional:(l==null?void 0:l.optional)??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:n,l:i,r:a}=this[0],l=Ds(n);return Hb(`Intersection${l&&` at ${l}`} of ${By(i,a)}`)}return`The following intersections result in unsatisfiable types:
81
- • ${this.map(({path:n,l:i,r:a})=>`${n}: ${By(i,a)}`).join(`
82
- • `)}`}throw(){return J(this.describeReasons())}invert(){const n=this.map(i=>({...i,l:i.r,r:i.l}));return n instanceof W?n:new W(...n)}withPrefixKey(n,i){return this.map(a=>({...a,path:[n,...a.path],optional:a.optional||i==="optional"}))}toNeverIfDisjoint(){return Z.intrinsic.never}}const By=(t,n)=>`${Xf(t)} and ${Xf(n)}`,Xf=t=>Et(t)?t.expression:kt(t)?t.map(Xf).join(" | ")||"never":String(t),Hb=t=>`${t} results in an unsatisfiable type`,Jr={},Zn=(t,n,i)=>mt(t,n,{$:i,invert:!1,pipe:!1}),Pf=(t,n,i)=>mt(t,n,{$:i,invert:!1,pipe:!0}),mt=(t,n,i)=>{const a=i.pipe?"|>":"&",l=`${t.hash}${a}${n.hash}`;if(Jr[l]!==void 0)return Jr[l];if(!i.pipe){const d=`${n.hash}${a}${t.hash}`;if(Jr[d]!==void 0){const m=Jr[d],p=m instanceof W?m.invert():m;return Jr[l]=p,p}}const u=!i.pipe||!t.includesTransform&&!n.includesTransform;if(u&&t.equals(n))return t;let f=u?Wf(t,n,i):t.hasKindIn(...Vo)?s2(t,n,i):Wf(t,n,i);return Et(f)&&(t.equals(f)?f=t:n.equals(f)&&(f=n)),Jr[l]=f,f},Wf=(t,n,i)=>{const a=t.precedence<n.precedence?t.kind:n.kind,l=t.impl.intersections[n.kind]??n.impl.intersections[t.kind];if(l===void 0)return null;if(a===t.kind)return l(t,n,i);{let u=l(n,t,{...i,invert:!i.invert});return u instanceof W&&(u=u.invert()),u}},s2=(t,n,i)=>t.includesTransform||n.includesTransform?i.invert?_y(n,t,i):_y(t,n,i):Wf(t,n,i),_y=(t,n,i)=>t.distribute(a=>l2(a,n,i),a=>{const l=a.filter(Et);if(l.length===0)return W.init("union",t.branches,n.branches);if(l.length<t.branches.length||!t.branches.every((f,d)=>f.in.equals(l[d].in)))return i.$.parseSchema(l);if(l.length===1)return l[0];const u={branches:l};return i.$.parseSchema(u)}),l2=(t,n,i)=>{if(t.hasKind("morph")){const l=[...t.morphs];if(t.lastMorphIfNode){const u=mt(t.lastMorphIfNode,n,i);if(u instanceof W)return u;l[l.length-1]=u}else l.push(n);return i.$.node("morph",{morphs:l,in:t.inner.in})}if(n.hasKind("morph")){const l=mt(t,n.in,i);return l instanceof W?l:i.$.node("morph",{morphs:[n],in:l})}return i.$.node("morph",{morphs:[n],in:t})};class la extends Kb{constructor(i,a){super(i,a);w(this,"impliedSiblings");Object.defineProperty(this,Yn,{value:"constraint",enumerable:!1})}intersect(i){return Zn(this,i,this.$)}}class Go extends la{constructor(){super(...arguments);w(this,"traverseApply",(i,a)=>{this.traverseAllows(i,a)||a.errorFromNodeContext(this.errorContext)})}compile(i){i.traversalKind==="Allows"?i.return(this.compiledCondition):i.if(this.compiledNegation,()=>i.line(`${i.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Ho(this.errorContext)}}const Lt=t=>(n,i)=>{if(kt(n)){if(n.length===0)return;const l=n.map(u=>i.$.node(t,u));return t==="predicate"?l:l.sort((u,f)=>u.hash<f.hash?-1:1)}const a=i.$.node(t,n);return a.hasOpenIntersection()?[a]:a},Ao=t=>{const n=t.r.shift();if(!n){let a=t.l.length===0&&t.kind==="structure"?Z.intrinsic.unknown.internal:t.ctx.$.node(t.kind,Object.assign(t.baseInner,o2(t.l)),{prereduced:!0});for(const l of t.roots){if(a instanceof W)return a;a=mt(l,a,t.ctx)}return a}let i=!1;for(let a=0;a<t.l.length;a++){const l=mt(t.l[a],n,t.ctx);if(l!==null){if(l instanceof W)return l;if(i){if(!t.l.includes(l))return nt(`Unexpectedly encountered multiple distinct intersection results for refinement ${l}`)}else{if(l.isRoot())return t.roots.push(l),t.l.splice(a),Ao(t);t.l[a]=l,i=!0}}}if(i||t.l.push(n),t.kind==="intersection"&&n.impliedSiblings)for(const a of n.impliedSiblings)Fi(t.r,a);return Ao(t)},$o=t=>Object.entries(t).flatMap(([i,a])=>i in Bb?a:[]).sort((i,a)=>i.precedence<a.precedence?-1:i.precedence>a.precedence?1:i.kind==="predicate"&&a.kind==="predicate"?0:i.hash<a.hash?-1:1),o2=t=>{const n={};for(const i of t)if(i.hasOpenIntersection())n[i.kind]=Be(n[i.kind],i);else{if(n[i.kind])return nt(`Unexpected intersection of closed refinements of kind ${i.kind}`);n[i.kind]=i}return n},u2=(...t)=>J(c2(...t)),c2=(t,n,i)=>{const a=i.hasKind("morph")?"a morph":i.isUnknown()?"unknown":i.exclude(n).defaultShortDescription;return`${x$(t)} operand must be ${n.description} (was ${a})`},f2=(t,n,i)=>new Co(t,n,i,i,null);class Gb extends sa{}var qv,Kv;class Co extends(Kv=sa,qv=Yn,Kv){constructor(i,a,l,u,f){super((...d)=>{const m=_e(this.names,(p,g)=>{const v=this.arg$.parse(d[p]);return v.extends(this.constraints[p])||J(d2(g,this.constraints[p].expression,v.expression)),[g,v]});if(this.defIsLazy()){const p=this.bodyDef(m);return this.$.parse(p)}return this.$.parse(a,{args:m})});w(this,qv,"generic");w(this,"paramDefs");w(this,"bodyDef");w(this,"$");w(this,"arg$");w(this,"baseInstantiation");w(this,"hkt");w(this,"description");this.paramDefs=i,this.bodyDef=a,this.$=l,this.arg$=u,this.hkt=f,this.description=f?new f().description??`a generic type for ${f.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof Gb}cacheGetter(i,a){return Object.defineProperty(this,i,{value:a}),a}get json(){return this.cacheGetter("json",{params:this.params.map(i=>i[1].isUnknown()?i[0]:[i[0],i[1].json]),body:q$(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(i=>typeof i=="string"?[i,Z.intrinsic.unknown]:[i[0],this.$.parse(i[1])]))}get names(){return this.cacheGetter("names",this.params.map(i=>i[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(i=>i[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const d2=(t,n,i)=>`${t} must be assignable to ${n} (was ${i})`,h2=Fe({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:t=>typeof t=="function"?{predicate:t}:t,defaults:{description:t=>`valid according to ${t.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class p2 extends la{constructor(){super(...arguments);w(this,"serializedPredicate",$t(this.predicate));w(this,"compiledCondition",`${this.serializedPredicate}(data, ctx)`);w(this,"compiledNegation",`!${this.compiledCondition}`);w(this,"impliedBasis",null);w(this,"expression",this.serializedPredicate);w(this,"traverseAllows",this.predicate);w(this,"errorContext",{code:"predicate",description:this.description,meta:this.meta});w(this,"compiledErrorContext",Ho(this.errorContext));w(this,"traverseApply",(i,a)=>{!this.predicate(i,a.external)&&!a.hasError()&&a.errorFromNodeContext(this.errorContext)})}compile(i){if(i.traversalKind==="Allows"){i.return(this.compiledCondition);return}i.if(`${this.compiledNegation} && !ctx.hasError()`,()=>i.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(i,a){return a.fallback.predicate({code:"predicate",base:i,predicate:this.predicate})}}const Jb={implementation:h2,Node:p2},m2=Fe({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:t=>Number.isInteger(t)?t:J(y2(t))}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>t.rule===1?"an integer":t.rule===2?"even":`a multiple of ${t.rule}`},intersections:{divisor:(t,n,i)=>i.$.node("divisor",{rule:Math.abs(t.rule*n.rule/v2(t.rule,n.rule))})},obviatesBasisDescription:!0});class g2 extends Go{constructor(){super(...arguments);w(this,"traverseAllows",i=>i%this.rule===0);w(this,"compiledCondition",`data % ${this.rule} === 0`);w(this,"compiledNegation",`data % ${this.rule} !== 0`);w(this,"impliedBasis",Z.intrinsic.number.internal);w(this,"expression",`% ${this.rule}`)}reduceJsonSchema(i){return i.type="integer",this.rule===1||(i.multipleOf=this.rule),i}}const Yb={implementation:m2,Node:g2},y2=t=>`divisor must be an integer (was ${t})`,v2=(t,n)=>{let i,a=t,l=n;for(;l!==0;)i=l,l=a%l,a=i;return a};class oa extends Go{constructor(){super(...arguments);w(this,"boundOperandKind",w2[this.kind]);w(this,"compiledActual",this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()");w(this,"comparator",N2(this.kind,this.exclusive));w(this,"numericLimit",this.rule.valueOf());w(this,"expression",`${this.comparator} ${this.rule}`);w(this,"compiledCondition",`${this.compiledActual} ${this.comparator} ${this.numericLimit}`);w(this,"compiledNegation",`${this.compiledActual} ${b2[this.comparator]} ${this.numericLimit}`);w(this,"stringLimit",this.boundOperandKind==="date"?k2(this.numericLimit):`${this.numericLimit}`);w(this,"limitKind",this.comparator[0]==="<"?"upper":"lower")}isStricterThan(i){return(this.limitKind==="upper"?this.numericLimit<i.numericLimit:this.numericLimit>i.numericLimit)||this.numericLimit===i.numericLimit&&this.exclusive===!0&&!i.exclusive}overlapsRange(i){return!(this.isStricterThan(i)||this.numericLimit===i.numericLimit&&(this.exclusive||i.exclusive))}overlapIsUnit(i){return this.numericLimit===i.numericLimit&&!this.exclusive&&!i.exclusive}}const b2={"<":">=","<=":">",">":"<=",">=":"<"},x2={min:"max",minLength:"maxLength",after:"before"},Ib={parse:t=>t||void 0},Zb=t=>n=>{if(typeof n=="number")return{rule:n};const{exclusive:i,...a}=n;return i?{...a,rule:t==="minLength"?a.rule+1:a.rule-1}:a},Qb=t=>n=>{if(typeof n=="number"||typeof n=="string"||n instanceof Date)return{rule:n};const{exclusive:i,...a}=n;if(!i)return a;const l=typeof a.rule=="number"?a.rule:typeof a.rule=="string"?new Date(a.rule).valueOf():a.rule.valueOf();return i?{...a,rule:t==="after"?l+1:l-1}:a},Fb=t=>typeof t=="string"||typeof t=="number"?new Date(t):t,S2=(t,n)=>`${t} bound must be a positive integer (was ${n})`,Td=t=>n=>((!Number.isInteger(n)||n<0)&&J(S2(t,n)),n),w2={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},N2=(t,n)=>`${Nn(t,x2)?">":"<"}${n?"":"="}`,k2=t=>typeof t=="string"?t:new Date(t).toLocaleString(),R2=t=>`Bounded expression ${t} must be exactly one of number, string, Array, or Date`,E2=Fe({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Fb,serialize:t=>t.toISOString()}},normalize:Qb("after"),defaults:{description:t=>`${t.collapsibleLimitString} or later`,actual:js},intersections:{after:(t,n)=>t.isStricterThan(n)?t:n}});class A2 extends oa{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.Date.internal);w(this,"collapsibleLimitString",js(this.rule));w(this,"traverseAllows",i=>i>=this.rule)}reduceJsonSchema(i,a){return a.fallback.date({code:"date",base:i,after:this.rule})}}const Xb={implementation:E2,Node:A2},$2=Fe({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Fb,serialize:t=>t.toISOString()}},normalize:Qb("before"),defaults:{description:t=>`${t.collapsibleLimitString} or earlier`,actual:js},intersections:{before:(t,n)=>t.isStricterThan(n)?t:n,after:(t,n,i)=>t.overlapsRange(n)?t.overlapIsUnit(n)?i.$.node("unit",{unit:t.rule}):null:W.init("range",t,n)}});class C2 extends oa{constructor(){super(...arguments);w(this,"collapsibleLimitString",js(this.rule));w(this,"traverseAllows",i=>i<=this.rule);w(this,"impliedBasis",Z.intrinsic.Date.internal)}reduceJsonSchema(i,a){return a.fallback.date({code:"date",base:i,before:this.rule})}}const Pb={implementation:$2,Node:C2},T2=Fe({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:Td("exactLength")}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>`exactly length ${t.rule}`,actual:t=>`${t.length}`},intersections:{exactLength:(t,n,i)=>W.init("unit",i.$.node("unit",{unit:t.rule}),i.$.node("unit",{unit:n.rule}),{path:["length"]}),minLength:(t,n)=>t.rule>=n.rule?t:W.init("range",t,n),maxLength:(t,n)=>t.rule<=n.rule?t:W.init("range",t,n)}});class O2 extends Go{constructor(){super(...arguments);w(this,"traverseAllows",i=>i.length===this.rule);w(this,"compiledCondition",`data.length === ${this.rule}`);w(this,"compiledNegation",`data.length !== ${this.rule}`);w(this,"impliedBasis",Z.intrinsic.lengthBoundable.internal);w(this,"expression",`== ${this.rule}`)}reduceJsonSchema(i){switch(i.type){case"string":return i.minLength=this.rule,i.maxLength=this.rule,i;case"array":return i.minItems=this.rule,i.maxItems=this.rule,i;default:return lt.throwInternalOperandError("exactLength",i)}}}const Wb={implementation:T2,Node:O2},j2=Fe({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:Ib},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"negative":"non-positive":`${t.exclusive?"less than":"at most"} ${t.rule}`},intersections:{max:(t,n)=>t.isStricterThan(n)?t:n,min:(t,n,i)=>t.overlapsRange(n)?t.overlapIsUnit(n)?i.$.node("unit",{unit:t.rule}):null:W.init("range",t,n)},obviatesBasisDescription:!0});class D2 extends oa{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.number.internal);w(this,"traverseAllows",this.exclusive?i=>i<this.rule:i=>i<=this.rule)}reduceJsonSchema(i){return this.exclusive?i.exclusiveMaximum=this.rule:i.maximum=this.rule,i}}const e0={implementation:j2,Node:D2},M2=Fe({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Td("maxLength")}},reduce:(t,n)=>t.rule===0?n.node("exactLength",t):void 0,normalize:Zb("maxLength"),defaults:{description:t=>`at most length ${t.rule}`,actual:t=>`${t.length}`},intersections:{maxLength:(t,n)=>t.isStricterThan(n)?t:n,minLength:(t,n,i)=>t.overlapsRange(n)?t.overlapIsUnit(n)?i.$.node("exactLength",{rule:t.rule}):null:W.init("range",t,n)}});class L2 extends oa{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.lengthBoundable.internal);w(this,"traverseAllows",i=>i.length<=this.rule)}reduceJsonSchema(i){switch(i.type){case"string":return i.maxLength=this.rule,i;case"array":return i.maxItems=this.rule,i;default:return lt.throwInternalOperandError("maxLength",i)}}}const t0={implementation:M2,Node:L2},z2=Fe({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:Ib},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"positive":"non-negative":`${t.exclusive?"more than":"at least"} ${t.rule}`},intersections:{min:(t,n)=>t.isStricterThan(n)?t:n},obviatesBasisDescription:!0});class U2 extends oa{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.number.internal);w(this,"traverseAllows",this.exclusive?i=>i>this.rule:i=>i>=this.rule)}reduceJsonSchema(i){return this.exclusive?i.exclusiveMinimum=this.rule:i.minimum=this.rule,i}}const n0={implementation:z2,Node:U2},B2=Fe({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Td("minLength")}},reduce:t=>t.rule===0?Z.intrinsic.unknown:void 0,normalize:Zb("minLength"),defaults:{description:t=>t.rule===1?"non-empty":`at least length ${t.rule}`,actual:t=>t.length===0?"":`${t.length}`},intersections:{minLength:(t,n)=>t.isStricterThan(n)?t:n}});class _2 extends oa{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.lengthBoundable.internal);w(this,"traverseAllows",i=>i.length>=this.rule)}reduceJsonSchema(i){switch(i.type){case"string":return i.minLength=this.rule,i;case"array":return i.minItems=this.rule,i;default:return lt.throwInternalOperandError("minLength",i)}}}const i0={implementation:B2,Node:_2},q2={min:n0.implementation,max:e0.implementation,minLength:i0.implementation,maxLength:t0.implementation,exactLength:Wb.implementation,after:Xb.implementation,before:Pb.implementation},K2={min:n0.Node,max:e0.Node,minLength:i0.Node,maxLength:t0.Node,exactLength:Wb.Node,after:Xb.Node,before:Pb.Node},V2=Fe({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:t=>typeof t=="string"?{rule:t}:t instanceof RegExp?t.flags?{rule:t.source,flags:t.flags}:{rule:t.source}:t,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:t=>`matched by ${t.rule}`},intersections:{pattern:()=>null}});class H2 extends Go{constructor(){super(...arguments);w(this,"instance",new RegExp(this.rule,this.flags));w(this,"expression",`${this.instance}`);w(this,"traverseAllows",this.instance.test.bind(this.instance));w(this,"compiledCondition",`${this.expression}.test(data)`);w(this,"compiledNegation",`!${this.compiledCondition}`);w(this,"impliedBasis",Z.intrinsic.string.internal)}reduceJsonSchema(i,a){return i.pattern?a.fallback.patternIntersection({code:"patternIntersection",base:i,pattern:this.rule}):(i.pattern=this.rule,i)}}const r0={implementation:V2,Node:H2},go=(t,n)=>{const i=G2(t);return n&&!n.includes(i)?J(`Root of kind ${i} should be one of ${n}`):i},G2=t=>{if(le(t,"root"))return t.kind;if(typeof t=="string")return t[0]==="$"?"alias":t in Jn?"domain":"proto";if(typeof t=="function")return"proto";if(typeof t!="object"||t===null)return J(qy(t));if("morphs"in t)return"morph";if("branches"in t||kt(t))return"union";if("unit"in t)return"unit";if("reference"in t)return"alias";const n=Object.keys(t);return n.length===0||n.some(i=>i in Bb)?"intersection":"proto"in t?"proto":"domain"in t?"domain":J(qy(t))},qy=t=>`${ze(t)} is not a valid type schema`,ro={},J2=t=>kt(t)?t.map(n=>n.collapsibleJson):t.collapsibleJson,an={};Z.nodesByRegisteredId=an;const a0=t=>(ro[t]??(ro[t]=0),`${t}${++ro[t]}`),s0=t=>{var p;const n=Jo[t.kind],i=((p=n.applyConfig)==null?void 0:p.call(n,t.def,t.$.resolvedConfig))??t.def,a={},{meta:l,...u}=i,f=l===void 0?{}:typeof l=="string"?{description:l}:l,d=bb(u).sort(([g],[v])=>mo(g)?mo(v)?Eo(g)-Eo(v):1:mo(v)||g<v?-1:1).filter(([g,v])=>{if(g.startsWith("meta.")){const b=g.slice(5);return f[b]=v,!1}return!0});for(const g of d){const v=g[0],b=n.keys[v];if(!b)return J(`Key ${v} is not valid on ${t.kind} schema`);const R=b.parse?b.parse(g[1],t):g[1];R!==qn&&(R!==void 0||b.preserveUndefined)&&(a[v]=R)}if(n.reduce&&!t.prereduced){const g=n.reduce(a,t.$);if(g)return g instanceof W?g.throw():I2(g,f)}return Od({id:t.id,kind:t.kind,inner:a,meta:f,$:t.$})},Od=({id:t,kind:n,inner:i,meta:a,$:l,ignoreCache:u})=>{const f=Jo[n],d=bb(i),m=[];let p={};for(const[z,L]of d){const G=f.keys[z],X=G.serialize??(G.child?J2:Xi);if(p[z]=X(L),G.child===!0){const F=L;kt(F)?m.push(...F):m.push(F)}else typeof G.child=="function"&&m.push(...G.child(L))}f.finalizeInnerJson&&(p=f.finalizeInnerJson(p));let g={...p},v={};Ts(a)||(v=_e(a,(z,L)=>[z,z==="examples"?L:Xi(L)]),g.meta=ao(v,"description",!0)),p=ao(p,f.collapsibleKey,!1);const b=JSON.stringify({kind:n,...p});g=ao(g,f.collapsibleKey,!1);const R=ao(g,f.collapsibleKey,!0),N=JSON.stringify({kind:n,...g});if(l.nodesByHash[N]&&!u)return l.nodesByHash[N];const O={id:t,kind:n,impl:f,inner:i,innerEntries:d,innerJson:p,innerHash:b,meta:a,metaJson:v,json:g,hash:N,collapsibleJson:R,children:m};if(n!=="intersection")for(const z in i)z!=="in"&&z!=="out"&&(O[z]=i[z]);const U=new XC[n](O,l);return l.nodesByHash[N]=U},Y2=(t,n)=>t.id===n?t:(Et(an[n])&&nt(`Unexpected attempt to overwrite node id ${n}`),Od({id:n,kind:t.kind,inner:t.inner,meta:t.meta,$:t.$,ignoreCache:!0})),I2=(t,n,i)=>Od({id:a0(n.alias??t.kind),kind:t.kind,inner:t.inner,meta:n,$:t.$}),ao=(t,n,i)=>{const a=Object.keys(t);if(a.length===1&&a[0]===n){const l=t[n];if(i||er(l,"object")&&(Object.keys(l).length===1||Array.isArray(l)))return l}return t},ed=(t,n,i)=>{if(t.key!==n.key)return null;const a=t.key;let l=mt(t.value,n.value,i);const u=t.required||n.required?"required":"optional";if(l instanceof W)if(u==="optional")l=Z.intrinsic.never.internal;else return l.withPrefixKey(t.key,t.required&&n.required?"required":"optional");if(u==="required")return i.$.node("required",{key:a,value:l});const f=t.hasDefault()?n.hasDefault()?t.default===n.default?t.default:J(o0(t.default,n.default)):t.default:n.hasDefault()?n.default:qn;return i.$.node("optional",{key:a,value:l,default:f})};class l0 extends la{constructor(){super(...arguments);w(this,"required",this.kind==="required");w(this,"optional",this.kind==="optional");w(this,"impliedBasis",Z.intrinsic.object.internal);w(this,"serializedKey",Ms(this.key));w(this,"compiledKey",typeof this.key=="string"?this.key:this.serializedKey);w(this,"flatRefs",Be(this.value.flatRefs.map(i=>Ni([this.key,...i.path],i.node)),Ni([this.key],this.value)));w(this,"traverseAllows",(i,a)=>this.key in i?In(this.key,()=>this.value.traverseAllows(i[this.key],a),a):this.optional);w(this,"traverseApply",(i,a)=>{this.key in i?In(this.key,()=>this.value.traverseApply(i[this.key],a),a):this.hasKind("required")&&a.errorFromNodeContext(this.errorContext)})}_transform(i,a){a.path.push(this.key);const l=super._transform(i,a);return a.path.pop(),l}hasDefault(){return"default"in this.inner}compile(i){i.if(`${this.serializedKey} in data`,()=>i.traverseKey(this.serializedKey,`data${i.prop(this.key)}`,this.value)),this.hasKind("required")&&i.else(()=>i.traversalKind==="Apply"?i.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):i.return(!1)),i.traversalKind==="Allows"&&i.return(!0)}}const o0=(t,n)=>`Invalid intersection of default values ${ze(t)} & ${ze(n)}`,Z2=Fe({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,n)=>n.$.parseSchema(t)},default:{preserveUndefined:!0}},normalize:t=>t,reduce:(t,n)=>{if(n.resolvedConfig.exactOptionalPropertyTypes===!1&&!t.value.allows(void 0))return n.node("optional",{...t,value:t.value.or(de.undefined)},{prereduced:!0})},defaults:{description:t=>`${t.compiledKey}?: ${t.value.description}`},intersections:{optional:ed}});class Q2 extends l0{constructor(...i){super(...i);w(this,"expression",this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${ze(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`);w(this,"defaultValueMorph",F2(this));w(this,"defaultValueMorphRef",this.defaultValueMorph&&$t(this.defaultValueMorph));"default"in this.inner&&Dd(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:i,...a}=this.inner;return this.cacheGetter("outProp",this.$.node("required",a,{prereduced:!0}))}}const jd={implementation:Z2,Node:Q2},Rf={},F2=t=>{if(!t.hasDefault())return;const n=`{${t.compiledKey}: ${t.value.id} = ${Xi(t.default)}}`;return Rf[n]??(Rf[n]=u0(t.key,t.value,t.default))},u0=(t,n,i)=>{if(typeof i=="function")return n.includesTransform?(l,u)=>(In(t,()=>n(l[t]=i(),u),u),l):l=>(l[t]=i(),l);const a=n.includesTransform?n.assert(i):i;return er(a,"object")?(l,u)=>(In(t,()=>n(l[t]=i,u),u),l):l=>(l[t]=a,l)},Dd=(t,n,i)=>{const a=_o(n);er(n,"object")&&!a&&J(X2(i));const l=t.in(a?n():n);if(l instanceof ki){i===null&&J(`Default ${l.summary}`);const u=l.transform(f=>f.transform(d=>({...d,prefixPath:[i]})));J(`Default for ${u.summary}`)}return n},X2=t=>`Non-primitive default ${t===null?"":typeof t=="number"?`for value at [${t}] `:`for ${Ms(t)} `}must be specified as a function like () => ({my: 'object'})`;class Ls extends Kb{constructor(i,a){super(i,a);w(this,"branches",this.hasKind("union")?this.inner.branches:[this]);w(this,"_keyof");w(this,"pipe",Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)}));Object.defineProperty(this,Yn,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:i=>{const a=this(i);return a instanceof ki?a:{value:a}}}}as(){return this}brand(i){return i===""?J(P2):this}readonly(){return this}distribute(i,a){const l=this.branches.map(i);return(a==null?void 0:a(l))??l}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(i={}){const a=qb(this.$.resolvedConfig.toJsonSchema,i);a.useRefs||(a.useRefs=this.isCyclic);const l=typeof a.dialect=="string"?{$schema:a.dialect}:{};return Object.assign(l,this.toJsonSchemaRecurse(a)),a.useRefs&&(l.$defs=_e(this.references,(u,f)=>f.isRoot()&&!f.alwaysExpandJsonSchema?[f.id,f.toResolvedJsonSchema(a)]:[])),l}toJsonSchemaRecurse(i){return i.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(i)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(i){const a=this.innerToJsonSchema(i);return Object.assign(a,this.metaJson)}intersect(i){const a=this.$.parseDefinition(i),l=this.rawIntersect(a);return l instanceof W?l:this.$.finalize(l)}rawIntersect(i){return Zn(this,i,this.$)}toNeverIfDisjoint(){return this}and(i){const a=this.intersect(i);return a instanceof W?a.throw():a}rawAnd(i){const a=this.rawIntersect(i);return a instanceof W?a.throw():a}or(i){const a=this.$.parseDefinition(i);return this.$.finalize(this.rawOr(a))}rawOr(i){const a=[...this.branches,...i.branches];return this.$.node("union",a)}map(i){return this.$.schema(this.applyStructuralOperation("map",[i]))}pick(...i){return this.$.schema(this.applyStructuralOperation("pick",i))}omit(...i){return this.$.schema(this.applyStructuralOperation("omit",i))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}keyof(){if(this._keyof)return this._keyof;const i=this.applyStructuralOperation("keyof",[]).reduce((a,l)=>a.intersect(l).toNeverIfDisjoint(),Z.intrinsic.unknown.internal);return i.branches.length===0&&J(Hb(`keyof ${this.expression}`)),this._keyof=this.$.finalize(i)}get props(){return this.branches.length!==1?J(W2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(i){const a=this.$.parseDefinition(i);return this.$.schema(a.distribute(l=>this.applyStructuralOperation("merge",[Ky(l)??J(Vy("merge",l.expression))])))}applyStructuralOperation(i,a){return this.distribute(l=>{if(l.equals(Z.intrinsic.object)&&i!=="merge")return l;const u=Ky(l);if(u||J(Vy(i,l.expression)),i==="keyof")return u.keyof();if(i==="get")return u.get(...a);if(i==="props")return u.props;const f=i==="required"?"require":i==="partial"?"optionalize":i;return this.$.node("intersection",{...l.inner,structure:u[f](...a)})})}get(...i){return i[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",i))}extract(i){const a=this.$.parseDefinition(i);return this.$.schema(this.branches.filter(l=>l.extends(a)))}exclude(i){const a=this.$.parseDefinition(i);return this.$.schema(this.branches.filter(l=>!l.extends(a)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(i){return!(this.intersect(i)instanceof W)}extends(i){const a=this.intersect(i);return!(a instanceof W)&&this.equals(a)}ifExtends(i){return this.extends(i)?this:void 0}subsumes(i){return this.$.parseDefinition(i).extends(this)}configure(i,a="shallow"){return this.configureReferences(i,a)}describe(i,a="shallow"){return this.configure({description:i},a)}optional(){return[this,"?"]}default(i){return Dd(this,i,null),[this,"=",i]}from(i){return this.assert(i)}_pipe(...i){const a=i.reduce((l,u)=>l.rawPipeOnce(u),this);return this.$.finalize(a)}tryPipe(...i){const a=i.reduce((l,u)=>l.rawPipeOnce(le(u,"root")?u:(f,d)=>{try{return u(f,d)}catch(m){return d.error({code:"predicate",predicate:u,actual:`aborted due to error:
83
- ${m}
84
- `})}}),this);return this.$.finalize(a)}to(i){return this.$.finalize(this.toNode(this.$.parseDefinition(i)))}toNode(i){const a=Pf(this,i,this.$);return a instanceof W?a.throw():a}rawPipeOnce(i){return le(i,"root")?this.toNode(i):this.distribute(a=>a.hasKind("morph")?this.$.node("morph",{in:a.inner.in,morphs:[...a.morphs,i]}):this.$.node("morph",{in:a,morphs:[i]}),this.$.parseSchema)}narrow(i){return this.constrainOut("predicate",i)}constrain(i,a){return this._constrain("root",i,a)}constrainIn(i,a){return this._constrain("in",i,a)}constrainOut(i,a){return this._constrain("out",i,a)}_constrain(i,a,l){const u=this.$.node(a,l);if(u.isRoot())return u.isUnknown()?this:nt(`Unexpected constraint node ${u}`);const f=i==="root"?this:this[i];if(f.hasKind("morph")||u.impliedBasis&&!f.extends(u.impliedBasis))return u2(a,u.impliedBasis,this);const d=this.$.node("intersection",{[u.kind]:u}),m=i==="out"?Pf(this,d,this.$):Zn(this,d,this.$);return m instanceof W&&m.throw(),this.$.finalize(m)}onUndeclaredKey(i){const a=typeof i=="string"?i:i.rule,l=typeof i=="string"?!1:i.deep;return this.$.finalize(this.transform((u,f)=>u==="structure"?a==="ignore"?r$(f,{undeclared:1}):{...f,undeclared:a}:f,l?void 0:{shouldTransform:u=>!Yi(Ko,u.kind)}))}hasEqualMorphs(i){return!this.includesTransform&&!i.includesTransform?!0:!(!Xr(this.shallowMorphs,i.shallowMorphs)||!Xr(this.flatMorphs,i.flatMorphs,{isEqual:(a,l)=>{var u,f;return a.propString===l.propString&&(a.node.hasKind("morph")&&l.node.hasKind("morph")?a.node.hasEqualMorphs(l.node):a.node.hasKind("intersection")&&l.node.hasKind("intersection")?((u=a.node.structure)==null?void 0:u.structuralMorphRef)===((f=l.node.structure)==null?void 0:f.structuralMorphRef):!1)}}))}onDeepUndeclaredKey(i){return this.onUndeclaredKey({rule:i,deep:!0})}filter(i){return this.constrainIn("predicate",i)}divisibleBy(i){return this.constrain("divisor",i)}matching(i){return this.constrain("pattern",i)}atLeast(i){return this.constrain("min",i)}atMost(i){return this.constrain("max",i)}moreThan(i){return this.constrain("min",Yr(i))}lessThan(i){return this.constrain("max",Yr(i))}atLeastLength(i){return this.constrain("minLength",i)}atMostLength(i){return this.constrain("maxLength",i)}moreThanLength(i){return this.constrain("minLength",Yr(i))}lessThanLength(i){return this.constrain("maxLength",Yr(i))}exactlyLength(i){return this.constrain("exactLength",i)}atOrAfter(i){return this.constrain("after",i)}atOrBefore(i){return this.constrain("before",i)}laterThan(i){return this.constrain("after",Yr(i))}earlierThan(i){return this.constrain("before",Yr(i))}}const P2="Expected a non-empty brand name after #",Yr=t=>typeof t=="object"&&!(t instanceof Date)?{...t,exclusive:!0}:{rule:t,exclusive:!0},so=(t,n)=>le(n,"root")?le(t,"root")?t.extends(n):n.allows(t):le(t,"root")?t.hasUnit(n):n===t,Ky=t=>{var n;return t.hasKind("morph")?null:t.hasKind("intersection")?t.inner.structure??(((n=t.basis)==null?void 0:n.domain)==="object"?t.$.bindReference(Z.intrinsic.emptyStructure):null):t.isBasis()&&t.domain==="object"?t.$.bindReference(Z.intrinsic.emptyStructure):null},W2=t=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
85
- ${t}`,Vy=(t,n)=>`${t} operand must be an object (was ${n})`,zs=(t,n)=>_e(Cd(t),(i,a)=>[a,n]),eC=t=>typeof t=="string"?{reference:t}:t,Hy=t=>t instanceof W?Z.intrinsic.never.internal:t,tC=Fe({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:t=>t.startsWith("$")?t:`$ark.${t}`},resolve:{}},normalize:eC,defaults:{description:t=>t.reference},intersections:{alias:(t,n,i)=>i.$.lazilyResolve(()=>Hy(mt(t.resolution,n.resolution,i)),`${t.reference}${i.pipe?"=>":"&"}${n.reference}`),...zs("alias",(t,n,i)=>n.isUnknown()?t:n.isNever()?n:n.isBasis()&&!n.overlaps(Z.intrinsic.object)?W.init("assignability",Z.intrinsic.object,n):i.$.lazilyResolve(()=>Hy(mt(t.resolution,n,i)),`${t.reference}${i.pipe?"=>":"&"}${n.id}`))}});class nC extends Ls{constructor(){super(...arguments);w(this,"expression",this.reference);w(this,"structure");w(this,"traverseAllows",(i,a)=>{const l=a.seen[this.reference];return l!=null&&l.includes(i)?!0:(a.seen[this.reference]=Be(l,i),this.resolution.traverseAllows(i,a))});w(this,"traverseApply",(i,a)=>{const l=a.seen[this.reference];l!=null&&l.includes(i)||(a.seen[this.reference]=Be(l,i),this.resolution.traverseApply(i,a))})}get resolution(){const i=this._resolve();return an[this.id]=i}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const i=this.reference;let a=an[i];const l=[];for(;le(a,"context");){if(l.includes(a.id))return J(iC(a.id,l));l.push(a.id),a=an[a.id]}return le(a,"root")?a:nt(`Unexpected resolution for reference ${this.reference}
86
- Seen: [${l.join("->")}]
87
- Resolution: ${ze(a)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const i=this.reference.slice(1),a=this.$.resolutions[i];return typeof a=="string"?a:le(a,"root")?a.id:nt(`Unexpected resolution for reference ${this.reference}: ${ze(a)}`)}get defaultShortDescription(){return Jn.object}innerToJsonSchema(i){return this.resolution.toJsonSchemaRecurse(i)}compile(i){const a=this.resolutionId;i.if(`ctx.seen.${a} && ctx.seen.${a}.includes(data)`,()=>i.return(!0)),i.if(`!ctx.seen.${a}`,()=>i.line(`ctx.seen.${a} = []`)),i.line(`ctx.seen.${a}.push(data)`),i.return(i.invoke(a))}}const iC=(t,n)=>`Alias '${t}' has a shallow resolution cycle: ${[...n,t].join("->")}`,Md={implementation:tC,Node:nC};class Ld extends Ls{constructor(){super(...arguments);w(this,"traverseApply",(i,a)=>{this.traverseAllows(i,a)||a.errorFromNodeContext(this.errorContext)})}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Ho(this.errorContext)}compile(i){i.traversalKind==="Allows"?i.return(this.compiledCondition):i.if(this.compiledNegation,()=>i.line(`${i.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const rC=Fe({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:t=>typeof t=="string"?{domain:t}:Nd(t,"numberAllowsNaN")&&t.domain!=="number"?J(zd.writeBadAllowNanMessage(t.domain)):t,applyConfig:(t,n)=>t.numberAllowsNaN===void 0&&t.domain==="number"&&n.numberAllowsNaN?{...t,numberAllowsNaN:!0}:t,defaults:{description:t=>Jn[t.domain],actual:t=>Number.isNaN(t)?"NaN":Jn[hn(t)]},intersections:{domain:(t,n)=>t.domain==="number"&&n.domain==="number"?t.numberAllowsNaN?n:t:W.init("domain",t,n)}});class aC extends Ld{constructor(){super(...arguments);w(this,"requiresNaNCheck",this.domain==="number"&&!this.numberAllowsNaN);w(this,"traverseAllows",this.requiresNaNCheck?i=>typeof i=="number"&&!Number.isNaN(i):i=>hn(i)===this.domain);w(this,"compiledCondition",this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`);w(this,"compiledNegation",this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`);w(this,"expression",this.numberAllowsNaN?"number | NaN":this.domain)}get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return Jn[this.domain]}innerToJsonSchema(i){return this.domain==="bigint"||this.domain==="symbol"?i.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const zd={implementation:rC,Node:aC,writeBadAllowNanMessage:t=>`numberAllowsNaN may only be specified with domain "number" (was ${t})`},sC=Fe({kind:"intersection",hasAssociatedError:!0,normalize:t=>{if(Et(t))return t;const{structure:n,...i}=t,a=!!n,l=n??{},u=_e(i,(f,d)=>Nn(f,F$)?(a&&J(`Flattened structure key ${f} cannot be specified alongside a root 'structure' key.`),l[f]=d,[]):[f,d]);return(le(l,"constraint")||!Ts(l))&&(u.structure=l),u},finalizeInnerJson:({structure:t,...n})=>er(t,"object")?{...t,...n}:n,keys:{domain:{child:!0,parse:(t,n)=>n.$.node("domain",t)},proto:{child:!0,parse:(t,n)=>n.$.node("proto",t)},structure:{child:!0,parse:(t,n)=>n.$.node("structure",t),serialize:t=>{var f;if(!((f=t.sequence)!=null&&f.minLength))return t.collapsibleJson;const{sequence:n,...i}=t.collapsibleJson,{minVariadicLength:a,...l}=n,u=l.variadic&&Object.keys(l).length===1?l.variadic:l;return{...i,sequence:u}}},divisor:{child:!0,parse:Lt("divisor")},max:{child:!0,parse:Lt("max")},min:{child:!0,parse:Lt("min")},maxLength:{child:!0,parse:Lt("maxLength")},minLength:{child:!0,parse:Lt("minLength")},exactLength:{child:!0,parse:Lt("exactLength")},before:{child:!0,parse:Lt("before")},after:{child:!0,parse:Lt("after")},pattern:{child:!0,parse:Lt("pattern")},predicate:{child:!0,parse:Lt("predicate")}},reduce:(t,n)=>Gy({},t,{$:n,invert:!1,pipe:!1}),defaults:{description:t=>{if(t.children.length===0)return"unknown";if(t.structure)return t.structure.description;const n=[];if(t.basis&&!t.refinements.some(i=>i.impl.obviatesBasisDescription)&&n.push(t.basis.description),t.refinements.length){const i=t.refinements.toSorted((a,l)=>a.kind==="min"&&l.kind==="max"?-1:0).map(a=>a.description);n.push(...i)}return t.inner.predicate&&n.push(...t.inner.predicate.map(i=>i.description)),n.join(" and ")},expected:t=>` ◦ ${t.errors.map(n=>n.expected).join(`
88
- ◦ `)}`,problem:t=>`(${t.actual}) must be...
89
- ${t.expected}`},intersections:{intersection:(t,n,i)=>Gy(t.inner,n.inner,i),...zs("intersection",(t,n,i)=>{var m;if(t.children.length===0)return n;const{domain:a,proto:l,...u}=t.inner,f=l??a,d=f?mt(f,n,i):n;return d instanceof W?d:(m=t==null?void 0:t.basis)!=null&&m.equals(d)?t:t.$.node("intersection",{...u,[d.kind]:d},{prereduced:!0})})}});class lC extends Ls{constructor(){super(...arguments);w(this,"basis",this.inner.domain??this.inner.proto??null);w(this,"refinements",this.children.filter(i=>i.isRefinement()));w(this,"structure",this.inner.structure);w(this,"expression",oC(this));w(this,"traverseAllows",(i,a)=>this.children.every(l=>l.traverseAllows(i,a)));w(this,"traverseApply",(i,a)=>{const l=a.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(i,a),a.currentErrorCount>l))){if(this.refinements.length){for(let u=0;u<this.refinements.length-1;u++)if(this.refinements[u].traverseApply(i,a),a.failFast&&a.currentErrorCount>l)return;if(this.refinements.at(-1).traverseApply(i,a),a.currentErrorCount>l)return}if(!(this.structure&&(this.structure.traverseApply(i,a),a.currentErrorCount>l))&&this.inner.predicate){for(let u=0;u<this.inner.predicate.length-1;u++)if(this.inner.predicate[u].traverseApply(i,a),a.failFast&&a.currentErrorCount>l)return;this.inner.predicate.at(-1).traverseApply(i,a)}}})}get shallowMorphs(){var i;return(i=this.inner.structure)!=null&&i.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){var i;return((i=this.basis)==null?void 0:i.defaultShortDescription)??"present"}innerToJsonSchema(i){return this.children.reduce((a,l)=>l.isBasis()?l.toJsonSchemaRecurse(i):l.reduceJsonSchema(a,i),{})}compile(i){if(i.traversalKind==="Allows"){for(const a of this.children)i.check(a);i.return(!0);return}if(i.initializeErrorCount(),this.basis&&(i.check(this.basis),this.children.length>1&&i.returnIfFail()),this.refinements.length){for(let a=0;a<this.refinements.length-1;a++)i.check(this.refinements[a]),i.returnIfFailFast();i.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&i.returnIfFail()}if(this.structure&&(i.check(this.structure),this.inner.predicate&&i.returnIfFail()),this.inner.predicate){for(let a=0;a<this.inner.predicate.length-1;a++)i.check(this.inner.predicate[a]),i.returnIfFail();i.check(this.inner.predicate.at(-1))}}}const c0={implementation:sC,Node:lC},oC=t=>{var i;let n=((i=t.structure)==null?void 0:i.expression)||`${t.basis&&!t.refinements.some(a=>a.impl.obviatesBasisExpression)?t.basis.nestableExpression+" ":""}${t.refinements.map(a=>a.expression).join(" & ")}`||"unknown";return n==="Array == 0"&&(n="[]"),n},Gy=(t,n,i)=>{const a={},l=t.proto??t.domain,u=n.proto??n.domain,f=l?u?mt(l,u,i):l:u;return f instanceof W?f:(f&&(a[f.kind]=f),Ao({kind:"intersection",baseInner:a,l:$o(t),r:$o(n),roots:[],ctx:i}))},uC=Fe({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(t,n)=>n.$.parseSchema(t)},morphs:{parse:Cs,serialize:t=>t.map(n=>le(n,"root")?n.json:$t(n))},declaredIn:{child:!1,serialize:t=>t.json},declaredOut:{child:!1,serialize:t=>t.json}},normalize:t=>t,defaults:{description:t=>{var n;return`a morph from ${t.in.description} to ${((n=t.out)==null?void 0:n.description)??"unknown"}`}},intersections:{morph:(t,n,i)=>{if(!t.hasEqualMorphs(n))return J(fC(t.expression,n.expression));const a=mt(t.in,n.in,i);if(a instanceof W)return a;const l={morphs:t.morphs};if(t.declaredIn||n.declaredIn){const u=mt(t.in,n.in,i);if(u instanceof W)return u.throw();l.declaredIn=u}if(t.declaredOut||n.declaredOut){const u=mt(t.out,n.out,i);if(u instanceof W)return u.throw();l.declaredOut=u}return a.distribute(u=>i.$.node("morph",{...l,in:u}),i.$.parseSchema)},...zs("morph",(t,n,i)=>{const a=t.inner.in?mt(t.inner.in,n,i):n;return a instanceof W?a:a.equals(t.inner.in)?t:i.$.node("morph",{...t.inner,in:a})})}});class cC extends Ls{constructor(){super(...arguments);w(this,"serializedMorphs",this.morphs.map($t));w(this,"compiledMorphs",`[${this.serializedMorphs}]`);w(this,"lastMorph",this.inner.morphs.at(-1));w(this,"lastMorphIfNode",le(this.lastMorph,"root")?this.lastMorph:void 0);w(this,"introspectableIn",this.inner.in);w(this,"introspectableOut",this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0);w(this,"expression",`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`);w(this,"traverseAllows",(i,a)=>!this.introspectableIn||this.introspectableIn.traverseAllows(i,a));w(this,"traverseApply",(i,a)=>{this.introspectableIn&&this.introspectableIn.traverseApply(i,a),a.queueMorphs(this.morphs)})}get shallowMorphs(){var i;return Array.isArray((i=this.inner.in)==null?void 0:i.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){var i;return this.declaredIn??((i=this.inner.in)==null?void 0:i.in)??Z.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??Z.intrinsic.unknown.internal}declareIn(i){return this.$.node("morph",{...this.inner,declaredIn:i})}declareOut(i){return this.$.node("morph",{...this.inner,declaredOut:i})}get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(i){var a;return i.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(i),out:((a=this.introspectableOut)==null?void 0:a.toJsonSchemaRecurse(i))??null})}compile(i){if(i.traversalKind==="Allows"){if(!this.introspectableIn)return;i.return(i.invoke(this.introspectableIn));return}this.introspectableIn&&i.line(i.invoke(this.introspectableIn)),i.line(`ctx.queueMorphs(${this.compiledMorphs})`)}hasEqualMorphs(i){return Xr(this.morphs,i.morphs,{isEqual:(a,l)=>a===l||le(a,"root")&&le(l,"root")&&a.equals(l)})}}const f0={implementation:uC,Node:cC},fC=(t,n)=>`The intersection of distinct morphs at a single path is indeterminate:
90
- Left: ${t}
91
- Right: ${n}`,dC=Fe({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:t=>Rd(t)??Xi(t)},dateAllowsInvalid:{}},normalize:t=>{const n=typeof t=="string"?{proto:Wr[t]}:typeof t=="function"?Et(t)?t:{proto:t}:typeof t.proto=="string"?{...t,proto:Wr[t.proto]}:t;return typeof n.proto!="function"&&J(To.writeInvalidSchemaMessage(n.proto)),Nd(n,"dateAllowsInvalid")&&n.proto!==Date&&J(To.writeBadInvalidDateMessage(n.proto)),n},applyConfig:(t,n)=>t.dateAllowsInvalid===void 0&&t.proto===Date&&n.dateAllowsInvalid?{...t,dateAllowsInvalid:!0}:t,defaults:{description:t=>t.builtinName?d$[t.builtinName]:`an instance of ${t.proto.name}`,actual:t=>t instanceof Date&&t.toString()==="Invalid Date"?"an invalid Date":Gf(t)},intersections:{proto:(t,n)=>t.proto===Date&&n.proto===Date?t.dateAllowsInvalid?n:t:jy(t.proto,n.proto)?t:jy(n.proto,t.proto)?n:W.init("proto",t,n),domain:(t,n)=>n.domain==="object"?t:W.init("domain",Z.intrinsic.object.internal,n)}});class hC extends Ld{constructor(){super(...arguments);w(this,"builtinName",Rd(this.proto));w(this,"serializedConstructor",this.json.proto);w(this,"requiresInvalidDateCheck",this.proto===Date&&!this.dateAllowsInvalid);w(this,"traverseAllows",this.requiresInvalidDateCheck?i=>i instanceof Date&&i.toString()!=="Invalid Date":i=>i instanceof this.proto);w(this,"compiledCondition",`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`);w(this,"compiledNegation",`!(${this.compiledCondition})`);w(this,"expression",this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name);w(this,"domain","object")}innerToJsonSchema(i){var a,l;switch(this.builtinName){case"Array":return{type:"array"};case"Date":return((l=(a=i.fallback).date)==null?void 0:l.call(a,{code:"date",base:{}}))??i.fallback.proto({code:"proto",base:{},proto:this.proto});default:return i.fallback.proto({code:"proto",base:{},proto:this.proto})}}get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}get defaultShortDescription(){return this.description}}const To={implementation:dC,Node:hC,writeBadInvalidDateMessage:t=>`dateAllowsInvalid may only be specified with constructor Date (was ${t.name})`,writeInvalidSchemaMessage:t=>`instanceOf operand must be a function (was ${hn(t)})`},pC=Fe({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(t,n)=>{const i=[];for(const a of t){const l=le(a,"root")?a.branches:n.$.parseSchema(a).branches;for(const u of l)if(u.hasKind("morph")){const f=i.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(u));if(f===-1)i.push(u);else{const d=i[f];i[f]=n.$.node("morph",{...d.inner,in:d.in.rawOr(u.in)})}}else i.push(u)}return n.def.ordered||i.sort((a,l)=>a.hash<l.hash?-1:1),i}}},normalize:t=>kt(t)?{branches:t}:t,reduce:(t,n)=>{const i=RC(t);if(i.length===1)return i[0];if(i.length!==t.branches.length)return n.node("union",{...t,branches:i},{prereduced:!0})},defaults:{description:t=>t.distribute(n=>n.description,Qr),expected:t=>{const n=XA(t.errors,"propString"),i=Object.entries(n).map(([a,l])=>{const u=[];for(const m of l)Fi(u,m.expected);const f=Qr(u),d=l.every(m=>m.actual===l[0].actual)?l[0].actual:ze(l[0].data);return`${a&&`${a} `}must be ${f}${d&&` (was ${d})`}`});return Qr(i)},problem:t=>t.expected,message:t=>t.problem},intersections:{union:(t,n,i)=>{if(t.isNever!==n.isNever)return W.init("presence",t,n);let a;return t.ordered?(n.ordered&&J(AC(t.expression,n.expression)),a=Ef(n.branches,t.branches,i),a instanceof W&&a.invert()):a=Ef(t.branches,n.branches,i),a instanceof W?a:i.$.parseSchema(t.ordered||n.ordered?{branches:a,ordered:!0}:{branches:a})},...zs("union",(t,n,i)=>{const a=Ef(t.branches,[n],i);return a instanceof W?a:a.length===1?a[0]:i.$.parseSchema(t.ordered?{branches:a,ordered:!0}:{branches:a})})}});class mC extends Ls{constructor(){super(...arguments);w(this,"isBoolean",this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0));w(this,"unitBranches",this.branches.filter(i=>i.in.hasKind("unit")));w(this,"discriminant",this.discriminate());w(this,"discriminantJson",this.discriminant?wC(this.discriminant):null);w(this,"expression",this.distribute(i=>i.nestableExpression,kC));w(this,"traverseAllows",(i,a)=>this.branches.some(l=>l.traverseAllows(i,a)));w(this,"traverseApply",(i,a)=>{const l=[];for(let u=0;u<this.branches.length;u++){if(a.pushBranch(),this.branches[u].traverseApply(i,a),!a.hasError())return this.branches[u].includesTransform?a.queuedMorphs.push(...a.popBranch().queuedMorphs):a.popBranch();l.push(a.popBranch().error)}a.errorFromNodeContext({code:"union",errors:l,meta:this.meta})});w(this,"traverseOptimistic",i=>{for(let a=0;a<this.branches.length;a++){const l=this.branches[a];if(l.traverseAllows(i))return l.contextFreeMorph?l.contextFreeMorph(i):i}return qn})}get branchGroups(){const i=[];let a=-1;for(const l of this.branches){if(l.hasKind("unit")&&l.domain==="boolean"){a===-1?(a=i.length,i.push(l)):i[a]=Z.intrinsic.boolean;continue}i.push(l)}return i}createBranchedOptimisticRootApply(){return(i,a)=>{const l=this.traverseOptimistic(i);if(l!==qn)return l;const u=new Ir(i,this.$.resolvedConfig);return this.traverseApply(i,u),u.finalize(a)}}get shallowMorphs(){return this.branches.reduce((i,a)=>Fi(i,a.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(i=>i.defaultShortDescription,Qr)}innerToJsonSchema(i){if(this.branchGroups.length===1&&this.branchGroups[0].equals(Z.intrinsic.boolean))return{type:"boolean"};const a=this.branchGroups.map(l=>l.toJsonSchemaRecurse(i));return a.every(l=>Object.keys(l).length===1&&Nd(l,"const"))?{enum:a.map(l=>l.const)}:{anyOf:a}}compile(i){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(i);let a=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(a=`typeof ${a} === "object" ? ${a} === null ? "null" : "object" : typeof ${a} === "function" ? "object" : typeof ${a}`);const l=this.discriminant.cases,u=Object.keys(l),{optimistic:f}=i;if(i.optimistic=!1,i.block(`switch(${a})`,()=>{for(const v in l){const b=l[v],R=v==="default"?v:`case ${v}`;i.line(`${R}: return ${b===!0?f?i.data:b:f?`${i.invoke(b)} ? ${b.contextFreeMorph?`${$t(b.contextFreeMorph)}(${i.data})`:i.data} : "${qn}"`:i.invoke(b)}`)}return i}),i.traversalKind==="Allows"){i.return(f?`"${qn}"`:!1);return}const d=Qr(this.discriminant.kind==="domain"?u.map(v=>{const b=v.slice(1,-1);return b==="function"?Jn.object:Jn[b]}):u),m=this.discriminant.path.map(v=>typeof v=="symbol"?$t(v):JSON.stringify(v)),p=JSON.stringify(d),g=this.discriminant.kind==="domain"?`${xC}[${a}]`:`${SC}(${a})`;i.line(`ctx.errorFromNodeContext({
92
- code: "predicate",
93
- expected: ${p},
94
- actual: ${g},
95
- relativePath: [${m}],
96
- meta: ${this.compiledMeta}
97
- })`)}compileIndiscriminable(i){if(i.traversalKind==="Apply"){i.const("errors","[]");for(const a of this.branches)i.line("ctx.pushBranch()").line(i.invoke(a)).if("!ctx.hasError()",()=>i.return(a.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");i.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:a}=i;i.optimistic=!1;for(const l of this.branches)i.if(`${i.invoke(l)}`,()=>i.return(a?l.contextFreeMorph?`${$t(l.contextFreeMorph)}(${i.data})`:i.data:!0));i.return(a?`"${qn}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){var f,d;if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const m=_e(this.unitBranches,(p,g)=>[`${g.in.serializedValue}`,g.hasKind("morph")?g:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:m}}const i=[];for(let m=0;m<this.branches.length-1;m++){const p=this.branches[m];for(let g=m+1;g<this.branches.length;g++){const v=this.branches[g],b=Zn(p.in,v.in,p.$);if(b instanceof W)for(const R of b){if(!R.kind||R.optional)continue;let N,O;if(R.kind==="domain"){const z=R.l,L=R.r;N=`"${typeof z=="string"?z:z.domain}"`,O=`"${typeof L=="string"?L:L.domain}"`}else if(R.kind==="unit")N=R.l.serializedValue,O=R.r.serializedValue;else continue;const U=i.find(z=>Xr(z.path,R.path)&&z.kind===R.kind);U?(U.cases[N]?U.cases[N].branchIndices=Fi(U.cases[N].branchIndices,m):(f=U.cases)[N]??(f[N]={branchIndices:[m],condition:R.l}),U.cases[O]?U.cases[O].branchIndices=Fi(U.cases[O].branchIndices,g):(d=U.cases)[O]??(d[O]={branchIndices:[g],condition:R.r})):i.push({kind:R.kind,cases:{[N]:{branchIndices:[m],condition:R.l},[O]:{branchIndices:[g],condition:R.r}},path:R.path})}}}const a=this.ordered?vC(i,this.branches):i;if(!a.length)return null;const l=gC(a,this),u={};for(const m in l.best.cases){const p=yC(l,m);if(p===null){u[m]=!0;continue}if(p.length===this.branches.length)return null;this.ordered&&p.sort((b,R)=>b.originalIndex-R.originalIndex);const g=p.map(b=>b.branch),v=g.length===1?g[0]:this.$.node("union",this.ordered?{branches:g,ordered:!0}:g);Object.assign(this.referencesById,v.referencesById),u[m]=v}if(l.defaultEntries.length){const m=l.defaultEntries.map(p=>p.branch);u.default=this.$.node("union",this.ordered?{branches:m,ordered:!0}:m,{prereduced:!0}),Object.assign(this.referencesById,u.default.referencesById)}return Object.assign(l.location,{cases:u})}}const gC=(t,n)=>{const i=t.sort((u,f)=>Object.keys(f.cases).length-Object.keys(u.cases).length)[0],a={kind:i.kind,path:i.path,optionallyChainedPropString:d0(i.path)},l=n.branches.map((u,f)=>({originalIndex:f,branch:u}));return{best:i,location:a,defaultEntries:l,node:n}},yC=(t,n)=>{const i=t.best.cases[n],a=bC(i.condition,t.location.path,t.node.$);let l=[];const u=[];for(let f=0;f<t.defaultEntries.length;f++){const d=t.defaultEntries[f];if(i.branchIndices.includes(d.originalIndex)){const m=Jy(t.node.branches[d.originalIndex],t.location);m===null?l=null:l==null||l.push({originalIndex:d.originalIndex,branch:m})}else if(d.branch.hasKind("alias")&&a.hasKind("domain")&&a.domain==="object")l==null||l.push(d);else{if(d.branch.in.overlaps(a)){const m=Jy(d.branch,t.location);l==null||l.push({originalIndex:d.originalIndex,branch:m})}u.push(d)}}return t.defaultEntries=u,l},vC=(t,n)=>t.filter(a=>{const l=Object.values(a.cases).map(u=>u.branchIndices);for(let u=0;u<l.length-1;u++){const f=l[u];for(let d=u+1;d<l.length;d++){const m=l[d];for(const p of f)for(const g of m)if(p>g&&n[p].overlaps(n[g]))return!1}}return!0}),bC=(t,n,i)=>{let a=t==="undefined"?i.node("unit",{unit:void 0}):t==="null"?i.node("unit",{unit:null}):t==="boolean"?i.units([!0,!1]):t;for(let l=n.length-1;l>=0;l--){const u=n[l];a=i.node("intersection",typeof u=="number"?{proto:"Array",sequence:[...QA(u).map(f=>({})),a]}:{domain:"object",required:[{key:u,value:a}]})}return a},d0=t=>t.reduce((n,i)=>n+Mb(i,!0),"data"),xC=$t(PA),SC=$t(ze),h0={implementation:pC,Node:mC},wC=t=>({kind:t.kind,path:t.path.map(n=>typeof n=="string"?n:Ms(n)),cases:_e(t.cases,(n,i)=>[n,i===!0?i:i.hasKind("union")&&i.discriminantJson?i.discriminantJson:i.json])}),NC={delimiter:" | ",finalDelimiter:" | "},kC=t=>Qr(t,NC),Qr=(t,n)=>{const i=(n==null?void 0:n.delimiter)??", ",a=(n==null?void 0:n.finalDelimiter)??" or ";if(t.length===0)return"never";if(t.length===1)return t[0];if(t.length===2&&t[0]==="false"&&t[1]==="true"||t[0]==="true"&&t[1]==="false")return"boolean";const l={},u=t.filter(d=>l[d]?!1:l[d]=!0),f=u.pop();return`${u.join(i)}${u.length?a:""}${f}`},Ef=(t,n,i)=>{const a=n.map(()=>[]);for(let u=0;u<t.length;u++){let f={};for(let d=0;d<n.length;d++){if(a[d]===null)continue;if(t[u].equals(n[d])){a[d]=null,f={};break}const m=mt(t[u],n[d],i);if(!(m instanceof W)){if(m.equals(t[u])){a[d].push(t[u]),f={};break}m.equals(n[d])?a[d]=null:f[d]=m}}for(const d in f)a[d][u]=f[d]}const l=a.flatMap((u,f)=>(u==null?void 0:u.flatMap(d=>d.branches))??n[f]);return l.length===0?W.init("union",t,n):l},RC=({branches:t,ordered:n})=>{if(t.length<2)return t;const i=t.map(()=>!0);for(let a=0;a<t.length;a++)for(let l=a+1;l<t.length&&i[a]&&i[l];l++){if(t[a].equals(t[l])){i[l]=!1;continue}const u=Zn(t[a].in,t[l].in,t[0].$);u instanceof W||(n||EC(t[a],t[l]),u.equals(t[a].in)?i[a]=!!n:u.equals(t[l].in)&&(i[l]=!1))}return t.filter((a,l)=>i[l])},EC=(t,n)=>{!t.includesTransform&&!n.includesTransform||(Xr(t.shallowMorphs,n.shallowMorphs)||J(Yy(t.expression,n.expression)),Xr(t.flatMorphs,n.flatMorphs,{isEqual:(i,a)=>{var l,u;return i.propString===a.propString&&(i.node.hasKind("morph")&&a.node.hasKind("morph")?i.node.hasEqualMorphs(a.node):i.node.hasKind("intersection")&&a.node.hasKind("intersection")?((l=i.node.structure)==null?void 0:l.structuralMorphRef)===((u=a.node.structure)==null?void 0:u.structuralMorphRef):!1)}})||J(Yy(t.expression,n.expression)))},Jy=(t,n)=>t.transform((i,a)=>i==="domain"||i==="unit"?null:a,{shouldTransform:(i,a)=>{const l=d0(a.path);return n.optionallyChainedPropString.startsWith(l)?i.hasKind("domain")&&i.domain==="object"||(i.hasKind("domain")||n.kind==="unit")&&l===n.optionallyChainedPropString?!0:i.children.length!==0&&i.kind!=="index":!1}}),Yy=(t,n)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
98
- Left: ${t}
99
- Right: ${n}`,AC=(t,n)=>`The intersection of two ordered unions is indeterminate:
100
- Left: ${t}
101
- Right: ${n}`,$C=Fe({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:t=>t instanceof Date?t.toISOString():Xi(t)}},normalize:t=>t,defaults:{description:t=>ze(t.unit),problem:({expected:t,actual:n})=>`${t===n?`must be reference equal to ${t} (serialized to the same value)`:`must be ${t} (was ${n})`}`},intersections:{unit:(t,n)=>W.init("unit",t,n),...zs("unit",(t,n)=>{if(n.allows(t.unit))return t;const i=n.hasKind("intersection")?n.basis:n;if(i){const a=i.hasKind("domain")?i:Z.intrinsic.object;if(t.domain!==a.domain){const l=t.domain==="undefined"||t.domain==="null"||t.domain==="boolean"?t.domain:Z.intrinsic[t.domain];return W.init("domain",l,a)}}return W.init("assignability",t,n.hasKind("intersection")?n.children.find(a=>!a.allows(t.unit)):n)})}});class CC extends Ld{constructor(){super(...arguments);w(this,"compiledValue",this.json.unit);w(this,"serializedValue",typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`);w(this,"compiledCondition",Iy(this.unit,this.serializedValue));w(this,"compiledNegation",Iy(this.unit,this.serializedValue,"negated"));w(this,"expression",ze(this.unit));w(this,"domain",hn(this.unit));w(this,"traverseAllows",this.unit instanceof Date?i=>i instanceof Date&&i.toISOString()===this.compiledValue:Number.isNaN(this.unit)?i=>Number.isNaN(i):i=>i===this.unit)}get defaultShortDescription(){return this.domain==="object"?Jn.object:this.description}innerToJsonSchema(i){return this.unit===null?{type:"null"}:Z.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:i.fallback.unit({code:"unit",base:{},unit:this.unit})}}const p0={implementation:$C,Node:CC},Iy=(t,n,i)=>{if(t instanceof Date){const a=`data instanceof Date && data.toISOString() === ${n}`;return i?`!(${a})`:a}return Number.isNaN(t)?`${i?"!":""}Number.isNaN(data)`:`data ${i?"!":"="}== ${n}`},TC=Fe({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(t,n)=>{const i=n.$.parseSchema(t);if(!i.extends(Z.intrinsic.key))return J(DC(i.expression));const a=i.branches.filter(l=>l.hasKind("unit"));return a.length?J(jC(a.map(l=>ze(l.unit)))):i}},value:{child:!0,parse:(t,n)=>n.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`[${t.signature.expression}]: ${t.value.description}`},intersections:{index:(t,n,i)=>{if(t.signature.equals(n.signature)){const a=mt(t.value,n.value,i),l=a instanceof W?Z.intrinsic.never.internal:a;return i.$.node("index",{signature:t.signature,value:l})}return t.signature.extends(n.signature)&&t.value.subsumes(n.value)?n:n.signature.extends(t.signature)&&n.value.subsumes(t.value)?t:null}}});class OC extends la{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.object.internal);w(this,"expression",`[${this.signature.expression}]: ${this.value.expression}`);w(this,"flatRefs",Be(this.value.flatRefs.map(i=>Ni([this.signature,...i.path],i.node)),Ni([this.signature],this.value)));w(this,"traverseAllows",(i,a)=>No(i).every(l=>this.signature.traverseAllows(l[0],a)?In(l[0],()=>this.value.traverseAllows(l[1],a),a):!0));w(this,"traverseApply",(i,a)=>{for(const l of No(i))this.signature.traverseAllows(l[0],a)&&In(l[0],()=>this.value.traverseApply(l[1],a),a)})}_transform(i,a){a.path.push(this.signature);const l=super._transform(i,a);return a.path.pop(),l}compile(){}}const m0={implementation:TC,Node:OC},jC=t=>`Index keys ${t.join(", ")} should be specified as named props.`,DC=t=>`Indexed key definition '${t}' must be a string or symbol`,MC=Fe({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,n)=>n.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`${t.compiledKey}: ${t.value.description}`,expected:t=>t.missingValueDescription,actual:()=>"missing"},intersections:{required:ed,optional:ed}});class LC extends l0{constructor(){super(...arguments);w(this,"expression",`${this.compiledKey}: ${this.value.expression}`);w(this,"errorContext",Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta}));w(this,"compiledErrorContext",Ho(this.errorContext))}}const g0={implementation:MC,Node:LC},zC=Fe({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(t,n)=>{if(t.length!==0)return t.map(i=>n.$.parseSchema(i))}},optionals:{child:!0,parse:(t,n)=>{if(t.length!==0)return t.map(i=>n.$.parseSchema(i))}},defaultables:{child:t=>t.map(n=>n[0]),parse:(t,n)=>{if(t.length!==0)return t.map(i=>{const a=n.$.parseSchema(i[0]);return Dd(a,i[1],null),[a,i[1]]})},serialize:t=>t.map(n=>[n[0].collapsibleJson,Xi(n[1])])},variadic:{child:!0,parse:(t,n)=>n.$.parseSchema(t,n)},minVariadicLength:{parse:t=>t===0?void 0:t},postfix:{child:!0,parse:(t,n)=>{if(t.length!==0)return t.map(i=>n.$.parseSchema(i))}}},normalize:t=>{var n,i,a;if(typeof t=="string")return{variadic:t};if("variadic"in t||"prefix"in t||"defaultables"in t||"optionals"in t||"postfix"in t||"minVariadicLength"in t){if((n=t.postfix)!=null&&n.length){if(!t.variadic)return J(qC);if((i=t.optionals)!=null&&i.length||(a=t.defaultables)!=null&&a.length)return J(v0)}return t.minVariadicLength&&!t.variadic?J("minVariadicLength may not be specified without a variadic element"):t}return{variadic:t}},reduce:(t,n)=>{var d,m,p,g,v,b,R;let i=t.minVariadicLength??0;const a=((d=t.prefix)==null?void 0:d.slice())??[],l=((m=t.defaultables)==null?void 0:m.slice())??[],u=((p=t.optionals)==null?void 0:p.slice())??[],f=((g=t.postfix)==null?void 0:g.slice())??[];if(t.variadic){for(;(v=u.at(-1))!=null&&v.equals(t.variadic);)u.pop();if(u.length===0&&l.length===0)for(;(b=a.at(-1))!=null&&b.equals(t.variadic);)a.pop(),i++;for(;(R=f[0])!=null&&R.equals(t.variadic);)f.shift(),i++}else u.length===0&&l.length===0&&a.push(...f.splice(0));if(i!==t.minVariadicLength||t.prefix&&t.prefix.length!==a.length)return n.node("sequence",{...t,prefix:a,defaultables:l,optionals:u,postfix:f,minVariadicLength:i},{prereduced:!0})},defaults:{description:t=>t.isVariadicOnly?`${t.variadic.nestableExpression}[]`:`[${t.tuple.map(i=>i.kind==="defaultables"?`${i.node.nestableExpression} = ${ze(i.default)}`:i.kind==="optionals"?`${i.node.nestableExpression}?`:i.kind==="variadic"?`...${i.node.nestableExpression}[]`:i.node.expression).join(", ")}]`},intersections:{sequence:(t,n,i)=>{const a=ms({l:t.tuple,r:n.tuple,disjoint:new W,result:[],fixedVariants:[],ctx:i}),l=a.disjoint.length===0?[a,...a.fixedVariants]:a.fixedVariants;return l.length===0?a.disjoint:l.length===1?i.$.node("sequence",Zy(l[0].result)):i.$.node("union",l.map(u=>({proto:Array,sequence:Zy(u.result)})))}}});var Vv,Hv,Gv,Jv;class UC extends la{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.Array.internal);w(this,"tuple",_C(this.inner));w(this,"prefixLength",((Vv=this.prefix)==null?void 0:Vv.length)??0);w(this,"defaultablesLength",((Hv=this.defaultables)==null?void 0:Hv.length)??0);w(this,"optionalsLength",((Gv=this.optionals)==null?void 0:Gv.length)??0);w(this,"postfixLength",((Jv=this.postfix)==null?void 0:Jv.length)??0);w(this,"defaultablesAndOptionals",[]);w(this,"prevariadic",this.tuple.filter(i=>i.kind==="defaultables"||i.kind==="optionals"?(this.defaultablesAndOptionals.push(i.node),!0):i.kind==="prefix"));w(this,"variadicOrPostfix",Zi(this.variadic&&[this.variadic],this.postfix));w(this,"flatRefs",this.addFlatRefs());w(this,"isVariadicOnly",this.prevariadic.length+this.postfixLength===0);w(this,"minVariadicLength",this.inner.minVariadicLength??0);w(this,"minLength",this.prefixLength+this.minVariadicLength+this.postfixLength);w(this,"minLengthNode",this.minLength===0?null:this.$.node("minLength",this.minLength));w(this,"maxLength",this.variadic?null:this.tuple.length);w(this,"maxLengthNode",this.maxLength===null?null:this.$.node("maxLength",this.maxLength));w(this,"impliedSiblings",this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[]);w(this,"defaultValueMorphs",BC(this));w(this,"defaultValueMorphsReference",this.defaultValueMorphs.length?$t(this.defaultValueMorphs):void 0);w(this,"traverseAllows",(i,a)=>{for(let l=0;l<i.length;l++)if(!this.elementAtIndex(i,l).node.traverseAllows(i[l],a))return!1;return!0});w(this,"traverseApply",(i,a)=>{let l=0;for(;l<i.length;l++)In(l,()=>this.elementAtIndex(i,l).node.traverseApply(i[l],a),a)});w(this,"expression",this.description)}addFlatRefs(){return Uy(this.flatRefs,this.prevariadic.flatMap((i,a)=>Be(i.node.flatRefs.map(l=>Ni([`${a}`,...l.path],l.node)),Ni([`${a}`],i.node)))),Uy(this.flatRefs,this.variadicOrPostfix.flatMap(i=>Be(i.flatRefs.map(a=>Ni([Z.intrinsic.nonNegativeIntegerString.internal,...a.path],a.node)),Ni([Z.intrinsic.nonNegativeIntegerString.internal],i)))),this.flatRefs}elementAtIndex(i,a){if(a<this.prevariadic.length)return this.tuple[a];const l=i.length-this.postfixLength;return a>=l?{kind:"postfix",node:this.postfix[a-l]}:{kind:"variadic",node:this.variadic??nt(`Unexpected attempt to access index ${a} on ${this}`)}}get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(i){if(this.prefix)for(const[a,l]of this.prefix.entries())i.traverseKey(`${a}`,`data[${a}]`,l);for(const[a,l]of this.defaultablesAndOptionals.entries()){const u=`${a+this.prefixLength}`;i.if(`${u} >= ${i.data}.length`,()=>i.traversalKind==="Allows"?i.return(!0):i.return()),i.traverseKey(u,`data[${u}]`,l)}if(this.variadic&&(this.postfix&&i.const("firstPostfixIndex",`${i.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),i.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>i.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[a,l]of this.postfix.entries()){const u=`firstPostfixIndex + ${a}`;i.traverseKey(u,`data[${u}]`,l)}i.traversalKind==="Allows"&&i.return(!0)}_transform(i,a){a.path.push(Z.intrinsic.nonNegativeIntegerString.internal);const l=super._transform(i,a);return a.path.pop(),l}reduceJsonSchema(i,a){if(this.prevariadic.length&&(i.prefixItems=this.prevariadic.map(l=>{const u=l.node.toJsonSchemaRecurse(a);if(l.kind==="defaultables"){const f=typeof l.default=="function"?l.default():l.default;u.default=Z.intrinsic.jsonData.allows(f)?f:a.fallback.defaultValue({code:"defaultValue",base:u,value:f})}return u})),this.minLength&&(i.minItems=this.minLength),this.variadic){const l=Object.assign(i,{items:this.variadic.toJsonSchemaRecurse(a)});if(this.maxLength&&(l.maxItems=this.maxLength),this.postfix){const u=this.postfix.map(f=>f.toJsonSchemaRecurse(a));i=a.fallback.arrayPostfix({code:"arrayPostfix",base:l,elements:u})}}else i.items=!1,delete i.maxItems;return i}}const Af={},BC=t=>{if(!t.defaultables)return[];const n=[];let i="[";const a=t.prefixLength+t.defaultablesLength-1;for(let l=t.prefixLength;l<=a;l++){const[u,f]=t.defaultables[l-t.prefixLength];n.push(u0(l,u,f)),i+=`${l}: ${u.id} = ${Xi(f)}, `}return i+="]",Af[i]??(Af[i]=n)},y0={implementation:zC,Node:UC},_C=t=>{const n=[];if(t.prefix)for(const i of t.prefix)n.push({kind:"prefix",node:i});if(t.defaultables)for(const[i,a]of t.defaultables)n.push({kind:"defaultables",node:i,default:a});if(t.optionals)for(const i of t.optionals)n.push({kind:"optionals",node:i});if(t.variadic&&n.push({kind:"variadic",node:t.variadic}),t.postfix)for(const i of t.postfix)n.push({kind:"postfix",node:i});return n},Zy=t=>t.reduce((n,i)=>(i.kind==="variadic"?n.variadic=i.node:i.kind==="defaultables"?n.defaultables=Be(n.defaultables,[[i.node,i.default]]):n[i.kind]=Be(n[i.kind],i.node),n),{}),v0="A postfix required element cannot follow an optional or defaultable element",qC="A postfix element requires a variadic element",ms=t=>{var v,b;const[n,...i]=t.l,[a,...l]=t.r;if(!n||!a)return t;const u=((v=i.at(-1))==null?void 0:v.kind)==="postfix",f=((b=l.at(-1))==null?void 0:b.kind)==="postfix",d=n.kind==="prefix"||a.kind==="prefix"?"prefix":n.kind==="postfix"||a.kind==="postfix"?"postfix":n.kind==="variadic"&&a.kind==="variadic"?"variadic":u||f?"prefix":n.kind==="defaultables"||a.kind==="defaultables"?"defaultables":"optionals";if(n.kind==="prefix"&&a.kind==="variadic"&&f){const R=ms({...t,fixedVariants:[],r:l.map(N=>({...N,kind:"prefix"}))});R.disjoint.length===0&&t.fixedVariants.push(R)}else if(a.kind==="prefix"&&n.kind==="variadic"&&u){const R=ms({...t,fixedVariants:[],l:i.map(N=>({...N,kind:"prefix"}))});R.disjoint.length===0&&t.fixedVariants.push(R)}const m=mt(n.node,a.node,t.ctx);if(m instanceof W)if(d==="prefix"||d==="postfix")t.disjoint.push(...m.withPrefixKey(d==="prefix"?t.result.length:`-${i.length+1}`,"required")),t.result=[...t.result,{kind:d,node:Z.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?t:ms({...t,fixedVariants:[],l:i.map(R=>({...R,kind:"prefix"})),r:i.map(R=>({...R,kind:"prefix"}))});else d==="defaultables"?(n.kind==="defaultables"&&a.kind==="defaultables"&&n.default!==a.default&&J(o0(n.default,a.default)),t.result=[...t.result,{kind:d,node:m,default:n.kind==="defaultables"?n.default:a.kind==="defaultables"?a.default:nt(`Unexpected defaultable intersection from ${n.kind} and ${a.kind} elements.`)}]):t.result=[...t.result,{kind:d,node:m}];const p=t.l.length,g=t.r.length;return(n.kind!=="variadic"||p>=g&&(a.kind==="variadic"||g===1))&&(t.l=i),(a.kind!=="variadic"||g>=p&&(n.kind==="variadic"||p===1))&&(t.r=l),ms(t)},b0=t=>n=>{var i,a;if(n.props.length||n.index){const l=((i=n.index)==null?void 0:i.map(f=>f[t]))??[];for(const f of n.props)l.push(f[t]);n.undeclared&&l.push(`+ (undeclared): ${n.undeclared}`);const u=`{ ${l.join(", ")} }`;return n.sequence?`${u} & ${n.sequence.description}`:u}return((a=n.sequence)==null?void 0:a.description)??"{}"},KC=b0("description"),VC=b0("expression"),Qy=(t,n,i)=>{const a=t.required?"required":"optional";if(!n.signature.allows(t.key))return null;const l=Zn(t.value,n.value,i);return l instanceof W?a==="optional"?i.node("optional",{key:t.key,value:Z.intrinsic.never.internal}):l.withPrefixKey(t.key,t.kind):null},HC=Fe({kind:"structure",hasAssociatedError:!1,normalize:t=>t,applyConfig:(t,n)=>!t.undeclared&&n.onUndeclaredKey!=="ignore"?{...t,undeclared:n.onUndeclaredKey}:t,keys:{required:{child:!0,parse:Lt("required"),reduceIo:(t,n,i)=>{n.required=Be(n.required,i.map(a=>a[t]))}},optional:{child:!0,parse:Lt("optional"),reduceIo:(t,n,i)=>{if(t==="in"){n.optional=i.map(a=>a.in);return}for(const a of i)n[a.outProp.kind]=Be(n[a.outProp.kind],a.outProp.out)}},index:{child:!0,parse:Lt("index")},sequence:{child:!0,parse:Lt("sequence")},undeclared:{parse:t=>t==="ignore"?void 0:t,reduceIo:(t,n,i)=>{i==="delete"&&(t==="in"?delete n.undeclared:n.undeclared="reject")}}},defaults:{description:KC},intersections:{structure:(t,n,i)=>{const a={...t.inner},l={...n.inner},u=new W;if(t.undeclared){const m=t.keyof();for(const p of n.requiredKeys)m.allows(p)||u.add("presence",Z.intrinsic.never.internal,n.propsByKey[p].value,{path:[p]});l.optional&&(l.optional=l.optional.filter(p=>m.allows(p.key))),l.index&&(l.index=l.index.flatMap(p=>{if(p.signature.extends(m))return p;const g=Zn(m,p.signature,i.$);if(g instanceof W)return[];const v=td(g,p.value,i.$);return v.required&&(l.required=Zi(l.required,v.required)),v.optional&&(l.optional=Zi(l.optional,v.optional)),v.index??[]}))}if(n.undeclared){const m=n.keyof();for(const p of t.requiredKeys)m.allows(p)||u.add("presence",t.propsByKey[p].value,Z.intrinsic.never.internal,{path:[p]});a.optional&&(a.optional=a.optional.filter(p=>m.allows(p.key))),a.index&&(a.index=a.index.flatMap(p=>{if(p.signature.extends(m))return p;const g=Zn(m,p.signature,i.$);if(g instanceof W)return[];const v=td(g,p.value,i.$);return v.required&&(a.required=Zi(a.required,v.required)),v.optional&&(a.optional=Zi(a.optional,v.optional)),v.index??[]}))}const f={};(t.undeclared||n.undeclared)&&(f.undeclared=t.undeclared==="reject"||n.undeclared==="reject"?"reject":"delete");const d=Ao({kind:"structure",baseInner:f,l:$o(a),r:$o(l),roots:[],ctx:i});return d instanceof W&&u.push(...d),u.length?u:d}},reduce:(t,n)=>{if(t.index){if(!(t.required||t.optional))return;let i=!1;const a=t.required??[],l=t.optional??[],u=[...l];for(const f of t.index){for(const d of a){const m=Qy(d,f,n);if(m instanceof W)return m}for(const[d,m]of l.entries()){const p=Qy(m,f,n);if(p instanceof W)return p;p!==null&&(u[d]=p,i=!0)}}if(i)return n.node("structure",{...t,optional:u},{prereduced:!0})}}});var Yv,Iv;class GC extends la{constructor(){super(...arguments);w(this,"impliedBasis",Z.intrinsic.object.internal);w(this,"impliedSiblings",this.children.flatMap(i=>i.impliedSiblings??[]));w(this,"props",Zi(this.required,this.optional));w(this,"propsByKey",_e(this.props,(i,a)=>[a.key,a]));w(this,"propsByKeyReference",$t(this.propsByKey));w(this,"expression",VC(this));w(this,"requiredKeys",((Yv=this.required)==null?void 0:Yv.map(i=>i.key))??[]);w(this,"optionalKeys",((Iv=this.optional)==null?void 0:Iv.map(i=>i.key))??[]);w(this,"literalKeys",[...this.requiredKeys,...this.optionalKeys]);w(this,"_keyof");w(this,"traverseAllows",(i,a)=>this._traverse("Allows",i,a));w(this,"traverseApply",(i,a)=>this._traverse("Apply",i,a));w(this,"_traverse",(i,a,l)=>{const u=(l==null?void 0:l.currentErrorCount)??0;for(let f=0;f<this.props.length;f++)if(i==="Allows"){if(!this.props[f].traverseAllows(a,l))return!1}else if(this.props[f].traverseApply(a,l),l.failFast&&l.currentErrorCount>u)return!1;if(this.sequence){if(i==="Allows"){if(!this.sequence.traverseAllows(a,l))return!1}else if(this.sequence.traverseApply(a,l),l.failFast&&l.currentErrorCount>u)return!1}if(this.index||this.undeclared==="reject"){const f=Object.keys(a);f.push(...Object.getOwnPropertySymbols(a));for(let d=0;d<f.length;d++){const m=f[d];if(this.index){for(const p of this.index)if(p.signature.traverseAllows(m,l)){if(i==="Allows"){if(!In(m,()=>p.value.traverseAllows(a[m],l),l))return!1}else if(In(m,()=>p.value.traverseApply(a[m],l),l),l.failFast&&l.currentErrorCount>u)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(m)&&(i==="Allows"||(l.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[m],meta:this.meta}),l.failFast)))return!1}}return this.structuralMorph&&l&&!l.hasError()&&l.queueMorphs([this.structuralMorph]),!0});w(this,"declaresKey",i=>{var a;return i in this.propsByKey||((a=this.index)==null?void 0:a.some(l=>l.signature.allows(i)))||this.sequence!==void 0&&Z.intrinsic.nonNegativeIntegerString.allows(i)});w(this,"structuralMorphRef",this.structuralMorph&&$t(this.structuralMorph))}keyof(){if(this._keyof)return this._keyof;let i=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:a}of this.index)i=i.concat(a.branches);return this._keyof=this.$.node("union",i)}map(i){return this.$.node("structure",this.props.flatMap(i).reduce((a,l)=>{const u=this.propsByKey[l.key];if(Et(l))return l.kind!=="required"&&l.kind!=="optional"?J(`Map result must have kind "required" or "optional" (was ${l.kind})`):(a[l.kind]=Be(a[l.kind],l),a);const f=l.kind??(u==null?void 0:u.kind)??"required",d=_e(l,(m,p)=>m in jd.implementation.keys?[m,p]:[]);return a[f]=Be(a[f],this.$.node(f,d)),a},{}))}assertHasKeys(i){const a=i.filter(l=>!so(l,this.keyof()));if(a.length)return J(Fy(this.expression,a))}get(i,...a){var m;let l,u=!1;const f=ZC(i);if((typeof f=="string"||typeof f=="symbol")&&this.propsByKey[f]&&(l=this.propsByKey[f].value,u=this.propsByKey[f].required),this.index)for(const p of this.index)so(f,p.signature)&&(l=(l==null?void 0:l.and(p.value))??p.value);if(this.sequence&&so(f,Z.intrinsic.nonNegativeIntegerString))if(le(f,"root"))this.sequence.variadic&&(l=(l==null?void 0:l.and(this.sequence.element))??this.sequence.element);else{const p=Number.parseInt(f);if(p<this.sequence.prevariadic.length){const g=this.sequence.prevariadic[p].node;l=(l==null?void 0:l.and(g))??g,u||(u=p<this.sequence.prefixLength)}else if(this.sequence.variadic){const g=this.$.node("union",this.sequence.variadicOrPostfix);l=(l==null?void 0:l.and(g))??g}}if(!l)return(m=this.sequence)!=null&&m.variadic&&le(f,"root")&&f.extends(Z.intrinsic.number)?J(QC(f.expression,this.sequence.expression)):J(Fy(this.expression,[f]));const d=l.get(...a);return u?d:d.or(Z.intrinsic.undefined)}pick(...i){return this.assertHasKeys(i),this.$.node("structure",this.filterKeys("pick",i))}omit(...i){return this.assertHasKeys(i),this.$.node("structure",this.filterKeys("omit",i))}optionalize(){const{required:i,...a}=this.inner;return this.$.node("structure",{...a,optional:this.props.map(l=>l.hasKind("required")?this.$.node("optional",l.inner):l)})}require(){const{optional:i,...a}=this.inner;return this.$.node("structure",{...a,required:this.props.map(l=>l.hasKind("optional")?{key:l.key,value:l.value}:l)})}merge(i){const a=this.filterKeys("omit",[i.keyof()]);return i.required&&(a.required=Be(a.required,i.required)),i.optional&&(a.optional=Be(a.optional,i.optional)),i.index&&(a.index=Be(a.index,i.index)),i.sequence&&(a.sequence=i.sequence),i.undeclared?a.undeclared=i.undeclared:delete a.undeclared,this.$.node("structure",a)}filterKeys(i,a){const l=zb(this.inner),u=f=>{const d=a.some(m=>so(f,m));return i==="pick"?d:!d};return l.required&&(l.required=l.required.filter(f=>u(f.key))),l.optional&&(l.optional=l.optional.filter(f=>u(f.key))),l.index&&(l.index=l.index.filter(f=>u(f.signature))),l}get defaultable(){var i;return this.cacheGetter("defaultable",((i=this.optional)==null?void 0:i.filter(a=>a.hasDefault()))??[])}_compileDeclaresKey(i){const a=[];if(this.props.length&&a.push(`k in ${this.propsByKeyReference}`),this.index)for(const l of this.index)a.push(i.invoke(l.signature,{kind:"Allows",arg:"k"}));return this.sequence&&a.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),a.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",YC(this))}compile(i){i.traversalKind==="Apply"&&i.initializeErrorCount();for(const a of this.props)i.check(a),i.traversalKind==="Apply"&&i.returnIfFailFast();if(this.sequence&&(i.check(this.sequence),i.traversalKind==="Apply"&&i.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(i.const("keys","Object.keys(data)"),i.line("keys.push(...Object.getOwnPropertySymbols(data))"),i.for("i < keys.length",()=>this.compileExhaustiveEntry(i))),i.traversalKind==="Allows")return i.return(!0);this.structuralMorphRef&&i.if("ctx && !ctx.hasError()",()=>(i.line("ctx.queueMorphs(["),IC(i,this),i.line("])")))}compileExhaustiveEntry(i){if(i.const("k","keys[i]"),this.index)for(const a of this.index)i.if(`${i.invoke(a.signature,{arg:"k",kind:"Allows"})}`,()=>i.traverseKey("k","data[k]",a.value));return this.undeclared==="reject"&&i.if(`!(${this._compileDeclaresKey(i)})`,()=>i.traversalKind==="Allows"?i.return(!1):i.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>i.return())),i}reduceJsonSchema(i,a){var l;switch(i.type){case"object":return this.reduceObjectJsonSchema(i,a);case"array":const u=((l=this.sequence)==null?void 0:l.reduceJsonSchema(i,a))??i;return this.props.length||this.index?a.fallback.arrayObject({code:"arrayObject",base:u,object:this.reduceObjectJsonSchema({type:"object"},a)}):u;default:return lt.throwInternalOperandError("structure",i)}}reduceObjectJsonSchema(i,a){if(this.props.length){i.properties={};for(const l of this.props){const u=l.value.toJsonSchemaRecurse(a);if(typeof l.key=="symbol"){a.fallback.symbolKey({code:"symbolKey",base:i,key:l.key,value:u,optional:l.optional});continue}if(l.hasDefault()){const f=typeof l.default=="function"?l.default():l.default;u.default=Z.intrinsic.jsonData.allows(f)?f:a.fallback.defaultValue({code:"defaultValue",base:u,value:f})}i.properties[l.key]=u}this.requiredKeys.length&&i.properties&&(i.required=this.requiredKeys.filter(l=>typeof l=="string"&&l in i.properties))}if(this.index)for(const l of this.index){const u=l.value.toJsonSchemaRecurse(a);if(l.signature.equals(Z.intrinsic.string)){i.additionalProperties=u;continue}for(const f of l.signature.branches){if(!f.extends(Z.intrinsic.string)){i=a.fallback.symbolKey({code:"symbolKey",base:i,key:null,value:u,optional:!1});continue}let d={type:"string"};if(f.hasKind("morph")&&(d=a.fallback.morph({code:"morph",base:f.in.toJsonSchemaRecurse(a),out:f.out.toJsonSchemaRecurse(a)})),!f.hasKind("intersection"))return nt(`Unexpected index branch kind ${f.kind}.`);const{pattern:m}=f.inner;if(m){const p=Object.assign(d,{pattern:m[0].rule});for(let g=1;g<m.length;g++)d=a.fallback.patternIntersection({code:"patternIntersection",base:p,pattern:m[g].rule});i.patternProperties??(i.patternProperties={}),i.patternProperties[p.pattern]=u}}}return this.undeclared&&!i.additionalProperties&&(i.additionalProperties=!1),i}}const $f={},JC=t=>{var i,a;let n="";for(let l=0;l<t.defaultable.length;l++)n+=t.defaultable[l].defaultValueMorphRef;if((i=t.sequence)!=null&&i.defaultValueMorphsReference&&(n+=(a=t.sequence)==null?void 0:a.defaultValueMorphsReference),t.undeclared==="delete"){if(n+="delete !(",t.required)for(const l of t.required)n+=l.compiledKey+" | ";if(t.optional)for(const l of t.optional)n+=l.compiledKey+" | ";if(t.index)for(const l of t.index)n+=l.signature.id+" | ";if(t.sequence)if(t.sequence.maxLength===null)n+=de.nonNegativeIntegerString.id;else for(let l=0;l<t.sequence.tuple.length;l++)n+=l+" | ";n+=")"}return n},YC=t=>{const n=JC(t);if(!n)return;if($f[n])return $f[n];const i=(a,l)=>{var u;for(let f=0;f<t.defaultable.length;f++)t.defaultable[f].key in a||t.defaultable[f].defaultValueMorph(a,l);if((u=t.sequence)!=null&&u.defaultables)for(let f=a.length-t.sequence.prefixLength;f<t.sequence.defaultables.length;f++)t.sequence.defaultValueMorphs[f](a,l);if(t.undeclared==="delete")for(const f in a)t.declaresKey(f)||delete a[f];return a};return $f[n]=i},IC=(t,n)=>{var l;const a=`(data${n.defaultable.some(u=>u.defaultValueMorph.length===2)||((l=n.sequence)==null?void 0:l.defaultValueMorphs.some(u=>u.length===2))?", ctx":""})`;return t.block(`${a} => `,u=>{var f;for(let d=0;d<n.defaultable.length;d++){const{serializedKey:m,defaultValueMorphRef:p}=n.defaultable[d];u.if(`!(${m} in data)`,g=>g.line(`${p}${a}`))}return(f=n.sequence)!=null&&f.defaultables&&u.for(`i < ${n.sequence.defaultables.length}`,d=>d.set("data[i]",5),`data.length - ${n.sequence.prefixLength}`),n.undeclared==="delete"&&u.forIn("data",d=>d.if(`!(${n._compileDeclaresKey(d)})`,m=>m.line("delete data[k]"))),u.return("data")})},x0={implementation:HC,Node:GC},ZC=t=>(le(t,"root")&&t.hasKind("unit")&&(t=t.unit),typeof t=="number"&&(t=`${t}`),t),QC=(t,n)=>`${t} is not allowed as an array index on ${n}. Use the 'nonNegativeIntegerString' keyword instead.`,td=(t,n,i)=>{const[a,l]=ZA(t.branches,f=>f.hasKind("unit"));if(!a.length)return{index:i.node("index",{signature:t,value:n})};const u={};for(const f of a){const d=i.node("required",{key:f.unit,value:n});u[d.kind]=Be(u[d.kind],d)}return l.length&&(u.index=i.node("index",{signature:l,value:n})),u},FC=t=>le(t,"root")?t.expression:ze(t),Fy=(t,n)=>`Key${n.length===1?"":"s"} ${n.map(FC).join(", ")} ${n.length===1?"does":"do"} not exist on ${t}`,Jo={...q2,alias:Md.implementation,domain:zd.implementation,unit:p0.implementation,proto:To.implementation,union:h0.implementation,morph:f0.implementation,intersection:c0.implementation,divisor:Yb.implementation,pattern:r0.implementation,predicate:Jb.implementation,required:g0.implementation,optional:jd.implementation,index:m0.implementation,sequence:y0.implementation,structure:x0.implementation};Z.defaultConfig=s$(Object.assign(_e(Jo,(t,n)=>[t,n.defaults]),{jitless:g$(),clone:h$,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:lt.defaultConfig}));Z.resolvedConfig=Ff(Z.defaultConfig,Z.config);const XC={...K2,alias:Md.Node,domain:zd.Node,unit:p0.Node,proto:To.Node,union:h0.Node,morph:f0.Node,intersection:c0.Node,divisor:Yb.Node,pattern:r0.Node,predicate:Jb.Node,required:g0.Node,optional:jd.Node,index:m0.Node,sequence:y0.Node,structure:x0.Node};class nd extends t${get[Yn](){return"module"}}const S0=(t,n)=>new nd(_e(t,(i,a)=>[i,le(a,"module")?S0(a,n):n.bindReference(a)])),PC=t=>kt(t)?t:"branches"in t&&kt(t.branches)?t.branches:void 0,WC=(t,n)=>J(`Node of kind ${n} is not valid as a ${t} definition`),Xy=t=>`#${t} duplicates public alias ${t}`,Cf={};Z.ambient??(Z.ambient={});let Py;const w0="function $",eT=t=>N0(t,k0(t)),N0=(t,n)=>{const i=n.write(w0,4),a=n.compile()();for(const l of t)l.precompilation||(l.traverseAllows=a[`${l.id}Allows`].bind(a),l.isRoot()&&!l.allowsRequiresContext&&(l.allows=l.traverseAllows),l.traverseApply=a[`${l.id}Apply`].bind(a),a[`${l.id}Optimistic`]&&(l.traverseOptimistic=a[`${l.id}Optimistic`].bind(a)),l.precompilation=i)},k0=t=>new Db().return(t.reduce((n,i)=>{const a=new kf({kind:"Allows"}).indent();i.compile(a);const l=a.write(`${i.id}Allows`),u=new kf({kind:"Apply"}).indent();i.compile(u);const f=u.write(`${i.id}Apply`),d=`${n}${l},
102
- ${f},
103
- `;if(!i.hasKind("union"))return d;const m=new kf({kind:"Allows",optimistic:!0}).indent();i.compile(m);const p=m.write(`${i.id}Optimistic`);return`${d}${p},
104
- `},`{
105
- `)+"}");class R0{constructor(n,i){w(this,"config");w(this,"resolvedConfig");w(this,"name");w(this,"referencesById",{});w(this,"references",[]);w(this,"resolutions",{});w(this,"exportedNames",[]);w(this,"aliases",{});w(this,"resolved",!1);w(this,"nodesByHash",{});w(this,"intrinsic");w(this,"_json");w(this,"generic",(...n)=>{const i=this;return(a,l)=>new Co(n,l?new Gb(a):a,i,i,l??null)});w(this,"units",(n,i)=>{const a=[];for(const u of n)a.includes(u)||a.push(u);const l=a.map(u=>this.node("unit",{unit:u},i));return this.node("union",l,{...i,prereduced:!0})});w(this,"lazyResolutions",[]);w(this,"schema",(n,i)=>this.finalize(this.parseSchema(n,i)));w(this,"parseSchema",(n,i)=>this.node(go(n),n,i));w(this,"precompilation");w(this,"_exportedResolutions");w(this,"_exports");w(this,"node",(n,i,a={})=>{const l=this.preparseNode(n,i,a);if(Et(l))return this.bindReference(l);const u=this.createParseContext(l),f=s0(u),d=this.bindReference(f);return an[u.id]=d});w(this,"parse",(n,i={})=>this.finalize(this.parseDefinition(n,i)));this.config=Ff(Z.config,i),this.resolvedConfig=Ff(Z.resolvedConfig,i),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(Cf).length}`,this.name in Cf&&J(`A Scope already named ${this.name} already exists`),Cf[this.name]=this;const a=Object.entries(n).map(l=>this.preparseOwnAliasEntry(...l));for(const[l,u]of a){let f=l;if(l[0]==="#"?(f=l.slice(1),f in this.aliases&&J(Xy(f)),this.aliases[f]=u):(f in this.aliases&&J(Xy(l)),this.aliases[f]=u,this.exportedNames.push(f)),!le(u,"module")&&!le(u,"generic")&&!_o(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:f});this.resolutions[f]=le(d,"root")?this.bindReference(d):this.createParseContext(d).id}}Py??(Py=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0})),this.nodesByHash[Py.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=Z.intrinsic?_e(Z.intrinsic,(l,u)=>l.startsWith("json")?[]:[l,this.bindReference(u)]):{}}get[Yn](){return"scope"}cacheGetter(n,i){return Object.defineProperty(this,n,{value:i}),i}get internal(){return this}get json(){return this._json||this.export(),this._json}defineSchema(n){return n}lazilyResolve(n,i){const a=this.node("alias",{reference:i??"synthetic",resolve:n},{prereduced:!0});return this.resolved||this.lazyResolutions.push(a),a}preparseNode(n,i,a){var d;let l=typeof n=="string"?n:go(i,n);if(Et(i)&&i.kind===l)return i;if(l==="alias"&&!(a!=null&&a.prereduced)){const{reference:m}=Md.implementation.normalize(i,this);if(m.startsWith("$")){const p=this.resolveRoot(m.slice(1));i=p,l=p.kind}}else if(l==="union"&&er(i,"object")){const m=PC(i);(m==null?void 0:m.length)===1&&(i=m[0],l=go(i))}if(Et(i)&&i.kind===l)return i;const u=Jo[l],f=((d=u.normalize)==null?void 0:d.call(u,i,this))??i;return Et(f)?f.kind===l?f:WC(l,f.kind):{...a,$:this,kind:l,def:f,prefix:a.alias??l}}bindReference(n){let i;return Et(n)?i=n.$===this?n:new n.constructor(n.attachments,this):i=n.$===this?n:new Co(n.params,n.bodyDef,n.$,this,n.hkt),this.resolved||Object.assign(this.referencesById,i.referencesById),i}resolveRoot(n){return this.maybeResolveRoot(n)??J(C0(n))}maybeResolveRoot(n){const i=this.maybeResolve(n);if(!le(i,"generic"))return i}maybeResolveSubalias(n){return id(this.aliases,n)??id(this.ambient,n)}get ambient(){return Z.ambient}maybeResolve(n){var l;const i=this.resolutions[n];if(i){if(typeof i!="string")return this.bindReference(i);const u=an[i];if(le(u,"root"))return this.resolutions[n]=u;if(le(u,"context")){if(u.phase==="resolving")return this.node("alias",{reference:`$${n}`},{prereduced:!0});if(u.phase==="resolved")return nt(`Unexpected resolved context for was uncached by its scope: ${ze(u)}`);u.phase="resolving";const f=this.bindReference(this.parseOwnDefinitionFormat(u.def,u));return u.phase="resolved",an[f.id]=f,an[u.id]=f,this.resolutions[n]=f}return nt(`Unexpected nodesById entry for ${i}: ${ze(u)}`)}let a=this.aliases[n]??((l=this.ambient)==null?void 0:l[n]);return a?(a=this.normalizeRootScopeValue(a),le(a,"generic")?this.resolutions[n]=this.bindReference(a):le(a,"module")?(a.root||J(T0(n)),this.resolutions[n]=this.bindReference(a.root)):this.resolutions[n]=this.parse(a,{alias:n})):this.maybeResolveSubalias(n)}createParseContext(n){const i=n.id??a0(n.prefix);return an[i]=Object.assign(n,{[Yn]:"context",$:this,id:i,phase:"unresolved"})}traversal(n){return new Ir(n,this.resolvedConfig)}import(...n){return new nd(_e(this.export(...n),(i,a)=>[`#${i}`,a]))}export(...n){if(!this._exports){this._exports={};for(const a of this.exportedNames){const l=this.aliases[a];this._exports[a]=le(l,"module")?S0(l,this):Wy(this.maybeResolve(a))}for(const a of this.lazyResolutions)a.resolution;if(this._exportedResolutions=$0(this,this._exports),this._json=A0(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const a=k0(this.references);this.precompilation=a.write(w0,4),N0(this.references,a)}this.resolved=!0}const i=n.length?n:this.exportedNames;return new nd(_e(i,(a,l)=>[l,this._exports[l]]))}resolve(n){return this.export()[n]}parseDefinition(n,i={}){if(le(n,"root"))return this.bindReference(n);const a=this.preparseOwnDefinitionFormat(n,i);if(le(a,"root"))return this.bindReference(a);const l=this.createParseContext(a);an[l.id]=l;let u=this.bindReference(this.parseOwnDefinitionFormat(n,l));return u.isCyclic&&(u=Y2(u,l.id)),an[l.id]=u,u}finalize(n){return Wy(n),!n.precompilation&&!this.resolvedConfig.jitless&&eT(n.references),n}}class E0 extends R0{parseOwnDefinitionFormat(n,i){return s0(i)}preparseOwnDefinitionFormat(n,i){return this.preparseNode(go(n),n,i)}preparseOwnAliasEntry(n,i){return[n,i]}normalizeRootScopeValue(n){return n}}const Wy=t=>{const n=t.references.filter(i=>i.hasKind("alias"));for(const i of n){Object.assign(i.referencesById,i.resolution.referencesById);for(const a of t.references)i.id in a.referencesById&&Object.assign(a.referencesById,i.referencesById)}return t},A0=t=>_e(t,(n,i)=>[n,le(i,"root")||le(i,"generic")?i.json:le(i,"module")?A0(i):nt(`Unexpected resolution ${ze(i)}`)]),id=(t,n)=>{const i=n.indexOf(".");if(i===-1)return;const a=n.slice(0,i),l=t[a];if(l===void 0)return;if(!le(l,"module"))return J(tT(a));const u=n.slice(i+1),f=l[u];if(f===void 0)return id(l,u);if(le(f,"root")||le(f,"generic"))return f;if(le(f,"module"))return f.root??J(T0(n));nt(`Unexpected resolution for alias '${n}': ${ze(f)}`)},Ud=(t,n)=>new E0(t,n),Us=new E0({}),$0=(t,n)=>{const i={};for(const a in n){const l=n[a];if(le(l,"module")){const u=$0(t,l),f=_e(u,(d,m)=>[`${a}.${d}`,m]);Object.assign(i,f)}else le(l,"root")||le(l,"generic")?i[a]=l:nt(`Unexpected scope resolution ${ze(l)}`)}return i},C0=t=>`'${t}' is unresolvable`,tT=t=>`'${t}' must reference a module to be accessed using dot syntax`,T0=t=>`Reference to submodule '${t}' must specify an alias`;Us.export();const Ke=Us.schema,Bd=Us.node;Us.defineSchema;const Qn=Us.generic,O0="^(?:0|[1-9]\\d*)$",nT=new RegExp(O0);$t(nT);const j0=Ud({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();Z.intrinsic={...j0};const D0=Ud({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:O0}},{prereducedAliases:!0}).export();Object.assign(Z.intrinsic,D0);const iT=Ud({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),de={...j0,...D0,...iT,emptyStructure:Bd("structure",{},{prereduced:!0})};Z.intrinsic={...de};const rT=t=>typeof t=="string"&&t[0]==="d"&&(t[1]==="'"||t[1]==='"')&&t.at(-1)===t[1],ev=t=>t.toString()!=="Invalid Date",aT=t=>t.slice(2,-1),M0=t=>`'${t}' could not be parsed by the Date constructor`,sT=(t,n)=>lT(t,n),lT=(t,n)=>{const i=new Date(t);if(ev(i))return i;const a=D$(t);if(a!==void 0){const l=new Date(a);if(ev(l))return l}return n?J(n===!0?M0(t):n):void 0},tv=(t,n)=>{const i=t.scanner.shiftUntil(uT[z0[n]]);if(t.scanner.lookahead==="")return t.error(fT(i,n));if(t.scanner.shift(),n==="/"){try{new RegExp(i)}catch(a){J(String(a))}t.root=t.ctx.$.node("intersection",{domain:"string",pattern:i},{prereduced:!0})}else if(Nn(n,L0))t.root=t.ctx.$.node("unit",{unit:i});else{const a=sT(i,M0(i));t.root=t.ctx.$.node("unit",{meta:i,unit:a})}},L0={"'":1,'"':1},oT={"/":1,"'":1,'"':1},z0={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},uT={"'":t=>t.lookahead==="'",'"':t=>t.lookahead==='"',"/":t=>t.lookahead==="/"},cT={'"':"double-quote","'":"single-quote","/":"forward slash"},fT=(t,n)=>`${n}${t} requires a closing ${cT[z0[n]]}`,dT=t=>`Private type references should not include '#'. Use '${t}' instead.`,U0="Optional definitions like 'string?' are only valid as properties in an object or tuple",B0="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",hT={">":!0,">=":!0},pT={"<":!0,"<=":!0},Oo={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},mT=t=>`Unmatched )${t===""?"":` before ${t}`}`,_0=t=>`Missing ${t}`,gT=(t,n)=>`Left bounds are only valid when paired with right bounds (try ...${n}${t})`,q0=t=>`Left-bounded expressions must specify their limits using < or <= (was ${t})`,yT=(t,n,i,a)=>`An expression may have at most one left bound (parsed ${t}${Oo[n]}, ${i}${Oo[a]})`,vT=(t,n,i)=>K0(t,n,i,[]),K0=(t,n,i,a)=>{const l=i.parseUntilFinalizer();return a.push(l.root),l.finalizer===">"?a.length!==n.params.length?i.error(V0(t,n.names,a.map(u=>u.expression))):a:l.finalizer===","?K0(t,n,i,a):l.error(_0(">"))},V0=(t,n,i)=>`${t}<${n.join(", ")}> requires exactly ${n.length} args (got ${i.length}${i.length===0?"":`: ${i.join(", ")}`})`,nv=t=>{const n=t.scanner.shiftUntilNextTerminator();n==="keyof"?t.addPrefix("keyof"):t.root=xT(t,n)},bT=(t,n,i)=>{if(i.scanner.shiftUntilNonWhitespace(),i.scanner.shift()!=="<")return i.error(V0(t,n.names,[]));const l=vT(t,n,i);return n(...l)},xT=(t,n)=>ST(t,n)??wT(t,n)??t.error(n===""?t.scanner.lookahead==="#"?dT(t.shiftedByOne().scanner.shiftUntilNextTerminator()):H0(t):C0(n)),ST=(t,n)=>{var a;if((a=t.ctx.args)!=null&&a[n]){const l=t.ctx.args[n];return typeof l!="string"?l:t.ctx.$.node("alias",{reference:l},{prereduced:!0})}const i=t.ctx.$.maybeResolve(n);if(le(i,"root"))return i;if(i!==void 0)return le(i,"generic")?bT(n,i,t):J(`Unexpected resolution ${ze(i)}`)},wT=(t,n)=>{const i=M$(n);if(i!==void 0)return t.ctx.$.node("unit",{unit:i});const a=z$(n);if(a!==void 0)return t.ctx.$.node("unit",{unit:a})},H0=t=>{const n=t.previousOperator();return n?G0(n,t.scanner.unscanned):NT(t.scanner.unscanned)},G0=(t,n="")=>`Token '${t}' requires a right operand${n?` before '${n}'`:""}`,NT=t=>`Expected an expression${t?` before '${t}'`:""}`,J0=t=>t.scanner.lookahead===""?t.error(H0(t)):t.scanner.lookahead==="("?t.shiftedByOne().reduceGroupOpen():t.scanner.lookaheadIsIn(oT)?tv(t,t.scanner.shift()):t.scanner.lookaheadIsIn(qo)?J0(t.shiftedByOne()):t.scanner.lookahead==="d"&&t.scanner.nextLookahead in L0?tv(t,`${t.scanner.shift()}${t.scanner.shift()}`):nv(t),Ii=class Ii extends G${shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Ii.terminatingChars)}};w(Ii,"terminatingChars",{"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...qo}),w(Ii,"finalizingLookaheads",{">":1,",":1,"":1,"=":1,"?":1}),w(Ii,"lookaheadIsFinalizing",(n,i)=>n===">"?i[0]==="="?i[1]==="=":i.trimStart()===""||Nn(i.trimStart()[0],Ii.terminatingChars):n==="="?i[0]!=="=":n===","||n==="?");let Ns=Ii;const kT=(t,n)=>{const i=ET(t,n);if(t.root.hasKind("unit")){if(typeof t.root.unit=="number"){t.reduceLeftBound(t.root.unit,i),t.unsetRoot();return}if(t.root.unit instanceof Date){const a=`d'${t.root.description??t.root.unit.toISOString()}'`;t.unsetRoot(),t.reduceLeftBound(a,i);return}}return $T(t,i)},RT={"<":1,">":1,"=":1},ET=(t,n)=>t.scanner.lookaheadIs("=")?`${n}${t.scanner.shift()}`:n,iv=(t,n,i,a)=>i.extends(Z.intrinsic.number)?typeof n!="number"?J(rd(t,n,a)):t==="=="?["min","max"]:t[0]===">"?["min"]:["max"]:i.extends(Z.intrinsic.lengthBoundable)?typeof n!="number"?J(rd(t,n,a)):t==="=="?["exactLength"]:t[0]===">"?["minLength"]:["maxLength"]:i.extends(Z.intrinsic.Date)?t==="=="?["after","before"]:t[0]===">"?["after"]:["before"]:J(R2(i.expression)),AT=t=>({rule:rT(t.limit)?aT(t.limit):t.limit,exclusive:t.comparator.length===1}),$T=(t,n)=>{const i=t.unsetRoot(),a=t.scanner.location;t.parseOperand();const l=t.unsetRoot(),u=t.scanner.sliceChars(a,t.scanner.location);if(t.root=i,!l.hasKind("unit")||typeof l.unit!="number"&&!(l.unit instanceof Date))return t.error(rd(n,u,"right"));const f=l.unit,d=n.length===1,m=iv(n,typeof f=="number"?f:u,i,"right");for(const g of m)t.constrainRoot(g,n==="=="?{rule:f}:{rule:f,exclusive:d});if(!t.branches.leftBound)return;if(!Nn(n,pT))return t.error(q0(n));const p=iv(t.branches.leftBound.comparator,t.branches.leftBound.limit,i,"left");t.constrainRoot(p[0],AT(t.branches.leftBound)),t.branches.leftBound=null},rd=(t,n,i)=>`Comparator ${i==="left"?Oo[t]:t} must be ${i==="left"?"preceded":"followed"} by a corresponding literal (was ${n})`,CT=t=>{t.scanner.shiftUntilNonWhitespace();const n=t.scanner.shiftUntilNextTerminator();t.root=t.root.brand(n)},TT=t=>{const n=t.scanner.shiftUntilNextTerminator(),i=L$(n,{errorOnFail:rv(n)});i===0&&t.error(rv(0)),t.root=t.root.constrain("divisor",i)},rv=t=>`% operator must be followed by a non-zero integer literal (was ${t})`,Y0=t=>{const n=t.scanner.shift();return n===""?t.finalize(""):n==="["?t.scanner.shift()==="]"?t.setRoot(t.root.array()):t.error(OT):n==="|"?t.scanner.lookahead===">"?t.shiftedByOne().pushRootToBranch("|>"):t.pushRootToBranch(n):n==="&"?t.pushRootToBranch(n):n===")"?t.finalizeGroup():Ns.lookaheadIsFinalizing(n,t.scanner.unscanned)?t.finalize(n):Nn(n,RT)?kT(t,n):n==="%"?TT(t):n==="#"?CT(t):n in qo?Y0(t):t.error(_d(n))},_d=(t,n="")=>`'${t}' is not allowed here${n&&` (should be ${n})`}`,OT="Missing expected ']'",jT=t=>{const n=t.unsetRoot();t.parseOperand();const i=t.unsetRoot();if(!i.hasKind("unit"))return t.error(DT(i.expression));const a=i.unit instanceof Date?()=>new Date(i.unit):i.unit;return[n,"=",a]},DT=t=>`Default value '${t}' must a literal value`,av=(t,n)=>{const i=n.$.maybeResolveRoot(t);if(i)return i;if(t.endsWith("[]")){const u=n.$.maybeResolveRoot(t.slice(0,-2));if(u)return u.array()}const a=new Yo(new Ns(t),n),l=MT(a);return a.finalizer===">"&&J(_d(">")),l},MT=t=>{t.parseOperand();let n=qd(t).root;return n?(t.finalizer==="="?n=jT(t):t.finalizer==="?"&&(n=[n,"?"]),t.scanner.shiftUntilNonWhitespace(),t.scanner.lookahead&&J(_d(t.scanner.lookahead)),n):nt(`Root was unexpectedly unset after parsing string '${t.scanner.scanned}'`)},qd=t=>{for(;t.finalizer===void 0;)LT(t);return t},LT=t=>t.hasRoot()?t.parseOperator():t.parseOperand();class Yo{constructor(n,i){w(this,"root");w(this,"branches",{prefixes:[],leftBound:null,intersection:null,union:null,pipe:null});w(this,"finalizer");w(this,"groups",[]);w(this,"scanner");w(this,"ctx");this.scanner=n,this.ctx=i}error(n){return J(n)}hasRoot(){return this.root!==void 0}setRoot(n){this.root=n}unsetRoot(){const n=this.root;return this.root=void 0,n}constrainRoot(...n){this.root=this.root.constrain(n[0],n[1])}finalize(n){if(this.groups.length)return this.error(_0(")"));this.finalizeBranches(),this.finalizer=n}reduceLeftBound(n,i){const a=Oo[i];if(!Nn(a,hT))return this.error(q0(i));if(this.branches.leftBound)return this.error(yT(this.branches.leftBound.limit,this.branches.leftBound.comparator,n,a));this.branches.leftBound={comparator:a,limit:n}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();const n=this.groups.pop();if(!n)return this.error(mT(this.scanner.unscanned));this.branches=n}addPrefix(n){this.branches.prefixes.push(n)}applyPrefixes(){for(;this.branches.prefixes.length;){const n=this.branches.prefixes.pop();this.root=n==="keyof"?this.root.keyof():nt(`Unexpected prefix '${n}'`)}}pushRootToBranch(n){var a,l,u;this.assertRangeUnset(),this.applyPrefixes();const i=this.root;this.root=void 0,this.branches.intersection=((a=this.branches.intersection)==null?void 0:a.rawAnd(i))??i,n!=="&"&&(this.branches.union=((l=this.branches.union)==null?void 0:l.rawOr(this.branches.intersection))??this.branches.intersection,this.branches.intersection=null,n!=="|"&&(this.branches.pipe=((u=this.branches.pipe)==null?void 0:u.rawPipeOnce(this.branches.union))??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return qd(new Yo(this.scanner,this.ctx))}parseOperator(){return Y0(this)}parseOperand(){return J0(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(gT(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){var n;return((n=this.branches.leftBound)==null?void 0:n.comparator)??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const zT="An empty string is not a valid generic parameter name",ad=(t,n,i)=>{t.shiftUntilNonWhitespace();const a=t.shiftUntilNextTerminator();return a===""?t.lookahead===""&&n.length?n:J(zT):(t.shiftUntilNonWhitespace(),UT(t,a,n,i))},sv="extends ",UT=(t,n,i,a)=>{if(t.shiftUntilNonWhitespace(),t.unscanned.startsWith(sv))t.jumpForward(sv.length);else return t.lookahead===","&&t.shift(),i.push(n),ad(t,i,a);const l=qd(new Yo(t,a));return i.push([n,l.root]),ad(t,i,a)};class BT extends sa{constructor(i){super((...a)=>new lo(i)(...a),{bind:i});w(this,"$");this.$=i}in(i){return new lo(this.$,i===void 0?void 0:this.$.parse(i))}at(i,a){return new lo(this.$).at(i,a)}case(i,a){return new lo(this.$).case(i,a)}}class lo extends sa{constructor(i,a){super(l=>this.caseEntries(Object.entries(l).map(([u,f])=>u==="default"?[u,f]:[this.$.parse(u),f])));w(this,"$");w(this,"in");w(this,"key");w(this,"branches",[]);this.$=i,this.in=a}at(i,a){return this.key&&J(qT),this.branches.length&&J(_T),this.key=i,a?this.match(a):this}case(i,a){return this.caseEntry(this.$.parse(i),a)}caseEntry(i,a){const u=(this.key?this.$.parse({[this.key]:i}):i).pipe(a);return this.branches.push(u),this}match(i){return this(i)}strings(i){return this.caseEntries(Object.entries(i).map(([a,l])=>a==="default"?[a,l]:[this.$.node("unit",{unit:a}),l]))}caseEntries(i){for(let a=0;a<i.length;a++){const[l,u]=i[a];if(l==="default")return a!==i.length-1&&J("default may only be specified as the last key of a switch definition"),this.default(u);if(typeof u!="function")return J(`Value for case "${l}" must be a function (was ${hn(u)})`);this.caseEntry(l,u)}return this}default(i){typeof i=="function"&&this.case(de.unknown,i);const a={branches:this.branches,ordered:!0};(i==="never"||i==="assert")&&(a.meta={onFail:lv});const l=this.$.node("union",a);if(!this.in)return this.$.finalize(l);let u=this.in.pipe(l);return(i==="never"||i==="assert")&&(u=u.configureReferences({onFail:lv},"self")),this.$.finalize(u)}}const lv=t=>t.throw(),_T="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",qT="At most one key matcher may be specified per expression",I0=(t,n)=>{if(kt(t)){if(t[1]==="=")return[n.$.parseOwnDefinitionFormat(t[0],n),"=",t[2]];if(t[1]==="?")return[n.$.parseOwnDefinitionFormat(t[0],n),"?"]}return ex(t,n)},KT="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",VT="Only required keys may specify default values, e.g. { value: 'number = 0' }",HT=(t,n)=>{var f;let i;const a={},l=No(t);for(const[d,m]of l){const p=YT(d);if(p.kind==="spread"){if(!Ts(a))return J(JT);const N=n.$.parseOwnDefinitionFormat(m,n);if(N.equals(de.object))continue;if(!N.hasKind("intersection")||!((f=N.basis)!=null&&f.equals(de.object)))return J(IT(N.expression));i=N.structure;continue}if(p.kind==="undeclared"){m!=="reject"&&m!=="delete"&&m!=="ignore"&&J(GT(m)),a.undeclared=m;continue}const g=I0(m,n),v=p;if(p.kind==="required"){kt(g)?Tf(a,"optional",g[1]==="="?{key:p.normalized,value:g[0],default:g[2]}:{key:p.normalized,value:g[0]},n):Tf(a,"required",{key:p.normalized,value:g},n);continue}if(kt(g)&&(g[1]==="?"&&J(KT),g[1]==="="&&J(VT)),p.kind==="optional"){Tf(a,"optional",{key:p.normalized,value:g},n);continue}const b=n.$.parseOwnDefinitionFormat(v.normalized,n),R=td(b,g,n.$);R.index&&(a.index=Be(a.index,R.index)),R.required&&(a.required=Be(a.required,R.required))}const u=n.$.node("structure",a);return n.$.parseSchema({domain:"object",structure:(i==null?void 0:i.merge(u))??u})},Tf=(t,n,i,a)=>{t[n]=Be(t[n],a.$.node(n,i))},GT=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${ze(t)})`,JT="Spread operator may only be used as the first key in an object",YT=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t.at(-1)==="?"?t.at(-2)===Jf?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t.at(-1)==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===Jf&&t[1]==="["&&t.at(-1)==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},IT=t=>`Spread operand must resolve to an object literal type (was ${t})`,ZT=(t,n)=>rO(t)?X0[t[0]](t,n):nO(t)?F0[t[1]](t,n):null,QT=(t,n)=>n.$.parseOwnDefinitionFormat(t[1],n).keyof(),Of=(t,n)=>{if(t[2]===void 0)return J(G0(t[1],""));const i=n.$.parseOwnDefinitionFormat(t[0],n),a=n.$.parseOwnDefinitionFormat(t[2],n);if(t[1]==="|")return n.$.node("union",{branches:[i,a]});const l=t[1]==="&"?Zn(i,a,n.$):Pf(i,a,n.$);return l instanceof W?l.throw():l},FT=(t,n)=>n.$.parseOwnDefinitionFormat(t[0],n).array(),XT=(t,n)=>typeof t[2]!="function"?J(Z0("=>",t[2])):n.$.parseOwnDefinitionFormat(t[0],n).pipe(t[2]),Z0=(t,n)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof n})`,PT=(t,n)=>typeof t[2]!="function"?J(Z0(":",t[2])):n.$.parseOwnDefinitionFormat(t[0],n).constrain("predicate",t[2]),WT=(t,n)=>n.$.parseOwnDefinitionFormat(t[0],n).configureReferences(t[2],"shallow"),Q0=t=>t,eO=Q0({"[]":FT,"?":()=>J(U0)}),tO=Q0({"|":Of,"&":Of,":":PT,"=>":XT,"|>":Of,"@":WT,"=":()=>J(B0)}),F0={...eO,...tO},nO=t=>F0[t[1]]!==void 0,iO=t=>t,X0=iO({keyof:QT,instanceof:(t,n)=>{if(typeof t[1]!="function")return J(ov(Gf(t[1])));const i=t.slice(1).map(a=>typeof a=="function"?n.$.node("proto",{proto:a}):J(ov(Gf(a))));return i.length===1?i[0]:n.$.node("union",{branches:i})},"===":(t,n)=>n.$.units(t.slice(1))}),rO=t=>X0[t[0]]!==void 0,ov=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,aO=(t,n)=>{let i=[{}],a=0;for(;a<t.length;){let l=!1;t[a]==="..."&&a<t.length-1&&(l=!0,a++);const u=I0(t[a],n),[f,d,m]=kt(u)?u:[u];if(a++,l){if(!f.extends(Z.intrinsic.Array))return J(oO(f.expression));i=i.flatMap(p=>f.distribute(g=>lO(zb(p),g)))}else i=i.map(p=>d==="?"?P0(p,f):d==="="?sO(p,f,m):sd(p,f))}return n.$.parseSchema(i.map(l=>Ts(l)?{proto:Array,exactLength:0}:{proto:Array,sequence:l}))},sd=(t,n)=>t.defaultables||t.optionals?J(t.variadic?v0:uO):(t.variadic?t.postfix=Be(t.postfix,n):t.prefix=Be(t.prefix,n),t),P0=(t,n)=>t.variadic?J(W0):(t.optionals=Be(t.optionals,n),t),sO=(t,n,i)=>t.variadic?J(W0):t.optionals?J(cO):(t.defaultables=Be(t.defaultables,[[n,i]]),t),uv=(t,n)=>(t.postfix&&J(cv),t.variadic?t.variadic.equals(n)||J(cv):t.variadic=n.internal,t),lO=(t,n)=>{const i=n.select({method:"find",kind:"sequence"});if(!i)return uv(t,Z.intrinsic.unknown);if(i.prefix)for(const a of i.prefix)sd(t,a);if(i.optionals)for(const a of i.optionals)P0(t,a);if(i.variadic&&uv(t,i.variadic),i.postfix)for(const a of i.postfix)sd(t,a);return t},oO=t=>`Spread element must be an array (was ${t})`,cv="A tuple may have at most one variadic element",uO="A required element may not follow an optional element",W0="An optional element may not follow a variadic element",cO="A defaultable element may not follow an optional element without a default",jf={},ex=(t,n)=>{var i;if(typeof t=="string"){if(n.args&&Object.keys(n.args).some(l=>t.includes(l)))return av(t,n);const a=jf[i=n.$.name]??(jf[i]={});return a[t]??(a[t]=av(t,n))}return er(t,"object")?fO(t,n):J(ld(hn(t)))},fO=(t,n)=>{const i=kd(t);switch(i){case void 0:return le(t,"root")?t:HT(t,n);case"Array":return dO(t,n);case"RegExp":return n.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const a=_o(t)?t():t;return le(a,"root")?a:J(ld("Function"))}default:return J(ld(i??ze(t)))}},dO=(t,n)=>ZT(t,n)??aO(t,n),ld=t=>`Type definitions must be strings or objects (was ${t})`;class hO extends sa{constructor(n){const i=Object.assign({errors:ki,hkt:kn,$:n,raw:n.parse,module:n.constructor.module,scope:n.constructor.scope,define:n.define,match:n.match,generic:n.generic,schema:n.schema,keywords:n.ambient,unit:n.unit,enumerated:n.enumerated,instanceOf:n.instanceOf,valueOf:n.valueOf,or:n.or,and:n.and,merge:n.merge,pipe:n.pipe},n.ambientAttachments);super((...a)=>{if(a.length===1)return n.parse(a[0]);if(a.length===2&&typeof a[0]=="string"&&a[0][0]==="<"&&a[0].at(-1)===">"){const l=a[0].slice(1,-1),u=n.parseGenericParams(l,{});return new Co(u,a[1],n,n,null)}return n.parse(a)},{bind:n,attach:i})}}const ks=Z,Zr=class Zr extends R0{constructor(){super(...arguments);w(this,"unit",i=>this.units([i]));w(this,"valueOf",i=>this.units(l$(i)));w(this,"enumerated",(...i)=>this.units(i));w(this,"instanceOf",i=>this.node("proto",{proto:i},{prereduced:!0}));w(this,"or",(...i)=>this.schema(i.map(a=>this.parse(a))));w(this,"and",(...i)=>i.reduce((a,l)=>a.and(this.parse(l)),this.intrinsic.unknown));w(this,"merge",(...i)=>i.reduce((a,l)=>a.merge(this.parse(l)),this.intrinsic.object));w(this,"pipe",(...i)=>this.intrinsic.unknown.pipe(...i));w(this,"match",new BT(this));w(this,"declare",()=>({type:this.type}));w(this,"type",new hO(this))}get ambientAttachments(){if(ks.typeAttachments)return this.cacheGetter("ambientAttachments",_e(ks.typeAttachments,(i,a)=>[i,this.bindReference(a)]))}preparseOwnAliasEntry(i,a){var d;const l=i.indexOf("<");if(l===-1){if(le(a,"module")||le(a,"generic"))return[i,a];const m=this.name==="ark"?i:i==="root"?this.name:`${this.name}.${i}`,p=(d=this.resolvedConfig.keywords)==null?void 0:d[m];return p&&(a=[a,"@",p]),[i,a]}i.at(-1)!==">"&&J("'>' must be the last character of a generic declaration in a scope");const u=i.slice(0,l),f=i.slice(l+1,-1);return[u,()=>{const m=this.parseGenericParams(f,{alias:u});return f2(m,a,this)}]}parseGenericParams(i,a){return ad(new Ns(i),[],this.createParseContext({...a,def:i,prefix:"generic"}))}normalizeRootScopeValue(i){return _o(i)&&!le(i,"generic")?i():i}preparseOwnDefinitionFormat(i,a){return{...a,def:i,prefix:a.alias??"type"}}parseOwnDefinitionFormat(i,a){!(a.alias&&a.alias in this.aliases)&&!a.args&&(a.args={this:a.id});const u=ex(i,a);if(kt(u)){if(u[1]==="=")return J(B0);if(u[1]==="?")return J(U0)}return u}define(i){return i}};w(Zr,"scope",(i,a={})=>new Zr(i,a)),w(Zr,"module",(i,a={})=>Zr.scope(i,a).export());let jo=Zr;const pO=Object.assign(jo.scope,{define:t=>t}),Ae=jo;class mO extends kn{constructor(){super(...arguments);w(this,"description",'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`')}}const gO=Qn(["base",de.object],["props",de.object])(t=>t.base.merge(t.props),mO),yO=Ae.module({Key:de.key,Merge:gO});class vO extends kn{}const bO=Qn("element")(t=>{const n=t.element.exclude(de.Array),i=n.array();return n.rawOr(i).pipe(Cs).distribute(a=>a.assertHasKind("morph").declareOut(i),Ke)},vO),xO=Ae.module({root:de.Array,readonly:"root",index:de.nonNegativeIntegerString,liftFrom:bO},{name:"Array"}),od=Ke(["string",Os.FileConstructor]),SO=od.rawOr(od.array()),fv=Ke({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:SO}}),wO=Ae.module({root:["instanceof",FormData],value:od,parsed:fv,parse:Ke({in:FormData,morphs:t=>{const n={};for(const[i,a]of t)if(i in n){const l=n[i];typeof l=="string"||l instanceof Os.FileConstructor?n[i]=[l,a]:l.push(a)}else n[i]=a;return n},declaredOut:fv})},{name:"FormData"}),NO=Ae.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"}),kO={Boolean:1,Number:1,String:1},RO=Ae.module({..._e({...Sb,...Nb},(t,n)=>t in kO?[]:[t,["instanceof",n]]),Array:xO,TypedArray:NO,FormData:wO}),EO=Ke({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),AO=Ke({domain:"number",divisor:1}),tx=Ae.module({root:de.number,integer:AO,epoch:EO,safe:Ke({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),He=(t,n,i)=>{const a={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:n}};return i&&(a.meta={format:i}),Bd("intersection",a)},dv=He(ko,"a well-formed integer string"),nx=Ae.module({root:dv,parse:Ke({in:dv,morphs:(t,n)=>{const i=Number.parseInt(t);return Number.isSafeInteger(i)?i:n.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:de.integer})},{name:"string.integer"}),$O=He(/^[\dA-Fa-f]+$/,"hex characters only"),CO=Ae.module({root:He(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:He(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),hv=He(/^[A-Z].*$/,"capitalized"),TO=Ae.module({root:Ke({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:hv}),preformatted:hv},{name:"string.capitalize"}),OO=t=>{const n=t.replaceAll(/[ -]+/g,"");let i=0,a,l,u=!1;for(let f=n.length-1;f>=0;f--)a=n.substring(f,f+1),l=Number.parseInt(a,10),u?(l*=2,i+=l>=10?l%10+1:l):i+=l,u=!u;return!!(i%10===0&&n)},jO=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,DO=Ke({domain:"string",pattern:{meta:"a credit card number",rule:jO.source},predicate:{meta:"a credit card number",predicate:OO}}),MO=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,LO=t=>!Number.isNaN(new Date(t).valueOf()),pv=Ke({domain:"string",predicate:{meta:"a parsable date",predicate:LO}}).assertHasKind("intersection"),mv=nx.root.internal.narrow((t,n)=>{const i=Number.parseInt(t),a=tx.epoch(i);return a instanceof ki?(n.errors.merge(a),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),zO=Ae.module({root:mv,parse:Ke({in:mv,morphs:t=>new Date(t),declaredOut:de.Date})},{name:"string.date.epoch"}),gv=He(MO,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),UO=Ae.module({root:gv,parse:Ke({in:gv,morphs:t=>new Date(t),declaredOut:de.Date})},{name:"string.date.iso"}),BO=Ae.module({root:pv,parse:Ke({declaredIn:pv,in:"string",morphs:(t,n)=>{const i=new Date(t);return Number.isNaN(i.valueOf())?n.error("a parsable date"):i},declaredOut:de.Date}),iso:UO,epoch:zO},{name:"string.date"}),_O=He(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),yv="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Si=`(${yv}[.]){3}${yv}`,qO=new RegExp(`^${Si}$`),tt="(?:[0-9a-fA-F]{1,4})",KO=new RegExp(`^((?:${tt}:){7}(?:${tt}|:)|(?:${tt}:){6}(?:${Si}|:${tt}|:)|(?:${tt}:){5}(?::${Si}|(:${tt}){1,2}|:)|(?:${tt}:){4}(?:(:${tt}){0,1}:${Si}|(:${tt}){1,3}|:)|(?:${tt}:){3}(?:(:${tt}){0,2}:${Si}|(:${tt}){1,4}|:)|(?:${tt}:){2}(?:(:${tt}){0,3}:${Si}|(:${tt}){1,5}|:)|(?:${tt}:){1}(?:(:${tt}){0,4}:${Si}|(:${tt}){1,6}|:)|(?::((?::${tt}){0,5}:${Si}|(?::${tt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),VO=Ae.module({root:["v4 | v6","@","an IP address"],v4:He(qO,"an IPv4 address","ipv4"),v6:He(KO,"an IPv6 address","ipv6")},{name:"string.ip"}),Fr="a JSON string",ix=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${Fr} (${t})`},HO=Ke({meta:Fr,domain:"string",predicate:{meta:Fr,predicate:(t,n)=>{try{return JSON.parse(t),!0}catch(i){return n.reject({code:"predicate",expected:Fr,problem:ix(i)})}}}}),GO=(t,n)=>{if(t.length===0)return n.error({code:"predicate",expected:Fr,actual:"empty"});try{return JSON.parse(t)}catch(i){return n.error({code:"predicate",expected:Fr,problem:ix(i)})}},JO=Ae.module({root:HO,parse:Ke({meta:"safe JSON string parser",in:"string",morphs:GO,declaredOut:de.jsonObject})},{name:"string.json"}),vv=He(/^[a-z]*$/,"only lowercase letters"),YO=Ae.module({root:Ke({in:"string",morphs:t=>t.toLowerCase(),declaredOut:vv}),preformatted:vv},{name:"string.lower"}),rx=["NFC","NFD","NFKC","NFKD"],Bs=_e(rx,(t,n)=>[n,Ke({domain:"string",predicate:i=>i.normalize(n)===i,meta:`${n}-normalized unicode`})]),Io=_e(rx,(t,n)=>[n,Ke({in:"string",morphs:i=>i.normalize(n),declaredOut:Bs[n]})]),IO=Ae.module({root:Io.NFC,preformatted:Bs.NFC},{name:"string.normalize.NFC"}),ZO=Ae.module({root:Io.NFD,preformatted:Bs.NFD},{name:"string.normalize.NFD"}),QO=Ae.module({root:Io.NFKC,preformatted:Bs.NFKC},{name:"string.normalize.NFKC"}),FO=Ae.module({root:Io.NFKD,preformatted:Bs.NFKD},{name:"string.normalize.NFKD"}),XO=Ae.module({root:"NFC",NFC:IO,NFD:ZO,NFKC:QO,NFKD:FO},{name:"string.normalize"}),bv=He(Yf,"a well-formed numeric string"),PO=Ae.module({root:bv,parse:Ke({in:bv,morphs:t=>Number.parseFloat(t),declaredOut:de.number})},{name:"string.numeric"}),xv="a regex pattern",WO=Ke({domain:"string",predicate:{meta:xv,predicate:(t,n)=>{try{return new RegExp(t),!0}catch(i){return n.reject({code:"predicate",expected:xv,problem:String(i)})}}},meta:{format:"regex"}}),ej=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,tj=He(ej,"a semantic version (see https://semver.org/)"),Sv=He(/^\S.*\S$|^\S?$/,"trimmed"),nj=Ae.module({root:Ke({in:"string",morphs:t=>t.trim(),declaredOut:Sv}),preformatted:Sv},{name:"string.trim"}),wv=He(/^[A-Z]*$/,"only uppercase letters"),ij=Ae.module({root:Ke({in:"string",morphs:t=>t.toUpperCase(),declaredOut:wv}),preformatted:wv},{name:"string.upper"}),rj=t=>{if(URL.canParse)return URL.canParse(t);try{return new URL(t),!0}catch{return!1}},Nv=Ke({domain:"string",predicate:{meta:"a URL string",predicate:rj},meta:{format:"uri"}}),aj=Ae.module({root:Nv,parse:Ke({declaredIn:Nv,in:"string",morphs:(t,n)=>{try{return new URL(t)}catch{return n.error("a URL string")}},declaredOut:Ke(URL)})},{name:"string.url"}),sj=Ae.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:He(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:He(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:He(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:He(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:He(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:He(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:He(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:He(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),lj=Ae.module({root:de.string,alpha:He(/^[A-Za-z]*$/,"only letters"),alphanumeric:He(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:$O,base64:CO,capitalize:TO,creditCard:DO,date:BO,digits:He(/^\d*$/,"only digits 0-9"),email:_O,integer:nx,ip:VO,json:JO,lower:YO,normalize:XO,numeric:PO,regex:WO,semver:tj,trim:nj,upper:ij,url:aj,uuid:sj},{name:"string"}),oj=Ae.module({bigint:de.bigint,boolean:de.boolean,false:de.false,never:de.never,null:de.null,number:de.number,object:de.object,string:de.string,symbol:de.symbol,true:de.true,unknown:de.unknown,undefined:de.undefined}),uj=Ae.module({root:de.unknown,any:de.unknown},{name:"unknown"}),cj=Ae.module({root:de.jsonObject,stringify:Bd("morph",{in:de.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:de.string})},{name:"object.json"}),fj=Ae.module({root:de.object,json:cj},{name:"object"});class dj extends kn{constructor(){super(...arguments);w(this,"description",'instantiate an object from an index signature and corresponding value type like `Record("string", "number")`')}}const hj=Qn(["K",de.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),dj);class pj extends kn{constructor(){super(...arguments);w(this,"description",'pick a set of properties from an object like `Pick(User, "name | age")`')}}const mj=Qn(["T",de.object],["K",de.key])(t=>t.T.pick(t.K),pj);class gj extends kn{constructor(){super(...arguments);w(this,"description",'omit a set of properties from an object like `Omit(User, "age")`')}}const yj=Qn(["T",de.object],["K",de.key])(t=>t.T.omit(t.K),gj);class vj extends kn{constructor(){super(...arguments);w(this,"description","make all named properties of an object optional like `Partial(User)`")}}const bj=Qn(["T",de.object])(t=>t.T.partial(),vj);class xj extends kn{constructor(){super(...arguments);w(this,"description","make all named properties of an object required like `Required(User)`")}}const Sj=Qn(["T",de.object])(t=>t.T.required(),xj);class wj extends kn{constructor(){super(...arguments);w(this,"description",'exclude branches of a union like `Exclude("boolean", "true")`')}}const Nj=Qn("T","U")(t=>t.T.exclude(t.U),wj);class kj extends kn{constructor(){super(...arguments);w(this,"description",'extract branches of a union like `Extract("0 | false | 1", "number")`')}}const Rj=Qn("T","U")(t=>t.T.extract(t.U),kj),Ej=Ae.module({Exclude:Nj,Extract:Rj,Omit:yj,Partial:bj,Pick:mj,Record:hj,Required:Sj}),tr=pO({...oj,...Ej,...RO,...yO,string:lj,number:tx,object:fj,unknown:uj},{prereducedAliases:!0,name:"ark"}),pt=tr.export();Object.assign(ks.ambient,pt);ks.typeAttachments={string:pt.string.root,number:pt.number.root,bigint:pt.bigint,boolean:pt.boolean,symbol:pt.symbol,undefined:pt.undefined,null:pt.null,object:pt.object.root,unknown:pt.unknown.root,false:pt.false,true:pt.true,never:pt.never,arrayIndex:pt.Array.index,Key:pt.Key,Record:pt.Record,Array:pt.Array.root,Date:pt.Date};const ax=Object.assign(tr.type,ks.typeAttachments);tr.match;tr.generic;tr.schema;tr.define;tr.declare;const Aj=ax("string|undefined"),kv=Aj.assert(void 0),$j=`${kv?`//${document.location.hostname}:${kv}`:`//${document.location.host}`}/api/plugin/site-generator`;let sx;const[Df]=document.getElementsByClassName("js-script-site-generator");Df&&Df instanceof HTMLScriptElement&&(sx=ax("string").assert(Df.dataset.googleRecaptchaSiteKey));const Mf=sx;async function Ri(t){try{const n=await fetch($j,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?n.json():{success:!1,userMessage:`Failed to execute command: ${n.statusText}`}}catch(n){return{success:!1,userMessage:`Communication error: ${IA(n)}`}}}const Nt=A.forwardRef((t,n)=>{const{label:i,severity:a="primary",loading:l,children:u,onClick:f,className:d="",disabled:m,...p}=t,[g,v]=A.useState(!1),b=g||l,R=["Button",a==="secondary"?"secondary":"",b?"loading":"",d].filter(Boolean).join(" "),N=async O=>{if(f)try{O.preventDefault(),v(!0),await f(O)}finally{v(!1)}};return S.jsxs("button",{ref:n,type:"button",className:R,onClick:N,disabled:m||b,...p,children:[!b&&u,!b&&i]})});Nt.displayName="Button";function lx({initialValue:t="",placeholder:n,submitLabel:i,onSubmit:a,isLoading:l=!1,error:u}){const{t:f}=Ct(),[d,m]=A.useState(t),p=v=>{m(v.target.value)},g=async()=>{d.trim()&&await a(d.trim())};return S.jsxs("div",{className:"PromptForm",children:[u&&S.jsx("div",{className:"Alert error mb-3",children:S.jsx("p",{children:u})}),S.jsx("textarea",{className:"PromptForm-textarea",placeholder:n||f("createPromptPlaceholder"),value:d,onChange:p,rows:6,disabled:l}),S.jsx(Nt,{onClick:g,loading:l,disabled:!d.trim()||l,className:"PromptForm-button mt-3",children:i})]})}const Rv=t=>{let n;const i=new Set,a=(p,g)=>{const v=typeof p=="function"?p(n):p;if(!Object.is(v,n)){const b=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),i.forEach(R=>R(n,b))}},l=()=>n,d={setState:a,getState:l,getInitialState:()=>m,subscribe:p=>(i.add(p),()=>i.delete(p))},m=n=t(a,l,d);return d},Cj=t=>t?Rv(t):Rv,Tj=t=>t;function Oj(t,n=Tj){const i=Bf.useSyncExternalStore(t.subscribe,()=>n(t.getState()),()=>n(t.getInitialState()));return Bf.useDebugValue(i),i}const Ev=t=>{const n=Cj(t),i=a=>Oj(n,a);return Object.assign(i,n),i},jj=t=>t?Ev(t):Ev,Kd="site-generator-session-token";function Av(t){try{sessionStorage.setItem(Kd,t)}catch(n){console.error("Failed to save session token",n)}}function Rs(){try{return sessionStorage.getItem(Kd)??void 0}catch(t){console.error("Failed to get session token",t)}}function Dj(){try{sessionStorage.removeItem(Kd)}catch(t){console.error("Failed to remove session token",t)}}const Mj=2e3,na=new Map;function Lj(t){if(na.has(t))return;const n=window.setInterval(()=>{zj(t)},Mj);na.set(t,n)}function oo(t){const n=na.get(t);n&&(window.clearInterval(n),na.delete(t))}function Vd(){na.forEach(t=>{window.clearInterval(t)}),na.clear()}async function zj(t){const n=Rs();if(!n){oo(t);return}try{const i=await Ri({command:"loadStep",sessionToken:n,stepNumber:t});if(i.success&&i.result){const a=i.result;Uj(a),a.status!=="pending"&&oo(t)}else console.error("Error polling step:",i),oo(t)}catch(i){console.error("Error polling step:",i),oo(t)}}function Uj(t){const{updateStep:n}=nr.getState();n(t)}function Lf(t){Vd(),t.steps.forEach(n=>{n.status==="pending"&&Lj(n.stepNumber)})}const nr=jj((t,n)=>({workSession:void 0,isLoading:!1,error:void 0,activeStepNumber:void 0,setWorkSession:i=>{t({workSession:i}),i&&Lf(i)},updateStep:i=>{const{workSession:a}=n();if(!a)return;const l=a.steps.map(f=>f.stepNumber===i.stepNumber?i:f),u={...a,steps:l};t({workSession:u}),i.status==="pending"&&Lf(u)},appendNewStep:i=>{const{workSession:a}=n();if(!a)return;const l={...a,steps:[...a.steps,i]};t({workSession:l}),i.status==="pending"&&Lf(l)},setIsLoading:i=>t({isLoading:i}),setError:i=>t({error:i}),setActiveStepNumber:i=>t({activeStepNumber:i}),resetSession:()=>{Vd(),t({workSession:void 0,isLoading:!1,error:void 0,activeStepNumber:void 0})}}));function Zo({size:t="medium"}){return S.jsx("div",{className:`Spinner Spinner-${t}`})}function yo({activeStep:t}){const{t:n}=Ct(),i=aa(),{workSession:a}=nr(),l=async()=>{await i("/")},u=async f=>{await i(`/step/${f}`)};return!a||!a.steps||a.steps.length===0?S.jsx("div",{className:"Sidebar",children:S.jsx(Nt,{className:`Sidebar-button ${t===void 0?"active":""}`,onClick:l,children:n("startAgain")})}):S.jsxs("div",{className:"Sidebar",children:[S.jsx(Nt,{className:`Sidebar-button ${t===void 0?"active":""}`,onClick:l,children:n("startAgain")}),S.jsx("div",{className:"Sidebar-steps",children:a.steps.map(f=>S.jsxs("div",{className:"Sidebar-step",children:[S.jsx(Nt,{className:`Sidebar-button ${t===f.stepNumber?"active":""} ${f.status==="pending"?"has-spinner":""}`,onClick:()=>u(f.stepNumber),children:n("stepTitle",{stepNumber:f.stepNumber,kind:n(f.kind)})}),f.status==="pending"&&S.jsx("div",{className:"Sidebar-spinner",children:S.jsx(Zo,{size:"small"})})]},f.stepNumber))})]})}function It({header:t,footer:n,children:i,className:a=""}){const l=["Card",a].filter(Boolean).join(" ");return S.jsxs("div",{className:l,children:[t&&S.jsx("div",{className:"Card-header",children:t}),S.jsx("div",{className:"Card-body",children:i}),n&&S.jsx("div",{className:"Card-footer",children:n})]})}function Bj(){const{t}=Ct(),n=aa(),[i,a]=A.useState(!1),[l,u]=A.useState(void 0),{workSession:f,appendNewStep:d}=nr(),m=async p=>{if(!f)return;a(!0),u(void 0);const g=Rs();if(!g){u(t("sessionExpired")),a(!1);return}try{const v=await Ri({command:"createSiteSchema",sessionToken:g,prompt:p});if(v.success&&v.result){const b=v.result;d(b),await n(`/step/${b.stepNumber}`)}else u(t("promptSubmissionFailed"))}catch(v){console.error("Error submitting prompt:",v),u(t("errorOccurred"))}finally{a(!1)}};return S.jsxs("div",{className:"RouteLayout",children:[S.jsx("div",{className:"RouteLayout-main",children:S.jsxs(It,{className:"p-4",children:[S.jsx("h1",{className:"mb-4",children:t("welcomeTitle")}),S.jsx("div",{className:"Text mb-4",dangerouslySetInnerHTML:{__html:t("startInstruction")}}),f&&f.steps.length>0&&S.jsx("p",{className:"InfoText",children:t("newTabRestartMessage")}),S.jsx(lx,{submitLabel:t("createSchema"),onSubmit:m,isLoading:i,error:l})]})}),S.jsx("div",{className:"RouteLayout-sidebar",children:S.jsx(yo,{activeStep:void 0})})]})}function _j(t){return"siteId"in t}function Hd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ir=Hd();function ox(t){ir=t}var vs={exec:()=>null};function $e(t,n=""){let i=typeof t=="string"?t:t.source;const a={replace:(l,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(At.caret,"$1"),i=i.replace(l,f),a},getRegex:()=>new RegExp(i,n)};return a}var At={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},qj=/^(?:[ \t]*(?:\n|$))+/,Kj=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vj=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_s=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Hj=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gd=/(?:[*+-]|\d{1,9}[.)])/,ux=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cx=$e(ux).replace(/bull/g,Gd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Gj=$e(ux).replace(/bull/g,Gd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jj=/^[^\n]+/,Yd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yj=$e(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ij=$e(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gd).getRegex(),Qo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Id=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Zj=$e("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Id).replace("tag",Qo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fx=$e(Jd).replace("hr",_s).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex(),Qj=$e(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fx).getRegex(),Zd={blockquote:Qj,code:Kj,def:Yj,fences:Vj,heading:Hj,hr:_s,html:Zj,lheading:cx,list:Ij,newline:qj,paragraph:fx,table:vs,text:Jj},$v=$e("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_s).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex(),Fj={...Zd,lheading:Gj,table:$v,paragraph:$e(Jd).replace("hr",_s).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$v).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex()},Xj={...Zd,html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Id).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$e(Jd).replace("hr",_s).replace("heading",` *#{1,6} *[^
106
- ]`).replace("lheading",cx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dx=/^( {2,}|\\)\n(?!\s*$)/,e3=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fo=/[\p{P}\p{S}]/u,Qd=/[\s\p{P}\p{S}]/u,hx=/[^\s\p{P}\p{S}]/u,t3=$e(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qd).getRegex(),px=/(?!~)[\p{P}\p{S}]/u,n3=/(?!~)[\s\p{P}\p{S}]/u,i3=/(?:[^\s\p{P}\p{S}]|~)/u,r3=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,mx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,a3=$e(mx,"u").replace(/punct/g,Fo).getRegex(),s3=$e(mx,"u").replace(/punct/g,px).getRegex(),gx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",l3=$e(gx,"gu").replace(/notPunctSpace/g,hx).replace(/punctSpace/g,Qd).replace(/punct/g,Fo).getRegex(),o3=$e(gx,"gu").replace(/notPunctSpace/g,i3).replace(/punctSpace/g,n3).replace(/punct/g,px).getRegex(),u3=$e("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hx).replace(/punctSpace/g,Qd).replace(/punct/g,Fo).getRegex(),c3=$e(/\\(punct)/,"gu").replace(/punct/g,Fo).getRegex(),f3=$e(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),d3=$e(Id).replace("(?:-->|$)","-->").getRegex(),h3=$e("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",d3).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Do=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,p3=$e(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Do).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yx=$e(/^!?\[(label)\]\[(ref)\]/).replace("label",Do).replace("ref",Yd).getRegex(),vx=$e(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yd).getRegex(),m3=$e("reflink|nolink(?!\\()","g").replace("reflink",yx).replace("nolink",vx).getRegex(),Fd={_backpedal:vs,anyPunctuation:c3,autolink:f3,blockSkip:r3,br:dx,code:Wj,del:vs,emStrongLDelim:a3,emStrongRDelimAst:l3,emStrongRDelimUnd:u3,escape:Pj,link:p3,nolink:vx,punctuation:t3,reflink:yx,reflinkSearch:m3,tag:h3,text:e3,url:vs},g3={...Fd,link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",Do).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Do).getRegex()},ud={...Fd,emStrongRDelimAst:o3,emStrongLDelim:s3,url:$e(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},y3={...ud,br:$e(dx).replace("{2,}","*").getRegex(),text:$e(ud.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},uo={normal:Zd,gfm:Fj,pedantic:Xj},ds={normal:Fd,gfm:ud,breaks:y3,pedantic:g3},v3={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cv=t=>v3[t];function Sn(t,n){if(n){if(At.escapeTest.test(t))return t.replace(At.escapeReplace,Cv)}else if(At.escapeTestNoEncode.test(t))return t.replace(At.escapeReplaceNoEncode,Cv);return t}function Tv(t){try{t=encodeURI(t).replace(At.percentDecode,"%")}catch{return null}return t}function Ov(t,n){var u;const i=t.replace(At.findPipe,(f,d,m)=>{let p=!1,g=d;for(;--g>=0&&m[g]==="\\";)p=!p;return p?"|":" |"}),a=i.split(At.splitPipe);let l=0;if(a[0].trim()||a.shift(),a.length>0&&!((u=a.at(-1))!=null&&u.trim())&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;l<a.length;l++)a[l]=a[l].trim().replace(At.slashPipe,"|");return a}function hs(t,n,i){const a=t.length;if(a===0)return"";let l=0;for(;l<a&&t.charAt(a-l-1)===n;)l++;return t.slice(0,a-l)}function b3(t,n){if(t.indexOf(n[1])===-1)return-1;let i=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===n[0])i++;else if(t[a]===n[1]&&(i--,i<0))return a;return i>0?-2:-1}function jv(t,n,i,a,l){const u=n.href,f=n.title||null,d=t[1].replace(l.other.outputLinkReplace,"$1");a.state.inLink=!0;const m={type:t[0].charAt(0)==="!"?"image":"link",raw:i,href:u,title:f,text:d,tokens:a.inlineTokens(d)};return a.state.inLink=!1,m}function x3(t,n,i){const a=t.match(i.other.indentCodeCompensation);if(a===null)return n;const l=a[1];return n.split(`
107
- `).map(u=>{const f=u.match(i.other.beginningSpace);if(f===null)return u;const[d]=f;return d.length>=l.length?u.slice(l.length):u}).join(`
108
- `)}var Mo=class{constructor(t){w(this,"options");w(this,"rules");w(this,"lexer");this.options=t||ir}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:hs(i,`
109
- `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],a=x3(i,n[3]||"",this.rules);return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(this.rules.other.endingHash.test(i)){const a=hs(i,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(i=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:hs(n[0],`
110
- `)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let i=hs(n[0],`
111
- `).split(`
112
- `),a="",l="";const u=[];for(;i.length>0;){let f=!1;const d=[];let m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))d.push(i[m]),f=!0;else if(!f)d.push(i[m]);else break;i=i.slice(m);const p=d.join(`
113
- `),g=p.replace(this.rules.other.blockquoteSetextReplace,`
114
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
115
- ${p}`:p,l=l?`${l}
116
- ${g}`:g;const v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,u,!0),this.lexer.state.top=v,i.length===0)break;const b=u.at(-1);if((b==null?void 0:b.type)==="code")break;if((b==null?void 0:b.type)==="blockquote"){const R=b,N=R.raw+`
117
- `+i.join(`
118
- `),O=this.blockquote(N);u[u.length-1]=O,a=a.substring(0,a.length-R.raw.length)+O.raw,l=l.substring(0,l.length-R.text.length)+O.text;break}else if((b==null?void 0:b.type)==="list"){const R=b,N=R.raw+`
119
- `+i.join(`
120
- `),O=this.list(N);u[u.length-1]=O,a=a.substring(0,a.length-b.raw.length)+O.raw,l=l.substring(0,l.length-R.raw.length)+O.raw,i=N.substring(u.at(-1).raw.length).split(`
121
- `);continue}}return{type:"blockquote",raw:a,tokens:u,text:l}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i=n[1].trim();const a=i.length>1,l={type:"list",raw:"",ordered:a,start:a?+i.slice(0,-1):"",loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:"[*+-]");const u=this.rules.other.listItemRegex(i);let f=!1;for(;t;){let m=!1,p="",g="";if(!(n=u.exec(t))||this.rules.block.hr.test(t))break;p=n[0],t=t.substring(p.length);let v=n[2].split(`
122
- `,1)[0].replace(this.rules.other.listReplaceTabs,z=>" ".repeat(3*z.length)),b=t.split(`
123
- `,1)[0],R=!v.trim(),N=0;if(this.options.pedantic?(N=2,g=v.trimStart()):R?N=n[1].length+1:(N=n[2].search(this.rules.other.nonSpaceChar),N=N>4?1:N,g=v.slice(N),N+=n[1].length),R&&this.rules.other.blankLine.test(b)&&(p+=b+`
124
- `,t=t.substring(b.length+1),m=!0),!m){const z=this.rules.other.nextBulletRegex(N),L=this.rules.other.hrRegex(N),G=this.rules.other.fencesBeginRegex(N),X=this.rules.other.headingBeginRegex(N),F=this.rules.other.htmlBeginRegex(N);for(;t;){const pe=t.split(`
125
- `,1)[0];let fe;if(b=pe,this.options.pedantic?(b=b.replace(this.rules.other.listReplaceNesting," "),fe=b):fe=b.replace(this.rules.other.tabCharGlobal," "),G.test(b)||X.test(b)||F.test(b)||z.test(b)||L.test(b))break;if(fe.search(this.rules.other.nonSpaceChar)>=N||!b.trim())g+=`
126
- `+fe.slice(N);else{if(R||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(v)||X.test(v)||L.test(v))break;g+=`
127
- `+b}!R&&!b.trim()&&(R=!0),p+=pe+`
128
- `,t=t.substring(pe.length+1),v=fe.slice(N)}}l.loose||(f?l.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(f=!0));let O=null,U;this.options.gfm&&(O=this.rules.other.listIsTask.exec(g),O&&(U=O[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:p,task:!!O,checked:U,loose:!1,text:g,tokens:[]}),l.raw+=p}const d=l.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let m=0;m<l.items.length;m++)if(this.lexer.state.top=!1,l.items[m].tokens=this.lexer.blockTokens(l.items[m].text,[]),!l.loose){const p=l.items[m].tokens.filter(v=>v.type==="space"),g=p.length>0&&p.some(v=>this.rules.other.anyLine.test(v.raw));l.loose=g}if(l.loose)for(let m=0;m<l.items.length;m++)l.items[m].loose=!0;return l}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const i=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:a,title:l}}}table(t){var f;const n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;const i=Ov(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(f=n[3])!=null&&f.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
129
- `):[],u={type:"table",raw:n[0],header:[],align:[],rows:[]};if(i.length===a.length){for(const d of a)this.rules.other.tableAlignRight.test(d)?u.align.push("right"):this.rules.other.tableAlignCenter.test(d)?u.align.push("center"):this.rules.other.tableAlignLeft.test(d)?u.align.push("left"):u.align.push(null);for(let d=0;d<i.length;d++)u.header.push({text:i[d],tokens:this.lexer.inline(i[d]),header:!0,align:u.align[d]});for(const d of l)u.rows.push(Ov(d,u.header.length).map((m,p)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[p]})));return u}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const i=n[1].charAt(n[1].length-1)===`
130
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;const u=hs(i.slice(0,-1),"\\");if((i.length-u.length)%2===0)return}else{const u=b3(n[2],"()");if(u===-2)return;if(u>-1){const d=(n[0].indexOf("!")===0?5:4)+n[1].length+u;n[2]=n[2].substring(0,u),n[0]=n[0].substring(0,d).trim(),n[3]=""}}let a=n[2],l="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(a);u&&(a=u[1],l=u[3])}else l=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?a=a.slice(1):a=a.slice(1,-1)),jv(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){const a=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=n[a.toLowerCase()];if(!l){const u=i[0].charAt(0);return{type:"text",raw:u,text:u}}return jv(i,l,i[0],this.lexer,this.rules)}}emStrong(t,n,i=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!a||a[3]&&i.match(this.rules.other.unicodeAlphaNumeric))return;if(!(a[1]||a[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const u=[...a[0]].length-1;let f,d,m=u,p=0;const g=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,n=n.slice(-1*t.length+u);(a=g.exec(n))!=null;){if(f=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!f)continue;if(d=[...f].length,a[3]||a[4]){m+=d;continue}else if((a[5]||a[6])&&u%3&&!((u+d)%3)){p+=d;continue}if(m-=d,m>0)continue;d=Math.min(d,d+m+p);const v=[...a[0]][0].length,b=t.slice(0,u+a.index+v+d);if(Math.min(u,d)%2){const N=b.slice(1,-1);return{type:"em",raw:b,text:N,tokens:this.lexer.inlineTokens(N)}}const R=b.slice(2,-2);return{type:"strong",raw:b,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(this.rules.other.newLineCharGlobal," ");const a=this.rules.other.nonSpaceChar.test(i),l=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return a&&l&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let i,a;return n[2]==="@"?(i=n[1],a="mailto:"+i):(i=n[1],a=i),{type:"link",raw:n[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i;let n;if(n=this.rules.inline.url.exec(t)){let a,l;if(n[2]==="@")a=n[0],l="mailto:"+a;else{let u;do u=n[0],n[0]=((i=this.rules.inline._backpedal.exec(n[0]))==null?void 0:i[0])??"";while(u!==n[0]);a=n[0],n[1]==="www."?l="http://"+n[0]:l=n[0]}return{type:"link",raw:n[0],text:a,href:l,tokens:[{type:"text",raw:a,text:a}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){const i=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:i}}}},Kn=class cd{constructor(n){w(this,"tokens");w(this,"options");w(this,"state");w(this,"tokenizer");w(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ir,this.options.tokenizer=this.options.tokenizer||new Mo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:At,block:uo.normal,inline:ds.normal};this.options.pedantic?(i.block=uo.pedantic,i.inline=ds.pedantic):this.options.gfm&&(i.block=uo.gfm,this.options.breaks?i.inline=ds.breaks:i.inline=ds.gfm),this.tokenizer.rules=i}static get rules(){return{block:uo,inline:ds}}static lex(n,i){return new cd(i).lex(n)}static lexInline(n,i){return new cd(i).inlineTokens(n)}lex(n){n=n.replace(At.carriageReturn,`
131
- `),this.blockTokens(n,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const a=this.inlineQueue[i];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,i=[],a=!1){var l,u,f;for(this.options.pedantic&&(n=n.replace(At.tabCharGlobal," ").replace(At.spaceLine,""));n;){let d;if((u=(l=this.options.extensions)==null?void 0:l.block)!=null&&u.some(p=>(d=p.call({lexer:this},n,i))?(n=n.substring(d.raw.length),i.push(d),!0):!1))continue;if(d=this.tokenizer.space(n)){n=n.substring(d.raw.length);const p=i.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
132
- `:i.push(d);continue}if(d=this.tokenizer.code(n)){n=n.substring(d.raw.length);const p=i.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=`
133
- `+d.raw,p.text+=`
134
- `+d.text,this.inlineQueue.at(-1).src=p.text):i.push(d);continue}if(d=this.tokenizer.fences(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.heading(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.hr(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.blockquote(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.list(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.html(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.def(n)){n=n.substring(d.raw.length);const p=i.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=`
135
- `+d.raw,p.text+=`
136
- `+d.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title});continue}if(d=this.tokenizer.table(n)){n=n.substring(d.raw.length),i.push(d);continue}if(d=this.tokenizer.lheading(n)){n=n.substring(d.raw.length),i.push(d);continue}let m=n;if((f=this.options.extensions)!=null&&f.startBlock){let p=1/0;const g=n.slice(1);let v;this.options.extensions.startBlock.forEach(b=>{v=b.call({lexer:this},g),typeof v=="number"&&v>=0&&(p=Math.min(p,v))}),p<1/0&&p>=0&&(m=n.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(m))){const p=i.at(-1);a&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=`
137
- `+d.raw,p.text+=`
138
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(d),a=m.length!==n.length,n=n.substring(d.raw.length);continue}if(d=this.tokenizer.text(n)){n=n.substring(d.raw.length);const p=i.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=`
139
- `+d.raw,p.text+=`
140
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):i.push(d);continue}if(n){const p="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){var d,m,p;let a=n,l=null;if(this.tokens.links){const g=Object.keys(this.tokens.links);if(g.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)g.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,f="";for(;n;){u||(f=""),u=!1;let g;if((m=(d=this.options.extensions)==null?void 0:d.inline)!=null&&m.some(b=>(g=b.call({lexer:this},n,i))?(n=n.substring(g.raw.length),i.push(g),!0):!1))continue;if(g=this.tokenizer.escape(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.tag(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.link(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(g.raw.length);const b=i.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(g=this.tokenizer.emStrong(n,a,f)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.codespan(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.br(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.del(n)){n=n.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.autolink(n)){n=n.substring(g.raw.length),i.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(n))){n=n.substring(g.raw.length),i.push(g);continue}let v=n;if((p=this.options.extensions)!=null&&p.startInline){let b=1/0;const R=n.slice(1);let N;this.options.extensions.startInline.forEach(O=>{N=O.call({lexer:this},R),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(v=n.substring(0,b+1))}if(g=this.tokenizer.inlineText(v)){n=n.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(f=g.raw.slice(-1)),u=!0;const b=i.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(n){const b="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return i}},Lo=class{constructor(t){w(this,"options");w(this,"parser");this.options=t||ir}space(t){return""}code({text:t,lang:n,escaped:i}){var u;const a=(u=(n||"").match(At.notSpaceStart))==null?void 0:u[0],l=t.replace(At.endingNewline,"")+`
141
- `;return a?'<pre><code class="language-'+Sn(a)+'">'+(i?l:Sn(l,!0))+`</code></pre>
142
- `:"<pre><code>"+(i?l:Sn(l,!0))+`</code></pre>
143
- `}blockquote({tokens:t}){return`<blockquote>
144
- ${this.parser.parse(t)}</blockquote>
145
- `}html({text:t}){return t}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
146
- `}hr(t){return`<hr>
147
- `}list(t){const n=t.ordered,i=t.start;let a="";for(let f=0;f<t.items.length;f++){const d=t.items[f];a+=this.listitem(d)}const l=n?"ol":"ul",u=n&&i!==1?' start="'+i+'"':"";return"<"+l+u+`>
148
- `+a+"</"+l+`>
149
- `}listitem(t){var i;let n="";if(t.task){const a=this.checkbox({checked:!!t.checked});t.loose?((i=t.tokens[0])==null?void 0:i.type)==="paragraph"?(t.tokens[0].text=a+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=a+" "+Sn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:a+" ",text:a+" ",escaped:!0}):n+=a+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
150
- `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
151
- `}table(t){let n="",i="";for(let l=0;l<t.header.length;l++)i+=this.tablecell(t.header[l]);n+=this.tablerow({text:i});let a="";for(let l=0;l<t.rows.length;l++){const u=t.rows[l];i="";for(let f=0;f<u.length;f++)i+=this.tablecell(u[f]);a+=this.tablerow({text:i})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
152
- <thead>
153
- `+n+`</thead>
154
- `+a+`</table>
155
- `}tablerow({text:t}){return`<tr>
156
- ${t}</tr>
157
- `}tablecell(t){const n=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+n+`</${i}>
158
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Sn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:i}){const a=this.parser.parseInline(i),l=Tv(t);if(l===null)return a;t=l;let u='<a href="'+t+'"';return n&&(u+=' title="'+Sn(n)+'"'),u+=">"+a+"</a>",u}image({href:t,title:n,text:i,tokens:a}){a&&(i=this.parser.parseInline(a,this.parser.textRenderer));const l=Tv(t);if(l===null)return Sn(i);t=l;let u=`<img src="${t}" alt="${i}"`;return n&&(u+=` title="${Sn(n)}"`),u+=">",u}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Sn(t.text)}},Xd=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Vn=class fd{constructor(n){w(this,"options");w(this,"renderer");w(this,"textRenderer");this.options=n||ir,this.options.renderer=this.options.renderer||new Lo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xd}static parse(n,i){return new fd(i).parse(n)}static parseInline(n,i){return new fd(i).parseInline(n)}parse(n,i=!0){var l,u;let a="";for(let f=0;f<n.length;f++){const d=n[f];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[d.type]){const p=d,g=this.options.extensions.renderers[p.type].call({parser:this},p);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)){a+=g||"";continue}}const m=d;switch(m.type){case"space":{a+=this.renderer.space(m);continue}case"hr":{a+=this.renderer.hr(m);continue}case"heading":{a+=this.renderer.heading(m);continue}case"code":{a+=this.renderer.code(m);continue}case"table":{a+=this.renderer.table(m);continue}case"blockquote":{a+=this.renderer.blockquote(m);continue}case"list":{a+=this.renderer.list(m);continue}case"html":{a+=this.renderer.html(m);continue}case"paragraph":{a+=this.renderer.paragraph(m);continue}case"text":{let p=m,g=this.renderer.text(p);for(;f+1<n.length&&n[f+1].type==="text";)p=n[++f],g+=`
159
- `+this.renderer.text(p);i?a+=this.renderer.paragraph({type:"paragraph",raw:g,text:g,tokens:[{type:"text",raw:g,text:g,escaped:!0}]}):a+=g;continue}default:{const p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return a}parseInline(n,i=this.renderer){var l,u;let a="";for(let f=0;f<n.length;f++){const d=n[f];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[d.type]){const p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(d.type)){a+=p||"";continue}}const m=d;switch(m.type){case"escape":{a+=i.text(m);break}case"html":{a+=i.html(m);break}case"link":{a+=i.link(m);break}case"image":{a+=i.image(m);break}case"strong":{a+=i.strong(m);break}case"em":{a+=i.em(m);break}case"codespan":{a+=i.codespan(m);break}case"br":{a+=i.br(m);break}case"del":{a+=i.del(m);break}case"text":{a+=i.text(m);break}default:{const p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return a}},zf,vo=(zf=class{constructor(t){w(this,"options");w(this,"block");this.options=t||ir}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Kn.lex:Kn.lexInline}provideParser(){return this.block?Vn.parse:Vn.parseInline}},w(zf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),zf),S3=class{constructor(...t){w(this,"defaults",Hd());w(this,"options",this.setOptions);w(this,"parse",this.parseMarkdown(!0));w(this,"parseInline",this.parseMarkdown(!1));w(this,"Parser",Vn);w(this,"Renderer",Lo);w(this,"TextRenderer",Xd);w(this,"Lexer",Kn);w(this,"Tokenizer",Mo);w(this,"Hooks",vo);this.use(...t)}walkTokens(t,n){var a,l;let i=[];for(const u of t)switch(i=i.concat(n.call(this,u)),u.type){case"table":{const f=u;for(const d of f.header)i=i.concat(this.walkTokens(d.tokens,n));for(const d of f.rows)for(const m of d)i=i.concat(this.walkTokens(m.tokens,n));break}case"list":{const f=u;i=i.concat(this.walkTokens(f.items,n));break}default:{const f=u;(l=(a=this.defaults.extensions)==null?void 0:a.childTokens)!=null&&l[f.type]?this.defaults.extensions.childTokens[f.type].forEach(d=>{const m=f[d].flat(1/0);i=i.concat(this.walkTokens(m,n))}):f.tokens&&(i=i.concat(this.walkTokens(f.tokens,n)))}}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const a={...i};if(a.async=this.defaults.async||a.async||!1,i.extensions&&(i.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const u=n.renderers[l.name];u?n.renderers[l.name]=function(...f){let d=l.renderer.apply(this,f);return d===!1&&(d=u.apply(this,f)),d}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=n[l.level];u?u.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),a.extensions=n),i.renderer){const l=this.defaults.renderer||new Lo(this.defaults);for(const u in i.renderer){if(!(u in l))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,d=i.renderer[f],m=l[f];l[f]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g||""}}a.renderer=l}if(i.tokenizer){const l=this.defaults.tokenizer||new Mo(this.defaults);for(const u in i.tokenizer){if(!(u in l))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,d=i.tokenizer[f],m=l[f];l[f]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}a.tokenizer=l}if(i.hooks){const l=this.defaults.hooks||new vo;for(const u in i.hooks){if(!(u in l))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,d=i.hooks[f],m=l[f];vo.passThroughHooks.has(u)?l[f]=p=>{if(this.defaults.async)return Promise.resolve(d.call(l,p)).then(v=>m.call(l,v));const g=d.call(l,p);return m.call(l,g)}:l[f]=(...p)=>{let g=d.apply(l,p);return g===!1&&(g=m.apply(l,p)),g}}a.hooks=l}if(i.walkTokens){const l=this.defaults.walkTokens,u=i.walkTokens;a.walkTokens=function(f){let d=[];return d.push(u.call(this,f)),l&&(d=d.concat(l.call(this,f))),d}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Kn.lex(t,n??this.defaults)}parser(t,n){return Vn.parse(t,n??this.defaults)}parseMarkdown(t){return(i,a)=>{const l={...a},u={...this.defaults,...l},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&l.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=t);const d=u.hooks?u.hooks.provideLexer():t?Kn.lex:Kn.lexInline,m=u.hooks?u.hooks.provideParser():t?Vn.parse:Vn.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(i):i).then(p=>d(p,u)).then(p=>u.hooks?u.hooks.processAllTokens(p):p).then(p=>u.walkTokens?Promise.all(this.walkTokens(p,u.walkTokens)).then(()=>p):p).then(p=>m(p,u)).then(p=>u.hooks?u.hooks.postprocess(p):p).catch(f);try{u.hooks&&(i=u.hooks.preprocess(i));let p=d(i,u);u.hooks&&(p=u.hooks.processAllTokens(p)),u.walkTokens&&this.walkTokens(p,u.walkTokens);let g=m(p,u);return u.hooks&&(g=u.hooks.postprocess(g)),g}catch(p){return f(p)}}}onError(t,n){return i=>{if(i.message+=`
160
- Please report this to https://github.com/markedjs/marked.`,t){const a="<p>An error occurred:</p><pre>"+Sn(i.message+"",!0)+"</pre>";return n?Promise.resolve(a):a}if(n)return Promise.reject(i);throw i}}},Pi=new S3;function Oe(t,n){return Pi.parse(t,n)}Oe.options=Oe.setOptions=function(t){return Pi.setOptions(t),Oe.defaults=Pi.defaults,ox(Oe.defaults),Oe};Oe.getDefaults=Hd;Oe.defaults=ir;Oe.use=function(...t){return Pi.use(...t),Oe.defaults=Pi.defaults,ox(Oe.defaults),Oe};Oe.walkTokens=function(t,n){return Pi.walkTokens(t,n)};Oe.parseInline=Pi.parseInline;Oe.Parser=Vn;Oe.parser=Vn.parse;Oe.Renderer=Lo;Oe.TextRenderer=Xd;Oe.Lexer=Kn;Oe.lexer=Kn.lex;Oe.Tokenizer=Mo;Oe.Hooks=vo;Oe.parse=Oe;Oe.options;Oe.setOptions;Oe.use;Oe.walkTokens;Oe.parseInline;Vn.parse;Kn.lex;function w3(t){if(!t)return"";try{return Oe.parse(t,{async:!1,gfm:!0,breaks:!0})}catch(n){return console.error("Error rendering markdown:",n),t}}function qs({content:t,title:n,variant:i="default",className:a="",children:l}){const u=["Explanation",`Explanation-${i}`,a].filter(Boolean).join(" ");return S.jsxs("div",{className:u,children:[n&&S.jsx("h3",{className:"Explanation-title",children:n}),S.jsx("div",{className:"Explanation-content markdown-content",dangerouslySetInnerHTML:{__html:w3(t)}}),l]})}function N3({isOpen:t,title:n,message:i,confirmLabel:a,cancelLabel:l,onConfirm:u,onCancel:f}){const{t:d}=Ct(),[m,p]=A.useState(!0);if(!t)return null;const g=async()=>{await u({withSampleData:m})},v=b=>{b.key==="Escape"&&f()};return S.jsxs("div",{className:"ConfirmDialog",children:[S.jsx("div",{className:"ConfirmDialog-backdrop",onClick:f,onKeyDown:v,tabIndex:0,role:"button","aria-label":"Close dialog"}),S.jsxs("div",{className:"ConfirmDialog-container",children:[S.jsx("div",{className:"ConfirmDialog-header",children:S.jsx("h3",{className:"ConfirmDialog-title",children:n})}),S.jsxs("div",{className:"ConfirmDialog-body",children:[S.jsx("p",{children:i}),S.jsx("div",{className:"ConfirmDialog-checkbox mt-3",children:S.jsxs("label",{children:[S.jsx("input",{type:"checkbox",checked:m,onChange:b=>p(b.target.checked)}),S.jsx("span",{className:"ml-2",children:d("generateSiteWithData")})]})})]}),S.jsxs("div",{className:"ConfirmDialog-footer",children:[S.jsx(Nt,{onClick:f,severity:"secondary",className:"ConfirmDialog-button",children:l||d("cancel")}),S.jsx(Nt,{onClick:g,className:"ConfirmDialog-button",children:a||d("confirm")})]})]})]})}function _(){return _=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var a in i)({}).hasOwnProperty.call(i,a)&&(t[a]=i[a])}return t},_.apply(null,arguments)}function we(t,n){if(t==null)return{};var i={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(n.indexOf(a)!==-1)continue;i[a]=t[a]}return i}var bx={},xx=A.createContext(bx),k3=(t,n)=>_({},t,n),R3=()=>A.useContext(xx),Pd=A.createContext(()=>{});Pd.displayName="JVR.DispatchShowTools";function E3(){return A.useReducer(k3,bx)}function Sx(){return A.useContext(Pd)}var wx=t=>{var{initial:n,dispatch:i,children:a}=t;return S.jsx(xx.Provider,{value:n,children:S.jsx(Pd.Provider,{value:i,children:a})})};wx.displayName="JVR.ShowTools";var Nx={},kx=A.createContext(Nx),A3=(t,n)=>_({},t,n),Xo=()=>A.useContext(kx),Wd=A.createContext(()=>{});Wd.displayName="JVR.DispatchExpands";function $3(){return A.useReducer(A3,Nx)}function C3(){return A.useContext(Wd)}var Rx=t=>{var{initial:n,dispatch:i,children:a}=t;return S.jsx(kx.Provider,{value:n,children:S.jsx(Wd.Provider,{value:i,children:a})})};Rx.displayName="JVR.Expands";var Ex={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},Ax=A.createContext(Ex),T3=(t,n)=>_({},t,n),Ve=()=>A.useContext(Ax),eh=A.createContext(()=>{});eh.displayName="JVR.DispatchTypes";function O3(){return A.useReducer(T3,Ex)}function j3(){return A.useContext(eh)}function $x(t){var{initial:n,dispatch:i,children:a}=t;return S.jsx(Ax.Provider,{value:n,children:S.jsx(eh.Provider,{value:i,children:a})})}$x.displayName="JVR.Types";var D3=["style"];function Cx(t){var{style:n}=t,i=we(t,D3),a=_({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},n);return S.jsx("svg",_({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:a},i,{children:S.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}Cx.displayName="JVR.TriangleArrow";var Tx={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:S.jsx(Cx,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},Ox=A.createContext(Tx),M3=(t,n)=>_({},t,n),zt=()=>A.useContext(Ox),th=A.createContext(()=>{});th.displayName="JVR.DispatchSymbols";function L3(){return A.useReducer(M3,Tx)}function z3(){return A.useContext(th)}var jx=t=>{var{initial:n,dispatch:i,children:a}=t;return S.jsx(Ox.Provider,{value:n,children:S.jsx(th.Provider,{value:i,children:a})})};jx.displayName="JVR.Symbols";var Dx={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},Mx=A.createContext(Dx),U3=(t,n)=>_({},t,n),ln=()=>A.useContext(Mx),nh=A.createContext(()=>{});nh.displayName="JVR.DispatchSection";function B3(){return A.useReducer(U3,Dx)}function _3(){return A.useContext(nh)}var Lx=t=>{var{initial:n,dispatch:i,children:a}=t;return S.jsx(Mx.Provider,{value:n,children:S.jsx(nh.Provider,{value:i,children:a})})};Lx.displayName="JVR.Section";var zx={objectSortKeys:!1,indentWidth:15},ih=A.createContext(zx);ih.displayName="JVR.Context";var Ux=A.createContext(()=>{});Ux.displayName="JVR.DispatchContext";function q3(t,n){return _({},t,n)}var rr=()=>A.useContext(ih),Bx=t=>{var{children:n,initialState:i,initialTypes:a}=t,[l,u]=A.useReducer(q3,Object.assign({},zx,i)),[f,d]=E3(),[m,p]=$3(),[g,v]=O3(),[b,R]=L3(),[N,O]=B3();return A.useEffect(()=>u(_({},i)),[i]),S.jsx(ih.Provider,{value:l,children:S.jsx(Ux.Provider,{value:u,children:S.jsx(wx,{initial:f,dispatch:d,children:S.jsx(Rx,{initial:m,dispatch:p,children:S.jsx($x,{initial:_({},g,a),dispatch:v,children:S.jsx(jx,{initial:b,dispatch:R,children:S.jsx(Lx,{initial:N,dispatch:O,children:n})})})})})})})};Bx.displayName="JVR.Provider";function K3(t){if(t==null)throw new TypeError("Cannot destructure "+t)}var V3=["isNumber","value","parentValue","keyName","keys"],H3=["as","render"],G3=["as","render"],J3=["as","render"],Y3=["as","style","render"],I3=["as","render"],Z3=["as","render"],Q3=["as","render"],F3=["as","render"],dd=t=>{var{Quote:n={}}=zt(),{isNumber:i,value:a,parentValue:l,keyName:u,keys:f}=t,d=we(t,V3);if(i)return null;var{as:m,render:p}=n,g=we(n,H3),v=m||"span",b=_({},d,g),R={value:a,parentValue:l,keyName:u,keys:f||(u?[u]:[])},N=p&&typeof p=="function"&&p(b,R);return N||S.jsx(v,_({},b))};dd.displayName="JVR.Quote";var Es=t=>{var{ValueQuote:n={}}=zt(),i=_({},(K3(t),t)),{as:a,render:l}=n,u=we(n,G3),f=a||"span",d=_({},i,u),m=l&&typeof l=="function"&&l(d,{});return m||S.jsx(f,_({},d))};Es.displayName="JVR.ValueQuote";var _x=t=>{var{value:n,parentValue:i,keyName:a,keys:l}=t,{Colon:u={}}=zt(),{as:f,render:d}=u,m=we(u,J3),p=f||"span",g=d&&typeof d=="function"&&d(m,{value:n,parentValue:i,keyName:a,keys:l||(a?[a]:[])});return g||S.jsx(p,_({},m))};_x.displayName="JVR.Colon";var qx=t=>{var{Arrow:n={}}=zt(),i=Xo(),{expandKey:a,style:l,value:u,parentValue:f,keyName:d,keys:m}=t,p=!!i[a],{as:g,style:v,render:b}=n,R=we(n,Y3),N=g||"span",O=b&&typeof b=="function",U=_({},R,{"data-expanded":p,style:_({},v,l)}),z={value:u,parentValue:f,keyName:d,keys:m||(d?[d]:[])},L=O&&b(U,z);return L||S.jsx(N,_({},R,{style:_({},v,l)}))};qx.displayName="JVR.Arrow";var Kx=t=>{var{isBrackets:n,value:i,parentValue:a,keyName:l,keys:u}=t,{BracketsLeft:f={},BraceLeft:d={}}=zt(),m={value:i,parentValue:a,keyName:l,keys:u||(l?[l]:[])};if(n){var{as:p,render:g}=f,v=we(f,I3),b=p||"span",R=g&&typeof g=="function"&&g(v,m);return R||S.jsx(b,_({},v))}var{as:N,render:O}=d,U=we(d,Z3),z=N||"span",L=O&&typeof O=="function"&&O(U,m);return L||S.jsx(z,_({},U))};Kx.displayName="JVR.BracketsOpen";var rh=t=>{var{isBrackets:n,isVisiable:i,value:a,parentValue:l,keyName:u,keys:f}=t,d={value:a,parentValue:l,keyName:u,keys:f||(u?[u]:[])};if(!i)return null;var{BracketsRight:m={},BraceRight:p={}}=zt();if(n){var{as:g,render:v}=m,b=we(m,Q3),R=g||"span",N=v&&typeof v=="function"&&v(b,d);return N||S.jsx(R,_({},b))}var{as:O,render:U}=p,z=we(p,F3),L=O||"span",G=U&&typeof U=="function"&&U(z,d);return G||S.jsx(L,_({},z))};rh.displayName="JVR.BracketsClose";var Vx=t=>{var n,{value:i,expandKey:a,level:l,keys:u=[]}=t,f=Xo(),d=Array.isArray(i),{collapsed:m,shouldExpandNodeInitially:p}=rr(),g=i instanceof Set,v=typeof m=="boolean"?m:typeof m=="number"?l>m:!1,b=(n=f[a])!=null?n:v,R=Object.keys(i).length;if(f[a]===void 0&&p&&p(b,{value:i,keys:u,level:l})||b||R===0)return null;var N={paddingLeft:4};return S.jsx("div",{style:N,children:S.jsx(rh,{isBrackets:d||g,isVisiable:!0})})};Vx.displayName="JVR.NestedClose";var X3=["as","render"],P3=["as","render"],W3=["as","render"],eD=["as","render"],tD=["as","render"],nD=["as","render"],iD=["as","render"],rD=["as","render"],aD=["as","render"],sD=["as","render"],lD=["as","render"],oD=["as","render"],uD=["as","render"],hd=t=>{if(t===void 0)return"0n";if(typeof t=="string")try{t=BigInt(t)}catch{return"0n"}return t?t.toString()+"n":"0n"},Hx=t=>{var{value:n,keyName:i}=t,{Set:a={},displayDataTypes:l}=Ve(),u=n instanceof Set;if(!u||!l)return null;var{as:f,render:d}=a,m=we(a,X3),p=d&&typeof d=="function",g=p&&d(m,{type:"type",value:n,keyName:i});if(g)return g;var v=f||"span";return S.jsx(v,_({},m))};Hx.displayName="JVR.SetComp";var Gx=t=>{var{value:n,keyName:i}=t,{Map:a={},displayDataTypes:l}=Ve(),u=n instanceof Map;if(!u||!l)return null;var{as:f,render:d}=a,m=we(a,P3),p=d&&typeof d=="function",g=p&&d(m,{type:"type",value:n,keyName:i});if(g)return g;var v=f||"span";return S.jsx(v,_({},m))};Gx.displayName="JVR.MapComp";var pn={opacity:.75,paddingRight:4},Jx=t=>{var{children:n="",keyName:i}=t,{Str:a={},displayDataTypes:l}=Ve(),{shortenTextAfterLength:u=30,stringEllipsis:f="..."}=rr(),{as:d,render:m}=a,p=we(a,W3),g=n,[v,b]=A.useState(u&&g.length>u);A.useEffect(()=>b(u&&g.length>u),[u]);var R=d||"span",N=_({},pn,a.style||{});u>0&&(p.style=_({},p.style,{cursor:g.length<=u?"initial":"pointer"}),g.length>u&&(p.onClick=()=>{b(!v)}));var O=v?""+g.slice(0,u)+f:g,U=m&&typeof m=="function",z=U&&m(_({},p,{style:N}),{type:"type",value:n,keyName:i}),L=v?"w-rjv-value w-rjv-value-short":"w-rjv-value",G=U&&m(_({},p,{children:O,className:L}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(z||S.jsx(R,_({},p,{style:N}))),G||S.jsxs(A.Fragment,{children:[S.jsx(Es,{}),S.jsx(R,_({},p,{className:L,children:O})),S.jsx(Es,{})]})]})};Jx.displayName="JVR.TypeString";var Yx=t=>{var{children:n,keyName:i}=t,{True:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,eD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsx(m,_({},d,{className:"w-rjv-value",children:n==null?void 0:n.toString()}))]})};Yx.displayName="JVR.TypeTrue";var Ix=t=>{var{children:n,keyName:i}=t,{False:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,tD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsx(m,_({},d,{className:"w-rjv-value",children:n==null?void 0:n.toString()}))]})};Ix.displayName="JVR.TypeFalse";var Zx=t=>{var{children:n,keyName:i}=t,{Float:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,nD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsx(m,_({},d,{className:"w-rjv-value",children:n==null?void 0:n.toString()}))]})};Zx.displayName="JVR.TypeFloat";var Qx=t=>{var{children:n,keyName:i}=t,{Int:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,iD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsx(m,_({},d,{className:"w-rjv-value",children:n==null?void 0:n.toString()}))]})};Qx.displayName="JVR.TypeInt";var Fx=t=>{var{children:n,keyName:i}=t,{Bigint:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,rD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsx(m,_({},d,{className:"w-rjv-value",children:hd(n==null?void 0:n.toString())}))]})};Fx.displayName="JVR.TypeFloat";var Xx=t=>{var{children:n,keyName:i}=t,{Url:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,aD),m=u||"span",p=_({},pn,a.style),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n==null?void 0:n.href,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b||S.jsxs("a",_({href:n==null?void 0:n.href,target:"_blank"},d,{className:"w-rjv-value",children:[S.jsx(Es,{}),n==null?void 0:n.href,S.jsx(Es,{})]}))]})};Xx.displayName="JVR.TypeUrl";var Px=t=>{var{children:n,keyName:i}=t,{Date:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,sD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=n instanceof Date?n.toLocaleString():n,R=g&&f(_({},d,{children:b,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),R||S.jsx(m,_({},d,{className:"w-rjv-value",children:b}))]})};Px.displayName="JVR.TypeDate";var Wx=t=>{var{children:n,keyName:i}=t,{Undefined:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,lD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b]})};Wx.displayName="JVR.TypeUndefined";var eS=t=>{var{children:n,keyName:i}=t,{Null:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,oD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n,className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b]})};eS.displayName="JVR.TypeNull";var tS=t=>{var{children:n,keyName:i}=t,{Nan:a={},displayDataTypes:l}=Ve(),{as:u,render:f}=a,d=we(a,uD),m=u||"span",p=_({},pn,a.style||{}),g=f&&typeof f=="function",v=g&&f(_({},d,{style:p}),{type:"type",value:n,keyName:i}),b=g&&f(_({},d,{children:n==null?void 0:n.toString(),className:"w-rjv-value"}),{type:"value",value:n,keyName:i});return S.jsxs(A.Fragment,{children:[l&&(v||S.jsx(m,_({},d,{style:p}))),b]})};tS.displayName="JVR.TypeNan";var cD=t=>Number(t)===t&&t%1!==0||isNaN(t),nS=t=>{var{value:n,keyName:i}=t,a={keyName:i};return n instanceof URL?S.jsx(Xx,_({},a,{children:n})):typeof n=="string"?S.jsx(Jx,_({},a,{children:n})):n===!0?S.jsx(Yx,_({},a,{children:n})):n===!1?S.jsx(Ix,_({},a,{children:n})):n===null?S.jsx(eS,_({},a,{children:n})):n===void 0?S.jsx(Wx,_({},a,{children:n})):n instanceof Date?S.jsx(Px,_({},a,{children:n})):typeof n=="number"&&isNaN(n)?S.jsx(tS,_({},a,{children:n})):typeof n=="number"&&cD(n)?S.jsx(Zx,_({},a,{children:n})):typeof n=="bigint"?S.jsx(Fx,_({},a,{children:n})):typeof n=="number"?S.jsx(Qx,_({},a,{children:n})):null};nS.displayName="JVR.Value";function Ai(t,n,i){var a=z3(),l=[t.className,n.className].filter(Boolean).join(" "),u=_({},t,n,{className:l,style:_({},t.style,n.style),children:n.children||t.children});A.useEffect(()=>a({[i]:u}),[n])}function Zt(t,n,i){var a=j3(),l=[t.className,n.className].filter(Boolean).join(" "),u=_({},t,n,{className:l,style:_({},t.style,n.style),children:n.children||t.children});A.useEffect(()=>a({[i]:u}),[n])}function ua(t,n,i){var a=_3(),l=[t.className,n.className].filter(Boolean).join(" "),u=_({},t,n,{className:l,style:_({},t.style,n.style),children:n.children||t.children});A.useEffect(()=>a({[i]:u}),[n])}var fD=["as","render"],iS=t=>{var{KeyName:n={}}=ln();return ua(n,t,"KeyName"),null};iS.displayName="JVR.KeyName";var rS=t=>{var{children:n,value:i,parentValue:a,keyName:l,keys:u}=t,f=typeof n=="number",d={color:f?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:m={}}=ln(),{as:p,render:g}=m,v=we(m,fD);v.style=_({},v.style,d);var b=p||"span",R=g&&typeof g=="function"&&g(_({},v,{children:n}),{value:i,parentValue:a,keyName:l,keys:u||(l?[l]:[])});return R||S.jsx(b,_({},v,{children:n}))};rS.displayName="JVR.KeyNameComp";var dD=["children","value","parentValue","keyName","keys"],hD=["as","render","children"],aS=t=>{var{Row:n={}}=ln();return ua(n,t,"Row"),null};aS.displayName="JVR.Row";var sS=t=>{var{children:n,value:i,parentValue:a,keyName:l,keys:u}=t,f=we(t,dD),{Row:d={}}=ln(),{as:m,render:p}=d,g=we(d,hD),v=m||"div",b=p&&typeof p=="function"&&p(_({},f,g,{children:n}),{value:i,keyName:l,parentValue:a,keys:u});return b||S.jsx(v,_({},f,g,{children:n}))};sS.displayName="JVR.RowComp";function pD(t){var n=A.useRef();return A.useEffect(()=>{n.current=t}),n.current}function mD(t){var{value:n,highlightUpdates:i,highlightContainer:a}=t,l=pD(n),u=A.useMemo(()=>{if(!i||l===void 0)return!1;if(typeof n!=typeof l)return!0;if(typeof n=="number")return isNaN(n)&&isNaN(l)?!1:n!==l;if(Array.isArray(n)!==Array.isArray(l))return!0;if(typeof n=="object"||typeof n=="function")return!1;if(n!==l)return!0},[i,n]);A.useEffect(()=>{a&&a.current&&u&&"animate"in a.current&&a.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[u,n,a])}var gD=["keyName","value","parentValue","expandKey","keys"],yD=["as","render"],ah=t=>{var{keyName:n,value:i,parentValue:a,expandKey:l,keys:u}=t,f=we(t,gD),{onCopied:d,enableClipboard:m}=rr(),p=R3(),g=p[l],[v,b]=A.useState(!1),{Copied:R={}}=ln();if(m===!1||!g)return null;var N=F=>{F.stopPropagation();var pe="";typeof i=="number"&&i===1/0?pe="Infinity":typeof i=="number"&&isNaN(i)?pe="NaN":typeof i=="bigint"?pe=hd(i):i instanceof Date?pe=i.toLocaleString():pe=JSON.stringify(i,(re,ee)=>typeof ee=="bigint"?hd(ee):ee,2),d&&d(pe,i),b(!0);var fe=navigator.clipboard||{writeText(re){return new Promise((ee,oe)=>{var xe=document.createElement("textarea");xe.style.position="absolute",xe.style.opacity="0",xe.style.left="-99999999px",xe.value=re,document.body.appendChild(xe),xe.select(),document.execCommand("copy")?ee():oe(),xe.remove()})}};fe.writeText(pe).then(()=>{var re=setTimeout(()=>{b(!1),clearTimeout(re)},3e3)}).catch(re=>{})},O={style:{display:"inline-flex"},fill:v?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:N},{render:U}=R,z=we(R,yD),L=_({},z,f,O,{style:_({},z.style,f.style,O.style)}),G=U&&typeof U=="function",X=G&&U(_({},L,{"data-copied":v}),{value:i,keyName:n,keys:u,parentValue:a});return X||(v?S.jsx("svg",_({viewBox:"0 0 32 36"},L,{children:S.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):S.jsx("svg",_({viewBox:"0 0 32 36"},L,{children:S.jsx("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};ah.displayName="JVR.Copied";function lS(){var t=A.useRef(null);return t.current===null&&(t.current="custom-id-"+Math.random().toString(36).substr(2,9)),t.current}var oS=t=>{var n,{value:i,expandKey:a="",level:l,keys:u=[]}=t,f=Xo(),{objectSortKeys:d,indentWidth:m,collapsed:p,shouldExpandNodeInitially:g}=rr(),v=Array.isArray(i),b=typeof p=="boolean"?p:typeof p=="number"?l>p:!1,R=(n=f[a])!=null?n:b;if(f[a]===void 0&&g&&g(R,{value:i,keys:u,level:l})||R)return null;var N=v?Object.entries(i).map(U=>[Number(U[0]),U[1]]):Object.entries(i);d&&(N=d===!0?N.sort((U,z)=>{var[L]=U,[G]=z;return typeof L=="string"&&typeof G=="string"?L.localeCompare(G):0}):N.sort((U,z)=>{var[L,G]=U,[X,F]=z;return typeof L=="string"&&typeof X=="string"?d(L,X,G,F):0}));var O={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:m,marginLeft:6};return S.jsx("div",{className:"w-rjv-wrap",style:O,children:N.map((U,z)=>{var[L,G]=U;return S.jsx(uS,{parentValue:i,keyName:L,keys:[...u,L],value:G,level:l},z)})})};oS.displayName="JVR.KeyValues";var sh=t=>{var{keyName:n,parentValue:i,keys:a,value:l}=t,{highlightUpdates:u}=rr(),f=typeof n=="number",d=A.useRef(null);mD({value:l,highlightUpdates:u,highlightContainer:d});var m={keyName:n,value:l,keys:a,parentValue:i};return S.jsxs(A.Fragment,{children:[S.jsxs("span",{ref:d,children:[S.jsx(dd,_({isNumber:f,"data-placement":"left"},m)),S.jsx(rS,_({},m,{children:n})),S.jsx(dd,_({isNumber:f,"data-placement":"right"},m))]}),S.jsx(_x,_({},m))]})};sh.displayName="JVR.KayName";var uS=t=>{var{keyName:n,value:i,parentValue:a,level:l=0,keys:u=[]}=t,f=Sx(),d=lS(),m=Array.isArray(i),p=i instanceof Set,g=i instanceof Map,v=i instanceof Date,b=i instanceof URL,R=i&&typeof i=="object"&&!m&&!p&&!g&&!v&&!b,N=R||m||p||g;if(N){var O=p?Array.from(i):g?Object.fromEntries(i):i;return S.jsx(lh,{keyName:n,value:O,parentValue:a,initialValue:i,keys:u,level:l+1})}var U={onMouseEnter:()=>f({[d]:!0}),onMouseLeave:()=>f({[d]:!1})};return S.jsxs(sS,_({className:"w-rjv-line",value:i,keyName:n,keys:u,parentValue:a},U,{children:[S.jsx(sh,{keyName:n,value:i,keys:u,parentValue:a}),S.jsx(nS,{keyName:n,value:i}),S.jsx(ah,{keyName:n,value:i,keys:u,parentValue:a,expandKey:d})]}))};uS.displayName="JVR.KeyValuesItem";var vD=["value","keyName"],bD=["as","render"],cS=t=>{var{CountInfoExtra:n={}}=ln();return ua(n,t,"CountInfoExtra"),null};cS.displayName="JVR.CountInfoExtra";var fS=t=>{var{value:n={},keyName:i}=t,a=we(t,vD),{CountInfoExtra:l={}}=ln(),{as:u,render:f}=l,d=we(l,bD);if(!f&&!d.children)return null;var m=u||"span",p=f&&typeof f=="function",g=_({},d,a),v=p&&f(g,{value:n,keyName:i});return v||S.jsx(m,_({},g))};fS.displayName="JVR.CountInfoExtraComps";var xD=["value","keyName"],SD=["as","render"],dS=t=>{var{CountInfo:n={}}=ln();return ua(n,t,"CountInfo"),null};dS.displayName="JVR.CountInfo";var hS=t=>{var{value:n={},keyName:i}=t,a=we(t,xD),{displayObjectSize:l}=rr(),{CountInfo:u={}}=ln();if(!l)return null;var{as:f,render:d}=u,m=we(u,SD),p=f||"span";m.style=_({},m.style,t.style);var g=Object.keys(n).length;m.children||(m.children=g+" item"+(g===1?"":"s"));var v=_({},m,a),b=d&&typeof d=="function",R=b&&d(_({},v,{"data-length":g}),{value:n,keyName:i});return R||S.jsx(p,_({},v))};hS.displayName="JVR.CountInfoComp";var wD=["as","render"],pS=t=>{var{Ellipsis:n={}}=ln();return ua(n,t,"Ellipsis"),null};pS.displayName="JVR.Ellipsis";var mS=t=>{var{isExpanded:n,value:i,keyName:a}=t,{Ellipsis:l={}}=ln(),{as:u,render:f}=l,d=we(l,wD),m=u||"span",p=f&&typeof f=="function"&&f(_({},d,{"data-expanded":n}),{value:i,keyName:a});return p||(!n||typeof i=="object"&&Object.keys(i).length==0?null:S.jsx(m,_({},d)))};mS.displayName="JVR.EllipsisComp";var gS=t=>{var n,{keyName:i,expandKey:a,keys:l=[],initialValue:u,value:f,parentValue:d,level:m}=t,p=Xo(),g=C3(),{onExpand:v,collapsed:b,shouldExpandNodeInitially:R}=rr(),N=Array.isArray(f),O=f instanceof Set,U=typeof b=="boolean"?b:typeof b=="number"?m>b:!1,z=typeof f=="object",L=(n=p[a])!=null?n:U,G=R&&R(L,{value:f,keys:l,level:m});p[a]===void 0&&G!==void 0&&(L=G);var X=()=>{var xe={expand:!L,value:f,keyid:a,keyName:i};v&&v(xe),g({[a]:xe.expand})},F={display:"inline-flex",alignItems:"center"},pe={transform:"rotate("+(L?"-90":"0")+"deg)",transition:"all 0.3s"},fe=Object.keys(f).length,re=fe!==0&&(N||O||z),ee={style:F};re&&(ee.onClick=X);var oe={keyName:i,value:f,keys:l,parentValue:d};return S.jsxs("span",_({},ee,{children:[re&&S.jsx(qx,_({style:pe,expandKey:a},oe)),(i||typeof i=="number")&&S.jsx(sh,_({},oe)),S.jsx(Hx,{value:u,keyName:i}),S.jsx(Gx,{value:u,keyName:i}),S.jsx(Kx,_({isBrackets:N||O},oe)),S.jsx(mS,{keyName:i,value:f,isExpanded:L}),S.jsx(rh,_({isVisiable:L||!re,isBrackets:N||O},oe)),S.jsx(hS,{value:f,keyName:i}),S.jsx(fS,{value:f,keyName:i}),S.jsx(ah,{keyName:i,value:f,expandKey:a,parentValue:d,keys:l})]}))};gS.displayName="JVR.NestedOpen";var ND=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],lh=A.forwardRef((t,n)=>{var{className:i="",parentValue:a,level:l=1,value:u,initialValue:f,keys:d,keyName:m}=t,p=we(t,ND),g=Sx(),v=lS(),b=[i,"w-rjv-inner"].filter(Boolean).join(" "),R={onMouseEnter:()=>g({[v]:!0}),onMouseLeave:()=>g({[v]:!1})};return S.jsxs("div",_({className:b,ref:n},p,R,{children:[S.jsx(gS,{expandKey:v,value:u,level:l,keys:d,parentValue:a,keyName:m,initialValue:f}),S.jsx(oS,{expandKey:v,value:u,level:l,keys:d,parentValue:a,keyName:m}),S.jsx(Vx,{expandKey:v,value:u,level:l,keys:d})]}))});lh.displayName="JVR.Container";var yS=t=>{var{BraceLeft:n={}}=zt();return Ai(n,t,"BraceLeft"),null};yS.displayName="JVR.BraceLeft";var vS=t=>{var{BraceRight:n={}}=zt();return Ai(n,t,"BraceRight"),null};vS.displayName="JVR.BraceRight";var bS=t=>{var{BracketsLeft:n={}}=zt();return Ai(n,t,"BracketsLeft"),null};bS.displayName="JVR.BracketsLeft";var xS=t=>{var{BracketsRight:n={}}=zt();return Ai(n,t,"BracketsRight"),null};xS.displayName="JVR.BracketsRight";var SS=t=>{var{Arrow:n={}}=zt();return Ai(n,t,"Arrow"),null};SS.displayName="JVR.Arrow";var wS=t=>{var{Colon:n={}}=zt();return Ai(n,t,"Colon"),null};wS.displayName="JVR.Colon";var NS=t=>{var{Quote:n={}}=zt();return Ai(n,t,"Quote"),null};NS.displayName="JVR.Quote";var kS=t=>{var{ValueQuote:n={}}=zt();return Ai(n,t,"ValueQuote"),null};kS.displayName="JVR.ValueQuote";var RS=t=>{var{Bigint:n={}}=Ve();return Zt(n,t,"Bigint"),null};RS.displayName="JVR.Bigint";var ES=t=>{var{Date:n={}}=Ve();return Zt(n,t,"Date"),null};ES.displayName="JVR.Date";var AS=t=>{var{False:n={}}=Ve();return Zt(n,t,"False"),null};AS.displayName="JVR.False";var $S=t=>{var{Float:n={}}=Ve();return Zt(n,t,"Float"),null};$S.displayName="JVR.Float";var CS=t=>{var{Int:n={}}=Ve();return Zt(n,t,"Int"),null};CS.displayName="JVR.Int";var TS=t=>{var{Map:n={}}=Ve();return Zt(n,t,"Map"),null};TS.displayName="JVR.Map";var OS=t=>{var{Nan:n={}}=Ve();return Zt(n,t,"Nan"),null};OS.displayName="JVR.Nan";var jS=t=>{var{Null:n={}}=Ve();return Zt(n,t,"Null"),null};jS.displayName="JVR.Null";var DS=t=>{var{Set:n={}}=Ve();return Zt(n,t,"Set"),null};DS.displayName="JVR.Set";var MS=t=>{var{Str:n={}}=Ve();return Zt(n,t,"Str"),null};MS.displayName="JVR.StringText";var LS=t=>{var{True:n={}}=Ve();return Zt(n,t,"True"),null};LS.displayName="JVR.True";var zS=t=>{var{Undefined:n={}}=Ve();return Zt(n,t,"Undefined"),null};zS.displayName="JVR.Undefined";var US=t=>{var{Url:n={}}=Ve();return Zt(n,t,"Url"),null};US.displayName="JVR.Url";var BS=t=>{var{Copied:n={}}=ln();return ua(n,t,"Copied"),null};BS.displayName="JVR.Copied";var kD=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied"],je=A.forwardRef((t,n)=>{var{className:i="",style:a,value:l,children:u,collapsed:f,shouldExpandNodeInitially:d,indentWidth:m=15,displayObjectSize:p=!0,shortenTextAfterLength:g=30,stringEllipsis:v,highlightUpdates:b=!0,enableClipboard:R=!0,displayDataTypes:N=!0,objectSortKeys:O=!1,onExpand:U,onCopied:z}=t,L=we(t,kD),G=_({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},a),X=["w-json-view-container","w-rjv",i].filter(Boolean).join(" ");return S.jsxs(Bx,{initialState:{value:l,objectSortKeys:O,indentWidth:m,shouldExpandNodeInitially:d,displayObjectSize:p,collapsed:f,enableClipboard:R,shortenTextAfterLength:g,stringEllipsis:v,highlightUpdates:b,onCopied:z,onExpand:U},initialTypes:{displayDataTypes:N},children:[S.jsx(lh,_({value:l},L,{ref:n,className:X,style:G})),u]})});je.Bigint=RS;je.Date=ES;je.False=AS;je.Float=$S;je.Int=CS;je.Map=TS;je.Nan=OS;je.Null=jS;je.Set=DS;je.String=MS;je.True=LS;je.Undefined=zS;je.Url=US;je.ValueQuote=kS;je.Arrow=SS;je.Colon=wS;je.Quote=NS;je.Ellipsis=pS;je.BraceLeft=yS;je.BraceRight=vS;je.BracketsLeft=bS;je.BracketsRight=xS;je.Copied=BS;je.CountInfo=dS;je.CountInfoExtra=cS;je.KeyName=iS;je.Row=aS;je.displayName="JVR.JsonView";var Dv={"--w-rjv-font-family":"monospace","--w-rjv-color":"#002b36","--w-rjv-key-string":"#002b36","--w-rjv-background-color":"#ffffff","--w-rjv-line-color":"#ebebeb","--w-rjv-arrow-color":"var(--w-rjv-color)","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#0000004d","--w-rjv-update-color":"#ebcb8b","--w-rjv-copied-color":"#002b36","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#236a7c","--w-rjv-colon-color":"#002b36","--w-rjv-brackets-color":"#236a7c","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#cb4b16","--w-rjv-type-int-color":"#268bd2","--w-rjv-type-float-color":"#859900","--w-rjv-type-bigint-color":"#268bd2","--w-rjv-type-boolean-color":"#2aa198","--w-rjv-type-date-color":"#586e75","--w-rjv-type-url-color":"#0969da","--w-rjv-type-null-color":"#d33682","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#586e75"};function RD(t){const n=Object.keys(t),i=n.length>0?n[0]:void 0;return(a,l,u={})=>{if(!i)return u.default??a;const f=t[l]??t[i],d=a.split(".");let m=f;for(const p of d){if(typeof m=="string"||!m||!Object.hasOwn(m,p))return u.default??a;m=m[p]}return typeof m=="string"?m:u.default??a}}function ED({siteSchema:t,schemaTranslate:n}){const i=new Set;return S.jsx("ul",{children:S.jsx(pd,{schema:t,schemaT:n,typeName:"home",displayedNodeTypeNames:i})})}function pd({schema:t,schemaT:n,typeName:i,depth:a=0,displayedNodeTypeNames:l}){const{i18n:u}=Ct(),f=AD(t,i);if(!f)return null;const d=f.routingChildren||[],m=f.regularChildren||[],p=f.lists||[],g=f.documentKind==="routing",v=n(`nodeTypes.${i}.label`,u.language,{default:i});return l.has(i)?S.jsx("li",{children:S.jsxs("div",{children:[g?S.jsx("strong",{children:v}):v," (",S.jsx("code",{children:i}),")"]})}):(l.add(i),S.jsxs("li",{children:[S.jsxs("div",{children:[g?S.jsx("strong",{children:v}):v," (",S.jsx("code",{children:i}),")"]}),p.map(b=>S.jsxs("div",{style:{marginLeft:"30px",color:"#999",fontStyle:"italic"},children:[n(`nodeTypes.${i}.lists.${b.listName}.label`,u.language,{default:b.listName})," ","(",S.jsx("code",{children:b.listName})," [",S.jsx("code",{children:b.parts.join("</code>, <code>")}),"])"]},b.listName)),d.length>0&&S.jsx("ul",{children:d.map(b=>S.jsx(pd,{schema:t,schemaT:n,typeName:b,depth:a+1,displayedNodeTypeNames:l},b))}),m.length>0&&S.jsx("ul",{children:m.map(b=>S.jsx(pd,{schema:t,schemaT:n,typeName:b,depth:a+1,displayedNodeTypeNames:l},b))})]}))}function AD(t,n){var i;return(i=t.nodeTypes)==null?void 0:i.find(a=>a.kind==="document"&&a.typeName===n)}const co=je;function $D({step:t}){const{t:n}=Ct(),[i,a]=A.useState("tree"),{siteSchema:l,l10n:u}=t,f=RD(u),d=(m,p)=>p.keys.length===1&&p.keys[0]==="plugins";return S.jsxs("div",{className:"SchemaViewer",children:[S.jsxs("div",{className:"SchemaViewer-tabs",children:[S.jsx(Nt,{className:`SchemaViewer-tab ${i==="tree"?"active":""}`,onClick:()=>a("tree"),children:n("treeView")}),S.jsx(Nt,{className:`SchemaViewer-tab ${i==="schema"?"active":""}`,onClick:()=>a("schema"),children:n("siteSchema")}),S.jsx(Nt,{className:`SchemaViewer-tab ${i==="locales"?"active":""}`,onClick:()=>a("locales"),children:n("labels")})]}),S.jsxs("div",{className:"SchemaViewer-main",children:[S.jsx("div",{className:"SchemaViewer-content",style:{display:i==="tree"?"block":"none"},children:S.jsx(ED,{siteSchema:l,schemaTranslate:f})}),S.jsx("div",{className:"SchemaViewer-content",style:{display:i==="locales"?"block":"none"},children:S.jsx(co,{value:u,style:Dv,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,shortenTextAfterLength:0})}),S.jsx("div",{className:"SchemaViewer-content",style:{display:i==="schema"?"block":"none"},children:S.jsxs(co,{value:l,style:Dv,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,shortenTextAfterLength:0,shouldExpandNodeInitially:d,children:[S.jsx(co.Colon,{render:(m,{parentValue:p})=>Array.isArray(p)&&m.children===":"?S.jsx("span",{}):S.jsx("span",{...m})}),S.jsx(co.KeyName,{render:({...m},{parentValue:p})=>Array.isArray(p)&&Number.isFinite(m.children)?S.jsx("span",{}):S.jsx("span",{...m})})]})})]})]})}function CD({step:t}){const{t:n}=Ct(),{workSession:i,appendNewStep:a}=nr(),[l,u]=A.useState(!1),[f,d]=A.useState(!1),[m,p]=A.useState(!1),[g,v]=A.useState(void 0),b=aa(),R=()=>{u(!l)},N=async U=>{if(!i)return;p(!0),v(void 0);const z=Rs();if(!z){v(n("sessionExpired")),p(!1);return}try{const L=await Ri({command:"updateSiteSchema",sessionToken:z,prompt:U,fromStepNumber:t.stepNumber});L.success&&L.result?(u(!1),a(L.result),await b(`/step/${L.result.stepNumber}`)):v(n("promptSubmissionFailed"))}catch(L){console.error("Error updating schema:",L),v(n("errorOccurred"))}finally{p(!1)}},O=async({withSampleData:U})=>{if(!i)return;p(!0),v(void 0),d(!1);const z=Rs();if(!z){v(n("sessionExpired")),p(!1);return}try{const L=await Ri({command:"generateSite",sessionToken:z,fromStepNumber:t.stepNumber,withSampleData:U});L.success&&L.result?(a(L.result),await b(`/step/${L.result.stepNumber}`)):v(n("generationFailed"))}catch(L){console.error("Error generating site:",L),v(n("errorOccurred"))}finally{p(!1)}};return S.jsx(It,{children:S.jsxs("div",{className:"CompletedStep",children:[S.jsx($D,{step:t}),t.explanation&&S.jsx(qs,{content:t.explanation,title:n("explanation")}),S.jsxs("div",{className:"CompletedStep-actions",children:[S.jsx(Nt,{onClick:R,className:"CompletedStep-button",children:n("modifySchema")}),S.jsx(Nt,{onClick:()=>d(!0),className:"CompletedStep-button",children:n("generateTheWebsite")})]}),l&&S.jsxs("div",{className:"CompletedStep-updateForm",children:[S.jsx("h3",{children:n("updateSchema")}),S.jsx(lx,{placeholder:n("updatePromptPlaceholder"),submitLabel:n("modifySchema"),onSubmit:N,isLoading:m,error:g})]}),S.jsx(N3,{isOpen:f,title:n("generateTheWebsite"),message:n("aboutToGenerateWebsite"),confirmLabel:n("confirm"),onConfirm:O,onCancel:()=>d(!1)}),g&&!l&&S.jsx("div",{className:"Alert error",children:S.jsx("p",{children:g})})]})})}function TD({step:t}){const{t:n}=Ct();return S.jsx(It,{children:S.jsxs("div",{className:"ErrorStep",children:[S.jsx("p",{className:"ErrorStep-message",children:n("stepFailed")}),t.explanation&&S.jsx(qs,{content:t.explanation,variant:"error"})]})})}function OD({step:t}){const{t:n}=Ct(),i=()=>{const a=`
161
- ${n("siteGenerated")}
162
- ${n("loginEmail")}: ${t.loginEmail}
163
- ${n("loginPassword")}: ${t.loginPassword}
164
- ${n("siteUrl")}: ${t.siteUrl}
165
- ${n("adminUrl")}: ${t.adminUiUrl}
166
- `.trim();navigator.clipboard.writeText(a)};return S.jsx(It,{children:S.jsxs("div",{className:"GeneratedSite",children:[t.status==="pending"&&S.jsxs("div",{className:"GeneratedSite-pending",children:[S.jsx(Zo,{size:"small"}),S.jsx("p",{children:n("generatingContent")})]}),t.explanation&&S.jsx(qs,{content:t.explanation,title:n("explanation"),variant:"info"}),S.jsx("div",{className:"GeneratedSite-header",children:S.jsx("h2",{className:"GeneratedSite-title",children:n("generatedSite")})}),S.jsx("div",{className:"Text my-4",dangerouslySetInnerHTML:{__html:n("userManual")}}),S.jsxs("div",{className:"GeneratedSite-information",children:[S.jsxs("div",{className:"GeneratedSite-field",children:[S.jsx("div",{className:"GeneratedSite-label",children:n("loginEmail")}),S.jsx("div",{className:"GeneratedSite-value",children:S.jsx("input",{type:"text",value:t.loginEmail,readOnly:!0,className:"GeneratedSite-input"})})]}),S.jsxs("div",{className:"GeneratedSite-field",children:[S.jsx("div",{className:"GeneratedSite-label",children:n("loginPassword")}),S.jsx("div",{className:"GeneratedSite-value",children:S.jsx("input",{type:"text",value:t.loginPassword,readOnly:!0,className:"GeneratedSite-input"})})]}),S.jsxs("div",{className:"GeneratedSite-field",children:[S.jsx("div",{className:"GeneratedSite-label",children:n("adminUrl")}),S.jsxs("div",{className:"GeneratedSite-value",children:[S.jsx("input",{type:"text",value:t.adminUiUrl,readOnly:!0,className:"GeneratedSite-input"}),S.jsx(Nt,{className:"GeneratedSite-link-button",onClick:()=>{window.open(t.adminUiUrl,"_blank")},"aria-label":n("administration"),children:"↗"})]})]}),S.jsxs("div",{className:"GeneratedSite-field",children:[S.jsx("div",{className:"GeneratedSite-label",children:n("siteUrl")}),S.jsxs("div",{className:"GeneratedSite-value",children:[S.jsx("input",{type:"text",value:t.siteUrl,readOnly:!0,className:"GeneratedSite-input"}),S.jsx(Nt,{className:"GeneratedSite-link-button",onClick:()=>{window.open(t.siteUrl,"_blank")},"aria-label":n("viewSite"),children:"↗"})]})]})]}),S.jsx("div",{className:"GeneratedSite-actions",children:S.jsx(Nt,{onClick:i,className:"GeneratedSite-copy-button",children:n("copyToClipboard")})})]})})}function jD({step:t}){const{t:n}=Ct();return S.jsx(It,{children:S.jsxs("div",{className:"ErrorStep",children:[S.jsx("p",{className:"ErrorStep-message ErrorStep-message-warning",children:n("stepNoEffect")}),t.explanation&&S.jsx(qs,{content:t.explanation,variant:"warning"})]})})}function Mv({step:t}){const{t:n}=Ct();return S.jsx(It,{children:S.jsxs("div",{className:"PendingStep",children:[S.jsx("div",{className:"PendingStep-header",children:S.jsx("h2",{children:n("stepTitle",{stepNumber:t.stepNumber,kind:n(t.kind)})})}),S.jsx("div",{className:"PendingStep-spinner",children:S.jsx(Zo,{size:"large"})}),t.currentActivity&&S.jsxs("div",{className:"PendingStep-activity",children:[S.jsx("h3",{children:n("currentActivity")}),S.jsx("p",{children:n(`activity.${t.currentActivity}`)})]}),t.explanation&&S.jsx(qs,{content:t.explanation,title:n("explanation"),variant:"info"})]})})}function DD({step:t}){if(t.status==="failed")return S.jsx(TD,{step:t});if(t.status==="noEffect")return S.jsx(jD,{step:t});if(t.kind==="initialSchema"||t.kind==="updateSchema")return t.status==="pending"?S.jsx(Mv,{step:t}):S.jsx(CD,{step:t});if(t.kind==="generateSite")return t.status==="pending"&&!_j(t)?S.jsx(Mv,{step:t}):S.jsx(OD,{step:t});throw new Error(`Unknown step kind: ${t.kind}`)}function MD(){const{t}=Ct(),n=aa(),{stepNumber:i}=XE(),{workSession:a,setActiveStepNumber:l}=nr(),u=i===void 0?void 0:Number.parseInt(i,10);if(A.useEffect(()=>(l(u),()=>l(void 0)),[u,l]),tb(async()=>{if(!a||!a.steps)return;a.steps.some(m=>m.stepNumber===u)||await n("/")},[u,a,n]),!a||!a.steps)return S.jsxs("div",{className:"RouteLayout",children:[S.jsx("div",{className:"RouteLayout-main",children:S.jsx(It,{className:"p-4",children:S.jsx("div",{className:"Alert error",children:S.jsx("p",{children:t("noSessionData")})})})}),S.jsx("div",{className:"RouteLayout-sidebar",children:S.jsx(yo,{activeStep:u})})]});const f=a.steps.find(d=>d.stepNumber===u);return f?S.jsxs("div",{className:"RouteLayout",children:[S.jsx("div",{className:"RouteLayout-main",children:S.jsx(DD,{step:f})}),S.jsx("div",{className:"RouteLayout-sidebar",children:S.jsx(yo,{activeStep:u})})]}):S.jsxs("div",{className:"RouteLayout",children:[S.jsx("div",{className:"RouteLayout-main",children:S.jsx(It,{className:"p-4",children:S.jsx("div",{className:"Alert error",children:S.jsx("p",{children:t("stepNotFound")})})})}),S.jsx("div",{className:"RouteLayout-sidebar",children:S.jsx(yo,{activeStep:u})})]})}function LD({sessionToken:t,onSessionExpired:n}){const{workSession:i,isLoading:a,error:l,setWorkSession:u,setIsLoading:f,setError:d,resetSession:m}=nr();return A.useEffect(()=>()=>{Vd()},[]),tb(async()=>{f(!0),d(void 0);try{const p=await Ri({command:"loadWorkSession",sessionToken:t});p.success&&p.result?(u(p.result),bt.changeLanguage(p.result.language)):(d(p.userMessage||"Failed to load session"),p.success||(m(),Dj(),n()))}catch(p){d("Error connecting to server"),console.error(p)}finally{f(!1)}},[t,u,f,d,n]),a?S.jsx("div",{className:"Layout-center p-4",children:S.jsx(It,{className:"p-4 max-w-2xl",children:S.jsx("div",{className:"Text text-center",children:S.jsx("p",{children:"Loading session..."})})})}):l?S.jsx("div",{className:"Layout-center p-4",children:S.jsx(It,{className:"p-4 max-w-2xl",children:S.jsx("div",{className:"Alert error",children:S.jsx("p",{children:l})})})}):i?S.jsx(UA,{children:S.jsxs(hA,{children:[S.jsx(fo,{path:"/",element:S.jsx(Bj,{})}),S.jsx(fo,{path:"/step/:stepNumber",element:S.jsx(MD,{})}),S.jsx(fo,{path:"*",element:S.jsx(fA,{to:"/",replace:!0})})]})}):S.jsx("div",{className:"Layout-center p-4",children:S.jsx(It,{className:"p-4 max-w-2xl",children:S.jsx("div",{className:"Text text-center",children:S.jsx("p",{children:"Session not available."})})})})}function zD({sessionToken:t}){const{t:n,i18n:i}=Ct(),a=async l=>{const u=l.target.value;await i.changeLanguage(u),t&&await Ri({command:"setLanguage",sessionToken:t,language:u})};return S.jsxs("footer",{className:"App-footer",children:[S.jsx("span",{className:"InlineText",dangerouslySetInnerHTML:{__html:n("footerText")}}),S.jsx("span",{className:"LanguageSelector",children:S.jsxs("select",{className:"LanguageSelector-select",value:i.language,onChange:a,"aria-label":"Select language",children:[S.jsx("option",{value:"en",children:"English"}),S.jsx("option",{value:"fr",children:"Français"})]})})]})}function _S({onTokenReceived:t}){const[n,i]=A.useState(!!window.grecaptcha),a=Mf;return A.useEffect(()=>{if(a){if(window.onRecaptchaSubmitted=l=>{t(l)},window.onRecaptchaExpired=()=>{t("")},n===!1&&!window.grecaptcha){i("loading");const l=document.createElement("script");l.src="https://www.google.com/recaptcha/api.js",l.async=!0,l.defer=!0,l.onload=()=>i(!0),document.head.appendChild(l)}else i(!0);return()=>{window.onRecaptchaSubmitted=void 0,window.onRecaptchaExpired=void 0}}},[a,t]),S.jsx(S.Fragment,{children:Mf&&n===!0?S.jsx("div",{className:"g-recaptcha","data-sitekey":Mf,"data-callback":"onRecaptchaSubmitted","data-expired-callback":"onRecaptchaExpired"}):S.jsx("div",{className:"RecaptchaBox",children:S.jsx(Zo,{})})})}function UD({onVerified:t}){const{t:n,i18n:i}=Ct(),[a,l]=A.useState(""),[u,f]=A.useState(),d=async()=>{var m;if(a){f(void 0);try{const p=await Ri({command:"newSession",recaptchaToken:a,language:i.language});p.success&&((m=p.result)!=null&&m.token)?t(p.result.token):f("Failed to create session")}catch(p){f("Error connecting to server"),console.error(p)}}};return S.jsx("div",{className:"Layout-center p-4",children:S.jsxs(It,{className:"max-w-2xl p-4",children:[S.jsx("h2",{className:"AppTitle mb-4 text-center",children:n("title")}),S.jsx("div",{className:"Text my-4",dangerouslySetInnerHTML:{__html:n("introduction")}}),u&&S.jsx("div",{className:"Alert error",children:S.jsx("p",{className:"m-0",children:u})}),S.jsxs("div",{className:"Layout-flex Layout-align-center Layout-gap Layout-justify-center Layout-wrap",children:[S.jsx(_S,{onTokenReceived:l}),S.jsx(Nt,{label:n("agree"),onClick:d,disabled:!a})]})]})})}function BD({expiredToken:t,onTokenRefreshed:n}){const{t:i}=Ct(),[a,l]=A.useState(),u=async f=>{var d;if(f){l(void 0);try{const m=await Ri({command:"renewSession",sessionToken:t,recaptchaToken:f});m.success&&((d=m.result)!=null&&d.token)?n(m.result.token):l(i("sessionRenewalFailed"))}catch(m){l(i("errorConnectingToServer")),console.error(m)}}};return S.jsx("div",{className:"Dialog-backdrop",children:S.jsx("div",{className:"Dialog-container",children:S.jsxs(It,{className:"p-4",children:[S.jsx("h2",{className:"mb-4 text-center",children:i("extendYourSession")}),a&&S.jsx("div",{className:"Alert error",children:S.jsx("p",{className:"m-0",children:a})}),S.jsx("div",{className:"Layout-flex Layout-align-center Layout-gap Layout-justify-center Layout-wrap my-4",children:S.jsx(_S,{onTokenReceived:u})}),S.jsx("p",{className:"InfoText",children:i("newTabRestartMessage")})]})})})}function _D(t){if(!t)return!1;try{const n=t.split(".");if(n.length!==3)return!1;const i=JSON.parse(atob(n[1]));if(!i.exp)return!1;const a=i.exp*1e3;return Date.now()<a?!0:"expired"}catch(n){return console.error("Error checking JWT token validity:",n),!1}}function qD(){const[t,n]=A.useState(),[i,a]=A.useState(),l=nr(d=>d.resetSession);A.useEffect(()=>{const d=Rs(),m=_D(d);if(!d||!m){l();return}m==="expired"?a(d):n(d)},[l]);const u=d=>{Av(d),n(d)},f=d=>{Av(d),n(d),a(void 0)};return S.jsxs("div",{className:"App",children:[S.jsx("div",{className:"App-content",children:t?S.jsx(LD,{sessionToken:t,onSessionExpired:()=>n(void 0)}):i?S.jsx(BD,{expiredToken:i,onTokenRefreshed:f}):S.jsx(UD,{onVerified:u})}),S.jsx(zD,{sessionToken:t})]})}async function KD(){const t=document.getElementById("site-generator-app");t&&xE.createRoot(t).render(S.jsx(Bf.StrictMode,{children:S.jsx(qD,{})}))}KD().catch(t=>console.error(t));