@powerhousedao/connect 4.1.0-dev.107 → 4.1.0-dev.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddDriveModal-C2fZqOQI.js → AddDriveModal-7r-BM-yT.js} +1 -1
- package/dist/assets/{ClearStorageModal-DjjEBXBS.js → ClearStorageModal-9gL_vLgY.js} +1 -1
- package/dist/assets/{CookiesPolicyModal-BrOPPvzy.js → CookiesPolicyModal-BdPCCPNX.js} +1 -1
- package/dist/assets/{DebugSettingsModal-PbDxwRkN.js → DebugSettingsModal-BkU8bK-I.js} +1 -1
- package/dist/assets/{DeleteDriveModal-x5WgUnZq.js → DeleteDriveModal-Ctt3VSe4.js} +1 -1
- package/dist/assets/{DeleteItemModal-BBYKOKsF.js → DeleteItemModal-DZLHSQPf.js} +1 -1
- package/dist/assets/{DisclaimerModal-CteySYvG.js → DisclaimerModal-BTFCt2N-.js} +1 -1
- package/dist/assets/{ExportDocumentWithErrorsModal-B7IfIoUE.js → ExportDocumentWithErrorsModal-B_tnIZE0.js} +1 -1
- package/dist/assets/{SettingsModal-BrdAtrxz.js → SettingsModal-BDHjn5Ac.js} +1 -1
- package/dist/assets/{UpgradeDriveModal-fqiiEuOr.js → UpgradeDriveModal-kyIQAIjP.js} +1 -1
- package/dist/assets/{index-BSTajiPh.js → index-BAlx9zX9.js} +3 -3
- package/dist/index.html +1 -1
- package/lib/package.copy.json +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.copy.json +1 -1
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sentry_react-C4W8xEsl.js","assets/sentry_browser-BFJlXALZ.js","assets/AddDriveModal-
|
|
2
|
-
import{w as xo,x as zr,j as N,v as Qe,y as Do,g as Kr,h as si,z as li,A as ci,B as ui,C as Wr,D as di,d as Lo,E as fi,F as hi,G as Po,H as pi,I as gi,J as mi,K as vi,f as Ei,L as yi,M as _i,N as Ci,O as Si,P as Ni,Q as Ri,R as bi,S as Oi,T as xi,U as Di,V as Li,W as Pi,X as wi,Y as Ai,Z as En,_ as Ti,$ as Ii,a0 as ki,a1 as Hi,a2 as Mi,a3 as ji,a4 as Fi,a5 as Bi,a6 as Vi,a7 as Ui,a8 as $i,s as St,a9 as ot,a as wo,aa as zi,ab as Ki,ac as Wi,ad as Ao,ae as Yi,af as yn,ag as Gi,ah as Ji}from"./reactor_browser-BbZdm6Aa.js";import{t as Xi,C as To,H as Io,A as qi,W as Zi,T as Qi,a as es,D as ts,b as rs,R as ns,c as os,d as as,S as is,e as ss,f as ls}from"./design_system_connect-DHQbQvgv.js";import{r as g,g as cs,b as us,R as ds,d as fs}from"./sentry_react-C4W8xEsl.js";import{o as we,a as ko,s as ae,e as Ho,n as hs,f as ps}from"./zod-C6yxFxyo.js";import{q as gs,l as de,t as Mo,B as ms,R as vs,I as Es,E as ys,v as jt,w as _s}from"./document_drive-CP6paqKN.js";import{_ as me,G as Dr}from"./drive_explorer-IB_BS5Au.js";import{Y as Cs,I as Lr,z as Ss}from"./design_system-CZfmC8Ij.js";import{K as Ns,J as Rs,L as Ft,j as jo,h as Fo,g as bs}from"./document_model-DLxR7ZLO.js";import{g as Os,r as xs}from"./graphql_request-9RNJ00DB.js";import{d as _n}from"./document_model_editor-ButtI7kP.js";import{ao as Ds}from"./sentry_browser-BFJlXALZ.js";import"./common-n2B-GsjO.js";import"./graphql-BS4Brs_E.js";import"./config-CU-aFfVJ.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const Q=ko([ps(),Ho(["true","false"])]).transform(t=>typeof t=="boolean"?t:t==="true"),Pr=ko([hs(),ae()]).transform(t=>typeof t=="number"?t:parseInt(t,10)),Ls=we({PH_CONFIG_PATH:ae().optional(),PH_PACKAGES:ae().optional(),PH_LOCAL_PACKAGE:ae().optional(),PH_DISABLE_LOCAL_PACKAGE:Q.default(!1),PH_SENTRY_AUTH_TOKEN:ae().optional(),PH_SENTRY_ORG:ae().optional(),PH_SENTRY_PROJECT:ae().optional()}),Ps=we({PH_CONNECT_VERSION:ae().default("unknown"),PH_CONNECT_LOG_LEVEL:Ho(["debug","info","warn","error"]).default("info"),PH_CONNECT_REQUIRES_HARD_REFRESH:Q.default(!0),PH_CONNECT_WARN_OUTDATED_APP:Q.default(!1),PH_CONNECT_STUDIO_MODE:Q.default(!1),PH_CONNECT_BASE_PATH:ae().optional(),PH_CONNECT_DEFAULT_DRIVES_URL:ae().optional(),PH_CONNECT_DRIVES_PRESERVE_STRATEGY:ae().optional(),PH_CONNECT_VERSION_CHECK_INTERVAL:Pr.default(3600*1e3),PH_CONNECT_CLI_VERSION:ae().optional(),PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE:Pr.default(50)}),ws=we({PH_CONNECT_DISABLE_ADD_DRIVE:Q.default(!1),PH_CONNECT_SEARCH_BAR_ENABLED:Q.default(!1),PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS:Q.default(!0),PH_CONNECT_ENABLED_EDITORS:ae().optional(),PH_CONNECT_DISABLED_EDITORS:ae().default("powerhouse/document-drive"),PH_CONNECT_GA_TRACKING_ID:ae().optional(),PH_CONNECT_EXTERNAL_PACKAGES_DISABLED:Q.default(!1)}),As=we({PH_CONNECT_PUBLIC_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES:Q.default(!1),PH_CONNECT_CLOUD_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES:Q.default(!1),PH_CONNECT_LOCAL_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES:Q.default(!1)}),Ts=we({PH_CONNECT_ANALYTICS_ENABLED:Q.default(!0),PH_CONNECT_ANALYTICS_DATABASE_NAME:ae().optional(),PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED:Q.default(!0),PH_CONNECT_DIFF_ANALYTICS_ENABLED:Q.default(!1),PH_CONNECT_DRIVE_ANALYTICS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED:Q.default(!0)}),Is=we({PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED:Q.default(!0)}),ks=we({PH_CONNECT_PROCESSORS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED:Q.default(!0)}),Hs=ks.merge(Ts).merge(Is),Ms=we({PH_CONNECT_SENTRY_RELEASE:ae().optional(),PH_CONNECT_SENTRY_DSN:ae().optional(),PH_CONNECT_SENTRY_ENV:ae().default("dev"),PH_CONNECT_SENTRY_TRACING_ENABLED:Q.default(!1)}),js=we({PH_CONNECT_RENOWN_URL:ae().default("https://auth.renown.id"),PH_CONNECT_RENOWN_NETWORK_ID:ae().default("eip155"),PH_CONNECT_RENOWN_CHAIN_ID:Pr.default(1)}),Ut=Ps.merge(ws).merge(As).merge(Hs).merge(Ms).merge(js);Ls.merge(Ut);function Fs(t,e,r){const{processEnv:n={},optionsEnv:o={},fileEnv:a={}}=t,i={};for(const s of e){const l=[{name:"process.env",value:n[s]},{name:"options",value:o[s]},{name:"fileEnv",value:a[s]}];for(const c of l){const d=c.value;if(!(d===void 0||d===""))try{const u=r.shape[s];if(u){u.parse(d),i[s]=d;break}console.warn(`Unknown environment variable: '${s}'`),i[s]=d;break}catch{const u=d===null?"null":typeof d=="object"?JSON.stringify(d):d;console.warn(`Invalid value for ${s} from ${c.name}: ${u}. Trying next source.`)}}}return i}function Bs(t={}){const e=new Set(Object.keys(Ut.shape)),r=Fs(t,e,Ut);return Ut.parse(r)}function Vs(t){let e=t;return e.startsWith(".")&&(e=e.slice(1)),e.startsWith("/")||(e=`/${e}`),e.endsWith("/")||(e=`${e}/`),e}const Us={BASE_URL:"/",DEV:!1,MODE:"production",PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED:"true",PH_CONNECT_ANALYTICS_ENABLED:"true",PH_CONNECT_CLOUD_DRIVES_ENABLED:"true",PH_CONNECT_DIFF_ANALYTICS_ENABLED:"false",PH_CONNECT_DISABLED_EDITORS:"powerhouse/document-drive",PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES:"false",PH_CONNECT_DISABLE_ADD_DRIVE:"false",PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES:"false",PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES:"false",PH_CONNECT_DRIVE_ANALYTICS_ENABLED:"true",PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED:"true",PH_CONNECT_EXTERNAL_PACKAGES_DISABLED:"false",PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED:"true",PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED:"true",PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE:"50",PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS:"true",PH_CONNECT_LOCAL_DRIVES_ENABLED:"true",PH_CONNECT_LOG_LEVEL:"info",PH_CONNECT_PROCESSORS_ENABLED:"true",PH_CONNECT_PUBLIC_DRIVES_ENABLED:"true",PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED:"true",PH_CONNECT_RENOWN_CHAIN_ID:"1",PH_CONNECT_RENOWN_NETWORK_ID:"eip155",PH_CONNECT_RENOWN_URL:"https://auth.renown.id",PH_CONNECT_REQUIRES_HARD_REFRESH:"true",PH_CONNECT_SEARCH_BAR_ENABLED:"false",PH_CONNECT_SENTRY_ENV:"prod",PH_CONNECT_SENTRY_TRACING_ENABLED:"false",PH_CONNECT_STUDIO_MODE:"false",PH_CONNECT_VERSION:"4.1.0-dev.106",PH_CONNECT_VERSION_CHECK_INTERVAL:"3600000",PH_CONNECT_WARN_OUTDATED_APP:"false",PROD:!0,SSR:!1},D=Bs({processEnv:Us});function $s(t){return t.endsWith("/")?t:t+"/"}function zs(){const t=D.PH_CONNECT_BASE_PATH||"/",e=$s(t);return{basePath:t,routerBasename:e,allowList:void 0,allowedDocumentTypes:[],isDragAndDropEnabled:!0,isEditorDebugModeEnabled:!1,isEditorReadModeEnabled:!1,isExternalControlsEnabled:!1,version:D.PH_CONNECT_VERSION,logLevel:D.PH_CONNECT_LOG_LEVEL,requiresHardRefresh:D.PH_CONNECT_REQUIRES_HARD_REFRESH,warnOutdatedApp:D.PH_CONNECT_WARN_OUTDATED_APP,studioMode:D.PH_CONNECT_STUDIO_MODE,versionCheckInterval:D.PH_CONNECT_VERSION_CHECK_INTERVAL,cliVersion:D.PH_CONNECT_CLI_VERSION,fileUploadOperationsChunkSize:D.PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE,gaTrackingId:D.PH_CONNECT_GA_TRACKING_ID,defaultDrivesUrl:D.PH_CONNECT_DEFAULT_DRIVES_URL,drivesPreserveStrategy:D.PH_CONNECT_DRIVES_PRESERVE_STRATEGY,enabledEditors:D.PH_CONNECT_ENABLED_EDITORS?.split(","),disabledEditors:D.PH_CONNECT_DISABLED_EDITORS.split(","),isExternalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED,isAnalyticsEnabled:D.PH_CONNECT_ANALYTICS_ENABLED,isAnalyticsExternalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED&&D.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,analyticsDatabaseName:D.PH_CONNECT_ANALYTICS_DATABASE_NAME,isRelationalProcessorsEnabled:D.PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED,isExternalRelationalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED&&D.PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED,renownUrl:D.PH_CONNECT_RENOWN_URL,renownNetworkId:D.PH_CONNECT_RENOWN_NETWORK_ID,renownChainId:D.PH_CONNECT_RENOWN_CHAIN_ID,sentryRelease:D.PH_CONNECT_SENTRY_RELEASE,sentryDsn:D.PH_CONNECT_SENTRY_DSN,sentryEnv:D.PH_CONNECT_SENTRY_ENV,isDiffAnalyticsEnabled:D.PH_CONNECT_DIFF_ANALYTICS_ENABLED,isDriveAnalyticsEnabled:D.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,isPublicDrivesEnabled:D.PH_CONNECT_PUBLIC_DRIVES_ENABLED,isCloudDrivesEnabled:D.PH_CONNECT_CLOUD_DRIVES_ENABLED,isLocalDrivesEnabled:D.PH_CONNECT_LOCAL_DRIVES_ENABLED,isSentryTracingEnabled:D.PH_CONNECT_SENTRY_TRACING_ENABLED,isDocumentModelSelectionSettingsEnabled:!D.PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS,isAddDriveEnabled:!D.PH_CONNECT_DISABLE_ADD_DRIVE,isAddPublicDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES,isDeletePublicDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES,isAddCloudDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES,isDeleteCloudDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES,isAddLocalDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES,isDeleteLocalDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES,isAnalyticsDatabaseWorkerEnabled:!D.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED,isExternalPackagesEnabled:!D.PH_CONNECT_EXTERNAL_PACKAGES_DISABLED}}const dt=zs(),Ks={isExternalControlsEnabled:dt.isExternalControlsEnabled},Ws={allowedDocumentTypes:dt.allowedDocumentTypes,isDragAndDropEnabled:dt.isDragAndDropEnabled};gs(D.PH_CONNECT_LOG_LEVEL);de.debug(`Setting log level to ${D.PH_CONNECT_LOG_LEVEL}.`);const Bo=Vs(D.PH_CONNECT_BASE_PATH||"/"),Ys=D.PH_CONNECT_ANALYTICS_DATABASE_NAME||`${Bo.replace(/\//g,"")}:analytics`,ce={appVersion:D.PH_CONNECT_VERSION,studioMode:D.PH_CONNECT_STUDIO_MODE,warnOutdatedApp:D.PH_CONNECT_WARN_OUTDATED_APP,appVersionCheckInterval:D.PH_CONNECT_VERSION_CHECK_INTERVAL,routerBasename:Bo,externalPackagesEnabled:!D.PH_CONNECT_EXTERNAL_PACKAGES_DISABLED,processors:{enabled:D.PH_CONNECT_PROCESSORS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED},analytics:{enabled:D.PH_CONNECT_ANALYTICS_ENABLED,databaseName:Ys,useWorker:!D.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED,driveAnalyticsEnabled:D.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,diffProcessorEnabled:D.PH_CONNECT_DIFF_ANALYTICS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED},relational:{enabled:D.PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED},renown:{url:D.PH_CONNECT_RENOWN_URL,networkId:D.PH_CONNECT_RENOWN_NETWORK_ID,chainId:D.PH_CONNECT_RENOWN_CHAIN_ID},sentry:{release:D.PH_CONNECT_SENTRY_RELEASE,dsn:D.PH_CONNECT_SENTRY_DSN,env:D.PH_CONNECT_SENTRY_ENV,tracing:D.PH_CONNECT_SENTRY_TRACING_ENABLED},content:{showSearchBar:D.PH_CONNECT_SEARCH_BAR_ENABLED,showDocumentModelSelectionSetting:!D.PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS},drives:{addDriveEnabled:!D.PH_CONNECT_DISABLE_ADD_DRIVE,preserveStrategy:D.PH_CONNECT_DRIVES_PRESERVE_STRATEGY,sections:{LOCAL:{enabled:D.PH_CONNECT_LOCAL_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES},CLOUD:{enabled:D.PH_CONNECT_CLOUD_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES},PUBLIC:{enabled:D.PH_CONNECT_PUBLIC_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES}}},gaTrackingId:D.PH_CONNECT_GA_TRACKING_ID,phCliVersion:D.PH_CONNECT_CLI_VERSION},Gs=ce.routerBasename,Vo=`${Gs}:acceptedCookies`,wr=new Set;let $t=Js();function Js(){try{const t=localStorage.getItem(Vo);return t?JSON.parse(t):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function Cn(){return $t}function Xs(t){$t=t($t),localStorage.setItem(Vo,JSON.stringify($t)),wr.forEach(e=>e())}function qs(t){return wr.add(t),()=>wr.delete(t)}const Yr=()=>[g.useSyncExternalStore(qs,Cn,Cn),Xs];async function Gr(){try{return(await me(()=>import("./hmr-LMNkvzP7.js"),[])).hmr}catch{return}}async function Uh(t){const e=await Gr();if(!e)throw new Error("HMR not available.");return new Promise(r=>{function n(o){t===o.name&&(r(),e?.off("studio:external-package-added",n))}e.on("studio:external-package-added",n),e.send("studio:add-external-package",{name:t})})}async function $h(t){const e=await Gr();if(!e)throw new Error("HMR not available.");return new Promise(r=>{function n(o){t===o.name&&(r(),e?.off("studio:external-package-removed",n))}e.on("studio:external-package-removed",n),e.send("studio:remove-external-package",{name:t})})}function Zs(){const t=g.useRef(void 0);g.useEffect(()=>{const e=async n=>{const o=window.ph?.vetraPackages||[],l=(await me(()=>import(`${n.url}?t=${n.timestamp}`),[])).default.map(xo),d=[...o.filter(u=>u.id==="powerhouse/common"),...l];zr(d)};async function r(){const n=await Gr();t.current=n,n?.on("studio:external-packages-updated",e)}return r().catch(de.error),()=>{t.current?.off("studio:external-packages-updated",e)}},[])}const Qs="connect";function Jr(t,e){const{type:r="default",containerId:n=Qs,...o}=e||{};return Xi(t,{type:r,containerId:n,...o})}const U=t=>typeof t=="string",vt=()=>{let t,e;const r=new Promise((n,o)=>{t=n,e=o});return r.resolve=t,r.reject=e,r},Sn=t=>t==null?"":""+t,el=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},tl=/###/g,Nn=t=>t&&t.indexOf("###")>-1?t.replace(tl,"."):t,Rn=t=>!t||U(t),Nt=(t,e,r)=>{const n=U(e)?e.split("."):e;let o=0;for(;o<n.length-1;){if(Rn(t))return{};const a=Nn(n[o]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++o}return Rn(t)?{}:{obj:t,k:Nn(n[o])}},bn=(t,e,r)=>{const{obj:n,k:o}=Nt(t,e,Object);if(n!==void 0||e.length===1){n[o]=r;return}let a=e[e.length-1],i=e.slice(0,e.length-1),s=Nt(t,i,Object);for(;s.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),s=Nt(t,i,Object),s?.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},rl=(t,e,r,n)=>{const{obj:o,k:a}=Nt(t,e,Object);o[a]=o[a]||[],o[a].push(r)},Yt=(t,e)=>{const{obj:r,k:n}=Nt(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},nl=(t,e,r)=>{const n=Yt(t,r);return n!==void 0?n:Yt(e,r)},Uo=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?U(t[n])||t[n]instanceof String||U(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):Uo(t[n],e[n],r):t[n]=e[n]);return t},at=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ol={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const al=t=>U(t)?t.replace(/[&<>"'\/]/g,e=>ol[e]):t;class il{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const sl=[" ",",","?","!",";"],ll=new il(20),cl=(t,e,r)=>{e=e||"",r=r||"";const n=sl.filter(i=>e.indexOf(i)<0&&r.indexOf(i)<0);if(n.length===0)return!0;const o=ll.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!o.test(t);if(!a){const i=t.indexOf(r);i>0&&!o.test(t.substring(0,i))&&(a=!0)}return a},Ar=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let o=t;for(let a=0;a<n.length;){if(!o||typeof o!="object")return;let i,s="";for(let l=a;l<n.length;++l)if(l!==a&&(s+=r),s+=n[l],i=o[s],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}o=i}return o},Rt=t=>t?.replace("_","-"),ul={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Gt{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||ul,this.options=r,this.debug=r.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,r,n,o){return o&&!this.debug?null:(U(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new Gt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Gt(this.logger,e)}}var Oe=new Gt;class tr{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const o=this.observers[n].get(r)||0;this.observers[n].set(r,o+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([o,a])=>{for(let i=0;i<a;i++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,a])=>{for(let i=0;i<a;i++)o.apply(o,[e,...r])})}}class On extends tr{constructor(e,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n,o={}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,i=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):U(n)&&a?s.push(...n.split(a)):s.push(n)));const l=Yt(this.data,s);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!i||!U(n)?l:Ar(this.data?.[e]?.[r],n,a)}addResource(e,r,n,o,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),o=r,r=s[1]),this.addNamespaces(r),bn(this.data,s,o),a.silent||this.emit("added",e,r,n,o)}addResources(e,r,n,o={silent:!1}){for(const a in n)(U(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});o.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,o,a,i={silent:!1,skipCopy:!1}){let s=[e,r];e.indexOf(".")>-1&&(s=e.split("."),o=n,n=r,r=s[1]),this.addNamespaces(r);let l=Yt(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?Uo(l,n,a):l={...l,...n},bn(this.data,s,l),i.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var $o={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,o){return t.forEach(a=>{e=this.processors[a]?.process(e,r,n,o)??e}),e}};const zo=Symbol("i18next/PATH_KEY");function dl(){const t=[],e=Object.create(null);let r;return e.get=(n,o)=>(r?.revoke?.(),o===zo?t:(t.push(o),r=Proxy.revocable(n,e),r.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Jt(t,e){const{[zo]:r}=t(dl());return r.join(e?.keySeparator??".")}const xn={},fr=t=>!U(t)&&typeof t!="boolean"&&typeof t!="number";class Xt extends tr{constructor(e,r={}){super(),el(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Oe.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const o=this.resolve(e,n);if(o?.res===void 0)return!1;const a=fr(o.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!cl(e,n,o);if(i&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:U(a)?[a]:a};const c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(o)}return{key:e,namespaces:U(a)?[a]:a}}translate(e,r,n){let o=typeof r=="object"?{...r}:r;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),e==null)return"";typeof e=="function"&&(e=Jt(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const a=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],o),c=l[l.length-1];let d=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const u=o.lng||this.language,h=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return h?a?{res:`${c}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:s;const f=this.resolve(e,o);let m=f?.res;const y=f?.usedKey||s,S=f?.exactUsedKey||s,_=["[object Number]","[object Function]","[object RegExp]"],R=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,b=o.count!==void 0&&!U(o.count),w=Xt.hasDefaultValue(o),k=b?this.pluralResolver.getSuffix(u,o.count,o):"",E=o.ordinal&&b?this.pluralResolver.getSuffix(u,o.count,{ordinal:!1}):"",x=b&&!o.ordinal&&o.count===0,j=x&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${k}`]||o[`defaultValue${E}`]||o.defaultValue;let H=m;L&&!m&&w&&(H=j);const $=fr(H),B=Object.prototype.toString.apply(H);if(L&&H&&$&&_.indexOf(B)<0&&!(U(R)&&Array.isArray(H))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,H,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(f.res=Y,f.usedParams=this.getUsedParamsDetails(o),f):Y}if(i){const Y=Array.isArray(H),G=Y?[]:{},ge=Y?S:y;for(const ue in H)if(Object.prototype.hasOwnProperty.call(H,ue)){const q=`${ge}${i}${ue}`;w&&!m?G[ue]=this.translate(q,{...o,defaultValue:fr(j)?j[ue]:void 0,joinArrays:!1,ns:l}):G[ue]=this.translate(q,{...o,joinArrays:!1,ns:l}),G[ue]===q&&(G[ue]=H[ue])}m=G}}else if(L&&U(R)&&Array.isArray(m))m=m.join(R),m&&(m=this.extendTranslation(m,e,o,n));else{let Y=!1,G=!1;!this.isValidLookup(m)&&w&&(Y=!0,m=j),this.isValidLookup(m)||(G=!0,m=s);const ue=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:m,q=w&&j!==m&&this.options.updateMissing;if(G||Y||q){if(this.logger.log(q?"updateKey":"missingKey",u,c,s,q?j:m),i){const ie=this.resolve(s,{...o,keySeparator:!1});ie&&ie.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 te=[];const xe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&xe&&xe[0])for(let ie=0;ie<xe.length;ie++)te.push(xe[ie]);else this.options.saveMissingTo==="all"?te=this.languageUtils.toResolveHierarchy(o.lng||this.language):te.push(o.lng||this.language);const Ae=(ie,fe,_e)=>{const Te=w&&_e!==m?_e:ue;this.options.missingKeyHandler?this.options.missingKeyHandler(ie,c,fe,Te,q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ie,c,fe,Te,q,o),this.emit("missingKey",ie,c,fe,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?te.forEach(ie=>{const fe=this.pluralResolver.getSuffixes(ie,o);x&&o[`defaultValue${this.options.pluralSeparator}zero`]&&fe.indexOf(`${this.options.pluralSeparator}zero`)<0&&fe.push(`${this.options.pluralSeparator}zero`),fe.forEach(_e=>{Ae([ie],s+_e,o[`defaultValue${_e}`]||j)})}):Ae(te,s,j))}m=this.extendTranslation(m,e,o,f,n),G&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${c}${d}${s}`),(G||Y)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${s}`:s,Y?m:void 0,o))}return a?(f.res=m,f.usedParams=this.getUsedParamsDetails(o),f):m}extendTranslation(e,r,n,o,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const l=U(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const u=e.match(this.interpolator.nestingRegexp);c=u&&u.length}let d=n.replace&&!U(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||o.usedLng,n),l){const u=e.match(this.interpolator.nestingRegexp),h=u&&u.length;c<h&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...u)=>a?.[0]===u[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${r[0]}`),null):this.translate(...u,r),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=U(i)?[i]:i;return e!=null&&s?.length&&n.applyPostProcessor!==!1&&(e=$o.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,o,a,i,s;return U(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;o=d;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const h=r.count!==void 0&&!U(r.count),f=h&&!r.ordinal&&r.count===0,m=r.context!==void 0&&(U(r.context)||typeof r.context=="number")&&r.context!=="",y=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(S=>{this.isValidLookup(n)||(s=S,!xn[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(xn[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" 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(_=>{if(this.isValidLookup(n))return;i=_;const R=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(R,d,_,S,r);else{let b;h&&(b=this.pluralResolver.getSuffix(_,r.count,r));const w=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(r.ordinal&&b.indexOf(k)===0&&R.push(d+b.replace(k,this.options.pluralSeparator)),R.push(d+b),f&&R.push(d+w)),m){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;R.push(E),h&&(r.ordinal&&b.indexOf(k)===0&&R.push(E+b.replace(k,this.options.pluralSeparator)),R.push(E+b),f&&R.push(E+w))}}let L;for(;L=R.pop();)this.isValidLookup(n)||(a=L,n=this.getResource(_,S,L,r))}))})}),{res:n,usedKey:o,exactUsedKey:a,usedLng:i,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,r,n,o):this.resourceStore.getResource(e,r,n,o)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!U(e.replace);let o=n?e.replace:e;if(n&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const a of r)delete o[a]}return o}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}class Dn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oe.create("languageUtils")}getScriptPartFromCode(e){if(e=Rt(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Rt(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(U(e)&&e.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const o=this.getScriptPartFromCode(n);if(this.isSupportedCode(o))return r=o;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),o=[],a=i=>{i&&(this.isSupportedCode(i)?o.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return U(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):U(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{o.indexOf(i)<0&&a(this.formatLanguageCode(i))}),o}}const Ln={zero:0,one:1,two:2,few:3,many:4,other:5},Pn={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class fl{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=Oe.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=Rt(e==="dev"?"en":e),o=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Pn;if(!e.match(/-|_/))return Pn;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,r)}return this.pluralRulesCache[a]=i,i}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(o=>`${r}${o}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((o,a)=>Ln[o]-Ln[a]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(e,r,n={}){const o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const wn=(t,e,r,n=".",o=!0)=>{let a=nl(t,e,r);return!a&&o&&U(r)&&(a=Ar(t,r,n),a===void 0&&(a=Ar(e,r,n))),a},hr=t=>t.replace(/\$/g,"$$$$");class hl{constructor(e={}){this.logger=Oe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:o,prefix:a,prefixEscaped:i,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:_,alwaysFormat:R}=e.interpolation;this.escape=r!==void 0?r:al,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?at(a):i||"{{",this.suffix=s?at(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?at(h):f||at("$t("),this.nestingSuffix=m?at(m):y||at(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=_||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"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,r,n,o){let a,i,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const _=wn(r,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,n,{...o,...r,interpolationkey:f}):_}const m=f.split(this.formatSeparator),y=m.shift().trim(),S=m.join(this.formatSeparator).trim();return this.format(wn(r,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,{...o,...r,interpolationkey:y})};this.resetRegExp();const d=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>hr(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?hr(this.escape(f)):hr(f)}].forEach(f=>{for(s=0;a=f.regex.exec(e);){const m=a[1].trim();if(i=c(m),i===void 0)if(typeof d=="function"){const S=d(e,a,o);i=U(S)?S:""}else if(o&&Object.prototype.hasOwnProperty.call(o,m))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),i="";else!U(i)&&!this.useRawValueToEscape&&(i=Sn(i));const y=f.safeValue(i);if(e=e.replace(a[0],y),u?(f.regex.lastIndex+=i.length,f.regex.lastIndex-=a[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let o,a,i;const s=(l,c)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const u=l.split(new RegExp(`${d}[ ]*{`));let h=`{${u[1]}`;l=u[0],h=this.interpolate(h,i);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{i=JSON.parse(h),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${h}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;o=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!U(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const c=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(c!==-1&&(l=o[1].slice(c).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),a=r(s.call(this,o[1].trim(),i),i),a&&o[0]===e&&!U(a))return a;U(a)||(a=Sn(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,u)=>this.format(d,u,n.lng,{...n,interpolationkey:o[1].trim()}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}const pl=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);e==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(i=>{if(i){const[s,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=c),c==="false"&&(r[d]=!1),c==="true"&&(r[d]=!0),isNaN(c)||(r[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:r}},An=t=>{const e={};return(r,n,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const i=n+JSON.stringify(a);let s=e[i];return s||(s=t(Rt(n),o),e[i]=s),s(r)}},gl=t=>(e,r,n)=>t(Rt(r),n)(e);class ml{constructor(e={}){this.logger=Oe.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?An:gl;this.formats={number:n((o,a)=>{const i=new Intl.NumberFormat(o,{...a});return s=>i.format(s)}),currency:n((o,a)=>{const i=new Intl.NumberFormat(o,{...a,style:"currency"});return s=>i.format(s)}),datetime:n((o,a)=>{const i=new Intl.DateTimeFormat(o,{...a});return s=>i.format(s)}),relativetime:n((o,a)=>{const i=new Intl.RelativeTimeFormat(o,{...a});return s=>i.format(s,a.range||"day")}),list:n((o,a)=>{const i=new Intl.ListFormat(o,{...a});return s=>i.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=An(r)}format(e,r,n,o={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{const{formatName:c,formatOptions:d}=pl(l);if(this.formats[c]){let u=s;try{const h=o?.formatParams?.[o.interpolationkey]||{},f=h.locale||h.lng||o.locale||o.lng||n;u=this.formats[c](s,f,{...d,...o,...h})}catch(h){this.logger.warn(h)}return u}else this.logger.warn(`there was no format function for ${c}`);return s},e)}}const vl=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class El extends tr{constructor(e,r,n,o={}){super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=Oe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,r,n,o){const a={},i={},s={},l={};return e.forEach(c=>{let d=!0;r.forEach(u=>{const h=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,u)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?i[h]===void 0&&(i[h]=!0):(this.state[h]=1,d=!1,i[h]===void 0&&(i[h]=!0),a[h]===void 0&&(a[h]=!0),l[u]===void 0&&(l[u]=!0)))}),d||(s[c]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const o=e.split("|"),a=o[0],i=o[1];r&&this.emit("failedLoading",a,i,r),!r&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{rl(l.loaded,[a],i),vl(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(u=>{s[c][u]===void 0&&(s[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,o=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:o,wait:a,callback:i});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&d&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,o+1,a*2,i)},a);return}i(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(e,r,s)}prepareLoading(e,r,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(r)&&(r=[r]);const a=this.queueLoad(e,r,n,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),o=n[0],a=n[1];this.read(o,a,"read",void 0,void 0,(i,s)=>{i&&this.logger.warn(`${r}loading namespace ${a} for language ${o} failed`,i),!i&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${o}`,s),this.loaded(e,i,s)})}saveMissing(e,r,n,o,a,i={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend?.create){const l={...i,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,r,n,o,l):d=c(e,r,n,o),d&&typeof d.then=="function"?d.then(u=>s(null,u)).catch(s):s(null,d)}catch(d){s(d)}else c(e,r,n,o,s,l)}!e||!e[0]||this.store.addResource(e[0],r,n,o)}}}const Tn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),U(t[1])&&(e.defaultValue=t[1]),U(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),In=t=>(U(t.ns)&&(t.ns=[t.ns]),U(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),U(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Bt=()=>{},yl=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class bt extends tr{constructor(e={},r){if(super(),this.options=In(e),this.services={},this.logger=Oe,this.modules={external:[]},yl(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(U(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Tn();this.options={...n,...this.options,...In(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?Oe.init(o(this.modules.logger),this.options):Oe.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=ml;const d=new Dn(this.options);this.store=new On(this.options.resources,this.options);const u=this.services;u.logger=Oe,u.resourceStore=this.store,u.languageUtils=d,u.pluralResolver=new fl(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=o(c),u.formatter.init&&u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new hl(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new El(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Xt(this.services,this.options),this.translator.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Bt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...d)=>this.store[c](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...d)=>(this.store[c](...d),this)});const s=vt(),l=()=>{const c=(d,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(u),r(d,u)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(e,r=Bt){let n=r;const o=U(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],i=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>i(l)),this.options.preload?.forEach?.(s=>i(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(e,r,n){const o=vt();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=Bt),this.services.backendConnector.reload(e,r,a=>{o.resolve(),n(a)}),o}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"&&$o.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,r){this.isLanguageChangingTo=e;const n=vt();this.emit("languageChanging",e);const o=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,l)=>{l?this.isLanguageChangingTo===e&&(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),r&&r(s,(...c)=>this.t(...c))},i=s=>{!e&&!s&&this.services.languageDetector&&(s=[]);const l=U(s)?s:s&&s[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(U(s)?[s]:s);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,r,n){const o=(a,i,...s)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(s)):l={...i},l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||o.keyPrefix);const c=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(a)?d=a.map(u=>(typeof u=="function"&&(u=Jt(u,{...this.options,...i})),`${l.keyPrefix}${c}${u}`)):(typeof a=="function"&&(a=Jt(a,{...this.options,...i})),d=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a),this.t(d,l)};return U(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){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 n=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(r.precheck){const s=r.precheck(this,i);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!o||i(a,e)))}loadNamespaces(e,r){const n=vt();return this.options.ns?(U(e)&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=vt();U(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(i=>o.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=o.concat(a),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["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"],n=this.services?.languageUtils||new Dn(Tn());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){return new bt(e,r)}cloneInstance(e={},r=Bt){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},a=new bt(o);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((d,u)=>(d[u]={...l[c][u]},d),l[c]),l),{});a.store=new On(s,o),a.services.resourceStore=a.store}return a.translator=new Xt(a.services,o),a.translator.on("*",(s,...l)=>{a.emit(s,...l)}),a.init(o,r),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pe=bt.createInstance();pe.createInstance=bt.createInstance;pe.createInstance;pe.dir;pe.init;pe.loadResources;pe.reloadResources;pe.use;pe.changeLanguage;pe.getFixedT;const zh=pe.t;pe.exists;pe.setDefaultNamespace;pe.hasLoadedNamespace;pe.loadNamespaces;pe.loadLanguages;var pr,kn;function _l(){return kn||(kn=1,pr={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}),pr}var Cl=_l();const Sl=cs(Cl);var Nl=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Hn(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(Sl[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var o=new RegExp(Nl),a=null;(a=o.exec(t))!==null;)if(a[0].trim())if(a[1]){var i=a[1].trim(),s=[i,""];i.indexOf("=")>-1&&(s=i.split("=")),e.attrs[s[0]]=s[1],o.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var Rl=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,bl=/^\s*$/,Ol=Object.create(null);function Ko(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?(function(r){var n=[];for(var o in r)n.push(o+'="'+r[o]+'"');return n.length?" "+n.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(Ko,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var xl={parse:function(t,e){e||(e={}),e.components||(e.components=Ol);var r,n=[],o=[],a=-1,i=!1;if(t.indexOf("<")!==0){var s=t.indexOf("<");n.push({type:"text",content:s===-1?t:t.substring(0,s)})}return t.replace(Rl,function(l,c){if(i){if(l!=="</"+r.name+">")return;i=!1}var d,u=l.charAt(1)!=="/",h=l.startsWith("<!--"),f=c+l.length,m=t.charAt(f);if(h){var y=Hn(l);return a<0?(n.push(y),n):((d=o[a]).children.push(y),n)}if(u&&(a++,(r=Hn(l)).type==="tag"&&e.components[r.name]&&(r.type="component",i=!0),r.voidElement||i||!m||m==="<"||r.children.push({type:"text",content:t.slice(f,t.indexOf("<",f))}),a===0&&n.push(r),(d=o[a-1])&&d.children.push(r),o[a]=r),(!u||r.voidElement)&&(a>-1&&(r.voidElement||r.name===l.slice(2,-1))&&(a--,r=a===-1?n:o[a]),!i&&m!=="<"&&m)){d=a===-1?n:o[a].children;var S=t.indexOf("<",f),_=t.slice(f,S===-1?void 0:S);bl.test(_)&&(_=" "),(S>-1&&a+d.length>=0||_!==" ")&&d.push({type:"text",content:_})}}),n},stringify:function(t){return t.reduce(function(e,r){return e+Ko("",r)},"")}};const zt=(t,e,r,n)=>{const o=[r,{code:e,...n||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(o,"warn","react-i18next::",!0);Se(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...o):console?.warn&&console.warn(...o)},Mn={},rr=(t,e,r,n)=>{Se(r)&&Mn[r]||(Se(r)&&(Mn[r]=new Date),zt(t,e,r,n))},Wo=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},Tr=(t,e,r)=>{t.loadNamespaces(e,Wo(t,r))},jn=(t,e,r,n)=>{if(Se(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Tr(t,r,n);r.forEach(o=>{t.options.ns.indexOf(o)<0&&t.options.ns.push(o)}),t.loadLanguages(e,Wo(t,n))},Dl=(t,e,r={})=>!e.languages||!e.languages.length?(rr(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,o)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,t))return!1}}),Se=t=>typeof t=="string",je=t=>typeof t=="object"&&t!==null,Ll=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pl={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wl=t=>Pl[t],Al=t=>t.replace(Ll,wl);let Ir={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Al};const Tl=(t={})=>{Ir={...Ir,...t}},Yo=()=>Ir;let Go;const Il=t=>{Go=t},Xr=()=>Go,gr=(t,e)=>{if(!t)return!1;const r=t.props?.children??t.children;return e?r.length>0:!!r},mr=t=>{if(!t)return[];const e=t.props?.children??t.children;return t.props?.i18nIsDynamicList?ut(e):e},kl=t=>Array.isArray(t)&&t.every(g.isValidElement),ut=t=>Array.isArray(t)?t:[t],Hl=(t,e)=>{const r={...e};return r.props=Object.assign(t.props,e.props),r},Jo=(t,e,r,n)=>{if(!t)return"";let o="";const a=ut(t),i=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Se(s)){o+=`${s}`;return}if(g.isValidElement(s)){const{props:c,type:d}=s,u=Object.keys(c).length,h=i.indexOf(d)>-1,f=c.children;if(!f&&h&&!u){o+=`<${d}/>`;return}if(!f&&(!h||u)||c.i18nIsDynamicList){o+=`<${l}></${l}>`;return}if(h&&u===1&&Se(f)){o+=`<${d}>${f}</${d}>`;return}const m=Jo(f,e,r,n);o+=`<${l}>${m}</${l}>`;return}if(s===null){zt(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(je(s)){const{format:c,...d}=s,u=Object.keys(d);if(u.length===1){const h=c?`${u[0]}, ${c}`:u[0];o+=`{{${h}}}`;return}zt(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}zt(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),o},Ml=(t,e=[],r={})=>{if(!t)return t;const n=Object.keys(r),o=[...e,...n];let a="",i=0;for(;i<t.length;)if(t[i]==="<"){let s=!1;const l=t.slice(i).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/);if(l){const c=l[1];(/^\d+$/.test(c)||o.includes(c))&&(s=!0,a+=l[0],i+=l[0].length)}if(!s){const c=t.slice(i).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(c){const d=c[1];(/^\d+$/.test(d)||o.includes(d))&&(s=!0,a+=c[0],i+=c[0].length)}}s||(a+="<",i+=1)}else a+=t[i],i+=1;return a},jl=(t,e,r,n,o,a,i)=>{if(r==="")return[];const s=o.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(R=>`<${R}`).join("|")).test(r);if(!t&&!e&&!l&&!i)return[r];const c=e??{},d=R=>{ut(R).forEach(b=>{Se(b)||(gr(b)?d(mr(b)):je(b)&&!g.isValidElement(b)&&Object.assign(c,b))})};d(t);const u=Ml(r,s,c),h=xl.parse(`<0>${u}</0>`),f={...c,...a},m=(R,L,b)=>{const w=mr(R),k=S(w,L.children,b);return kl(w)&&k.length===0||R.props?.i18nIsDynamicList?w:k},y=(R,L,b,w,k)=>{R.dummy?(R.children=L,b.push(g.cloneElement(R,{key:w},k?void 0:L))):b.push(...g.Children.map([R],E=>{const x={...E.props};return delete x.i18nIsDynamicList,g.createElement(E.type,{...x,key:w,ref:E.props.ref??E.ref},k?null:L)}))},S=(R,L,b)=>{const w=ut(R);return ut(L).reduce((E,x,j)=>{const H=x.children?.[0]?.content&&n.services.interpolator.interpolate(x.children[0].content,f,n.language);if(x.type==="tag"){let $=w[parseInt(x.name,10)];!$&&e&&($=e[x.name]),b.length===1&&!$&&($=b[0][x.name]),$||($={});const B=Object.keys(x.attrs).length!==0?Hl({props:x.attrs},$):$,Y=g.isValidElement(B),G=Y&&gr(x,!0)&&!x.voidElement,ge=l&&je(B)&&B.dummy&&!Y,ue=je(e)&&Object.hasOwnProperty.call(e,x.name);if(Se(B)){const q=n.services.interpolator.interpolate(B,f,n.language);E.push(q)}else if(gr(B)||G){const q=m(B,x,b);y(B,q,E,j)}else if(ge){const q=S(w,x.children,b);y(B,q,E,j)}else if(Number.isNaN(parseFloat(x.name)))if(ue){const q=m(B,x,b);y(B,q,E,j,x.voidElement)}else if(o.transSupportBasicHtmlNodes&&s.indexOf(x.name)>-1)if(x.voidElement)E.push(g.createElement(x.name,{key:`${x.name}-${j}`}));else{const q=S(w,x.children,b);E.push(g.createElement(x.name,{key:`${x.name}-${j}`},q))}else if(x.voidElement)E.push(`<${x.name} />`);else{const q=S(w,x.children,b);E.push(`<${x.name}>${q}</${x.name}>`)}else if(je(B)&&!Y){const q=x.children[0]?H:null;q&&E.push(q)}else y(B,H,E,j,x.children.length!==1||!H)}else if(x.type==="text"){const $=o.transWrapTextNodes,B=i?o.unescape(n.services.interpolator.interpolate(x.content,f,n.language)):n.services.interpolator.interpolate(x.content,f,n.language);$?E.push(g.createElement($,{key:`${x.name}-${j}`},B)):E.push(B)}return E},[])},_=S([{dummy:!0,children:t||[]}],h,ut(t||[]));return mr(_[0])},Xo=(t,e,r)=>{const n=t.key||e,o=g.cloneElement(t,{key:n});if(!o.props||!o.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return o;function a(){return g.createElement(g.Fragment,null,o)}return g.createElement(a,{key:n})},Fl=(t,e)=>t.map((r,n)=>Xo(r,n,e)),Bl=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Xo(t[n],n,e)})}),r},Vl=(t,e,r,n)=>t?Array.isArray(t)?Fl(t,e):je(t)?Bl(t,e):(rr(r,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null,Ul=t=>!je(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function $l({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a={},values:i,defaults:s,components:l,ns:c,i18n:d,t:u,shouldUnescape:h,...f}){const m=d||Xr();if(!m)return rr(m,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:n}),t;const y=u||m.t.bind(m)||(G=>G),S={...Yo(),...m.options?.react};let _=c||y.ns||m.options?.defaultNS;_=Se(_)?[_]:_||["translation"];const R=Jo(t,S,m,n),L=s||a?.defaultValue||R||S.transEmptyNodeValue||(typeof n=="function"?Jt(n):n),{hashTransKey:b}=S,w=n||(b?b(R||L):R||L);m.options?.interpolation?.defaultVariables&&(i=i&&Object.keys(i).length>0?{...i,...m.options.interpolation.defaultVariables}:{...m.options.interpolation.defaultVariables});const k=i||e!==void 0&&!m.options?.interpolation?.alwaysFormat||!t?a.interpolation:{interpolation:{...a.interpolation,prefix:"#$?",suffix:"?$#"}},E={...a,context:o||a.context,count:e,...i,...k,defaultValue:s||a?.defaultValue,ns:_};let x=w?y(w,E):L;x===w&&L&&(x=L);const j=Vl(l,x,m,n);let H=j||t,$=null;Ul(j)&&($=j,H=t);const B=jl(H,$,x,m,S,E,h),Y=r??S.defaultTransParent;return Y?g.createElement(Y,f,B):B}const zl={type:"3rdParty",init(t){Tl(t.options.react),Il(t)}},qo=g.createContext();class Kl{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Wl({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a={},values:i,defaults:s,components:l,ns:c,i18n:d,t:u,shouldUnescape:h,...f}){const{i18n:m,defaultNS:y}=g.useContext(qo)||{},S=d||m||Xr(),_=u||S?.t.bind(S);return $l({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a,values:i,defaults:s,components:l,ns:c||_?.ns||y||S?.options?.defaultNS,i18n:S,t:u,shouldUnescape:h,...f})}var vr={exports:{}},Er={};var Fn;function Yl(){if(Fn)return Er;Fn=1;var t=us();function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,o=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(u,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),y=m[0].inst,S=m[1];return a(function(){y.value=f,y.getSnapshot=h,l(y)&&S({inst:y})},[u,f,h]),o(function(){return l(y)&&S({inst:y}),u(function(){l(y)&&S({inst:y})})},[u]),i(f),f}function l(u){var h=u.getSnapshot;u=u.value;try{var f=h();return!r(u,f)}catch{return!0}}function c(u,h){return h()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Er.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Er}var Bn;function Gl(){return Bn||(Bn=1,vr.exports=Yl()),vr.exports}var Jl=Gl();const Xl=(t,e)=>Se(e)?e:je(e)&&Se(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t,ql={t:Xl,ready:!1},Zl=()=>()=>{},Zo=(t,e={})=>{const{i18n:r}=e,{i18n:n,defaultNS:o}=g.useContext(qo)||{},a=r||n||Xr();a&&!a.reportNamespaces&&(a.reportNamespaces=new Kl),a||rr(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const i=g.useMemo(()=>({...Yo(),...a?.options?.react,...e}),[a,e]),{useSuspense:s,keyPrefix:l}=i,c=g.useMemo(()=>{const b=o||a?.options?.defaultNS;return Se(b)?[b]:b||["translation"]},[t,o,a]);a?.reportNamespaces?.addUsedNamespaces?.(c);const d=g.useRef(0),u=g.useCallback(b=>{if(!a)return Zl;const{bindI18n:w,bindI18nStore:k}=i,E=()=>{d.current+=1,b()};return w&&a.on(w,E),k&&a.store.on(k,E),()=>{w&&w.split(" ").forEach(x=>a.off(x,E)),k&&k.split(" ").forEach(x=>a.store.off(x,E))}},[a,i]),h=g.useRef(),f=g.useCallback(()=>{if(!a)return ql;const b=!!(a.isInitialized||a.initializedStoreOnce)&&c.every(H=>Dl(H,a,i)),w=e.lng||a.language,k=d.current,E=h.current;if(E&&E.ready===b&&E.lng===w&&E.keyPrefix===l&&E.revision===k)return E;const j={t:a.getFixedT(w,i.nsMode==="fallback"?c:c[0],l),ready:b,lng:w,keyPrefix:l,revision:k};return h.current=j,j},[a,c,l,i,e.lng]),[m,y]=g.useState(0),{t:S,ready:_}=Jl.useSyncExternalStore(u,f,f);g.useEffect(()=>{if(a&&!_&&!s){const b=()=>y(w=>w+1);e.lng?jn(a,e.lng,c,b):Tr(a,c,b)}},[a,e.lng,c,_,s,m]);const R=a||{},L=g.useMemo(()=>{const b=[S,R,_];return b.t=S,b.i18n=R,b.ready=_,b},[S,R,_]);if(a&&s&&!_)throw new Promise(b=>{const w=()=>b();e.lng?jn(a,e.lng,c,w):Tr(a,c,w)});return L},Ql=()=>{const{t}=Zo();return N.jsxs("div",{children:[N.jsx("p",{className:"font-medium",children:t("notifications.reloadApp")}),N.jsxs("button",{onClick:()=>location.reload(),className:"underline decoration-solid underline-offset-2",children:[t("common.reloadConnect")," 🔄"]})]})},ec=()=>{async function t(){const e=await ad();if(e!==null){if(e.isLatest||e.currentVersion.includes("-"))return!0;ce.studioMode||!ce.warnOutdatedApp?de.warn(`Connect is outdated:
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sentry_react-C4W8xEsl.js","assets/sentry_browser-BFJlXALZ.js","assets/AddDriveModal-7r-BM-yT.js","assets/reactor_browser-BbZdm6Aa.js","assets/document_drive-CP6paqKN.js","assets/document_model-DLxR7ZLO.js","assets/zod-C6yxFxyo.js","assets/graphql-BS4Brs_E.js","assets/config-CU-aFfVJ.js","assets/design_system_connect-DHQbQvgv.js","assets/design_system-CZfmC8Ij.js","assets/common-n2B-GsjO.js","assets/common-8r_LaZs4.css","assets/drive_explorer-IB_BS5Au.js","assets/graphql_request-9RNJ00DB.js","assets/document_model_editor-ButtI7kP.js","assets/ClearStorageModal-9gL_vLgY.js","assets/CookiesPolicyModal-BdPCCPNX.js","assets/CreateDocumentModal-C09c_nGK.js","assets/DebugSettingsModal-BkU8bK-I.js","assets/DeleteDriveModal-Ctt3VSe4.js","assets/DeleteItemModal-DZLHSQPf.js","assets/DisclaimerModal-BTFCt2N-.js","assets/DriveSettingsModal-B18X9rkK.js","assets/ExportDocumentWithErrorsModal-B_tnIZE0.js","assets/SettingsModal-BDHjn5Ac.js","assets/UpgradeDriveModal-kyIQAIjP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{w as xo,x as zr,j as N,v as Qe,y as Do,g as Kr,h as si,z as li,A as ci,B as ui,C as Wr,D as di,d as Lo,E as fi,F as hi,G as Po,H as pi,I as gi,J as mi,K as vi,f as Ei,L as yi,M as _i,N as Ci,O as Si,P as Ni,Q as Ri,R as bi,S as Oi,T as xi,U as Di,V as Li,W as Pi,X as wi,Y as Ai,Z as En,_ as Ti,$ as Ii,a0 as ki,a1 as Hi,a2 as Mi,a3 as ji,a4 as Fi,a5 as Bi,a6 as Vi,a7 as Ui,a8 as $i,s as St,a9 as ot,a as wo,aa as zi,ab as Ki,ac as Wi,ad as Ao,ae as Yi,af as yn,ag as Gi,ah as Ji}from"./reactor_browser-BbZdm6Aa.js";import{t as Xi,C as To,H as Io,A as qi,W as Zi,T as Qi,a as es,D as ts,b as rs,R as ns,c as os,d as as,S as is,e as ss,f as ls}from"./design_system_connect-DHQbQvgv.js";import{r as g,g as cs,b as us,R as ds,d as fs}from"./sentry_react-C4W8xEsl.js";import{o as we,a as ko,s as ae,e as Ho,n as hs,f as ps}from"./zod-C6yxFxyo.js";import{q as gs,l as de,t as Mo,B as ms,R as vs,I as Es,E as ys,v as jt,w as _s}from"./document_drive-CP6paqKN.js";import{_ as me,G as Dr}from"./drive_explorer-IB_BS5Au.js";import{Y as Cs,I as Lr,z as Ss}from"./design_system-CZfmC8Ij.js";import{K as Ns,J as Rs,L as Ft,j as jo,h as Fo,g as bs}from"./document_model-DLxR7ZLO.js";import{g as Os,r as xs}from"./graphql_request-9RNJ00DB.js";import{d as _n}from"./document_model_editor-ButtI7kP.js";import{ao as Ds}from"./sentry_browser-BFJlXALZ.js";import"./common-n2B-GsjO.js";import"./graphql-BS4Brs_E.js";import"./config-CU-aFfVJ.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();const Q=ko([ps(),Ho(["true","false"])]).transform(t=>typeof t=="boolean"?t:t==="true"),Pr=ko([hs(),ae()]).transform(t=>typeof t=="number"?t:parseInt(t,10)),Ls=we({PH_CONFIG_PATH:ae().optional(),PH_PACKAGES:ae().optional(),PH_LOCAL_PACKAGE:ae().optional(),PH_DISABLE_LOCAL_PACKAGE:Q.default(!1),PH_SENTRY_AUTH_TOKEN:ae().optional(),PH_SENTRY_ORG:ae().optional(),PH_SENTRY_PROJECT:ae().optional()}),Ps=we({PH_CONNECT_VERSION:ae().default("unknown"),PH_CONNECT_LOG_LEVEL:Ho(["debug","info","warn","error"]).default("info"),PH_CONNECT_REQUIRES_HARD_REFRESH:Q.default(!0),PH_CONNECT_WARN_OUTDATED_APP:Q.default(!1),PH_CONNECT_STUDIO_MODE:Q.default(!1),PH_CONNECT_BASE_PATH:ae().optional(),PH_CONNECT_DEFAULT_DRIVES_URL:ae().optional(),PH_CONNECT_DRIVES_PRESERVE_STRATEGY:ae().optional(),PH_CONNECT_VERSION_CHECK_INTERVAL:Pr.default(3600*1e3),PH_CONNECT_CLI_VERSION:ae().optional(),PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE:Pr.default(50)}),ws=we({PH_CONNECT_DISABLE_ADD_DRIVE:Q.default(!1),PH_CONNECT_SEARCH_BAR_ENABLED:Q.default(!1),PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS:Q.default(!0),PH_CONNECT_ENABLED_EDITORS:ae().optional(),PH_CONNECT_DISABLED_EDITORS:ae().default("powerhouse/document-drive"),PH_CONNECT_GA_TRACKING_ID:ae().optional(),PH_CONNECT_EXTERNAL_PACKAGES_DISABLED:Q.default(!1)}),As=we({PH_CONNECT_PUBLIC_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES:Q.default(!1),PH_CONNECT_CLOUD_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES:Q.default(!1),PH_CONNECT_LOCAL_DRIVES_ENABLED:Q.default(!0),PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES:Q.default(!1),PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES:Q.default(!1)}),Ts=we({PH_CONNECT_ANALYTICS_ENABLED:Q.default(!0),PH_CONNECT_ANALYTICS_DATABASE_NAME:ae().optional(),PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED:Q.default(!0),PH_CONNECT_DIFF_ANALYTICS_ENABLED:Q.default(!1),PH_CONNECT_DRIVE_ANALYTICS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED:Q.default(!0)}),Is=we({PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED:Q.default(!0)}),ks=we({PH_CONNECT_PROCESSORS_ENABLED:Q.default(!0),PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED:Q.default(!0)}),Hs=ks.merge(Ts).merge(Is),Ms=we({PH_CONNECT_SENTRY_RELEASE:ae().optional(),PH_CONNECT_SENTRY_DSN:ae().optional(),PH_CONNECT_SENTRY_ENV:ae().default("dev"),PH_CONNECT_SENTRY_TRACING_ENABLED:Q.default(!1)}),js=we({PH_CONNECT_RENOWN_URL:ae().default("https://auth.renown.id"),PH_CONNECT_RENOWN_NETWORK_ID:ae().default("eip155"),PH_CONNECT_RENOWN_CHAIN_ID:Pr.default(1)}),Ut=Ps.merge(ws).merge(As).merge(Hs).merge(Ms).merge(js);Ls.merge(Ut);function Fs(t,e,r){const{processEnv:n={},optionsEnv:o={},fileEnv:a={}}=t,i={};for(const s of e){const l=[{name:"process.env",value:n[s]},{name:"options",value:o[s]},{name:"fileEnv",value:a[s]}];for(const c of l){const d=c.value;if(!(d===void 0||d===""))try{const u=r.shape[s];if(u){u.parse(d),i[s]=d;break}console.warn(`Unknown environment variable: '${s}'`),i[s]=d;break}catch{const u=d===null?"null":typeof d=="object"?JSON.stringify(d):d;console.warn(`Invalid value for ${s} from ${c.name}: ${u}. Trying next source.`)}}}return i}function Bs(t={}){const e=new Set(Object.keys(Ut.shape)),r=Fs(t,e,Ut);return Ut.parse(r)}function Vs(t){let e=t;return e.startsWith(".")&&(e=e.slice(1)),e.startsWith("/")||(e=`/${e}`),e.endsWith("/")||(e=`${e}/`),e}const Us={BASE_URL:"/",DEV:!1,MODE:"production",PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED:"true",PH_CONNECT_ANALYTICS_ENABLED:"true",PH_CONNECT_CLOUD_DRIVES_ENABLED:"true",PH_CONNECT_DIFF_ANALYTICS_ENABLED:"false",PH_CONNECT_DISABLED_EDITORS:"powerhouse/document-drive",PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES:"false",PH_CONNECT_DISABLE_ADD_DRIVE:"false",PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES:"false",PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES:"false",PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES:"false",PH_CONNECT_DRIVE_ANALYTICS_ENABLED:"true",PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED:"true",PH_CONNECT_EXTERNAL_PACKAGES_DISABLED:"false",PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED:"true",PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED:"true",PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE:"50",PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS:"true",PH_CONNECT_LOCAL_DRIVES_ENABLED:"true",PH_CONNECT_LOG_LEVEL:"info",PH_CONNECT_PROCESSORS_ENABLED:"true",PH_CONNECT_PUBLIC_DRIVES_ENABLED:"true",PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED:"true",PH_CONNECT_RENOWN_CHAIN_ID:"1",PH_CONNECT_RENOWN_NETWORK_ID:"eip155",PH_CONNECT_RENOWN_URL:"https://auth.renown.id",PH_CONNECT_REQUIRES_HARD_REFRESH:"true",PH_CONNECT_SEARCH_BAR_ENABLED:"false",PH_CONNECT_SENTRY_ENV:"prod",PH_CONNECT_SENTRY_TRACING_ENABLED:"false",PH_CONNECT_STUDIO_MODE:"false",PH_CONNECT_VERSION:"4.1.0-dev.107",PH_CONNECT_VERSION_CHECK_INTERVAL:"3600000",PH_CONNECT_WARN_OUTDATED_APP:"false",PROD:!0,SSR:!1},D=Bs({processEnv:Us});function $s(t){return t.endsWith("/")?t:t+"/"}function zs(){const t=D.PH_CONNECT_BASE_PATH||"/",e=$s(t);return{basePath:t,routerBasename:e,allowList:void 0,allowedDocumentTypes:[],isDragAndDropEnabled:!0,isEditorDebugModeEnabled:!1,isEditorReadModeEnabled:!1,isExternalControlsEnabled:!1,version:D.PH_CONNECT_VERSION,logLevel:D.PH_CONNECT_LOG_LEVEL,requiresHardRefresh:D.PH_CONNECT_REQUIRES_HARD_REFRESH,warnOutdatedApp:D.PH_CONNECT_WARN_OUTDATED_APP,studioMode:D.PH_CONNECT_STUDIO_MODE,versionCheckInterval:D.PH_CONNECT_VERSION_CHECK_INTERVAL,cliVersion:D.PH_CONNECT_CLI_VERSION,fileUploadOperationsChunkSize:D.PH_CONNECT_FILE_UPLOAD_OPERATIONS_CHUNK_SIZE,gaTrackingId:D.PH_CONNECT_GA_TRACKING_ID,defaultDrivesUrl:D.PH_CONNECT_DEFAULT_DRIVES_URL,drivesPreserveStrategy:D.PH_CONNECT_DRIVES_PRESERVE_STRATEGY,enabledEditors:D.PH_CONNECT_ENABLED_EDITORS?.split(","),disabledEditors:D.PH_CONNECT_DISABLED_EDITORS.split(","),isExternalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED,isAnalyticsEnabled:D.PH_CONNECT_ANALYTICS_ENABLED,isAnalyticsExternalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED&&D.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,analyticsDatabaseName:D.PH_CONNECT_ANALYTICS_DATABASE_NAME,isRelationalProcessorsEnabled:D.PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED,isExternalRelationalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED&&D.PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED,renownUrl:D.PH_CONNECT_RENOWN_URL,renownNetworkId:D.PH_CONNECT_RENOWN_NETWORK_ID,renownChainId:D.PH_CONNECT_RENOWN_CHAIN_ID,sentryRelease:D.PH_CONNECT_SENTRY_RELEASE,sentryDsn:D.PH_CONNECT_SENTRY_DSN,sentryEnv:D.PH_CONNECT_SENTRY_ENV,isDiffAnalyticsEnabled:D.PH_CONNECT_DIFF_ANALYTICS_ENABLED,isDriveAnalyticsEnabled:D.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,isPublicDrivesEnabled:D.PH_CONNECT_PUBLIC_DRIVES_ENABLED,isCloudDrivesEnabled:D.PH_CONNECT_CLOUD_DRIVES_ENABLED,isLocalDrivesEnabled:D.PH_CONNECT_LOCAL_DRIVES_ENABLED,isSentryTracingEnabled:D.PH_CONNECT_SENTRY_TRACING_ENABLED,isDocumentModelSelectionSettingsEnabled:!D.PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS,isAddDriveEnabled:!D.PH_CONNECT_DISABLE_ADD_DRIVE,isAddPublicDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES,isDeletePublicDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES,isAddCloudDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES,isDeleteCloudDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES,isAddLocalDrivesEnabled:!D.PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES,isDeleteLocalDrivesEnabled:!D.PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES,isAnalyticsDatabaseWorkerEnabled:!D.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED,isExternalPackagesEnabled:!D.PH_CONNECT_EXTERNAL_PACKAGES_DISABLED}}const dt=zs(),Ks={isExternalControlsEnabled:dt.isExternalControlsEnabled},Ws={allowedDocumentTypes:dt.allowedDocumentTypes,isDragAndDropEnabled:dt.isDragAndDropEnabled};gs(D.PH_CONNECT_LOG_LEVEL);de.debug(`Setting log level to ${D.PH_CONNECT_LOG_LEVEL}.`);const Bo=Vs(D.PH_CONNECT_BASE_PATH||"/"),Ys=D.PH_CONNECT_ANALYTICS_DATABASE_NAME||`${Bo.replace(/\//g,"")}:analytics`,ce={appVersion:D.PH_CONNECT_VERSION,studioMode:D.PH_CONNECT_STUDIO_MODE,warnOutdatedApp:D.PH_CONNECT_WARN_OUTDATED_APP,appVersionCheckInterval:D.PH_CONNECT_VERSION_CHECK_INTERVAL,routerBasename:Bo,externalPackagesEnabled:!D.PH_CONNECT_EXTERNAL_PACKAGES_DISABLED,processors:{enabled:D.PH_CONNECT_PROCESSORS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED},analytics:{enabled:D.PH_CONNECT_ANALYTICS_ENABLED,databaseName:Ys,useWorker:!D.PH_CONNECT_ANALYTICS_DATABASE_WORKER_DISABLED,driveAnalyticsEnabled:D.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,diffProcessorEnabled:D.PH_CONNECT_DIFF_ANALYTICS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_PROCESSORS_ENABLED},relational:{enabled:D.PH_CONNECT_RELATIONAL_PROCESSORS_ENABLED,externalProcessorsEnabled:D.PH_CONNECT_EXTERNAL_RELATIONAL_PROCESSORS_ENABLED},renown:{url:D.PH_CONNECT_RENOWN_URL,networkId:D.PH_CONNECT_RENOWN_NETWORK_ID,chainId:D.PH_CONNECT_RENOWN_CHAIN_ID},sentry:{release:D.PH_CONNECT_SENTRY_RELEASE,dsn:D.PH_CONNECT_SENTRY_DSN,env:D.PH_CONNECT_SENTRY_ENV,tracing:D.PH_CONNECT_SENTRY_TRACING_ENABLED},content:{showSearchBar:D.PH_CONNECT_SEARCH_BAR_ENABLED,showDocumentModelSelectionSetting:!D.PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGS},drives:{addDriveEnabled:!D.PH_CONNECT_DISABLE_ADD_DRIVE,preserveStrategy:D.PH_CONNECT_DRIVES_PRESERVE_STRATEGY,sections:{LOCAL:{enabled:D.PH_CONNECT_LOCAL_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_LOCAL_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVES},CLOUD:{enabled:D.PH_CONNECT_CLOUD_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_CLOUD_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVES},PUBLIC:{enabled:D.PH_CONNECT_PUBLIC_DRIVES_ENABLED,allowAdd:!D.PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES,allowDelete:!D.PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVES}}},gaTrackingId:D.PH_CONNECT_GA_TRACKING_ID,phCliVersion:D.PH_CONNECT_CLI_VERSION},Gs=ce.routerBasename,Vo=`${Gs}:acceptedCookies`,wr=new Set;let $t=Js();function Js(){try{const t=localStorage.getItem(Vo);return t?JSON.parse(t):{analytics:!1,marketing:!1,functional:!1}}catch{return{analytics:!1,marketing:!1,functional:!1}}}function Cn(){return $t}function Xs(t){$t=t($t),localStorage.setItem(Vo,JSON.stringify($t)),wr.forEach(e=>e())}function qs(t){return wr.add(t),()=>wr.delete(t)}const Yr=()=>[g.useSyncExternalStore(qs,Cn,Cn),Xs];async function Gr(){try{return(await me(()=>import("./hmr-LMNkvzP7.js"),[])).hmr}catch{return}}async function Uh(t){const e=await Gr();if(!e)throw new Error("HMR not available.");return new Promise(r=>{function n(o){t===o.name&&(r(),e?.off("studio:external-package-added",n))}e.on("studio:external-package-added",n),e.send("studio:add-external-package",{name:t})})}async function $h(t){const e=await Gr();if(!e)throw new Error("HMR not available.");return new Promise(r=>{function n(o){t===o.name&&(r(),e?.off("studio:external-package-removed",n))}e.on("studio:external-package-removed",n),e.send("studio:remove-external-package",{name:t})})}function Zs(){const t=g.useRef(void 0);g.useEffect(()=>{const e=async n=>{const o=window.ph?.vetraPackages||[],l=(await me(()=>import(`${n.url}?t=${n.timestamp}`),[])).default.map(xo),d=[...o.filter(u=>u.id==="powerhouse/common"),...l];zr(d)};async function r(){const n=await Gr();t.current=n,n?.on("studio:external-packages-updated",e)}return r().catch(de.error),()=>{t.current?.off("studio:external-packages-updated",e)}},[])}const Qs="connect";function Jr(t,e){const{type:r="default",containerId:n=Qs,...o}=e||{};return Xi(t,{type:r,containerId:n,...o})}const U=t=>typeof t=="string",vt=()=>{let t,e;const r=new Promise((n,o)=>{t=n,e=o});return r.resolve=t,r.reject=e,r},Sn=t=>t==null?"":""+t,el=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},tl=/###/g,Nn=t=>t&&t.indexOf("###")>-1?t.replace(tl,"."):t,Rn=t=>!t||U(t),Nt=(t,e,r)=>{const n=U(e)?e.split("."):e;let o=0;for(;o<n.length-1;){if(Rn(t))return{};const a=Nn(n[o]);!t[a]&&r&&(t[a]=new r),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++o}return Rn(t)?{}:{obj:t,k:Nn(n[o])}},bn=(t,e,r)=>{const{obj:n,k:o}=Nt(t,e,Object);if(n!==void 0||e.length===1){n[o]=r;return}let a=e[e.length-1],i=e.slice(0,e.length-1),s=Nt(t,i,Object);for(;s.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),s=Nt(t,i,Object),s?.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},rl=(t,e,r,n)=>{const{obj:o,k:a}=Nt(t,e,Object);o[a]=o[a]||[],o[a].push(r)},Yt=(t,e)=>{const{obj:r,k:n}=Nt(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},nl=(t,e,r)=>{const n=Yt(t,r);return n!==void 0?n:Yt(e,r)},Uo=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?U(t[n])||t[n]instanceof String||U(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):Uo(t[n],e[n],r):t[n]=e[n]);return t},at=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ol={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const al=t=>U(t)?t.replace(/[&<>"'\/]/g,e=>ol[e]):t;class il{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const sl=[" ",",","?","!",";"],ll=new il(20),cl=(t,e,r)=>{e=e||"",r=r||"";const n=sl.filter(i=>e.indexOf(i)<0&&r.indexOf(i)<0);if(n.length===0)return!0;const o=ll.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!o.test(t);if(!a){const i=t.indexOf(r);i>0&&!o.test(t.substring(0,i))&&(a=!0)}return a},Ar=(t,e,r=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let o=t;for(let a=0;a<n.length;){if(!o||typeof o!="object")return;let i,s="";for(let l=a;l<n.length;++l)if(l!==a&&(s+=r),s+=n[l],i=o[s],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}o=i}return o},Rt=t=>t?.replace("_","-"),ul={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Gt{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||ul,this.options=r,this.debug=r.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,r,n,o){return o&&!this.debug?null:(U(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new Gt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Gt(this.logger,e)}}var Oe=new Gt;class tr{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const o=this.observers[n].get(r)||0;this.observers[n].set(r,o+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e,...r){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([o,a])=>{for(let i=0;i<a;i++)o(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,a])=>{for(let i=0;i<a;i++)o.apply(o,[e,...r])})}}class On extends tr{constructor(e,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n,o={}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,i=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):U(n)&&a?s.push(...n.split(a)):s.push(n)));const l=Yt(this.data,s);return!l&&!r&&!n&&e.indexOf(".")>-1&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!i||!U(n)?l:Ar(this.data?.[e]?.[r],n,a)}addResource(e,r,n,o,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(s=e.split("."),o=r,r=s[1]),this.addNamespaces(r),bn(this.data,s,o),a.silent||this.emit("added",e,r,n,o)}addResources(e,r,n,o={silent:!1}){for(const a in n)(U(n[a])||Array.isArray(n[a]))&&this.addResource(e,r,a,n[a],{silent:!0});o.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,o,a,i={silent:!1,skipCopy:!1}){let s=[e,r];e.indexOf(".")>-1&&(s=e.split("."),o=n,n=r,r=s[1]),this.addNamespaces(r);let l=Yt(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?Uo(l,n,a):l={...l,...n},bn(this.data,s,l),i.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var $o={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,o){return t.forEach(a=>{e=this.processors[a]?.process(e,r,n,o)??e}),e}};const zo=Symbol("i18next/PATH_KEY");function dl(){const t=[],e=Object.create(null);let r;return e.get=(n,o)=>(r?.revoke?.(),o===zo?t:(t.push(o),r=Proxy.revocable(n,e),r.proxy)),Proxy.revocable(Object.create(null),e).proxy}function Jt(t,e){const{[zo]:r}=t(dl());return r.join(e?.keySeparator??".")}const xn={},fr=t=>!U(t)&&typeof t!="boolean"&&typeof t!="number";class Xt extends tr{constructor(e,r={}){super(),el(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Oe.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,r={interpolation:{}}){const n={...r};if(e==null)return!1;const o=this.resolve(e,n);if(o?.res===void 0)return!1;const a=fr(o.res);return!(n.returnObjects===!1&&a)}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let a=r.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!cl(e,n,o);if(i&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:U(a)?[a]:a};const c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(o)}return{key:e,namespaces:U(a)?[a]:a}}translate(e,r,n){let o=typeof r=="object"?{...r}:r;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),e==null)return"";typeof e=="function"&&(e=Jt(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);const a=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,i=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],o),c=l[l.length-1];let d=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const u=o.lng||this.language,h=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return h?a?{res:`${c}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:`${c}${d}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(o)}:s;const f=this.resolve(e,o);let m=f?.res;const y=f?.usedKey||s,S=f?.exactUsedKey||s,_=["[object Number]","[object Function]","[object RegExp]"],R=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,b=o.count!==void 0&&!U(o.count),w=Xt.hasDefaultValue(o),k=b?this.pluralResolver.getSuffix(u,o.count,o):"",E=o.ordinal&&b?this.pluralResolver.getSuffix(u,o.count,{ordinal:!1}):"",x=b&&!o.ordinal&&o.count===0,j=x&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${k}`]||o[`defaultValue${E}`]||o.defaultValue;let H=m;L&&!m&&w&&(H=j);const $=fr(H),B=Object.prototype.toString.apply(H);if(L&&H&&$&&_.indexOf(B)<0&&!(U(R)&&Array.isArray(H))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,H,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(f.res=Y,f.usedParams=this.getUsedParamsDetails(o),f):Y}if(i){const Y=Array.isArray(H),G=Y?[]:{},ge=Y?S:y;for(const ue in H)if(Object.prototype.hasOwnProperty.call(H,ue)){const q=`${ge}${i}${ue}`;w&&!m?G[ue]=this.translate(q,{...o,defaultValue:fr(j)?j[ue]:void 0,joinArrays:!1,ns:l}):G[ue]=this.translate(q,{...o,joinArrays:!1,ns:l}),G[ue]===q&&(G[ue]=H[ue])}m=G}}else if(L&&U(R)&&Array.isArray(m))m=m.join(R),m&&(m=this.extendTranslation(m,e,o,n));else{let Y=!1,G=!1;!this.isValidLookup(m)&&w&&(Y=!0,m=j),this.isValidLookup(m)||(G=!0,m=s);const ue=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:m,q=w&&j!==m&&this.options.updateMissing;if(G||Y||q){if(this.logger.log(q?"updateKey":"missingKey",u,c,s,q?j:m),i){const ie=this.resolve(s,{...o,keySeparator:!1});ie&&ie.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 te=[];const xe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&xe&&xe[0])for(let ie=0;ie<xe.length;ie++)te.push(xe[ie]);else this.options.saveMissingTo==="all"?te=this.languageUtils.toResolveHierarchy(o.lng||this.language):te.push(o.lng||this.language);const Ae=(ie,fe,_e)=>{const Te=w&&_e!==m?_e:ue;this.options.missingKeyHandler?this.options.missingKeyHandler(ie,c,fe,Te,q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ie,c,fe,Te,q,o),this.emit("missingKey",ie,c,fe,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?te.forEach(ie=>{const fe=this.pluralResolver.getSuffixes(ie,o);x&&o[`defaultValue${this.options.pluralSeparator}zero`]&&fe.indexOf(`${this.options.pluralSeparator}zero`)<0&&fe.push(`${this.options.pluralSeparator}zero`),fe.forEach(_e=>{Ae([ie],s+_e,o[`defaultValue${_e}`]||j)})}):Ae(te,s,j))}m=this.extendTranslation(m,e,o,f,n),G&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${c}${d}${s}`),(G||Y)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${d}${s}`:s,Y?m:void 0,o))}return a?(f.res=m,f.usedParams=this.getUsedParamsDetails(o),f):m}extendTranslation(e,r,n,o,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const l=U(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const u=e.match(this.interpolator.nestingRegexp);c=u&&u.length}let d=n.replace&&!U(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||o.usedLng,n),l){const u=e.match(this.interpolator.nestingRegexp),h=u&&u.length;c<h&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...u)=>a?.[0]===u[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${r[0]}`),null):this.translate(...u,r),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,s=U(i)?[i]:i;return e!=null&&s?.length&&n.applyPostProcessor!==!1&&(e=$o.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,o,a,i,s;return U(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;o=d;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const h=r.count!==void 0&&!U(r.count),f=h&&!r.ordinal&&r.count===0,m=r.context!==void 0&&(U(r.context)||typeof r.context=="number")&&r.context!=="",y=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(S=>{this.isValidLookup(n)||(s=S,!xn[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(xn[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" 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(_=>{if(this.isValidLookup(n))return;i=_;const R=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(R,d,_,S,r);else{let b;h&&(b=this.pluralResolver.getSuffix(_,r.count,r));const w=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(r.ordinal&&b.indexOf(k)===0&&R.push(d+b.replace(k,this.options.pluralSeparator)),R.push(d+b),f&&R.push(d+w)),m){const E=`${d}${this.options.contextSeparator||"_"}${r.context}`;R.push(E),h&&(r.ordinal&&b.indexOf(k)===0&&R.push(E+b.replace(k,this.options.pluralSeparator)),R.push(E+b),f&&R.push(E+w))}}let L;for(;L=R.pop();)this.isValidLookup(n)||(a=L,n=this.getResource(_,S,L,r))}))})}),{res:n,usedKey:o,exactUsedKey:a,usedLng:i,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,r,n,o):this.resourceStore.getResource(e,r,n,o)}getUsedParamsDetails(e={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!U(e.replace);let o=n?e.replace:e;if(n&&typeof e.count<"u"&&(o.count=e.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const a of r)delete o[a]}return o}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}class Dn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oe.create("languageUtils")}getScriptPartFromCode(e){if(e=Rt(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=Rt(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(U(e)&&e.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const o=this.getScriptPartFromCode(n);if(this.isSupportedCode(o))return r=o;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return r=a;r=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),U(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],e),o=[],a=i=>{i&&(this.isSupportedCode(i)?o.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return U(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):U(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{o.indexOf(i)<0&&a(this.formatLanguageCode(i))}),o}}const Ln={zero:0,one:1,two:2,few:3,many:4,other:5},Pn={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class fl{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=Oe.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=Rt(e==="dev"?"en":e),o=r.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:o});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Pn;if(!e.match(/-|_/))return Pn;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,r)}return this.pluralRulesCache[a]=i,i}needsPlural(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,r,n={}){return this.getSuffixes(e,n).map(o=>`${r}${o}`)}getSuffixes(e,r={}){let n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((o,a)=>Ln[o]-Ln[a]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(e,r,n={}){const o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const wn=(t,e,r,n=".",o=!0)=>{let a=nl(t,e,r);return!a&&o&&U(r)&&(a=Ar(t,r,n),a===void 0&&(a=Ar(e,r,n))),a},hr=t=>t.replace(/\$/g,"$$$$");class hl{constructor(e={}){this.logger=Oe.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:o,prefix:a,prefixEscaped:i,suffix:s,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:_,alwaysFormat:R}=e.interpolation;this.escape=r!==void 0?r:al,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=a?at(a):i||"{{",this.suffix=s?at(s):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?at(h):f||at("$t("),this.nestingSuffix=m?at(m):y||at(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=_||1e3,this.alwaysFormat=R!==void 0?R:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>r?.source===n?(r.lastIndex=0,r):new RegExp(n,"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,r,n,o){let a,i,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const _=wn(r,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,n,{...o,...r,interpolationkey:f}):_}const m=f.split(this.formatSeparator),y=m.shift().trim(),S=m.join(this.formatSeparator).trim();return this.format(wn(r,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,{...o,...r,interpolationkey:y})};this.resetRegExp();const d=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>hr(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?hr(this.escape(f)):hr(f)}].forEach(f=>{for(s=0;a=f.regex.exec(e);){const m=a[1].trim();if(i=c(m),i===void 0)if(typeof d=="function"){const S=d(e,a,o);i=U(S)?S:""}else if(o&&Object.prototype.hasOwnProperty.call(o,m))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),i="";else!U(i)&&!this.useRawValueToEscape&&(i=Sn(i));const y=f.safeValue(i);if(e=e.replace(a[0],y),u?(f.regex.lastIndex+=i.length,f.regex.lastIndex-=a[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let o,a,i;const s=(l,c)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const u=l.split(new RegExp(`${d}[ ]*{`));let h=`{${u[1]}`;l=u[0],h=this.interpolate(h,i);const f=h.match(/'/g),m=h.match(/"/g);((f?.length??0)%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{i=JSON.parse(h),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${h}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;o=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!U(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const c=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(c!==-1&&(l=o[1].slice(c).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),a=r(s.call(this,o[1].trim(),i),i),a&&o[0]===e&&!U(a))return a;U(a)||(a=Sn(a)),a||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),a=""),l.length&&(a=l.reduce((d,u)=>this.format(d,u,n.lng,{...n,interpolationkey:o[1].trim()}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}const pl=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);e==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):e==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(i=>{if(i){const[s,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=c),c==="false"&&(r[d]=!1),c==="true"&&(r[d]=!0),isNaN(c)||(r[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:r}},An=t=>{const e={};return(r,n,o)=>{let a=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(a={...a,[o.interpolationkey]:void 0});const i=n+JSON.stringify(a);let s=e[i];return s||(s=t(Rt(n),o),e[i]=s),s(r)}},gl=t=>(e,r,n)=>t(Rt(r),n)(e);class ml{constructor(e={}){this.logger=Oe.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?An:gl;this.formats={number:n((o,a)=>{const i=new Intl.NumberFormat(o,{...a});return s=>i.format(s)}),currency:n((o,a)=>{const i=new Intl.NumberFormat(o,{...a,style:"currency"});return s=>i.format(s)}),datetime:n((o,a)=>{const i=new Intl.DateTimeFormat(o,{...a});return s=>i.format(s)}),relativetime:n((o,a)=>{const i=new Intl.RelativeTimeFormat(o,{...a});return s=>i.format(s,a.range||"day")}),list:n((o,a)=>{const i=new Intl.ListFormat(o,{...a});return s=>i.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=An(r)}format(e,r,n,o={}){const a=r.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(s=>s.indexOf(")")>-1)){const s=a.findIndex(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,s)].join(this.formatSeparator)}return a.reduce((s,l)=>{const{formatName:c,formatOptions:d}=pl(l);if(this.formats[c]){let u=s;try{const h=o?.formatParams?.[o.interpolationkey]||{},f=h.locale||h.lng||o.locale||o.lng||n;u=this.formats[c](s,f,{...d,...o,...h})}catch(h){this.logger.warn(h)}return u}else this.logger.warn(`there was no format function for ${c}`);return s},e)}}const vl=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class El extends tr{constructor(e,r,n,o={}){super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=Oe.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,r,n,o){const a={},i={},s={},l={};return e.forEach(c=>{let d=!0;r.forEach(u=>{const h=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,u)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?i[h]===void 0&&(i[h]=!0):(this.state[h]=1,d=!1,i[h]===void 0&&(i[h]=!0),a[h]===void 0&&(a[h]=!0),l[u]===void 0&&(l[u]=!0)))}),d||(s[c]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const o=e.split("|"),a=o[0],i=o[1];r&&this.emit("failedLoading",a,i,r),!r&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{rl(l.loaded,[a],i),vl(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(u=>{s[c][u]===void 0&&(s[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,o=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:o,wait:a,callback:i});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(c&&d&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,o+1,a*2,i)},a);return}i(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(e,r,s)}prepareLoading(e,r,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();U(e)&&(e=this.languageUtils.toResolveHierarchy(e)),U(r)&&(r=[r]);const a=this.queueLoad(e,r,n,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e,r=""){const n=e.split("|"),o=n[0],a=n[1];this.read(o,a,"read",void 0,void 0,(i,s)=>{i&&this.logger.warn(`${r}loading namespace ${a} for language ${o} failed`,i),!i&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${o}`,s),this.loaded(e,i,s)})}saveMissing(e,r,n,o,a,i={},s=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend?.create){const l={...i,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,r,n,o,l):d=c(e,r,n,o),d&&typeof d.then=="function"?d.then(u=>s(null,u)).catch(s):s(null,d)}catch(d){s(d)}else c(e,r,n,o,s,l)}!e||!e[0]||this.store.addResource(e[0],r,n,o)}}}const Tn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),U(t[1])&&(e.defaultValue=t[1]),U(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),In=t=>(U(t.ns)&&(t.ns=[t.ns]),U(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),U(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),Bt=()=>{},yl=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class bt extends tr{constructor(e={},r){if(super(),this.options=In(e),this.services={},this.logger=Oe,this.modules={external:[]},yl(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(e={},r){this.isInitializing=!0,typeof e=="function"&&(r=e,e={}),e.defaultNS==null&&e.ns&&(U(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Tn();this.options={...n,...this.options,...In(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const o=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?Oe.init(o(this.modules.logger),this.options):Oe.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=ml;const d=new Dn(this.options);this.store=new On(this.options.resources,this.options);const u=this.services;u.logger=Oe,u.resourceStore=this.store,u.languageUtils=d,u.pluralResolver=new fl(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=o(c),u.formatter.init&&u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new hl(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new El(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Xt(this.services,this.options),this.translator.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Bt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=(...d)=>this.store[c](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...d)=>(this.store[c](...d),this)});const s=vt(),l=()=>{const c=(d,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(u),r(d,u)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),s}loadResources(e,r=Bt){let n=r;const o=U(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],i=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>i(l)),this.options.preload?.forEach?.(s=>i(s)),this.services.backendConnector.load(a,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(e,r,n){const o=vt();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=Bt),this.services.backendConnector.reload(e,r,a=>{o.resolve(),n(a)}),o}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"&&$o.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,r){this.isLanguageChangingTo=e;const n=vt();this.emit("languageChanging",e);const o=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,l)=>{l?this.isLanguageChangingTo===e&&(o(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),r&&r(s,(...c)=>this.t(...c))},i=s=>{!e&&!s&&this.services.languageDetector&&(s=[]);const l=U(s)?s:s&&s[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(U(s)?[s]:s);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,r,n){const o=(a,i,...s)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(s)):l={...i},l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||o.keyPrefix);const c=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(a)?d=a.map(u=>(typeof u=="function"&&(u=Jt(u,{...this.options,...i})),`${l.keyPrefix}${c}${u}`)):(typeof a=="function"&&(a=Jt(a,{...this.options,...i})),d=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a),this.t(d,l)};return U(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,r={}){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 n=r.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===0||c===2};if(r.precheck){const s=r.precheck(this,i);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!o||i(a,e)))}loadNamespaces(e,r){const n=vt();return this.options.ns?(U(e)&&(e=[e]),e.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{n.resolve(),r&&r(o)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=vt();U(e)&&(e=[e]);const o=this.options.preload||[],a=e.filter(i=>o.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=o.concat(a),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const r=["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"],n=this.services?.languageUtils||new Dn(Tn());return e.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},r){return new bt(e,r)}cloneInstance(e={},r=Bt){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const o={...this.options,...e,isClone:!0},a=new bt(o);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((d,u)=>(d[u]={...l[c][u]},d),l[c]),l),{});a.store=new On(s,o),a.services.resourceStore=a.store}return a.translator=new Xt(a.services,o),a.translator.on("*",(s,...l)=>{a.emit(s,...l)}),a.init(o,r),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const pe=bt.createInstance();pe.createInstance=bt.createInstance;pe.createInstance;pe.dir;pe.init;pe.loadResources;pe.reloadResources;pe.use;pe.changeLanguage;pe.getFixedT;const zh=pe.t;pe.exists;pe.setDefaultNamespace;pe.hasLoadedNamespace;pe.loadNamespaces;pe.loadLanguages;var pr,kn;function _l(){return kn||(kn=1,pr={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}),pr}var Cl=_l();const Sl=cs(Cl);var Nl=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Hn(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(Sl[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var o=new RegExp(Nl),a=null;(a=o.exec(t))!==null;)if(a[0].trim())if(a[1]){var i=a[1].trim(),s=[i,""];i.indexOf("=")>-1&&(s=i.split("=")),e.attrs[s[0]]=s[1],o.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var Rl=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,bl=/^\s*$/,Ol=Object.create(null);function Ko(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?(function(r){var n=[];for(var o in r)n.push(o+'="'+r[o]+'"');return n.length?" "+n.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(Ko,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var xl={parse:function(t,e){e||(e={}),e.components||(e.components=Ol);var r,n=[],o=[],a=-1,i=!1;if(t.indexOf("<")!==0){var s=t.indexOf("<");n.push({type:"text",content:s===-1?t:t.substring(0,s)})}return t.replace(Rl,function(l,c){if(i){if(l!=="</"+r.name+">")return;i=!1}var d,u=l.charAt(1)!=="/",h=l.startsWith("<!--"),f=c+l.length,m=t.charAt(f);if(h){var y=Hn(l);return a<0?(n.push(y),n):((d=o[a]).children.push(y),n)}if(u&&(a++,(r=Hn(l)).type==="tag"&&e.components[r.name]&&(r.type="component",i=!0),r.voidElement||i||!m||m==="<"||r.children.push({type:"text",content:t.slice(f,t.indexOf("<",f))}),a===0&&n.push(r),(d=o[a-1])&&d.children.push(r),o[a]=r),(!u||r.voidElement)&&(a>-1&&(r.voidElement||r.name===l.slice(2,-1))&&(a--,r=a===-1?n:o[a]),!i&&m!=="<"&&m)){d=a===-1?n:o[a].children;var S=t.indexOf("<",f),_=t.slice(f,S===-1?void 0:S);bl.test(_)&&(_=" "),(S>-1&&a+d.length>=0||_!==" ")&&d.push({type:"text",content:_})}}),n},stringify:function(t){return t.reduce(function(e,r){return e+Ko("",r)},"")}};const zt=(t,e,r,n)=>{const o=[r,{code:e,...n||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(o,"warn","react-i18next::",!0);Se(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...o):console?.warn&&console.warn(...o)},Mn={},rr=(t,e,r,n)=>{Se(r)&&Mn[r]||(Se(r)&&(Mn[r]=new Date),zt(t,e,r,n))},Wo=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},Tr=(t,e,r)=>{t.loadNamespaces(e,Wo(t,r))},jn=(t,e,r,n)=>{if(Se(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Tr(t,r,n);r.forEach(o=>{t.options.ns.indexOf(o)<0&&t.options.ns.push(o)}),t.loadLanguages(e,Wo(t,n))},Dl=(t,e,r={})=>!e.languages||!e.languages.length?(rr(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:r.lng,precheck:(n,o)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,t))return!1}}),Se=t=>typeof t=="string",je=t=>typeof t=="object"&&t!==null,Ll=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pl={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wl=t=>Pl[t],Al=t=>t.replace(Ll,wl);let Ir={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Al};const Tl=(t={})=>{Ir={...Ir,...t}},Yo=()=>Ir;let Go;const Il=t=>{Go=t},Xr=()=>Go,gr=(t,e)=>{if(!t)return!1;const r=t.props?.children??t.children;return e?r.length>0:!!r},mr=t=>{if(!t)return[];const e=t.props?.children??t.children;return t.props?.i18nIsDynamicList?ut(e):e},kl=t=>Array.isArray(t)&&t.every(g.isValidElement),ut=t=>Array.isArray(t)?t:[t],Hl=(t,e)=>{const r={...e};return r.props=Object.assign(t.props,e.props),r},Jo=(t,e,r,n)=>{if(!t)return"";let o="";const a=ut(t),i=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(Se(s)){o+=`${s}`;return}if(g.isValidElement(s)){const{props:c,type:d}=s,u=Object.keys(c).length,h=i.indexOf(d)>-1,f=c.children;if(!f&&h&&!u){o+=`<${d}/>`;return}if(!f&&(!h||u)||c.i18nIsDynamicList){o+=`<${l}></${l}>`;return}if(h&&u===1&&Se(f)){o+=`<${d}>${f}</${d}>`;return}const m=Jo(f,e,r,n);o+=`<${l}>${m}</${l}>`;return}if(s===null){zt(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(je(s)){const{format:c,...d}=s,u=Object.keys(d);if(u.length===1){const h=c?`${u[0]}, ${c}`:u[0];o+=`{{${h}}}`;return}zt(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}zt(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),o},Ml=(t,e=[],r={})=>{if(!t)return t;const n=Object.keys(r),o=[...e,...n];let a="",i=0;for(;i<t.length;)if(t[i]==="<"){let s=!1;const l=t.slice(i).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/);if(l){const c=l[1];(/^\d+$/.test(c)||o.includes(c))&&(s=!0,a+=l[0],i+=l[0].length)}if(!s){const c=t.slice(i).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(c){const d=c[1];(/^\d+$/.test(d)||o.includes(d))&&(s=!0,a+=c[0],i+=c[0].length)}}s||(a+="<",i+=1)}else a+=t[i],i+=1;return a},jl=(t,e,r,n,o,a,i)=>{if(r==="")return[];const s=o.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(R=>`<${R}`).join("|")).test(r);if(!t&&!e&&!l&&!i)return[r];const c=e??{},d=R=>{ut(R).forEach(b=>{Se(b)||(gr(b)?d(mr(b)):je(b)&&!g.isValidElement(b)&&Object.assign(c,b))})};d(t);const u=Ml(r,s,c),h=xl.parse(`<0>${u}</0>`),f={...c,...a},m=(R,L,b)=>{const w=mr(R),k=S(w,L.children,b);return kl(w)&&k.length===0||R.props?.i18nIsDynamicList?w:k},y=(R,L,b,w,k)=>{R.dummy?(R.children=L,b.push(g.cloneElement(R,{key:w},k?void 0:L))):b.push(...g.Children.map([R],E=>{const x={...E.props};return delete x.i18nIsDynamicList,g.createElement(E.type,{...x,key:w,ref:E.props.ref??E.ref},k?null:L)}))},S=(R,L,b)=>{const w=ut(R);return ut(L).reduce((E,x,j)=>{const H=x.children?.[0]?.content&&n.services.interpolator.interpolate(x.children[0].content,f,n.language);if(x.type==="tag"){let $=w[parseInt(x.name,10)];!$&&e&&($=e[x.name]),b.length===1&&!$&&($=b[0][x.name]),$||($={});const B=Object.keys(x.attrs).length!==0?Hl({props:x.attrs},$):$,Y=g.isValidElement(B),G=Y&&gr(x,!0)&&!x.voidElement,ge=l&&je(B)&&B.dummy&&!Y,ue=je(e)&&Object.hasOwnProperty.call(e,x.name);if(Se(B)){const q=n.services.interpolator.interpolate(B,f,n.language);E.push(q)}else if(gr(B)||G){const q=m(B,x,b);y(B,q,E,j)}else if(ge){const q=S(w,x.children,b);y(B,q,E,j)}else if(Number.isNaN(parseFloat(x.name)))if(ue){const q=m(B,x,b);y(B,q,E,j,x.voidElement)}else if(o.transSupportBasicHtmlNodes&&s.indexOf(x.name)>-1)if(x.voidElement)E.push(g.createElement(x.name,{key:`${x.name}-${j}`}));else{const q=S(w,x.children,b);E.push(g.createElement(x.name,{key:`${x.name}-${j}`},q))}else if(x.voidElement)E.push(`<${x.name} />`);else{const q=S(w,x.children,b);E.push(`<${x.name}>${q}</${x.name}>`)}else if(je(B)&&!Y){const q=x.children[0]?H:null;q&&E.push(q)}else y(B,H,E,j,x.children.length!==1||!H)}else if(x.type==="text"){const $=o.transWrapTextNodes,B=i?o.unescape(n.services.interpolator.interpolate(x.content,f,n.language)):n.services.interpolator.interpolate(x.content,f,n.language);$?E.push(g.createElement($,{key:`${x.name}-${j}`},B)):E.push(B)}return E},[])},_=S([{dummy:!0,children:t||[]}],h,ut(t||[]));return mr(_[0])},Xo=(t,e,r)=>{const n=t.key||e,o=g.cloneElement(t,{key:n});if(!o.props||!o.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return o;function a(){return g.createElement(g.Fragment,null,o)}return g.createElement(a,{key:n})},Fl=(t,e)=>t.map((r,n)=>Xo(r,n,e)),Bl=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Xo(t[n],n,e)})}),r},Vl=(t,e,r,n)=>t?Array.isArray(t)?Fl(t,e):je(t)?Bl(t,e):(rr(r,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:n}),null):null,Ul=t=>!je(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function $l({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a={},values:i,defaults:s,components:l,ns:c,i18n:d,t:u,shouldUnescape:h,...f}){const m=d||Xr();if(!m)return rr(m,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:n}),t;const y=u||m.t.bind(m)||(G=>G),S={...Yo(),...m.options?.react};let _=c||y.ns||m.options?.defaultNS;_=Se(_)?[_]:_||["translation"];const R=Jo(t,S,m,n),L=s||a?.defaultValue||R||S.transEmptyNodeValue||(typeof n=="function"?Jt(n):n),{hashTransKey:b}=S,w=n||(b?b(R||L):R||L);m.options?.interpolation?.defaultVariables&&(i=i&&Object.keys(i).length>0?{...i,...m.options.interpolation.defaultVariables}:{...m.options.interpolation.defaultVariables});const k=i||e!==void 0&&!m.options?.interpolation?.alwaysFormat||!t?a.interpolation:{interpolation:{...a.interpolation,prefix:"#$?",suffix:"?$#"}},E={...a,context:o||a.context,count:e,...i,...k,defaultValue:s||a?.defaultValue,ns:_};let x=w?y(w,E):L;x===w&&L&&(x=L);const j=Vl(l,x,m,n);let H=j||t,$=null;Ul(j)&&($=j,H=t);const B=jl(H,$,x,m,S,E,h),Y=r??S.defaultTransParent;return Y?g.createElement(Y,f,B):B}const zl={type:"3rdParty",init(t){Tl(t.options.react),Il(t)}},qo=g.createContext();class Kl{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Wl({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a={},values:i,defaults:s,components:l,ns:c,i18n:d,t:u,shouldUnescape:h,...f}){const{i18n:m,defaultNS:y}=g.useContext(qo)||{},S=d||m||Xr(),_=u||S?.t.bind(S);return $l({children:t,count:e,parent:r,i18nKey:n,context:o,tOptions:a,values:i,defaults:s,components:l,ns:c||_?.ns||y||S?.options?.defaultNS,i18n:S,t:u,shouldUnescape:h,...f})}var vr={exports:{}},Er={};var Fn;function Yl(){if(Fn)return Er;Fn=1;var t=us();function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,o=t.useEffect,a=t.useLayoutEffect,i=t.useDebugValue;function s(u,h){var f=h(),m=n({inst:{value:f,getSnapshot:h}}),y=m[0].inst,S=m[1];return a(function(){y.value=f,y.getSnapshot=h,l(y)&&S({inst:y})},[u,f,h]),o(function(){return l(y)&&S({inst:y}),u(function(){l(y)&&S({inst:y})})},[u]),i(f),f}function l(u){var h=u.getSnapshot;u=u.value;try{var f=h();return!r(u,f)}catch{return!0}}function c(u,h){return h()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return Er.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,Er}var Bn;function Gl(){return Bn||(Bn=1,vr.exports=Yl()),vr.exports}var Jl=Gl();const Xl=(t,e)=>Se(e)?e:je(e)&&Se(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t,ql={t:Xl,ready:!1},Zl=()=>()=>{},Zo=(t,e={})=>{const{i18n:r}=e,{i18n:n,defaultNS:o}=g.useContext(qo)||{},a=r||n||Xr();a&&!a.reportNamespaces&&(a.reportNamespaces=new Kl),a||rr(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const i=g.useMemo(()=>({...Yo(),...a?.options?.react,...e}),[a,e]),{useSuspense:s,keyPrefix:l}=i,c=g.useMemo(()=>{const b=o||a?.options?.defaultNS;return Se(b)?[b]:b||["translation"]},[t,o,a]);a?.reportNamespaces?.addUsedNamespaces?.(c);const d=g.useRef(0),u=g.useCallback(b=>{if(!a)return Zl;const{bindI18n:w,bindI18nStore:k}=i,E=()=>{d.current+=1,b()};return w&&a.on(w,E),k&&a.store.on(k,E),()=>{w&&w.split(" ").forEach(x=>a.off(x,E)),k&&k.split(" ").forEach(x=>a.store.off(x,E))}},[a,i]),h=g.useRef(),f=g.useCallback(()=>{if(!a)return ql;const b=!!(a.isInitialized||a.initializedStoreOnce)&&c.every(H=>Dl(H,a,i)),w=e.lng||a.language,k=d.current,E=h.current;if(E&&E.ready===b&&E.lng===w&&E.keyPrefix===l&&E.revision===k)return E;const j={t:a.getFixedT(w,i.nsMode==="fallback"?c:c[0],l),ready:b,lng:w,keyPrefix:l,revision:k};return h.current=j,j},[a,c,l,i,e.lng]),[m,y]=g.useState(0),{t:S,ready:_}=Jl.useSyncExternalStore(u,f,f);g.useEffect(()=>{if(a&&!_&&!s){const b=()=>y(w=>w+1);e.lng?jn(a,e.lng,c,b):Tr(a,c,b)}},[a,e.lng,c,_,s,m]);const R=a||{},L=g.useMemo(()=>{const b=[S,R,_];return b.t=S,b.i18n=R,b.ready=_,b},[S,R,_]);if(a&&s&&!_)throw new Promise(b=>{const w=()=>b();e.lng?jn(a,e.lng,c,w):Tr(a,c,w)});return L},Ql=()=>{const{t}=Zo();return N.jsxs("div",{children:[N.jsx("p",{className:"font-medium",children:t("notifications.reloadApp")}),N.jsxs("button",{onClick:()=>location.reload(),className:"underline decoration-solid underline-offset-2",children:[t("common.reloadConnect")," 🔄"]})]})},ec=()=>{async function t(){const e=await ad();if(e!==null){if(e.isLatest||e.currentVersion.includes("-"))return!0;ce.studioMode||!ce.warnOutdatedApp?de.warn(`Connect is outdated:
|
|
3
3
|
Current: ${e.currentVersion}
|
|
4
4
|
Latest: ${e.latestVersion}`):Jr(g.createElement(Ql),{type:"connect-warning",toastId:"outdated-app",autoClose:!1})}}g.useEffect(()=>{t().catch(console.error)},[])},tc=ce.routerBasename,Qo=`${tc}:display-cookie-banner`,Vn=new Set;let ea=rc();function rc(){try{return localStorage.getItem(Qo)!=="false"}catch(t){return console.error(t),!0}}function Un(){return ea}function nc(t){ea=t,localStorage.setItem(Qo,JSON.stringify(t))}function oc(t){return Vn.add(t),()=>Vn.delete(t)}const ac=()=>[g.useSyncExternalStore(oc,Un,Un),nc];function re(){return re=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},re.apply(this,arguments)}var le;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(le||(le={}));const $n="popstate";function ic(t){t===void 0&&(t={});function e(n,o){let{pathname:a,search:i,hash:s}=n.location;return Ot("",{pathname:a,search:i,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){return typeof o=="string"?o:Lt(o)}return lc(e,r,null,t)}function K(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ft(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function sc(){return Math.random().toString(36).substr(2,8)}function zn(t,e){return{usr:t.state,key:t.key,idx:e}}function Ot(t,e,r,n){return r===void 0&&(r=null),re({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?$e(e):e,{state:r,key:e&&e.key||n||sc()})}function Lt(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function $e(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function lc(t,e,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,s=le.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(re({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function u(){s=le.Pop;let S=d(),_=S==null?null:S-c;c=S,l&&l({action:s,location:y.location,delta:_})}function h(S,_){s=le.Push;let R=Ot(y.location,S,_);c=d()+1;let L=zn(R,c),b=y.createHref(R);try{i.pushState(L,"",b)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;o.location.assign(b)}a&&l&&l({action:s,location:y.location,delta:1})}function f(S,_){s=le.Replace;let R=Ot(y.location,S,_);c=d();let L=zn(R,c),b=y.createHref(R);i.replaceState(L,"",b),a&&l&&l({action:s,location:y.location,delta:0})}function m(S){let _=o.location.origin!=="null"?o.location.origin:o.location.href,R=typeof S=="string"?S:Lt(S);return R=R.replace(/ $/,"%20"),K(_,"No window.location.(origin|href) available to create URL for href: "+R),new URL(R,_)}let y={get action(){return s},get location(){return t(o,i)},listen(S){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener($n,u),l=S,()=>{o.removeEventListener($n,u),l=null}},createHref(S){return e(o,S)},createURL:m,encodeLocation(S){let _=m(S);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:f,go(S){return i.go(S)}};return y}var Z;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Z||(Z={}));const cc=new Set(["lazy","caseSensitive","path","id","index","children"]);function uc(t){return t.index===!0}function qt(t,e,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),t.map((o,a)=>{let i=[...r,String(a)],s=typeof o.id=="string"?o.id:i.join("-");if(K(o.index!==!0||!o.children,"Cannot specify children on an index route"),K(!n[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),uc(o)){let l=re({},o,e(o),{id:s});return n[s]=l,l}else{let l=re({},o,e(o),{id:s,children:void 0});return n[s]=l,o.children&&(l.children=qt(o.children,e,i,n)),l}})}function Me(t,e,r){return r===void 0&&(r="/"),Kt(t,e,r,!1)}function Kt(t,e,r,n){let o=typeof e=="string"?$e(e):e,a=Pt(o.pathname||"/",r);if(a==null)return null;let i=ta(t);fc(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=Nc(a);s=Cc(i[l],c,n)}return s}function dc(t,e){let{route:r,pathname:n,params:o}=t;return{id:r.id,pathname:n,params:o,data:e[r.id],handle:r.handle}}function ta(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(a,i,s)=>{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};l.relativePath.startsWith("/")&&(K(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=Ue([n,l.relativePath]),d=r.concat(l);a.children&&a.children.length>0&&(K(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),ta(a.children,e,d,c)),!(a.path==null&&!a.index)&&e.push({path:c,score:yc(c,a.index),routesMeta:d})};return t.forEach((a,i)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))o(a,i);else for(let l of ra(a.path))o(a,i,l)}),e}function ra(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let i=ra(n.join("/")),s=[];return s.push(...i.map(l=>l===""?a:[a,l].join("/"))),o&&s.push(...i),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function fc(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:_c(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const hc=/^:[\w-]+$/,pc=3,gc=2,mc=1,vc=10,Ec=-2,Kn=t=>t==="*";function yc(t,e){let r=t.split("/"),n=r.length;return r.some(Kn)&&(n+=Ec),e&&(n+=gc),r.filter(o=>!Kn(o)).reduce((o,a)=>o+(hc.test(a)?pc:a===""?mc:vc),n)}function _c(t,e){return t.length===e.length&&t.slice(0,-1).every((n,o)=>n===e[o])?t[t.length-1]-e[e.length-1]:0}function Cc(t,e,r){r===void 0&&(r=!1);let{routesMeta:n}=t,o={},a="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],c=s===n.length-1,d=a==="/"?e:e.slice(a.length)||"/",u=Wn({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),h=l.route;if(!u&&c&&r&&!n[n.length-1].route.index&&(u=Wn({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!u)return null;Object.assign(o,u.params),i.push({params:o,pathname:Ue([a,u.pathname]),pathnameBase:Oc(Ue([a,u.pathnameBase])),route:h}),u.pathnameBase!=="/"&&(a=Ue([a,u.pathnameBase]))}return i}function Wn(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=Sc(t.path,t.caseSensitive,t.end),o=e.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:n.reduce((c,d,u)=>{let{paramName:h,isOptional:f}=d;if(h==="*"){let y=s[u]||"";i=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const m=s[u];return f&&!m?c[h]=void 0:c[h]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:t}}function Sc(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),ft(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,e?void 0:"i"),n]}function Nc(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ft(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Pt(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function Rc(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:o=""}=typeof t=="string"?$e(t):t;return{pathname:r?r.startsWith("/")?r:bc(r,e):e,search:xc(n),hash:Dc(o)}}function bc(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function yr(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function na(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function oa(t,e){let r=na(t);return e?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function aa(t,e,r,n){n===void 0&&(n=!1);let o;typeof t=="string"?o=$e(t):(o=re({},t),K(!o.pathname||!o.pathname.includes("?"),yr("?","pathname","search",o)),K(!o.pathname||!o.pathname.includes("#"),yr("#","pathname","hash",o)),K(!o.search||!o.search.includes("#"),yr("#","search","hash",o)));let a=t===""||o.pathname==="",i=a?"/":o.pathname,s;if(i==null)s=r;else{let u=e.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),u-=1;o.pathname=h.join("/")}s=u>=0?e[u]:"/"}let l=Rc(o,s),c=i&&i!=="/"&&i.endsWith("/"),d=(a||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const Ue=t=>t.join("/").replace(/\/\/+/g,"/"),Oc=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),xc=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Dc=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Zt{constructor(e,r,n,o){o===void 0&&(o=!1),this.status=e,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function xt(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ia=["post","put","patch","delete"],Lc=new Set(ia),Pc=["get",...ia],wc=new Set(Pc),Ac=new Set([301,302,303,307,308]),Tc=new Set([307,308]),_r={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ic={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Et={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kc=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),sa="remix-router-transitions";function Hc(t){const e=t.window?t.window:typeof window<"u"?window:void 0,r=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",n=!r;K(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(t.mapRouteProperties)o=t.mapRouteProperties;else if(t.detectErrorBoundary){let p=t.detectErrorBoundary;o=v=>({hasErrorBoundary:p(v)})}else o=kc;let a={},i=qt(t.routes,o,void 0,a),s,l=t.basename||"/",c=t.dataStrategy||Bc,d=t.patchRoutesOnNavigation,u=re({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),h=null,f=new Set,m=null,y=null,S=null,_=t.hydrationData!=null,R=Me(i,t.history.location,l),L=!1,b=null;if(R==null&&!d){let p=Ee(404,{pathname:t.history.location.pathname}),{matches:v,route:C}=no(i);R=v,b={[C.id]:p}}R&&!t.hydrationData&&It(R,i,t.history.location.pathname).active&&(R=null);let w;if(R)if(R.some(p=>p.route.lazy))w=!1;else if(!R.some(p=>p.route.loader))w=!0;else if(u.v7_partialHydration){let p=t.hydrationData?t.hydrationData.loaderData:null,v=t.hydrationData?t.hydrationData.errors:null;if(v){let C=R.findIndex(O=>v[O.route.id]!==void 0);w=R.slice(0,C+1).every(O=>!Hr(O.route,p,v))}else w=R.every(C=>!Hr(C.route,p,v))}else w=t.hydrationData!=null;else if(w=!1,R=[],u.v7_partialHydration){let p=It(null,i,t.history.location.pathname);p.active&&p.matches&&(L=!0,R=p.matches)}let k,E={historyAction:t.history.action,location:t.history.location,matches:R,initialized:w,navigation:_r,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||b,fetchers:new Map,blockers:new Map},x=le.Pop,j=!1,H,$=!1,B=new Map,Y=null,G=!1,ge=!1,ue=[],q=new Set,te=new Map,xe=0,Ae=-1,ie=new Map,fe=new Set,_e=new Map,Te=new Map,Ne=new Set,We=new Map,Ye=new Map,wt;function za(){if(h=t.history.listen(p=>{let{action:v,location:C,delta:O}=p;if(wt){wt(),wt=void 0;return}ft(Ye.size===0||O!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let P=pn({currentLocation:E.location,nextLocation:C,historyAction:v});if(P&&O!=null){let F=new Promise(V=>{wt=V});t.history.go(O*-1),Tt(P,{state:"blocked",location:C,proceed(){Tt(P,{state:"proceeding",proceed:void 0,reset:void 0,location:C}),F.then(()=>t.history.go(O))},reset(){let V=new Map(E.blockers);V.set(P,Et),ve({blockers:V})}});return}return Ge(v,C)}),r){eu(e,B);let p=()=>tu(e,B);e.addEventListener("pagehide",p),Y=()=>e.removeEventListener("pagehide",p)}return E.initialized||Ge(le.Pop,E.location,{initialHydration:!0}),k}function Ka(){h&&h(),Y&&Y(),f.clear(),H&&H.abort(),E.fetchers.forEach((p,v)=>At(v)),E.blockers.forEach((p,v)=>hn(v))}function Wa(p){return f.add(p),()=>f.delete(p)}function ve(p,v){v===void 0&&(v={}),E=re({},E,p);let C=[],O=[];u.v7_fetcherPersist&&E.fetchers.forEach((P,F)=>{P.state==="idle"&&(Ne.has(F)?O.push(F):C.push(F))}),Ne.forEach(P=>{!E.fetchers.has(P)&&!te.has(P)&&O.push(P)}),[...f].forEach(P=>P(E,{deletedFetchers:O,viewTransitionOpts:v.viewTransitionOpts,flushSync:v.flushSync===!0})),u.v7_fetcherPersist?(C.forEach(P=>E.fetchers.delete(P)),O.forEach(P=>At(P))):O.forEach(P=>Ne.delete(P))}function et(p,v,C){var O,P;let{flushSync:F}=C===void 0?{}:C,V=E.actionData!=null&&E.navigation.formMethod!=null&&Re(E.navigation.formMethod)&&E.navigation.state==="loading"&&((O=p.state)==null?void 0:O._isRedirect)!==!0,T;v.actionData?Object.keys(v.actionData).length>0?T=v.actionData:T=null:V?T=E.actionData:T=null;let I=v.loaderData?to(E.loaderData,v.loaderData,v.matches||[],v.errors):E.loaderData,A=E.blockers;A.size>0&&(A=new Map(A),A.forEach((W,he)=>A.set(he,Et)));let M=j===!0||E.navigation.formMethod!=null&&Re(E.navigation.formMethod)&&((P=p.state)==null?void 0:P._isRedirect)!==!0;s&&(i=s,s=void 0),G||x===le.Pop||(x===le.Push?t.history.push(p,p.state):x===le.Replace&&t.history.replace(p,p.state));let z;if(x===le.Pop){let W=B.get(E.location.pathname);W&&W.has(p.pathname)?z={currentLocation:E.location,nextLocation:p}:B.has(p.pathname)&&(z={currentLocation:p,nextLocation:E.location})}else if($){let W=B.get(E.location.pathname);W?W.add(p.pathname):(W=new Set([p.pathname]),B.set(E.location.pathname,W)),z={currentLocation:E.location,nextLocation:p}}ve(re({},v,{actionData:T,loaderData:I,historyAction:x,location:p,initialized:!0,navigation:_r,revalidation:"idle",restoreScrollPosition:mn(p,v.matches||E.matches),preventScrollReset:M,blockers:A}),{viewTransitionOpts:z,flushSync:F===!0}),x=le.Pop,j=!1,$=!1,G=!1,ge=!1,ue=[]}async function an(p,v){if(typeof p=="number"){t.history.go(p);return}let C=kr(E.location,E.matches,l,u.v7_prependBasename,p,u.v7_relativeSplatPath,v?.fromRouteId,v?.relative),{path:O,submission:P,error:F}=Yn(u.v7_normalizeFormMethod,!1,C,v),V=E.location,T=Ot(E.location,O,v&&v.state);T=re({},T,t.history.encodeLocation(T));let I=v&&v.replace!=null?v.replace:void 0,A=le.Push;I===!0?A=le.Replace:I===!1||P!=null&&Re(P.formMethod)&&P.formAction===E.location.pathname+E.location.search&&(A=le.Replace);let M=v&&"preventScrollReset"in v?v.preventScrollReset===!0:void 0,z=(v&&v.flushSync)===!0,W=pn({currentLocation:V,nextLocation:T,historyAction:A});if(W){Tt(W,{state:"blocked",location:T,proceed(){Tt(W,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),an(p,v)},reset(){let he=new Map(E.blockers);he.set(W,Et),ve({blockers:he})}});return}return await Ge(A,T,{submission:P,pendingError:F,preventScrollReset:M,replace:v&&v.replace,enableViewTransition:v&&v.viewTransition,flushSync:z})}function Ya(){if(lr(),ve({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){Ge(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}Ge(x||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:$===!0})}}async function Ge(p,v,C){H&&H.abort(),H=null,x=p,G=(C&&C.startUninterruptedRevalidation)===!0,ni(E.location,E.matches),j=(C&&C.preventScrollReset)===!0,$=(C&&C.enableViewTransition)===!0;let O=s||i,P=C&&C.overrideNavigation,F=C!=null&&C.initialHydration&&E.matches&&E.matches.length>0&&!L?E.matches:Me(O,v,l),V=(C&&C.flushSync)===!0;if(F&&E.initialized&&!ge&&Wc(E.location,v)&&!(C&&C.submission&&Re(C.submission.formMethod))){et(v,{matches:F},{flushSync:V});return}let T=It(F,O,v.pathname);if(T.active&&T.matches&&(F=T.matches),!F){let{error:ee,notFoundMatches:X,route:ne}=cr(v.pathname);et(v,{matches:X,loaderData:{},errors:{[ne.id]:ee}},{flushSync:V});return}H=new AbortController;let I=it(t.history,v,H.signal,C&&C.submission),A;if(C&&C.pendingError)A=[qe(F).route.id,{type:Z.error,error:C.pendingError}];else if(C&&C.submission&&Re(C.submission.formMethod)){let ee=await Ga(I,v,C.submission,F,T.active,{replace:C.replace,flushSync:V});if(ee.shortCircuited)return;if(ee.pendingActionResult){let[X,ne]=ee.pendingActionResult;if(ye(ne)&&xt(ne.error)&&ne.error.status===404){H=null,et(v,{matches:ee.matches,loaderData:{},errors:{[X]:ne.error}});return}}F=ee.matches||F,A=ee.pendingActionResult,P=Cr(v,C.submission),V=!1,T.active=!1,I=it(t.history,I.url,I.signal)}let{shortCircuited:M,matches:z,loaderData:W,errors:he}=await Ja(I,v,F,T.active,P,C&&C.submission,C&&C.fetcherSubmission,C&&C.replace,C&&C.initialHydration===!0,V,A);M||(H=null,et(v,re({matches:z||F},ro(A),{loaderData:W,errors:he})))}async function Ga(p,v,C,O,P,F){F===void 0&&(F={}),lr();let V=Zc(v,C);if(ve({navigation:V},{flushSync:F.flushSync===!0}),P){let A=await kt(O,v.pathname,p.signal);if(A.type==="aborted")return{shortCircuited:!0};if(A.type==="error"){let M=qe(A.partialMatches).route.id;return{matches:A.partialMatches,pendingActionResult:[M,{type:Z.error,error:A.error}]}}else if(A.matches)O=A.matches;else{let{notFoundMatches:M,error:z,route:W}=cr(v.pathname);return{matches:M,pendingActionResult:[W.id,{type:Z.error,error:z}]}}}let T,I=Ct(O,v);if(!I.route.action&&!I.route.lazy)T={type:Z.error,error:Ee(405,{method:p.method,pathname:v.pathname,routeId:I.route.id})};else if(T=(await ht("action",E,p,[I],O,null))[I.route.id],p.signal.aborted)return{shortCircuited:!0};if(Ze(T)){let A;return F&&F.replace!=null?A=F.replace:A=Zn(T.response.headers.get("Location"),new URL(p.url),l)===E.location.pathname+E.location.search,await Je(p,T,!0,{submission:C,replace:A}),{shortCircuited:!0}}if(Fe(T))throw Ee(400,{type:"defer-action"});if(ye(T)){let A=qe(O,I.route.id);return(F&&F.replace)!==!0&&(x=le.Push),{matches:O,pendingActionResult:[A.route.id,T]}}return{matches:O,pendingActionResult:[I.route.id,T]}}async function Ja(p,v,C,O,P,F,V,T,I,A,M){let z=P||Cr(v,F),W=F||V||ao(z),he=!G&&(!u.v7_partialHydration||!I);if(O){if(he){let oe=sn(M);ve(re({navigation:z},oe!==void 0?{actionData:oe}:{}),{flushSync:A})}let J=await kt(C,v.pathname,p.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let oe=qe(J.partialMatches).route.id;return{matches:J.partialMatches,loaderData:{},errors:{[oe]:J.error}}}else if(J.matches)C=J.matches;else{let{error:oe,notFoundMatches:rt,route:mt}=cr(v.pathname);return{matches:rt,loaderData:{},errors:{[mt.id]:oe}}}}let ee=s||i,[X,ne]=Jn(t.history,E,C,W,v,u.v7_partialHydration&&I===!0,u.v7_skipActionErrorRevalidation,ge,ue,q,Ne,_e,fe,ee,l,M);if(ur(J=>!(C&&C.some(oe=>oe.route.id===J))||X&&X.some(oe=>oe.route.id===J)),Ae=++xe,X.length===0&&ne.length===0){let J=dn();return et(v,re({matches:C,loaderData:{},errors:M&&ye(M[1])?{[M[0]]:M[1].error}:null},ro(M),J?{fetchers:new Map(E.fetchers)}:{}),{flushSync:A}),{shortCircuited:!0}}if(he){let J={};if(!O){J.navigation=z;let oe=sn(M);oe!==void 0&&(J.actionData=oe)}ne.length>0&&(J.fetchers=Xa(ne)),ve(J,{flushSync:A})}ne.forEach(J=>{ke(J.key),J.controller&&te.set(J.key,J.controller)});let tt=()=>ne.forEach(J=>ke(J.key));H&&H.signal.addEventListener("abort",tt);let{loaderResults:pt,fetcherResults:Le}=await ln(E,C,X,ne,p);if(p.signal.aborted)return{shortCircuited:!0};H&&H.signal.removeEventListener("abort",tt),ne.forEach(J=>te.delete(J.key));let be=Vt(pt);if(be)return await Je(p,be.result,!0,{replace:T}),{shortCircuited:!0};if(be=Vt(Le),be)return fe.add(be.key),await Je(p,be.result,!0,{replace:T}),{shortCircuited:!0};let{loaderData:dr,errors:gt}=eo(E,C,pt,M,ne,Le,We);We.forEach((J,oe)=>{J.subscribe(rt=>{(rt||J.done)&&We.delete(oe)})}),u.v7_partialHydration&&I&&E.errors&&(gt=re({},E.errors,gt));let Xe=dn(),Ht=fn(Ae),Mt=Xe||Ht||ne.length>0;return re({matches:C,loaderData:dr,errors:gt},Mt?{fetchers:new Map(E.fetchers)}:{})}function sn(p){if(p&&!ye(p[1]))return{[p[0]]:p[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Xa(p){return p.forEach(v=>{let C=E.fetchers.get(v.key),O=yt(void 0,C?C.data:void 0);E.fetchers.set(v.key,O)}),new Map(E.fetchers)}function qa(p,v,C,O){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ke(p);let P=(O&&O.flushSync)===!0,F=s||i,V=kr(E.location,E.matches,l,u.v7_prependBasename,C,u.v7_relativeSplatPath,v,O?.relative),T=Me(F,V,l),I=It(T,F,V);if(I.active&&I.matches&&(T=I.matches),!T){De(p,v,Ee(404,{pathname:V}),{flushSync:P});return}let{path:A,submission:M,error:z}=Yn(u.v7_normalizeFormMethod,!0,V,O);if(z){De(p,v,z,{flushSync:P});return}let W=Ct(T,A),he=(O&&O.preventScrollReset)===!0;if(M&&Re(M.formMethod)){Za(p,v,A,W,T,I.active,P,he,M);return}_e.set(p,{routeId:v,path:A}),Qa(p,v,A,W,T,I.active,P,he,M)}async function Za(p,v,C,O,P,F,V,T,I){lr(),_e.delete(p);function A(se){if(!se.route.action&&!se.route.lazy){let nt=Ee(405,{method:I.formMethod,pathname:C,routeId:v});return De(p,v,nt,{flushSync:V}),!0}return!1}if(!F&&A(O))return;let M=E.fetchers.get(p);Ie(p,Qc(I,M),{flushSync:V});let z=new AbortController,W=it(t.history,C,z.signal,I);if(F){let se=await kt(P,new URL(W.url).pathname,W.signal,p);if(se.type==="aborted")return;if(se.type==="error"){De(p,v,se.error,{flushSync:V});return}else if(se.matches){if(P=se.matches,O=Ct(P,C),A(O))return}else{De(p,v,Ee(404,{pathname:C}),{flushSync:V});return}}te.set(p,z);let he=xe,X=(await ht("action",E,W,[O],P,p))[O.route.id];if(W.signal.aborted){te.get(p)===z&&te.delete(p);return}if(u.v7_fetcherPersist&&Ne.has(p)){if(Ze(X)||ye(X)){Ie(p,He(void 0));return}}else{if(Ze(X))if(te.delete(p),Ae>he){Ie(p,He(void 0));return}else return fe.add(p),Ie(p,yt(I)),Je(W,X,!1,{fetcherSubmission:I,preventScrollReset:T});if(ye(X)){De(p,v,X.error);return}}if(Fe(X))throw Ee(400,{type:"defer-action"});let ne=E.navigation.location||E.location,tt=it(t.history,ne,z.signal),pt=s||i,Le=E.navigation.state!=="idle"?Me(pt,E.navigation.location,l):E.matches;K(Le,"Didn't find any matches after fetcher action");let be=++xe;ie.set(p,be);let dr=yt(I,X.data);E.fetchers.set(p,dr);let[gt,Xe]=Jn(t.history,E,Le,I,ne,!1,u.v7_skipActionErrorRevalidation,ge,ue,q,Ne,_e,fe,pt,l,[O.route.id,X]);Xe.filter(se=>se.key!==p).forEach(se=>{let nt=se.key,vn=E.fetchers.get(nt),ii=yt(void 0,vn?vn.data:void 0);E.fetchers.set(nt,ii),ke(nt),se.controller&&te.set(nt,se.controller)}),ve({fetchers:new Map(E.fetchers)});let Ht=()=>Xe.forEach(se=>ke(se.key));z.signal.addEventListener("abort",Ht);let{loaderResults:Mt,fetcherResults:J}=await ln(E,Le,gt,Xe,tt);if(z.signal.aborted)return;z.signal.removeEventListener("abort",Ht),ie.delete(p),te.delete(p),Xe.forEach(se=>te.delete(se.key));let oe=Vt(Mt);if(oe)return Je(tt,oe.result,!1,{preventScrollReset:T});if(oe=Vt(J),oe)return fe.add(oe.key),Je(tt,oe.result,!1,{preventScrollReset:T});let{loaderData:rt,errors:mt}=eo(E,Le,Mt,void 0,Xe,J,We);if(E.fetchers.has(p)){let se=He(X.data);E.fetchers.set(p,se)}fn(be),E.navigation.state==="loading"&&be>Ae?(K(x,"Expected pending action"),H&&H.abort(),et(E.navigation.location,{matches:Le,loaderData:rt,errors:mt,fetchers:new Map(E.fetchers)})):(ve({errors:mt,loaderData:to(E.loaderData,rt,Le,mt),fetchers:new Map(E.fetchers)}),ge=!1)}async function Qa(p,v,C,O,P,F,V,T,I){let A=E.fetchers.get(p);Ie(p,yt(I,A?A.data:void 0),{flushSync:V});let M=new AbortController,z=it(t.history,C,M.signal);if(F){let X=await kt(P,new URL(z.url).pathname,z.signal,p);if(X.type==="aborted")return;if(X.type==="error"){De(p,v,X.error,{flushSync:V});return}else if(X.matches)P=X.matches,O=Ct(P,C);else{De(p,v,Ee(404,{pathname:C}),{flushSync:V});return}}te.set(p,M);let W=xe,ee=(await ht("loader",E,z,[O],P,p))[O.route.id];if(Fe(ee)&&(ee=await Zr(ee,z.signal,!0)||ee),te.get(p)===M&&te.delete(p),!z.signal.aborted){if(Ne.has(p)){Ie(p,He(void 0));return}if(Ze(ee))if(Ae>W){Ie(p,He(void 0));return}else{fe.add(p),await Je(z,ee,!1,{preventScrollReset:T});return}if(ye(ee)){De(p,v,ee.error);return}K(!Fe(ee),"Unhandled fetcher deferred data"),Ie(p,He(ee.data))}}async function Je(p,v,C,O){let{submission:P,fetcherSubmission:F,preventScrollReset:V,replace:T}=O===void 0?{}:O;v.response.headers.has("X-Remix-Revalidate")&&(ge=!0);let I=v.response.headers.get("Location");K(I,"Expected a Location header on the redirect Response"),I=Zn(I,new URL(p.url),l);let A=Ot(E.location,I,{_isRedirect:!0});if(r){let X=!1;if(v.response.headers.has("X-Remix-Reload-Document"))X=!0;else if(qr.test(I)){const ne=t.history.createURL(I);X=ne.origin!==e.location.origin||Pt(ne.pathname,l)==null}if(X){T?e.location.replace(I):e.location.assign(I);return}}H=null;let M=T===!0||v.response.headers.has("X-Remix-Replace")?le.Replace:le.Push,{formMethod:z,formAction:W,formEncType:he}=E.navigation;!P&&!F&&z&&W&&he&&(P=ao(E.navigation));let ee=P||F;if(Tc.has(v.response.status)&&ee&&Re(ee.formMethod))await Ge(M,A,{submission:re({},ee,{formAction:I}),preventScrollReset:V||j,enableViewTransition:C?$:void 0});else{let X=Cr(A,P);await Ge(M,A,{overrideNavigation:X,fetcherSubmission:F,preventScrollReset:V||j,enableViewTransition:C?$:void 0})}}async function ht(p,v,C,O,P,F){let V,T={};try{V=await Vc(c,p,v,C,O,P,F,a,o)}catch(I){return O.forEach(A=>{T[A.route.id]={type:Z.error,error:I}}),T}for(let[I,A]of Object.entries(V))if(Yc(A)){let M=A.result;T[I]={type:Z.redirect,response:zc(M,C,I,P,l,u.v7_relativeSplatPath)}}else T[I]=await $c(A);return T}async function ln(p,v,C,O,P){let F=p.matches,V=ht("loader",p,P,C,v,null),T=Promise.all(O.map(async M=>{if(M.matches&&M.match&&M.controller){let W=(await ht("loader",p,it(t.history,M.path,M.controller.signal),[M.match],M.matches,M.key))[M.match.route.id];return{[M.key]:W}}else return Promise.resolve({[M.key]:{type:Z.error,error:Ee(404,{pathname:M.path})}})})),I=await V,A=(await T).reduce((M,z)=>Object.assign(M,z),{});return await Promise.all([Xc(v,I,P.signal,F,p.loaderData),qc(v,A,O)]),{loaderResults:I,fetcherResults:A}}function lr(){ge=!0,ue.push(...ur()),_e.forEach((p,v)=>{te.has(v)&&q.add(v),ke(v)})}function Ie(p,v,C){C===void 0&&(C={}),E.fetchers.set(p,v),ve({fetchers:new Map(E.fetchers)},{flushSync:(C&&C.flushSync)===!0})}function De(p,v,C,O){O===void 0&&(O={});let P=qe(E.matches,v);At(p),ve({errors:{[P.route.id]:C},fetchers:new Map(E.fetchers)},{flushSync:(O&&O.flushSync)===!0})}function cn(p){return Te.set(p,(Te.get(p)||0)+1),Ne.has(p)&&Ne.delete(p),E.fetchers.get(p)||Ic}function At(p){let v=E.fetchers.get(p);te.has(p)&&!(v&&v.state==="loading"&&ie.has(p))&&ke(p),_e.delete(p),ie.delete(p),fe.delete(p),u.v7_fetcherPersist&&Ne.delete(p),q.delete(p),E.fetchers.delete(p)}function ei(p){let v=(Te.get(p)||0)-1;v<=0?(Te.delete(p),Ne.add(p),u.v7_fetcherPersist||At(p)):Te.set(p,v),ve({fetchers:new Map(E.fetchers)})}function ke(p){let v=te.get(p);v&&(v.abort(),te.delete(p))}function un(p){for(let v of p){let C=cn(v),O=He(C.data);E.fetchers.set(v,O)}}function dn(){let p=[],v=!1;for(let C of fe){let O=E.fetchers.get(C);K(O,"Expected fetcher: "+C),O.state==="loading"&&(fe.delete(C),p.push(C),v=!0)}return un(p),v}function fn(p){let v=[];for(let[C,O]of ie)if(O<p){let P=E.fetchers.get(C);K(P,"Expected fetcher: "+C),P.state==="loading"&&(ke(C),ie.delete(C),v.push(C))}return un(v),v.length>0}function ti(p,v){let C=E.blockers.get(p)||Et;return Ye.get(p)!==v&&Ye.set(p,v),C}function hn(p){E.blockers.delete(p),Ye.delete(p)}function Tt(p,v){let C=E.blockers.get(p)||Et;K(C.state==="unblocked"&&v.state==="blocked"||C.state==="blocked"&&v.state==="blocked"||C.state==="blocked"&&v.state==="proceeding"||C.state==="blocked"&&v.state==="unblocked"||C.state==="proceeding"&&v.state==="unblocked","Invalid blocker state transition: "+C.state+" -> "+v.state);let O=new Map(E.blockers);O.set(p,v),ve({blockers:O})}function pn(p){let{currentLocation:v,nextLocation:C,historyAction:O}=p;if(Ye.size===0)return;Ye.size>1&&ft(!1,"A router only supports one blocker at a time");let P=Array.from(Ye.entries()),[F,V]=P[P.length-1],T=E.blockers.get(F);if(!(T&&T.state==="proceeding")&&V({currentLocation:v,nextLocation:C,historyAction:O}))return F}function cr(p){let v=Ee(404,{pathname:p}),C=s||i,{matches:O,route:P}=no(C);return ur(),{notFoundMatches:O,route:P,error:v}}function ur(p){let v=[];return We.forEach((C,O)=>{(!p||p(O))&&(C.cancel(),v.push(O),We.delete(O))}),v}function ri(p,v,C){if(m=p,S=v,y=C||null,!_&&E.navigation===_r){_=!0;let O=mn(E.location,E.matches);O!=null&&ve({restoreScrollPosition:O})}return()=>{m=null,S=null,y=null}}function gn(p,v){return y&&y(p,v.map(O=>dc(O,E.loaderData)))||p.key}function ni(p,v){if(m&&S){let C=gn(p,v);m[C]=S()}}function mn(p,v){if(m){let C=gn(p,v),O=m[C];if(typeof O=="number")return O}return null}function It(p,v,C){if(d)if(p){if(Object.keys(p[0].params).length>0)return{active:!0,matches:Kt(v,C,l,!0)}}else return{active:!0,matches:Kt(v,C,l,!0)||[]};return{active:!1,matches:null}}async function kt(p,v,C,O){if(!d)return{type:"success",matches:p};let P=p;for(;;){let F=s==null,V=s||i,T=a;try{await d({signal:C,path:v,matches:P,fetcherKey:O,patch:(M,z)=>{C.aborted||qn(M,z,V,T,o)}})}catch(M){return{type:"error",error:M,partialMatches:P}}finally{F&&!C.aborted&&(i=[...i])}if(C.aborted)return{type:"aborted"};let I=Me(V,v,l);if(I)return{type:"success",matches:I};let A=Kt(V,v,l,!0);if(!A||P.length===A.length&&P.every((M,z)=>M.route.id===A[z].route.id))return{type:"success",matches:null};P=A}}function oi(p){a={},s=qt(p,o,void 0,a)}function ai(p,v){let C=s==null;qn(p,v,s||i,a,o),C&&(i=[...i],ve({}))}return k={get basename(){return l},get future(){return u},get state(){return E},get routes(){return i},get window(){return e},initialize:za,subscribe:Wa,enableScrollRestoration:ri,navigate:an,fetch:qa,revalidate:Ya,createHref:p=>t.history.createHref(p),encodeLocation:p=>t.history.encodeLocation(p),getFetcher:cn,deleteFetcher:ei,dispose:Ka,getBlocker:ti,deleteBlocker:hn,patchRoutes:ai,_internalFetchControllers:te,_internalActiveDeferreds:We,_internalSetRoutes:oi},k}function Mc(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function kr(t,e,r,n,o,a,i,s){let l,c;if(i){l=[];for(let u of e)if(l.push(u),u.route.id===i){c=u;break}}else l=e,c=e[e.length-1];let d=aa(o||".",oa(l,a),Pt(t.pathname,r)||t.pathname,s==="path");if(o==null&&(d.search=t.search,d.hash=t.hash),(o==null||o===""||o===".")&&c){let u=Qr(d.search);if(c.route.index&&!u)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&u){let h=new URLSearchParams(d.search),f=h.getAll("index");h.delete("index"),f.filter(y=>y).forEach(y=>h.append("index",y));let m=h.toString();d.search=m?"?"+m:""}}return n&&r!=="/"&&(d.pathname=d.pathname==="/"?r:Ue([r,d.pathname])),Lt(d)}function Yn(t,e,r,n){if(!n||!Mc(n))return{path:r};if(n.formMethod&&!Jc(n.formMethod))return{path:r,error:Ee(405,{method:n.formMethod})};let o=()=>({path:r,error:Ee(400,{type:"invalid-body"})}),a=n.formMethod||"get",i=t?a.toUpperCase():a.toLowerCase(),s=ua(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Re(i))return o();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((f,m)=>{let[y,S]=m;return""+f+y+"="+S+`
|
|
5
5
|
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!Re(i))return o();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:s,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}K(typeof FormData=="function","FormData is not available in this environment");let l,c;if(n.formData)l=Mr(n.formData),c=n.formData;else if(n.body instanceof FormData)l=Mr(n.body),c=n.body;else if(n.body instanceof URLSearchParams)l=n.body,c=Qn(l);else if(n.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(n.body),c=Qn(l)}catch{return o()}let d={formMethod:i,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Re(d.formMethod))return{path:r,submission:d};let u=$e(r);return e&&u.search&&Qr(u.search)&&l.append("index",""),u.search="?"+l,{path:Lt(u),submission:d}}function Gn(t,e,r){r===void 0&&(r=!1);let n=t.findIndex(o=>o.route.id===e);return n>=0?t.slice(0,r?n+1:n):t}function Jn(t,e,r,n,o,a,i,s,l,c,d,u,h,f,m,y){let S=y?ye(y[1])?y[1].error:y[1].data:void 0,_=t.createURL(e.location),R=t.createURL(o),L=r;a&&e.errors?L=Gn(r,Object.keys(e.errors)[0],!0):y&&ye(y[1])&&(L=Gn(r,y[0]));let b=y?y[1].statusCode:void 0,w=i&&b&&b>=400,k=L.filter((x,j)=>{let{route:H}=x;if(H.lazy)return!0;if(H.loader==null)return!1;if(a)return Hr(H,e.loaderData,e.errors);if(jc(e.loaderData,e.matches[j],x)||l.some(Y=>Y===x.route.id))return!0;let $=e.matches[j],B=x;return Xn(x,re({currentUrl:_,currentParams:$.params,nextUrl:R,nextParams:B.params},n,{actionResult:S,actionStatus:b,defaultShouldRevalidate:w?!1:s||_.pathname+_.search===R.pathname+R.search||_.search!==R.search||la($,B)}))}),E=[];return u.forEach((x,j)=>{if(a||!r.some(G=>G.route.id===x.routeId)||d.has(j))return;let H=Me(f,x.path,m);if(!H){E.push({key:j,routeId:x.routeId,path:x.path,matches:null,match:null,controller:null});return}let $=e.fetchers.get(j),B=Ct(H,x.path),Y=!1;h.has(j)?Y=!1:c.has(j)?(c.delete(j),Y=!0):$&&$.state!=="idle"&&$.data===void 0?Y=s:Y=Xn(B,re({currentUrl:_,currentParams:e.matches[e.matches.length-1].params,nextUrl:R,nextParams:r[r.length-1].params},n,{actionResult:S,actionStatus:b,defaultShouldRevalidate:w?!1:s})),Y&&E.push({key:j,routeId:x.routeId,path:x.path,matches:H,match:B,controller:new AbortController})}),[k,E]}function Hr(t,e,r){if(t.lazy)return!0;if(!t.loader)return!1;let n=e!=null&&e[t.id]!==void 0,o=r!=null&&r[t.id]!==void 0;return!n&&o?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!n&&!o}function jc(t,e,r){let n=!e||r.route.id!==e.route.id,o=t[r.route.id]===void 0;return n||o}function la(t,e){let r=t.route.path;return t.pathname!==e.pathname||r!=null&&r.endsWith("*")&&t.params["*"]!==e.params["*"]}function Xn(t,e){if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate(e);if(typeof r=="boolean")return r}return e.defaultShouldRevalidate}function qn(t,e,r,n,o){var a;let i;if(t){let c=n[t];K(c,"No route found to patch children into: routeId = "+t),c.children||(c.children=[]),i=c.children}else i=r;let s=e.filter(c=>!i.some(d=>ca(c,d))),l=qt(s,o,[t||"_","patch",String(((a=i)==null?void 0:a.length)||"0")],n);i.push(...l)}function ca(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((r,n)=>{var o;return(o=e.children)==null?void 0:o.some(a=>ca(r,a))}):!1}async function Fc(t,e,r){if(!t.lazy)return;let n=await t.lazy();if(!t.lazy)return;let o=r[t.id];K(o,"No route found in manifest");let a={};for(let i in n){let l=o[i]!==void 0&&i!=="hasErrorBoundary";ft(!l,'Route "'+o.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!l&&!cc.has(i)&&(a[i]=n[i])}Object.assign(o,a),Object.assign(o,re({},e(o),{lazy:void 0}))}async function Bc(t){let{matches:e}=t,r=e.filter(o=>o.shouldLoad);return(await Promise.all(r.map(o=>o.resolve()))).reduce((o,a,i)=>Object.assign(o,{[r[i].route.id]:a}),{})}async function Vc(t,e,r,n,o,a,i,s,l,c){let d=a.map(f=>f.route.lazy?Fc(f.route,l,s):void 0),u=a.map((f,m)=>{let y=d[m],S=o.some(R=>R.route.id===f.route.id);return re({},f,{shouldLoad:S,resolve:async R=>(R&&n.method==="GET"&&(f.route.lazy||f.route.loader)&&(S=!0),S?Uc(e,n,f,y,R,c):Promise.resolve({type:Z.data,result:void 0}))})}),h=await t({matches:u,request:n,params:a[0].params,fetcherKey:i,context:c});try{await Promise.all(d)}catch{}return h}async function Uc(t,e,r,n,o,a){let i,s,l=c=>{let d,u=new Promise((m,y)=>d=y);s=()=>d(),e.signal.addEventListener("abort",s);let h=m=>typeof c!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+r.route.id+"]"))):c({request:e,params:r.params,context:a},...m!==void 0?[m]:[]),f=(async()=>{try{return{type:"data",result:await(o?o(y=>h(y)):h())}}catch(m){return{type:"error",result:m}}})();return Promise.race([f,u])};try{let c=r.route[t];if(n)if(c){let d,[u]=await Promise.all([l(c).catch(h=>{d=h}),n]);if(d!==void 0)throw d;i=u}else if(await n,c=r.route[t],c)i=await l(c);else if(t==="action"){let d=new URL(e.url),u=d.pathname+d.search;throw Ee(405,{method:e.method,pathname:u,routeId:r.route.id})}else return{type:Z.data,result:void 0};else if(c)i=await l(c);else{let d=new URL(e.url),u=d.pathname+d.search;throw Ee(404,{pathname:u})}K(i.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(c){return{type:Z.error,result:c}}finally{s&&e.signal.removeEventListener("abort",s)}return i}async function $c(t){let{result:e,type:r}=t;if(da(e)){let u;try{let h=e.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?e.body==null?u=null:u=await e.json():u=await e.text()}catch(h){return{type:Z.error,error:h}}return r===Z.error?{type:Z.error,error:new Zt(e.status,e.statusText,u),statusCode:e.status,headers:e.headers}:{type:Z.data,data:u,statusCode:e.status,headers:e.headers}}if(r===Z.error){if(oo(e)){var n,o;if(e.data instanceof Error){var a,i;return{type:Z.error,error:e.data,statusCode:(a=e.init)==null?void 0:a.status,headers:(i=e.init)!=null&&i.headers?new Headers(e.init.headers):void 0}}return{type:Z.error,error:new Zt(((n=e.init)==null?void 0:n.status)||500,void 0,e.data),statusCode:xt(e)?e.status:void 0,headers:(o=e.init)!=null&&o.headers?new Headers(e.init.headers):void 0}}return{type:Z.error,error:e,statusCode:xt(e)?e.status:void 0}}if(Gc(e)){var s,l;return{type:Z.deferred,deferredData:e,statusCode:(s=e.init)==null?void 0:s.status,headers:((l=e.init)==null?void 0:l.headers)&&new Headers(e.init.headers)}}if(oo(e)){var c,d;return{type:Z.data,data:e.data,statusCode:(c=e.init)==null?void 0:c.status,headers:(d=e.init)!=null&&d.headers?new Headers(e.init.headers):void 0}}return{type:Z.data,data:e}}function zc(t,e,r,n,o,a){let i=t.headers.get("Location");if(K(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!qr.test(i)){let s=n.slice(0,n.findIndex(l=>l.route.id===r)+1);i=kr(new URL(e.url),s,o,!0,i,a),t.headers.set("Location",i)}return t}function Zn(t,e,r){if(qr.test(t)){let n=t,o=n.startsWith("//")?new URL(e.protocol+n):new URL(n),a=Pt(o.pathname,r)!=null;if(o.origin===e.origin&&a)return o.pathname+o.search+o.hash}return t}function it(t,e,r,n){let o=t.createURL(ua(e)).toString(),a={signal:r};if(n&&Re(n.formMethod)){let{formMethod:i,formEncType:s}=n;a.method=i.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(n.json)):s==="text/plain"?a.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?a.body=Mr(n.formData):a.body=n.formData}return new Request(o,a)}function Mr(t){let e=new URLSearchParams;for(let[r,n]of t.entries())e.append(r,typeof n=="string"?n:n.name);return e}function Qn(t){let e=new FormData;for(let[r,n]of t.entries())e.append(r,n);return e}function Kc(t,e,r,n,o){let a={},i=null,s,l=!1,c={},d=r&&ye(r[1])?r[1].error:void 0;return t.forEach(u=>{if(!(u.route.id in e))return;let h=u.route.id,f=e[h];if(K(!Ze(f),"Cannot handle redirect results in processLoaderData"),ye(f)){let m=f.error;d!==void 0&&(m=d,d=void 0),i=i||{};{let y=qe(t,h);i[y.route.id]==null&&(i[y.route.id]=m)}a[h]=void 0,l||(l=!0,s=xt(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else Fe(f)?(n.set(h,f.deferredData),a[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers)):(a[h]=f.data,f.statusCode&&f.statusCode!==200&&!l&&(s=f.statusCode),f.headers&&(c[h]=f.headers))}),d!==void 0&&r&&(i={[r[0]]:d},a[r[0]]=void 0),{loaderData:a,errors:i,statusCode:s||200,loaderHeaders:c}}function eo(t,e,r,n,o,a,i){let{loaderData:s,errors:l}=Kc(e,r,n,i);return o.forEach(c=>{let{key:d,match:u,controller:h}=c,f=a[d];if(K(f,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(ye(f)){let m=qe(t.matches,u?.route.id);l&&l[m.route.id]||(l=re({},l,{[m.route.id]:f.error})),t.fetchers.delete(d)}else if(Ze(f))K(!1,"Unhandled fetcher revalidation redirect");else if(Fe(f))K(!1,"Unhandled fetcher deferred data");else{let m=He(f.data);t.fetchers.set(d,m)}}),{loaderData:s,errors:l}}function to(t,e,r,n){let o=re({},e);for(let a of r){let i=a.route.id;if(e.hasOwnProperty(i)?e[i]!==void 0&&(o[i]=e[i]):t[i]!==void 0&&a.route.loader&&(o[i]=t[i]),n&&n.hasOwnProperty(i))break}return o}function ro(t){return t?ye(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function qe(t,e){return(e?t.slice(0,t.findIndex(n=>n.route.id===e)+1):[...t]).reverse().find(n=>n.route.hasErrorBoundary===!0)||t[0]}function no(t){let e=t.length===1?t[0]:t.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Ee(t,e){let{pathname:r,routeId:n,method:o,type:a,message:i}=e===void 0?{}:e,s="Unknown Server Error",l="Unknown @remix-run/router error";return t===400?(s="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":a==="defer-action"?l="defer() is not supported in actions":a==="invalid-body"&&(l="Unable to encode submission body")):t===403?(s="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):t===404?(s="Not Found",l='No route matches URL "'+r+'"'):t===405&&(s="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Zt(t||500,s,new Error(l),!0)}function Vt(t){let e=Object.entries(t);for(let r=e.length-1;r>=0;r--){let[n,o]=e[r];if(Ze(o))return{key:n,result:o}}}function ua(t){let e=typeof t=="string"?$e(t):t;return Lt(re({},e,{hash:""}))}function Wc(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Yc(t){return da(t.result)&&Ac.has(t.result.status)}function Fe(t){return t.type===Z.deferred}function ye(t){return t.type===Z.error}function Ze(t){return(t&&t.type)===Z.redirect}function oo(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Gc(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function da(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Jc(t){return wc.has(t.toLowerCase())}function Re(t){return Lc.has(t.toLowerCase())}async function Xc(t,e,r,n,o){let a=Object.entries(e);for(let i=0;i<a.length;i++){let[s,l]=a[i],c=t.find(h=>h?.route.id===s);if(!c)continue;let d=n.find(h=>h.route.id===c.route.id),u=d!=null&&!la(d,c)&&(o&&o[c.route.id])!==void 0;Fe(l)&&u&&await Zr(l,r,!1).then(h=>{h&&(e[s]=h)})}}async function qc(t,e,r){for(let n=0;n<r.length;n++){let{key:o,routeId:a,controller:i}=r[n],s=e[o];t.find(c=>c?.route.id===a)&&Fe(s)&&(K(i,"Expected an AbortController for revalidating fetcher deferred result"),await Zr(s,i.signal,!0).then(c=>{c&&(e[o]=c)}))}}async function Zr(t,e,r){if(r===void 0&&(r=!1),!await t.deferredData.resolveData(e)){if(r)try{return{type:Z.data,data:t.deferredData.unwrappedData}}catch(o){return{type:Z.error,error:o}}return{type:Z.data,data:t.deferredData.data}}}function Qr(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ct(t,e){let r=typeof e=="string"?$e(e).search:e.search;if(t[t.length-1].route.index&&Qr(r||""))return t[t.length-1];let n=na(t);return n[n.length-1]}function ao(t){let{formMethod:e,formAction:r,formEncType:n,text:o,formData:a,json:i}=t;if(!(!e||!r||!n)){if(o!=null)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:e,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0};if(i!==void 0)return{formMethod:e,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function Cr(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Zc(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function yt(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Qc(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function He(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function eu(t,e){try{let r=t.sessionStorage.getItem(sa);if(r){let n=JSON.parse(r);for(let[o,a]of Object.entries(n||{}))a&&Array.isArray(a)&&e.set(o,new Set(a||[]))}}catch{}}function tu(t,e){if(e.size>0){let r={};for(let[n,o]of e)r[n]=[...o];try{t.sessionStorage.setItem(sa,JSON.stringify(r))}catch(n){ft(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}function Qt(){return Qt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Qt.apply(this,arguments)}const nr=g.createContext(null),fa=g.createContext(null),or=g.createContext(null),ar=g.createContext(null),ze=g.createContext({outlet:null,matches:[],isDataRoute:!1}),ha=g.createContext(null);function ir(){return g.useContext(ar)!=null}function sr(){return ir()||K(!1),g.useContext(ar).location}function ru(){return g.useContext(ar).navigationType}function pa(t){g.useContext(or).static||g.useLayoutEffect(t)}function nu(){let{isDataRoute:t}=g.useContext(ze);return t?Eu():ou()}function ou(){ir()||K(!1);let t=g.useContext(nr),{basename:e,future:r,navigator:n}=g.useContext(or),{matches:o}=g.useContext(ze),{pathname:a}=sr(),i=JSON.stringify(oa(o,r.v7_relativeSplatPath)),s=g.useRef(!1);return pa(()=>{s.current=!0}),g.useCallback(function(c,d){if(d===void 0&&(d={}),!s.current)return;if(typeof c=="number"){n.go(c);return}let u=aa(c,JSON.parse(i),a,d.relative==="path");t==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:Ue([e,u.pathname])),(d.replace?n.replace:n.push)(u,d.state,d)},[e,n,i,a,t])}const au=g.createContext(null);function iu(t){let e=g.useContext(ze).outlet;return e&&g.createElement(au.Provider,{value:t},e)}function su(){let{matches:t}=g.useContext(ze),e=t[t.length-1];return e?e.params:{}}function lu(t,e,r,n){ir()||K(!1);let{navigator:o}=g.useContext(or),{matches:a}=g.useContext(ze),i=a[a.length-1],s=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=sr(),d;d=c;let u=d.pathname||"/",h=u;if(l!=="/"){let y=l.replace(/^\//,"").split("/");h="/"+u.replace(/^\//,"").split("/").slice(y.length).join("/")}let f=Me(t,{pathname:h});return hu(f&&f.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Ue([l,o.encodeLocation?o.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Ue([l,o.encodeLocation?o.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n)}function cu(){let t=vu(),e=xt(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},e),r?g.createElement("pre",{style:o},r):null,null)}const uu=g.createElement(cu,null);class du extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?g.createElement(ze.Provider,{value:this.props.routeContext},g.createElement(ha.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fu(t){let{routeContext:e,match:r,children:n}=t,o=g.useContext(nr);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),g.createElement(ze.Provider,{value:e},n)}function hu(t,e,r,n){var o;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var a;if(!r)return null;if(r.errors)t=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let i=t,s=(o=r)==null?void 0:o.errors;if(s!=null){let d=i.findIndex(u=>u.route.id&&s?.[u.route.id]!==void 0);d>=0||K(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<i.length;d++){let u=i[d];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=d),u.route.id){let{loaderData:h,errors:f}=r,m=u.route.loader&&h[u.route.id]===void 0&&(!f||f[u.route.id]===void 0);if(u.route.lazy||m){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,u,h)=>{let f,m=!1,y=null,S=null;r&&(f=s&&u.route.id?s[u.route.id]:void 0,y=u.route.errorElement||uu,l&&(c<0&&h===0?(yu("route-fallback"),m=!0,S=null):c===h&&(m=!0,S=u.route.hydrateFallbackElement||null)));let _=e.concat(i.slice(0,h+1)),R=()=>{let L;return f?L=y:m?L=S:u.route.Component?L=g.createElement(u.route.Component,null):u.route.element?L=u.route.element:L=d,g.createElement(fu,{match:u,routeContext:{outlet:d,matches:_,isDataRoute:r!=null},children:L})};return r&&(u.route.ErrorBoundary||u.route.errorElement||h===0)?g.createElement(du,{location:r.location,revalidation:r.revalidation,component:y,error:f,children:R(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):R()},null)}var ga=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(ga||{}),ma=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(ma||{});function pu(t){let e=g.useContext(nr);return e||K(!1),e}function gu(t){let e=g.useContext(fa);return e||K(!1),e}function mu(t){let e=g.useContext(ze);return e||K(!1),e}function va(t){let e=mu(),r=e.matches[e.matches.length-1];return r.route.id||K(!1),r.route.id}function vu(){var t;let e=g.useContext(ha),r=gu(ma.UseRouteError),n=va();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Eu(){let{router:t}=pu(ga.UseNavigateStable),e=va(),r=g.useRef(!1);return pa(()=>{r.current=!0}),g.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?t.navigate(o):t.navigate(o,Qt({fromRouteId:e},a)))},[t,e])}const io={};function yu(t,e,r){io[t]||(io[t]=!0)}function _u(t,e){t?.v7_startTransition,t?.v7_relativeSplatPath===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function Cu(t){return iu(t.context)}function Su(t){K(!1)}function Nu(t){let{basename:e="/",children:r=null,location:n,navigationType:o=le.Pop,navigator:a,static:i=!1,future:s}=t;ir()&&K(!1);let l=e.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:l,navigator:a,static:i,future:Qt({v7_relativeSplatPath:!1},s)}),[l,s,a,i]);typeof n=="string"&&(n=$e(n));let{pathname:d="/",search:u="",hash:h="",state:f=null,key:m="default"}=n,y=g.useMemo(()=>{let S=Pt(d,l);return S==null?null:{location:{pathname:S,search:u,hash:h,state:f,key:m},navigationType:o}},[l,d,u,h,f,m,o]);return y==null?null:g.createElement(or.Provider,{value:c},g.createElement(ar.Provider,{children:r,value:y}))}new Promise(()=>{});function jr(t,e){e===void 0&&(e=[]);let r=[];return g.Children.forEach(t,(n,o)=>{if(!g.isValidElement(n))return;let a=[...e,o];if(n.type===g.Fragment){r.push.apply(r,jr(n.props.children,a));return}n.type!==Su&&K(!1),!n.props.index||!n.props.children||K(!1);let i={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=jr(n.props.children,a)),r.push(i)}),r}function Ru(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:g.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:g.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:g.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function er(){return er=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},er.apply(this,arguments)}const bu="6";try{window.__reactRouterVersion=bu}catch{}function Ou(t,e){return Hc({basename:e?.basename,future:er({},e?.future,{v7_prependBasename:!0}),history:ic({window:e?.window}),hydrationData:e?.hydrationData||xu(),routes:t,mapRouteProperties:Ru,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window}).initialize()}function xu(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=er({},e,{errors:Du(e.errors)})),e}function Du(t){if(!t)return null;let e=Object.entries(t),r={};for(let[n,o]of e)if(o&&o.__type==="RouteErrorResponse")r[n]=new Zt(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let i=new a(o.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let a=new Error(o.message);a.stack="",r[n]=a}}else r[n]=o;return r}const Lu=g.createContext({isTransitioning:!1}),Pu=g.createContext(new Map),wu="startTransition",so=ds[wu],Au="flushSync",lo=Cs[Au];function Tu(t){so?so(t):t()}function _t(t){lo?lo(t):t()}class Iu{constructor(){this.status="pending",this.promise=new Promise((e,r)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",r(n))}})}}function ku(t){let{fallbackElement:e,router:r,future:n}=t,[o,a]=g.useState(r.state),[i,s]=g.useState(),[l,c]=g.useState({isTransitioning:!1}),[d,u]=g.useState(),[h,f]=g.useState(),[m,y]=g.useState(),S=g.useRef(new Map),{v7_startTransition:_}=n||{},R=g.useCallback(x=>{_?Tu(x):x()},[_]),L=g.useCallback((x,j)=>{let{deletedFetchers:H,flushSync:$,viewTransitionOpts:B}=j;x.fetchers.forEach((G,ge)=>{G.data!==void 0&&S.current.set(ge,G.data)}),H.forEach(G=>S.current.delete(G));let Y=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!B||Y){$?_t(()=>a(x)):R(()=>a(x));return}if($){_t(()=>{h&&(d&&d.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let G=r.window.document.startViewTransition(()=>{_t(()=>a(x))});G.finished.finally(()=>{_t(()=>{u(void 0),f(void 0),s(void 0),c({isTransitioning:!1})})}),_t(()=>f(G));return}h?(d&&d.resolve(),h.skipTransition(),y({state:x,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(s(x),c({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[r.window,h,d,S,R]);g.useLayoutEffect(()=>r.subscribe(L),[r,L]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&u(new Iu)},[l]),g.useEffect(()=>{if(d&&i&&r.window){let x=i,j=d.promise,H=r.window.document.startViewTransition(async()=>{R(()=>a(x)),await j});H.finished.finally(()=>{u(void 0),f(void 0),s(void 0),c({isTransitioning:!1})}),f(H)}},[R,i,d,r.window]),g.useEffect(()=>{d&&i&&o.location.key===i.location.key&&d.resolve()},[d,h,o.location,i]),g.useEffect(()=>{!l.isTransitioning&&m&&(s(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),y(void 0))},[l.isTransitioning,m]),g.useEffect(()=>{},[]);let b=g.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:x=>r.navigate(x),push:(x,j,H)=>r.navigate(x,{state:j,preventScrollReset:H?.preventScrollReset}),replace:(x,j,H)=>r.navigate(x,{replace:!0,state:j,preventScrollReset:H?.preventScrollReset})}),[r]),w=r.basename||"/",k=g.useMemo(()=>({router:r,navigator:b,static:!1,basename:w}),[r,b,w]),E=g.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return g.useEffect(()=>_u(n,r.future),[n,r.future]),g.createElement(g.Fragment,null,g.createElement(nr.Provider,{value:k},g.createElement(fa.Provider,{value:o},g.createElement(Pu.Provider,{value:S.current},g.createElement(Lu.Provider,{value:l},g.createElement(Nu,{basename:w,location:o.location,navigationType:o.historyAction,navigator:b,future:E},o.initialized||r.future.v7_partialHydration?g.createElement(Hu,{routes:r.routes,future:r.future,state:o}):e))))),null)}const Hu=g.memo(Mu);function Mu(t){let{routes:e,future:r,state:n}=t;return lu(e,void 0,n,r)}var co;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(co||(co={}));var uo;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(uo||(uo={}));const fo=Mo(["sentry"]);let en=!1;async function Ea(){return await me(()=>import("./sentry_react-C4W8xEsl.js").then(t=>t.i),__vite__mapDeps([0,1]))}async function ju(){const t=await Ea(),e=[t.httpClientIntegration(),t.extraErrorDataIntegration({depth:5}),t.replayIntegration(),t.captureConsoleIntegration({levels:["error"]})];ce.sentry.tracing&&e.push(t.reactRouterV6BrowserTracingIntegration({useEffect:fs.useEffect,useLocation:sr,useNavigationType:ru,createRoutesFromChildren:jr,matchRoutes:Me})),t.init({release:ce.sentry.release,dsn:ce.sentry.dsn,environment:ce.sentry.env,integrations:e,ignoreErrors:["User is not allowed to create files","User is not allowed to move documents","The user aborted a request."],sendDefaultPii:!0,tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,beforeSend(r,n){const o=n.originalException;return o instanceof TypeError&&o.message.includes("Failed to fetch")&&!navigator.onLine?null:r}}),en=!0}async function Fu(){return en?(await Ea()).getClient()?.close():void 0}function Bu(){const[t]=Yr(),{analytics:e}=t;g.useEffect(()=>{if(!e){Fu().catch(r=>fo.error(r));return}en||!ce.sentry.dsn||ce.sentry.dsn===""||ju().catch(r=>fo.error(r))},[e])}function Fr(){return Fr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Fr.apply(null,arguments)}var ya=["shift","alt","meta","mod","ctrl"],Vu={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Be(t){return(t&&Vu[t]||t||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Uu(t){return ya.includes(t)}function Sr(t,e){return e===void 0&&(e=","),t.split(e)}function Nr(t,e,r){e===void 0&&(e="+");var n=t.toLocaleLowerCase().split(e).map(function(i){return Be(i)}),o={alt:n.includes("alt"),ctrl:n.includes("ctrl")||n.includes("control"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},a=n.filter(function(i){return!ya.includes(i)});return Fr({},o,{keys:a,description:r,hotkey:t})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(t){t.key!==void 0&&_a([Be(t.key),Be(t.code)])}),document.addEventListener("keyup",function(t){t.key!==void 0&&Ca([Be(t.key),Be(t.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ve.clear()})})();var Ve=new Set;function tn(t){return Array.isArray(t)}function $u(t,e){e===void 0&&(e=",");var r=tn(t)?t:t.split(e);return r.every(function(n){return Ve.has(n.trim().toLowerCase())})}function _a(t){var e=Array.isArray(t)?t:[t];Ve.has("meta")&&Ve.forEach(function(r){return!Uu(r)&&Ve.delete(r.toLowerCase())}),e.forEach(function(r){return Ve.add(r.toLowerCase())})}function Ca(t){var e=Array.isArray(t)?t:[t];t==="meta"?Ve.clear():e.forEach(function(r){return Ve.delete(r.toLowerCase())})}function zu(t,e,r){(typeof r=="function"&&r(t,e)||r===!0)&&t.preventDefault()}function Ku(t,e,r){return typeof r=="function"?r(t,e):r===!0||r===void 0}function Wu(t){return Sa(t,["input","textarea","select"])}function Sa(t,e){e===void 0&&(e=!1);var r=t.target,n=t.composed,o=null;return Yu(r)&&n?o=t.composedPath()[0]&&t.composedPath()[0].tagName:o=r&&r.tagName,tn(e)?!!(o&&e&&e.some(function(a){var i;return a.toLowerCase()===((i=o)==null?void 0:i.toLowerCase())})):!!(o&&e&&e)}function Yu(t){return!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-")}function Gu(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(function(r){return e.includes(r)})||t.includes("*"):!0}var Ju=function(e,r,n){n===void 0&&(n=!1);var o=r.alt,a=r.meta,i=r.mod,s=r.shift,l=r.ctrl,c=r.keys,d=e.key,u=e.code,h=e.ctrlKey,f=e.metaKey,m=e.shiftKey,y=e.altKey,S=Be(u),_=d.toLowerCase();if(!(c!=null&&c.includes(S))&&!(c!=null&&c.includes(_))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(S))return!1;if(!n){if(o===!y&&_!=="alt"||s===!m&&_!=="shift")return!1;if(i){if(!f&&!h)return!1}else if(a===!f&&_!=="meta"&&_!=="os"||l===!h&&_!=="ctrl"&&_!=="control")return!1}return c&&c.length===1&&(c.includes(_)||c.includes(S))?!0:c?$u(c):!c},Xu=g.createContext(void 0),qu=function(){return g.useContext(Xu)};function Na(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce(function(r,n){return r&&Na(t[n],e[n])},!0):t===e}var Zu=g.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Qu=function(){return g.useContext(Zu)};function ed(t){var e=g.useRef(void 0);return Na(e.current,t)||(e.current=t),e.current}var ho=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},td=typeof window<"u"?g.useLayoutEffect:g.useEffect;function po(t,e,r,n){var o=g.useState(null),a=o[0],i=o[1],s=g.useRef(!1),l=r instanceof Array?n instanceof Array?void 0:n:r,c=tn(t)?t.join(l?.splitKey):t,d=r instanceof Array?r:n instanceof Array?n:void 0,u=g.useCallback(e,d??[]),h=g.useRef(u);d?h.current=u:h.current=e;var f=ed(l),m=Qu(),y=m.enabledScopes,S=qu();return td(function(){if(!(f?.enabled===!1||!Gu(y,f?.scopes))){var _=function(k,E){var x;if(E===void 0&&(E=!1),!(Wu(k)&&!Sa(k,f?.enableOnFormTags))){if(a!==null){var j=a.getRootNode();if((j instanceof Document||j instanceof ShadowRoot)&&j.activeElement!==a&&!a.contains(j.activeElement)){ho(k);return}}(x=k.target)!=null&&x.isContentEditable&&!(f!=null&&f.enableOnContentEditable)||Sr(c,f?.splitKey).forEach(function(H){var $,B=Nr(H,f?.combinationKey);if(Ju(k,B,f?.ignoreModifiers)||($=B.keys)!=null&&$.includes("*")){if(f!=null&&f.ignoreEventWhen!=null&&f.ignoreEventWhen(k)||E&&s.current)return;if(zu(k,B,f?.preventDefault),!Ku(k,B,f?.enabled)){ho(k);return}h.current(k,B),E||(s.current=!0)}})}},R=function(k){k.key!==void 0&&(_a(Be(k.code)),(f?.keydown===void 0&&f?.keyup!==!0||f!=null&&f.keydown)&&_(k))},L=function(k){k.key!==void 0&&(Ca(Be(k.code)),s.current=!1,f!=null&&f.keyup&&_(k,!0))},b=a||l?.document||document;return b.addEventListener("keyup",L,l?.eventListenerOptions),b.addEventListener("keydown",R,l?.eventListenerOptions),S&&Sr(c,f?.splitKey).forEach(function(w){return S.addHotkey(Nr(w,f?.combinationKey,f?.description))}),function(){b.removeEventListener("keyup",L,l?.eventListenerOptions),b.removeEventListener("keydown",R,l?.eventListenerOptions),S&&Sr(c,f?.splitKey).forEach(function(w){return S.removeHotkey(Nr(w,f?.combinationKey,f?.description))})}}},[a,c,f,y]),i}const rd=t=>{const{undo:e,redo:r,canRedo:n,canUndo:o}=t,a=window.navigator.userAgent.includes("Mac");let i="ctrl+z",s="ctrl+y";a&&(i="mod+z",s="mod+shift+z"),po(i,l=>{l.preventDefault(),o&&e()},{},[o,e]),po(s,l=>{l.preventDefault(),n&&r()},{},[n,r])};window.navigator.appVersion.includes("Mac");const go={"staging/makerdao":"deployments/staging/makerdao","staging/arbitrum":"arb-ltip","staging/powerhouse":"staging",makerdao:"deployments/makerdao",arbitrum:"deployments/arbitrum",arbgrants:"deployments/arbitrum",localhost:"develop"},nd=()=>{const t="https://raw.githubusercontent.com/powerhouse-inc/connect",e=window.location.href,r=Object.keys(go).find(o=>e.includes(o)),n=r?go[r]:void 0;if(n)return`${t}/${n}/package.json`},od=async()=>{const t=nd();if(!t)return;const r=await(await fetch(t)).json(),{version:n}=r;return n},ad=async()=>{const t=ce.appVersion,e=await od();return e?{isLatest:e===t,currentVersion:t,latestVersion:e}:null};function mo(...t){window.dataLayer?.push(...t)}const id=()=>{const t=ce.gaTrackingId,[{analytics:e}]=Yr(),r=t&&e;return g.useEffect(()=>{if(r){const n=document.createElement("script");return n.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,n.async=!0,document.head.appendChild(n),window.dataLayer=window.dataLayer||[],mo("js",new Date),mo("config",t),()=>{document.head.removeChild(n)}}},[r,t]),null};function sd(){return typeof document>"u"?"/":document.querySelector("base")?.getAttribute("href")||"/"}const ld=["preserve-all","preserve-by-url-and-detach"],cd=()=>{const t=ce.drives.preserveStrategy;return t&&(r=>ld.includes(r))(t)?t:"preserve-by-url-and-detach"},ud=t=>{if(t.length===0)return{strategy:"preserve-all"};switch(cd()){case"preserve-all":return{strategy:"preserve-all"};case"preserve-by-url-and-detach":return{strategy:"preserve-by-url-and-detach",urls:t};default:return{strategy:"preserve-by-url-and-detach",urls:t}}},dd=t=>window.open(t,"_blank"),fd=dd,vo=[],hd=()=>({defaultDrives:{remoteDrives:vo.map(e=>({url:e,options:{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:e,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]}})),removeOldRemoteDrives:ud(vo)}});function pd(t){return new ms(t)}function gd(t,e,r){return new vs(t).withStorage(e).withCache(new Es).withQueueManager(new ys).withOptions({...r,...hd()}).build()}const md=ce.routerBasename,vd=[md,"service-worker.js"].join("/").replace(/\/{2,}/gm,"/");class Ed{ready=!1;debug=!1;registration=null;constructor(e=!1){this.debug=e}setDebug(e){this.debug=e}#t(e){this.debug&&console.log("ServiceWorker message: ",e);const r="type"in e.data?e:null;switch(r?.data.type){case"NEW_VERSION_AVAILABLE":{if(r.data.version===ce.appVersion)return;r.data.requiresHardRefresh&&(this.debug&&console.log("New version available"),window.location.reload());break}default:{console.warn("Unhandled message:",r);break}}}#e(e){this.debug&&console.log("ServiceWorker registered: ",e),navigator.serviceWorker.addEventListener("message",this.#t.bind(this)),this.registration=e,this.ready=!0}async#r(){try{const e=await navigator.serviceWorker.getRegistration();if(e)await e.update(),this.#e(e);else{const n=await navigator.serviceWorker.register(vd);this.#e(n),n.addEventListener("updatefound",()=>{this.#e(n)})}const r=setInterval(async()=>{const n=await navigator.serviceWorker.getRegistration();n?await n.update():(clearInterval(r),this.registerServiceWorker())},ce.appVersionCheckInterval)}catch(e){console.error("ServiceWorker registration failed: ",e)}}registerServiceWorker(e=!1){if(this.debug=e,!("serviceWorker"in navigator)){console.warn("Service Worker not available");return}window.addEventListener("load",()=>{this.#r().catch(console.error)})}}const yd=new Ed,_d=250,Cd=({delay:t=_d})=>{const e=typeof window>"u",r=typeof document<"u"&&document.body.getAttribute("data-show-loader")==="true",[n,o]=g.useState(!t||r);return g.useEffect(()=>{const a=setTimeout(()=>{o(!0)},t);return()=>clearTimeout(a)},[]),N.jsxs("div",{className:`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${n?"":"hidden"}`,children:[N.jsx("div",{className:"animate-pulse overflow-hidden rounded-full shadow-lg",children:N.jsx(qi,{})}),e?N.jsx("script",{dangerouslySetInnerHTML:{__html:`setTimeout(() => {
|
|
@@ -11,7 +11,7 @@ Latest: ${e.latestVersion}`):Jr(g.createElement(Ql),{type:"connect-warning",toas
|
|
|
11
11
|
const basePath = href || '/';
|
|
12
12
|
if (window.location.pathname === basePath) {
|
|
13
13
|
document.querySelector('.home-screen')?.classList.remove('hidden')
|
|
14
|
-
}`}}):null,N.jsx(Cd,{})]})};function Nd({children:t}){return N.jsx(N.Fragment,{children:t})}const Rd=({children:t})=>(Bu(),t),bd=()=>(g.useEffect(()=>{yd.registerServiceWorker(!1)},[]),N.jsx(Rd,{children:N.jsx(Zi,{children:N.jsxs(Nd,{children:[N.jsx(Qi,{position:"bottom-right",containerId:"connect"}),N.jsx(Rh,{}),N.jsx(id,{})]})})})),Od={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},xd={placeholder:"Search Powerhouse",filterLabel:"File type"},Dd={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},Ld={options:{switchboardLink:"Switchboard Link"}},Pd={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},wd={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},Ad={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},Td={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},Id={common:Od,searchbar:xd,folderView:Dd,files:Ld,modals:Pd,notifications:wd,footer:Ad,cookieBanner:Td},kd={en:{code:"en",name:"English",translation:Id}};pe.use(zl).init({resources:kd,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(t=>{console.error(t)});const Hd=(t,e)=>t.some(r=>r.id===e&&r.value),Md=()=>{const{t}=Zo(void 0,{useSuspense:!0,i18n:pe}),[e,r]=ac(),[,n]=Yr(),o=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],a=s=>{r(!1),Hd(s,"analytics-cookie")&&n(l=>({...l,analytics:!0}))},i=()=>{r(!1),n(()=>({analytics:!1,functional:!1,marketing:!1}))};return e?N.jsxs("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[N.jsx("div",{className:"absolute inset-0 bg-black opacity-15"}),N.jsx("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:N.jsx(es,{className:"max-w-[1024px]",cookies:o,onSubmit:a,onReject:i,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:N.jsx("p",{className:"font-semibold text-gray-500",children:N.jsx(Wl,{i18nKey:"cookieBanner.message",components:{a:N.jsx("a",{onClick:()=>Qe({type:"cookiesPolicy"}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null};function jd(){const[t]=Do(),[e]=Kr(),r=si(e?.header.id),n=li(t),o=ci(t),a=ui(),i=Wr(),s=d=>{if(fi(d).length)Qe({type:"exportDocumentWithErrors",documentId:d.header.id});else return hi(d)},l=()=>{if(e)return s(e)},c=g.useMemo(()=>n?async()=>{if(!e?.header.id){console.error("No selected document");return}if(!o){console.error("No remote drive url found");return}const d=i?.address?await a?.getBearerToken(o,i.address,!1,{expiresIn:600}):void 0,u=di(o,e.header.id,d);try{fd(u)}catch(h){console.error("Error opening switchboard link",h)}}:void 0,[n,o,e]);return e?N.jsx("div",{id:"document-editor-container",className:"flex-1 rounded-2xl bg-gray-50 p-4",children:N.jsx(zd,{document:e,onClose:()=>Lo(r),onExport:l,onOpenSwitchboardLink:c})}):null}const Fd=g.createContext(null),Rr={didCatch:!1,error:null};class rn extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rr}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var r,n,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Rr)}}componentDidCatch(e,r){var n,o;(n=(o=this.props).onError)===null||n===void 0||n.call(o,e,r)}componentDidUpdate(e,r){const{didCatch:n}=this.state,{resetKeys:o}=this.props;if(n&&r.error!==null&&Bd(e.resetKeys,o)){var a,i;(a=(i=this.props).onReset)===null||a===void 0||a.call(i,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(Rr)}}render(){const{children:e,fallbackRender:r,FallbackComponent:n,fallback:o}=this.props,{didCatch:a,error:i}=this.state;let s=e;if(a){const l={error:i,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")s=r(l);else if(n)s=g.createElement(n,l);else if(o!==void 0)s=o;else throw i}return g.createElement(Fd.Provider,{value:{didCatch:a,error:i,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Bd(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((r,n)=>!Object.is(r,e[n]))}function Wt(t){const[e,r]=g.useState(!1);if(g.useEffect(()=>{setTimeout(()=>{r(!0)},t.loadingTimeout??200)},[t]),!e)return null;const{customEditorLoader:n,...o}=t;return n?N.jsx(N.Fragment,{children:n}):N.jsx(ts,{...o})}function Vd({error:t}){return N.jsxs("div",{className:"mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center",children:[N.jsx("h1",{className:"mb-2 text-xl font-semibold",children:"Error"}),N.jsx("i",{children:t instanceof Error?t.message:t}),N.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Ud(){const[t]=Do(),[e]=Kr(),r=Po(t?.header.meta?.preferredEditor),n=pi(),o=r?.Component??n?.Component??Dr.Component;if(!o)throw new Error("No drive editor component found");return N.jsx(rn,{fallbackRender:Vd,children:N.jsx(g.Suspense,{fallback:N.jsx(Wt,{}),children:N.jsx(rs,{className:"flex h-full flex-col overflow-auto",children:N.jsx(o,{children:e?N.jsx(jd,{}):null})})})},t.header.id)}function Ra({drive:t}){const e=gi(t),r=t?.state.global.icon;return r?N.jsx("img",{src:r,alt:t.header.name,height:32,width:32}):e==="LOCAL"?N.jsx(Lr,{name:"Hdd",size:32}):N.jsx(Lr,{name:"Server",size:32})}function Br({message:t}){return N.jsx("div",{className:"flex size-full items-center justify-center",children:N.jsx("h3",{className:"text-lg font-semibold",children:t})})}function $d(t){const e=t.error instanceof Error?t.error.message:t.error;return N.jsx(Br,{message:e})}const zd=t=>{const{document:e,onClose:r,onExport:n,onOpenSwitchboardLink:o}=t,a=mi(),i=vi(),[s,l]=Ei(e.header.id),c=s?.header.id??void 0,d=s?.header.name??void 0,u=s?.header.documentType??void 0,h=s?.header.meta?.preferredEditor??void 0,f=s?.operations.global??[],m=s?.operations.local??[],y=s?.header.revision.global??0,S=s?.header.revision.local??0,_=yi(u),R=_i(h),L=Ci(u),b=R??L,w=!s,k=b&&u&&!b.documentTypes.includes(u)&&!b.documentTypes.includes("*"),E=y>0||S>0,x=!!s?.clipboard.length;rd({undo:()=>l(Ns()),redo:()=>l(Rs()),canUndo:E,canRedo:x}),g.useEffect(()=>()=>{window.documentEditorDebugTools?.clear()},[]);const[$,B]=g.useState(void 0);g.useEffect(()=>{$&&$.documentId!==c&&B(void 0)},[$,c]);const Y=(ge,ue)=>{B({error:ge,documentId:c,info:ue})};if(k)return N.jsx(Wt,{message:"Loading editor"});if(w)return N.jsx(Wt,{message:"Loading document"});if(!_)return N.jsx(Br,{message:N.jsxs("div",{className:"text-center leading-10",children:[N.jsxs("p",{children:['Unable to open the document because the document model "',u,'" is not supported.']}),N.jsxs("p",{children:["Go to the"," ",N.jsx("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{Qe({type:"settings"})},children:"package manager"})," ","to install this document model"]})]})});if(!b)return N.jsx(Br,{message:N.jsxs("div",{className:"text-center leading-10",children:[N.jsx("p",{children:"Unable to open the document because no editor has been found"}),N.jsxs("p",{children:["Go to the"," ",N.jsx("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{Qe({type:"settings"})},children:"package manager"})," ",'an editor for the "$',u,'" document type']})]})});const G=b.Component;return N.jsx("div",{className:"relative h-full",id:"document-editor-context",children:i?N.jsx(ns,{documentTitle:d??"",documentId:c??"",globalOperations:f,localOperations:m,onClose:()=>Si(!1),documentState:s.state,onCopyState:()=>{Jr("Copied document state to clipboard",{type:"success"})}},c):N.jsx(g.Suspense,{fallback:N.jsx(Wt,{message:"Loading editor"}),name:"EditorLoader",children:N.jsx(rn,{fallbackRender:$d,onError:Y,children:!$?.error&&N.jsx(G,{context:{readMode:!!a,selectedTimelineRevision:Ni(a?.startDate,a?.endDate,f)},documentId:s.header.id},c)},c)})})},Kd=Mo(["Connect","Modals"]);class Wd extends g.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){Kd.error(e,r)}render(){return this.state.hasError?null:this.props.children}}const Yd=g.lazy(()=>me(()=>import("./AddDriveModal-C2fZqOQI.js"),__vite__mapDeps([2,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.AddDriveModal}))),Gd=g.lazy(()=>me(()=>import("./ClearStorageModal-DjjEBXBS.js"),__vite__mapDeps([16,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.ClearStorageModal}))),Jd=g.lazy(()=>me(()=>import("./CookiesPolicyModal-BrOPPvzy.js"),__vite__mapDeps([17,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.CookiesPolicyModal}))),Xd=g.lazy(()=>me(()=>import("./CreateDocumentModal-C09c_nGK.js"),__vite__mapDeps([18,3,4,1,5,6,0,7,8,9,10,11,12,13])).then(t=>({default:t.CreateDocumentModal}))),qd=g.lazy(()=>me(()=>import("./DebugSettingsModal-PbDxwRkN.js"),__vite__mapDeps([19,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DebugSettingsModal}))),Zd=g.lazy(()=>me(()=>import("./DeleteDriveModal-x5WgUnZq.js"),__vite__mapDeps([20,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DeleteDriveModal}))),Qd=g.lazy(()=>me(()=>import("./DeleteItemModal-BBYKOKsF.js"),__vite__mapDeps([21,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DeleteItemModal}))),ef=g.lazy(()=>me(()=>import("./DisclaimerModal-CteySYvG.js"),__vite__mapDeps([22,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DisclaimerModal}))),tf=g.lazy(()=>me(()=>import("./DriveSettingsModal-B18X9rkK.js"),__vite__mapDeps([23,3,4,1,5,6,0,7,8,9,10,11,12,13])).then(t=>({default:t.DriveSettingsModal}))),rf=g.lazy(()=>me(()=>import("./ExportDocumentWithErrorsModal-B7IfIoUE.js"),__vite__mapDeps([24,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.ExportDocumentWithErrorsModal}))),nf=g.lazy(()=>me(()=>import("./SettingsModal-BrdAtrxz.js"),__vite__mapDeps([25,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.SettingsModal}))),of=g.lazy(()=>me(()=>import("./UpgradeDriveModal-fqiiEuOr.js"),__vite__mapDeps([26,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.UpgradeDriveModal}))),af={addDrive:Yd,clearStorage:Gd,cookiesPolicy:Jd,createDocument:Xd,debugSettings:qd,deleteDrive:Zd,deleteItem:Qd,disclaimer:ef,driveSettings:tf,exportDocumentWithErrors:rf,settings:nf,upgradeDrive:of};function sf(){const t=Ri();if(!t?.type)return null;const e=af[t.type];return e?N.jsx(Wd,{children:N.jsx(g.Suspense,{fallback:null,children:N.jsx(e,{})})}):null}function lf(){const t="Generic Drive Explorer",e=Dr.documentTypes,r=Dr.Component;return{id:bi,name:t,documentTypes:e,Component:r}}function cf(){const t="Document Model Editor",e="document-model-editor-v2",r=_n.documentTypes,n=_n.Component;return{id:e,name:t,documentTypes:r,Component:n}}async function uf(){const t=Ft.documentModel.global,e=t.name,r=t.id,n=r,o=t.extension,a=t.specifications,i=Ft.reducer,s=Ft.actions,l=Ft.utils;return{id:n,name:e,documentType:r,extension:o,specifications:a,reducer:i,actions:s,utils:l,documentModel:jo(Fo(),t)}}async function df(){const t=jt.documentModel.global,e=t.name,r=t.id,n=r,o=t.extension,a=t.specifications,i=jt.reducer,s=jt.actions,l=jt.utils;return{id:n,name:e,documentType:r,extension:o,specifications:a,reducer:i,actions:s,utils:l,documentModel:jo(Fo(),t)}}async function ff(){const t=await uf(),e=await df(),r=cf(),n=lf();return{id:Oi,name:"Common",description:"Common",category:"Common",author:{name:"Powerhouse",website:"https://powerhousedao.com"},modules:{documentModelModules:[t,e],editorModules:[r,n]}}}const{externalPackagesEnabled:hf}=ce;function pf(t){return t.loadExternalPackages().then(e=>e.map(xo))}async function gf(){try{if(!hf)return[];const t=await me(()=>import("./virtual_ph_external-packages-CM1tCR4L.js"),[]);return pf(t)}catch(t){return console.error(t),[]}}var mf=Object.defineProperty,vf=Object.defineProperties,Ef=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,yf=Object.prototype.hasOwnProperty,_f=Object.prototype.propertyIsEnumerable,yo=(t,e,r)=>e in t?mf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,br=(t,e)=>{for(var r in e||(e={}))yf.call(e,r)&&yo(t,r,e[r]);if(Eo)for(var r of Eo(e))_f.call(e,r)&&yo(t,r,e[r]);return t},Or=(t,e)=>vf(t,Ef(e)),lt=(t,e,r)=>new Promise((n,o)=>{var a=l=>{try{s(r.next(l))}catch(c){o(c)}},i=l=>{try{s(r.throw(l))}catch(c){o(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,i);s((r=r.apply(t,e)).next())}),Cf=class{constructor(){this.data=new Map}set(t,e){this.data.set(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}delete(t){return this.data.delete(t)}clear(){this.data.clear()}},Sf={ERROR:"ERROR"},ba=(t=>(t.PROVIDER_NOT_READY="PROVIDER_NOT_READY",t.PROVIDER_FATAL="PROVIDER_FATAL",t.FLAG_NOT_FOUND="FLAG_NOT_FOUND",t.PARSE_ERROR="PARSE_ERROR",t.TYPE_MISMATCH="TYPE_MISMATCH",t.TARGETING_KEY_MISSING="TARGETING_KEY_MISSING",t.INVALID_CONTEXT="INVALID_CONTEXT",t.GENERAL="GENERAL",t))(ba||{}),Ke=class Oa extends Error{constructor(e,r){super(e),Object.setPrototypeOf(this,Oa.prototype),this.name="OpenFeatureError",this.cause=r?.cause}},Nf=class xa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,xa.prototype),this.name="FlagNotFoundError",this.code="FLAG_NOT_FOUND"}},Da=class La extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,La.prototype),this.name="GeneralError",this.code="GENERAL"}},Rf=class Pa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Pa.prototype),this.name="InvalidContextError",this.code="INVALID_CONTEXT"}},bf=class wa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,wa.prototype),this.name="ParseError",this.code="PARSE_ERROR"}},Aa=class Ta extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ta.prototype),this.name="ProviderFatalError",this.code="PROVIDER_FATAL"}},Ia=class ka extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,ka.prototype),this.name="ProviderNotReadyError",this.code="PROVIDER_NOT_READY"}},Of=class Ha extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ha.prototype),this.name="TargetingKeyMissingError",this.code="TARGETING_KEY_MISSING"}},xf=class Ma extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ma.prototype),this.name="TypeMismatchError",this.code="TYPE_MISMATCH"}},Df=(t,e)=>{switch(t){case"FLAG_NOT_FOUND":return new Nf(e);case"PARSE_ERROR":return new bf(e);case"TYPE_MISMATCH":return new xf(e);case"TARGETING_KEY_MISSING":return new Of(e);case"INVALID_CONTEXT":return new Rf(e);case"PROVIDER_NOT_READY":return new Ia(e);case"PROVIDER_FATAL":return new Aa(e);default:return new Da(e)}},Dt=(t=>(t.NOT_READY="NOT_READY",t.READY="READY",t.ERROR="ERROR",t.STALE="STALE",t.FATAL="FATAL",t.RECONCILING="RECONCILING",t))(Dt||{}),Pe=(t=>(t.Ready="PROVIDER_READY",t.Error="PROVIDER_ERROR",t.ConfigurationChanged="PROVIDER_CONFIGURATION_CHANGED",t.ContextChanged="PROVIDER_CONTEXT_CHANGED",t.Reconciling="PROVIDER_RECONCILING",t.Stale="PROVIDER_STALE",t))(Pe||{}),Lf={READY:"PROVIDER_READY",ERROR:"PROVIDER_ERROR",FATAL:"PROVIDER_ERROR",STALE:"PROVIDER_STALE",RECONCILING:"PROVIDER_RECONCILING",NOT_READY:void 0},ja=(t,e)=>!e&&t==="PROVIDER_READY"||Lf[e]===t,Fa=class{error(...t){console.error(...t)}warn(...t){console.warn(...t)}info(){}debug(){}},Pf=["error","warn","info","debug"],nn=class{constructor(t){this.fallbackLogger=new Fa;try{for(const e of Pf)if(!t[e]||typeof t[e]!="function")throw new Error(`The provided logger is missing the ${e} method.`);this.logger=t}catch(e){console.error(e),console.error("Falling back to the default logger."),this.logger=this.fallbackLogger}}error(...t){this.log("error",...t)}warn(...t){this.log("warn",...t)}info(...t){this.log("info",...t)}debug(...t){this.log("debug",...t)}log(t,...e){try{this.logger[t](...e)}catch{this.fallbackLogger[t](...e)}}},wf=class{constructor(t){this.globalLogger=t,this._handlers={PROVIDER_CONFIGURATION_CHANGED:new WeakMap,PROVIDER_CONTEXT_CHANGED:new WeakMap,PROVIDER_READY:new WeakMap,PROVIDER_ERROR:new WeakMap,PROVIDER_STALE:new WeakMap,PROVIDER_RECONCILING:new WeakMap}}emit(t,e){this.eventEmitter.emit(t,e)}addHandler(t,e){const r=o=>lt(this,null,function*(){var a;try{yield e(o)}catch(i){(a=this._logger)==null||a.error("Error running event handler:",i)}}),n=this._handlers[t].get(e);this._handlers[t].set(e,[...n||[],r]),this.eventEmitter.on(t,r)}removeHandler(t,e){const r=this._handlers[t].get(e);if(r){const n=r.pop();n&&this.eventEmitter.removeListener(t,n)}}removeAllHandlers(t){t?this.eventEmitter.removeAllListeners(t):this.eventEmitter.removeAllListeners()}getHandlers(t){return this.eventEmitter.listeners(t)}setLogger(t){return this._eventLogger=new nn(t),this}get _logger(){var t,e;return(e=this._eventLogger)!=null?e:(t=this.globalLogger)==null?void 0:t.call(this)}};function Af(t){return typeof t=="string"}function ct(t){return Af(t)?t:void 0}function Tf(t){return typeof t=="object"}function Ce(t){return Tf(t)?t:void 0}function _o(t){return typeof t<"u"&&t!==null}var Vr=class{constructor(t,e,r){this._provider=t,this._status=e,this._pendingContextChanges=0;var n,o,a;(n=t.events)==null||n.addHandler("PROVIDER_READY",()=>{this._status=r.READY}),(o=t.events)==null||o.addHandler("PROVIDER_STALE",()=>{this._status=r.STALE}),(a=t.events)==null||a.addHandler("PROVIDER_ERROR",i=>{i?.errorCode==="PROVIDER_FATAL"?this._status=r.FATAL:this._status=r.ERROR})}get provider(){return this._provider}set provider(t){this._provider=t}get status(){return this._status}set status(t){this._status=t}get allContextChangesSettled(){return this._pendingContextChanges===0}incrementPendingContextChanges(){this._pendingContextChanges++}decrementPendingContextChanges(){this._pendingContextChanges--}},If=class{constructor(t){this._hooks=[],this._context={},this._logger=new Fa,this._clientEventHandlers=new Map,this._domainScopedContext=new Map,this._clientEvents=new Map,this._runsOn=t}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}setLogger(t){return this._logger=new nn(t),this}get providerMetadata(){return this.getProviderMetadata()}getProviderMetadata(t){return this.getProviderForClient(t).metadata}addHandler(t,e,r){[...new Map([[void 0,this._defaultProvider]]),...this._domainScopedProviders].forEach(n=>{var o;const a=n[0],i=n[1].provider,s=n[1].status;if(ja(t,s))try{e({domain:a,providerName:i.metadata.name})}catch(c){(o=this._logger)==null||o.error("Error running event handler:",c)}}),this._apiEmitter.addHandler(t,e),r?.signal&&typeof r.signal.addEventListener=="function"&&r.signal.addEventListener("abort",()=>{this.removeHandler(t,e)})}removeHandler(t,e){this._apiEmitter.removeHandler(t,e)}clearHandlers(){this._apiEmitter.removeAllHandlers()}getHandlers(t){return this._apiEmitter.getHandlers(t)}setAwaitableProvider(t,e){var r,n,o,a,i,s,l,c;const d=ct(t),u=(r=Ce(t))!=null?r:Ce(e);if(!u){this._logger.debug("No provider defined, ignoring setProvider call");return}const h=this.getProviderForClient(d),f=u.metadata.name;if(h===u){this._logger.debug("Provider is already set, ignoring setProvider call");return}if(!u.runsOn)this._logger.debug(`Provider '${u.metadata.name}' has not defined its intended use.`);else if(u.runsOn!==this._runsOn)throw new Da(`Provider '${u.metadata.name}' is intended for use on the ${u.runsOn}.`);const m=this.getAssociatedEventEmitters(d);let y;const S=new Vr(u,this._statusEnumType.NOT_READY,this._statusEnumType);return typeof u.initialize=="function"&&!this.allProviders.includes(u)?y=(i=(a=(o=u.initialize)==null?void 0:o.call(u,d?(n=this._domainScopedContext.get(d))!=null?n:this._context:this._context))==null?void 0:a.then(()=>{var _;S.status=this._statusEnumType.READY,this.getAssociatedEventEmitters(d).forEach(R=>{R?.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}),(_=this._apiEmitter)==null||_.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}))==null?void 0:i.catch(_=>{var R;throw _?.code==="PROVIDER_FATAL"?S.status=this._statusEnumType.FATAL:S.status=this._statusEnumType.ERROR,this.getAssociatedEventEmitters(d).forEach(L=>{L?.emit("PROVIDER_ERROR",{clientName:d,domain:d,providerName:f,message:_?.message})}),(R=this._apiEmitter)==null||R.emit("PROVIDER_ERROR",{clientName:d,domain:d,providerName:f,message:_?.message}),_}):(S.status=this._statusEnumType.READY,m.forEach(_=>{_?.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}),(s=this._apiEmitter)==null||s.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})),d?this._domainScopedProviders.set(d,S):this._defaultProvider=S,this.transferListeners(h,u,d,m),this.allProviders.includes(h)||(c=(l=h?.onClose)==null?void 0:l.call(h))==null||c.catch(_=>{this._logger.error(`error closing provider: ${_?.message}, ${_?.stack}`)}),y}getProviderForClient(t){var e,r;return t?(r=(e=this._domainScopedProviders.get(t))==null?void 0:e.provider)!=null?r:this._defaultProvider.provider:this._defaultProvider.provider}buildAndCacheEventEmitterForClient(t){const e=this._clientEvents.get(t);if(e)return e;const r=this._createEventEmitter();this._clientEvents.set(t,r);const n=this.getProviderForClient(t);return Object.values(Pe).forEach(o=>{var a;return(a=n.events)==null?void 0:a.addHandler(o,i=>lt(this,null,function*(){r.emit(o,Or(br({},i),{clientName:t,domain:t,providerName:n.metadata.name}))}))}),r}getUnboundEmitters(){const t=[...this._domainScopedProviders.keys()];return[...[...this._clientEvents.keys()].filter(_o).filter(n=>!t.includes(n)).map(n=>this._clientEvents.get(n)),this._clientEvents.get(void 0)].filter(_o)}getAssociatedEventEmitters(t){return t?[this.buildAndCacheEventEmitterForClient(t)]:this.getUnboundEmitters()}transferListeners(t,e,r,n){var o;(o=this._clientEventHandlers.get(r))==null||o.forEach(i=>{var s;return(s=t.events)==null?void 0:s.removeHandler(...i)});const a=Object.values(Pe).map(i=>[i,l=>lt(this,null,function*(){n.forEach(c=>{c?.emit(i,Or(br({},l),{clientName:r,domain:r,providerName:e.metadata.name}))}),this._apiEmitter.emit(i,Or(br({},l),{clientName:r,domain:r,providerName:e.metadata.name}))})]);this._clientEventHandlers.set(r,a),a.forEach(i=>{var s;return(s=e.events)==null?void 0:s.addHandler(...i)})}close(){return lt(this,null,function*(){var t,e;try{yield(e=(t=this==null?void 0:this._defaultProvider.provider)==null?void 0:t.onClose)==null?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider.provider,n)}const r=Array.from(this._domainScopedProviders);yield Promise.all(r.map(n=>lt(this,[n],function*([,o]){var a,i;try{yield(i=o==null?void 0:(a=o.provider).onClose)==null?void 0:i.call(a)}catch(s){this.handleShutdownError(o?.provider,s)}})))})}clearProvidersAndSetDefault(t){return lt(this,null,function*(){try{yield this.close()}catch{this._logger.error("Unable to cleanly close providers. Resetting to the default configuration.")}finally{this._domainScopedProviders.clear(),this._defaultProvider=new Vr(t,this._statusEnumType.NOT_READY,this._statusEnumType)}})}get allProviders(){return[...[...this._domainScopedProviders.values()].map(t=>t.provider),this._defaultProvider.provider]}handleShutdownError(t,e){this._logger.error(`Error during shutdown of provider ${t.metadata.name}: ${e}`),this._logger.error(e?.stack)}},kf=Object.create,on=Object.defineProperty,Hf=Object.defineProperties,Mf=Object.getOwnPropertyDescriptor,jf=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertyNames,Co=Object.getOwnPropertySymbols,Va=Object.getPrototypeOf,Ua=Object.prototype.hasOwnProperty,Ff=Object.prototype.propertyIsEnumerable,Bf=Reflect.get,So=(t,e,r)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xr=(t,e)=>{for(var r in e||(e={}))Ua.call(e,r)&&So(t,r,e[r]);if(Co)for(var r of Co(e))Ff.call(e,r)&&So(t,r,e[r]);return t},Vf=(t,e)=>Hf(t,jf(e)),Uf=(t,e)=>function(){return e||(0,t[Ba(t)[0]])((e={exports:{}}).exports,e),e.exports},$f=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ba(e))!Ua.call(t,o)&&o!==r&&on(t,o,{get:()=>e[o],enumerable:!(n=Mf(e,o))||n.enumerable});return t},zf=(t,e,r)=>(r=t!=null?kf(Va(t)):{},$f(on(r,"default",{value:t,enumerable:!0}),t)),Kf=(t,e,r)=>Bf(Va(t),r,e),st=(t,e,r)=>new Promise((n,o)=>{var a=l=>{try{s(r.next(l))}catch(c){o(c)}},i=l=>{try{s(r.throw(l))}catch(c){o(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,i);s((r=r.apply(t,e)).next())}),Wf=Uf({"../../node_modules/eventemitter3/index.js"(t,e){var r=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function a(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,h,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new a(u,h||c,f),y=n?n+d:d;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function s(c,d){--c._eventsCount===0?c._events=new o:delete c._events[d]}function l(){this._events=new o,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,h;if(this._eventsCount===0)return d;for(h in u=this._events)r.call(u,h)&&d.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=n?n+d:d,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,m=h.length,y=new Array(m);f<m;f++)y[f]=h[f].fn;return y},l.prototype.listenerCount=function(d){var u=n?n+d:d,h=this._events[u];return h?h.fn?1:h.length:0},l.prototype.emit=function(d,u,h,f,m,y){var S=n?n+d:d;if(!this._events[S])return!1;var _=this._events[S],R=arguments.length,L,b;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),R){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,u),!0;case 3:return _.fn.call(_.context,u,h),!0;case 4:return _.fn.call(_.context,u,h,f),!0;case 5:return _.fn.call(_.context,u,h,f,m),!0;case 6:return _.fn.call(_.context,u,h,f,m,y),!0}for(b=1,L=new Array(R-1);b<R;b++)L[b-1]=arguments[b];_.fn.apply(_.context,L)}else{var w=_.length,k;for(b=0;b<w;b++)switch(_[b].once&&this.removeListener(d,_[b].fn,void 0,!0),R){case 1:_[b].fn.call(_[b].context);break;case 2:_[b].fn.call(_[b].context,u);break;case 3:_[b].fn.call(_[b].context,u,h);break;case 4:_[b].fn.call(_[b].context,u,h,f);break;default:if(!L)for(k=1,L=new Array(R-1);k<R;k++)L[k-1]=arguments[k];_[b].fn.apply(_[b].context,L)}}return!0},l.prototype.on=function(d,u,h){return i(this,d,u,h,!1)},l.prototype.once=function(d,u,h){return i(this,d,u,h,!0)},l.prototype.removeListener=function(d,u,h,f){var m=n?n+d:d;if(!this._events[m])return this;if(!u)return s(this,m),this;var y=this._events[m];if(y.fn)y.fn===u&&(!f||y.once)&&(!h||y.context===h)&&s(this,m);else{for(var S=0,_=[],R=y.length;S<R;S++)(y[S].fn!==u||f&&!y[S].once||h&&y[S].context!==h)&&_.push(y[S]);_.length?this._events[m]=_.length===1?_[0]:_:s(this,m)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=n?n+d:d,this._events[u]&&s(this,u)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,typeof e<"u"&&(e.exports=l)}}),Yf="No-op",Gf=class{constructor(){this.metadata={name:"No-op Provider"}}resolveBooleanEvaluation(t,e){return this.noOp(e)}resolveStringEvaluation(t,e){return this.noOp(e)}resolveNumberEvaluation(t,e){return this.noOp(e)}resolveObjectEvaluation(t,e){return this.noOp(e)}noOp(t){return{value:t,reason:Yf}}},No=new Gf,Jf=zf(Wf()),Ro=class extends wf{constructor(){super(),this.eventEmitter=new Jf.default}},Xf=class{constructor(t,e,r,n,o,a,i){this.providerAccessor=t,this.providerStatusAccessor=e,this.emitterAccessor=r,this.apiContextAccessor=n,this.apiHooksAccessor=o,this.globalLogger=a,this.options=i,this._hooks=[]}get metadata(){var t,e;return{name:(t=this.options.domain)!=null?t:this.options.name,domain:(e=this.options.domain)!=null?e:this.options.name,version:this.options.version,providerMetadata:this.providerAccessor().metadata}}get providerStatus(){return this.providerStatusAccessor()}addHandler(t,e,r){var n;if(this.emitterAccessor().addHandler(t,e),ja(t,this.providerStatus))try{e({clientName:this.metadata.name,domain:this.metadata.domain,providerName:this._provider.metadata.name})}catch(a){(n=this._logger)==null||n.error("Error running event handler:",a)}r?.signal&&typeof r.signal.addEventListener=="function"&&r.signal.addEventListener("abort",()=>{this.removeHandler(t,e)})}removeHandler(t,e){this.emitterAccessor().removeHandler(t,e)}getHandlers(t){return this.emitterAccessor().getHandlers(t)}setLogger(t){return this._clientLogger=new nn(t),this}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}getBooleanValue(t,e,r){return this.getBooleanDetails(t,e,r).value}getBooleanDetails(t,e,r){return this.evaluate(t,this._provider.resolveBooleanEvaluation,e,"boolean",r)}getStringValue(t,e,r){return this.getStringDetails(t,e,r).value}getStringDetails(t,e,r){return this.evaluate(t,this._provider.resolveStringEvaluation,e,"string",r)}getNumberValue(t,e,r){return this.getNumberDetails(t,e,r).value}getNumberDetails(t,e,r){return this.evaluate(t,this._provider.resolveNumberEvaluation,e,"number",r)}getObjectValue(t,e,r){return this.getObjectDetails(t,e,r).value}getObjectDetails(t,e,r){return this.evaluate(t,this._provider.resolveObjectEvaluation,e,"object",r)}track(t,e={}){var r,n,o;try{if(this.shortCircuitIfNotReady(),typeof this._provider.track=="function"){const a=Object.freeze(xr({},this.apiContextAccessor((r=this==null?void 0:this.options)==null?void 0:r.domain)));return(o=(n=this._provider).track)==null?void 0:o.call(n,t,a,e)}else this._logger.debug("Provider does not support the track function; will no-op.")}catch(a){this._logger.debug("Error recording tracking event.",a)}}evaluate(t,e,r,n,o={}){var a,i;const s=[...this.apiHooksAccessor(),...this.getHooks(),...o.hooks||[],...this._provider.hooks||[]],l=[...s].reverse(),c=xr({},this.apiContextAccessor((a=this==null?void 0:this.options)==null?void 0:a.domain)),d=l.map(()=>Object.freeze({flagKey:t,defaultValue:r,flagValueType:n,clientMetadata:this.metadata,providerMetadata:this._provider.metadata,context:c,logger:this._logger,hookData:new Cf}));let u;try{this.beforeHooks(s,d,o),this.shortCircuitIfNotReady();const h=e.call(this._provider,t,r,c,this._logger),f=Vf(xr({},h),{flagMetadata:Object.freeze((i=h.flagMetadata)!=null?i:{}),flagKey:t});if(f.errorCode){const m=Df(f.errorCode,f.errorMessage);this.errorHooks(l,d,m,o),u=this.getErrorEvaluationDetails(t,r,m,f.flagMetadata)}else this.afterHooks(l,d,f,o),u=f}catch(h){this.errorHooks(l,d,h,o),u=this.getErrorEvaluationDetails(t,r,h)}return this.finallyHooks(l,d,u,o),u}beforeHooks(t,e,r){var n;for(const[o,a]of t.entries()){const i=t.length-1-o,s=e[i];Object.freeze(s),Object.freeze(s.context),(n=a?.before)==null||n.call(a,s,Object.freeze(r.hookHints))}}afterHooks(t,e,r,n){var o;for(const[a,i]of t.entries()){const s=e[a];(o=i?.after)==null||o.call(i,s,r,n.hookHints)}}errorHooks(t,e,r,n){var o;for(const[a,i]of t.entries())try{const s=e[a];(o=i?.error)==null||o.call(i,s,r,n.hookHints)}catch(s){this._logger.error(`Unhandled error during 'error' hook: ${s}`),s instanceof Error&&this._logger.error(s.stack),this._logger.error(s?.stack)}}finallyHooks(t,e,r,n){var o;for(const[a,i]of t.entries())try{const s=e[a];(o=i?.finally)==null||o.call(i,s,r,n.hookHints)}catch(s){this._logger.error(`Unhandled error during 'finally' hook: ${s}`),s instanceof Error&&this._logger.error(s.stack),this._logger.error(s?.stack)}}get _provider(){return this.providerAccessor()}get _logger(){return this._clientLogger||this.globalLogger()}shortCircuitIfNotReady(){if(this.providerStatus===Dt.NOT_READY)throw new Ia("provider has not yet initialized");if(this.providerStatus===Dt.FATAL)throw new Aa("provider is in an irrecoverable error state")}getErrorEvaluationDetails(t,e,r,n={}){const o=r?.message;return{errorCode:r?.code||ba.GENERAL,errorMessage:o,value:e,reason:Sf.ERROR,flagMetadata:Object.freeze(n),flagKey:t}}},bo=Symbol.for("@openfeature/web-sdk/api"),Oo=globalThis,qf=class Ur extends If{constructor(){super("client"),this._statusEnumType=Dt,this._apiEmitter=new Ro,this._defaultProvider=new Vr(No,Dt.NOT_READY,this._statusEnumType),this._domainScopedProviders=new Map,this._createEventEmitter=()=>new Ro}static getInstance(){const e=Oo[bo];if(e)return e;const r=new Ur;return Oo[bo]=r,r}getProviderStatus(e){var r,n;return e?(n=(r=this._domainScopedProviders.get(e))==null?void 0:r.status)!=null?n:this._defaultProvider.status:this._defaultProvider.status}setProviderAndWait(e,r,n){return st(this,null,function*(){const o=ct(e),a=Ce(o?r:e),i=Ce(o?n:r);i&&(o?this._domainScopedContext.set(o,i):this._context=i),yield this.setAwaitableProvider(o,a)})}setProvider(e,r,n){const o=ct(e),a=Ce(o?r:e),i=Ce(o?n:r);i&&(o?this._domainScopedContext.set(o,i):this._context=i);const s=this.setAwaitableProvider(o,a);return Promise.resolve(s).catch(l=>{this._logger.error("Error during provider initialization:",l)}),this}getProvider(e){return this.getProviderForClient(e)}setContext(e,r){return st(this,null,function*(){var n,o;const a=ct(e),i=(o=(n=Ce(e))!=null?n:Ce(r))!=null?o:{};if(a){const s=this._domainScopedProviders.get(a);if(s){const l=this.getContext(a);this._domainScopedContext.set(a,i),yield this.runProviderContextChangeHandler(a,s,l,i)}else this._domainScopedContext.set(a,i)}else{const s=this._context;this._context=i;const l=Array.from(this._domainScopedProviders.entries()).filter(([d])=>!this._domainScopedContext.has(d)).reduce((d,[u,h])=>(d.push({domain:u,wrapper:h}),d),[]),c=[{domain:void 0,wrapper:this._defaultProvider},...l];yield Promise.all(c.map(d=>this.runProviderContextChangeHandler(d.domain,d.wrapper,s,i)))}})}getContext(e){const r=ct(e);if(r){const n=this._domainScopedContext.get(r);if(n)return n;this._logger.debug(`Unable to find context for '${r}'.`)}return this._context}clearContext(e){return st(this,null,function*(){const r=ct(e);if(r){const n=this._domainScopedProviders.get(r);if(n){const o=this.getContext(r);this._domainScopedContext.delete(r);const a=this.getContext();yield this.runProviderContextChangeHandler(r,n,o,a)}else this._domainScopedContext.delete(r)}else return this.setContext({})})}clearContexts(){return st(this,null,function*(){yield this.clearContext(),yield Promise.allSettled(Array.from(this._domainScopedProviders.keys()).map(e=>this.clearContext(e)))})}getClient(e,r){return new Xf(()=>this.getProviderForClient(e),()=>this.getProviderStatus(e),()=>this.buildAndCacheEventEmitterForClient(e),n=>this.getContext(n),()=>this.getHooks(),()=>this._logger,{domain:e,version:r})}clearProviders(){return st(this,null,function*(){yield Kf(Ur.prototype,this,"clearProvidersAndSetDefault").call(this,No),this._domainScopedContext.clear()})}runProviderContextChangeHandler(e,r,n,o){return st(this,null,function*(){var a,i,s,l,c,d;const u=((i=(a=r.provider)==null?void 0:a.metadata)==null?void 0:i.name)||"unnamed-provider";try{if(typeof r.provider.onContextChange=="function"){const h=r.provider.onContextChange(n,o);h&&typeof h?.then=="function"&&(r.incrementPendingContextChanges(),r.status=this._statusEnumType.RECONCILING,this.getAssociatedEventEmitters(e).forEach(f=>{f?.emit(Pe.Reconciling,{domain:e,providerName:u})}),(s=this._apiEmitter)==null||s.emit(Pe.Reconciling,{domain:e,providerName:u}),yield h,r.decrementPendingContextChanges())}r.status=this._statusEnumType.READY,r.allContextChangesSettled&&(this.getAssociatedEventEmitters(e).forEach(h=>{h?.emit(Pe.ContextChanged,{clientName:e,domain:e,providerName:u})}),(l=this._apiEmitter)==null||l.emit(Pe.ContextChanged,{clientName:e,domain:e,providerName:u}))}catch(h){if(r.decrementPendingContextChanges(),r.status=this._statusEnumType.ERROR,r.allContextChangesSettled){const f=h,m=`Error running ${u}'s context change handler: ${f?.message}`;(c=this._logger)==null||c.error(`${m}`,h),this.getAssociatedEventEmitters(e).forEach(y=>{y?.emit(Pe.Error,{clientName:e,domain:e,providerName:u,message:m})}),(d=this._apiEmitter)==null||d.emit(Pe.Error,{clientName:e,domain:e,providerName:u,message:m})}}})}},$a=qf.getInstance();class Zf{runsOn="client";metadata={name:"QueryParamProvider"};flags;constructor(e){this.flags=new Map;for(const[r,n]of e.entries())this.flags.set(r,n)}resolveBooleanEvaluation(e,r){const n=this.flags.get(e);return n===void 0?{value:r,reason:"DEFAULT"}:{value:n.toLowerCase()==="true"||n==="1",reason:"STATIC",variant:n}}resolveStringEvaluation(e,r){const n=this.flags.get(e);return n===void 0?{value:r,reason:"DEFAULT"}:{value:n,reason:"STATIC",variant:n}}resolveNumberEvaluation(e,r){const n=this.flags.get(e);if(n===void 0)return{value:r,reason:"DEFAULT"};const o=Number(n);return isNaN(o)?{value:r,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:`Failed to parse "${n}" as a number`}:{value:o,reason:"STATIC",variant:n}}resolveObjectEvaluation(e,r){const n=this.flags.get(e);if(n===void 0)return{value:r,reason:"DEFAULT"};try{return{value:JSON.parse(n),reason:"STATIC",variant:n}}catch(o){return{value:r,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}}}async function Qf(t){const e=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,r=new Zf(e);await $a.setProviderAndWait(r)}async function eh(){const t=$a.getClient();return Promise.resolve(t.getBooleanValue("FEATURE_DUAL_ACTION_CREATE_ENABLED",!1))}let $r;function th(t){$r=t}async function Kh(){return await $r?.clear(),!!$r}async function rh(t){const e=await ff(),r=[e,...t];return zr([e,...t]),r}async function nh(t,e,r){const n=r.find(o=>o.state.local.triggers.find(a=>a.type==="PullResponder"&&a.data?.url===t));if(n)return n;try{return await e.addRemoteDrive(t,{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:t,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:bs(),system:!0}],triggers:[]})}catch(o){de.error("Error adding remote drive",o)}}async function oh(){if(window.ph||(window.ph={}),window.ph.reactor||window.ph.loading)return;window.ph.loading=!0,xi(),await Qf();const t=await Di(),e=await t.did(),r=Li(e,dt.routerBasename),n=pd(dt.routerBasename);th(n);const o=await gf(),a=await rh(o),i=a.flatMap(L=>L.modules.documentModelModules).filter(L=>L!==void 0),s=await eh(),l=Pi(),c=gd(i,n,{...l,featureFlags:{enableDualActionCreate:s}});await wi(c,r,t);const d=Ai(c),u=new _s(c.listeners,c);let h=await En(c);const f=ih(),m=f?await nh(f,c,h):void 0;m&&(h=await En(c));const y=window.location.pathname,S=m?.header.slug??Ti(y),_=m?"":Ii(y),R=ah();await ki(R,c,r,t),Hi(dt),Mi(c),ji(d),Fi(t),Bi(e),Vi(r),Ui(u),$i(h),zr(a),St(S),Lo(_),c.on("defaultRemoteDrive",(...L)=>{de.verbose("defaultRemoteDrive",...L),ot(c).catch(de.error)}),c.on("clientStrandsError",(...L)=>{de.verbose("clientStrandsError",...L),ot(c).catch(de.error)}),c.on("driveAdded",(...L)=>{de.verbose("driveAdded",...L),u.registerDrive(L[0].header.id).catch(de.error),ot(c).catch(de.error)}),c.on("driveDeleted",(...L)=>{de.verbose("driveDeleted",...L),ot(c).catch(de.error)}),c.on("documentModelModules",(...L)=>{de.verbose("documentModelModules",...L),ot(c).catch(de.error)}),c.on("driveOperationsAdded",(...L)=>{de.verbose("driveOperationsAdded",...L),ot(c).catch(de.error)}),window.ph.loading=!1}function ah(){const e=new URLSearchParams(window.location.search).get("user");return e?decodeURIComponent(e):void 0}function ih(){const e=new URLSearchParams(window.location.search).get("driveUrl");return e?decodeURIComponent(e):void 0}function sh(){const t=Wr();g.useEffect(()=>{let e=null;if(t){const{credential:r,...n}=t;e={id:n.did,username:n.ens?.name,...n}}Ds(e)},[t])}function lh(){return N.jsx("div",{className:"h-screen",children:N.jsx("div",{className:"flex h-screen items-stretch overflow-auto",role:"presentation",tabIndex:0,children:N.jsxs(g.Suspense,{name:"Root",children:[N.jsx(bh,{}),N.jsx("div",{className:"relative flex-1 overflow-auto",children:N.jsx(Cu,{})})]})})})}function ch(){const[t]=wo(),e=zi(),[r]=Kr();g.useEffect(()=>{r||Ki(Ks)},[r]),g.useEffect(()=>{t||Wi(Ws)},[t]);const n=!r&&!t&&!e;return N.jsx(uh,{children:n?N.jsx(fh,{}):N.jsx(Ud,{})})}function uh({children:t}){return N.jsx("div",{className:"flex h-full flex-col overflow-auto",id:"content-view",children:t})}function dh({drive:t}){const r=Po(t.header.meta?.preferredEditor)?.name||"Drive Explorer App";return N.jsx(as,{title:t.state.global.name,description:r,icon:N.jsx(Ra,{drive:t}),onClick:()=>St(t)},t.header.id)}function fh(){const t=Ao(),e=ce;return N.jsxs(Io,{children:[t?.map(r=>N.jsx(dh,{drive:r},r.header.id)),e.drives.addDriveEnabled&&N.jsx(os,{})]})}const hh=t=>g.createElement("svg",{width:28,height:32,viewBox:"0 0 28 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z",fill:"url(#paint0_radial_319_20865)"}),g.createElement("path",{d:"M14 0L0 23.9998V7.99993L14 0Z",fill:"url(#paint1_linear_319_20865)"}),g.createElement("path",{d:"M28 24L7.82013e-05 24L14 31.9999L28 24Z",fill:"url(#paint2_linear_319_20865)"}),g.createElement("path",{d:"M14 0L28 23.9998V7.99993L14 0Z",fill:"url(#paint3_linear_319_20865)"}),g.createElement("defs",null,g.createElement("radialGradient",{id:"paint0_radial_319_20865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)"},g.createElement("stop",{offset:.181008,stopColor:"#FFCD6B"}),g.createElement("stop",{offset:1,stopColor:"#EB5EDF"})),g.createElement("linearGradient",{id:"paint1_linear_319_20865",x1:-.031454,y1:24.041,x2:13.801,y2:-.142908,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#4331E9"}),g.createElement("stop",{offset:1,stopColor:"#A273FF"})),g.createElement("linearGradient",{id:"paint2_linear_319_20865",x1:-.0310093,y1:24,x2:28.0444,y2:24,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#A273FF"}),g.createElement("stop",{offset:1,stopColor:"#4331E9"})),g.createElement("linearGradient",{id:"paint3_linear_319_20865",x1:28.0315,y1:24.041,x2:14.199,y2:-.142908,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#A273FF"}),g.createElement("stop",{offset:1,stopColor:"#4331E9"})))),ph=t=>g.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},g.createElement("path",{d:"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z",fill:"#6C7275"}),g.createElement("path",{d:"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z",fill:"#6C7275"})),gh="https://apps.powerhouse.io/sky-atlas/staging/switchboard",mh=2e3;function vh(){const{search:t}=sr();return g.useMemo(()=>{const r=new URLSearchParams(t).get("reactorUrl")??gh;return r.endsWith("/")?r:`${r}/`},[t])}async function Eh(t,e){const r=Os`
|
|
14
|
+
}`}}):null,N.jsx(Cd,{})]})};function Nd({children:t}){return N.jsx(N.Fragment,{children:t})}const Rd=({children:t})=>(Bu(),t),bd=()=>(g.useEffect(()=>{yd.registerServiceWorker(!1)},[]),N.jsx(Rd,{children:N.jsx(Zi,{children:N.jsxs(Nd,{children:[N.jsx(Qi,{position:"bottom-right",containerId:"connect"}),N.jsx(Rh,{}),N.jsx(id,{})]})})})),Od={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},xd={placeholder:"Search Powerhouse",filterLabel:"File type"},Dd={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},Ld={options:{switchboardLink:"Switchboard Link"}},Pd={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},wd={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},Ad={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},Td={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},Id={common:Od,searchbar:xd,folderView:Dd,files:Ld,modals:Pd,notifications:wd,footer:Ad,cookieBanner:Td},kd={en:{code:"en",name:"English",translation:Id}};pe.use(zl).init({resources:kd,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(t=>{console.error(t)});const Hd=(t,e)=>t.some(r=>r.id===e&&r.value),Md=()=>{const{t}=Zo(void 0,{useSuspense:!0,i18n:pe}),[e,r]=ac(),[,n]=Yr(),o=[{id:"analytics-cookie",label:t("cookieBanner.cookies.analytics"),value:!0}],a=s=>{r(!1),Hd(s,"analytics-cookie")&&n(l=>({...l,analytics:!0}))},i=()=>{r(!1),n(()=>({analytics:!1,functional:!1,marketing:!1}))};return e?N.jsxs("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[N.jsx("div",{className:"absolute inset-0 bg-black opacity-15"}),N.jsx("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:N.jsx(es,{className:"max-w-[1024px]",cookies:o,onSubmit:a,onReject:i,submitLabel:t("cookieBanner.accept"),rejectLabel:t("cookieBanner.reject"),children:N.jsx("p",{className:"font-semibold text-gray-500",children:N.jsx(Wl,{i18nKey:"cookieBanner.message",components:{a:N.jsx("a",{onClick:()=>Qe({type:"cookiesPolicy"}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null};function jd(){const[t]=Do(),[e]=Kr(),r=si(e?.header.id),n=li(t),o=ci(t),a=ui(),i=Wr(),s=d=>{if(fi(d).length)Qe({type:"exportDocumentWithErrors",documentId:d.header.id});else return hi(d)},l=()=>{if(e)return s(e)},c=g.useMemo(()=>n?async()=>{if(!e?.header.id){console.error("No selected document");return}if(!o){console.error("No remote drive url found");return}const d=i?.address?await a?.getBearerToken(o,i.address,!1,{expiresIn:600}):void 0,u=di(o,e.header.id,d);try{fd(u)}catch(h){console.error("Error opening switchboard link",h)}}:void 0,[n,o,e]);return e?N.jsx("div",{id:"document-editor-container",className:"flex-1 rounded-2xl bg-gray-50 p-4",children:N.jsx(zd,{document:e,onClose:()=>Lo(r),onExport:l,onOpenSwitchboardLink:c})}):null}const Fd=g.createContext(null),Rr={didCatch:!1,error:null};class rn extends g.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rr}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var r,n,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];(r=(n=this.props).onReset)===null||r===void 0||r.call(n,{args:a,reason:"imperative-api"}),this.setState(Rr)}}componentDidCatch(e,r){var n,o;(n=(o=this.props).onError)===null||n===void 0||n.call(o,e,r)}componentDidUpdate(e,r){const{didCatch:n}=this.state,{resetKeys:o}=this.props;if(n&&r.error!==null&&Bd(e.resetKeys,o)){var a,i;(a=(i=this.props).onReset)===null||a===void 0||a.call(i,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(Rr)}}render(){const{children:e,fallbackRender:r,FallbackComponent:n,fallback:o}=this.props,{didCatch:a,error:i}=this.state;let s=e;if(a){const l={error:i,resetErrorBoundary:this.resetErrorBoundary};if(typeof r=="function")s=r(l);else if(n)s=g.createElement(n,l);else if(o!==void 0)s=o;else throw i}return g.createElement(Fd.Provider,{value:{didCatch:a,error:i,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Bd(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((r,n)=>!Object.is(r,e[n]))}function Wt(t){const[e,r]=g.useState(!1);if(g.useEffect(()=>{setTimeout(()=>{r(!0)},t.loadingTimeout??200)},[t]),!e)return null;const{customEditorLoader:n,...o}=t;return n?N.jsx(N.Fragment,{children:n}):N.jsx(ts,{...o})}function Vd({error:t}){return N.jsxs("div",{className:"mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center",children:[N.jsx("h1",{className:"mb-2 text-xl font-semibold",children:"Error"}),N.jsx("i",{children:t instanceof Error?t.message:t}),N.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function Ud(){const[t]=Do(),[e]=Kr(),r=Po(t?.header.meta?.preferredEditor),n=pi(),o=r?.Component??n?.Component??Dr.Component;if(!o)throw new Error("No drive editor component found");return N.jsx(rn,{fallbackRender:Vd,children:N.jsx(g.Suspense,{fallback:N.jsx(Wt,{}),children:N.jsx(rs,{className:"flex h-full flex-col overflow-auto",children:N.jsx(o,{children:e?N.jsx(jd,{}):null})})})},t.header.id)}function Ra({drive:t}){const e=gi(t),r=t?.state.global.icon;return r?N.jsx("img",{src:r,alt:t.header.name,height:32,width:32}):e==="LOCAL"?N.jsx(Lr,{name:"Hdd",size:32}):N.jsx(Lr,{name:"Server",size:32})}function Br({message:t}){return N.jsx("div",{className:"flex size-full items-center justify-center",children:N.jsx("h3",{className:"text-lg font-semibold",children:t})})}function $d(t){const e=t.error instanceof Error?t.error.message:t.error;return N.jsx(Br,{message:e})}const zd=t=>{const{document:e,onClose:r,onExport:n,onOpenSwitchboardLink:o}=t,a=mi(),i=vi(),[s,l]=Ei(e.header.id),c=s?.header.id??void 0,d=s?.header.name??void 0,u=s?.header.documentType??void 0,h=s?.header.meta?.preferredEditor??void 0,f=s?.operations.global??[],m=s?.operations.local??[],y=s?.header.revision.global??0,S=s?.header.revision.local??0,_=yi(u),R=_i(h),L=Ci(u),b=R??L,w=!s,k=b&&u&&!b.documentTypes.includes(u)&&!b.documentTypes.includes("*"),E=y>0||S>0,x=!!s?.clipboard.length;rd({undo:()=>l(Ns()),redo:()=>l(Rs()),canUndo:E,canRedo:x}),g.useEffect(()=>()=>{window.documentEditorDebugTools?.clear()},[]);const[$,B]=g.useState(void 0);g.useEffect(()=>{$&&$.documentId!==c&&B(void 0)},[$,c]);const Y=(ge,ue)=>{B({error:ge,documentId:c,info:ue})};if(k)return N.jsx(Wt,{message:"Loading editor"});if(w)return N.jsx(Wt,{message:"Loading document"});if(!_)return N.jsx(Br,{message:N.jsxs("div",{className:"text-center leading-10",children:[N.jsxs("p",{children:['Unable to open the document because the document model "',u,'" is not supported.']}),N.jsxs("p",{children:["Go to the"," ",N.jsx("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{Qe({type:"settings"})},children:"package manager"})," ","to install this document model"]})]})});if(!b)return N.jsx(Br,{message:N.jsxs("div",{className:"text-center leading-10",children:[N.jsx("p",{children:"Unable to open the document because no editor has been found"}),N.jsxs("p",{children:["Go to the"," ",N.jsx("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{Qe({type:"settings"})},children:"package manager"})," ",'an editor for the "$',u,'" document type']})]})});const G=b.Component;return N.jsx("div",{className:"relative h-full",id:"document-editor-context",children:i?N.jsx(ns,{documentTitle:d??"",documentId:c??"",globalOperations:f,localOperations:m,onClose:()=>Si(!1),documentState:s.state,onCopyState:()=>{Jr("Copied document state to clipboard",{type:"success"})}},c):N.jsx(g.Suspense,{fallback:N.jsx(Wt,{message:"Loading editor"}),name:"EditorLoader",children:N.jsx(rn,{fallbackRender:$d,onError:Y,children:!$?.error&&N.jsx(G,{context:{readMode:!!a,selectedTimelineRevision:Ni(a?.startDate,a?.endDate,f)},documentId:s.header.id},c)},c)})})},Kd=Mo(["Connect","Modals"]);class Wd extends g.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){Kd.error(e,r)}render(){return this.state.hasError?null:this.props.children}}const Yd=g.lazy(()=>me(()=>import("./AddDriveModal-7r-BM-yT.js"),__vite__mapDeps([2,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.AddDriveModal}))),Gd=g.lazy(()=>me(()=>import("./ClearStorageModal-9gL_vLgY.js"),__vite__mapDeps([16,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.ClearStorageModal}))),Jd=g.lazy(()=>me(()=>import("./CookiesPolicyModal-BdPCCPNX.js"),__vite__mapDeps([17,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.CookiesPolicyModal}))),Xd=g.lazy(()=>me(()=>import("./CreateDocumentModal-C09c_nGK.js"),__vite__mapDeps([18,3,4,1,5,6,0,7,8,9,10,11,12,13])).then(t=>({default:t.CreateDocumentModal}))),qd=g.lazy(()=>me(()=>import("./DebugSettingsModal-BkU8bK-I.js"),__vite__mapDeps([19,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DebugSettingsModal}))),Zd=g.lazy(()=>me(()=>import("./DeleteDriveModal-Ctt3VSe4.js"),__vite__mapDeps([20,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DeleteDriveModal}))),Qd=g.lazy(()=>me(()=>import("./DeleteItemModal-DZLHSQPf.js"),__vite__mapDeps([21,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DeleteItemModal}))),ef=g.lazy(()=>me(()=>import("./DisclaimerModal-BTFCt2N-.js"),__vite__mapDeps([22,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.DisclaimerModal}))),tf=g.lazy(()=>me(()=>import("./DriveSettingsModal-B18X9rkK.js"),__vite__mapDeps([23,3,4,1,5,6,0,7,8,9,10,11,12,13])).then(t=>({default:t.DriveSettingsModal}))),rf=g.lazy(()=>me(()=>import("./ExportDocumentWithErrorsModal-B_tnIZE0.js"),__vite__mapDeps([24,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.ExportDocumentWithErrorsModal}))),nf=g.lazy(()=>me(()=>import("./SettingsModal-BDHjn5Ac.js"),__vite__mapDeps([25,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.SettingsModal}))),of=g.lazy(()=>me(()=>import("./UpgradeDriveModal-kyIQAIjP.js"),__vite__mapDeps([26,3,4,1,5,6,0,7,8,9,10,11,12,13,14,15])).then(t=>({default:t.UpgradeDriveModal}))),af={addDrive:Yd,clearStorage:Gd,cookiesPolicy:Jd,createDocument:Xd,debugSettings:qd,deleteDrive:Zd,deleteItem:Qd,disclaimer:ef,driveSettings:tf,exportDocumentWithErrors:rf,settings:nf,upgradeDrive:of};function sf(){const t=Ri();if(!t?.type)return null;const e=af[t.type];return e?N.jsx(Wd,{children:N.jsx(g.Suspense,{fallback:null,children:N.jsx(e,{})})}):null}function lf(){const t="Generic Drive Explorer",e=Dr.documentTypes,r=Dr.Component;return{id:bi,name:t,documentTypes:e,Component:r}}function cf(){const t="Document Model Editor",e="document-model-editor-v2",r=_n.documentTypes,n=_n.Component;return{id:e,name:t,documentTypes:r,Component:n}}async function uf(){const t=Ft.documentModel.global,e=t.name,r=t.id,n=r,o=t.extension,a=t.specifications,i=Ft.reducer,s=Ft.actions,l=Ft.utils;return{id:n,name:e,documentType:r,extension:o,specifications:a,reducer:i,actions:s,utils:l,documentModel:jo(Fo(),t)}}async function df(){const t=jt.documentModel.global,e=t.name,r=t.id,n=r,o=t.extension,a=t.specifications,i=jt.reducer,s=jt.actions,l=jt.utils;return{id:n,name:e,documentType:r,extension:o,specifications:a,reducer:i,actions:s,utils:l,documentModel:jo(Fo(),t)}}async function ff(){const t=await uf(),e=await df(),r=cf(),n=lf();return{id:Oi,name:"Common",description:"Common",category:"Common",author:{name:"Powerhouse",website:"https://powerhousedao.com"},modules:{documentModelModules:[t,e],editorModules:[r,n]}}}const{externalPackagesEnabled:hf}=ce;function pf(t){return t.loadExternalPackages().then(e=>e.map(xo))}async function gf(){try{if(!hf)return[];const t=await me(()=>import("./virtual_ph_external-packages-CM1tCR4L.js"),[]);return pf(t)}catch(t){return console.error(t),[]}}var mf=Object.defineProperty,vf=Object.defineProperties,Ef=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,yf=Object.prototype.hasOwnProperty,_f=Object.prototype.propertyIsEnumerable,yo=(t,e,r)=>e in t?mf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,br=(t,e)=>{for(var r in e||(e={}))yf.call(e,r)&&yo(t,r,e[r]);if(Eo)for(var r of Eo(e))_f.call(e,r)&&yo(t,r,e[r]);return t},Or=(t,e)=>vf(t,Ef(e)),lt=(t,e,r)=>new Promise((n,o)=>{var a=l=>{try{s(r.next(l))}catch(c){o(c)}},i=l=>{try{s(r.throw(l))}catch(c){o(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,i);s((r=r.apply(t,e)).next())}),Cf=class{constructor(){this.data=new Map}set(t,e){this.data.set(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}delete(t){return this.data.delete(t)}clear(){this.data.clear()}},Sf={ERROR:"ERROR"},ba=(t=>(t.PROVIDER_NOT_READY="PROVIDER_NOT_READY",t.PROVIDER_FATAL="PROVIDER_FATAL",t.FLAG_NOT_FOUND="FLAG_NOT_FOUND",t.PARSE_ERROR="PARSE_ERROR",t.TYPE_MISMATCH="TYPE_MISMATCH",t.TARGETING_KEY_MISSING="TARGETING_KEY_MISSING",t.INVALID_CONTEXT="INVALID_CONTEXT",t.GENERAL="GENERAL",t))(ba||{}),Ke=class Oa extends Error{constructor(e,r){super(e),Object.setPrototypeOf(this,Oa.prototype),this.name="OpenFeatureError",this.cause=r?.cause}},Nf=class xa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,xa.prototype),this.name="FlagNotFoundError",this.code="FLAG_NOT_FOUND"}},Da=class La extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,La.prototype),this.name="GeneralError",this.code="GENERAL"}},Rf=class Pa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Pa.prototype),this.name="InvalidContextError",this.code="INVALID_CONTEXT"}},bf=class wa extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,wa.prototype),this.name="ParseError",this.code="PARSE_ERROR"}},Aa=class Ta extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ta.prototype),this.name="ProviderFatalError",this.code="PROVIDER_FATAL"}},Ia=class ka extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,ka.prototype),this.name="ProviderNotReadyError",this.code="PROVIDER_NOT_READY"}},Of=class Ha extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ha.prototype),this.name="TargetingKeyMissingError",this.code="TARGETING_KEY_MISSING"}},xf=class Ma extends Ke{constructor(e,r){super(e,r),Object.setPrototypeOf(this,Ma.prototype),this.name="TypeMismatchError",this.code="TYPE_MISMATCH"}},Df=(t,e)=>{switch(t){case"FLAG_NOT_FOUND":return new Nf(e);case"PARSE_ERROR":return new bf(e);case"TYPE_MISMATCH":return new xf(e);case"TARGETING_KEY_MISSING":return new Of(e);case"INVALID_CONTEXT":return new Rf(e);case"PROVIDER_NOT_READY":return new Ia(e);case"PROVIDER_FATAL":return new Aa(e);default:return new Da(e)}},Dt=(t=>(t.NOT_READY="NOT_READY",t.READY="READY",t.ERROR="ERROR",t.STALE="STALE",t.FATAL="FATAL",t.RECONCILING="RECONCILING",t))(Dt||{}),Pe=(t=>(t.Ready="PROVIDER_READY",t.Error="PROVIDER_ERROR",t.ConfigurationChanged="PROVIDER_CONFIGURATION_CHANGED",t.ContextChanged="PROVIDER_CONTEXT_CHANGED",t.Reconciling="PROVIDER_RECONCILING",t.Stale="PROVIDER_STALE",t))(Pe||{}),Lf={READY:"PROVIDER_READY",ERROR:"PROVIDER_ERROR",FATAL:"PROVIDER_ERROR",STALE:"PROVIDER_STALE",RECONCILING:"PROVIDER_RECONCILING",NOT_READY:void 0},ja=(t,e)=>!e&&t==="PROVIDER_READY"||Lf[e]===t,Fa=class{error(...t){console.error(...t)}warn(...t){console.warn(...t)}info(){}debug(){}},Pf=["error","warn","info","debug"],nn=class{constructor(t){this.fallbackLogger=new Fa;try{for(const e of Pf)if(!t[e]||typeof t[e]!="function")throw new Error(`The provided logger is missing the ${e} method.`);this.logger=t}catch(e){console.error(e),console.error("Falling back to the default logger."),this.logger=this.fallbackLogger}}error(...t){this.log("error",...t)}warn(...t){this.log("warn",...t)}info(...t){this.log("info",...t)}debug(...t){this.log("debug",...t)}log(t,...e){try{this.logger[t](...e)}catch{this.fallbackLogger[t](...e)}}},wf=class{constructor(t){this.globalLogger=t,this._handlers={PROVIDER_CONFIGURATION_CHANGED:new WeakMap,PROVIDER_CONTEXT_CHANGED:new WeakMap,PROVIDER_READY:new WeakMap,PROVIDER_ERROR:new WeakMap,PROVIDER_STALE:new WeakMap,PROVIDER_RECONCILING:new WeakMap}}emit(t,e){this.eventEmitter.emit(t,e)}addHandler(t,e){const r=o=>lt(this,null,function*(){var a;try{yield e(o)}catch(i){(a=this._logger)==null||a.error("Error running event handler:",i)}}),n=this._handlers[t].get(e);this._handlers[t].set(e,[...n||[],r]),this.eventEmitter.on(t,r)}removeHandler(t,e){const r=this._handlers[t].get(e);if(r){const n=r.pop();n&&this.eventEmitter.removeListener(t,n)}}removeAllHandlers(t){t?this.eventEmitter.removeAllListeners(t):this.eventEmitter.removeAllListeners()}getHandlers(t){return this.eventEmitter.listeners(t)}setLogger(t){return this._eventLogger=new nn(t),this}get _logger(){var t,e;return(e=this._eventLogger)!=null?e:(t=this.globalLogger)==null?void 0:t.call(this)}};function Af(t){return typeof t=="string"}function ct(t){return Af(t)?t:void 0}function Tf(t){return typeof t=="object"}function Ce(t){return Tf(t)?t:void 0}function _o(t){return typeof t<"u"&&t!==null}var Vr=class{constructor(t,e,r){this._provider=t,this._status=e,this._pendingContextChanges=0;var n,o,a;(n=t.events)==null||n.addHandler("PROVIDER_READY",()=>{this._status=r.READY}),(o=t.events)==null||o.addHandler("PROVIDER_STALE",()=>{this._status=r.STALE}),(a=t.events)==null||a.addHandler("PROVIDER_ERROR",i=>{i?.errorCode==="PROVIDER_FATAL"?this._status=r.FATAL:this._status=r.ERROR})}get provider(){return this._provider}set provider(t){this._provider=t}get status(){return this._status}set status(t){this._status=t}get allContextChangesSettled(){return this._pendingContextChanges===0}incrementPendingContextChanges(){this._pendingContextChanges++}decrementPendingContextChanges(){this._pendingContextChanges--}},If=class{constructor(t){this._hooks=[],this._context={},this._logger=new Fa,this._clientEventHandlers=new Map,this._domainScopedContext=new Map,this._clientEvents=new Map,this._runsOn=t}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}setLogger(t){return this._logger=new nn(t),this}get providerMetadata(){return this.getProviderMetadata()}getProviderMetadata(t){return this.getProviderForClient(t).metadata}addHandler(t,e,r){[...new Map([[void 0,this._defaultProvider]]),...this._domainScopedProviders].forEach(n=>{var o;const a=n[0],i=n[1].provider,s=n[1].status;if(ja(t,s))try{e({domain:a,providerName:i.metadata.name})}catch(c){(o=this._logger)==null||o.error("Error running event handler:",c)}}),this._apiEmitter.addHandler(t,e),r?.signal&&typeof r.signal.addEventListener=="function"&&r.signal.addEventListener("abort",()=>{this.removeHandler(t,e)})}removeHandler(t,e){this._apiEmitter.removeHandler(t,e)}clearHandlers(){this._apiEmitter.removeAllHandlers()}getHandlers(t){return this._apiEmitter.getHandlers(t)}setAwaitableProvider(t,e){var r,n,o,a,i,s,l,c;const d=ct(t),u=(r=Ce(t))!=null?r:Ce(e);if(!u){this._logger.debug("No provider defined, ignoring setProvider call");return}const h=this.getProviderForClient(d),f=u.metadata.name;if(h===u){this._logger.debug("Provider is already set, ignoring setProvider call");return}if(!u.runsOn)this._logger.debug(`Provider '${u.metadata.name}' has not defined its intended use.`);else if(u.runsOn!==this._runsOn)throw new Da(`Provider '${u.metadata.name}' is intended for use on the ${u.runsOn}.`);const m=this.getAssociatedEventEmitters(d);let y;const S=new Vr(u,this._statusEnumType.NOT_READY,this._statusEnumType);return typeof u.initialize=="function"&&!this.allProviders.includes(u)?y=(i=(a=(o=u.initialize)==null?void 0:o.call(u,d?(n=this._domainScopedContext.get(d))!=null?n:this._context:this._context))==null?void 0:a.then(()=>{var _;S.status=this._statusEnumType.READY,this.getAssociatedEventEmitters(d).forEach(R=>{R?.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}),(_=this._apiEmitter)==null||_.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}))==null?void 0:i.catch(_=>{var R;throw _?.code==="PROVIDER_FATAL"?S.status=this._statusEnumType.FATAL:S.status=this._statusEnumType.ERROR,this.getAssociatedEventEmitters(d).forEach(L=>{L?.emit("PROVIDER_ERROR",{clientName:d,domain:d,providerName:f,message:_?.message})}),(R=this._apiEmitter)==null||R.emit("PROVIDER_ERROR",{clientName:d,domain:d,providerName:f,message:_?.message}),_}):(S.status=this._statusEnumType.READY,m.forEach(_=>{_?.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})}),(s=this._apiEmitter)==null||s.emit("PROVIDER_READY",{clientName:d,domain:d,providerName:f})),d?this._domainScopedProviders.set(d,S):this._defaultProvider=S,this.transferListeners(h,u,d,m),this.allProviders.includes(h)||(c=(l=h?.onClose)==null?void 0:l.call(h))==null||c.catch(_=>{this._logger.error(`error closing provider: ${_?.message}, ${_?.stack}`)}),y}getProviderForClient(t){var e,r;return t?(r=(e=this._domainScopedProviders.get(t))==null?void 0:e.provider)!=null?r:this._defaultProvider.provider:this._defaultProvider.provider}buildAndCacheEventEmitterForClient(t){const e=this._clientEvents.get(t);if(e)return e;const r=this._createEventEmitter();this._clientEvents.set(t,r);const n=this.getProviderForClient(t);return Object.values(Pe).forEach(o=>{var a;return(a=n.events)==null?void 0:a.addHandler(o,i=>lt(this,null,function*(){r.emit(o,Or(br({},i),{clientName:t,domain:t,providerName:n.metadata.name}))}))}),r}getUnboundEmitters(){const t=[...this._domainScopedProviders.keys()];return[...[...this._clientEvents.keys()].filter(_o).filter(n=>!t.includes(n)).map(n=>this._clientEvents.get(n)),this._clientEvents.get(void 0)].filter(_o)}getAssociatedEventEmitters(t){return t?[this.buildAndCacheEventEmitterForClient(t)]:this.getUnboundEmitters()}transferListeners(t,e,r,n){var o;(o=this._clientEventHandlers.get(r))==null||o.forEach(i=>{var s;return(s=t.events)==null?void 0:s.removeHandler(...i)});const a=Object.values(Pe).map(i=>[i,l=>lt(this,null,function*(){n.forEach(c=>{c?.emit(i,Or(br({},l),{clientName:r,domain:r,providerName:e.metadata.name}))}),this._apiEmitter.emit(i,Or(br({},l),{clientName:r,domain:r,providerName:e.metadata.name}))})]);this._clientEventHandlers.set(r,a),a.forEach(i=>{var s;return(s=e.events)==null?void 0:s.addHandler(...i)})}close(){return lt(this,null,function*(){var t,e;try{yield(e=(t=this==null?void 0:this._defaultProvider.provider)==null?void 0:t.onClose)==null?void 0:e.call(t)}catch(n){this.handleShutdownError(this._defaultProvider.provider,n)}const r=Array.from(this._domainScopedProviders);yield Promise.all(r.map(n=>lt(this,[n],function*([,o]){var a,i;try{yield(i=o==null?void 0:(a=o.provider).onClose)==null?void 0:i.call(a)}catch(s){this.handleShutdownError(o?.provider,s)}})))})}clearProvidersAndSetDefault(t){return lt(this,null,function*(){try{yield this.close()}catch{this._logger.error("Unable to cleanly close providers. Resetting to the default configuration.")}finally{this._domainScopedProviders.clear(),this._defaultProvider=new Vr(t,this._statusEnumType.NOT_READY,this._statusEnumType)}})}get allProviders(){return[...[...this._domainScopedProviders.values()].map(t=>t.provider),this._defaultProvider.provider]}handleShutdownError(t,e){this._logger.error(`Error during shutdown of provider ${t.metadata.name}: ${e}`),this._logger.error(e?.stack)}},kf=Object.create,on=Object.defineProperty,Hf=Object.defineProperties,Mf=Object.getOwnPropertyDescriptor,jf=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertyNames,Co=Object.getOwnPropertySymbols,Va=Object.getPrototypeOf,Ua=Object.prototype.hasOwnProperty,Ff=Object.prototype.propertyIsEnumerable,Bf=Reflect.get,So=(t,e,r)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xr=(t,e)=>{for(var r in e||(e={}))Ua.call(e,r)&&So(t,r,e[r]);if(Co)for(var r of Co(e))Ff.call(e,r)&&So(t,r,e[r]);return t},Vf=(t,e)=>Hf(t,jf(e)),Uf=(t,e)=>function(){return e||(0,t[Ba(t)[0]])((e={exports:{}}).exports,e),e.exports},$f=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ba(e))!Ua.call(t,o)&&o!==r&&on(t,o,{get:()=>e[o],enumerable:!(n=Mf(e,o))||n.enumerable});return t},zf=(t,e,r)=>(r=t!=null?kf(Va(t)):{},$f(on(r,"default",{value:t,enumerable:!0}),t)),Kf=(t,e,r)=>Bf(Va(t),r,e),st=(t,e,r)=>new Promise((n,o)=>{var a=l=>{try{s(r.next(l))}catch(c){o(c)}},i=l=>{try{s(r.throw(l))}catch(c){o(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,i);s((r=r.apply(t,e)).next())}),Wf=Uf({"../../node_modules/eventemitter3/index.js"(t,e){var r=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function a(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function i(c,d,u,h,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new a(u,h||c,f),y=n?n+d:d;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function s(c,d){--c._eventsCount===0?c._events=new o:delete c._events[d]}function l(){this._events=new o,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,h;if(this._eventsCount===0)return d;for(h in u=this._events)r.call(u,h)&&d.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=n?n+d:d,h=this._events[u];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,m=h.length,y=new Array(m);f<m;f++)y[f]=h[f].fn;return y},l.prototype.listenerCount=function(d){var u=n?n+d:d,h=this._events[u];return h?h.fn?1:h.length:0},l.prototype.emit=function(d,u,h,f,m,y){var S=n?n+d:d;if(!this._events[S])return!1;var _=this._events[S],R=arguments.length,L,b;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),R){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,u),!0;case 3:return _.fn.call(_.context,u,h),!0;case 4:return _.fn.call(_.context,u,h,f),!0;case 5:return _.fn.call(_.context,u,h,f,m),!0;case 6:return _.fn.call(_.context,u,h,f,m,y),!0}for(b=1,L=new Array(R-1);b<R;b++)L[b-1]=arguments[b];_.fn.apply(_.context,L)}else{var w=_.length,k;for(b=0;b<w;b++)switch(_[b].once&&this.removeListener(d,_[b].fn,void 0,!0),R){case 1:_[b].fn.call(_[b].context);break;case 2:_[b].fn.call(_[b].context,u);break;case 3:_[b].fn.call(_[b].context,u,h);break;case 4:_[b].fn.call(_[b].context,u,h,f);break;default:if(!L)for(k=1,L=new Array(R-1);k<R;k++)L[k-1]=arguments[k];_[b].fn.apply(_[b].context,L)}}return!0},l.prototype.on=function(d,u,h){return i(this,d,u,h,!1)},l.prototype.once=function(d,u,h){return i(this,d,u,h,!0)},l.prototype.removeListener=function(d,u,h,f){var m=n?n+d:d;if(!this._events[m])return this;if(!u)return s(this,m),this;var y=this._events[m];if(y.fn)y.fn===u&&(!f||y.once)&&(!h||y.context===h)&&s(this,m);else{for(var S=0,_=[],R=y.length;S<R;S++)(y[S].fn!==u||f&&!y[S].once||h&&y[S].context!==h)&&_.push(y[S]);_.length?this._events[m]=_.length===1?_[0]:_:s(this,m)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=n?n+d:d,this._events[u]&&s(this,u)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,typeof e<"u"&&(e.exports=l)}}),Yf="No-op",Gf=class{constructor(){this.metadata={name:"No-op Provider"}}resolveBooleanEvaluation(t,e){return this.noOp(e)}resolveStringEvaluation(t,e){return this.noOp(e)}resolveNumberEvaluation(t,e){return this.noOp(e)}resolveObjectEvaluation(t,e){return this.noOp(e)}noOp(t){return{value:t,reason:Yf}}},No=new Gf,Jf=zf(Wf()),Ro=class extends wf{constructor(){super(),this.eventEmitter=new Jf.default}},Xf=class{constructor(t,e,r,n,o,a,i){this.providerAccessor=t,this.providerStatusAccessor=e,this.emitterAccessor=r,this.apiContextAccessor=n,this.apiHooksAccessor=o,this.globalLogger=a,this.options=i,this._hooks=[]}get metadata(){var t,e;return{name:(t=this.options.domain)!=null?t:this.options.name,domain:(e=this.options.domain)!=null?e:this.options.name,version:this.options.version,providerMetadata:this.providerAccessor().metadata}}get providerStatus(){return this.providerStatusAccessor()}addHandler(t,e,r){var n;if(this.emitterAccessor().addHandler(t,e),ja(t,this.providerStatus))try{e({clientName:this.metadata.name,domain:this.metadata.domain,providerName:this._provider.metadata.name})}catch(a){(n=this._logger)==null||n.error("Error running event handler:",a)}r?.signal&&typeof r.signal.addEventListener=="function"&&r.signal.addEventListener("abort",()=>{this.removeHandler(t,e)})}removeHandler(t,e){this.emitterAccessor().removeHandler(t,e)}getHandlers(t){return this.emitterAccessor().getHandlers(t)}setLogger(t){return this._clientLogger=new nn(t),this}addHooks(...t){return this._hooks=[...this._hooks,...t],this}getHooks(){return this._hooks}clearHooks(){return this._hooks=[],this}getBooleanValue(t,e,r){return this.getBooleanDetails(t,e,r).value}getBooleanDetails(t,e,r){return this.evaluate(t,this._provider.resolveBooleanEvaluation,e,"boolean",r)}getStringValue(t,e,r){return this.getStringDetails(t,e,r).value}getStringDetails(t,e,r){return this.evaluate(t,this._provider.resolveStringEvaluation,e,"string",r)}getNumberValue(t,e,r){return this.getNumberDetails(t,e,r).value}getNumberDetails(t,e,r){return this.evaluate(t,this._provider.resolveNumberEvaluation,e,"number",r)}getObjectValue(t,e,r){return this.getObjectDetails(t,e,r).value}getObjectDetails(t,e,r){return this.evaluate(t,this._provider.resolveObjectEvaluation,e,"object",r)}track(t,e={}){var r,n,o;try{if(this.shortCircuitIfNotReady(),typeof this._provider.track=="function"){const a=Object.freeze(xr({},this.apiContextAccessor((r=this==null?void 0:this.options)==null?void 0:r.domain)));return(o=(n=this._provider).track)==null?void 0:o.call(n,t,a,e)}else this._logger.debug("Provider does not support the track function; will no-op.")}catch(a){this._logger.debug("Error recording tracking event.",a)}}evaluate(t,e,r,n,o={}){var a,i;const s=[...this.apiHooksAccessor(),...this.getHooks(),...o.hooks||[],...this._provider.hooks||[]],l=[...s].reverse(),c=xr({},this.apiContextAccessor((a=this==null?void 0:this.options)==null?void 0:a.domain)),d=l.map(()=>Object.freeze({flagKey:t,defaultValue:r,flagValueType:n,clientMetadata:this.metadata,providerMetadata:this._provider.metadata,context:c,logger:this._logger,hookData:new Cf}));let u;try{this.beforeHooks(s,d,o),this.shortCircuitIfNotReady();const h=e.call(this._provider,t,r,c,this._logger),f=Vf(xr({},h),{flagMetadata:Object.freeze((i=h.flagMetadata)!=null?i:{}),flagKey:t});if(f.errorCode){const m=Df(f.errorCode,f.errorMessage);this.errorHooks(l,d,m,o),u=this.getErrorEvaluationDetails(t,r,m,f.flagMetadata)}else this.afterHooks(l,d,f,o),u=f}catch(h){this.errorHooks(l,d,h,o),u=this.getErrorEvaluationDetails(t,r,h)}return this.finallyHooks(l,d,u,o),u}beforeHooks(t,e,r){var n;for(const[o,a]of t.entries()){const i=t.length-1-o,s=e[i];Object.freeze(s),Object.freeze(s.context),(n=a?.before)==null||n.call(a,s,Object.freeze(r.hookHints))}}afterHooks(t,e,r,n){var o;for(const[a,i]of t.entries()){const s=e[a];(o=i?.after)==null||o.call(i,s,r,n.hookHints)}}errorHooks(t,e,r,n){var o;for(const[a,i]of t.entries())try{const s=e[a];(o=i?.error)==null||o.call(i,s,r,n.hookHints)}catch(s){this._logger.error(`Unhandled error during 'error' hook: ${s}`),s instanceof Error&&this._logger.error(s.stack),this._logger.error(s?.stack)}}finallyHooks(t,e,r,n){var o;for(const[a,i]of t.entries())try{const s=e[a];(o=i?.finally)==null||o.call(i,s,r,n.hookHints)}catch(s){this._logger.error(`Unhandled error during 'finally' hook: ${s}`),s instanceof Error&&this._logger.error(s.stack),this._logger.error(s?.stack)}}get _provider(){return this.providerAccessor()}get _logger(){return this._clientLogger||this.globalLogger()}shortCircuitIfNotReady(){if(this.providerStatus===Dt.NOT_READY)throw new Ia("provider has not yet initialized");if(this.providerStatus===Dt.FATAL)throw new Aa("provider is in an irrecoverable error state")}getErrorEvaluationDetails(t,e,r,n={}){const o=r?.message;return{errorCode:r?.code||ba.GENERAL,errorMessage:o,value:e,reason:Sf.ERROR,flagMetadata:Object.freeze(n),flagKey:t}}},bo=Symbol.for("@openfeature/web-sdk/api"),Oo=globalThis,qf=class Ur extends If{constructor(){super("client"),this._statusEnumType=Dt,this._apiEmitter=new Ro,this._defaultProvider=new Vr(No,Dt.NOT_READY,this._statusEnumType),this._domainScopedProviders=new Map,this._createEventEmitter=()=>new Ro}static getInstance(){const e=Oo[bo];if(e)return e;const r=new Ur;return Oo[bo]=r,r}getProviderStatus(e){var r,n;return e?(n=(r=this._domainScopedProviders.get(e))==null?void 0:r.status)!=null?n:this._defaultProvider.status:this._defaultProvider.status}setProviderAndWait(e,r,n){return st(this,null,function*(){const o=ct(e),a=Ce(o?r:e),i=Ce(o?n:r);i&&(o?this._domainScopedContext.set(o,i):this._context=i),yield this.setAwaitableProvider(o,a)})}setProvider(e,r,n){const o=ct(e),a=Ce(o?r:e),i=Ce(o?n:r);i&&(o?this._domainScopedContext.set(o,i):this._context=i);const s=this.setAwaitableProvider(o,a);return Promise.resolve(s).catch(l=>{this._logger.error("Error during provider initialization:",l)}),this}getProvider(e){return this.getProviderForClient(e)}setContext(e,r){return st(this,null,function*(){var n,o;const a=ct(e),i=(o=(n=Ce(e))!=null?n:Ce(r))!=null?o:{};if(a){const s=this._domainScopedProviders.get(a);if(s){const l=this.getContext(a);this._domainScopedContext.set(a,i),yield this.runProviderContextChangeHandler(a,s,l,i)}else this._domainScopedContext.set(a,i)}else{const s=this._context;this._context=i;const l=Array.from(this._domainScopedProviders.entries()).filter(([d])=>!this._domainScopedContext.has(d)).reduce((d,[u,h])=>(d.push({domain:u,wrapper:h}),d),[]),c=[{domain:void 0,wrapper:this._defaultProvider},...l];yield Promise.all(c.map(d=>this.runProviderContextChangeHandler(d.domain,d.wrapper,s,i)))}})}getContext(e){const r=ct(e);if(r){const n=this._domainScopedContext.get(r);if(n)return n;this._logger.debug(`Unable to find context for '${r}'.`)}return this._context}clearContext(e){return st(this,null,function*(){const r=ct(e);if(r){const n=this._domainScopedProviders.get(r);if(n){const o=this.getContext(r);this._domainScopedContext.delete(r);const a=this.getContext();yield this.runProviderContextChangeHandler(r,n,o,a)}else this._domainScopedContext.delete(r)}else return this.setContext({})})}clearContexts(){return st(this,null,function*(){yield this.clearContext(),yield Promise.allSettled(Array.from(this._domainScopedProviders.keys()).map(e=>this.clearContext(e)))})}getClient(e,r){return new Xf(()=>this.getProviderForClient(e),()=>this.getProviderStatus(e),()=>this.buildAndCacheEventEmitterForClient(e),n=>this.getContext(n),()=>this.getHooks(),()=>this._logger,{domain:e,version:r})}clearProviders(){return st(this,null,function*(){yield Kf(Ur.prototype,this,"clearProvidersAndSetDefault").call(this,No),this._domainScopedContext.clear()})}runProviderContextChangeHandler(e,r,n,o){return st(this,null,function*(){var a,i,s,l,c,d;const u=((i=(a=r.provider)==null?void 0:a.metadata)==null?void 0:i.name)||"unnamed-provider";try{if(typeof r.provider.onContextChange=="function"){const h=r.provider.onContextChange(n,o);h&&typeof h?.then=="function"&&(r.incrementPendingContextChanges(),r.status=this._statusEnumType.RECONCILING,this.getAssociatedEventEmitters(e).forEach(f=>{f?.emit(Pe.Reconciling,{domain:e,providerName:u})}),(s=this._apiEmitter)==null||s.emit(Pe.Reconciling,{domain:e,providerName:u}),yield h,r.decrementPendingContextChanges())}r.status=this._statusEnumType.READY,r.allContextChangesSettled&&(this.getAssociatedEventEmitters(e).forEach(h=>{h?.emit(Pe.ContextChanged,{clientName:e,domain:e,providerName:u})}),(l=this._apiEmitter)==null||l.emit(Pe.ContextChanged,{clientName:e,domain:e,providerName:u}))}catch(h){if(r.decrementPendingContextChanges(),r.status=this._statusEnumType.ERROR,r.allContextChangesSettled){const f=h,m=`Error running ${u}'s context change handler: ${f?.message}`;(c=this._logger)==null||c.error(`${m}`,h),this.getAssociatedEventEmitters(e).forEach(y=>{y?.emit(Pe.Error,{clientName:e,domain:e,providerName:u,message:m})}),(d=this._apiEmitter)==null||d.emit(Pe.Error,{clientName:e,domain:e,providerName:u,message:m})}}})}},$a=qf.getInstance();class Zf{runsOn="client";metadata={name:"QueryParamProvider"};flags;constructor(e){this.flags=new Map;for(const[r,n]of e.entries())this.flags.set(r,n)}resolveBooleanEvaluation(e,r){const n=this.flags.get(e);return n===void 0?{value:r,reason:"DEFAULT"}:{value:n.toLowerCase()==="true"||n==="1",reason:"STATIC",variant:n}}resolveStringEvaluation(e,r){const n=this.flags.get(e);return n===void 0?{value:r,reason:"DEFAULT"}:{value:n,reason:"STATIC",variant:n}}resolveNumberEvaluation(e,r){const n=this.flags.get(e);if(n===void 0)return{value:r,reason:"DEFAULT"};const o=Number(n);return isNaN(o)?{value:r,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:`Failed to parse "${n}" as a number`}:{value:o,reason:"STATIC",variant:n}}resolveObjectEvaluation(e,r){const n=this.flags.get(e);if(n===void 0)return{value:r,reason:"DEFAULT"};try{return{value:JSON.parse(n),reason:"STATIC",variant:n}}catch(o){return{value:r,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}}}async function Qf(t){const e=typeof window<"u"?new URLSearchParams(window.location.search):new URLSearchParams,r=new Zf(e);await $a.setProviderAndWait(r)}async function eh(){const t=$a.getClient();return Promise.resolve(t.getBooleanValue("FEATURE_DUAL_ACTION_CREATE_ENABLED",!1))}let $r;function th(t){$r=t}async function Kh(){return await $r?.clear(),!!$r}async function rh(t){const e=await ff(),r=[e,...t];return zr([e,...t]),r}async function nh(t,e,r){const n=r.find(o=>o.state.local.triggers.find(a=>a.type==="PullResponder"&&a.data?.url===t));if(n)return n;try{return await e.addRemoteDrive(t,{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:t,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:bs(),system:!0}],triggers:[]})}catch(o){de.error("Error adding remote drive",o)}}async function oh(){if(window.ph||(window.ph={}),window.ph.reactor||window.ph.loading)return;window.ph.loading=!0,xi(),await Qf();const t=await Di(),e=await t.did(),r=Li(e,dt.routerBasename),n=pd(dt.routerBasename);th(n);const o=await gf(),a=await rh(o),i=a.flatMap(L=>L.modules.documentModelModules).filter(L=>L!==void 0),s=await eh(),l=Pi(),c=gd(i,n,{...l,featureFlags:{enableDualActionCreate:s}});await wi(c,r,t);const d=Ai(c),u=new _s(c.listeners,c);let h=await En(c);const f=ih(),m=f?await nh(f,c,h):void 0;m&&(h=await En(c));const y=window.location.pathname,S=m?.header.slug??Ti(y),_=m?"":Ii(y),R=ah();await ki(R,c,r,t),Hi(dt),Mi(c),ji(d),Fi(t),Bi(e),Vi(r),Ui(u),$i(h),zr(a),St(S),Lo(_),c.on("defaultRemoteDrive",(...L)=>{de.verbose("defaultRemoteDrive",...L),ot(c).catch(de.error)}),c.on("clientStrandsError",(...L)=>{de.verbose("clientStrandsError",...L),ot(c).catch(de.error)}),c.on("driveAdded",(...L)=>{de.verbose("driveAdded",...L),u.registerDrive(L[0].header.id).catch(de.error),ot(c).catch(de.error)}),c.on("driveDeleted",(...L)=>{de.verbose("driveDeleted",...L),ot(c).catch(de.error)}),c.on("documentModelModules",(...L)=>{de.verbose("documentModelModules",...L),ot(c).catch(de.error)}),c.on("driveOperationsAdded",(...L)=>{de.verbose("driveOperationsAdded",...L),ot(c).catch(de.error)}),window.ph.loading=!1}function ah(){const e=new URLSearchParams(window.location.search).get("user");return e?decodeURIComponent(e):void 0}function ih(){const e=new URLSearchParams(window.location.search).get("driveUrl");return e?decodeURIComponent(e):void 0}function sh(){const t=Wr();g.useEffect(()=>{let e=null;if(t){const{credential:r,...n}=t;e={id:n.did,username:n.ens?.name,...n}}Ds(e)},[t])}function lh(){return N.jsx("div",{className:"h-screen",children:N.jsx("div",{className:"flex h-screen items-stretch overflow-auto",role:"presentation",tabIndex:0,children:N.jsxs(g.Suspense,{name:"Root",children:[N.jsx(bh,{}),N.jsx("div",{className:"relative flex-1 overflow-auto",children:N.jsx(Cu,{})})]})})})}function ch(){const[t]=wo(),e=zi(),[r]=Kr();g.useEffect(()=>{r||Ki(Ks)},[r]),g.useEffect(()=>{t||Wi(Ws)},[t]);const n=!r&&!t&&!e;return N.jsx(uh,{children:n?N.jsx(fh,{}):N.jsx(Ud,{})})}function uh({children:t}){return N.jsx("div",{className:"flex h-full flex-col overflow-auto",id:"content-view",children:t})}function dh({drive:t}){const r=Po(t.header.meta?.preferredEditor)?.name||"Drive Explorer App";return N.jsx(as,{title:t.state.global.name,description:r,icon:N.jsx(Ra,{drive:t}),onClick:()=>St(t)},t.header.id)}function fh(){const t=Ao(),e=ce;return N.jsxs(Io,{children:[t?.map(r=>N.jsx(dh,{drive:r},r.header.id)),e.drives.addDriveEnabled&&N.jsx(os,{})]})}const hh=t=>g.createElement("svg",{width:28,height:32,viewBox:"0 0 28 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},g.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z",fill:"url(#paint0_radial_319_20865)"}),g.createElement("path",{d:"M14 0L0 23.9998V7.99993L14 0Z",fill:"url(#paint1_linear_319_20865)"}),g.createElement("path",{d:"M28 24L7.82013e-05 24L14 31.9999L28 24Z",fill:"url(#paint2_linear_319_20865)"}),g.createElement("path",{d:"M14 0L28 23.9998V7.99993L14 0Z",fill:"url(#paint3_linear_319_20865)"}),g.createElement("defs",null,g.createElement("radialGradient",{id:"paint0_radial_319_20865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)"},g.createElement("stop",{offset:.181008,stopColor:"#FFCD6B"}),g.createElement("stop",{offset:1,stopColor:"#EB5EDF"})),g.createElement("linearGradient",{id:"paint1_linear_319_20865",x1:-.031454,y1:24.041,x2:13.801,y2:-.142908,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#4331E9"}),g.createElement("stop",{offset:1,stopColor:"#A273FF"})),g.createElement("linearGradient",{id:"paint2_linear_319_20865",x1:-.0310093,y1:24,x2:28.0444,y2:24,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#A273FF"}),g.createElement("stop",{offset:1,stopColor:"#4331E9"})),g.createElement("linearGradient",{id:"paint3_linear_319_20865",x1:28.0315,y1:24.041,x2:14.199,y2:-.142908,gradientUnits:"userSpaceOnUse"},g.createElement("stop",{stopColor:"#A273FF"}),g.createElement("stop",{offset:1,stopColor:"#4331E9"})))),ph=t=>g.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},g.createElement("path",{d:"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z",fill:"#6C7275"}),g.createElement("path",{d:"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z",fill:"#6C7275"})),gh="https://apps.powerhouse.io/sky-atlas/staging/switchboard",mh=2e3;function vh(){const{search:t}=sr();return g.useMemo(()=>{const r=new URLSearchParams(t).get("reactorUrl")??gh;return r.endsWith("/")?r:`${r}/`},[t])}async function Eh(t,e){const r=Os`
|
|
15
15
|
mutation ForkAtlas($docId: PHID) {
|
|
16
16
|
ForkAtlas(docId: $docId)
|
|
17
17
|
}
|