@oneworks/client 0.1.0-alpha.0 → 0.1.0-beta.1
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.
- package/dist/assets/ActionSearchToolbar-BqRwfUQY.js +1 -0
- package/dist/assets/ActionSearchToolbar-CMBns0Zm.css +1 -0
- package/dist/assets/AgentRoomRoute-BYgM7vgg.js +1 -0
- package/dist/assets/AgentRoomSessionRoute-DdoZY7qL.js +3 -0
- package/dist/assets/ArchiveRoute-ydgLUN7p.js +1 -0
- package/dist/assets/{AuthenticatedApp-BTs4l2pB.js → AuthenticatedApp-CK9TT7Nk.js} +236 -224
- package/dist/assets/AuthenticatedApp-scWyvbOf.css +1 -0
- package/dist/assets/AutomationRoute-CpcRbNa8.js +1 -0
- package/dist/assets/BenchmarkRoute-CZRZVolT.js +21 -0
- package/dist/assets/ChatRoute-DdRVEkAb.js +2 -0
- package/dist/assets/Collapse-CxTS9FJh.js +10 -0
- package/dist/assets/{ComposerLanding-Cl6zfbOm.js → ComposerLanding-BChGuCjF.js} +4 -4
- package/dist/assets/ConfigEditors-BuDavOAj.css +1 -0
- package/dist/assets/ConfigRoute-D_EkHryB.js +28 -0
- package/dist/assets/ConfigRoute-TW2qRRNP.css +1 -0
- package/dist/assets/InteractionStructureRoute-Dpjr6hIq.js +1 -0
- package/dist/assets/KnowledgeRoute-Bp4Da65A.js +1 -0
- package/dist/assets/LauncherApp-ByUpDwod.js +2 -0
- package/dist/assets/LauncherRoute-B94P9m3I.js +2 -0
- package/dist/assets/LauncherRoute-NsK8KCzb.css +1 -0
- package/dist/assets/MobileAwareSelect-BySpAJpa.css +1 -0
- package/dist/assets/MobileAwareSelect-CCAQrsxL.js +37 -0
- package/dist/assets/{ModuleManagementRoute-DQACRan1.js → ModuleManagementRoute-DcrMX6P7.js} +3 -3
- package/dist/assets/NotFoundRoute-C1IfsiZY.js +1 -0
- package/dist/assets/PluginStoreRoute-7UBLkrWc.js +1 -0
- package/dist/assets/PluginStoreRoute-Cfalv335.css +1 -0
- package/dist/assets/RouteContainerPanelTabs-D8pC61tF.js +11 -0
- package/dist/assets/RouteContainerPanelTabs-DAjUmk7i.css +1 -0
- package/dist/assets/SchemaObjectEditor-DvwrURac.js +1 -0
- package/dist/assets/StandaloneMobileDebugRoute--yiQ5EdW.js +1 -0
- package/dist/assets/StandaloneMobileDebugRoute-DuOLjUb9.css +1 -0
- package/dist/assets/WorkspaceApp-l-h_IsMp.js +9 -0
- package/dist/assets/agent-room-session-paths-CYMSFD9m.css +32 -0
- package/dist/assets/agent-room-session-paths-DNpYqOr3.js +537 -0
- package/dist/assets/{arc-BXsvCKst.js → arc-Xh4h56Fv.js} +1 -1
- package/dist/assets/azure-C6wcxVWu.ico +0 -0
- package/dist/assets/{blockDiagram-c4efeb88-hc-xNCrG.js → blockDiagram-c4efeb88-CG3HxYeL.js} +2 -2
- package/dist/assets/{c4Diagram-c83219d4-DVHTOuVr.js → c4Diagram-c83219d4-DiEPAqCg.js} +2 -2
- package/dist/assets/channel-DH-F5Uqk.js +1 -0
- package/dist/assets/classDiagram-beda092f-Dwx44PuJ.js +2 -0
- package/dist/assets/classDiagram-v2-2358418a-COXM437u.js +2 -0
- package/dist/assets/client-build-info-6B4KoYHs.js +1 -0
- package/dist/assets/clone-DGri7oGq.js +1 -0
- package/dist/assets/{createText-1719965b-x3Mhf0Jh.js → createText-1719965b-DPLMqVqY.js} +1 -1
- package/dist/assets/cssMode-DfDq4hLs.js +1 -0
- package/dist/assets/customParseFormat-DwjB960X.js +1 -0
- package/dist/assets/dockPanelConstants-4XXOUD0A.css +1 -0
- package/dist/assets/dockPanelConstants-OzU6hJl5.js +8 -0
- package/dist/assets/{edges-96097737-COVuSxRY.js → edges-96097737-ry9ejc8v.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-WcgqCWce.js → erDiagram-0228fc6a-AcCPz3wc.js} +2 -2
- package/dist/assets/{flowDb-c6c81e3f-nYly38YN.js → flowDb-c6c81e3f-BGnBxhJf.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-DLYALlBY.js → flowDiagram-50d868cf-BnS6RFWo.js} +2 -2
- package/dist/assets/flowDiagram-v2-4f6560a1-C3klqpJG.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-Da8rP8k4.js → flowchart-elk-definition-6af322e1-8-ynORZL.js} +2 -2
- package/dist/assets/{freemarker2-OWISI6Bb.js → freemarker2-uFZBYLEW.js} +2 -2
- package/dist/assets/ganttDiagram-a2739b55-3MEPfmMB.js +257 -0
- package/dist/assets/gemini-B9inYaVW.png +0 -0
- package/dist/assets/{gitGraphDiagram-82fe8481-DCk8Jny9.js → gitGraphDiagram-82fe8481-BKYGV9pb.js} +2 -2
- package/dist/assets/{graph-DvFQr_wY.js → graph-BEwlNa_j.js} +1 -1
- package/dist/assets/handlebars-dg6IZCa7.js +1 -0
- package/dist/assets/html-KunL9NkW.js +1 -0
- package/dist/assets/htmlMode-CrFpTEpC.js +1 -0
- package/dist/assets/{index-5325376f-CRF6GGjL.js → index-5325376f-CCcP_Ahl.js} +1 -1
- package/dist/assets/index-BIs5hzci.js +13 -0
- package/dist/assets/index-BggFUwYR.js +1 -0
- package/dist/assets/index-DdUqPqXW.js +727 -0
- package/dist/assets/{index-BnZLa3J3.js → index-DhpAFZQZ.js} +2 -2
- package/dist/assets/index-YzfSzOLk.js +13 -0
- package/dist/assets/index-ZOsqqPVv.js +36 -0
- package/dist/assets/index-jfuA2A4w.css +1 -0
- package/dist/assets/index-nXq6jwfM.js +3 -0
- package/dist/assets/{infoDiagram-8eee0895-dVa2Kh9_.js → infoDiagram-8eee0895-BzZ34kgw.js} +2 -2
- package/dist/assets/interaction-panel-mobile-debug-pages-8AAd4Csf.css +1 -0
- package/dist/assets/interaction-panel-mobile-debug-pages-DXC3HSZU.js +113 -0
- package/dist/assets/javascript-DA3fh3oR.js +1 -0
- package/dist/assets/{journeyDiagram-c64418c1-BJCT1TJ7.js → journeyDiagram-c64418c1-B_kSGErn.js} +2 -2
- package/dist/assets/{jsonMode-RsjNGxUQ.js → jsonMode-BDucSIBv.js} +4 -4
- package/dist/assets/{layout-BMZRkCUf.js → layout-CRLM1T9z.js} +1 -1
- package/dist/assets/{line-C99msl9T.js → line-Cdyr_7ve.js} +1 -1
- package/dist/assets/{linear-CJHB38BG.js → linear-y86GycLK.js} +1 -1
- package/dist/assets/liquid-mJp997il.js +1 -0
- package/dist/assets/{lspLanguageFeatures-D8zjArb3.js → lspLanguageFeatures-DiGGmudW.js} +1 -1
- package/dist/assets/mdx-Co6h2mZ2.js +1 -0
- package/dist/assets/{mermaid.core-DWzpZH_g.js → mermaid.core-VYJIZL_J.js} +4 -4
- package/dist/assets/micu-dUcmmgZZ.png +0 -0
- package/dist/assets/{mindmap-definition-8da855dc-DulNL_Ks.js → mindmap-definition-8da855dc-DKNG2gyr.js} +2 -2
- package/dist/assets/minimax-B5WRVrUt.png +0 -0
- package/dist/assets/openai-ABb0YGGa.svg +71 -0
- package/dist/assets/openrouter-CsJ_bD5Q.ico +0 -0
- package/dist/assets/{pieDiagram-a8764435-CHfubQBm.js → pieDiagram-a8764435-Cu3up9mc.js} +3 -3
- package/dist/assets/project-file-tree-icons-CfonMx-1.js +2 -0
- package/dist/assets/project-file-tree-icons-DXkdVC0r.css +1 -0
- package/dist/assets/python-BUUKzwmG.js +1 -0
- package/dist/assets/{quadrantDiagram-1e28029f-CFHca9nu.js → quadrantDiagram-1e28029f-DHW8R4el.js} +2 -2
- package/dist/assets/qwen-Cla2cGrM.svg +107 -0
- package/dist/assets/razor-ZPlQfY47.js +1 -0
- package/dist/assets/requesty-DAzbbw8F.ico +0 -0
- package/dist/assets/{requirementDiagram-08caed73-ClrFG92W.js → requirementDiagram-08caed73-CXWNC-_B.js} +2 -2
- package/dist/assets/route-plugin-chrome-bV1HEaju.js +1 -0
- package/dist/assets/sankeyDiagram-a04cb91d-DhKL8pMH.js +8 -0
- package/dist/assets/{sequenceDiagram-c5b8d532-ZoeuLa-n.js → sequenceDiagram-c5b8d532-D3fAcQeI.js} +2 -2
- package/dist/assets/shortcutUtils-B8h6g_7o.js +27 -0
- package/dist/assets/stateDiagram-1ecb1508-wKQS4LMF.js +1 -0
- package/dist/assets/stateDiagram-v2-c2b004d7-D5qOKtOa.js +1 -0
- package/dist/assets/{styles-b4e223ce-0VFG2Z9W.js → styles-b4e223ce-CpBwPex_.js} +1 -1
- package/dist/assets/{styles-ca3715f6-DaJIsB-N.js → styles-ca3715f6-4bqpN1KH.js} +1 -1
- package/dist/assets/{styles-d45a18b0-DT8DH24o.js → styles-d45a18b0-B0RCBD5D.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-DxTZXiLW.js → svgDrawCommon-b86b1483-C9KXk4gS.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-lu3ppiNq.js → timeline-definition-faaaa080-B1Bfjd0m.js} +2 -2
- package/dist/assets/{tsMode-B6pOKC1l.js → tsMode-Bd8BwKXc.js} +2 -2
- package/dist/assets/typescript-CLd6MPK0.js +1 -0
- package/dist/assets/use-app-preferences-DGCafwsP.js +1 -0
- package/dist/assets/use-chat-session-actions-wF_HiVzj.js +2 -0
- package/dist/assets/{vendor-react-BNJ5yonH.js → vendor-react-CnooHTJc.js} +1 -1
- package/dist/assets/vendor-state-zjcHRN98.js +1 -0
- package/dist/assets/worker-BZxxbL_z.js +1 -0
- package/dist/assets/workspace-file-openers-Dj_Cfk1S.js +1 -0
- package/dist/assets/workspace-file-openers-fM4AQXug.css +1 -0
- package/dist/assets/xml-BeC1cWk3.js +1 -0
- package/dist/assets/{xychartDiagram-f5964ef8-DvmrNK0s.js → xychartDiagram-f5964ef8-DbJVUSHy.js} +2 -2
- package/dist/assets/yaml-gQrw9AcN.js +1 -0
- package/dist/assets/yunwu-C0h7koCA.png +0 -0
- package/dist/assets/zhipu-CWmkm5qz.png +0 -0
- package/dist/index.html +4 -4
- package/dist/sw.js +5 -3
- package/package.json +20 -15
- package/dist/assets/AgentRoomRoute-rNmmPMvh.js +0 -1
- package/dist/assets/AgentRoomSessionRoute-Dg8yQRY_.js +0 -1
- package/dist/assets/ArchiveRoute-BWE_JVjl.js +0 -1
- package/dist/assets/AuthenticatedApp-Bop-GglJ.css +0 -1
- package/dist/assets/AutomationRoute-CoJ8YGK2.js +0 -1
- package/dist/assets/BenchmarkRoute-BcRZ1AFC.js +0 -21
- package/dist/assets/ChatRoute-DBN4uo7j.js +0 -1
- package/dist/assets/Collapse-DDrFhfKr.js +0 -8
- package/dist/assets/ConfigEditors-jcXiTWRg.css +0 -1
- package/dist/assets/ConfigRoute-D5zxs-kv.css +0 -1
- package/dist/assets/ConfigRoute-z5Dj1ihn.js +0 -2
- package/dist/assets/ConfigSectionPanel-DHIwutHm.js +0 -13
- package/dist/assets/DockPanel-DuxVeJzf.js +0 -11
- package/dist/assets/DockPanel-HEMeJ1MR.css +0 -1
- package/dist/assets/InteractionStructureRoute-B8yJdycA.js +0 -1
- package/dist/assets/KnowledgeRoute-BPYnBocT.js +0 -1
- package/dist/assets/LauncherApp-BqKOigOK.js +0 -2
- package/dist/assets/LauncherRoute-C1g-gjbs.js +0 -2
- package/dist/assets/LauncherRoute-DtjtKtXc.css +0 -1
- package/dist/assets/PluginStoreRoute-Bny2x-oC.css +0 -1
- package/dist/assets/PluginStoreRoute-CGIBez_4.js +0 -3
- package/dist/assets/SchemaObjectEditor-BdzgIkYh.js +0 -1
- package/dist/assets/WorkspaceApp-DGL3CHCp.js +0 -46
- package/dist/assets/agent-room-session-paths-Bl0JdX79.js +0 -153
- package/dist/assets/agent-room-session-paths-CCE5rS0K.css +0 -32
- package/dist/assets/channel-X7k9544o.js +0 -1
- package/dist/assets/classDiagram-beda092f-C--_J0De.js +0 -2
- package/dist/assets/classDiagram-v2-2358418a-VLoB_o-4.js +0 -2
- package/dist/assets/client-build-info-CUyezPn4.js +0 -37
- package/dist/assets/client-build-info-CgBKDSmG.css +0 -1
- package/dist/assets/clone-BsR4Dtrm.js +0 -1
- package/dist/assets/copy-OJ_6Pvs2.js +0 -28
- package/dist/assets/cssMode-Dg95dCSS.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-DZXqc8d3.js +0 -1
- package/dist/assets/ganttDiagram-a2739b55-SFoaaNUl.js +0 -257
- package/dist/assets/handlebars-DvhbIeVz.js +0 -1
- package/dist/assets/html-B6ANaoGC.js +0 -1
- package/dist/assets/htmlMode-CA_KA1J8.js +0 -1
- package/dist/assets/index-BfLbHhFR.js +0 -13
- package/dist/assets/index-C9FQLbWu.js +0 -1
- package/dist/assets/index-DA1kZA8X.css +0 -1
- package/dist/assets/index-Dn-Bbs_z.js +0 -705
- package/dist/assets/javascript-qaeO24NX.js +0 -1
- package/dist/assets/liquid-yYJuHMAu.js +0 -1
- package/dist/assets/mdx-CrAkCLhE.js +0 -1
- package/dist/assets/python-h0Aqhxqi.js +0 -1
- package/dist/assets/razor-DalkOWO-.js +0 -1
- package/dist/assets/sankeyDiagram-a04cb91d-C9DgEVjM.js +0 -8
- package/dist/assets/stateDiagram-1ecb1508-DDRxhJDf.js +0 -1
- package/dist/assets/stateDiagram-v2-c2b004d7-CIob4OCF.js +0 -1
- package/dist/assets/typescript-Bn-lx_lA.js +0 -1
- package/dist/assets/use-app-preferences-B4K999VJ.js +0 -1
- package/dist/assets/use-chat-session-actions-5N-NQ9my.js +0 -2
- package/dist/assets/use-project-theme-preview-sources-5CPt1X2N.js +0 -1
- package/dist/assets/vendor-state-CBVXPiKY.js +0 -1
- package/dist/assets/workspace-file-openers-DAuX65xw.js +0 -1
- package/dist/assets/workspace-file-openers-erSFu-UO.css +0 -1
- package/dist/assets/xml-C1SO5DSd.js +0 -1
- package/dist/assets/yaml-DihjE03_.js +0 -1
|
@@ -56,4 +56,4 @@ Error generating stack: `+o.message+`
|
|
|
56
56
|
* @license MIT
|
|
57
57
|
*/var xa="popstate";function Jp(e={}){function t(r,l){let{pathname:o,search:u,hash:i}=r.location;return au("",{pathname:o,search:u,hash:i},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:ur(l)}return qp(t,n,null,e)}function A(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function we(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Zp(){return Math.random().toString(36).substring(2,10)}function Pa(e,t){return{usr:e.state,key:e.key,idx:t}}function au(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?mn(t):t,state:n,key:t&&t.key||r||Zp()}}function ur({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function mn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function qp(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:o=!1}=r,u=l.history,i="POP",a=null,s=h();s==null&&(s=0,u.replaceState({...u.state,idx:s},""));function h(){return(u.state||{idx:null}).idx}function p(){i="POP";let C=h(),d=C==null?null:C-s;s=C,a&&a({action:i,location:g.location,delta:d})}function m(C,d){i="PUSH";let c=au(g.location,C,d);s=h()+1;let f=Pa(c,s),w=g.createHref(c);try{u.pushState(f,"",w)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;l.location.assign(w)}o&&a&&a({action:i,location:g.location,delta:1})}function y(C,d){i="REPLACE";let c=au(g.location,C,d);s=h();let f=Pa(c,s),w=g.createHref(c);u.replaceState(f,"",w),o&&a&&a({action:i,location:g.location,delta:0})}function S(C){return bp(C)}let g={get action(){return i},get location(){return e(l,u)},listen(C){if(a)throw new Error("A history only accepts one active listener");return l.addEventListener(xa,p),a=C,()=>{l.removeEventListener(xa,p),a=null}},createHref(C){return t(l,C)},createURL:S,encodeLocation(C){let d=S(C);return{pathname:d.pathname,search:d.search,hash:d.hash}},push:m,replace:y,go(C){return u.go(C)}};return g}function bp(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),A(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ur(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Kc(e,t,n="/"){return eh(e,t,n,!1)}function eh(e,t,n,r){let l=typeof t=="string"?mn(t):t,o=be(l.pathname||"/",n);if(o==null)return null;let u=Yc(e);th(u);let i=null;for(let a=0;i==null&&a<u.length;++a){let s=dh(o);i=ch(u[a],s,r)}return i}function Yc(e,t=[],n=[],r="",l=!1){let o=(u,i,a=l,s)=>{let h={relativePath:s===void 0?u.path||"":s,caseSensitive:u.caseSensitive===!0,childrenIndex:i,route:u};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&a)return;A(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=Ge([r,h.relativePath]),m=n.concat(h);u.children&&u.children.length>0&&(A(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Yc(u.children,t,m,p,a)),!(u.path==null&&!u.index)&&t.push({path:p,score:ah(p,u.index),routesMeta:m})};return e.forEach((u,i)=>{var a;if(u.path===""||!((a=u.path)!=null&&a.includes("?")))o(u,i);else for(let s of Gc(u.path))o(u,i,!0,s)}),t}function Gc(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let u=Gc(r.join("/")),i=[];return i.push(...u.map(a=>a===""?o:[o,a].join("/"))),l&&i.push(...u),i.map(a=>e.startsWith("/")&&a===""?"/":a)}function th(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var nh=/^:[\w-]+$/,rh=3,lh=2,oh=1,uh=10,ih=-2,Ra=e=>e==="*";function ah(e,t){let n=e.split("/"),r=n.length;return n.some(Ra)&&(r+=ih),t&&(r+=lh),n.filter(l=>!Ra(l)).reduce((l,o)=>l+(nh.test(o)?rh:o===""?oh:uh),r)}function sh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function ch(e,t,n=!1){let{routesMeta:r}=e,l={},o="/",u=[];for(let i=0;i<r.length;++i){let a=r[i],s=i===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",p=yl({path:a.relativePath,caseSensitive:a.caseSensitive,end:s},h),m=a.route;if(!p&&s&&n&&!r[r.length-1].route.index&&(p=yl({path:a.relativePath,caseSensitive:a.caseSensitive,end:!1},h)),!p)return null;Object.assign(l,p.params),u.push({params:l,pathname:Ge([o,p.pathname]),pathnameBase:vh(Ge([o,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(o=Ge([o,p.pathnameBase]))}return u}function yl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fh(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),i=l.slice(1);return{params:r.reduce((s,{paramName:h,isOptional:p},m)=>{if(h==="*"){let S=i[m]||"";u=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const y=i[m];return p&&!y?s[h]=void 0:s[h]=(y||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:u,pattern:e}}function fh(e,t=!1,n=!0){we(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,i,a)=>(r.push({paramName:i,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function dh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return we(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function be(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Xc=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ph=e=>Xc.test(e);function hh(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?mn(e):e,o;if(n)if(ph(n))o=n;else{if(n.includes("//")){let u=n;n=n.replace(/\/\/+/g,"/"),we(!1,`Pathnames cannot have embedded double slashes - normalizing ${u} -> ${n}`)}n.startsWith("/")?o=_a(n.substring(1),"/"):o=_a(n,t)}else o=t;return{pathname:o,search:yh(r),hash:gh(l)}}function _a(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function po(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function mh(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ui(e){let t=mh(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function ii(e,t,n,r=!1){let l;typeof e=="string"?l=mn(e):(l={...e},A(!l.pathname||!l.pathname.includes("?"),po("?","pathname","search",l)),A(!l.pathname||!l.pathname.includes("#"),po("#","pathname","hash",l)),A(!l.search||!l.search.includes("#"),po("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,i;if(u==null)i=n;else{let p=t.length-1;if(!r&&u.startsWith("..")){let m=u.split("/");for(;m[0]==="..";)m.shift(),p-=1;l.pathname=m.join("/")}i=p>=0?t[p]:"/"}let a=hh(l,i),s=u&&u!=="/"&&u.endsWith("/"),h=(o||u===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(s||h)&&(a.pathname+="/"),a}var Ge=e=>e.join("/").replace(/\/\/+/g,"/"),vh=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yh=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gh=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,wh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Sh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function kh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Jc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zc(e,t){let n=e;if(typeof n!="string"||!Xc.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(Jc)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),i=be(u.pathname,t);u.origin===o.origin&&i!=null?n=i+u.search+u.hash:l=!0}catch{we(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qc=["POST","PUT","PATCH","DELETE"];new Set(qc);var Eh=["GET",...qc];new Set(Eh);var vn=v.createContext(null);vn.displayName="DataRouter";var Ml=v.createContext(null);Ml.displayName="DataRouterState";var Ch=v.createContext(!1),bc=v.createContext({isTransitioning:!1});bc.displayName="ViewTransition";var xh=v.createContext(new Map);xh.displayName="Fetchers";var Ph=v.createContext(null);Ph.displayName="Await";var Ee=v.createContext(null);Ee.displayName="Navigation";var yn=v.createContext(null);yn.displayName="Location";var $e=v.createContext({outlet:null,matches:[],isDataRoute:!1});$e.displayName="Route";var ai=v.createContext(null);ai.displayName="RouteError";var ef="REACT_ROUTER_ERROR",Rh="REDIRECT",_h="ROUTE_ERROR_RESPONSE";function Lh(e){if(e.startsWith(`${ef}:${Rh}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Nh(e){if(e.startsWith(`${ef}:${_h}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new wh(t.status,t.statusText,t.data)}catch{}}function Th(e,{relative:t}={}){A(gn(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ee),{hash:l,pathname:o,search:u}=dr(e,{relative:t}),i=o;return n!=="/"&&(i=o==="/"?n:Ge([n,o])),r.createHref({pathname:i,search:u,hash:l})}function gn(){return v.useContext(yn)!=null}function tt(){return A(gn(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(yn).location}function Om(){return v.useContext(yn).navigationType}var tf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nf(e){v.useContext(Ee).static||v.useLayoutEffect(e)}function si(){let{isDataRoute:e}=v.useContext($e);return e?Hh():zh()}function zh(){A(gn(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(vn),{basename:t,navigator:n}=v.useContext(Ee),{matches:r}=v.useContext($e),{pathname:l}=tt(),o=JSON.stringify(ui(r)),u=v.useRef(!1);return nf(()=>{u.current=!0}),v.useCallback((a,s={})=>{if(we(u.current,tf),!u.current)return;if(typeof a=="number"){n.go(a);return}let h=ii(a,JSON.parse(o),l,s.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ge([t,h.pathname])),(s.replace?n.replace:n.push)(h,s.state,s)},[t,n,o,l,e])}v.createContext(null);function Dm(){let{matches:e}=v.useContext($e),t=e[e.length-1];return t?t.params:{}}function dr(e,{relative:t}={}){let{matches:n}=v.useContext($e),{pathname:r}=tt(),l=JSON.stringify(ui(n));return v.useMemo(()=>ii(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Oh(e,t){return rf(e,t)}function rf(e,t,n,r,l){var c;A(gn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Ee),{matches:u}=v.useContext($e),i=u[u.length-1],a=i?i.params:{},s=i?i.pathname:"/",h=i?i.pathnameBase:"/",p=i&&i.route;{let f=p&&p.path||"";of(s,!p||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${f}">) 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.
|
|
58
58
|
|
|
59
|
-
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let m=tt(),y;if(t){let f=typeof t=="string"?mn(t):t;A(h==="/"||((c=f.pathname)==null?void 0:c.startsWith(h)),`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 "${h}" but pathname "${f.pathname}" was given in the \`location\` prop.`),y=f}else y=m;let S=y.pathname||"/",g=S;if(h!=="/"){let f=h.replace(/^\//,"").split("/");g="/"+S.replace(/^\//,"").split("/").slice(f.length).join("/")}let C=Kc(e,{pathname:g});we(p||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),we(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 d=$h(C&&C.map(f=>Object.assign({},f,{params:Object.assign({},a,f.params),pathname:Ge([h,o.encodeLocation?o.encodeLocation(f.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?h:Ge([h,o.encodeLocation?o.encodeLocation(f.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),u,n,r,l);return t&&d?v.createElement(yn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},d):d}function Dh(){let e=Wh(),t=Sh(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,u)}var Mh=v.createElement(Dh,null),lf=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Nh(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement($e.Provider,{value:this.props.routeContext},v.createElement(ai.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Fh,{error:e},t):t}};lf.contextType=Ch;var ho=new WeakMap;function Fh({children:e,error:t}){let{basename:n}=v.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Lh(t.digest);if(r){let l=ho.get(t);if(l)throw l;let o=Zc(r.location,n);if(Jc&&!ho.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw ho.set(t,u),u}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Ih({routeContext:e,match:t,children:n}){let r=v.useContext(vn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement($e.Provider,{value:e},n)}function $h(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,u=n==null?void 0:n.errors;if(u!=null){let h=o.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);A(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let i=!1,a=-1;if(n)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(a=h),p.route.id){let{loaderData:m,errors:y}=n,S=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||S){i=!0,a>=0?o=o.slice(0,a+1):o=[o[0]];break}}}let s=n&&r?(h,p)=>{var m,y;r(h,{location:n.location,params:((y=(m=n.matches)==null?void 0:m[0])==null?void 0:y.params)??{},unstable_pattern:kh(n.matches),errorInfo:p})}:void 0;return o.reduceRight((h,p,m)=>{let y,S=!1,g=null,C=null;n&&(y=u&&p.route.id?u[p.route.id]:void 0,g=p.route.errorElement||Mh,i&&(a<0&&m===0?(of("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):a===m&&(S=!0,C=p.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,m+1)),c=()=>{let f;return y?f=g:S?f=C:p.route.Component?f=v.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=h,v.createElement(Ih,{match:p,routeContext:{outlet:h,matches:d,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?v.createElement(lf,{location:n.location,revalidation:n.revalidation,component:g,error:y,children:c(),routeContext:{outlet:null,matches:d,isDataRoute:!0},onError:s}):c()},null)}function ci(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jh(e){let t=v.useContext(vn);return A(t,ci(e)),t}function Uh(e){let t=v.useContext(Ml);return A(t,ci(e)),t}function Ah(e){let t=v.useContext($e);return A(t,ci(e)),t}function fi(e){let t=Ah(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Bh(){return fi("useRouteId")}function Wh(){var r;let e=v.useContext(ai),t=Uh("useRouteError"),n=fi("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Hh(){let{router:e}=jh("useNavigate"),t=fi("useNavigate"),n=v.useRef(!1);return nf(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{we(n.current,tf),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var La={};function of(e,t,n){!t&&!La[e]&&(La[e]=!0,we(!1,n))}v.memo(Vh);function Vh({routes:e,future:t,state:n,onError:r}){return rf(e,void 0,n,r,t)}function Mm({to:e,replace:t,state:n,relative:r}){A(gn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=v.useContext(Ee);we(!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:o}=v.useContext($e),{pathname:u}=tt(),i=si(),a=ii(e,ui(o),u,r==="path"),s=JSON.stringify(a);return v.useEffect(()=>{i(JSON.parse(s),{replace:t,state:n,relative:r})},[i,s,r,t,n]),null}function Qh(e){A(!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 Kh({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){A(!gn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=v.useMemo(()=>({basename:i,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[i,l,o,u]);typeof n=="string"&&(n=mn(n));let{pathname:s="/",search:h="",hash:p="",state:m=null,key:y="default"}=n,S=v.useMemo(()=>{let g=be(s,i);return g==null?null:{location:{pathname:g,search:h,hash:p,state:m,key:y},navigationType:r}},[i,s,h,p,m,y,r]);return we(S!=null,`<Router basename="${i}"> is not able to match the URL "${s}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(Ee.Provider,{value:a},v.createElement(yn.Provider,{children:t,value:S}))}function Fm({children:e,location:t}){return Oh(su(e),t)}function su(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,su(r.props.children,o));return}A(r.type===Qh,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=su(r.props.children,o)),n.push(u)}),n}var Qr="get",Kr="application/x-www-form-urlencoded";function Fl(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Yh(e){return Fl(e)&&e.tagName.toLowerCase()==="button"}function Gh(e){return Fl(e)&&e.tagName.toLowerCase()==="form"}function Xh(e){return Fl(e)&&e.tagName.toLowerCase()==="input"}function Jh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zh(e,t){return e.button===0&&(!t||t==="_self")&&!Jh(e)}function cu(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function qh(e,t){let n=cu(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Or=null;function bh(){if(Or===null)try{new FormData(document.createElement("form"),0),Or=!1}catch{Or=!0}return Or}var em=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mo(e){return e!=null&&!em.has(e)?(we(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kr}"`),null):e}function tm(e,t){let n,r,l,o,u;if(Gh(e)){let i=e.getAttribute("action");r=i?be(i,t):null,n=e.getAttribute("method")||Qr,l=mo(e.getAttribute("enctype"))||Kr,o=new FormData(e)}else if(Yh(e)||Xh(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||i.getAttribute("action");if(r=a?be(a,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Qr,l=mo(e.getAttribute("formenctype"))||mo(i.getAttribute("enctype"))||Kr,o=new FormData(i,e),!bh()){let{name:s,type:h,value:p}=e;if(h==="image"){let m=s?`${s}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else s&&o.append(s,p)}}else{if(Fl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qr,r=null,l=Kr,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:r,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function di(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nm(e,t,n,r){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${r}`:l.pathname=`${l.pathname}.${r}`:l.pathname==="/"?l.pathname=`_root.${r}`:t&&be(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${r}`,l}async function rm(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lm(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function om(e,t,n){let r=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await rm(o,n);return u.links?u.links():[]}return[]}));return sm(r.flat(1).filter(lm).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Na(e,t,n,r,l,o){let u=(a,s)=>n[s]?a.route.id!==n[s].route.id:!0,i=(a,s)=>{var h;return n[s].pathname!==a.pathname||((h=n[s].route.path)==null?void 0:h.endsWith("*"))&&n[s].params["*"]!==a.params["*"]};return o==="assets"?t.filter((a,s)=>u(a,s)||i(a,s)):o==="data"?t.filter((a,s)=>{var p;let h=r.routes[a.route.id];if(!h||!h.hasLoader)return!1;if(u(a,s)||i(a,s))return!0;if(a.route.shouldRevalidate){let m=a.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function um(e,t,{includeHydrateFallback:n}={}){return im(e.map(r=>{let l=t.routes[r.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function im(e){return[...new Set(e)]}function am(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function sm(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let o=JSON.stringify(am(l));return n.has(o)||(n.add(o),r.push({key:o,link:l})),r},[])}function uf(){let e=v.useContext(vn);return di(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cm(){let e=v.useContext(Ml);return di(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pi=v.createContext(void 0);pi.displayName="FrameworkContext";function af(){let e=v.useContext(pi);return di(e,"You must render this element inside a <HydratedRouter> element"),e}function fm(e,t){let n=v.useContext(pi),[r,l]=v.useState(!1),[o,u]=v.useState(!1),{onFocus:i,onBlur:a,onMouseEnter:s,onMouseLeave:h,onTouchStart:p}=t,m=v.useRef(null);v.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let g=d=>{d.forEach(c=>{u(c.isIntersecting)})},C=new IntersectionObserver(g,{threshold:.5});return m.current&&C.observe(m.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let g=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(g)}}},[r]);let y=()=>{l(!0)},S=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Nn(i,y),onBlur:Nn(a,S),onMouseEnter:Nn(s,y),onMouseLeave:Nn(h,S),onTouchStart:Nn(p,y)}]:[!1,m,{}]}function Nn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dm({page:e,...t}){let{router:n}=uf(),r=v.useMemo(()=>Kc(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(hm,{page:e,matches:r,...t}):null}function pm(e){let{manifest:t,routeModules:n}=af(),[r,l]=v.useState([]);return v.useEffect(()=>{let o=!1;return om(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),r}function hm({page:e,matches:t,...n}){let r=tt(),{future:l,manifest:o,routeModules:u}=af(),{basename:i}=uf(),{loaderData:a,matches:s}=cm(),h=v.useMemo(()=>Na(e,t,s,o,r,"data"),[e,t,s,o,r]),p=v.useMemo(()=>Na(e,t,s,o,r,"assets"),[e,t,s,o,r]),m=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,C=!1;if(t.forEach(c=>{var w;let f=o.routes[c.route.id];!f||!f.hasLoader||(!h.some(E=>E.route.id===c.route.id)&&c.route.id in a&&((w=u[c.route.id])!=null&&w.shouldRevalidate)||f.hasClientLoader?C=!0:g.add(c.route.id))}),g.size===0)return[];let d=nm(e,i,l.unstable_trailingSlashAwareDataRequests,"data");return C&&g.size>0&&d.searchParams.set("_routes",t.filter(c=>g.has(c.route.id)).map(c=>c.route.id).join(",")),[d.pathname+d.search]},[i,l.unstable_trailingSlashAwareDataRequests,a,r,o,h,t,e,u]),y=v.useMemo(()=>um(p,o),[p,o]),S=pm(p);return v.createElement(v.Fragment,null,m.map(g=>v.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),y.map(g=>v.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),S.map(({key:g,link:C})=>v.createElement("link",{key:g,nonce:n.nonce,...C})))}function mm(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vm&&(window.__reactRouterVersion="7.12.0")}catch{}function Im({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=v.useRef();l.current==null&&(l.current=Jp({window:r,v5Compat:!0}));let o=l.current,[u,i]=v.useState({action:o.action,location:o.location}),a=v.useCallback(s=>{n===!1?i(s):v.startTransition(()=>i(s))},[n]);return v.useLayoutEffect(()=>o.listen(a),[o,a]),v.createElement(Kh,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var sf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cf=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:o,replace:u,state:i,target:a,to:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},S){let{basename:g,unstable_useTransitions:C}=v.useContext(Ee),d=typeof s=="string"&&sf.test(s),c=Zc(s,g);s=c.to;let f=Th(s,{relative:l}),[w,E,x]=fm(r,y),R=Sm(s,{replace:u,state:i,target:a,preventScrollReset:h,relative:l,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:C});function L(N){t&&t(N),N.defaultPrevented||R(N)}let F=v.createElement("a",{...y,...x,href:c.absoluteURL||f,onClick:c.isExternal||o?t:L,ref:mm(S,E),target:a,"data-discover":!d&&n==="render"?"true":void 0});return w&&!d?v.createElement(v.Fragment,null,F,v.createElement(dm,{page:f})):F});cf.displayName="Link";var ym=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:o,to:u,viewTransition:i,children:a,...s},h){let p=dr(u,{relative:s.relative}),m=tt(),y=v.useContext(Ml),{navigator:S,basename:g}=v.useContext(Ee),C=y!=null&&Pm(p)&&i===!0,d=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,c=m.pathname,f=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(c=c.toLowerCase(),f=f?f.toLowerCase():null,d=d.toLowerCase()),f&&g&&(f=be(f,g)||f);const w=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let E=c===d||!l&&c.startsWith(d)&&c.charAt(w)==="/",x=f!=null&&(f===d||!l&&f.startsWith(d)&&f.charAt(d.length)==="/"),R={isActive:E,isPending:x,isTransitioning:C},L=E?t:void 0,F;typeof r=="function"?F=r(R):F=[r,E?"active":null,x?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let N=typeof o=="function"?o(R):o;return v.createElement(cf,{...s,"aria-current":L,className:F,ref:h,style:N,to:u,viewTransition:i},typeof a=="function"?a(R):a)});ym.displayName="NavLink";var gm=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:o,method:u=Qr,action:i,onSubmit:a,relative:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},S)=>{let{unstable_useTransitions:g}=v.useContext(Ee),C=Cm(),d=xm(i,{relative:s}),c=u.toLowerCase()==="get"?"get":"post",f=typeof i=="string"&&sf.test(i),w=E=>{if(a&&a(E),E.defaultPrevented)return;E.preventDefault();let x=E.nativeEvent.submitter,R=(x==null?void 0:x.getAttribute("formmethod"))||u,L=()=>C(x||E.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:l,state:o,relative:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m});g&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:S,method:c,action:d,onSubmit:r?a:w,...y,"data-discover":!f&&e==="render"?"true":void 0})});gm.displayName="Form";function wm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ff(e){let t=v.useContext(vn);return A(t,wm(e)),t}function Sm(e,{target:t,replace:n,state:r,preventScrollReset:l,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:i,unstable_useTransitions:a}={}){let s=si(),h=tt(),p=dr(e,{relative:o});return v.useCallback(m=>{if(Zh(m,t)){m.preventDefault();let y=n!==void 0?n:ur(h)===ur(p),S=()=>s(e,{replace:y,state:r,preventScrollReset:l,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:i});a?v.startTransition(()=>S()):S()}},[h,s,p,n,r,t,e,l,o,u,i,a])}function $m(e){we(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(cu(e)),n=v.useRef(!1),r=tt(),l=v.useMemo(()=>qh(r.search,n.current?null:t.current),[r.search]),o=si(),u=v.useCallback((i,a)=>{const s=cu(typeof i=="function"?i(new URLSearchParams(l)):i);n.current=!0,o("?"+s,a)},[o,l]);return[l,u]}var km=0,Em=()=>`__${String(++km)}__`;function Cm(){let{router:e}=ff("useSubmit"),{basename:t}=v.useContext(Ee),n=Bh(),r=e.fetch,l=e.navigate;return v.useCallback(async(o,u={})=>{let{action:i,method:a,encType:s,formData:h,body:p}=tm(o,t);if(u.navigate===!1){let m=u.fetcherKey||Em();await r(m,n,u.action||i,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:h,body:p,formMethod:u.method||a,formEncType:u.encType||s,flushSync:u.flushSync})}else await l(u.action||i,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:h,body:p,formMethod:u.method||a,formEncType:u.encType||s,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,l,t,n])}function xm(e,{relative:t}={}){let{basename:n}=v.useContext(Ee),r=v.useContext($e);A(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),o={...dr(e||".",{relative:t})},u=tt();if(e==null){o.search=u.search;let i=new URLSearchParams(o.search),a=i.getAll("index");if(a.some(h=>h==="")){i.delete("index"),a.filter(p=>p).forEach(p=>i.append("index",p));let h=i.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ge([n,o.pathname])),ur(o)}function Pm(e,{relative:t}={}){let n=v.useContext(bc);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ff("useViewTransitionState"),l=dr(e,{relative:t});if(!n.isTransitioning)return!1;let o=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yl(l.pathname,u)!=null||yl(l.pathname,o)!=null}export{Im as B,Mm as N,Lf as R,Up as a,Lm as b,oi as c,Tm as d,_m as e,Ap as f,za as g,Rm as h,si as i,Nm as j,$m as k,Om as l,yl as m,Dm as n,Fm as o,Qh as p,v as r,zm as s,tt as u};
|
|
59
|
+
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let m=tt(),y;if(t){let f=typeof t=="string"?mn(t):t;A(h==="/"||((c=f.pathname)==null?void 0:c.startsWith(h)),`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 "${h}" but pathname "${f.pathname}" was given in the \`location\` prop.`),y=f}else y=m;let S=y.pathname||"/",g=S;if(h!=="/"){let f=h.replace(/^\//,"").split("/");g="/"+S.replace(/^\//,"").split("/").slice(f.length).join("/")}let C=Kc(e,{pathname:g});we(p||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),we(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 d=$h(C&&C.map(f=>Object.assign({},f,{params:Object.assign({},a,f.params),pathname:Ge([h,o.encodeLocation?o.encodeLocation(f.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?h:Ge([h,o.encodeLocation?o.encodeLocation(f.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),u,n,r,l);return t&&d?v.createElement(yn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},d):d}function Dh(){let e=Wh(),t=Sh(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:l},n):null,u)}var Mh=v.createElement(Dh,null),lf=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Nh(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement($e.Provider,{value:this.props.routeContext},v.createElement(ai.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(Fh,{error:e},t):t}};lf.contextType=Ch;var ho=new WeakMap;function Fh({children:e,error:t}){let{basename:n}=v.useContext(Ee);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Lh(t.digest);if(r){let l=ho.get(t);if(l)throw l;let o=Zc(r.location,n);if(Jc&&!ho.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw ho.set(t,u),u}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function Ih({routeContext:e,match:t,children:n}){let r=v.useContext(vn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement($e.Provider,{value:e},n)}function $h(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,u=n==null?void 0:n.errors;if(u!=null){let h=o.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);A(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let i=!1,a=-1;if(n)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(a=h),p.route.id){let{loaderData:m,errors:y}=n,S=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||S){i=!0,a>=0?o=o.slice(0,a+1):o=[o[0]];break}}}let s=n&&r?(h,p)=>{var m,y;r(h,{location:n.location,params:((y=(m=n.matches)==null?void 0:m[0])==null?void 0:y.params)??{},unstable_pattern:kh(n.matches),errorInfo:p})}:void 0;return o.reduceRight((h,p,m)=>{let y,S=!1,g=null,C=null;n&&(y=u&&p.route.id?u[p.route.id]:void 0,g=p.route.errorElement||Mh,i&&(a<0&&m===0?(of("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):a===m&&(S=!0,C=p.route.hydrateFallbackElement||null)));let d=t.concat(o.slice(0,m+1)),c=()=>{let f;return y?f=g:S?f=C:p.route.Component?f=v.createElement(p.route.Component,null):p.route.element?f=p.route.element:f=h,v.createElement(Ih,{match:p,routeContext:{outlet:h,matches:d,isDataRoute:n!=null},children:f})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?v.createElement(lf,{location:n.location,revalidation:n.revalidation,component:g,error:y,children:c(),routeContext:{outlet:null,matches:d,isDataRoute:!0},onError:s}):c()},null)}function ci(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jh(e){let t=v.useContext(vn);return A(t,ci(e)),t}function Uh(e){let t=v.useContext(Ml);return A(t,ci(e)),t}function Ah(e){let t=v.useContext($e);return A(t,ci(e)),t}function fi(e){let t=Ah(e),n=t.matches[t.matches.length-1];return A(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Bh(){return fi("useRouteId")}function Wh(){var r;let e=v.useContext(ai),t=Uh("useRouteError"),n=fi("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Hh(){let{router:e}=jh("useNavigate"),t=fi("useNavigate"),n=v.useRef(!1);return nf(()=>{n.current=!0}),v.useCallback(async(l,o={})=>{we(n.current,tf),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var La={};function of(e,t,n){!t&&!La[e]&&(La[e]=!0,we(!1,n))}v.memo(Vh);function Vh({routes:e,future:t,state:n,onError:r}){return rf(e,void 0,n,r,t)}function Mm({to:e,replace:t,state:n,relative:r}){A(gn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=v.useContext(Ee);we(!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:o}=v.useContext($e),{pathname:u}=tt(),i=si(),a=ii(e,ui(o),u,r==="path"),s=JSON.stringify(a);return v.useEffect(()=>{i(JSON.parse(s),{replace:t,state:n,relative:r})},[i,s,r,t,n]),null}function Qh(e){A(!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 Kh({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){A(!gn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=v.useMemo(()=>({basename:i,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[i,l,o,u]);typeof n=="string"&&(n=mn(n));let{pathname:s="/",search:h="",hash:p="",state:m=null,key:y="default"}=n,S=v.useMemo(()=>{let g=be(s,i);return g==null?null:{location:{pathname:g,search:h,hash:p,state:m,key:y},navigationType:r}},[i,s,h,p,m,y,r]);return we(S!=null,`<Router basename="${i}"> is not able to match the URL "${s}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:v.createElement(Ee.Provider,{value:a},v.createElement(yn.Provider,{children:t,value:S}))}function Fm({children:e,location:t}){return Oh(su(e),t)}function su(e,t=[]){let n=[];return v.Children.forEach(e,(r,l)=>{if(!v.isValidElement(r))return;let o=[...t,l];if(r.type===v.Fragment){n.push.apply(n,su(r.props.children,o));return}A(r.type===Qh,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),A(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=su(r.props.children,o)),n.push(u)}),n}var Qr="get",Kr="application/x-www-form-urlencoded";function Fl(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Yh(e){return Fl(e)&&e.tagName.toLowerCase()==="button"}function Gh(e){return Fl(e)&&e.tagName.toLowerCase()==="form"}function Xh(e){return Fl(e)&&e.tagName.toLowerCase()==="input"}function Jh(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zh(e,t){return e.button===0&&(!t||t==="_self")&&!Jh(e)}function cu(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function qh(e,t){let n=cu(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Or=null;function bh(){if(Or===null)try{new FormData(document.createElement("form"),0),Or=!1}catch{Or=!0}return Or}var em=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mo(e){return e!=null&&!em.has(e)?(we(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kr}"`),null):e}function tm(e,t){let n,r,l,o,u;if(Gh(e)){let i=e.getAttribute("action");r=i?be(i,t):null,n=e.getAttribute("method")||Qr,l=mo(e.getAttribute("enctype"))||Kr,o=new FormData(e)}else if(Yh(e)||Xh(e)&&(e.type==="submit"||e.type==="image")){let i=e.form;if(i==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||i.getAttribute("action");if(r=a?be(a,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Qr,l=mo(e.getAttribute("formenctype"))||mo(i.getAttribute("enctype"))||Kr,o=new FormData(i,e),!bh()){let{name:s,type:h,value:p}=e;if(h==="image"){let m=s?`${s}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else s&&o.append(s,p)}}else{if(Fl(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qr,r=null,l=Kr,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:r,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function di(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nm(e,t,n,r){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${r}`:l.pathname=`${l.pathname}.${r}`:l.pathname==="/"?l.pathname=`_root.${r}`:t&&be(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${r}`,l}async function rm(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lm(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function om(e,t,n){let r=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await rm(o,n);return u.links?u.links():[]}return[]}));return sm(r.flat(1).filter(lm).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Na(e,t,n,r,l,o){let u=(a,s)=>n[s]?a.route.id!==n[s].route.id:!0,i=(a,s)=>{var h;return n[s].pathname!==a.pathname||((h=n[s].route.path)==null?void 0:h.endsWith("*"))&&n[s].params["*"]!==a.params["*"]};return o==="assets"?t.filter((a,s)=>u(a,s)||i(a,s)):o==="data"?t.filter((a,s)=>{var p;let h=r.routes[a.route.id];if(!h||!h.hasLoader)return!1;if(u(a,s)||i(a,s))return!0;if(a.route.shouldRevalidate){let m=a.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:a.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function um(e,t,{includeHydrateFallback:n}={}){return im(e.map(r=>{let l=t.routes[r.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function im(e){return[...new Set(e)]}function am(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function sm(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let o=JSON.stringify(am(l));return n.has(o)||(n.add(o),r.push({key:o,link:l})),r},[])}function uf(){let e=v.useContext(vn);return di(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cm(){let e=v.useContext(Ml);return di(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var pi=v.createContext(void 0);pi.displayName="FrameworkContext";function af(){let e=v.useContext(pi);return di(e,"You must render this element inside a <HydratedRouter> element"),e}function fm(e,t){let n=v.useContext(pi),[r,l]=v.useState(!1),[o,u]=v.useState(!1),{onFocus:i,onBlur:a,onMouseEnter:s,onMouseLeave:h,onTouchStart:p}=t,m=v.useRef(null);v.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let g=d=>{d.forEach(c=>{u(c.isIntersecting)})},C=new IntersectionObserver(g,{threshold:.5});return m.current&&C.observe(m.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let g=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(g)}}},[r]);let y=()=>{l(!0)},S=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,m,{}]:[o,m,{onFocus:Nn(i,y),onBlur:Nn(a,S),onMouseEnter:Nn(s,y),onMouseLeave:Nn(h,S),onTouchStart:Nn(p,y)}]:[!1,m,{}]}function Nn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dm({page:e,...t}){let{router:n}=uf(),r=v.useMemo(()=>Kc(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(hm,{page:e,matches:r,...t}):null}function pm(e){let{manifest:t,routeModules:n}=af(),[r,l]=v.useState([]);return v.useEffect(()=>{let o=!1;return om(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),r}function hm({page:e,matches:t,...n}){let r=tt(),{future:l,manifest:o,routeModules:u}=af(),{basename:i}=uf(),{loaderData:a,matches:s}=cm(),h=v.useMemo(()=>Na(e,t,s,o,r,"data"),[e,t,s,o,r]),p=v.useMemo(()=>Na(e,t,s,o,r,"assets"),[e,t,s,o,r]),m=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let g=new Set,C=!1;if(t.forEach(c=>{var w;let f=o.routes[c.route.id];!f||!f.hasLoader||(!h.some(E=>E.route.id===c.route.id)&&c.route.id in a&&((w=u[c.route.id])!=null&&w.shouldRevalidate)||f.hasClientLoader?C=!0:g.add(c.route.id))}),g.size===0)return[];let d=nm(e,i,l.unstable_trailingSlashAwareDataRequests,"data");return C&&g.size>0&&d.searchParams.set("_routes",t.filter(c=>g.has(c.route.id)).map(c=>c.route.id).join(",")),[d.pathname+d.search]},[i,l.unstable_trailingSlashAwareDataRequests,a,r,o,h,t,e,u]),y=v.useMemo(()=>um(p,o),[p,o]),S=pm(p);return v.createElement(v.Fragment,null,m.map(g=>v.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...n})),y.map(g=>v.createElement("link",{key:g,rel:"modulepreload",href:g,...n})),S.map(({key:g,link:C})=>v.createElement("link",{key:g,nonce:n.nonce,...C})))}function mm(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vm&&(window.__reactRouterVersion="7.12.0")}catch{}function Im({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=v.useRef();l.current==null&&(l.current=Jp({window:r,v5Compat:!0}));let o=l.current,[u,i]=v.useState({action:o.action,location:o.location}),a=v.useCallback(s=>{n===!1?i(s):v.startTransition(()=>i(s))},[n]);return v.useLayoutEffect(()=>o.listen(a),[o,a]),v.createElement(Kh,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var sf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cf=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:o,replace:u,state:i,target:a,to:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},S){let{basename:g,unstable_useTransitions:C}=v.useContext(Ee),d=typeof s=="string"&&sf.test(s),c=Zc(s,g);s=c.to;let f=Th(s,{relative:l}),[w,E,x]=fm(r,y),R=Sm(s,{replace:u,state:i,target:a,preventScrollReset:h,relative:l,viewTransition:p,unstable_defaultShouldRevalidate:m,unstable_useTransitions:C});function L(N){t&&t(N),N.defaultPrevented||R(N)}let F=v.createElement("a",{...y,...x,href:c.absoluteURL||f,onClick:c.isExternal||o?t:L,ref:mm(S,E),target:a,"data-discover":!d&&n==="render"?"true":void 0});return w&&!d?v.createElement(v.Fragment,null,F,v.createElement(dm,{page:f})):F});cf.displayName="Link";var ym=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:o,to:u,viewTransition:i,children:a,...s},h){let p=dr(u,{relative:s.relative}),m=tt(),y=v.useContext(Ml),{navigator:S,basename:g}=v.useContext(Ee),C=y!=null&&Pm(p)&&i===!0,d=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,c=m.pathname,f=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(c=c.toLowerCase(),f=f?f.toLowerCase():null,d=d.toLowerCase()),f&&g&&(f=be(f,g)||f);const w=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let E=c===d||!l&&c.startsWith(d)&&c.charAt(w)==="/",x=f!=null&&(f===d||!l&&f.startsWith(d)&&f.charAt(d.length)==="/"),R={isActive:E,isPending:x,isTransitioning:C},L=E?t:void 0,F;typeof r=="function"?F=r(R):F=[r,E?"active":null,x?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let N=typeof o=="function"?o(R):o;return v.createElement(cf,{...s,"aria-current":L,className:F,ref:h,style:N,to:u,viewTransition:i},typeof a=="function"?a(R):a)});ym.displayName="NavLink";var gm=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:o,method:u=Qr,action:i,onSubmit:a,relative:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},S)=>{let{unstable_useTransitions:g}=v.useContext(Ee),C=Cm(),d=xm(i,{relative:s}),c=u.toLowerCase()==="get"?"get":"post",f=typeof i=="string"&&sf.test(i),w=E=>{if(a&&a(E),E.defaultPrevented)return;E.preventDefault();let x=E.nativeEvent.submitter,R=(x==null?void 0:x.getAttribute("formmethod"))||u,L=()=>C(x||E.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:l,state:o,relative:s,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m});g&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:S,method:c,action:d,onSubmit:r?a:w,...y,"data-discover":!f&&e==="render"?"true":void 0})});gm.displayName="Form";function wm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ff(e){let t=v.useContext(vn);return A(t,wm(e)),t}function Sm(e,{target:t,replace:n,state:r,preventScrollReset:l,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:i,unstable_useTransitions:a}={}){let s=si(),h=tt(),p=dr(e,{relative:o});return v.useCallback(m=>{if(Zh(m,t)){m.preventDefault();let y=n!==void 0?n:ur(h)===ur(p),S=()=>s(e,{replace:y,state:r,preventScrollReset:l,relative:o,viewTransition:u,unstable_defaultShouldRevalidate:i});a?v.startTransition(()=>S()):S()}},[h,s,p,n,r,t,e,l,o,u,i,a])}function $m(e){we(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(cu(e)),n=v.useRef(!1),r=tt(),l=v.useMemo(()=>qh(r.search,n.current?null:t.current),[r.search]),o=si(),u=v.useCallback((i,a)=>{const s=cu(typeof i=="function"?i(new URLSearchParams(l)):i);n.current=!0,o("?"+s,a)},[o,l]);return[l,u]}var km=0,Em=()=>`__${String(++km)}__`;function Cm(){let{router:e}=ff("useSubmit"),{basename:t}=v.useContext(Ee),n=Bh(),r=e.fetch,l=e.navigate;return v.useCallback(async(o,u={})=>{let{action:i,method:a,encType:s,formData:h,body:p}=tm(o,t);if(u.navigate===!1){let m=u.fetcherKey||Em();await r(m,n,u.action||i,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:h,body:p,formMethod:u.method||a,formEncType:u.encType||s,flushSync:u.flushSync})}else await l(u.action||i,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:h,body:p,formMethod:u.method||a,formEncType:u.encType||s,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,l,t,n])}function xm(e,{relative:t}={}){let{basename:n}=v.useContext(Ee),r=v.useContext($e);A(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),o={...dr(e||".",{relative:t})},u=tt();if(e==null){o.search=u.search;let i=new URLSearchParams(o.search),a=i.getAll("index");if(a.some(h=>h==="")){i.delete("index"),a.filter(p=>p).forEach(p=>i.append("index",p));let h=i.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ge([n,o.pathname])),ur(o)}function Pm(e,{relative:t}={}){let n=v.useContext(bc);A(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ff("useViewTransitionState"),l=dr(e,{relative:t});if(!n.isTransitioning)return!1;let o=be(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=be(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yl(l.pathname,u)!=null||yl(l.pathname,o)!=null}export{Im as B,Mm as N,Lf as R,Up as a,Lm as b,oi as c,Tm as d,_m as e,Ap as f,za as g,si as h,Rm as i,Nm as j,$m as k,Om as l,yl as m,Dm as n,Fm as o,Qh as p,v as r,zm as s,tt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v,s as Ie,R as Le}from"./vendor-react-CnooHTJc.js";const w=t=>typeof t=="string",ye=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},Ct=t=>t==null?"":""+t,Ln=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},Cn=/###/g,Et=t=>t&&t.indexOf("###")>-1?t.replace(Cn,"."):t,_t=t=>!t||w(t),Oe=(t,e,n)=>{const s=w(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(_t(t))return{};const r=Et(s[i]);!t[r]&&n&&(t[r]=new n),Object.prototype.hasOwnProperty.call(t,r)?t=t[r]:t={},++i}return _t(t)?{}:{obj:t,k:Et(s[i])}},Nt=(t,e,n)=>{const{obj:s,k:i}=Oe(t,e,Object);if(s!==void 0||e.length===1){s[i]=n;return}let r=e[e.length-1],o=e.slice(0,e.length-1),a=Oe(t,o,Object);for(;a.obj===void 0&&o.length;)r=`${o[o.length-1]}.${r}`,o=o.slice(0,o.length-1),a=Oe(t,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${r}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${r}`]=n},En=(t,e,n,s)=>{const{obj:i,k:r}=Oe(t,e,Object);i[r]=i[r]||[],i[r].push(n)},Ae=(t,e)=>{const{obj:n,k:s}=Oe(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},_n=(t,e,n)=>{const s=Ae(t,n);return s!==void 0?s:Ae(e,n)},Yt=(t,e,n)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in t?w(t[s])||t[s]instanceof String||w(e[s])||e[s]instanceof String?n&&(t[s]=e[s]):Yt(t[s],e[s],n):t[s]=e[s]);return t},pe=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Nn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Pn=t=>w(t)?t.replace(/[&<>"'\/]/g,e=>Nn[e]):t;class In{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const An=[" ",",","?","!",";"],Dn=new In(20),Tn=(t,e,n)=>{e=e||"",n=n||"";const s=An.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(s.length===0)return!0;const i=Dn.getRegExp(`(${s.map(o=>o==="?"?"\\?":o).join("|")})`);let r=!i.test(t);if(!r){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(r=!0)}return r},et=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const s=e.split(n);let i=t;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let o,a="";for(let l=r;l<s.length;++l)if(l!==r&&(a+=n),a+=s[l],o=i[a],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&l<s.length-1)continue;r+=l-r+1;break}i=o}return i},we=t=>t==null?void 0:t.replace("_","-"),kn={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,s;(s=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||s.call(n,console,e)}};class De{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||kn,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,s,i){return i&&!this.debug?null:(w(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new De(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new De(this.logger,e)}}var ne=new De;class Ve{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(n)||0;this.observers[s].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,r])=>{for(let o=0;o<r;o++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,r])=>{for(let o=0;o<r;o++)i.apply(i,[e,...n])})}}class Pt extends Ve{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,s,i={}){var c,f;const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],s&&(Array.isArray(s)?a.push(...s):w(s)&&r?a.push(...s.split(r)):a.push(s)));const l=Ae(this.data,a);return!l&&!n&&!s&&e.indexOf(".")>-1&&(e=a[0],n=a[1],s=a.slice(2).join(".")),l||!o||!w(s)?l:et((f=(c=this.data)==null?void 0:c[e])==null?void 0:f[n],s,r)}addResource(e,n,s,i,r={silent:!1}){const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=[e,n];s&&(a=a.concat(o?s.split(o):s)),e.indexOf(".")>-1&&(a=e.split("."),i=n,n=a[1]),this.addNamespaces(n),Nt(this.data,a,i),r.silent||this.emit("added",e,n,s,i)}addResources(e,n,s,i={silent:!1}){for(const r in s)(w(s[r])||Array.isArray(s[r]))&&this.addResource(e,n,r,s[r],{silent:!0});i.silent||this.emit("added",e,n,s)}addResourceBundle(e,n,s,i,r,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),i=s,s=n,n=a[1]),this.addNamespaces(n);let l=Ae(this.data,a)||{};o.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Yt(l,s,r):l={...l,...s},Nt(this.data,a,l),o.silent||this.emit("added",e,n,s)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Qt={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,i){return t.forEach(r=>{var o;e=((o=this.processors[r])==null?void 0:o.process(e,n,s,i))??e}),e}};const Xt=Symbol("i18next/PATH_KEY");function $n(){const t=[],e=Object.create(null);let n;return e.get=(s,i)=>{var r;return(r=n==null?void 0:n.revoke)==null||r.call(n),i===Xt?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function tt(t,e){const{[Xt]:n}=t($n());return n.join((e==null?void 0:e.keySeparator)??".")}const It={},Ke=t=>!w(t)&&typeof t!="boolean"&&typeof t!="number";class Te extends Ve{constructor(e,n={}){super(),Ln(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ne.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const s={...n};if(e==null)return!1;const i=this.resolve(e,s);if((i==null?void 0:i.res)===void 0)return!1;const r=Ke(i.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let r=n.ns||this.options.defaultNS||[];const o=s&&e.indexOf(s)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Tn(e,s,i);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:w(r)?[r]:r};const c=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(i)}return{key:e,namespaces:w(r)?[r]:r}}translate(e,n,s){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=tt(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const r=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],i),c=l[l.length-1];let f=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=i.lng||this.language,g=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return g?r?{res:`${c}${f}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:`${c}${f}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(i)}:a;const d=this.resolve(e,i);let h=d==null?void 0:d.res;const S=(d==null?void 0:d.usedKey)||a,L=(d==null?void 0:d.exactUsedKey)||a,O=["[object Number]","[object Function]","[object RegExp]"],p=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,N=i.count!==void 0&&!w(i.count),b=Te.hasDefaultValue(i),D=N?this.pluralResolver.getSuffix(u,i.count,i):"",k=i.ordinal&&N?this.pluralResolver.getSuffix(u,i.count,{ordinal:!1}):"",P=N&&!i.ordinal&&i.count===0,m=P&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${D}`]||i[`defaultValue${k}`]||i.defaultValue;let x=h;_&&!h&&b&&(x=m);const A=Ke(x),C=Object.prototype.toString.apply(x);if(_&&x&&A&&O.indexOf(C)<0&&!(w(p)&&Array.isArray(x))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,x,{...i,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(d.res=R,d.usedParams=this.getUsedParamsDetails(i),d):R}if(o){const R=Array.isArray(x),y=R?[]:{},I=R?L:S;for(const $ in x)if(Object.prototype.hasOwnProperty.call(x,$)){const T=`${I}${o}${$}`;b&&!h?y[$]=this.translate(T,{...i,defaultValue:Ke(m)?m[$]:void 0,joinArrays:!1,ns:l}):y[$]=this.translate(T,{...i,joinArrays:!1,ns:l}),y[$]===T&&(y[$]=x[$])}h=y}}else if(_&&w(p)&&Array.isArray(h))h=h.join(p),h&&(h=this.extendTranslation(h,e,i,s));else{let R=!1,y=!1;!this.isValidLookup(h)&&b&&(R=!0,h=m),this.isValidLookup(h)||(y=!0,h=a);const $=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&y?void 0:h,T=b&&m!==h&&this.options.updateMissing;if(y||R||T){if(this.logger.log(T?"updateKey":"missingKey",u,c,a,T?m:h),o){const K=this.resolve(a,{...i,keySeparator:!1});K&&K.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 W=[];const J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(let K=0;K<J.length;K++)W.push(J[K]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(i.lng||this.language):W.push(i.lng||this.language);const ce=(K,j,G)=>{var ue;const ee=b&&G!==h?G:$;this.options.missingKeyHandler?this.options.missingKeyHandler(K,c,j,ee,T,i):(ue=this.backendConnector)!=null&&ue.saveMissing&&this.backendConnector.saveMissing(K,c,j,ee,T,i),this.emit("missingKey",K,c,j,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?W.forEach(K=>{const j=this.pluralResolver.getSuffixes(K,i);P&&i[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach(G=>{ce([K],a+G,i[`defaultValue${G}`]||m)})}):ce(W,a,m))}h=this.extendTranslation(h,e,i,d,s),y&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${c}${f}${a}`),(y||R)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${a}`:a,R?h:void 0,i))}return r?(d.res=h,d.usedParams=this.getUsedParamsDetails(i),d):h}extendTranslation(e,n,s,i,r){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const f=w(e)&&(((c=s==null?void 0:s.interpolation)==null?void 0:c.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const d=e.match(this.interpolator.nestingRegexp);u=d&&d.length}let g=s.replace&&!w(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),e=this.interpolator.interpolate(e,g,s.lng||this.language||i.usedLng,s),f){const d=e.match(this.interpolator.nestingRegexp),h=d&&d.length;u<h&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>(r==null?void 0:r[0])===d[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,a=w(o)?[o]:o;return e!=null&&(a!=null&&a.length)&&s.applyPostProcessor!==!1&&(e=Qt.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,n={}){let s,i,r,o,a;return w(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(l,n),f=c.key;i=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const g=n.count!==void 0&&!w(n.count),d=g&&!n.ordinal&&n.count===0,h=n.context!==void 0&&(w(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);u.forEach(L=>{var O,p;this.isValidLookup(s)||(a=L,!It[`${S[0]}-${L}`]&&((O=this.utils)!=null&&O.hasLoadedNamespace)&&!((p=this.utils)!=null&&p.hasLoadedNamespace(a))&&(It[`${S[0]}-${L}`]=!0,this.logger.warn(`key "${i}" for languages "${S.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),S.forEach(_=>{var D;if(this.isValidLookup(s))return;o=_;const N=[f];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(N,f,_,L,n);else{let k;g&&(k=this.pluralResolver.getSuffix(_,n.count,n));const P=`${this.options.pluralSeparator}zero`,m=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(n.ordinal&&k.indexOf(m)===0&&N.push(f+k.replace(m,this.options.pluralSeparator)),N.push(f+k),d&&N.push(f+P)),h){const x=`${f}${this.options.contextSeparator||"_"}${n.context}`;N.push(x),g&&(n.ordinal&&k.indexOf(m)===0&&N.push(x+k.replace(m,this.options.pluralSeparator)),N.push(x+k),d&&N.push(x+P))}}let b;for(;b=N.pop();)this.isValidLookup(s)||(r=b,s=this.getResource(_,L,b,n))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,s,i={}){var r;return(r=this.i18nFormat)!=null&&r.getResource?this.i18nFormat.getResource(e,n,s,i):this.resourceStore.getResource(e,n,s,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!w(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of n)delete i[r]}return i}static hasDefaultValue(e){const n="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n===s.substring(0,n.length)&&e[s]!==void 0)return!0;return!1}}class At{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ne.create("languageUtils")}getScriptPartFromCode(e){if(e=we(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=we(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(w(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(s=>{if(n)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(s=>{if(n)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return n=i;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return n=r;n=this.options.supportedLngs.find(o=>{if(o===r)return o;if(!(o.indexOf("-")<0&&r.indexOf("-")<0)&&(o.indexOf("-")>0&&r.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===r||o.indexOf(r)===0&&r.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),w(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let s=e[n];return s||(s=e[this.getScriptPartFromCode(n)]),s||(s=e[this.formatLanguageCode(n)]),s||(s=e[this.getLanguagePartFromCode(n)]),s||(s=e.default),s||[]}toResolveHierarchy(e,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],r=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return w(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):w(e)&&r(this.formatLanguageCode(e)),s.forEach(o=>{i.indexOf(o)<0&&r(this.formatLanguageCode(o))}),i}}const Dt={zero:0,one:1,two:2,few:3,many:4,other:5},Tt={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Fn{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=ne.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=we(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(s,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Tt;if(!e.match(/-|_/))return Tt;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[r]=o,o}needsPlural(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,s={}){return this.getSuffixes(e,s).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((i,r)=>Dt[i]-Dt[r]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,s))}}const kt=(t,e,n,s=".",i=!0)=>{let r=_n(t,e,n);return!r&&i&&w(n)&&(r=et(t,n,s),r===void 0&&(r=et(e,n,s))),r},He=t=>t.replace(/\$/g,"$$$$");class $t{constructor(e={}){var n;this.logger=ne.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:g,nestingPrefixEscaped:d,nestingSuffix:h,nestingSuffixEscaped:S,nestingOptionsSeparator:L,maxReplaces:O,alwaysFormat:p}=e.interpolation;this.escape=n!==void 0?n:Pn,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?pe(r):o||"{{",this.suffix=a?pe(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=g?pe(g):d||pe("$t("),this.nestingSuffix=h?pe(h):S||pe(")"),this.nestingOptionsSeparator=L||",",this.maxReplaces=O||1e3,this.alwaysFormat=p!==void 0?p:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,s)=>(n==null?void 0:n.source)===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,s,i){var d;let r,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=h=>{if(h.indexOf(this.formatSeparator)<0){const p=kt(n,l,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(p,void 0,s,{...i,...n,interpolationkey:h}):p}const S=h.split(this.formatSeparator),L=S.shift().trim(),O=S.join(this.formatSeparator).trim();return this.format(kt(n,l,L,this.options.keySeparator,this.options.ignoreJSONStructure),O,s,{...i,...n,interpolationkey:L})};this.resetRegExp();const f=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((d=i==null?void 0:i.interpolation)==null?void 0:d.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>He(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?He(this.escape(h)):He(h)}].forEach(h=>{for(a=0;r=h.regex.exec(e);){const S=r[1].trim();if(o=c(S),o===void 0)if(typeof f=="function"){const O=f(e,r,i);o=w(O)?O:""}else if(i&&Object.prototype.hasOwnProperty.call(i,S))o="";else if(u){o=r[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${e}`),o="";else!w(o)&&!this.useRawValueToEscape&&(o=Ct(o));const L=h.safeValue(o);if(e=e.replace(r[0],L),u?(h.regex.lastIndex+=o.length,h.regex.lastIndex-=r[0].length):h.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,s={}){let i,r,o;const a=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let g=`{${u[1]}`;l=u[0],g=this.interpolate(g,o);const d=g.match(/'/g),h=g.match(/"/g);(((d==null?void 0:d.length)??0)%2===0&&!h||h.length%2!==0)&&(g=g.replace(/'/g,'"'));try{o=JSON.parse(g),c&&(o={...c,...o})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,S),`${l}${f}${g}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...s},o=o.replace&&!w(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const c=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(c!==-1&&(l=i[1].slice(c).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),i[1]=i[1].slice(0,c)),r=n(a.call(this,i[1].trim(),o),o),r&&i[0]===e&&!w(r))return r;w(r)||(r=Ct(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((f,u)=>this.format(f,u,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const jn=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),f=a.trim();n[f]||(n[f]=c),c==="false"&&(n[f]=!1),c==="true"&&(n[f]=!0),isNaN(c)||(n[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:n}},Ft=t=>{const e={};return(n,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const o=s+JSON.stringify(r);let a=e[o];return a||(a=t(we(s),i),e[o]=a),a(n)}},Vn=t=>(e,n,s)=>t(we(n),s)(e);class Mn{constructor(e={}){this.logger=ne.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?Ft:Vn;this.formats={number:s((i,r)=>{const o=new Intl.NumberFormat(i,{...r});return a=>o.format(a)}),currency:s((i,r)=>{const o=new Intl.NumberFormat(i,{...r,style:"currency"});return a=>o.format(a)}),datetime:s((i,r)=>{const o=new Intl.DateTimeFormat(i,{...r});return a=>o.format(a)}),relativetime:s((i,r)=>{const o=new Intl.RelativeTimeFormat(i,{...r});return a=>o.format(a,r.range||"day")}),list:s((i,r)=>{const o=new Intl.ListFormat(i,{...r});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Ft(n)}format(e,n,s,i={}){const r=n.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(a=>a.indexOf(")")>-1)){const a=r.findIndex(l=>l.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,a)].join(this.formatSeparator)}return r.reduce((a,l)=>{var u;const{formatName:c,formatOptions:f}=jn(l);if(this.formats[c]){let g=a;try{const d=((u=i==null?void 0:i.formatParams)==null?void 0:u[i.interpolationkey])||{},h=d.locale||d.lng||i.locale||i.lng||s;g=this.formats[c](a,h,{...f,...i,...d})}catch(d){this.logger.warn(d)}return g}else this.logger.warn(`there was no format function for ${c}`);return a},e)}}const Bn=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class Un extends Ve{constructor(e,n,s,i={}){var r,o;super(),this.backend=e,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=ne.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(o=(r=this.backend)==null?void 0:r.init)==null||o.call(r,s,i.backend,i)}queueLoad(e,n,s,i){const r={},o={},a={},l={};return e.forEach(c=>{let f=!0;n.forEach(u=>{const g=`${c}|${u}`;!s.reload&&this.store.hasResourceBundle(c,u)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?o[g]===void 0&&(o[g]=!0):(this.state[g]=1,f=!1,o[g]===void 0&&(o[g]=!0),r[g]===void 0&&(r[g]=!0),l[u]===void 0&&(l[u]=!0)))}),f||(a[c]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,s){const i=e.split("|"),r=i[0],o=i[1];n&&this.emit("failedLoading",r,o,n),!n&&s&&this.store.addResourceBundle(r,o,s,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&s&&(this.state[e]=0);const a={};this.queue.forEach(l=>{En(l.loaded,[r],o),Bn(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{a[c][u]===void 0&&(a[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,s,i=0,r=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:s,tried:i,wait:r,callback:o});return}this.readingCalls++;const a=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&f&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,r*2,o)},r);return}o(c,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const c=l(e,n);c&&typeof c.then=="function"?c.then(f=>a(null,f)).catch(a):a(null,c)}catch(c){a(c)}return}return l(e,n,a)}prepareLoading(e,n,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();w(e)&&(e=this.languageUtils.toResolveHierarchy(e)),w(n)&&(n=[n]);const r=this.queueLoad(e,n,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,s){this.prepareLoading(e,n,{},s)}reload(e,n,s){this.prepareLoading(e,n,{reload:!0},s)}loadOne(e,n=""){const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${r} for language ${i} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${r} for language ${i}`,a),this.loaded(e,o,a)})}saveMissing(e,n,s,i,r,o={},a=()=>{}){var l,c,f,u,g;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${s}" as the namespace "${n}" 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(!(s==null||s==="")){if((g=this.backend)!=null&&g.create){const d={...o,isUpdate:r},h=this.backend.create.bind(this.backend);if(h.length<6)try{let S;h.length===5?S=h(e,n,s,i,d):S=h(e,n,s,i),S&&typeof S.then=="function"?S.then(L=>a(null,L)).catch(a):a(null,S)}catch(S){a(S)}else h(e,n,s,i,a,d)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const We=()=>({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 e={};if(typeof t[1]=="object"&&(e=t[1]),w(t[1])&&(e.defaultValue=t[1]),w(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(s=>{e[s]=n[s]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),jt=t=>{var e,n;return w(t.ns)&&(t.ns=[t.ns]),w(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),w(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Ee=()=>{},Kn=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class ve extends Ve{constructor(e={},n){if(super(),this.options=jt(e),this.services={},this.logger=ne,this.modules={external:[]},Kn(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(w(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=We();this.options={...s,...this.options,...jt(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const i=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?ne.init(i(this.modules.logger),this.options):ne.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Mn;const f=new At(this.options);this.store=new Pt(this.options.resources,this.options);const u=this.services;u.logger=ne,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Fn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(u.formatter=i(c),u.formatter.init&&u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new $t(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Un(i(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(u.languageDetector=i(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=i(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Te(this.services,this.options),this.translator.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Ee),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const a=ye(),l=()=>{const c=(f,u)=>{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),a.resolve(u),n(f,u)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=Ee){var r,o;let s=n;const i=w(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const a=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&a.indexOf(u)<0&&a.push(u)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(o=(r=this.options.preload)==null?void 0:r.forEach)==null||o.call(r,c=>l(c)),this.services.backendConnector.load(a,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(c)})}else s(null)}reloadResources(e,n,s){const i=ye();return typeof e=="function"&&(s=e,e=void 0),typeof n=="function"&&(s=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),s||(s=Ee),this.services.backendConnector.reload(e,n,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Qt.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const s=ye();this.emit("languageChanging",e);const i=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},r=(a,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...c)=>this.t(...c)),n&&n(a,(...c)=>this.t(...c))},o=a=>{var f,u;!e&&!a&&this.services.languageDetector&&(a=[]);const l=w(a)?a:a&&a[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(w(a)?[a]:a);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,g=>{r(g,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,s){const i=(r,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([r,o].concat(a)):l={...o},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||s||i.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(r)?f=r.map(u=>(typeof u=="function"&&(u=tt(u,{...this.options,...o})),`${l.keyPrefix}${c}${u}`)):(typeof r=="function"&&(r=tt(r,{...this.options,...o})),f=l.keyPrefix?`${l.keyPrefix}${c}${r}`:r),this.t(f,l)};return w(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=s,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){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 s=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const c=this.services.backendConnector.state[`${a}|${l}`];return c===-1||c===0||c===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(s,e)&&(!i||o(r,e)))}loadNamespaces(e,n){const s=ye();return this.options.ns?(w(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),n&&n(i)}),s):(n&&n(),Promise.resolve())}loadLanguages(e,n){const s=ye();w(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return r.length?(this.options.preload=i.concat(r),this.loadResources(o=>{s.resolve(),n&&n(o)}),s):(n&&n(),Promise.resolve())}dir(e){var i,r;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const n=["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"],s=((r=this.services)==null?void 0:r.languageUtils)||new At(We());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const s=new ve(e,n);return s.createInstance=ve.createInstance,s}cloneInstance(e={},n=Ee){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new ve(i);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(a=>{r[a]=this[a]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const a=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});r.store=new Pt(a,i),r.services.resourceStore=r.store}if(e.interpolation){const l={...We().interpolation,...this.options.interpolation,...e.interpolation},c={...i,interpolation:l};r.services.interpolator=new $t(c)}return r.translator=new Te(r.services,i),r.translator.on("*",(a,...l)=>{r.emit(a,...l)}),r.init(i,n),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Y=ve.createInstance();Y.createInstance;Y.dir;Y.init;Y.loadResources;Y.reloadResources;Y.use;Y.changeLanguage;Y.getFixedT;Y.t;Y.exists;Y.setDefaultNamespace;Y.hasLoadedNamespace;Y.loadNamespaces;Y.loadLanguages;const Hn=(t,e,n,s)=>{var r,o,a,l;const i=[n,{code:e,...s||{}}];if((o=(r=t==null?void 0:t.services)==null?void 0:r.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);de(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Vt={},Zt=(t,e,n,s)=>{de(n)&&Vt[n]||(de(n)&&(Vt[n]=new Date),Hn(t,e,n,s))},en=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},nt=(t,e,n)=>{t.loadNamespaces(e,en(t,n))},Mt=(t,e,n,s)=>{if(de(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return nt(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,en(t,s))},Wn=(t,e,n={})=>!e.languages||!e.languages.length?(Zt(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(s,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,t))return!1}}),de=t=>typeof t=="string",zn=t=>typeof t=="object"&&t!==null,Jn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Gn={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},qn=t=>Gn[t],Yn=t=>t.replace(Jn,qn);let st={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Yn,transDefaultProps:void 0};const Qn=(t={})=>{st={...st,...t}},Xn=()=>st;let tn;const Zn=t=>{tn=t},es=()=>tn,Si={type:"3rdParty",init(t){Qn(t.options.react),Zn(t)}},ts=v.createContext();class ns{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const ss=(t,e)=>de(e)?e:zn(e)&&de(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t,is={t:ss,ready:!1},rs=()=>()=>{},yi=(t,e={})=>{var m,x,A;const{i18n:n}=e,{i18n:s,defaultNS:i}=v.useContext(ts)||{},r=n||s||es();r&&!r.reportNamespaces&&(r.reportNamespaces=new ns),r||Zt(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=v.useMemo(()=>{var C;return{...Xn(),...(C=r==null?void 0:r.options)==null?void 0:C.react,...e}},[r,e]),{useSuspense:a,keyPrefix:l}=o,c=i||((m=r==null?void 0:r.options)==null?void 0:m.defaultNS),f=de(c)?[c]:c||["translation"],u=v.useMemo(()=>f,f);(A=(x=r==null?void 0:r.reportNamespaces)==null?void 0:x.addUsedNamespaces)==null||A.call(x,u);const g=v.useRef(0),d=v.useCallback(C=>{if(!r)return rs;const{bindI18n:R,bindI18nStore:y}=o,I=()=>{g.current+=1,C()};return R&&r.on(R,I),y&&r.store.on(y,I),()=>{R&&R.split(" ").forEach($=>r.off($,I)),y&&y.split(" ").forEach($=>r.store.off($,I))}},[r,o]),h=v.useRef(),S=v.useCallback(()=>{if(!r)return is;const C=!!(r.isInitialized||r.initializedStoreOnce)&&u.every(W=>Wn(W,r,o)),R=e.lng||r.language,y=g.current,I=h.current;if(I&&I.ready===C&&I.lng===R&&I.keyPrefix===l&&I.revision===y)return I;const T={t:r.getFixedT(R,o.nsMode==="fallback"?u:u[0],l),ready:C,lng:R,keyPrefix:l,revision:y};return h.current=T,T},[r,u,l,o,e.lng]),[L,O]=v.useState(0),{t:p,ready:_}=Ie.useSyncExternalStore(d,S,S);v.useEffect(()=>{if(r&&!_&&!a){const C=()=>O(R=>R+1);e.lng?Mt(r,e.lng,u,C):nt(r,u,C)}},[r,e.lng,u,_,a,L]);const N=r||{},b=v.useRef(null),D=v.useRef(),k=C=>{const R=Object.getOwnPropertyDescriptors(C);R.__original&&delete R.__original;const y=Object.create(Object.getPrototypeOf(C),R);if(!Object.prototype.hasOwnProperty.call(y,"__original"))try{Object.defineProperty(y,"__original",{value:C,writable:!1,enumerable:!1,configurable:!1})}catch{}return y},P=v.useMemo(()=>{const C=N,R=C==null?void 0:C.language;let y=C;C&&(b.current&&b.current.__original===C?D.current!==R?(y=k(C),b.current=y,D.current=R):y=b.current:(y=k(C),b.current=y,D.current=R));const I=[p,y,_];return I.t=p,I.i18n=y,I.ready=_,I},[p,N,_,N.resolvedLanguage,N.language,N.languages]);if(r&&a&&!_)throw new Promise(C=>{const R=()=>C();e.lng?Mt(r,e.lng,u,R):nt(r,u,R)});return P},nn=0,sn=1,rn=2,Bt=3;var Ut=Object.prototype.hasOwnProperty;function it(t,e){var n,s;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((s=t.length)===e.length)for(;s--&&it(t[s],e[s]););return s===-1}if(!n||typeof t=="object"){s=0;for(n in t)if(Ut.call(t,n)&&++s&&!Ut.call(e,n)||!(n in e)||!it(t[n],e[n]))return!1;return Object.keys(e).length===s}}return t!==t&&e!==e}const te=new WeakMap,re=()=>{},U=re(),ke=Object,E=t=>t===U,X=t=>typeof t=="function",ae=(t,e)=>({...t,...e}),on=t=>X(t.then),ze={},_e={},bt="undefined",Ce=typeof window!=bt,rt=typeof document!=bt,os=Ce&&"Deno"in window,as=()=>Ce&&typeof window.requestAnimationFrame!=bt,le=(t,e)=>{const n=te.get(t);return[()=>!E(e)&&t.get(e)||ze,s=>{if(!E(e)){const i=t.get(e);e in _e||(_e[e]=i),n[5](e,ae(i,s),i||ze)}},n[6],()=>!E(e)&&e in _e?_e[e]:!E(e)&&t.get(e)||ze]};let ot=!0;const ls=()=>ot,[at,lt]=Ce&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[re,re],cs=()=>{const t=rt&&document.visibilityState;return E(t)||t!=="hidden"},us=t=>(rt&&document.addEventListener("visibilitychange",t),at("focus",t),()=>{rt&&document.removeEventListener("visibilitychange",t),lt("focus",t)}),fs=t=>{const e=()=>{ot=!0,t()},n=()=>{ot=!1};return at("online",e),at("offline",n),()=>{lt("online",e),lt("offline",n)}},ds={isOnline:ls,isVisible:cs},hs={initFocus:us,initReconnect:fs},Kt=!Le.useId,me=!Ce||os,gs=t=>as()?window.requestAnimationFrame(t):setTimeout(t,1),xe=me?v.useEffect:v.useLayoutEffect,Je=typeof navigator<"u"&&navigator.connection,Ht=!me&&Je&&(["slow-2g","2g"].includes(Je.effectiveType)||Je.saveData),Ne=new WeakMap,ps=t=>ke.prototype.toString.call(t),Ge=(t,e)=>t===`[object ${e}]`;let ms=0;const ct=t=>{const e=typeof t,n=ps(t),s=Ge(n,"Date"),i=Ge(n,"RegExp"),r=Ge(n,"Object");let o,a;if(ke(t)===t&&!s&&!i){if(o=Ne.get(t),o)return o;if(o=++ms+"~",Ne.set(t,o),Array.isArray(t)){for(o="@",a=0;a<t.length;a++)o+=ct(t[a])+",";Ne.set(t,o)}if(r){o="#";const l=ke.keys(t).sort();for(;!E(a=l.pop());)E(t[a])||(o+=a+":"+ct(t[a])+",");Ne.set(t,o)}}else o=s?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return o},Re=t=>{if(X(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?ct(t):"",[t,e]};let Ss=0;const ut=()=>++Ss;async function an(...t){const[e,n,s,i]=t,r=ae({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=r.populateCache;const a=r.rollbackOnError;let l=r.optimisticData;const c=g=>typeof a=="function"?a(g):a!==!1,f=r.throwOnError;if(X(n)){const g=n,d=[],h=e.keys();for(const S of h)!/^\$(inf|sub)\$/.test(S)&&g(e.get(S)._k)&&d.push(S);return Promise.all(d.map(u))}return u(n);async function u(g){const[d]=Re(g);if(!d)return;const[h,S]=le(e,d),[L,O,p,_]=te.get(e),N=()=>{const y=L[d];return(X(r.revalidate)?r.revalidate(h().data,g):r.revalidate!==!1)&&(delete p[d],delete _[d],y&&y[0])?y[0](rn).then(()=>h().data):h().data};if(t.length<3)return N();let b=s,D,k=!1;const P=ut();O[d]=[P,0];const m=!E(l),x=h(),A=x.data,C=x._c,R=E(C)?A:C;if(m&&(l=X(l)?l(R,A):l,S({data:l,_c:R})),X(b))try{b=b(R)}catch(y){D=y,k=!0}if(b&&on(b))if(b=await b.catch(y=>{D=y,k=!0}),P!==O[d][0]){if(k)throw D;return b}else k&&m&&c(D)&&(o=!0,S({data:R,_c:U}));if(o&&!k)if(X(o)){const y=o(b,R);S({data:y,error:U,_c:U})}else S({data:b,error:U,_c:U});if(O[d][1]=ut(),Promise.resolve(N()).then(()=>{S({_c:U})}),k){if(f)throw D;return}return b}}const Wt=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},ln=(t,e)=>{if(!te.has(t)){const n=ae(hs,e),s=Object.create(null),i=an.bind(U,t);let r=re;const o=Object.create(null),a=(f,u)=>{const g=o[f]||[];return o[f]=g,g.push(u),()=>g.splice(g.indexOf(u),1)},l=(f,u,g)=>{t.set(f,u);const d=o[f];if(d)for(const h of d)h(u,g)},c=()=>{if(!te.has(t)&&(te.set(t,[s,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!me)){const f=n.initFocus(setTimeout.bind(U,Wt.bind(U,s,nn))),u=n.initReconnect(setTimeout.bind(U,Wt.bind(U,s,sn)));r=()=>{f&&f(),u&&u(),te.delete(t)}}};return c(),[t,i,c,r]}return[t,te.get(t)[4]]},ys=(t,e,n,s,i)=>{const r=n.errorRetryCount,o=i.retryCount,a=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!E(r)&&o>r||setTimeout(s,a,i)},bs=it,[Me,Os]=ln(new Map),cn=ae({onLoadingSlow:re,onSuccess:re,onError:re,onErrorRetry:ys,onDiscarded:re,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ht?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Ht?5e3:3e3,compare:bs,isPaused:()=>!1,cache:Me,mutate:Os,fallback:{}},ds),un=(t,e)=>{const n=ae(t,e);if(e){const{use:s,fallback:i}=t,{use:r,fallback:o}=e;s&&r&&(n.use=s.concat(r)),i&&o&&(n.fallback=ae(i,o))}return n},ft=v.createContext({}),vs=t=>{const{value:e}=t,n=v.useContext(ft),s=X(e),i=v.useMemo(()=>s?e(n):e,[s,n,e]),r=v.useMemo(()=>s?i:un(n,i),[s,n,i]),o=i&&i.provider,a=v.useRef(U);o&&!a.current&&(a.current=ln(o(r.cache||Me),i));const l=a.current;return l&&(r.cache=l[0],r.mutate=l[1]),xe(()=>{if(l)return l[2]&&l[2](),l[3]},[]),v.createElement(ft.Provider,ae(t,{value:r}))},fn="$inf$",dn=Ce&&window.__SWR_DEVTOOLS_USE__,xs=dn?window.__SWR_DEVTOOLS_USE__:[],ws=()=>{dn&&(window.__SWR_DEVTOOLS_REACT__=Le)},hn=t=>X(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(t[1]===null?t[2]:t[1])||{}],Rs=()=>{const t=v.useContext(ft);return v.useMemo(()=>ae(cn,t),[t])},Ls=t=>(e,n,s)=>t(e,n&&((...r)=>{const[o]=Re(e),[,,,a]=te.get(Me);if(o.startsWith(fn))return n(...r);const l=a[o];return E(l)?n(...r):(delete a[o],l)}),s),Cs=xs.concat(Ls),Es=t=>function(...n){const s=Rs(),[i,r,o]=hn(n),a=un(s,o);let l=t;const{use:c}=a,f=(c||[]).concat(Cs);for(let u=f.length;u--;)l=f[u](l);return l(i,r||a.fetcher||null,a)},_s=(t,e,n)=>{const s=e[t]||(e[t]=[]);return s.push(n),()=>{const i=s.indexOf(n);i>=0&&(s[i]=s[s.length-1],s.pop())}},Ns=(t,e)=>(...n)=>{const[s,i,r]=hn(n),o=(r.use||[]).concat(e);return t(s,i,{...r,use:o})};ws();const qe=Le.use||(t=>{switch(t.status){case"pending":throw t;case"fulfilled":return t.value;case"rejected":throw t.reason;default:throw t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t}}),Ye={dedupe:!0},zt=Promise.resolve(U),Ps=(t,e,n)=>{const{cache:s,compare:i,suspense:r,fallbackData:o,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:f,refreshWhenOffline:u,keepPreviousData:g,strictServerPrefetchWarning:d}=n,[h,S,L,O]=te.get(s),[p,_]=Re(t),N=v.useRef(!1),b=v.useRef(!1),D=v.useRef(p),k=v.useRef(e),P=v.useRef(n),m=()=>P.current,x=()=>m().isVisible()&&m().isOnline(),[A,C,R,y]=le(s,p),I=v.useRef({}).current,$=E(o)?E(n.fallback)?U:n.fallback[p]:o,T=(F,V)=>{for(const B in I){const M=B;if(M==="data"){if(!i(F[M],V[M])&&(!E(F[M])||!i(he,V[M])))return!1}else if(V[M]!==F[M])return!1}return!0},W=v.useMemo(()=>{const F=!p||!e?!1:E(a)?m().isPaused()||r?!1:l!==!1:a,V=q=>{const se=ae(q);return delete se._k,F?{isValidating:!0,isLoading:!0,...se}:se},B=A(),M=y(),Z=V(B),ge=B===M?Z:V(M);let H=Z;return[()=>{const q=V(A());return T(q,H)?(H.data=q.data,H.isLoading=q.isLoading,H.isValidating=q.isValidating,H.error=q.error,H):(H=q,q)},()=>ge]},[s,p]),J=Ie.useSyncExternalStore(v.useCallback(F=>R(p,(V,B)=>{T(B,V)||F()}),[s,p]),W[0],W[1]),ce=!N.current,K=h[p]&&h[p].length>0,j=J.data,G=E(j)?$&&on($)?qe($):$:j,ee=J.error,ue=v.useRef(G),he=g?E(j)?E(ue.current)?G:ue.current:j:G,fe=p&&E(G),vn=!me&&Ie.useSyncExternalStore(()=>re,()=>!1,()=>!0);d&&vn&&!r&&fe&&console.warn(`Missing pre-initiated data for serialized key "${p}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ot=K&&!E(ee)?!1:ce&&!E(a)?a:m().isPaused()?!1:r?E(G)?!1:l:E(G)||l,vt=!!(p&&e&&ce&&Ot),xn=E(J.isValidating)?vt:J.isValidating,wn=E(J.isLoading)?vt:J.isLoading,Se=v.useCallback(async F=>{const V=k.current;if(!p||!V||b.current||m().isPaused())return!1;let B,M,Z=!0;const ge=F||{},H=!L[p]||!ge.dedupe,q=()=>Kt?!b.current&&p===D.current&&N.current:p===D.current,se={isValidating:!1,isLoading:!1},wt=()=>{C(se)},Rt=()=>{const Q=L[p];Q&&Q[1]===M&&delete L[p]},Lt={isValidating:!0};E(A().data)&&(Lt.isLoading=!0);try{if(H&&(C(Lt),n.loadingTimeout&&E(A().data)&&setTimeout(()=>{Z&&q()&&m().onLoadingSlow(p,n)},n.loadingTimeout),L[p]=[V(_),ut()]),[B,M]=L[p],B=await B,H&&setTimeout(Rt,n.dedupingInterval),!L[p]||L[p][1]!==M)return H&&q()&&m().onDiscarded(p),!1;se.error=U;const Q=S[p];if(!E(Q)&&(M<=Q[0]||M<=Q[1]||Q[1]===0))return wt(),H&&q()&&m().onDiscarded(p),!1;const ie=A().data;se.data=i(ie,B)?ie:B,H&&q()&&m().onSuccess(B,p,n)}catch(Q){Rt();const ie=m(),{shouldRetryOnError:Be}=ie;ie.isPaused()||(se.error=Q,H&&q()&&(ie.onError(Q,p,ie),(Be===!0||X(Be)&&Be(Q))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||x())&&ie.onErrorRetry(Q,p,ie,Rn=>{const Ue=h[p];Ue&&Ue[0]&&Ue[0](Bt,Rn)},{retryCount:(ge.retryCount||0)+1,dedupe:!0})))}return Z=!1,wt(),!0},[p,s]),xt=v.useCallback((...F)=>an(s,D.current,...F),[]);if(xe(()=>{k.current=e,P.current=n,E(j)||(ue.current=j)}),xe(()=>{if(!p)return;const F=Se.bind(U,Ye);let V=0;m().revalidateOnFocus&&(V=Date.now()+m().focusThrottleInterval);const M=_s(p,h,(Z,ge={})=>{if(Z==nn){const H=Date.now();m().revalidateOnFocus&&H>V&&x()&&(V=H+m().focusThrottleInterval,F())}else if(Z==sn)m().revalidateOnReconnect&&x()&&F();else{if(Z==rn)return Se();if(Z==Bt)return Se(ge)}});return b.current=!1,D.current=p,N.current=!0,C({_k:_}),Ot&&(L[p]||(E(G)||me?F():gs(F))),()=>{b.current=!0,M()}},[p]),xe(()=>{let F;function V(){const M=X(c)?c(A().data):c;M&&F!==-1&&(F=setTimeout(B,M))}function B(){!A().error&&(f||m().isVisible())&&(u||m().isOnline())?Se(Ye).then(V):V()}return V(),()=>{F&&(clearTimeout(F),F=-1)}},[c,f,u,p]),v.useDebugValue(he),r){if(!Kt&&me&&fe)throw new Error("Fallback data is required when using Suspense in SSR.");fe&&(k.current=e,P.current=n,b.current=!1);const F=O[p],V=!E(F)&&fe?xt(F):zt;if(qe(V),!E(ee)&&fe)throw ee;const B=fe?Se(Ye):zt;!E(he)&&fe&&(B.status="fulfilled",B.value=!0),qe(B)}return{mutate:xt,get data(){return I.data=!0,he},get error(){return I.error=!0,ee},get isValidating(){return I.isValidating=!0,xn},get isLoading(){return I.isLoading=!0,wn}}},bi=ke.defineProperty(vs,"defaultValue",{value:cn}),Is=Es(Ps),oe={BASE_URL:"/__ONEWORKS_PROJECT_CLIENT_BASE__/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,__ONEWORKS_PROJECT_CLIENT_COMMIT_HASH__:"6788a07c7f265c252930c4d6df671af73ff93dad",__ONEWORKS_PROJECT_CLIENT_VERSION__:"0.1.0-beta.1",__ONEWORKS_PROJECT_DEV_GIT_REF__:""};function gn(t){return"init"in t}function dt(t){return!!t.write}function Jt(t){return"v"in t||"e"in t}function $e(t){if("e"in t)throw t.e;if((oe?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}const Fe=new WeakMap;function pn(t){var e;return je(t)&&!!((e=Fe.get(t))!=null&&e[0])}function As(t){const e=Fe.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(n=>n()))}function ht(t,e){let n=Fe.get(t);if(!n){n=[!0,new Set],Fe.set(t,n);const s=()=>{n[0]=!1};t.then(s,s)}n[1].add(e)}function je(t){return typeof(t==null?void 0:t.then)=="function"}function mn(t,e,n){if(!n.p.has(t)){n.p.add(t);const s=()=>n.p.delete(t);e.then(s,s)}}function Sn(t,e,n){var s;const i=new Set;for(const r of((s=n.get(t))==null?void 0:s.t)||[])i.add(r);for(const r of e.p)i.add(r);return i}const Ds=(t,e,...n)=>e.read(...n),Ts=(t,e,...n)=>e.write(...n),ks=(t,e)=>{if(e.INTERNAL_onInit)return e.INTERNAL_onInit(t);if(e.unstable_onInit)return console.warn("[DEPRECATED] atom.unstable_onInit is renamed to atom.INTERNAL_onInit."),e.unstable_onInit(t)},$s=(t,e,n)=>{var s;return(s=e.onMount)==null?void 0:s.call(e,n)},Fs=(t,e)=>{var n;const s=z(t),i=s[0],r=s[6],o=s[9];if((oe?"production":void 0)!=="production"&&!e)throw new Error("Atom is undefined or null");let a=i.get(e);return a||(a={d:new Map,p:new Set,n:0},i.set(e,a),(n=r.i)==null||n.call(r,e),o==null||o(t,e)),a},js=t=>{const e=z(t),n=e[1],s=e[3],i=e[4],r=e[5],o=e[6],a=e[13],l=[],c=f=>{try{f()}catch(u){l.push(u)}};do{o.f&&c(o.f);const f=new Set,u=f.add.bind(f);s.forEach(g=>{var d;return(d=n.get(g))==null?void 0:d.l.forEach(u)}),s.clear(),r.forEach(u),r.clear(),i.forEach(u),i.clear(),f.forEach(c),s.size&&a(t)}while(s.size||r.size||i.size);if(l.length)throw new AggregateError(l)},Vs=t=>{const e=z(t),n=e[1],s=e[2],i=e[3],r=e[11],o=e[14],a=e[17],l=[],c=new WeakSet,f=new WeakSet,u=Array.from(i);for(;u.length;){const g=u[u.length-1],d=r(t,g);if(f.has(g)){u.pop();continue}if(c.has(g)){if(s.get(g)===d.n)l.push([g,d]);else if((oe?"production":void 0)!=="production"&&s.has(g))throw new Error("[Bug] invalidated atom exists");f.add(g),u.pop();continue}c.add(g);for(const h of Sn(g,d,n))c.has(h)||u.push(h)}for(let g=l.length-1;g>=0;--g){const[d,h]=l[g];let S=!1;for(const L of h.d.keys())if(L!==d&&i.has(L)){S=!0;break}S&&(o(t,d),a(t,d)),s.delete(d)}},gt=new WeakSet,Ms=(t,e)=>{var n,s;const i=z(t),r=i[1],o=i[2],a=i[3],l=i[6],c=i[7],f=i[11],u=i[12],g=i[13],d=i[14],h=i[16],S=i[17],L=i[20],O=f(t,e);if(Jt(O)){if(r.has(e)&&o.get(e)!==O.n)return O;let m=!1;for(const[x,A]of O.d)if(d(t,x).n!==A){m=!0;break}if(!m)return O}O.d.clear();let p=!0;function _(){r.has(e)&&(S(t,e),g(t),u(t))}function N(m){var x;if(m===e){const C=f(t,m);if(!Jt(C))if(gn(m))L(t,m,m.init);else throw new Error("no atom init");return $e(C)}const A=d(t,m);try{return $e(A)}finally{O.d.set(m,A.n),pn(O.v)&&mn(e,O.v,A),r.has(e)&&((x=r.get(m))==null||x.t.add(e)),p||_()}}let b,D;const k={get signal(){return b||(b=new AbortController),b.signal},get setSelf(){return(oe?"production":void 0)!=="production"&&!dt(e)&&console.warn("setSelf function cannot be used with read-only atom"),!D&&dt(e)&&(D=(...m)=>{if((oe?"production":void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)try{return h(t,e,...m)}finally{g(t),u(t)}}),D}},P=O.n;try{(oe?"production":void 0)!=="production"&>.delete(t);const m=c(t,e,N,k);return(oe?"production":void 0)!=="production"&>.has(t)&&console.warn("Detected store mutation during atom read. This is not supported."),L(t,e,m),je(m)&&(ht(m,()=>b==null?void 0:b.abort()),m.then(_,_)),(n=l.r)==null||n.call(l,e),O}catch(m){return delete O.v,O.e=m,++O.n,O}finally{p=!1,P!==O.n&&o.get(e)===P&&(o.set(e,O.n),a.add(e),(s=l.c)==null||s.call(l,e))}},Bs=(t,e)=>{const n=z(t),s=n[1],i=n[2],r=n[11],o=[e];for(;o.length;){const a=o.pop(),l=r(t,a);for(const c of Sn(a,l,s)){const f=r(t,c);i.set(c,f.n),o.push(c)}}},Us=(t,e,...n)=>{const s=z(t),i=s[3],r=s[6],o=s[8],a=s[11],l=s[12],c=s[13],f=s[14],u=s[15],g=s[16],d=s[17],h=s[20];let S=!0;const L=p=>$e(f(t,p)),O=(p,..._)=>{var N;const b=a(t,p);try{if(p===e){if(!gn(p))throw new Error("atom not writable");(oe?"production":void 0)!=="production"&>.add(t);const D=b.n,k=_[0];h(t,p,k),d(t,p),D!==b.n&&(i.add(p),u(t,p),(N=r.c)==null||N.call(r,p));return}else return g(t,p,..._)}finally{S||(c(t),l(t))}};try{return o(t,e,L,O,...n)}finally{S=!1}},Ks=(t,e)=>{var n;const s=z(t),i=s[1],r=s[3],o=s[6],a=s[11],l=s[15],c=s[18],f=s[19],u=a(t,e),g=i.get(e);if(g&&!pn(u.v)){for(const[d,h]of u.d)if(!g.d.has(d)){const S=a(t,d);c(t,d).t.add(e),g.d.add(d),h!==S.n&&(r.add(d),l(t,d),(n=o.c)==null||n.call(o,d))}for(const d of g.d)if(!u.d.has(d)){g.d.delete(d);const h=f(t,d);h==null||h.t.delete(e)}}},Hs=(t,e)=>{var n;const s=z(t),i=s[1],r=s[4],o=s[6],a=s[10],l=s[11],c=s[12],f=s[13],u=s[14],g=s[16],d=s[18],h=l(t,e);let S=i.get(e);if(!S){u(t,e);for(const L of h.d.keys())d(t,L).t.add(e);if(S={l:new Set,d:new Set(h.d.keys()),t:new Set},i.set(e,S),dt(e)){const L=()=>{let O=!0;const p=(..._)=>{try{return g(t,e,..._)}finally{O||(f(t),c(t))}};try{const _=a(t,e,p);_&&(S.u=()=>{O=!0;try{_()}finally{O=!1}})}finally{O=!1}};r.add(L)}(n=o.m)==null||n.call(o,e)}return S},Ws=(t,e)=>{var n,s;const i=z(t),r=i[1],o=i[5],a=i[6],l=i[11],c=i[19],f=l(t,e);let u=r.get(e);if(!u||u.l.size)return u;let g=!1;for(const d of u.t)if((n=r.get(d))!=null&&n.d.has(e)){g=!0;break}if(!g){u.u&&o.add(u.u),u=void 0,r.delete(e);for(const d of f.d.keys()){const h=c(t,d);h==null||h.t.delete(e)}(s=a.u)==null||s.call(a,e);return}return u},zs=(t,e,n)=>{const s=z(t)[11],i=s(t,e),r="v"in i,o=i.v;if(je(n))for(const a of i.d.keys())mn(e,n,s(t,a));i.v=n,delete i.e,(!r||!Object.is(o,i.v))&&(++i.n,je(o)&&As(o))},Js=(t,e)=>{const n=z(t)[14];return $e(n(t,e))},Gs=(t,e,...n)=>{const s=z(t),i=s[12],r=s[13],o=s[16];try{return o(t,e,...n)}finally{r(t),i(t)}},qs=(t,e,n)=>{const s=z(t),i=s[12],r=s[18],o=s[19],l=r(t,e).l;return l.add(n),i(t),()=>{l.delete(n),o(t,e),i(t)}},yn=new WeakMap,z=t=>{const e=yn.get(t);if((oe?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");return e};function Ys(...t){const e={get(s){const i=z(e)[21];return i(e,s)},set(s,...i){const r=z(e)[22];return r(e,s,...i)},sub(s,i){const r=z(e)[23];return r(e,s,i)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Ds,Ts,ks,$s,Fs,js,Vs,Ms,Bs,Us,Ks,Hs,Ws,zs,Js,Gs,qs,void 0].map((s,i)=>t[i]||s);return yn.set(e,Object.freeze(n)),e}const bn={};let Qs=0;function Oi(t,e){const n=`atom${++Qs}`,s={toString(){return(bn?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?s.read=t:(s.init=t,s.read=Xs,s.write=Zs),e&&(s.write=e),s}function Xs(t){return t(this)}function Zs(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function ei(){return Ys()}let be;function ti(){return be||(be=ei(),(bn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=be),globalThis.__JOTAI_DEFAULT_STORE__!==be&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),be}const ni={},si=v.createContext(void 0);function On(t){return v.useContext(si)||ti()}const pt=t=>typeof(t==null?void 0:t.then)=="function",mt=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},ii=Le.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(mt(t),t)}),Qe=new WeakMap,Gt=(t,e)=>{let n=Qe.get(t);return n||(n=new Promise((s,i)=>{let r=t;const o=c=>f=>{r===c&&s(f)},a=c=>f=>{r===c&&i(f)},l=()=>{try{const c=e();pt(c)?(Qe.set(c,n),r=c,c.then(o(c),a(c)),ht(c,l)):s(c)}catch(c){i(c)}};t.then(o(t),a(t)),ht(t,l)}),Qe.set(t,n)),n};function ri(t,e){const{delay:n,unstable_promiseStatus:s=!Le.use}={},i=On(),[[r,o,a],l]=v.useReducer(f=>{const u=i.get(t);return Object.is(f[0],u)&&f[1]===i&&f[2]===t?f:[u,i,t]},void 0,()=>[i.get(t),i,t]);let c=r;if((o!==i||a!==t)&&(l(),c=i.get(t)),v.useEffect(()=>{const f=i.sub(t,()=>{if(s)try{const u=i.get(t);pt(u)&&mt(Gt(u,()=>i.get(t)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),f},[i,t,n,s]),v.useDebugValue(c),pt(c)){const f=Gt(c,()=>i.get(t));return s&&mt(f),ii(f)}return c}function oi(t,e){const n=On();return v.useCallback((...i)=>{if((ni?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function vi(t,e){return[ri(t),oi(t)]}const ai=()=>{},li=ai(),St=Object,qt=t=>t===li,ci=t=>typeof t=="function",Pe=new WeakMap,ui=t=>St.prototype.toString.call(t),Xe=(t,e)=>t===`[object ${e}]`;let fi=0;const yt=t=>{const e=typeof t,n=ui(t),s=Xe(n,"Date"),i=Xe(n,"RegExp"),r=Xe(n,"Object");let o,a;if(St(t)===t&&!s&&!i){if(o=Pe.get(t),o)return o;if(o=++fi+"~",Pe.set(t,o),Array.isArray(t)){for(o="@",a=0;a<t.length;a++)o+=yt(t[a])+",";Pe.set(t,o)}if(r){o="#";const l=St.keys(t).sort();for(;!qt(a=l.pop());)qt(t[a])||(o+=a+":"+yt(t[a])+",");Pe.set(t,o)}}else o=s?t.toJSON():e=="symbol"?t.toString():e=="string"?JSON.stringify(t):""+t;return o},di=t=>{if(ci(t))try{t=t()}catch{t=""}const e=t;return t=typeof t=="string"?t:(Array.isArray(t)?t.length:t)?yt(t):"",[t,e]},hi=t=>di(t?t(0,null):null)[0],Ze=Promise.resolve(),gi=t=>(e,n,s)=>{const i=v.useRef(!1),{cache:r,initialSize:o=1,revalidateAll:a=!1,persistSize:l=!1,revalidateFirstPage:c=!0,revalidateOnMount:f=!1,parallel:u=!1}=s,[,,,g]=te.get(Me);let d;try{d=hi(e),d&&(d=fn+d)}catch{}const[h,S,L]=le(r,d),O=v.useCallback(()=>E(h()._l)?o:h()._l,[r,d,o]);Ie.useSyncExternalStore(v.useCallback(P=>d?L(d,()=>{P()}):()=>{},[r,d]),O,O);const p=v.useCallback(()=>{const P=h()._l;return E(P)?o:P},[d,o]),_=v.useRef(p());xe(()=>{if(!i.current){i.current=!0;return}d&&S({_l:l?_.current:p()})},[d,r]);const N=f&&!i.current,b=t(d,async P=>{const m=h()._i,x=h()._r;S({_r:U});const A=[],C=p(),[R]=le(r,P),y=R().data,I=[];let $=null;for(let T=0;T<C;++T){const[W,J]=Re(e(T,u?null:$));if(!W)break;const[ce,K]=le(r,W);let j=ce().data;const G=a||m||E(j)||c&&!T&&!E(y)||N||y&&!E(y[T])&&!s.compare(y[T],j);if(n&&(typeof x=="function"?x(j,J):G)){const ee=async()=>{if(!(W in g))j=await n(J);else{const he=g[W];delete g[W],j=await he}K({data:j,_k:J}),A[T]=j};u?I.push(ee):await ee()}else A[T]=j;u||($=j)}return u&&await Promise.all(I.map(T=>T())),S({_i:U}),A},s),D=v.useCallback(function(P,m){const x=typeof m=="boolean"?{revalidate:m}:m||{},A=x.revalidate!==!1;return d?(A&&(E(P)?S({_i:!0,_r:x.revalidate}):S({_i:!1,_r:x.revalidate})),arguments.length?b.mutate(P,{...x,revalidate:A}):b.mutate()):Ze},[d,r]),k=v.useCallback(P=>{if(!d)return Ze;const[,m]=le(r,d);let x;if(X(P)?x=P(p()):typeof P=="number"&&(x=P),typeof x!="number")return Ze;m({_l:x}),_.current=x;const A=[],[C]=le(r,d);let R=null;for(let y=0;y<x;++y){const[I]=Re(e(y,R)),[$]=le(r,I),T=I?$().data:U;if(E(T))return D(C().data);A.push(T),R=T}return D(A)},[d,r,D,p]);return{size:p(),setSize:k,mutate:D,get data(){return b.data},get error(){return b.error},get isValidating(){return b.isValidating},get isLoading(){return b.isLoading}}},xi=Ns(Is,gi);export{bi as S,Oi as a,ri as b,Si as c,oi as d,Is as e,Rs as f,vi as g,xi as h,Y as i,yi as u};
|