@oneworks/client 0.1.0-beta.0 → 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/assets/{ActionSearchToolbar-8q-bk3mu.js → ActionSearchToolbar-DEGf2jhC.js} +1 -1
  2. package/dist/assets/{AgentRoomRoute-DfSI_dFH.js → AgentRoomRoute-q3zS46Sd.js} +1 -1
  3. package/dist/assets/{AgentRoomSessionRoute-DH9PdjZm.js → AgentRoomSessionRoute-DjPxv7X5.js} +1 -1
  4. package/dist/assets/{ArchiveRoute-E9-htB4H.js → ArchiveRoute-CLIn3VrK.js} +1 -1
  5. package/dist/assets/{AuthenticatedApp-CgBrvMuc.js → AuthenticatedApp-CjqSg3Fe.js} +192 -192
  6. package/dist/assets/{AutomationRoute-Bw2xw5bx.js → AutomationRoute-BUkrePKH.js} +1 -1
  7. package/dist/assets/{BenchmarkRoute-3VS17jHr.js → BenchmarkRoute-CuO0hJBU.js} +1 -1
  8. package/dist/assets/{ChatRoute-CBQ3j4Je.js → ChatRoute-Du5zkaQU.js} +1 -1
  9. package/dist/assets/{Collapse-B-oCiEx4.js → Collapse-v6rPK_Og.js} +1 -1
  10. package/dist/assets/{ComposerLanding-SZn_zRGX.js → ComposerLanding-Yr0ydPHI.js} +1 -1
  11. package/dist/assets/{ConfigRoute-Dv-7BRGG.js → ConfigRoute-C3uzNXG_.js} +1 -1
  12. package/dist/assets/{InteractionStructureRoute-FDl9jRvT.js → InteractionStructureRoute-Db6Csunn.js} +1 -1
  13. package/dist/assets/{KnowledgeRoute-C5em_VSL.js → KnowledgeRoute-qqkXU5WL.js} +1 -1
  14. package/dist/assets/{LauncherApp-olYmK_zO.js → LauncherApp-Qvdl-Yj8.js} +2 -2
  15. package/dist/assets/{LauncherRoute-Qt8dQkIk.js → LauncherRoute-DZWkoiJw.js} +1 -1
  16. package/dist/assets/{MobileAwareSelect-BmK6WApn.js → MobileAwareSelect-C3a67aGF.js} +1 -1
  17. package/dist/assets/{ModuleManagementRoute-B1I_8JKc.js → ModuleManagementRoute-Cy4wuohf.js} +1 -1
  18. package/dist/assets/{NotFoundRoute-Bj6_YY3I.js → NotFoundRoute-ChcyVvqJ.js} +1 -1
  19. package/dist/assets/{PluginStoreRoute-B847PAZ5.js → PluginStoreRoute-DdiK4aa2.js} +1 -1
  20. package/dist/assets/{RouteContainerPanelTabs-BnIptVwq.js → RouteContainerPanelTabs-jxh2d8jI.js} +1 -1
  21. package/dist/assets/{SchemaObjectEditor-B9fPfDyT.js → SchemaObjectEditor-COAQ7p3E.js} +1 -1
  22. package/dist/assets/{StandaloneMobileDebugRoute-BR4w_LeM.js → StandaloneMobileDebugRoute-CB3AJiyj.js} +1 -1
  23. package/dist/assets/StandaloneMobileDebugRoute-Cz0tNyI6.css +1 -0
  24. package/dist/assets/{WorkspaceApp-BNmtIdn4.js → WorkspaceApp-CokR7Tpr.js} +3 -3
  25. package/dist/assets/{agent-room-session-paths-Dca8S6NN.js → agent-room-session-paths-CDJw-DoF.js} +3 -3
  26. package/dist/assets/{arc-JBUpUV6M.js → arc-f6ab2s7J.js} +1 -1
  27. package/dist/assets/{blockDiagram-c4efeb88-DKhNwgEQ.js → blockDiagram-c4efeb88-DuND8Id_.js} +1 -1
  28. package/dist/assets/{c4Diagram-c83219d4-CWODEGms.js → c4Diagram-c83219d4-CrENVa9z.js} +1 -1
  29. package/dist/assets/channel-CE7hI28G.js +1 -0
  30. package/dist/assets/{classDiagram-beda092f-DlghsOqF.js → classDiagram-beda092f-DLPG6RB7.js} +1 -1
  31. package/dist/assets/{classDiagram-v2-2358418a-CrSR8gWz.js → classDiagram-v2-2358418a-BKv3EDtT.js} +1 -1
  32. package/dist/assets/client-build-info-tgdsIlyX.js +1 -0
  33. package/dist/assets/clone-Ddl6jS9o.js +1 -0
  34. package/dist/assets/{createText-1719965b-CLlPr73k.js → createText-1719965b-NwleWdyg.js} +1 -1
  35. package/dist/assets/{cssMode-Bt_74RVV.js → cssMode-ww9pyNNv.js} +1 -1
  36. package/dist/assets/{dockPanelConstants-BWuu_DJp.js → dockPanelConstants-CW3M3t4v.js} +1 -1
  37. package/dist/assets/{edges-96097737-L_gy1fky.js → edges-96097737-D8fX9hn5.js} +1 -1
  38. package/dist/assets/{erDiagram-0228fc6a-X1QMD6me.js → erDiagram-0228fc6a-HDOuPZk2.js} +1 -1
  39. package/dist/assets/{flowDb-c6c81e3f-DNdWK0Po.js → flowDb-c6c81e3f-CnExuc5d.js} +1 -1
  40. package/dist/assets/{flowDiagram-50d868cf-C2khStgw.js → flowDiagram-50d868cf-DZV01cOD.js} +1 -1
  41. package/dist/assets/flowDiagram-v2-4f6560a1-Tygi-b2q.js +1 -0
  42. package/dist/assets/{flowchart-elk-definition-6af322e1-C89sxd2D.js → flowchart-elk-definition-6af322e1-rMtb8Q3Q.js} +1 -1
  43. package/dist/assets/{freemarker2-DZ1XIuHj.js → freemarker2-CtQwsBbf.js} +1 -1
  44. package/dist/assets/{ganttDiagram-a2739b55-Ba3rPNKd.js → ganttDiagram-a2739b55-BPZWVVUB.js} +1 -1
  45. package/dist/assets/{gitGraphDiagram-82fe8481-DTEFHHtN.js → gitGraphDiagram-82fe8481-DF7pLuMJ.js} +1 -1
  46. package/dist/assets/{graph-BPujwFoF.js → graph-DKmOtEDg.js} +1 -1
  47. package/dist/assets/{handlebars-lOgsnnQw.js → handlebars-nX8yIw3l.js} +1 -1
  48. package/dist/assets/{html-DLHadu9L.js → html-CbuZuRXh.js} +1 -1
  49. package/dist/assets/{htmlMode-VeiQ-IsQ.js → htmlMode-CJH80z5n.js} +1 -1
  50. package/dist/assets/{index-5325376f-Cx2RM6pk.js → index-5325376f-DEHuhQF_.js} +1 -1
  51. package/dist/assets/{index-DBUG8CzV.js → index-CPxqxItX.js} +1 -1
  52. package/dist/assets/{index-sFqkb8xv.js → index-CqhgNUy-.js} +1 -1
  53. package/dist/assets/{index-CJEVYkL9.js → index-DOj3DlsY.js} +1 -1
  54. package/dist/assets/{index-Cp4GfHnF.js → index-DgZk1SFp.js} +27 -27
  55. package/dist/assets/{index-CBFCjoHv.js → index-DnQoX9ZY.js} +1 -1
  56. package/dist/assets/{index-D4eelxQF.js → index-JwN0oF3c.js} +1 -1
  57. package/dist/assets/{index-CWmEuVWV.js → index-aZ1QdVqZ.js} +1 -1
  58. package/dist/assets/{infoDiagram-8eee0895-Bj9hWnDg.js → infoDiagram-8eee0895-CZD8lkRQ.js} +1 -1
  59. package/dist/assets/interaction-panel-mobile-debug-pages-Bu5Kh4-Z.css +1 -0
  60. package/dist/assets/interaction-panel-mobile-debug-pages-CT5eb8Gd.js +171 -0
  61. package/dist/assets/{javascript-CXJw-bvU.js → javascript-CxKLYDBQ.js} +1 -1
  62. package/dist/assets/{journeyDiagram-c64418c1-BXAycrrn.js → journeyDiagram-c64418c1-BMaEeakR.js} +1 -1
  63. package/dist/assets/{jsonMode-DmUNJfpX.js → jsonMode-DIC-5Lwr.js} +1 -1
  64. package/dist/assets/{layout-Bp8GVMnq.js → layout-Q0dn6j1W.js} +1 -1
  65. package/dist/assets/{line-olpPNgnh.js → line-BqB1JWak.js} +1 -1
  66. package/dist/assets/{linear-flh_7ux_.js → linear-VTwyGoCc.js} +1 -1
  67. package/dist/assets/{liquid-BiVpRgBP.js → liquid-DNvVNW0k.js} +1 -1
  68. package/dist/assets/{lspLanguageFeatures-olWF83eX.js → lspLanguageFeatures-DeOzllRF.js} +1 -1
  69. package/dist/assets/{mdx-B5dr7YB-.js → mdx-C98MqvlS.js} +1 -1
  70. package/dist/assets/{mermaid.core-NVIiXnRA.js → mermaid.core-DBYO3wup.js} +4 -4
  71. package/dist/assets/{mindmap-definition-8da855dc-BOCh8K8K.js → mindmap-definition-8da855dc-D9C_cL3R.js} +1 -1
  72. package/dist/assets/{pieDiagram-a8764435-CCitKBQK.js → pieDiagram-a8764435-FVnh07ga.js} +1 -1
  73. package/dist/assets/{project-file-tree-icons-DqqhgvoI.js → project-file-tree-icons-Iz30jDs3.js} +1 -1
  74. package/dist/assets/{python-BkEOPIle.js → python-Emg9kCcG.js} +1 -1
  75. package/dist/assets/{quadrantDiagram-1e28029f-C_FvcHzZ.js → quadrantDiagram-1e28029f-DKEnlnQE.js} +1 -1
  76. package/dist/assets/{razor-BCMQgdis.js → razor-BebYpuFx.js} +1 -1
  77. package/dist/assets/{requirementDiagram-08caed73-B001ugYd.js → requirementDiagram-08caed73-BHVdwyn8.js} +1 -1
  78. package/dist/assets/{route-plugin-chrome-B-Goj3vG.js → route-plugin-chrome-DI32l8cC.js} +1 -1
  79. package/dist/assets/{sankeyDiagram-a04cb91d-BnkC9YW5.js → sankeyDiagram-a04cb91d-COhhpvg5.js} +1 -1
  80. package/dist/assets/{sequenceDiagram-c5b8d532-BGiFCs5z.js → sequenceDiagram-c5b8d532-CfjihR0y.js} +1 -1
  81. package/dist/assets/{shortcutUtils-20iqPDwh.js → shortcutUtils-HFKOHIG8.js} +1 -1
  82. package/dist/assets/{stateDiagram-1ecb1508-Uk4XxTkP.js → stateDiagram-1ecb1508-BjgwBAXi.js} +1 -1
  83. package/dist/assets/{stateDiagram-v2-c2b004d7-Db6Ouywh.js → stateDiagram-v2-c2b004d7-D3w7Spww.js} +1 -1
  84. package/dist/assets/{styles-b4e223ce-CfG45yIm.js → styles-b4e223ce-BOAkdyMQ.js} +1 -1
  85. package/dist/assets/{styles-ca3715f6-BGGbMvKc.js → styles-ca3715f6-CcZFkBde.js} +1 -1
  86. package/dist/assets/{styles-d45a18b0-mHteeqS2.js → styles-d45a18b0-HXDBEoho.js} +1 -1
  87. package/dist/assets/{svgDrawCommon-b86b1483-BAMR2PsF.js → svgDrawCommon-b86b1483-CyvFXNjU.js} +1 -1
  88. package/dist/assets/{timeline-definition-faaaa080-DLBoPuJD.js → timeline-definition-faaaa080-CKFw-bXV.js} +1 -1
  89. package/dist/assets/{tsMode-BTzZ8Zos.js → tsMode-B7ZLt3D7.js} +1 -1
  90. package/dist/assets/{typescript-_rLmAd51.js → typescript-BI4b07nJ.js} +1 -1
  91. package/dist/assets/{use-app-preferences-gyulV-hA.js → use-app-preferences-BZCemhY7.js} +1 -1
  92. package/dist/assets/{use-chat-session-actions-DDZ5KCua.js → use-chat-session-actions-BNmm_R8s.js} +1 -1
  93. package/dist/assets/{vendor-state-BYwEPTaO.js → vendor-state-Djj0Jjxr.js} +1 -1
  94. package/dist/assets/{workspace-file-openers-BwZ5cSeq.js → workspace-file-openers-yFyhcWXX.js} +1 -1
  95. package/dist/assets/{xml-BAU8TJ-c.js → xml--qVpqb-2.js} +1 -1
  96. package/dist/assets/{xychartDiagram-f5964ef8-CNfcxTsi.js → xychartDiagram-f5964ef8-v75Tkx5A.js} +1 -1
  97. package/dist/assets/{yaml-_cphTIn0.js → yaml-CkA7Z41y.js} +1 -1
  98. package/dist/index.html +2 -2
  99. package/package.json +17 -17
  100. package/dist/assets/StandaloneMobileDebugRoute-DuOLjUb9.css +0 -1
  101. package/dist/assets/channel-BsuHYNQO.js +0 -1
  102. package/dist/assets/client-build-info-bcijLdfD.js +0 -1
  103. package/dist/assets/clone-BKV6leIk.js +0 -1
  104. package/dist/assets/flowDiagram-v2-4f6560a1-DW5hyUju.js +0 -1
  105. package/dist/assets/interaction-panel-mobile-debug-pages-1Gdivksn.js +0 -113
  106. package/dist/assets/interaction-panel-mobile-debug-pages-8AAd4Csf.css +0 -1
@@ -1 +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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};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={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},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__:"58ff704dc300bb08c207e357a9ff2d5740d9730a",__ONEWORKS_PROJECT_CLIENT_VERSION__:"0.1.0-beta.0",__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"&&gt.delete(t);const m=c(t,e,N,k);return(oe?"production":void 0)!=="production"&&gt.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"&&gt.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};
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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};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={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},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__:"5e0dbbb3851f616836aceeacc575d72fc42ccab6",__ONEWORKS_PROJECT_CLIENT_VERSION__:"0.1.0-beta.2",__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"&&gt.delete(t);const m=c(t,e,N,k);return(oe?"production":void 0)!=="production"&&gt.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"&&gt.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};