@runfusion/fusion 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/bin.js +7431 -2240
- package/dist/client/.vite/manifest.json +1118 -331
- package/dist/client/assets/AgentDetailView-CgbB51Iw.css +1 -0
- package/dist/client/assets/AgentDetailView-D1cA9Bfj.js +18 -0
- package/dist/client/assets/{AgentPermissionPolicyEditor--YS4iMUY.js → AgentPermissionPolicyEditor-DE0wv8-L.js} +2 -2
- package/dist/client/assets/AgentsView-Bm_FA_1w.js +29 -0
- package/dist/client/assets/AgentsView-CzMa5Olf.css +1 -0
- package/dist/client/assets/ChatView-BtjkE0V7.css +1 -0
- package/dist/client/assets/ChatView-CHEkov6q.js +19 -0
- package/dist/client/assets/CommandCenter-Cfgek-dC.js +71 -0
- package/dist/client/assets/CommandCenter-DDjpYkPe.css +1 -0
- package/dist/client/assets/DevServerView-DgDksVH2.css +1 -0
- package/dist/client/assets/DevServerView-_or2KLVw.js +1 -0
- package/dist/client/assets/DirectoryPicker-etVwa-6X.js +1 -0
- package/dist/client/assets/DocumentsView-e8ZTdPIZ.js +1 -0
- package/dist/client/assets/EvalsView-CTbgPUne.css +1 -0
- package/dist/client/assets/EvalsView-CjDRQFMQ.js +1 -0
- package/dist/client/assets/ExperimentalAgentOnboardingModal-3ZEFv8sr.css +1 -0
- package/dist/client/assets/ExperimentalAgentOnboardingModal-DXR0OAsR.js +1 -0
- package/dist/client/assets/GoalsView-CUh8JBnJ.css +1 -0
- package/dist/client/assets/GoalsView-WWDKVslN.js +2 -0
- package/dist/client/assets/InsightsView-C7yRTMPn.css +1 -0
- package/dist/client/assets/InsightsView-DxIfxOzx.js +11 -0
- package/dist/client/assets/MemoryView-BVW2hkWf.js +2 -0
- package/dist/client/assets/MemoryView-CBDUr2Jy.css +1 -0
- package/dist/client/assets/PiExtensionsManager-CpSfMok2.js +11 -0
- package/dist/client/assets/PluginManager-CpBCy656.js +1 -0
- package/dist/client/assets/PullRequestView-BMspX1ga.js +6 -0
- package/dist/client/assets/PullRequestView-CpdE3Yo_.css +1 -0
- package/dist/client/assets/ResearchView--YEtcv_s.js +1 -0
- package/dist/client/assets/ResearchView-DIVNQF4_.css +1 -0
- package/dist/client/assets/SecretsView-CC6QDMWN.js +1 -0
- package/dist/client/assets/SecretsView-CvFioX7R.css +1 -0
- package/dist/client/assets/SessionTerminal-D4R3ScvQ.css +1 -0
- package/dist/client/assets/SessionTerminal-DJGtgIls.js +2 -0
- package/dist/client/assets/SettingsModal-4d_p8D7W.js +1 -0
- package/dist/client/assets/SettingsModal-BESN59Ao.css +1 -0
- package/dist/client/assets/SettingsModal-ino68pI2.css +1 -0
- package/dist/client/assets/SettingsModal-wABa7xmZ.js +21 -0
- package/dist/client/assets/SetupWizardModal-DHe2tXzx.js +2 -0
- package/dist/client/assets/ShadcnColorPicker-HX3j1v66.js +11 -0
- package/dist/client/assets/ShadcnColorPicker-pqVWCC5-.css +1 -0
- package/dist/client/assets/SkillsView-CJ8snrma.css +1 -0
- package/dist/client/assets/SkillsView-mdFVTX-r.js +1 -0
- package/dist/client/assets/TodoView-CIsL_uvQ.css +1 -0
- package/dist/client/assets/TodoView-DQVugDpW.js +6 -0
- package/dist/client/assets/WorkflowNodeEditor-CeERQHHu.js +8 -0
- package/dist/client/assets/WorkflowNodeEditor-f_XPV5Jd.css +1 -0
- package/dist/client/assets/{addon-fit-SnYDEvGm.js → addon-fit-C1WQXRvu.js} +1 -1
- package/dist/client/assets/{addon-unicode11-s5GoZCpi.js → addon-unicode11-BVmNDUBM.js} +1 -1
- package/dist/client/assets/{addon-web-links-jjt2f_oV.js → addon-web-links-CkVew5xs.js} +1 -1
- package/dist/client/assets/{addon-webgl-Icn-RnEx.js → addon-webgl-uLc0RKcC.js} +1 -1
- package/dist/client/assets/agentSkills-C2v1wbxh.js +1 -0
- package/dist/client/assets/{ExperimentalAgentOnboardingModal-CZ_jbgep.css → agentSkills-bQJ4X1gH.css} +1 -1
- package/dist/client/assets/agentsOrgChartLayout-BMvyuaLA.js +1 -0
- package/dist/client/assets/app-BJGkp7Tt.js +13 -0
- package/dist/client/assets/app-BKLUvvm8.js +13 -0
- package/dist/client/assets/app-BaoNC9zg.js +13 -0
- package/dist/client/assets/app-CZQ_fFNf.js +13 -0
- package/dist/client/assets/app-DAu3AzsS.js +13 -0
- package/dist/client/assets/app-DgezOJub.js +13 -0
- package/dist/client/assets/arc-cxkkNsnK.js +1 -0
- package/dist/client/assets/architectureDiagram-3BPJPVTR-CGEhhgX_.js +36 -0
- package/dist/client/assets/band-CquvqAHh.js +1 -0
- package/dist/client/assets/blockDiagram-GPEHLZMM-D0DTo0HT.js +132 -0
- package/dist/client/assets/c4Diagram-AAUBKEIU-DNykNaRb.js +10 -0
- package/dist/client/assets/channel-Dwf1FoGU.js +1 -0
- package/dist/client/assets/chunk-2J33WTMH-5oQfAhmr.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-BqLZXgFw.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-C1oIjX3T.js +1 -0
- package/dist/client/assets/chunk-727SXJPM-BaovQTgk.js +206 -0
- package/dist/client/assets/chunk-AQP2D5EJ-B4ikBK42.js +231 -0
- package/dist/client/assets/chunk-FMBD7UC4-5zgtNnG2.js +15 -0
- package/dist/client/assets/chunk-ND2GUHAM-ByrypRna.js +1 -0
- package/dist/client/assets/chunk-QZHKN3VN-B7D1exsu.js +1 -0
- package/dist/client/assets/classDiagram-4FO5ZUOK-WqSUwcK_.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-WqSUwcK_.js +1 -0
- package/dist/client/assets/common-BDp2y6CF.js +1 -0
- package/dist/client/assets/common-BnEo5fLN.js +1 -0
- package/dist/client/assets/common-Bzr_Y8h4.js +1 -0
- package/dist/client/assets/common-CvwyFzfv.js +1 -0
- package/dist/client/assets/common-CztCXRkz.js +1 -0
- package/dist/client/assets/common-DPe2mbb7.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-CQmiNzGr.js +1 -0
- package/dist/client/assets/cytoscape.esm-OyMbaexL.js +331 -0
- package/dist/client/assets/dagre-BM42HDAG-BH8Uk0Up.js +4 -0
- package/dist/client/assets/{dashboard-view-B4LXCv5H.js → dashboard-view-CWJ-b59n.js} +1680 -1620
- package/dist/client/assets/dashboard-view-D3PWY2PH.js +1 -0
- package/dist/client/assets/dashboard-view-D_zsA-kz.css +1 -0
- package/dist/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/client/assets/diagram-2AECGRRQ-CDoHfkxY.js +43 -0
- package/dist/client/assets/diagram-5GNKFQAL-DARILCuD.js +10 -0
- package/dist/client/assets/diagram-KO2AKTUF-CNP-qi0y.js +3 -0
- package/dist/client/assets/diagram-LMA3HP47-SCiVmkcf.js +24 -0
- package/dist/client/assets/diagram-OG6HWLK6-iTJLXH61.js +24 -0
- package/dist/client/assets/erDiagram-TEJ5UH35-ByMpiPIa.js +85 -0
- package/dist/client/assets/flowDiagram-I6XJVG4X-DW3m3ZpM.js +162 -0
- package/dist/client/assets/{folder-open-33WGVnbp.js → folder-open-G-9vPAdv.js} +1 -1
- package/dist/client/assets/ganttDiagram-6RSMTGT7-BJeYH7Ol.js +292 -0
- package/dist/client/assets/gitGraphDiagram-PVQCEYII-CK_Chj4m.js +106 -0
- package/dist/client/assets/graph--OzhPTMs.js +1 -0
- package/dist/client/assets/index-BZBQ_KsL.css +1 -0
- package/dist/client/assets/index-ccFe_1av.js +1459 -0
- package/dist/client/assets/infoDiagram-5YYISTIA-D8Wg1IgN.js +2 -0
- package/dist/client/assets/init-Dmth1JHB.js +1 -0
- package/dist/client/assets/ishikawaDiagram-YF4QCWOH-DWROR2aX.js +70 -0
- package/dist/client/assets/journeyDiagram-JHISSGLW-Bns9774_.js +139 -0
- package/dist/client/assets/kanban-definition-UN3LZRKU-QtURfAoI.js +89 -0
- package/dist/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/client/assets/layout-SsrduOYp.js +1 -0
- package/dist/client/assets/linear-dXivciGL.js +1 -0
- package/dist/client/assets/mermaid.core-DqgrgWWm.js +309 -0
- package/dist/client/assets/mindmap-definition-RKZ34NQL-jLaDb5_X.js +96 -0
- package/dist/client/assets/ordinal-DILIJJjt.js +1 -0
- package/dist/client/assets/pieDiagram-4H26LBE5-CjbHuIje.js +30 -0
- package/dist/client/assets/quadrantDiagram-W4KKPZXB-xgHbylQr.js +7 -0
- package/dist/client/assets/requirementDiagram-4Y6WPE33-CHdD7W41.js +84 -0
- package/dist/client/assets/sankeyDiagram-5OEKKPKP-C3me87g9.js +40 -0
- package/dist/client/assets/sequenceDiagram-3UESZ5HK-DSHfs1kU.js +162 -0
- package/dist/client/assets/{shield-alert-CqeGWBUK.js → shield-alert-DkGlhVjI.js} +1 -1
- package/dist/client/assets/stateDiagram-AJRCARHV-C08n7sMP.js +1 -0
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BosoAbfO.js +1 -0
- package/dist/client/assets/step-yuy0qJer.js +1 -0
- package/dist/client/assets/time-DoDTxsna.js +1 -0
- package/dist/client/assets/timeline-definition-PNZ67QCA-C21h9Zqh.js +120 -0
- package/dist/client/assets/{upload-C11J2diI.js → upload-B9B-tYt9.js} +1 -1
- package/dist/client/assets/{users-a-ELbyyZ.js → users-C_BA3C7E.js} +1 -1
- package/dist/client/assets/{vendor-i18n-DYlSUfot.js → vendor-i18n-GF3RlKbq.js} +2 -2
- package/dist/client/assets/{vendor-react-BTgM5bbZ.js → vendor-react-SZ_qB27O.js} +1 -1
- package/dist/client/assets/vendor-reactflow-Bg-Qjzh8.js +15 -0
- package/dist/client/assets/{vendor-xterm-ea7-K05z.js → vendor-xterm-BNq00GSj.js} +1 -1
- package/dist/client/assets/vennDiagram-CIIHVFJN-Bv3G0dwI.js +34 -0
- package/dist/client/assets/wardley-L42UT6IY-WX0hHKcN.js +173 -0
- package/dist/client/assets/wardleyDiagram-YWT4CUSO-CMwIPWm7.js +78 -0
- package/dist/client/assets/xychartDiagram-2RQKCTM6-CZvFdt6j.js +7 -0
- package/dist/client/assets/zoom-out-NWbVkreR.js +41 -0
- package/dist/client/index.html +30 -10
- package/dist/client/sw.js +1 -1
- package/dist/client/theme-data.css +3082 -206
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/index.ts +56 -40
- package/dist/droid-cli/package.json +1 -1
- package/dist/droid-cli/src/__tests__/index.test.ts +47 -21
- package/dist/droid-cli/src/__tests__/process-manager.test.ts +50 -33
- package/dist/extension.js +5405 -919
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/pi-claude-cli/src/__tests__/process-manager.test.ts +25 -0
- package/dist/pi-claude-cli/src/process-manager.ts +11 -1
- package/dist/plugin-sdk/index.d.ts +137 -4
- package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
- package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
- package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +68 -44
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/package.json +1 -1
- package/dist/plugins/fusion-plugin-roadmap/bundled.js +5 -11
- package/dist/plugins/fusion-plugin-roadmap/manifest.json +1 -11
- package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
- package/package.json +3 -3
- package/skill/fusion/SKILL.md +1 -1
- package/skill/fusion/references/cli-commands.md +2 -1
- package/skill/fusion/references/extension-tools.md +10 -0
- package/skill/fusion/references/fusion-capabilities.md +3 -1
- package/dist/client/assets/AgentDetailView-CanIeYHg.css +0 -1
- package/dist/client/assets/AgentDetailView-DxV8pFHX.js +0 -18
- package/dist/client/assets/AgentsView-BVILQjdS.css +0 -1
- package/dist/client/assets/AgentsView-CTzbcvhK.js +0 -29
- package/dist/client/assets/ChatView-COygcnyk.js +0 -6
- package/dist/client/assets/ChatView-DwJAd5G1.css +0 -1
- package/dist/client/assets/CommandCenter-CTaopaC0.css +0 -1
- package/dist/client/assets/CommandCenter-DoKX2HWm.js +0 -56
- package/dist/client/assets/DevServerView-Cyevyvqx.js +0 -1
- package/dist/client/assets/DevServerView-VTQY28P7.css +0 -1
- package/dist/client/assets/DirectoryPicker-DBdyXEhR.js +0 -1
- package/dist/client/assets/DocumentsView-BzSMyrns.js +0 -1
- package/dist/client/assets/DocumentsView-WfVoTZt8.css +0 -1
- package/dist/client/assets/EvalsView-CUNJ1TLc.css +0 -1
- package/dist/client/assets/EvalsView-ikz00o9g.js +0 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-D-rzCCET.js +0 -499
- package/dist/client/assets/GoalsView-Bfu1Oy2-.js +0 -2
- package/dist/client/assets/GoalsView-rg9VSIza.css +0 -1
- package/dist/client/assets/InsightsView-Cgmf5nES.js +0 -11
- package/dist/client/assets/InsightsView-LMv1M1dU.css +0 -1
- package/dist/client/assets/MemoryView-DkEuDKQs.js +0 -2
- package/dist/client/assets/MemoryView-zaXewZzi.css +0 -1
- package/dist/client/assets/NodesView-7VInxyf_.css +0 -1
- package/dist/client/assets/NodesView-B_KYfS4o.js +0 -14
- package/dist/client/assets/PiExtensionsManager-Dz69kkKs.js +0 -11
- package/dist/client/assets/PluginManager-LHCVcduP.js +0 -1
- package/dist/client/assets/PullRequestView-3AdbS2a1.css +0 -1
- package/dist/client/assets/PullRequestView-DBJutLLl.js +0 -6
- package/dist/client/assets/ResearchView-DTh8FLUm.css +0 -1
- package/dist/client/assets/ResearchView-gpn1XcVy.js +0 -1
- package/dist/client/assets/SecretsView-B7YqIowt.js +0 -1
- package/dist/client/assets/SecretsView-Djo1rahi.css +0 -1
- package/dist/client/assets/SessionTerminal-9l4bdKcn.js +0 -2
- package/dist/client/assets/SessionTerminal-BNgtmXb3.css +0 -1
- package/dist/client/assets/SettingsModal-BGEK9_9A.js +0 -31
- package/dist/client/assets/SettingsModal-CKv0TJfM.css +0 -1
- package/dist/client/assets/SettingsModal-CXogw-Er.css +0 -1
- package/dist/client/assets/SettingsModal-DIIoHGUH.js +0 -1
- package/dist/client/assets/SetupWizardModal-BcVeMxeX.js +0 -1
- package/dist/client/assets/SetupWizardModal-CIqFbkrD.css +0 -1
- package/dist/client/assets/SkillsView-3bhGyWs1.css +0 -1
- package/dist/client/assets/SkillsView-BxSJ4PHL.js +0 -1
- package/dist/client/assets/StashRecoveryView-B_8WIQEo.css +0 -1
- package/dist/client/assets/StashRecoveryView-BhFQ2FsP.js +0 -1
- package/dist/client/assets/TodoView-7xIh-Fmi.css +0 -1
- package/dist/client/assets/TodoView-BZpewjy0.js +0 -6
- package/dist/client/assets/WorkflowNodeEditor-Yn1FRF2v.css +0 -1
- package/dist/client/assets/WorkflowNodeEditor-tWsgCdVt.js +0 -8
- package/dist/client/assets/app-BmGA0Hiz.js +0 -13
- package/dist/client/assets/app-CEVYlVuJ.js +0 -13
- package/dist/client/assets/app-CbBFax2C.js +0 -13
- package/dist/client/assets/app-DORKrGAz.js +0 -13
- package/dist/client/assets/app-DQibuQ9z.js +0 -13
- package/dist/client/assets/app-k76GrQP0.js +0 -13
- package/dist/client/assets/common-BRyX4VxB.js +0 -1
- package/dist/client/assets/common-CN9QPI2d.js +0 -1
- package/dist/client/assets/common-CNbjPELi.js +0 -1
- package/dist/client/assets/common-DFDqu_n0.js +0 -1
- package/dist/client/assets/common-DgWWKG8Z.js +0 -1
- package/dist/client/assets/common-X6PzBnVA.js +0 -1
- package/dist/client/assets/createLucideIcon-DmVITl5d.js +0 -21
- package/dist/client/assets/dashboard-view-BFoyhTYF.js +0 -3
- package/dist/client/assets/dashboard-view-Cxzm_eqc.js +0 -1
- package/dist/client/assets/dashboard-view-DdGlfuu-.css +0 -1
- package/dist/client/assets/dashboard-view-_8yfNwju.css +0 -1
- package/dist/client/assets/index-Bglw05rM.js +0 -791
- package/dist/client/assets/index-FYgnflWD.css +0 -1
- package/dist/client/assets/vendor-reactflow-ZasuEfF9.js +0 -15
- package/dist/client/assets/x-PItWc-wQ.js +0 -61
- package/dist/client/assets/zoom-out-CzlHv0Kj.js +0 -21
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{_ as o,E as pt,V as Rt,W as Ct,X as Wt,c as gt,l as E,K as Pt,P as Bt,Y as ft,D as Vt,$ as Ft,z as zt}from"./mermaid.core-DqgrgWWm.js";import{s as U}from"./vendor-reactflow-Bg-Qjzh8.js";import{d as ot}from"./arc-cxkkNsnK.js";import"./index-ccFe_1av.js";import"./vendor-react-SZ_qB27O.js";import"./vendor-i18n-GF3RlKbq.js";import"./vendor-xterm-BNq00GSj.js";import"./vendor-codemirror-jBKmHyH0.js";import"./step-yuy0qJer.js";var tt=(function(){var e=o(function(k,s,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=s);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],n=[1,12],i=[1,13],r=[1,14],h=[1,15],c=[1,16],a=[1,19],f=[1,20],g={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(s,d,l,p,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:p.setDirection("LR");break;case 4:p.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:p.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),p.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),p.getCommonDb().setAccDescription(this.$);break;case 15:p.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:p.addTask(u[v],0,""),this.$=u[v];break;case 19:p.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:n,15:i,17:r,19:h,20:c,21:17,22:18,23:a,24:f},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(s,d){if(d.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=d,l}},"parseError"),parse:o(function(s){var d=this,l=[0],p=[],x=[null],u=[],S=this.table,v="",I=0,R=0,W=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(s,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var X=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=p.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(p=A,A=p.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,C={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>W&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
|
+
`+w.showPosition()+`
|
|
3
|
+
Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,R=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],C.$=x[x.length-B],C._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},X&&(C._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(C,[v,R,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(C.$),u.push(C._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(s,d){return this.yy=d||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var d=s.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var d=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),d=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+d+"^"},"showPosition"),test_match:o(function(s,d){var l,p,x;if(this.options.backtrack_lexer&&(x={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(x.yylloc.range=this.yylloc.range.slice(0))),p=s[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,d,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var u in x)this[u]=x[u];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,d,l,p;this._more||(this.yytext="",this.match="");for(var x=this._currentRules(),u=0;u<x.length;u++)if(l=this._input.match(this.rules[x[u]]),l&&(!d||l[0].length>d[0].length)){if(d=l,p=u,this.options.backtrack_lexer){if(s=this.test_match(l,x[u]),s!==!1)return s;if(this._backtrack){d=!1;continue}else return!1}else if(!this.options.flex)break}return d?(s=this.test_match(d,x[p]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var d=this.next();return d||this.lex()},"lex"),begin:o(function(d){this.conditionStack.push(d)},"begin"),popState:o(function(){var d=this.conditionStack.length-1;return d>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(d){return d=this.conditionStack.length-1-Math.abs(d||0),d>=0?this.conditionStack[d]:"INITIAL"},"topState"),pushState:o(function(d){this.begin(d)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(d,l,p,x){switch(p){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin("acc_title"),15;case 10:return this.popState(),"acc_title_value";case 11:return this.begin("acc_descr"),17;case 12:return this.popState(),"acc_descr_value";case 13:this.begin("acc_descr_multiline");break;case 14:this.popState();break;case 15:return"acc_descr_multiline_value";case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}};return k})();g.lexer=m;function y(){this.yy={}}return o(y,"Parser"),y.prototype=g,g.Parser=y,new y})();tt.parser=tt;var Ot=tt,yt={};Vt(yt,{addEvent:()=>Tt,addSection:()=>_t,addTask:()=>Et,addTaskOrg:()=>$t,clear:()=>kt,default:()=>Gt,getCommonDb:()=>xt,getDirection:()=>bt,getSections:()=>wt,getTasks:()=>St,setDirection:()=>vt});var D="",mt=0,nt="LR",rt=[],q=[],K=[],xt=o(()=>Ft,"getCommonDb"),kt=o(function(){rt.length=0,q.length=0,D="",K.length=0,nt="LR",zt()},"clear"),vt=o(function(e){nt=e},"setDirection"),bt=o(function(){return nt},"getDirection"),_t=o(function(e){D=e,rt.push(e)},"addSection"),wt=o(function(){return rt},"getSections"),St=o(function(){let e=ct();const t=100;let n=0;for(;!e&&n<t;)e=ct(),n++;return q.push(...K),q},"getTasks"),Et=o(function(e,t,n){const i={id:mt++,section:D,type:D,task:e,score:t||0,events:n?[n]:[]};K.push(i)},"addTask"),Tt=o(function(e){K.find(n=>n.id===mt-1).events.push(e)},"addEvent"),$t=o(function(e){const t={section:D,type:D,description:e,task:e,classes:[]};q.push(t)},"addTaskOrg"),ct=o(function(){const e=o(function(n){return K[n].processed},"compileTask");let t=!0;for(const[n,i]of K.entries())e(n),t=t&&i.processed;return t},"compileTasks"),Gt={clear:kt,getCommonDb:xt,getDirection:bt,setDirection:vt,addSection:_t,getSections:wt,getTasks:St,addTask:Et,addTaskOrg:$t,addEvent:Tt},Nt=0,J=o(function(e,t){const n=e.append("rect");return n.attr("x",t.x),n.attr("y",t.y),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("width",t.width),n.attr("height",t.height),n.attr("rx",t.rx),n.attr("ry",t.ry),t.class!==void 0&&n.attr("class",t.class),n},"drawRect"),Dt=o(function(e,t){const i=e.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");r.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(f){const g=ot().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}o(h,"smile");function c(f){const g=ot().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",g).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}o(c,"sad");function a(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return o(a,"ambivalent"),t.score>3?h(r):t.score<3?c(r):a(r),i},"drawFace"),Kt=o(function(e,t){const n=e.append("circle");return n.attr("cx",t.cx),n.attr("cy",t.cy),n.attr("class","actor-"+t.pos),n.attr("fill",t.fill),n.attr("stroke",t.stroke),n.attr("r",t.r),n.class!==void 0&&n.attr("class",n.class),t.title!==void 0&&n.append("title").text(t.title),n},"drawCircle"),It=o(function(e,t){const n=t.text.replace(/<br\s*\/?>/gi," "),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.attr("class","legend"),i.style("text-anchor",t.anchor),t.class!==void 0&&i.attr("class",t.class);const r=i.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(n),i},"drawText"),Xt=o(function(e,t){function n(r,h,c,a,f){return r+","+h+" "+(r+c)+","+h+" "+(r+c)+","+(h+a-f)+" "+(r+c-f*1.2)+","+(h+a)+" "+r+","+(h+a)}o(n,"genPoints");const i=e.append("polygon");i.attr("points",n(t.x,t.y,50,20,7)),i.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,It(e,t)},"drawLabel"),Ut=o(function(e,t,n){const i=e.append("g"),r=st();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=n.width,r.height=n.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,J(i,r),Ht(n)(t.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},n,t.colour)},"drawSection"),et=-1,Zt=o(function(e,t,n,i){const r=t.x+n.width/2,h=e.append("g");et++,h.append("line").attr("id",i+"-task"+et).attr("x1",r).attr("y1",t.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dt(h,{cx:r,cy:300+(5-t.score)*30,score:t.score});const a=st();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=n.width,a.height=n.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,J(h,a),Ht(n)(t.task,h,a.x,a.y,a.width,a.height,{class:"task"},n,t.colour)},"drawTask"),jt=o(function(e,t){J(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),qt=o(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),st=o(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ht=(function(){function e(r,h,c,a,f,g,m,y){const k=h.append("text").attr("x",c+f/2).attr("y",a+g/2+5).style("font-color",y).style("text-anchor","middle").text(r);i(k,m)}o(e,"byText");function t(r,h,c,a,f,g,m,y,k){const{taskFontSize:s,taskFontFamily:d}=y,l=r.split(/<br\s*\/?>/gi);for(let p=0;p<l.length;p++){const x=p*s-s*(l.length-1)/2,u=h.append("text").attr("x",c+f/2).attr("y",a).attr("fill",k).style("text-anchor","middle").style("font-size",s).style("font-family",d);u.append("tspan").attr("x",c+f/2).attr("dy",x).text(l[p]),u.attr("y",a+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(u,m)}}o(t,"byTspan");function n(r,h,c,a,f,g,m,y){const k=h.append("switch"),d=k.append("foreignObject").attr("x",c).attr("y",a).attr("width",f).attr("height",g).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,k,c,a,f,g,m,y),i(d,m)}o(n,"byFo");function i(r,h){for(const c in h)c in h&&r.attr(c,h[c])}return o(i,"_setTextAttrs"),function(r){return r.textPlacement==="fo"?n:r.textPlacement==="old"?e:t}})(),Jt=o(function(e,t){Nt=0,et=-1,e.append("defs").append("marker").attr("id",t+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function it(e,t){e.each(function(){var n=U(this),i=n.text().split(/(\s+|<br>)/).reverse(),r,h=[],c=1.1,a=n.attr("y"),f=parseFloat(n.attr("dy")),g=n.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",f+"em");for(let m=0;m<i.length;m++)r=i[i.length-1-m],h.push(r),g.text(h.join(" ").trim()),(g.node().getComputedTextLength()>t||r==="<br>")&&(h.pop(),g.text(h.join(" ").trim()),r==="<br>"?h=[""]:h=[r],g=n.append("tspan").attr("x",0).attr("y",a).attr("dy",c+"em").text(r))})}o(it,"wrap");var Qt=o(function(e,t,n,i,r,h=!1){const{theme:c,look:a}=i,f=c?.includes("redux"),g=i?.themeVariables?.THEME_COLOR_LIMIT??12,m=n%g-1,y=e.append("g");t.section=m,y.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+m));const k=y.append("g"),s=y.append("g"),l=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),p=i.fontSize?.replace?i.fontSize.replace("px",""):i.fontSize;if(t.height=l.height+p*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,s.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),f&&s.attr("transform",`translate(${t.width/2}, ${h?t.padding/2+3:t.padding})`),te(k,t,m,r,i),a==="neo"&&(y.attr("data-look","neo"),f)){const x=c.includes("dark"),u=e.node()?.ownerSVGElement??e.node(),S=U(u),v=S.attr("id")??"",I=v?`${v}-drop-shadow`:"drop-shadow";if(S.select(`#${I}`).empty()){const R=S.select("defs");(R.empty()?S.append("defs"):R).append("filter").attr("id",I).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity",x?"0.2":"0.06").attr("flood-color",x?"#FFFFFF":"#000000")}}return t},"drawNode"),Yt=o(function(e,t,n){const i=e.append("g"),h=i.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(it,t.width).node().getBBox(),c=n.fontSize?.replace?n.fontSize.replace("px",""):n.fontSize;return i.remove(),h.height+c*1.1*.5+t.padding},"getVirtualNodeHeight"),te=o(function(e,t,n,i,r){const{theme:h}=r,c=h?.includes("redux")?0:5,a=5,f=c>0?`M0 ${t.height-a} v${-t.height+2*a} q0,-${c},${c},-${c} h${t.width-2*a} q${c},0,${c},${c} v${t.height-a} H0 Z`:`M0 ${t.height-a} v${-(t.height-a)} h${t.width} v${t.height} H0 Z`;e.append("path").attr("id",i+"-node-"+Nt++).attr("class","node-bkg node-"+t.type).attr("d",f),h?.includes("redux")||e.append("line").attr("class","node-line-"+n).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),M={drawRect:J,drawCircle:Kt,drawSection:Ut,drawText:It,drawLabel:Xt,drawTask:Zt,drawBackgroundRect:jt,getTextObj:qt,getNoteRect:st,initGraphics:Jt,drawNode:Qt,getVirtualNodeHeight:Yt},ee=o(function(e,t,n,i){const r=gt(),{look:h,theme:c,themeVariables:a}=r,{useGradient:f,gradientStart:g,gradientStop:m}=a,y=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const k=r.securityLevel;let s;k==="sandbox"&&(s=U("#i"+t));const l=(k==="sandbox"?U(s.nodes()[0].contentDocument.body):U("body")).select("#"+t);l.append("g");const p=i.db.getTasks(),x=i.db.getCommonDb().getDiagramTitle();E.debug("task",p),M.initGraphics(l,t);const u=i.db.getSections();E.debug("sections",u);let S=0,v=0,I=0,R=0,W=50+y,O=50;R=50;let L=0,w=!0;u.forEach(function(N){const b={number:L,descr:N,section:L,width:150,padding:20,maxHeight:S},_=M.getVirtualNodeHeight(l,b,r);E.debug("sectionHeight before draw",_),S=Math.max(S,_+20)});let H=0,V=0;E.debug("tasks.length",p.length);for(const[N,b]of p.entries()){const _={number:N,descr:b,section:b.section,width:150,padding:20,maxHeight:v},$=M.getVirtualNodeHeight(l,_,r);E.debug("taskHeight before draw",$),v=Math.max(v,$+20),H=Math.max(H,b.events.length);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:150,padding:20,maxHeight:50};T+=M.getVirtualNodeHeight(l,C,r)}b.events.length>0&&(T+=(b.events.length-1)*10),V=Math.max(V,T)}E.debug("maxSectionHeight before draw",S),E.debug("maxTaskHeight before draw",v),u&&u.length>0?u.forEach(N=>{const b=p.filter(P=>P.section===N),_={number:L,descr:N,section:L,width:200*Math.max(b.length,1)-50,padding:20,maxHeight:S};E.debug("sectionNode",_);const $=l.append("g"),T=M.drawNode($,_,L,r,t);E.debug("sectionNode output",T),$.attr("transform",`translate(${W}, ${R})`),O+=S+50,b.length>0&<(l,b,L,W,O,v,r,H,V,S,!1,t),W+=200*Math.max(b.length,1),O=R,L++}):(w=!1,lt(l,p,L,W,O,v,r,H,V,S,!0,t));const F=l.node().getBBox();if(E.debug("bounds",F),x&&l.append("text").text(x).attr("x",h==="neo"?F.x*2+y:F.width/2-y).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),I=w?S+v+150:v+100,l.append("g").attr("class","lineWrapper").append("line").attr("x1",y).attr("y1",I).attr("x2",F.width+3*y).attr("y2",I).attr("stroke-width",4).attr("stroke","black").attr("marker-end",`url(#${t}-arrowhead)`),h==="neo"&&f&&c!=="neutral"){const N=l.select("defs"),_=(N.empty()?l.append("defs"):N).append("linearGradient").attr("id",l.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");_.append("stop").attr("offset","0%").attr("stop-color",g).attr("stop-opacity",1),_.append("stop").attr("offset","100%").attr("stop-color",m).attr("stop-opacity",1)}ft(void 0,l,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),lt=o(function(e,t,n,i,r,h,c,a,f,g,m,y){for(const k of t){const s={descr:k.task,section:n,number:n,width:150,padding:20,maxHeight:h};E.debug("taskNode",s);const d=e.append("g").attr("class","taskWrapper"),p=M.drawNode(d,s,n,c,y).height;if(E.debug("taskHeight after draw",p),d.attr("transform",`translate(${i}, ${r})`),h=Math.max(h,p),k.events){const x=e.append("g").attr("class","lineWrapper");let u=h;r+=100,u=u+ne(e,k.events,n,i,r,c,y),r-=100,x.append("line").attr("x1",i+190/2).attr("y1",r+h).attr("x2",i+190/2).attr("y2",r+h+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end",`url(#${y}-arrowhead)`).attr("stroke-dasharray","5,5")}i=i+200,m&&!c.timeline?.disableMulticolor&&n++}r=r-10},"drawTasks"),ne=o(function(e,t,n,i,r,h,c){let a=0;const f=r;r=r+100;for(const g of t){const m={descr:g,section:n,number:n,width:150,padding:20,maxHeight:50};E.debug("eventNode",m);const y=e.append("g").attr("class","eventWrapper"),s=M.drawNode(y,m,n,h,c,!0).height;a=a+s,y.attr("transform",`translate(${i}, ${r})`),r=r+10+s}return r=f,a},"drawEvents"),re={setConf:o(()=>{},"setConf"),draw:ee},Q=200,z=5,se=Q+z*2,at=Q+100,ie=at+z*2,Lt=10,ae=0,ht=20,Mt=20,dt=30,At=50,oe=o(function(e,t,n,i){const r=gt(),h=r.timeline?.leftMargin??50;E.debug("timeline",i.db);const c=Pt(t);c.append("g");const a=i.db.getTasks(),f=i.db.getCommonDb().getDiagramTitle();E.debug("task",a),M.initGraphics(c);const g=i.db.getSections();E.debug("sections",g);let m=0,y=0;const k=50+h;let s=50;const d=s,l=k,p=se+Mt,x=ie+At,u=l+p;let S=0;const v=g&&g.length>0,I=v?u:k+p,R=Math.max(50,p+x-z*2);g.forEach(function(N){const b={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m},_=M.getVirtualNodeHeight(c,b,r);E.debug("sectionHeight before draw",_),m=Math.max(m,_)});let W=0;E.debug("tasks.length",a.length);for(const[N,b]of a.entries()){const _={number:N,descr:b,section:b.section,width:Q,padding:z,maxHeight:y},$=M.getVirtualNodeHeight(c,_,r);E.debug("taskHeight before draw",$),y=Math.max(y,$);let T=0;for(const P of b.events){const C={descr:P,section:b.section,number:b.section,width:at,padding:z,maxHeight:50};T+=M.getVirtualNodeHeight(c,C,r)}b.events.length>0&&(T+=(b.events.length-1)*Lt),W=Math.max(W,T)+ae}E.debug("maxSectionHeight before draw",m),E.debug("maxTaskHeight before draw",y);const L=Math.max(y,W)+dt;v?g.forEach(N=>{const b=a.filter(Z=>Z.section===N),_={number:S,descr:N,section:S,width:R,padding:z,maxHeight:m};E.debug("sectionNode",_);const $=c.append("g"),T=M.drawNode($,_,S,r);E.debug("sectionNode output",T);const P=I-p;$.attr("transform",`translate(${P}, ${s})`);const C=s+T.height+ht;b.length>0&&ut(c,b,S,I,C,y,r,L,!1);const G=b.length,B=T.height+ht+L*Math.max(G,1)-(G>0?dt*2:0);s+=B,S++}):ut(c,a,S,I,s,y,r,L,!0);let w=c.node()?.getBBox();if(!w)throw new Error("bbox not found");if(E.debug("bounds",w),f){if(c.append("text").text(f).attr("x",w.width/2-h).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),w=c.node()?.getBBox(),!w)throw new Error("bbox not found");E.debug("bounds after title",w)}const[H]=Bt(r.fontSize),V=(H??16)*2,F=(H??16)*.5+20,X=c.append("g").attr("class","lineWrapper");X.append("line").attr("x1",I).attr("y1",d-V).attr("x2",I).attr("y2",w.y+w.height+F).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),X.lower(),ft(void 0,c,r.timeline?.padding??50,r.timeline?.useMaxWidth??!1)},"draw"),ut=o(function(e,t,n,i,r,h,c,a,f){for(const g of t){const m={descr:g.task,section:n,number:n,width:Q,padding:z,maxHeight:h};E.debug("taskNode",m);const y=e.append("g").attr("class","taskWrapper"),k=M.drawNode(y,m,n,c),s=k.height;E.debug("taskHeight after draw",s);const d=i-Mt-k.width;if(y.attr("transform",`translate(${d}, ${r})`),h=Math.max(h,s),g.events&&g.events.length>0){const l=r,p=i+At;ce(e,g.events,n,i,p,l,c)}r=r+a,f&&!c.timeline?.disableMulticolor&&n++}},"drawTasks"),ce=o(function(e,t,n,i,r,h,c){let a=h;for(const f of t){const g={descr:f,section:n,number:n,width:at,padding:z,maxHeight:0};E.debug("eventNode",g);const m=e.append("g").attr("class","eventWrapper"),k=M.drawNode(m,g,n,c).height;m.attr("transform",`translate(${r}, ${a})`);const s=e.append("g").attr("class","lineWrapper"),d=a+k/2;s.append("line").attr("x1",i).attr("y1",d).attr("x2",r).attr("y2",d).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5"),a=a+k+Lt}return a-h},"drawEvents"),le={setConf:o(()=>{},"setConf"),draw:oe},he=o(e=>{const{theme:t}=pt(),n=t?.includes("dark"),i=t?.includes("color"),r=e.svgId?.replace(/^#/,"")??"",h=r?`url(#${r}-drop-shadow)`:e.dropShadow??"none";let c="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++){const f=`${17-3*a}`,g=i?e.borderColorArray[a]:e.mainBkg,m=i?e.borderColorArray[a]:e.nodeBorder;c+=`
|
|
7
|
+
.section-${a-1} rect,
|
|
8
|
+
.section-${a-1} path,
|
|
9
|
+
.section-${a-1} circle {
|
|
10
|
+
fill: ${n&&i?e.mainBkg:g};
|
|
11
|
+
stroke: ${m};
|
|
12
|
+
stroke-width: ${e.strokeWidth};
|
|
13
|
+
filter: ${h};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.section-${a-1} text {
|
|
17
|
+
fill: ${e.nodeBorder};
|
|
18
|
+
font-weight: ${e.fontWeight}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.node-icon-${a-1} {
|
|
22
|
+
font-size: 40px;
|
|
23
|
+
color: ${e["cScaleLabel"+a]};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.section-edge-${a-1} {
|
|
27
|
+
stroke: ${e["cScale"+a]};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edge-depth-${a-1} {
|
|
31
|
+
stroke-width: ${f};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.section-${a-1} line {
|
|
35
|
+
stroke: ${e["cScaleInv"+a]};
|
|
36
|
+
stroke-width: 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lineWrapper line {
|
|
40
|
+
stroke: ${e.nodeBorder};
|
|
41
|
+
stroke-width:${e.strokeWidth}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.disabled,
|
|
45
|
+
.disabled circle,
|
|
46
|
+
.disabled text {
|
|
47
|
+
fill: ${e.tertiaryColor??"lightgray"};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.disabled text {
|
|
51
|
+
fill: ${e.clusterBorder??"#efefef"};
|
|
52
|
+
}
|
|
53
|
+
`}return c},"genReduxSections"),de=o(e=>{let t="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],Rt(e["lineColor"+n])?e["lineColor"+n]=Ct(e["lineColor"+n],20):e["lineColor"+n]=Wt(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){const i=""+(17-3*n);t+=`
|
|
54
|
+
.section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {
|
|
55
|
+
fill: ${e["cScale"+n]};
|
|
56
|
+
}
|
|
57
|
+
.section-${n-1} text {
|
|
58
|
+
fill: ${e["cScaleLabel"+n]};
|
|
59
|
+
}
|
|
60
|
+
.node-icon-${n-1} {
|
|
61
|
+
font-size: 40px;
|
|
62
|
+
color: ${e["cScaleLabel"+n]};
|
|
63
|
+
}
|
|
64
|
+
.section-edge-${n-1}{
|
|
65
|
+
stroke: ${e["cScale"+n]};
|
|
66
|
+
}
|
|
67
|
+
.edge-depth-${n-1}{
|
|
68
|
+
stroke-width: ${i};
|
|
69
|
+
}
|
|
70
|
+
.section-${n-1} line {
|
|
71
|
+
stroke: ${e["cScaleInv"+n]} ;
|
|
72
|
+
stroke-width: 3;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.lineWrapper line{
|
|
76
|
+
stroke: ${e["cScaleLabel"+n]} ;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.disabled, .disabled circle, .disabled text {
|
|
80
|
+
fill: ${e.tertiaryColor??"lightgray"};
|
|
81
|
+
}
|
|
82
|
+
.disabled text {
|
|
83
|
+
fill: ${e.clusterBorder??"#efefef"};
|
|
84
|
+
}
|
|
85
|
+
`}return t},"genSections"),ue=o(e=>{const{theme:t}=pt(),n=t?.includes("redux"),i=t==="neutral",r=e.svgId?.replace(/^#/,"")??"";let h="";if(e.useGradient&&r&&e.THEME_COLOR_LIMIT&&!i)for(let c=0;c<e.THEME_COLOR_LIMIT;c++)h+=`
|
|
86
|
+
.section-${c-1}[data-look="neo"] rect,
|
|
87
|
+
.section-${c-1}[data-look="neo"] path,
|
|
88
|
+
.section-${c-1}[data-look="neo"] circle {
|
|
89
|
+
fill: ${e.mainBkg};
|
|
90
|
+
stroke: url(#${r}-gradient);
|
|
91
|
+
stroke-width: 2;
|
|
92
|
+
}
|
|
93
|
+
.section-${c-1}[data-look="neo"] line {
|
|
94
|
+
stroke: url(#${r}-gradient);
|
|
95
|
+
stroke-width: 2;
|
|
96
|
+
}`;return`
|
|
97
|
+
.edge {
|
|
98
|
+
stroke-width: 3;
|
|
99
|
+
}
|
|
100
|
+
${n?he(e):de(e)}
|
|
101
|
+
${h}
|
|
102
|
+
.section-root rect, .section-root path, .section-root circle {
|
|
103
|
+
fill: ${e.git0};
|
|
104
|
+
}
|
|
105
|
+
.section-root text {
|
|
106
|
+
fill: ${e.gitBranchLabel0};
|
|
107
|
+
}
|
|
108
|
+
.icon-container {
|
|
109
|
+
height:100%;
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
113
|
+
}
|
|
114
|
+
.edge {
|
|
115
|
+
fill: none;
|
|
116
|
+
}
|
|
117
|
+
.eventWrapper {
|
|
118
|
+
filter: brightness(120%);
|
|
119
|
+
}
|
|
120
|
+
`},"getStyles"),pe=ue,ge={setConf:o(()=>{},"setConf"),draw:o((e,t,n,i)=>(i?.db?.getDirection?.()??"LR")==="TD"?le.draw(e,t,n,i):re.draw(e,t,n,i),"draw")},Se={db:yt,renderer:ge,parser:Ot,styles:pe};export{Se as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as nt,r as O,a as it}from"./vendor-react-BTgM5bbZ.js";const x=i=>typeof i=="string",G=()=>{let i,e;const t=new Promise((s,n)=>{i=s,e=n});return t.resolve=i,t.reject=e,t},Ce=i=>i==null?"":String(i),rt=(i,e,t)=>{i.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Ee=i=>i&&i.includes("###")?i.replace(at,"."):i,Ne=i=>!i||x(i),ee=(i,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ne(i))return{};const r=Ee(s[n]);!i[r]&&t&&(i[r]=new t),Object.prototype.hasOwnProperty.call(i,r)?i=i[r]:i={},++n}return Ne(i)?{}:{obj:i,k:Ee(s[n])}},$e=(i,e,t)=>{const{obj:s,k:n}=ee(i,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=ee(i,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=ee(i,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},ot=(i,e,t,s)=>{const{obj:n,k:r}=ee(i,e,Object);n[r]=n[r]||[],n[r].push(t)},oe=(i,e)=>{const{obj:t,k:s}=ee(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(i,e,t)=>{const s=oe(i,t);return s!==void 0?s:oe(e,t)},Je=(i,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in i?x(i[s])||i[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(i[s]=e[s]):Je(i[s],e[s],t):i[s]=e[s]);return i},z=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ut={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},ct=i=>x(i)?i.replace(/[&<>"'\/]/g,e=>ut[e]):i;class ft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;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 dt=[" ",",","?","!",";"],ht=new ft(20),pt=(i,e,t)=>{e=e||"",t=t||"";const s=dt.filter(a=>!e.includes(a)&&!t.includes(a));if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!n.test(i);if(!r){const a=i.indexOf(t);a>0&&!n.test(i.substring(0,a))&&(r=!0)}return r},xe=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const s=e.split(t);let n=i;for(let r=0;r<s.length;){if(!n||typeof n!="object")return;let a,o="";for(let l=r;l<s.length;++l)if(l!==r&&(o+=t),o+=s[l],a=n[o],a!==void 0){if(["string","number","boolean"].includes(typeof a)&&l<s.length-1)continue;r+=l-r+1;break}n=a}return n},se=i=>i?.replace(/_/g,"-"),gt={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){console?.[i]?.apply?.(console,e)}};class le{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||gt,this.options=t,this.debug=t.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,t,s,n){return n&&!this.debug?null:(e=e.map(r=>x(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new le(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new le(this.logger,e)}}var M=new le;class ce{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(e,...t)})}}class ke extends ce{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):x(s)&&r?o.push(...s.split(r)):o.push(s)));const l=oe(this.data,o);return!l&&!t&&!s&&e.includes(".")&&(e=o[0],t=o[1],s=o.slice(2).join(".")),l||!a||!x(s)?l:xe(this.data?.[e]?.[t],s,r)}addResource(e,t,s,n,r={silent:!1}){const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.includes(".")&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),$e(this.data,o,n),r.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const r in s)(x(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),n=s,s=t,t=o[1]),this.addNamespaces(t);let l=oe(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Je(l,s,r):l={...l,...s},$e(this.data,o,l),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var qe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,s,n){return i.forEach(r=>{e=this.processors[r]?.process(e,t,s,n)??e}),e}};const Ye=Symbol("i18next/PATH_KEY");function mt(){const i=[],e=Object.create(null);let t;return e.get=(s,n)=>(t?.revoke?.(),n===Ye?i:(i.push(n),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function q(i,e){const{[Ye]:t}=i(mt()),s=e?.keySeparator??".",n=e?.nsSeparator??":",r=e?.enableSelector==="strict";if(t.length>1&&n){const a=e?.ns,o=r?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(o&&(r?o:o.length>1?o.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(s)}`}return t.join(s)}const de=i=>!x(i)&&typeof i!="boolean"&&typeof i!="number";class ue extends ce{constructor(e,t={}){super(),rt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=M.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if(n?.res===void 0)return!1;const r=de(n.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.includes(s),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!pt(e,s,n);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:x(r)?[r]:r};const u=e.split(s);(s!==n||s===n&&this.options.ns.includes(u[0]))&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:x(r)?[r]:r}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=q(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?q(L,{...this.options,...n}):String(L));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let f=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?r?{res:`${u}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${f}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:o;const g=this.resolve(e,n);let h=g?.res;const y=g?.usedKey||o,S=g?.exactUsedKey||o,R=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!x(n.count),C=ue.hasDefaultValue(n),A=v?this.pluralResolver.getSuffix(c,n.count,n):"",$=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",P=v&&!n.ordinal&&n.count===0,p=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${$}`]||n.defaultValue;let m=h;E&&!h&&C&&(m=p);const k=de(m),N=Object.prototype.toString.apply(m);if(E&&m&&k&&!R.includes(N)&&!(x(b)&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,m,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(g.res=L,g.usedParams=this.getUsedParamsDetails(n),g):L}if(a){const L=Array.isArray(m),w=L?[]:{},U=L?S:y;for(const j in m)if(Object.prototype.hasOwnProperty.call(m,j)){const I=`${U}${a}${j}`;C&&!h?w[j]=this.translate(I,{...n,defaultValue:de(p)?p[j]:void 0,joinArrays:!1,ns:l}):w[j]=this.translate(I,{...n,joinArrays:!1,ns:l}),w[j]===I&&(w[j]=m[j])}h=w}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let L=!1,w=!1;!this.isValidLookup(h)&&C&&(L=!0,h=p),this.isValidLookup(h)||(w=!0,h=o);const j=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,I=C&&p!==h&&this.options.updateMissing;if(w||L||I){if(this.logger.log(I?"updateKey":"missingKey",c,u,v&&!I?`${o}${this.pluralResolver.getSuffix(c,n.count,n)}`:o,I?p:h),a){const F=this.resolve(o,{...n,keySeparator:!1});F&&F.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 H=[];const T=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&T&&T[0])for(let F=0;F<T.length;F++)H.push(T[F]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const K=(F,_,J)=>{const Y=C&&J!==h?J:j;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,_,Y,I,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,u,_,Y,I,n),this.emit("missingKey",F,u,_,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?H.forEach(F=>{const _=this.pluralResolver.getSuffixes(F,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!_.includes(`${this.options.pluralSeparator}zero`)&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(J=>{K([F],o+J,n[`defaultValue${J}`]||p)})}):K(H,o,p))}h=this.extendTranslation(h,e,n,g,s),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${u}${f}${o}`),(w||L)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${o}`:o,L?h:void 0,n))}return r?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const l=x(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let f=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,s.lng||this.language||n.usedLng,s),l){const c=e.match(this.interpolator.nestingRegexp),d=c&&c.length;u<d&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...c)=>r?.[0]===c[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,o=x(a)?[a]:a;return e!=null&&o?.length&&s.applyPostProcessor!==!1&&(e=qe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,r,a,o;return x(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?q(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),f=u.key;n=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=t.count!==void 0&&!x(t.count),g=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(S=>{this.isValidLookup(s)||(o=S,!this.checkedLoadedFor[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),y.forEach(R=>{if(this.isValidLookup(s))return;a=R;const b=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,f,R,S,t);else{let v;d&&(v=this.pluralResolver.getSuffix(R,t.count,t));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&v.startsWith(A)&&b.push(f+v.replace(A,this.options.pluralSeparator)),b.push(f+v),g&&b.push(f+C)),h){const $=`${f}${this.options.contextSeparator||"_"}${t.context}`;b.push($),d&&(t.ordinal&&v.startsWith(A)&&b.push($+v.replace(A,this.options.pluralSeparator)),b.push($+v),g&&b.push($+C))}}let E;for(;E=b.pop();)this.isValidLookup(s)||(r=E,s=this.getResource(R,S,E,t))}))})}),{res:s,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M.create("languageUtils")}getScriptPartFromCode(e){if(e=se(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=se(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(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.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>a===r?!0:!a.includes("-")&&!r.includes("-")?!1:!!(a.includes("-")&&!r.includes("-")&&a.slice(0,a.indexOf("-"))===r||a.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.includes("-")||e.includes("_"))?(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))):x(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{n.includes(a)||r(this.formatLanguageCode(a))}),n}}const Pe={zero:0,one:1,two:2,few:3,many:4,other:5},Te={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class yt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=M.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=se(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Te;if(!e.match(/-|_/))return Te;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,r)=>Pe[n]-Pe[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(i,e,t,s=".",n=!0)=>{let r=lt(i,e,t);return!r&&n&&x(t)&&(r=xe(i,t,s),r===void 0&&(r=xe(e,t,s))),r},he=i=>i.replace(/\$/g,"$$$$");class Fe{constructor(e={}){this.logger=M.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:R,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?z(r):a||"{{",this.suffix=o?z(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c?z(c):"-",this.unescapeSuffix=this.unescapePrefix?"":f?z(f):"",this.nestingPrefix=d?z(d):g||z("$t("),this.nestingSuffix=h?z(h):y||z(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=R||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t?.source===s?(t.lastIndex=0,t):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,t,s,n){let r,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const R=Ae(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,s,{...n,...t,interpolationkey:g}):R}const h=g.split(this.formatSeparator),y=h.shift().trim(),S=h.join(this.formatSeparator).trim();return this.format(Ae(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...n,...t,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const f=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>he(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?he(this.escape(g)):he(g)}].forEach(g=>{for(o=0;r=g.regex.exec(e);){const h=r[1].trim();if(a=u(h),a===void 0)if(typeof f=="function"){const S=f(e,r,n);a=x(S)?S:""}else if(n&&Object.prototype.hasOwnProperty.call(n,h))a="";else if(c){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ce(a));const y=g.safeValue(a);if(e=e.replace(r[0],y),c?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=r[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,r,a;const o=(l,u)=>{const f=this.nestingOptionsSeparator;if(!l.includes(f))return l;const c=l.split(new RegExp(`${z(f)}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,a);const g=d.match(/'/g),h=d.match(/"/g);((g?.length??0)%2===0&&!h||(h?.length??0)%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(o.call(this,n[1].trim(),a),a),r&&n[0]===e&&!x(r))return r;x(r)||(r=Ce(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((f,c)=>this.format(f,c,s.lng,{...s,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const xt=i=>{let e=i.toLowerCase().trim();const t={};if(i.includes("(")){const s=i.split("(");e=s[0].toLowerCase().trim();const n=s[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=u),u==="false"&&(t[f]=!1),u==="true"&&(t[f]=!0),isNaN(u)||(t[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},je=i=>{const e={};return(t,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=i(se(s),n),e[a]=o),o(t)}},St=i=>(e,t,s)=>i(se(t),s)(e);class bt{constructor(e={}){this.logger=M.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?je:St;this.formats={number:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:s((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:s((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:s((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=je(t)}format(e,t,s,n={}){if(!t||e==null)return e;const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(o=>o.includes(")"))){const o=r.findIndex(l=>l.includes(")"));r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{const{formatName:u,formatOptions:f}=xt(l);if(this.formats[u]){let c=o;try{const d=n?.formatParams?.[n.interpolationkey]||{},g=d.locale||d.lng||n.locale||n.lng||s;c=this.formats[u](o,g,{...f,...n,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const vt=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class wt extends ce{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=M.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,n.backend,n)}queueLoad(e,t,s,n){const r={},a={},o={},l={};return e.forEach(u=>{let f=!0;t.forEach(c=>{const d=`${u}|${c}`;!s.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),r[d]===void 0&&(r[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),r=n[0],a=n[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(l=>{ot(l.loaded,[r],a),vt(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{o[u][c]===void 0&&(o[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s,n=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:r,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,s,n+1,r*2,a)},r);return}a(u,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const r=this.queueLoad(e,t,s,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],r=s[1];this.read(n,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,n,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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(this.backend?.create){const l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,t,s,n,l):f=u(e,t,s,n),f&&typeof f.then=="function"?f.then(c=>o(null,c)).catch(o):o(null,f)}catch(f){o(f)}else u(e,t,s,n,o,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),x(i[1])&&(e.defaultValue=i[1]),x(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ie=i=>(x(i.ns)&&(i.ns=[i.ns]),x(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),x(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&!i.supportedLngs.includes("cimode")&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i),ie=()=>{},Lt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class te extends ce{constructor(e={},t){if(super(),this.options=Ie(e),this.services={},this.logger=M,this.modules={external:[]},Lt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...Ie(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 n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?M.init(n(this.modules.logger),this.options):M.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=bt;const f=new Re(this.options);this.store=new ke(this.options.resources,this.options);const c=this.services;c.logger=M,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new yt(f,{prepend:this.options.pluralSeparator}),u&&(c.formatter=n(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fe(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new wt(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new ue(this.services,this.options),this.translator.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ie),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const o=G(),l=()=>{const u=(f,c)=>{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),o.resolve(c),t(f,c)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=ie){let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&(r.includes(u)||r.push(u))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const n=G();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ie),this.services.backendConnector.reload(e,t,r=>{n.resolve(),s(r)}),n}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"&&qe.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"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=G();this.emit("languageChanging",e);const n=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=x(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(x(o)?[o]:o);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,f=>{r(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s,n){const r=n?.scopeNs,a=(o,l,...u)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(u)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs;const c=f.ns!==void 0&&f.ns!==null;f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||s||a.keyPrefix);const d={...this.options,...f};Array.isArray(r)&&!c&&(d.ns=r),typeof f.keyPrefix=="function"&&(f.keyPrefix=q(f.keyPrefix,d));const g=this.options.keySeparator||".";let h;return f.keyPrefix&&Array.isArray(o)?h=o.map(y=>(typeof y=="function"&&(y=q(y,d)),`${f.keyPrefix}${g}${y}`)):(typeof o=="function"&&(o=q(o,d)),h=f.keyPrefix?`${f.keyPrefix}${g}${o}`:o),this.t(h,f)};return x(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(r,e)))}loadNamespaces(e,t){const s=G();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=G();x(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(a=>!n.includes(a)&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=n.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const n=new Intl.Locale(e);if(n&&n.getTextInfo){const r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["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=this.services?.languageUtils||new Re(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new te(e,t);return s.createInstance=te.createInstance,s}cloneInstance(e={},t=ie){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new te(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,c)=>(f[c]={...l[u][c]},f),l[u]),l),{});r.store=new ke(o,n),r.services.resourceStore=r.store}if(e.interpolation){const l={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new Fe(u)}return r.translator=new ue(r.services,n),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(n,t),r.translator.options=n,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 V=te.createInstance();V.createInstance;V.dir;V.init;V.loadResources;V.reloadResources;V.use;V.changeLanguage;V.getFixedT;V.t;V.exists;V.setDefaultNamespace;V.hasLoadedNamespace;V.loadNamespaces;V.loadLanguages;var ge,De;function Ot(){return De||(De=1,ge={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ge}var Ct=Ot();const Et=nt(Ct);var Nt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ve(i){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=i.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(e.name=t[1],(Et[t[1]]||i.charAt(i.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var s=i.indexOf("-->");return{type:"comment",comment:s!==-1?i.slice(4,s):""}}for(var n=new RegExp(Nt),r=null;(r=n.exec(i))!==null;)if(r[0].trim())if(r[1]){var a=r[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],n.lastIndex--}else r[2]&&(e.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return e}var $t=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,kt=/^\s*$/,Rt=Object.create(null);function Qe(i,e){switch(e.type){case"text":return i+e.content;case"tag":return i+="<"+e.name+(e.attrs?(function(t){var s=[];for(var n in t)s.push(n+'="'+t[n]+'"');return s.length?" "+s.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?i:i+e.children.reduce(Qe,"")+"</"+e.name+">";case"comment":return i+"<!--"+e.comment+"-->"}}var Pt={parse:function(i,e){e||(e={}),e.components||(e.components=Rt);var t,s=[],n=[],r=-1,a=!1;if(i.indexOf("<")!==0){var o=i.indexOf("<");s.push({type:"text",content:o===-1?i:i.substring(0,o)})}return i.replace($t,function(l,u){if(a){if(l!=="</"+t.name+">")return;a=!1}var f,c=l.charAt(1)!=="/",d=l.startsWith("<!--"),g=u+l.length,h=i.charAt(g);if(d){var y=Ve(l);return r<0?(s.push(y),s):((f=n[r]).children.push(y),s)}if(c&&(r++,(t=Ve(l)).type==="tag"&&e.components[t.name]&&(t.type="component",a=!0),t.voidElement||a||!h||h==="<"||t.children.push({type:"text",content:i.slice(g,i.indexOf("<",g))}),r===0&&s.push(t),(f=n[r-1])&&f.children.push(t),n[r]=t),(!c||t.voidElement)&&(r>-1&&(t.voidElement||t.name===l.slice(2,-1))&&(r--,t=r===-1?s:n[r]),!a&&h!=="<"&&h)){f=r===-1?s:n[r].children;var S=i.indexOf("<",g),R=i.slice(g,S===-1?void 0:S);kt.test(R)&&(R=" "),(S>-1&&r+f.length>=0||R!==" ")&&f.push({type:"text",content:R})}}),s},stringify:function(i){return i.reduce(function(e,t){return e+Qe("",t)},"")}};const re=(i,e,t,s)=>{const n=[t,{code:e,...s||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(n,"warn","react-i18next::",!0);D(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...n):console?.warn&&console.warn(...n)},Ue={},ne=(i,e,t,s)=>{D(t)&&Ue[t]||(D(t)&&(Ue[t]=new Date),re(i,e,t,s))},Ze=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Se=(i,e,t)=>{i.loadNamespaces(e,Ze(i,t))},Ke=(i,e,t,s)=>{if(D(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return Se(i,t,s);t.forEach(n=>{i.options.ns.indexOf(n)<0&&i.options.ns.push(n)}),i.loadLanguages(e,Ze(i,s))},Tt=(i,e,t={})=>!e.languages||!e.languages.length?(ne(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,i))return!1}}),D=i=>typeof i=="string",B=i=>typeof i=="object"&&i!==null,At=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ft={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},jt=i=>Ft[i],Ge=i=>i.replace(At,jt);let be={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ge,transDefaultProps:void 0};const It=(i={})=>{be={...be,...i}},we=()=>be;let Xe;const Dt=i=>{Xe=i},Le=()=>Xe,ae=(i,e)=>{if(!i)return!1;const t=i.props?.children??i.children;return e?t.length>0:!!t},X=i=>{if(!i)return[];const e=i.props?.children??i.children;return i.props?.i18nIsDynamicList?W(e):e},Vt=i=>Array.isArray(i)&&i.every(O.isValidElement),W=i=>Array.isArray(i)?i:[i],Ut=(i,e)=>{const t={...e};return t.props={...e.props,...i.props},t},Kt=i=>{const e={};if(!i)return e;const t=s=>{W(s).forEach(r=>{D(r)||(ae(r)?t(X(r)):B(r)&&!O.isValidElement(r)&&Object.assign(e,r))})};return t(i),e},ve=(i,e,t,s)=>{if(!i)return"";let n="";const r=W(i),a=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((o,l)=>{if(D(o)){n+=`${o}`;return}if(O.isValidElement(o)){const{props:u,type:f}=o,c=Object.keys(u).length,d=a.indexOf(f)>-1,g=u.children;if(!g&&d&&!c){n+=`<${f}/>`;return}if(!g&&(!d||c)||u.i18nIsDynamicList){n+=`<${l}></${l}>`;return}if(d&&c<=1){const y=D(g)?g:ve(g,e,t,s);n+=`<${f}>${y}</${f}>`;return}const h=ve(g,e,t,s);n+=`<${l}>${h}</${l}>`;return}if(o===null){re(t,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(B(o)){const{format:u,...f}=o,c=Object.keys(f);if(c.length===1){const d=u?`${c[0]}, ${u}`:c[0];n+=`{{${d}}}`;return}re(t,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:o});return}re(t,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:o})}),n},Ht=(i,e=[],t={})=>{if(!i)return i;const s=Object.keys(t),n=[...e,...s];let r="",a=0;for(;a<i.length;)if(i[a]==="<"){let o=!1;const l=i.slice(a).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(l){const u=l[1];(/^\d+$/.test(u)||n.includes(u))&&(o=!0,r+=l[0],a+=l[0].length)}if(!o){const u=i.slice(a).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const f=u[1];(/^\d+$/.test(f)||n.includes(f))&&(o=!0,r+=u[0],a+=u[0].length)}}o||(r+="<",a+=1)}else r+=i[a],a+=1;return r},Mt=(i,e,t,s,n,r,a)=>{if(t==="")return[];const o=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(b=>`<${b}`).join("|")).test(t);if(!i&&!e&&!l&&!a)return[t];const u=e??{},f=b=>{W(b).forEach(v=>{D(v)||(ae(v)?f(X(v)):B(v)&&!O.isValidElement(v)&&Object.assign(u,v))})};f(i);const c=Ht(t,o,u),d=Pt.parse(`<0>${c}</0>`),g={...u,...r},h=(b,E,v)=>{const C=X(b),A=S(C,E.children,v);return Vt(C)&&A.length===0||b.props?.i18nIsDynamicList?C:A},y=(b,E,v,C,A)=>{b.dummy?(b.children=E,v.push(O.cloneElement(b,{key:C},A?void 0:E))):v.push(...O.Children.map([b],$=>{if($.type===O.Fragment||$.props?.i18nIsDynamicList!==void 0){const p={key:C};return $&&$.props&&Object.keys($.props).forEach(m=>{m==="children"||m==="i18nIsDynamicList"||(p[m]=$.props[m])}),O.createElement($.type,p,A?null:E)}const P={key:C};return $&&$.props&&Object.keys($.props).forEach(p=>{p==="ref"||p==="children"||(P[p]=$.props[p])}),O.cloneElement($,P,A?null:E)}))},S=(b,E,v)=>{const C=W(b),A=W(E),$={};return A.reduce((P,p,m)=>{const k=p.children?.[0]?.content&&s.services.interpolator.interpolate(p.children[0].content,g,s.language);if(p.type==="tag"){let N=C[parseInt(p.name,10)];!N&&e&&(N=e[p.name]),v.length===1&&!N&&(N=v[0][p.name]),N||(N={});const L={...p.attrs};a&&Object.keys(L).forEach(T=>{const K=L[T];D(K)&&(L[T]=Ge(K))});const w=Object.keys(L).length!==0?Ut({props:L},N):N,U=O.isValidElement(w),j=U&&ae(p,!0)&&!p.voidElement,I=l&&B(w)&&w.dummy&&!U,H=B(e)&&Object.hasOwnProperty.call(e,p.name);if(D(w)){const T=s.services.interpolator.interpolate(w,g,s.language);P.push(T)}else if(ae(w)||j){const T=h(w,p,v);y(w,T,P,m)}else if(I){const T=S(C,p.children,v);y(w,T,P,m)}else if(Number.isNaN(parseFloat(p.name)))if(H){const T=h(w,p,v);y(w,T,P,m,p.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(p.name)>-1)if(p.voidElement)P.push(O.createElement(p.name,{key:`${p.name}-${m}`}));else{const T=$[p.name]||0;$[p.name]=T+1;let K,F=0;for(let Y=0;Y<C.length;Y+=1){const fe=C[Y];if(O.isValidElement(fe)&&fe.type===p.name){if(F===T){K=fe;break}F+=1}}const _=K?W(X(K)):C,J=S(_,p.children,v);P.push(O.createElement(p.name,{key:`${p.name}-${m}`},J))}else if(p.voidElement)P.push(`<${p.name} />`);else{const T=S(C,p.children,v);P.push(`<${p.name}>${T}</${p.name}>`)}else if(B(w)&&!U){const T=p.children[0]?k:null;T&&P.push(T)}else y(w,k,P,m,p.children.length!==1||!k)}else if(p.type==="text"){const N=n.transWrapTextNodes,L=typeof n.unescape=="function"?n.unescape:we().unescape,w=a?L(s.services.interpolator.interpolate(p.content,g,s.language)):s.services.interpolator.interpolate(p.content,g,s.language);N?P.push(O.createElement(N,{key:`${p.name}-${m}`},w)):P.push(w)}return P},[])},R=S([{dummy:!0,children:i||[]}],d,W(i||[]));return X(R[0])},et=(i,e,t)=>{const s=i.key||e,n=O.cloneElement(i,{key:s});if(!n.props||!n.props.children||t.indexOf(`${e}/>`)<0&&t.indexOf(`${e} />`)<0)return n;function r(){return O.createElement(O.Fragment,null,n)}return O.createElement(r,{key:s})},_t=(i,e)=>i.map((t,s)=>et(t,s,e)),zt=(i,e)=>{const t={};return Object.keys(i).forEach(s=>{Object.assign(t,{[s]:et(i[s],s,e)})}),t},Bt=(i,e,t,s)=>i?Array.isArray(i)?_t(i,e):B(i)?zt(i,e):(ne(t,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,Wt=i=>!B(i)||Array.isArray(i)?!1:Object.keys(i).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const h=f||Le();if(!h)return ne(h,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:s}),i;const y=c||h.t.bind(h)||(K=>K),S={...we(),...h.options?.react};let R=u||y.ns||h.options?.defaultNS;R=D(R)?[R]:R||["translation"];const{transDefaultProps:b}=S,E=b?.tOptions?{...b.tOptions,...r}:r,v=d??b?.shouldUnescape,C=b?.values?{...b.values,...a}:a,A=b?.components?{...b.components,...l}:l,$=ve(i,S,h,s),P=o||E?.defaultValue||$||S.transEmptyNodeValue||(typeof s=="function"?q(s):s),{hashTransKey:p}=S,m=s||(p?p($||P):$||P);h.options?.interpolation?.defaultVariables?a=C&&Object.keys(C).length>0?{...C,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables}:a=C;const k=Kt(i);k&&typeof k.count=="number"&&e===void 0&&(e=k.count);const N=a||e!==void 0&&!h.options?.interpolation?.alwaysFormat||!i?E.interpolation:{interpolation:{...E.interpolation,prefix:"#$?",suffix:"?$#"}},L={...E,context:n||E.context,count:e,...a,...N,defaultValue:P,ns:R};let w=m?y(m,L):P;w===m&&P&&(w=P);const U=Bt(A,w,h,s);let j=U||i,I=null;Wt(U)&&(I=U,j=i);const H=Mt(j,I,w,h,S,L,v),T=t??S.defaultTransParent;return T?O.createElement(T,g,H):H}const xs={type:"3rdParty",init(i){It(i.options.react),Dt(i)}},Oe=O.createContext();class qt{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Ss({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const{i18n:h,defaultNS:y}=O.useContext(Oe)||{},S=f||h||Le(),R=c||S?.t.bind(S);return Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r,values:a,defaults:o,components:l,ns:u||R?.ns||y||S?.options?.defaultNS,i18n:S,t:c,shouldUnescape:d,...g})}var me={exports:{}},ye={};/**
|
|
1
|
+
import{g as nt,r as O,a as it}from"./vendor-react-SZ_qB27O.js";const x=i=>typeof i=="string",G=()=>{let i,e;const t=new Promise((s,n)=>{i=s,e=n});return t.resolve=i,t.reject=e,t},Ce=i=>i==null?"":String(i),rt=(i,e,t)=>{i.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Ee=i=>i&&i.includes("###")?i.replace(at,"."):i,Ne=i=>!i||x(i),ee=(i,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ne(i))return{};const r=Ee(s[n]);!i[r]&&t&&(i[r]=new t),Object.prototype.hasOwnProperty.call(i,r)?i=i[r]:i={},++n}return Ne(i)?{}:{obj:i,k:Ee(s[n])}},$e=(i,e,t)=>{const{obj:s,k:n}=ee(i,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=ee(i,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=ee(i,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},ot=(i,e,t,s)=>{const{obj:n,k:r}=ee(i,e,Object);n[r]=n[r]||[],n[r].push(t)},oe=(i,e)=>{const{obj:t,k:s}=ee(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(i,e,t)=>{const s=oe(i,t);return s!==void 0?s:oe(e,t)},Je=(i,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in i?x(i[s])||i[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(i[s]=e[s]):Je(i[s],e[s],t):i[s]=e[s]);return i},z=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ut={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},ct=i=>x(i)?i.replace(/[&<>"'\/]/g,e=>ut[e]):i;class ft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;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 dt=[" ",",","?","!",";"],ht=new ft(20),pt=(i,e,t)=>{e=e||"",t=t||"";const s=dt.filter(a=>!e.includes(a)&&!t.includes(a));if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!n.test(i);if(!r){const a=i.indexOf(t);a>0&&!n.test(i.substring(0,a))&&(r=!0)}return r},xe=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const s=e.split(t);let n=i;for(let r=0;r<s.length;){if(!n||typeof n!="object")return;let a,o="";for(let l=r;l<s.length;++l)if(l!==r&&(o+=t),o+=s[l],a=n[o],a!==void 0){if(["string","number","boolean"].includes(typeof a)&&l<s.length-1)continue;r+=l-r+1;break}n=a}return n},se=i=>i?.replace(/_/g,"-"),gt={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){console?.[i]?.apply?.(console,e)}};class le{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||gt,this.options=t,this.debug=t.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,t,s,n){return n&&!this.debug?null:(e=e.map(r=>x(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new le(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new le(this.logger,e)}}var M=new le;class ce{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(e,...t)})}}class ke extends ce{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):x(s)&&r?o.push(...s.split(r)):o.push(s)));const l=oe(this.data,o);return!l&&!t&&!s&&e.includes(".")&&(e=o[0],t=o[1],s=o.slice(2).join(".")),l||!a||!x(s)?l:xe(this.data?.[e]?.[t],s,r)}addResource(e,t,s,n,r={silent:!1}){const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.includes(".")&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),$e(this.data,o,n),r.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const r in s)(x(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),n=s,s=t,t=o[1]),this.addNamespaces(t);let l=oe(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Je(l,s,r):l={...l,...s},$e(this.data,o,l),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var qe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,s,n){return i.forEach(r=>{e=this.processors[r]?.process(e,t,s,n)??e}),e}};const Ye=Symbol("i18next/PATH_KEY");function mt(){const i=[],e=Object.create(null);let t;return e.get=(s,n)=>(t?.revoke?.(),n===Ye?i:(i.push(n),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function q(i,e){const{[Ye]:t}=i(mt()),s=e?.keySeparator??".",n=e?.nsSeparator??":",r=e?.enableSelector==="strict";if(t.length>1&&n){const a=e?.ns,o=r?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(o&&(r?o:o.length>1?o.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(s)}`}return t.join(s)}const de=i=>!x(i)&&typeof i!="boolean"&&typeof i!="number";class ue extends ce{constructor(e,t={}){super(),rt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=M.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if(n?.res===void 0)return!1;const r=de(n.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.includes(s),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!pt(e,s,n);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:x(r)?[r]:r};const u=e.split(s);(s!==n||s===n&&this.options.ns.includes(u[0]))&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:x(r)?[r]:r}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=q(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?q(L,{...this.options,...n}):String(L));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let f=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?r?{res:`${u}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${f}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:o;const g=this.resolve(e,n);let h=g?.res;const y=g?.usedKey||o,S=g?.exactUsedKey||o,R=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!x(n.count),C=ue.hasDefaultValue(n),A=v?this.pluralResolver.getSuffix(c,n.count,n):"",$=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",P=v&&!n.ordinal&&n.count===0,p=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${$}`]||n.defaultValue;let m=h;E&&!h&&C&&(m=p);const k=de(m),N=Object.prototype.toString.apply(m);if(E&&m&&k&&!R.includes(N)&&!(x(b)&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,m,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(g.res=L,g.usedParams=this.getUsedParamsDetails(n),g):L}if(a){const L=Array.isArray(m),w=L?[]:{},U=L?S:y;for(const j in m)if(Object.prototype.hasOwnProperty.call(m,j)){const I=`${U}${a}${j}`;C&&!h?w[j]=this.translate(I,{...n,defaultValue:de(p)?p[j]:void 0,joinArrays:!1,ns:l}):w[j]=this.translate(I,{...n,joinArrays:!1,ns:l}),w[j]===I&&(w[j]=m[j])}h=w}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let L=!1,w=!1;!this.isValidLookup(h)&&C&&(L=!0,h=p),this.isValidLookup(h)||(w=!0,h=o);const j=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,I=C&&p!==h&&this.options.updateMissing;if(w||L||I){if(this.logger.log(I?"updateKey":"missingKey",c,u,v&&!I?`${o}${this.pluralResolver.getSuffix(c,n.count,n)}`:o,I?p:h),a){const F=this.resolve(o,{...n,keySeparator:!1});F&&F.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 H=[];const T=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&T&&T[0])for(let F=0;F<T.length;F++)H.push(T[F]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const K=(F,_,J)=>{const Y=C&&J!==h?J:j;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,_,Y,I,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,u,_,Y,I,n),this.emit("missingKey",F,u,_,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?H.forEach(F=>{const _=this.pluralResolver.getSuffixes(F,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!_.includes(`${this.options.pluralSeparator}zero`)&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(J=>{K([F],o+J,n[`defaultValue${J}`]||p)})}):K(H,o,p))}h=this.extendTranslation(h,e,n,g,s),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${u}${f}${o}`),(w||L)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${o}`:o,L?h:void 0,n))}return r?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const l=x(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let f=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,s.lng||this.language||n.usedLng,s),l){const c=e.match(this.interpolator.nestingRegexp),d=c&&c.length;u<d&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...c)=>r?.[0]===c[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,o=x(a)?[a]:a;return e!=null&&o?.length&&s.applyPostProcessor!==!1&&(e=qe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,r,a,o;return x(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?q(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),f=u.key;n=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=t.count!==void 0&&!x(t.count),g=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(S=>{this.isValidLookup(s)||(o=S,!this.checkedLoadedFor[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),y.forEach(R=>{if(this.isValidLookup(s))return;a=R;const b=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,f,R,S,t);else{let v;d&&(v=this.pluralResolver.getSuffix(R,t.count,t));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&v.startsWith(A)&&b.push(f+v.replace(A,this.options.pluralSeparator)),b.push(f+v),g&&b.push(f+C)),h){const $=`${f}${this.options.contextSeparator||"_"}${t.context}`;b.push($),d&&(t.ordinal&&v.startsWith(A)&&b.push($+v.replace(A,this.options.pluralSeparator)),b.push($+v),g&&b.push($+C))}}let E;for(;E=b.pop();)this.isValidLookup(s)||(r=E,s=this.getResource(R,S,E,t))}))})}),{res:s,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M.create("languageUtils")}getScriptPartFromCode(e){if(e=se(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=se(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(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.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>a===r?!0:!a.includes("-")&&!r.includes("-")?!1:!!(a.includes("-")&&!r.includes("-")&&a.slice(0,a.indexOf("-"))===r||a.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.includes("-")||e.includes("_"))?(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))):x(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{n.includes(a)||r(this.formatLanguageCode(a))}),n}}const Pe={zero:0,one:1,two:2,few:3,many:4,other:5},Te={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class yt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=M.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=se(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Te;if(!e.match(/-|_/))return Te;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,r)=>Pe[n]-Pe[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(i,e,t,s=".",n=!0)=>{let r=lt(i,e,t);return!r&&n&&x(t)&&(r=xe(i,t,s),r===void 0&&(r=xe(e,t,s))),r},he=i=>i.replace(/\$/g,"$$$$");class Fe{constructor(e={}){this.logger=M.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:R,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?z(r):a||"{{",this.suffix=o?z(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c?z(c):"-",this.unescapeSuffix=this.unescapePrefix?"":f?z(f):"",this.nestingPrefix=d?z(d):g||z("$t("),this.nestingSuffix=h?z(h):y||z(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=R||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t?.source===s?(t.lastIndex=0,t):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,t,s,n){let r,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const R=Ae(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,s,{...n,...t,interpolationkey:g}):R}const h=g.split(this.formatSeparator),y=h.shift().trim(),S=h.join(this.formatSeparator).trim();return this.format(Ae(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...n,...t,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const f=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>he(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?he(this.escape(g)):he(g)}].forEach(g=>{for(o=0;r=g.regex.exec(e);){const h=r[1].trim();if(a=u(h),a===void 0)if(typeof f=="function"){const S=f(e,r,n);a=x(S)?S:""}else if(n&&Object.prototype.hasOwnProperty.call(n,h))a="";else if(c){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ce(a));const y=g.safeValue(a);if(e=e.replace(r[0],y),c?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=r[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,r,a;const o=(l,u)=>{const f=this.nestingOptionsSeparator;if(!l.includes(f))return l;const c=l.split(new RegExp(`${z(f)}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,a);const g=d.match(/'/g),h=d.match(/"/g);((g?.length??0)%2===0&&!h||(h?.length??0)%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(o.call(this,n[1].trim(),a),a),r&&n[0]===e&&!x(r))return r;x(r)||(r=Ce(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((f,c)=>this.format(f,c,s.lng,{...s,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const xt=i=>{let e=i.toLowerCase().trim();const t={};if(i.includes("(")){const s=i.split("(");e=s[0].toLowerCase().trim();const n=s[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=u),u==="false"&&(t[f]=!1),u==="true"&&(t[f]=!0),isNaN(u)||(t[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},je=i=>{const e={};return(t,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=i(se(s),n),e[a]=o),o(t)}},St=i=>(e,t,s)=>i(se(t),s)(e);class bt{constructor(e={}){this.logger=M.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?je:St;this.formats={number:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:s((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:s((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:s((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=je(t)}format(e,t,s,n={}){if(!t||e==null)return e;const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(o=>o.includes(")"))){const o=r.findIndex(l=>l.includes(")"));r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{const{formatName:u,formatOptions:f}=xt(l);if(this.formats[u]){let c=o;try{const d=n?.formatParams?.[n.interpolationkey]||{},g=d.locale||d.lng||n.locale||n.lng||s;c=this.formats[u](o,g,{...f,...n,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const vt=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class wt extends ce{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=M.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,n.backend,n)}queueLoad(e,t,s,n){const r={},a={},o={},l={};return e.forEach(u=>{let f=!0;t.forEach(c=>{const d=`${u}|${c}`;!s.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),r[d]===void 0&&(r[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),r=n[0],a=n[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(l=>{ot(l.loaded,[r],a),vt(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{o[u][c]===void 0&&(o[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s,n=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:r,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,s,n+1,r*2,a)},r);return}a(u,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const r=this.queueLoad(e,t,s,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],r=s[1];this.read(n,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,n,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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(this.backend?.create){const l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,t,s,n,l):f=u(e,t,s,n),f&&typeof f.then=="function"?f.then(c=>o(null,c)).catch(o):o(null,f)}catch(f){o(f)}else u(e,t,s,n,o,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),x(i[1])&&(e.defaultValue=i[1]),x(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ie=i=>(x(i.ns)&&(i.ns=[i.ns]),x(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),x(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&!i.supportedLngs.includes("cimode")&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i),ie=()=>{},Lt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class te extends ce{constructor(e={},t){if(super(),this.options=Ie(e),this.services={},this.logger=M,this.modules={external:[]},Lt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...Ie(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 n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?M.init(n(this.modules.logger),this.options):M.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=bt;const f=new Re(this.options);this.store=new ke(this.options.resources,this.options);const c=this.services;c.logger=M,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new yt(f,{prepend:this.options.pluralSeparator}),u&&(c.formatter=n(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fe(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new wt(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new ue(this.services,this.options),this.translator.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ie),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const o=G(),l=()=>{const u=(f,c)=>{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),o.resolve(c),t(f,c)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=ie){let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&(r.includes(u)||r.push(u))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const n=G();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ie),this.services.backendConnector.reload(e,t,r=>{n.resolve(),s(r)}),n}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"&&qe.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"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=G();this.emit("languageChanging",e);const n=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=x(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(x(o)?[o]:o);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,f=>{r(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s,n){const r=n?.scopeNs,a=(o,l,...u)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(u)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs;const c=f.ns!==void 0&&f.ns!==null;f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||s||a.keyPrefix);const d={...this.options,...f};Array.isArray(r)&&!c&&(d.ns=r),typeof f.keyPrefix=="function"&&(f.keyPrefix=q(f.keyPrefix,d));const g=this.options.keySeparator||".";let h;return f.keyPrefix&&Array.isArray(o)?h=o.map(y=>(typeof y=="function"&&(y=q(y,d)),`${f.keyPrefix}${g}${y}`)):(typeof o=="function"&&(o=q(o,d)),h=f.keyPrefix?`${f.keyPrefix}${g}${o}`:o),this.t(h,f)};return x(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(r,e)))}loadNamespaces(e,t){const s=G();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=G();x(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(a=>!n.includes(a)&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=n.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const n=new Intl.Locale(e);if(n&&n.getTextInfo){const r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["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=this.services?.languageUtils||new Re(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new te(e,t);return s.createInstance=te.createInstance,s}cloneInstance(e={},t=ie){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new te(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,c)=>(f[c]={...l[u][c]},f),l[u]),l),{});r.store=new ke(o,n),r.services.resourceStore=r.store}if(e.interpolation){const l={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new Fe(u)}return r.translator=new ue(r.services,n),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(n,t),r.translator.options=n,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 V=te.createInstance();V.createInstance;V.dir;V.init;V.loadResources;V.reloadResources;V.use;V.changeLanguage;V.getFixedT;V.t;V.exists;V.setDefaultNamespace;V.hasLoadedNamespace;V.loadNamespaces;V.loadLanguages;const{slice:Ot,forEach:Ct}=[];function Et(i){return Ct.call(Ot.call(arguments,1),e=>{if(e)for(const t in e)i[t]===void 0&&(i[t]=e[t])}),i}function Nt(i){return typeof i!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(i))}const De=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,$t=function(i,e){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(e);let r=`${i}=${n}`;if(s.maxAge>0){const a=s.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(a)}`}if(s.domain){if(!De.test(s.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${s.domain}`}if(s.path){if(!De.test(s.path))throw new TypeError("option path is invalid");r+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");r+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(r+="; HttpOnly"),s.secure&&(r+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(r+="; Partitioned"),r},Ve={create(i,e,t,s){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+t*60*1e3)),s&&(n.domain=s),document.cookie=$t(i,e,n)},read(i){const e=`${i}=`,t=document.cookie.split(";");for(let s=0;s<t.length;s++){let n=t[s];for(;n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return n.substring(e.length,n.length)}return null},remove(i,e){this.create(i,"",-1,e)}};var kt={name:"cookie",lookup(i){let{lookupCookie:e}=i;if(e&&typeof document<"u")return Ve.read(e)||void 0},cacheUserLanguage(i,e){let{lookupCookie:t,cookieMinutes:s,cookieDomain:n,cookieOptions:r}=e;t&&typeof document<"u"&&Ve.create(t,i,s,n,r)}},Rt={name:"querystring",lookup(i){let{lookupQuerystring:e}=i,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const r=s.substring(1).split("&");for(let a=0;a<r.length;a++){const o=r[a].indexOf("=");o>0&&r[a].substring(0,o)===e&&(t=r[a].substring(o+1))}}return t}},Pt={name:"hash",lookup(i){let{lookupHash:e,lookupFromHashIndex:t}=i,s;if(typeof window<"u"){const{hash:n}=window.location;if(n&&n.length>2){const r=n.substring(1);if(e){const a=r.split("&");for(let o=0;o<a.length;o++){const l=a[o].indexOf("=");l>0&&a[o].substring(0,l)===e&&(s=a[o].substring(l+1))}}if(s)return s;if(!s&&t>-1){const a=n.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return s}};let Q=null;const Ue=()=>{if(Q!==null)return Q;try{if(Q=typeof window<"u"&&window.localStorage!==null,!Q)return!1;const i="i18next.translate.boo";window.localStorage.setItem(i,"foo"),window.localStorage.removeItem(i)}catch{Q=!1}return Q};var Tt={name:"localStorage",lookup(i){let{lookupLocalStorage:e}=i;if(e&&Ue())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupLocalStorage:t}=e;t&&Ue()&&window.localStorage.setItem(t,i)}};let Z=null;const Ke=()=>{if(Z!==null)return Z;try{if(Z=typeof window<"u"&&window.sessionStorage!==null,!Z)return!1;const i="i18next.translate.boo";window.sessionStorage.setItem(i,"foo"),window.sessionStorage.removeItem(i)}catch{Z=!1}return Z};var At={name:"sessionStorage",lookup(i){let{lookupSessionStorage:e}=i;if(e&&Ke())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupSessionStorage:t}=e;t&&Ke()&&window.sessionStorage.setItem(t,i)}},Ft={name:"navigator",lookup(i){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:s,language:n}=navigator;if(t)for(let r=0;r<t.length;r++)e.push(t[r]);s&&e.push(s),n&&e.push(n)}return e.length>0?e:void 0}},jt={name:"htmlTag",lookup(i){let{htmlTag:e}=i,t;const s=e||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(t=s.getAttribute("lang")),t}},It={name:"path",lookup(i){let{lookupFromPathIndex:e}=i;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof e=="number"?e:0]?.replace("/",""):void 0}},Dt={name:"subdomain",lookup(i){let{lookupFromSubdomainIndex:e}=i;const t=typeof e=="number"?e+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[t]}};let Qe=!1;try{document.cookie,Qe=!0}catch{}const Ze=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Qe||Ze.splice(1,1);const Vt=()=>({order:Ze,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:i=>i});class Ut{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Et(t,this.options||{},Vt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=n=>n.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(kt),this.addDetector(Rt),this.addDetector(Tt),this.addDetector(At),this.addDetector(Ft),this.addDetector(jt),this.addDetector(It),this.addDetector(Dt),this.addDetector(Pt)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(s=>{if(this.detectors[s]){let n=this.detectors[s].lookup(this.options);n&&typeof n=="string"&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(s=>s!=null&&!Nt(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(e,this.options)}))}}Ut.type="languageDetector";var xs=function(e){return{type:"backend",init:function(s,n,r){},read:function(s,n,r){if(typeof e=="function"){if(e.length<3){try{var a=e(s,n);a&&typeof a.then=="function"?a.then(function(o){return r(null,o&&o.default||o)}).catch(r):r(null,a)}catch(o){r(o)}return}e(s,n,r);return}r(null,e&&e[s]&&e[s][n])}}},ge,He;function Kt(){return He||(He=1,ge={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ge}var Ht=Kt();const Mt=nt(Ht);var _t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Me(i){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=i.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(e.name=t[1],(Mt[t[1]]||i.charAt(i.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var s=i.indexOf("-->");return{type:"comment",comment:s!==-1?i.slice(4,s):""}}for(var n=new RegExp(_t),r=null;(r=n.exec(i))!==null;)if(r[0].trim())if(r[1]){var a=r[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],n.lastIndex--}else r[2]&&(e.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return e}var zt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Bt=/^\s*$/,Wt=Object.create(null);function Ge(i,e){switch(e.type){case"text":return i+e.content;case"tag":return i+="<"+e.name+(e.attrs?(function(t){var s=[];for(var n in t)s.push(n+'="'+t[n]+'"');return s.length?" "+s.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?i:i+e.children.reduce(Ge,"")+"</"+e.name+">";case"comment":return i+"<!--"+e.comment+"-->"}}var Jt={parse:function(i,e){e||(e={}),e.components||(e.components=Wt);var t,s=[],n=[],r=-1,a=!1;if(i.indexOf("<")!==0){var o=i.indexOf("<");s.push({type:"text",content:o===-1?i:i.substring(0,o)})}return i.replace(zt,function(l,u){if(a){if(l!=="</"+t.name+">")return;a=!1}var f,c=l.charAt(1)!=="/",d=l.startsWith("<!--"),g=u+l.length,h=i.charAt(g);if(d){var y=Me(l);return r<0?(s.push(y),s):((f=n[r]).children.push(y),s)}if(c&&(r++,(t=Me(l)).type==="tag"&&e.components[t.name]&&(t.type="component",a=!0),t.voidElement||a||!h||h==="<"||t.children.push({type:"text",content:i.slice(g,i.indexOf("<",g))}),r===0&&s.push(t),(f=n[r-1])&&f.children.push(t),n[r]=t),(!c||t.voidElement)&&(r>-1&&(t.voidElement||t.name===l.slice(2,-1))&&(r--,t=r===-1?s:n[r]),!a&&h!=="<"&&h)){f=r===-1?s:n[r].children;var S=i.indexOf("<",g),R=i.slice(g,S===-1?void 0:S);Bt.test(R)&&(R=" "),(S>-1&&r+f.length>=0||R!==" ")&&f.push({type:"text",content:R})}}),s},stringify:function(i){return i.reduce(function(e,t){return e+Ge("",t)},"")}};const re=(i,e,t,s)=>{const n=[t,{code:e,...s||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(n,"warn","react-i18next::",!0);D(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...n):console?.warn&&console.warn(...n)},_e={},ne=(i,e,t,s)=>{D(t)&&_e[t]||(D(t)&&(_e[t]=new Date),re(i,e,t,s))},Xe=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Se=(i,e,t)=>{i.loadNamespaces(e,Xe(i,t))},ze=(i,e,t,s)=>{if(D(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return Se(i,t,s);t.forEach(n=>{i.options.ns.indexOf(n)<0&&i.options.ns.push(n)}),i.loadLanguages(e,Xe(i,s))},qt=(i,e,t={})=>!e.languages||!e.languages.length?(ne(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,i))return!1}}),D=i=>typeof i=="string",B=i=>typeof i=="object"&&i!==null,Yt=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Qt={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Zt=i=>Qt[i],et=i=>i.replace(Yt,Zt);let be={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:et,transDefaultProps:void 0};const Gt=(i={})=>{be={...be,...i}},we=()=>be;let tt;const Xt=i=>{tt=i},Le=()=>tt,ae=(i,e)=>{if(!i)return!1;const t=i.props?.children??i.children;return e?t.length>0:!!t},X=i=>{if(!i)return[];const e=i.props?.children??i.children;return i.props?.i18nIsDynamicList?W(e):e},es=i=>Array.isArray(i)&&i.every(O.isValidElement),W=i=>Array.isArray(i)?i:[i],ts=(i,e)=>{const t={...e};return t.props={...e.props,...i.props},t},ss=i=>{const e={};if(!i)return e;const t=s=>{W(s).forEach(r=>{D(r)||(ae(r)?t(X(r)):B(r)&&!O.isValidElement(r)&&Object.assign(e,r))})};return t(i),e},ve=(i,e,t,s)=>{if(!i)return"";let n="";const r=W(i),a=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((o,l)=>{if(D(o)){n+=`${o}`;return}if(O.isValidElement(o)){const{props:u,type:f}=o,c=Object.keys(u).length,d=a.indexOf(f)>-1,g=u.children;if(!g&&d&&!c){n+=`<${f}/>`;return}if(!g&&(!d||c)||u.i18nIsDynamicList){n+=`<${l}></${l}>`;return}if(d&&c<=1){const y=D(g)?g:ve(g,e,t,s);n+=`<${f}>${y}</${f}>`;return}const h=ve(g,e,t,s);n+=`<${l}>${h}</${l}>`;return}if(o===null){re(t,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(B(o)){const{format:u,...f}=o,c=Object.keys(f);if(c.length===1){const d=u?`${c[0]}, ${u}`:c[0];n+=`{{${d}}}`;return}re(t,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:o});return}re(t,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:o})}),n},ns=(i,e=[],t={})=>{if(!i)return i;const s=Object.keys(t),n=[...e,...s];let r="",a=0;for(;a<i.length;)if(i[a]==="<"){let o=!1;const l=i.slice(a).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(l){const u=l[1];(/^\d+$/.test(u)||n.includes(u))&&(o=!0,r+=l[0],a+=l[0].length)}if(!o){const u=i.slice(a).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const f=u[1];(/^\d+$/.test(f)||n.includes(f))&&(o=!0,r+=u[0],a+=u[0].length)}}o||(r+="<",a+=1)}else r+=i[a],a+=1;return r},is=(i,e,t,s,n,r,a)=>{if(t==="")return[];const o=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(b=>`<${b}`).join("|")).test(t);if(!i&&!e&&!l&&!a)return[t];const u=e??{},f=b=>{W(b).forEach(v=>{D(v)||(ae(v)?f(X(v)):B(v)&&!O.isValidElement(v)&&Object.assign(u,v))})};f(i);const c=ns(t,o,u),d=Jt.parse(`<0>${c}</0>`),g={...u,...r},h=(b,E,v)=>{const C=X(b),A=S(C,E.children,v);return es(C)&&A.length===0||b.props?.i18nIsDynamicList?C:A},y=(b,E,v,C,A)=>{b.dummy?(b.children=E,v.push(O.cloneElement(b,{key:C},A?void 0:E))):v.push(...O.Children.map([b],$=>{if($.type===O.Fragment||$.props?.i18nIsDynamicList!==void 0){const p={key:C};return $&&$.props&&Object.keys($.props).forEach(m=>{m==="children"||m==="i18nIsDynamicList"||(p[m]=$.props[m])}),O.createElement($.type,p,A?null:E)}const P={key:C};return $&&$.props&&Object.keys($.props).forEach(p=>{p==="ref"||p==="children"||(P[p]=$.props[p])}),O.cloneElement($,P,A?null:E)}))},S=(b,E,v)=>{const C=W(b),A=W(E),$={};return A.reduce((P,p,m)=>{const k=p.children?.[0]?.content&&s.services.interpolator.interpolate(p.children[0].content,g,s.language);if(p.type==="tag"){let N=C[parseInt(p.name,10)];!N&&e&&(N=e[p.name]),v.length===1&&!N&&(N=v[0][p.name]),N||(N={});const L={...p.attrs};a&&Object.keys(L).forEach(T=>{const K=L[T];D(K)&&(L[T]=et(K))});const w=Object.keys(L).length!==0?ts({props:L},N):N,U=O.isValidElement(w),j=U&&ae(p,!0)&&!p.voidElement,I=l&&B(w)&&w.dummy&&!U,H=B(e)&&Object.hasOwnProperty.call(e,p.name);if(D(w)){const T=s.services.interpolator.interpolate(w,g,s.language);P.push(T)}else if(ae(w)||j){const T=h(w,p,v);y(w,T,P,m)}else if(I){const T=S(C,p.children,v);y(w,T,P,m)}else if(Number.isNaN(parseFloat(p.name)))if(H){const T=h(w,p,v);y(w,T,P,m,p.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(p.name)>-1)if(p.voidElement)P.push(O.createElement(p.name,{key:`${p.name}-${m}`}));else{const T=$[p.name]||0;$[p.name]=T+1;let K,F=0;for(let Y=0;Y<C.length;Y+=1){const fe=C[Y];if(O.isValidElement(fe)&&fe.type===p.name){if(F===T){K=fe;break}F+=1}}const _=K?W(X(K)):C,J=S(_,p.children,v);P.push(O.createElement(p.name,{key:`${p.name}-${m}`},J))}else if(p.voidElement)P.push(`<${p.name} />`);else{const T=S(C,p.children,v);P.push(`<${p.name}>${T}</${p.name}>`)}else if(B(w)&&!U){const T=p.children[0]?k:null;T&&P.push(T)}else y(w,k,P,m,p.children.length!==1||!k)}else if(p.type==="text"){const N=n.transWrapTextNodes,L=typeof n.unescape=="function"?n.unescape:we().unescape,w=a?L(s.services.interpolator.interpolate(p.content,g,s.language)):s.services.interpolator.interpolate(p.content,g,s.language);N?P.push(O.createElement(N,{key:`${p.name}-${m}`},w)):P.push(w)}return P},[])},R=S([{dummy:!0,children:i||[]}],d,W(i||[]));return X(R[0])},st=(i,e,t)=>{const s=i.key||e,n=O.cloneElement(i,{key:s});if(!n.props||!n.props.children||t.indexOf(`${e}/>`)<0&&t.indexOf(`${e} />`)<0)return n;function r(){return O.createElement(O.Fragment,null,n)}return O.createElement(r,{key:s})},rs=(i,e)=>i.map((t,s)=>st(t,s,e)),as=(i,e)=>{const t={};return Object.keys(i).forEach(s=>{Object.assign(t,{[s]:st(i[s],s,e)})}),t},os=(i,e,t,s)=>i?Array.isArray(i)?rs(i,e):B(i)?as(i,e):(ne(t,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,ls=i=>!B(i)||Array.isArray(i)?!1:Object.keys(i).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function us({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const h=f||Le();if(!h)return ne(h,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:s}),i;const y=c||h.t.bind(h)||(K=>K),S={...we(),...h.options?.react};let R=u||y.ns||h.options?.defaultNS;R=D(R)?[R]:R||["translation"];const{transDefaultProps:b}=S,E=b?.tOptions?{...b.tOptions,...r}:r,v=d??b?.shouldUnescape,C=b?.values?{...b.values,...a}:a,A=b?.components?{...b.components,...l}:l,$=ve(i,S,h,s),P=o||E?.defaultValue||$||S.transEmptyNodeValue||(typeof s=="function"?q(s):s),{hashTransKey:p}=S,m=s||(p?p($||P):$||P);h.options?.interpolation?.defaultVariables?a=C&&Object.keys(C).length>0?{...C,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables}:a=C;const k=ss(i);k&&typeof k.count=="number"&&e===void 0&&(e=k.count);const N=a||e!==void 0&&!h.options?.interpolation?.alwaysFormat||!i?E.interpolation:{interpolation:{...E.interpolation,prefix:"#$?",suffix:"?$#"}},L={...E,context:n||E.context,count:e,...a,...N,defaultValue:P,ns:R};let w=m?y(m,L):P;w===m&&P&&(w=P);const U=os(A,w,h,s);let j=U||i,I=null;ls(U)&&(I=U,j=i);const H=is(j,I,w,h,S,L,v),T=t??S.defaultTransParent;return T?O.createElement(T,g,H):H}const Ss={type:"3rdParty",init(i){Gt(i.options.react),Xt(i)}},Oe=O.createContext();class cs{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function bs({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const{i18n:h,defaultNS:y}=O.useContext(Oe)||{},S=f||h||Le(),R=c||S?.t.bind(S);return us({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r,values:a,defaults:o,components:l,ns:u||R?.ns||y||S?.options?.defaultNS,i18n:S,t:c,shouldUnescape:d,...g})}var me={exports:{}},ye={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@ import{g as nt,r as O,a as it}from"./vendor-react-BTgM5bbZ.js";const x=i=>typeof
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var He;function Yt(){if(He)return ye;He=1;var i=it();function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var t=typeof Object.is=="function"?Object.is:e,s=i.useState,n=i.useEffect,r=i.useLayoutEffect,a=i.useDebugValue;function o(c,d){var g=d(),h=s({inst:{value:g,getSnapshot:d}}),y=h[0].inst,S=h[1];return r(function(){y.value=g,y.getSnapshot=d,l(y)&&S({inst:y})},[c,g,d]),n(function(){return l(y)&&S({inst:y}),c(function(){l(y)&&S({inst:y})})},[c]),a(g),g}function l(c){var d=c.getSnapshot;c=c.value;try{var g=d();return!t(c,g)}catch{return!0}}function u(c,d){return d()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return ye.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:f,ye}var Me;function Qt(){return Me||(Me=1,me.exports=Yt()),me.exports}var Zt=Qt();const Gt=(i,e)=>{if(D(e))return e;if(B(e)&&D(e.defaultValue))return e.defaultValue;if(typeof i=="function")return"";if(Array.isArray(i)){const t=i[i.length-1];return typeof t=="function"?"":t}return i},Xt={t:Gt,ready:!1},es=()=>()=>{},bs=(i,e={})=>{const{i18n:t}=e,{i18n:s,defaultNS:n}=O.useContext(Oe)||{},r=t||s||Le();r&&!r.reportNamespaces&&(r.reportNamespaces=new qt),r||ne(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=O.useMemo(()=>({...we(),...r?.options?.react,...e}),[r,e]),{useSuspense:o,keyPrefix:l}=a,u=i||n||r?.options?.defaultNS,f=D(u)?[u]:u||["translation"],c=O.useMemo(()=>f,f);r?.reportNamespaces?.addUsedNamespaces?.(c);const d=O.useRef(0),g=O.useCallback(p=>{if(!r)return es;const{bindI18n:m,bindI18nStore:k}=a,N=()=>{d.current+=1,p()};return m&&r.on(m,N),k&&r.store.on(k,N),()=>{m&&m.split(" ").forEach(L=>r.off(L,N)),k&&k.split(" ").forEach(L=>r.store.off(L,N))}},[r,a]),h=O.useRef(),y=O.useCallback(()=>{if(!r)return Xt;const p=!!(r.isInitialized||r.initializedStoreOnce)&&c.every(U=>Tt(U,r,a)),m=e.lng||r.language,k=d.current,N=h.current;if(N&&N.ready===p&&N.lng===m&&N.keyPrefix===l&&N.revision===k)return N;const w={t:r.getFixedT(m,a.nsMode==="fallback"?c:c[0],l,{scopeNs:c}),ready:p,lng:m,keyPrefix:l,revision:k};return h.current=w,w},[r,c,l,a,e.lng]),[S,R]=O.useState(0),{t:b,ready:E}=Zt.useSyncExternalStore(g,y,y);O.useEffect(()=>{if(r&&!E&&!o){const p=()=>R(m=>m+1);e.lng?Ke(r,e.lng,c,p):Se(r,c,p)}},[r,e.lng,c,E,o,S]);const v=r||{},C=O.useRef(null),A=O.useRef(),$=p=>{const m=Object.getOwnPropertyDescriptors(p);m.__original&&delete m.__original;const k=Object.create(Object.getPrototypeOf(p),m);if(!Object.prototype.hasOwnProperty.call(k,"__original"))try{Object.defineProperty(k,"__original",{value:p,writable:!1,enumerable:!1,configurable:!1})}catch{}return k},P=O.useMemo(()=>{const p=v,m=p?.language;let k=p;p&&(C.current&&C.current.__original===p?A.current!==m?(k=$(p),C.current=k,A.current=m):k=C.current:(k=$(p),C.current=k,A.current=m));const N=!E&&!o?(...w)=>(ne(r,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...w)):b,L=[N,k,E];return L.t=N,L.i18n=k,L.ready=E,L},[b,v,E,v.resolvedLanguage,v.language,v.languages]);if(r&&o&&!E)throw new Promise(p=>{const m=()=>p();e.lng?Ke(r,e.lng,c,m):Se(r,c,m)});return P};function vs({i18n:i,defaultNS:e,children:t}){const s=O.useMemo(()=>({i18n:i,defaultNS:e}),[i,e]);return O.createElement(Oe.Provider,{value:s},t)}const{slice:ts,forEach:ss}=[];function ns(i){return ss.call(ts.call(arguments,1),e=>{if(e)for(const t in e)i[t]===void 0&&(i[t]=e[t])}),i}function is(i){return typeof i!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(i))}const _e=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rs=function(i,e){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(e);let r=`${i}=${n}`;if(s.maxAge>0){const a=s.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(a)}`}if(s.domain){if(!_e.test(s.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${s.domain}`}if(s.path){if(!_e.test(s.path))throw new TypeError("option path is invalid");r+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");r+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(r+="; HttpOnly"),s.secure&&(r+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(r+="; Partitioned"),r},ze={create(i,e,t,s){let n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(n.expires=new Date,n.expires.setTime(n.expires.getTime()+t*60*1e3)),s&&(n.domain=s),document.cookie=rs(i,e,n)},read(i){const e=`${i}=`,t=document.cookie.split(";");for(let s=0;s<t.length;s++){let n=t[s];for(;n.charAt(0)===" ";)n=n.substring(1,n.length);if(n.indexOf(e)===0)return n.substring(e.length,n.length)}return null},remove(i,e){this.create(i,"",-1,e)}};var as={name:"cookie",lookup(i){let{lookupCookie:e}=i;if(e&&typeof document<"u")return ze.read(e)||void 0},cacheUserLanguage(i,e){let{lookupCookie:t,cookieMinutes:s,cookieDomain:n,cookieOptions:r}=e;t&&typeof document<"u"&&ze.create(t,i,s,n,r)}},os={name:"querystring",lookup(i){let{lookupQuerystring:e}=i,t;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const r=s.substring(1).split("&");for(let a=0;a<r.length;a++){const o=r[a].indexOf("=");o>0&&r[a].substring(0,o)===e&&(t=r[a].substring(o+1))}}return t}},ls={name:"hash",lookup(i){let{lookupHash:e,lookupFromHashIndex:t}=i,s;if(typeof window<"u"){const{hash:n}=window.location;if(n&&n.length>2){const r=n.substring(1);if(e){const a=r.split("&");for(let o=0;o<a.length;o++){const l=a[o].indexOf("=");l>0&&a[o].substring(0,l)===e&&(s=a[o].substring(l+1))}}if(s)return s;if(!s&&t>-1){const a=n.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return s}};let Q=null;const Be=()=>{if(Q!==null)return Q;try{if(Q=typeof window<"u"&&window.localStorage!==null,!Q)return!1;const i="i18next.translate.boo";window.localStorage.setItem(i,"foo"),window.localStorage.removeItem(i)}catch{Q=!1}return Q};var us={name:"localStorage",lookup(i){let{lookupLocalStorage:e}=i;if(e&&Be())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupLocalStorage:t}=e;t&&Be()&&window.localStorage.setItem(t,i)}};let Z=null;const We=()=>{if(Z!==null)return Z;try{if(Z=typeof window<"u"&&window.sessionStorage!==null,!Z)return!1;const i="i18next.translate.boo";window.sessionStorage.setItem(i,"foo"),window.sessionStorage.removeItem(i)}catch{Z=!1}return Z};var cs={name:"sessionStorage",lookup(i){let{lookupSessionStorage:e}=i;if(e&&We())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(i,e){let{lookupSessionStorage:t}=e;t&&We()&&window.sessionStorage.setItem(t,i)}},fs={name:"navigator",lookup(i){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:s,language:n}=navigator;if(t)for(let r=0;r<t.length;r++)e.push(t[r]);s&&e.push(s),n&&e.push(n)}return e.length>0?e:void 0}},ds={name:"htmlTag",lookup(i){let{htmlTag:e}=i,t;const s=e||(typeof document<"u"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(t=s.getAttribute("lang")),t}},hs={name:"path",lookup(i){let{lookupFromPathIndex:e}=i;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof e=="number"?e:0]?.replace("/",""):void 0}},ps={name:"subdomain",lookup(i){let{lookupFromSubdomainIndex:e}=i;const t=typeof e=="number"?e+1:1,s=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[t]}};let tt=!1;try{document.cookie,tt=!0}catch{}const st=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];tt||st.splice(1,1);const gs=()=>({order:st,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:i=>i});class ms{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=ns(t,this.options||{},gs()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=n=>n.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(as),this.addDetector(os),this.addDetector(us),this.addDetector(cs),this.addDetector(fs),this.addDetector(ds),this.addDetector(hs),this.addDetector(ps),this.addDetector(ls)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(s=>{if(this.detectors[s]){let n=this.detectors[s].lookup(this.options);n&&typeof n=="string"&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(s=>s!=null&&!is(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(e,this.options)}))}}ms.type="languageDetector";var ws=function(e){return{type:"backend",init:function(s,n,r){},read:function(s,n,r){if(typeof e=="function"){if(e.length<3){try{var a=e(s,n);a&&typeof a.then=="function"?a.then(function(o){return r(null,o&&o.default||o)}).catch(r):r(null,a)}catch(o){r(o)}return}e(s,n,r);return}r(null,e&&e[s]&&e[s][n])}}};export{ms as B,vs as I,Ss as T,ws as a,xs as b,V as i,Qt as r,bs as u};
|
|
9
|
+
*/var Be;function fs(){if(Be)return ye;Be=1;var i=it();function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var t=typeof Object.is=="function"?Object.is:e,s=i.useState,n=i.useEffect,r=i.useLayoutEffect,a=i.useDebugValue;function o(c,d){var g=d(),h=s({inst:{value:g,getSnapshot:d}}),y=h[0].inst,S=h[1];return r(function(){y.value=g,y.getSnapshot=d,l(y)&&S({inst:y})},[c,g,d]),n(function(){return l(y)&&S({inst:y}),c(function(){l(y)&&S({inst:y})})},[c]),a(g),g}function l(c){var d=c.getSnapshot;c=c.value;try{var g=d();return!t(c,g)}catch{return!0}}function u(c,d){return d()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return ye.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:f,ye}var We;function ds(){return We||(We=1,me.exports=fs()),me.exports}var hs=ds();const ps=(i,e)=>{if(D(e))return e;if(B(e)&&D(e.defaultValue))return e.defaultValue;if(typeof i=="function")return"";if(Array.isArray(i)){const t=i[i.length-1];return typeof t=="function"?"":t}return i},gs={t:ps,ready:!1},ms=()=>()=>{},vs=(i,e={})=>{const{i18n:t}=e,{i18n:s,defaultNS:n}=O.useContext(Oe)||{},r=t||s||Le();r&&!r.reportNamespaces&&(r.reportNamespaces=new cs),r||ne(r,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=O.useMemo(()=>({...we(),...r?.options?.react,...e}),[r,e]),{useSuspense:o,keyPrefix:l}=a,u=i||n||r?.options?.defaultNS,f=D(u)?[u]:u||["translation"],c=O.useMemo(()=>f,f);r?.reportNamespaces?.addUsedNamespaces?.(c);const d=O.useRef(0),g=O.useCallback(p=>{if(!r)return ms;const{bindI18n:m,bindI18nStore:k}=a,N=()=>{d.current+=1,p()};return m&&r.on(m,N),k&&r.store.on(k,N),()=>{m&&m.split(" ").forEach(L=>r.off(L,N)),k&&k.split(" ").forEach(L=>r.store.off(L,N))}},[r,a]),h=O.useRef(),y=O.useCallback(()=>{if(!r)return gs;const p=!!(r.isInitialized||r.initializedStoreOnce)&&c.every(U=>qt(U,r,a)),m=e.lng||r.language,k=d.current,N=h.current;if(N&&N.ready===p&&N.lng===m&&N.keyPrefix===l&&N.revision===k)return N;const w={t:r.getFixedT(m,a.nsMode==="fallback"?c:c[0],l,{scopeNs:c}),ready:p,lng:m,keyPrefix:l,revision:k};return h.current=w,w},[r,c,l,a,e.lng]),[S,R]=O.useState(0),{t:b,ready:E}=hs.useSyncExternalStore(g,y,y);O.useEffect(()=>{if(r&&!E&&!o){const p=()=>R(m=>m+1);e.lng?ze(r,e.lng,c,p):Se(r,c,p)}},[r,e.lng,c,E,o,S]);const v=r||{},C=O.useRef(null),A=O.useRef(),$=p=>{const m=Object.getOwnPropertyDescriptors(p);m.__original&&delete m.__original;const k=Object.create(Object.getPrototypeOf(p),m);if(!Object.prototype.hasOwnProperty.call(k,"__original"))try{Object.defineProperty(k,"__original",{value:p,writable:!1,enumerable:!1,configurable:!1})}catch{}return k},P=O.useMemo(()=>{const p=v,m=p?.language;let k=p;p&&(C.current&&C.current.__original===p?A.current!==m?(k=$(p),C.current=k,A.current=m):k=C.current:(k=$(p),C.current=k,A.current=m));const N=!E&&!o?(...w)=>(ne(r,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...w)):b,L=[N,k,E];return L.t=N,L.i18n=k,L.ready=E,L},[b,v,E,v.resolvedLanguage,v.language,v.languages]);if(r&&o&&!E)throw new Promise(p=>{const m=()=>p();e.lng?ze(r,e.lng,c,m):Se(r,c,m)});return P};function ws({i18n:i,defaultNS:e,children:t}){const s=O.useMemo(()=>({i18n:i,defaultNS:e}),[i,e]);return O.createElement(Oe.Provider,{value:s},t)}export{Ut as B,ws as I,bs as T,xs as a,Ss as b,V as i,ds as r,vs as u};
|