@camstack/addon-admin-ui 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddLocationWizard-DS7BizJv.js → AddLocationWizard-r5xWfOLZ.js} +1 -1
- package/dist/assets/{AddonCollectionPage-D7lHEbwI.js → AddonCollectionPage-BmcSdSkl.js} +1 -1
- package/dist/assets/{Addons-D6z52udO.js → Addons-CLf82zRJ.js} +1 -1
- package/dist/assets/{AdminTabs-ZprmiCN3.js → AdminTabs-7mkfimpe.js} +1 -1
- package/dist/assets/{AiProfiles-Z7ksIPFF.js → AiProfiles-R33NnzxL.js} +1 -1
- package/dist/assets/{BrokerForm-DbfBwy1x.js → BrokerForm-SDrahZJq.js} +1 -1
- package/dist/assets/{Capabilities-BeYEhvPF.js → Capabilities-BS_pV5kK.js} +1 -1
- package/dist/assets/{CapabilityBadges-DXbYtBuK.js → CapabilityBadges-B5gVN9yo.js} +1 -1
- package/dist/assets/{Cluster-CC5_CGJA.js → Cluster-DwLZwcXa.js} +1 -1
- package/dist/assets/{ClusterRecordingTab-BSJTZsGS.js → ClusterRecordingTab-CFs8rzNM.js} +1 -1
- package/dist/assets/{Dashboard-B44hFAIO.js → Dashboard-DaH-7MeN.js} +1 -1
- package/dist/assets/{Data-o2lHojn-.js → Data-DM2CB0tr.js} +1 -1
- package/dist/assets/{DetectionIntelligence-CBn9zwCs.js → DetectionIntelligence-DTA_96Ae.js} +1 -1
- package/dist/assets/{DeviceDetail-CiJPK_Hg.js → DeviceDetail-Cobtc6wN.js} +1 -1
- package/dist/assets/{Devices-CuAPCnH8.js → Devices-BYHdwUA9.js} +1 -1
- package/dist/assets/{EmbedPlayerPage-C8Qwuzjd.js → EmbedPlayerPage-BpW4lsWq.js} +1 -1
- package/dist/assets/Events-Db4fPx9x.js +1 -0
- package/dist/assets/{FormBuilder-2eKUDBn_.js → FormBuilder-BwFnNOpt.js} +1 -1
- package/dist/assets/{Identity-BKqc54Et.js → Identity-C_r6Mgc9.js} +1 -1
- package/dist/assets/{IntegrationDetail-BRX1Cgc7.js → IntegrationDetail-B3nptv5G.js} +1 -1
- package/dist/assets/{Integrations-GzRXWJY0.js → Integrations-BF1ngbno.js} +1 -1
- package/dist/assets/{Integrations-CAdnay5c.js → Integrations-BNxwRAw3.js} +1 -1
- package/dist/assets/{Logs-DBBumaMc.js → Logs-CR6FjpSE.js} +1 -1
- package/dist/assets/{MotionZonesSettings-rxIHdY6l.js → MotionZonesSettings-CH8c2gQJ.js} +1 -1
- package/dist/assets/{MyAccess-BbPpIYRJ.js → MyAccess-D6FVIObH.js} +1 -1
- package/dist/assets/{Network-C5ZntFKl.js → Network-DZjk05lH.js} +1 -1
- package/dist/assets/{NodeAddonsSettingsPanel-KR29Oo7P.js → NodeAddonsSettingsPanel-BvaibJiq.js} +1 -1
- package/dist/assets/{NodeInferenceDevices-BowEeg99.js → NodeInferenceDevices-Ch5rjESF.js} +1 -1
- package/dist/assets/{NotificationTargets-f-LdcumZ.js → NotificationTargets-3YNCICGO.js} +1 -1
- package/dist/assets/{Pipeline-BUL-ABEL.js → Pipeline-BzxPuzJh.js} +1 -1
- package/dist/assets/{Plates-re0O5v8R.js → Plates-C48k-46Q.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-DB5GYkOu.js → PrivacyMaskSettings-BwJCGD0l.js} +1 -1
- package/dist/assets/{ProviderIcon-CYHRodqA.js → ProviderIcon-BNV0FRHJ.js} +1 -1
- package/dist/assets/{Recordings-Cshnuw6r.js → Recordings-CT0gChTC.js} +1 -1
- package/dist/assets/{ScanNetworkModal-DAkm1Fdk.js → ScanNetworkModal-BOpbimbE.js} +1 -1
- package/dist/assets/{Settings-KX75IP58.js → Settings-BdPbbCyr.js} +1 -1
- package/dist/assets/{Showroom-Dztrxiso.js → Showroom-BjnHBP5S.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-G3thYr_7.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-D5_wAHv9.js} +1 -1
- package/dist/assets/{build-cluster-graph-DUCV6DVF.js → build-cluster-graph-CY__30ZO.js} +1 -1
- package/dist/assets/circle-check-big-CE4wAvoQ.js +1 -0
- package/dist/assets/clock-B9UjbLDl.js +1 -0
- package/dist/assets/{copy-C11dg8eq.js → copy-D5asBldD.js} +1 -1
- package/dist/assets/{debounced-invalidate-C_DB9sqL.js → debounced-invalidate-DYWZ0mPG.js} +1 -1
- package/dist/assets/{dist-CYW0dAGQ.js → dist-DFASlyrs.js} +1 -1
- package/dist/assets/dist-Dx_vZxMI.js +7 -0
- package/dist/assets/{download-DshuRjOL.js → download-CeG-HJtH.js} +1 -1
- package/dist/assets/{face-bbox-D4Ljg5be.js → face-bbox-6vUFpDk7.js} +1 -1
- package/dist/assets/{hostInit-DnViVaCH.js → hostInit-BT2qoJBv.js} +1 -1
- package/dist/assets/{index-PRd5ZDug.js → index-CS131rnv.js} +3 -3
- package/dist/assets/{key-round-DQuSsH_p.js → key-round-DPrVlcVK.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-3b353fa3.js → mf-entry-bootstrap-0-cc4be7d0.js} +2 -2
- package/dist/assets/{pencil-DoH-KTcO.js → pencil-BGFPzGyL.js} +1 -1
- package/dist/assets/{player-overlays-BfnV1C0Q.js → player-overlays-CWRGbPFt.js} +1 -1
- package/dist/assets/plus-CnPG0Tyf.js +1 -0
- package/dist/assets/{radio-nxBAF-O0.js → radio-BW_yEv9p.js} +1 -1
- package/dist/assets/{refresh-cw-Bh7jR0Ir.js → refresh-cw-53RBMMNj.js} +1 -1
- package/dist/assets/remoteEntry-CNnEAmGt.js +1 -0
- package/dist/assets/{rotate-ccw-RKms_9rY.js → rotate-ccw-CLPp2z9s.js} +1 -1
- package/dist/assets/rotate-cw-BgRV22iV.js +1 -0
- package/dist/assets/search-BGpt8p5m.js +1 -0
- package/dist/assets/{send-h8PoRj0P.js → send-DUPHYluz.js} +1 -1
- package/dist/assets/{server-D6u4qxlr.js → server-DRSIdxSw.js} +1 -1
- package/dist/assets/square-TBVq6Wu4.js +1 -0
- package/dist/assets/{square-check-big-COxvcZ2K.js → square-check-big-2shiyBaF.js} +1 -1
- package/dist/assets/src-BS1NDJr1.js +7 -0
- package/dist/assets/{src-DKAxBIDH.js → src-CjlMsFRd.js} +4 -4
- package/dist/assets/{upload-cX_3Ogx3.js → upload-BmROjXzl.js} +1 -1
- package/dist/assets/{useEventInvalidation-DMfSVBY-.js → useEventInvalidation-DD_0VNer.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BBpdMDOB.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BNFfTwsx.js} +2 -2
- package/dist/assets/{wifi-Bk03mxTw.js → wifi-_GGDG2Kl.js} +1 -1
- package/dist/assets/{zap-B7VEvais.js → zap-CNKAzXbX.js} +1 -1
- package/dist/index.html +5 -5
- package/dist/server/addon.js +21 -4
- package/package.json +1 -1
- package/dist/assets/Events-De1MNcJg.js +0 -1
- package/dist/assets/circle-check-big-Ctn01sEf.js +0 -1
- package/dist/assets/clock-CdqW_Msl.js +0 -1
- package/dist/assets/dist-D7nNU2QV.js +0 -7
- package/dist/assets/plus-CIHjZPFg.js +0 -1
- package/dist/assets/remoteEntry-Bk3nWhnN.js +0 -1
- package/dist/assets/rotate-cw-64smQO88.js +0 -1
- package/dist/assets/search-C0Kh9F13.js +0 -1
- package/dist/assets/square-BtiVHmLU.js +0 -1
- package/dist/assets/src-CCZM6rtM.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-
|
|
2
|
-
import{i as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import"./virtual_mf-exposes___mfe_internal__admin_ui_host__remoteEntry-_hash_-DnnXQRkG.js";import{a as n,o as r}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BBpdMDOB.js";import{t as i}from"./vite-preload-helper-zJ_50EbN.js";import{$a as a,Ct as o,Da as s,Di as c,Ft as l,Ga as u,I as d,Ia as f,It as p,Ja as m,L as h,Lt as g,M as _,Oo as v,Pt as y,R as b,Rt as x,Si as S,T as C,V as w,Wa as T,_t as E,ao as D,ct as ee,ga as te,io as ne,j as re,k as ie,ki as ae,ko as oe,t as se,ui as ce,vi as le,wo as ue}from"./src-DKAxBIDH.js";import{A as de,B as O,D as k,E as A,I as j,J as fe,K as M,L as N,M as pe,N as me,O as P,P as he,Q as F,S as I,U as ge,W as L,X as _e,Y as ve,Z as ye,a as be,b as xe,d as Se,j as R,k as Ce,o as we,q as z,u as Te,x as B,z as V}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{q as Ee,t as De}from"./src-CCZM6rtM.js";import{d as Oe,p as ke}from"./player-overlays-BfnV1C0Q.js";import{r as Ae,t as je}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-D9-wIasd.js";import{t as Me}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DstpX0yz.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),F();var Ne=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pe=/^[\\/]{2}/;function Fe(e,t){return t+e.replace(/\\/g,`/`)}var Ie=`popstate`;function Le(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Re(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ve(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:He(t)}return We(t,n,null,e)}function H(e,t){if(e===!1||e==null)throw Error(t)}function U(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ze(){return Math.random().toString(36).substring(2,10)}function Be(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ve(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ue(t):t,state:n,key:t&&t.key||r||ze(),mask:i}}function He({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ue(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function We(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Le(e)?e:Ve(h.location,e,t);n&&n(r,e),l=u()+1;let d=Be(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Le(e)?e:Ve(h.location,e,t);n&&n(r,e),l=u();let i=Be(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ge(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ie,d),c=e,()=>{i.removeEventListener(Ie,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ge(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),H(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:He(t);return i=i.replace(/ $/,`%20`),!n&&Pe.test(i)&&(i=r+i),new URL(i,r)}function Ke(e,t,n=`/`){return qe(e,t,n,!1)}function qe(e,t,n,r,i){let a=pt((typeof t==`string`?Ue(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ye(e),s=null,c=ft(a);for(let e=0;s==null&&e<o.length;++e)s=ct(o[e],c,r);return s}function Je(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ye(e){let t=Xe(e);return Qe(t),t}function Xe(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;H(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(H(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Xe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ot(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ze(e.path))a(e,t,!0,n)}),t}function Ze(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ze(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Qe(e){e.sort((e,t)=>e.score===t.score?st(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var $e=/^:[\w-]+$/,et=3,tt=2,nt=1,rt=10,it=-2,at=e=>e===`*`;function ot(e,t){let n=e.split(`/`),r=n.length;return n.some(at)&&(r+=it),t&&(r+=tt),n.filter(e=>!at(e)).reduce((e,t)=>e+($e.test(t)?et:t===``?nt:rt),r)}function st(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ct(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ut(u,l,s.matcher,s.compiledParams):lt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=lt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:W([a,d.pathname]),pathnameBase:St(W([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=W([a,d.pathnameBase]))}return o}function lt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=dt(e.path,e.caseSensitive,e.end);return ut(e,t,n,r)}function ut(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function dt(e,t=!1,n=!0){U(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ft(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return U(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function pt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function mt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ue(e):e,a;return n?(n=bt(n),a=n.startsWith(`/`)?ht(n.substring(1),`/`):ht(n,t)):a=t,{pathname:a,search:Ct(r),hash:wt(i)}}function ht(e,t){let n=xt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function gt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _t(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function vt(e){let t=_t(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function yt(e,t,n,r=!1){let i;typeof e==`string`?i=Ue(e):(i={...e},H(!i.pathname||!i.pathname.includes(`?`),gt(`?`,`pathname`,`search`,i)),H(!i.pathname||!i.pathname.includes(`#`),gt(`#`,`pathname`,`hash`,i)),H(!i.search||!i.search.includes(`#`),gt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=mt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var bt=e=>e.replace(/[\\/]{2,}/g,`/`),W=e=>bt(e.join(`/`)),xt=e=>e.replace(/\/+$/,``),St=e=>xt(e).replace(/^\/*/,`/`),Ct=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Tt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Et(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Dt(e){return W(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ot=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function kt(e,t){let n=e;if(typeof n!=`string`||!Ne.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ot)try{let e=new URL(window.location.href),r=Pe.test(n)?new URL(Fe(n,e.protocol)):new URL(n),a=pt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{U(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var At=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(At);var jt=[`GET`,...At];new Set(jt);var Mt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Nt(e){try{return Mt.includes(new URL(e).protocol)}catch{return!1}}var Pt=k(null);Pt.displayName=`DataRouter`;var Ft=k(null);Ft.displayName=`DataRouterState`;var It=k(!1);function Lt(){return N(It)}var Rt=k({isTransitioning:!1});Rt.displayName=`ViewTransition`;var zt=k(new Map);zt.displayName=`Fetchers`;var Bt=k(null);Bt.displayName=`Await`;var G=k(null);G.displayName=`Navigation`;var Vt=k(null);Vt.displayName=`Location`;var K=k({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var Ht=k(null);Ht.displayName=`RouteError`;var Ut=`REACT_ROUTER_ERROR`,Wt=`REDIRECT`,Gt=`ROUTE_ERROR_RESPONSE`;function Kt(e){if(e.startsWith(`${Ut}:${Wt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function qt(e){if(e.startsWith(`${Ut}:${Gt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Tt(t.status,t.statusText,t.data)}catch{}}function Jt(e,{relative:t}={}){H(Yt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=N(G),{hash:i,pathname:a,search:o}=rn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:W([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Yt(){return N(Vt)!=null}function q(){return H(Yt(),`useLocation() may be used only in the context of a <Router> component.`),N(Vt).location}var Xt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Zt(e){N(G).static||ge(e)}function Qt(){let{isDataRoute:e}=N(K);return e?Cn():$t()}function $t(){H(Yt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=N(Pt),{basename:t,navigator:n}=N(G),{matches:r}=N(K),{pathname:i}=q(),a=JSON.stringify(vt(r)),o=M(!1);return Zt(()=>{o.current=!0}),j((r,s={})=>{if(U(o.current,Xt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=yt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var en=k(null);function tn(e){let t=N(K).outlet;return L(()=>t&&P(en.Provider,{value:e},t),[t,e])}function nn(){let{matches:e}=N(K);return e[e.length-1]?.params??{}}function rn(e,{relative:t}={}){let{matches:n}=N(K),{pathname:r}=q(),i=JSON.stringify(vt(n));return L(()=>yt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function an(e,t){return on(e,t)}function on(e,t,n){H(Yt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=N(G),{matches:i}=N(K),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Tn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DaH-7MeN.js","assets/src-CjlMsFRd.js","assets/compat-CbwIzIXq.js","assets/src-BS1NDJr1.js","assets/player-overlays-CWRGbPFt.js","assets/plus-CnPG0Tyf.js","assets/Devices-BYHdwUA9.js","assets/ProviderIcon-BNV0FRHJ.js","assets/radio-BW_yEv9p.js","assets/server-DRSIdxSw.js","assets/wifi-_GGDG2Kl.js","assets/AdminPage-BwmGKnRf.js","assets/useEventInvalidation-DD_0VNer.js","assets/Integrations-BF1ngbno.js","assets/FormBuilder-BwFnNOpt.js","assets/refresh-cw-53RBMMNj.js","assets/search-BGpt8p5m.js","assets/ScanNetworkModal-BOpbimbE.js","assets/download-CeG-HJtH.js","assets/BrokerForm-SDrahZJq.js","assets/StatusBadge-Dcr2bw58.js","assets/useBodyScrollLock-B_rtaBV1.js","assets/IntegrationDetail-B3nptv5G.js","assets/rotate-cw-BgRV22iV.js","assets/Pipeline-BzxPuzJh.js","assets/build-cluster-graph-CY__30ZO.js","assets/format-size-CO9d3C3-.js","assets/NodeInferenceDevices-Ch5rjESF.js","assets/zap-CNKAzXbX.js","assets/AddLocationWizard-r5xWfOLZ.js","assets/pencil-BGFPzGyL.js","assets/square-check-big-2shiyBaF.js","assets/square-TBVq6Wu4.js","assets/NodeAddonsSettingsPanel-BvaibJiq.js","assets/SchemaTabBar-DhsmEGyn.js","assets/ClusterRecordingTab-CFs8rzNM.js","assets/DeviceDetail-Cobtc6wN.js","assets/CapabilityBadges-B5gVN9yo.js","assets/rotate-ccw-CLPp2z9s.js","assets/Showroom-BjnHBP5S.js","assets/EmbedPlayerPage-BpW4lsWq.js","assets/DetectionIntelligence-DTA_96Ae.js","assets/face-bbox-6vUFpDk7.js","assets/debounced-invalidate-DYWZ0mPG.js","assets/authed-media-XfBD4Ma-.js","assets/Plates-C48k-46Q.js","assets/Events-Db4fPx9x.js","assets/clock-B9UjbLDl.js","assets/copy-D5asBldD.js","assets/Recordings-CT0gChTC.js","assets/AdminTabs-7mkfimpe.js","assets/Addons-CLf82zRJ.js","assets/upload-BmROjXzl.js","assets/AiProfiles-R33NnzxL.js","assets/send-DUPHYluz.js","assets/MyAccess-D6FVIObH.js","assets/circle-check-big-CE4wAvoQ.js","assets/key-round-DPrVlcVK.js","assets/Logs-CR6FjpSE.js","assets/Identity-C_r6Mgc9.js","assets/AddonCollectionPage-BmcSdSkl.js","assets/addon-display-names-DvSEQty-.js","assets/Network-DZjk05lH.js","assets/Integrations-BNxwRAw3.js","assets/Data-DM2CB0tr.js","assets/Settings-BdPbbCyr.js","assets/Cluster-DwLZwcXa.js","assets/Capabilities-BS_pV5kK.js","assets/NotificationTargets-3YNCICGO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,t}from"./rolldown-runtime-Cyuzqnbw.js";import"./virtual_mf-exposes___mfe_internal__admin_ui_host__remoteEntry-_hash_-DnnXQRkG.js";import{a as n,o as r}from"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BNFfTwsx.js";import{t as i}from"./vite-preload-helper-zJ_50EbN.js";import{$a as a,Ct as o,Da as s,Di as c,Ft as l,Ga as u,I as d,Ia as f,It as p,Ja as m,L as h,Lt as g,M as _,Oo as v,Pt as y,R as b,Rt as x,Si as S,T as C,V as w,Wa as T,_t as E,ao as D,ct as ee,ga as te,io as ne,j as re,k as ie,ki as ae,ko as oe,t as se,ui as ce,vi as le,wo as ue}from"./src-CjlMsFRd.js";import{A as de,B as O,D as k,E as A,I as j,J as fe,K as M,L as N,M as pe,N as me,O as P,P as he,Q as F,S as I,U as ge,W as L,X as _e,Y as ve,Z as ye,a as be,b as xe,d as Se,j as R,k as Ce,o as we,q as z,u as Te,x as B,z as V}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DTufy7Ue.js";import{q as Ee,t as De}from"./src-BS1NDJr1.js";import{d as Oe,p as ke}from"./player-overlays-CWRGbPFt.js";import{r as Ae,t as je}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.js-D9-wIasd.js";import{t as Me}from"./_virtual_mf___mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DstpX0yz.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),F();var Ne=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pe=/^[\\/]{2}/;function Fe(e,t){return t+e.replace(/\\/g,`/`)}var Ie=`popstate`;function Le(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Re(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Ve(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:He(t)}return We(t,n,null,e)}function H(e,t){if(e===!1||e==null)throw Error(t)}function U(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ze(){return Math.random().toString(36).substring(2,10)}function Be(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ve(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ue(t):t,state:n,key:t&&t.key||r||ze(),mask:i}}function He({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ue(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function We(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Le(e)?e:Ve(h.location,e,t);n&&n(r,e),l=u()+1;let d=Be(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Le(e)?e:Ve(h.location,e,t);n&&n(r,e),l=u();let i=Be(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ge(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ie,d),c=e,()=>{i.removeEventListener(Ie,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ge(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),H(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:He(t);return i=i.replace(/ $/,`%20`),!n&&Pe.test(i)&&(i=r+i),new URL(i,r)}function Ke(e,t,n=`/`){return qe(e,t,n,!1)}function qe(e,t,n,r,i){let a=pt((typeof t==`string`?Ue(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Ye(e),s=null,c=ft(a);for(let e=0;s==null&&e<o.length;++e)s=ct(o[e],c,r);return s}function Je(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Ye(e){let t=Xe(e);return Qe(t),t}function Xe(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;H(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=W([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(H(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Xe(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ot(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=dt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ze(e.path))a(e,t,!0,n)}),t}function Ze(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ze(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Qe(e){e.sort((e,t)=>e.score===t.score?st(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var $e=/^:[\w-]+$/,et=3,tt=2,nt=1,rt=10,it=-2,at=e=>e===`*`;function ot(e,t){let n=e.split(`/`),r=n.length;return n.some(at)&&(r+=it),t&&(r+=tt),n.filter(e=>!at(e)).reduce((e,t)=>e+($e.test(t)?et:t===``?nt:rt),r)}function st(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ct(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ut(u,l,s.matcher,s.compiledParams):lt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=lt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:W([a,d.pathname]),pathnameBase:St(W([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=W([a,d.pathnameBase]))}return o}function lt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=dt(e.path,e.caseSensitive,e.end);return ut(e,t,n,r)}function ut(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function dt(e,t=!1,n=!0){U(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function ft(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return U(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function pt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function mt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ue(e):e,a;return n?(n=bt(n),a=n.startsWith(`/`)?ht(n.substring(1),`/`):ht(n,t)):a=t,{pathname:a,search:Ct(r),hash:wt(i)}}function ht(e,t){let n=xt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function gt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _t(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function vt(e){let t=_t(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function yt(e,t,n,r=!1){let i;typeof e==`string`?i=Ue(e):(i={...e},H(!i.pathname||!i.pathname.includes(`?`),gt(`?`,`pathname`,`search`,i)),H(!i.pathname||!i.pathname.includes(`#`),gt(`#`,`pathname`,`hash`,i)),H(!i.search||!i.search.includes(`#`),gt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=mt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var bt=e=>e.replace(/[\\/]{2,}/g,`/`),W=e=>bt(e.join(`/`)),xt=e=>e.replace(/\/+$/,``),St=e=>xt(e).replace(/^\/*/,`/`),Ct=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,wt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Tt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Et(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Dt(e){return W(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ot=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function kt(e,t){let n=e;if(typeof n!=`string`||!Ne.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ot)try{let e=new URL(window.location.href),r=Pe.test(n)?new URL(Fe(n,e.protocol)):new URL(n),a=pt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{U(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var At=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(At);var jt=[`GET`,...At];new Set(jt);var Mt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Nt(e){try{return Mt.includes(new URL(e).protocol)}catch{return!1}}var Pt=k(null);Pt.displayName=`DataRouter`;var Ft=k(null);Ft.displayName=`DataRouterState`;var It=k(!1);function Lt(){return N(It)}var Rt=k({isTransitioning:!1});Rt.displayName=`ViewTransition`;var zt=k(new Map);zt.displayName=`Fetchers`;var Bt=k(null);Bt.displayName=`Await`;var G=k(null);G.displayName=`Navigation`;var Vt=k(null);Vt.displayName=`Location`;var K=k({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var Ht=k(null);Ht.displayName=`RouteError`;var Ut=`REACT_ROUTER_ERROR`,Wt=`REDIRECT`,Gt=`ROUTE_ERROR_RESPONSE`;function Kt(e){if(e.startsWith(`${Ut}:${Wt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function qt(e){if(e.startsWith(`${Ut}:${Gt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Tt(t.status,t.statusText,t.data)}catch{}}function Jt(e,{relative:t}={}){H(Yt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=N(G),{hash:i,pathname:a,search:o}=rn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:W([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Yt(){return N(Vt)!=null}function q(){return H(Yt(),`useLocation() may be used only in the context of a <Router> component.`),N(Vt).location}var Xt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Zt(e){N(G).static||ge(e)}function Qt(){let{isDataRoute:e}=N(K);return e?Cn():$t()}function $t(){H(Yt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=N(Pt),{basename:t,navigator:n}=N(G),{matches:r}=N(K),{pathname:i}=q(),a=JSON.stringify(vt(r)),o=M(!1);return Zt(()=>{o.current=!0}),j((r,s={})=>{if(U(o.current,Xt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=yt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:W([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var en=k(null);function tn(e){let t=N(K).outlet;return L(()=>t&&P(en.Provider,{value:e},t),[t,e])}function nn(){let{matches:e}=N(K);return e[e.length-1]?.params??{}}function rn(e,{relative:t}={}){let{matches:n}=N(K),{pathname:r}=q(),i=JSON.stringify(vt(n));return L(()=>yt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function an(e,t){return on(e,t)}function on(e,t,n){H(Yt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=N(G),{matches:i}=N(K),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Tn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
3
|
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=q(),d;if(t){let e=typeof t==`string`?Ue(t):t;H(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ke(e,{pathname:p});U(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),U(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=pn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:W([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:W([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?P(Vt.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function sn(){let e=Sn(),t=Et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=P(O,null,P(`p`,null,`💿 Hey developer 👋`),P(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,P(`code`,{style:a},`ErrorBoundary`),` or`,` `,P(`code`,{style:a},`errorElement`),` prop on your route.`)),P(O,null,P(`h2`,null,`Unexpected Application Error!`),P(`h3`,{style:{fontStyle:`italic`}},t),n?P(`pre`,{style:i},n):null,o)}var cn=P(sn,null),ln=class extends me{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=qt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:P(K.Provider,{value:this.props.routeContext},P(Ht.Provider,{value:e,children:this.props.component}));return this.context?P(dn,{error:e},t):t}};ln.contextType=It;var un=new WeakMap;function dn({children:e,error:t}){let{basename:n}=N(G);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Kt(t.digest);if(e){let r=un.get(t);if(r)throw r;let i=kt(e.location,n),a=i.absoluteURL||i.to;if(Nt(a))throw Error(`Invalid redirect location`);if(Ot&&!un.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw un.set(t,n),n}return P(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function fn({routeContext:e,match:t,children:n}){let r=N(Pt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),P(K.Provider,{value:e},n)}function pn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);H(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Dt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||cn,o&&(s<0&&c===0?(Tn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?P(n.route.Component,null):n.route.element?n.route.element:e,P(fn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?P(ln,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hn(e){let t=N(Pt);return H(t,mn(e)),t}function gn(e){let t=N(Ft);return H(t,mn(e)),t}function _n(e){let t=N(K);return H(t,mn(e)),t}function vn(e){let t=_n(e),n=t.matches[t.matches.length-1];return H(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function yn(){return vn(`useRouteId`)}function bn(){let e=gn(`useNavigation`);return L(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function xn(){let{matches:e,loaderData:t}=gn(`useMatches`);return L(()=>e.map(e=>Je(e,t)),[e,t])}function Sn(){let e=N(Ht),t=gn(`useRouteError`),n=vn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Cn(){let{router:e}=hn(`useNavigate`),t=vn(`useNavigate`),n=M(!1);return Zt(()=>{n.current=!0}),j(async(r,i={})=>{U(n.current,Xt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var wn={};function Tn(e,t,n){!t&&!wn[e]&&(wn[e]=!0,U(!1,n))}pe(En);function En({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return on(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function J({to:e,replace:t,state:n,relative:r}){H(Yt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=N(G);U(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=N(K),{pathname:o}=q(),s=Qt(),c=yt(e,vt(a),o,r===`path`),l=JSON.stringify(c);return V(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Dn(e){return tn(e.context)}function Y(e){H(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function On({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){H(!Yt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ue(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=L(()=>{let e=pt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return U(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:P(G.Provider,{value:c},P(Vt.Provider,{children:t,value:h}))}function kn({children:e,location:t}){return an(An(e),t)}function An(e,t=[]){let n=[];return A.forEach(e,(e,r)=>{if(!de(e))return;let i=[...t,r];if(e.type===O){n.push.apply(n,An(e.props.children,i));return}H(e.type===Y,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),H(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=An(e.props.children,i)),n.push(a)}),n}var jn=`get`,Mn=`application/x-www-form-urlencoded`;function Nn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Pn(e){return Nn(e)&&e.tagName.toLowerCase()===`button`}function Fn(e){return Nn(e)&&e.tagName.toLowerCase()===`form`}function In(e){return Nn(e)&&e.tagName.toLowerCase()===`input`}function Ln(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Rn(e,t){return e.button===0&&(!t||t===`_self`)&&!Ln(e)}function zn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Bn(e,t){let n=zn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Vn=null;function Hn(){if(Vn===null)try{new FormData(document.createElement(`form`),0),Vn=!1}catch{Vn=!0}return Vn}var Un=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Wn(e){return e!=null&&!Un.has(e)?(U(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mn}"`),null):e}function Gn(e,t){let n,r,i,a,o;if(Fn(e)){let o=e.getAttribute(`action`);r=o?pt(o,t):null,n=e.getAttribute(`method`)||jn,i=Wn(e.getAttribute(`enctype`))||Mn,a=new FormData(e)}else if(Pn(e)||In(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?pt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||jn,i=Wn(e.getAttribute(`formenctype`))||Wn(o.getAttribute(`enctype`))||Mn,a=new FormData(o,e),!Hn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Nn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=jn,r=null,i=Mn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Kn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},qn=/[&><\u2028\u2029]/g;function Jn(e){return e.replace(qn,e=>Kn[e])}function Yn(e,t){if(e===!1||e==null)throw Error(t)}function Xn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&pt(i.pathname,t)===`/`?i.pathname=`${xt(t)}/_root.${r}`:i.pathname=`${xt(i.pathname)}.${r}`,i}async function Zn(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Qn(e){return e!=null&&typeof e.page==`string`}function $n(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function er(e,t,n){return ar((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Zn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter($n).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function tr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function nr(e,t,{includeHydrateFallback:n}={}){return rr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function rr(e){return[...new Set(e)]}function ir(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ar(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Qn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ir(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function or(){let e=N(Pt);return Yn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function sr(){let e=N(Ft);return Yn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var cr=k(void 0);cr.displayName=`FrameworkContext`;function lr(){let e=N(cr);return Yn(e,`You must render this element inside a <HydratedRouter> element`),e}function ur(e,t){let n=N(cr),[r,i]=z(!1),[a,o]=z(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=M(null);V(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),V(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:dr(s,p),onBlur:dr(c,m),onMouseEnter:dr(l,p),onMouseLeave:dr(u,m),onTouchStart:dr(d,p)}]:[a,f,{}]:[!1,f,{}]}function dr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function fr({page:e,...t}){let n=Lt(),{nonce:r}=lr(),{router:i}=or(),a=L(()=>Ke(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),P(n?mr:hr,{page:e,matches:a,...t})):null}function pr(e){let{manifest:t,routeModules:n}=lr(),[r,i]=z([]);return V(()=>{let r=!1;return er(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function mr({page:e,matches:t,...n}){let r=q(),{future:i}=lr(),{basename:a}=or();return P(O,null,L(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Xn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]).map(e=>P(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function hr({page:e,matches:t,...n}){let r=q(),{future:i,manifest:a,routeModules:o}=lr(),{basename:s}=or(),{loaderData:c,matches:l}=sr(),u=L(()=>tr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L(()=>tr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Xn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L(()=>nr(d,a),[d,a]),m=pr(d);return P(O,null,f.map(e=>P(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>P(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>P(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function gr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var _r=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{_r&&(window.__reactRouterVersion=`7.18.0`)}catch{}function vr({basename:e,children:t,useTransitions:n,window:r}){let i=M();i.current??=Re({window:r,v5Compat:!0});let a=i.current,[o,s]=z({action:a.action,location:a.location}),c=j(e=>{n===!1?s(e):he(()=>s(e))},[n]);return ge(()=>a.listen(c),[a,c]),P(On,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function yr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=z({action:n.action,location:n.location}),o=j(e=>{r===!1?a(e):he(()=>a(e))},[r]);return ge(()=>n.listen(o),[n,o]),P(On,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}yr.displayName=`unstable_HistoryRouter`;var br=Ce(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=N(G),v=typeof l==`string`&&Ne.test(l),y=kt(l,h);l=y.to;let b=Jt(l,{relative:r}),x=q(),S=null;if(o){let e=yt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:W([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=ur(n,p),E=Dr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let ee=!(y.isExternal||i),te=P(`a`,{...p,...T,href:(ee?S:void 0)||y.absoluteURL||b,onClick:ee?D:e,ref:gr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?P(O,null,te,P(fr,{page:b})):te});br.displayName=`Link`;var xr=Ce(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=rn(a,{relative:c.relative}),d=q(),f=N(Ft),{navigator:p,basename:m}=N(G),h=f!=null&&Rr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=pt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return P(br,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});xr.displayName=`NavLink`;var Sr=Ce(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=jn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=N(G),g=jr(),_=Mr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ne.test(s);return P(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?he(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Sr.displayName=`Form`;function Cr({getKey:e,storageKey:t,...n}){let r=N(cr),{basename:i}=N(G),a=q(),o=xn();Ir({getKey:e,storageKey:t});let s=L(()=>{if(!r||!e)return null;let t=Fr(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),P(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Jn(JSON.stringify(t||Nr))}, ${Jn(JSON.stringify(s))})`}})}Cr.displayName=`ScrollRestoration`;function wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tr(e){let t=N(Pt);return H(t,wr(e)),t}function Er(e){let t=N(Ft);return H(t,wr(e)),t}function Dr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Qt(),d=q(),f=rn(e,{relative:o});return j(p=>{if(Rn(p,t)){p.preventDefault();let t=n===void 0?He(d)===He(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?he(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Or(e){U(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M(zn(e)),n=M(!1),r=q(),i=L(()=>Bn(r.search,n.current?null:t.current),[r.search]),a=Qt();return[i,j((e,t)=>{let r=zn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var kr=0,Ar=()=>`__${String(++kr)}__`;function jr(){let{router:e}=Tr(`useSubmit`),{basename:t}=N(G),n=yn(),r=e.fetch,i=e.navigate;return j(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Gn(e,t);a.navigate===!1?await r(a.fetcherKey||Ar(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Mr(e,{relative:t}={}){let{basename:n}=N(G),r=N(K);H(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...rn(e||`.`,{relative:t})},o=q();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:W([n,a.pathname])),He(a)}var Nr=`react-router-scroll-positions`,Pr={};function Fr(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:pt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ir({getKey:e,storageKey:t}={}){let{router:n}=Tr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Er(`useScrollRestoration`),{basename:a}=N(G),o=q(),s=xn(),c=bn();V(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Lr(j(()=>{if(c.state===`idle`){let t=Fr(o,s,a,e);Pr[t]=window.scrollY}try{sessionStorage.setItem(t||Nr,JSON.stringify(Pr))}catch(e){U(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(ge(()=>{try{let e=sessionStorage.getItem(t||Nr);e&&(Pr=JSON.parse(e))}catch{}},[t]),ge(()=>{let t=n?.enableScrollRestoration(Pr,()=>window.scrollY,e?(t,n)=>Fr(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),ge(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{U(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Lr(e,t){let{capture:n}=t||{};V(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Rr(e,{relative:t}={}){let n=N(Rt);H(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Tr(`useViewTransitionState`),i=rn(e,{relative:t});if(!n.isTransitioning)return!1;let a=pt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=pt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lt(i.pathname,o)!=null||lt(i.pathname,a)!=null}var zr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Br=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vr=e=>{let t=Br(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ur=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Wr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};F();var Gr=Ce(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>P(`svg`,{ref:c,...Wr,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hr(`lucide`,i),...!a&&!Ur(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>P(e,t)),...Array.isArray(a)?a:[a]]));F();var X=(e,t)=>{let n=Ce(({className:n,...r},i)=>P(Gr,{ref:i,iconNode:t,className:Hr(`lucide-${zr(Vr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Vr(e),n},Kr=X(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),qr=X(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Jr=X(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Yr=X(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Xr=X(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Zr=X(`camera`,[[`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`,key:`1tc9qg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Qr=X(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),$r=X(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),ei=X(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ti=X(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ni=X(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ri=X(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ii=X(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ai=X(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),oi=X(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),si=X(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),ci=X(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),li=X(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ui=X(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),di=X(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),fi=X(`fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pi=X(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),mi=X(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),hi=X(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),gi=X(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),_i=X(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),vi=X(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),yi=X(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),bi=X(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),xi=X(`menu`,[[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 18h16`,key:`19g7jn`}],[`path`,{d:`M4 6h16`,key:`1o0s65`}]]),Si=X(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ci=X(`moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),wi=X(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ti=X(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Ei=X(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Di=X(`scan-face`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`path`,{d:`M9 9h.01`,key:`1q5me6`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}]]),Oi=X(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ki=X(`settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ai=X(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ji=X(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),Mi=X(`sliders-horizontal`,[[`line`,{x1:`21`,x2:`14`,y1:`4`,y2:`4`,key:`obuewd`}],[`line`,{x1:`10`,x2:`3`,y1:`4`,y2:`4`,key:`1q6298`}],[`line`,{x1:`21`,x2:`12`,y1:`12`,y2:`12`,key:`1iu8h1`}],[`line`,{x1:`8`,x2:`3`,y1:`12`,y2:`12`,key:`ntss68`}],[`line`,{x1:`21`,x2:`16`,y1:`20`,y2:`20`,key:`14d8ph`}],[`line`,{x1:`12`,x2:`3`,y1:`20`,y2:`20`,key:`m0wm8r`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`6`,key:`14e1ph`}],[`line`,{x1:`8`,x2:`8`,y1:`10`,y2:`14`,key:`1i6ji0`}],[`line`,{x1:`16`,x2:`16`,y1:`18`,y2:`22`,key:`1lctlv`}]]),Ni=X(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Pi=X(`sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Fi=X(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ii=X(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Li=X(`trash-2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Ri=X(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),zi=X(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Bi=X(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Vi=X(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]);F();function Hi({tabs:e,active:t,onChange:n}){return B(`div`,{className:`flex rounded-lg border border-border bg-surface p-0.5 gap-0.5`,children:e.map(e=>B(`button`,{type:`button`,onClick:()=>n(e.id),className:[`flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors`,t===e.id?`bg-primary/12 text-primary`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`].join(` `),children:e.label},e.id))})}function Ui(e){let t=e.formats;if(!t)return``;let n=Object.values(t).filter(e=>e!==void 0&&e.sizeMB>0).map(e=>e.sizeMB);if(n.length===0)return``;let r=Math.min(...n),i=Math.max(...n);return r===i?`${r} MB`:`${r}-${i} MB`}function Wi(e){return`${e.inputSize.width}x${e.inputSize.height}`}function Gi(e){return e.formats?Object.keys(e.formats).filter(t=>e.formats[t]!==void 0):[]}function Ki({entry:e,selected:t,onSelect:n,disabled:r}){let i=Ui(e),a=Wi(e),o=Gi(e);return I(`button`,{type:`button`,onClick:n,disabled:r,className:[`w-full text-left rounded-lg border p-3 transition-all`,t?`border-primary bg-primary/5 ring-1 ring-primary/30`:`border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50`,r?`opacity-50 cursor-not-allowed`:`cursor-pointer`].join(` `),children:[B(`div`,{className:`flex items-start justify-between gap-2`,children:I(`div`,{className:`flex-1 min-w-0`,children:[I(`div`,{className:`flex items-center gap-2`,children:[B(`span`,{className:`text-xs font-semibold text-foreground truncate`,children:e.name}),t&&B(ei,{className:`h-3.5 w-3.5 text-primary shrink-0`})]}),B(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.description})]})}),I(`div`,{className:`flex items-center gap-3 mt-2 flex-wrap`,children:[I(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-foreground-subtle`,children:[B(oi,{className:`h-3 w-3`}),a]}),i&&B(`span`,{className:`text-[10px] text-foreground-subtle`,children:i}),o.length>0&&B(`div`,{className:`flex gap-1`,children:o.map(e=>B(`span`,{className:`text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono`,children:e},e))}),e.labels.length>0&&I(`span`,{className:`text-[10px] text-foreground-subtle`,children:[e.labels.length,` label`,e.labels.length===1?``:`s`]})]})]})}function qi({field:e,value:t,onChange:n,disabled:r}){let i=e.catalog??[],a=i.length>0,o=Ee(i).length>0,s=e.allowCustomPath!==!1||e.allowCustom===!0,c=[...a?[{id:`catalog`,label:`Models (${i.length})`}]:[],...s?[{id:`custom`,label:`Custom Path`}]:[]],[l,u]=z(a?`catalog`:`custom`),d=t==null?``:String(t);return I(`div`,{className:`space-y-3`,children:[c.length>1&&B(Hi,{tabs:c,active:l,onChange:u}),l===`catalog`&&a&&o&&B(m,{catalog:i,value:d,onChange:e=>n(e),disabled:r||e.disabled}),l===`catalog`&&a&&!o&&B(`div`,{className:`space-y-1.5 max-h-[320px] overflow-y-auto pr-1`,children:i.filter(e=>e.legacy!==!0).map(t=>B(Ki,{entry:t,selected:d===t.id,onSelect:()=>n(t.id),disabled:r||e.disabled},t.id))}),l===`catalog`&&!a&&I(`div`,{className:`rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2`,children:[B(gi,{className:`h-3.5 w-3.5 text-info shrink-0 mt-0.5`}),B(`p`,{className:`text-[11px] text-foreground-subtle leading-relaxed`,children:`No predefined models available. Use the Custom Path tab to specify a model file path or URL.`})]}),l===`custom`&&s&&I(`div`,{className:`space-y-2`,children:[B(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50`,placeholder:`Enter path like /data/models/custom.onnx or https://...`,value:d,disabled:r||e.disabled,onChange:e=>n(e.target.value)}),e.acceptFormats&&e.acceptFormats.length>0&&I(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Accepted formats: `,e.acceptFormats.join(`, `)]})]}),(e.compatibilityNote||e.conversionGuideUrl)&&I(`div`,{className:`flex items-start justify-between gap-3 pt-1`,children:[e.compatibilityNote&&I(`p`,{className:`flex items-start gap-1 text-[10px] text-foreground-subtle`,children:[B(gi,{className:`h-3 w-3 mt-0.5 shrink-0`}),e.compatibilityNote]}),e.conversionGuideUrl&&I(`a`,{href:e.conversionGuideUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-[11px] text-primary hover:underline shrink-0`,children:[`How to convert your model`,B(ci,{className:`h-3 w-3`})]})]})]})}function Ji(e){let t=ke();return be({queryKey:[`field-resolver`,e?.capName??`<none>`,e?.methodName??`<none>`,e?.input??{}],enabled:!!e,queryFn:async()=>{if(!e)throw Error(`useFieldResolver: resolver is null (enabled guard should have prevented this)`);let n=e=>e!==null&&(typeof e==`object`||typeof e==`function`),r=Reflect.get(t.trpcClient,e.capName);if(!n(r))throw Error(`useFieldResolver: no cap namespace '${e.capName}' on the tRPC client`);let i=Reflect.get(r,e.methodName);if(!n(i))throw Error(`useFieldResolver: no method '${e.methodName}' on cap '${e.capName}'`);let a=Reflect.get(i,`query`);if(typeof a!=`function`)throw Error(`useFieldResolver: '${e.capName}.${e.methodName}' has no .query() (resolvers must be query methods, not mutations)`);return await a(e.input??{})}})}F();function Yi(e){return typeof e==`string`&&e.length>0&&e!==`undefined`&&e!==`null`}function Xi(e={}){let t=we(),n=le(void 0,{enabled:e.enabled??!0}),r=L(()=>(n.data??[]).filter(e=>Yi(e.nodeId)),[n.data]),i=j(()=>{t.invalidateQueries({queryKey:[`pipelineOrchestrator`,`listAgentSettings`]})},[t]);return{agents:r,isLoading:n.isLoading,isError:n.isError,error:n.error,refetch:()=>{n.refetch()},invalidate:i}}F();function Zi({field:e,disabled:t}){let n=we(),r=e.deviceId,i=Ji(e.catalogResolver),a=ce({deviceId:r}),o=ae({onSuccess:()=>{n.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getCameraSettings`]]}),n.invalidateQueries({queryKey:[[`deviceManager`]]})}}),s=i.data,c=a.data??null,l=L(()=>s?na(s,c):[],[s,c]),u=L(()=>{if(!s)return{};let e={};for(let t of s.slots)for(let n of t.addons)e[n.id]=n.enabledByDefault??!0;return e},[s]);return i.error?I(`div`,{className:`text-xs text-red-400`,children:[`Failed to load pipeline catalog for `,B(`code`,{children:e.nodeId}),`:`,` `,String(i.error.message??i.error)]}):i.isLoading||!s?I(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:[`Loading pipeline for `,e.nodeId,`…`]}):I(`div`,{className:`col-span-full space-y-4`,children:[I(`div`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Agent: `,B(`span`,{className:`text-foreground`,children:e.nodeId}),I(`span`,{className:`ml-2`,children:[`Engine:`,` `,B(`span`,{className:`text-foreground font-mono`,children:`${s.selectedEngine.runtime}/${s.selectedEngine.backend}`})]}),I(`span`,{className:`ml-auto text-[10px]`,children:[`Model + settings edited on Pipeline → `,e.nodeId,`.`]})]}),B(w,{schema:s,steps:l,onChange:()=>{},templates:[],selectedTemplateId:null,onSelectTemplate:()=>{},onSaveTemplate:()=>{},onUpdateTemplate:()=>{},onDeleteTemplate:()=>{},readOnly:t===!0,hideTemplates:!0,toggleMode:`threeState`,hideModelAndSettings:!0,overrides:c?.stepToggles??{},onOverrideChange:(e,t)=>o.mutate({deviceId:r,addonId:e,enabled:t}),inheritedEnabledByAddon:u}),B(ta,{deviceId:r,currentAgentNodeId:e.nodeId,catalog:s,pipelineByAgent:ea(c?.pipelineByAgent,s),disabled:t===!0})]})}function Qi(e,t){for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e.defaultModelId}function $i(e,t){return e?{modelId:e.modelId??Qi(t,`audio-classifier`)??``,enabled:e.enabled}:null}function ea(e,t){let n={};for(let[r,i]of Object.entries(e??{}))n[r]={steps:i.steps,audio:$i(i.audio,t)};return n}function ta({deviceId:e,currentAgentNodeId:t,catalog:n,pipelineByAgent:r,disabled:i}){let a=we(),[o,s]=z(!1),[l,u]=z(t),{agents:d}=Xi({enabled:o}),f=S({deviceId:e,agentNodeId:l},{enabled:o}),p=c({onSuccess:()=>{a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getCameraSettings`]]}),a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`resolvePipeline`]]})}}),m=r[l]??null,h=d,g=L(()=>m?ra(m.steps,n):[],[m,n]);return I(`section`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[I(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`w-full px-4 py-2 flex items-center gap-2 hover:bg-surface-hover`,children:[B(o?ti:ri,{className:`h-3 w-3`}),B(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wide`,children:`Advanced — custom pipeline per agent`}),B(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:Object.keys(r).length>0?`${Object.keys(r).length} override(s) active`:`None configured`})]}),o&&I(`div`,{className:`border-t border-border px-4 py-3 space-y-3`,children:[I(`div`,{className:`flex items-center gap-2 text-xs`,children:[B(`span`,{className:`text-foreground-subtle`,children:`Agent:`}),I(`select`,{value:l,disabled:i,onChange:e=>u(e.target.value),className:`rounded border border-border bg-surface-hover px-2 py-1 text-xs text-foreground focus:outline-none focus:border-primary`,children:[typeof t==`string`&&t.length>0&&t!==`undefined`&&I(`option`,{value:t,children:[t,` (current)`]}),h.filter(e=>e.nodeId!==t).map(e=>B(`option`,{value:e.nodeId,children:e.nodeId},e.nodeId))]}),r[l]&&I(`button`,{type:`button`,onClick:()=>{window.confirm(`Remove custom pipeline override for ${l}? The camera will revert to the agent default + step toggles.`)&&p.mutate({deviceId:e,agentNodeId:l,pipeline:null})},disabled:i||p.isPending,className:`ml-auto inline-flex items-center gap-1 px-2 py-1 text-[11px] text-red-400 hover:bg-red-500/10 rounded disabled:opacity-50`,children:[B(Li,{className:`h-3 w-3`}),`Remove override`]})]}),m?B(w,{schema:n,steps:g,onChange:t=>{let n=m?.audio??null;p.mutate({deviceId:e,agentNodeId:l,pipeline:{steps:ia(t),audio:n?{modelId:n.modelId,enabled:n.enabled}:null}})},templates:[],selectedTemplateId:null,onSelectTemplate:()=>{},onSaveTemplate:()=>{},onUpdateTemplate:()=>{},onDeleteTemplate:()=>{},readOnly:i,hideTemplates:!0,allowAutoModel:!0}):I(`div`,{className:`text-xs text-foreground-subtle space-y-2`,children:[I(`p`,{children:[`No custom pipeline for `,B(`code`,{children:l}),`. The camera uses the agent's default + step toggles.`]}),B(`button`,{type:`button`,onClick:()=>{let t=f.data;t&&p.mutate({deviceId:e,agentNodeId:l,pipeline:{steps:t.steps,audio:$i(t.audio,n)}})},disabled:i||p.isPending||!f.data,className:`inline-flex items-center gap-1 px-3 py-1.5 text-xs font-medium rounded bg-primary/15 text-primary hover:bg-primary/25 disabled:opacity-50`,children:`Create wholesale override from current default`})]})]})]})}function na(e,t){let n=t=>{for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e;return null},r=e=>{let n=e.enabledByDefault??!0,r=t?.stepToggles?.[e.id],i=r===void 0?n:r;return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:i,modelId:e.defaultModelId,children:[]}},i=new Map;for(let t of e.slots)for(let e of t.addons)i.set(e.id,r(e));let a=[],o=new Set;for(let[e,t]of i){let r=n(e);r&&r.inputClasses.length===0&&(a.push(t),o.add(e))}let s=!0;for(;s;){s=!1;for(let[e,t]of i){if(o.has(e))continue;let r=n(e);if(r)for(let[a,c]of i){if(a===e)continue;let i=n(a);if(i&&o.has(a)&&i.outputClasses.some(e=>r.inputClasses.includes(e))){c.children.push(t),o.add(e),s=!0;break}}}}return a}function ra(e,t){let n=new Map;for(let e of t.slots)for(let t of e.addons)n.set(t.id,t);let r=e=>{let t=n.get(e.addonId);return{addonId:e.addonId,addonName:t?.name??e.addonId,slot:t?.slot??`detector`,inputClasses:t?.inputClasses?[...t.inputClasses]:[],outputClasses:t?.outputClasses?[...t.outputClasses]:[],enabled:e.enabled,modelId:e.modelId??``,children:(e.children??[]).map(r),...e.settings?{settings:{...e.settings}}:{}}};return[...e].map(r)}function ia(e){let t=e=>({addonId:e.addonId,...e.modelId?{modelId:e.modelId}:{},enabled:e.enabled,children:e.children.map(t),...e.settings?{settings:{...e.settings}}:{}});return e.map(t)}F();function aa(){let e=ke(),t=we(),[n,r]=z(()=>e.isConnected()?`connected`:`disconnected`),i=M(!1),[a,o]=z(0),[s,c]=z([]);V(()=>e.subscribeConnectionEvents(e=>{r(t=>(t!==`connected`&&e===`connected`&&i.current&&o(e=>e+1),e!==`connected`&&(i.current=!0),e))}),[e]),V(()=>{a!==0&&t.invalidateQueries({queryKey:[[`addons`,`getLastRestart`]]})},[a,t]);let{data:l}=E(void 0,{enabled:n===`connected`&&a>0,staleTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),u=M(null);return V(()=>{if(l==null||l.requestedAt===u.current)return;u.current=l.requestedAt;let e=sa(l);c(t=>[...t,e]);let t=window.setTimeout(()=>{c(t=>t.filter(t=>t.id!==e.id))},6e3);return()=>window.clearTimeout(t)},[l]),B(xe,{children:s.length>0&&B(oa,{toasts:s})})}function oa({toasts:e}){return B(`div`,{className:`fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>I(`div`,{className:`pointer-events-auto flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm`,children:[B(ai,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),I(`div`,{children:[B(`div`,{className:`text-[11px] font-semibold text-foreground`,children:e.title}),B(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:e.message})]})]},e.id))})}function sa(e){let t=`restart-${e.requestedAt}`;if(e.kind===`framework-update`&&e.packageName!==void 0&&e.toVersion!==void 0){let n=e.fromVersion===void 0?`v${e.toVersion}`:`v${e.fromVersion} → v${e.toVersion}`;return{id:t,title:`Framework updated`,message:`${e.packageName} is now ${n}.`}}return{id:t,title:`Server restarted`,message:e.requestedBy===void 0?`Manual restart completed.`:`Manual restart by ${e.requestedBy} completed.`}}F();var ca={info:{bg:`bg-blue-500/10`,border:`border-blue-500/30`,icon:gi},warning:{bg:`bg-orange-500/10`,border:`border-orange-500/30`,icon:Ri},critical:{bg:`bg-red-500/10`,border:`border-red-500/30`,icon:ii}};function la({toast:e,onDismiss:t}){let n=ca[e.severity]??ca.info,r=n.icon;return V(()=>{let n=e.duration??5e3;if(n<=0)return;let r=setTimeout(()=>t(e.id),n);return()=>clearTimeout(r)},[e.id,e.duration,t]),I(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${n.border} ${n.bg} shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:[B(r,{className:`h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle`}),I(`div`,{className:`flex-1 min-w-0`,children:[B(`div`,{className:`text-xs font-semibold text-foreground`,children:e.title}),B(`div`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:e.message})]}),B(`button`,{type:`button`,onClick:()=>t(e.id),className:`shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors`,children:B(Bi,{className:`h-3.5 w-3.5 text-foreground-subtle`})})]})}function ua(){let[e,t]=z([]),n=j(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return te(void 0,{onData:e=>{let n=e,r=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;t(e=>[...e,{...n,id:r,timestamp:Date.now()}])}}),e.length===0?null:B(`div`,{className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>B(`div`,{className:`pointer-events-auto`,children:B(la,{toast:e,onDismiss:n})},e.id))})}function da(e){return e.hubReachable?e.authOk===!1?{kind:`auth-expired`}:{kind:`cluster-degraded`,offlineAgents:e.offlineAgents,offlineAgentIds:e.offlineAgentIds}:{kind:`hub-unreachable`}}function fa(e){switch(e.kind){case`connected`:return null;case`reconnecting`:return{severity:`warning`,message:`Reconnecting…`,i18nKey:`connection.reconnecting`,showSpinner:!0};case`cluster-degraded`:{let t=e.offlineAgentIds??[];return t.length>0?{severity:`warning`,message:`Cluster degraded — ${t.length===1?`node ${t[0]}`:`nodes ${t.join(`, `)}`} not responding. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedNodes`,i18nParams:{nodes:t.join(`, `),count:t.length},showSpinner:!0}:e.offlineAgents!==null&&e.offlineAgents>0?{severity:`warning`,message:`Cluster degraded — ${e.offlineAgents} cluster node${e.offlineAgents===1?``:`s`} offline. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedCount`,i18nParams:{count:e.offlineAgents},showSpinner:!0}:{severity:`warning`,message:`Live connection interrupted — hub is online (a cluster node may be unresponsive), re-establishing…`,i18nKey:`connection.degraded`,showSpinner:!0}}case`hub-unreachable`:return{severity:`danger`,message:`Server unreachable — reconnecting…`,i18nKey:`connection.disconnected`,showSpinner:!0};case`auth-expired`:return{severity:`danger`,message:`Session expired — please sign in again.`,i18nKey:`connection.sessionExpired`,showSpinner:!1,action:`sign-in`}}}var pa=4e3,ma=5e3;function ha(e){if(typeof e!=`object`||!e)return{offline:null,offlineIds:null,ok:null};let t={...e},n=typeof t.ok==`boolean`?t.ok:null,r=t.agents;if(typeof r!=`object`||!r)return{offline:null,offlineIds:null,ok:n};let i={...r},a=i.offline,o=typeof a==`number`?a:null,s=i.offlineIds;return{offline:o,offlineIds:Array.isArray(s)?s.filter(e=>typeof e==`string`):null,ok:n}}async function ga(e,t,n,r){let i=new AbortController,a=setTimeout(()=>i.abort(),n);try{return await e(t,{method:`GET`,signal:i.signal,credentials:`omit`,...r===void 0?{}:{headers:r}})}finally{clearTimeout(a)}}async function _a(e){let t=e.fetchFn??fetch,n=e.timeoutMs??pa,r=e.origin.replace(/\/+$/,``),i;try{i=await ga(t,`${r}/health`,n)}catch{return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null}}if(!i.ok)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let a=null,o=e.getToken();if(o!==null&&o!==``)try{let e=await ga(t,`${r}/health/details`,n,{Authorization:`Bearer ${o}`});e.ok&&(a=await e.json())}catch{}let s;try{s=ha(a??await i.json())}catch{s={offline:null,offlineIds:null,ok:null}}if(s.ok===!1)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let c=e.getToken(),l=`unknown`;if(c!==null&&c!==``)try{let e=await ga(t,`${r}/trpc/auth.me`,n,{Authorization:`Bearer ${c}`});e.status===401||e.status===403?l=!1:e.ok&&(l=!0)}catch{l=`unknown`}return{hubReachable:!0,authOk:l,offlineAgents:s.offline,offlineAgentIds:s.offlineIds}}var va={kind:`connected`},ya={kind:`reconnecting`};function ba(e){let t=e.probeIntervalMs??ma,n=new Set,r=va,i=0,a=!1,o=null;function s(e){if(r!==e){r=e;for(let e of n)e()}}function c(){a=!1,o!==null&&(clearTimeout(o),o=null)}function l(){let n=i;e.probe().then(e=>{n!==i||!a||(s(da(e)),o=setTimeout(l,t))},()=>{n!==i||!a||(s({kind:`hub-unreachable`}),o=setTimeout(l,t))})}function u(e){if(i+=1,e===`connected`){c(),s(va);return}if(e===`connecting`){c(),s(ya);return}(r.kind===`connected`||r.kind===`reconnecting`)&&s(ya),o!==null&&(clearTimeout(o),o=null),a=!0,l()}return{getSnapshot:()=>r,subscribe:e=>(n.add(e),()=>{n.delete(e)}),onSdkConnectionState:u,dispose:()=>{i+=1,c(),n.clear()}}}var xa=null;function Sa(){return xa===null&&(xa=ba({probe:()=>_a({origin:window.location.origin,getToken:()=>localStorage.getItem(`camstack_admin_token`)})})),xa}function Ca(e){Sa().onSdkConnectionState(e)}var wa=null;function Ta(){if(!wa){let e=window.location.origin;wa=b({serverUrl:e,token:localStorage.getItem(`camstack_admin_token`)??void 0,onConnectionChange:e=>Ca(e)})}return wa}function Ea(){wa?.close(),wa=null}function Da(e){try{let t=e.split(`.`);if(t.length<2||!t[1])return null;let n=JSON.parse(atob(t[1]));return{id:String(n.userId??``),username:String(n.username??`unknown`),isAdmin:!!n.isAdmin,exp:Number(n.exp??0),scopes:Aa(n.scopes)}}catch{return null}}var Oa=new Set([`view`,`create`,`delete`]),ka=new Set([`category`,`capability`,`addon`,`device`]);function Aa(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n,{type:r,access:i}=e;if(typeof r!=`string`||!ka.has(r)||!Array.isArray(i))continue;let a=i.filter(e=>typeof e==`string`&&Oa.has(e));if(a.length===0)continue;if(r===`device`){let n=e.targets;if(!Array.isArray(n))continue;let r=n.filter(e=>typeof e==`string`&&e.length>0);if(r.length===0)continue;t.push({type:`device`,targets:r,access:a});continue}let o=e.target;if(typeof o==`string`)if(r===`category`){if(o!==`device`&&o!==`system`)continue;t.push({type:r,target:o,access:a})}else r===`capability`?t.push({type:r,target:o,access:a}):t.push({type:`addon`,target:o,access:a})}return t}function ja(e){let t=Da(e);return t?t.exp*1e3<Date.now():!0}var Ma=[`camstack://auth-callback`,`camstack.dev://auth-callback`],Na=512;function Pa(e){return e.replace(/^([a-z][a-z0-9.+-]*):\/\/\/(?!\/)/i,`$1://`).replace(/\/$/,``)}function Fa(e){if(!e||e.length>Na)return null;let t=Pa(e);return Ma.includes(t)?{kind:`app-callback`,url:t}:!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||e.includes(`://`)||e.includes(`..`)||e===`/login`||e.startsWith(`/login?`)||e.startsWith(`/login/`)?null:{kind:`path`,path:e}}function Ia(e,t){return`${e}?code=${encodeURIComponent(t)}`}function La(e,t=Date.now()){return Ha(t)??Fa(e)}var Ra=`camstack:login-redirect`,za=10*6e4;function Ba(){if(typeof window>`u`)return null;try{return window.sessionStorage}catch{return null}}function Va(e,t=Date.now()){let n=Ba();if(!n||!Fa(e))return;let r={raw:e??``,at:t};try{n.setItem(Ra,JSON.stringify(r))}catch{}}function Ha(e=Date.now()){let t=Ba();if(!t)return null;let n=null;try{n=t.getItem(Ra),t.removeItem(Ra)}catch{return null}if(!n)return null;try{let t=JSON.parse(n);if(typeof t!=`object`||!t)return null;let r=Reflect.get(t,`at`),i=Reflect.get(t,`raw`);return typeof r!=`number`||typeof i!=`string`||e-r>za?null:Fa(i)}catch{return null}}F();var Ua=`changeme`;async function Wa(e){await fetch(`/api/auth/session`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:e})}).catch(()=>{})}async function Ga(e,t){if(await Wa(e),t.kind===`path`){window.location.replace(t.path);return}try{Ea();let{code:e}=await Ta().trpcClient.auth.createHandoffCode.mutate();window.location.replace(Ia(t.url,e))}catch{window.location.replace(`/admin`)}}var Ka=k(null);function qa({children:e}){let[t,n]=z(null),[r,i]=z(!0),[a,o]=z(!1);V(()=>{if(typeof window<`u`&&window.location.hash.startsWith(`#token=`)){let e=new URLSearchParams(window.location.hash.slice(1)).get(`token`);if(e){localStorage.setItem(`camstack_admin_token`,e);let t=Ha();if(t){Ga(e,t);return}window.history.replaceState({},``,`/admin`)}}let e=localStorage.getItem(`camstack_admin_token`);if(!e){i(!1);return}if(ja(e)){localStorage.removeItem(`camstack_admin_token`),i(!1);return}let t=Da(e);if(!t){localStorage.removeItem(`camstack_admin_token`),i(!1);return}Ta().trpcClient.system.info.query().then(()=>n(t)).catch(e=>{let r=e?.data?.code;r===`UNAUTHORIZED`||r===`FORBIDDEN`?(localStorage.removeItem(`camstack_admin_token`),Ea()):n(t)}).finally(()=>i(!1))},[]);let s=j(async(e,t)=>{let r=await Ta().login(e,t),i=r.secondFactors??(r.requiresTotp===!0?[`totp`]:[]);if(i.length>0)return{kind:`second-factor`,challengeToken:r.token,factors:i};let a=r.token;return localStorage.setItem(`camstack_admin_token`,a),await Wa(a),Ea(),n(Da(a)),o(t===Ua),{kind:`ok`}},[]),c=j(async(e,t)=>{let r=(await Ta().loginVerifyTotp(e,t)).token;localStorage.setItem(`camstack_admin_token`,r),await Wa(r),Ea(),n(Da(r)),o(!1)},[]),l=j(async e=>{localStorage.setItem(`camstack_admin_token`,e),await Wa(e),Ea(),n(Da(e)),o(!1)},[]),u=j(()=>{localStorage.removeItem(`camstack_admin_token`),fetch(`/api/auth/session`,{method:`DELETE`}).catch(()=>{}),Ea(),n(null),o(!1)},[]),d=j(()=>{o(!1)},[]);return B(Ka.Provider,{value:{user:t,loading:r,mustChangePassword:a,login:s,verifyTotp:c,finalizePasskeyLogin:l,logout:u,clearMustChangePassword:d},children:e})}function Ja(){let e=N(Ka);if(!e)throw Error(`useAuth must be used within AuthProvider`);return e}F();var Ya=3e4;function Xa(e){let t=M(e);t.current=e,V(()=>{let e=null,n=()=>{if(document.visibilityState===`hidden`){e=Date.now();return}if(document.visibilityState===`visible`&&e!==null){let n=Date.now()-e;e=null,n>=Ya&&t.current()}},r=()=>{t.current()},i=e=>{e.persisted&&t.current()};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`online`,r),window.addEventListener(`pageshow`,i),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`online`,r),window.removeEventListener(`pageshow`,i)}},[])}F();function Za(e){let t=new Set,n=new Set,r=e=>e.page.remoteName.includes(e.addonId.replace(/[^a-zA-Z0-9]+/g,`_`)),i=[...e.filter(r),...e.filter(e=>!r(e))],a=[];for(let e of i){let r=`${e.addonId}::${e.page.id}`;t.has(r)||n.has(e.page.path)||(t.add(r),n.add(e.page.path),a.push({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,remoteName:e.page.remoteName,bundle:e.page.bundle,bundleUrl:e.bundleUrl,...e.page.section===void 0?{}:{section:e.page.section},...e.page.sectionLabel===void 0?{}:{sectionLabel:e.page.sectionLabel}}))}return a}var Qa=new Map,$a=new Map,eo=new Set;function to(e){return!e||typeof e!=`object`?!1:typeof e.default==`function`}async function no(e,t){let i=Qa.get(e);if(i)return i;let a=$a.get(e);if(a)return a;eo.has(e)||(ue(),r([{name:e,entry:t,type:`module`}],{force:!1}),eo.add(e));let o=n(`${e}/page`).then(n=>{if(!to(n))throw Error(`Addon page remote ${e} (${t}) does not expose a default React component on './page'`);return Qa.set(e,n.default),$a.delete(e),n.default}).catch(t=>{throw $a.delete(e),t});return $a.set(e,o),o}function ro(){let{pagePath:e}=nn(),t=ke(),{data:n}=ee(void 0),r=L(()=>n?Za(n):void 0,[n]),i=r?.find(t=>t.path===`/addon/${e}`),[a,o]=z(null),[s,c]=z(null);return V(()=>{if(!i)return;c(null),o(null);let e=!1;return no(i.remoteName,i.bundleUrl).then(t=>{e||o(()=>t)}).catch(t=>{e||c(`Failed to load addon page: ${t instanceof Error?t.message:String(t)}`)}),()=>{e=!0}},[i]),r?i?s?B(`div`,{className:`flex items-center justify-center h-full text-red-400 text-sm`,children:s}):a?B(a,{trpc:t.trpcClient,theme:{isDark:document.documentElement.classList.contains(`dark`)},navigate:e=>{window.location.href=e}}):B(`div`,{className:`flex items-center justify-center h-full`,children:B(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})}):B(`div`,{className:`flex items-center justify-center h-full text-foreground-subtle`,children:`Addon page not found`}):B(`div`,{className:`flex items-center justify-center h-full`,children:B(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})})}Ae();var Z=e=>typeof e==`string`,io=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ao=e=>e==null?``:String(e),oo=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},so=/###/g,co=e=>e&&e.includes(`###`)?e.replace(so,`.`):e,lo=e=>!e||Z(e),uo=(e,t,n)=>{let r=Z(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(lo(e))return{};let t=co(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return lo(e)?{}:{obj:e,k:co(r[i])}},fo=(e,t,n)=>{let{obj:r,k:i}=uo(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=uo(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=uo(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},po=(e,t,n,r)=>{let{obj:i,k:a}=uo(e,t,Object);i[a]=i[a]||[],i[a].push(n)},mo=(e,t)=>{let{obj:n,k:r}=uo(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ho=(e,t,n)=>{let r=mo(e,n);return r===void 0?mo(t,n):r},go=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Z(e[r])||e[r]instanceof String||Z(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):go(e[r],t[r],n):e[r]=t[r]);return e},_o=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),vo={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},yo=e=>Z(e)?e.replace(/[&<>"'\/]/g,e=>vo[e]):e,bo=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},xo=[` `,`,`,`?`,`!`,`;`],So=new bo(20),Co=(e,t,n)=>{t||=``,n||=``;let r=xo.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=So.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},wo=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},To=e=>e?.replace(/_/g,`-`),Eo={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Do=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Eo,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>Z(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),Z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Oo=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ko=class extends Oo{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Z(n)&&i?o.push(...n.split(i)):o.push(n)));let s=mo(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Z(n)?s:wo(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),fo(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Z(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=mo(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?go(s,n,i):s={...s,...n},fo(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Ao={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},jo=Symbol(`i18next/PATH_KEY`);function Mo(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===jo?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function No(e,t){let{[jo]:n}=e(Mo()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Po=e=>!Z(e)&&typeof e!=`boolean`&&typeof e!=`number`,Fo=class e extends Oo{constructor(e,t={}){super(),oo([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Do.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Po(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Co(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Z(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Z(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=No(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?No(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Z(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=Po(E),ee=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(ee)&&!(Z(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Po(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Z(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Z(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Z(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Ao.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Z(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?No(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Z(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Z(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Z(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},Io=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Do.create(`languageUtils`)}getScriptPartFromCode(e){if(e=To(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=To(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Z(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Z(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Z(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},Lo={zero:0,one:1,two:2,few:3,many:4,other:5},Ro={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},zo=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Do.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=To(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Ro;if(!e.match(/-|_/))return Ro;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Lo[e]-Lo[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Bo=(e,t,n,r=`.`,i=!0)=>{let a=ho(e,t,n);return!a&&i&&Z(n)&&(a=wo(e,n,r),a===void 0&&(a=wo(t,n,r))),a},Vo=e=>e.replace(/\$/g,`$$$$`),Ho=class{constructor(e={}){this.logger=Do.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?yo:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?_o(i):a||`{{`,this.suffix=o?_o(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?_o(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?_o(l):``,this.nestingPrefix=d?_o(d):f||_o(`$t(`),this.nestingSuffix=p?_o(p):m||_o(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Bo(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Bo(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Vo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Vo(this.escape(e)):Vo(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Z(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !Z(a)&&!this.useRawValueToEscape&&(a=ao(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${_o(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Z(i))return i;Z(i)||(i=ao(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Uo=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Wo=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(To(r),i),t[o]=s),s(n)}},Go=e=>(t,n,r)=>e(To(n),r)(t),Ko=class{constructor(e={}){this.logger=Do.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Wo:Go;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Wo(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Uo(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},qo=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Jo=class extends Oo{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Do.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{po(n.loaded,[i],a),qo(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Z(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Yo=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Xo=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Zo=()=>{},Qo=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Q=class e extends Oo{constructor(e={},t){if(super(),this.options=Xo(e),this.services={},this.logger=Do,this.modules={external:[]},Qo(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Z(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Yo();this.options={...n,...this.options,...Xo(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),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Do.init(r(this.modules.logger),this.options):Do.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ko;let t=new Io(this.options);this.store=new ko(this.options.resources,this.options);let n=this.services;n.logger=Do,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new zo(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Ho(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Jo(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Fo(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Zo,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=io(),a=()=>{let e=(e,n)=>{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),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Zo){let n=t,r=Z(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=io();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Zo,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw 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`&&Ao.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=io();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Z(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Z(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=No(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=No(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=No(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return Z(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=io();return this.options.ns?(Z(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=io();Z(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Io(Yo());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Zo){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ko(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Yo().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ho(n)}return a.translator=new Fo(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,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}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var $o=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);os(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},es={},ts=(e,t,n,r)=>{os(n)&&es[n]||(os(n)&&(es[n]=new Date),$o(e,t,n,r))},ns=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},rs=(e,t,n)=>{e.loadNamespaces(t,ns(e,n))},is=(e,t,n,r)=>{if(os(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return rs(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,ns(e,r))},as=(e,t,n={})=>!t.languages||!t.languages.length?(ts(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),os=e=>typeof e==`string`,ss=e=>typeof e==`object`&&!!e,cs=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ls={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},us=e=>ls[e],ds={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(cs,us),transDefaultProps:void 0},fs=(e={})=>{ds={...ds,...e}},ps=()=>ds,ms,hs=e=>{ms=e},gs=()=>ms,_s={type:`3rdParty`,init(e){fs(e.options.react),hs(e)}};F();var vs=k(),ys=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},bs=t((t=>{var n=(F(),e(ye));function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),xs=t(((e,t)=>{t.exports=bs()}));F();var Ss=xs(),Cs={t:(e,t)=>{if(os(t))return t;if(ss(t)&&os(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},ws=()=>()=>{},Ts=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=N(vs)||{},a=n||r||gs();a&&!a.reportNamespaces&&(a.reportNamespaces=new ys),a||ts(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=L(()=>({...ps(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=os(l)?[l]:l||[`translation`],d=L(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=M(0),p=j(e=>{if(!a)return ws;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=M(),h=j(()=>{if(!a)return Cs;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>as(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=z(0),{t:v,ready:y}=(0,Ss.useSyncExternalStore)(p,h,h);V(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?is(a,t.lng,d,e):rs(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=M(null),S=M(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=L(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(ts(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?is(a,t.lng,d,n):rs(a,d,n)});return w};F();var Es={info:gi,success:ai,warning:Ri,error:ii},Ds={info:`text-blue-400`,success:`text-green-400`,warning:`text-amber-400`,error:`text-red-400`},Os={active:`border-l-blue-400`,"in-progress":`border-l-amber-400`,completed:`border-l-green-400`,failed:`border-l-red-400`,dismissed:`border-l-foreground-subtle/30`};function ks(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${String(n)}m ago`;let r=Math.floor(n/60);if(r<24)return`${String(r)}h ago`;let i=Math.floor(r/24);return`${String(i)}d ago`}function As({alert:e,onMarkRead:t,onDismiss:n}){let r=e.severity in Es?e.severity:`info`,i=e.status in Os?e.status:`active`,a=Es[r],o=Ds[r],s=Os[i];return I(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 border-l-2 ${s} ${e.read?`opacity-60`:``} hover:bg-surface-hover transition-colors`,children:[B(a,{className:`h-3.5 w-3.5 shrink-0 mt-0.5 ${o}`}),I(`div`,{className:`flex-1 min-w-0`,children:[I(`div`,{className:`flex items-center gap-1.5`,children:[B(`span`,{className:`text-[11px] font-semibold ${e.read?`text-foreground-subtle`:`text-foreground`}`,children:e.title}),!e.read&&B(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary shrink-0`})]}),B(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.message}),e.status===`in-progress`&&e.progress!==void 0&&I(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[B(`div`,{className:`flex-1 h-1 bg-surface-hover rounded-full overflow-hidden`,children:B(`div`,{className:`h-full bg-primary rounded-full transition-all duration-300`,style:{width:`${String(Math.min(100,Math.max(0,e.progress)))}%`}})}),I(`span`,{className:`text-[9px] text-foreground-subtle font-mono shrink-0`,children:[String(Math.round(e.progress)),`%`]})]}),B(`div`,{className:`text-[9px] text-foreground-subtle/60 mt-1`,children:ks(e.updatedAt)})]}),I(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!e.read&&B(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:`Mark as read`,children:B(ei,{className:`h-3 w-3 text-foreground-subtle`})}),e.status!==`in-progress`&&B(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),n(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:`Dismiss`,children:B(Bi,{className:`h-3 w-3 text-foreground-subtle`})})]})]})}function js({variant:e=`icon`,compact:t=!1}={}){let[n,r]=z(!1),[i,a]=z(!1),o=M(null),s=M(null),c=we(),{data:u=0}=l(void 0,{refetchInterval:3e4}),{data:d=[],isLoading:f}=p({limit:50},{enabled:n}),m=i?d:d.filter(e=>!e.read),h=d.filter(e=>e.read).length,_=()=>{c.invalidateQueries({queryKey:[[`alerts`]]})},v=x({onSuccess:_}),b=g({onSuccess:_}),S=y({onSuccess:_});T(`alert.created`,()=>{c.invalidateQueries({queryKey:[[`alerts`]]})}),T(`alert.updated`,()=>{c.invalidateQueries({queryKey:[[`alerts`]]})}),V(()=>{if(!n)return;let e=e=>{let t=e.target;o.current&&!o.current.contains(t)&&s.current&&!s.current.contains(t)&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[n]);let C=j(e=>{v.mutate({alertId:e})},[v]),w=j(e=>{e&&S.mutate({alertId:e})},[S]),E=j(()=>{b.mutate(void 0),r(!1)},[b]),D=m.filter(e=>e.status===`in-progress`),ee=m.filter(e=>e.status!==`in-progress`),[te,ne]=z({}),re=j(()=>{let e=s.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=Math.min(320,n-16),a=t.left;a+i>n-8&&(a=n-8-i),a<8&&(a=8);let o=r-t.bottom,c=t.top,l={position:`fixed`,left:a,width:i,zIndex:9999};o>=c?(l.top=t.bottom+4,l.maxHeight=Math.max(160,o-8-4)):(l.bottom=r-t.top+4,l.maxHeight=Math.max(160,c-8-4)),ne(l)},[]);return V(()=>{if(!n)return;re();let e=()=>re();return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[n,re]),I(`div`,{children:[e===`sidebar`?I(`button`,{ref:s,type:`button`,onClick:()=>r(!n),className:`flex w-full items-center gap-2.5 rounded-md ${t?`justify-center px-0 py-2`:`px-2.5 py-1.5`} text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors`,title:t?`Alerts${u>0?` (${u})`:``}`:void 0,children:[I(`span`,{className:`relative inline-flex shrink-0`,children:[B(Oi,{className:`h-3.5 w-3.5`}),t&&u>0&&B(`span`,{className:`absolute -top-1 -right-1 h-2 w-2 rounded-full bg-primary`})]}),!t&&B(`span`,{className:`flex-1 text-left`,children:`Alerts`}),!t&&u>0&&B(`span`,{className:`flex items-center justify-center h-4 min-w-4 px-1 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:u>99?`99+`:String(u)})]}):I(`button`,{ref:s,type:`button`,onClick:()=>r(!n),className:`relative p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors`,"aria-label":`Alerts`,children:[B(Oi,{className:`h-4.5 w-4.5`}),u>0&&B(`span`,{className:`absolute -top-0.5 -right-0.5 flex items-center justify-center h-4 min-w-4 px-0.5 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:u>99?`99+`:String(u)})]}),n&&je(I(`div`,{ref:o,style:te,className:`bg-surface border border-border rounded-lg shadow-xl flex flex-col overflow-hidden`,children:[I(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border shrink-0`,children:[B(`span`,{className:`text-[12px] font-semibold text-foreground`,children:`Alerts`}),I(`div`,{className:`flex items-center gap-2`,children:[h>0&&I(`label`,{className:`flex items-center gap-1 text-[10px] text-foreground-subtle cursor-pointer select-none`,children:[B(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked),className:`h-3 w-3 rounded border-border accent-primary cursor-pointer`}),`Show read`]}),u>0&&I(`button`,{type:`button`,onClick:E,className:`flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors`,children:[B($r,{className:`h-3 w-3`}),`Mark all read`]})]})]}),I(`div`,{className:`flex-1 overflow-y-auto`,children:[f&&B(`div`,{className:`flex items-center justify-center py-8`,children:B(vi,{className:`h-4 w-4 animate-spin text-foreground-subtle`})}),!f&&m.length===0&&I(`div`,{className:`flex flex-col items-center justify-center py-8 text-foreground-subtle`,children:[B(Oi,{className:`h-6 w-6 mb-2 opacity-40`}),B(`span`,{className:`text-[11px]`,children:d.length>0?`No unread alerts`:`No alerts`}),d.length>0&&!i&&I(`button`,{type:`button`,onClick:()=>a(!0),className:`text-[10px] text-primary mt-1 hover:underline`,children:[`Show `,h,` read alert`,h===1?``:`s`]})]}),D.length>0&&I(`div`,{className:`border-b border-border`,children:[B(`div`,{className:`px-3 py-1.5 bg-surface-hover/50`,children:B(`span`,{className:`text-[9px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:`In Progress`})}),D.map(e=>B(As,{alert:e,onMarkRead:C,onDismiss:w},e.id))]}),ee.map(e=>B(As,{alert:e,onMarkRead:C,onDismiss:w},e.id))]})]}),document.body)]})}var Ms=/^(\d{1,3}\.){3}\d{1,3}$/;function Ns(e){let t=e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1):e;return!!(Ms.test(t)||t.includes(`:`))}function Ps(e,t){return!t||Ns(e)?!1:e===t||e.endsWith(`.${t}`)}F();var Fs=`auth-webauthn/passkey-enrollment`,Is=`camstack_passkey_prompt_dismissed:`,Ls=720*60*60*1e3;function Rs(e){try{let t=localStorage.getItem(`${Is}${e}`);if(!t)return!1;let n=Number(t);return Number.isFinite(n)?Date.now()-n<Ls:!1}catch{return!1}}function zs(e){try{localStorage.setItem(`${Is}${e}`,String(Date.now()))}catch{}}function Bs(){let{user:e}=Ja(),{t}=Ts(),n=ke(),r=_(Fs),[i,a]=z(!1),[o,s]=z(!1),c=L(()=>e?Rs(e.id):!0,[e]),l=u.auth.listLoginMethods.useQuery().data?.find(e=>e.kind===`passkey`),d=l!==void 0&&Ps(window.location.hostname,l.rpId),f=e!==null&&d&&r!=null&&!c,p=be({queryKey:[`auth`,`listOwnPasskeys`],queryFn:()=>n.listOwnPasskeys(),enabled:f,staleTime:6e4}),m=j(()=>{e&&zs(e.id),a(!0),s(!1)},[e]),h=j(()=>{s(!1),p.refetch()},[p]);return!f||i||p.data===void 0||p.data.length>0?null:I(`div`,{className:`shrink-0 border-b border-primary/20 bg-primary/5`,children:[I(`div`,{className:`flex items-center gap-2.5 px-3 py-2 text-xs text-foreground`,children:[B(fi,{className:`h-4 w-4 text-primary shrink-0`}),B(`span`,{className:`flex-1 min-w-0`,children:t(`passkeyPrompt.message`,`Save a passkey for faster sign-in?`)}),B(`button`,{onClick:()=>s(e=>!e),className:`rounded bg-primary px-2.5 py-1 text-[11px] font-semibold text-primary-foreground hover:bg-primary/90`,children:t(`passkeyPrompt.enrollNow`,`Enroll now`)}),B(`button`,{onClick:m,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`passkeyPrompt.notNow`,`Not now`)}),B(`button`,{onClick:m,"aria-label":t(`passkeyPrompt.notNow`,`Not now`),className:`p-1 rounded text-foreground-subtle hover:text-foreground`,children:B(Bi,{className:`h-3.5 w-3.5`})})]}),o&&B(`div`,{className:`px-3 pb-3`,children:I(`div`,{className:`max-w-xl`,children:[B(C,{widgetId:Fs,host:`dashboard`}),B(`div`,{className:`mt-2 flex justify-end`,children:B(`button`,{onClick:h,className:`rounded border border-border px-2.5 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`common.close`,`Close`)})})]})})]})}F();function Vs(){let e=Sa();return fe(e.subscribe,e.getSnapshot,e.getSnapshot)}var Hs=[`detection`,`cluster`,`administration`];function Us(e){return Hs.includes(e)}function Ws(e){let t=new Map,n=new Map,r=[];for(let i of e){let e=i.section?.trim();if(e===void 0||e.length===0){r.push(i);continue}if(Us(e)){let n=t.get(e)??[];n.push(i),t.set(e,n);continue}let a=n.get(e);a?a.pages.push(i):n.set(e,{label:i.sectionLabel?.trim()||e,pages:[i]})}return{known:t,custom:[...n.entries()].map(([e,t])=>({id:e,label:t.label,pages:t.pages})),ungrouped:r}}var Gs=`camstack:last-path`,Ks=512,qs=[`/login`,`/change-password`,`/access-denied`,`/logout`];function Js(e){return!e.startsWith(`/`)||e.startsWith(`//`)||e.length>Ks?!1:!qs.some(t=>e===t||e.startsWith(t+`/`))}function Ys(e){if(!(typeof window>`u`)&&Js(e))try{window.localStorage.setItem(Gs,e)}catch{}}function Xs(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(Gs);return e===null?null:Js(e)?e:null}catch{return null}}F();var Zs={dark:Ci,light:Fi,system:Si},Qs={gauge:pi,puzzle:Ei,bot:Yr,cpu:oi,terminal:Ii,box:Xr,wrench:Vi,activity:Kr,plug:Ti};function $s(){let e=q(),t=Qt(),{user:n,logout:r}=Ja(),i=v(),{t:s}=Ts(),c=D(),l=ne(),u=fa(Vs()),[d,f]=z(!1);V(()=>{Ys(e.pathname+e.search)},[e.pathname,e.search]);let[p,m]=z(()=>typeof window>`u`?!1:window.localStorage.getItem(`camstack:sidebar-collapsed`)===`1`);V(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed`,p?`1`:`0`)},[p]);let[h]=z(()=>{if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(`camstack:sidebar-collapsed-groups`);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}});V(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed-groups`,JSON.stringify([...h]))},[h]),V(()=>{l&&window.localStorage.getItem(`camstack:sidebar-collapsed`)===null&&m(!0)},[l]);let{data:g=[]}=o({nodeId:`hub`},{refetchInterval:3e4}),_=g.length,y=we(),b=M(Date.now()),{data:x}=ee(void 0,{staleTime:0,refetchOnMount:`always`,refetchInterval:e=>{let t=e.state.data;return t&&t.length>0||Date.now()-b.current>=3e4?!1:2e3}}),S=L(()=>x&&n?.isAdmin?Za(x):[],[x,n?.isAdmin]),C=L(()=>Ws(S),[S]),w=C.known.get(`detection`)??[],E=C.known.get(`cluster`)??[],te=C.known.get(`administration`)??[];T(`addon.page-ready`,()=>{y.invalidateQueries({queryKey:[[`addonPages`,`listPages`]]})});let re=()=>{r(),t(`/login`)},ie=t=>!!(e.pathname===t||e.pathname.startsWith(t+`/`)),ae=[`/pipeline`].some(t=>e.pathname===t||e.pathname.startsWith(t+`/`)),oe=n?.isAdmin===!0,se=e=>e.filter(e=>!e.adminOnly||oe),ce=se([{label:s(`nav.devices`,`Devices`),icon:Zr,path:`/devices`},{label:s(`nav.integrations`),icon:Ti,path:`/integrations`},{label:s(`nav.viewer`,`Viewer`),icon:Si,path:`/viewer/camstack/`,external:!0}]),le=se([{label:s(`nav.pipeline`,`Pipeline`),icon:mi,path:`/pipeline`},{label:s(`nav.detectionIntelligence`,`People`),icon:Di,path:`/detection-intelligence`,adminOnly:!0},{label:s(`nav.vehicles`,`Vehicles`),icon:Qr,path:`/plates`,adminOnly:!0},{label:s(`nav.events`,`Events`),icon:Kr,path:`/events`,adminOnly:!0},{label:s(`nav.recordings`,`Recordings`),icon:di,path:`/recordings`,adminOnly:!0}]),ue=se([{label:s(`system.cluster`,`Cluster`),icon:wi,path:`/system/cluster`,adminOnly:!0},{label:s(`system.addons`),icon:Ei,path:`/system/addons`,adminOnly:!0},{label:s(`system.ai`,`AI`),icon:Pi,path:`/system/ai`,adminOnly:!0}]),de=se([{label:s(`system.identity`,`Identity & Access`),icon:yi,path:`/system/identity`,adminOnly:!0},{label:s(`system.network`,`Network`),icon:hi,path:`/system/network`,adminOnly:!0},{label:s(`system.integrations`,`Connectivity`),icon:Ti,path:`/system/integrations`,adminOnly:!0},{label:s(`system.data`,`Data`),icon:si,path:`/system/data`,adminOnly:!0},{label:s(`system.notifications`,`Notifications`),icon:Jr,path:`/system/notifications`,adminOnly:!0},{label:s(`system.capabilities`,`Capabilities`),icon:Mi,path:`/system/capabilities`,adminOnly:!0},{label:s(`system.addonSettings`,`Addon Settings`),icon:ki,path:`/system/settings`,adminOnly:!0},{label:s(`system.logs`,`Logs`),icon:Oi,path:`/system/logs`,adminOnly:!0}]),O=i?.mode??`system`,k={dark:s(`theme.dark`),light:s(`theme.light`),system:s(`theme.system`)},A=p&&!c,j=(e,t=`md`)=>`flex w-full items-center gap-2.5 rounded-md ${A?`justify-center px-0 py-2`:`px-2.5 py-1.5`} ${t===`lg`?`text-[13px] font-medium`:`text-[12px]`} transition-all ${e?t===`lg`?`bg-primary/12 text-primary shadow-sm shadow-primary/5`:`bg-primary/12 text-primary`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,fe=(e,t)=>e===0?null:A?B(`div`,{className:`pt-3 mb-1 mx-2 border-t border-border/60`},`sep-${t}`):B(`div`,{className:`pt-4 pb-1.5 px-2.5`,children:B(`span`,{className:`text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:t})},`hdr-${t}`),N=e=>{let n=ie(e.path),r=Qs[e.icon]??Ei;return I(`button`,{onClick:()=>{t(e.path),f(!1)},className:j(n),title:A?e.label:void 0,children:[B(r,{className:`h-3.5 w-3.5 shrink-0 ${n?`text-primary`:``}`}),!A&&e.label]},`${e.addonId}::${e.id}`)},pe=e=>{let n=e.icon,r=e.external?!1:ie(e.path),i=e.path===`/system/addons`;return I(`button`,{"data-testid":`nav-${e.path.replace(/^\//,``).replace(/\//g,`-`)}`,onClick:()=>{e.external?window.open(e.path,`_blank`,`noopener,noreferrer`):t(e.path),f(!1)},className:j(r),title:A?e.label:void 0,children:[B(n,{className:`h-3.5 w-3.5 shrink-0 ${r?`text-primary`:``}`}),!A&&I(xe,{children:[B(`span`,{className:`flex-1 text-left`,children:e.label}),i&&_>0&&B(`span`,{className:`ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none`,children:_})]}),A&&i&&_>0&&B(`span`,{className:`absolute mt-[-14px] ml-3 h-2 w-2 rounded-full bg-primary`})]},e.path)},me=I(xe,{children:[I(`div`,{className:`flex h-14 items-center border-b border-border ${A?`justify-center px-1`:`pl-3 pr-4 gap-2`}`,children:[!A&&B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-9 flex-1 min-w-0`}),!c&&B(`button`,{onClick:()=>m(e=>!e),className:`p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle transition-colors flex-shrink-0 ${A?``:`mr-2`}`,"aria-label":p?`Expand sidebar`:`Collapse sidebar`,title:p?`Expand sidebar`:`Collapse sidebar`,children:B(p?ri:ni,{className:`h-4 w-4`})})]}),I(`nav`,{className:`flex-1 overflow-y-auto py-3 ${A?`px-1.5`:`px-2`} space-y-0.5`,children:[(()=>{let e=ie(`/dashboard`);return I(`button`,{"data-testid":`nav-dashboard`,onClick:()=>{t(`/dashboard`),f(!1)},className:j(e,`lg`),title:A?s(`nav.dashboard`):void 0,children:[B(_i,{className:`h-4 w-4 shrink-0 ${e?`text-primary`:``}`}),!A&&s(`nav.dashboard`)]})})(),ce.map(e=>pe(e)),fe(le.length+w.length,s(`nav.detectionSection`,`Detection`)),le.map(e=>pe(e)),w.map(e=>N(e)),fe(ue.length+E.length,s(`nav.clusterSection`,`Cluster & Server`)),ue.map(e=>pe(e)),E.map(e=>N(e)),fe(de.length+te.length,s(`system.title`,`Administration`)),de.map(e=>pe(e)),te.map(e=>N(e)),C.custom.map(e=>I(`div`,{className:`contents`,children:[fe(e.pages.length,e.label),e.pages.map(e=>N(e))]},`custom-${e.id}`)),fe(C.ungrouped.length,s(`nav.addonPages`,`Addon Pages`)),C.ungrouped.map(e=>N(e))]}),I(`div`,{className:`border-t border-border ${A?`p-1.5`:`p-2`} space-y-0.5`,children:[I(`button`,{onClick:()=>i?.toggleMode(),className:j(!1),title:A?k[O]:void 0,children:[(()=>{let e=Zs[O];return B(e,{className:`h-3.5 w-3.5 shrink-0`})})(),!A&&B(`span`,{children:k[O]})]}),B(js,{variant:`sidebar`,compact:A}),I(`button`,{type:`button`,onClick:()=>t(`/system/my-access`),className:j(ie(`/system/my-access`)),title:A?s(`system.myAccess`,`My access`):void 0,children:[B(Ai,{className:`h-3.5 w-3.5 shrink-0`}),!A&&B(`span`,{className:`truncate`,children:s(`system.myAccess`,`My access`)})]}),I(`button`,{onClick:re,className:j(!1).replace(`hover:text-foreground`,`hover:text-danger`),title:A?n?.username??`Logout`:void 0,children:[B(bi,{className:`h-3.5 w-3.5 shrink-0`}),!A&&B(`span`,{className:`truncate`,children:n?.username??`User`})]}),B(`div`,{className:`pt-1 text-[10px] text-foreground-disabled select-none ${A?`text-center`:`px-2`}`,title:`admin-ui v1.2.0`,children:A?`1.2.0`:`v1.2.0`})]})]});return I(`div`,{className:`flex h-dvh overflow-hidden bg-background text-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]`,children:[!c&&B(`aside`,{className:`flex flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0 transition-[width] duration-150 ease-out ${A?`w-12`:`w-48`}`,children:me}),c&&B(a,{open:d,onClose:()=>f(!1),width:`w-64`,children:me}),I(`div`,{className:`flex flex-1 flex-col min-w-0`,children:[u!==null&&I(`div`,{className:`flex items-center justify-center gap-2 px-3 py-2 text-[12px] font-medium shrink-0 ${u.severity===`danger`?`bg-danger/90 text-white`:`bg-warning/15 text-warning border-b border-warning/30`}`,children:[u.severity===`danger`?B(zi,{className:`h-3.5 w-3.5`}):B(Kr,{className:`h-3.5 w-3.5`}),B(`span`,{children:s(u.i18nKey,{defaultValue:u.message,...u.i18nParams})}),u.action===`sign-in`&&B(`button`,{onClick:()=>r(),className:`ml-2 rounded border border-white/40 px-2 py-0.5 text-[11px] font-semibold hover:bg-white/10`,children:s(`connection.signIn`,`Sign in`)}),u.showSpinner&&B(vi,{className:`h-3.5 w-3.5 animate-spin`})]}),B(Bs,{}),c&&I(`header`,{className:`flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm`,children:[B(`button`,{onClick:()=>f(!0),className:`p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors`,"aria-label":`Open menu`,children:B(xi,{className:`h-5 w-5`})}),B(`div`,{className:`flex-1 flex justify-center`,children:B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack`,className:`h-7`})}),B(js,{})]}),B(`main`,{className:`relative flex-1 min-h-0 overscroll-contain bg-background ${ae?`overflow-hidden`:`overflow-auto`}`,children:B(Dn,{})})]})]})}function $({children:e,requireAdmin:t}){let{user:n,loading:r,mustChangePassword:i}=Ja(),a=q();return r?B(`div`,{className:`flex h-screen items-center justify-center bg-background text-foreground-subtle`,children:`Loading...`}):n?i&&a.pathname!==`/change-password`?B(J,{to:`/change-password`,replace:!0}):t&&!n.isAdmin?B(J,{to:`/access-denied`,replace:!0}):B(xe,{children:e}):B(J,{to:`/login`,replace:!0,state:{from:a.pathname+a.search}})}function ec(){let e=Qt();return I(`div`,{className:`flex flex-col items-center justify-center text-foreground py-16 px-4`,children:[B(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4`,children:B(ji,{className:`h-8 w-8 text-danger`})}),B(`h1`,{className:`text-xl font-bold`,children:`Access Denied`}),B(`p`,{className:`mt-2 text-sm text-foreground-subtle`,children:`You don't have permission to access this page.`}),B(`button`,{onClick:()=>e(`/dashboard`),className:`mt-6 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all`,children:`Go to Dashboard`})]})}F();var tc=8;function nc(){let{user:e,mustChangePassword:t,clearMustChangePassword:n,logout:r}=Ja(),i=v(),a=Qt(),[o,c]=z(``),[l,u]=z(``),[d,f]=z(!1),[p,m]=z(``),h=s({onSuccess:()=>{n(),a(`/dashboard`,{replace:!0})},onError:e=>{m(e instanceof Error?e.message:`Could not change password`)}});return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm`,children:[B(`div`,{className:`flex justify-center mb-8`,children:B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-12`})}),I(`form`,{onSubmit:async t=>{if(t.preventDefault(),m(``),!e){m(`Not signed in`);return}if(o.length<tc){m(`Password must be at least ${tc} characters`);return}if(o!==l){m(`The two passwords do not match`);return}if(o===`changeme`){m(`Choose a password different from the seed default`);return}h.mutate({id:e.id,newPassword:o})},className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[I(`div`,{className:`space-y-1`,children:[B(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Set a new password`}),B(`p`,{className:`text-xs text-foreground-subtle`,children:t?`You must rotate the seed password before continuing.`:`Choose a new password for your account.`})]}),p&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:p}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`New password`}),I(`div`,{className:`relative`,children:[B(`input`,{"data-testid":`change-password-new`,type:d?`text`:`password`,value:o,onChange:e=>c(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0}),B(`button`,{type:`button`,onClick:()=>f(!d),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:B(d?li:ui,{className:`h-4 w-4`})})]})]}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Confirm new password`}),B(`input`,{"data-testid":`change-password-confirm`,type:d?`text`:`password`,value:l,onChange:e=>u(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`})]}),B(`button`,{"data-testid":`change-password-submit`,type:`submit`,disabled:h.isPending||!o||!l,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:h.isPending?`Saving…`:`Save and continue`}),t&&B(`button`,{type:`button`,onClick:()=>{r(),a(`/login`,{replace:!0})},className:`w-full text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:`Sign out instead`})]})]})})}function rc(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ic(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function ac(){return window?.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==`function`}function oc(e){let{id:t}=e;return{...e,id:ic(t),transports:e.transports}}function sc(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}var cc=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.name=r??n.name,this.code=t}},lc=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},uc=[`cross-platform`,`platform`];function dc(e){if(e&&!(uc.indexOf(e)<0))return e}function fc(){if(!ac())return new Promise(e=>e(!1));let e=window.PublicKeyCredential;return e.isConditionalMediationAvailable===void 0?new Promise(e=>e(!1)):e.isConditionalMediationAvailable()}function pc({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new cc({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new cc({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!sc(t))return new cc({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new cc({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new cc({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function mc(e){let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!ac())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(oc));let a={...t,challenge:ic(t.challenge),allowCredentials:i},o={};if(n){if(!await fc())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=lc.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw pc({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=rc(u.userHandle)),{id:c,rawId:rc(l),response:{authenticatorData:rc(u.authenticatorData),clientDataJSON:rc(u.clientDataJSON),signature:rc(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:dc(s.authenticatorAttachment)}}var hc=()=>window.location.hostname;function gc(e,t=hc){return ac()&&Ps(t(),e.rpId)}function _c(e,t=hc){let n=e.filter(e=>e.kind===`passkey`&&e.stage===`second-factor`).filter(e=>gc(e,t));return{passkeyMethods:n,widgetMethods:n.length>0?[]:e.filter(e=>e.kind===`widget`&&e.stage===`second-factor`)}}function vc(e,t){let n=e.includes(`passkey`),r=t.passkeyMethods.length>0||t.widgetMethods.length>0,i=e.includes(`totp`);return n&&!r&&!i}F();async function yc(e){let t=await mc({optionsJSON:e});return Object.fromEntries(Object.entries(t))}function bc({method:e,challengeToken:t,onComplete:n,onSecondFactor:r,onError:i}){let[a,o]=z(!1),[s,c]=z(null),l=async()=>{c(null),o(!0);try{let e=Ta();if(t){let r=await yc((await e.loginBeginPasskey(t)).optionsJSON);n((await e.loginVerifyPasskey(t,r)).token);return}let a=await yc((await e.passkeyLoginBegin()).optionsJSON),o=await e.passkeyLoginFinish(a),s=o.secondFactors??(o.requiresTotp===!0?[`totp`]:[]);if(s.length>0){if(r)r({challengeToken:o.token,factors:s});else{let e=`Additional verification is required — sign in with your password to continue.`;c(e),i?.(e)}return}n(o.token)}catch(e){let n=t?`Passkey verification failed`:`Passkey sign-in failed`,r=e instanceof Error?e.message:n;c(r),i?.(r)}finally{o(!1)}};return I(`div`,{className:`space-y-2`,children:[I(`button`,{type:`button`,"data-testid":t?`login-passkey`:`login-passkey-direct`,onClick:()=>void l(),disabled:a,className:`w-full flex items-center justify-center gap-2 rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover disabled:opacity-50 transition-colors`,children:[a?B(vi,{className:`h-4 w-4 animate-spin text-primary`}):B(fi,{className:`h-4 w-4 text-primary`}),e.label]}),s&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:s})]})}function xc(e){let t=e.onComplete,n=e.onSecondFactor;return typeof t==`function`?{onComplete:t,onSecondFactor:typeof n==`function`?n:void 0}:null}function Sc({methods:e,widgetConfig:t}){let n=e.filter(e=>e.kind!==`passkey`||gc(e));return n.length===0?null:I(`div`,{className:`mt-6 space-y-3`,children:[I(`div`,{className:`flex items-center gap-3`,children:[B(`div`,{className:`h-px flex-1 bg-border`}),B(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:`Or continue with`}),B(`div`,{className:`h-px flex-1 bg-border`})]}),B(`div`,{className:`space-y-2`,children:n.map(e=>{if(e.kind===`redirect`)return I(`a`,{href:e.startUrl,className:`flex items-center justify-center gap-2 w-full rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:[B(Ai,{className:`h-4 w-4 text-primary`}),e.label]},e.id);if(e.kind===`passkey`){let n=xc(t);return n?B(bc,{method:e,onComplete:n.onComplete,onSecondFactor:n.onSecondFactor},e.id):null}return B(Cc,{method:e,config:t},e.id)})})]})}function Cc({method:e,config:t}){let n=re(e.remote,e.bundleUrl);return n===null?I(`div`,{className:`flex items-center justify-center gap-2 rounded-lg border border-border bg-background px-4 py-2.5 text-xs text-foreground-subtle`,children:[B(vi,{className:`h-3.5 w-3.5 animate-spin`}),`Loading…`]}):n===void 0?I(`div`,{"data-testid":`login-method-load-error`,className:`flex items-center justify-center gap-2 rounded-lg border border-danger/20 bg-danger/10 px-4 py-2.5 text-xs text-danger`,children:[B(ii,{className:`h-3.5 w-3.5 shrink-0`}),`A sign-in method could not be loaded — reload the page to retry.`]}):B(n,{instanceId:e.id,host:`dashboard`,config:t})}F();function wc(){let{login:e,verifyTotp:t,finalizePasskeyLogin:n,user:r}=Ja(),{i18n:i}=Ts(),a=v(),o=Qt(),s=q(),c=new URLSearchParams(window.location.search).get(`next`),l=new URLSearchParams(window.location.search).get(`redirect`);V(()=>{Va(l)},[l]);let d=s.state?.from??Xs()??`/dashboard`,[f,p]=z(``),[m,h]=z(``),[g,_]=z(!1),[y,b]=z(``),[x,S]=z(!1),[C,w]=z(`credentials`),[T,E]=z(``),[D,ee]=z([]),[te,ne]=z(``),re=u.auth.listLoginMethods.useQuery().data??[],ie=re.filter(e=>e.stage===`primary`),ae=_c(re),{passkeyMethods:oe,widgetMethods:se}=ae,ce=M(!1),le=async()=>{if(ce.current)return;ce.current=!0;let e=La(l);if(e?.kind===`app-callback`){await O(e.url);return}else if(e){window.location.assign(e.path);return}c?window.location.assign(c):o(d,{replace:!0})},[ue,de]=z(null),O=async e=>{de({callbackBase:e,mintedUrl:null,failed:!1});try{let{code:t}=await Ta().trpcClient.auth.createHandoffCode.mutate(),n=Ia(e,t);de({callbackBase:e,mintedUrl:n,failed:!1}),window.location.assign(n)}catch{de({callbackBase:e,mintedUrl:null,failed:!0})}},k=r!==null,[A,j]=z(!1);V(()=>{!k||!l||A||(j(!0),le())},[k,l,A]);let fe=async t=>{t.preventDefault(),b(``),S(!0);try{let t=await e(f,m);if(t.kind===`second-factor`){E(t.challengeToken),ee(t.factors),w(`second-factor`);return}m===`changeme`?o(`/change-password`,{replace:!0}):await le()}catch(e){b(e instanceof Error?e.message:`Login failed`)}finally{S(!1)}},N=async e=>{e.preventDefault(),b(``),S(!0);try{await t(T,te.trim()),await le()}catch(e){b(e instanceof Error?e.message:`TOTP verification failed`),ne(``)}finally{S(!1)}},pe=async e=>{try{await n(e),await le()}catch(e){b(e instanceof Error?e.message:`Passkey sign-in failed`)}};return ue===null?B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm`,children:[B(`div`,{className:`flex justify-center mb-8`,children:B(`img`,{src:a?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-12`})}),C===`credentials`?I(`form`,{onSubmit:fe,className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[y&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:y}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Username`}),B(`input`,{"data-testid":`login-username`,type:`text`,placeholder:`Username`,value:f,onChange:e=>p(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Password`}),I(`div`,{className:`relative`,children:[B(`input`,{"data-testid":`login-password`,type:g?`text`:`password`,placeholder:`Password`,value:m,onChange:e=>h(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`}),B(`button`,{type:`button`,onClick:()=>_(!g),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:B(g?li:ui,{className:`h-4 w-4`})})]})]}),B(`button`,{"data-testid":`login-submit`,type:`submit`,disabled:x||!f||!m,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:x?I(`span`,{className:`flex items-center justify-center gap-2`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),`Logging in...`]}):`Log in`})]}):I(`div`,{className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[I(`div`,{className:`flex items-center gap-2 pb-1 border-b border-border`,children:[B(Ni,{className:`h-4 w-4 text-primary`}),B(`div`,{className:`text-sm font-medium text-foreground`,children:`Two-factor authentication`})]}),B(`p`,{className:`text-xs text-foreground-subtle`,children:f?I(xe,{children:[`Finish signing in as `,B(`span`,{className:`font-mono text-foreground`,children:f}),`.`]}):`Finish signing in.`}),y&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:y}),D.includes(`passkey`)&&oe.map(e=>B(bc,{method:e,challengeToken:T,onComplete:pe},e.id)),D.includes(`passkey`)&&se.map(e=>B(Cc,{method:e,config:{challengeToken:T,onComplete:pe}},e.id)),vc(D,ae)&&B(`div`,{className:`rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground-subtle`,children:`Passkey verification isn't available on this address. Open the hub via its domain URL to complete sign-in.`}),D.includes(`passkey`)&&D.includes(`totp`)&&I(`div`,{className:`flex items-center gap-3`,children:[B(`div`,{className:`h-px flex-1 bg-border`}),B(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:`or`}),B(`div`,{className:`h-px flex-1 bg-border`})]}),D.includes(`totp`)&&I(`form`,{onSubmit:N,className:`space-y-4`,children:[I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Authentication code`}),B(`input`,{"data-testid":`login-totp`,type:`text`,inputMode:`numeric`,autoComplete:`one-time-code`,placeholder:`123456`,value:te,onChange:e=>ne(e.target.value.replace(/\D/g,``).slice(0,6)),className:`w-full rounded-lg border border-border bg-background px-3 py-3 text-center text-2xl font-mono tracking-widest text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),B(`button`,{"data-testid":`login-totp-submit`,type:`submit`,disabled:x||te.length!==6,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:x?I(`span`,{className:`flex items-center justify-center gap-2`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),`Verifying...`]}):`Verify and sign in`})]}),I(`button`,{type:`button`,onClick:()=>{w(`credentials`),E(``),ee([]),ne(``),b(``)},className:`w-full flex items-center justify-center gap-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:[B(qr,{className:`h-3 w-3`}),`Back to username + password`]})]}),C===`credentials`&&B(Sc,{methods:ie,widgetConfig:{onComplete:pe,onSecondFactor:e=>{let t=e.factors.filter(e=>e===`totp`||e===`passkey`);E(e.challengeToken),ee(t),ne(``),b(``),w(`second-factor`)},locale:i.language}}),I(`p`,{className:`mt-6 text-center text-[10px] text-foreground-subtle/50`,children:[`CamStack v`,`1.2.0`]})]})}):B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm rounded-xl border border-border bg-surface p-6 text-center space-y-4`,children:[B(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Returning to the app…`}),ue.failed?I(xe,{children:[B(`p`,{className:`text-xs text-danger`,children:`Could not prepare the sign-in handoff. You are logged in — retry below.`}),B(`button`,{onClick:()=>void O(ue.callbackBase),className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Retry`})]}):ue.mintedUrl===null?B(`p`,{className:`text-xs text-foreground-subtle`,children:`Preparing a one-time sign-in code…`}):I(xe,{children:[B(`p`,{className:`text-xs text-foreground-subtle`,children:`If the app does not open automatically, tap below (the code expires in 60s).`}),B(`a`,{href:ue.mintedUrl,className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Open CamStack`})]})]})})}F();function Tc(){return B(J,{to:Xs()??`/dashboard`,replace:!0})}var Ec=R(()=>i(()=>import(`./Dashboard-B44hFAIO.js`).then(e=>({default:e.DashboardPage})),__vite__mapDeps([0,1,2,3,4,5]))),Dc=R(()=>i(()=>import(`./Devices-CuAPCnH8.js`).then(e=>({default:e.DevicesPage})),__vite__mapDeps([6,1,2,3,4,7,8,9,10,11,12]))),Oc=R(()=>i(()=>import(`./Integrations-GzRXWJY0.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([13,1,2,3,4,7,8,9,10,14,15,16,5,17,18,19,11,20,21,12]))),kc=R(()=>i(()=>import(`./IntegrationDetail-BRX1Cgc7.js`).then(e=>({default:e.IntegrationDetailPage})),__vite__mapDeps([22,1,2,3,4,7,8,9,10,14,15,16,5,17,18,19,23]))),Ac=R(()=>i(()=>import(`./Pipeline-BUL-ABEL.js`).then(e=>({default:e.PipelinePage})),__vite__mapDeps([24,25,1,2,3,4,23,26,27,28,18,29,14,15,16,30,5,8,9,31,32,11,33,34,35,12]))),jc=R(()=>i(()=>import(`./DeviceDetail-CiJPK_Hg.js`).then(e=>({default:e.DeviceDetailPage})),__vite__mapDeps([36,1,2,3,4,37,28,8,15,38,7,9,10,27,14,16,30,5,23,34,20,12]))),Mc=R(()=>i(()=>import(`./Showroom-Dztrxiso.js`).then(e=>({default:e.ShowroomPage})),__vite__mapDeps([39,37,28,8,15,7,9,10,14,1,2,3,4,16,20]))),Nc=R(()=>i(()=>import(`./EmbedPlayerPage-C8Qwuzjd.js`).then(e=>({default:e.EmbedPlayerPage})),__vite__mapDeps([40,1,2,3,4]))),Pc=R(()=>i(()=>import(`./DetectionIntelligence-CBn9zwCs.js`).then(e=>({default:e.DetectionIntelligencePage})),__vite__mapDeps([41,1,2,3,4,42,43,30,5,15,31,32,11,44]))),Fc=R(()=>i(()=>import(`./Plates-re0O5v8R.js`).then(e=>({default:e.PlatesPage})),__vite__mapDeps([45,1,2,3,4,42,43,30,5,31,32,11,44]))),Ic=R(()=>i(()=>import(`./Events-De1MNcJg.js`).then(e=>({default:e.EventsPage})),__vite__mapDeps([46,1,2,3,4,47,48,43,16,31,32,11,44]))),Lc=R(()=>i(()=>import(`./Recordings-Cshnuw6r.js`).then(e=>({default:e.RecordingsPage})),__vite__mapDeps([49,1,2,3,4,18,29,14,15,16,30,5,11,50,35,44,26]))),Rc=R(()=>i(()=>import(`./Addons-D6z52udO.js`).then(e=>({default:e.AddonsPage})),__vite__mapDeps([51,1,2,3,4,47,18,5,15,16,52,11,33,14,34]))),zc=R(()=>i(()=>import(`./AiProfiles-Z7ksIPFF.js`).then(e=>({default:e.AiProfilesPage})),__vite__mapDeps([53,1,2,3,4,30,5,54,9,11]))),Bc=R(()=>i(()=>import(`./MyAccess-BbPpIYRJ.js`).then(e=>({default:e.MyAccessPage})),__vite__mapDeps([55,1,2,3,4,56,48,57,30,11]))),Vc=R(()=>i(()=>import(`./Logs-DBBumaMc.js`).then(e=>({default:e.LogsPage})),__vite__mapDeps([58,1,2,3,4,11]))),Hc=R(()=>i(()=>import(`./Identity-BKqc54Et.js`).then(e=>({default:e.IdentityPage})),__vite__mapDeps([59,1,2,3,4,56,48,57,60,5,15,32,11,33,14,16,34,50,61]))),Uc=R(()=>i(()=>import(`./Network-C5ZntFKl.js`).then(e=>({default:e.NetworkPage})),__vite__mapDeps([62,1,2,3,4,38,48,60,5,15,32,11,33,14,16,34,9,10,50,61]))),Wc=R(()=>i(()=>import(`./Integrations-CAdnay5c.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([63,1,2,3,4,30,60,5,15,32,11,33,14,16,34,8,10,50,19,21]))),Gc=R(()=>i(()=>import(`./Data-o2lHojn-.js`).then(e=>({default:e.DataPage})),__vite__mapDeps([64,1,2,3,4,18,29,14,15,16,30,5,23,11,50,44,26]))),Kc=R(()=>i(()=>import(`./Settings-KX75IP58.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([65,1,2,3,4,11,33,14,15,16,34]))),qc=R(()=>i(()=>import(`./Cluster-CC5_CGJA.js`).then(e=>({default:e.ClusterPage})),__vite__mapDeps([66,25,1,2,3,4,23,26,30,8,15,9,52,33,14,16,34]))),Jc=R(()=>i(()=>import(`./Capabilities-BeYEhvPF.js`).then(e=>({default:e.CapabilitiesPage})),__vite__mapDeps([67,1,2,3,4,56,11]))),Yc=R(()=>i(()=>import(`./NotificationTargets-f-LdcumZ.js`).then(e=>({default:e.NotificationTargetsPage})),__vite__mapDeps([68,1,2,3,4,56,30,5,16,54,11]))),Xc=new Se({defaultOptions:{queries:{gcTime:0,staleTime:0,retry:!1,refetchOnWindowFocus:!1}}});function Zc({field:e,value:t,onChange:n,disabled:r}){return B(Zi,{field:e,value:t,onChange:n,disabled:r})}function Qc({field:e,value:t,onChange:n,disabled:r}){return B(qi,{field:e,value:t,onChange:n,disabled:r})}var $c={"pipeline-editor":Zc,"model-selector":Qc};function el({children:e}){let{user:t,logout:n}=Ja(),[r,i]=z(0),a=M(t?.username??null);V(()=>{let e=t?.username??null;e!==a.current&&(a.current=e,Ea(),i(e=>e+1))},[t]);let o=L(()=>Ta(),[r]),[s,c]=z(!1),[l,d]=z(null);return V(()=>{if(c(!1),d(null),!t){c(!0);return}let e=!1;return o.init().then(()=>{e||c(!0)},t=>{if(e)return;let r=t instanceof Error?t.message:String(t),i=t?.data?.code;if(i===`UNAUTHORIZED`||i===`FORBIDDEN`||/UNAUTHORIZED|FORBIDDEN/.test(r)){n();return}d(r),c(!0)}),()=>{e=!0}},[o,t,n]),Xa(j(()=>{Ea(),i(e=>e+1),Xc.invalidateQueries()},[])),B(Oe,{system:o,children:B(u.Provider,{client:o.trpcClient,queryClient:Xc,children:I(ie,{children:[s?e:B(tl,{}),s&&B(aa,{}),l!==null&&s&&I(`div`,{className:`fixed bottom-4 right-4 z-50 max-w-sm rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning shadow-lg`,children:[`Boot probe failed: `,l,`. Retrying in background.`]})]})})})}function tl(){return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:I(`div`,{className:`flex items-center gap-3 text-sm text-foreground-subtle`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`}),`Connecting…`]})})}function nl(){return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`})})}function rl(){return B(oe,{defaultMode:`dark`,children:B(Te,{client:Xc,children:B(qa,{children:B(el,{children:B(f,{children:I(d,{renderers:$c,children:[B(vr,{children:B(_e,{fallback:B(nl,{}),children:I(kn,{children:[B(Y,{path:`/login`,element:B(wc,{})}),B(Y,{path:`/change-password`,element:B($,{children:B(nc,{})})}),B(Y,{path:`/showroom`,element:B(Mc,{})}),B(Y,{path:`/embed/player`,element:B(Nc,{})}),I(Y,{element:B($,{children:B($s,{})}),children:[B(Y,{index:!0,element:B(Tc,{})}),B(Y,{path:`/access-denied`,element:B(ec,{})}),B(Y,{path:`/dashboard`,element:B(Ec,{})}),B(Y,{path:`/devices`,element:B(Dc,{})}),B(Y,{path:`/cameras`,element:B(J,{to:`/devices`,replace:!0})}),B(Y,{path:`/integrations`,element:B(Oc,{})}),B(Y,{path:`/integrations/:integrationId`,element:B(kc,{})}),B(Y,{path:`/pipeline`,element:B(Ac,{})}),B(Y,{path:`/devices/:deviceId`,element:B(jc,{})}),B(Y,{path:`/system/logs`,element:B($,{requireAdmin:!0,children:B(Vc,{})})}),B(Y,{path:`/system/addons`,element:B($,{requireAdmin:!0,children:B(Rc,{})})}),B(Y,{path:`/system/ai`,element:B($,{requireAdmin:!0,children:B(zc,{})})}),B(Y,{path:`/system/settings`,element:B($,{requireAdmin:!0,children:B(Kc,{})})}),B(Y,{path:`/system/cluster`,element:B($,{requireAdmin:!0,children:B(qc,{})})}),B(Y,{path:`/system/capabilities`,element:B($,{requireAdmin:!0,children:B(Jc,{})})}),B(Y,{path:`/system/server`,element:B(J,{to:`/system/cluster`,replace:!0})}),B(Y,{path:`/system/notifications`,element:B($,{requireAdmin:!0,children:B(Yc,{})})}),B(Y,{path:`/system/identity`,element:B($,{requireAdmin:!0,children:B(Hc,{})})}),B(Y,{path:`/system/my-access`,element:B(Bc,{})}),B(Y,{path:`/system/network`,element:B($,{requireAdmin:!0,children:B(Uc,{})})}),B(Y,{path:`/system/integrations`,element:B($,{requireAdmin:!0,children:B(Wc,{})})}),B(Y,{path:`/system/data`,element:B($,{requireAdmin:!0,children:B(Gc,{})})}),B(Y,{path:`/system/users`,element:B(J,{to:`/system/identity?tab=users`,replace:!0})}),B(Y,{path:`/system/api-keys`,element:B(J,{to:`/system/identity?tab=api-keys`,replace:!0})}),B(Y,{path:`/system/authentication`,element:B(J,{to:`/system/identity?tab=authentication`,replace:!0})}),B(Y,{path:`/system/linked-sessions`,element:B(J,{to:`/system/identity?tab=linked-sessions`,replace:!0})}),B(Y,{path:`/system/remote-access`,element:B(J,{to:`/system/network?tab=remote-access`,replace:!0})}),B(Y,{path:`/system/turn`,element:B(J,{to:`/system/network?tab=turn`,replace:!0})}),B(Y,{path:`/system/storage`,element:B(J,{to:`/system/data?tab=storage`,replace:!0})}),B(Y,{path:`/system/backup`,element:B(J,{to:`/system/data?tab=backup`,replace:!0})}),B(Y,{path:`/detection-intelligence`,element:B($,{requireAdmin:!0,children:B(Pc,{})})}),B(Y,{path:`/plates`,element:B($,{requireAdmin:!0,children:B(Fc,{})})}),B(Y,{path:`/events`,element:B($,{requireAdmin:!0,children:B(Ic,{})})}),B(Y,{path:`/recordings`,element:B($,{requireAdmin:!0,children:B(Lc,{})})}),B(Y,{path:`/addon/:pagePath`,element:B($,{requireAdmin:!0,children:B(ro,{})})})]})]})})}),B(ua,{})]})})})})})})}var il={nav:{dashboard:`Dashboard`,integrations:`Integrations`,metrics:`Metrics`,detectionSection:`Detection`,detectionIntelligence:`People`,vehicles:`Vehicles`,clusterSection:`Cluster & Server`},system:{title:`Administration`,addons:`Addons`,agents:`Agents`,processes:`Processes`,logs:`Logs`,users:`Users`,settings:`Settings`,repl:`REPL`,models:`Models`,integrations:`Connectivity`,serverManagement:`Server`},common:{save:`Save`,cancel:`Cancel`,delete:`Delete`,enable:`Enable`,disable:`Disable`,edit:`Edit`,add:`Add`,remove:`Remove`,confirm:`Confirm`,close:`Close`,back:`Back`,next:`Next`,search:`Search`,filter:`Filter`,reset:`Reset`,apply:`Apply`,submit:`Submit`,loading:`Loading…`,error:`Error`,success:`Success`,warning:`Warning`,info:`Info`,noData:`No data available`,noResults:`No results found`,retry:`Retry`,refresh:`Refresh`,copy:`Copy`,copied:`Copied!`,yes:`Yes`,no:`No`},connection:{disconnected:`Server unreachable — reconnecting…`,connected:`Connected`,reconnecting:`Reconnecting…`,degraded:`Live connection interrupted — hub is online (a cluster node may be unresponsive), re-establishing…`,degradedNodes_one:`Cluster degraded — node {{nodes}} not responding. Hub is online, live link re-establishing…`,degradedNodes_other:`Cluster degraded — nodes {{nodes}} not responding. Hub is online, live link re-establishing…`,degradedCount_one:`Cluster degraded — {{count}} cluster node offline. Hub is online, live link re-establishing…`,degradedCount_other:`Cluster degraded — {{count}} cluster nodes offline. Hub is online, live link re-establishing…`,sessionExpired:`Session expired — please sign in again.`,signIn:`Sign in`},passkeyPrompt:{message:`Save a passkey for faster sign-in?`,enrollNow:`Enroll now`,notNow:`Not now`},status:{online:`Online`,offline:`Offline`,connecting:`Connecting`,error:`Error`,disabled:`Disabled`,enabled:`Enabled`,active:`Active`,inactive:`Inactive`,running:`Running`,stopped:`Stopped`,pending:`Pending`,unknown:`Unknown`},auth:{login:`Login`,logout:`Logout`,username:`Username`,password:`Password`,signIn:`Sign In`,invalidCredentials:`Invalid username or password`},theme:{dark:`Dark`,light:`Light`,system:`System`},language:{select:`Language`,en:`English`,it:`Italian`},pages:{dashboard:{title:`Dashboard`,subtitle:`Overview of all devices and their status`},integrations:{title:`Integrations`,subtitle:`Manage camera sources and provider connections`},metrics:{title:`Metrics`,subtitle:`System performance and usage statistics`},agents:{title:`Agents`,subtitle:`Manage distributed processing agents`},addons:{title:`Addons`,subtitle:`Extend functionality with addon modules`},settings:{title:`Settings`,subtitle:`Configure system-wide preferences`},users:{title:`Users`,subtitle:`Manage user accounts and permissions`},logs:{title:`Logs`,subtitle:`View system and device logs`}},integrations:{preview:`Preview`,snapshotUnavailable:`Snapshot unavailable`,noSnapshot:`No snapshot`,lastSnapshot:`Last snapshot:`,offline:`Offline`,active:`Active`,available:`Available`,noDevices:`No devices.`,addFirstDevice:`Add your first device to get started.`,import:`+ Import`,noProviders:`No providers available. Install a provider addon.`,manage:`Manage`,integrationName:`Integration name`,integrationNamePlaceholder:`e.g. Garage Server`,connectionSuccess:`Connection successful!`,errorPrefix:`Error:`,back:`Back`,testing:`Testing...`,testConnection:`Test connection`,forward:`Next`,searchingDevices:`Searching for devices...`,foundDevices:`Found {{count}} devices. Select the ones to import.`,noDevicesFound:`No devices found.`,skip:`Skip`,importSelected:`Import selected`,newIntegration:`New Integration`,configureIntegration:`Configure Integration`,importDevices:`Import Devices`,addDevice:`Add device`,name:`Name`,namePlaceholder:`e.g. Entrance Camera`,snapshotUrlOptional:`Snapshot URL (optional)`,streamUrls:`Stream URLs`,addStream:`Add stream`,cancel:`Cancel`,saving:`Saving...`,save:`Save`,saveAndNew:`Save and new`,test:`Test`,stream:`Stream {{number}}:`,devices:`devices`,rediscover:`Rediscover`,config:`Config`,integrationNotFound:`Integration not found.`,configComingSoon:`Config coming soon.`,providerConfig:`Provider Config`,editConfig:`Edit configuration`,relinkBrokerHelp:`Choose the broker this integration connects through. Picking a different broker re-points it and restarts the addon.`,currentBroker:`Current broker`,relinkFailed:`Failed to update broker link.`,noBrokerKind:`This integration declares device-adoption but its addon manifest has no brokerKind.`}},al={nav:{dashboard:`Dashboard`,integrations:`Integrazioni`,metrics:`Metriche`,detectionSection:`Detection`,detectionIntelligence:`Persone`,vehicles:`Veicoli`,clusterSection:`Cluster & Server`},system:{title:`Amministrazione`,addons:`Addon`,agents:`Agenti`,processes:`Processi`,logs:`Log`,users:`Utenti`,settings:`Impostazioni`,repl:`REPL`,models:`Modelli`,integrations:`Connettività`,serverManagement:`Server`},common:{save:`Salva`,cancel:`Annulla`,delete:`Elimina`,enable:`Abilita`,disable:`Disabilita`,edit:`Modifica`,add:`Aggiungi`,remove:`Rimuovi`,confirm:`Conferma`,close:`Chiudi`,back:`Indietro`,next:`Avanti`,search:`Cerca`,filter:`Filtra`,reset:`Reimposta`,apply:`Applica`,submit:`Invia`,loading:`Caricamento…`,error:`Errore`,success:`Successo`,warning:`Avviso`,info:`Info`,noData:`Nessun dato disponibile`,noResults:`Nessun risultato trovato`,retry:`Riprova`,refresh:`Aggiorna`,copy:`Copia`,copied:`Copiato!`,yes:`Sì`,no:`No`},connection:{disconnected:`Server non raggiungibile — riconnessione in corso…`,connected:`Connesso`,reconnecting:`Riconnessione in corso…`,degraded:`Connessione live interrotta — l'hub è online (un nodo del cluster potrebbe non rispondere), ripristino in corso…`,degradedNodes_one:`Cluster degradato — il nodo {{nodes}} non risponde. L'hub è online, ripristino del collegamento live…`,degradedNodes_other:`Cluster degradato — i nodi {{nodes}} non rispondono. L'hub è online, ripristino del collegamento live…`,degradedCount_one:`Cluster degradato — {{count}} nodo del cluster offline. L'hub è online, ripristino del collegamento live…`,degradedCount_other:`Cluster degradato — {{count}} nodi del cluster offline. L'hub è online, ripristino del collegamento live…`,sessionExpired:`Sessione scaduta — effettua di nuovo l'accesso.`,signIn:`Accedi`},passkeyPrompt:{message:`Vuoi salvare una passkey per accedere più velocemente?`,enrollNow:`Registra ora`,notNow:`Non ora`},status:{online:`Online`,offline:`Offline`,connecting:`Connessione in corso`,error:`Errore`,disabled:`Disabilitato`,enabled:`Abilitato`,active:`Attivo`,inactive:`Inattivo`,running:`In esecuzione`,stopped:`Fermato`,pending:`In attesa`,unknown:`Sconosciuto`},auth:{login:`Accesso`,logout:`Esci`,username:`Nome utente`,password:`Password`,signIn:`Accedi`,invalidCredentials:`Nome utente o password non validi`},theme:{dark:`Scuro`,light:`Chiaro`,system:`Sistema`},language:{select:`Lingua`,en:`Inglese`,it:`Italiano`},pages:{dashboard:{title:`Dashboard`,subtitle:`Panoramica di tutti i dispositivi e il loro stato`},integrations:{title:`Integrazioni`,subtitle:`Gestisci le sorgenti video e le connessioni ai provider`},metrics:{title:`Metriche`,subtitle:`Statistiche di prestazioni e utilizzo del sistema`},agents:{title:`Agenti`,subtitle:`Gestisci gli agenti di elaborazione distribuita`},addons:{title:`Addon`,subtitle:`Estendi le funzionalità con moduli addon`},settings:{title:`Impostazioni`,subtitle:`Configura le preferenze di sistema`},users:{title:`Utenti`,subtitle:`Gestisci gli account utente e i permessi`},logs:{title:`Log`,subtitle:`Visualizza i log di sistema e dei dispositivi`}},integrations:{preview:`Anteprima`,snapshotUnavailable:`Snapshot non disponibile`,noSnapshot:`Nessuno snapshot`,lastSnapshot:`Ultimo snapshot:`,offline:`Offline`,active:`Attivi`,available:`Disponibili`,noDevices:`Nessun dispositivo.`,addFirstDevice:`Aggiungi il primo dispositivo per iniziare.`,import:`+ Importa`,noProviders:`Nessun provider disponibile. Installa un addon provider.`,manage:`Gestisci`,integrationName:`Nome integrazione`,integrationNamePlaceholder:`es. Server Garage`,connectionSuccess:`Connessione riuscita!`,errorPrefix:`Errore:`,back:`Indietro`,testing:`Test...`,testConnection:`Test connessione`,forward:`Avanti`,searchingDevices:`Ricerca dispositivi in corso...`,foundDevices:`Trovati {{count}} dispositivi. Seleziona quelli da importare.`,noDevicesFound:`Nessun dispositivo trovato.`,skip:`Salta`,importSelected:`Importa selezionati`,newIntegration:`Nuova Integrazione`,configureIntegration:`Configura Integrazione`,importDevices:`Importa Dispositivi`,addDevice:`Aggiungi dispositivo`,name:`Nome`,namePlaceholder:`es. Camera Ingresso`,snapshotUrlOptional:`Snapshot URL (opzionale)`,streamUrls:`Stream URLs`,addStream:`Aggiungi stream`,cancel:`Annulla`,saving:`Salvataggio...`,save:`Salva`,saveAndNew:`Salva e nuova`,test:`Test`,stream:`Stream {{number}}:`,devices:`dispositivi`,rediscover:`Riscopri`,config:`Config`,integrationNotFound:`Integrazione non trovata.`,configComingSoon:`Config coming soon.`,providerConfig:`Provider Config`,editConfig:`Modifica configurazione`,relinkBrokerHelp:`Scegli il broker tramite cui questa integrazione si connette. Selezionando un broker diverso la si ricollega e riavvia l’addon.`,currentBroker:`Broker attuale`,relinkFailed:`Aggiornamento del collegamento al broker non riuscito.`,noBrokerKind:`Questa integrazione dichiara device-adoption ma il manifest dell’addon non ha un brokerKind.`},serverManagement:{title:`Gestione server`,subtitle:`Pacchetti radice aggiornabili a runtime per ogni nodo — gli aggiornamenti si installano nella data directory del nodo e si applicano al riavvio con rollback automatico.`,nodeHub:`hub`,nodeAgent:`agent`,nodeOffline:`offline`,lastReportedVersion:`Ultima versione riportata`,nodeRestarting:`Il nodo si sta riavviando per applicare la modifica…`,topologyError:`Impossibile caricare l'elenco dei nodi del cluster — viene mostrato solo il hub.`,checkForUpdate:`Controlla aggiornamenti`,updateTo:`Aggiorna a {{version}}`,rollback:`Ripristina {{version}}`,runningVersion:`Versione in esecuzione`,latestVersion:`Ultima sul registry`,previousVersion:`Precedente (destinazione rollback)`,seedVersion:`Versione seed immagine`,pendingVersion:`In attesa (si applica al riavvio)`,stateUpToDate:`aggiornato`,stateUpdateAvailable:`aggiornamento disponibile`,stateChecking:`controllo…`,stateStaging:`aggiornamento…`,statePending:`riavvio in sospeso`,stateAwaitingConfirmation:`in attesa di conferma`,stateRolledBack:`rollback eseguito (aggiornamento fallito)`,bootDataRoot:`aggiornabile a runtime`,bootWorkspace:`workspace di sviluppo`,bootBaked:`seed dell'immagine`,bakedSeed:`il seed dell'immagine`,lastChecked:`Ultimo controllo: {{when}}`,loadError:`Impossibile caricare lo stato del pacchetto radice del nodo.`,workspaceNote:`Workspace di sviluppo rilevato — gli aggiornamenti runtime sono disabilitati.`,rolledBackDetail:`Aggiornamento a {{from}} fallito, rollback a {{to}}: {{reason}}`,confirmUpdateTitle:`Aggiorna pacchetto radice del nodo`,confirmUpdateBody:`Installa {{pkg}}@{{version}} sul nodo "{{node}}" e riavvialo per applicarlo. La nuova versione parte in prova: se non raggiunge lo stato ready, il nodo torna automaticamente alla versione corrente. Richiede un supervisore che riavvii sempre il processo (restart policy Docker "unless-stopped" o "always"), altrimenti il nodo resta spento dopo essere uscito per applicare l'aggiornamento.`,confirmUpdateAction:`Aggiorna e riavvia`,confirmRollbackTitle:`Ripristina pacchetto radice del nodo`,confirmRollbackBody:`Riavviare il nodo "{{node}}" sulla versione precedente ({{version}})?`,confirmRollbackAction:`Ripristina e riavvia`,restart:`Riavvia`,nodeRuntimeVersion:`Runtime Node.js`,confirmRestartTitle:`Riavvia nodo`,confirmRestartBody:`Riavviare ora il nodo "{{node}}"? Il processo esce e il suo supervisore lo riavvia sulla stessa versione. Le richieste in corso verso questo nodo vengono interrotte.`,confirmRestartAction:`Riavvia`,updateAll:`Aggiorna tutti i nodi`,updateAllHint:`In sequenza: prima gli agent, l'hub per ultimo — i nodi già aggiornati vengono saltati.`,confirmUpdateAllTitle:`Aggiorna tutti i nodi`,confirmUpdateAllBody:`Aggiorna in sequenza ogni nodo online all'ultima versione pubblicata — prima gli agent, l'hub per ultimo. Ogni nodo installa il suo pacchetto radice (solo se più recente di quello in esecuzione) e riparte in prova con rollback automatico; i nodi già aggiornati vengono saltati. L'hub riparte per ultimo, quindi questa pagina si riconnetterà successivamente.`,confirmUpdateAllAction:`Aggiorna tutti e riavvia`,awaitingConfirmationWarning:`Questo nodo è ripartito su {{version}} e sta confermando lo stato di boot — evita di riavviarlo ora. Aggiornamento e rollback sono temporaneamente non disponibili finché il boot in prova non viene confermato; un riavvio manuale in questa finestra causerebbe il rollback automatico dell'aggiornamento.`,stateCorruptWarning:`Il file di stato server-root su questo nodo è corrotto — il nodo è partito dal seed dell'immagine e le versioni installate nella data directory vengono ignorate. Applicare un aggiornamento riscriverà il file di stato.`,phase2Note:`Fase 2: l'aggiornamento riguarda solo il processo principale di ciascun nodo (hub + agent docker) — i runner degli addon restano sull'overlay /data/framework e l'agent Electron resta legato al bundle fino alle fasi successive. Non assumere coerenza dell'intero stack da un singolo Update.`}},ol=`camstack_language`,sl=localStorage.getItem(ol)??`en`;Q.use(_s).init({resources:{en:{translation:il},it:{translation:al}},lng:sl,fallbackLng:`en`,interpolation:{escapeValue:!1}}),Q.on(`languageChanged`,e=>{localStorage.setItem(ol,e)}),F(),window.__camstackUiLibrary=se,window.__camstackSdk=h,window.__camstackTypes=De,Me(document.getElementById(`root`)).render(B(ve,{children:B(rl,{})}));export{si as A,Xr as B,_i as C,ui as D,di as E,ni as F,br as G,qr as H,ti as I,Or as J,Qt as K,ei as L,ai as M,ii as N,li as O,ri as P,Qr as R,vi as S,hi as T,Kr as U,Jr as V,X as W,Ti as _,zi as a,bi as b,Ii as c,Mi as d,Ai as f,Ei as g,Di as h,Bi as i,oi as j,ci as k,Pi as l,Oi as m,xs as n,Ri as o,ki as p,nn as q,Ja as r,Li as s,Ts as t,Ni as u,wi as v,gi as w,yi as x,Ci as y,Zr as z};
|
|
4
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=q(),d;if(t){let e=typeof t==`string`?Ue(t):t;H(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ke(e,{pathname:p});U(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),U(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=pn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:W([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:W([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?P(Vt.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function sn(){let e=Sn(),t=Et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=P(O,null,P(`p`,null,`💿 Hey developer 👋`),P(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,P(`code`,{style:a},`ErrorBoundary`),` or`,` `,P(`code`,{style:a},`errorElement`),` prop on your route.`)),P(O,null,P(`h2`,null,`Unexpected Application Error!`),P(`h3`,{style:{fontStyle:`italic`}},t),n?P(`pre`,{style:i},n):null,o)}var cn=P(sn,null),ln=class extends me{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=qt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:P(K.Provider,{value:this.props.routeContext},P(Ht.Provider,{value:e,children:this.props.component}));return this.context?P(dn,{error:e},t):t}};ln.contextType=It;var un=new WeakMap;function dn({children:e,error:t}){let{basename:n}=N(G);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Kt(t.digest);if(e){let r=un.get(t);if(r)throw r;let i=kt(e.location,n),a=i.absoluteURL||i.to;if(Nt(a))throw Error(`Invalid redirect location`);if(Ot&&!un.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw un.set(t,n),n}return P(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function fn({routeContext:e,match:t,children:n}){let r=N(Pt);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),P(K.Provider,{value:e},n)}function pn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);H(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Dt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||cn,o&&(s<0&&c===0?(Tn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?P(n.route.Component,null):n.route.element?n.route.element:e,P(fn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?P(ln,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hn(e){let t=N(Pt);return H(t,mn(e)),t}function gn(e){let t=N(Ft);return H(t,mn(e)),t}function _n(e){let t=N(K);return H(t,mn(e)),t}function vn(e){let t=_n(e),n=t.matches[t.matches.length-1];return H(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function yn(){return vn(`useRouteId`)}function bn(){let e=gn(`useNavigation`);return L(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function xn(){let{matches:e,loaderData:t}=gn(`useMatches`);return L(()=>e.map(e=>Je(e,t)),[e,t])}function Sn(){let e=N(Ht),t=gn(`useRouteError`),n=vn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Cn(){let{router:e}=hn(`useNavigate`),t=vn(`useNavigate`),n=M(!1);return Zt(()=>{n.current=!0}),j(async(r,i={})=>{U(n.current,Xt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var wn={};function Tn(e,t,n){!t&&!wn[e]&&(wn[e]=!0,U(!1,n))}pe(En);function En({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return on(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function J({to:e,replace:t,state:n,relative:r}){H(Yt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=N(G);U(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=N(K),{pathname:o}=q(),s=Qt(),c=yt(e,vt(a),o,r===`path`),l=JSON.stringify(c);return V(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Dn(e){return tn(e.context)}function Y(e){H(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function On({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){H(!Yt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ue(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=L(()=>{let e=pt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return U(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:P(G.Provider,{value:c},P(Vt.Provider,{children:t,value:h}))}function kn({children:e,location:t}){return an(An(e),t)}function An(e,t=[]){let n=[];return A.forEach(e,(e,r)=>{if(!de(e))return;let i=[...t,r];if(e.type===O){n.push.apply(n,An(e.props.children,i));return}H(e.type===Y,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),H(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=An(e.props.children,i)),n.push(a)}),n}var jn=`get`,Mn=`application/x-www-form-urlencoded`;function Nn(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Pn(e){return Nn(e)&&e.tagName.toLowerCase()===`button`}function Fn(e){return Nn(e)&&e.tagName.toLowerCase()===`form`}function In(e){return Nn(e)&&e.tagName.toLowerCase()===`input`}function Ln(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Rn(e,t){return e.button===0&&(!t||t===`_self`)&&!Ln(e)}function zn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Bn(e,t){let n=zn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Vn=null;function Hn(){if(Vn===null)try{new FormData(document.createElement(`form`),0),Vn=!1}catch{Vn=!0}return Vn}var Un=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Wn(e){return e!=null&&!Un.has(e)?(U(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mn}"`),null):e}function Gn(e,t){let n,r,i,a,o;if(Fn(e)){let o=e.getAttribute(`action`);r=o?pt(o,t):null,n=e.getAttribute(`method`)||jn,i=Wn(e.getAttribute(`enctype`))||Mn,a=new FormData(e)}else if(Pn(e)||In(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?pt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||jn,i=Wn(e.getAttribute(`formenctype`))||Wn(o.getAttribute(`enctype`))||Mn,a=new FormData(o,e),!Hn()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Nn(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=jn,r=null,i=Mn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Kn={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},qn=/[&><\u2028\u2029]/g;function Jn(e){return e.replace(qn,e=>Kn[e])}function Yn(e,t){if(e===!1||e==null)throw Error(t)}function Xn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&pt(i.pathname,t)===`/`?i.pathname=`${xt(t)}/_root.${r}`:i.pathname=`${xt(i.pathname)}.${r}`,i}async function Zn(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Qn(e){return e!=null&&typeof e.page==`string`}function $n(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function er(e,t,n){return ar((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Zn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter($n).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function tr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function nr(e,t,{includeHydrateFallback:n}={}){return rr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function rr(e){return[...new Set(e)]}function ir(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ar(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Qn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ir(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function or(){let e=N(Pt);return Yn(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function sr(){let e=N(Ft);return Yn(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var cr=k(void 0);cr.displayName=`FrameworkContext`;function lr(){let e=N(cr);return Yn(e,`You must render this element inside a <HydratedRouter> element`),e}function ur(e,t){let n=N(cr),[r,i]=z(!1),[a,o]=z(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=M(null);V(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),V(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:dr(s,p),onBlur:dr(c,m),onMouseEnter:dr(l,p),onMouseLeave:dr(u,m),onTouchStart:dr(d,p)}]:[a,f,{}]:[!1,f,{}]}function dr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function fr({page:e,...t}){let n=Lt(),{nonce:r}=lr(),{router:i}=or(),a=L(()=>Ke(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),P(n?mr:hr,{page:e,matches:a,...t})):null}function pr(e){let{manifest:t,routeModules:n}=lr(),[r,i]=z([]);return V(()=>{let r=!1;return er(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function mr({page:e,matches:t,...n}){let r=q(),{future:i}=lr(),{basename:a}=or();return P(O,null,L(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Xn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]).map(e=>P(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function hr({page:e,matches:t,...n}){let r=q(),{future:i,manifest:a,routeModules:o}=lr(),{basename:s}=or(),{loaderData:c,matches:l}=sr(),u=L(()=>tr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L(()=>tr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Xn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L(()=>nr(d,a),[d,a]),m=pr(d);return P(O,null,f.map(e=>P(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>P(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>P(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function gr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var _r=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{_r&&(window.__reactRouterVersion=`7.18.0`)}catch{}function vr({basename:e,children:t,useTransitions:n,window:r}){let i=M();i.current??=Re({window:r,v5Compat:!0});let a=i.current,[o,s]=z({action:a.action,location:a.location}),c=j(e=>{n===!1?s(e):he(()=>s(e))},[n]);return ge(()=>a.listen(c),[a,c]),P(On,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function yr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=z({action:n.action,location:n.location}),o=j(e=>{r===!1?a(e):he(()=>a(e))},[r]);return ge(()=>n.listen(o),[n,o]),P(On,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}yr.displayName=`unstable_HistoryRouter`;var br=Ce(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=N(G),v=typeof l==`string`&&Ne.test(l),y=kt(l,h);l=y.to;let b=Jt(l,{relative:r}),x=q(),S=null;if(o){let e=yt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:W([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=ur(n,p),E=Dr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let ee=!(y.isExternal||i),te=P(`a`,{...p,...T,href:(ee?S:void 0)||y.absoluteURL||b,onClick:ee?D:e,ref:gr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?P(O,null,te,P(fr,{page:b})):te});br.displayName=`Link`;var xr=Ce(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=rn(a,{relative:c.relative}),d=q(),f=N(Ft),{navigator:p,basename:m}=N(G),h=f!=null&&Rr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=pt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return P(br,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});xr.displayName=`NavLink`;var Sr=Ce(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=jn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=N(G),g=jr(),_=Mr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ne.test(s);return P(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?he(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Sr.displayName=`Form`;function Cr({getKey:e,storageKey:t,...n}){let r=N(cr),{basename:i}=N(G),a=q(),o=xn();Ir({getKey:e,storageKey:t});let s=L(()=>{if(!r||!e)return null;let t=Fr(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),P(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Jn(JSON.stringify(t||Nr))}, ${Jn(JSON.stringify(s))})`}})}Cr.displayName=`ScrollRestoration`;function wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tr(e){let t=N(Pt);return H(t,wr(e)),t}function Er(e){let t=N(Ft);return H(t,wr(e)),t}function Dr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Qt(),d=q(),f=rn(e,{relative:o});return j(p=>{if(Rn(p,t)){p.preventDefault();let t=n===void 0?He(d)===He(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?he(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Or(e){U(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M(zn(e)),n=M(!1),r=q(),i=L(()=>Bn(r.search,n.current?null:t.current),[r.search]),a=Qt();return[i,j((e,t)=>{let r=zn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var kr=0,Ar=()=>`__${String(++kr)}__`;function jr(){let{router:e}=Tr(`useSubmit`),{basename:t}=N(G),n=yn(),r=e.fetch,i=e.navigate;return j(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Gn(e,t);a.navigate===!1?await r(a.fetcherKey||Ar(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Mr(e,{relative:t}={}){let{basename:n}=N(G),r=N(K);H(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...rn(e||`.`,{relative:t})},o=q();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:W([n,a.pathname])),He(a)}var Nr=`react-router-scroll-positions`,Pr={};function Fr(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:pt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ir({getKey:e,storageKey:t}={}){let{router:n}=Tr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Er(`useScrollRestoration`),{basename:a}=N(G),o=q(),s=xn(),c=bn();V(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Lr(j(()=>{if(c.state===`idle`){let t=Fr(o,s,a,e);Pr[t]=window.scrollY}try{sessionStorage.setItem(t||Nr,JSON.stringify(Pr))}catch(e){U(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(ge(()=>{try{let e=sessionStorage.getItem(t||Nr);e&&(Pr=JSON.parse(e))}catch{}},[t]),ge(()=>{let t=n?.enableScrollRestoration(Pr,()=>window.scrollY,e?(t,n)=>Fr(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),ge(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{U(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Lr(e,t){let{capture:n}=t||{};V(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Rr(e,{relative:t}={}){let n=N(Rt);H(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Tr(`useViewTransitionState`),i=rn(e,{relative:t});if(!n.isTransitioning)return!1;let a=pt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=pt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return lt(i.pathname,o)!=null||lt(i.pathname,a)!=null}var zr=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Br=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Vr=e=>{let t=Br(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ur=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Wr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};F();var Gr=Ce(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>P(`svg`,{ref:c,...Wr,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hr(`lucide`,i),...!a&&!Ur(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>P(e,t)),...Array.isArray(a)?a:[a]]));F();var X=(e,t)=>{let n=Ce(({className:n,...r},i)=>P(Gr,{ref:i,iconNode:t,className:Hr(`lucide-${zr(Vr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Vr(e),n},Kr=X(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),qr=X(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Jr=X(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Yr=X(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Xr=X(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),Zr=X(`camera`,[[`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`,key:`1tc9qg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),Qr=X(`car`,[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]),$r=X(`check-check`,[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]),ei=X(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ti=X(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ni=X(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),ri=X(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ii=X(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ai=X(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),oi=X(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),si=X(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),ci=X(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),li=X(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ui=X(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),di=X(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),fi=X(`fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pi=X(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),mi=X(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),hi=X(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),gi=X(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),_i=X(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),vi=X(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),yi=X(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),bi=X(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),xi=X(`menu`,[[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 18h16`,key:`19g7jn`}],[`path`,{d:`M4 6h16`,key:`1o0s65`}]]),Si=X(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ci=X(`moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),wi=X(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Ti=X(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Ei=X(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),Di=X(`scan-face`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`path`,{d:`M9 9h.01`,key:`1q5me6`}],[`path`,{d:`M15 9h.01`,key:`x1ddxp`}]]),Oi=X(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ki=X(`settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ai=X(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ji=X(`shield-x`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),Mi=X(`sliders-horizontal`,[[`line`,{x1:`21`,x2:`14`,y1:`4`,y2:`4`,key:`obuewd`}],[`line`,{x1:`10`,x2:`3`,y1:`4`,y2:`4`,key:`1q6298`}],[`line`,{x1:`21`,x2:`12`,y1:`12`,y2:`12`,key:`1iu8h1`}],[`line`,{x1:`8`,x2:`3`,y1:`12`,y2:`12`,key:`ntss68`}],[`line`,{x1:`21`,x2:`16`,y1:`20`,y2:`20`,key:`14d8ph`}],[`line`,{x1:`12`,x2:`3`,y1:`20`,y2:`20`,key:`m0wm8r`}],[`line`,{x1:`14`,x2:`14`,y1:`2`,y2:`6`,key:`14e1ph`}],[`line`,{x1:`8`,x2:`8`,y1:`10`,y2:`14`,key:`1i6ji0`}],[`line`,{x1:`16`,x2:`16`,y1:`18`,y2:`22`,key:`1lctlv`}]]),Ni=X(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Pi=X(`sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Fi=X(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ii=X(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Li=X(`trash-2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Ri=X(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),zi=X(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Bi=X(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Vi=X(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]);F();function Hi({tabs:e,active:t,onChange:n}){return B(`div`,{className:`flex rounded-lg border border-border bg-surface p-0.5 gap-0.5`,children:e.map(e=>B(`button`,{type:`button`,onClick:()=>n(e.id),className:[`flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors`,t===e.id?`bg-primary/12 text-primary`:`text-foreground-subtle hover:text-foreground hover:bg-surface-hover`].join(` `),children:e.label},e.id))})}function Ui(e){let t=e.formats;if(!t)return``;let n=Object.values(t).filter(e=>e!==void 0&&e.sizeMB>0).map(e=>e.sizeMB);if(n.length===0)return``;let r=Math.min(...n),i=Math.max(...n);return r===i?`${r} MB`:`${r}-${i} MB`}function Wi(e){return`${e.inputSize.width}x${e.inputSize.height}`}function Gi(e){return e.formats?Object.keys(e.formats).filter(t=>e.formats[t]!==void 0):[]}function Ki({entry:e,selected:t,onSelect:n,disabled:r}){let i=Ui(e),a=Wi(e),o=Gi(e);return I(`button`,{type:`button`,onClick:n,disabled:r,className:[`w-full text-left rounded-lg border p-3 transition-all`,t?`border-primary bg-primary/5 ring-1 ring-primary/30`:`border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50`,r?`opacity-50 cursor-not-allowed`:`cursor-pointer`].join(` `),children:[B(`div`,{className:`flex items-start justify-between gap-2`,children:I(`div`,{className:`flex-1 min-w-0`,children:[I(`div`,{className:`flex items-center gap-2`,children:[B(`span`,{className:`text-xs font-semibold text-foreground truncate`,children:e.name}),t&&B(ei,{className:`h-3.5 w-3.5 text-primary shrink-0`})]}),B(`p`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.description})]})}),I(`div`,{className:`flex items-center gap-3 mt-2 flex-wrap`,children:[I(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-foreground-subtle`,children:[B(oi,{className:`h-3 w-3`}),a]}),i&&B(`span`,{className:`text-[10px] text-foreground-subtle`,children:i}),o.length>0&&B(`div`,{className:`flex gap-1`,children:o.map(e=>B(`span`,{className:`text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono`,children:e},e))}),e.labels.length>0&&I(`span`,{className:`text-[10px] text-foreground-subtle`,children:[e.labels.length,` label`,e.labels.length===1?``:`s`]})]})]})}function qi({field:e,value:t,onChange:n,disabled:r}){let i=e.catalog??[],a=i.length>0,o=Ee(i).length>0,s=e.allowCustomPath!==!1||e.allowCustom===!0,c=[...a?[{id:`catalog`,label:`Models (${i.length})`}]:[],...s?[{id:`custom`,label:`Custom Path`}]:[]],[l,u]=z(a?`catalog`:`custom`),d=t==null?``:String(t);return I(`div`,{className:`space-y-3`,children:[c.length>1&&B(Hi,{tabs:c,active:l,onChange:u}),l===`catalog`&&a&&o&&B(m,{catalog:i,value:d,onChange:e=>n(e),disabled:r||e.disabled}),l===`catalog`&&a&&!o&&B(`div`,{className:`space-y-1.5 max-h-[320px] overflow-y-auto pr-1`,children:i.filter(e=>e.legacy!==!0).map(t=>B(Ki,{entry:t,selected:d===t.id,onSelect:()=>n(t.id),disabled:r||e.disabled},t.id))}),l===`catalog`&&!a&&I(`div`,{className:`rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2`,children:[B(gi,{className:`h-3.5 w-3.5 text-info shrink-0 mt-0.5`}),B(`p`,{className:`text-[11px] text-foreground-subtle leading-relaxed`,children:`No predefined models available. Use the Custom Path tab to specify a model file path or URL.`})]}),l===`custom`&&s&&I(`div`,{className:`space-y-2`,children:[B(`input`,{type:`text`,className:`w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50`,placeholder:`Enter path like /data/models/custom.onnx or https://...`,value:d,disabled:r||e.disabled,onChange:e=>n(e.target.value)}),e.acceptFormats&&e.acceptFormats.length>0&&I(`p`,{className:`text-[10px] text-foreground-subtle`,children:[`Accepted formats: `,e.acceptFormats.join(`, `)]})]}),(e.compatibilityNote||e.conversionGuideUrl)&&I(`div`,{className:`flex items-start justify-between gap-3 pt-1`,children:[e.compatibilityNote&&I(`p`,{className:`flex items-start gap-1 text-[10px] text-foreground-subtle`,children:[B(gi,{className:`h-3 w-3 mt-0.5 shrink-0`}),e.compatibilityNote]}),e.conversionGuideUrl&&I(`a`,{href:e.conversionGuideUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-[11px] text-primary hover:underline shrink-0`,children:[`How to convert your model`,B(ci,{className:`h-3 w-3`})]})]})]})}function Ji(e){let t=ke();return be({queryKey:[`field-resolver`,e?.capName??`<none>`,e?.methodName??`<none>`,e?.input??{}],enabled:!!e,queryFn:async()=>{if(!e)throw Error(`useFieldResolver: resolver is null (enabled guard should have prevented this)`);let n=e=>e!==null&&(typeof e==`object`||typeof e==`function`),r=Reflect.get(t.trpcClient,e.capName);if(!n(r))throw Error(`useFieldResolver: no cap namespace '${e.capName}' on the tRPC client`);let i=Reflect.get(r,e.methodName);if(!n(i))throw Error(`useFieldResolver: no method '${e.methodName}' on cap '${e.capName}'`);let a=Reflect.get(i,`query`);if(typeof a!=`function`)throw Error(`useFieldResolver: '${e.capName}.${e.methodName}' has no .query() (resolvers must be query methods, not mutations)`);return await a(e.input??{})}})}F();function Yi(e){return typeof e==`string`&&e.length>0&&e!==`undefined`&&e!==`null`}function Xi(e={}){let t=we(),n=le(void 0,{enabled:e.enabled??!0}),r=L(()=>(n.data??[]).filter(e=>Yi(e.nodeId)),[n.data]),i=j(()=>{t.invalidateQueries({queryKey:[`pipelineOrchestrator`,`listAgentSettings`]})},[t]);return{agents:r,isLoading:n.isLoading,isError:n.isError,error:n.error,refetch:()=>{n.refetch()},invalidate:i}}F();function Zi({field:e,disabled:t}){let n=we(),r=e.deviceId,i=Ji(e.catalogResolver),a=ce({deviceId:r}),o=ae({onSuccess:()=>{n.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getCameraSettings`]]}),n.invalidateQueries({queryKey:[[`deviceManager`]]})}}),s=i.data,c=a.data??null,l=L(()=>s?na(s,c):[],[s,c]),u=L(()=>{if(!s)return{};let e={};for(let t of s.slots)for(let n of t.addons)e[n.id]=n.enabledByDefault??!0;return e},[s]);return i.error?I(`div`,{className:`text-xs text-red-400`,children:[`Failed to load pipeline catalog for `,B(`code`,{children:e.nodeId}),`:`,` `,String(i.error.message??i.error)]}):i.isLoading||!s?I(`div`,{className:`text-xs text-foreground-subtle animate-pulse`,children:[`Loading pipeline for `,e.nodeId,`…`]}):I(`div`,{className:`col-span-full space-y-4`,children:[I(`div`,{className:`flex items-center gap-2 text-[11px] text-foreground-subtle`,children:[`Agent: `,B(`span`,{className:`text-foreground`,children:e.nodeId}),I(`span`,{className:`ml-2`,children:[`Engine:`,` `,B(`span`,{className:`text-foreground font-mono`,children:`${s.selectedEngine.runtime}/${s.selectedEngine.backend}`})]}),I(`span`,{className:`ml-auto text-[10px]`,children:[`Model + settings edited on Pipeline → `,e.nodeId,`.`]})]}),B(w,{schema:s,steps:l,onChange:()=>{},templates:[],selectedTemplateId:null,onSelectTemplate:()=>{},onSaveTemplate:()=>{},onUpdateTemplate:()=>{},onDeleteTemplate:()=>{},readOnly:t===!0,hideTemplates:!0,toggleMode:`threeState`,hideModelAndSettings:!0,overrides:c?.stepToggles??{},onOverrideChange:(e,t)=>o.mutate({deviceId:r,addonId:e,enabled:t}),inheritedEnabledByAddon:u}),B(ta,{deviceId:r,currentAgentNodeId:e.nodeId,catalog:s,pipelineByAgent:ea(c?.pipelineByAgent,s),disabled:t===!0})]})}function Qi(e,t){for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e.defaultModelId}function $i(e,t){return e?{modelId:e.modelId??Qi(t,`audio-classifier`)??``,enabled:e.enabled}:null}function ea(e,t){let n={};for(let[r,i]of Object.entries(e??{}))n[r]={steps:i.steps,audio:$i(i.audio,t)};return n}function ta({deviceId:e,currentAgentNodeId:t,catalog:n,pipelineByAgent:r,disabled:i}){let a=we(),[o,s]=z(!1),[l,u]=z(t),{agents:d}=Xi({enabled:o}),f=S({deviceId:e,agentNodeId:l},{enabled:o}),p=c({onSuccess:()=>{a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`getCameraSettings`]]}),a.invalidateQueries({queryKey:[[`pipelineOrchestrator`,`resolvePipeline`]]})}}),m=r[l]??null,h=d,g=L(()=>m?ra(m.steps,n):[],[m,n]);return I(`section`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[I(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`w-full px-4 py-2 flex items-center gap-2 hover:bg-surface-hover`,children:[B(o?ti:ri,{className:`h-3 w-3`}),B(`h3`,{className:`text-xs font-semibold text-foreground uppercase tracking-wide`,children:`Advanced — custom pipeline per agent`}),B(`span`,{className:`ml-auto text-[10px] text-foreground-subtle`,children:Object.keys(r).length>0?`${Object.keys(r).length} override(s) active`:`None configured`})]}),o&&I(`div`,{className:`border-t border-border px-4 py-3 space-y-3`,children:[I(`div`,{className:`flex items-center gap-2 text-xs`,children:[B(`span`,{className:`text-foreground-subtle`,children:`Agent:`}),I(`select`,{value:l,disabled:i,onChange:e=>u(e.target.value),className:`rounded border border-border bg-surface-hover px-2 py-1 text-xs text-foreground focus:outline-none focus:border-primary`,children:[typeof t==`string`&&t.length>0&&t!==`undefined`&&I(`option`,{value:t,children:[t,` (current)`]}),h.filter(e=>e.nodeId!==t).map(e=>B(`option`,{value:e.nodeId,children:e.nodeId},e.nodeId))]}),r[l]&&I(`button`,{type:`button`,onClick:()=>{window.confirm(`Remove custom pipeline override for ${l}? The camera will revert to the agent default + step toggles.`)&&p.mutate({deviceId:e,agentNodeId:l,pipeline:null})},disabled:i||p.isPending,className:`ml-auto inline-flex items-center gap-1 px-2 py-1 text-[11px] text-red-400 hover:bg-red-500/10 rounded disabled:opacity-50`,children:[B(Li,{className:`h-3 w-3`}),`Remove override`]})]}),m?B(w,{schema:n,steps:g,onChange:t=>{let n=m?.audio??null;p.mutate({deviceId:e,agentNodeId:l,pipeline:{steps:ia(t),audio:n?{modelId:n.modelId,enabled:n.enabled}:null}})},templates:[],selectedTemplateId:null,onSelectTemplate:()=>{},onSaveTemplate:()=>{},onUpdateTemplate:()=>{},onDeleteTemplate:()=>{},readOnly:i,hideTemplates:!0,allowAutoModel:!0}):I(`div`,{className:`text-xs text-foreground-subtle space-y-2`,children:[I(`p`,{children:[`No custom pipeline for `,B(`code`,{children:l}),`. The camera uses the agent's default + step toggles.`]}),B(`button`,{type:`button`,onClick:()=>{let t=f.data;t&&p.mutate({deviceId:e,agentNodeId:l,pipeline:{steps:t.steps,audio:$i(t.audio,n)}})},disabled:i||p.isPending||!f.data,className:`inline-flex items-center gap-1 px-3 py-1.5 text-xs font-medium rounded bg-primary/15 text-primary hover:bg-primary/25 disabled:opacity-50`,children:`Create wholesale override from current default`})]})]})]})}function na(e,t){let n=t=>{for(let n of e.slots)for(let e of n.addons)if(e.id===t)return e;return null},r=e=>{let n=e.enabledByDefault??!0,r=t?.stepToggles?.[e.id],i=r===void 0?n:r;return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:i,modelId:e.defaultModelId,children:[]}},i=new Map;for(let t of e.slots)for(let e of t.addons)i.set(e.id,r(e));let a=[],o=new Set;for(let[e,t]of i){let r=n(e);r&&r.inputClasses.length===0&&(a.push(t),o.add(e))}let s=!0;for(;s;){s=!1;for(let[e,t]of i){if(o.has(e))continue;let r=n(e);if(r)for(let[a,c]of i){if(a===e)continue;let i=n(a);if(i&&o.has(a)&&i.outputClasses.some(e=>r.inputClasses.includes(e))){c.children.push(t),o.add(e),s=!0;break}}}}return a}function ra(e,t){let n=new Map;for(let e of t.slots)for(let t of e.addons)n.set(t.id,t);let r=e=>{let t=n.get(e.addonId);return{addonId:e.addonId,addonName:t?.name??e.addonId,slot:t?.slot??`detector`,inputClasses:t?.inputClasses?[...t.inputClasses]:[],outputClasses:t?.outputClasses?[...t.outputClasses]:[],enabled:e.enabled,modelId:e.modelId??``,children:(e.children??[]).map(r),...e.settings?{settings:{...e.settings}}:{}}};return[...e].map(r)}function ia(e){let t=e=>({addonId:e.addonId,...e.modelId?{modelId:e.modelId}:{},enabled:e.enabled,children:e.children.map(t),...e.settings?{settings:{...e.settings}}:{}});return e.map(t)}F();function aa(){let e=ke(),t=we(),[n,r]=z(()=>e.isConnected()?`connected`:`disconnected`),i=M(!1),[a,o]=z(0),[s,c]=z([]);V(()=>e.subscribeConnectionEvents(e=>{r(t=>(t!==`connected`&&e===`connected`&&i.current&&o(e=>e+1),e!==`connected`&&(i.current=!0),e))}),[e]),V(()=>{a!==0&&t.invalidateQueries({queryKey:[[`addons`,`getLastRestart`]]})},[a,t]);let{data:l}=E(void 0,{enabled:n===`connected`&&a>0,staleTime:0,refetchOnMount:!1,refetchOnWindowFocus:!1}),u=M(null);return V(()=>{if(l==null||l.requestedAt===u.current)return;u.current=l.requestedAt;let e=sa(l);c(t=>[...t,e]);let t=window.setTimeout(()=>{c(t=>t.filter(t=>t.id!==e.id))},6e3);return()=>window.clearTimeout(t)},[l]),B(xe,{children:s.length>0&&B(oa,{toasts:s})})}function oa({toasts:e}){return B(`div`,{className:`fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>I(`div`,{className:`pointer-events-auto flex items-start gap-2 px-3 py-2.5 rounded-md border border-green-500/30 bg-green-500/10 shadow-lg backdrop-blur-sm`,children:[B(ai,{className:`w-4 h-4 shrink-0 mt-0.5 text-green-400`}),I(`div`,{children:[B(`div`,{className:`text-[11px] font-semibold text-foreground`,children:e.title}),B(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5`,children:e.message})]})]},e.id))})}function sa(e){let t=`restart-${e.requestedAt}`;if(e.kind===`framework-update`&&e.packageName!==void 0&&e.toVersion!==void 0){let n=e.fromVersion===void 0?`v${e.toVersion}`:`v${e.fromVersion} → v${e.toVersion}`;return{id:t,title:`Framework updated`,message:`${e.packageName} is now ${n}.`}}return{id:t,title:`Server restarted`,message:e.requestedBy===void 0?`Manual restart completed.`:`Manual restart by ${e.requestedBy} completed.`}}F();var ca={info:{bg:`bg-blue-500/10`,border:`border-blue-500/30`,icon:gi},warning:{bg:`bg-orange-500/10`,border:`border-orange-500/30`,icon:Ri},critical:{bg:`bg-red-500/10`,border:`border-red-500/30`,icon:ii}};function la({toast:e,onDismiss:t}){let n=ca[e.severity]??ca.info,r=n.icon;return V(()=>{let n=e.duration??5e3;if(n<=0)return;let r=setTimeout(()=>t(e.id),n);return()=>clearTimeout(r)},[e.id,e.duration,t]),I(`div`,{className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${n.border} ${n.bg} shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:[B(r,{className:`h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle`}),I(`div`,{className:`flex-1 min-w-0`,children:[B(`div`,{className:`text-xs font-semibold text-foreground`,children:e.title}),B(`div`,{className:`text-[11px] text-foreground-subtle mt-0.5`,children:e.message})]}),B(`button`,{type:`button`,onClick:()=>t(e.id),className:`shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors`,children:B(Bi,{className:`h-3.5 w-3.5 text-foreground-subtle`})})]})}function ua(){let[e,t]=z([]),n=j(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return te(void 0,{onData:e=>{let n=e,r=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;t(e=>[...e,{...n,id:r,timestamp:Date.now()}])}}),e.length===0?null:B(`div`,{className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>B(`div`,{className:`pointer-events-auto`,children:B(la,{toast:e,onDismiss:n})},e.id))})}function da(e){return e.hubReachable?e.authOk===!1?{kind:`auth-expired`}:{kind:`cluster-degraded`,offlineAgents:e.offlineAgents,offlineAgentIds:e.offlineAgentIds}:{kind:`hub-unreachable`}}function fa(e){switch(e.kind){case`connected`:return null;case`reconnecting`:return{severity:`warning`,message:`Reconnecting…`,i18nKey:`connection.reconnecting`,showSpinner:!0};case`cluster-degraded`:{let t=e.offlineAgentIds??[];return t.length>0?{severity:`warning`,message:`Cluster degraded — ${t.length===1?`node ${t[0]}`:`nodes ${t.join(`, `)}`} not responding. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedNodes`,i18nParams:{nodes:t.join(`, `),count:t.length},showSpinner:!0}:e.offlineAgents!==null&&e.offlineAgents>0?{severity:`warning`,message:`Cluster degraded — ${e.offlineAgents} cluster node${e.offlineAgents===1?``:`s`} offline. Hub is online, live link re-establishing…`,i18nKey:`connection.degradedCount`,i18nParams:{count:e.offlineAgents},showSpinner:!0}:{severity:`warning`,message:`Live connection interrupted — hub is online (a cluster node may be unresponsive), re-establishing…`,i18nKey:`connection.degraded`,showSpinner:!0}}case`hub-unreachable`:return{severity:`danger`,message:`Server unreachable — reconnecting…`,i18nKey:`connection.disconnected`,showSpinner:!0};case`auth-expired`:return{severity:`danger`,message:`Session expired — please sign in again.`,i18nKey:`connection.sessionExpired`,showSpinner:!1,action:`sign-in`}}}var pa=4e3,ma=5e3;function ha(e){if(typeof e!=`object`||!e)return{offline:null,offlineIds:null,ok:null};let t={...e},n=typeof t.ok==`boolean`?t.ok:null,r=t.agents;if(typeof r!=`object`||!r)return{offline:null,offlineIds:null,ok:n};let i={...r},a=i.offline,o=typeof a==`number`?a:null,s=i.offlineIds;return{offline:o,offlineIds:Array.isArray(s)?s.filter(e=>typeof e==`string`):null,ok:n}}async function ga(e,t,n,r){let i=new AbortController,a=setTimeout(()=>i.abort(),n);try{return await e(t,{method:`GET`,signal:i.signal,credentials:`omit`,...r===void 0?{}:{headers:r}})}finally{clearTimeout(a)}}async function _a(e){let t=e.fetchFn??fetch,n=e.timeoutMs??pa,r=e.origin.replace(/\/+$/,``),i;try{i=await ga(t,`${r}/health`,n)}catch{return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null}}if(!i.ok)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let a=null,o=e.getToken();if(o!==null&&o!==``)try{let e=await ga(t,`${r}/health/details`,n,{Authorization:`Bearer ${o}`});e.ok&&(a=await e.json())}catch{}let s;try{s=ha(a??await i.json())}catch{s={offline:null,offlineIds:null,ok:null}}if(s.ok===!1)return{hubReachable:!1,authOk:`unknown`,offlineAgents:null,offlineAgentIds:null};let c=e.getToken(),l=`unknown`;if(c!==null&&c!==``)try{let e=await ga(t,`${r}/trpc/auth.me`,n,{Authorization:`Bearer ${c}`});e.status===401||e.status===403?l=!1:e.ok&&(l=!0)}catch{l=`unknown`}return{hubReachable:!0,authOk:l,offlineAgents:s.offline,offlineAgentIds:s.offlineIds}}var va={kind:`connected`},ya={kind:`reconnecting`};function ba(e){let t=e.probeIntervalMs??ma,n=new Set,r=va,i=0,a=!1,o=null;function s(e){if(r!==e){r=e;for(let e of n)e()}}function c(){a=!1,o!==null&&(clearTimeout(o),o=null)}function l(){let n=i;e.probe().then(e=>{n!==i||!a||(s(da(e)),o=setTimeout(l,t))},()=>{n!==i||!a||(s({kind:`hub-unreachable`}),o=setTimeout(l,t))})}function u(e){if(i+=1,e===`connected`){c(),s(va);return}if(e===`connecting`){c(),s(ya);return}(r.kind===`connected`||r.kind===`reconnecting`)&&s(ya),o!==null&&(clearTimeout(o),o=null),a=!0,l()}return{getSnapshot:()=>r,subscribe:e=>(n.add(e),()=>{n.delete(e)}),onSdkConnectionState:u,dispose:()=>{i+=1,c(),n.clear()}}}var xa=null;function Sa(){return xa===null&&(xa=ba({probe:()=>_a({origin:window.location.origin,getToken:()=>localStorage.getItem(`camstack_admin_token`)})})),xa}function Ca(e){Sa().onSdkConnectionState(e)}var wa=null;function Ta(){if(!wa){let e=window.location.origin;wa=b({serverUrl:e,token:localStorage.getItem(`camstack_admin_token`)??void 0,onConnectionChange:e=>Ca(e)})}return wa}function Ea(){wa?.close(),wa=null}function Da(e){try{let t=e.split(`.`);if(t.length<2||!t[1])return null;let n=JSON.parse(atob(t[1]));return{id:String(n.userId??``),username:String(n.username??`unknown`),isAdmin:!!n.isAdmin,exp:Number(n.exp??0),scopes:Aa(n.scopes)}}catch{return null}}var Oa=new Set([`view`,`create`,`delete`]),ka=new Set([`category`,`capability`,`addon`,`device`]);function Aa(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n,{type:r,access:i}=e;if(typeof r!=`string`||!ka.has(r)||!Array.isArray(i))continue;let a=i.filter(e=>typeof e==`string`&&Oa.has(e));if(a.length===0)continue;if(r===`device`){let n=e.targets;if(!Array.isArray(n))continue;let r=n.filter(e=>typeof e==`string`&&e.length>0);if(r.length===0)continue;t.push({type:`device`,targets:r,access:a});continue}let o=e.target;if(typeof o==`string`)if(r===`category`){if(o!==`device`&&o!==`system`)continue;t.push({type:r,target:o,access:a})}else r===`capability`?t.push({type:r,target:o,access:a}):t.push({type:`addon`,target:o,access:a})}return t}function ja(e){let t=Da(e);return t?t.exp*1e3<Date.now():!0}var Ma=[`camstack://auth-callback`,`camstack.dev://auth-callback`],Na=512;function Pa(e){return e.replace(/^([a-z][a-z0-9.+-]*):\/\/\/(?!\/)/i,`$1://`).replace(/\/$/,``)}function Fa(e){if(!e||e.length>Na)return null;let t=Pa(e);return Ma.includes(t)?{kind:`app-callback`,url:t}:!e.startsWith(`/`)||e.startsWith(`//`)||e.includes(`\\`)||e.includes(`://`)||e.includes(`..`)||e===`/login`||e.startsWith(`/login?`)||e.startsWith(`/login/`)?null:{kind:`path`,path:e}}function Ia(e,t){return`${e}?code=${encodeURIComponent(t)}`}function La(e,t=Date.now()){return Ha(t)??Fa(e)}var Ra=`camstack:login-redirect`,za=10*6e4;function Ba(){if(typeof window>`u`)return null;try{return window.sessionStorage}catch{return null}}function Va(e,t=Date.now()){let n=Ba();if(!n||!Fa(e))return;let r={raw:e??``,at:t};try{n.setItem(Ra,JSON.stringify(r))}catch{}}function Ha(e=Date.now()){let t=Ba();if(!t)return null;let n=null;try{n=t.getItem(Ra),t.removeItem(Ra)}catch{return null}if(!n)return null;try{let t=JSON.parse(n);if(typeof t!=`object`||!t)return null;let r=Reflect.get(t,`at`),i=Reflect.get(t,`raw`);return typeof r!=`number`||typeof i!=`string`||e-r>za?null:Fa(i)}catch{return null}}F();var Ua=`changeme`;async function Wa(e){await fetch(`/api/auth/session`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:e})}).catch(()=>{})}async function Ga(e,t){if(await Wa(e),t.kind===`path`){window.location.replace(t.path);return}try{Ea();let{code:e}=await Ta().trpcClient.auth.createHandoffCode.mutate();window.location.replace(Ia(t.url,e))}catch{window.location.replace(`/admin`)}}var Ka=k(null);function qa({children:e}){let[t,n]=z(null),[r,i]=z(!0),[a,o]=z(!1);V(()=>{if(typeof window<`u`&&window.location.hash.startsWith(`#token=`)){let e=new URLSearchParams(window.location.hash.slice(1)).get(`token`);if(e){localStorage.setItem(`camstack_admin_token`,e);let t=Ha();if(t){Ga(e,t);return}window.history.replaceState({},``,`/admin`)}}let e=localStorage.getItem(`camstack_admin_token`);if(!e){i(!1);return}if(ja(e)){localStorage.removeItem(`camstack_admin_token`),i(!1);return}let t=Da(e);if(!t){localStorage.removeItem(`camstack_admin_token`),i(!1);return}Ta().trpcClient.system.info.query().then(()=>n(t)).catch(e=>{let r=e?.data?.code;r===`UNAUTHORIZED`||r===`FORBIDDEN`?(localStorage.removeItem(`camstack_admin_token`),Ea()):n(t)}).finally(()=>i(!1))},[]);let s=j(async(e,t)=>{let r=await Ta().login(e,t),i=r.secondFactors??(r.requiresTotp===!0?[`totp`]:[]);if(i.length>0)return{kind:`second-factor`,challengeToken:r.token,factors:i};let a=r.token;return localStorage.setItem(`camstack_admin_token`,a),await Wa(a),Ea(),n(Da(a)),o(t===Ua),{kind:`ok`}},[]),c=j(async(e,t)=>{let r=(await Ta().loginVerifyTotp(e,t)).token;localStorage.setItem(`camstack_admin_token`,r),await Wa(r),Ea(),n(Da(r)),o(!1)},[]),l=j(async e=>{localStorage.setItem(`camstack_admin_token`,e),await Wa(e),Ea(),n(Da(e)),o(!1)},[]),u=j(()=>{localStorage.removeItem(`camstack_admin_token`),fetch(`/api/auth/session`,{method:`DELETE`}).catch(()=>{}),Ea(),n(null),o(!1)},[]),d=j(()=>{o(!1)},[]);return B(Ka.Provider,{value:{user:t,loading:r,mustChangePassword:a,login:s,verifyTotp:c,finalizePasskeyLogin:l,logout:u,clearMustChangePassword:d},children:e})}function Ja(){let e=N(Ka);if(!e)throw Error(`useAuth must be used within AuthProvider`);return e}F();var Ya=3e4;function Xa(e){let t=M(e);t.current=e,V(()=>{let e=null,n=()=>{if(document.visibilityState===`hidden`){e=Date.now();return}if(document.visibilityState===`visible`&&e!==null){let n=Date.now()-e;e=null,n>=Ya&&t.current()}},r=()=>{t.current()},i=e=>{e.persisted&&t.current()};return document.addEventListener(`visibilitychange`,n),window.addEventListener(`online`,r),window.addEventListener(`pageshow`,i),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`online`,r),window.removeEventListener(`pageshow`,i)}},[])}F();function Za(e){let t=new Set,n=new Set,r=e=>e.page.remoteName.includes(e.addonId.replace(/[^a-zA-Z0-9]+/g,`_`)),i=[...e.filter(r),...e.filter(e=>!r(e))],a=[];for(let e of i){let r=`${e.addonId}::${e.page.id}`;t.has(r)||n.has(e.page.path)||(t.add(r),n.add(e.page.path),a.push({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,remoteName:e.page.remoteName,bundle:e.page.bundle,bundleUrl:e.bundleUrl,...e.page.section===void 0?{}:{section:e.page.section},...e.page.sectionLabel===void 0?{}:{sectionLabel:e.page.sectionLabel}}))}return a}var Qa=new Map,$a=new Map,eo=new Set;function to(e){return!e||typeof e!=`object`?!1:typeof e.default==`function`}async function no(e,t){let i=Qa.get(e);if(i)return i;let a=$a.get(e);if(a)return a;eo.has(e)||(ue(),r([{name:e,entry:t,type:`module`}],{force:!1}),eo.add(e));let o=n(`${e}/page`).then(n=>{if(!to(n))throw Error(`Addon page remote ${e} (${t}) does not expose a default React component on './page'`);return Qa.set(e,n.default),$a.delete(e),n.default}).catch(t=>{throw $a.delete(e),t});return $a.set(e,o),o}function ro(){let{pagePath:e}=nn(),t=ke(),{data:n}=ee(void 0),r=L(()=>n?Za(n):void 0,[n]),i=r?.find(t=>t.path===`/addon/${e}`),[a,o]=z(null),[s,c]=z(null);return V(()=>{if(!i)return;c(null),o(null);let e=!1;return no(i.remoteName,i.bundleUrl).then(t=>{e||o(()=>t)}).catch(t=>{e||c(`Failed to load addon page: ${t instanceof Error?t.message:String(t)}`)}),()=>{e=!0}},[i]),r?i?s?B(`div`,{className:`flex items-center justify-center h-full text-red-400 text-sm`,children:s}):a?B(a,{trpc:t.trpcClient,theme:{isDark:document.documentElement.classList.contains(`dark`)},navigate:e=>{window.location.href=e}}):B(`div`,{className:`flex items-center justify-center h-full`,children:B(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})}):B(`div`,{className:`flex items-center justify-center h-full text-foreground-subtle`,children:`Addon page not found`}):B(`div`,{className:`flex items-center justify-center h-full`,children:B(`div`,{className:`animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full`})})}Ae();var Z=e=>typeof e==`string`,io=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ao=e=>e==null?``:String(e),oo=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},so=/###/g,co=e=>e&&e.includes(`###`)?e.replace(so,`.`):e,lo=e=>!e||Z(e),uo=(e,t,n)=>{let r=Z(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(lo(e))return{};let t=co(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return lo(e)?{}:{obj:e,k:co(r[i])}},fo=(e,t,n)=>{let{obj:r,k:i}=uo(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=uo(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=uo(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},po=(e,t,n,r)=>{let{obj:i,k:a}=uo(e,t,Object);i[a]=i[a]||[],i[a].push(n)},mo=(e,t)=>{let{obj:n,k:r}=uo(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},ho=(e,t,n)=>{let r=mo(e,n);return r===void 0?mo(t,n):r},go=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Z(e[r])||e[r]instanceof String||Z(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):go(e[r],t[r],n):e[r]=t[r]);return e},_o=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),vo={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`,"/":`/`},yo=e=>Z(e)?e.replace(/[&<>"'\/]/g,e=>vo[e]):e,bo=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let 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}},xo=[` `,`,`,`?`,`!`,`;`],So=new bo(20),Co=(e,t,n)=>{t||=``,n||=``;let r=xo.filter(e=>!t.includes(e)&&!n.includes(e));if(r.length===0)return!0;let i=So.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},wo=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].includes(typeof t)&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},To=e=>e?.replace(/_/g,`-`),Eo={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},Do=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Eo,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>Z(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e),Z(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},Oo=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n(e,...t)})}},ko=class extends Oo{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.includes(`.`)?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Z(n)&&i?o.push(...n.split(i)):o.push(n)));let s=mo(this.data,o);return!s&&!t&&!n&&e.includes(`.`)&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Z(n)?s:wo(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.includes(`.`)&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),fo(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Z(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(`.`)&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=mo(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?go(s,n,i):s={...s,...n},fo(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Ao={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},jo=Symbol(`i18next/PATH_KEY`);function Mo(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===jo?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function No(e,t){let{[jo]:n}=e(Mo()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`,a=t?.enableSelector===`strict`;if(n.length>1&&i){let e=t?.ns,o=a?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(o&&(a?o:o.length>1?o.slice(1):[]).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var Po=e=>!Z(e)&&typeof e!=`boolean`&&typeof e!=`number`,Fo=class e extends Oo{constructor(e,t={}){super(),oo([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=Do.create(`translator`),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=Po(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.includes(n),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Co(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Z(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.includes(a[0]))&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Z(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=No(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?No(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!Z(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=Po(E),ee=Object.prototype.toString.apply(E);if(y&&E&&D&&!_.includes(ee)&&!(Z(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:Po(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&Z(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,b&&!c?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.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 e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Z(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Z(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Z(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=Ao.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Z(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?No(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Z(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Z(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!this.checkedLoadedFor[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.startsWith(i)&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.startsWith(i)&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Z(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith(`defaultValue`)&&e[t]!==void 0)return!0;return!1}},Io=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Do.create(`languageUtils`)}getScriptPartFromCode(e){if(e=To(e),!e||!e.includes(`-`))return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=To(e),!e||!e.includes(`-`))return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Z(e)&&e.includes(`-`)){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?!0:!e.includes(`-`)&&!r.includes(`-`)?!1:!!(e.includes(`-`)&&!r.includes(`-`)&&e.slice(0,e.indexOf(`-`))===r||e.startsWith(r)&&r.length>1))}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Z(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Z(e)&&(e.includes(`-`)||e.includes(`_`))?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Z(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.includes(e)||i(this.formatLanguageCode(e))}),r}},Lo={zero:0,one:1,two:2,few:3,many:4,other:5},Ro={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},zo=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Do.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=To(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),Ro;if(!e.match(/-|_/))return Ro;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Lo[e]-Lo[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},Bo=(e,t,n,r=`.`,i=!0)=>{let a=ho(e,t,n);return!a&&i&&Z(n)&&(a=wo(e,n,r),a===void 0&&(a=wo(t,n,r))),a},Vo=e=>e.replace(/\$/g,`$$$$`),Ho=class{constructor(e={}){this.logger=Do.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?yo:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?_o(i):a||`{{`,this.suffix=o?_o(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u?_o(u):`-`,this.unescapeSuffix=this.unescapePrefix?``:l?_o(l):``,this.nestingPrefix=d?_o(d):f||_o(`$t(`),this.nestingSuffix=p?_o(p):m||_o(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(!e.includes(this.formatSeparator)){let i=Bo(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Bo(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp(),!this.escapeValue&&typeof e==`string`&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn(`nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.`);let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Vo(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Vo(this.escape(e)):Vo(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Z(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !Z(a)&&!this.useRawValueToEscape&&(a=ao(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${_o(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Z(i))return i;Z(i)||(i=ao(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Uo=e=>{let t=e.toLowerCase().trim(),n={};if(e.includes(`(`)){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].slice(0,-1);t===`currency`&&!i.includes(`:`)?n.currency||=i.trim():t===`relativetime`&&!i.includes(`:`)?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},Wo=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(To(r),i),t[o]=s),s(n)}},Go=e=>(t,n,r)=>e(To(n),r)(t),Ko=class{constructor(e={}){this.logger=Do.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?Wo:Go;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Wo(t)}format(e,t,n,r={}){if(!t||e==null)return e;let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&!i[0].includes(`)`)&&i.find(e=>e.includes(`)`))){let e=i.findIndex(e=>e.includes(`)`));i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Uo(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},qo=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Jo=class extends Oo{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Do.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{po(n.loaded,[i],a),qo(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read(e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Z(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Z(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},Yo=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Xo=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes(`cimode`)&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Zo=()=>{},Qo=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},Q=class e extends Oo{constructor(e={},t){if(super(),this.options=Xo(e),this.services={},this.logger=Do,this.modules={external:[]},Qo(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Z(e.ns)?e.defaultNS=e.ns:e.ns.includes(`translation`)||(e.defaultNS=e.ns[0]));let n=Yo();this.options={...n,...this.options,...Xo(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),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?Do.init(r(this.modules.logger),this.options):Do.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Ko;let t=new Io(this.options);this.store=new ko(this.options.resources,this.options);let n=this.services;n.logger=Do,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new zo(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new Ho(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new Jo(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Fo(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Zo,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[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(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=io(),a=()=>{let e=(e,n)=>{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),i.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Zo){let n=t,r=Z(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=io();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Zo,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw 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`&&Ao.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&![`cimode`,`dev`].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(![`cimode`,`dev`].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=io();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Z(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Z(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n,r){let i=r?.scopeNs,a=(e,t,...r)=>{let o;o=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(r)),o.lng=o.lng||a.lng,o.lngs=o.lngs||a.lngs;let s=o.ns!==void 0&&o.ns!==null;o.ns=o.ns||a.ns,o.keyPrefix!==``&&(o.keyPrefix=o.keyPrefix||n||a.keyPrefix);let c={...this.options,...o};Array.isArray(i)&&!s&&(c.ns=i),typeof o.keyPrefix==`function`&&(o.keyPrefix=No(o.keyPrefix,c));let l=this.options.keySeparator||`.`,u;return o.keyPrefix&&Array.isArray(e)?u=e.map(e=>(typeof e==`function`&&(e=No(e,c)),`${o.keyPrefix}${l}${e}`)):(typeof e==`function`&&(e=No(e,c)),u=o.keyPrefix?`${o.keyPrefix}${l}${e}`:e),this.t(u,o)};return Z(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=n,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=io();return this.options.ns?(Z(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=io();Z(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new Io(Yo());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.includes(n.getLanguagePartFromCode(e))||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=Zo){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new ko(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...Yo().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new Ho(n)}return a.translator=new Fo(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,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}}}.createInstance();Q.createInstance,Q.dir,Q.init,Q.loadResources,Q.reloadResources,Q.use,Q.changeLanguage,Q.getFixedT,Q.t,Q.exists,Q.setDefaultNamespace,Q.hasLoadedNamespace,Q.loadNamespaces,Q.loadLanguages;var $o=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);os(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},es={},ts=(e,t,n,r)=>{os(n)&&es[n]||(os(n)&&(es[n]=new Date),$o(e,t,n,r))},ns=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},rs=(e,t,n)=>{e.loadNamespaces(t,ns(e,n))},is=(e,t,n,r)=>{if(os(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return rs(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,ns(e,r))},as=(e,t,n={})=>!t.languages||!t.languages.length?(ts(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),os=e=>typeof e==`string`,ss=e=>typeof e==`object`&&!!e,cs=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ls={"&":`&`,"&":`&`,"<":`<`,"<":`<`,">":`>`,">":`>`,"'":`'`,"'":`'`,""":`"`,""":`"`," ":` `," ":` `,"©":`©`,"©":`©`,"®":`®`,"®":`®`,"…":`…`,"…":`…`,"/":`/`,"/":`/`},us=e=>ls[e],ds={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(cs,us),transDefaultProps:void 0},fs=(e={})=>{ds={...ds,...e}},ps=()=>ds,ms,hs=e=>{ms=e},gs=()=>ms,_s={type:`3rdParty`,init(e){fs(e.options.react),hs(e)}};F();var vs=k(),ys=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},bs=t((t=>{var n=(F(),e(ye));function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;t.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),xs=t(((e,t)=>{t.exports=bs()}));F();var Ss=xs(),Cs={t:(e,t)=>{if(os(t))return t;if(ss(t)&&os(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},ws=()=>()=>{},Ts=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=N(vs)||{},a=n||r||gs();a&&!a.reportNamespaces&&(a.reportNamespaces=new ys),a||ts(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let o=L(()=>({...ps(),...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=o,l=e||i||a?.options?.defaultNS,u=os(l)?[l]:l||[`translation`],d=L(()=>u,u);a?.reportNamespaces?.addUsedNamespaces?.(d);let f=M(0),p=j(e=>{if(!a)return ws;let{bindI18n:t,bindI18nStore:n}=o,r=()=>{f.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>a.off(e,r)),n&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,o]),m=M(),h=j(()=>{if(!a)return Cs;let e=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(e=>as(e,a,o)),n=t.lng||a.language,r=f.current,i=m.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===c&&i.revision===r)return i;let s={t:a.getFixedT(n,o.nsMode===`fallback`?d:d[0],c,{scopeNs:d}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=s,s},[a,d,c,o,t.lng]),[g,_]=z(0),{t:v,ready:y}=(0,Ss.useSyncExternalStore)(p,h,h);V(()=>{if(a&&!y&&!s){let e=()=>_(e=>e+1);t.lng?is(a,t.lng,d,e):rs(a,d,e)}},[a,t.lng,d,y,s,g]);let b=a||{},x=M(null),S=M(),C=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},w=L(()=>{let e=b,t=e?.language,n=e;e&&(x.current&&x.current.__original===e&&S.current===t?n=x.current:(n=C(e),x.current=n,S.current=t));let r=!y&&!s?(...e)=>(ts(a,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),v(...e)):v,i=[r,n,y];return i.t=r,i.i18n=n,i.ready=y,i},[v,b,y,b.resolvedLanguage,b.language,b.languages]);if(a&&s&&!y)throw new Promise(e=>{let n=()=>e();t.lng?is(a,t.lng,d,n):rs(a,d,n)});return w};F();var Es={info:gi,success:ai,warning:Ri,error:ii},Ds={info:`text-blue-400`,success:`text-green-400`,warning:`text-amber-400`,error:`text-red-400`},Os={active:`border-l-blue-400`,"in-progress":`border-l-amber-400`,completed:`border-l-green-400`,failed:`border-l-red-400`,dismissed:`border-l-foreground-subtle/30`};function ks(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`just now`;let n=Math.floor(t/60);if(n<60)return`${String(n)}m ago`;let r=Math.floor(n/60);if(r<24)return`${String(r)}h ago`;let i=Math.floor(r/24);return`${String(i)}d ago`}function As({alert:e,onMarkRead:t,onDismiss:n}){let r=e.severity in Es?e.severity:`info`,i=e.status in Os?e.status:`active`,a=Es[r],o=Ds[r],s=Os[i];return I(`div`,{className:`flex items-start gap-2.5 px-3 py-2.5 border-l-2 ${s} ${e.read?`opacity-60`:``} hover:bg-surface-hover transition-colors`,children:[B(a,{className:`h-3.5 w-3.5 shrink-0 mt-0.5 ${o}`}),I(`div`,{className:`flex-1 min-w-0`,children:[I(`div`,{className:`flex items-center gap-1.5`,children:[B(`span`,{className:`text-[11px] font-semibold ${e.read?`text-foreground-subtle`:`text-foreground`}`,children:e.title}),!e.read&&B(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary shrink-0`})]}),B(`div`,{className:`text-[10px] text-foreground-subtle mt-0.5 line-clamp-2`,children:e.message}),e.status===`in-progress`&&e.progress!==void 0&&I(`div`,{className:`mt-1.5 flex items-center gap-2`,children:[B(`div`,{className:`flex-1 h-1 bg-surface-hover rounded-full overflow-hidden`,children:B(`div`,{className:`h-full bg-primary rounded-full transition-all duration-300`,style:{width:`${String(Math.min(100,Math.max(0,e.progress)))}%`}})}),I(`span`,{className:`text-[9px] text-foreground-subtle font-mono shrink-0`,children:[String(Math.round(e.progress)),`%`]})]}),B(`div`,{className:`text-[9px] text-foreground-subtle/60 mt-1`,children:ks(e.updatedAt)})]}),I(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[!e.read&&B(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:`Mark as read`,children:B(ei,{className:`h-3 w-3 text-foreground-subtle`})}),e.status!==`in-progress`&&B(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),n(e.id)},className:`p-1 rounded hover:bg-surface-hover transition-colors`,title:`Dismiss`,children:B(Bi,{className:`h-3 w-3 text-foreground-subtle`})})]})]})}function js({variant:e=`icon`,compact:t=!1}={}){let[n,r]=z(!1),[i,a]=z(!1),o=M(null),s=M(null),c=we(),{data:u=0}=l(void 0,{refetchInterval:3e4}),{data:d=[],isLoading:f}=p({limit:50},{enabled:n}),m=i?d:d.filter(e=>!e.read),h=d.filter(e=>e.read).length,_=()=>{c.invalidateQueries({queryKey:[[`alerts`]]})},v=x({onSuccess:_}),b=g({onSuccess:_}),S=y({onSuccess:_});T(`alert.created`,()=>{c.invalidateQueries({queryKey:[[`alerts`]]})}),T(`alert.updated`,()=>{c.invalidateQueries({queryKey:[[`alerts`]]})}),V(()=>{if(!n)return;let e=e=>{let t=e.target;o.current&&!o.current.contains(t)&&s.current&&!s.current.contains(t)&&r(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[n]);let C=j(e=>{v.mutate({alertId:e})},[v]),w=j(e=>{e&&S.mutate({alertId:e})},[S]),E=j(()=>{b.mutate(void 0),r(!1)},[b]),D=m.filter(e=>e.status===`in-progress`),ee=m.filter(e=>e.status!==`in-progress`),[te,ne]=z({}),re=j(()=>{let e=s.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=Math.min(320,n-16),a=t.left;a+i>n-8&&(a=n-8-i),a<8&&(a=8);let o=r-t.bottom,c=t.top,l={position:`fixed`,left:a,width:i,zIndex:9999};o>=c?(l.top=t.bottom+4,l.maxHeight=Math.max(160,o-8-4)):(l.bottom=r-t.top+4,l.maxHeight=Math.max(160,c-8-4)),ne(l)},[]);return V(()=>{if(!n)return;re();let e=()=>re();return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[n,re]),I(`div`,{children:[e===`sidebar`?I(`button`,{ref:s,type:`button`,onClick:()=>r(!n),className:`flex w-full items-center gap-2.5 rounded-md ${t?`justify-center px-0 py-2`:`px-2.5 py-1.5`} text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors`,title:t?`Alerts${u>0?` (${u})`:``}`:void 0,children:[I(`span`,{className:`relative inline-flex shrink-0`,children:[B(Oi,{className:`h-3.5 w-3.5`}),t&&u>0&&B(`span`,{className:`absolute -top-1 -right-1 h-2 w-2 rounded-full bg-primary`})]}),!t&&B(`span`,{className:`flex-1 text-left`,children:`Alerts`}),!t&&u>0&&B(`span`,{className:`flex items-center justify-center h-4 min-w-4 px-1 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:u>99?`99+`:String(u)})]}):I(`button`,{ref:s,type:`button`,onClick:()=>r(!n),className:`relative p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors`,"aria-label":`Alerts`,children:[B(Oi,{className:`h-4.5 w-4.5`}),u>0&&B(`span`,{className:`absolute -top-0.5 -right-0.5 flex items-center justify-center h-4 min-w-4 px-0.5 rounded-full bg-primary text-primary-foreground text-[9px] font-bold leading-none`,children:u>99?`99+`:String(u)})]}),n&&je(I(`div`,{ref:o,style:te,className:`bg-surface border border-border rounded-lg shadow-xl flex flex-col overflow-hidden`,children:[I(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border shrink-0`,children:[B(`span`,{className:`text-[12px] font-semibold text-foreground`,children:`Alerts`}),I(`div`,{className:`flex items-center gap-2`,children:[h>0&&I(`label`,{className:`flex items-center gap-1 text-[10px] text-foreground-subtle cursor-pointer select-none`,children:[B(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked),className:`h-3 w-3 rounded border-border accent-primary cursor-pointer`}),`Show read`]}),u>0&&I(`button`,{type:`button`,onClick:E,className:`flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors`,children:[B($r,{className:`h-3 w-3`}),`Mark all read`]})]})]}),I(`div`,{className:`flex-1 overflow-y-auto`,children:[f&&B(`div`,{className:`flex items-center justify-center py-8`,children:B(vi,{className:`h-4 w-4 animate-spin text-foreground-subtle`})}),!f&&m.length===0&&I(`div`,{className:`flex flex-col items-center justify-center py-8 text-foreground-subtle`,children:[B(Oi,{className:`h-6 w-6 mb-2 opacity-40`}),B(`span`,{className:`text-[11px]`,children:d.length>0?`No unread alerts`:`No alerts`}),d.length>0&&!i&&I(`button`,{type:`button`,onClick:()=>a(!0),className:`text-[10px] text-primary mt-1 hover:underline`,children:[`Show `,h,` read alert`,h===1?``:`s`]})]}),D.length>0&&I(`div`,{className:`border-b border-border`,children:[B(`div`,{className:`px-3 py-1.5 bg-surface-hover/50`,children:B(`span`,{className:`text-[9px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:`In Progress`})}),D.map(e=>B(As,{alert:e,onMarkRead:C,onDismiss:w},e.id))]}),ee.map(e=>B(As,{alert:e,onMarkRead:C,onDismiss:w},e.id))]})]}),document.body)]})}var Ms=/^(\d{1,3}\.){3}\d{1,3}$/;function Ns(e){let t=e.startsWith(`[`)&&e.endsWith(`]`)?e.slice(1,-1):e;return!!(Ms.test(t)||t.includes(`:`))}function Ps(e,t){return!t||Ns(e)?!1:e===t||e.endsWith(`.${t}`)}F();var Fs=`auth-webauthn/passkey-enrollment`,Is=`camstack_passkey_prompt_dismissed:`,Ls=720*60*60*1e3;function Rs(e){try{let t=localStorage.getItem(`${Is}${e}`);if(!t)return!1;let n=Number(t);return Number.isFinite(n)?Date.now()-n<Ls:!1}catch{return!1}}function zs(e){try{localStorage.setItem(`${Is}${e}`,String(Date.now()))}catch{}}function Bs(){let{user:e}=Ja(),{t}=Ts(),n=ke(),r=_(Fs),[i,a]=z(!1),[o,s]=z(!1),c=L(()=>e?Rs(e.id):!0,[e]),l=u.auth.listLoginMethods.useQuery().data?.find(e=>e.kind===`passkey`),d=l!==void 0&&Ps(window.location.hostname,l.rpId),f=e!==null&&d&&r!=null&&!c,p=be({queryKey:[`auth`,`listOwnPasskeys`],queryFn:()=>n.listOwnPasskeys(),enabled:f,staleTime:6e4}),m=j(()=>{e&&zs(e.id),a(!0),s(!1)},[e]),h=j(()=>{s(!1),p.refetch()},[p]);return!f||i||p.data===void 0||p.data.length>0?null:I(`div`,{className:`shrink-0 border-b border-primary/20 bg-primary/5`,children:[I(`div`,{className:`flex items-center gap-2.5 px-3 py-2 text-xs text-foreground`,children:[B(fi,{className:`h-4 w-4 text-primary shrink-0`}),B(`span`,{className:`flex-1 min-w-0`,children:t(`passkeyPrompt.message`,`Save a passkey for faster sign-in?`)}),B(`button`,{onClick:()=>s(e=>!e),className:`rounded bg-primary px-2.5 py-1 text-[11px] font-semibold text-primary-foreground hover:bg-primary/90`,children:t(`passkeyPrompt.enrollNow`,`Enroll now`)}),B(`button`,{onClick:m,className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`passkeyPrompt.notNow`,`Not now`)}),B(`button`,{onClick:m,"aria-label":t(`passkeyPrompt.notNow`,`Not now`),className:`p-1 rounded text-foreground-subtle hover:text-foreground`,children:B(Bi,{className:`h-3.5 w-3.5`})})]}),o&&B(`div`,{className:`px-3 pb-3`,children:I(`div`,{className:`max-w-xl`,children:[B(C,{widgetId:Fs,host:`dashboard`}),B(`div`,{className:`mt-2 flex justify-end`,children:B(`button`,{onClick:h,className:`rounded border border-border px-2.5 py-1 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover`,children:t(`common.close`,`Close`)})})]})})]})}F();function Vs(){let e=Sa();return fe(e.subscribe,e.getSnapshot,e.getSnapshot)}var Hs=[`detection`,`cluster`,`administration`];function Us(e){return Hs.includes(e)}function Ws(e){let t=new Map,n=new Map,r=[];for(let i of e){let e=i.section?.trim();if(e===void 0||e.length===0){r.push(i);continue}if(Us(e)){let n=t.get(e)??[];n.push(i),t.set(e,n);continue}let a=n.get(e);a?a.pages.push(i):n.set(e,{label:i.sectionLabel?.trim()||e,pages:[i]})}return{known:t,custom:[...n.entries()].map(([e,t])=>({id:e,label:t.label,pages:t.pages})),ungrouped:r}}var Gs=`camstack:last-path`,Ks=512,qs=[`/login`,`/change-password`,`/access-denied`,`/logout`];function Js(e){return!e.startsWith(`/`)||e.startsWith(`//`)||e.length>Ks?!1:!qs.some(t=>e===t||e.startsWith(t+`/`))}function Ys(e){if(!(typeof window>`u`)&&Js(e))try{window.localStorage.setItem(Gs,e)}catch{}}function Xs(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(Gs);return e===null?null:Js(e)?e:null}catch{return null}}F();var Zs={dark:Ci,light:Fi,system:Si},Qs={gauge:pi,puzzle:Ei,bot:Yr,cpu:oi,terminal:Ii,box:Xr,wrench:Vi,activity:Kr,plug:Ti};function $s(){let e=q(),t=Qt(),{user:n,logout:r}=Ja(),i=v(),{t:s}=Ts(),c=D(),l=ne(),u=fa(Vs()),[d,f]=z(!1);V(()=>{Ys(e.pathname+e.search)},[e.pathname,e.search]);let[p,m]=z(()=>typeof window>`u`?!1:window.localStorage.getItem(`camstack:sidebar-collapsed`)===`1`);V(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed`,p?`1`:`0`)},[p]);let[h]=z(()=>{if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(`camstack:sidebar-collapsed-groups`);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}});V(()=>{typeof window>`u`||window.localStorage.setItem(`camstack:sidebar-collapsed-groups`,JSON.stringify([...h]))},[h]),V(()=>{l&&window.localStorage.getItem(`camstack:sidebar-collapsed`)===null&&m(!0)},[l]);let{data:g=[]}=o({nodeId:`hub`},{refetchInterval:3e4}),_=g.length,y=we(),b=M(Date.now()),{data:x}=ee(void 0,{staleTime:0,refetchOnMount:`always`,refetchInterval:e=>{let t=e.state.data;return t&&t.length>0||Date.now()-b.current>=3e4?!1:2e3}}),S=L(()=>x&&n?.isAdmin?Za(x):[],[x,n?.isAdmin]),C=L(()=>Ws(S),[S]),w=C.known.get(`detection`)??[],E=C.known.get(`cluster`)??[],te=C.known.get(`administration`)??[];T(`addon.page-ready`,()=>{y.invalidateQueries({queryKey:[[`addonPages`,`listPages`]]})});let re=()=>{r(),t(`/login`)},ie=t=>!!(e.pathname===t||e.pathname.startsWith(t+`/`)),ae=[`/pipeline`].some(t=>e.pathname===t||e.pathname.startsWith(t+`/`)),oe=n?.isAdmin===!0,se=e=>e.filter(e=>!e.adminOnly||oe),ce=se([{label:s(`nav.devices`,`Devices`),icon:Zr,path:`/devices`},{label:s(`nav.integrations`),icon:Ti,path:`/integrations`},{label:s(`nav.viewer`,`Viewer`),icon:Si,path:`/viewer/camstack/`,external:!0}]),le=se([{label:s(`nav.pipeline`,`Pipeline`),icon:mi,path:`/pipeline`},{label:s(`nav.detectionIntelligence`,`People`),icon:Di,path:`/detection-intelligence`,adminOnly:!0},{label:s(`nav.vehicles`,`Vehicles`),icon:Qr,path:`/plates`,adminOnly:!0},{label:s(`nav.events`,`Events`),icon:Kr,path:`/events`,adminOnly:!0},{label:s(`nav.recordings`,`Recordings`),icon:di,path:`/recordings`,adminOnly:!0}]),ue=se([{label:s(`system.cluster`,`Cluster`),icon:wi,path:`/system/cluster`,adminOnly:!0},{label:s(`system.addons`),icon:Ei,path:`/system/addons`,adminOnly:!0},{label:s(`system.ai`,`AI`),icon:Pi,path:`/system/ai`,adminOnly:!0}]),de=se([{label:s(`system.identity`,`Identity & Access`),icon:yi,path:`/system/identity`,adminOnly:!0},{label:s(`system.network`,`Network`),icon:hi,path:`/system/network`,adminOnly:!0},{label:s(`system.integrations`,`Connectivity`),icon:Ti,path:`/system/integrations`,adminOnly:!0},{label:s(`system.data`,`Data`),icon:si,path:`/system/data`,adminOnly:!0},{label:s(`system.notifications`,`Notifications`),icon:Jr,path:`/system/notifications`,adminOnly:!0},{label:s(`system.capabilities`,`Capabilities`),icon:Mi,path:`/system/capabilities`,adminOnly:!0},{label:s(`system.addonSettings`,`Addon Settings`),icon:ki,path:`/system/settings`,adminOnly:!0},{label:s(`system.logs`,`Logs`),icon:Oi,path:`/system/logs`,adminOnly:!0}]),O=i?.mode??`system`,k={dark:s(`theme.dark`),light:s(`theme.light`),system:s(`theme.system`)},A=p&&!c,j=(e,t=`md`)=>`flex w-full items-center gap-2.5 rounded-md ${A?`justify-center px-0 py-2`:`px-2.5 py-1.5`} ${t===`lg`?`text-[13px] font-medium`:`text-[12px]`} transition-all ${e?t===`lg`?`bg-primary/12 text-primary shadow-sm shadow-primary/5`:`bg-primary/12 text-primary`:`text-foreground-subtle hover:bg-surface-hover hover:text-foreground`}`,fe=(e,t)=>e===0?null:A?B(`div`,{className:`pt-3 mb-1 mx-2 border-t border-border/60`},`sep-${t}`):B(`div`,{className:`pt-4 pb-1.5 px-2.5`,children:B(`span`,{className:`text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60`,children:t})},`hdr-${t}`),N=e=>{let n=ie(e.path),r=Qs[e.icon]??Ei;return I(`button`,{onClick:()=>{t(e.path),f(!1)},className:j(n),title:A?e.label:void 0,children:[B(r,{className:`h-3.5 w-3.5 shrink-0 ${n?`text-primary`:``}`}),!A&&e.label]},`${e.addonId}::${e.id}`)},pe=e=>{let n=e.icon,r=e.external?!1:ie(e.path),i=e.path===`/system/addons`;return I(`button`,{"data-testid":`nav-${e.path.replace(/^\//,``).replace(/\//g,`-`)}`,onClick:()=>{e.external?window.open(e.path,`_blank`,`noopener,noreferrer`):t(e.path),f(!1)},className:j(r),title:A?e.label:void 0,children:[B(n,{className:`h-3.5 w-3.5 shrink-0 ${r?`text-primary`:``}`}),!A&&I(xe,{children:[B(`span`,{className:`flex-1 text-left`,children:e.label}),i&&_>0&&B(`span`,{className:`ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none`,children:_})]}),A&&i&&_>0&&B(`span`,{className:`absolute mt-[-14px] ml-3 h-2 w-2 rounded-full bg-primary`})]},e.path)},me=I(xe,{children:[I(`div`,{className:`flex h-14 items-center border-b border-border ${A?`justify-center px-1`:`pl-3 pr-4 gap-2`}`,children:[!A&&B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-9 flex-1 min-w-0`}),!c&&B(`button`,{onClick:()=>m(e=>!e),className:`p-1.5 rounded-md hover:bg-surface-hover text-foreground-subtle transition-colors flex-shrink-0 ${A?``:`mr-2`}`,"aria-label":p?`Expand sidebar`:`Collapse sidebar`,title:p?`Expand sidebar`:`Collapse sidebar`,children:B(p?ri:ni,{className:`h-4 w-4`})})]}),I(`nav`,{className:`flex-1 overflow-y-auto py-3 ${A?`px-1.5`:`px-2`} space-y-0.5`,children:[(()=>{let e=ie(`/dashboard`);return I(`button`,{"data-testid":`nav-dashboard`,onClick:()=>{t(`/dashboard`),f(!1)},className:j(e,`lg`),title:A?s(`nav.dashboard`):void 0,children:[B(_i,{className:`h-4 w-4 shrink-0 ${e?`text-primary`:``}`}),!A&&s(`nav.dashboard`)]})})(),ce.map(e=>pe(e)),fe(le.length+w.length,s(`nav.detectionSection`,`Detection`)),le.map(e=>pe(e)),w.map(e=>N(e)),fe(ue.length+E.length,s(`nav.clusterSection`,`Cluster & Server`)),ue.map(e=>pe(e)),E.map(e=>N(e)),fe(de.length+te.length,s(`system.title`,`Administration`)),de.map(e=>pe(e)),te.map(e=>N(e)),C.custom.map(e=>I(`div`,{className:`contents`,children:[fe(e.pages.length,e.label),e.pages.map(e=>N(e))]},`custom-${e.id}`)),fe(C.ungrouped.length,s(`nav.addonPages`,`Addon Pages`)),C.ungrouped.map(e=>N(e))]}),I(`div`,{className:`border-t border-border ${A?`p-1.5`:`p-2`} space-y-0.5`,children:[I(`button`,{onClick:()=>i?.toggleMode(),className:j(!1),title:A?k[O]:void 0,children:[(()=>{let e=Zs[O];return B(e,{className:`h-3.5 w-3.5 shrink-0`})})(),!A&&B(`span`,{children:k[O]})]}),B(js,{variant:`sidebar`,compact:A}),I(`button`,{type:`button`,onClick:()=>t(`/system/my-access`),className:j(ie(`/system/my-access`)),title:A?s(`system.myAccess`,`My access`):void 0,children:[B(Ai,{className:`h-3.5 w-3.5 shrink-0`}),!A&&B(`span`,{className:`truncate`,children:s(`system.myAccess`,`My access`)})]}),I(`button`,{onClick:re,className:j(!1).replace(`hover:text-foreground`,`hover:text-danger`),title:A?n?.username??`Logout`:void 0,children:[B(bi,{className:`h-3.5 w-3.5 shrink-0`}),!A&&B(`span`,{className:`truncate`,children:n?.username??`User`})]}),B(`div`,{className:`pt-1 text-[10px] text-foreground-disabled select-none ${A?`text-center`:`px-2`}`,title:`admin-ui v1.2.1`,children:A?`1.2.1`:`v1.2.1`})]})]});return I(`div`,{className:`flex h-dvh overflow-hidden bg-background text-foreground pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]`,children:[!c&&B(`aside`,{className:`flex flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0 transition-[width] duration-150 ease-out ${A?`w-12`:`w-48`}`,children:me}),c&&B(a,{open:d,onClose:()=>f(!1),width:`w-64`,children:me}),I(`div`,{className:`flex flex-1 flex-col min-w-0`,children:[u!==null&&I(`div`,{className:`flex items-center justify-center gap-2 px-3 py-2 text-[12px] font-medium shrink-0 ${u.severity===`danger`?`bg-danger/90 text-white`:`bg-warning/15 text-warning border-b border-warning/30`}`,children:[u.severity===`danger`?B(zi,{className:`h-3.5 w-3.5`}):B(Kr,{className:`h-3.5 w-3.5`}),B(`span`,{children:s(u.i18nKey,{defaultValue:u.message,...u.i18nParams})}),u.action===`sign-in`&&B(`button`,{onClick:()=>r(),className:`ml-2 rounded border border-white/40 px-2 py-0.5 text-[11px] font-semibold hover:bg-white/10`,children:s(`connection.signIn`,`Sign in`)}),u.showSpinner&&B(vi,{className:`h-3.5 w-3.5 animate-spin`})]}),B(Bs,{}),c&&I(`header`,{className:`flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm`,children:[B(`button`,{onClick:()=>f(!0),className:`p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors`,"aria-label":`Open menu`,children:B(xi,{className:`h-5 w-5`})}),B(`div`,{className:`flex-1 flex justify-center`,children:B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack`,className:`h-7`})}),B(js,{})]}),B(`main`,{className:`relative flex-1 min-h-0 overscroll-contain bg-background ${ae?`overflow-hidden`:`overflow-auto`}`,children:B(Dn,{})})]})]})}function $({children:e,requireAdmin:t}){let{user:n,loading:r,mustChangePassword:i}=Ja(),a=q();return r?B(`div`,{className:`flex h-screen items-center justify-center bg-background text-foreground-subtle`,children:`Loading...`}):n?i&&a.pathname!==`/change-password`?B(J,{to:`/change-password`,replace:!0}):t&&!n.isAdmin?B(J,{to:`/access-denied`,replace:!0}):B(xe,{children:e}):B(J,{to:`/login`,replace:!0,state:{from:a.pathname+a.search}})}function ec(){let e=Qt();return I(`div`,{className:`flex flex-col items-center justify-center text-foreground py-16 px-4`,children:[B(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4`,children:B(ji,{className:`h-8 w-8 text-danger`})}),B(`h1`,{className:`text-xl font-bold`,children:`Access Denied`}),B(`p`,{className:`mt-2 text-sm text-foreground-subtle`,children:`You don't have permission to access this page.`}),B(`button`,{onClick:()=>e(`/dashboard`),className:`mt-6 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all`,children:`Go to Dashboard`})]})}F();var tc=8;function nc(){let{user:e,mustChangePassword:t,clearMustChangePassword:n,logout:r}=Ja(),i=v(),a=Qt(),[o,c]=z(``),[l,u]=z(``),[d,f]=z(!1),[p,m]=z(``),h=s({onSuccess:()=>{n(),a(`/dashboard`,{replace:!0})},onError:e=>{m(e instanceof Error?e.message:`Could not change password`)}});return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm`,children:[B(`div`,{className:`flex justify-center mb-8`,children:B(`img`,{src:i?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-12`})}),I(`form`,{onSubmit:async t=>{if(t.preventDefault(),m(``),!e){m(`Not signed in`);return}if(o.length<tc){m(`Password must be at least ${tc} characters`);return}if(o!==l){m(`The two passwords do not match`);return}if(o===`changeme`){m(`Choose a password different from the seed default`);return}h.mutate({id:e.id,newPassword:o})},className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[I(`div`,{className:`space-y-1`,children:[B(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Set a new password`}),B(`p`,{className:`text-xs text-foreground-subtle`,children:t?`You must rotate the seed password before continuing.`:`Choose a new password for your account.`})]}),p&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:p}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`New password`}),I(`div`,{className:`relative`,children:[B(`input`,{"data-testid":`change-password-new`,type:d?`text`:`password`,value:o,onChange:e=>c(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0}),B(`button`,{type:`button`,onClick:()=>f(!d),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:B(d?li:ui,{className:`h-4 w-4`})})]})]}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Confirm new password`}),B(`input`,{"data-testid":`change-password-confirm`,type:d?`text`:`password`,value:l,onChange:e=>u(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`})]}),B(`button`,{"data-testid":`change-password-submit`,type:`submit`,disabled:h.isPending||!o||!l,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:h.isPending?`Saving…`:`Save and continue`}),t&&B(`button`,{type:`button`,onClick:()=>{r(),a(`/login`,{replace:!0})},className:`w-full text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:`Sign out instead`})]})]})})}function rc(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function ic(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function ac(){return window?.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==`function`}function oc(e){let{id:t}=e;return{...e,id:ic(t),transports:e.transports}}function sc(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}var cc=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.name=r??n.name,this.code=t}},lc=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},uc=[`cross-platform`,`platform`];function dc(e){if(e&&!(uc.indexOf(e)<0))return e}function fc(){if(!ac())return new Promise(e=>e(!1));let e=window.PublicKeyCredential;return e.isConditionalMediationAvailable===void 0?new Promise(e=>e(!1)):e.isConditionalMediationAvailable()}function pc({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new cc({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new cc({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!sc(t))return new cc({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new cc({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new cc({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function mc(e){let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!ac())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(oc));let a={...t,challenge:ic(t.challenge),allowCredentials:i},o={};if(n){if(!await fc())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=lc.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw pc({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=rc(u.userHandle)),{id:c,rawId:rc(l),response:{authenticatorData:rc(u.authenticatorData),clientDataJSON:rc(u.clientDataJSON),signature:rc(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:dc(s.authenticatorAttachment)}}var hc=()=>window.location.hostname;function gc(e,t=hc){return ac()&&Ps(t(),e.rpId)}function _c(e,t=hc){let n=e.filter(e=>e.kind===`passkey`&&e.stage===`second-factor`).filter(e=>gc(e,t));return{passkeyMethods:n,widgetMethods:n.length>0?[]:e.filter(e=>e.kind===`widget`&&e.stage===`second-factor`)}}function vc(e,t){let n=e.includes(`passkey`),r=t.passkeyMethods.length>0||t.widgetMethods.length>0,i=e.includes(`totp`);return n&&!r&&!i}F();async function yc(e){let t=await mc({optionsJSON:e});return Object.fromEntries(Object.entries(t))}function bc({method:e,challengeToken:t,onComplete:n,onSecondFactor:r,onError:i}){let[a,o]=z(!1),[s,c]=z(null),l=async()=>{c(null),o(!0);try{let e=Ta();if(t){let r=await yc((await e.loginBeginPasskey(t)).optionsJSON);n((await e.loginVerifyPasskey(t,r)).token);return}let a=await yc((await e.passkeyLoginBegin()).optionsJSON),o=await e.passkeyLoginFinish(a),s=o.secondFactors??(o.requiresTotp===!0?[`totp`]:[]);if(s.length>0){if(r)r({challengeToken:o.token,factors:s});else{let e=`Additional verification is required — sign in with your password to continue.`;c(e),i?.(e)}return}n(o.token)}catch(e){let n=t?`Passkey verification failed`:`Passkey sign-in failed`,r=e instanceof Error?e.message:n;c(r),i?.(r)}finally{o(!1)}};return I(`div`,{className:`space-y-2`,children:[I(`button`,{type:`button`,"data-testid":t?`login-passkey`:`login-passkey-direct`,onClick:()=>void l(),disabled:a,className:`w-full flex items-center justify-center gap-2 rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover disabled:opacity-50 transition-colors`,children:[a?B(vi,{className:`h-4 w-4 animate-spin text-primary`}):B(fi,{className:`h-4 w-4 text-primary`}),e.label]}),s&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:s})]})}function xc(e){let t=e.onComplete,n=e.onSecondFactor;return typeof t==`function`?{onComplete:t,onSecondFactor:typeof n==`function`?n:void 0}:null}function Sc({methods:e,widgetConfig:t}){let n=e.filter(e=>e.kind!==`passkey`||gc(e));return n.length===0?null:I(`div`,{className:`mt-6 space-y-3`,children:[I(`div`,{className:`flex items-center gap-3`,children:[B(`div`,{className:`h-px flex-1 bg-border`}),B(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:`Or continue with`}),B(`div`,{className:`h-px flex-1 bg-border`})]}),B(`div`,{className:`space-y-2`,children:n.map(e=>{if(e.kind===`redirect`)return I(`a`,{href:e.startUrl,className:`flex items-center justify-center gap-2 w-full rounded-lg border border-border bg-surface px-4 py-2.5 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors`,children:[B(Ai,{className:`h-4 w-4 text-primary`}),e.label]},e.id);if(e.kind===`passkey`){let n=xc(t);return n?B(bc,{method:e,onComplete:n.onComplete,onSecondFactor:n.onSecondFactor},e.id):null}return B(Cc,{method:e,config:t},e.id)})})]})}function Cc({method:e,config:t}){let n=re(e.remote,e.bundleUrl);return n===null?I(`div`,{className:`flex items-center justify-center gap-2 rounded-lg border border-border bg-background px-4 py-2.5 text-xs text-foreground-subtle`,children:[B(vi,{className:`h-3.5 w-3.5 animate-spin`}),`Loading…`]}):n===void 0?I(`div`,{"data-testid":`login-method-load-error`,className:`flex items-center justify-center gap-2 rounded-lg border border-danger/20 bg-danger/10 px-4 py-2.5 text-xs text-danger`,children:[B(ii,{className:`h-3.5 w-3.5 shrink-0`}),`A sign-in method could not be loaded — reload the page to retry.`]}):B(n,{instanceId:e.id,host:`dashboard`,config:t})}F();function wc(){let{login:e,verifyTotp:t,finalizePasskeyLogin:n,user:r}=Ja(),{i18n:i}=Ts(),a=v(),o=Qt(),s=q(),c=new URLSearchParams(window.location.search).get(`next`),l=new URLSearchParams(window.location.search).get(`redirect`);V(()=>{Va(l)},[l]);let d=s.state?.from??Xs()??`/dashboard`,[f,p]=z(``),[m,h]=z(``),[g,_]=z(!1),[y,b]=z(``),[x,S]=z(!1),[C,w]=z(`credentials`),[T,E]=z(``),[D,ee]=z([]),[te,ne]=z(``),re=u.auth.listLoginMethods.useQuery().data??[],ie=re.filter(e=>e.stage===`primary`),ae=_c(re),{passkeyMethods:oe,widgetMethods:se}=ae,ce=M(!1),le=async()=>{if(ce.current)return;ce.current=!0;let e=La(l);if(e?.kind===`app-callback`){await O(e.url);return}else if(e){window.location.assign(e.path);return}c?window.location.assign(c):o(d,{replace:!0})},[ue,de]=z(null),O=async e=>{de({callbackBase:e,mintedUrl:null,failed:!1});try{let{code:t}=await Ta().trpcClient.auth.createHandoffCode.mutate(),n=Ia(e,t);de({callbackBase:e,mintedUrl:n,failed:!1}),window.location.assign(n)}catch{de({callbackBase:e,mintedUrl:null,failed:!0})}},k=r!==null,[A,j]=z(!1);V(()=>{!k||!l||A||(j(!0),le())},[k,l,A]);let fe=async t=>{t.preventDefault(),b(``),S(!0);try{let t=await e(f,m);if(t.kind===`second-factor`){E(t.challengeToken),ee(t.factors),w(`second-factor`);return}m===`changeme`?o(`/change-password`,{replace:!0}):await le()}catch(e){b(e instanceof Error?e.message:`Login failed`)}finally{S(!1)}},N=async e=>{e.preventDefault(),b(``),S(!0);try{await t(T,te.trim()),await le()}catch(e){b(e instanceof Error?e.message:`TOTP verification failed`),ne(``)}finally{S(!1)}},pe=async e=>{try{await n(e),await le()}catch(e){b(e instanceof Error?e.message:`Passkey sign-in failed`)}};return ue===null?B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm`,children:[B(`div`,{className:`flex justify-center mb-8`,children:B(`img`,{src:a?.resolvedMode===`light`?`/brand/logo-horizontal-light.svg`:`/brand/logo-horizontal-dark.svg`,alt:`CamStack Admin`,className:`h-12`})}),C===`credentials`?I(`form`,{onSubmit:fe,className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[y&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:y}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Username`}),B(`input`,{"data-testid":`login-username`,type:`text`,placeholder:`Username`,value:f,onChange:e=>p(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Password`}),I(`div`,{className:`relative`,children:[B(`input`,{"data-testid":`login-password`,type:g?`text`:`password`,placeholder:`Password`,value:m,onChange:e=>h(e.target.value),className:`w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`}),B(`button`,{type:`button`,onClick:()=>_(!g),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors`,tabIndex:-1,children:B(g?li:ui,{className:`h-4 w-4`})})]})]}),B(`button`,{"data-testid":`login-submit`,type:`submit`,disabled:x||!f||!m,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:x?I(`span`,{className:`flex items-center justify-center gap-2`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),`Logging in...`]}):`Log in`})]}):I(`div`,{className:`space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10`,children:[I(`div`,{className:`flex items-center gap-2 pb-1 border-b border-border`,children:[B(Ni,{className:`h-4 w-4 text-primary`}),B(`div`,{className:`text-sm font-medium text-foreground`,children:`Two-factor authentication`})]}),B(`p`,{className:`text-xs text-foreground-subtle`,children:f?I(xe,{children:[`Finish signing in as `,B(`span`,{className:`font-mono text-foreground`,children:f}),`.`]}):`Finish signing in.`}),y&&B(`div`,{className:`rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger`,children:y}),D.includes(`passkey`)&&oe.map(e=>B(bc,{method:e,challengeToken:T,onComplete:pe},e.id)),D.includes(`passkey`)&&se.map(e=>B(Cc,{method:e,config:{challengeToken:T,onComplete:pe}},e.id)),vc(D,ae)&&B(`div`,{className:`rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground-subtle`,children:`Passkey verification isn't available on this address. Open the hub via its domain URL to complete sign-in.`}),D.includes(`passkey`)&&D.includes(`totp`)&&I(`div`,{className:`flex items-center gap-3`,children:[B(`div`,{className:`h-px flex-1 bg-border`}),B(`span`,{className:`text-[10px] uppercase tracking-wider text-foreground-subtle`,children:`or`}),B(`div`,{className:`h-px flex-1 bg-border`})]}),D.includes(`totp`)&&I(`form`,{onSubmit:N,className:`space-y-4`,children:[I(`div`,{className:`space-y-1.5`,children:[B(`label`,{className:`text-xs font-medium text-foreground-subtle`,children:`Authentication code`}),B(`input`,{"data-testid":`login-totp`,type:`text`,inputMode:`numeric`,autoComplete:`one-time-code`,placeholder:`123456`,value:te,onChange:e=>ne(e.target.value.replace(/\D/g,``).slice(0,6)),className:`w-full rounded-lg border border-border bg-background px-3 py-3 text-center text-2xl font-mono tracking-widest text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all`,autoFocus:!0})]}),B(`button`,{"data-testid":`login-totp-submit`,type:`submit`,disabled:x||te.length!==6,className:`w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all`,children:x?I(`span`,{className:`flex items-center justify-center gap-2`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground`}),`Verifying...`]}):`Verify and sign in`})]}),I(`button`,{type:`button`,onClick:()=>{w(`credentials`),E(``),ee([]),ne(``),b(``)},className:`w-full flex items-center justify-center gap-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors`,children:[B(qr,{className:`h-3 w-3`}),`Back to username + password`]})]}),C===`credentials`&&B(Sc,{methods:ie,widgetConfig:{onComplete:pe,onSecondFactor:e=>{let t=e.factors.filter(e=>e===`totp`||e===`passkey`);E(e.challengeToken),ee(t),ne(``),b(``),w(`second-factor`)},locale:i.language}}),I(`p`,{className:`mt-6 text-center text-[10px] text-foreground-subtle/50`,children:[`CamStack v`,`1.2.1`]})]})}):B(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-4`,children:I(`div`,{className:`w-full max-w-sm rounded-xl border border-border bg-surface p-6 text-center space-y-4`,children:[B(`h1`,{className:`text-sm font-semibold text-foreground`,children:`Returning to the app…`}),ue.failed?I(xe,{children:[B(`p`,{className:`text-xs text-danger`,children:`Could not prepare the sign-in handoff. You are logged in — retry below.`}),B(`button`,{onClick:()=>void O(ue.callbackBase),className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Retry`})]}):ue.mintedUrl===null?B(`p`,{className:`text-xs text-foreground-subtle`,children:`Preparing a one-time sign-in code…`}):I(xe,{children:[B(`p`,{className:`text-xs text-foreground-subtle`,children:`If the app does not open automatically, tap below (the code expires in 60s).`}),B(`a`,{href:ue.mintedUrl,className:`inline-flex rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90`,children:`Open CamStack`})]})]})})}F();function Tc(){return B(J,{to:Xs()??`/dashboard`,replace:!0})}var Ec=R(()=>i(()=>import(`./Dashboard-DaH-7MeN.js`).then(e=>({default:e.DashboardPage})),__vite__mapDeps([0,1,2,3,4,5]))),Dc=R(()=>i(()=>import(`./Devices-BYHdwUA9.js`).then(e=>({default:e.DevicesPage})),__vite__mapDeps([6,1,2,3,4,7,8,9,10,11,12]))),Oc=R(()=>i(()=>import(`./Integrations-BF1ngbno.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([13,1,2,3,4,7,8,9,10,14,15,16,5,17,18,19,11,20,21,12]))),kc=R(()=>i(()=>import(`./IntegrationDetail-B3nptv5G.js`).then(e=>({default:e.IntegrationDetailPage})),__vite__mapDeps([22,1,2,3,4,7,8,9,10,14,15,16,5,17,18,19,23]))),Ac=R(()=>i(()=>import(`./Pipeline-BzxPuzJh.js`).then(e=>({default:e.PipelinePage})),__vite__mapDeps([24,25,1,2,3,4,23,26,27,28,18,29,14,15,16,30,5,8,9,31,32,11,33,34,35,12]))),jc=R(()=>i(()=>import(`./DeviceDetail-Cobtc6wN.js`).then(e=>({default:e.DeviceDetailPage})),__vite__mapDeps([36,1,2,3,4,37,28,8,15,38,7,9,10,27,14,16,30,5,23,34,20,12]))),Mc=R(()=>i(()=>import(`./Showroom-BjnHBP5S.js`).then(e=>({default:e.ShowroomPage})),__vite__mapDeps([39,37,28,8,15,7,9,10,14,1,2,3,4,16,20]))),Nc=R(()=>i(()=>import(`./EmbedPlayerPage-BpW4lsWq.js`).then(e=>({default:e.EmbedPlayerPage})),__vite__mapDeps([40,1,2,3,4]))),Pc=R(()=>i(()=>import(`./DetectionIntelligence-DTA_96Ae.js`).then(e=>({default:e.DetectionIntelligencePage})),__vite__mapDeps([41,1,2,3,4,42,43,30,5,15,31,32,11,44]))),Fc=R(()=>i(()=>import(`./Plates-C48k-46Q.js`).then(e=>({default:e.PlatesPage})),__vite__mapDeps([45,1,2,3,4,42,43,30,5,31,32,11,44]))),Ic=R(()=>i(()=>import(`./Events-Db4fPx9x.js`).then(e=>({default:e.EventsPage})),__vite__mapDeps([46,1,2,3,4,47,48,43,16,31,32,11,44]))),Lc=R(()=>i(()=>import(`./Recordings-CT0gChTC.js`).then(e=>({default:e.RecordingsPage})),__vite__mapDeps([49,1,2,3,4,18,29,14,15,16,30,5,11,50,35,44,26]))),Rc=R(()=>i(()=>import(`./Addons-CLf82zRJ.js`).then(e=>({default:e.AddonsPage})),__vite__mapDeps([51,1,2,3,4,47,18,5,15,16,52,11,33,14,34]))),zc=R(()=>i(()=>import(`./AiProfiles-R33NnzxL.js`).then(e=>({default:e.AiProfilesPage})),__vite__mapDeps([53,1,2,3,4,30,5,54,9,11]))),Bc=R(()=>i(()=>import(`./MyAccess-D6FVIObH.js`).then(e=>({default:e.MyAccessPage})),__vite__mapDeps([55,1,2,3,4,56,48,57,30,11]))),Vc=R(()=>i(()=>import(`./Logs-CR6FjpSE.js`).then(e=>({default:e.LogsPage})),__vite__mapDeps([58,1,2,3,4,11]))),Hc=R(()=>i(()=>import(`./Identity-C_r6Mgc9.js`).then(e=>({default:e.IdentityPage})),__vite__mapDeps([59,1,2,3,4,56,48,57,60,5,15,32,11,33,14,16,34,50,61]))),Uc=R(()=>i(()=>import(`./Network-DZjk05lH.js`).then(e=>({default:e.NetworkPage})),__vite__mapDeps([62,1,2,3,4,38,48,60,5,15,32,11,33,14,16,34,9,10,50,61]))),Wc=R(()=>i(()=>import(`./Integrations-BNxwRAw3.js`).then(e=>({default:e.IntegrationsPage})),__vite__mapDeps([63,1,2,3,4,30,60,5,15,32,11,33,14,16,34,8,10,50,19,21]))),Gc=R(()=>i(()=>import(`./Data-DM2CB0tr.js`).then(e=>({default:e.DataPage})),__vite__mapDeps([64,1,2,3,4,18,29,14,15,16,30,5,23,11,50,44,26]))),Kc=R(()=>i(()=>import(`./Settings-BdPbbCyr.js`).then(e=>({default:e.SettingsPage})),__vite__mapDeps([65,1,2,3,4,11,33,14,15,16,34]))),qc=R(()=>i(()=>import(`./Cluster-DwLZwcXa.js`).then(e=>({default:e.ClusterPage})),__vite__mapDeps([66,25,1,2,3,4,23,26,30,8,15,9,52,33,14,16,34]))),Jc=R(()=>i(()=>import(`./Capabilities-BS_pV5kK.js`).then(e=>({default:e.CapabilitiesPage})),__vite__mapDeps([67,1,2,3,4,56,11]))),Yc=R(()=>i(()=>import(`./NotificationTargets-3YNCICGO.js`).then(e=>({default:e.NotificationTargetsPage})),__vite__mapDeps([68,1,2,3,4,56,30,5,16,54,11]))),Xc=new Se({defaultOptions:{queries:{gcTime:0,staleTime:0,retry:!1,refetchOnWindowFocus:!1}}});function Zc({field:e,value:t,onChange:n,disabled:r}){return B(Zi,{field:e,value:t,onChange:n,disabled:r})}function Qc({field:e,value:t,onChange:n,disabled:r}){return B(qi,{field:e,value:t,onChange:n,disabled:r})}var $c={"pipeline-editor":Zc,"model-selector":Qc};function el({children:e}){let{user:t,logout:n}=Ja(),[r,i]=z(0),a=M(t?.username??null);V(()=>{let e=t?.username??null;e!==a.current&&(a.current=e,Ea(),i(e=>e+1))},[t]);let o=L(()=>Ta(),[r]),[s,c]=z(!1),[l,d]=z(null);return V(()=>{if(c(!1),d(null),!t){c(!0);return}let e=!1;return o.init().then(()=>{e||c(!0)},t=>{if(e)return;let r=t instanceof Error?t.message:String(t),i=t?.data?.code;if(i===`UNAUTHORIZED`||i===`FORBIDDEN`||/UNAUTHORIZED|FORBIDDEN/.test(r)){n();return}d(r),c(!0)}),()=>{e=!0}},[o,t,n]),Xa(j(()=>{Ea(),i(e=>e+1),Xc.invalidateQueries()},[])),B(Oe,{system:o,children:B(u.Provider,{client:o.trpcClient,queryClient:Xc,children:I(ie,{children:[s?e:B(tl,{}),s&&B(aa,{}),l!==null&&s&&I(`div`,{className:`fixed bottom-4 right-4 z-50 max-w-sm rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning shadow-lg`,children:[`Boot probe failed: `,l,`. Retrying in background.`]})]})})})}function tl(){return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:I(`div`,{className:`flex items-center gap-3 text-sm text-foreground-subtle`,children:[B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`}),`Connecting…`]})})}function nl(){return B(`div`,{className:`flex min-h-screen items-center justify-center bg-background`,children:B(`span`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-primary/30 border-t-primary`})})}function rl(){return B(oe,{defaultMode:`dark`,children:B(Te,{client:Xc,children:B(qa,{children:B(el,{children:B(f,{children:I(d,{renderers:$c,children:[B(vr,{children:B(_e,{fallback:B(nl,{}),children:I(kn,{children:[B(Y,{path:`/login`,element:B(wc,{})}),B(Y,{path:`/change-password`,element:B($,{children:B(nc,{})})}),B(Y,{path:`/showroom`,element:B(Mc,{})}),B(Y,{path:`/embed/player`,element:B(Nc,{})}),I(Y,{element:B($,{children:B($s,{})}),children:[B(Y,{index:!0,element:B(Tc,{})}),B(Y,{path:`/access-denied`,element:B(ec,{})}),B(Y,{path:`/dashboard`,element:B(Ec,{})}),B(Y,{path:`/devices`,element:B(Dc,{})}),B(Y,{path:`/cameras`,element:B(J,{to:`/devices`,replace:!0})}),B(Y,{path:`/integrations`,element:B(Oc,{})}),B(Y,{path:`/integrations/:integrationId`,element:B(kc,{})}),B(Y,{path:`/pipeline`,element:B(Ac,{})}),B(Y,{path:`/devices/:deviceId`,element:B(jc,{})}),B(Y,{path:`/system/logs`,element:B($,{requireAdmin:!0,children:B(Vc,{})})}),B(Y,{path:`/system/addons`,element:B($,{requireAdmin:!0,children:B(Rc,{})})}),B(Y,{path:`/system/ai`,element:B($,{requireAdmin:!0,children:B(zc,{})})}),B(Y,{path:`/system/settings`,element:B($,{requireAdmin:!0,children:B(Kc,{})})}),B(Y,{path:`/system/cluster`,element:B($,{requireAdmin:!0,children:B(qc,{})})}),B(Y,{path:`/system/capabilities`,element:B($,{requireAdmin:!0,children:B(Jc,{})})}),B(Y,{path:`/system/server`,element:B(J,{to:`/system/cluster`,replace:!0})}),B(Y,{path:`/system/notifications`,element:B($,{requireAdmin:!0,children:B(Yc,{})})}),B(Y,{path:`/system/identity`,element:B($,{requireAdmin:!0,children:B(Hc,{})})}),B(Y,{path:`/system/my-access`,element:B(Bc,{})}),B(Y,{path:`/system/network`,element:B($,{requireAdmin:!0,children:B(Uc,{})})}),B(Y,{path:`/system/integrations`,element:B($,{requireAdmin:!0,children:B(Wc,{})})}),B(Y,{path:`/system/data`,element:B($,{requireAdmin:!0,children:B(Gc,{})})}),B(Y,{path:`/system/users`,element:B(J,{to:`/system/identity?tab=users`,replace:!0})}),B(Y,{path:`/system/api-keys`,element:B(J,{to:`/system/identity?tab=api-keys`,replace:!0})}),B(Y,{path:`/system/authentication`,element:B(J,{to:`/system/identity?tab=authentication`,replace:!0})}),B(Y,{path:`/system/linked-sessions`,element:B(J,{to:`/system/identity?tab=linked-sessions`,replace:!0})}),B(Y,{path:`/system/remote-access`,element:B(J,{to:`/system/network?tab=remote-access`,replace:!0})}),B(Y,{path:`/system/turn`,element:B(J,{to:`/system/network?tab=turn`,replace:!0})}),B(Y,{path:`/system/storage`,element:B(J,{to:`/system/data?tab=storage`,replace:!0})}),B(Y,{path:`/system/backup`,element:B(J,{to:`/system/data?tab=backup`,replace:!0})}),B(Y,{path:`/detection-intelligence`,element:B($,{requireAdmin:!0,children:B(Pc,{})})}),B(Y,{path:`/plates`,element:B($,{requireAdmin:!0,children:B(Fc,{})})}),B(Y,{path:`/events`,element:B($,{requireAdmin:!0,children:B(Ic,{})})}),B(Y,{path:`/recordings`,element:B($,{requireAdmin:!0,children:B(Lc,{})})}),B(Y,{path:`/addon/:pagePath`,element:B($,{requireAdmin:!0,children:B(ro,{})})})]})]})})}),B(ua,{})]})})})})})})}var il={nav:{dashboard:`Dashboard`,integrations:`Integrations`,metrics:`Metrics`,detectionSection:`Detection`,detectionIntelligence:`People`,vehicles:`Vehicles`,clusterSection:`Cluster & Server`},system:{title:`Administration`,addons:`Addons`,agents:`Agents`,processes:`Processes`,logs:`Logs`,users:`Users`,settings:`Settings`,repl:`REPL`,models:`Models`,integrations:`Connectivity`,serverManagement:`Server`},common:{save:`Save`,cancel:`Cancel`,delete:`Delete`,enable:`Enable`,disable:`Disable`,edit:`Edit`,add:`Add`,remove:`Remove`,confirm:`Confirm`,close:`Close`,back:`Back`,next:`Next`,search:`Search`,filter:`Filter`,reset:`Reset`,apply:`Apply`,submit:`Submit`,loading:`Loading…`,error:`Error`,success:`Success`,warning:`Warning`,info:`Info`,noData:`No data available`,noResults:`No results found`,retry:`Retry`,refresh:`Refresh`,copy:`Copy`,copied:`Copied!`,yes:`Yes`,no:`No`},connection:{disconnected:`Server unreachable — reconnecting…`,connected:`Connected`,reconnecting:`Reconnecting…`,degraded:`Live connection interrupted — hub is online (a cluster node may be unresponsive), re-establishing…`,degradedNodes_one:`Cluster degraded — node {{nodes}} not responding. Hub is online, live link re-establishing…`,degradedNodes_other:`Cluster degraded — nodes {{nodes}} not responding. Hub is online, live link re-establishing…`,degradedCount_one:`Cluster degraded — {{count}} cluster node offline. Hub is online, live link re-establishing…`,degradedCount_other:`Cluster degraded — {{count}} cluster nodes offline. Hub is online, live link re-establishing…`,sessionExpired:`Session expired — please sign in again.`,signIn:`Sign in`},passkeyPrompt:{message:`Save a passkey for faster sign-in?`,enrollNow:`Enroll now`,notNow:`Not now`},status:{online:`Online`,offline:`Offline`,connecting:`Connecting`,error:`Error`,disabled:`Disabled`,enabled:`Enabled`,active:`Active`,inactive:`Inactive`,running:`Running`,stopped:`Stopped`,pending:`Pending`,unknown:`Unknown`},auth:{login:`Login`,logout:`Logout`,username:`Username`,password:`Password`,signIn:`Sign In`,invalidCredentials:`Invalid username or password`},theme:{dark:`Dark`,light:`Light`,system:`System`},language:{select:`Language`,en:`English`,it:`Italian`},pages:{dashboard:{title:`Dashboard`,subtitle:`Overview of all devices and their status`},integrations:{title:`Integrations`,subtitle:`Manage camera sources and provider connections`},metrics:{title:`Metrics`,subtitle:`System performance and usage statistics`},agents:{title:`Agents`,subtitle:`Manage distributed processing agents`},addons:{title:`Addons`,subtitle:`Extend functionality with addon modules`},settings:{title:`Settings`,subtitle:`Configure system-wide preferences`},users:{title:`Users`,subtitle:`Manage user accounts and permissions`},logs:{title:`Logs`,subtitle:`View system and device logs`}},integrations:{preview:`Preview`,snapshotUnavailable:`Snapshot unavailable`,noSnapshot:`No snapshot`,lastSnapshot:`Last snapshot:`,offline:`Offline`,active:`Active`,available:`Available`,noDevices:`No devices.`,addFirstDevice:`Add your first device to get started.`,import:`+ Import`,noProviders:`No providers available. Install a provider addon.`,manage:`Manage`,integrationName:`Integration name`,integrationNamePlaceholder:`e.g. Garage Server`,connectionSuccess:`Connection successful!`,errorPrefix:`Error:`,back:`Back`,testing:`Testing...`,testConnection:`Test connection`,forward:`Next`,searchingDevices:`Searching for devices...`,foundDevices:`Found {{count}} devices. Select the ones to import.`,noDevicesFound:`No devices found.`,skip:`Skip`,importSelected:`Import selected`,newIntegration:`New Integration`,configureIntegration:`Configure Integration`,importDevices:`Import Devices`,addDevice:`Add device`,name:`Name`,namePlaceholder:`e.g. Entrance Camera`,snapshotUrlOptional:`Snapshot URL (optional)`,streamUrls:`Stream URLs`,addStream:`Add stream`,cancel:`Cancel`,saving:`Saving...`,save:`Save`,saveAndNew:`Save and new`,test:`Test`,stream:`Stream {{number}}:`,devices:`devices`,rediscover:`Rediscover`,config:`Config`,integrationNotFound:`Integration not found.`,configComingSoon:`Config coming soon.`,providerConfig:`Provider Config`,editConfig:`Edit configuration`,relinkBrokerHelp:`Choose the broker this integration connects through. Picking a different broker re-points it and restarts the addon.`,currentBroker:`Current broker`,relinkFailed:`Failed to update broker link.`,noBrokerKind:`This integration declares device-adoption but its addon manifest has no brokerKind.`}},al={nav:{dashboard:`Dashboard`,integrations:`Integrazioni`,metrics:`Metriche`,detectionSection:`Detection`,detectionIntelligence:`Persone`,vehicles:`Veicoli`,clusterSection:`Cluster & Server`},system:{title:`Amministrazione`,addons:`Addon`,agents:`Agenti`,processes:`Processi`,logs:`Log`,users:`Utenti`,settings:`Impostazioni`,repl:`REPL`,models:`Modelli`,integrations:`Connettività`,serverManagement:`Server`},common:{save:`Salva`,cancel:`Annulla`,delete:`Elimina`,enable:`Abilita`,disable:`Disabilita`,edit:`Modifica`,add:`Aggiungi`,remove:`Rimuovi`,confirm:`Conferma`,close:`Chiudi`,back:`Indietro`,next:`Avanti`,search:`Cerca`,filter:`Filtra`,reset:`Reimposta`,apply:`Applica`,submit:`Invia`,loading:`Caricamento…`,error:`Errore`,success:`Successo`,warning:`Avviso`,info:`Info`,noData:`Nessun dato disponibile`,noResults:`Nessun risultato trovato`,retry:`Riprova`,refresh:`Aggiorna`,copy:`Copia`,copied:`Copiato!`,yes:`Sì`,no:`No`},connection:{disconnected:`Server non raggiungibile — riconnessione in corso…`,connected:`Connesso`,reconnecting:`Riconnessione in corso…`,degraded:`Connessione live interrotta — l'hub è online (un nodo del cluster potrebbe non rispondere), ripristino in corso…`,degradedNodes_one:`Cluster degradato — il nodo {{nodes}} non risponde. L'hub è online, ripristino del collegamento live…`,degradedNodes_other:`Cluster degradato — i nodi {{nodes}} non rispondono. L'hub è online, ripristino del collegamento live…`,degradedCount_one:`Cluster degradato — {{count}} nodo del cluster offline. L'hub è online, ripristino del collegamento live…`,degradedCount_other:`Cluster degradato — {{count}} nodi del cluster offline. L'hub è online, ripristino del collegamento live…`,sessionExpired:`Sessione scaduta — effettua di nuovo l'accesso.`,signIn:`Accedi`},passkeyPrompt:{message:`Vuoi salvare una passkey per accedere più velocemente?`,enrollNow:`Registra ora`,notNow:`Non ora`},status:{online:`Online`,offline:`Offline`,connecting:`Connessione in corso`,error:`Errore`,disabled:`Disabilitato`,enabled:`Abilitato`,active:`Attivo`,inactive:`Inattivo`,running:`In esecuzione`,stopped:`Fermato`,pending:`In attesa`,unknown:`Sconosciuto`},auth:{login:`Accesso`,logout:`Esci`,username:`Nome utente`,password:`Password`,signIn:`Accedi`,invalidCredentials:`Nome utente o password non validi`},theme:{dark:`Scuro`,light:`Chiaro`,system:`Sistema`},language:{select:`Lingua`,en:`Inglese`,it:`Italiano`},pages:{dashboard:{title:`Dashboard`,subtitle:`Panoramica di tutti i dispositivi e il loro stato`},integrations:{title:`Integrazioni`,subtitle:`Gestisci le sorgenti video e le connessioni ai provider`},metrics:{title:`Metriche`,subtitle:`Statistiche di prestazioni e utilizzo del sistema`},agents:{title:`Agenti`,subtitle:`Gestisci gli agenti di elaborazione distribuita`},addons:{title:`Addon`,subtitle:`Estendi le funzionalità con moduli addon`},settings:{title:`Impostazioni`,subtitle:`Configura le preferenze di sistema`},users:{title:`Utenti`,subtitle:`Gestisci gli account utente e i permessi`},logs:{title:`Log`,subtitle:`Visualizza i log di sistema e dei dispositivi`}},integrations:{preview:`Anteprima`,snapshotUnavailable:`Snapshot non disponibile`,noSnapshot:`Nessuno snapshot`,lastSnapshot:`Ultimo snapshot:`,offline:`Offline`,active:`Attivi`,available:`Disponibili`,noDevices:`Nessun dispositivo.`,addFirstDevice:`Aggiungi il primo dispositivo per iniziare.`,import:`+ Importa`,noProviders:`Nessun provider disponibile. Installa un addon provider.`,manage:`Gestisci`,integrationName:`Nome integrazione`,integrationNamePlaceholder:`es. Server Garage`,connectionSuccess:`Connessione riuscita!`,errorPrefix:`Errore:`,back:`Indietro`,testing:`Test...`,testConnection:`Test connessione`,forward:`Avanti`,searchingDevices:`Ricerca dispositivi in corso...`,foundDevices:`Trovati {{count}} dispositivi. Seleziona quelli da importare.`,noDevicesFound:`Nessun dispositivo trovato.`,skip:`Salta`,importSelected:`Importa selezionati`,newIntegration:`Nuova Integrazione`,configureIntegration:`Configura Integrazione`,importDevices:`Importa Dispositivi`,addDevice:`Aggiungi dispositivo`,name:`Nome`,namePlaceholder:`es. Camera Ingresso`,snapshotUrlOptional:`Snapshot URL (opzionale)`,streamUrls:`Stream URLs`,addStream:`Aggiungi stream`,cancel:`Annulla`,saving:`Salvataggio...`,save:`Salva`,saveAndNew:`Salva e nuova`,test:`Test`,stream:`Stream {{number}}:`,devices:`dispositivi`,rediscover:`Riscopri`,config:`Config`,integrationNotFound:`Integrazione non trovata.`,configComingSoon:`Config coming soon.`,providerConfig:`Provider Config`,editConfig:`Modifica configurazione`,relinkBrokerHelp:`Scegli il broker tramite cui questa integrazione si connette. Selezionando un broker diverso la si ricollega e riavvia l’addon.`,currentBroker:`Broker attuale`,relinkFailed:`Aggiornamento del collegamento al broker non riuscito.`,noBrokerKind:`Questa integrazione dichiara device-adoption ma il manifest dell’addon non ha un brokerKind.`},serverManagement:{title:`Gestione server`,subtitle:`Pacchetti radice aggiornabili a runtime per ogni nodo — gli aggiornamenti si installano nella data directory del nodo e si applicano al riavvio con rollback automatico.`,nodeHub:`hub`,nodeAgent:`agent`,nodeOffline:`offline`,lastReportedVersion:`Ultima versione riportata`,nodeRestarting:`Il nodo si sta riavviando per applicare la modifica…`,topologyError:`Impossibile caricare l'elenco dei nodi del cluster — viene mostrato solo il hub.`,checkForUpdate:`Controlla aggiornamenti`,updateTo:`Aggiorna a {{version}}`,rollback:`Ripristina {{version}}`,runningVersion:`Versione in esecuzione`,latestVersion:`Ultima sul registry`,previousVersion:`Precedente (destinazione rollback)`,seedVersion:`Versione seed immagine`,pendingVersion:`In attesa (si applica al riavvio)`,stateUpToDate:`aggiornato`,stateUpdateAvailable:`aggiornamento disponibile`,stateChecking:`controllo…`,stateStaging:`aggiornamento…`,statePending:`riavvio in sospeso`,stateAwaitingConfirmation:`in attesa di conferma`,stateRolledBack:`rollback eseguito (aggiornamento fallito)`,bootDataRoot:`aggiornabile a runtime`,bootWorkspace:`workspace di sviluppo`,bootBaked:`seed dell'immagine`,bakedSeed:`il seed dell'immagine`,lastChecked:`Ultimo controllo: {{when}}`,loadError:`Impossibile caricare lo stato del pacchetto radice del nodo.`,workspaceNote:`Workspace di sviluppo rilevato — gli aggiornamenti runtime sono disabilitati.`,rolledBackDetail:`Aggiornamento a {{from}} fallito, rollback a {{to}}: {{reason}}`,confirmUpdateTitle:`Aggiorna pacchetto radice del nodo`,confirmUpdateBody:`Installa {{pkg}}@{{version}} sul nodo "{{node}}" e riavvialo per applicarlo. La nuova versione parte in prova: se non raggiunge lo stato ready, il nodo torna automaticamente alla versione corrente. Richiede un supervisore che riavvii sempre il processo (restart policy Docker "unless-stopped" o "always"), altrimenti il nodo resta spento dopo essere uscito per applicare l'aggiornamento.`,confirmUpdateAction:`Aggiorna e riavvia`,confirmRollbackTitle:`Ripristina pacchetto radice del nodo`,confirmRollbackBody:`Riavviare il nodo "{{node}}" sulla versione precedente ({{version}})?`,confirmRollbackAction:`Ripristina e riavvia`,restart:`Riavvia`,nodeRuntimeVersion:`Runtime Node.js`,confirmRestartTitle:`Riavvia nodo`,confirmRestartBody:`Riavviare ora il nodo "{{node}}"? Il processo esce e il suo supervisore lo riavvia sulla stessa versione. Le richieste in corso verso questo nodo vengono interrotte.`,confirmRestartAction:`Riavvia`,updateAll:`Aggiorna tutti i nodi`,updateAllHint:`In sequenza: prima gli agent, l'hub per ultimo — i nodi già aggiornati vengono saltati.`,confirmUpdateAllTitle:`Aggiorna tutti i nodi`,confirmUpdateAllBody:`Aggiorna in sequenza ogni nodo online all'ultima versione pubblicata — prima gli agent, l'hub per ultimo. Ogni nodo installa il suo pacchetto radice (solo se più recente di quello in esecuzione) e riparte in prova con rollback automatico; i nodi già aggiornati vengono saltati. L'hub riparte per ultimo, quindi questa pagina si riconnetterà successivamente.`,confirmUpdateAllAction:`Aggiorna tutti e riavvia`,awaitingConfirmationWarning:`Questo nodo è ripartito su {{version}} e sta confermando lo stato di boot — evita di riavviarlo ora. Aggiornamento e rollback sono temporaneamente non disponibili finché il boot in prova non viene confermato; un riavvio manuale in questa finestra causerebbe il rollback automatico dell'aggiornamento.`,stateCorruptWarning:`Il file di stato server-root su questo nodo è corrotto — il nodo è partito dal seed dell'immagine e le versioni installate nella data directory vengono ignorate. Applicare un aggiornamento riscriverà il file di stato.`,phase2Note:`Fase 2: l'aggiornamento riguarda solo il processo principale di ciascun nodo (hub + agent docker) — i runner degli addon restano sull'overlay /data/framework e l'agent Electron resta legato al bundle fino alle fasi successive. Non assumere coerenza dell'intero stack da un singolo Update.`}},ol=`camstack_language`,sl=localStorage.getItem(ol)??`en`;Q.use(_s).init({resources:{en:{translation:il},it:{translation:al}},lng:sl,fallbackLng:`en`,interpolation:{escapeValue:!1}}),Q.on(`languageChanged`,e=>{localStorage.setItem(ol,e)}),F(),window.__camstackUiLibrary=se,window.__camstackSdk=h,window.__camstackTypes=De,Me(document.getElementById(`root`)).render(B(ve,{children:B(rl,{})}));export{si as A,Xr as B,_i as C,ui as D,di as E,ni as F,br as G,qr as H,ti as I,Or as J,Qt as K,ei as L,ai as M,ii as N,li as O,ri as P,Qr as R,vi as S,hi as T,Kr as U,Jr as V,X as W,Ti as _,zi as a,bi as b,Ii as c,Mi as d,Ai as f,Ei as g,Di as h,Bi as i,oi as j,ci as k,Pi as l,Oi as m,xs as n,Ri as o,ki as p,nn as q,Ja as r,Li as s,Ts as t,Ni as u,wi as v,gi as w,yi as x,Ci as y,Zr as z};
|