@camstack/addon-admin-ui 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/assets/index-BoVZEQ1j.js +598 -0
  2. package/dist/assets/index-DwSc8ann.css +1 -0
  3. package/{index.html → dist/index.html} +3 -1
  4. package/dist/server/addon.d.ts +11 -0
  5. package/dist/server/addon.js +50 -0
  6. package/dist/server/addon.js.map +1 -0
  7. package/package.json +4 -1
  8. package/src/App.tsx +0 -71
  9. package/src/components/addons/AddonCard.tsx +0 -355
  10. package/src/components/addons/AddonUploadZone.tsx +0 -69
  11. package/src/components/addons/CapabilityBadge.tsx +0 -55
  12. package/src/components/addons/CapabilityMap.tsx +0 -133
  13. package/src/components/addons/UpdatesList.tsx +0 -108
  14. package/src/components/agents/AgentCard.tsx +0 -281
  15. package/src/components/agents/AgentLogs.tsx +0 -231
  16. package/src/components/agents/ProcessList.tsx +0 -127
  17. package/src/components/agents/ProcessTree.tsx +0 -369
  18. package/src/components/agents/TaskList.tsx +0 -68
  19. package/src/components/cameras/CameraCard.tsx +0 -60
  20. package/src/components/cameras/LiveEventsPanel.tsx +0 -91
  21. package/src/components/cameras/ProviderSection.tsx +0 -50
  22. package/src/components/cameras/StreamArea.tsx +0 -107
  23. package/src/components/cameras/tabs/AddonsTab.tsx +0 -113
  24. package/src/components/cameras/tabs/CameraEventsTab.tsx +0 -129
  25. package/src/components/cameras/tabs/PipelineTab.tsx +0 -118
  26. package/src/components/cameras/tabs/StreamsTab.tsx +0 -114
  27. package/src/components/dashboard/BlockPicker.tsx +0 -54
  28. package/src/components/dashboard/BlockWrapper.tsx +0 -97
  29. package/src/components/dashboard/DashboardGrid.tsx +0 -160
  30. package/src/components/dashboard/block-registry.ts +0 -15
  31. package/src/components/dashboard/blocks/PipelineStagesBlock.tsx +0 -39
  32. package/src/components/dashboard/blocks/StorageBlock.tsx +0 -66
  33. package/src/components/dashboard/blocks/SystemStatusBlock.tsx +0 -67
  34. package/src/components/dashboard/blocks/index.ts +0 -32
  35. package/src/components/device/DeviceHeader.tsx +0 -116
  36. package/src/components/device/FloatingPanel.tsx +0 -132
  37. package/src/components/device/FloatingPanelManager.tsx +0 -167
  38. package/src/components/device/PanelContent.tsx +0 -196
  39. package/src/components/device/QuickConfigWizard.tsx +0 -507
  40. package/src/components/device/tabs/DetectionConfigTab.tsx +0 -96
  41. package/src/components/device/tabs/EventsTab.tsx +0 -19
  42. package/src/components/device/tabs/LogsTab.tsx +0 -22
  43. package/src/components/device/tabs/OverviewTab.tsx +0 -104
  44. package/src/components/device/tabs/ProviderSettingsTab.tsx +0 -34
  45. package/src/components/device/tabs/RecordingTab.tsx +0 -47
  46. package/src/components/device/tabs/ReplTab.tsx +0 -153
  47. package/src/components/device/tabs/TrackTrailTab.tsx +0 -49
  48. package/src/components/device/tabs/ZonesTab.tsx +0 -98
  49. package/src/components/device/zone-editor/ZoneCanvas.tsx +0 -354
  50. package/src/components/device/zone-editor/ZoneForm.tsx +0 -128
  51. package/src/components/device/zone-editor/ZoneList.tsx +0 -150
  52. package/src/components/form-builder/FormBuilder.tsx +0 -135
  53. package/src/components/form-builder/FormField.tsx +0 -732
  54. package/src/components/form-builder/ModelSelector.tsx +0 -239
  55. package/src/components/integrations/AddDeviceDialog.tsx +0 -205
  56. package/src/components/integrations/CompactDeviceCard.tsx +0 -35
  57. package/src/components/integrations/DeviceCard.tsx +0 -29
  58. package/src/components/integrations/DeviceDiscoveryStep.tsx +0 -105
  59. package/src/components/integrations/DeviceGrid.tsx +0 -79
  60. package/src/components/integrations/DeviceGroupHeader.tsx +0 -17
  61. package/src/components/integrations/DiscoveredDeviceCard.tsx +0 -26
  62. package/src/components/integrations/IntegrationCard.tsx +0 -40
  63. package/src/components/integrations/IntegrationWizard.tsx +0 -172
  64. package/src/components/integrations/ProviderConfigForm.tsx +0 -89
  65. package/src/components/integrations/ProviderPicker.tsx +0 -91
  66. package/src/components/integrations/SnapshotPopover.tsx +0 -68
  67. package/src/components/metrics/AgentLoad.tsx +0 -105
  68. package/src/components/metrics/IntegrationUsage.tsx +0 -73
  69. package/src/components/metrics/PipelineStatus.tsx +0 -74
  70. package/src/components/metrics/ProcessResources.tsx +0 -123
  71. package/src/components/pipeline/PhaseSettings.tsx +0 -131
  72. package/src/components/shared/CapabilityBadges.tsx +0 -30
  73. package/src/components/shared/ProviderIcon.tsx +0 -42
  74. package/src/components/shared/StatusBadge.tsx +0 -23
  75. package/src/components/shared/WebRtcPlayer.tsx +0 -211
  76. package/src/components/timeline/EventMarker.tsx +0 -32
  77. package/src/components/timeline/TimelineBar.tsx +0 -131
  78. package/src/components/ui/ConfirmDialog.tsx +0 -115
  79. package/src/components/ui/ToastContainer.tsx +0 -92
  80. package/src/contexts/auth-context.tsx +0 -91
  81. package/src/hooks/useBackendClient.ts +0 -6
  82. package/src/hooks/useTheme.ts +0 -1
  83. package/src/i18n/en.json +0 -164
  84. package/src/i18n/index.ts +0 -29
  85. package/src/i18n/it.json +0 -164
  86. package/src/index.css +0 -63
  87. package/src/layouts/AddonPageLoader.tsx +0 -120
  88. package/src/layouts/AppLayout.tsx +0 -254
  89. package/src/layouts/ProtectedRoute.tsx +0 -25
  90. package/src/lib/addon-page-context.ts +0 -29
  91. package/src/lib/backend.ts +0 -16
  92. package/src/main.tsx +0 -21
  93. package/src/pages/AccessDenied.tsx +0 -22
  94. package/src/pages/Cameras.tsx +0 -127
  95. package/src/pages/Dashboard.tsx +0 -6
  96. package/src/pages/DeviceDetail.tsx +0 -175
  97. package/src/pages/IntegrationDetail.tsx +0 -222
  98. package/src/pages/Integrations.tsx +0 -333
  99. package/src/pages/Login.tsx +0 -106
  100. package/src/pages/Metrics.tsx +0 -18
  101. package/src/pages/PipelineConfig.tsx +0 -282
  102. package/src/pages/Showroom.tsx +0 -351
  103. package/src/pages/Timeline.tsx +0 -269
  104. package/src/pages/system/Addons.tsx +0 -396
  105. package/src/pages/system/Agents.tsx +0 -362
  106. package/src/pages/system/Logs.tsx +0 -131
  107. package/src/pages/system/Models.tsx +0 -102
  108. package/src/pages/system/Processes.tsx +0 -129
  109. package/src/pages/system/Repl.tsx +0 -148
  110. package/src/pages/system/Settings.tsx +0 -168
  111. package/src/pages/system/Users.tsx +0 -174
  112. package/src/server/addon.ts +0 -54
  113. package/src/types/config-ui.ts +0 -28
  114. package/src/types/dashboard.ts +0 -39
  115. package/tsconfig.json +0 -29
  116. package/tsconfig.server.json +0 -16
  117. package/tsup.config.ts +0 -20
  118. package/vite.config.ts +0 -68
  119. /package/{public → dist}/brand/logo-dark.svg +0 -0
  120. /package/{public → dist}/brand/logo-horizontal-dark.svg +0 -0
  121. /package/{public → dist}/brand/logo-horizontal-light.svg +0 -0
  122. /package/{public → dist}/brand/logo-light.svg +0 -0
  123. /package/{public → dist}/brand/logo-wide-dark.svg +0 -0
  124. /package/{public → dist}/brand/logo-wide-light.svg +0 -0
  125. /package/{public → dist}/favicon.svg +0 -0
  126. /package/{public → dist}/vendor/react-jsx-runtime.mjs +0 -0
  127. /package/{public → dist}/vendor/react.mjs +0 -0
@@ -0,0 +1,598 @@
1
+ var L7=Object.defineProperty;var g2=t=>{throw TypeError(t)};var U7=(t,e,n)=>e in t?L7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pp=(t,e,n)=>U7(t,typeof e!="symbol"?e+"":e,n),qy=(t,e,n)=>e.has(t)||g2("Cannot "+n);var Q=(t,e,n)=>(qy(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?g2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Oe=(t,e,n,s)=>(qy(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Je=(t,e,n)=>(qy(t,e,"access private method"),n);var L0=(t,e,n,s)=>({set _(i){Oe(t,e,i,n)},get _(){return Q(t,e,s)}});function b4(t,e){for(var n=0;n<e.length;n++){const s=e[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(s,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function qb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var By={exports:{}},Yp={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var y2;function H7(){if(y2)return Yp;y2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var d=null;if(o!==void 0&&(d=""+o),i.key!==void 0&&(d=""+i.key),"key"in i){o={};for(var f in i)f!=="key"&&(o[f]=i[f])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:d,ref:i!==void 0?i:null,props:o}}return Yp.Fragment=e,Yp.jsx=n,Yp.jsxs=n,Yp}var x2;function q7(){return x2||(x2=1,By.exports=H7()),By.exports}var h=q7(),Gy={exports:{}},lt={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var b2;function B7(){if(b2)return lt;b2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function j(G){return G===null||typeof G!="object"?null:(G=_&&G[_]||G["@@iterator"],typeof G=="function"?G:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,R={};function T(G,W,he){this.props=G,this.context=W,this.refs=R,this.updater=he||w}T.prototype.isReactComponent={},T.prototype.setState=function(G,W){if(typeof G!="object"&&typeof G!="function"&&G!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,G,W,"setState")},T.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function A(){}A.prototype=T.prototype;function z(G,W,he){this.props=G,this.context=W,this.refs=R,this.updater=he||w}var k=z.prototype=new A;k.constructor=z,O(k,T.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(G,W,he){var xe=he.ref;return{$$typeof:t,type:G,key:W,ref:xe!==void 0?xe:null,props:he}}function Z(G,W){return V(G.type,W,G.props)}function oe(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ne(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(he){return W[he]})}var J=/\/+/g;function ie(G,W){return typeof G=="object"&&G!==null&&G.key!=null?ne(""+G.key):W.toString(36)}function ce(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(H,H):(G.status="pending",G.then(function(W){G.status==="pending"&&(G.status="fulfilled",G.value=W)},function(W){G.status==="pending"&&(G.status="rejected",G.reason=W)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function Y(G,W,he,xe,_e){var je=typeof G;(je==="undefined"||je==="boolean")&&(G=null);var De=!1;if(G===null)De=!0;else switch(je){case"bigint":case"string":case"number":De=!0;break;case"object":switch(G.$$typeof){case t:case e:De=!0;break;case v:return De=G._init,Y(De(G._payload),W,he,xe,_e)}}if(De)return _e=_e(G),De=xe===""?"."+ie(G,0):xe,P(_e)?(he="",De!=null&&(he=De.replace(J,"$&/")+"/"),Y(_e,W,he,"",function(Vt){return Vt})):_e!=null&&(oe(_e)&&(_e=Z(_e,he+(_e.key==null||G&&G.key===_e.key?"":(""+_e.key).replace(J,"$&/")+"/")+De)),W.push(_e)),1;De=0;var nt=xe===""?".":xe+":";if(P(G))for(var ze=0;ze<G.length;ze++)xe=G[ze],je=nt+ie(xe,ze),De+=Y(xe,W,he,je,_e);else if(ze=j(G),typeof ze=="function")for(G=ze.call(G),ze=0;!(xe=G.next()).done;)xe=xe.value,je=nt+ie(xe,ze++),De+=Y(xe,W,he,je,_e);else if(je==="object"){if(typeof G.then=="function")return Y(ce(G),W,he,xe,_e);throw W=String(G),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return De}function $(G,W,he){if(G==null)return G;var xe=[],_e=0;return Y(G,xe,"","",function(je){return W.call(he,je,_e++)}),xe}function ae(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(he){(G._status===0||G._status===-1)&&(G._status=1,G._result=he)},function(he){(G._status===0||G._status===-1)&&(G._status=2,G._result=he)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var Ne=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},re={map:$,forEach:function(G,W,he){$(G,function(){W.apply(this,arguments)},he)},count:function(G){var W=0;return $(G,function(){W++}),W},toArray:function(G){return $(G,function(W){return W})||[]},only:function(G){if(!oe(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return lt.Activity=b,lt.Children=re,lt.Component=T,lt.Fragment=n,lt.Profiler=i,lt.PureComponent=z,lt.StrictMode=s,lt.Suspense=m,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,lt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return B.H.useMemoCache(G)}},lt.cache=function(G){return function(){return G.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(G,W,he){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var xe=O({},G.props),_e=G.key;if(W!=null)for(je in W.key!==void 0&&(_e=""+W.key),W)!L.call(W,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&W.ref===void 0||(xe[je]=W[je]);var je=arguments.length-2;if(je===1)xe.children=he;else if(1<je){for(var De=Array(je),nt=0;nt<je;nt++)De[nt]=arguments[nt+2];xe.children=De}return V(G.type,_e,xe)},lt.createContext=function(G){return G={$$typeof:d,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},lt.createElement=function(G,W,he){var xe,_e={},je=null;if(W!=null)for(xe in W.key!==void 0&&(je=""+W.key),W)L.call(W,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(_e[xe]=W[xe]);var De=arguments.length-2;if(De===1)_e.children=he;else if(1<De){for(var nt=Array(De),ze=0;ze<De;ze++)nt[ze]=arguments[ze+2];_e.children=nt}if(G&&G.defaultProps)for(xe in De=G.defaultProps,De)_e[xe]===void 0&&(_e[xe]=De[xe]);return V(G,je,_e)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(G){return{$$typeof:f,render:G}},lt.isValidElement=oe,lt.lazy=function(G){return{$$typeof:v,_payload:{_status:-1,_result:G},_init:ae}},lt.memo=function(G,W){return{$$typeof:y,type:G,compare:W===void 0?null:W}},lt.startTransition=function(G){var W=B.T,he={};B.T=he;try{var xe=G(),_e=B.S;_e!==null&&_e(he,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(H,Ne)}catch(je){Ne(je)}finally{W!==null&&he.types!==null&&(W.types=he.types),B.T=W}},lt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},lt.use=function(G){return B.H.use(G)},lt.useActionState=function(G,W,he){return B.H.useActionState(G,W,he)},lt.useCallback=function(G,W){return B.H.useCallback(G,W)},lt.useContext=function(G){return B.H.useContext(G)},lt.useDebugValue=function(){},lt.useDeferredValue=function(G,W){return B.H.useDeferredValue(G,W)},lt.useEffect=function(G,W){return B.H.useEffect(G,W)},lt.useEffectEvent=function(G){return B.H.useEffectEvent(G)},lt.useId=function(){return B.H.useId()},lt.useImperativeHandle=function(G,W,he){return B.H.useImperativeHandle(G,W,he)},lt.useInsertionEffect=function(G,W){return B.H.useInsertionEffect(G,W)},lt.useLayoutEffect=function(G,W){return B.H.useLayoutEffect(G,W)},lt.useMemo=function(G,W){return B.H.useMemo(G,W)},lt.useOptimistic=function(G,W){return B.H.useOptimistic(G,W)},lt.useReducer=function(G,W,he){return B.H.useReducer(G,W,he)},lt.useRef=function(G){return B.H.useRef(G)},lt.useState=function(G){return B.H.useState(G)},lt.useSyncExternalStore=function(G,W,he){return B.H.useSyncExternalStore(G,W,he)},lt.useTransition=function(){return B.H.useTransition()},lt.version="19.2.4",lt}var v2;function gl(){return v2||(v2=1,Gy.exports=B7()),Gy.exports}var D=gl();const $t=qb(D),G7=b4({__proto__:null,default:$t},[D]);var Py={exports:{}},Vp={},Yy={exports:{}},Vy={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var S2;function P7(){return S2||(S2=1,(function(t){function e(Y,$){var ae=Y.length;Y.push($);e:for(;0<ae;){var Ne=ae-1>>>1,re=Y[Ne];if(0<i(re,$))Y[Ne]=$,Y[ae]=re,ae=Ne;else break e}}function n(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var $=Y[0],ae=Y.pop();if(ae!==$){Y[0]=ae;e:for(var Ne=0,re=Y.length,G=re>>>1;Ne<G;){var W=2*(Ne+1)-1,he=Y[W],xe=W+1,_e=Y[xe];if(0>i(he,ae))xe<re&&0>i(_e,he)?(Y[Ne]=_e,Y[xe]=ae,Ne=xe):(Y[Ne]=he,Y[W]=ae,Ne=W);else if(xe<re&&0>i(_e,ae))Y[Ne]=_e,Y[xe]=ae,Ne=xe;else break e}}return $}function i(Y,$){var ae=Y.sortIndex-$.sortIndex;return ae!==0?ae:Y.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var d=Date,f=d.now();t.unstable_now=function(){return d.now()-f}}var m=[],y=[],v=1,b=null,_=3,j=!1,w=!1,O=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function k(Y){for(var $=n(y);$!==null;){if($.callback===null)s(y);else if($.startTime<=Y)s(y),$.sortIndex=$.expirationTime,e(m,$);else break;$=n(y)}}function P(Y){if(O=!1,k(Y),!w)if(n(m)!==null)w=!0,H||(H=!0,ne());else{var $=n(y);$!==null&&ce(P,$.startTime-Y)}}var H=!1,B=-1,L=5,V=-1;function Z(){return R?!0:!(t.unstable_now()-V<L)}function oe(){if(R=!1,H){var Y=t.unstable_now();V=Y;var $=!0;try{e:{w=!1,O&&(O=!1,A(B),B=-1),j=!0;var ae=_;try{t:{for(k(Y),b=n(m);b!==null&&!(b.expirationTime>Y&&Z());){var Ne=b.callback;if(typeof Ne=="function"){b.callback=null,_=b.priorityLevel;var re=Ne(b.expirationTime<=Y);if(Y=t.unstable_now(),typeof re=="function"){b.callback=re,k(Y),$=!0;break t}b===n(m)&&s(m),k(Y)}else s(m);b=n(m)}if(b!==null)$=!0;else{var G=n(y);G!==null&&ce(P,G.startTime-Y),$=!1}}break e}finally{b=null,_=ae,j=!1}$=void 0}}finally{$?ne():H=!1}}}var ne;if(typeof z=="function")ne=function(){z(oe)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ie=J.port2;J.port1.onmessage=oe,ne=function(){ie.postMessage(null)}}else ne=function(){T(oe,0)};function ce(Y,$){B=T(function(){Y(t.unstable_now())},$)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Y){Y.callback=null},t.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<Y?Math.floor(1e3/Y):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_next=function(Y){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var ae=_;_=$;try{return Y()}finally{_=ae}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ae=_;_=Y;try{return $()}finally{_=ae}},t.unstable_scheduleCallback=function(Y,$,ae){var Ne=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Ne+ae:Ne):ae=Ne,Y){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=ae+re,Y={id:v++,callback:$,priorityLevel:Y,startTime:ae,expirationTime:re,sortIndex:-1},ae>Ne?(Y.sortIndex=ae,e(y,Y),n(m)===null&&Y===n(y)&&(O?(A(B),B=-1):O=!0,ce(P,ae-Ne))):(Y.sortIndex=re,e(m,Y),w||j||(w=!0,H||(H=!0,ne()))),Y},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(Y){var $=_;return function(){var ae=_;_=$;try{return Y.apply(this,arguments)}finally{_=ae}}}})(Vy)),Vy}var N2;function Bb(){return N2||(N2=1,Yy.exports=P7()),Yy.exports}var Qy={exports:{}},bs={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var _2;function Y7(){if(_2)return bs;_2=1;var t=gl();function e(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)y+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(m,y,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:m,containerInfo:y,implementation:v}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return bs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,bs.createPortal=function(m,y){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(e(299));return o(m,y,null,v)},bs.flushSync=function(m){var y=d.T,v=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=y,s.p=v,s.d.f()}},bs.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(m,y))},bs.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},bs.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var v=y.as,b=f(v,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,j=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;v==="style"?s.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:j}):v==="script"&&s.d.X(m,{crossOrigin:b,integrity:_,fetchPriority:j,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},bs.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var v=f(y.as,y.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(m)},bs.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var v=y.as,b=f(v,y.crossOrigin);s.d.L(m,v,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},bs.preloadModule=function(m,y){if(typeof m=="string")if(y){var v=f(y.as,y.crossOrigin);s.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(m)},bs.requestFormReset=function(m){s.d.r(m)},bs.unstable_batchedUpdates=function(m,y){return m(y)},bs.useFormState=function(m,y,v){return d.H.useFormState(m,y,v)},bs.useFormStatus=function(){return d.H.useHostTransitionStatus()},bs.version="19.2.4",bs}var C2;function Gb(){if(C2)return Qy.exports;C2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Qy.exports=Y7(),Qy.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var j2;function V7(){if(j2)return Vp;j2=1;var t=Bb(),e=gl(),n=Gb();function s(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var r=a,c=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(c=r.return),a=r.return;while(a)}return r.tag===3?c:null}function d(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function f(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function m(a){if(o(a)!==a)throw Error(s(188))}function y(a){var r=a.alternate;if(!r){if(r=o(a),r===null)throw Error(s(188));return r!==a?null:a}for(var c=a,p=r;;){var S=c.return;if(S===null)break;var N=S.alternate;if(N===null){if(p=S.return,p!==null){c=p;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===c)return m(S),a;if(N===p)return m(S),r;N=N.sibling}throw Error(s(188))}if(c.return!==p.return)c=S,p=N;else{for(var M=!1,q=S.child;q;){if(q===c){M=!0,c=S,p=N;break}if(q===p){M=!0,p=S,c=N;break}q=q.sibling}if(!M){for(q=N.child;q;){if(q===c){M=!0,c=N,p=S;break}if(q===p){M=!0,p=N,c=S;break}q=q.sibling}if(!M)throw Error(s(189))}}if(c.alternate!==p)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?a:r}function v(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=v(a),r!==null)return r;a=a.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),z=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function ne(a){return a===null||typeof a!="object"?null:(a=oe&&a[oe]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function ie(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case O:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case H:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case z:return a.displayName||"Context";case A:return(a._context.displayName||"Context")+".Consumer";case k:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case B:return r=a.displayName||null,r!==null?r:ie(a.type)||"Memo";case L:r=a._payload,a=a._init;try{return ie(a(r))}catch{}}return null}var ce=Array.isArray,Y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Ne=[],re=-1;function G(a){return{current:a}}function W(a){0>re||(a.current=Ne[re],Ne[re]=null,re--)}function he(a,r){re++,Ne[re]=a.current,a.current=r}var xe=G(null),_e=G(null),je=G(null),De=G(null);function nt(a,r){switch(he(je,r),he(_e,a),he(xe,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?qv(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=qv(r),a=Bv(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}W(xe),he(xe,a)}function ze(){W(xe),W(_e),W(je)}function Vt(a){a.memoizedState!==null&&he(De,a);var r=xe.current,c=Bv(r,a.type);r!==c&&(he(_e,a),he(xe,c))}function $e(a){_e.current===a&&(W(xe),W(_e)),De.current===a&&(W(De),Hp._currentValue=ae)}var At,qt;function wn(a){if(At===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);At=r&&r[1]||"",qt=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+At+a+qt}var Vn=!1;function Gt(a,r){if(!a||Vn)return"";Vn=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ge){var fe=ge}Reflect.construct(a,[],ve)}else{try{ve.call()}catch(ge){fe=ge}a.call(ve.prototype)}}else{try{throw Error()}catch(ge){fe=ge}(ve=a())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ge){if(ge&&fe&&typeof ge.stack=="string")return[ge.stack,fe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=p.DetermineComponentFrameRoot(),M=N[0],q=N[1];if(M&&q){var K=M.split(`
44
+ `),ue=q.split(`
45
+ `);for(S=p=0;p<K.length&&!K[p].includes("DetermineComponentFrameRoot");)p++;for(;S<ue.length&&!ue[S].includes("DetermineComponentFrameRoot");)S++;if(p===K.length||S===ue.length)for(p=K.length-1,S=ue.length-1;1<=p&&0<=S&&K[p]!==ue[S];)S--;for(;1<=p&&0<=S;p--,S--)if(K[p]!==ue[S]){if(p!==1||S!==1)do if(p--,S--,0>S||K[p]!==ue[S]){var ye=`
46
+ `+K[p].replace(" at new "," at ");return a.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",a.displayName)),ye}while(1<=p&&0<=S);break}}}finally{Vn=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?wn(c):""}function fn(a,r){switch(a.tag){case 26:case 27:case 5:return wn(a.type);case 16:return wn("Lazy");case 13:return a.child!==r&&r!==null?wn("Suspense Fallback"):wn("Suspense");case 19:return wn("SuspenseList");case 0:case 15:return Gt(a.type,!1);case 11:return Gt(a.type.render,!1);case 1:return Gt(a.type,!0);case 31:return wn("Activity");default:return""}}function fr(a){try{var r="",c=null;do r+=fn(a,c),c=a,a=a.return;while(a);return r}catch(p){return`
47
+ Error generating stack: `+p.message+`
48
+ `+p.stack}}var Ft=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,Un=t.unstable_cancelCallback,hn=t.unstable_shouldYield,Zt=t.unstable_requestPaint,Qn=t.unstable_now,Ns=t.unstable_getCurrentPriorityLevel,hr=t.unstable_ImmediatePriority,Qa=t.unstable_UserBlockingPriority,ia=t.unstable_NormalPriority,Ea=t.unstable_LowPriority,is=t.unstable_IdlePriority,pr=t.log,_s=t.unstable_setDisableYieldValue,Bs=null,$n=null;function ls(a){if(typeof pr=="function"&&_s(a),$n&&typeof $n.setStrictMode=="function")try{$n.setStrictMode(Bs,a)}catch{}}var ya=Math.clz32?Math.clz32:Nl,Ta=Math.log,Pu=Math.LN2;function Nl(a){return a>>>=0,a===0?32:31-(Ta(a)/Pu|0)|0}var Cs=256,mr=262144,gt=4194304;function pt(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Qt(a,r,c){var p=a.pendingLanes;if(p===0)return 0;var S=0,N=a.suspendedLanes,M=a.pingedLanes;a=a.warmLanes;var q=p&134217727;return q!==0?(p=q&~N,p!==0?S=pt(p):(M&=q,M!==0?S=pt(M):c||(c=q&~a,c!==0&&(S=pt(c))))):(q=p&~N,q!==0?S=pt(q):M!==0?S=pt(M):c||(c=p&~a,c!==0&&(S=pt(c)))),S===0?0:r!==0&&r!==S&&(r&N)===0&&(N=S&-S,c=r&-r,N>=c||N===32&&(c&4194048)!==0)?r:S}function Mt(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function Hn(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rn(){var a=gt;return gt<<=1,(gt&62914560)===0&&(gt=4194304),a}function Xn(a){for(var r=[],c=0;31>c;c++)r.push(a);return r}function yn(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ra(a,r,c,p,S,N){var M=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var q=a.entanglements,K=a.expirationTimes,ue=a.hiddenUpdates;for(c=M&~c;0<c;){var ye=31-ya(c),ve=1<<ye;q[ye]=0,K[ye]=-1;var fe=ue[ye];if(fe!==null)for(ue[ye]=null,ye=0;ye<fe.length;ye++){var ge=fe[ye];ge!==null&&(ge.lane&=-536870913)}c&=~ve}p!==0&&la(a,p,0),N!==0&&S===0&&a.tag!==0&&(a.suspendedLanes|=N&~(M&~r))}function la(a,r,c){a.pendingLanes|=r,a.suspendedLanes&=~r;var p=31-ya(r);a.entangledLanes|=r,a.entanglements[p]=a.entanglements[p]|1073741824|c&261930}function os(a,r){var c=a.entangledLanes|=r;for(a=a.entanglements;c;){var p=31-ya(c),S=1<<p;S&r|a[p]&r&&(a[p]|=r),c&=~S}}function Gs(a,r){var c=r&-r;return c=(c&42)!==0?1:Ue(c),(c&(a.suspendedLanes|r))!==0?0:c}function Ue(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function et(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ve(){var a=$.p;return a!==0?a:(a=window.event,a===void 0?32:u2(a.type))}function ot(a,r){var c=$.p;try{return $.p=a,r()}finally{$.p=c}}var yt=Math.random().toString(36).slice(2),Fe="__reactFiber$"+yt,ut="__reactProps$"+yt,an="__reactContainer$"+yt,Tt="__reactEvents$"+yt,pn="__reactListeners$"+yt,Ar="__reactHandles$"+yt,us="__reactResources$"+yt,Xa="__reactMarker$"+yt;function Ps(a){delete a[Fe],delete a[ut],delete a[Tt],delete a[pn],delete a[Ar]}function Pt(a){var r=a[Fe];if(r)return r;for(var c=a.parentNode;c;){if(r=c[an]||c[Fe]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(a=Kv(a);a!==null;){if(c=a[Fe])return c;a=Kv(a)}return r}a=c,c=a.parentNode}return null}function gr(a){if(a=a[Fe]||a[an]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function yr(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(s(33))}function js(a){var r=a[us];return r||(r=a[us]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function En(a){a[Xa]=!0}var ws=new Set,cd={};function Di(a,r){Es(a,r),Es(a+"Capture",r)}function Es(a,r){for(cd[a]=r,a=0;a<r.length;a++)ws.add(r[a])}var Ts=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yu={},Tn={};function ph(a){return Ft.call(Tn,a)?!0:Ft.call(Yu,a)?!1:Ts.test(a)?Tn[a]=!0:(Yu[a]=!0,!1)}function xo(a,r,c){if(ph(r))if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var p=r.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+c)}}function Vu(a,r,c){if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+c)}}function Mr(a,r,c,p){if(p===null)a.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(r,c,""+p)}}function Ys(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dd(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function mh(a,r,c){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,N=p.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return S.call(this)},set:function(M){c=""+M,N.call(this,M)}}),Object.defineProperty(a,r,{enumerable:p.enumerable}),{getValue:function(){return c},setValue:function(M){c=""+M},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Qu(a){if(!a._valueTracker){var r=dd(a)?"checked":"value";a._valueTracker=mh(a,r,""+a[r])}}function Ha(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var c=r.getValue(),p="";return a&&(p=dd(a)?a.checked?"true":"false":a.value),a=p,a!==c?(r.setValue(a),!0):!1}function xn(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var fd=/[\n"\\]/g;function qa(a){return a.replace(fd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function bo(a,r,c,p,S,N,M,q){a.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.type=M:a.removeAttribute("type"),r!=null?M==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ys(r)):a.value!==""+Ys(r)&&(a.value=""+Ys(r)):M!=="submit"&&M!=="reset"||a.removeAttribute("value"),r!=null?xr(a,M,Ys(r)):c!=null?xr(a,M,Ys(c)):p!=null&&a.removeAttribute("value"),S==null&&N!=null&&(a.defaultChecked=!!N),S!=null&&(a.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?a.name=""+Ys(q):a.removeAttribute("name")}function hd(a,r,c,p,S,N,M,q){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.type=N),r!=null||c!=null){if(!(N!=="submit"&&N!=="reset"||r!=null)){Qu(a);return}c=c!=null?""+Ys(c):"",r=r!=null?""+Ys(r):c,q||r===a.value||(a.value=r),a.defaultValue=r}p=p??S,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=q?a.checked:!!p,a.defaultChecked=!!p,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(a.name=M),Qu(a)}function xr(a,r,c){r==="number"&&xn(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function ui(a,r,c,p){if(a=a.options,r){r={};for(var S=0;S<c.length;S++)r["$"+c[S]]=!0;for(c=0;c<a.length;c++)S=r.hasOwnProperty("$"+a[c].value),a[c].selected!==S&&(a[c].selected=S),S&&p&&(a[c].defaultSelected=!0)}else{for(c=""+Ys(c),r=null,S=0;S<a.length;S++){if(a[S].value===c){a[S].selected=!0,p&&(a[S].defaultSelected=!0);return}r!==null||a[S].disabled||(r=a[S])}r!==null&&(r.selected=!0)}}function pd(a,r,c){if(r!=null&&(r=""+Ys(r),r!==a.value&&(a.value=r),c==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=c!=null?""+Ys(c):""}function md(a,r,c,p){if(r==null){if(p!=null){if(c!=null)throw Error(s(92));if(ce(p)){if(1<p.length)throw Error(s(93));p=p[0]}c=p}c==null&&(c=""),r=c}c=Ys(r),a.defaultValue=c,p=a.textContent,p===c&&p!==""&&p!==null&&(a.value=p),Qu(a)}function _l(a,r){if(r){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=r;return}}a.textContent=r}var Wm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gh(a,r,c){var p=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?p?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":p?a.setProperty(r,c):typeof c!="number"||c===0||Wm.has(r)?r==="float"?a.cssFloat=c:a[r]=(""+c).trim():a[r]=c+"px"}function yh(a,r,c){if(r!=null&&typeof r!="object")throw Error(s(62));if(a=a.style,c!=null){for(var p in c)!c.hasOwnProperty(p)||r!=null&&r.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var S in r)p=r[S],r.hasOwnProperty(S)&&c[S]!==p&&gh(a,S,p)}else for(var N in r)r.hasOwnProperty(N)&&gh(a,N,r[N])}function gd(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $m=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xh=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xu(a){return xh.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ci(){}var yd=null;function xd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Cl=null,zi=null;function bh(a){var r=gr(a);if(r&&(a=r.stateNode)){var c=a[ut]||null;e:switch(a=r.stateNode,r.type){case"input":if(bo(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+qa(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var p=c[r];if(p!==a&&p.form===a.form){var S=p[ut]||null;if(!S)throw Error(s(90));bo(p,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<c.length;r++)p=c[r],p.form===a.form&&Ha(p)}break e;case"textarea":pd(a,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&ui(a,!!c.multiple,r,!1)}}}var bd=!1;function vh(a,r,c){if(bd)return a(r,c);bd=!0;try{var p=a(r);return p}finally{if(bd=!1,(Cl!==null||zi!==null)&&(_r(),Cl&&(r=Cl,a=zi,zi=Cl=null,bh(r),a)))for(r=0;r<a.length;r++)bh(a[r])}}function vo(a,r){var c=a.stateNode;if(c===null)return null;var p=c[ut]||null;if(p===null)return null;c=p[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(s(231,r,typeof c));return c}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=!1;if(Dr)try{var So={};Object.defineProperty(So,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{Sh=!1}var Rs=null,vd=null,jl=null;function Ku(){if(jl)return jl;var a,r=vd,c=r.length,p,S="value"in Rs?Rs.value:Rs.textContent,N=S.length;for(a=0;a<c&&r[a]===S[a];a++);var M=c-a;for(p=1;p<=M&&r[c-p]===S[N-p];p++);return jl=S.slice(a,1<p?1-p:void 0)}function Fu(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function No(){return!0}function eg(){return!1}function Ka(a){function r(c,p,S,N,M){this._reactName=c,this._targetInst=S,this.type=p,this.nativeEvent=N,this.target=M,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(c=a[q],this[q]=c?c(N):N[q]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?No:eg,this.isPropagationStopped=eg,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=No)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=No)},persist:function(){},isPersistent:No}),r}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zu=Ka(ki),_o=b({},ki,{view:0,detail:0}),tg=Ka(_o),Iu,Sd,Co,jo=b({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Co&&(Co&&a.type==="mousemove"?(Iu=a.screenX-Co.screenX,Sd=a.screenY-Co.screenY):Sd=Iu=0,Co=a),Iu)},movementY:function(a){return"movementY"in a?a.movementY:Sd}}),Nh=Ka(jo),ng=b({},jo,{dataTransfer:0}),ag=Ka(ng),_h=b({},_o,{relatedTarget:0}),Nd=Ka(_h),sg=b({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),ry=Ka(sg),iy=b({},ki,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),rg=Ka(iy),Ju=b({},ki,{data:0}),_d=Ka(Ju),Cd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},lg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ch(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=lg[a])?!!r[a]:!1}function jd(){return Ch}var og=b({},_o,{key:function(a){if(a.key){var r=Cd[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Fu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?ig[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(a){return a.type==="keypress"?Fu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Fu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wl=Ka(og),wd=b({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Ka(wd),wh=b({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),ug=Ka(wh),cg=b({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),ly=Ka(cg),Oa=b({},jo,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),dg=Ka(Oa),fg=b({},ki,{newState:0,oldState:0}),hg=Ka(fg),pg=[9,13,27,32],El=Dr&&"CompositionEvent"in window,wo=null;Dr&&"documentMode"in document&&(wo=document.documentMode);var Ed=Dr&&"TextEvent"in window&&!wo,Eh=Dr&&(!El||wo&&8<wo&&11>=wo),mg=" ",Wu=!1;function Td(a,r){switch(a){case"keyup":return pg.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Th(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Tl=!1;function gg(a,r){switch(a){case"compositionend":return Th(r);case"keypress":return r.which!==32?null:(Wu=!0,mg);case"textInput":return a=r.data,a===mg&&Wu?null:a;default:return null}}function Rh(a,r){if(Tl)return a==="compositionend"||!El&&Td(a,r)?(a=Ku(),jl=vd=Rs=null,Tl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Eh&&r.locale!=="ko"?null:r.data;default:return null}}var Oh={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ah(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Oh[a.type]:r==="textarea"}function Rd(a,r,c,p){Cl?zi?zi.push(p):zi=[p]:Cl=p,r=S0(r,"onChange"),0<r.length&&(c=new Zu("onChange","change",null,c,p),a.push({event:c,listeners:r}))}var Li=null,Rl=null;function yg(a){Dv(a,0)}function Eo(a){var r=yr(a);if(Ha(r))return a}function Mh(a,r){if(a==="change")return r}var zr=!1;if(Dr){var $u;if(Dr){var Dh="oninput"in document;if(!Dh){var zh=document.createElement("div");zh.setAttribute("oninput","return;"),Dh=typeof zh.oninput=="function"}$u=Dh}else $u=!1;zr=$u&&(!document.documentMode||9<document.documentMode)}function Vs(){Li&&(Li.detachEvent("onpropertychange",ec),Rl=Li=null)}function ec(a){if(a.propertyName==="value"&&Eo(Rl)){var r=[];Rd(r,Rl,a,xd(a)),vh(yg,r)}}function xg(a,r,c){a==="focusin"?(Vs(),Li=r,Rl=c,Li.attachEvent("onpropertychange",ec)):a==="focusout"&&Vs()}function kh(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Eo(Rl)}function bg(a,r){if(a==="click")return Eo(r)}function vg(a,r){if(a==="input"||a==="change")return Eo(r)}function Lh(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Fa=typeof Object.is=="function"?Object.is:Lh;function To(a,r){if(Fa(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var c=Object.keys(a),p=Object.keys(r);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var S=c[p];if(!Ft.call(r,S)||!Fa(a[S],r[S]))return!1}return!0}function tc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ro(a,r){var c=tc(a);a=0;for(var p;c;){if(c.nodeType===3){if(p=a+c.textContent.length,a<=r&&p>=r)return{node:c,offset:r-a};a=p}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=tc(c)}}function ln(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?ln(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Sg(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=xn(a.document);r instanceof a.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)a=r.contentWindow;else break;r=xn(a.document)}return r}function Uh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var Ng=Dr&&"documentMode"in document&&11>=document.documentMode,kr=null,Lr=null,Oo=null,Od=!1;function Ao(a,r,c){var p=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Od||kr==null||kr!==xn(p)||(p=kr,"selectionStart"in p&&Uh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Oo&&To(Oo,p)||(Oo=p,p=S0(Lr,"onSelect"),0<p.length&&(r=new Zu("onSelect","select",null,r,c),a.push({event:r,listeners:p}),r.target=kr)))}function Ba(a,r){var c={};return c[a.toLowerCase()]=r.toLowerCase(),c["Webkit"+a]="webkit"+r,c["Moz"+a]="moz"+r,c}var Ol={animationend:Ba("Animation","AnimationEnd"),animationiteration:Ba("Animation","AnimationIteration"),animationstart:Ba("Animation","AnimationStart"),transitionrun:Ba("Transition","TransitionRun"),transitionstart:Ba("Transition","TransitionStart"),transitioncancel:Ba("Transition","TransitionCancel"),transitionend:Ba("Transition","TransitionEnd")},nc={},Hh={};Dr&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function di(a){if(nc[a])return nc[a];if(!Ol[a])return a;var r=Ol[a],c;for(c in r)if(r.hasOwnProperty(c)&&c in Hh)return nc[a]=r[c];return a}var Ad=di("animationend"),ac=di("animationiteration"),qh=di("animationstart"),_g=di("transitionrun"),oy=di("transitionstart"),Cg=di("transitioncancel"),Bh=di("transitionend"),Qs=new Map,sc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");sc.push("scrollEnd");function Xs(a,r){Qs.set(a,r),Di(r,[a])}var rc=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ks=[],fi=0,xa=0;function ic(){for(var a=fi,r=xa=fi=0;r<a;){var c=Ks[r];Ks[r++]=null;var p=Ks[r];Ks[r++]=null;var S=Ks[r];Ks[r++]=null;var N=Ks[r];if(Ks[r++]=null,p!==null&&S!==null){var M=p.pending;M===null?S.next=S:(S.next=M.next,M.next=S),p.pending=S}N!==0&&Ui(c,S,N)}}function ba(a,r,c,p){Ks[fi++]=a,Ks[fi++]=r,Ks[fi++]=c,Ks[fi++]=p,xa|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Md(a,r,c,p){return ba(a,r,c,p),Fs(a)}function Za(a,r){return ba(a,null,null,r),Fs(a)}function Ui(a,r,c){a.lanes|=c;var p=a.alternate;p!==null&&(p.lanes|=c);for(var S=!1,N=a.return;N!==null;)N.childLanes|=c,p=N.alternate,p!==null&&(p.childLanes|=c),N.tag===22&&(a=N.stateNode,a===null||a._visibility&1||(S=!0)),a=N,N=N.return;return a.tag===3?(N=a.stateNode,S&&r!==null&&(S=31-ya(c),a=N.hiddenUpdates,p=a[S],p===null?a[S]=[r]:p.push(r),r.lane=c|536870912),N):null}function Fs(a){if(50<nl)throw nl=0,Zl=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Hi={};function Gh(a,r,c,p){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(a,r,c,p){return new Gh(a,r,c,p)}function Dd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function cs(a,r){var c=a.alternate;return c===null?(c=Rn(a.tag,r,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=r,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,r=a.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function Mo(a,r){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,r=c.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function Ur(a,r,c,p,S,N){var M=0;if(p=a,typeof a=="function")Dd(a)&&(M=1);else if(typeof a=="string")M=C7(a,c,xe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=Rn(31,c,r,S),a.elementType=V,a.lanes=N,a;case O:return qi(c.children,S,N,r);case R:M=8,S|=24;break;case T:return a=Rn(12,c,r,S|2),a.elementType=T,a.lanes=N,a;case P:return a=Rn(13,c,r,S),a.elementType=P,a.lanes=N,a;case H:return a=Rn(19,c,r,S),a.elementType=H,a.lanes=N,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:M=10;break e;case A:M=9;break e;case k:M=11;break e;case B:M=14;break e;case L:M=16,p=null;break e}M=29,c=Error(s(130,a===null?"null":typeof a,"")),p=null}return r=Rn(M,c,r,S),r.elementType=a,r.type=p,r.lanes=N,r}function qi(a,r,c,p){return a=Rn(7,a,p,r),a.lanes=c,a}function zd(a,r,c){return a=Rn(6,a,null,r),a.lanes=c,a}function Do(a){var r=Rn(18,null,null,0);return r.stateNode=a,r}function kd(a,r,c){return r=Rn(4,a.children!==null?a.children:[],a.key,r),r.lanes=c,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var lc=new WeakMap;function Os(a,r){if(typeof a=="object"&&a!==null){var c=lc.get(a);return c!==void 0?c:(r={value:a,source:r,stack:fr(r)},lc.set(a,r),r)}return{value:a,source:r,stack:fr(r)}}var Bi=[],Gi=0,zo=null,ko=0,ds=[],bn=0,hi=null,On=1,br="";function Hr(a,r){Bi[Gi++]=ko,Bi[Gi++]=zo,zo=a,ko=r}function jg(a,r,c){ds[bn++]=On,ds[bn++]=br,ds[bn++]=hi,hi=a;var p=On;a=br;var S=32-ya(p)-1;p&=~(1<<S),c+=1;var N=32-ya(r)+S;if(30<N){var M=S-S%5;N=(p&(1<<M)-1).toString(32),p>>=M,S-=M,On=1<<32-ya(r)+S|c<<S|p,br=N+a}else On=1<<N|c<<S|p,br=a}function qr(a){a.return!==null&&(Hr(a,1),jg(a,1,0))}function Ld(a){for(;a===zo;)zo=Bi[--Gi],Bi[Gi]=null,ko=Bi[--Gi],Bi[Gi]=null;for(;a===hi;)hi=ds[--bn],ds[bn]=null,br=ds[--bn],ds[bn]=null,On=ds[--bn],ds[bn]=null}function Ud(a,r){ds[bn++]=On,ds[bn++]=br,ds[bn++]=hi,On=r.id,br=r.overflow,hi=a}var qn=null,on=null,jt=!1,pi=null,As=!1,Lo=Error(s(519));function Br(a){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gr(Os(r,a)),Lo}function wg(a){var r=a.stateNode,c=a.type,p=a.memoizedProps;switch(r[Fe]=a,r[ut]=p,c){case"dialog":Ot("cancel",r),Ot("close",r);break;case"iframe":case"object":case"embed":Ot("load",r);break;case"video":case"audio":for(c=0;c<lr.length;c++)Ot(lr[c],r);break;case"source":Ot("error",r);break;case"img":case"image":case"link":Ot("error",r),Ot("load",r);break;case"details":Ot("toggle",r);break;case"input":Ot("invalid",r),hd(r,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ot("invalid",r);break;case"textarea":Ot("invalid",r),md(r,p.value,p.defaultValue,p.children)}c=p.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||p.suppressHydrationWarning===!0||Uv(r.textContent,c)?(p.popover!=null&&(Ot("beforetoggle",r),Ot("toggle",r)),p.onScroll!=null&&Ot("scroll",r),p.onScrollEnd!=null&&Ot("scrollend",r),p.onClick!=null&&(r.onclick=ci),r=!0):r=!1,r||Br(a,!0)}function Eg(a){for(qn=a.return;qn;)switch(qn.tag){case 5:case 31:case 13:As=!1;return;case 27:case 3:As=!0;return;default:qn=qn.return}}function Uo(a){if(a!==qn)return!1;if(!jt)return Eg(a),jt=!0,!1;var r=a.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||Cy(a.type,a.memoizedProps)),c=!c),c&&on&&Br(a),Eg(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Xv(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Xv(a)}else r===27?(r=on,au(a.type)?(a=Ry,Ry=null,on=a):on=r):on=qn?ti(a.stateNode.nextSibling):null;return!0}function Pi(){on=qn=null,jt=!1}function Hd(){var a=pi;return a!==null&&(Gn===null?Gn=a:Gn.push.apply(Gn,a),pi=null),a}function Gr(a){pi===null?pi=[a]:pi.push(a)}var Ho=G(null),Yi=null,Pr=null;function mi(a,r,c){he(Ho,r._currentValue),r._currentValue=c}function Yr(a){a._currentValue=Ho.current,W(Ho)}function qd(a,r,c){for(;a!==null;){var p=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,p!==null&&(p.childLanes|=r)):p!==null&&(p.childLanes&r)!==r&&(p.childLanes|=r),a===c)break;a=a.return}}function Bd(a,r,c,p){var S=a.child;for(S!==null&&(S.return=a);S!==null;){var N=S.dependencies;if(N!==null){var M=S.child;N=N.firstContext;e:for(;N!==null;){var q=N;N=S;for(var K=0;K<r.length;K++)if(q.context===r[K]){N.lanes|=c,q=N.alternate,q!==null&&(q.lanes|=c),qd(N.return,c,a),p||(M=null);break e}N=q.next}}else if(S.tag===18){if(M=S.return,M===null)throw Error(s(341));M.lanes|=c,N=M.alternate,N!==null&&(N.lanes|=c),qd(M,c,a),M=null}else M=S.child;if(M!==null)M.return=S;else for(M=S;M!==null;){if(M===a){M=null;break}if(S=M.sibling,S!==null){S.return=M.return,M=S;break}M=M.return}S=M}}function Vr(a,r,c,p){a=null;for(var S=r,N=!1;S!==null;){if(!N){if((S.flags&524288)!==0)N=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var M=S.alternate;if(M===null)throw Error(s(387));if(M=M.memoizedProps,M!==null){var q=S.type;Fa(S.pendingProps.value,M.value)||(a!==null?a.push(q):a=[q])}}else if(S===De.current){if(M=S.alternate,M===null)throw Error(s(387));M.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(a!==null?a.push(Hp):a=[Hp])}S=S.return}a!==null&&Bd(r,a,c,p),r.flags|=262144}function oc(a){for(a=a.firstContext;a!==null;){if(!Fa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Vi(a){Yi=a,Pr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function We(a){return Tg(Yi,a)}function qo(a,r){return Yi===null&&Vi(a),Tg(a,r)}function Tg(a,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Pr===null){if(a===null)throw Error(s(308));Pr=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Pr=Pr.next=r;return c}var Rg=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(c,p){a.push(p)}};this.abort=function(){r.aborted=!0,a.forEach(function(c){return c()})}},uy=t.unstable_scheduleCallback,cy=t.unstable_NormalPriority,ea={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ph(){return{controller:new Rg,data:new Map,refCount:0}}function Al(a){a.refCount--,a.refCount===0&&uy(cy,function(){a.controller.abort()})}var Ms=null,Gd=0,gi=0,Zs=null;function Yh(a,r){if(Ms===null){var c=Ms=[];Gd=0,gi=pe(),Zs={status:"pending",value:void 0,then:function(p){c.push(p)}}}return Gd++,r.then(Vh,Vh),r}function Vh(){if(--Gd===0&&Ms!==null){Zs!==null&&(Zs.status="fulfilled");var a=Ms;Ms=null,gi=0,Zs=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Qh(a,r){var c=[],p={status:"pending",value:null,reason:null,then:function(S){c.push(S)}};return a.then(function(){p.status="fulfilled",p.value=r;for(var S=0;S<c.length;S++)(0,c[S])(r)},function(S){for(p.status="rejected",p.reason=S,S=0;S<c.length;S++)(0,c[S])(void 0)}),p}var Og=Y.S;Y.S=function(a,r){Mp=Qn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Yh(a,r),Og!==null&&Og(a,r)};var Qi=G(null);function Pd(){var a=Qi.current;return a!==null?a:tt.pooledCache}function uc(a,r){r===null?he(Qi,Qi.current):he(Qi,r.pool)}function Xh(){var a=Pd();return a===null?null:{parent:ea._currentValue,pool:a}}var Ml=Error(s(460)),cc=Error(s(474)),dt=Error(s(542)),Yd={then:function(){}};function fs(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Vd(a,r,c){switch(c=a[c],c===void 0?a.push(r):c!==r&&(r.then(ci,ci),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a;default:if(typeof r.status=="string")r.then(ci,ci);else{if(a=tt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(p){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=p}},function(p){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=p}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a}throw Qr=r,Ml}}function Dl(a){try{var r=a._init;return r(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Qr=c,Ml):c}}var Qr=null;function zl(){if(Qr===null)throw Error(s(459));var a=Qr;return Qr=null,a}function kl(a){if(a===Ml||a===dt)throw Error(s(483))}var Ll=null,Ul=0;function dc(a){var r=Ul;return Ul+=1,Ll===null&&(Ll=[]),Vd(Ll,a,r)}function Is(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Bo(a,r){throw r.$$typeof===_?Error(s(525)):(a=Object.prototype.toString.call(r),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Qd(a){function r(te,I){if(a){var le=te.deletions;le===null?(te.deletions=[I],te.flags|=16):le.push(I)}}function c(te,I){if(!a)return null;for(;I!==null;)r(te,I),I=I.sibling;return null}function p(te){for(var I=new Map;te!==null;)te.key!==null?I.set(te.key,te):I.set(te.index,te),te=te.sibling;return I}function S(te,I){return te=cs(te,I),te.index=0,te.sibling=null,te}function N(te,I,le){return te.index=le,a?(le=te.alternate,le!==null?(le=le.index,le<I?(te.flags|=67108866,I):le):(te.flags|=67108866,I)):(te.flags|=1048576,I)}function M(te){return a&&te.alternate===null&&(te.flags|=67108866),te}function q(te,I,le,be){return I===null||I.tag!==6?(I=zd(le,te.mode,be),I.return=te,I):(I=S(I,le),I.return=te,I)}function K(te,I,le,be){var Xe=le.type;return Xe===O?ye(te,I,le.props.children,be,le.key):I!==null&&(I.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===L&&Dl(Xe)===I.type)?(I=S(I,le.props),Is(I,le),I.return=te,I):(I=Ur(le.type,le.key,le.props,null,te.mode,be),Is(I,le),I.return=te,I)}function ue(te,I,le,be){return I===null||I.tag!==4||I.stateNode.containerInfo!==le.containerInfo||I.stateNode.implementation!==le.implementation?(I=kd(le,te.mode,be),I.return=te,I):(I=S(I,le.children||[]),I.return=te,I)}function ye(te,I,le,be,Xe){return I===null||I.tag!==7?(I=qi(le,te.mode,be,Xe),I.return=te,I):(I=S(I,le),I.return=te,I)}function ve(te,I,le){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=zd(""+I,te.mode,le),I.return=te,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case j:return le=Ur(I.type,I.key,I.props,null,te.mode,le),Is(le,I),le.return=te,le;case w:return I=kd(I,te.mode,le),I.return=te,I;case L:return I=Dl(I),ve(te,I,le)}if(ce(I)||ne(I))return I=qi(I,te.mode,le,null),I.return=te,I;if(typeof I.then=="function")return ve(te,dc(I),le);if(I.$$typeof===z)return ve(te,qo(te,I),le);Bo(te,I)}return null}function fe(te,I,le,be){var Xe=I!==null?I.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Xe!==null?null:q(te,I,""+le,be);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case j:return le.key===Xe?K(te,I,le,be):null;case w:return le.key===Xe?ue(te,I,le,be):null;case L:return le=Dl(le),fe(te,I,le,be)}if(ce(le)||ne(le))return Xe!==null?null:ye(te,I,le,be,null);if(typeof le.then=="function")return fe(te,I,dc(le),be);if(le.$$typeof===z)return fe(te,I,qo(te,le),be);Bo(te,le)}return null}function ge(te,I,le,be,Xe){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return te=te.get(le)||null,q(I,te,""+be,Xe);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case j:return te=te.get(be.key===null?le:be.key)||null,K(I,te,be,Xe);case w:return te=te.get(be.key===null?le:be.key)||null,ue(I,te,be,Xe);case L:return be=Dl(be),ge(te,I,le,be,Xe)}if(ce(be)||ne(be))return te=te.get(le)||null,ye(I,te,be,Xe,null);if(typeof be.then=="function")return ge(te,I,le,dc(be),Xe);if(be.$$typeof===z)return ge(te,I,le,qo(I,be),Xe);Bo(I,be)}return null}function qe(te,I,le,be){for(var Xe=null,Xt=null,Pe=I,mt=I=0,zt=null;Pe!==null&&mt<le.length;mt++){Pe.index>mt?(zt=Pe,Pe=null):zt=Pe.sibling;var Kt=fe(te,Pe,le[mt],be);if(Kt===null){Pe===null&&(Pe=zt);break}a&&Pe&&Kt.alternate===null&&r(te,Pe),I=N(Kt,I,mt),Xt===null?Xe=Kt:Xt.sibling=Kt,Xt=Kt,Pe=zt}if(mt===le.length)return c(te,Pe),jt&&Hr(te,mt),Xe;if(Pe===null){for(;mt<le.length;mt++)Pe=ve(te,le[mt],be),Pe!==null&&(I=N(Pe,I,mt),Xt===null?Xe=Pe:Xt.sibling=Pe,Xt=Pe);return jt&&Hr(te,mt),Xe}for(Pe=p(Pe);mt<le.length;mt++)zt=ge(Pe,te,mt,le[mt],be),zt!==null&&(a&&zt.alternate!==null&&Pe.delete(zt.key===null?mt:zt.key),I=N(zt,I,mt),Xt===null?Xe=zt:Xt.sibling=zt,Xt=zt);return a&&Pe.forEach(function(ou){return r(te,ou)}),jt&&Hr(te,mt),Xe}function Ie(te,I,le,be){if(le==null)throw Error(s(151));for(var Xe=null,Xt=null,Pe=I,mt=I=0,zt=null,Kt=le.next();Pe!==null&&!Kt.done;mt++,Kt=le.next()){Pe.index>mt?(zt=Pe,Pe=null):zt=Pe.sibling;var ou=fe(te,Pe,Kt.value,be);if(ou===null){Pe===null&&(Pe=zt);break}a&&Pe&&ou.alternate===null&&r(te,Pe),I=N(ou,I,mt),Xt===null?Xe=ou:Xt.sibling=ou,Xt=ou,Pe=zt}if(Kt.done)return c(te,Pe),jt&&Hr(te,mt),Xe;if(Pe===null){for(;!Kt.done;mt++,Kt=le.next())Kt=ve(te,Kt.value,be),Kt!==null&&(I=N(Kt,I,mt),Xt===null?Xe=Kt:Xt.sibling=Kt,Xt=Kt);return jt&&Hr(te,mt),Xe}for(Pe=p(Pe);!Kt.done;mt++,Kt=le.next())Kt=ge(Pe,te,mt,Kt.value,be),Kt!==null&&(a&&Kt.alternate!==null&&Pe.delete(Kt.key===null?mt:Kt.key),I=N(Kt,I,mt),Xt===null?Xe=Kt:Xt.sibling=Kt,Xt=Kt);return a&&Pe.forEach(function(k7){return r(te,k7)}),jt&&Hr(te,mt),Xe}function dn(te,I,le,be){if(typeof le=="object"&&le!==null&&le.type===O&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case j:e:{for(var Xe=le.key;I!==null;){if(I.key===Xe){if(Xe=le.type,Xe===O){if(I.tag===7){c(te,I.sibling),be=S(I,le.props.children),be.return=te,te=be;break e}}else if(I.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===L&&Dl(Xe)===I.type){c(te,I.sibling),be=S(I,le.props),Is(be,le),be.return=te,te=be;break e}c(te,I);break}else r(te,I);I=I.sibling}le.type===O?(be=qi(le.props.children,te.mode,be,le.key),be.return=te,te=be):(be=Ur(le.type,le.key,le.props,null,te.mode,be),Is(be,le),be.return=te,te=be)}return M(te);case w:e:{for(Xe=le.key;I!==null;){if(I.key===Xe)if(I.tag===4&&I.stateNode.containerInfo===le.containerInfo&&I.stateNode.implementation===le.implementation){c(te,I.sibling),be=S(I,le.children||[]),be.return=te,te=be;break e}else{c(te,I);break}else r(te,I);I=I.sibling}be=kd(le,te.mode,be),be.return=te,te=be}return M(te);case L:return le=Dl(le),dn(te,I,le,be)}if(ce(le))return qe(te,I,le,be);if(ne(le)){if(Xe=ne(le),typeof Xe!="function")throw Error(s(150));return le=Xe.call(le),Ie(te,I,le,be)}if(typeof le.then=="function")return dn(te,I,dc(le),be);if(le.$$typeof===z)return dn(te,I,qo(te,le),be);Bo(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,I!==null&&I.tag===6?(c(te,I.sibling),be=S(I,le),be.return=te,te=be):(c(te,I),be=zd(le,te.mode,be),be.return=te,te=be),M(te)):c(te,I)}return function(te,I,le,be){try{Ul=0;var Xe=dn(te,I,le,be);return Ll=null,Xe}catch(Pe){if(Pe===Ml||Pe===dt)throw Pe;var Xt=Rn(29,Pe,null,te.mode);return Xt.lanes=be,Xt.return=te,Xt}finally{}}}var yi=Qd(!0),Xd=Qd(!1),Ia=!1;function fc(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kh(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function xi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Xi(a,r,c){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Ye&2)!==0){var S=p.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),p.pending=r,r=Fs(a),Ui(a,null,c),r}return ba(a,p,r,c),Fs(a)}function Ki(a,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var p=r.lanes;p&=a.pendingLanes,c|=p,r.lanes=c,os(a,c)}}function Qe(a,r){var c=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var S=null,N=null;if(c=c.firstBaseUpdate,c!==null){do{var M={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};N===null?S=N=M:N=N.next=M,c=c.next}while(c!==null);N===null?S=N=r:N=N.next=r}else S=N=r;c={baseState:p.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:p.shared,callbacks:p.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=r:a.next=r,c.lastBaseUpdate=r}var Fh=!1;function hc(){if(Fh){var a=Zs;if(a!==null)throw a}}function Go(a,r,c,p){Fh=!1;var S=a.updateQueue;Ia=!1;var N=S.firstBaseUpdate,M=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var K=q,ue=K.next;K.next=null,M===null?N=ue:M.next=ue,M=K;var ye=a.alternate;ye!==null&&(ye=ye.updateQueue,q=ye.lastBaseUpdate,q!==M&&(q===null?ye.firstBaseUpdate=ue:q.next=ue,ye.lastBaseUpdate=K))}if(N!==null){var ve=S.baseState;M=0,ye=ue=K=null,q=N;do{var fe=q.lane&-536870913,ge=fe!==q.lane;if(ge?(ct&fe)===fe:(p&fe)===fe){fe!==0&&fe===gi&&(Fh=!0),ye!==null&&(ye=ye.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var qe=a,Ie=q;fe=r;var dn=c;switch(Ie.tag){case 1:if(qe=Ie.payload,typeof qe=="function"){ve=qe.call(dn,ve,fe);break e}ve=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ie.payload,fe=typeof qe=="function"?qe.call(dn,ve,fe):qe,fe==null)break e;ve=b({},ve,fe);break e;case 2:Ia=!0}}fe=q.callback,fe!==null&&(a.flags|=64,ge&&(a.flags|=8192),ge=S.callbacks,ge===null?S.callbacks=[fe]:ge.push(fe))}else ge={lane:fe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ye===null?(ue=ye=ge,K=ve):ye=ye.next=ge,M|=fe;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;ge=q,q=ge.next,ge.next=null,S.lastBaseUpdate=ge,S.shared.pending=null}}while(!0);ye===null&&(K=ve),S.baseState=K,S.firstBaseUpdate=ue,S.lastBaseUpdate=ye,N===null&&(S.shared.lanes=0),Wr|=M,a.lanes=M,a.memoizedState=ve}}function Po(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Ag(a,r){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)Po(c[a],r)}var Yo=G(null),Kd=G(0);function Mg(a,r){a=Ls,he(Kd,a),he(Yo,r),Ls=a|r.baseLanes}function Zh(){he(Kd,Ls),he(Yo,Yo.current)}function pc(){Ls=Kd.current,W(Yo),W(Kd)}var hs=G(null),Ja=null;function bi(a){var r=a.alternate;he(wt,wt.current&1),he(hs,a),Ja===null&&(r===null||Yo.current!==null||r.memoizedState!==null)&&(Ja=a)}function Ih(a){he(wt,wt.current),he(hs,a),Ja===null&&(Ja=a)}function Dg(a){a.tag===22?(he(wt,wt.current),he(hs,a),Ja===null&&(Ja=a)):ps()}function ps(){he(wt,wt.current),he(hs,hs.current)}function Kn(a){W(hs),Ja===a&&(Ja=null),W(wt)}var wt=G(0);function Ds(a){for(var r=a;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ey(c)||Ty(c)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var vn=0,rt=null,en=null,vt=null,Js=!1,Vo=!1,Hl=!1,Fd=0,mc=0,Qo=null,Jh=0;function An(){throw Error(s(321))}function Wh(a,r){if(r===null)return!1;for(var c=0;c<r.length&&c<a.length;c++)if(!Fa(a[c],r[c]))return!1;return!0}function Zd(a,r,c,p,S,N){return vn=N,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Y.H=a===null||a.memoizedState===null?d0:xp,Hl=!1,N=c(p,S),Hl=!1,Vo&&(N=ql(r,c,p,S)),zg(a),N}function zg(a){Y.H=Xo;var r=en!==null&&en.next!==null;if(vn=0,vt=en=rt=null,Js=!1,mc=0,Qo=null,r)throw Error(s(300));a===null||ta||(a=a.dependencies,a!==null&&oc(a)&&(ta=!0))}function ql(a,r,c,p){rt=a;var S=0;do{if(Vo&&(Qo=null),mc=0,Vo=!1,25<=S)throw Error(s(301));if(S+=1,vt=en=null,a.updateQueue!=null){var N=a.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}Y.H=Ws,N=r(c,p)}while(Vo);return N}function Bl(){var a=Y.H,r=a.useState()[0];return r=typeof r.then=="function"?gc(r):r,a=a.useState()[0],(en!==null?en.memoizedState:null)!==a&&(rt.flags|=1024),r}function $h(){var a=Fd!==0;return Fd=0,a}function ep(a,r,c){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~c}function tp(a){if(Js){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Js=!1}vn=0,vt=en=rt=null,Vo=!1,mc=Fd=0,Qo=null}function oa(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?rt.memoizedState=vt=a:vt=vt.next=a,vt}function Fn(){if(en===null){var a=rt.alternate;a=a!==null?a.memoizedState:null}else a=en.next;var r=vt===null?rt.memoizedState:vt.next;if(r!==null)vt=r,en=a;else{if(a===null)throw rt.alternate===null?Error(s(467)):Error(s(310));en=a,a={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},vt===null?rt.memoizedState=vt=a:vt=vt.next=a}return vt}function Id(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gc(a){var r=mc;return mc+=1,Qo===null&&(Qo=[]),a=Vd(Qo,a,r),r=rt,(vt===null?r.memoizedState:vt.next)===null&&(r=r.alternate,Y.H=r===null||r.memoizedState===null?d0:xp),a}function Fi(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gc(a);if(a.$$typeof===z)return We(a)}throw Error(s(438,String(a)))}function np(a){var r=null,c=rt.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var p=rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(r={data:p.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Id(),rt.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(a),p=0;p<a;p++)c[p]=Z;return r.index++,c}function vi(a,r){return typeof r=="function"?r(a):r}function Jd(a){var r=Fn();return ap(r,en,a)}function ap(a,r,c){var p=a.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=c;var S=a.baseQueue,N=p.pending;if(N!==null){if(S!==null){var M=S.next;S.next=N.next,N.next=M}r.baseQueue=S=N,p.pending=null}if(N=a.baseState,S===null)a.memoizedState=N;else{r=S.next;var q=M=null,K=null,ue=r,ye=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(ct&ve)===ve:(vn&ve)===ve){var fe=ue.revertLane;if(fe===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===gi&&(ye=!0);else if((vn&fe)===fe){ue=ue.next,fe===gi&&(ye=!0);continue}else ve={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},K===null?(q=K=ve,M=N):K=K.next=ve,rt.lanes|=fe,Wr|=fe;ve=ue.action,Hl&&c(N,ve),N=ue.hasEagerState?ue.eagerState:c(N,ve)}else fe={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},K===null?(q=K=fe,M=N):K=K.next=fe,rt.lanes|=ve,Wr|=ve;ue=ue.next}while(ue!==null&&ue!==r);if(K===null?M=N:K.next=q,!Fa(N,a.memoizedState)&&(ta=!0,ye&&(c=Zs,c!==null)))throw c;a.memoizedState=N,a.baseState=M,a.baseQueue=K,p.lastRenderedState=N}return S===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function sp(a){var r=Fn(),c=r.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=a;var p=c.dispatch,S=c.pending,N=r.memoizedState;if(S!==null){c.pending=null;var M=S=S.next;do N=a(N,M.action),M=M.next;while(M!==S);Fa(N,r.memoizedState)||(ta=!0),r.memoizedState=N,r.baseQueue===null&&(r.baseState=N),c.lastRenderedState=N}return[N,p]}function kg(a,r,c){var p=rt,S=Fn(),N=jt;if(N){if(c===void 0)throw Error(s(407));c=c()}else c=r();var M=!Fa((en||S).memoizedState,c);if(M&&(S.memoizedState=c,ta=!0),S=S.queue,fp(Hg.bind(null,p,S,a),[a]),S.getSnapshot!==r||M||vt!==null&&vt.memoizedState.tag&1){if(p.flags|=2048,Zi(9,{destroy:void 0},Ug.bind(null,p,S,c,r),null),tt===null)throw Error(s(349));N||(vn&127)!==0||Lg(p,r,c)}return c}function Lg(a,r,c){a.flags|=16384,a={getSnapshot:r,value:c},r=rt.updateQueue,r===null?(r=Id(),rt.updateQueue=r,r.stores=[a]):(c=r.stores,c===null?r.stores=[a]:c.push(a))}function Ug(a,r,c,p){r.value=c,r.getSnapshot=p,qg(r)&&Bg(a)}function Hg(a,r,c){return c(function(){qg(r)&&Bg(a)})}function qg(a){var r=a.getSnapshot;a=a.value;try{var c=r();return!Fa(a,c)}catch{return!0}}function Bg(a){var r=Za(a,2);r!==null&&ht(r,a,2)}function rp(a){var r=oa();if(typeof a=="function"){var c=a;if(a=c(),Hl){ls(!0);try{c()}finally{ls(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:a},r}function ip(a,r,c,p){return a.baseState=c,ap(a,en,typeof p=="function"?p:vi)}function dy(a,r,c,p,S){if(tf(a))throw Error(s(485));if(a=r.action,a!==null){var N={payload:S,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){N.listeners.push(M)}};Y.T!==null?c(!0):N.isTransition=!1,p(N),c=r.pending,c===null?(N.next=r.pending=N,Gg(r,N)):(N.next=c.next,r.pending=c.next=N)}}function Gg(a,r){var c=r.action,p=r.payload,S=a.state;if(r.isTransition){var N=Y.T,M={};Y.T=M;try{var q=c(S,p),K=Y.S;K!==null&&K(M,q),Pg(a,r,q)}catch(ue){lp(a,r,ue)}finally{N!==null&&M.types!==null&&(N.types=M.types),Y.T=N}}else try{N=c(S,p),Pg(a,r,N)}catch(ue){lp(a,r,ue)}}function Pg(a,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(p){Yg(a,r,p)},function(p){return lp(a,r,p)}):Yg(a,r,c)}function Yg(a,r,c){r.status="fulfilled",r.value=c,Vg(r),a.state=c,r=a.pending,r!==null&&(c=r.next,c===r?a.pending=null:(c=c.next,r.next=c,Gg(a,c)))}function lp(a,r,c){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=c,Vg(r),r=r.next;while(r!==p)}a.action=null}function Vg(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function op(a,r){return r}function up(a,r){if(jt){var c=tt.formState;if(c!==null){e:{var p=rt;if(jt){if(on){t:{for(var S=on,N=As;S.nodeType!==8;){if(!N){S=null;break t}if(S=ti(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){on=ti(S.nextSibling),p=S.data==="F!";break e}}Br(p)}p=!1}p&&(r=c[0])}}return c=oa(),c.memoizedState=c.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:op,lastRenderedState:r},c.queue=p,c=o0.bind(null,rt,p),p.dispatch=c,p=rp(!1),N=yp.bind(null,rt,!1,p.queue),p=oa(),S={state:r,dispatch:null,action:a,pending:null},p.queue=S,c=dy.bind(null,rt,S,N,c),S.dispatch=c,p.memoizedState=a,[r,c,!1]}function Qg(a){var r=Fn();return cp(r,en,a)}function cp(a,r,c){if(r=ap(a,r,op)[0],a=Jd(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=gc(r)}catch(M){throw M===Ml?dt:M}else p=r;r=Fn();var S=r.queue,N=S.dispatch;return c!==r.memoizedState&&(rt.flags|=2048,Zi(9,{destroy:void 0},Xg.bind(null,S,c),null)),[p,N,a]}function Xg(a,r){a.action=r}function dp(a){var r=Fn(),c=en;if(c!==null)return cp(r,c,a);Fn(),r=r.memoizedState,c=Fn();var p=c.queue.dispatch;return c.memoizedState=a,[r,p,!1]}function Zi(a,r,c,p){return a={tag:a,create:c,deps:p,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Id(),rt.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=a.next=a:(p=c.next,c.next=a,a.next=p,r.lastEffect=a),a}function Wd(){return Fn().memoizedState}function $d(a,r,c,p){var S=oa();rt.flags|=a,S.memoizedState=Zi(1|r,{destroy:void 0},c,p===void 0?null:p)}function ef(a,r,c,p){var S=Fn();p=p===void 0?null:p;var N=S.memoizedState.inst;en!==null&&p!==null&&Wh(p,en.memoizedState.deps)?S.memoizedState=Zi(r,N,c,p):(rt.flags|=a,S.memoizedState=Zi(1|r,N,c,p))}function Kg(a,r){$d(8390656,8,a,r)}function fp(a,r){ef(2048,8,a,r)}function Fg(a){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Id(),rt.updateQueue=r,r.events=[a];else{var c=r.events;c===null?r.events=[a]:c.push(a)}}function Zg(a){var r=Fn().memoizedState;return Fg({ref:r,nextImpl:a}),function(){if((Ye&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Ig(a,r){return ef(4,2,a,r)}function Jg(a,r){return ef(4,4,a,r)}function Wg(a,r){if(typeof r=="function"){a=a();var c=r(a);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function $g(a,r,c){c=c!=null?c.concat([a]):null,ef(4,4,Wg.bind(null,r,a),c)}function hp(){}function e0(a,r){var c=Fn();r=r===void 0?null:r;var p=c.memoizedState;return r!==null&&Wh(r,p[1])?p[0]:(c.memoizedState=[a,r],a)}function t0(a,r){var c=Fn();r=r===void 0?null:r;var p=c.memoizedState;if(r!==null&&Wh(r,p[1]))return p[0];if(p=a(),Hl){ls(!0);try{a()}finally{ls(!1)}}return c.memoizedState=[p,r],p}function pp(a,r,c){return c===void 0||(vn&1073741824)!==0&&(ct&261930)===0?a.memoizedState=r:(a.memoizedState=c,a=xt(),rt.lanes|=a,Wr|=a,c)}function n0(a,r,c,p){return Fa(c,r)?c:Yo.current!==null?(a=pp(a,c,p),Fa(a,r)||(ta=!0),a):(vn&42)===0||(vn&1073741824)!==0&&(ct&261930)===0?(ta=!0,a.memoizedState=c):(a=xt(),rt.lanes|=a,Wr|=a,r)}function a0(a,r,c,p,S){var N=$.p;$.p=N!==0&&8>N?N:8;var M=Y.T,q={};Y.T=q,yp(a,!1,r,c);try{var K=S(),ue=Y.S;if(ue!==null&&ue(q,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ye=Qh(K,p);yc(a,r,ye,Hs(a))}else yc(a,r,p,Hs(a))}catch(ve){yc(a,r,{then:function(){},status:"rejected",reason:ve},Hs())}finally{$.p=N,M!==null&&q.types!==null&&(M.types=q.types),Y.T=M}}function fy(){}function mp(a,r,c,p){if(a.tag!==5)throw Error(s(476));var S=s0(a).queue;a0(a,S,r,ae,c===null?fy:function(){return r0(a),c(p)})}function s0(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:ae},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:c},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function r0(a){var r=s0(a);r.next===null&&(r=a.alternate.memoizedState),yc(a,r.next.queue,{},Hs())}function gp(){return We(Hp)}function i0(){return Fn().memoizedState}function l0(){return Fn().memoizedState}function hy(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var c=Hs();a=xi(c);var p=Xi(r,a,c);p!==null&&(ht(p,r,c),Ki(p,r,c)),r={cache:Ph()},a.payload=r;return}r=r.return}}function py(a,r,c){var p=Hs();c={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},tf(a)?u0(r,c):(c=Md(a,r,c,p),c!==null&&(ht(c,a,p),c0(c,r,p)))}function o0(a,r,c){var p=Hs();yc(a,r,c,p)}function yc(a,r,c,p){var S={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(tf(a))u0(r,S);else{var N=a.alternate;if(a.lanes===0&&(N===null||N.lanes===0)&&(N=r.lastRenderedReducer,N!==null))try{var M=r.lastRenderedState,q=N(M,c);if(S.hasEagerState=!0,S.eagerState=q,Fa(q,M))return ba(a,r,S,0),tt===null&&ic(),!1}catch{}finally{}if(c=Md(a,r,S,p),c!==null)return ht(c,a,p),c0(c,r,p),!0}return!1}function yp(a,r,c,p){if(p={lane:2,revertLane:pe(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},tf(a)){if(r)throw Error(s(479))}else r=Md(a,c,p,2),r!==null&&ht(r,a,2)}function tf(a){var r=a.alternate;return a===rt||r!==null&&r===rt}function u0(a,r){Vo=Js=!0;var c=a.pending;c===null?r.next=r:(r.next=c.next,c.next=r),a.pending=r}function c0(a,r,c){if((c&4194048)!==0){var p=r.lanes;p&=a.pendingLanes,c|=p,r.lanes=c,os(a,c)}}var Xo={readContext:We,use:Fi,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};Xo.useEffectEvent=An;var d0={readContext:We,use:Fi,useCallback:function(a,r){return oa().memoizedState=[a,r===void 0?null:r],a},useContext:We,useEffect:Kg,useImperativeHandle:function(a,r,c){c=c!=null?c.concat([a]):null,$d(4194308,4,Wg.bind(null,r,a),c)},useLayoutEffect:function(a,r){return $d(4194308,4,a,r)},useInsertionEffect:function(a,r){$d(4,2,a,r)},useMemo:function(a,r){var c=oa();r=r===void 0?null:r;var p=a();if(Hl){ls(!0);try{a()}finally{ls(!1)}}return c.memoizedState=[p,r],p},useReducer:function(a,r,c){var p=oa();if(c!==void 0){var S=c(r);if(Hl){ls(!0);try{c(r)}finally{ls(!1)}}}else S=r;return p.memoizedState=p.baseState=S,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:S},p.queue=a,a=a.dispatch=py.bind(null,rt,a),[p.memoizedState,a]},useRef:function(a){var r=oa();return a={current:a},r.memoizedState=a},useState:function(a){a=rp(a);var r=a.queue,c=o0.bind(null,rt,r);return r.dispatch=c,[a.memoizedState,c]},useDebugValue:hp,useDeferredValue:function(a,r){var c=oa();return pp(c,a,r)},useTransition:function(){var a=rp(!1);return a=a0.bind(null,rt,a.queue,!0,!1),oa().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,c){var p=rt,S=oa();if(jt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=r(),tt===null)throw Error(s(349));(ct&127)!==0||Lg(p,r,c)}S.memoizedState=c;var N={value:c,getSnapshot:r};return S.queue=N,Kg(Hg.bind(null,p,N,a),[a]),p.flags|=2048,Zi(9,{destroy:void 0},Ug.bind(null,p,N,c,r),null),c},useId:function(){var a=oa(),r=tt.identifierPrefix;if(jt){var c=br,p=On;c=(p&~(1<<32-ya(p)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Fd++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=Jh++,r="_"+r+"r_"+c.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:gp,useFormState:up,useActionState:up,useOptimistic:function(a){var r=oa();r.memoizedState=r.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=yp.bind(null,rt,!0,c),c.dispatch=r,[a,r]},useMemoCache:np,useCacheRefresh:function(){return oa().memoizedState=hy.bind(null,rt)},useEffectEvent:function(a){var r=oa(),c={impl:a};return r.memoizedState=c,function(){if((Ye&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},xp={readContext:We,use:Fi,useCallback:e0,useContext:We,useEffect:fp,useImperativeHandle:$g,useInsertionEffect:Ig,useLayoutEffect:Jg,useMemo:t0,useReducer:Jd,useRef:Wd,useState:function(){return Jd(vi)},useDebugValue:hp,useDeferredValue:function(a,r){var c=Fn();return n0(c,en.memoizedState,a,r)},useTransition:function(){var a=Jd(vi)[0],r=Fn().memoizedState;return[typeof a=="boolean"?a:gc(a),r]},useSyncExternalStore:kg,useId:i0,useHostTransitionStatus:gp,useFormState:Qg,useActionState:Qg,useOptimistic:function(a,r){var c=Fn();return ip(c,en,a,r)},useMemoCache:np,useCacheRefresh:l0};xp.useEffectEvent=Zg;var Ws={readContext:We,use:Fi,useCallback:e0,useContext:We,useEffect:fp,useImperativeHandle:$g,useInsertionEffect:Ig,useLayoutEffect:Jg,useMemo:t0,useReducer:sp,useRef:Wd,useState:function(){return sp(vi)},useDebugValue:hp,useDeferredValue:function(a,r){var c=Fn();return en===null?pp(c,a,r):n0(c,en.memoizedState,a,r)},useTransition:function(){var a=sp(vi)[0],r=Fn().memoizedState;return[typeof a=="boolean"?a:gc(a),r]},useSyncExternalStore:kg,useId:i0,useHostTransitionStatus:gp,useFormState:dp,useActionState:dp,useOptimistic:function(a,r){var c=Fn();return en!==null?ip(c,en,a,r):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:np,useCacheRefresh:l0};Ws.useEffectEvent=Zg;function nf(a,r,c,p){r=a.memoizedState,c=c(p,r),c=c==null?r:b({},r,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var xc={enqueueSetState:function(a,r,c){a=a._reactInternals;var p=Hs(),S=xi(p);S.payload=r,c!=null&&(S.callback=c),r=Xi(a,S,p),r!==null&&(ht(r,a,p),Ki(r,a,p))},enqueueReplaceState:function(a,r,c){a=a._reactInternals;var p=Hs(),S=xi(p);S.tag=1,S.payload=r,c!=null&&(S.callback=c),r=Xi(a,S,p),r!==null&&(ht(r,a,p),Ki(r,a,p))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var c=Hs(),p=xi(c);p.tag=2,r!=null&&(p.callback=r),r=Xi(a,p,c),r!==null&&(ht(r,a,c),Ki(r,a,c))}};function bp(a,r,c,p,S,N,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,N,M):r.prototype&&r.prototype.isPureReactComponent?!To(c,p)||!To(S,N):!0}function vp(a,r,c,p){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,p),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,p),r.state!==a&&xc.enqueueReplaceState(r,r.state,null)}function Ii(a,r){var c=r;if("ref"in r){c={};for(var p in r)p!=="ref"&&(c[p]=r[p])}if(a=a.defaultProps){c===r&&(c=b({},c));for(var S in a)c[S]===void 0&&(c[S]=a[S])}return c}function f0(a){rc(a)}function Sp(a){console.error(a)}function Np(a){rc(a)}function af(a,r){try{var c=a.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function h0(a,r,c){try{var p=a.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function _p(a,r,c){return c=xi(c),c.tag=3,c.payload={element:null},c.callback=function(){af(a,r)},c}function Cp(a){return a=xi(a),a.tag=3,a}function p0(a,r,c,p){var S=c.type.getDerivedStateFromError;if(typeof S=="function"){var N=p.value;a.payload=function(){return S(N)},a.callback=function(){h0(r,c,p)}}var M=c.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(a.callback=function(){h0(r,c,p),typeof S!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var q=p.stack;this.componentDidCatch(p.value,{componentStack:q!==null?q:""})})}function ua(a,r,c,p,S){if(c.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=c.alternate,r!==null&&Vr(r,c,S,!0),c=hs.current,c!==null){switch(c.tag){case 31:case 13:return Ja===null?$o():c.alternate===null&&Mn===0&&(Mn=3),c.flags&=-257,c.flags|=65536,c.lanes=S,p===Yd?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([p]):r.add(p),Oc(a,p,S)),!1;case 22:return c.flags|=65536,p===Yd?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([p]):c.add(p)),Oc(a,p,S)),!1}throw Error(s(435,c.tag))}return Oc(a,p,S),$o(),!1}if(jt)return r=hs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,p!==Lo&&(a=Error(s(422),{cause:p}),Gr(Os(a,c)))):(p!==Lo&&(r=Error(s(423),{cause:p}),Gr(Os(r,c))),a=a.current.alternate,a.flags|=65536,S&=-S,a.lanes|=S,p=Os(p,c),S=_p(a.stateNode,p,S),Qe(a,S),Mn!==4&&(Mn=2)),!1;var N=Error(s(520),{cause:p});if(N=Os(N,c),Fl===null?Fl=[N]:Fl.push(N),Mn!==4&&(Mn=2),r===null)return!0;p=Os(p,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,a=S&-S,c.lanes|=a,a=_p(c.stateNode,p,a),Qe(c,a),!1;case 1:if(r=c.type,N=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Jn===null||!Jn.has(N))))return c.flags|=65536,S&=-S,c.lanes|=S,S=Cp(S),p0(S,a,c,p),Qe(c,S),!1}c=c.return}while(c!==null);return!1}var sf=Error(s(461)),ta=!1;function va(a,r,c,p){r.child=a===null?Xd(r,null,c,p):yi(r,a.child,c,p)}function jp(a,r,c,p,S){c=c.render;var N=r.ref;if("ref"in p){var M={};for(var q in p)q!=="ref"&&(M[q]=p[q])}else M=p;return Vi(r),p=Zd(a,r,c,M,N,S),q=$h(),a!==null&&!ta?(ep(a,r,S),Zn(a,r,S)):(jt&&q&&qr(r),r.flags|=1,va(a,r,p,S),r.child)}function Gl(a,r,c,p,S){if(a===null){var N=c.type;return typeof N=="function"&&!Dd(N)&&N.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=N,rf(a,r,N,p,S)):(a=Ur(c.type,null,p,r,r.mode,S),a.ref=r.ref,a.return=r,r.child=a)}if(N=a.child,!ff(a,S)){var M=N.memoizedProps;if(c=c.compare,c=c!==null?c:To,c(M,p)&&a.ref===r.ref)return Zn(a,r,S)}return r.flags|=1,a=cs(N,p),a.ref=r.ref,a.return=r,r.child=a}function rf(a,r,c,p,S){if(a!==null){var N=a.memoizedProps;if(To(N,p)&&a.ref===r.ref)if(ta=!1,r.pendingProps=p=N,ff(a,S))(a.flags&131072)!==0&&(ta=!0);else return r.lanes=a.lanes,Zn(a,r,S)}return Ko(a,r,c,p,S)}function Pl(a,r,c,p){var S=p.children,N=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((r.flags&128)!==0){if(N=N!==null?N.baseLanes|c:c,a!==null){for(p=r.child=a.child,S=0;p!==null;)S=S|p.lanes|p.childLanes,p=p.sibling;p=S&~N}else p=0,r.child=null;return ms(a,r,N,c,p)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&uc(r,N!==null?N.cachePool:null),N!==null?Mg(r,N):Zh(),Dg(r);else return p=r.lanes=536870912,ms(a,r,N!==null?N.baseLanes|c:c,c,p)}else N!==null?(uc(r,N.cachePool),Mg(r,N),ps(),r.memoizedState=null):(a!==null&&uc(r,null),Zh(),ps());return va(a,r,S,c),r.child}function Xr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ms(a,r,c,p,S){var N=Pd();return N=N===null?null:{parent:ea._currentValue,pool:N},r.memoizedState={baseLanes:c,cachePool:N},a!==null&&uc(r,null),Zh(),Dg(r),a!==null&&Vr(a,r,p,!0),r.childLanes=S,null}function lf(a,r){return r=df({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function m0(a,r,c){return yi(r,a.child,null,c),a=lf(r,r.pendingProps),a.flags|=2,Kn(r),r.memoizedState=null,a}function of(a,r,c){var p=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(jt){if(p.mode==="hidden")return a=lf(r,p),r.lanes=536870912,Xr(null,a);if(Ih(r),(a=on)?(a=Qv(a,As),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:hi!==null?{id:On,overflow:br}:null,retryLane:536870912,hydrationErrors:null},c=Do(a),c.return=r,r.child=c,qn=r,on=null)):a=null,a===null)throw Br(r);return r.lanes=536870912,null}return lf(r,p)}var N=a.memoizedState;if(N!==null){var M=N.dehydrated;if(Ih(r),S)if(r.flags&256)r.flags&=-257,r=m0(a,r,c);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(ta||Vr(a,r,c,!1),S=(c&a.childLanes)!==0,ta||S){if(p=tt,p!==null&&(M=Gs(p,c),M!==0&&M!==N.retryLane))throw N.retryLane=M,Za(a,M),ht(p,a,M),sf;$o(),r=m0(a,r,c)}else a=N.treeContext,on=ti(M.nextSibling),qn=r,jt=!0,pi=null,As=!1,a!==null&&Ud(r,a),r=lf(r,p),r.flags|=4096;return r}return a=cs(a.child,{mode:p.mode,children:p.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Yl(a,r){var c=r.ref;if(c===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(a===null||a.ref!==c)&&(r.flags|=4194816)}}function Ko(a,r,c,p,S){return Vi(r),c=Zd(a,r,c,p,void 0,S),p=$h(),a!==null&&!ta?(ep(a,r,S),Zn(a,r,S)):(jt&&p&&qr(r),r.flags|=1,va(a,r,c,S),r.child)}function bc(a,r,c,p,S,N){return Vi(r),r.updateQueue=null,c=ql(r,p,c,S),zg(a),p=$h(),a!==null&&!ta?(ep(a,r,N),Zn(a,r,N)):(jt&&p&&qr(r),r.flags|=1,va(a,r,c,N),r.child)}function uf(a,r,c,p,S){if(Vi(r),r.stateNode===null){var N=Hi,M=c.contextType;typeof M=="object"&&M!==null&&(N=We(M)),N=new c(p,N),r.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=xc,r.stateNode=N,N._reactInternals=r,N=r.stateNode,N.props=p,N.state=r.memoizedState,N.refs={},fc(r),M=c.contextType,N.context=typeof M=="object"&&M!==null?We(M):Hi,N.state=r.memoizedState,M=c.getDerivedStateFromProps,typeof M=="function"&&(nf(r,c,M,p),N.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(M=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),M!==N.state&&xc.enqueueReplaceState(N,N.state,null),Go(r,p,N,S),hc(),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(a===null){N=r.stateNode;var q=r.memoizedProps,K=Ii(c,q);N.props=K;var ue=N.context,ye=c.contextType;M=Hi,typeof ye=="object"&&ye!==null&&(M=We(ye));var ve=c.getDerivedStateFromProps;ye=typeof ve=="function"||typeof N.getSnapshotBeforeUpdate=="function",q=r.pendingProps!==q,ye||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(q||ue!==M)&&vp(r,N,p,M),Ia=!1;var fe=r.memoizedState;N.state=fe,Go(r,p,N,S),hc(),ue=r.memoizedState,q||fe!==ue||Ia?(typeof ve=="function"&&(nf(r,c,ve,p),ue=r.memoizedState),(K=Ia||bp(r,c,K,p,fe,ue,M))?(ye||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(r.flags|=4194308)):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=p,r.memoizedState=ue),N.props=p,N.state=ue,N.context=M,p=K):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{N=r.stateNode,Kh(a,r),M=r.memoizedProps,ye=Ii(c,M),N.props=ye,ve=r.pendingProps,fe=N.context,ue=c.contextType,K=Hi,typeof ue=="object"&&ue!==null&&(K=We(ue)),q=c.getDerivedStateFromProps,(ue=typeof q=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M!==ve||fe!==K)&&vp(r,N,p,K),Ia=!1,fe=r.memoizedState,N.state=fe,Go(r,p,N,S),hc();var ge=r.memoizedState;M!==ve||fe!==ge||Ia||a!==null&&a.dependencies!==null&&oc(a.dependencies)?(typeof q=="function"&&(nf(r,c,q,p),ge=r.memoizedState),(ye=Ia||bp(r,c,ye,p,fe,ge,K)||a!==null&&a.dependencies!==null&&oc(a.dependencies))?(ue||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(p,ge,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(p,ge,K)),typeof N.componentDidUpdate=="function"&&(r.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof N.componentDidUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=ge),N.props=p,N.state=ge,N.context=K,p=ye):(typeof N.componentDidUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),p=!1)}return N=p,Yl(a,r),p=(r.flags&128)!==0,N||p?(N=r.stateNode,c=p&&typeof c.getDerivedStateFromError!="function"?null:N.render(),r.flags|=1,a!==null&&p?(r.child=yi(r,a.child,null,S),r.child=yi(r,null,c,S)):va(a,r,c,S),r.memoizedState=N.state,a=r.child):a=Zn(a,r,S),a}function g0(a,r,c,p){return Pi(),r.flags|=256,va(a,r,c,p),r.child}var wp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ga(a){return{baseLanes:a,cachePool:Xh()}}function cf(a,r,c){return a=a!==null?a.childLanes&~c:0,r&&(a|=ts),a}function y0(a,r,c){var p=r.pendingProps,S=!1,N=(r.flags&128)!==0,M;if((M=N)||(M=a!==null&&a.memoizedState===null?!1:(wt.current&2)!==0),M&&(S=!0,r.flags&=-129),M=(r.flags&32)!==0,r.flags&=-33,a===null){if(jt){if(S?bi(r):ps(),(a=on)?(a=Qv(a,As),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:hi!==null?{id:On,overflow:br}:null,retryLane:536870912,hydrationErrors:null},c=Do(a),c.return=r,r.child=c,qn=r,on=null)):a=null,a===null)throw Br(r);return Ty(a)?r.lanes=32:r.lanes=536870912,null}var q=p.children;return p=p.fallback,S?(ps(),S=r.mode,q=df({mode:"hidden",children:q},S),p=qi(p,S,c,null),q.return=r,p.return=r,q.sibling=p,r.child=q,p=r.child,p.memoizedState=Ga(c),p.childLanes=cf(a,M,c),r.memoizedState=wp,Xr(null,p)):(bi(r),vc(r,q))}var K=a.memoizedState;if(K!==null&&(q=K.dehydrated,q!==null)){if(N)r.flags&256?(bi(r),r.flags&=-257,r=Ep(a,r,c)):r.memoizedState!==null?(ps(),r.child=a.child,r.flags|=128,r=null):(ps(),q=p.fallback,S=r.mode,p=df({mode:"visible",children:p.children},S),q=qi(q,S,c,null),q.flags|=2,p.return=r,q.return=r,p.sibling=q,r.child=p,yi(r,a.child,null,c),p=r.child,p.memoizedState=Ga(c),p.childLanes=cf(a,M,c),r.memoizedState=wp,r=Xr(null,p));else if(bi(r),Ty(q)){if(M=q.nextSibling&&q.nextSibling.dataset,M)var ue=M.dgst;M=ue,p=Error(s(419)),p.stack="",p.digest=M,Gr({value:p,source:null,stack:null}),r=Ep(a,r,c)}else if(ta||Vr(a,r,c,!1),M=(c&a.childLanes)!==0,ta||M){if(M=tt,M!==null&&(p=Gs(M,c),p!==0&&p!==K.retryLane))throw K.retryLane=p,Za(a,p),ht(M,a,p),sf;Ey(q)||$o(),r=Ep(a,r,c)}else Ey(q)?(r.flags|=192,r.child=a.child,r=null):(a=K.treeContext,on=ti(q.nextSibling),qn=r,jt=!0,pi=null,As=!1,a!==null&&Ud(r,a),r=vc(r,p.children),r.flags|=4096);return r}return S?(ps(),q=p.fallback,S=r.mode,K=a.child,ue=K.sibling,p=cs(K,{mode:"hidden",children:p.children}),p.subtreeFlags=K.subtreeFlags&65011712,ue!==null?q=cs(ue,q):(q=qi(q,S,c,null),q.flags|=2),q.return=r,p.return=r,p.sibling=q,r.child=p,Xr(null,p),p=r.child,q=a.child.memoizedState,q===null?q=Ga(c):(S=q.cachePool,S!==null?(K=ea._currentValue,S=S.parent!==K?{parent:K,pool:K}:S):S=Xh(),q={baseLanes:q.baseLanes|c,cachePool:S}),p.memoizedState=q,p.childLanes=cf(a,M,c),r.memoizedState=wp,Xr(a.child,p)):(bi(r),c=a.child,a=c.sibling,c=cs(c,{mode:"visible",children:p.children}),c.return=r,c.sibling=null,a!==null&&(M=r.deletions,M===null?(r.deletions=[a],r.flags|=16):M.push(a)),r.child=c,r.memoizedState=null,c)}function vc(a,r){return r=df({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function df(a,r){return a=Rn(22,a,null,r),a.lanes=0,a}function Ep(a,r,c){return yi(r,a.child,null,c),a=vc(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function x0(a,r,c){a.lanes|=r;var p=a.alternate;p!==null&&(p.lanes|=r),qd(a.return,r,c)}function Vl(a,r,c,p,S,N){var M=a.memoizedState;M===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:S,treeForkCount:N}:(M.isBackwards=r,M.rendering=null,M.renderingStartTime=0,M.last=p,M.tail=c,M.tailMode=S,M.treeForkCount=N)}function gs(a,r,c){var p=r.pendingProps,S=p.revealOrder,N=p.tail;p=p.children;var M=wt.current,q=(M&2)!==0;if(q?(M=M&1|2,r.flags|=128):M&=1,he(wt,M),va(a,r,p,c),p=jt?ko:0,!q&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&x0(a,c,r);else if(a.tag===19)x0(a,c,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(S){case"forwards":for(c=r.child,S=null;c!==null;)a=c.alternate,a!==null&&Ds(a)===null&&(S=c),c=c.sibling;c=S,c===null?(S=r.child,r.child=null):(S=c.sibling,c.sibling=null),Vl(r,!1,S,c,N,p);break;case"backwards":case"unstable_legacy-backwards":for(c=null,S=r.child,r.child=null;S!==null;){if(a=S.alternate,a!==null&&Ds(a)===null){r.child=S;break}a=S.sibling,S.sibling=c,c=S,S=a}Vl(r,!0,c,null,N,p);break;case"together":Vl(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function Zn(a,r,c){if(a!==null&&(r.dependencies=a.dependencies),Wr|=r.lanes,(c&r.childLanes)===0)if(a!==null){if(Vr(a,r,c,!1),(c&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(s(153));if(r.child!==null){for(a=r.child,c=cs(a,a.pendingProps),r.child=c,c.return=r;a.sibling!==null;)a=a.sibling,c=c.sibling=cs(a,a.pendingProps),c.return=r;c.sibling=null}return r.child}function ff(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&oc(a)))}function my(a,r,c){switch(r.tag){case 3:nt(r,r.stateNode.containerInfo),mi(r,ea,a.memoizedState.cache),Pi();break;case 27:case 5:Vt(r);break;case 4:nt(r,r.stateNode.containerInfo);break;case 10:mi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ih(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(bi(r),r.flags|=128,null):(c&r.child.childLanes)!==0?y0(a,r,c):(bi(r),a=Zn(a,r,c),a!==null?a.sibling:null);bi(r);break;case 19:var S=(a.flags&128)!==0;if(p=(c&r.childLanes)!==0,p||(Vr(a,r,c,!1),p=(c&r.childLanes)!==0),S){if(p)return gs(a,r,c);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),he(wt,wt.current),p)break;return null;case 22:return r.lanes=0,Pl(a,r,c,r.pendingProps);case 24:mi(r,ea,a.memoizedState.cache)}return Zn(a,r,c)}function hf(a,r,c){if(a!==null)if(a.memoizedProps!==r.pendingProps)ta=!0;else{if(!ff(a,c)&&(r.flags&128)===0)return ta=!1,my(a,r,c);ta=(a.flags&131072)!==0}else ta=!1,jt&&(r.flags&1048576)!==0&&jg(r,ko,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(a=Dl(r.elementType),r.type=a,typeof a=="function")Dd(a)?(p=Ii(a,p),r.tag=1,r=uf(null,r,a,p,c)):(r.tag=0,r=Ko(null,r,a,p,c));else{if(a!=null){var S=a.$$typeof;if(S===k){r.tag=11,r=jp(null,r,a,p,c);break e}else if(S===B){r.tag=14,r=Gl(null,r,a,p,c);break e}}throw r=ie(a)||a,Error(s(306,r,""))}}return r;case 0:return Ko(a,r,r.type,r.pendingProps,c);case 1:return p=r.type,S=Ii(p,r.pendingProps),uf(a,r,p,S,c);case 3:e:{if(nt(r,r.stateNode.containerInfo),a===null)throw Error(s(387));p=r.pendingProps;var N=r.memoizedState;S=N.element,Kh(a,r),Go(r,p,null,c);var M=r.memoizedState;if(p=M.cache,mi(r,ea,p),p!==N.cache&&Bd(r,[ea],c,!0),hc(),p=M.element,N.isDehydrated)if(N={element:p,isDehydrated:!1,cache:M.cache},r.updateQueue.baseState=N,r.memoizedState=N,r.flags&256){r=g0(a,r,p,c);break e}else if(p!==S){S=Os(Error(s(424)),r),Gr(S),r=g0(a,r,p,c);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(on=ti(a.firstChild),qn=r,jt=!0,pi=null,As=!0,c=Xd(r,null,p,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Pi(),p===S){r=Zn(a,r,c);break e}va(a,r,p,c)}r=r.child}return r;case 26:return Yl(a,r),a===null?(c=Jv(r.type,null,r.pendingProps,null))?r.memoizedState=c:jt||(c=r.type,a=r.pendingProps,p=N0(je.current).createElement(c),p[Fe]=r,p[ut]=a,as(p,c,a),En(p),r.stateNode=p):r.memoizedState=Jv(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Vt(r),a===null&&jt&&(p=r.stateNode=Fv(r.type,r.pendingProps,je.current),qn=r,As=!0,S=on,au(r.type)?(Ry=S,on=ti(p.firstChild)):on=S),va(a,r,r.pendingProps.children,c),Yl(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&jt&&((S=p=on)&&(p=d7(p,r.type,r.pendingProps,As),p!==null?(r.stateNode=p,qn=r,on=ti(p.firstChild),As=!1,S=!0):S=!1),S||Br(r)),Vt(r),S=r.type,N=r.pendingProps,M=a!==null?a.memoizedProps:null,p=N.children,Cy(S,N)?p=null:M!==null&&Cy(S,M)&&(r.flags|=32),r.memoizedState!==null&&(S=Zd(a,r,Bl,null,null,c),Hp._currentValue=S),Yl(a,r),va(a,r,p,c),r.child;case 6:return a===null&&jt&&((a=c=on)&&(c=f7(c,r.pendingProps,As),c!==null?(r.stateNode=c,qn=r,on=null,a=!0):a=!1),a||Br(r)),null;case 13:return y0(a,r,c);case 4:return nt(r,r.stateNode.containerInfo),p=r.pendingProps,a===null?r.child=yi(r,null,p,c):va(a,r,p,c),r.child;case 11:return jp(a,r,r.type,r.pendingProps,c);case 7:return va(a,r,r.pendingProps,c),r.child;case 8:return va(a,r,r.pendingProps.children,c),r.child;case 12:return va(a,r,r.pendingProps.children,c),r.child;case 10:return p=r.pendingProps,mi(r,r.type,p.value),va(a,r,p.children,c),r.child;case 9:return S=r.type._context,p=r.pendingProps.children,Vi(r),S=We(S),p=p(S),r.flags|=1,va(a,r,p,c),r.child;case 14:return Gl(a,r,r.type,r.pendingProps,c);case 15:return rf(a,r,r.type,r.pendingProps,c);case 19:return gs(a,r,c);case 31:return of(a,r,c);case 22:return Pl(a,r,c,r.pendingProps);case 24:return Vi(r),p=We(ea),a===null?(S=Pd(),S===null&&(S=tt,N=Ph(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=c),S=N),r.memoizedState={parent:p,cache:S},fc(r),mi(r,ea,S)):((a.lanes&c)!==0&&(Kh(a,r),Go(r,null,null,c),hc()),S=a.memoizedState,N=r.memoizedState,S.parent!==p?(S={parent:p,cache:p},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),mi(r,ea,p)):(p=N.cache,mi(r,ea,p),p!==S.cache&&Bd(r,[ea],c,!0))),va(a,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Kr(a){a.flags|=4}function Sc(a,r,c,p,S){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(S&335544128)===S)if(a.stateNode.complete)a.flags|=8192;else if(zn())a.flags|=8192;else throw Qr=Yd,cc}else a.flags&=-16777217}function Tp(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!n2(r))if(zn())a.flags|=8192;else throw Qr=Yd,cc}function Si(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?rn():536870912,a.lanes|=r,mn|=r)}function Fr(a,r){if(!jt)switch(a.tailMode){case"hidden":r=a.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function tn(a){var r=a.alternate!==null&&a.alternate.child===a.child,c=0,p=0;if(r)for(var S=a.child;S!==null;)c|=S.lanes|S.childLanes,p|=S.subtreeFlags&65011712,p|=S.flags&65011712,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)c|=S.lanes|S.childLanes,p|=S.subtreeFlags,p|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=p,a.childLanes=c,r}function Nc(a,r,c){var p=r.pendingProps;switch(Ld(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(r),null;case 1:return tn(r),null;case 3:return c=r.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Yr(ea),ze(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Uo(r)?Kr(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Hd())),tn(r),null;case 26:var S=r.type,N=r.memoizedState;return a===null?(Kr(r),N!==null?(tn(r),Tp(r,N)):(tn(r),Sc(r,S,null,p,c))):N?N!==a.memoizedState?(Kr(r),tn(r),Tp(r,N)):(tn(r),r.flags&=-16777217):(a=a.memoizedProps,a!==p&&Kr(r),tn(r),Sc(r,S,a,p,c)),null;case 27:if($e(r),c=je.current,S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==p&&Kr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return tn(r),null}a=xe.current,Uo(r)?wg(r):(a=Fv(S,p,c),r.stateNode=a,Kr(r))}return tn(r),null;case 5:if($e(r),S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==p&&Kr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return tn(r),null}if(N=xe.current,Uo(r))wg(r);else{var M=N0(je.current);switch(N){case 1:N=M.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=M.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=M.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=M.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":N=M.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof p.is=="string"?M.createElement("select",{is:p.is}):M.createElement("select"),p.multiple?N.multiple=!0:p.size&&(N.size=p.size);break;default:N=typeof p.is=="string"?M.createElement(S,{is:p.is}):M.createElement(S)}}N[Fe]=r,N[ut]=p;e:for(M=r.child;M!==null;){if(M.tag===5||M.tag===6)N.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===r)break e;for(;M.sibling===null;){if(M.return===null||M.return===r)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}r.stateNode=N;e:switch(as(N,S,p),S){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Kr(r)}}return tn(r),Sc(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,c),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==p&&Kr(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(s(166));if(a=je.current,Uo(r)){if(a=r.stateNode,c=r.memoizedProps,p=null,S=qn,S!==null)switch(S.tag){case 27:case 5:p=S.memoizedProps}a[Fe]=r,a=!!(a.nodeValue===c||p!==null&&p.suppressHydrationWarning===!0||Uv(a.nodeValue,c)),a||Br(r,!0)}else a=N0(a).createTextNode(p),a[Fe]=r,r.stateNode=a}return tn(r),null;case 31:if(c=r.memoizedState,a===null||a.memoizedState!==null){if(p=Uo(r),c!==null){if(a===null){if(!p)throw Error(s(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[Fe]=r}else Pi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tn(r),a=!1}else c=Hd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return r.flags&256?(Kn(r),r):(Kn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return tn(r),null;case 13:if(p=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(S=Uo(r),p!==null&&p.dehydrated!==null){if(a===null){if(!S)throw Error(s(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(s(317));S[Fe]=r}else Pi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tn(r),S=!1}else S=Hd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(Kn(r),r):(Kn(r),null)}return Kn(r),(r.flags&128)!==0?(r.lanes=c,r):(c=p!==null,a=a!==null&&a.memoizedState!==null,c&&(p=r.child,S=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(S=p.alternate.memoizedState.cachePool.pool),N=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(N=p.memoizedState.cachePool.pool),N!==S&&(p.flags|=2048)),c!==a&&c&&(r.child.flags|=8192),Si(r,r.updateQueue),tn(r),null);case 4:return ze(),a===null&&by(r.stateNode.containerInfo),tn(r),null;case 10:return Yr(r.type),tn(r),null;case 19:if(W(wt),p=r.memoizedState,p===null)return tn(r),null;if(S=(r.flags&128)!==0,N=p.rendering,N===null)if(S)Fr(p,!1);else{if(Mn!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(N=Ds(a),N!==null){for(r.flags|=128,Fr(p,!1),a=N.updateQueue,r.updateQueue=a,Si(r,a),r.subtreeFlags=0,a=c,c=r.child;c!==null;)Mo(c,a),c=c.sibling;return he(wt,wt.current&1|2),jt&&Hr(r,p.treeForkCount),r.child}a=a.sibling}p.tail!==null&&Qn()>In&&(r.flags|=128,S=!0,Fr(p,!1),r.lanes=4194304)}else{if(!S)if(a=Ds(N),a!==null){if(r.flags|=128,S=!0,a=a.updateQueue,r.updateQueue=a,Si(r,a),Fr(p,!0),p.tail===null&&p.tailMode==="hidden"&&!N.alternate&&!jt)return tn(r),null}else 2*Qn()-p.renderingStartTime>In&&c!==536870912&&(r.flags|=128,S=!0,Fr(p,!1),r.lanes=4194304);p.isBackwards?(N.sibling=r.child,r.child=N):(a=p.last,a!==null?a.sibling=N:r.child=N,p.last=N)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=Qn(),a.sibling=null,c=wt.current,he(wt,S?c&1|2:c&1),jt&&Hr(r,p.treeForkCount),a):(tn(r),null);case 22:case 23:return Kn(r),pc(),p=r.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(r.flags|=8192):p&&(r.flags|=8192),p?(c&536870912)!==0&&(r.flags&128)===0&&(tn(r),r.subtreeFlags&6&&(r.flags|=8192)):tn(r),c=r.updateQueue,c!==null&&Si(r,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),p=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),p!==c&&(r.flags|=2048),a!==null&&W(Qi),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Yr(ea),tn(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function $s(a,r){switch(Ld(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Yr(ea),ze(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return $e(r),null;case 31:if(r.memoizedState!==null){if(Kn(r),r.alternate===null)throw Error(s(340));Pi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Kn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Pi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return W(wt),null;case 4:return ze(),null;case 10:return Yr(r.type),null;case 22:case 23:return Kn(r),pc(),a!==null&&W(Qi),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Yr(ea),null;case 25:return null;default:return null}}function zs(a,r){switch(Ld(r),r.tag){case 3:Yr(ea),ze();break;case 26:case 27:case 5:$e(r);break;case 4:ze();break;case 31:r.memoizedState!==null&&Kn(r);break;case 13:Kn(r);break;case 19:W(wt);break;case 10:Yr(r.type);break;case 22:case 23:Kn(r),pc(),a!==null&&W(Qi);break;case 24:Yr(ea)}}function er(a,r){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var S=p.next;c=S;do{if((c.tag&a)===a){p=void 0;var N=c.create,M=c.inst;p=N(),M.destroy=p}c=c.next}while(c!==S)}}catch(q){Ut(r,r.return,q)}}function Aa(a,r,c){try{var p=r.updateQueue,S=p!==null?p.lastEffect:null;if(S!==null){var N=S.next;p=N;do{if((p.tag&a)===a){var M=p.inst,q=M.destroy;if(q!==void 0){M.destroy=void 0,S=r;var K=c,ue=q;try{ue()}catch(ye){Ut(S,K,ye)}}}p=p.next}while(p!==N)}}catch(ye){Ut(r,r.return,ye)}}function vr(a){var r=a.updateQueue;if(r!==null){var c=a.stateNode;try{Ag(r,c)}catch(p){Ut(a,a.return,p)}}}function Sa(a,r,c){c.props=Ii(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(p){Ut(a,r,p)}}function Ni(a,r){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof c=="function"?a.refCleanup=c(p):c.current=p}}catch(S){Ut(a,r,S)}}function Ma(a,r){var c=a.ref,p=a.refCleanup;if(c!==null)if(typeof p=="function")try{p()}catch(S){Ut(a,r,S)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(S){Ut(a,r,S)}else c.current=null}function _c(a){var r=a.type,c=a.memoizedProps,p=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&p.focus();break e;case"img":c.src?p.src=c.src:c.srcSet&&(p.srcset=c.srcSet)}}catch(S){Ut(a,a.return,S)}}function ca(a,r,c){try{var p=a.stateNode;r7(p,a.type,c,r),p[ut]=r}catch(S){Ut(a,a.return,S)}}function Sn(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&au(a.type)||a.tag===4}function St(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Sn(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&au(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Zr(a,r,c){var p=a.tag;if(p===5||p===6)a=a.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(a),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=ci));else if(p!==4&&(p===27&&au(a.type)&&(c=a.stateNode,r=null),a=a.child,a!==null))for(Zr(a,r,c),a=a.sibling;a!==null;)Zr(a,r,c),a=a.sibling}function Wa(a,r,c){var p=a.tag;if(p===5||p===6)a=a.stateNode,r?c.insertBefore(a,r):c.appendChild(a);else if(p!==4&&(p===27&&au(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(Wa(a,r,c),a=a.sibling;a!==null;)Wa(a,r,c),a=a.sibling}function pf(a){var r=a.stateNode,c=a.memoizedProps;try{for(var p=a.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);as(r,p,c),r[Fe]=a,r[ut]=c}catch(N){Ut(a,a.return,N)}}var tr=!1,un=!1,Sr=!1,b0=typeof WeakSet=="function"?WeakSet:Set,Na=null;function gy(a,r){if(a=a.containerInfo,Ny=R0,a=Sg(a),Uh(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var S=p.anchorOffset,N=p.focusNode;p=p.focusOffset;try{c.nodeType,N.nodeType}catch{c=null;break e}var M=0,q=-1,K=-1,ue=0,ye=0,ve=a,fe=null;t:for(;;){for(var ge;ve!==c||S!==0&&ve.nodeType!==3||(q=M+S),ve!==N||p!==0&&ve.nodeType!==3||(K=M+p),ve.nodeType===3&&(M+=ve.nodeValue.length),(ge=ve.firstChild)!==null;)fe=ve,ve=ge;for(;;){if(ve===a)break t;if(fe===c&&++ue===S&&(q=M),fe===N&&++ye===p&&(K=M),(ge=ve.nextSibling)!==null)break;ve=fe,fe=ve.parentNode}ve=ge}c=q===-1||K===-1?null:{start:q,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(_y={focusedElem:a,selectionRange:c},R0=!1,Na=r;Na!==null;)if(r=Na,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Na=a;else for(;Na!==null;){switch(r=Na,N=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)S=a[c],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&N!==null){a=void 0,c=r,S=N.memoizedProps,N=N.memoizedState,p=c.stateNode;try{var qe=Ii(c.type,S);a=p.getSnapshotBeforeUpdate(qe,N),p.__reactInternalSnapshotBeforeUpdate=a}catch(Ie){Ut(c,c.return,Ie)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,c=a.nodeType,c===9)wy(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":wy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(s(163))}if(a=r.sibling,a!==null){a.return=r.return,Na=a;break}Na=r.return}}function Nn(a,r,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:sr(a,c),p&4&&er(5,c);break;case 1:if(sr(a,c),p&4)if(a=c.stateNode,r===null)try{a.componentDidMount()}catch(M){Ut(c,c.return,M)}else{var S=Ii(c.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(S,r,a.__reactInternalSnapshotBeforeUpdate)}catch(M){Ut(c,c.return,M)}}p&64&&vr(c),p&512&&Ni(c,c.return);break;case 3:if(sr(a,c),p&64&&(a=c.updateQueue,a!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{Ag(a,r)}catch(M){Ut(c,c.return,M)}}break;case 27:r===null&&p&4&&pf(c);case 26:case 5:sr(a,c),r===null&&p&4&&_c(c),p&512&&Ni(c,c.return);break;case 12:sr(a,c);break;case 31:sr(a,c),p&4&&Ji(a,c);break;case 13:sr(a,c),p&4&&Fo(a,c),p&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=g.bind(null,c),h7(a,c))));break;case 22:if(p=c.memoizedState!==null||tr,!p){r=r!==null&&r.memoizedState!==null||un,S=tr;var N=un;tr=p,(un=r)&&!N?$a(a,c,(c.subtreeFlags&8772)!==0):sr(a,c),tr=S,un=N}break;case 30:break;default:sr(a,c)}}function Cc(a){var r=a.alternate;r!==null&&(a.alternate=null,Cc(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Ps(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var It=null,Pa=!1;function nr(a,r,c){for(c=c.child;c!==null;)mf(a,r,c),c=c.sibling}function mf(a,r,c){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(Bs,c)}catch{}switch(c.tag){case 26:un||Ma(c,r),nr(a,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:un||Ma(c,r);var p=It,S=Pa;au(c.type)&&(It=c.stateNode,Pa=!1),nr(a,r,c),kp(c.stateNode),It=p,Pa=S;break;case 5:un||Ma(c,r);case 6:if(p=It,S=Pa,It=null,nr(a,r,c),It=p,Pa=S,It!==null)if(Pa)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(c.stateNode)}catch(N){Ut(c,r,N)}else try{It.removeChild(c.stateNode)}catch(N){Ut(c,r,N)}break;case 18:It!==null&&(Pa?(a=It,Yv(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),_f(a)):Yv(It,c.stateNode));break;case 4:p=It,S=Pa,It=c.stateNode.containerInfo,Pa=!0,nr(a,r,c),It=p,Pa=S;break;case 0:case 11:case 14:case 15:Aa(2,c,r),un||Aa(4,c,r),nr(a,r,c);break;case 1:un||(Ma(c,r),p=c.stateNode,typeof p.componentWillUnmount=="function"&&Sa(c,r,p)),nr(a,r,c);break;case 21:nr(a,r,c);break;case 22:un=(p=un)||c.memoizedState!==null,nr(a,r,c),un=p;break;default:nr(a,r,c)}}function Ji(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{_f(a)}catch(c){Ut(r,r.return,c)}}}function Fo(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{_f(a)}catch(c){Ut(r,r.return,c)}}function Rp(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new b0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new b0),r;default:throw Error(s(435,a.tag))}}function _i(a,r){var c=Rp(a);r.forEach(function(p){if(!c.has(p)){c.add(p);var S=x.bind(null,a,p);p.then(S,S)}})}function da(a,r){var c=r.deletions;if(c!==null)for(var p=0;p<c.length;p++){var S=c[p],N=a,M=r,q=M;e:for(;q!==null;){switch(q.tag){case 27:if(au(q.type)){It=q.stateNode,Pa=!1;break e}break;case 5:It=q.stateNode,Pa=!1;break e;case 3:case 4:It=q.stateNode.containerInfo,Pa=!0;break e}q=q.return}if(It===null)throw Error(s(160));mf(N,M,S),It=null,Pa=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Wi(r,a),r=r.sibling}var ar=null;function Wi(a,r){var c=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:da(r,a),fa(a),p&4&&(Aa(3,a,a.return),er(3,a),Aa(5,a,a.return));break;case 1:da(r,a),fa(a),p&512&&(un||c===null||Ma(c,c.return)),p&64&&tr&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:var S=ar;if(da(r,a),fa(a),p&512&&(un||c===null||Ma(c,c.return)),p&4){var N=c!==null?c.memoizedState:null;if(p=a.memoizedState,c===null)if(p===null)if(a.stateNode===null){e:{p=a.type,c=a.memoizedProps,S=S.ownerDocument||S;t:switch(p){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Xa]||N[Fe]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(p),S.head.insertBefore(N,S.querySelector("head > title"))),as(N,p,c),N[Fe]=a,En(N),p=N;break e;case"link":var M=e2("link","href",S).get(p+(c.href||""));if(M){for(var q=0;q<M.length;q++)if(N=M[q],N.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&N.getAttribute("rel")===(c.rel==null?null:c.rel)&&N.getAttribute("title")===(c.title==null?null:c.title)&&N.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){M.splice(q,1);break t}}N=S.createElement(p),as(N,p,c),S.head.appendChild(N);break;case"meta":if(M=e2("meta","content",S).get(p+(c.content||""))){for(q=0;q<M.length;q++)if(N=M[q],N.getAttribute("content")===(c.content==null?null:""+c.content)&&N.getAttribute("name")===(c.name==null?null:c.name)&&N.getAttribute("property")===(c.property==null?null:c.property)&&N.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&N.getAttribute("charset")===(c.charSet==null?null:c.charSet)){M.splice(q,1);break t}}N=S.createElement(p),as(N,p,c),S.head.appendChild(N);break;default:throw Error(s(468,p))}N[Fe]=a,En(N),p=N}a.stateNode=p}else t2(S,a.type,a.stateNode);else a.stateNode=$v(S,p,a.memoizedProps);else N!==p?(N===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):N.count--,p===null?t2(S,a.type,a.stateNode):$v(S,p,a.memoizedProps)):p===null&&a.stateNode!==null&&ca(a,a.memoizedProps,c.memoizedProps)}break;case 27:da(r,a),fa(a),p&512&&(un||c===null||Ma(c,c.return)),c!==null&&p&4&&ca(a,a.memoizedProps,c.memoizedProps);break;case 5:if(da(r,a),fa(a),p&512&&(un||c===null||Ma(c,c.return)),a.flags&32){S=a.stateNode;try{_l(S,"")}catch(qe){Ut(a,a.return,qe)}}p&4&&a.stateNode!=null&&(S=a.memoizedProps,ca(a,S,c!==null?c.memoizedProps:S)),p&1024&&(Sr=!0);break;case 6:if(da(r,a),fa(a),p&4){if(a.stateNode===null)throw Error(s(162));p=a.memoizedProps,c=a.stateNode;try{c.nodeValue=p}catch(qe){Ut(a,a.return,qe)}}break;case 3:if(j0=null,S=ar,ar=_0(r.containerInfo),da(r,a),ar=S,fa(a),p&4&&c!==null&&c.memoizedState.isDehydrated)try{_f(r.containerInfo)}catch(qe){Ut(a,a.return,qe)}Sr&&(Sr=!1,gf(a));break;case 4:p=ar,ar=_0(a.stateNode.containerInfo),da(r,a),fa(a),ar=p;break;case 12:da(r,a),fa(a);break;case 31:da(r,a),fa(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));break;case 13:da(r,a),fa(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Zo=Qn()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));break;case 22:S=a.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,ue=tr,ye=un;if(tr=ue||S,un=ye||K,da(r,a),un=ye,tr=ue,fa(a),p&8192)e:for(r=a.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(c===null||K||tr||un||Ir(a)),c=null,r=a;;){if(r.tag===5||r.tag===26){if(c===null){K=c=r;try{if(N=K.stateNode,S)M=N.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{q=K.stateNode;var ve=K.memoizedProps.style,fe=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;q.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(qe){Ut(K,K.return,qe)}}}else if(r.tag===6){if(c===null){K=r;try{K.stateNode.nodeValue=S?"":K.memoizedProps}catch(qe){Ut(K,K.return,qe)}}}else if(r.tag===18){if(c===null){K=r;try{var ge=K.stateNode;S?Vv(ge,!0):Vv(K.stateNode,!1)}catch(qe){Ut(K,K.return,qe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}p&4&&(p=a.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,_i(a,c))));break;case 19:da(r,a),fa(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));break;case 30:break;case 21:break;default:da(r,a),fa(a)}}function fa(a){var r=a.flags;if(r&2){try{for(var c,p=a.return;p!==null;){if(Sn(p)){c=p;break}p=p.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var S=c.stateNode,N=St(a);Wa(a,N,S);break;case 5:var M=c.stateNode;c.flags&32&&(_l(M,""),c.flags&=-33);var q=St(a);Wa(a,q,M);break;case 3:case 4:var K=c.stateNode.containerInfo,ue=St(a);Zr(a,ue,K);break;default:throw Error(s(161))}}catch(ye){Ut(a,a.return,ye)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function gf(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;gf(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function sr(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Nn(a,r.alternate,r),r=r.sibling}function Ir(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Aa(4,r,r.return),Ir(r);break;case 1:Ma(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&Sa(r,r.return,c),Ir(r);break;case 27:kp(r.stateNode);case 26:case 5:Ma(r,r.return),Ir(r);break;case 22:r.memoizedState===null&&Ir(r);break;case 30:Ir(r);break;default:Ir(r)}a=a.sibling}}function $a(a,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,S=a,N=r,M=N.flags;switch(N.tag){case 0:case 11:case 15:$a(S,N,c),er(4,N);break;case 1:if($a(S,N,c),p=N,S=p.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ue){Ut(p,p.return,ue)}if(p=N,S=p.updateQueue,S!==null){var q=p.stateNode;try{var K=S.shared.hiddenCallbacks;if(K!==null)for(S.shared.hiddenCallbacks=null,S=0;S<K.length;S++)Po(K[S],q)}catch(ue){Ut(p,p.return,ue)}}c&&M&64&&vr(N),Ni(N,N.return);break;case 27:pf(N);case 26:case 5:$a(S,N,c),c&&p===null&&M&4&&_c(N),Ni(N,N.return);break;case 12:$a(S,N,c);break;case 31:$a(S,N,c),c&&M&4&&Ji(S,N);break;case 13:$a(S,N,c),c&&M&4&&Fo(S,N);break;case 22:N.memoizedState===null&&$a(S,N,c),Ni(N,N.return);break;case 30:break;default:$a(S,N,c)}r=r.sibling}}function $i(a,r){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Al(c))}function Ql(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Al(a))}function Da(a,r,c,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Op(a,r,c,p),r=r.sibling}function Op(a,r,c,p){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Da(a,r,c,p),S&2048&&er(9,r);break;case 1:Da(a,r,c,p);break;case 3:Da(a,r,c,p),S&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Al(a)));break;case 12:if(S&2048){Da(a,r,c,p),a=r.stateNode;try{var N=r.memoizedProps,M=N.id,q=N.onPostCommit;typeof q=="function"&&q(M,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(K){Ut(r,r.return,K)}}else Da(a,r,c,p);break;case 31:Da(a,r,c,p);break;case 13:Da(a,r,c,p);break;case 23:break;case 22:N=r.stateNode,M=r.alternate,r.memoizedState!==null?N._visibility&2?Da(a,r,c,p):Jr(a,r):N._visibility&2?Da(a,r,c,p):(N._visibility|=2,za(a,r,c,p,(r.subtreeFlags&10256)!==0||!1)),S&2048&&$i(M,r);break;case 24:Da(a,r,c,p),S&2048&&Ql(r.alternate,r);break;default:Da(a,r,c,p)}}function za(a,r,c,p,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var N=a,M=r,q=c,K=p,ue=M.flags;switch(M.tag){case 0:case 11:case 15:za(N,M,q,K,S),er(8,M);break;case 23:break;case 22:var ye=M.stateNode;M.memoizedState!==null?ye._visibility&2?za(N,M,q,K,S):Jr(N,M):(ye._visibility|=2,za(N,M,q,K,S)),S&&ue&2048&&$i(M.alternate,M);break;case 24:za(N,M,q,K,S),S&&ue&2048&&Ql(M.alternate,M);break;default:za(N,M,q,K,S)}r=r.sibling}}function Jr(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=a,p=r,S=p.flags;switch(p.tag){case 22:Jr(c,p),S&2048&&$i(p.alternate,p);break;case 24:Jr(c,p),S&2048&&Ql(p.alternate,p);break;default:Jr(c,p)}r=r.sibling}}var Xl=8192;function ks(a,r,c){if(a.subtreeFlags&Xl)for(a=a.child;a!==null;)yf(a,r,c),a=a.sibling}function yf(a,r,c){switch(a.tag){case 26:ks(a,r,c),a.flags&Xl&&a.memoizedState!==null&&j7(c,ar,a.memoizedState,a.memoizedProps);break;case 5:ks(a,r,c);break;case 3:case 4:var p=ar;ar=_0(a.stateNode.containerInfo),ks(a,r,c),ar=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=Xl,Xl=16777216,ks(a,r,c),Xl=p):ks(a,r,c));break;default:ks(a,r,c)}}function Kl(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function el(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];Na=p,Bn(p,a)}Kl(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)ys(a),a=a.sibling}function ys(a){switch(a.tag){case 0:case 11:case 15:el(a),a.flags&2048&&Aa(9,a,a.return);break;case 3:el(a);break;case 12:el(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,es(a)):el(a);break;default:el(a)}}function es(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];Na=p,Bn(p,a)}Kl(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Aa(8,r,r.return),es(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,es(r));break;default:es(r)}a=a.sibling}}function Bn(a,r){for(;Na!==null;){var c=Na;switch(c.tag){case 0:case 11:case 15:Aa(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var p=c.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Al(c.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,Na=p;else e:for(c=a;Na!==null;){p=Na;var S=p.sibling,N=p.return;if(Cc(p),p===c){Na=null;break e}if(S!==null){S.return=N,Na=S;break e}Na=N}}}var Ci={getCacheForType:function(a){var r=We(ea),c=r.data.get(a);return c===void 0&&(c=a(),r.data.set(a,c)),c},cacheSignal:function(){return We(ea).controller.signal}},it=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,ft=null,ct=0,Rt=0,Ya=null,rr=!1,Nr=!1,Ap=!1,Ls=0,Mn=0,Wr=0,tl=0,jc=0,ts=0,mn=0,Fl=null,Gn=null,Pn=!1,Zo=0,Mp=0,In=1/0,Dn=null,Jn=null,Jt=0,Us=null,Io=null,ir=0,Jo=0,Wo=null,wc=null,nl=0,Zl=null;function Hs(){return(Ye&2)!==0&&ct!==0?ct&-ct:Y.T!==null?pe():Ve()}function xt(){if(ts===0)if((ct&536870912)===0||jt){var a=mr;mr<<=1,(mr&3932160)===0&&(mr=262144),ts=a}else ts=536870912;return a=hs.current,a!==null&&(a.flags|=32),ts}function ht(a,r,c){(a===tt&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)&&(sl(a,0),na(a,ct,ts,!1)),yn(a,c),((Ye&2)===0||a!==tt)&&(a===tt&&((Ye&2)===0&&(tl|=c),Mn===4&&na(a,ct,ts,!1)),Ce(a))}function bt(a,r,c){if((Ye&6)!==0)throw Error(s(327));var p=!c&&(r&127)===0&&(r&a.expiredLanes)===0||Mt(a,r),S=p?Ec(a,r):ns(a,r,!0),N=p;do{if(S===0){Nr&&!p&&na(a,r,0,!1);break}else{if(c=a.current.alternate,N&&!Wt(c)){S=ns(a,r,!1),N=!1;continue}if(S===2){if(N=r,a.errorRecoveryDisabledLanes&N)var M=0;else M=a.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){r=M;e:{var q=a;S=Fl;var K=q.current.memoizedState.isDehydrated;if(K&&(sl(q,M).flags|=256),M=ns(q,M,!1),M!==2){if(Ap&&!K){q.errorRecoveryDisabledLanes|=N,tl|=N,S=4;break e}N=Gn,Gn=S,N!==null&&(Gn===null?Gn=N:Gn.push.apply(Gn,N))}S=M}if(N=!1,S!==2)continue}}if(S===1){sl(a,0),na(a,r,0,!0);break}e:{switch(p=a,N=S,N){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:na(p,r,ts,!rr);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(S=Zo+300-Qn(),10<S)){if(na(p,r,ts,!rr),Qt(p,0,!0)!==0)break e;ir=r,p.timeoutHandle=Gv(Nt.bind(null,p,c,Gn,Dn,Pn,r,ts,tl,mn,rr,N,"Throttled",-0,0),S);break e}Nt(p,c,Gn,Dn,Pn,r,ts,tl,mn,rr,N,null,-0,0)}}break}while(!0);Ce(a)}function Nt(a,r,c,p,S,N,M,q,K,ue,ye,ve,fe,ge){if(a.timeoutHandle=-1,ve=r.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ci},yf(r,N,ve);var qe=(N&62914560)===N?Zo-Qn():(N&4194048)===N?Mp-Qn():0;if(qe=w7(ve,qe),qe!==null){ir=N,a.cancelPendingCommit=qe(wi.bind(null,a,r,N,c,p,S,M,q,K,ye,ve,null,fe,ge)),na(a,N,M,!ue);return}}wi(a,r,N,c,p,S,M,q,K)}function Wt(a){for(var r=a;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var S=c[p],N=S.getSnapshot;S=S.value;try{if(!Fa(N(),S))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function na(a,r,c,p){r&=~jc,r&=~tl,a.suspendedLanes|=r,a.pingedLanes&=~r,p&&(a.warmLanes|=r),p=a.expirationTimes;for(var S=r;0<S;){var N=31-ya(S),M=1<<N;p[N]=-1,S&=~M}c!==0&&la(a,c,r)}function _r(){return(Ye&6)===0?(Le(0),!1):!0}function al(){if(ft!==null){if(Rt===0)var a=ft.return;else a=ft,Pr=Yi=null,tp(a),Ll=null,Ul=0,a=ft;for(;a!==null;)zs(a.alternate,a),a=a.return;ft=null}}function sl(a,r){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,o7(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),ir=0,al(),tt=a,ft=c=cs(a.current,null),ct=r,Rt=0,Ya=null,rr=!1,Nr=Mt(a,r),Ap=!1,mn=ts=jc=tl=Wr=Mn=0,Gn=Fl=null,Pn=!1,(r&8)!==0&&(r|=r&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=r;0<p;){var S=31-ya(p),N=1<<S;r|=a[S],p&=~N}return Ls=r,ic(),c}function $r(a,r){rt=null,Y.H=Xo,r===Ml||r===dt?(r=zl(),Rt=3):r===cc?(r=zl(),Rt=4):Rt=r===sf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ya=r,ft===null&&(Mn=1,af(a,Os(r,a.current)))}function zn(){var a=hs.current;return a===null?!0:(ct&4194048)===ct?Ja===null:(ct&62914560)===ct||(ct&536870912)!==0?a===Ja:!1}function ji(){var a=Y.H;return Y.H=Xo,a===null?Xo:a}function rl(){var a=Y.A;return Y.A=Ci,a}function $o(){Mn=4,rr||(ct&4194048)!==ct&&hs.current!==null||(Nr=!0),(Wr&134217727)===0&&(tl&134217727)===0||tt===null||na(tt,ct,ts,!1)}function ns(a,r,c){var p=Ye;Ye|=2;var S=ji(),N=rl();(tt!==a||ct!==r)&&(Dn=null,sl(a,r)),r=!1;var M=Mn;e:do try{if(Rt!==0&&ft!==null){var q=ft,K=Ya;switch(Rt){case 8:al(),M=6;break e;case 3:case 2:case 9:case 6:hs.current===null&&(r=!0);var ue=Rt;if(Rt=0,Ya=null,Il(a,q,K,ue),c&&Nr){M=0;break e}break;default:ue=Rt,Rt=0,Ya=null,Il(a,q,K,ue)}}eu(),M=Mn;break}catch(ye){$r(a,ye)}while(!0);return r&&a.shellSuspendCounter++,Pr=Yi=null,Ye=p,Y.H=S,Y.A=N,ft===null&&(tt=null,ct=0,ic()),M}function eu(){for(;ft!==null;)xf(ft)}function Ec(a,r){var c=Ye;Ye|=2;var p=ji(),S=rl();tt!==a||ct!==r?(Dn=null,In=Qn()+500,sl(a,r)):Nr=Mt(a,r);e:do try{if(Rt!==0&&ft!==null){r=ft;var N=Ya;t:switch(Rt){case 1:Rt=0,Ya=null,Il(a,r,N,1);break;case 2:case 9:if(fs(N)){Rt=0,Ya=null,Tc(r);break}r=function(){Rt!==2&&Rt!==9||tt!==a||(Rt=7),Ce(a)},N.then(r,r);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:fs(N)?(Rt=0,Ya=null,Tc(r)):(Rt=0,Ya=null,Il(a,r,N,7));break;case 5:var M=null;switch(ft.tag){case 26:M=ft.memoizedState;case 5:case 27:var q=ft;if(M?n2(M):q.stateNode.complete){Rt=0,Ya=null;var K=q.sibling;if(K!==null)ft=K;else{var ue=q.return;ue!==null?(ft=ue,il(ue)):ft=null}break t}}Rt=0,Ya=null,Il(a,r,N,5);break;case 6:Rt=0,Ya=null,Il(a,r,N,6);break;case 8:al(),Mn=6;break e;default:throw Error(s(462))}}xs();break}catch(ye){$r(a,ye)}while(!0);return Pr=Yi=null,Y.H=p,Y.A=S,Ye=c,ft!==null?0:(tt=null,ct=0,ic(),Mn)}function xs(){for(;ft!==null&&!hn();)xf(ft)}function xf(a){var r=hf(a.alternate,a,Ls);a.memoizedProps=a.pendingProps,r===null?il(a):ft=r}function Tc(a){var r=a,c=r.alternate;switch(r.tag){case 15:case 0:r=bc(c,r,r.pendingProps,r.type,void 0,ct);break;case 11:r=bc(c,r,r.pendingProps,r.type.render,r.ref,ct);break;case 5:tp(r);default:zs(c,r),r=ft=Mo(r,Ls),r=hf(c,r,Ls)}a.memoizedProps=a.pendingProps,r===null?il(a):ft=r}function Il(a,r,c,p){Pr=Yi=null,tp(r),Ll=null,Ul=0;var S=r.return;try{if(ua(a,S,r,c,ct)){Mn=1,af(a,Os(c,a.current)),ft=null;return}}catch(N){if(S!==null)throw ft=S,N;Mn=1,af(a,Os(c,a.current)),ft=null;return}r.flags&32768?(jt||p===1?a=!0:Nr||(ct&536870912)!==0?a=!1:(rr=a=!0,(p===2||p===9||p===3||p===6)&&(p=hs.current,p!==null&&p.tag===13&&(p.flags|=16384))),Rc(r,a)):il(r)}function il(a){var r=a;do{if((r.flags&32768)!==0){Rc(r,rr);return}a=r.return;var c=Nc(r.alternate,r,Ls);if(c!==null){ft=c;return}if(r=r.sibling,r!==null){ft=r;return}ft=r=a}while(r!==null);Mn===0&&(Mn=5)}function Rc(a,r){do{var c=$s(a.alternate,a);if(c!==null){c.flags&=32767,ft=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(a=a.sibling,a!==null)){ft=a;return}ft=a=c}while(a!==null);Mn=6,ft=null}function wi(a,r,c,p,S,N,M,q,K){a.cancelPendingCommit=null;do tu();while(Jt!==0);if((Ye&6)!==0)throw Error(s(327));if(r!==null){if(r===a.current)throw Error(s(177));if(N=r.lanes|r.childLanes,N|=xa,Ra(a,c,N,M,q,K),a===tt&&(ft=tt=null,ct=0),Io=r,Us=a,ir=c,Jo=N,Wo=S,wc=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,C(ia,function(){return bf(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=Y.T,Y.T=null,S=$.p,$.p=2,M=Ye,Ye|=4;try{gy(a,r,c)}finally{Ye=M,$.p=S,Y.T=p}}Jt=1,aa(),Ei(),Jl()}}function aa(){if(Jt===1){Jt=0;var a=Us,r=Io,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=Y.T,Y.T=null;var p=$.p;$.p=2;var S=Ye;Ye|=4;try{Wi(r,a);var N=_y,M=Sg(a.containerInfo),q=N.focusedElem,K=N.selectionRange;if(M!==q&&q&&q.ownerDocument&&ln(q.ownerDocument.documentElement,q)){if(K!==null&&Uh(q)){var ue=K.start,ye=K.end;if(ye===void 0&&(ye=ue),"selectionStart"in q)q.selectionStart=ue,q.selectionEnd=Math.min(ye,q.value.length);else{var ve=q.ownerDocument||document,fe=ve&&ve.defaultView||window;if(fe.getSelection){var ge=fe.getSelection(),qe=q.textContent.length,Ie=Math.min(K.start,qe),dn=K.end===void 0?Ie:Math.min(K.end,qe);!ge.extend&&Ie>dn&&(M=dn,dn=Ie,Ie=M);var te=Ro(q,Ie),I=Ro(q,dn);if(te&&I&&(ge.rangeCount!==1||ge.anchorNode!==te.node||ge.anchorOffset!==te.offset||ge.focusNode!==I.node||ge.focusOffset!==I.offset)){var le=ve.createRange();le.setStart(te.node,te.offset),ge.removeAllRanges(),Ie>dn?(ge.addRange(le),ge.extend(I.node,I.offset)):(le.setEnd(I.node,I.offset),ge.addRange(le))}}}}for(ve=[],ge=q;ge=ge.parentNode;)ge.nodeType===1&&ve.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<ve.length;q++){var be=ve[q];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}R0=!!Ny,_y=Ny=null}finally{Ye=S,$.p=p,Y.T=c}}a.current=r,Jt=2}}function Ei(){if(Jt===2){Jt=0;var a=Us,r=Io,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=Y.T,Y.T=null;var p=$.p;$.p=2;var S=Ye;Ye|=4;try{Nn(a,r.alternate,r)}finally{Ye=S,$.p=p,Y.T=c}}Jt=3}}function Jl(){if(Jt===4||Jt===3){Jt=0,Zt();var a=Us,r=Io,c=ir,p=wc;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Jt=5:(Jt=0,Io=Us=null,ei(a,a.pendingLanes));var S=a.pendingLanes;if(S===0&&(Jn=null),et(c),r=r.stateNode,$n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(Bs,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=Y.T,S=$.p,$.p=2,Y.T=null;try{for(var N=a.onRecoverableError,M=0;M<p.length;M++){var q=p[M];N(q.value,{componentStack:q.stack})}}finally{Y.T=r,$.p=S}}(ir&3)!==0&&tu(),Ce(a),S=a.pendingLanes,(c&261930)!==0&&(S&42)!==0?a===Zl?nl++:(nl=0,Zl=a):nl=0,Le(0)}}function ei(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Al(r)))}function tu(){return aa(),Ei(),Jl(),bf()}function bf(){if(Jt!==5)return!1;var a=Us,r=Jo;Jo=0;var c=et(ir),p=Y.T,S=$.p;try{$.p=32>c?32:c,Y.T=null,c=Wo,Wo=null;var N=Us,M=ir;if(Jt=0,Io=Us=null,ir=0,(Ye&6)!==0)throw Error(s(331));var q=Ye;if(Ye|=4,ys(N.current),Op(N,N.current,M,c),Ye=q,Le(0,!1),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(Bs,N)}catch{}return!0}finally{$.p=S,Y.T=p,ei(a,r)}}function Dp(a,r,c){r=Os(c,r),r=_p(a.stateNode,r,2),a=Xi(a,r,2),a!==null&&(yn(a,2),Ce(a))}function Ut(a,r,c){if(a.tag===3)Dp(a,a,c);else for(;r!==null;){if(r.tag===3){Dp(r,a,c);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Jn===null||!Jn.has(p))){a=Os(c,a),c=Cp(2),p=Xi(r,c,2),p!==null&&(p0(c,p,r,a),yn(p,2),Ce(p));break}}r=r.return}}function Oc(a,r,c){var p=a.pingCache;if(p===null){p=a.pingCache=new it;var S=new Set;p.set(r,S)}else S=p.get(r),S===void 0&&(S=new Set,p.set(r,S));S.has(c)||(Ap=!0,S.add(c),a=l.bind(null,a,r,c),r.then(a,a))}function l(a,r,c){var p=a.pingCache;p!==null&&p.delete(r),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,tt===a&&(ct&c)===c&&(Mn===4||Mn===3&&(ct&62914560)===ct&&300>Qn()-Zo?(Ye&2)===0&&sl(a,0):jc|=c,mn===ct&&(mn=0)),Ce(a)}function u(a,r){r===0&&(r=rn()),a=Za(a,r),a!==null&&(yn(a,r),Ce(a))}function g(a){var r=a.memoizedState,c=0;r!==null&&(c=r.retryLane),u(a,c)}function x(a,r){var c=0;switch(a.tag){case 31:case 13:var p=a.stateNode,S=a.memoizedState;S!==null&&(c=S.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(r),u(a,c)}function C(a,r){return Et(a,r)}var E=null,U=null,F=!1,me=!1,Se=!1,Re=0;function Ce(a){a!==U&&a.next===null&&(U===null?E=U=a:U=U.next=a),me=!0,F||(F=!0,se())}function Le(a,r){if(!Se&&me){Se=!0;do for(var c=!1,p=E;p!==null;){if(a!==0){var S=p.pendingLanes;if(S===0)var N=0;else{var M=p.suspendedLanes,q=p.pingedLanes;N=(1<<31-ya(42|a)+1)-1,N&=S&~(M&~q),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(c=!0,de(p,N))}else N=ct,N=Qt(p,p===tt?N:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(N&3)===0||Mt(p,N)||(c=!0,de(p,N));p=p.next}while(c);Se=!1}}function st(){_a()}function _a(){me=F=!1;var a=0;Re!==0&&l7()&&(a=Re);for(var r=Qn(),c=null,p=E;p!==null;){var S=p.next,N=nu(p,r);N===0?(p.next=null,c===null?E=S:c.next=S,S===null&&(U=c)):(c=p,(a!==0||(N&3)!==0)&&(me=!0)),p=S}Jt!==0&&Jt!==5||Le(a),Re!==0&&(Re=0)}function nu(a,r){for(var c=a.suspendedLanes,p=a.pingedLanes,S=a.expirationTimes,N=a.pendingLanes&-62914561;0<N;){var M=31-ya(N),q=1<<M,K=S[M];K===-1?((q&c)===0||(q&p)!==0)&&(S[M]=Hn(q,r)):K<=r&&(a.expiredLanes|=q),N&=~q}if(r=tt,c=ct,c=Qt(a,a===r?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,c===0||a===r&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Un(p),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Mt(a,c)){if(r=c&-c,r===a.callbackPriority)return r;switch(p!==null&&Un(p),et(c)){case 2:case 8:c=Qa;break;case 32:c=ia;break;case 268435456:c=is;break;default:c=ia}return p=ll.bind(null,a),c=Et(c,p),a.callbackPriority=r,a.callbackNode=c,r}return p!==null&&p!==null&&Un(p),a.callbackPriority=2,a.callbackNode=null,2}function ll(a,r){if(Jt!==0&&Jt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(tu()&&a.callbackNode!==c)return null;var p=ct;return p=Qt(a,a===tt?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(bt(a,p,r),nu(a,Qn()),a.callbackNode!=null&&a.callbackNode===c?ll.bind(null,a):null)}function de(a,r){if(tu())return null;bt(a,r,!0)}function se(){u7(function(){(Ye&6)!==0?Et(hr,st):_a()})}function pe(){if(Re===0){var a=gi;a===0&&(a=Cs,Cs<<=1,(Cs&261888)===0&&(Cs=256)),Re=a}return Re}function Ee(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Xu(""+a)}function Ke(a,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,a.id&&c.setAttribute("form",a.id),r.parentNode.insertBefore(c,r),a=new FormData(a),c.parentNode.removeChild(c),a}function kn(a,r,c,p,S){if(r==="submit"&&c&&c.stateNode===S){var N=Ee((S[ut]||null).action),M=p.submitter;M&&(r=(r=M[ut]||null)?Ee(r.formAction):M.getAttribute("formAction"),r!==null&&(N=r,M=null));var q=new Zu("action","action",null,p,S);a.push({event:q,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Re!==0){var K=M?Ke(S,M):new FormData(S);mp(c,{pending:!0,data:K,method:S.method,action:N},null,K)}}else typeof N=="function"&&(q.preventDefault(),K=M?Ke(S,M):new FormData(S),mp(c,{pending:!0,data:K,method:S.method,action:N},N,K))},currentTarget:S}]})}}for(var Ze=0;Ze<sc.length;Ze++){var Dt=sc[Ze],Ca=Dt.toLowerCase(),Bt=Dt[0].toUpperCase()+Dt.slice(1);Xs(Ca,"on"+Bt)}Xs(Ad,"onAnimationEnd"),Xs(ac,"onAnimationIteration"),Xs(qh,"onAnimationStart"),Xs("dblclick","onDoubleClick"),Xs("focusin","onFocus"),Xs("focusout","onBlur"),Xs(_g,"onTransitionRun"),Xs(oy,"onTransitionStart"),Xs(Cg,"onTransitionCancel"),Xs(Bh,"onTransitionEnd"),Es("onMouseEnter",["mouseout","mouseover"]),Es("onMouseLeave",["mouseout","mouseover"]),Es("onPointerEnter",["pointerout","pointerover"]),Es("onPointerLeave",["pointerout","pointerover"]),Di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Di("onBeforeInput",["compositionend","keypress","textInput","paste"]),Di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),yy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lr));function Dv(a,r){r=(r&4)!==0;for(var c=0;c<a.length;c++){var p=a[c],S=p.event;p=p.listeners;e:{var N=void 0;if(r)for(var M=p.length-1;0<=M;M--){var q=p[M],K=q.instance,ue=q.currentTarget;if(q=q.listener,K!==N&&S.isPropagationStopped())break e;N=q,S.currentTarget=ue;try{N(S)}catch(ye){rc(ye)}S.currentTarget=null,N=K}else for(M=0;M<p.length;M++){if(q=p[M],K=q.instance,ue=q.currentTarget,q=q.listener,K!==N&&S.isPropagationStopped())break e;N=q,S.currentTarget=ue;try{N(S)}catch(ye){rc(ye)}S.currentTarget=null,N=K}}}}function Ot(a,r){var c=r[Tt];c===void 0&&(c=r[Tt]=new Set);var p=a+"__bubble";c.has(p)||(zv(r,a,2,!1),c.add(p))}function xy(a,r,c){var p=0;r&&(p|=4),zv(c,a,p,r)}var v0="_reactListening"+Math.random().toString(36).slice(2);function by(a){if(!a[v0]){a[v0]=!0,ws.forEach(function(c){c!=="selectionchange"&&(yy.has(c)||xy(c,!1,a),xy(c,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[v0]||(r[v0]=!0,xy("selectionchange",!1,r))}}function zv(a,r,c,p){switch(u2(r)){case 2:var S=R7;break;case 8:S=O7;break;default:S=zy}c=S.bind(null,r,c,a),S=void 0,!Sh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),p?S!==void 0?a.addEventListener(r,c,{capture:!0,passive:S}):a.addEventListener(r,c,!0):S!==void 0?a.addEventListener(r,c,{passive:S}):a.addEventListener(r,c,!1)}function vy(a,r,c,p,S){var N=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var M=p.tag;if(M===3||M===4){var q=p.stateNode.containerInfo;if(q===S)break;if(M===4)for(M=p.return;M!==null;){var K=M.tag;if((K===3||K===4)&&M.stateNode.containerInfo===S)return;M=M.return}for(;q!==null;){if(M=Pt(q),M===null)return;if(K=M.tag,K===5||K===6||K===26||K===27){p=N=M;continue e}q=q.parentNode}}p=p.return}vh(function(){var ue=N,ye=xd(c),ve=[];e:{var fe=Qs.get(a);if(fe!==void 0){var ge=Zu,qe=a;switch(a){case"keypress":if(Fu(c)===0)break e;case"keydown":case"keyup":ge=wl;break;case"focusin":qe="focus",ge=Nd;break;case"focusout":qe="blur",ge=Nd;break;case"beforeblur":case"afterblur":ge=Nd;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Nh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=ag;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=ug;break;case Ad:case ac:case qh:ge=ry;break;case Bh:ge=ly;break;case"scroll":case"scrollend":ge=tg;break;case"wheel":ge=dg;break;case"copy":case"cut":case"paste":ge=rg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=jh;break;case"toggle":case"beforetoggle":ge=hg}var Ie=(r&4)!==0,dn=!Ie&&(a==="scroll"||a==="scrollend"),te=Ie?fe!==null?fe+"Capture":null:fe;Ie=[];for(var I=ue,le;I!==null;){var be=I;if(le=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||le===null||te===null||(be=vo(I,te),be!=null&&Ie.push(zp(I,be,le))),dn)break;I=I.return}0<Ie.length&&(fe=new ge(fe,qe,null,c,ye),ve.push({event:fe,listeners:Ie}))}}if((r&7)===0){e:{if(fe=a==="mouseover"||a==="pointerover",ge=a==="mouseout"||a==="pointerout",fe&&c!==yd&&(qe=c.relatedTarget||c.fromElement)&&(Pt(qe)||qe[an]))break e;if((ge||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,ge?(qe=c.relatedTarget||c.toElement,ge=ue,qe=qe?Pt(qe):null,qe!==null&&(dn=o(qe),Ie=qe.tag,qe!==dn||Ie!==5&&Ie!==27&&Ie!==6)&&(qe=null)):(ge=null,qe=ue),ge!==qe)){if(Ie=Nh,be="onMouseLeave",te="onMouseEnter",I="mouse",(a==="pointerout"||a==="pointerover")&&(Ie=jh,be="onPointerLeave",te="onPointerEnter",I="pointer"),dn=ge==null?fe:yr(ge),le=qe==null?fe:yr(qe),fe=new Ie(be,I+"leave",ge,c,ye),fe.target=dn,fe.relatedTarget=le,be=null,Pt(ye)===ue&&(Ie=new Ie(te,I+"enter",qe,c,ye),Ie.target=le,Ie.relatedTarget=dn,be=Ie),dn=be,ge&&qe)t:{for(Ie=n7,te=ge,I=qe,le=0,be=te;be;be=Ie(be))le++;be=0;for(var Xe=I;Xe;Xe=Ie(Xe))be++;for(;0<le-be;)te=Ie(te),le--;for(;0<be-le;)I=Ie(I),be--;for(;le--;){if(te===I||I!==null&&te===I.alternate){Ie=te;break t}te=Ie(te),I=Ie(I)}Ie=null}else Ie=null;ge!==null&&kv(ve,fe,ge,Ie,!1),qe!==null&&dn!==null&&kv(ve,dn,qe,Ie,!0)}}e:{if(fe=ue?yr(ue):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var Xt=Mh;else if(Ah(fe))if(zr)Xt=vg;else{Xt=kh;var Pe=xg}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&gd(ue.elementType)&&(Xt=Mh):Xt=bg;if(Xt&&(Xt=Xt(a,ue))){Rd(ve,Xt,c,ye);break e}Pe&&Pe(a,fe,ue),a==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&xr(fe,"number",fe.value)}switch(Pe=ue?yr(ue):window,a){case"focusin":(Ah(Pe)||Pe.contentEditable==="true")&&(kr=Pe,Lr=ue,Oo=null);break;case"focusout":Oo=Lr=kr=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,Ao(ve,c,ye);break;case"selectionchange":if(Ng)break;case"keydown":case"keyup":Ao(ve,c,ye)}var mt;if(El)e:{switch(a){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else Tl?Td(a,c)&&(zt="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(zt="onCompositionStart");zt&&(Eh&&c.locale!=="ko"&&(Tl||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Tl&&(mt=Ku()):(Rs=ye,vd="value"in Rs?Rs.value:Rs.textContent,Tl=!0)),Pe=S0(ue,zt),0<Pe.length&&(zt=new _d(zt,a,null,c,ye),ve.push({event:zt,listeners:Pe}),mt?zt.data=mt:(mt=Th(c),mt!==null&&(zt.data=mt)))),(mt=Ed?gg(a,c):Rh(a,c))&&(zt=S0(ue,"onBeforeInput"),0<zt.length&&(Pe=new _d("onBeforeInput","beforeinput",null,c,ye),ve.push({event:Pe,listeners:zt}),Pe.data=mt)),kn(ve,a,ue,c,ye)}Dv(ve,r)})}function zp(a,r,c){return{instance:a,listener:r,currentTarget:c}}function S0(a,r){for(var c=r+"Capture",p=[];a!==null;){var S=a,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=vo(a,c),S!=null&&p.unshift(zp(a,S,N)),S=vo(a,r),S!=null&&p.push(zp(a,S,N))),a.tag===3)return p;a=a.return}return[]}function n7(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function kv(a,r,c,p,S){for(var N=r._reactName,M=[];c!==null&&c!==p;){var q=c,K=q.alternate,ue=q.stateNode;if(q=q.tag,K!==null&&K===p)break;q!==5&&q!==26&&q!==27||ue===null||(K=ue,S?(ue=vo(c,N),ue!=null&&M.unshift(zp(c,ue,K))):S||(ue=vo(c,N),ue!=null&&M.push(zp(c,ue,K)))),c=c.return}M.length!==0&&a.push({event:r,listeners:M})}var a7=/\r\n?/g,s7=/\u0000|\uFFFD/g;function Lv(a){return(typeof a=="string"?a:""+a).replace(a7,`
49
+ `).replace(s7,"")}function Uv(a,r){return r=Lv(r),Lv(a)===r}function cn(a,r,c,p,S,N){switch(c){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||_l(a,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&_l(a,""+p);break;case"className":Vu(a,"class",p);break;case"tabIndex":Vu(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Vu(a,c,p);break;case"style":yh(a,p,N);break;case"data":if(r!=="object"){Vu(a,"data",p);break}case"src":case"href":if(p===""&&(r!=="a"||c!=="href")){a.removeAttribute(c);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(c);break}p=Xu(""+p),a.setAttribute(c,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof N=="function"&&(c==="formAction"?(r!=="input"&&cn(a,r,"name",S.name,S,null),cn(a,r,"formEncType",S.formEncType,S,null),cn(a,r,"formMethod",S.formMethod,S,null),cn(a,r,"formTarget",S.formTarget,S,null)):(cn(a,r,"encType",S.encType,S,null),cn(a,r,"method",S.method,S,null),cn(a,r,"target",S.target,S,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(c);break}p=Xu(""+p),a.setAttribute(c,p);break;case"onClick":p!=null&&(a.onclick=ci);break;case"onScroll":p!=null&&Ot("scroll",a);break;case"onScrollEnd":p!=null&&Ot("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(c=p.__html,c!=null){if(S.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}c=Xu(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,""+p):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":p===!0?a.setAttribute(c,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,p):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(c,p):a.removeAttribute(c);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(c):a.setAttribute(c,p);break;case"popover":Ot("beforetoggle",a),Ot("toggle",a),xo(a,"popover",p);break;case"xlinkActuate":Mr(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Mr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Mr(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Mr(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Mr(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Mr(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":xo(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=$m.get(c)||c,xo(a,c,p))}}function Sy(a,r,c,p,S,N){switch(c){case"style":yh(a,p,N);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(c=p.__html,c!=null){if(S.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"children":typeof p=="string"?_l(a,p):(typeof p=="number"||typeof p=="bigint")&&_l(a,""+p);break;case"onScroll":p!=null&&Ot("scroll",a);break;case"onScrollEnd":p!=null&&Ot("scrollend",a);break;case"onClick":p!=null&&(a.onclick=ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cd.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(S=c.endsWith("Capture"),r=c.slice(2,S?c.length-7:void 0),N=a[ut]||null,N=N!=null?N[c]:null,typeof N=="function"&&a.removeEventListener(r,N,S),typeof p=="function")){typeof N!="function"&&N!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(r,p,S);break e}c in a?a[c]=p:p===!0?a.setAttribute(c,""):xo(a,c,p)}}}function as(a,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ot("error",a),Ot("load",a);var p=!1,S=!1,N;for(N in c)if(c.hasOwnProperty(N)){var M=c[N];if(M!=null)switch(N){case"src":p=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:cn(a,r,N,M,c,null)}}S&&cn(a,r,"srcSet",c.srcSet,c,null),p&&cn(a,r,"src",c.src,c,null);return;case"input":Ot("invalid",a);var q=N=M=S=null,K=null,ue=null;for(p in c)if(c.hasOwnProperty(p)){var ye=c[p];if(ye!=null)switch(p){case"name":S=ye;break;case"type":M=ye;break;case"checked":K=ye;break;case"defaultChecked":ue=ye;break;case"value":N=ye;break;case"defaultValue":q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,r));break;default:cn(a,r,p,ye,c,null)}}hd(a,N,q,K,ue,M,S,!1);return;case"select":Ot("invalid",a),p=M=N=null;for(S in c)if(c.hasOwnProperty(S)&&(q=c[S],q!=null))switch(S){case"value":N=q;break;case"defaultValue":M=q;break;case"multiple":p=q;default:cn(a,r,S,q,c,null)}r=N,c=M,a.multiple=!!p,r!=null?ui(a,!!p,r,!1):c!=null&&ui(a,!!p,c,!0);return;case"textarea":Ot("invalid",a),N=S=p=null;for(M in c)if(c.hasOwnProperty(M)&&(q=c[M],q!=null))switch(M){case"value":p=q;break;case"defaultValue":S=q;break;case"children":N=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:cn(a,r,M,q,c,null)}md(a,p,S,N);return;case"option":for(K in c)if(c.hasOwnProperty(K)&&(p=c[K],p!=null))switch(K){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:cn(a,r,K,p,c,null)}return;case"dialog":Ot("beforetoggle",a),Ot("toggle",a),Ot("cancel",a),Ot("close",a);break;case"iframe":case"object":Ot("load",a);break;case"video":case"audio":for(p=0;p<lr.length;p++)Ot(lr[p],a);break;case"image":Ot("error",a),Ot("load",a);break;case"details":Ot("toggle",a);break;case"embed":case"source":case"link":Ot("error",a),Ot("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in c)if(c.hasOwnProperty(ue)&&(p=c[ue],p!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:cn(a,r,ue,p,c,null)}return;default:if(gd(r)){for(ye in c)c.hasOwnProperty(ye)&&(p=c[ye],p!==void 0&&Sy(a,r,ye,p,c,void 0));return}}for(q in c)c.hasOwnProperty(q)&&(p=c[q],p!=null&&cn(a,r,q,p,c,null))}function r7(a,r,c,p){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,N=null,M=null,q=null,K=null,ue=null,ye=null;for(ge in c){var ve=c[ge];if(c.hasOwnProperty(ge)&&ve!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":K=ve;default:p.hasOwnProperty(ge)||cn(a,r,ge,null,p,ve)}}for(var fe in p){var ge=p[fe];if(ve=c[fe],p.hasOwnProperty(fe)&&(ge!=null||ve!=null))switch(fe){case"type":N=ge;break;case"name":S=ge;break;case"checked":ue=ge;break;case"defaultChecked":ye=ge;break;case"value":M=ge;break;case"defaultValue":q=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(s(137,r));break;default:ge!==ve&&cn(a,r,fe,ge,p,ve)}}bo(a,M,q,K,ue,ye,N,S);return;case"select":ge=M=q=fe=null;for(N in c)if(K=c[N],c.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":ge=K;default:p.hasOwnProperty(N)||cn(a,r,N,null,p,K)}for(S in p)if(N=p[S],K=c[S],p.hasOwnProperty(S)&&(N!=null||K!=null))switch(S){case"value":fe=N;break;case"defaultValue":q=N;break;case"multiple":M=N;default:N!==K&&cn(a,r,S,N,p,K)}r=q,c=M,p=ge,fe!=null?ui(a,!!c,fe,!1):!!p!=!!c&&(r!=null?ui(a,!!c,r,!0):ui(a,!!c,c?[]:"",!1));return;case"textarea":ge=fe=null;for(q in c)if(S=c[q],c.hasOwnProperty(q)&&S!=null&&!p.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:cn(a,r,q,null,p,S)}for(M in p)if(S=p[M],N=c[M],p.hasOwnProperty(M)&&(S!=null||N!=null))switch(M){case"value":fe=S;break;case"defaultValue":ge=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:S!==N&&cn(a,r,M,S,p,N)}pd(a,fe,ge);return;case"option":for(var qe in c)if(fe=c[qe],c.hasOwnProperty(qe)&&fe!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":a.selected=!1;break;default:cn(a,r,qe,null,p,fe)}for(K in p)if(fe=p[K],ge=c[K],p.hasOwnProperty(K)&&fe!==ge&&(fe!=null||ge!=null))switch(K){case"selected":a.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:cn(a,r,K,fe,p,ge)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in c)fe=c[Ie],c.hasOwnProperty(Ie)&&fe!=null&&!p.hasOwnProperty(Ie)&&cn(a,r,Ie,null,p,fe);for(ue in p)if(fe=p[ue],ge=c[ue],p.hasOwnProperty(ue)&&fe!==ge&&(fe!=null||ge!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:cn(a,r,ue,fe,p,ge)}return;default:if(gd(r)){for(var dn in c)fe=c[dn],c.hasOwnProperty(dn)&&fe!==void 0&&!p.hasOwnProperty(dn)&&Sy(a,r,dn,void 0,p,fe);for(ye in p)fe=p[ye],ge=c[ye],!p.hasOwnProperty(ye)||fe===ge||fe===void 0&&ge===void 0||Sy(a,r,ye,fe,p,ge);return}}for(var te in c)fe=c[te],c.hasOwnProperty(te)&&fe!=null&&!p.hasOwnProperty(te)&&cn(a,r,te,null,p,fe);for(ve in p)fe=p[ve],ge=c[ve],!p.hasOwnProperty(ve)||fe===ge||fe==null&&ge==null||cn(a,r,ve,fe,p,ge)}function Hv(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i7(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,c=performance.getEntriesByType("resource"),p=0;p<c.length;p++){var S=c[p],N=S.transferSize,M=S.initiatorType,q=S.duration;if(N&&q&&Hv(M)){for(M=0,q=S.responseEnd,p+=1;p<c.length;p++){var K=c[p],ue=K.startTime;if(ue>q)break;var ye=K.transferSize,ve=K.initiatorType;ye&&Hv(ve)&&(K=K.responseEnd,M+=ye*(K<q?1:(q-ue)/(K-ue)))}if(--p,r+=8*(N+M)/(S.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Ny=null,_y=null;function N0(a){return a.nodeType===9?a:a.ownerDocument}function qv(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bv(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Cy(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var jy=null;function l7(){var a=window.event;return a&&a.type==="popstate"?a===jy?!1:(jy=a,!0):(jy=null,!1)}var Gv=typeof setTimeout=="function"?setTimeout:void 0,o7=typeof clearTimeout=="function"?clearTimeout:void 0,Pv=typeof Promise=="function"?Promise:void 0,u7=typeof queueMicrotask=="function"?queueMicrotask:typeof Pv<"u"?function(a){return Pv.resolve(null).then(a).catch(c7)}:Gv;function c7(a){setTimeout(function(){throw a})}function au(a){return a==="head"}function Yv(a,r){var c=r,p=0;do{var S=c.nextSibling;if(a.removeChild(c),S&&S.nodeType===8)if(c=S.data,c==="/$"||c==="/&"){if(p===0){a.removeChild(S),_f(r);return}p--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")p++;else if(c==="html")kp(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,kp(c);for(var N=c.firstChild;N;){var M=N.nextSibling,q=N.nodeName;N[Xa]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&N.rel.toLowerCase()==="stylesheet"||c.removeChild(N),N=M}}else c==="body"&&kp(a.ownerDocument.body);c=S}while(c);_f(r)}function Vv(a,r){var c=a;a=0;do{var p=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),p&&p.nodeType===8)if(c=p.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=p}while(c)}function wy(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":wy(c),Ps(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function d7(a,r,c,p){for(;a.nodeType===1;){var S=c;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){if(!a[Xa])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(N=a.getAttribute("rel"),N==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(N!==S.rel||a.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||a.getAttribute("title")!==(S.title==null?null:S.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(N=a.getAttribute("src"),(N!==(S.src==null?null:S.src)||a.getAttribute("type")!==(S.type==null?null:S.type)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&a.getAttribute("name")===N)return a}else return a;if(a=ti(a.nextSibling),a===null)break}return null}function f7(a,r,c){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=ti(a.nextSibling),a===null))return null;return a}function Qv(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=ti(a.nextSibling),a===null))return null;return a}function Ey(a){return a.data==="$?"||a.data==="$~"}function Ty(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function h7(a,r){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||c.readyState!=="loading")r();else{var p=function(){r(),c.removeEventListener("DOMContentLoaded",p)};c.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function ti(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var Ry=null;function Xv(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(r===0)return ti(a.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}a=a.nextSibling}return null}function Kv(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return a;r--}else c!=="/$"&&c!=="/&"||r++}a=a.previousSibling}return null}function Fv(a,r,c){switch(r=N0(c),a){case"html":if(a=r.documentElement,!a)throw Error(s(452));return a;case"head":if(a=r.head,!a)throw Error(s(453));return a;case"body":if(a=r.body,!a)throw Error(s(454));return a;default:throw Error(s(451))}}function kp(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Ps(a)}var ni=new Map,Zv=new Set;function _0(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Wl=$.d;$.d={f:p7,r:m7,D:g7,C:y7,L:x7,m:b7,X:S7,S:v7,M:N7};function p7(){var a=Wl.f(),r=_r();return a||r}function m7(a){var r=gr(a);r!==null&&r.tag===5&&r.type==="form"?r0(r):Wl.r(a)}var vf=typeof document>"u"?null:document;function Iv(a,r,c){var p=vf;if(p&&typeof r=="string"&&r){var S=qa(r);S='link[rel="'+a+'"][href="'+S+'"]',typeof c=="string"&&(S+='[crossorigin="'+c+'"]'),Zv.has(S)||(Zv.add(S),a={rel:a,crossOrigin:c,href:r},p.querySelector(S)===null&&(r=p.createElement("link"),as(r,"link",a),En(r),p.head.appendChild(r)))}}function g7(a){Wl.D(a),Iv("dns-prefetch",a,null)}function y7(a,r){Wl.C(a,r),Iv("preconnect",a,r)}function x7(a,r,c){Wl.L(a,r,c);var p=vf;if(p&&a&&r){var S='link[rel="preload"][as="'+qa(r)+'"]';r==="image"&&c&&c.imageSrcSet?(S+='[imagesrcset="'+qa(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(S+='[imagesizes="'+qa(c.imageSizes)+'"]')):S+='[href="'+qa(a)+'"]';var N=S;switch(r){case"style":N=Sf(a);break;case"script":N=Nf(a)}ni.has(N)||(a=b({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:a,as:r},c),ni.set(N,a),p.querySelector(S)!==null||r==="style"&&p.querySelector(Lp(N))||r==="script"&&p.querySelector(Up(N))||(r=p.createElement("link"),as(r,"link",a),En(r),p.head.appendChild(r)))}}function b7(a,r){Wl.m(a,r);var c=vf;if(c&&a){var p=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+qa(p)+'"][href="'+qa(a)+'"]',N=S;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Nf(a)}if(!ni.has(N)&&(a=b({rel:"modulepreload",href:a},r),ni.set(N,a),c.querySelector(S)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Up(N)))return}p=c.createElement("link"),as(p,"link",a),En(p),c.head.appendChild(p)}}}function v7(a,r,c){Wl.S(a,r,c);var p=vf;if(p&&a){var S=js(p).hoistableStyles,N=Sf(a);r=r||"default";var M=S.get(N);if(!M){var q={loading:0,preload:null};if(M=p.querySelector(Lp(N)))q.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":r},c),(c=ni.get(N))&&Oy(a,c);var K=M=p.createElement("link");En(K),as(K,"link",a),K._p=new Promise(function(ue,ye){K.onload=ue,K.onerror=ye}),K.addEventListener("load",function(){q.loading|=1}),K.addEventListener("error",function(){q.loading|=2}),q.loading|=4,C0(M,r,p)}M={type:"stylesheet",instance:M,count:1,state:q},S.set(N,M)}}}function S7(a,r){Wl.X(a,r);var c=vf;if(c&&a){var p=js(c).hoistableScripts,S=Nf(a),N=p.get(S);N||(N=c.querySelector(Up(S)),N||(a=b({src:a,async:!0},r),(r=ni.get(S))&&Ay(a,r),N=c.createElement("script"),En(N),as(N,"link",a),c.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},p.set(S,N))}}function N7(a,r){Wl.M(a,r);var c=vf;if(c&&a){var p=js(c).hoistableScripts,S=Nf(a),N=p.get(S);N||(N=c.querySelector(Up(S)),N||(a=b({src:a,async:!0,type:"module"},r),(r=ni.get(S))&&Ay(a,r),N=c.createElement("script"),En(N),as(N,"link",a),c.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},p.set(S,N))}}function Jv(a,r,c,p){var S=(S=je.current)?_0(S):null;if(!S)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Sf(c.href),c=js(S).hoistableStyles,p=c.get(r),p||(p={type:"style",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Sf(c.href);var N=js(S).hoistableStyles,M=N.get(a);if(M||(S=S.ownerDocument||S,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(a,M),(N=S.querySelector(Lp(a)))&&!N._p&&(M.instance=N,M.state.loading=5),ni.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ni.set(a,c),N||_7(S,a,c,M.state))),r&&p===null)throw Error(s(528,""));return M}if(r&&p!==null)throw Error(s(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Nf(c),c=js(S).hoistableScripts,p=c.get(r),p||(p={type:"script",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function Sf(a){return'href="'+qa(a)+'"'}function Lp(a){return'link[rel="stylesheet"]['+a+"]"}function Wv(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function _7(a,r,c,p){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?p.loading=1:(r=a.createElement("link"),p.preload=r,r.addEventListener("load",function(){return p.loading|=1}),r.addEventListener("error",function(){return p.loading|=2}),as(r,"link",c),En(r),a.head.appendChild(r))}function Nf(a){return'[src="'+qa(a)+'"]'}function Up(a){return"script[async]"+a}function $v(a,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var p=a.querySelector('style[data-href~="'+qa(c.href)+'"]');if(p)return r.instance=p,En(p),p;var S=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),En(p),as(p,"style",S),C0(p,c.precedence,a),r.instance=p;case"stylesheet":S=Sf(c.href);var N=a.querySelector(Lp(S));if(N)return r.state.loading|=4,r.instance=N,En(N),N;p=Wv(c),(S=ni.get(S))&&Oy(p,S),N=(a.ownerDocument||a).createElement("link"),En(N);var M=N;return M._p=new Promise(function(q,K){M.onload=q,M.onerror=K}),as(N,"link",p),r.state.loading|=4,C0(N,c.precedence,a),r.instance=N;case"script":return N=Nf(c.src),(S=a.querySelector(Up(N)))?(r.instance=S,En(S),S):(p=c,(S=ni.get(N))&&(p=b({},c),Ay(p,S)),a=a.ownerDocument||a,S=a.createElement("script"),En(S),as(S,"link",p),a.head.appendChild(S),r.instance=S);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(p=r.instance,r.state.loading|=4,C0(p,c.precedence,a));return r.instance}function C0(a,r,c){for(var p=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=p.length?p[p.length-1]:null,N=S,M=0;M<p.length;M++){var q=p[M];if(q.dataset.precedence===r)N=q;else if(N!==S)break}N?N.parentNode.insertBefore(a,N.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(a,r.firstChild))}function Oy(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Ay(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var j0=null;function e2(a,r,c){if(j0===null){var p=new Map,S=j0=new Map;S.set(c,p)}else S=j0,p=S.get(c),p||(p=new Map,S.set(c,p));if(p.has(a))return p;for(p.set(a,null),c=c.getElementsByTagName(a),S=0;S<c.length;S++){var N=c[S];if(!(N[Xa]||N[Fe]||a==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var M=N.getAttribute(r)||"";M=a+M;var q=p.get(M);q?q.push(N):p.set(M,[N])}}return p}function t2(a,r,c){a=a.ownerDocument||a,a.head.insertBefore(c,r==="title"?a.querySelector("head > title"):null)}function C7(a,r,c){if(c===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function n2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function j7(a,r,c,p){if(c.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var S=Sf(p.href),N=r.querySelector(Lp(S));if(N){r=N._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=w0.bind(a),r.then(a,a)),c.state.loading|=4,c.instance=N,En(N);return}N=r.ownerDocument||r,p=Wv(p),(S=ni.get(S))&&Oy(p,S),N=N.createElement("link"),En(N);var M=N;M._p=new Promise(function(q,K){M.onload=q,M.onerror=K}),as(N,"link",p),c.instance=N}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,r),(r=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=w0.bind(a),r.addEventListener("load",c),r.addEventListener("error",c))}}var My=0;function w7(a,r){return a.stylesheets&&a.count===0&&T0(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var p=setTimeout(function(){if(a.stylesheets&&T0(a,a.stylesheets),a.unsuspend){var N=a.unsuspend;a.unsuspend=null,N()}},6e4+r);0<a.imgBytes&&My===0&&(My=62500*i7());var S=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&T0(a,a.stylesheets),a.unsuspend)){var N=a.unsuspend;a.unsuspend=null,N()}},(a.imgBytes>My?50:800)+r);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(S)}}:null}function w0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)T0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var E0=null;function T0(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,E0=new Map,r.forEach(E7,a),E0=null,w0.call(a))}function E7(a,r){if(!(r.state.loading&4)){var c=E0.get(a);if(c)var p=c.get(null);else{c=new Map,E0.set(a,c);for(var S=a.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var M=S[N];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(c.set(M.dataset.precedence,M),p=M)}p&&c.set(null,p)}S=r.instance,M=S.getAttribute("data-precedence"),N=c.get(M)||p,N===p&&c.set(null,S),c.set(M,S),this.count++,p=w0.bind(this),S.addEventListener("load",p),S.addEventListener("error",p),N?N.parentNode.insertBefore(S,N.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(S,a.firstChild)),r.state.loading|=4}}var Hp={$$typeof:z,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function T7(a,r,c,p,S,N,M,q,K){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=p,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function a2(a,r,c,p,S,N,M,q,K,ue,ye,ve){return a=new T7(a,r,c,M,K,ue,ye,ve,q),r=1,N===!0&&(r|=24),N=Rn(3,null,null,r),a.current=N,N.stateNode=a,r=Ph(),r.refCount++,a.pooledCache=r,r.refCount++,N.memoizedState={element:p,isDehydrated:c,cache:r},fc(N),a}function s2(a){return a?(a=Hi,a):Hi}function r2(a,r,c,p,S,N){S=s2(S),p.context===null?p.context=S:p.pendingContext=S,p=xi(r),p.payload={element:c},N=N===void 0?null:N,N!==null&&(p.callback=N),c=Xi(a,p,r),c!==null&&(ht(c,a,r),Ki(c,a,r))}function i2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<r?c:r}}function Dy(a,r){i2(a,r),(a=a.alternate)&&i2(a,r)}function l2(a){if(a.tag===13||a.tag===31){var r=Za(a,67108864);r!==null&&ht(r,a,67108864),Dy(a,67108864)}}function o2(a){if(a.tag===13||a.tag===31){var r=Hs();r=Ue(r);var c=Za(a,r);c!==null&&ht(c,a,r),Dy(a,r)}}var R0=!0;function R7(a,r,c,p){var S=Y.T;Y.T=null;var N=$.p;try{$.p=2,zy(a,r,c,p)}finally{$.p=N,Y.T=S}}function O7(a,r,c,p){var S=Y.T;Y.T=null;var N=$.p;try{$.p=8,zy(a,r,c,p)}finally{$.p=N,Y.T=S}}function zy(a,r,c,p){if(R0){var S=ky(p);if(S===null)vy(a,r,p,O0,c),c2(a,p);else if(M7(S,a,r,c,p))p.stopPropagation();else if(c2(a,p),r&4&&-1<A7.indexOf(a)){for(;S!==null;){var N=gr(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var M=pt(N.pendingLanes);if(M!==0){var q=N;for(q.pendingLanes|=2,q.entangledLanes|=2;M;){var K=1<<31-ya(M);q.entanglements[1]|=K,M&=~K}Ce(N),(Ye&6)===0&&(In=Qn()+500,Le(0))}}break;case 31:case 13:q=Za(N,2),q!==null&&ht(q,N,2),_r(),Dy(N,2)}if(N=ky(p),N===null&&vy(a,r,p,O0,c),N===S)break;S=N}S!==null&&p.stopPropagation()}else vy(a,r,p,null,c)}}function ky(a){return a=xd(a),Ly(a)}var O0=null;function Ly(a){if(O0=null,a=Pt(a),a!==null){var r=o(a);if(r===null)a=null;else{var c=r.tag;if(c===13){if(a=d(r),a!==null)return a;a=null}else if(c===31){if(a=f(r),a!==null)return a;a=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return O0=a,null}function u2(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ns()){case hr:return 2;case Qa:return 8;case ia:case Ea:return 32;case is:return 268435456;default:return 32}default:return 32}}var Uy=!1,su=null,ru=null,iu=null,qp=new Map,Bp=new Map,lu=[],A7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function c2(a,r){switch(a){case"focusin":case"focusout":su=null;break;case"dragenter":case"dragleave":ru=null;break;case"mouseover":case"mouseout":iu=null;break;case"pointerover":case"pointerout":qp.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bp.delete(r.pointerId)}}function Gp(a,r,c,p,S,N){return a===null||a.nativeEvent!==N?(a={blockedOn:r,domEventName:c,eventSystemFlags:p,nativeEvent:N,targetContainers:[S]},r!==null&&(r=gr(r),r!==null&&l2(r)),a):(a.eventSystemFlags|=p,r=a.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),a)}function M7(a,r,c,p,S){switch(r){case"focusin":return su=Gp(su,a,r,c,p,S),!0;case"dragenter":return ru=Gp(ru,a,r,c,p,S),!0;case"mouseover":return iu=Gp(iu,a,r,c,p,S),!0;case"pointerover":var N=S.pointerId;return qp.set(N,Gp(qp.get(N)||null,a,r,c,p,S)),!0;case"gotpointercapture":return N=S.pointerId,Bp.set(N,Gp(Bp.get(N)||null,a,r,c,p,S)),!0}return!1}function d2(a){var r=Pt(a.target);if(r!==null){var c=o(r);if(c!==null){if(r=c.tag,r===13){if(r=d(c),r!==null){a.blockedOn=r,ot(a.priority,function(){o2(c)});return}}else if(r===31){if(r=f(c),r!==null){a.blockedOn=r,ot(a.priority,function(){o2(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function A0(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var c=ky(a.nativeEvent);if(c===null){c=a.nativeEvent;var p=new c.constructor(c.type,c);yd=p,c.target.dispatchEvent(p),yd=null}else return r=gr(c),r!==null&&l2(r),a.blockedOn=c,!1;r.shift()}return!0}function f2(a,r,c){A0(a)&&c.delete(r)}function D7(){Uy=!1,su!==null&&A0(su)&&(su=null),ru!==null&&A0(ru)&&(ru=null),iu!==null&&A0(iu)&&(iu=null),qp.forEach(f2),Bp.forEach(f2)}function M0(a,r){a.blockedOn===r&&(a.blockedOn=null,Uy||(Uy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D7)))}var D0=null;function h2(a){D0!==a&&(D0=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){D0===a&&(D0=null);for(var r=0;r<a.length;r+=3){var c=a[r],p=a[r+1],S=a[r+2];if(typeof p!="function"){if(Ly(p||c)===null)continue;break}var N=gr(c);N!==null&&(a.splice(r,3),r-=3,mp(N,{pending:!0,data:S,method:c.method,action:p},p,S))}}))}function _f(a){function r(K){return M0(K,a)}su!==null&&M0(su,a),ru!==null&&M0(ru,a),iu!==null&&M0(iu,a),qp.forEach(r),Bp.forEach(r);for(var c=0;c<lu.length;c++){var p=lu[c];p.blockedOn===a&&(p.blockedOn=null)}for(;0<lu.length&&(c=lu[0],c.blockedOn===null);)d2(c),c.blockedOn===null&&lu.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(p=0;p<c.length;p+=3){var S=c[p],N=c[p+1],M=S[ut]||null;if(typeof N=="function")M||h2(c);else if(M){var q=null;if(N&&N.hasAttribute("formAction")){if(S=N,M=N[ut]||null)q=M.formAction;else if(Ly(S)!==null)continue}else q=M.action;typeof q=="function"?c[p+1]=q:(c.splice(p,3),p-=3),h2(c)}}}function p2(){function a(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(M){return S=M})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),p||setTimeout(c,20)}function c(){if(!p&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,S=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function Hy(a){this._internalRoot=a}z0.prototype.render=Hy.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var c=r.current,p=Hs();r2(c,p,a,r,null,null)},z0.prototype.unmount=Hy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;r2(a.current,2,null,a,null,null),_r(),r[an]=null}};function z0(a){this._internalRoot=a}z0.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ve();a={blockedOn:null,target:a,priority:r};for(var c=0;c<lu.length&&r!==0&&r<lu[c].priority;c++);lu.splice(c,0,a),c===0&&d2(a)}};var m2=e.version;if(m2!=="19.2.4")throw Error(s(527,m2,"19.2.4"));$.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=y(r),a=a!==null?v(a):null,a=a===null?null:a.stateNode,a};var z7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var k0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!k0.isDisabled&&k0.supportsFiber)try{Bs=k0.inject(z7),$n=k0}catch{}}return Vp.createRoot=function(a,r){if(!i(a))throw Error(s(299));var c=!1,p="",S=f0,N=Sp,M=Np;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(M=r.onRecoverableError)),r=a2(a,1,!1,null,null,c,p,null,S,N,M,p2),a[an]=r.current,by(a),new Hy(r)},Vp.hydrateRoot=function(a,r,c){if(!i(a))throw Error(s(299));var p=!1,S="",N=f0,M=Sp,q=Np,K=null;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(S=c.identifierPrefix),c.onUncaughtError!==void 0&&(N=c.onUncaughtError),c.onCaughtError!==void 0&&(M=c.onCaughtError),c.onRecoverableError!==void 0&&(q=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),r=a2(a,1,!0,r,c??null,p,S,K,N,M,q,p2),r.context=s2(null),c=r.current,p=Hs(),p=Ue(p),S=xi(p),S.callback=null,Xi(c,S,p),c=p,r.current.lanes=c,yn(r,c),Ce(r),a[an]=r.current,by(a),new z0(r)},Vp.version="19.2.4",Vp}var w2;function Q7(){if(w2)return Py.exports;w2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Py.exports=V7(),Py.exports}var Pb=Q7();const X7=qb(Pb),K7=b4({__proto__:null,default:X7},[Pb]);var ed=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qc,bu,Lf,l4,F7=(l4=class extends ed{constructor(){super();He(this,qc);He(this,bu);He(this,Lf);Oe(this,Lf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,bu)||this.setEventListener(Q(this,Lf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,bu))==null||e.call(this),Oe(this,bu,void 0))}setEventListener(e){var n;Oe(this,Lf,e),(n=Q(this,bu))==null||n.call(this),Oe(this,bu,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Q(this,qc)!==e&&(Oe(this,qc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Q(this,qc)=="boolean"?Q(this,qc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qc=new WeakMap,bu=new WeakMap,Lf=new WeakMap,l4),M1=new F7,Z7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},vu,Hb,o4,I7=(o4=class{constructor(){He(this,vu,Z7);He(this,Hb,!1)}setTimeoutProvider(t){Oe(this,vu,t)}setTimeout(t,e){return Q(this,vu).setTimeout(t,e)}clearTimeout(t){Q(this,vu).clearTimeout(t)}setInterval(t,e){return Q(this,vu).setInterval(t,e)}clearInterval(t){Q(this,vu).clearInterval(t)}},vu=new WeakMap,Hb=new WeakMap,o4),Ru=new I7;function J7(t){setTimeout(t,0)}var v4=typeof window>"u"||"Deno"in globalThis;function pa(){}function W7(t,e){return typeof t=="function"?t(e):t}function Mx(t){return typeof t=="number"&&t>=0&&t!==1/0}function S4(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ou(t,e){return typeof t=="function"?t(e):t}function ri(t,e){return typeof t=="function"?t(e):t}function Dx(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:d,stale:f}=t;if(d){if(s){if(e.queryHash!==Yb(d,e.options))return!1}else if(!Jf(e.queryKey,d))return!1}if(n!=="all"){const m=e.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||i&&i!==e.state.fetchStatus||o&&!o(e))}function zx(t,e){const{exact:n,status:s,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Au(e.options.mutationKey)!==Au(o))return!1}else if(!Jf(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Yb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Au)(t)}function Au(t){return JSON.stringify(t,(e,n)=>kx(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Jf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Jf(t[n],e[n])):!1}var $7=Object.prototype.hasOwnProperty;function Vm(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=E2(t)&&E2(e);if(!s&&!(kx(t)&&kx(e)))return e;const o=(s?t:Object.keys(t)).length,d=s?e:Object.keys(e),f=d.length,m=s?new Array(f):{};let y=0;for(let v=0;v<f;v++){const b=s?v:d[v],_=t[b],j=e[b];if(_===j){m[b]=_,(s?v<o:$7.call(t,b))&&y++;continue}if(_===null||j===null||typeof _!="object"||typeof j!="object"){m[b]=j;continue}const w=Vm(_,j,n+1);m[b]=w,w===_&&y++}return o===f&&y===o?t:m}function _m(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function E2(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function kx(t){if(!T2(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!T2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function T2(t){return Object.prototype.toString.call(t)==="[object Object]"}function e9(t){return new Promise(e=>{Ru.setTimeout(e,t)})}function Lx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Vm(t,e):e}function t9(t){return t}function N4(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function n9(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var D1=Symbol();function _4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===D1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function z1(t,e){return typeof t=="function"?t(...e):!!t}function C4(t,e,n){let s=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Wf=(()=>{let t=()=>v4;return{isServer(){return t()},setIsServer(e){t=e}}})();function Ux(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),t(i)},n.reject=i=>{s({status:"rejected",reason:i}),e(i)},n}function a9(t){var n;let e;if((n=t.then(s=>(e=s,s),pa))==null||n.catch(pa),e!==void 0)return{data:e}}function j4(t){return t}function s9(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function r9(t,e,n){const s=()=>{var o;const i=(o=t.promise)==null?void 0:o.then(e).catch(d=>n(d)?Promise.reject(new Error("redacted")):Promise.reject(d));return i==null||i.catch(pa),i};return{dehydratedAt:Date.now(),state:{...t.state,...t.state.data!==void 0&&{data:e(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,...t.state.status==="pending"&&{promise:s()},...t.meta&&{meta:t.meta}}}function w4(t){return t.state.isPaused}function E4(t){return t.state.status==="success"}function i9(t){return!0}function l9(t,e={}){var m,y,v,b;const n=e.shouldDehydrateMutation??((m=t.getDefaultOptions().dehydrate)==null?void 0:m.shouldDehydrateMutation)??w4,s=t.getMutationCache().getAll().flatMap(_=>n(_)?[s9(_)]:[]),i=e.shouldDehydrateQuery??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateQuery)??E4,o=e.shouldRedactErrors??((v=t.getDefaultOptions().dehydrate)==null?void 0:v.shouldRedactErrors)??i9,d=e.serializeData??((b=t.getDefaultOptions().dehydrate)==null?void 0:b.serializeData)??j4,f=t.getQueryCache().getAll().flatMap(_=>i(_)?[r9(_,d,o)]:[]);return{mutations:s,queries:f}}function Hx(t,e,n){var m,y;if(typeof e!="object"||e===null)return;const s=t.getMutationCache(),i=t.getQueryCache(),o=((m=n==null?void 0:n.defaultOptions)==null?void 0:m.deserializeData)??((y=t.getDefaultOptions().hydrate)==null?void 0:y.deserializeData)??j4,d=e.mutations||[],f=e.queries||[];d.forEach(({state:v,...b})=>{var _,j;s.build(t,{...(_=t.getDefaultOptions().hydrate)==null?void 0:_.mutations,...(j=n==null?void 0:n.defaultOptions)==null?void 0:j.mutations,...b},v)}),f.forEach(({queryKey:v,state:b,queryHash:_,meta:j,promise:w,dehydratedAt:O})=>{var H,B;const R=w?a9(w):void 0,T=b.data===void 0?R==null?void 0:R.data:b.data,A=T===void 0?T:o(T);let z=i.get(_);const k=(z==null?void 0:z.state.status)==="pending",P=(z==null?void 0:z.state.fetchStatus)==="fetching";if(z){const L=R&&O!==void 0&&O>z.state.dataUpdatedAt;if(b.dataUpdatedAt>z.state.dataUpdatedAt||L){const{fetchStatus:V,...Z}=b;z.setState({...Z,data:A})}}else z=i.build(t,{...(H=t.getDefaultOptions().hydrate)==null?void 0:H.queries,...(B=n==null?void 0:n.defaultOptions)==null?void 0:B.queries,queryKey:v,queryHash:_,meta:j},{...b,data:A,fetchStatus:"idle",status:A!==void 0?"success":b.status});w&&!k&&!P&&(O===void 0||O>z.state.dataUpdatedAt)&&z.fetch(void 0,{initialPromise:Promise.resolve(w).then(o)}).catch(pa)})}var T4=J7;function o9(){let t=[],e=0,n=f=>{f()},s=f=>{f()},i=T4;const o=f=>{e?t.push(f):i(()=>{n(f)})},d=()=>{const f=t;t=[],f.length&&i(()=>{s(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;e++;try{m=f()}finally{e--,e||d()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var Ln=o9(),Uf,Su,Hf,u4,u9=(u4=class extends ed{constructor(){super();He(this,Uf,!0);He(this,Su);He(this,Hf);Oe(this,Hf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){Q(this,Su)||this.setEventListener(Q(this,Hf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,Su))==null||e.call(this),Oe(this,Su,void 0))}setEventListener(e){var n;Oe(this,Hf,e),(n=Q(this,Su))==null||n.call(this),Oe(this,Su,e(this.setOnline.bind(this)))}setOnline(e){Q(this,Uf)!==e&&(Oe(this,Uf,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Q(this,Uf)}},Uf=new WeakMap,Su=new WeakMap,Hf=new WeakMap,u4),Cm=new u9;function c9(t){return Math.min(1e3*2**t,3e4)}function R4(t){return(t??"online")==="online"?Cm.isOnline():!0}var jm=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function d9(t){return t instanceof jm}function O4(t){let e=!1,n=0,s;const i=Ux(),o=()=>i.status!=="pending",d=O=>{var R;if(!o()){const T=new jm(O);_(T),(R=t.onCancel)==null||R.call(t,T)}},f=()=>{e=!0},m=()=>{e=!1},y=()=>M1.isFocused()&&(t.networkMode==="always"||Cm.isOnline())&&t.canRun(),v=()=>R4(t.networkMode)&&t.canRun(),b=O=>{o()||(s==null||s(),i.resolve(O))},_=O=>{o()||(s==null||s(),i.reject(O))},j=()=>new Promise(O=>{var R;s=T=>{(o()||y())&&O(T)},(R=t.onPause)==null||R.call(t)}).then(()=>{var O;s=void 0,o()||(O=t.onContinue)==null||O.call(t)}),w=()=>{if(o())return;let O;const R=n===0?t.initialPromise:void 0;try{O=R??t.fn()}catch(T){O=Promise.reject(T)}Promise.resolve(O).then(b).catch(T=>{var H;if(o())return;const A=t.retry??(Wf.isServer()?0:3),z=t.retryDelay??c9,k=typeof z=="function"?z(n,T):z,P=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,T);if(e||!P){_(T);return}n++,(H=t.onFail)==null||H.call(t,n,T),e9(k).then(()=>y()?void 0:j()).then(()=>{e?_(T):w()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?w():j().then(w),i)}}var Bc,c4,A4=(c4=class{constructor(){He(this,Bc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mx(this.gcTime)&&Oe(this,Bc,Ru.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wf.isServer()?1/0:300*1e3))}clearGcTimeout(){Q(this,Bc)&&(Ru.clearTimeout(Q(this,Bc)),Oe(this,Bc,void 0))}},Bc=new WeakMap,c4),Gc,qf,ai,Pc,Va,km,Yc,jr,D4,ao,d4,M4=(d4=class extends A4{constructor(e){super();He(this,jr);He(this,Gc);He(this,qf);He(this,ai);He(this,Pc);He(this,Va);He(this,km);He(this,Yc);Oe(this,Yc,!1),Oe(this,km,e.defaultOptions),this.setOptions(e.options),this.observers=[],Oe(this,Pc,e.client),Oe(this,ai,Q(this,Pc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Oe(this,Gc,O2(this.options)),this.state=e.state??Q(this,Gc),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Q(this,Va))==null?void 0:e.promise}setOptions(e){if(this.options={...Q(this,km),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=O2(this.options);n.data!==void 0&&(this.setState(R2(n.data,n.dataUpdatedAt)),Oe(this,Gc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,ai).remove(this)}setData(e,n){const s=Lx(this.state.data,e,this.options);return Je(this,jr,ao).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){Je(this,jr,ao).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,i;const n=(s=Q(this,Va))==null?void 0:s.promise;return(i=Q(this,Va))==null||i.cancel(e),n?n.then(pa).catch(pa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Q(this,Gc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ri(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ou(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!S4(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Q(this,ai).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(Q(this,Va)&&(Q(this,Yc)||Je(this,jr,D4).call(this)?Q(this,Va).cancel({revert:!0}):Q(this,Va).cancelRetry()),this.scheduleGc()),Q(this,ai).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,jr,ao).call(this,{type:"invalidate"})}async fetch(e,n){var m,y,v,b,_,j,w,O,R,T,A,z;if(this.state.fetchStatus!=="idle"&&((m=Q(this,Va))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Va))return Q(this,Va).continueRetry(),Q(this,Va).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(P=>P.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Oe(this,Yc,!0),s.signal)})},o=()=>{const k=_4(this.options,n),H=(()=>{const B={client:Q(this,Pc),queryKey:this.queryKey,meta:this.meta};return i(B),B})();return Oe(this,Yc,!1),this.options.persister?this.options.persister(k,H,this):k(H)},f=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,Pc),state:this.state,fetchFn:o};return i(k),k})();(y=this.options.behavior)==null||y.onFetch(f,this),Oe(this,qf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=f.fetchOptions)==null?void 0:v.meta))&&Je(this,jr,ao).call(this,{type:"fetch",meta:(b=f.fetchOptions)==null?void 0:b.meta}),Oe(this,Va,O4({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:k=>{k instanceof jm&&k.revert&&this.setState({...Q(this,qf),fetchStatus:"idle"}),s.abort()},onFail:(k,P)=>{Je(this,jr,ao).call(this,{type:"failed",failureCount:k,error:P})},onPause:()=>{Je(this,jr,ao).call(this,{type:"pause"})},onContinue:()=>{Je(this,jr,ao).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const k=await Q(this,Va).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(j=(_=Q(this,ai).config).onSuccess)==null||j.call(_,k,this),(O=(w=Q(this,ai).config).onSettled)==null||O.call(w,k,this.state.error,this),k}catch(k){if(k instanceof jm){if(k.silent)return Q(this,Va).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw Je(this,jr,ao).call(this,{type:"error",error:k}),(T=(R=Q(this,ai).config).onError)==null||T.call(R,k,this),(z=(A=Q(this,ai).config).onSettled)==null||z.call(A,this.state.data,k,this),k}finally{this.scheduleGc()}}},Gc=new WeakMap,qf=new WeakMap,ai=new WeakMap,Pc=new WeakMap,Va=new WeakMap,km=new WeakMap,Yc=new WeakMap,jr=new WeakSet,D4=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ao=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...z4(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...R2(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Oe(this,qf,e.manual?i:void 0),i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),Ln.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Q(this,ai).notify({query:this,type:"updated",action:e})})},d4);function z4(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:R4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function R2(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function O2(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ur,Ht,Lm,qs,Vc,Bf,io,Nu,Um,Gf,Pf,Qc,Xc,_u,Yf,nn,om,qx,Bx,Gx,Px,Yx,Vx,Qx,k4,f4,rh=(f4=class extends ed{constructor(e,n){super();He(this,nn);He(this,ur);He(this,Ht);He(this,Lm);He(this,qs);He(this,Vc);He(this,Bf);He(this,io);He(this,Nu);He(this,Um);He(this,Gf);He(this,Pf);He(this,Qc);He(this,Xc);He(this,_u);He(this,Yf,new Set);this.options=n,Oe(this,ur,e),Oe(this,Nu,null),Oe(this,io,Ux()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,Ht).addObserver(this),A2(Q(this,Ht),this.options)?Je(this,nn,om).call(this):this.updateResult(),Je(this,nn,Px).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xx(Q(this,Ht),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xx(Q(this,Ht),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,nn,Yx).call(this),Je(this,nn,Vx).call(this),Q(this,Ht).removeObserver(this)}setOptions(e){const n=this.options,s=Q(this,Ht);if(this.options=Q(this,ur).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ri(this.options.enabled,Q(this,Ht))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,nn,Qx).call(this),Q(this,Ht).setOptions(this.options),n._defaulted&&!_m(this.options,n)&&Q(this,ur).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,Ht),observer:this});const i=this.hasListeners();i&&M2(Q(this,Ht),s,this.options,n)&&Je(this,nn,om).call(this),this.updateResult(),i&&(Q(this,Ht)!==s||ri(this.options.enabled,Q(this,Ht))!==ri(n.enabled,Q(this,Ht))||Ou(this.options.staleTime,Q(this,Ht))!==Ou(n.staleTime,Q(this,Ht)))&&Je(this,nn,qx).call(this);const o=Je(this,nn,Bx).call(this);i&&(Q(this,Ht)!==s||ri(this.options.enabled,Q(this,Ht))!==ri(n.enabled,Q(this,Ht))||o!==Q(this,_u))&&Je(this,nn,Gx).call(this,o)}getOptimisticResult(e){const n=Q(this,ur).getQueryCache().build(Q(this,ur),e),s=this.createResult(n,e);return h9(this,s)&&(Oe(this,qs,s),Oe(this,Bf,this.options),Oe(this,Vc,Q(this,Ht).state)),s}getCurrentResult(){return Q(this,qs)}trackResult(e,n){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Q(this,io).status==="pending"&&Q(this,io).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(e){Q(this,Yf).add(e)}getCurrentQuery(){return Q(this,Ht)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Q(this,ur).defaultQueryOptions(e),s=Q(this,ur).getQueryCache().build(Q(this,ur),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return Je(this,nn,om).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,qs)))}createResult(e,n){var V;const s=Q(this,Ht),i=this.options,o=Q(this,qs),d=Q(this,Vc),f=Q(this,Bf),y=e!==s?e.state:Q(this,Lm),{state:v}=e;let b={...v},_=!1,j;if(n._optimisticResults){const Z=this.hasListeners(),oe=!Z&&A2(e,n),ne=Z&&M2(e,s,n,i);(oe||ne)&&(b={...b,...z4(v.data,e.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:O,status:R}=b;j=b.data;let T=!1;if(n.placeholderData!==void 0&&j===void 0&&R==="pending"){let Z;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(Z=o.data,T=!0):Z=typeof n.placeholderData=="function"?n.placeholderData((V=Q(this,Pf))==null?void 0:V.state.data,Q(this,Pf)):n.placeholderData,Z!==void 0&&(R="success",j=Lx(o==null?void 0:o.data,Z,n),_=!0)}if(n.select&&j!==void 0&&!T)if(o&&j===(d==null?void 0:d.data)&&n.select===Q(this,Um))j=Q(this,Gf);else try{Oe(this,Um,n.select),j=n.select(j),j=Lx(o==null?void 0:o.data,j,n),Oe(this,Gf,j),Oe(this,Nu,null)}catch(Z){Oe(this,Nu,Z)}Q(this,Nu)&&(w=Q(this,Nu),j=Q(this,Gf),O=Date.now(),R="error");const A=b.fetchStatus==="fetching",z=R==="pending",k=R==="error",P=z&&A,H=j!==void 0,L={status:R,fetchStatus:b.fetchStatus,isPending:z,isSuccess:R==="success",isError:k,isInitialLoading:P,isLoading:P,data:j,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:O,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>y.dataUpdateCount||b.errorUpdateCount>y.errorUpdateCount,isFetching:A,isRefetching:A&&!z,isLoadingError:k&&!H,isPaused:b.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:k&&H,isStale:Vb(e,n),refetch:this.refetch,promise:Q(this,io),isEnabled:ri(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const Z=L.data!==void 0,oe=L.status==="error"&&!Z,ne=ce=>{oe?ce.reject(L.error):Z&&ce.resolve(L.data)},J=()=>{const ce=Oe(this,io,L.promise=Ux());ne(ce)},ie=Q(this,io);switch(ie.status){case"pending":e.queryHash===s.queryHash&&ne(ie);break;case"fulfilled":(oe||L.data!==ie.value)&&J();break;case"rejected":(!oe||L.error!==ie.reason)&&J();break}}return L}updateResult(){const e=Q(this,qs),n=this.createResult(Q(this,Ht),this.options);if(Oe(this,Vc,Q(this,Ht).state),Oe(this,Bf,this.options),Q(this,Vc).data!==void 0&&Oe(this,Pf,Q(this,Ht)),_m(n,e))return;Oe(this,qs,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Q(this,Yf).size)return!0;const d=new Set(o??Q(this,Yf));return this.options.throwOnError&&d.add("error"),Object.keys(Q(this,qs)).some(f=>{const m=f;return Q(this,qs)[m]!==e[m]&&d.has(m)})};Je(this,nn,k4).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,nn,Px).call(this)}},ur=new WeakMap,Ht=new WeakMap,Lm=new WeakMap,qs=new WeakMap,Vc=new WeakMap,Bf=new WeakMap,io=new WeakMap,Nu=new WeakMap,Um=new WeakMap,Gf=new WeakMap,Pf=new WeakMap,Qc=new WeakMap,Xc=new WeakMap,_u=new WeakMap,Yf=new WeakMap,nn=new WeakSet,om=function(e){Je(this,nn,Qx).call(this);let n=Q(this,Ht).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(pa)),n},qx=function(){Je(this,nn,Yx).call(this);const e=Ou(this.options.staleTime,Q(this,Ht));if(Wf.isServer()||Q(this,qs).isStale||!Mx(e))return;const s=S4(Q(this,qs).dataUpdatedAt,e)+1;Oe(this,Qc,Ru.setTimeout(()=>{Q(this,qs).isStale||this.updateResult()},s))},Bx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,Ht)):this.options.refetchInterval)??!1},Gx=function(e){Je(this,nn,Vx).call(this),Oe(this,_u,e),!(Wf.isServer()||ri(this.options.enabled,Q(this,Ht))===!1||!Mx(Q(this,_u))||Q(this,_u)===0)&&Oe(this,Xc,Ru.setInterval(()=>{(this.options.refetchIntervalInBackground||M1.isFocused())&&Je(this,nn,om).call(this)},Q(this,_u)))},Px=function(){Je(this,nn,qx).call(this),Je(this,nn,Gx).call(this,Je(this,nn,Bx).call(this))},Yx=function(){Q(this,Qc)&&(Ru.clearTimeout(Q(this,Qc)),Oe(this,Qc,void 0))},Vx=function(){Q(this,Xc)&&(Ru.clearInterval(Q(this,Xc)),Oe(this,Xc,void 0))},Qx=function(){const e=Q(this,ur).getQueryCache().build(Q(this,ur),this.options);if(e===Q(this,Ht))return;const n=Q(this,Ht);Oe(this,Ht,e),Oe(this,Lm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},k4=function(e){Ln.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(Q(this,qs))}),Q(this,ur).getQueryCache().notify({query:Q(this,Ht),type:"observerResultsUpdated"})})},f4);function f9(t,e){return ri(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function A2(t,e){return f9(t,e)||t.state.data!==void 0&&Xx(t,e,e.refetchOnMount)}function Xx(t,e,n){if(ri(e.enabled,t)!==!1&&Ou(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Vb(t,e)}return!1}function M2(t,e,n,s){return(t!==e||ri(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Vb(t,n)}function Vb(t,e){return ri(e.enabled,t)!==!1&&t.isStaleByTime(Ou(e.staleTime,t))}function h9(t,e){return!_m(t.getCurrentResult(),e)}function x1(t){return{onFetch:(e,n)=>{var v,b,_,j,w;const s=e.options,i=(_=(b=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:_.direction,o=((j=e.state.data)==null?void 0:j.pages)||[],d=((w=e.state.data)==null?void 0:w.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const y=async()=>{let O=!1;const R=z=>{C4(z,()=>e.signal,()=>O=!0)},T=_4(e.options,e.fetchOptions),A=async(z,k,P)=>{if(O)return Promise.reject();if(k==null&&z.pages.length)return Promise.resolve(z);const B=(()=>{const oe={client:e.client,queryKey:e.queryKey,pageParam:k,direction:P?"backward":"forward",meta:e.options.meta};return R(oe),oe})(),L=await T(B),{maxPages:V}=e.options,Z=P?n9:N4;return{pages:Z(z.pages,L,V),pageParams:Z(z.pageParams,k,V)}};if(i&&o.length){const z=i==="backward",k=z?L4:Kx,P={pages:o,pageParams:d},H=k(s,P);f=await A(P,H,z)}else{const z=t??o.length;do{const k=m===0?d[0]??s.initialPageParam:Kx(s,f);if(m>0&&k==null)break;f=await A(f,k),m++}while(m<z)}return f};e.options.persister?e.fetchFn=()=>{var O,R;return(R=(O=e.options).persister)==null?void 0:R.call(O,y,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=y}}}function Kx(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function L4(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}function p9(t,e){return e?Kx(t,e)!=null:!1}function m9(t,e){return!e||!t.getPreviousPageParam?!1:L4(t,e)!=null}var Qb=class extends rh{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:x1()})}getOptimisticResult(t){return t.behavior=x1(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var w,O;const{state:n}=t,s=super.createResult(t,e),{isFetching:i,isRefetching:o,isError:d,isRefetchError:f}=s,m=(O=(w=n.fetchMeta)==null?void 0:w.fetchMore)==null?void 0:O.direction,y=d&&m==="forward",v=i&&m==="forward",b=d&&m==="backward",_=i&&m==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:p9(e,n.data),hasPreviousPage:m9(e,n.data),isFetchNextPageError:y,isFetchingNextPage:v,isFetchPreviousPageError:b,isFetchingPreviousPage:_,isRefetchError:f&&!y&&!b,isRefetching:o&&!v&&!_}}},Hm,dl,vs,Kc,fl,hu,h4,U4=(h4=class extends A4{constructor(e){super();He(this,fl);He(this,Hm);He(this,dl);He(this,vs);He(this,Kc);Oe(this,Hm,e.client),this.mutationId=e.mutationId,Oe(this,vs,e.mutationCache),Oe(this,dl,[]),this.state=e.state||H4(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Q(this,dl).includes(e)||(Q(this,dl).push(e),this.clearGcTimeout(),Q(this,vs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Oe(this,dl,Q(this,dl).filter(n=>n!==e)),this.scheduleGc(),Q(this,vs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,dl).length||(this.state.status==="pending"?this.scheduleGc():Q(this,vs).remove(this))}continue(){var e;return((e=Q(this,Kc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,f,m,y,v,b,_,j,w,O,R,T,A,z,k,P,H,B;const n=()=>{Je(this,fl,hu).call(this,{type:"continue"})},s={client:Q(this,Hm),meta:this.options.meta,mutationKey:this.options.mutationKey};Oe(this,Kc,O4({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{Je(this,fl,hu).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{Je(this,fl,hu).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,vs).canRun(this)}));const i=this.state.status==="pending",o=!Q(this,Kc).canStart();try{if(i)n();else{Je(this,fl,hu).call(this,{type:"pending",variables:e,isPaused:o}),Q(this,vs).config.onMutate&&await Q(this,vs).config.onMutate(e,this,s);const V=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,e,s));V!==this.state.context&&Je(this,fl,hu).call(this,{type:"pending",context:V,variables:e,isPaused:o})}const L=await Q(this,Kc).start();return await((y=(m=Q(this,vs).config).onSuccess)==null?void 0:y.call(m,L,e,this.state.context,this,s)),await((b=(v=this.options).onSuccess)==null?void 0:b.call(v,L,e,this.state.context,s)),await((j=(_=Q(this,vs).config).onSettled)==null?void 0:j.call(_,L,null,this.state.variables,this.state.context,this,s)),await((O=(w=this.options).onSettled)==null?void 0:O.call(w,L,null,e,this.state.context,s)),Je(this,fl,hu).call(this,{type:"success",data:L}),L}catch(L){try{await((T=(R=Q(this,vs).config).onError)==null?void 0:T.call(R,L,e,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((z=(A=this.options).onError)==null?void 0:z.call(A,L,e,this.state.context,s))}catch(V){Promise.reject(V)}try{await((P=(k=Q(this,vs).config).onSettled)==null?void 0:P.call(k,void 0,L,this.state.variables,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((B=(H=this.options).onSettled)==null?void 0:B.call(H,void 0,L,e,this.state.context,s))}catch(V){Promise.reject(V)}throw Je(this,fl,hu).call(this,{type:"error",error:L}),L}finally{Q(this,vs).runNext(this)}}},Hm=new WeakMap,dl=new WeakMap,vs=new WeakMap,Kc=new WeakMap,fl=new WeakSet,hu=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ln.batch(()=>{Q(this,dl).forEach(s=>{s.onMutationUpdate(e)}),Q(this,vs).notify({mutation:this,type:"updated",action:e})})},h4);function H4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lo,Ti,qm,p4,q4=(p4=class extends ed{constructor(e={}){super();He(this,lo);He(this,Ti);He(this,qm);this.config=e,Oe(this,lo,new Set),Oe(this,Ti,new Map),Oe(this,qm,0)}build(e,n,s){const i=new U4({client:e,mutationCache:this,mutationId:++L0(this,qm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){Q(this,lo).add(e);const n=U0(e);if(typeof n=="string"){const s=Q(this,Ti).get(n);s?s.push(e):Q(this,Ti).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Q(this,lo).delete(e)){const n=U0(e);if(typeof n=="string"){const s=Q(this,Ti).get(n);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&Q(this,Ti).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=U0(e);if(typeof n=="string"){const s=Q(this,Ti).get(n),i=s==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var s;const n=U0(e);if(typeof n=="string"){const i=(s=Q(this,Ti).get(n))==null?void 0:s.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ln.batch(()=>{Q(this,lo).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,lo).clear(),Q(this,Ti).clear()})}getAll(){return Array.from(Q(this,lo))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>zx(n,s))}findAll(e={}){return this.getAll().filter(n=>zx(e,n))}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ln.batch(()=>Promise.all(e.map(n=>n.continue().catch(pa))))}},lo=new WeakMap,Ti=new WeakMap,qm=new WeakMap,p4);function U0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var oo,Cu,cr,uo,fo,c1,Fx,m4,B4=(m4=class extends ed{constructor(n,s){super();He(this,fo);He(this,oo);He(this,Cu);He(this,cr);He(this,uo);Oe(this,oo,n),this.setOptions(s),this.bindMethods(),Je(this,fo,c1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const s=this.options;this.options=Q(this,oo).defaultMutationOptions(n),_m(this.options,s)||Q(this,oo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Au(s.mutationKey)!==Au(this.options.mutationKey)?this.reset():((i=Q(this,cr))==null?void 0:i.state.status)==="pending"&&Q(this,cr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Q(this,cr))==null||n.removeObserver(this)}onMutationUpdate(n){Je(this,fo,c1).call(this),Je(this,fo,Fx).call(this,n)}getCurrentResult(){return Q(this,Cu)}reset(){var n;(n=Q(this,cr))==null||n.removeObserver(this),Oe(this,cr,void 0),Je(this,fo,c1).call(this),Je(this,fo,Fx).call(this)}mutate(n,s){var i;return Oe(this,uo,s),(i=Q(this,cr))==null||i.removeObserver(this),Oe(this,cr,Q(this,oo).getMutationCache().build(Q(this,oo),this.options)),Q(this,cr).addObserver(this),Q(this,cr).execute(n)}},oo=new WeakMap,Cu=new WeakMap,cr=new WeakMap,uo=new WeakMap,fo=new WeakSet,c1=function(){var s;const n=((s=Q(this,cr))==null?void 0:s.state)??H4();Oe(this,Cu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Fx=function(n){Ln.batch(()=>{var s,i,o,d,f,m,y,v;if(Q(this,uo)&&this.hasListeners()){const b=Q(this,Cu).variables,_=Q(this,Cu).context,j={client:Q(this,oo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=Q(this,uo)).onSuccess)==null||i.call(s,n.data,b,_,j)}catch(w){Promise.reject(w)}try{(d=(o=Q(this,uo)).onSettled)==null||d.call(o,n.data,null,b,_,j)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=Q(this,uo)).onError)==null||m.call(f,n.error,b,_,j)}catch(w){Promise.reject(w)}try{(v=(y=Q(this,uo)).onSettled)==null||v.call(y,void 0,n.error,b,_,j)}catch(w){Promise.reject(w)}}}this.listeners.forEach(b=>{b(Q(this,Cu))})})},m4);function D2(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function g9(t,e,n){const s=t.slice(0);return s[e]=n,s}var Vf,Cr,Qf,Xf,si,ju,Bm,Gm,Pm,Ym,rs,Zx,Ix,Jx,Wx,$x,g4,G4=(g4=class extends ed{constructor(e,n,s){super();He(this,rs);He(this,Vf);He(this,Cr);He(this,Qf);He(this,Xf);He(this,si);He(this,ju);He(this,Bm);He(this,Gm);He(this,Pm);He(this,Ym,[]);Oe(this,Vf,e),Oe(this,Xf,s),Oe(this,Qf,[]),Oe(this,si,[]),Oe(this,Cr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Q(this,si).forEach(e=>{e.subscribe(n=>{Je(this,rs,Wx).call(this,e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Q(this,si).forEach(e=>{e.destroy()})}setQueries(e,n){Oe(this,Qf,e),Oe(this,Xf,n),Ln.batch(()=>{const s=Q(this,si),i=Je(this,rs,Jx).call(this,Q(this,Qf));i.forEach(b=>b.observer.setOptions(b.defaultedQueryOptions));const o=i.map(b=>b.observer),d=o.map(b=>b.getCurrentResult()),f=s.length!==o.length,m=o.some((b,_)=>b!==s[_]),y=f||m,v=y?!0:d.some((b,_)=>{const j=Q(this,Cr)[_];return!j||!_m(b,j)});!y&&!v||(y&&(Oe(this,Ym,i),Oe(this,si,o)),Oe(this,Cr,d),this.hasListeners()&&(y&&(D2(s,o).forEach(b=>{b.destroy()}),D2(o,s).forEach(b=>{b.subscribe(_=>{Je(this,rs,Wx).call(this,b,_)})})),Je(this,rs,$x).call(this)))})}getCurrentResult(){return Q(this,Cr)}getQueries(){return Q(this,si).map(e=>e.getCurrentQuery())}getObservers(){return Q(this,si)}getOptimisticResult(e,n){const s=Je(this,rs,Jx).call(this,e),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>Je(this,rs,Ix).call(this,d??i,n,o),()=>Je(this,rs,Zx).call(this,i,s)]}},Vf=new WeakMap,Cr=new WeakMap,Qf=new WeakMap,Xf=new WeakMap,si=new WeakMap,ju=new WeakMap,Bm=new WeakMap,Gm=new WeakMap,Pm=new WeakMap,Ym=new WeakMap,rs=new WeakSet,Zx=function(e,n){return n.map((s,i)=>{const o=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,d=>{n.forEach(f=>{f.observer.trackProp(d)})})})},Ix=function(e,n,s){if(n){const i=Q(this,Pm),o=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!Q(this,ju)||Q(this,Cr)!==Q(this,Gm)||o||n!==Q(this,Bm))&&(Oe(this,Bm,n),Oe(this,Gm,Q(this,Cr)),s!==void 0&&Oe(this,Pm,s),Oe(this,ju,Vm(Q(this,ju),n(e)))),Q(this,ju)}return e},Jx=function(e){const n=new Map;Q(this,si).forEach(i=>{const o=i.options.queryHash;if(!o)return;const d=n.get(o);d?d.push(i):n.set(o,[i])});const s=[];return e.forEach(i=>{var m;const o=Q(this,Vf).defaultQueryOptions(i),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new rh(Q(this,Vf),o);s.push({defaultedQueryOptions:o,observer:f})}),s},Wx=function(e,n){const s=Q(this,si).indexOf(e);s!==-1&&(Oe(this,Cr,g9(Q(this,Cr),s,n)),Je(this,rs,$x).call(this))},$x=function(){var e;if(this.hasListeners()){const n=Q(this,ju),s=Je(this,rs,Zx).call(this,Q(this,Cr),Q(this,Ym)),i=Je(this,rs,Ix).call(this,s,(e=Q(this,Xf))==null?void 0:e.combine);n!==i&&Ln.batch(()=>{this.listeners.forEach(o=>{o(Q(this,Cr))})})}},g4),hl,y4,P4=(y4=class extends ed{constructor(e={}){super();He(this,hl);this.config=e,Oe(this,hl,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??Yb(i,n);let d=this.get(o);return d||(d=new M4({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(d)),d}add(e){Q(this,hl).has(e.queryHash)||(Q(this,hl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,hl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,hl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ln.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,hl).get(e)}getAll(){return[...Q(this,hl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Dx(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Dx(e,s)):n}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hl=new WeakMap,y4),sa,wu,Eu,Kf,Ff,Tu,Zf,If,x4,Y4=(x4=class{constructor(t={}){He(this,sa);He(this,wu);He(this,Eu);He(this,Kf);He(this,Ff);He(this,Tu);He(this,Zf);He(this,If);Oe(this,sa,t.queryCache||new P4),Oe(this,wu,t.mutationCache||new q4),Oe(this,Eu,t.defaultOptions||{}),Oe(this,Kf,new Map),Oe(this,Ff,new Map),Oe(this,Tu,0)}mount(){L0(this,Tu)._++,Q(this,Tu)===1&&(Oe(this,Zf,M1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,sa).onFocus())})),Oe(this,If,Cm.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,sa).onOnline())})))}unmount(){var t,e;L0(this,Tu)._--,Q(this,Tu)===0&&((t=Q(this,Zf))==null||t.call(this),Oe(this,Zf,void 0),(e=Q(this,If))==null||e.call(this),Oe(this,If,void 0))}isFetching(t){return Q(this,sa).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Q(this,wu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,sa).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,sa).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ou(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return Q(this,sa).findAll(t).map(({queryKey:e,state:n})=>{const s=n.data;return[e,s]})}setQueryData(t,e,n){const s=this.defaultQueryOptions({queryKey:t}),i=Q(this,sa).get(s.queryHash),o=i==null?void 0:i.state.data,d=W7(e,o);if(d!==void 0)return Q(this,sa).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(t,e,n){return Ln.batch(()=>Q(this,sa).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,sa).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,sa);Ln.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,sa);return Ln.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Ln.batch(()=>Q(this,sa).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(pa).catch(pa)}invalidateQueries(t,e={}){return Ln.batch(()=>(Q(this,sa).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=Ln.batch(()=>Q(this,sa).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(pa)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(pa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Q(this,sa).build(this,e);return n.isStaleByTime(Ou(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(pa).catch(pa)}fetchInfiniteQuery(t){return t.behavior=x1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(pa).catch(pa)}ensureInfiniteQueryData(t){return t.behavior=x1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Cm.isOnline()?Q(this,wu).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,sa)}getMutationCache(){return Q(this,wu)}getDefaultOptions(){return Q(this,Eu)}setDefaultOptions(t){Oe(this,Eu,t)}setQueryDefaults(t,e){Q(this,Kf).set(Au(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Q(this,Kf).values()],n={};return e.forEach(s=>{Jf(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){Q(this,Ff).set(Au(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Q(this,Ff).values()],n={};return e.forEach(s=>{Jf(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Q(this,Eu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Yb(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===D1&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Q(this,Eu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Q(this,sa).clear(),Q(this,wu).clear()}},sa=new WeakMap,wu=new WeakMap,Eu=new WeakMap,Kf=new WeakMap,Ff=new WeakMap,Tu=new WeakMap,Zf=new WeakMap,If=new WeakMap,x4);function y9({streamFn:t,refetchMode:e="reset",reducer:n=(i,o)=>N4(i,o),initialValue:s=[]}){return async i=>{const o=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),d=!!o&&o.isFetched();d&&e==="reset"&&o.setState({...o.resetState,fetchStatus:"fetching"});let f=s,m=!1;const y=C4({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>m=!0),v=await t(y),b=d&&e==="replace";for await(const _ of v){if(m)break;b?f=n(f,_):i.client.setQueryData(i.queryKey,j=>n(j===void 0?s:j,_))}return b&&!m&&i.client.setQueryData(i.queryKey,f),i.client.getQueryData(i.queryKey)??s}}var x9=Symbol("dataTagSymbol"),b9=Symbol("dataTagErrorSymbol"),v9=Symbol("unsetMarker"),Xb=D.createContext(void 0),wa=t=>{const e=D.useContext(Xb);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},V4=({client:t,children:e})=>(D.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(Xb.Provider,{value:t,children:e})),Q4=D.createContext(!1),Kb=()=>D.useContext(Q4),S9=Q4.Provider;function X4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var K4=D.createContext(X4()),Fb=()=>D.useContext(K4),N9=({children:t})=>{const[e]=D.useState(()=>X4());return h.jsx(K4.Provider,{value:e,children:typeof t=="function"?t(e):t})},F4=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?z1(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Z4=t=>{D.useEffect(()=>{t.clearReset()},[t])},I4=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||z1(n,[t.error,s])),Zb=(t,e)=>e.state.data===void 0,J4=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},_9=(t,e)=>t.isLoading&&t.isFetching&&!e,eb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,tb=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function W4({queries:t,...e},n){const s=wa(n),i=Kb(),o=Fb(),d=D.useMemo(()=>t.map(O=>{const R=s.defaultQueryOptions(O);return R._optimisticResults=i?"isRestoring":"optimistic",R}),[t,s,i]);d.forEach(O=>{J4(O);const R=s.getQueryCache().get(O.queryHash);F4(O,o,R)}),Z4(o);const[f]=D.useState(()=>new G4(s,d,e)),[m,y,v]=f.getOptimisticResult(d,e.combine),b=!i&&e.subscribed!==!1;D.useSyncExternalStore(D.useCallback(O=>b?f.subscribe(Ln.batchCalls(O)):pa,[f,b]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),D.useEffect(()=>{f.setQueries(d,e)},[d,e,f]);const j=m.some((O,R)=>eb(d[R],O))?m.flatMap((O,R)=>{const T=d[R];if(T&&eb(T,O)){const A=new rh(s,T);return tb(T,A,o)}return[]}):[];if(j.length>0)throw Promise.all(j);const w=m.find((O,R)=>{const T=d[R];return T&&I4({result:O,errorResetBoundary:o,throwOnError:T.throwOnError,query:s.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(w!=null&&w.error)throw w.error;return y(v())}function k1(t,e,n){var _,j,w,O;const s=Kb(),i=Fb(),o=wa(n),d=o.defaultQueryOptions(t);(j=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||j.call(_,d);const f=o.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",J4(d),F4(d,i,f),Z4(i);const m=!o.getQueryCache().get(d.queryHash),[y]=D.useState(()=>new e(o,d)),v=y.getOptimisticResult(d),b=!s&&t.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(R=>{const T=b?y.subscribe(Ln.batchCalls(R)):pa;return y.updateResult(),T},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),D.useEffect(()=>{y.setOptions(d)},[d,y]),eb(d,v))throw tb(d,y,i);if(I4({result:v,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;if((O=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||O.call(w,d,v),d.experimental_prefetchInRender&&!Wf.isServer()&&_9(v,s)){const R=m?tb(d,y,i):f==null?void 0:f.promise;R==null||R.catch(pa).finally(()=>{y.updateResult()})}return d.notifyOnChangeProps?v:y.trackResult(v)}function Ct(t,e){return k1(t,rh,e)}function C9(t,e){return k1({...t,enabled:!0,suspense:!0,throwOnError:Zb,placeholderData:void 0},rh,e)}function j9(t,e){return k1({...t,enabled:!0,suspense:!0,throwOnError:Zb},Qb,e)}function w9(t,e){return W4({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Zb,enabled:!0,placeholderData:void 0}))},e)}function E9(t,e){const n=wa(e);n.getQueryState(t.queryKey)||n.prefetchQuery(t)}function T9(t,e){const n=wa(e);n.getQueryState(t.queryKey)||n.prefetchInfiniteQuery(t)}function R9(t){return t}function O9(t){return t}var A9=({children:t,options:e={},state:n,queryClient:s})=>{const i=wa(s),o=D.useRef(e);D.useEffect(()=>{o.current=e});const d=D.useMemo(()=>{if(n){if(typeof n!="object")return;const f=i.getQueryCache(),m=n.queries||[],y=[],v=[];for(const b of m){const _=f.get(b.queryHash);_?(b.state.dataUpdatedAt>_.state.dataUpdatedAt||b.promise&&_.state.status!=="pending"&&_.state.fetchStatus!=="fetching"&&b.dehydratedAt!==void 0&&b.dehydratedAt>_.state.dataUpdatedAt)&&v.push(b):y.push(b)}if(y.length>0&&Hx(i,{queries:y},o.current),v.length>0)return v}},[i,n]);return D.useEffect(()=>{d&&Hx(i,{queries:d},o.current)},[i,d]),t};function M9(t,e){const n=wa(e),s=n.getQueryCache();return D.useSyncExternalStore(D.useCallback(i=>s.subscribe(Ln.batchCalls(i)),[s]),()=>n.isFetching(t),()=>n.isFetching(t))}function D9(t,e){const n=wa(e);return $4({filters:{...t,status:"pending"}},n).length}function z2(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function $4(t={},e){const n=wa(e).getMutationCache(),s=D.useRef(t),i=D.useRef(null);return i.current===null&&(i.current=z2(n,t)),D.useEffect(()=>{s.current=t}),D.useSyncExternalStore(D.useCallback(o=>n.subscribe(()=>{const d=Vm(i.current,z2(n,s.current));i.current!==d&&(i.current=d,Ln.schedule(o))}),[n]),()=>i.current,()=>i.current)}function ja(t,e){const n=wa(e),[s]=D.useState(()=>new B4(n,t));D.useEffect(()=>{s.setOptions(t)},[s,t]);const i=D.useSyncExternalStore(D.useCallback(d=>s.subscribe(Ln.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=D.useCallback((d,f)=>{s.mutate(d,f).catch(pa)},[s]);if(i.error&&z1(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function z9(t){return t}function k9(t,e){return k1(t,Qb,e)}const L9=Object.freeze(Object.defineProperty({__proto__:null,CancelledError:jm,HydrationBoundary:A9,InfiniteQueryObserver:Qb,IsRestoringProvider:S9,Mutation:U4,MutationCache:q4,MutationObserver:B4,QueriesObserver:G4,Query:M4,QueryCache:P4,QueryClient:Y4,QueryClientContext:Xb,QueryClientProvider:V4,QueryErrorResetBoundary:N9,QueryObserver:rh,dataTagErrorSymbol:b9,dataTagSymbol:x9,defaultScheduler:T4,defaultShouldDehydrateMutation:w4,defaultShouldDehydrateQuery:E4,dehydrate:l9,environmentManager:Wf,experimental_streamedQuery:y9,focusManager:M1,hashKey:Au,hydrate:Hx,infiniteQueryOptions:O9,isCancelledError:d9,isServer:v4,keepPreviousData:t9,matchMutation:zx,matchQuery:Dx,mutationOptions:z9,noop:pa,notifyManager:Ln,onlineManager:Cm,partialMatchKey:Jf,queryOptions:R9,replaceEqualDeep:Vm,shouldThrowError:z1,skipToken:D1,timeoutManager:Ru,unsetMarker:v9,useInfiniteQuery:k9,useIsFetching:M9,useIsMutating:D9,useIsRestoring:Kb,useMutation:ja,useMutationState:$4,usePrefetchInfiniteQuery:T9,usePrefetchQuery:E9,useQueries:W4,useQuery:Ct,useQueryClient:wa,useQueryErrorResetBoundary:Fb,useSuspenseInfiniteQuery:j9,useSuspenseQueries:w9,useSuspenseQuery:C9},Symbol.toStringTag,{value:"Module"}));function U9(){window.__camstack={React:$t,ReactDOM:K7,ReactQuery:L9}}/**
50
+ * react-router v7.13.1
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var k2="popstate";function L2(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function H9(t={}){function e(s,i){var y;let o=(y=i.state)==null?void 0:y.masked,{pathname:d,search:f,hash:m}=o||s.location;return nb("",{pathname:d,search:f,hash:m},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,i){return typeof i=="string"?i:wm(i)}return B9(e,n,null,t)}function Yn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ri(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function q9(){return Math.random().toString(36).substring(2,10)}function U2(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function nb(t,e,n=null,s,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ih(e):e,state:n,key:e&&e.key||s||q9(),unstable_mask:i}}function wm({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ih(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function B9(t,e,n,s={}){let{window:i=document.defaultView,v5Compat:o=!1}=s,d=i.history,f="POP",m=null,y=v();y==null&&(y=0,d.replaceState({...d.state,idx:y},""));function v(){return(d.state||{idx:null}).idx}function b(){f="POP";let R=v(),T=R==null?null:R-y;y=R,m&&m({action:f,location:O.location,delta:T})}function _(R,T){f="PUSH";let A=L2(R)?R:nb(O.location,R,T);y=v()+1;let z=U2(A,y),k=O.createHref(A.unstable_mask||A);try{d.pushState(z,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(k)}o&&m&&m({action:f,location:O.location,delta:1})}function j(R,T){f="REPLACE";let A=L2(R)?R:nb(O.location,R,T);y=v();let z=U2(A,y),k=O.createHref(A.unstable_mask||A);d.replaceState(z,"",k),o&&m&&m({action:f,location:O.location,delta:0})}function w(R){return G9(R)}let O={get action(){return f},get location(){return t(i,d)},listen(R){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(k2,b),m=R,()=>{i.removeEventListener(k2,b),m=null}},createHref(R){return e(i,R)},createURL:w,encodeLocation(R){let T=w(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:_,replace:j,go(R){return d.go(R)}};return O}function G9(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Yn(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:wm(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function eS(t,e,n="/"){return P9(t,e,n,!1)}function P9(t,e,n,s){let i=typeof e=="string"?ih(e):e,o=ho(i.pathname||"/",n);if(o==null)return null;let d=tS(t);Y9(d);let f=null;for(let m=0;f==null&&m<d.length;++m){let y=eN(o);f=W9(d[m],y,s)}return f}function tS(t,e=[],n=[],s="",i=!1){let o=(d,f,m=i,y)=>{let v={relativePath:y===void 0?d.path||"":y,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&m)return;Yn(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let b=ml([s,v.relativePath]),_=n.concat(v);d.children&&d.children.length>0&&(Yn(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),tS(d.children,e,_,b,m)),!(d.path==null&&!d.index)&&e.push({path:b,score:I9(b,d.index),routesMeta:_})};return t.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))o(d,f);else for(let y of nS(d.path))o(d,f,!0,y)}),e}function nS(t){let e=t.split("/");if(e.length===0)return[];let[n,...s]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return i?[o,""]:[o];let d=nS(s.join("/")),f=[];return f.push(...d.map(m=>m===""?o:[o,m].join("/"))),i&&f.push(...d),f.map(m=>t.startsWith("/")&&m===""?"/":m)}function Y9(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:J9(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var V9=/^:[\w-]+$/,Q9=3,X9=2,K9=1,F9=10,Z9=-2,H2=t=>t==="*";function I9(t,e){let n=t.split("/"),s=n.length;return n.some(H2)&&(s+=Z9),e&&(s+=X9),n.filter(i=>!H2(i)).reduce((i,o)=>i+(V9.test(o)?Q9:o===""?K9:F9),s)}function J9(t,e){return t.length===e.length&&t.slice(0,-1).every((s,i)=>s===e[i])?t[t.length-1]-e[e.length-1]:0}function W9(t,e,n=!1){let{routesMeta:s}=t,i={},o="/",d=[];for(let f=0;f<s.length;++f){let m=s[f],y=f===s.length-1,v=o==="/"?e:e.slice(o.length)||"/",b=b1({path:m.relativePath,caseSensitive:m.caseSensitive,end:y},v),_=m.route;if(!b&&y&&n&&!s[s.length-1].route.index&&(b=b1({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(i,b.params),d.push({params:i,pathname:ml([o,b.pathname]),pathnameBase:sN(ml([o,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(o=ml([o,b.pathnameBase]))}return d}function b1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=$9(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],d=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:s.reduce((y,{paramName:v,isOptional:b},_)=>{if(v==="*"){let w=f[_]||"";d=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const j=f[_];return b&&!j?y[v]=void 0:y[v]=(j||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:d,pattern:t}}function $9(t,e=!1,n=!0){Ri(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m,y,v)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let b=v.charAt(y+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),s]}function eN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ri(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ho(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,s=t.charAt(n);return s&&s!=="/"?null:t.slice(n)||"/"}var tN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function nN(t,e="/"){let{pathname:n,search:s="",hash:i=""}=typeof t=="string"?ih(t):t,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=q2(n.substring(1),"/"):o=q2(n,e)):o=e,{pathname:o,search:rN(s),hash:iN(i)}}function q2(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Xy(t,e,n,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. 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 aN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ib(t){let e=aN(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function L1(t,e,n,s=!1){let i;typeof t=="string"?i=ih(t):(i={...t},Yn(!i.pathname||!i.pathname.includes("?"),Xy("?","pathname","search",i)),Yn(!i.pathname||!i.pathname.includes("#"),Xy("#","pathname","hash",i)),Yn(!i.search||!i.search.includes("#"),Xy("#","search","hash",i)));let o=t===""||i.pathname==="",d=o?"/":i.pathname,f;if(d==null)f=n;else{let b=e.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),b-=1;i.pathname=_.join("/")}f=b>=0?e[b]:"/"}let m=nN(i,f),y=d&&d!=="/"&&d.endsWith("/"),v=(o||d===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(y||v)&&(m.pathname+="/"),m}var ml=t=>t.join("/").replace(/\/\/+/g,"/"),sN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),rN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,iN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,lN=class{constructor(t,e,n,s=!1){this.status=t,this.statusText=e||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function oN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function uN(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sS(t,e){let n=t;if(typeof n!="string"||!tN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(aS)try{let o=new URL(window.location.href),d=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ho(d.pathname,e);d.origin===o.origin&&f!=null?n=f+d.search+d.hash:i=!0}catch{Ri(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var rS=["POST","PUT","PATCH","DELETE"];new Set(rS);var cN=["GET",...rS];new Set(cN);var lh=D.createContext(null);lh.displayName="DataRouter";var U1=D.createContext(null);U1.displayName="DataRouterState";var dN=D.createContext(!1),iS=D.createContext({isTransitioning:!1});iS.displayName="ViewTransition";var fN=D.createContext(new Map);fN.displayName="Fetchers";var hN=D.createContext(null);hN.displayName="Await";var Tr=D.createContext(null);Tr.displayName="Navigation";var Qm=D.createContext(null);Qm.displayName="Location";var oi=D.createContext({outlet:null,matches:[],isDataRoute:!1});oi.displayName="Route";var Jb=D.createContext(null);Jb.displayName="RouteError";var lS="REACT_ROUTER_ERROR",pN="REDIRECT",mN="ROUTE_ERROR_RESPONSE";function gN(t){if(t.startsWith(`${lS}:${pN}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function yN(t){if(t.startsWith(`${lS}:${mN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new lN(e.status,e.statusText,e.data)}catch{}}function xN(t,{relative:e}={}){Yn(oh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=D.useContext(Tr),{hash:i,pathname:o,search:d}=Xm(t,{relative:e}),f=o;return n!=="/"&&(f=o==="/"?n:ml([n,o])),s.createHref({pathname:f,search:d,hash:i})}function oh(){return D.useContext(Qm)!=null}function yl(){return Yn(oh(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Qm).location}var oS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uS(t){D.useContext(Tr).static||D.useLayoutEffect(t)}function xl(){let{isDataRoute:t}=D.useContext(oi);return t?DN():bN()}function bN(){Yn(oh(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(lh),{basename:e,navigator:n}=D.useContext(Tr),{matches:s}=D.useContext(oi),{pathname:i}=yl(),o=JSON.stringify(Ib(s)),d=D.useRef(!1);return uS(()=>{d.current=!0}),D.useCallback((m,y={})=>{if(Ri(d.current,oS),!d.current)return;if(typeof m=="number"){n.go(m);return}let v=L1(m,JSON.parse(o),i,y.relative==="path");t==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:ml([e,v.pathname])),(y.replace?n.replace:n.push)(v,y.state,y)},[e,n,o,i,t])}var vN=D.createContext(null);function SN(t){let e=D.useContext(oi).outlet;return D.useMemo(()=>e&&D.createElement(vN.Provider,{value:t},e),[e,t])}function Wb(){let{matches:t}=D.useContext(oi),e=t[t.length-1];return e?e.params:{}}function Xm(t,{relative:e}={}){let{matches:n}=D.useContext(oi),{pathname:s}=yl(),i=JSON.stringify(Ib(n));return D.useMemo(()=>L1(t,JSON.parse(i),s,e==="path"),[t,i,s,e])}function NN(t,e){return cS(t,e)}function cS(t,e,n){var R;Yn(oh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=D.useContext(Tr),{matches:i}=D.useContext(oi),o=i[i.length-1],d=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",y=o&&o.route;{let T=y&&y.path||"";fS(f,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) 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.
59
+
60
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=yl(),b;if(e){let T=typeof e=="string"?ih(e):e;Yn(m==="/"||((R=T.pathname)==null?void 0:R.startsWith(m)),`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 "${m}" but pathname "${T.pathname}" was given in the \`location\` prop.`),b=T}else b=v;let _=b.pathname||"/",j=_;if(m!=="/"){let T=m.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(T.length).join("/")}let w=eS(t,{pathname:j});Ri(y||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ri(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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 O=EN(w&&w.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:ml([m,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:ml([m,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),i,n);return e&&O?D.createElement(Qm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},O):O}function _N(){let t=MN(),e=oN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:o},"ErrorBoundary")," or"," ",D.createElement("code",{style:o},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),n?D.createElement("pre",{style:i},n):null,d)}var CN=D.createElement(_N,null),dS=class extends D.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=yN(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(oi.Provider,{value:this.props.routeContext},D.createElement(Jb.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(jN,{error:t},e):e}};dS.contextType=dN;var Ky=new WeakMap;function jN({children:t,error:e}){let{basename:n}=D.useContext(Tr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=gN(e.digest);if(s){let i=Ky.get(e);if(i)throw i;let o=sS(s.location,n);if(aS&&!Ky.get(e))if(o.isExternal||s.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:s.replace}));throw Ky.set(e,d),d}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function wN({routeContext:t,match:e,children:n}){let s=D.useContext(lh);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),D.createElement(oi.Provider,{value:t},n)}function EN(t,e=[],n){let s=n==null?void 0:n.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(e.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let i=t,o=s==null?void 0:s.errors;if(o!=null){let v=i.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);Yn(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,v+1))}let d=!1,f=-1;if(n&&s){d=s.renderFallback;for(let v=0;v<i.length;v++){let b=i[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=v),b.route.id){let{loaderData:_,errors:j}=s,w=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.route.lazy||w){n.isStatic&&(d=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let m=n==null?void 0:n.onError,y=s&&m?(v,b)=>{var _,j;m(v,{location:s.location,params:((j=(_=s.matches)==null?void 0:_[0])==null?void 0:j.params)??{},unstable_pattern:uN(s.matches),errorInfo:b})}:void 0;return i.reduceRight((v,b,_)=>{let j,w=!1,O=null,R=null;s&&(j=o&&b.route.id?o[b.route.id]:void 0,O=b.route.errorElement||CN,d&&(f<0&&_===0?(fS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):f===_&&(w=!0,R=b.route.hydrateFallbackElement||null)));let T=e.concat(i.slice(0,_+1)),A=()=>{let z;return j?z=O:w?z=R:b.route.Component?z=D.createElement(b.route.Component,null):b.route.element?z=b.route.element:z=v,D.createElement(wN,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:s!=null},children:z})};return s&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?D.createElement(dS,{location:s.location,revalidation:s.revalidation,component:O,error:j,children:A(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:y}):A()},null)}function $b(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function TN(t){let e=D.useContext(lh);return Yn(e,$b(t)),e}function RN(t){let e=D.useContext(U1);return Yn(e,$b(t)),e}function ON(t){let e=D.useContext(oi);return Yn(e,$b(t)),e}function ev(t){let e=ON(t),n=e.matches[e.matches.length-1];return Yn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function AN(){return ev("useRouteId")}function MN(){var s;let t=D.useContext(Jb),e=RN("useRouteError"),n=ev("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function DN(){let{router:t}=TN("useNavigate"),e=ev("useNavigate"),n=D.useRef(!1);return uS(()=>{n.current=!0}),D.useCallback(async(i,o={})=>{Ri(n.current,oS),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...o}))},[t,e])}var B2={};function fS(t,e,n){!e&&!B2[t]&&(B2[t]=!0,Ri(!1,n))}D.memo(zN);function zN({routes:t,future:e,state:n,isStatic:s,onError:i}){return cS(t,void 0,{state:n,isStatic:s,onError:i})}function ab({to:t,replace:e,state:n,relative:s}){Yn(oh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=D.useContext(Tr);Ri(!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:o}=D.useContext(oi),{pathname:d}=yl(),f=xl(),m=L1(t,Ib(o),d,s==="path"),y=JSON.stringify(m);return D.useEffect(()=>{f(JSON.parse(y),{replace:e,state:n,relative:s})},[f,y,s,e,n]),null}function kN(t){return SN(t.context)}function La(t){Yn(!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 LN({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:i,static:o=!1,unstable_useTransitions:d}){Yn(!oh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),m=D.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:d,future:{}}),[f,i,o,d]);typeof n=="string"&&(n=ih(n));let{pathname:y="/",search:v="",hash:b="",state:_=null,key:j="default",unstable_mask:w}=n,O=D.useMemo(()=>{let R=ho(y,f);return R==null?null:{location:{pathname:R,search:v,hash:b,state:_,key:j,unstable_mask:w},navigationType:s}},[f,y,v,b,_,j,s,w]);return Ri(O!=null,`<Router basename="${f}"> is not able to match the URL "${y}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:D.createElement(Tr.Provider,{value:m},D.createElement(Qm.Provider,{children:e,value:O}))}function UN({children:t,location:e}){return NN(sb(t),e)}function sb(t,e=[]){let n=[];return D.Children.forEach(t,(s,i)=>{if(!D.isValidElement(s))return;let o=[...e,i];if(s.type===D.Fragment){n.push.apply(n,sb(s.props.children,o));return}Yn(s.type===La,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Yn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let d={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(d.children=sb(s.props.children,o)),n.push(d)}),n}var d1="get",f1="application/x-www-form-urlencoded";function H1(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function HN(t){return H1(t)&&t.tagName.toLowerCase()==="button"}function qN(t){return H1(t)&&t.tagName.toLowerCase()==="form"}function BN(t){return H1(t)&&t.tagName.toLowerCase()==="input"}function GN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function PN(t,e){return t.button===0&&(!e||e==="_self")&&!GN(t)}var H0=null;function YN(){if(H0===null)try{new FormData(document.createElement("form"),0),H0=!1}catch{H0=!0}return H0}var VN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fy(t){return t!=null&&!VN.has(t)?(Ri(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${f1}"`),null):t}function QN(t,e){let n,s,i,o,d;if(qN(t)){let f=t.getAttribute("action");s=f?ho(f,e):null,n=t.getAttribute("method")||d1,i=Fy(t.getAttribute("enctype"))||f1,o=new FormData(t)}else if(HN(t)||BN(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||f.getAttribute("action");if(s=m?ho(m,e):null,n=t.getAttribute("formmethod")||f.getAttribute("method")||d1,i=Fy(t.getAttribute("formenctype"))||Fy(f.getAttribute("enctype"))||f1,o=new FormData(f,t),!YN()){let{name:y,type:v,value:b}=t;if(v==="image"){let _=y?`${y}.`:"";o.append(`${_}x`,"0"),o.append(`${_}y`,"0")}else y&&o.append(y,b)}}else{if(H1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=d1,s=null,i=f1,d=t}return o&&i==="text/plain"&&(d=o,o=void 0),{action:s,method:n.toLowerCase(),encType:i,formData:o,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function tv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function XN(t,e,n,s){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:e&&ho(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function KN(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FN(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function ZN(t,e,n){let s=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let d=await KN(o,n);return d.links?d.links():[]}return[]}));return $N(s.flat(1).filter(FN).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function G2(t,e,n,s,i,o){let d=(m,y)=>n[y]?m.route.id!==n[y].route.id:!0,f=(m,y)=>{var v;return n[y].pathname!==m.pathname||((v=n[y].route.path)==null?void 0:v.endsWith("*"))&&n[y].params["*"]!==m.params["*"]};return o==="assets"?e.filter((m,y)=>d(m,y)||f(m,y)):o==="data"?e.filter((m,y)=>{var b;let v=s.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,y)||f(m,y))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function IN(t,e,{includeHydrateFallback:n}={}){return JN(t.map(s=>{let i=e.routes[s.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function JN(t){return[...new Set(t)]}function WN(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function $N(t,e){let n=new Set;return new Set(e),t.reduce((s,i)=>{let o=JSON.stringify(WN(i));return n.has(o)||(n.add(o),s.push({key:o,link:i})),s},[])}function hS(){let t=D.useContext(lh);return tv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function e_(){let t=D.useContext(U1);return tv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var nv=D.createContext(void 0);nv.displayName="FrameworkContext";function pS(){let t=D.useContext(nv);return tv(t,"You must render this element inside a <HydratedRouter> element"),t}function t_(t,e){let n=D.useContext(nv),[s,i]=D.useState(!1),[o,d]=D.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:y,onMouseLeave:v,onTouchStart:b}=e,_=D.useRef(null);D.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let O=T=>{T.forEach(A=>{d(A.isIntersecting)})},R=new IntersectionObserver(O,{threshold:.5});return _.current&&R.observe(_.current),()=>{R.disconnect()}}},[t]),D.useEffect(()=>{if(s){let O=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(O)}}},[s]);let j=()=>{i(!0)},w=()=>{i(!1),d(!1)};return n?t!=="intent"?[o,_,{}]:[o,_,{onFocus:Qp(f,j),onBlur:Qp(m,w),onMouseEnter:Qp(y,j),onMouseLeave:Qp(v,w),onTouchStart:Qp(b,j)}]:[!1,_,{}]}function Qp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function n_({page:t,...e}){let{router:n}=hS(),s=D.useMemo(()=>eS(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?D.createElement(s_,{page:t,matches:s,...e}):null}function a_(t){let{manifest:e,routeModules:n}=pS(),[s,i]=D.useState([]);return D.useEffect(()=>{let o=!1;return ZN(t,e,n).then(d=>{o||i(d)}),()=>{o=!0}},[t,e,n]),s}function s_({page:t,matches:e,...n}){let s=yl(),{future:i,manifest:o,routeModules:d}=pS(),{basename:f}=hS(),{loaderData:m,matches:y}=e_(),v=D.useMemo(()=>G2(t,e,y,o,s,"data"),[t,e,y,o,s]),b=D.useMemo(()=>G2(t,e,y,o,s,"assets"),[t,e,y,o,s]),_=D.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let O=new Set,R=!1;if(e.forEach(A=>{var k;let z=o.routes[A.route.id];!z||!z.hasLoader||(!v.some(P=>P.route.id===A.route.id)&&A.route.id in m&&((k=d[A.route.id])!=null&&k.shouldRevalidate)||z.hasClientLoader?R=!0:O.add(A.route.id))}),O.size===0)return[];let T=XN(t,f,i.unstable_trailingSlashAwareDataRequests,"data");return R&&O.size>0&&T.searchParams.set("_routes",e.filter(A=>O.has(A.route.id)).map(A=>A.route.id).join(",")),[T.pathname+T.search]},[f,i.unstable_trailingSlashAwareDataRequests,m,s,o,v,e,t,d]),j=D.useMemo(()=>IN(b,o),[b,o]),w=a_(b);return D.createElement(D.Fragment,null,_.map(O=>D.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...n})),j.map(O=>D.createElement("link",{key:O,rel:"modulepreload",href:O,...n})),w.map(({key:O,link:R})=>D.createElement("link",{key:O,nonce:n.nonce,...R,crossOrigin:R.crossOrigin??n.crossOrigin})))}function r_(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var i_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{i_&&(window.__reactRouterVersion="7.13.1")}catch{}function l_({basename:t,children:e,unstable_useTransitions:n,window:s}){let i=D.useRef();i.current==null&&(i.current=H9({window:s,v5Compat:!0}));let o=i.current,[d,f]=D.useState({action:o.action,location:o.location}),m=D.useCallback(y=>{n===!1?f(y):D.startTransition(()=>f(y))},[n]);return D.useLayoutEffect(()=>o.listen(m),[o,m]),D.createElement(LN,{basename:t,children:e,location:d.location,navigationType:d.action,navigator:o,unstable_useTransitions:n})}var mS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,av=D.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:i,reloadDocument:o,replace:d,unstable_mask:f,state:m,target:y,to:v,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:j,...w},O){let{basename:R,navigator:T,unstable_useTransitions:A}=D.useContext(Tr),z=typeof v=="string"&&mS.test(v),k=sS(v,R);v=k.to;let P=xN(v,{relative:i}),H=yl(),B=null;if(f){let ce=L1(f,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);R!=="/"&&(ce.pathname=ce.pathname==="/"?R:ml([R,ce.pathname])),B=T.createHref(ce)}let[L,V,Z]=t_(s,w),oe=d_(v,{replace:d,unstable_mask:f,state:m,target:y,preventScrollReset:b,relative:i,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:A});function ne(ce){e&&e(ce),ce.defaultPrevented||oe(ce)}let J=!(k.isExternal||o),ie=D.createElement("a",{...w,...Z,href:(J?B:void 0)||k.absoluteURL||P,onClick:J?ne:e,ref:r_(O,V),target:y,"data-discover":!z&&n==="render"?"true":void 0});return L&&!z?D.createElement(D.Fragment,null,ie,D.createElement(n_,{page:P})):ie});av.displayName="Link";var o_=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:i=!1,style:o,to:d,viewTransition:f,children:m,...y},v){let b=Xm(d,{relative:y.relative}),_=yl(),j=D.useContext(U1),{navigator:w,basename:O}=D.useContext(Tr),R=j!=null&&g_(b)&&f===!0,T=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,A=_.pathname,z=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;n||(A=A.toLowerCase(),z=z?z.toLowerCase():null,T=T.toLowerCase()),z&&O&&(z=ho(z,O)||z);const k=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=A===T||!i&&A.startsWith(T)&&A.charAt(k)==="/",H=z!=null&&(z===T||!i&&z.startsWith(T)&&z.charAt(T.length)==="/"),B={isActive:P,isPending:H,isTransitioning:R},L=P?e:void 0,V;typeof s=="function"?V=s(B):V=[s,P?"active":null,H?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let Z=typeof o=="function"?o(B):o;return D.createElement(av,{...y,"aria-current":L,className:V,ref:v,style:Z,to:d,viewTransition:f},typeof m=="function"?m(B):m)});o_.displayName="NavLink";var u_=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:i,state:o,method:d=d1,action:f,onSubmit:m,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_,...j},w)=>{let{unstable_useTransitions:O}=D.useContext(Tr),R=p_(),T=m_(f,{relative:y}),A=d.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&mS.test(f),k=P=>{if(m&&m(P),P.defaultPrevented)return;P.preventDefault();let H=P.nativeEvent.submitter,B=(H==null?void 0:H.getAttribute("formmethod"))||d,L=()=>R(H||P.currentTarget,{fetcherKey:e,method:B,navigate:n,replace:i,state:o,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_});O&&n!==!1?D.startTransition(()=>L()):L()};return D.createElement("form",{ref:w,method:A,action:T,onSubmit:s?m:k,...j,"data-discover":!z&&t==="render"?"true":void 0})});u_.displayName="Form";function c_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gS(t){let e=D.useContext(lh);return Yn(e,c_(t)),e}function d_(t,{target:e,replace:n,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:y}={}){let v=xl(),b=yl(),_=Xm(t,{relative:d});return D.useCallback(j=>{if(PN(j,e)){j.preventDefault();let w=n!==void 0?n:wm(b)===wm(_),O=()=>v(t,{replace:w,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:m});y?D.startTransition(()=>O()):O()}},[b,v,_,n,s,i,e,t,o,d,f,m,y])}var f_=0,h_=()=>`__${String(++f_)}__`;function p_(){let{router:t}=gS("useSubmit"),{basename:e}=D.useContext(Tr),n=AN(),s=t.fetch,i=t.navigate;return D.useCallback(async(o,d={})=>{let{action:f,method:m,encType:y,formData:v,body:b}=QN(o,e);if(d.navigate===!1){let _=d.fetcherKey||h_();await s(_,n,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||m,formEncType:d.encType||y,flushSync:d.flushSync})}else await i(d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||m,formEncType:d.encType||y,replace:d.replace,state:d.state,fromRouteId:n,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,e,n])}function m_(t,{relative:e}={}){let{basename:n}=D.useContext(Tr),s=D.useContext(oi);Yn(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),o={...Xm(t||".",{relative:e})},d=yl();if(t==null){o.search=d.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(v=>v==="")){f.delete("index"),m.filter(b=>b).forEach(b=>f.append("index",b));let v=f.toString();o.search=v?`?${v}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ml([n,o.pathname])),wm(o)}function g_(t,{relative:e}={}){let n=D.useContext(iS);Yn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=gS("useViewTransitionState"),i=Xm(t,{relative:e});if(!n.isTransitioning)return!1;let o=ho(n.currentLocation.pathname,s)||n.currentLocation.pathname,d=ho(n.nextLocation.pathname,s)||n.nextLocation.pathname;return b1(i.pathname,d)!=null||b1(i.pathname,o)!=null}const yS=D.createContext(null),Zy=["dark","light","system"];function xS(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function y_(t,e){if(typeof window>"u")return e;const n=localStorage.getItem(t);return n==="dark"||n==="light"||n==="system"?n:e}function P2(t){return t==="system"?xS():t}function x_({children:t,defaultMode:e="system",storageKey:n="camstack-theme-mode"}){const[s,i]=D.useState(()=>y_(n,e)),[o,d]=D.useState(()=>P2(s)),f=D.useCallback(v=>{i(v),d(P2(v)),typeof window<"u"&&localStorage.setItem(n,v)},[n]),m=D.useCallback(()=>{const b=(Zy.indexOf(s)+1)%Zy.length;f(Zy[b]??"dark")},[s,f]);D.useEffect(()=>{if(typeof document>"u")return;const v=document.documentElement;v.classList.remove("dark","light"),v.classList.add(o)},[s,o]),D.useEffect(()=>{if(typeof window>"u"||s!=="system")return;const v=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{d(xS())};return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},[s]);const y=D.useMemo(()=>({mode:s,resolvedMode:o,setMode:f,toggleMode:m}),[s,o,f,m]);return h.jsx(yS.Provider,{value:y,children:t})}function bS(){const t=D.useContext(yS);if(!t)throw new Error("useThemeMode must be used within a ThemeProvider");return t}function vS(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=vS(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Km(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=vS(t))&&(s&&(s+=" "),s+=e);return s}const b_=(t,e)=>{const n=new Array(t.length+e.length);for(let s=0;s<t.length;s++)n[s]=t[s];for(let s=0;s<e.length;s++)n[t.length+s]=e[s];return n},v_=(t,e)=>({classGroupId:t,validator:e}),SS=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),v1="-",Y2=[],S_="arbitrary..",N_=t=>{const e=C_(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return __(d);const f=d.split(v1),m=f[0]===""&&f.length>1?1:0;return NS(f,m,e)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=s[d],y=n[d];return m?y?b_(y,m):m:y||Y2}return n[d]||Y2}}},NS=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],o=n.nextPart.get(i);if(o){const y=NS(t,e+1,o);if(y)return y}const d=n.validators;if(d===null)return;const f=e===0?t.join(v1):t.slice(e).join(v1),m=d.length;for(let y=0;y<m;y++){const v=d[y];if(v.validator(f))return v.classGroupId}},__=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),s=e.slice(0,n);return s?S_+s:void 0})(),C_=t=>{const{theme:e,classGroups:n}=t;return j_(n,e)},j_=(t,e)=>{const n=SS();for(const s in t){const i=t[s];sv(i,n,s,e)}return n},sv=(t,e,n,s)=>{const i=t.length;for(let o=0;o<i;o++){const d=t[o];w_(d,e,n,s)}},w_=(t,e,n,s)=>{if(typeof t=="string"){E_(t,e,n);return}if(typeof t=="function"){T_(t,e,n,s);return}R_(t,e,n,s)},E_=(t,e,n)=>{const s=t===""?e:_S(e,t);s.classGroupId=n},T_=(t,e,n,s)=>{if(O_(t)){sv(t(s),e,n,s);return}e.validators===null&&(e.validators=[]),e.validators.push(v_(n,t))},R_=(t,e,n,s)=>{const i=Object.entries(t),o=i.length;for(let d=0;d<o;d++){const[f,m]=i[d];sv(m,_S(e,f),n,s)}},_S=(t,e)=>{let n=t;const s=e.split(v1),i=s.length;for(let o=0;o<i;o++){const d=s[o];let f=n.nextPart.get(d);f||(f=SS(),n.nextPart.set(d,f)),n=f}return n},O_=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,A_=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),s=Object.create(null);const i=(o,d)=>{n[o]=d,e++,e>t&&(e=0,s=n,n=Object.create(null))};return{get(o){let d=n[o];if(d!==void 0)return d;if((d=s[o])!==void 0)return i(o,d),d},set(o,d){o in n?n[o]=d:i(o,d)}}},rb="!",V2=":",M_=[],Q2=(t,e,n,s,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),D_=t=>{const{prefix:e,experimentalParseClassName:n}=t;let s=i=>{const o=[];let d=0,f=0,m=0,y;const v=i.length;for(let O=0;O<v;O++){const R=i[O];if(d===0&&f===0){if(R===V2){o.push(i.slice(m,O)),m=O+1;continue}if(R==="/"){y=O;continue}}R==="["?d++:R==="]"?d--:R==="("?f++:R===")"&&f--}const b=o.length===0?i:i.slice(m);let _=b,j=!1;b.endsWith(rb)?(_=b.slice(0,-1),j=!0):b.startsWith(rb)&&(_=b.slice(1),j=!0);const w=y&&y>m?y-m:void 0;return Q2(o,j,_,w)};if(e){const i=e+V2,o=s;s=d=>d.startsWith(i)?o(d.slice(i.length)):Q2(M_,!1,d,void 0,!0)}if(n){const i=s;s=o=>n({className:o,parseClassName:i})}return s},z_=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,s)=>{e.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let o=0;o<n.length;o++){const d=n[o],f=d[0]==="[",m=e.has(d);f||m?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(d)):i.push(d)}return i.length>0&&(i.sort(),s.push(...i)),s}},k_=t=>({cache:A_(t.cacheSize),parseClassName:D_(t),sortModifiers:z_(t),...N_(t)}),L_=/\s+/,U_=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:o}=e,d=[],f=t.trim().split(L_);let m="";for(let y=f.length-1;y>=0;y-=1){const v=f[y],{isExternal:b,modifiers:_,hasImportantModifier:j,baseClassName:w,maybePostfixModifierPosition:O}=n(v);if(b){m=v+(m.length>0?" "+m:m);continue}let R=!!O,T=s(R?w.substring(0,O):w);if(!T){if(!R){m=v+(m.length>0?" "+m:m);continue}if(T=s(w),!T){m=v+(m.length>0?" "+m:m);continue}R=!1}const A=_.length===0?"":_.length===1?_[0]:o(_).join(":"),z=j?A+rb:A,k=z+T;if(d.indexOf(k)>-1)continue;d.push(k);const P=i(T,R);for(let H=0;H<P.length;++H){const B=P[H];d.push(z+B)}m=v+(m.length>0?" "+m:m)}return m},H_=(...t)=>{let e=0,n,s,i="";for(;e<t.length;)(n=t[e++])&&(s=CS(n))&&(i&&(i+=" "),i+=s);return i},CS=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=CS(t[s]))&&(n&&(n+=" "),n+=e);return n},q_=(t,...e)=>{let n,s,i,o;const d=m=>{const y=e.reduce((v,b)=>b(v),t());return n=k_(y),s=n.cache.get,i=n.cache.set,o=f,f(m)},f=m=>{const y=s(m);if(y)return y;const v=U_(m,n);return i(m,v),v};return o=d,(...m)=>o(H_(...m))},B_=[],ka=t=>{const e=n=>n[t]||B_;return e.isThemeGetter=!0,e},jS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,G_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,P_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,V_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uu=t=>G_.test(t),_t=t=>!!t&&!Number.isNaN(Number(t)),cu=t=>!!t&&Number.isInteger(Number(t)),Iy=t=>t.endsWith("%")&&_t(t.slice(0,-1)),$l=t=>P_.test(t),ES=()=>!0,K_=t=>Y_.test(t)&&!V_.test(t),rv=()=>!1,F_=t=>Q_.test(t),Z_=t=>X_.test(t),I_=t=>!Be(t)&&!Ge(t),J_=t=>zu(t,OS,rv),Be=t=>jS.test(t),Ac=t=>zu(t,AS,K_),X2=t=>zu(t,rC,_t),W_=t=>zu(t,DS,ES),$_=t=>zu(t,MS,rv),K2=t=>zu(t,TS,rv),eC=t=>zu(t,RS,Z_),q0=t=>zu(t,zS,F_),Ge=t=>wS.test(t),Xp=t=>td(t,AS),tC=t=>td(t,MS),F2=t=>td(t,TS),nC=t=>td(t,OS),aC=t=>td(t,RS),B0=t=>td(t,zS,!0),sC=t=>td(t,DS,!0),zu=(t,e,n)=>{const s=jS.exec(t);return s?s[1]?e(s[1]):n(s[2]):!1},td=(t,e,n=!1)=>{const s=wS.exec(t);return s?s[1]?e(s[1]):n:!1},TS=t=>t==="position"||t==="percentage",RS=t=>t==="image"||t==="url",OS=t=>t==="length"||t==="size"||t==="bg-size",AS=t=>t==="length",rC=t=>t==="number",MS=t=>t==="family-name",DS=t=>t==="number"||t==="weight",zS=t=>t==="shadow",iC=()=>{const t=ka("color"),e=ka("font"),n=ka("text"),s=ka("font-weight"),i=ka("tracking"),o=ka("leading"),d=ka("breakpoint"),f=ka("container"),m=ka("spacing"),y=ka("radius"),v=ka("shadow"),b=ka("inset-shadow"),_=ka("text-shadow"),j=ka("drop-shadow"),w=ka("blur"),O=ka("perspective"),R=ka("aspect"),T=ka("ease"),A=ka("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...k(),Ge,Be],H=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],L=()=>[Ge,Be,m],V=()=>[uu,"full","auto",...L()],Z=()=>[cu,"none","subgrid",Ge,Be],oe=()=>["auto",{span:["full",cu,Ge,Be]},cu,Ge,Be],ne=()=>[cu,"auto",Ge,Be],J=()=>["auto","min","max","fr",Ge,Be],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...L()],$=()=>[uu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],ae=()=>[uu,"screen","full","dvw","lvw","svw","min","max","fit",...L()],Ne=()=>[uu,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],re=()=>[t,Ge,Be],G=()=>[...k(),F2,K2,{position:[Ge,Be]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",nC,J_,{size:[Ge,Be]}],xe=()=>[Iy,Xp,Ac],_e=()=>["","none","full",y,Ge,Be],je=()=>["",_t,Xp,Ac],De=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>[_t,Iy,F2,K2],Vt=()=>["","none",w,Ge,Be],$e=()=>["none",_t,Ge,Be],At=()=>["none",_t,Ge,Be],qt=()=>[_t,Ge,Be],wn=()=>[uu,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$l],breakpoint:[$l],color:[ES],container:[$l],"drop-shadow":[$l],ease:["in","out","in-out"],font:[I_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$l],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$l],shadow:[$l],spacing:["px",_t],text:[$l],"text-shadow":[$l],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",uu,Be,Ge,R]}],container:["container"],columns:[{columns:[_t,Be,Ge,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[cu,"auto",Ge,Be]}],basis:[{basis:[uu,"full","auto",f,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_t,uu,"auto","initial","none",Be]}],grow:[{grow:["",_t,Ge,Be]}],shrink:[{shrink:["",_t,Ge,Be]}],order:[{order:[cu,"first","last","none",Ge,Be]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...Ne()]}],"min-block-size":[{"min-block":["auto",...Ne()]}],"max-block-size":[{"max-block":["none",...Ne()]}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Xp,Ac]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,sC,W_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Iy,Be]}],"font-family":[{font:[tC,$_,e]}],"font-features":[{"font-features":[Be]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ge,Be]}],"line-clamp":[{"line-clamp":[_t,"none",Ge,X2]}],leading:[{leading:[o,...L()]}],"list-image":[{"list-image":["none",Ge,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[_t,"from-font","auto",Ge,Ac]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[_t,"auto",Ge,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cu,Ge,Be],radial:["",Ge,Be],conic:[cu,Ge,Be]},aC,eC]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:xe()}],"gradient-via-pos":[{via:xe()}],"gradient-to-pos":[{to:xe()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:_e()}],"rounded-s":[{"rounded-s":_e()}],"rounded-e":[{"rounded-e":_e()}],"rounded-t":[{"rounded-t":_e()}],"rounded-r":[{"rounded-r":_e()}],"rounded-b":[{"rounded-b":_e()}],"rounded-l":[{"rounded-l":_e()}],"rounded-ss":[{"rounded-ss":_e()}],"rounded-se":[{"rounded-se":_e()}],"rounded-ee":[{"rounded-ee":_e()}],"rounded-es":[{"rounded-es":_e()}],"rounded-tl":[{"rounded-tl":_e()}],"rounded-tr":[{"rounded-tr":_e()}],"rounded-br":[{"rounded-br":_e()}],"rounded-bl":[{"rounded-bl":_e()}],"border-w":[{border:je()}],"border-w-x":[{"border-x":je()}],"border-w-y":[{"border-y":je()}],"border-w-s":[{"border-s":je()}],"border-w-e":[{"border-e":je()}],"border-w-bs":[{"border-bs":je()}],"border-w-be":[{"border-be":je()}],"border-w-t":[{"border-t":je()}],"border-w-r":[{"border-r":je()}],"border-w-b":[{"border-b":je()}],"border-w-l":[{"border-l":je()}],"divide-x":[{"divide-x":je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-bs":[{"border-bs":re()}],"border-color-be":[{"border-be":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_t,Ge,Be]}],"outline-w":[{outline:["",_t,Xp,Ac]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",v,B0,q0]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",b,B0,q0]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[_t,Ac]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":je()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",_,B0,q0]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[_t,Ge,Be]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_t]}],"mask-image-linear-from-pos":[{"mask-linear-from":ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":ze()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":ze()}],"mask-image-t-to-pos":[{"mask-t-to":ze()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":ze()}],"mask-image-r-to-pos":[{"mask-r-to":ze()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":ze()}],"mask-image-b-to-pos":[{"mask-b-to":ze()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":ze()}],"mask-image-l-to-pos":[{"mask-l-to":ze()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":ze()}],"mask-image-x-to-pos":[{"mask-x-to":ze()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":ze()}],"mask-image-y-to-pos":[{"mask-y-to":ze()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[Ge,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":ze()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[_t]}],"mask-image-conic-from-pos":[{"mask-conic-from":ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":ze()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Be]}],filter:[{filter:["","none",Ge,Be]}],blur:[{blur:Vt()}],brightness:[{brightness:[_t,Ge,Be]}],contrast:[{contrast:[_t,Ge,Be]}],"drop-shadow":[{"drop-shadow":["","none",j,B0,q0]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",_t,Ge,Be]}],"hue-rotate":[{"hue-rotate":[_t,Ge,Be]}],invert:[{invert:["",_t,Ge,Be]}],saturate:[{saturate:[_t,Ge,Be]}],sepia:[{sepia:["",_t,Ge,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Be]}],"backdrop-blur":[{"backdrop-blur":Vt()}],"backdrop-brightness":[{"backdrop-brightness":[_t,Ge,Be]}],"backdrop-contrast":[{"backdrop-contrast":[_t,Ge,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_t,Ge,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_t,Ge,Be]}],"backdrop-invert":[{"backdrop-invert":["",_t,Ge,Be]}],"backdrop-opacity":[{"backdrop-opacity":[_t,Ge,Be]}],"backdrop-saturate":[{"backdrop-saturate":[_t,Ge,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",_t,Ge,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_t,"initial",Ge,Be]}],ease:[{ease:["linear","initial",T,Ge,Be]}],delay:[{delay:[_t,Ge,Be]}],animate:[{animate:["none",A,Ge,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,Ge,Be]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:$e()}],"rotate-x":[{"rotate-x":$e()}],"rotate-y":[{"rotate-y":$e()}],"rotate-z":[{"rotate-z":$e()}],scale:[{scale:At()}],"scale-x":[{"scale-x":At()}],"scale-y":[{"scale-y":At()}],"scale-z":[{"scale-z":At()}],"scale-3d":["scale-3d"],skew:[{skew:qt()}],"skew-x":[{"skew-x":qt()}],"skew-y":[{"skew-y":qt()}],transform:[{transform:[Ge,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:wn()}],"translate-x":[{"translate-x":wn()}],"translate-y":[{"translate-y":wn()}],"translate-z":[{"translate-z":wn()}],"translate-none":["translate-none"],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge,Be]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[_t,Xp,Ac,X2]}],stroke:[{stroke:["none",...re()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kS=q_(iC);function ss(...t){return kS(Km(t))}/**
61
+ * @license lucide-react v0.576.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const LS=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();/**
66
+ * @license lucide-react v0.576.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const lC=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v0.576.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const oC=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
76
+ * @license lucide-react v0.576.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Z2=t=>{const e=oC(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
81
+ * @license lucide-react v0.576.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var uC={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"};/**
86
+ * @license lucide-react v0.576.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const cC=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
91
+ * @license lucide-react v0.576.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const dC=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},m)=>D.createElement("svg",{ref:m,...uC,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:LS("lucide",i),...!o&&!cC(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...Array.isArray(o)?o:[o]]));/**
96
+ * @license lucide-react v0.576.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const nd=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(dC,{ref:o,iconNode:e,className:LS(`lucide-${lC(Z2(t))}`,`lucide-${t}`,s),...i}));return n.displayName=Z2(t),n};/**
101
+ * @license lucide-react v0.576.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const fC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iv=nd("chevron-down",fC);/**
106
+ * @license lucide-react v0.576.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const hC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pC=nd("chevron-right",hC);/**
111
+ * @license lucide-react v0.576.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const mC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],gC=nd("circle-plus",mC);/**
116
+ * @license lucide-react v0.576.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const yC=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xC=nd("copy-plus",yC);/**
121
+ * @license lucide-react v0.576.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const bC=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],vC=nd("save",bC);/**
126
+ * @license lucide-react v0.576.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const SC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],NC=nd("trash-2",SC);/**
131
+ * @license lucide-react v0.576.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const _C=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],CC=nd("x",_C),I2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,J2=Km,dr=(t,e)=>n=>{var s;if((e==null?void 0:e.variants)==null)return J2(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,d=Object.keys(i).map(y=>{const v=n==null?void 0:n[y],b=o==null?void 0:o[y];if(v===null)return null;const _=I2(v)||I2(b);return i[y][_]}),f=n&&Object.entries(n).reduce((y,v)=>{let[b,_]=v;return _===void 0||(y[b]=_),y},{}),m=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((y,v)=>{let{class:b,className:_,...j}=v;return Object.entries(j).every(w=>{let[O,R]=w;return Array.isArray(R)?R.includes({...o,...f}[O]):{...o,...f}[O]===R})?[...y,b,_]:y},[]);return J2(t,d,m,n==null?void 0:n.class,n==null?void 0:n.className)},jC=dr("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),wC=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:ss(jC({variant:e,size:n}),t),...s}));wC.displayName="Button";const EC=dr("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),TC=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:ss(EC({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));TC.displayName="IconButton";const RC=dr("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),OC=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:ss(RC({variant:e,styleVariant:n}),t),...s}));OC.displayName="Badge";const AC=dr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),MC=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:ss(AC({variant:e}),t),...n}));MC.displayName="Card";const DC=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:ss("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));DC.displayName="Label";const zC=dr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),kC=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:ss(zC({orientation:e}),t),...n}));kC.displayName="Separator";const LC=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ss("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));LC.displayName="Skeleton";const W2=dr("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),UC=D.forwardRef(({className:t,state:e,leftSlot:n,rightSlot:s,...i},o)=>n||s?h.jsxs("div",{className:"relative flex items-center w-full",children:[n&&h.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),h.jsx("input",{ref:o,className:ss(W2({state:e}),n?"pl-7":"",s?"pr-7":"",t),...i}),s&&h.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:s})]}):h.jsx("input",{ref:o,className:ss(W2({state:e}),t),...i}));UC.displayName="Input";const HC=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:ss("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",t),...n,children:e.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))}),h.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:h.jsx(iv,{className:"h-3.5 w-3.5"})})]}));HC.displayName="Select";const qC=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:ss("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));qC.displayName="Checkbox";const BC=D.forwardRef(({className:t,checked:e,onCheckedChange:n,label:s,...i},o)=>h.jsxs("button",{ref:o,role:"switch","aria-checked":e,type:"button",onClick:()=>n(!e),className:ss("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:ss("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:ss("block w-3.5 h-3.5 rounded-full bg-white transition-transform",e?"translate-x-4":"translate-x-0.5")})}),s&&h.jsx("span",{className:"text-xs text-foreground",children:s})]}));BC.displayName="Switch";const GC=D.createContext(null);function PC(){const t=D.useContext(GC);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}const YC=dr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),VC=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=PC(),m=D.useRef(null),y=i??m;D.useEffect(()=>{const b=y.current;b&&(o&&!b.open&&b.showModal(),!o&&b.open&&b.close())},[o,y]);const v=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:ss(YC({width:e}),"w-full",t),onClick:v,onClose:()=>d(!1),...s,children:n})});VC.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);const QC=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ss("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));QC.displayName="ScrollArea";const XC={success:"bg-emerald-400 text-emerald-950",warning:"bg-amber-400 text-amber-950",danger:"bg-red-400 text-red-950",info:"bg-blue-400 text-blue-950",neutral:"bg-foreground-subtle/20 text-foreground"};function KC({children:t,variant:e="neutral",mono:n,className:s}){return h.jsx("span",{className:ss("inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold leading-tight",n&&"font-mono",XC[e],s),children:t})}function FC({version:t,preRelease:e,className:n}){const s=e??/-(alpha|beta|rc|dev|canary|next)/i.test(t);return h.jsx(KC,{variant:s?"warning":"success",mono:!0,className:n,children:t})}var ZC=Object.create,US=Object.defineProperty,IC=Object.getOwnPropertyDescriptor,HS=Object.getOwnPropertyNames,JC=Object.getPrototypeOf,WC=Object.prototype.hasOwnProperty,bl=(t,e)=>function(){return e||(0,t[HS(t)[0]])((e={exports:{}}).exports,e),e.exports},$C=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=HS(e),o=0,d=i.length,f;o<d;o++)f=i[o],!WC.call(t,f)&&f!==n&&US(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=IC(e,f))||s.enumerable});return t},ma=(t,e,n)=>(n=t!=null?ZC(JC(t)):{},$C(US(n,"default",{value:t,enumerable:!0}),t)),qS=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),ej=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=qS().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),tj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=qS().default,s=ej();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),ad=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=tj();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Oi=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ad();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function nj(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(m){var y;i||(y=n.next)===null||y===void 0||y.call(n,m)},error(m){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,m),f())},complete(){var m;i||(i=!0,(m=n.complete)===null||m===void 0||m.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(aj,e)}};return e}function aj(t,e){return e(t)}function sj(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=nj(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}ma(ad());ma(Oi());ma(Oi());ma(Oi());ma(Oi());ma(Oi());const BS=(t,...e)=>typeof t=="function"?t(...e):t;ma(ad());function rj(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function ij(t){const e=await BS(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function lj(t,e){const n={method:"connectionParams",data:await BS(t)};return e.encode(n)}ma(ad());var pu=ma(ad());function oj(t){const{promise:e,resolve:n,reject:s}=rj();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function uj(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:m})=>{clearTimeout(s),o(),m==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var cj=class ib{constructor(e){var n;if((0,pu.default)(this,"id",++ib.connectCount),(0,pu.default)(this,"WebSocketPonyfill",void 0),(0,pu.default)(this,"urlOptions",void 0),(0,pu.default)(this,"keepAliveOpts",void 0),(0,pu.default)(this,"encoder",void 0),(0,pu.default)(this,"wsObservable",sj(null)),(0,pu.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++ib.connectCount;const n=ij(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&uj(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await oj(s),e.urlOptions.connectionParams&&s.send(await lj(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,pu.default)(cj,"connectCount",0);ma(ad());ma(Oi());ma(ad());ma(Oi());ma(Oi());ma(Oi());var dj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,m=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);m--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(m){return{value:m,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var m=this.s.return;return m===void 0?Promise.resolve({value:f,done:!0}):o(m.apply(this.s,arguments))},throw:function(f){var m=this.s.return;return m===void 0?Promise.reject(f):o(m.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ma(dj());ma(Oi());var fj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,m){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=m,y},i={},o=[];function d(f,m){if(m!=null){if(Object(m)!==m)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=m[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=m[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.call(m)}catch(_){return Promise.reject(_)}}),o.push({v:m,d:y,a:f})}else f&&o.push({d:m,a:f});return m}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var m,y=this.e,v=0;function b(){for(;m=o.pop();)try{if(!m.a&&v===1)return v=0,o.push(m),Promise.resolve().then(b);if(m.d){var j=m.d.call(m.v);if(m.a)return v|=2,Promise.resolve(j).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),GS=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),hj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=GS();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),pj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=GS();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function m(v,b){try{var _=o[v](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(O){if(w){var R=v==="return"?"return":"next";if(!j.k||O.done)return m(R,O);O=o[R](O).value}y(_.done?"return":"normal",O)},function(O){m("throw",O)})}catch(O){y("throw",O)}}function y(v,b){switch(v){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?m(d.key,d.arg):f=null}this._invoke=function(v,b){return new Promise(function(_,j){var w={key:v,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,m(v,b))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});ma(fj());ma(hj());ma(pj());ma(Oi());class mj{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,n){this.keyToValue.set(e,n),this.valueToKey.set(n,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class PS{constructor(e){this.generateIdentifier=e,this.kv=new mj}register(e,n){this.kv.getByValue(e)||(n||(n=this.generateIdentifier(e)),this.kv.set(n,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class gj extends PS{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(e,n.allowProps),super.register(e,n.identifier)):super.register(e,n)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function yj(t){if("values"in Object)return Object.values(t);const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}function xj(t,e){const n=yj(t);if("find"in n)return n.find(e);const s=n;for(let i=0;i<s.length;i++){const o=s[i];if(e(o))return o}}function $f(t,e){Object.entries(t).forEach(([n,s])=>e(s,n))}function h1(t,e){return t.indexOf(e)!==-1}function $2(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(e(s))return s}}class bj{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return xj(this.transfomers,n=>n.isApplicable(e))}findByName(e){return this.transfomers[e]}}const vj=t=>Object.prototype.toString.call(t).slice(8,-1),YS=t=>typeof t>"u",Sj=t=>t===null,Em=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,lb=t=>Em(t)&&Object.keys(t).length===0,Mu=t=>Array.isArray(t),Nj=t=>typeof t=="string",_j=t=>typeof t=="number"&&!isNaN(t),Cj=t=>typeof t=="boolean",jj=t=>t instanceof RegExp,Tm=t=>t instanceof Map,Rm=t=>t instanceof Set,VS=t=>vj(t)==="Symbol",wj=t=>t instanceof Date&&!isNaN(t.valueOf()),QS=t=>t instanceof Error,e3=t=>typeof t=="number"&&isNaN(t),Ej=t=>Cj(t)||Sj(t)||YS(t)||_j(t)||Nj(t)||VS(t),Tj=t=>typeof t=="bigint",Rj=t=>t===1/0||t===-1/0,Oj=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),Aj=t=>t instanceof URL,ob=t=>t.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Jy=t=>t.map(String).map(ob).join("."),pm=(t,e)=>{const n=[];let s="";for(let o=0;o<t.length;o++){let d=t.charAt(o);if(!e&&d==="\\"){const y=t.charAt(o+1);if(y==="\\"){s+="\\",o++;continue}else if(y!==".")throw Error("invalid path")}if(d==="\\"&&t.charAt(o+1)==="."){s+=".",o++;continue}if(d==="."){n.push(s),s="";continue}s+=d}const i=s;return n.push(i),n};function ol(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const XS=[ol(YS,"undefined",()=>null,()=>{}),ol(Tj,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),ol(wj,"Date",t=>t.toISOString(),t=>new Date(t)),ol(QS,"Error",(t,e)=>{const n={name:t.name,message:t.message};return"cause"in t&&(n.cause=t.cause),e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n},(t,e)=>{const n=new Error(t.message,{cause:t.cause});return n.name=t.name,n.stack=t.stack,e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n}),ol(jj,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),n=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,n)}),ol(Rm,"set",t=>[...t.values()],t=>new Set(t)),ol(Tm,"map",t=>[...t.entries()],t=>new Map(t)),ol(t=>e3(t)||Rj(t),"number",t=>e3(t)?"NaN":t>0?"Infinity":"-Infinity",Number),ol(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),ol(Aj,"URL",t=>t.toString(),t=>new URL(t))];function q1(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const KS=q1((t,e)=>VS(t)?!!e.symbolRegistry.getIdentifier(t):!1,(t,e)=>["symbol",e.symbolRegistry.getIdentifier(t)],t=>t.description,(t,e,n)=>{const s=n.symbolRegistry.getValue(e[1]);if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),Mj=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),FS=q1(Oj,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const n=Mj[e[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(t)});function ZS(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const IS=q1(ZS,(t,e)=>["class",e.classRegistry.getIdentifier(t.constructor)],(t,e)=>{const n=e.classRegistry.getAllowedProps(t.constructor);if(!n)return{...t};const s={};return n.forEach(i=>{s[i]=t[i]}),s},(t,e,n)=>{const s=n.classRegistry.getValue(e[1]);if(!s)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(s.prototype),t)}),JS=q1((t,e)=>!!e.customTransformerRegistry.findApplicable(t),(t,e)=>["custom",e.customTransformerRegistry.findApplicable(t).name],(t,e)=>e.customTransformerRegistry.findApplicable(t).serialize(t),(t,e,n)=>{const s=n.customTransformerRegistry.findByName(e[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(t)}),Dj=[IS,KS,JS,FS],t3=(t,e)=>{const n=$2(Dj,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation(t,e)};const s=$2(XS,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation}},WS={};XS.forEach(t=>{WS[t.annotation]=t});const zj=(t,e,n)=>{if(Mu(e))switch(e[0]){case"symbol":return KS.untransform(t,e,n);case"class":return IS.untransform(t,e,n);case"custom":return JS.untransform(t,e,n);case"typed-array":return FS.untransform(t,e,n);default:throw new Error("Unknown transformation: "+e)}else{const s=WS[e];if(!s)throw new Error("Unknown transformation: "+e);return s.untransform(t,n)}},Of=(t,e)=>{if(e>t.size)throw new Error("index out of bounds");const n=t.keys();for(;e>0;)n.next(),e--;return n.next().value};function $S(t){if(h1(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(h1(t,"prototype"))throw new Error("prototype is not allowed as a property");if(h1(t,"constructor"))throw new Error("constructor is not allowed as a property")}const kj=(t,e)=>{$S(e);for(let n=0;n<e.length;n++){const s=e[n];if(Rm(t))t=Of(t,+s);else if(Tm(t)){const i=+s,o=+e[++n]==0?"key":"value",d=Of(t,i);switch(o){case"key":t=d;break;case"value":t=t.get(d);break}}else t=t[s]}return t},ub=(t,e,n)=>{if($S(e),e.length===0)return n(t);let s=t;for(let o=0;o<e.length-1;o++){const d=e[o];if(Mu(s)){const f=+d;s=s[f]}else if(Em(s))s=s[d];else if(Rm(s)){const f=+d;s=Of(s,f)}else if(Tm(s)){if(o===e.length-2)break;const m=+d,y=+e[++o]==0?"key":"value",v=Of(s,m);switch(y){case"key":s=v;break;case"value":s=s.get(v);break}}}const i=e[e.length-1];if(Mu(s)?s[+i]=n(s[+i]):Em(s)&&(s[i]=n(s[i])),Rm(s)){const o=Of(s,+i),d=n(o);o!==d&&(s.delete(o),s.add(d))}if(Tm(s)){const o=+e[e.length-2],d=Of(s,o);switch(+i==0?"key":"value"){case"key":{const m=n(d);s.set(m,s.get(d)),m!==d&&s.delete(d);break}case"value":{s.set(d,n(s.get(d)));break}}}return t},e6=t=>t<1;function cb(t,e,n,s=[]){if(!t)return;const i=e6(n);if(!Mu(t)){$f(t,(f,m)=>cb(f,e,n,[...s,...pm(m,i)]));return}const[o,d]=t;d&&$f(d,(f,m)=>{cb(f,e,n,[...s,...pm(m,i)])}),e(o,s)}function Lj(t,e,n,s){return cb(e,(i,o)=>{t=ub(t,o,d=>zj(d,i,s))},n),t}function Uj(t,e,n){const s=e6(n);function i(o,d){const f=kj(t,pm(d,s));o.map(m=>pm(m,s)).forEach(m=>{t=ub(t,m,()=>f)})}if(Mu(e)){const[o,d]=e;o.forEach(f=>{t=ub(t,pm(f,s),()=>t)}),d&&$f(d,i)}else $f(e,i);return t}const Hj=(t,e)=>Em(t)||Mu(t)||Tm(t)||Rm(t)||QS(t)||ZS(t,e);function qj(t,e,n){const s=n.get(t);s?s.push(e):n.set(t,[e])}function Bj(t,e){const n={};let s;return t.forEach(i=>{if(i.length<=1)return;e||(i=i.map(f=>f.map(String)).sort((f,m)=>f.length-m.length));const[o,...d]=i;o.length===0?s=d.map(Jy):n[Jy(o)]=d.map(Jy)}),s?lb(n)?[s]:[s,n]:lb(n)?void 0:n}const t6=(t,e,n,s,i=[],o=[],d=new Map)=>{const f=Ej(t);if(!f){qj(t,i,e);const j=d.get(t);if(j)return s?{transformedValue:null}:j}if(!Hj(t,n)){const j=t3(t,n),w=j?{transformedValue:j.value,annotations:[j.type]}:{transformedValue:t};return f||d.set(t,w),w}if(h1(o,t))return{transformedValue:null};const m=t3(t,n),y=(m==null?void 0:m.value)??t,v=Mu(y)?[]:{},b={};$f(y,(j,w)=>{if(w==="__proto__"||w==="constructor"||w==="prototype")throw new Error(`Detected property ${w}. This is a prototype pollution risk, please remove it from your object.`);const O=t6(j,e,n,s,[...i,w],[...o,t],d);v[w]=O.transformedValue,Mu(O.annotations)?b[ob(w)]=O.annotations:Em(O.annotations)&&$f(O.annotations,(R,T)=>{b[ob(w)+"."+T]=R})});const _=lb(b)?{transformedValue:v,annotations:m?[m.type]:void 0}:{transformedValue:v,annotations:m?[m.type,b]:b};return f||d.set(t,_),_};function n6(t){return Object.prototype.toString.call(t).slice(8,-1)}function n3(t){return n6(t)==="Array"}function Gj(t){if(n6(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function Pj(t,e,n,s,i){const o={}.propertyIsEnumerable.call(s,e)?"enumerable":"nonenumerable";o==="enumerable"&&(t[e]=n),i&&o==="nonenumerable"&&Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}function db(t,e={}){if(n3(t))return t.map(i=>db(i,e));if(!Gj(t))return t;const n=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return[...n,...s].reduce((i,o)=>{if(o==="__proto__"||n3(e.props)&&!e.props.includes(o))return i;const d=t[o],f=db(d,e);return Pj(i,o,f,t,e.nonenumerable),i},{})}class kt{constructor({dedupe:e=!1}={}){this.classRegistry=new gj,this.symbolRegistry=new PS(n=>n.description??""),this.customTransformerRegistry=new bj,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const n=new Map,s=t6(e,n,this,this.dedupe),i={json:s.transformedValue};s.annotations&&(i.meta={...i.meta,values:s.annotations});const o=Bj(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i.meta&&(i.meta.v=1),i}deserialize(e,n){const{json:s,meta:i}=e;let o=n!=null&&n.inPlace?s:db(s);return i!=null&&i.values&&(o=Lj(o,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(o=Uj(o,i.referentialEqualities,i.v??0)),o}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,n){this.classRegistry.register(e,n)}registerSymbol(e,n){this.symbolRegistry.register(e,n)}registerCustom(e,n){this.customTransformerRegistry.register({name:n,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}kt.defaultInstance=new kt;kt.serialize=kt.defaultInstance.serialize.bind(kt.defaultInstance);kt.deserialize=kt.defaultInstance.deserialize.bind(kt.defaultInstance);kt.stringify=kt.defaultInstance.stringify.bind(kt.defaultInstance);kt.parse=kt.defaultInstance.parse.bind(kt.defaultInstance);kt.registerClass=kt.defaultInstance.registerClass.bind(kt.defaultInstance);kt.registerSymbol=kt.defaultInstance.registerSymbol.bind(kt.defaultInstance);kt.registerCustom=kt.defaultInstance.registerCustom.bind(kt.defaultInstance);kt.allowErrorProps=kt.defaultInstance.allowErrorProps.bind(kt.defaultInstance);kt.serialize;kt.deserialize;kt.stringify;kt.parse;kt.registerClass;kt.registerCustom;kt.registerSymbol;kt.allowErrorProps;D.createContext(null);var Yj=Object.create,a6=Object.defineProperty,Vj=Object.getOwnPropertyDescriptor,s6=Object.getOwnPropertyNames,Qj=Object.getPrototypeOf,Xj=Object.prototype.hasOwnProperty,vl=(t,e)=>function(){return e||(0,t[s6(t)[0]])((e={exports:{}}).exports,e),e.exports},Kj=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=s6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!Xj.call(t,f)&&f!==n&&a6(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=Vj(e,f))||s.enumerable});return t},ga=(t,e,n)=>(n=t!=null?Yj(Qj(t)):{},Kj(e||!t||!t.__esModule?a6(n,"default",{value:t,enumerable:!0}):n,t)),r6=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Fj=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=r6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Zj=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=r6().default,s=Fj();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),sd=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=Zj();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ai=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=sd();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function uh(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(m){var y;i||(y=n.next)===null||y===void 0||y.call(n,m)},error(m){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,m),f())},complete(){var m;i||(i=!0,(m=n.complete)===null||m===void 0||m.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(Ij,e)}};return e}function Ij(t,e){return e(t)}function Jj(t){const e=new AbortController;return new Promise((s,i)=>{let o=!1;function d(){o||(o=!0,f.unsubscribe())}e.signal.addEventListener("abort",()=>{i(e.signal.reason)});const f=t.subscribe({next(m){o=!0,s(m),d()},error(m){i(m)},complete(){e.abort(),d()}})})}function Wj(t){return e=>{let n=0,s=null;const i=[];function o(){s||(s=e.subscribe({next(f){for(const y of i){var m;(m=y.next)===null||m===void 0||m.call(y,f)}},error(f){for(const y of i){var m;(m=y.error)===null||m===void 0||m.call(y,f)}},complete(){for(const m of i){var f;(f=m.complete)===null||f===void 0||f.call(m)}}}))}function d(){if(n===0&&s){const f=s;s=null,f.unsubscribe()}}return uh(f=>(n++,i.push(f),o(),{unsubscribe(){n--,d();const m=i.findIndex(y=>y===f);m>-1&&i.splice(m,1)}}))}}function i6(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=uh(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}function $j(t){return uh(e=>{function n(i=0,o=t.op){const d=t.links[i];if(!d)throw new Error("No more links to execute - did you forget to add an ending link?");return d({op:o,next(m){return n(i+1,m)}})}return n().subscribe(e)})}function Om(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function ew(){return Object.create(null)}const a3=t=>t();function s3(t=0){return new Promise(e=>setTimeout(e,t))}var tw=Object.create,l6=Object.defineProperty,nw=Object.getOwnPropertyDescriptor,o6=Object.getOwnPropertyNames,aw=Object.getPrototypeOf,sw=Object.prototype.hasOwnProperty,Fm=(t,e)=>function(){return e||(0,t[o6(t)[0]])((e={exports:{}}).exports,e),e.exports},rw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=o6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!sw.call(t,f)&&f!==n&&l6(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=nw(e,f))||s.enumerable});return t},B1=(t,e,n)=>(n=t!=null?tw(aw(t)):{},rw(l6(n,"default",{value:t,enumerable:!0}),t));const u6=()=>{},r3=t=>{Object.freeze&&Object.freeze(t)};function c6(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(u6,{get(o,d){if(!(typeof d!="string"||d==="then"))return c6(t,[...e,d],n)},apply(o,d,f){const m=e[e.length-1];let y={args:f,path:e};return m==="call"?y={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:m==="apply"&&(y={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),r3(y.args),r3(y.path),t(y)}})),n[i]}const iw=t=>c6(t,[],ew()),lw=t=>new Proxy(u6,{get(e,n){if(n!=="then")return t(n)}});var d6=Fm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),ow=Fm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=d6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),uw=Fm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=d6().default,s=ow();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),f6=Fm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=uw();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),lv=Fm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=f6();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});B1(lv());B1(f6());var G0=B1(lv());function cw(t,e){if("error"in t){const s=e.deserialize(t.error);return{ok:!1,error:(0,G0.default)((0,G0.default)({},t),{},{error:s})}}return{ok:!0,result:(0,G0.default)((0,G0.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var Wy=class extends Error{constructor(){super("Unable to transform response from server")}};function h6(t,e){let n;try{n=cw(t,e)}catch{throw new Wy}if(!n.ok&&(!Om(n.error.error)||typeof n.error.error.code!="number"))throw new Wy;if(n.ok&&!Om(n.result))throw new Wy;return n}B1(lv());var P0=ga(sd(),1),Cf=ga(Ai(),1);function dw(t){return t instanceof co}function fw(t){return Om(t)&&Om(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function hw(t,e){return typeof t=="string"?t:Om(t)&&typeof t.message=="string"?t.message:e}var co=class p1 extends Error{constructor(e,n){var s,i;const o=n==null?void 0:n.cause;super(e,{cause:o}),(0,P0.default)(this,"cause",void 0),(0,P0.default)(this,"shape",void 0),(0,P0.default)(this,"data",void 0),(0,P0.default)(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=o,this.shape=n==null||(s=n.result)===null||s===void 0?void 0:s.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,p1.prototype)}static from(e,n={}){const s=e;return dw(s)?(n.meta&&(s.meta=(0,Cf.default)((0,Cf.default)({},s.meta),n.meta)),s):fw(s)?new p1(s.error.message,(0,Cf.default)((0,Cf.default)({},n),{},{result:s,cause:n.cause})):new p1(hw(s,"Unknown error"),(0,Cf.default)((0,Cf.default)({},n),{},{cause:s}))}};function p6(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const i3=t=>typeof t=="function";function pw(t){if(t)return t;if(typeof window<"u"&&i3(window.fetch))return window.fetch;if(typeof globalThis<"u"&&i3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var mm=ga(Ai());function mw(t){return{url:t.url.toString(),fetch:t.fetch,transformer:p6(t.transformer),methodOverride:t.methodOverride}}function gw(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const yw={query:"GET",mutation:"POST",subscription:"PATCH"};function m6(t){return"input"in t?t.transformer.input.serialize(t.input):gw(t.inputs.map(e=>t.transformer.input.serialize(e)))}const fb=t=>{const e=t.url.split("?");let s=e[0].replace(/\/$/,"")+"/"+t.path;const i=[];if(e[1]&&i.push(e[1]),"inputs"in t&&i.push("batch=1"),t.type==="query"||t.type==="subscription"){const o=m6(t);o!==void 0&&t.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(s+="?"+i.join("&")),s},xw=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=m6(t);return e!==void 0?JSON.stringify(e):void 0},bw=t=>hb((0,mm.default)((0,mm.default)({},t),{},{contentTypeHeader:"application/json",getUrl:fb,getBody:xw}));var vw=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const Sw=t=>{var e;if(t!=null&&t.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new vw};async function Nw(t){var e,n;Sw(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:yw[t.type],d=await(async()=>{const m=await t.headers();return Symbol.iterator in m?Object.fromEntries(m):m})(),f=(0,mm.default)((0,mm.default)((0,mm.default)({},t.contentTypeHeader&&o!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{[(n=t.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:t.trpcAcceptHeader}:void 0),d);return pw(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:f})}async function hb(t){const e={},n=await Nw(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}function _w(t){return t instanceof Uint8Array||t instanceof Blob}function Cw(t){return t instanceof FormData}var Af=ga(Ai(),1);const jw=t=>{if("input"in t){const{input:e}=t;if(Cw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return hb((0,Af.default)((0,Af.default)({},t),{},{contentTypeHeader:void 0,getUrl:fb,getBody:()=>e}))}if(_w(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return hb((0,Af.default)((0,Af.default)({},t),{},{contentTypeHeader:"application/octet-stream",getUrl:fb,getBody:()=>e}))}}return bw(t)};function ww(t){const e=mw(t);return()=>n=>{const{op:s}=n;return uh(i=>{const{path:o,input:d,type:f}=s;/* istanbul ignore if -- @preserve */if(f==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const m=jw((0,Af.default)((0,Af.default)({},e),{},{type:f,path:o,input:d,signal:s.signal,headers(){return t.headers?typeof t.headers=="function"?t.headers({op:s}):t.headers:{}}}));let y;return m.then(v=>{y=v.meta;const b=h6(v.json,e.transformer.output);if(!b.ok){i.error(co.from(b.error,{meta:y}));return}i.next({context:v.meta,result:b.result}),i.complete()}).catch(v=>{i.error(co.from(v,{meta:y}))}),()=>{}})}}ga(Ai(),1);ga(Ai(),1);const Ew={encode:t=>JSON.stringify(t),decode:t=>{if(typeof t!="string")throw new Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");return JSON.parse(t)}},Tw={enabled:!1,closeMs:0},Rw={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},Ow=t=>t===0?0:Math.min(1e3*2**t,3e4),g6=(t,...e)=>typeof t=="function"?t(...e):t;var Aw=ga(sd(),1),jf=class y6 extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,y6.prototype)}},Mw=class{constructor(t,e){this.onTimeout=t,this.timeoutMs=e,(0,Aw.default)(this,"timeout",void 0)}reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function x6(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Dw(t){const e=await g6(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function zw(t,e){const n={method:"connectionParams",data:await g6(t)};return e.encode(n)}var l3=ga(sd(),1),kw=class{constructor(){(0,l3.default)(this,"outgoingRequests",new Array),(0,l3.default)(this,"pendingRequests",{})}register(t,e){const{promise:n,resolve:s}=x6();return this.outgoingRequests.push({id:String(t.id),message:t,end:n,callbacks:{next:e.next,complete:()=>{e.complete(),s()},error:i=>{e.error(i),s()}}}),()=>{this.delete(t.id),e.complete(),s()}}delete(t){t!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:e})=>e!==String(t)),delete this.pendingRequests[String(t)])}flush(){const t=this.outgoingRequests;this.outgoingRequests=[];for(const e of t)this.pendingRequests[e.id]=e;return t}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(t){return t===null?null:this.pendingRequests[String(t)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(t=>({state:"outgoing",message:t.message,end:t.end,callbacks:t.callbacks})),...this.getPendingRequests().map(t=>({state:"pending",message:t.message,end:t.end,callbacks:t.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(t=>t.message.method==="subscription")}hasOutgoingRequests(){return this.outgoingRequests.length>0}},mu=ga(sd(),1);function Lw(t){const{promise:e,resolve:n,reject:s}=x6();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function Uw(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:m})=>{clearTimeout(s),o(),m==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var b6=class pb{constructor(e){var n;if((0,mu.default)(this,"id",++pb.connectCount),(0,mu.default)(this,"WebSocketPonyfill",void 0),(0,mu.default)(this,"urlOptions",void 0),(0,mu.default)(this,"keepAliveOpts",void 0),(0,mu.default)(this,"encoder",void 0),(0,mu.default)(this,"wsObservable",i6(null)),(0,mu.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++pb.connectCount;const n=Dw(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&Uw(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Lw(s),e.urlOptions.connectionParams&&s.send(await zw(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,mu.default)(b6,"connectCount",0);function Hw(t){return t.isOpen()?{id:t.id,state:"open",ws:t.ws}:t.isClosed()?{id:t.id,state:"closed",ws:t.ws}:t.ws?{id:t.id,state:"connecting",ws:t.ws}:null}var ul=ga(sd(),1),wf=ga(Ai(),1),qw=class{constructor(t){var e,n;(0,ul.default)(this,"connectionState",void 0),(0,ul.default)(this,"allowReconnect",!1),(0,ul.default)(this,"requestManager",new kw),(0,ul.default)(this,"activeConnection",void 0),(0,ul.default)(this,"reconnectRetryDelay",void 0),(0,ul.default)(this,"inactivityTimeout",void 0),(0,ul.default)(this,"callbacks",void 0),(0,ul.default)(this,"lazyMode",void 0),(0,ul.default)(this,"encoder",void 0),(0,ul.default)(this,"reconnecting",null),this.encoder=(e=t.experimental_encoder)!==null&&e!==void 0?e:Ew,this.callbacks={onOpen:t.onOpen,onClose:t.onClose,onError:t.onError};const s=(0,wf.default)((0,wf.default)({},Tw),t.lazy);this.inactivityTimeout=new Mw(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},s.closeMs),this.activeConnection=new b6({WebSocketPonyfill:t.WebSocket,urlOptions:t,keepAlive:(0,wf.default)((0,wf.default)({},Rw),t.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:i=>{i&&this.setupWebSocketListeners(i)}}),this.reconnectRetryDelay=(n=t.retryDelayMs)!==null&&n!==void 0?n:Ow,this.lazyMode=s.enabled,this.connectionState=i6({type:"state",state:s.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var t=this;t.allowReconnect=!0,t.connectionState.get().state==="idle"&&t.connectionState.next({type:"state",state:"connecting",error:null});try{await t.activeConnection.open()}catch(e){return t.reconnect(new jf({message:"Initialization error",cause:e})),t.reconnecting}}async close(){var t=this;t.allowReconnect=!1,t.inactivityTimeout.stop();const e=[];for(const n of t.requestManager.getRequests())n.message.method==="subscription"?n.callbacks.complete():n.state==="outgoing"?n.callbacks.error(co.from(new jf({message:"Closed before connection was established"}))):e.push(n.end);await Promise.all(e).catch(()=>null),await t.activeConnection.close().catch(()=>null),t.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:t,type:e,path:n,input:s,signal:i},transformer:o,lastEventId:d}){return uh(f=>{const m=this.batchSend({id:t,method:e,params:{input:o.input.serialize(s),path:n,lastEventId:d}},(0,wf.default)((0,wf.default)({},f),{},{next(y){const v=h6(y,o.output);if(!v.ok){f.error(co.from(v.error));return}f.next({result:v.result})}}));return()=>{m(),e==="subscription"&&this.activeConnection.isOpen()&&this.send({id:t,method:"subscription.stop"}),i==null||i.removeEventListener("abort",m)}})}get connection(){return Hw(this.activeConnection)}reconnect(t){var e=this;if(this.connectionState.next({type:"state",state:"connecting",error:co.from(t)}),this.reconnecting)return;const n=async s=>{try{await s3(e.reconnectRetryDelay(s)),e.allowReconnect&&(await e.activeConnection.close(),await e.activeConnection.open(),e.requestManager.hasPendingRequests()&&e.send(e.requestManager.getPendingRequests().map(({message:i})=>i))),e.reconnecting=null}catch{await n(s+1)}};this.reconnecting=n(0)}setupWebSocketListeners(t){var e=this;const n=s=>{const i=this.requestManager.getPendingRequests();for(const{message:o,callbacks:d}of i)o.method!=="subscription"&&(d.error(co.from(s??new jf({message:"WebSocket closed",cause:s}))),this.requestManager.delete(o.id))};t.addEventListener("open",()=>{a3(async()=>{var s,i;e.lazyMode&&e.inactivityTimeout.start(),(s=(i=e.callbacks).onOpen)===null||s===void 0||s.call(i),e.connectionState.next({type:"state",state:"pending",error:null})}).catch(s=>{t.close(3e3),n(s)})}),t.addEventListener("message",({data:s})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(s))return;const i=this.encoder.decode(s);if("method"in i){this.handleIncomingRequest(i);return}this.handleResponseMessage(i)}),t.addEventListener("close",s=>{var i,o;n(s),(i=(o=this.callbacks).onClose)===null||i===void 0||i.call(o,s),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new jf({message:"WebSocket closed",cause:s}))}),t.addEventListener("error",s=>{var i,o;n(s),(i=(o=this.callbacks).onError)===null||i===void 0||i.call(o,s),this.reconnect(new jf({message:"WebSocket closed",cause:s}))})}handleResponseMessage(t){const e=this.requestManager.getPendingRequest(t.id);if(!e)return;e.callbacks.next(t);let n=!0;"result"in t&&e.message.method==="subscription"&&(t.result.type==="data"&&(e.message.params.lastEventId=t.result.id),t.result.type!=="stopped"&&(n=!1)),n&&(e.callbacks.complete(),this.requestManager.delete(t.id))}handleIncomingRequest(t){t.method==="reconnect"&&this.reconnect(new jf({message:"Server requested reconnect"}))}send(t){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const e=t instanceof Array?t:[t];this.activeConnection.ws.send(this.encoder.encode(e.length===1?e[0]:e))}batchSend(t,e){var n=this;return this.inactivityTimeout.reset(),a3(async()=>{n.activeConnection.isOpen()||await n.open(),await s3(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:s})=>s))}).catch(s=>{this.requestManager.delete(t.id),e.error(co.from(s))}),this.requestManager.register(t,e)}};function Bw(t){return new qw(t)}function Gw(t){const{client:e}=t,n=p6(t.transformer);return()=>({op:s})=>uh(i=>{const o=s.type==="subscription"?e.connectionState.subscribe({next(f){i.next({result:f,context:s.context})}}):null,d=e.request({op:s,transformer:n}).subscribe(i);return()=>{d.unsubscribe(),o==null||o.unsubscribe()}})}var $y=ga(sd(),1),o3=ga(Ai(),1),Pw=class{constructor(t){(0,$y.default)(this,"links",void 0),(0,$y.default)(this,"runtime",void 0),(0,$y.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return $j({links:this.links,op:(0,o3.default)((0,o3.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(Wj())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await Jj(n)).result.data}catch(n){throw co.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(i){switch(i.result.type){case"state":{var o;(o=n.onConnectionStateChange)===null||o===void 0||o.call(n,i.result);break}case"started":{var d;(d=n.onStarted)===null||d===void 0||d.call(n,{context:i.context});break}case"stopped":{var f;(f=n.onStopped)===null||f===void 0||f.call(n);break}case"data":case void 0:{var m;(m=n.onData)===null||m===void 0||m.call(n,i.result.data);break}}},error(i){var o;(o=n.onError)===null||o===void 0||o.call(n,i)},complete(){var i;(i=n.onComplete)===null||i===void 0||i.call(n)}})}};const Yw=Symbol.for("trpc_untypedClient"),Vw={query:"query",mutate:"mutation",subscribe:"subscription"},Qw=t=>Vw[t];function Xw(t){const e=iw(({path:n,args:s})=>{const i=[...n],o=Qw(i.pop()),d=i.join(".");return t[o](d,...s)});return lw(n=>n===Yw?t:e[n])}function u3(t){const e=new Pw(t);return Xw(e)}ga(Ai(),1);ga(Ai(),1);var Kw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,m=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);m--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(m){return{value:m,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var m=this.s.return;return m===void 0?Promise.resolve({value:f,done:!0}):o(m.apply(this.s,arguments))},throw:function(f){var m=this.s.return;return m===void 0?Promise.reject(f):o(m.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ga(Kw(),1);ga(Ai(),1);var Fw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,m){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=m,y},i={},o=[];function d(f,m){if(m!=null){if(Object(m)!==m)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=m[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=m[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.call(m)}catch(_){return Promise.reject(_)}}),o.push({v:m,d:y,a:f})}else f&&o.push({d:m,a:f});return m}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var m,y=this.e,v=0;function b(){for(;m=o.pop();)try{if(!m.a&&v===1)return v=0,o.push(m),Promise.resolve().then(b);if(m.d){var j=m.d.call(m.v);if(m.a)return v|=2,Promise.resolve(j).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),v6=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Zw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=v6();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Iw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=v6();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function m(v,b){try{var _=o[v](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(O){if(w){var R=v==="return"?"return":"next";if(!j.k||O.done)return m(R,O);O=o[R](O).value}y(_.done?"return":"normal",O)},function(O){m("throw",O)})}catch(O){y("throw",O)}}function y(v,b){switch(v){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?m(d.key,d.arg):f=null}this._invoke=function(v,b){return new Promise(function(_,j){var w={key:v,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,m(v,b))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});ga(Fw(),1);ga(Zw(),1);ga(Iw(),1);ga(Ai(),1);class Jw{constructor(e){Pp(this,"trpc");Pp(this,"serverUrl");Pp(this,"token");Pp(this,"wsClient",null);this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.token=e.token;const n=typeof window<"u",s=e.useWebSocket??n,i=()=>{const o={};return this.token&&(o.Authorization=`Bearer ${this.token}`),o};if(s){const o=this.serverUrl.replace(/^http/,"ws")+"/trpc";this.wsClient=Bw({url:o,connectionParams:()=>({token:this.token}),retryDelayMs:()=>2e3}),this.trpc=u3({links:[Gw({client:this.wsClient,transformer:kt})]})}else this.trpc=u3({links:[ww({url:`${this.serverUrl}/trpc`,headers:i,transformer:kt})]})}setToken(e){this.token=e}close(){var e;(e=this.wsClient)==null||e.close()}async login(e,n){return this.trpc.auth.login.mutate({username:e,password:n})}async getMe(){return this.trpc.auth.me.query()}async logout(){return this.trpc.auth.logout.mutate()}async getSystemInfo(){return this.trpc.system.info.query()}async getFeatureFlags(){return this.trpc.system.featureFlags.query()}async listProviders(){return this.trpc.providers.list.query()}async getProvider(e){return this.trpc.providers.get.query({id:e})}async startProvider(e){return this.trpc.providers.start.mutate({id:e})}async stopProvider(e){return this.trpc.providers.stop.mutate({id:e})}async listProviderTypes(){return this.trpc.providerConfig.getAvailableTypes.query()}async listDevices(){return this.trpc.devices.list.query()}async getDevice(e){return this.trpc.devices.get.query({id:e})}async discoverDevices(e){return this.trpc.devices.discoverDevices.query({providerId:e})}async adoptDevice(e,n){return this.trpc.devices.adoptDevice.mutate({providerId:e,externalId:n})}async createDevice(e,n){return this.trpc.devices.createDevice.mutate({providerId:e,config:n})}getAddonAssetUrl(e,n){return`/api/addon-assets/${e}/${n}`}async listAddons(){return this.trpc.addons.list.query()}async getAddonConfigSchema(e){return this.trpc.addons.getConfigSchema.query({addonId:e})}async getAddonConfig(e){return this.trpc.addons.getConfig.query({addonId:e})}async updateAddonConfig(e,n){return this.trpc.addons.updateConfig.mutate({addonId:e,config:n})}async getAddonLogs(e,n){return this.trpc.addons.getLogs.query({addonId:e,...n})}async listKnownFaces(){return this.trpc.knownFaces.list.query()}async registerFace(e,n,s){return this.trpc.knownFaces.register.mutate({label:e,cropBase64:n,group:s})}async listPipelines(){return this.trpc.bridgePipeline.listAddons.query()}async getPipelineStatus(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async listAgents(){return this.trpc.agents.listAgents.query()}async dispatchTask(e,n){return this.trpc.agents.dispatchTask.mutate({capability:e,input:n})}async getProcessTree(){return this.trpc.agent.processTree.query()}async bridgeListAddons(){return this.trpc.bridgePipeline.listAddons.query()}async bridgeGetPipeline(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async bridgeSetPipeline(e,n){return this.trpc.bridgePipeline.setPipeline.mutate({deviceId:e,config:n})}async bridgeValidatePipeline(e){return this.trpc.bridgePipeline.validatePipeline.query(e)}async bridgeGetAddonConfig(e){return this.trpc.bridgePipeline.getAddonConfig.query({addonId:e})}async bridgeSetAddonConfig(e,n){return this.trpc.bridgePipeline.setAddonConfig.mutate({addonId:e,config:n})}async bridgeListPackages(){return this.trpc.bridgeAddons.listPackages.query()}async bridgeListAddonsPackages(){return this.trpc.bridgeAddons.listAddons.query()}async bridgeInstallPackage(e,n){return this.trpc.bridgeAddons.installPackage.mutate({packageName:e,version:n})}async bridgeUninstallPackage(e){return this.trpc.bridgeAddons.uninstallPackage.mutate({packageName:e})}async getRecordingConfig(e){return this.trpc.recording.getConfig.query({deviceId:e})}async getRecordingPolicy(e){return this.trpc.recording.getPolicy.query({deviceId:e})}async getRecordingPolicyStatus(e){return this.trpc.recording.getPolicyStatus.query({deviceId:e})}async getRecordingSegments(e,n,s,i){return this.trpc.recording.getSegments.query({deviceId:e,streamId:n,startTime:s,endTime:i})}async getEvents(e,n){return this.trpc.events.query.query({deviceId:e,...n})}async getLogs(e){return this.trpc.logs.query.query(e??{})}async replEval(e,n){return this.trpc.repl.execute.mutate({code:e,scope:n??{type:"system"}})}async listUsers(){return this.trpc.users.list.query()}async createUser(e,n,s){return this.trpc.users.create.mutate({username:e,password:n,role:s})}async getTrackingSessions(e){return this.trpc.session.getActiveTracks.query({deviceId:e})}async listProcesses(){return this.trpc.processes.listProcesses.query()}async enableProvider(e){return this.trpc.processes.enableProvider.mutate({id:e})}async disableProvider(e){return this.trpc.processes.disableProvider.mutate({id:e})}async getSettingsSchema(e){return this.trpc.settings.getSchema.query({section:e})}async getSettings(e){return this.trpc.settings.get.query({section:e})}async updateSettings(e,n){return this.trpc.settings.update.mutate({section:e,data:n})}}var S6=(t=>(t.Motion="motion",t.Person="person",t.Vehicle="vehicle",t.Animal="animal",t.Audio="audio",t.Face="face",t.Plate="plate",t.Package="package",t.Doorbell="doorbell",t.Sensor="sensor",t))(S6||{});const Ww=["animal","dog_cat","dog","cat","horse","sheep","cow","elephant","bear","zebra","giraffe","mouse","rabbit","deer","lion","tiger","bird","eagle","owl","pigeon","fish","whale","dolphin","snake","turtle","lizard"],$w=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],eE=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],tE=["face","eyes","nose","mouth","ears","eyebrows","left_eye","right_eye","pupil","iris","eyelid","eye_corner","upper_lip","lower_lip","teeth","chin","cheek","forehead","jaw","glasses","sunglasses","facial_hair","beard","mustache","facial_landmark","facial_keypoint"],nE=["plate","license_plate","front_plate","rear_plate","motorcycle_plate","temporary_plate","dealer_plate","licensePlate","plate_number","plate_character","plate_digit","plate_letter","plate_symbol","plate_region","plate_country_identifier","plate_frame","plate_bolt","plate_sticker","plate_validation_tag","damaged_plate","obscured_plate","dirty_plate"],aE=["motion","movement","other"],sE=["package","packet"],rE=["audio"],iE=["speech","scream","babbling","yell","bellow","whoop","whispering","laughter","snicker","crying","cry","sigh","singing","choir","chant","mantra","child_singing","rapping","humming","groan","grunt","whistling","breathing","wheeze","snoring","gasp","pant","snort","cough","throat_clearing","sneeze","sniff","cheering","applause","chatter","crowd","children_playing","bark","yip","howl","bow-wow","growling","whimper_dog","purr","meow","hiss","caterwaul","pets","livestock","doorbell","ding-dong","door","slam","knock","alarm","telephone","music","dog","dogs"],lE=["doorbell","ring"],oE=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...Ww.reduce((t,e)=>({...t,[e]:"animal"}),{}),...$w.reduce((t,e)=>({...t,[e]:"person"}),{}),...eE.reduce((t,e)=>({...t,[e]:"vehicle"}),{}),...aE.reduce((t,e)=>({...t,[e]:"motion"}),{}),...sE.reduce((t,e)=>({...t,[e]:"package"}),{}),...tE.reduce((t,e)=>({...t,[e]:"face"}),{}),...nE.reduce((t,e)=>({...t,[e]:"plate"}),{}),...rE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...iE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...lE.reduce((t,e)=>({...t,[e]:"doorbell"}),{}),...oE.reduce((t,e)=>({...t,[e]:"sensor"}),{})});const uE=Object.values(S6),cE=uE.filter(t=>t!=="motion");[...cE];const dE=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(dE);const fE=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(fE);let m1=null;function Am(){if(!m1){const t=window.location.origin,e=localStorage.getItem("camstack_admin_token")??void 0;m1=new Jw({serverUrl:t,token:e})}return m1}function c3(){m1=null}const N6=D.createContext(null);function d3(t){try{const e=JSON.parse(atob(t.split(".")[1]));return{username:e.username??"unknown",role:e.role??"viewer",exp:e.exp??0}}catch{return null}}function hE({children:t}){const[e,n]=D.useState(null),[s,i]=D.useState(!0);D.useEffect(()=>{const f=localStorage.getItem("camstack_admin_token");if(!f){i(!1);return}const m=d3(f);if(!m||m.exp*1e3<Date.now()){localStorage.removeItem("camstack_admin_token"),i(!1);return}Am().getSystemInfo().then(()=>n(m)).catch(v=>{var _;const b=(_=v==null?void 0:v.data)==null?void 0:_.code;b==="UNAUTHORIZED"||b==="FORBIDDEN"?(localStorage.removeItem("camstack_admin_token"),c3()):n(m)}).finally(()=>i(!1))},[]);const o=D.useCallback(async(f,m)=>{const y=Am(),b=(await y.login(f,m)).token;localStorage.setItem("camstack_admin_token",b),y.setToken(b),n(d3(b))},[]),d=D.useCallback(()=>{localStorage.removeItem("camstack_admin_token"),c3(),n(null)},[]);return h.jsx(N6.Provider,{value:{user:e,loading:s,login:o,logout:d},children:t})}function ov(){const t=D.useContext(N6);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function Mc({children:t,requiredRole:e}){const{user:n,loading:s}=ov();return s?h.jsx("div",{className:"flex h-screen items-center justify-center bg-background text-foreground-subtle",children:"Loading..."}):n?e==="admin"&&n.role!=="admin"&&n.role!=="super_admin"?h.jsx(ab,{to:"/access-denied",replace:!0}):h.jsx(h.Fragment,{children:t}):h.jsx(ab,{to:"/login",replace:!0})}/**
136
+ * @license lucide-react v0.511.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const pE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mE=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),f3=t=>{const e=mE(t);return e.charAt(0).toUpperCase()+e.slice(1)},_6=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),gE=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
141
+ * @license lucide-react v0.511.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */var yE={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"};/**
146
+ * @license lucide-react v0.511.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const xE=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},m)=>D.createElement("svg",{ref:m,...yE,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:_6("lucide",i),...!o&&!gE(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...Array.isArray(o)?o:[o]]));/**
151
+ * @license lucide-react v0.511.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const ke=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(xE,{ref:o,iconNode:e,className:_6(`lucide-${pE(f3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=f3(t),n};/**
156
+ * @license lucide-react v0.511.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const bE=[["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"}]],uv=ke("activity",bE);/**
161
+ * @license lucide-react v0.511.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const vE=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],SE=ke("arrow-down-to-line",vE);/**
166
+ * @license lucide-react v0.511.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const NE=[["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"}]],cv=ke("bell",NE);/**
171
+ * @license lucide-react v0.511.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const _E=[["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"}]],mb=ke("bot",_E);/**
176
+ * @license lucide-react v0.511.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const CE=[["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"}]],jE=ke("box",CE);/**
181
+ * @license lucide-react v0.511.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const wE=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],EE=ke("calendar",wE);/**
186
+ * @license lucide-react v0.511.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const TE=[["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"}]],ku=ke("camera",TE);/**
191
+ * @license lucide-react v0.511.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const RE=[["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"}]],OE=ke("car",RE);/**
196
+ * @license lucide-react v0.511.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const AE=[["path",{d:"M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97",key:"ir91b5"}],["path",{d:"M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z",key:"jlp8i1"}],["path",{d:"M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15",key:"19bib8"}],["path",{d:"M2 21v-4",key:"l40lih"}],["path",{d:"M7 9h.01",key:"19b3jx"}]],ME=ke("cctv",AE);/**
201
+ * @license lucide-react v0.511.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const DE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],G1=ke("check",DE);/**
206
+ * @license lucide-react v0.511.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const zE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zc=ke("chevron-down",zE);/**
211
+ * @license lucide-react v0.511.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const kE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],LE=ke("chevron-left",kE);/**
216
+ * @license lucide-react v0.511.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const UE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ic=ke("chevron-right",UE);/**
221
+ * @license lucide-react v0.511.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const HE=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],S1=ke("chevron-up",HE);/**
226
+ * @license lucide-react v0.511.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const qE=[["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"}]],BE=ke("circle-alert",qE);/**
231
+ * @license lucide-react v0.511.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const GE=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],PE=ke("circle-check-big",GE);/**
236
+ * @license lucide-react v0.511.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const YE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],C6=ke("circle-dot",YE);/**
241
+ * @license lucide-react v0.511.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const VE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],h3=ke("circle-help",VE);/**
246
+ * @license lucide-react v0.511.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const QE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],j6=ke("clock",QE);/**
251
+ * @license lucide-react v0.511.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const XE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],KE=ke("copy",XE);/**
256
+ * @license lucide-react v0.511.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const FE=[["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"}]],zf=ke("cpu",FE);/**
261
+ * @license lucide-react v0.511.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const ZE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],IE=ke("crosshair",ZE);/**
266
+ * @license lucide-react v0.511.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const JE=[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]],WE=ke("dog",JE);/**
271
+ * @license lucide-react v0.511.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const $E=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],w6=ke("download",$E);/**
276
+ * @license lucide-react v0.511.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const eT=[["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"}]],tT=ke("external-link",eT);/**
281
+ * @license lucide-react v0.511.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const nT=[["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"}]],E6=ke("eye-off",nT);/**
286
+ * @license lucide-react v0.511.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const aT=[["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"}]],ch=ke("eye",aT);/**
291
+ * @license lucide-react v0.511.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const sT=[["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"}]],T6=ke("film",sT);/**
296
+ * @license lucide-react v0.511.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const rT=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],iT=ke("flask-conical",rT);/**
301
+ * @license lucide-react v0.511.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const lT=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],oT=ke("funnel",lT);/**
306
+ * @license lucide-react v0.511.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const uT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],cT=ke("gauge",uT);/**
311
+ * @license lucide-react v0.511.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const dT=[["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"}]],P1=ke("git-branch",dT);/**
316
+ * @license lucide-react v0.511.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const fT=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],hT=ke("grip-vertical",fT);/**
321
+ * @license lucide-react v0.511.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const pT=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],gm=ke("hard-drive",pT);/**
326
+ * @license lucide-react v0.511.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const mT=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],gT=ke("house",mT);/**
331
+ * @license lucide-react v0.511.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const yT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],gb=ke("info",yT);/**
336
+ * @license lucide-react v0.511.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const xT=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],bT=ke("languages",xT);/**
341
+ * @license lucide-react v0.511.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const vT=[["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"}]],R6=ke("layout-dashboard",vT);/**
346
+ * @license lucide-react v0.511.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const ST=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],NT=ke("lightbulb",ST);/**
351
+ * @license lucide-react v0.511.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const _T=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],CT=ke("list-todo",_T);/**
356
+ * @license lucide-react v0.511.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const jT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],eh=ke("loader-circle",jT);/**
361
+ * @license lucide-react v0.511.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const wT=[["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"}]],ET=ke("log-out",wT);/**
366
+ * @license lucide-react v0.511.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const TT=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],O6=ke("mic",TT);/**
371
+ * @license lucide-react v0.511.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const RT=[["path",{d:"M5 12h14",key:"1ays0h"}]],OT=ke("minus",RT);/**
376
+ * @license lucide-react v0.511.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const AT=[["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"}]],N1=ke("monitor",AT);/**
381
+ * @license lucide-react v0.511.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const MT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],DT=ke("moon",MT);/**
386
+ * @license lucide-react v0.511.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const zT=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Mm=ke("package",zT);/**
391
+ * @license lucide-react v0.511.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const kT=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],LT=ke("pause",kT);/**
396
+ * @license lucide-react v0.511.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const UT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],HT=ke("pencil",UT);/**
401
+ * @license lucide-react v0.511.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const qT=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],dv=ke("play",qT);/**
406
+ * @license lucide-react v0.511.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const BT=[["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"}]],A6=ke("plug",BT);/**
411
+ * @license lucide-react v0.511.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const GT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=ke("plus",GT);/**
416
+ * @license lucide-react v0.511.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const PT=[["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"}]],_1=ke("puzzle",PT);/**
421
+ * @license lucide-react v0.511.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const YT=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],fv=ke("radio",YT);/**
426
+ * @license lucide-react v0.511.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const VT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],yb=ke("refresh-cw",VT);/**
431
+ * @license lucide-react v0.511.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const QT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],M6=ke("save",QT);/**
436
+ * @license lucide-react v0.511.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const XT=[["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"}]],Y1=ke("scroll-text",XT);/**
441
+ * @license lucide-react v0.511.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const KT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hv=ke("search",KT);/**
446
+ * @license lucide-react v0.511.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const FT=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],C1=ke("server",FT);/**
451
+ * @license lucide-react v0.511.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const ZT=[["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"}]],Zm=ke("settings",ZT);/**
456
+ * @license lucide-react v0.511.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const IT=[["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"}]],JT=ke("shield-x",IT);/**
461
+ * @license lucide-react v0.511.0 - ISC
462
+ *
463
+ * This source code is licensed under the ISC license.
464
+ * See the LICENSE file in the root directory of this source tree.
465
+ */const WT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],D6=ke("square",WT);/**
466
+ * @license lucide-react v0.511.0 - ISC
467
+ *
468
+ * This source code is licensed under the ISC license.
469
+ * See the LICENSE file in the root directory of this source tree.
470
+ */const $T=[["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"}]],eR=ke("sun",$T);/**
471
+ * @license lucide-react v0.511.0 - ISC
472
+ *
473
+ * This source code is licensed under the ISC license.
474
+ * See the LICENSE file in the root directory of this source tree.
475
+ */const tR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],nR=ke("terminal",tR);/**
476
+ * @license lucide-react v0.511.0 - ISC
477
+ *
478
+ * This source code is licensed under the ISC license.
479
+ * See the LICENSE file in the root directory of this source tree.
480
+ */const aR=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],sR=ke("toggle-left",aR);/**
481
+ * @license lucide-react v0.511.0 - ISC
482
+ *
483
+ * This source code is licensed under the ISC license.
484
+ * See the LICENSE file in the root directory of this source tree.
485
+ */const rR=[["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"}]],Im=ke("trash-2",rR);/**
486
+ * @license lucide-react v0.511.0 - ISC
487
+ *
488
+ * This source code is licensed under the ISC license.
489
+ * See the LICENSE file in the root directory of this source tree.
490
+ */const iR=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],lR=ke("tree-pine",iR);/**
491
+ * @license lucide-react v0.511.0 - ISC
492
+ *
493
+ * This source code is licensed under the ISC license.
494
+ * See the LICENSE file in the root directory of this source tree.
495
+ */const oR=[["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"}]],z6=ke("triangle-alert",oR);/**
496
+ * @license lucide-react v0.511.0 - ISC
497
+ *
498
+ * This source code is licensed under the ISC license.
499
+ * See the LICENSE file in the root directory of this source tree.
500
+ */const uR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],cR=ke("upload",uR);/**
501
+ * @license lucide-react v0.511.0 - ISC
502
+ *
503
+ * This source code is licensed under the ISC license.
504
+ * See the LICENSE file in the root directory of this source tree.
505
+ */const dR=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fR=ke("user",dR);/**
506
+ * @license lucide-react v0.511.0 - ISC
507
+ *
508
+ * This source code is licensed under the ISC license.
509
+ * See the LICENSE file in the root directory of this source tree.
510
+ */const hR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],pR=ke("users",hR);/**
511
+ * @license lucide-react v0.511.0 - ISC
512
+ *
513
+ * This source code is licensed under the ISC license.
514
+ * See the LICENSE file in the root directory of this source tree.
515
+ */const mR=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],gR=ke("video",mR);/**
516
+ * @license lucide-react v0.511.0 - ISC
517
+ *
518
+ * This source code is licensed under the ISC license.
519
+ * See the LICENSE file in the root directory of this source tree.
520
+ */const yR=[["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"}]],xR=ke("wifi-off",yR);/**
521
+ * @license lucide-react v0.511.0 - ISC
522
+ *
523
+ * This source code is licensed under the ISC license.
524
+ * See the LICENSE file in the root directory of this source tree.
525
+ */const bR=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],p3=ke("wifi",bR);/**
526
+ * @license lucide-react v0.511.0 - ISC
527
+ *
528
+ * This source code is licensed under the ISC license.
529
+ * See the LICENSE file in the root directory of this source tree.
530
+ */const vR=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],SR=ke("workflow",vR);/**
531
+ * @license lucide-react v0.511.0 - ISC
532
+ *
533
+ * This source code is licensed under the ISC license.
534
+ * See the LICENSE file in the root directory of this source tree.
535
+ */const NR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Lu=ke("x",NR);/**
536
+ * @license lucide-react v0.511.0 - ISC
537
+ *
538
+ * This source code is licensed under the ISC license.
539
+ * See the LICENSE file in the root directory of this source tree.
540
+ */const _R=[["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"}]],k6=ke("wrench",_R);var m3={};const at=t=>typeof t=="string",Kp=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},g3=t=>t==null?"":""+t,CR=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},jR=/###/g,y3=t=>t&&t.indexOf("###")>-1?t.replace(jR,"."):t,x3=t=>!t||at(t),ym=(t,e,n)=>{const s=at(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(x3(t))return{};const o=y3(s[i]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++i}return x3(t)?{}:{obj:t,k:y3(s[i])}},b3=(t,e,n)=>{const{obj:s,k:i}=ym(t,e,Object);if(s!==void 0||e.length===1){s[i]=n;return}let o=e[e.length-1],d=e.slice(0,e.length-1),f=ym(t,d,Object);for(;f.obj===void 0&&d.length;)o=`${d[d.length-1]}.${o}`,d=d.slice(0,d.length-1),f=ym(t,d,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},wR=(t,e,n,s)=>{const{obj:i,k:o}=ym(t,e,Object);i[o]=i[o]||[],i[o].push(n)},j1=(t,e)=>{const{obj:n,k:s}=ym(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},ER=(t,e,n)=>{const s=j1(t,n);return s!==void 0?s:j1(e,n)},L6=(t,e,n)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in t?at(t[s])||t[s]instanceof String||at(e[s])||e[s]instanceof String?n&&(t[s]=e[s]):L6(t[s],e[s],n):t[s]=e[s]);return t},Dc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var TR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const RR=t=>at(t)?t.replace(/[&<>"'\/]/g,e=>TR[e]):t;class OR{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const AR=[" ",",","?","!",";"],MR=new OR(20),DR=(t,e,n)=>{e=e||"",n=n||"";const s=AR.filter(d=>e.indexOf(d)<0&&n.indexOf(d)<0);if(s.length===0)return!0;const i=MR.getRegExp(`(${s.map(d=>d==="?"?"\\?":d).join("|")})`);let o=!i.test(t);if(!o){const d=t.indexOf(n);d>0&&!i.test(t.substring(0,d))&&(o=!0)}return o},xb=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const s=e.split(n);let i=t;for(let o=0;o<s.length;){if(!i||typeof i!="object")return;let d,f="";for(let m=o;m<s.length;++m)if(m!==o&&(f+=n),f+=s[m],d=i[f],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&m<s.length-1)continue;o+=m-o+1;break}i=d}return i},Dm=t=>t==null?void 0:t.replace(/_/g,"-"),zR={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,s;(s=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||s.call(n,console,e)}};class w1{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||zR,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,s,i){return i&&!this.debug?null:(at(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new w1(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new w1(this.logger,e)}}var pl=new w1;class V1{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(n)||0;this.observers[s].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i.apply(i,[e,...n])})}}class v3 extends V1{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,s,i={}){var y,v;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;e.indexOf(".")>-1?f=e.split("."):(f=[e,n],s&&(Array.isArray(s)?f.push(...s):at(s)&&o?f.push(...s.split(o)):f.push(s)));const m=j1(this.data,f);return!m&&!n&&!s&&e.indexOf(".")>-1&&(e=f[0],n=f[1],s=f.slice(2).join(".")),m||!d||!at(s)?m:xb((v=(y=this.data)==null?void 0:y[e])==null?void 0:v[n],s,o)}addResource(e,n,s,i,o={silent:!1}){const d=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=[e,n];s&&(f=f.concat(d?s.split(d):s)),e.indexOf(".")>-1&&(f=e.split("."),i=n,n=f[1]),this.addNamespaces(n),b3(this.data,f,i),o.silent||this.emit("added",e,n,s,i)}addResources(e,n,s,i={silent:!1}){for(const o in s)(at(s[o])||Array.isArray(s[o]))&&this.addResource(e,n,o,s[o],{silent:!0});i.silent||this.emit("added",e,n,s)}addResourceBundle(e,n,s,i,o,d={silent:!1,skipCopy:!1}){let f=[e,n];e.indexOf(".")>-1&&(f=e.split("."),i=s,s=n,n=f[1]),this.addNamespaces(n);let m=j1(this.data,f)||{};d.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?L6(m,s,o):m={...m,...s},b3(this.data,f,m),d.silent||this.emit("added",e,n,s)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var U6={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,i){return t.forEach(o=>{var d;e=((d=this.processors[o])==null?void 0:d.process(e,n,s,i))??e}),e}};const H6=Symbol("i18next/PATH_KEY");function kR(){const t=[],e=Object.create(null);let n;return e.get=(s,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===H6?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function kf(t,e){const{[H6]:n}=t(kR()),s=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&i){const o=e==null?void 0:e.ns,d=Array.isArray(o)?o:null;if(d&&d.length>1&&d.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(s)}`}return n.join(s)}const S3={},ex=t=>!at(t)&&typeof t!="boolean"&&typeof t!="number";class E1 extends V1{constructor(e,n={}){super(),CR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=pl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const s={...n};if(e==null)return!1;const i=this.resolve(e,s);if((i==null?void 0:i.res)===void 0)return!1;const o=ex(i.res);return!(s.returnObjects===!1&&o)}extractFromKey(e,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const d=s&&e.indexOf(s)>-1,f=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!DR(e,s,i);if(d&&!f){const m=e.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:e,namespaces:at(o)?[o]:o};const y=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(y[0])>-1)&&(o=y.shift()),e=y.join(i)}return{key:e,namespaces:at(o)?[o]:o}}translate(e,n,s){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=kf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(J=>typeof J=="function"?kf(J,{...this.options,...i}):String(J));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,d=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:f,namespaces:m}=this.extractFromKey(e[e.length-1],i),y=m[m.length-1];let v=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=i.lng||this.language,_=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((b==null?void 0:b.toLowerCase())==="cimode")return _?o?{res:`${y}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:`${y}${v}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:f;const j=this.resolve(e,i);let w=j==null?void 0:j.res;const O=(j==null?void 0:j.usedKey)||f,R=(j==null?void 0:j.exactUsedKey)||f,T=["[object Number]","[object Function]","[object RegExp]"],A=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!at(i.count),P=E1.hasDefaultValue(i),H=k?this.pluralResolver.getSuffix(b,i.count,i):"",B=i.ordinal&&k?this.pluralResolver.getSuffix(b,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,V=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${H}`]||i[`defaultValue${B}`]||i.defaultValue;let Z=w;z&&!w&&P&&(Z=V);const oe=ex(Z),ne=Object.prototype.toString.apply(Z);if(z&&Z&&oe&&T.indexOf(ne)<0&&!(at(A)&&Array.isArray(Z))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,Z,{...i,ns:m}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(j.res=J,j.usedParams=this.getUsedParamsDetails(i),j):J}if(d){const J=Array.isArray(Z),ie=J?[]:{},ce=J?R:O;for(const Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y)){const $=`${ce}${d}${Y}`;P&&!w?ie[Y]=this.translate($,{...i,defaultValue:ex(V)?V[Y]:void 0,joinArrays:!1,ns:m}):ie[Y]=this.translate($,{...i,joinArrays:!1,ns:m}),ie[Y]===$&&(ie[Y]=Z[Y])}w=ie}}else if(z&&at(A)&&Array.isArray(w))w=w.join(A),w&&(w=this.extendTranslation(w,e,i,s));else{let J=!1,ie=!1;!this.isValidLookup(w)&&P&&(J=!0,w=V),this.isValidLookup(w)||(ie=!0,w=f);const Y=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:w,$=P&&V!==w&&this.options.updateMissing;if(ie||J||$){if(this.logger.log($?"updateKey":"missingKey",b,y,f,$?V:w),d){const G=this.resolve(f,{...i,keySeparator:!1});G&&G.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 ae=[];const Ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Ne&&Ne[0])for(let G=0;G<Ne.length;G++)ae.push(Ne[G]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const re=(G,W,he)=>{var _e;const xe=P&&he!==w?he:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(G,y,W,xe,$,i):(_e=this.backendConnector)!=null&&_e.saveMissing&&this.backendConnector.saveMissing(G,y,W,xe,$,i),this.emit("missingKey",G,y,W,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ae.forEach(G=>{const W=this.pluralResolver.getSuffixes(G,i);L&&i[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(he=>{re([G],f+he,i[`defaultValue${he}`]||V)})}):re(ae,f,V))}w=this.extendTranslation(w,e,i,j,s),ie&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${y}${v}${f}`),(ie||J)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${v}${f}`:f,J?w:void 0,i))}return o?(j.res=w,j.usedParams=this.getUsedParamsDetails(i),j):w}extendTranslation(e,n,s,i,o){var m,y;if((m=this.i18nFormat)!=null&&m.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const v=at(e)&&(((y=s==null?void 0:s.interpolation)==null?void 0:y.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let b;if(v){const j=e.match(this.interpolator.nestingRegexp);b=j&&j.length}let _=s.replace&&!at(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(_={...this.options.interpolation.defaultVariables,..._}),e=this.interpolator.interpolate(e,_,s.lng||this.language||i.usedLng,s),v){const j=e.match(this.interpolator.nestingRegexp),w=j&&j.length;b<w&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...j)=>(o==null?void 0:o[0])===j[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${j[0]} in key: ${n[0]}`),null):this.translate(...j,n),s)),s.interpolation&&this.interpolator.reset()}const d=s.postProcess||this.options.postProcess,f=at(d)?[d]:d;return e!=null&&(f!=null&&f.length)&&s.applyPostProcessor!==!1&&(e=U6.handle(f,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,n={}){let s,i,o,d,f;return at(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(m=>typeof m=="function"?kf(m,{...this.options,...n}):m)),e.forEach(m=>{if(this.isValidLookup(s))return;const y=this.extractFromKey(m,n),v=y.key;i=v;let b=y.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=n.count!==void 0&&!at(n.count),j=_&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",O=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);b.forEach(R=>{var T,A;this.isValidLookup(s)||(f=R,!S3[`${O[0]}-${R}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((A=this.utils)!=null&&A.hasLoadedNamespace(f))&&(S3[`${O[0]}-${R}`]=!0,this.logger.warn(`key "${i}" for languages "${O.join(", ")}" won't get resolved as namespace "${f}" 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!!!")),O.forEach(z=>{var H;if(this.isValidLookup(s))return;d=z;const k=[v];if((H=this.i18nFormat)!=null&&H.addLookupKeys)this.i18nFormat.addLookupKeys(k,v,z,R,n);else{let B;_&&(B=this.pluralResolver.getSuffix(z,n.count,n));const L=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(n.ordinal&&B.indexOf(V)===0&&k.push(v+B.replace(V,this.options.pluralSeparator)),k.push(v+B),j&&k.push(v+L)),w){const Z=`${v}${this.options.contextSeparator||"_"}${n.context}`;k.push(Z),_&&(n.ordinal&&B.indexOf(V)===0&&k.push(Z+B.replace(V,this.options.pluralSeparator)),k.push(Z+B),j&&k.push(Z+L))}}let P;for(;P=k.pop();)this.isValidLookup(s)||(o=P,s=this.getResource(z,R,P,n))}))})}),{res:s,usedKey:i,exactUsedKey:o,usedLng:d,usedNS:f}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,s,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(e,n,s,i):this.resourceStore.getResource(e,n,s,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!at(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(e){const n="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n===s.substring(0,n.length)&&e[s]!==void 0)return!0;return!1}}class N3{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pl.create("languageUtils")}getScriptPartFromCode(e){if(e=Dm(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Dm(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(at(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(s=>{if(n)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(s=>{if(n)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(s);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(d=>{if(d===o)return d;if(!(d.indexOf("-")<0&&o.indexOf("-")<0)&&(d.indexOf("-")>0&&o.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===o||d.indexOf(o)===0&&o.length>1))return d})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),at(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let s=e[n];return s||(s=e[this.getScriptPartFromCode(n)]),s||(s=e[this.formatLanguageCode(n)]),s||(s=e[this.getLanguagePartFromCode(n)]),s||(s=e.default),s||[]}toResolveHierarchy(e,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],o=d=>{d&&(this.isSupportedCode(d)?i.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return at(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):at(e)&&o(this.formatLanguageCode(e)),s.forEach(d=>{i.indexOf(d)<0&&o(this.formatLanguageCode(d))}),i}}const _3={zero:0,one:1,two:2,few:3,many:4,other:5},C3={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class LR{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=pl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=Dm(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let d;try{d=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),C3;if(!e.match(/-|_/))return C3;const m=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(m,n)}return this.pluralRulesCache[o]=d,d}needsPlural(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,s={}){return this.getSuffixes(e,s).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((i,o)=>_3[i]-_3[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,s))}}const j3=(t,e,n,s=".",i=!0)=>{let o=ER(t,e,n);return!o&&i&&at(n)&&(o=xb(t,n,s),o===void 0&&(o=xb(e,n,s))),o},tx=t=>t.replace(/\$/g,"$$$$");class w3{constructor(e={}){var n;this.logger=pl.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:i,prefix:o,prefixEscaped:d,suffix:f,suffixEscaped:m,formatSeparator:y,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:w,nestingSuffixEscaped:O,nestingOptionsSeparator:R,maxReplaces:T,alwaysFormat:A}=e.interpolation;this.escape=n!==void 0?n:RR,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Dc(o):d||"{{",this.suffix=f?Dc(f):m||"}}",this.formatSeparator=y||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Dc(_):j||Dc("$t("),this.nestingSuffix=w?Dc(w):O||Dc(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=T||1e3,this.alwaysFormat=A!==void 0?A:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,s)=>(n==null?void 0:n.source)===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,s,i){var j;let o,d,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=w=>{if(w.indexOf(this.formatSeparator)<0){const A=j3(n,m,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(A,void 0,s,{...i,...n,interpolationkey:w}):A}const O=w.split(this.formatSeparator),R=O.shift().trim(),T=O.join(this.formatSeparator).trim();return this.format(j3(n,m,R,this.options.keySeparator,this.options.ignoreJSONStructure),T,s,{...i,...n,interpolationkey:R})};this.resetRegExp();const v=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,b=((j=i==null?void 0:i.interpolation)==null?void 0:j.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>tx(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?tx(this.escape(w)):tx(w)}].forEach(w=>{for(f=0;o=w.regex.exec(e);){const O=o[1].trim();if(d=y(O),d===void 0)if(typeof v=="function"){const T=v(e,o,i);d=at(T)?T:""}else if(i&&Object.prototype.hasOwnProperty.call(i,O))d="";else if(b){d=o[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${e}`),d="";else!at(d)&&!this.useRawValueToEscape&&(d=g3(d));const R=w.safeValue(d);if(e=e.replace(o[0],R),b?(w.regex.lastIndex+=d.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),e}nest(e,n,s={}){let i,o,d;const f=(m,y)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const b=m.split(new RegExp(`${Dc(v)}[ ]*{`));let _=`{${b[1]}`;m=b[0],_=this.interpolate(_,d);const j=_.match(/'/g),w=_.match(/"/g);(((j==null?void 0:j.length)??0)%2===0&&!w||((w==null?void 0:w.length)??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{d=JSON.parse(_),y&&(d={...y,...d})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,O),`${m}${v}${_}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,m};for(;i=this.nestingRegexp.exec(e);){let m=[];d={...s},d=d.replace&&!at(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const y=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(y!==-1&&(m=i[1].slice(y).split(this.formatSeparator).map(v=>v.trim()).filter(Boolean),i[1]=i[1].slice(0,y)),o=n(f.call(this,i[1].trim(),d),d),o&&i[0]===e&&!at(o))return o;at(o)||(o=g3(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),m.length&&(o=m.reduce((v,b)=>this.format(v,b,s.lng,{...s,interpolationkey:i[1].trim()}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const UR=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(d=>{if(d){const[f,...m]=d.split(":"),y=m.join(":").trim().replace(/^'+|'+$/g,""),v=f.trim();n[v]||(n[v]=y),y==="false"&&(n[v]=!1),y==="true"&&(n[v]=!0),isNaN(y)||(n[v]=parseInt(y,10))}})}return{formatName:e,formatOptions:n}},E3=t=>{const e={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const d=s+JSON.stringify(o);let f=e[d];return f||(f=t(Dm(s),i),e[d]=f),f(n)}},HR=t=>(e,n,s)=>t(Dm(n),s)(e);class qR{constructor(e={}){this.logger=pl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?E3:HR;this.formats={number:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o});return f=>d.format(f)}),currency:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o,style:"currency"});return f=>d.format(f)}),datetime:s((i,o)=>{const d=new Intl.DateTimeFormat(i,{...o});return f=>d.format(f)}),relativetime:s((i,o)=>{const d=new Intl.RelativeTimeFormat(i,{...o});return f=>d.format(f,o.range||"day")}),list:s((i,o)=>{const d=new Intl.ListFormat(i,{...o});return f=>d.format(f)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=E3(n)}format(e,n,s,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(f=>f.indexOf(")")>-1)){const f=o.findIndex(m=>m.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,m)=>{var b;const{formatName:y,formatOptions:v}=UR(m);if(this.formats[y]){let _=f;try{const j=((b=i==null?void 0:i.formatParams)==null?void 0:b[i.interpolationkey])||{},w=j.locale||j.lng||i.locale||i.lng||s;_=this.formats[y](f,w,{...v,...i,...j})}catch(j){this.logger.warn(j)}return _}else this.logger.warn(`there was no format function for ${y}`);return f},e)}}const BR=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class GR extends V1{constructor(e,n,s,i={}){var o,d;super(),this.backend=e,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=pl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(d=(o=this.backend)==null?void 0:o.init)==null||d.call(o,s,i.backend,i)}queueLoad(e,n,s,i){const o={},d={},f={},m={};return e.forEach(y=>{let v=!0;n.forEach(b=>{const _=`${y}|${b}`;!s.reload&&this.store.hasResourceBundle(y,b)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?d[_]===void 0&&(d[_]=!0):(this.state[_]=1,v=!1,d[_]===void 0&&(d[_]=!0),o[_]===void 0&&(o[_]=!0),m[b]===void 0&&(m[b]=!0)))}),v||(f[y]=!0)}),(Object.keys(o).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(m)}}loaded(e,n,s){const i=e.split("|"),o=i[0],d=i[1];n&&this.emit("failedLoading",o,d,n),!n&&s&&this.store.addResourceBundle(o,d,s,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&s&&(this.state[e]=0);const f={};this.queue.forEach(m=>{wR(m.loaded,[o],d),BR(m,e),n&&m.errors.push(n),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(y=>{f[y]||(f[y]={});const v=m.loaded[y];v.length&&v.forEach(b=>{f[y][b]===void 0&&(f[y][b]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.done)}read(e,n,s,i=0,o=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:s,tried:i,wait:o,callback:d});return}this.readingCalls++;const f=(y,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(y&&v&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,o*2,d)},o);return}d(y,v)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const y=m(e,n);y&&typeof y.then=="function"?y.then(v=>f(null,v)).catch(f):f(null,y)}catch(y){f(y)}return}return m(e,n,f)}prepareLoading(e,n,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();at(e)&&(e=this.languageUtils.toResolveHierarchy(e)),at(n)&&(n=[n]);const o=this.queueLoad(e,n,s,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(d=>{this.loadOne(d)})}load(e,n,s){this.prepareLoading(e,n,{},s)}reload(e,n,s){this.prepareLoading(e,n,{reload:!0},s)}loadOne(e,n=""){const s=e.split("|"),i=s[0],o=s[1];this.read(i,o,"read",void 0,void 0,(d,f)=>{d&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,d),!d&&f&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,f),this.loaded(e,d,f)})}saveMissing(e,n,s,i,o,d={},f=()=>{}){var m,y,v,b,_;if((y=(m=this.services)==null?void 0:m.utils)!=null&&y.hasLoadedNamespace&&!((b=(v=this.services)==null?void 0:v.utils)!=null&&b.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${s}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((_=this.backend)!=null&&_.create){const j={...d,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let O;w.length===5?O=w(e,n,s,i,j):O=w(e,n,s,i),O&&typeof O.then=="function"?O.then(R=>f(null,R)).catch(f):f(null,O)}catch(O){f(O)}else w(e,n,s,i,f,j)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const nx=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),at(t[1])&&(e.defaultValue=t[1]),at(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(s=>{e[s]=n[s]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),T3=t=>{var e,n;return at(t.ns)&&(t.ns=[t.ns]),at(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),at(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Y0=()=>{},PR=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},q6="__i18next_supportNoticeShown",YR=()=>!!(typeof globalThis<"u"&&globalThis[q6]||typeof process<"u"&&m3&&m3.I18NEXT_NO_SUPPORT_NOTICE),VR=()=>{typeof globalThis<"u"&&(globalThis[q6]=!0)},QR=t=>{var e,n,s,i,o,d,f,m,y,v,b,_,j;return!!(((s=(n=(e=t==null?void 0:t.modules)==null?void 0:e.backend)==null?void 0:n.name)==null?void 0:s.indexOf("Locize"))>0||((f=(d=(o=(i=t==null?void 0:t.modules)==null?void 0:i.backend)==null?void 0:o.constructor)==null?void 0:d.name)==null?void 0:f.indexOf("Locize"))>0||(y=(m=t==null?void 0:t.options)==null?void 0:m.backend)!=null&&y.backends&&t.options.backend.backends.some(w=>{var O,R,T;return((O=w==null?void 0:w.name)==null?void 0:O.indexOf("Locize"))>0||((T=(R=w==null?void 0:w.constructor)==null?void 0:R.name)==null?void 0:T.indexOf("Locize"))>0})||(b=(v=t==null?void 0:t.options)==null?void 0:v.backend)!=null&&b.projectId||(j=(_=t==null?void 0:t.options)==null?void 0:_.backend)!=null&&j.backendOptions&&t.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class xm extends V1{constructor(e={},n){if(super(),this.options=T3(e),this.services={},this.logger=pl,this.modules={external:[]},PR(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(at(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=nx();this.options={...s,...this.options,...T3(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!QR(this)&&!YR()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),VR());const i=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?pl.init(i(this.modules.logger),this.options):pl.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=qR;const v=new N3(this.options);this.store=new v3(this.options.resources,this.options);const b=this.services;b.logger=pl,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new LR(v,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(b.formatter=i(y),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new w3(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new GR(i(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.languageDetector&&(b.languageDetector=i(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=i(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new E1(this.services,this.options),this.translator.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.external.forEach(j=>{j.init&&j.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Y0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[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(y=>{this[y]=(...v)=>this.store[y](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...v)=>(this.store[y](...v),this)});const f=Kp(),m=()=>{const y=(v,b)=>{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),f.resolve(b),n(v,b)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),f}loadResources(e,n=Y0){var o,d;let s=n;const i=at(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const f=[],m=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(b=>{b!=="cimode"&&f.indexOf(b)<0&&f.push(b)})};i?m(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(v=>m(v)),(d=(o=this.options.preload)==null?void 0:o.forEach)==null||d.call(o,y=>m(y)),this.services.backendConnector.load(f,this.options.ns,y=>{!y&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(y)})}else s(null)}reloadResources(e,n,s){const i=Kp();return typeof e=="function"&&(s=e,e=void 0),typeof n=="function"&&(s=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),s||(s=Y0),this.services.backendConnector.reload(e,n,o=>{i.resolve(),s(o)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&U6.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const s=Kp();this.emit("languageChanging",e);const i=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},o=(f,m)=>{m?this.isLanguageChangingTo===e&&(i(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...y)=>this.t(...y)),n&&n(f,(...y)=>this.t(...y))},d=f=>{var v,b;!e&&!f&&this.services.languageDetector&&(f=[]);const m=at(f)?f:f&&f[0],y=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(at(f)?[f]:f);y&&(this.language||i(y),this.translator.language||this.translator.changeLanguage(y),(b=(v=this.services.languageDetector)==null?void 0:v.cacheUserLanguage)==null||b.call(v,y)),this.loadResources(y,_=>{o(_,y)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(e),s}getFixedT(e,n,s){const i=(o,d,...f)=>{let m;typeof d!="object"?m=this.options.overloadTranslationOptionHandler([o,d].concat(f)):m={...d},m.lng=m.lng||i.lng,m.lngs=m.lngs||i.lngs,m.ns=m.ns||i.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||i.keyPrefix);const y={...this.options,...m};typeof m.keyPrefix=="function"&&(m.keyPrefix=kf(m.keyPrefix,y));const v=this.options.keySeparator||".";let b;return m.keyPrefix&&Array.isArray(o)?b=o.map(_=>(typeof _=="function"&&(_=kf(_,y)),`${m.keyPrefix}${v}${_}`)):(typeof o=="function"&&(o=kf(o,y)),b=m.keyPrefix?`${m.keyPrefix}${v}${o}`:o),this.t(b,m)};return at(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=s,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const d=(f,m)=>{const y=this.services.backendConnector.state[`${f}|${m}`];return y===-1||y===0||y===2};if(n.precheck){const f=n.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,e)&&(!i||d(o,e)))}loadNamespaces(e,n){const s=Kp();return this.options.ns?(at(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),n&&n(i)}),s):(n&&n(),Promise.resolve())}loadLanguages(e,n){const s=Kp();at(e)&&(e=[e]);const i=this.options.preload||[],o=e.filter(d=>i.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return o.length?(this.options.preload=i.concat(o),this.loadResources(d=>{s.resolve(),n&&n(d)}),s):(n&&n(),Promise.resolve())}dir(e){var i,o;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const d=new Intl.Locale(e);if(d&&d.getTextInfo){const f=d.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((o=this.services)==null?void 0:o.languageUtils)||new N3(nx());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const s=new xm(e,n);return s.createInstance=xm.createInstance,s}cloneInstance(e={},n=Y0){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new xm(i);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(f=>{o[f]=this[f]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s){const f=Object.keys(this.store.data).reduce((m,y)=>(m[y]={...this.store.data[y]},m[y]=Object.keys(m[y]).reduce((v,b)=>(v[b]={...m[y][b]},v),m[y]),m),{});o.store=new v3(f,i),o.services.resourceStore=o.store}if(e.interpolation){const m={...nx().interpolation,...this.options.interpolation,...e.interpolation},y={...i,interpolation:m};o.services.interpolator=new w3(y)}return o.translator=new E1(o.services,i),o.translator.on("*",(f,...m)=>{o.emit(f,...m)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ss=xm.createInstance();Ss.createInstance;Ss.dir;Ss.init;Ss.loadResources;Ss.reloadResources;Ss.use;Ss.changeLanguage;Ss.getFixedT;Ss.t;Ss.exists;Ss.setDefaultNamespace;Ss.hasLoadedNamespace;Ss.loadNamespaces;Ss.loadLanguages;const XR=(t,e,n,s)=>{var o,d,f,m;const i=[n,{code:e,...s||{}}];if((d=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&d.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Jc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(m=(f=t==null?void 0:t.services)==null?void 0:f.logger)!=null&&m.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},R3={},bb=(t,e,n,s)=>{Jc(n)&&R3[n]||(Jc(n)&&(R3[n]=new Date),XR(t,e,n,s))},B6=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},vb=(t,e,n)=>{t.loadNamespaces(e,B6(t,n))},O3=(t,e,n,s)=>{if(Jc(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return vb(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,B6(t,s))},KR=(t,e,n={})=>!e.languages||!e.languages.length?(bb(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(s,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,t))return!1}}),Jc=t=>typeof t=="string",FR=t=>typeof t=="object"&&t!==null,ZR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,IR={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},JR=t=>IR[t],WR=t=>t.replace(ZR,JR);let Sb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:WR,transDefaultProps:void 0};const $R=(t={})=>{Sb={...Sb,...t}},eO=()=>Sb;let G6;const tO=t=>{G6=t},nO=()=>G6,aO={type:"3rdParty",init(t){$R(t.options.react),tO(t)}},sO=D.createContext();class rO{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ax={exports:{}},sx={};/**
541
+ * @license React
542
+ * use-sync-external-store-shim.production.js
543
+ *
544
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
545
+ *
546
+ * This source code is licensed under the MIT license found in the
547
+ * LICENSE file in the root directory of this source tree.
548
+ */var A3;function iO(){if(A3)return sx;A3=1;var t=gl();function e(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var n=typeof Object.is=="function"?Object.is:e,s=t.useState,i=t.useEffect,o=t.useLayoutEffect,d=t.useDebugValue;function f(b,_){var j=_(),w=s({inst:{value:j,getSnapshot:_}}),O=w[0].inst,R=w[1];return o(function(){O.value=j,O.getSnapshot=_,m(O)&&R({inst:O})},[b,j,_]),i(function(){return m(O)&&R({inst:O}),b(function(){m(O)&&R({inst:O})})},[b]),d(j),j}function m(b){var _=b.getSnapshot;b=b.value;try{var j=_();return!n(b,j)}catch{return!0}}function y(b,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return sx.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,sx}var M3;function lO(){return M3||(M3=1,ax.exports=iO()),ax.exports}var oO=lO();const uO=(t,e)=>{if(Jc(e))return e;if(FR(e)&&Jc(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},cO={t:uO,ready:!1},dO=()=>()=>{},Rr=(t,e={})=>{var V,Z,oe;const{i18n:n}=e,{i18n:s,defaultNS:i}=D.useContext(sO)||{},o=n||s||nO();o&&!o.reportNamespaces&&(o.reportNamespaces=new rO),o||bb(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=D.useMemo(()=>{var ne;return{...eO(),...(ne=o==null?void 0:o.options)==null?void 0:ne.react,...e}},[o,e]),{useSuspense:f,keyPrefix:m}=d,y=i||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),v=Jc(y)?[y]:y||["translation"],b=D.useMemo(()=>v,v);(oe=(Z=o==null?void 0:o.reportNamespaces)==null?void 0:Z.addUsedNamespaces)==null||oe.call(Z,b);const _=D.useRef(0),j=D.useCallback(ne=>{if(!o)return dO;const{bindI18n:J,bindI18nStore:ie}=d,ce=()=>{_.current+=1,ne()};return J&&o.on(J,ce),ie&&o.store.on(ie,ce),()=>{J&&J.split(" ").forEach(Y=>o.off(Y,ce)),ie&&ie.split(" ").forEach(Y=>o.store.off(Y,ce))}},[o,d]),w=D.useRef(),O=D.useCallback(()=>{if(!o)return cO;const ne=!!(o.isInitialized||o.initializedStoreOnce)&&b.every(ae=>KR(ae,o,d)),J=e.lng||o.language,ie=_.current,ce=w.current;if(ce&&ce.ready===ne&&ce.lng===J&&ce.keyPrefix===m&&ce.revision===ie)return ce;const $={t:o.getFixedT(J,d.nsMode==="fallback"?b:b[0],m),ready:ne,lng:J,keyPrefix:m,revision:ie};return w.current=$,$},[o,b,m,d,e.lng]),[R,T]=D.useState(0),{t:A,ready:z}=oO.useSyncExternalStore(j,O,O);D.useEffect(()=>{if(o&&!z&&!f){const ne=()=>T(J=>J+1);e.lng?O3(o,e.lng,b,ne):vb(o,b,ne)}},[o,e.lng,b,z,f,R]);const k=o||{},P=D.useRef(null),H=D.useRef(),B=ne=>{const J=Object.getOwnPropertyDescriptors(ne);J.__original&&delete J.__original;const ie=Object.create(Object.getPrototypeOf(ne),J);if(!Object.prototype.hasOwnProperty.call(ie,"__original"))try{Object.defineProperty(ie,"__original",{value:ne,writable:!1,enumerable:!1,configurable:!1})}catch{}return ie},L=D.useMemo(()=>{const ne=k,J=ne==null?void 0:ne.language;let ie=ne;ne&&(P.current&&P.current.__original===ne?H.current!==J?(ie=B(ne),P.current=ie,H.current=J):ie=P.current:(ie=B(ne),P.current=ie,H.current=J));const ce=!z&&!f?(...$)=>(bb(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),A(...$)):A,Y=[ce,ie,z];return Y.t=ce,Y.i18n=ie,Y.ready=z,Y},[A,k,z,k.resolvedLanguage,k.language,k.languages]);if(o&&f&&!z)throw new Promise(ne=>{const J=()=>ne();e.lng?O3(o,e.lng,b,J):vb(o,b,J)});return L};function P6(t){return t.map(e=>({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,bundle:e.page.bundle,bundleUrl:e.bundleUrl}))}const D3=new Map;function fO(){const{pagePath:t}=Wb(),e=Am(),{data:n}=Ct({queryKey:["addon-pages"],queryFn:async()=>{const m=await e.trpc.addonPages.listPages.query();return P6(m)},staleTime:6e4}),s=n==null?void 0:n.find(m=>m.path===`/addon/${t}`),[i,o]=D.useState(null),[d,f]=D.useState(null);return D.useEffect(()=>{if(!s)return;const m=`${s.addonId}/${s.bundle}`,y=D3.get(m);if(y){o(()=>y);return}f(null),o(null);const v=s.bundleUrl;import(v).then(b=>{const _=b.default;if(typeof _!="function")throw new Error(`Addon page "${s.id}" does not export a default React component`);D3.set(m,_),o(()=>_)}).catch(b=>{console.error(`[AddonPageLoader] Failed to load ${v}:`,b),f(`Failed to load addon page: ${b.message}`)})},[s]),n?s?d?h.jsx("div",{className:"flex items-center justify-center h-full text-red-400 text-sm",children:d}):i?h.jsx(i,{trpc:e.trpc,theme:{isDark:document.documentElement.classList.contains("dark")},navigate:m=>{window.location.href=m}}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})}):h.jsx("div",{className:"flex items-center justify-center h-full text-foreground-subtle",children:"Addon page not found"}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})})}const hO={dark:DT,light:eR,system:N1},pO={gauge:cT,puzzle:_1,bot:mb,cpu:zf,terminal:nR,box:jE,wrench:k6,activity:uv,plug:A6};function mO(){const t=yl(),e=xl(),{user:n,logout:s}=ov(),i=bS(),{t:o,i18n:d}=Rr(),f=Am(),{data:m=0}=Ct({queryKey:["updates","count"],queryFn:async()=>(await f.trpc.update.listUpdates.query()).length,staleTime:3e4,refetchInterval:3e4}),{data:y}=Ct({queryKey:["addon-pages"],queryFn:async()=>{const T=await f.trpc.addonPages.listPages.query();return P6(T)},staleTime:6e4}),v=()=>{s(),e("/login")},b=T=>t.pathname===T||t.pathname.startsWith(T+"/"),_=()=>{const T=d.language==="en"?"it":"en";d.changeLanguage(T)},j=[{label:o("nav.cameras","Cameras"),icon:ku,path:"/cameras"},{label:o("nav.integrations"),icon:A6,path:"/integrations"},{label:o("nav.timeline","Timeline"),icon:j6,path:"/timeline"},{label:o("nav.pipeline","Pipeline"),icon:P1,path:"/pipeline"}],w=[{label:o("system.addons"),icon:_1,path:"/system/addons"},{label:o("system.agents","Agents & Processes"),icon:C1,path:"/system/agents"},{label:o("system.logs"),icon:Y1,path:"/system/logs"},{label:o("system.users"),icon:pR,path:"/system/users"},{label:o("system.settings"),icon:k6,path:"/system/settings"}],O=(i==null?void 0:i.mode)??"system",R={dark:o("theme.dark"),light:o("theme.light"),system:o("theme.system")};return h.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[h.jsxs("aside",{className:"flex w-48 flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0",children:[h.jsx("div",{className:"flex h-14 items-center px-3 border-b border-border",children:h.jsx("img",{src:(i==null?void 0:i.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-9"})}),h.jsxs("nav",{className:"flex-1 overflow-y-auto py-3 px-2 space-y-0.5",children:[(()=>{const T=b("/dashboard");return h.jsxs("button",{onClick:()=>e("/dashboard"),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-all ${T?"bg-primary/12 text-primary shadow-sm shadow-primary/5":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(R6,{className:`h-4 w-4 shrink-0 ${T?"text-primary":""}`}),o("nav.dashboard")]})})(),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.camerasSection","Cameras")})}),j.map(T=>{const A=T.icon,z=b(T.path);return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(A,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),T.label]},T.path)}),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("system.title")})}),w.map(T=>{const A=T.icon,z=b(T.path),k=T.path==="/system/addons";return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(A,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),h.jsx("span",{className:"flex-1 text-left",children:T.label}),k&&m>0&&h.jsx("span",{className:"ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none",children:m})]},T.path)}),y&&y.length>0&&h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.addonPages","Addon Pages")})}),y==null?void 0:y.map(T=>{const A=b(T.path),z=pO[T.icon]??_1;return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${A?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(z,{className:`h-3.5 w-3.5 shrink-0 ${A?"text-primary":""}`}),T.label]},T.id)})]}),h.jsxs("div",{className:"border-t border-border p-2 space-y-0.5",children:[h.jsxs("button",{onClick:_,title:o("language.select"),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[h.jsx(bT,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:d.language==="en"?o("language.en"):o("language.it")})]}),h.jsxs("button",{onClick:()=>i==null?void 0:i.toggleMode(),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[(()=>{const T=hO[O];return h.jsx(T,{className:"h-3.5 w-3.5"})})(),h.jsx("span",{children:R[O]})]}),h.jsxs("button",{onClick:v,className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-danger transition-colors",children:[h.jsx(ET,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate",children:(n==null?void 0:n.username)??"User"})]})]})]}),h.jsx("main",{className:"flex-1 overflow-auto bg-background",children:h.jsx(kN,{})})]})}function gO(){const{login:t}=ov(),e=bS(),n=xl(),[s,i]=D.useState(""),[o,d]=D.useState(""),[f,m]=D.useState(!1),[y,v]=D.useState(""),[b,_]=D.useState(!1),j=async w=>{w.preventDefault(),v(""),_(!0);try{await t(s,o),n("/dashboard",{replace:!0})}catch(O){v(O instanceof Error?O.message:"Login failed")}finally{_(!1)}};return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:h.jsxs("div",{className:"w-full max-w-sm",children:[h.jsx("div",{className:"flex justify-center mb-8",children:h.jsx("img",{src:(e==null?void 0:e.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-12"})}),h.jsxs("form",{onSubmit:j,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[y&&h.jsx("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:y}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),h.jsx("input",{type:"text",placeholder:"admin",value:s,onChange:w=>i(w.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})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:f?"text":"password",placeholder:"Enter password",value:o,onChange:w=>d(w.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"}),h.jsx("button",{type:"button",onClick:()=>m(!f),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors",tabIndex:-1,children:f?h.jsx(E6,{className:"h-4 w-4"}):h.jsx(ch,{className:"h-4 w-4"})})]})]}),h.jsx("button",{type:"submit",disabled:b||!s||!o,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:b?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground"}),"Logging in..."]}):"Log in"})]}),h.jsx("p",{className:"mt-6 text-center text-[10px] text-foreground-subtle/50",children:"CamStack v0.1.0"})]})})}function yO(){const t=xl();return h.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-background text-foreground p-4",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4",children:h.jsx(JT,{className:"h-8 w-8 text-danger"})}),h.jsx("h1",{className:"text-xl font-bold",children:"Access Denied"}),h.jsx("p",{className:"mt-2 text-sm text-foreground-subtle",children:"You don't have permission to access this page."}),h.jsx("button",{onClick:()=>t("/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"})]})}const pv=new Map;function mv(t){pv.set(t.id,t)}function z3(t){return pv.get(t)}function xO(){return Array.from(pv.values())}function sn(){return D.useMemo(()=>Am(),[])}function bO({config:t,size:e}){const n=sn(),{data:s,isLoading:i,error:o}=Ct({queryKey:["system-info"],queryFn:()=>n.getSystemInfo(),refetchInterval:1e4});if(i)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[h.jsx(eh,{className:"h-3.5 w-3.5 animate-spin"}),h.jsx("span",{children:"Connecting to server..."})]});if(o)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-danger",children:[h.jsx(z6,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Unable to reach server"})]});const d=s;return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[h.jsx(PE,{className:"h-3.5 w-3.5 text-success"}),h.jsx("span",{className:"text-success font-medium",children:"Online"})]}),h.jsx(V0,{label:"Version",value:String((d==null?void 0:d.version)??"N/A")}),h.jsx(V0,{label:"Uptime",value:vO(d==null?void 0:d.uptime)}),h.jsx(V0,{label:"Memory",value:`${SO(d==null?void 0:d.memoryUsage)} MB`}),h.jsx(V0,{label:"Platform",value:String((d==null?void 0:d.platform)??"N/A")})]})}function V0({label:t,value:e}){return h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{className:"text-foreground-subtle",children:t}),h.jsx("span",{className:"text-foreground font-medium tabular-nums",children:e})]})}function vO(t){if(!t)return"N/A";const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return e>0?`${e}h ${n}m`:`${n}m`}function SO(t){return t?(t/1024/1024).toFixed(0):"N/A"}const NO=["class-filter","tracker","sub-detection","recognition","zone-analysis","event-generation","object-snapshot"];function _O({config:t,size:e}){const n=sn(),{data:s,isLoading:i,error:o}=Ct({queryKey:["pipelines"],queryFn:()=>n.listPipelines(),refetchInterval:5e3});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load pipelines"});const d=s??[];return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex justify-between text-foreground-subtle",children:[h.jsx("span",{children:"Active pipelines"}),h.jsx("span",{className:"font-medium text-foreground",children:d.length})]}),h.jsx("div",{className:"space-y-0.5",children:NO.map(f=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success shrink-0"}),h.jsx("span",{className:"text-foreground-subtle",children:f})]},f))})]})}function CO(t){if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function jO({config:t,size:e}){const n=sn(),{data:s,isLoading:i,error:o}=Ct({queryKey:["system-info"],queryFn:async()=>await n.getSystemInfo(),refetchInterval:3e4}),{data:d}=Ct({queryKey:["storage-addons"],queryFn:()=>n.listAddons(),refetchInterval:6e4});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load system info"});const f=d??[];return h.jsxs("div",{className:"space-y-1.5 text-xs",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Platform"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.platform)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Uptime"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.uptime)!=null?CO(s.uptime):"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Node"}),h.jsx("span",{className:"text-foreground font-medium font-mono",children:(s==null?void 0:s.nodeVersion)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Addons"}),h.jsxs("span",{className:"text-foreground font-medium",children:[f.length," installed"]})]})]})}mv({id:"system-status",name:"System Status",icon:N1,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:bO});mv({id:"pipeline-stages",name:"Pipeline Stages",icon:SR,defaultSize:{w:4,h:3},minSize:{w:3,h:2},component:_O});mv({id:"storage",name:"Storage",icon:gm,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:jO});function dh(t){const{margin:e,containerPadding:n,containerWidth:s,cols:i}=t;return(s-e[0]*(i-1)-n[0]*2)/i}function th(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Fp(t,e,n,s,i,o,d){const{margin:f,containerPadding:m,rowHeight:y}=t,v=dh(t);let b,_,j,w;if(d?(b=Math.round(d.width),_=Math.round(d.height)):(b=th(s,v,f[0]),_=th(i,y,f[1])),o?(j=Math.round(o.top),w=Math.round(o.left)):d?(j=Math.round(d.top),w=Math.round(d.left)):(j=Math.round((y+f[1])*n+m[1]),w=Math.round((v+f[0])*e+m[0])),!o&&!d){if(Number.isFinite(s)){const R=Math.round((v+f[0])*(e+s)+m[0])-w-b;R!==f[0]&&(b+=R-f[0])}if(Number.isFinite(i)){const R=Math.round((y+f[1])*(n+i)+m[1])-j-_;R!==f[1]&&(_+=R-f[1])}}return{top:j,left:w,width:b,height:_}}function wO(t,e,n,s,i){const{margin:o,containerPadding:d,cols:f,rowHeight:m,maxRows:y}=t,v=dh(t);let b=Math.round((n-d[0])/(v+o[0])),_=Math.round((e-d[1])/(m+o[1]));return b=T1(b,0,f-s),_=T1(_,0,y-i),{x:b,y:_}}function Q0(t,e,n){const{margin:s,containerPadding:i,rowHeight:o}=t,d=dh(t),f=Math.round((n-i[0])/(d+s[0])),m=Math.round((e-i[1])/(o+s[1]));return{x:f,y:m}}function EO(t,e,n){const{margin:s,rowHeight:i}=t,o=dh(t),d=Math.max(1,Math.round((e+s[0])/(o+s[0]))),f=Math.max(1,Math.round((n+s[1])/(i+s[1])));return{w:d,h:f}}function T1(t,e,n){return Math.max(Math.min(t,n),e)}function gv(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Fc(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&gv(s,e))return s}}function Y6(t,e){return t.filter(n=>gv(n,e))}function TO(t,e){return e==="horizontal"?V6(t):e==="vertical"||e==="wrap"?Nb(t):[...t]}function Nb(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function V6(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function Q1(t){let e=0;for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0){const i=s.y+s.h;i>e&&(e=i)}}return e}function Lc(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&s.i===e)return s}}function X1(t){return t.filter(e=>e.static===!0)}function Wc(t){return{i:t.i,x:t.x,y:t.y,w:t.w,h:t.h,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,constraints:t.constraints,isBounded:t.isBounded}}function Du(t){const e=new Array(t.length);for(let n=0;n<t.length;n++){const s=t[n];s!==void 0&&(e[n]=Wc(s))}return e}function RO(t,e){const n=new Array(t.length);for(let s=0;s<t.length;s++){const i=t[s];i!==void 0&&(e.i===i.i?n[s]=e:n[s]=i)}return n}function OO(t,e,n){let s=Lc(t,e);return s?(s=n(Wc(s)),[RO(t,s),s]):[[...t],null]}function yv(t,e){const n=X1(t);for(let s=0;s<t.length;s++){const i=t[s];if(i!==void 0)if(i.x+i.w>e.cols&&(i.x=e.cols-i.w),i.x<0&&(i.x=0,i.w=e.cols),!i.static)n.push(i);else for(;Fc(n,i);)i.y++}return t}function Uc(t,e,n,s,i,o,d,f,m){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===s&&e.x===n)return[...t];const y=e.x,v=e.y;typeof n=="number"&&(e.x=n),typeof s=="number"&&(e.y=s),e.moved=!0;let b=TO(t,d);(d==="vertical"&&typeof s=="number"?v>=s:d==="horizontal"&&typeof n=="number"?y>=n:!1)&&(b=b.reverse());const j=Y6(b,e),w=j.length>0;if(w&&m)return Du(t);if(w&&o)return e.x=y,e.y=v,e.moved=!1,t;let O=[...t];for(let R=0;R<j.length;R++){const T=j[R];T!==void 0&&(T.moved||(T.static?O=k3(O,T,e,i,d):O=k3(O,e,T,i,d)))}return O}function k3(t,e,n,s,i,o){const d=i==="horizontal",f=i==="vertical",m=e.static;if(s){s=!1;const b={x:d?Math.max(e.x-n.w,0):n.x,y:f?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},_=Fc(t,b),j=_!==void 0&&_.y+_.h>e.y,w=_!==void 0&&e.x+e.w>_.x;if(!_)return Uc(t,n,d?b.x:void 0,f?b.y:void 0,s,m,i);if(j&&f)return Uc(t,n,void 0,n.y+1,s,m,i);if(j&&i===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(w&&d)return Uc(t,e,n.x,void 0,s,m,i)}const y=d?n.x+1:void 0,v=f?n.y+1:void 0;return y===void 0&&v===void 0?[...t]:Uc(t,n,y,v,s,m,i)}function Mf(t,e,n){return Math.max(e,Math.min(n,t))}var AO={name:"gridBounds",constrainPosition(t,e,n,{cols:s,maxRows:i}){return{x:Mf(e,0,Math.max(0,s-t.w)),y:Mf(n,0,Math.max(0,i-t.h))}},constrainSize(t,e,n,s,{cols:i,maxRows:o}){const d=s==="w"||s==="nw"||s==="sw"?t.x+t.w:i-t.x,f=s==="n"||s==="nw"||s==="ne"?t.y+t.h:o-t.y;return{w:Mf(e,1,Math.max(1,d)),h:Mf(n,1,Math.max(1,f))}}},MO={name:"minMaxSize",constrainSize(t,e,n){return{w:Mf(e,t.minW??1,t.maxW??1/0),h:Mf(n,t.minH??1,t.maxH??1/0)}}},Q6=[AO,MO];function X0(t,e,n,s,i){let o={x:n,y:s};for(const d of t)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));if(e.constraints)for(const d of e.constraints)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));return o}function DO(t,e,n,s,i,o){let d={w:n,h:s};for(const f of t)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));if(e.constraints)for(const f of e.constraints)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));return d}function X6({top:t,left:e,width:n,height:s}){const i=`translate(${e}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${s}px`,position:"absolute"}}function zO({top:t,left:e,width:n,height:s}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${s}px`,position:"absolute"}}function L3(t){return t*100+"%"}function kO(t,e,n,s){return t+n>s?e:n}function K6(t,e,n){return t<0?e:n}function LO(t){return Math.max(0,t)}function R1(t){return Math.max(0,t)}var xv=(t,e,n)=>{const{left:s,height:i,width:o}=e,d=t.top-(i-t.height);return{left:s,width:o,height:K6(d,t.height,i),top:R1(d)}},bv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{top:s,height:o,width:kO(t.left,t.width,d,n),left:LO(i)}},vv=(t,e,n)=>{const{top:s,height:i,width:o}=e,d=t.left+t.width-o;return d<0?{height:i,width:t.left+t.width,top:R1(s),left:0}:{height:i,width:o,top:R1(s),left:d}},Sv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{width:d,left:i,height:K6(s,t.height,o),top:R1(s)}},UO=(t,e,n)=>xv(t,bv(t,e,n)),HO=(t,e,n)=>xv(t,vv(t,e)),qO=(t,e,n)=>Sv(t,bv(t,e,n)),BO=(t,e,n)=>Sv(t,vv(t,e)),GO={n:xv,ne:UO,e:bv,se:qO,s:Sv,sw:BO,w:vv,nw:HO};function PO(t,e,n,s){const i=GO[t];return i?i(e,{...e,...n},s):n}var YO={type:"transform",scale:1,calcStyle(t){return X6(t)}},VO=YO,QO={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},XO={enabled:!0,bounded:!1,threshold:3},KO={enabled:!0,handles:["se"]},FO={enabled:!1,defaultItem:{w:1,h:1}};function Nv(t,e,n,s,i){const o=s==="x"?"w":"h";e[s]+=1;const d=t.findIndex(m=>m.i===e.i),f=i??X1(t).length>0;for(let m=d+1;m<t.length;m++){const y=t[m];if(y!==void 0&&!y.static){if(!f&&y.y>e.y+e.h)break;gv(e,y)&&Nv(t,y,n+e[o],s,f)}}e[s]=n}function ZO(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.y=Math.min(s,e.y);e.y>0&&!Fc(t,e);)e.y--;let i;for(;(i=Fc(t,e))!==void 0;)Nv(n,e,i.y+i.h,"y");return e.y=Math.max(e.y,0),e}function IO(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!Fc(t,e);)e.x--;let i;for(;(i=Fc(t,e))!==void 0;)if(Nv(s,e,i.x+i.w,"x"),e.x+e.w>n)for(e.x=n-e.w,e.y++;e.x>0&&!Fc(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var F6={type:"vertical",allowOverlap:!1,compact(t,e){const n=X1(t);let s=Q1(n);const i=Nb(t),o=new Array(t.length);for(let d=0;d<i.length;d++){const f=i[d];if(f===void 0)continue;let m=Wc(f);m.static||(m=ZO(n,m,i,s),s=Math.max(s,m.y+m.h),n.push(m));const y=t.indexOf(f);o[y]=m,m.moved=!1}return o}},Z6={type:"horizontal",allowOverlap:!1,compact(t,e){const n=X1(t),s=V6(t),i=new Array(t.length);for(let o=0;o<s.length;o++){const d=s[o];if(d===void 0)continue;let f=Wc(d);f.static||(f=IO(n,f,e,s),n.push(f));const m=t.indexOf(d);i[m]=f,f.moved=!1}return i}},I6={type:null,allowOverlap:!1,compact(t,e){return Du(t)}},JO={...F6,allowOverlap:!0,compact(t,e){return Du(t)}},WO={...Z6,allowOverlap:!0,compact(t,e){return Du(t)}},$O={...I6,allowOverlap:!0};function _v(t,e=!1,n=!1){let s;return e?t==="vertical"?s=JO:t==="horizontal"?s=WO:s=$O:t==="vertical"?s=F6:t==="horizontal"?s=Z6:s=I6,n?{...s,preventCollision:n}:s}function J6(t){return Object.keys(t).sort((n,s)=>t[n]-t[s])}function U3(t,e){const n=J6(t);let s=n[0];if(s===void 0)throw new Error("No breakpoints defined");for(let i=1;i<n.length;i++){const o=n[i];if(o===void 0)continue;const d=t[o];e>d&&(s=o)}return s}function H3(t,e){const n=e[t];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(t)} is missing!`);return n}function rx(t,e,n,s,i,o){const d=t[n];if(d)return Du(d);let f=t[s];const m=J6(e),y=m.slice(m.indexOf(n));for(let j=0;j<y.length;j++){const w=y[j];if(w===void 0)continue;const O=t[w];if(O){f=O;break}}const v=Du(f||[]),b=yv(v,{cols:i});return(typeof o=="object"&&o!==null?o:_v(o)).compact(b,i)}function K0(t,e){if(Array.isArray(t))return t;const n=t,s=n[e];if(s!==void 0)return s;const i=Object.keys(n);for(const o of i){const d=n[o];if(d!==void 0)return d}return[10,10]}function W6(t){return function(n,s,i,o,d,f,m){return t(n,s,m)}}function K1(t){return function(n,s,i,o){if(!n||!s||typeof n!="object"||typeof s!="object")return t(n,s,i,o);var d=o.get(n),f=o.get(s);if(d&&f)return d===s&&f===n;o.set(n,s),o.set(s,n);var m=t(n,s,i,o);return o.delete(n),o.delete(s),m}}function $6(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n}function q3(t){return t.constructor===Object||t.constructor==null}function B3(t){return typeof t.then=="function"}function F1(t,e){return t===e||t!==t&&e!==e}var eA="[object Arguments]",tA="[object Boolean]",nA="[object Date]",aA="[object RegExp]",sA="[object Map]",rA="[object Number]",iA="[object Object]",lA="[object Set]",oA="[object String]",G3=Object.prototype.toString;function Z1(t){var e=t.areArraysEqual,n=t.areDatesEqual,s=t.areMapsEqual,i=t.areObjectsEqual,o=t.areRegExpsEqual,d=t.areSetsEqual,f=t.createIsNestedEqual,m=f(y);function y(v,b,_){if(v===b)return!0;if(!v||!b||typeof v!="object"||typeof b!="object")return v!==v&&b!==b;if(q3(v)&&q3(b))return i(v,b,m,_);var j=Array.isArray(v),w=Array.isArray(b);if(j||w)return j===w&&e(v,b,m,_);var O=G3.call(v);return O!==G3.call(b)?!1:O===nA?n(v,b,m,_):O===aA?o(v,b,m,_):O===sA?s(v,b,m,_):O===lA?d(v,b,m,_):O===iA||O===eA?B3(v)||B3(b)?!1:i(v,b,m,_):O===tA||O===rA||O===oA?F1(v.valueOf(),b.valueOf()):!1}return y}function e8(t,e,n,s){var i=t.length;if(e.length!==i)return!1;for(;i-- >0;)if(!n(t[i],e[i],i,i,t,e,s))return!1;return!0}var uA=K1(e8);function t8(t,e){return F1(t.valueOf(),e.valueOf())}function n8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={},d=0;return t.forEach(function(f,m){if(i){var y=!1,v=0;e.forEach(function(b,_){!y&&!o[v]&&(y=n(m,_,d,v,t,e,s)&&n(f,b,m,_,t,e,s))&&(o[v]=!0),v++}),d++,i=y}}),i}var cA=K1(n8),dA="_owner",fA=Object.prototype.hasOwnProperty;function a8(t,e,n,s){var i=Object.keys(t),o=i.length;if(Object.keys(e).length!==o)return!1;for(var d;o-- >0;){if(d=i[o],d===dA){var f=!!t.$$typeof,m=!!e.$$typeof;if((f||m)&&f!==m)return!1}if(!fA.call(e,d)||!n(t[d],e[d],d,d,t,e,s))return!1}return!0}var hA=K1(a8);function s8(t,e){return t.source===e.source&&t.flags===e.flags}function r8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={};return t.forEach(function(d,f){if(i){var m=!1,y=0;e.forEach(function(v,b){!m&&!o[y]&&(m=n(d,v,f,b,t,e,s))&&(o[y]=!0),y++}),i=m}}),i}var pA=K1(r8),i8=Object.freeze({areArraysEqual:e8,areDatesEqual:t8,areMapsEqual:n8,areObjectsEqual:a8,areRegExpsEqual:s8,areSetsEqual:r8,createIsNestedEqual:W6}),l8=Object.freeze({areArraysEqual:uA,areDatesEqual:t8,areMapsEqual:cA,areObjectsEqual:hA,areRegExpsEqual:s8,areSetsEqual:pA,createIsNestedEqual:W6}),mA=Z1(i8);function ro(t,e){return mA(t,e,void 0)}Z1($6(i8,{createIsNestedEqual:function(){return F1}}));Z1(l8);Z1($6(l8,{createIsNestedEqual:function(){return F1}}));var Zp={exports:{}},ix={},lx={exports:{}},ox,P3;function gA(){if(P3)return ox;P3=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ox=t,ox}var ux,Y3;function yA(){if(Y3)return ux;Y3=1;var t=gA();function e(){}function n(){}return n.resetWarningCache=e,ux=function(){function s(d,f,m,y,v,b){if(b!==t){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}s.isRequired=s;function i(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:i,element:s,elementType:s,instanceOf:i,node:s,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},ux}var V3;function I1(){return V3||(V3=1,lx.exports=yA()()),lx.exports}var F0={exports:{}},Q3;function xA(){if(Q3)return F0.exports;Q3=1;function t(n){var s,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(s=0;s<d;s++)n[s]&&(i=t(n[s]))&&(o&&(o+=" "),o+=i)}else for(i in n)n[i]&&(o&&(o+=" "),o+=i);return o}function e(){for(var n,s,i=0,o="",d=arguments.length;i<d;i++)(n=arguments[i])&&(s=t(n))&&(o&&(o+=" "),o+=s);return o}return F0.exports=e,F0.exports.clsx=e,F0.exports}var ha={},du={},X3;function J1(){if(X3)return du;X3=1,Object.defineProperty(du,"__esModule",{value:!0}),du.dontSetMe=i,du.findInArray=t,du.int=s,du.isFunction=e,du.isNum=n;function t(o,d){for(let f=0,m=o.length;f<m;f++)if(d.apply(d,[o[f],f,o]))return o[f]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function s(o){return parseInt(o,10)}function i(o,d,f){if(o[d])return new Error(`Invalid prop ${d} passed to ${f} - do not set this, set it on the child.`)}return du}var fu={},K3;function bA(){if(K3)return fu;K3=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.browserPrefixToKey=n,fu.browserPrefixToStyle=s,fu.default=void 0,fu.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var f,m;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const d=(m=(f=window.document)==null?void 0:f.documentElement)==null?void 0:m.style;if(!d||o in d)return"";for(let y=0;y<t.length;y++)if(n(o,t[y])in d)return t[y];return""}function n(o,d){return d?`${d}${i(o)}`:o}function s(o,d){return d?`-${d.toLowerCase()}-${o}`:o}function i(o){let d="",f=!0;for(let m=0;m<o.length;m++)f?(d+=o[m].toUpperCase(),f=!1):o[m]==="-"?f=!0:d+=o[m];return d}return fu.default=e(),fu}var F3;function Cv(){if(F3)return ha;F3=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.addClassName=P,ha.addEvent=d,ha.addUserSelectStyles=A,ha.createCSSTransform=j,ha.createSVGTransform=w,ha.getTouch=R,ha.getTouchIdentifier=T,ha.getTranslation=O,ha.innerHeight=v,ha.innerWidth=b,ha.matchesSelector=i,ha.matchesSelectorAndParentsTo=o,ha.offsetXYFromParent=_,ha.outerHeight=m,ha.outerWidth=y,ha.removeClassName=H,ha.removeEvent=f,ha.scheduleRemoveUserSelectStyles=z;var t=J1(),e=n(bA());function n(B,L){if(typeof WeakMap=="function")var V=new WeakMap,Z=new WeakMap;return(n=function(oe,ne){if(!ne&&oe&&oe.__esModule)return oe;var J,ie,ce={__proto__:null,default:oe};if(oe===null||typeof oe!="object"&&typeof oe!="function")return ce;if(J=ne?Z:V){if(J.has(oe))return J.get(oe);J.set(oe,ce)}for(const Y in oe)Y!=="default"&&{}.hasOwnProperty.call(oe,Y)&&((ie=(J=Object.defineProperty)&&Object.getOwnPropertyDescriptor(oe,Y))&&(ie.get||ie.set)?J(ce,Y,ie):ce[Y]=oe[Y]);return ce})(B,L)}let s="";function i(B,L){return s||(s=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(V){return(0,t.isFunction)(B[V])})),(0,t.isFunction)(B[s])?B[s](L):!1}function o(B,L,V){let Z=B;do{if(i(Z,L))return!0;if(Z===V)return!1;Z=Z.parentNode}while(Z);return!1}function d(B,L,V,Z){if(!B)return;const oe={capture:!0,...Z};B.addEventListener?B.addEventListener(L,V,oe):B.attachEvent?B.attachEvent("on"+L,V):B["on"+L]=V}function f(B,L,V,Z){if(!B)return;const oe={capture:!0,...Z};B.removeEventListener?B.removeEventListener(L,V,oe):B.detachEvent?B.detachEvent("on"+L,V):B["on"+L]=null}function m(B){let L=B.clientHeight;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,t.int)(V.borderTopWidth),L+=(0,t.int)(V.borderBottomWidth),L}function y(B){let L=B.clientWidth;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,t.int)(V.borderLeftWidth),L+=(0,t.int)(V.borderRightWidth),L}function v(B){let L=B.clientHeight;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,t.int)(V.paddingTop),L-=(0,t.int)(V.paddingBottom),L}function b(B){let L=B.clientWidth;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,t.int)(V.paddingLeft),L-=(0,t.int)(V.paddingRight),L}function _(B,L,V){const oe=L===L.ownerDocument.body?{left:0,top:0}:L.getBoundingClientRect(),ne=(B.clientX+L.scrollLeft-oe.left)/V,J=(B.clientY+L.scrollTop-oe.top)/V;return{x:ne,y:J}}function j(B,L){const V=O(B,L,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:V}}function w(B,L){return O(B,L,"")}function O(B,L,V){let{x:Z,y:oe}=B,ne=`translate(${Z}${V},${oe}${V})`;if(L){const J=`${typeof L.x=="string"?L.x:L.x+V}`,ie=`${typeof L.y=="string"?L.y:L.y+V}`;ne=`translate(${J}, ${ie})`+ne}return ne}function R(B,L){return B.targetTouches&&(0,t.findInArray)(B.targetTouches,V=>L===V.identifier)||B.changedTouches&&(0,t.findInArray)(B.changedTouches,V=>L===V.identifier)}function T(B){if(B.targetTouches&&B.targetTouches[0])return B.targetTouches[0].identifier;if(B.changedTouches&&B.changedTouches[0])return B.changedTouches[0].identifier}function A(B){if(!B)return;let L=B.getElementById("react-draggable-style-el");L||(L=B.createElement("style"),L.type="text/css",L.id="react-draggable-style-el",L.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
549
+ `,L.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
550
+ `,B.getElementsByTagName("head")[0].appendChild(L)),B.body&&P(B.body,"react-draggable-transparent-selection")}function z(B){window.requestAnimationFrame?window.requestAnimationFrame(()=>{k(B)}):k(B)}function k(B){if(B)try{if(B.body&&H(B.body,"react-draggable-transparent-selection"),B.selection)B.selection.empty();else{const L=(B.defaultView||window).getSelection();L&&L.type!=="Caret"&&L.removeAllRanges()}}catch{}}function P(B,L){B.classList?B.classList.add(L):B.className.match(new RegExp(`(?:^|\\s)${L}(?!\\S)`))||(B.className+=` ${L}`)}function H(B,L){B.classList?B.classList.remove(L):B.className=B.className.replace(new RegExp(`(?:^|\\s)${L}(?!\\S)`,"g"),"")}return ha}var cl={},Z3;function o8(){if(Z3)return cl;Z3=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.canDragX=i,cl.canDragY=o,cl.createCoreData=f,cl.createDraggableData=m,cl.getBoundPosition=n,cl.getControlPosition=d,cl.snapToGrid=s;var t=J1(),e=Cv();function n(b,_,j){if(!b.props.bounds)return[_,j];let{bounds:w}=b.props;w=typeof w=="string"?w:y(w);const O=v(b);if(typeof w=="string"){const{ownerDocument:R}=O,T=R.defaultView;let A;if(w==="parent"?A=O.parentNode:A=O.getRootNode().querySelector(w),!(A instanceof T.HTMLElement))throw new Error('Bounds selector "'+w+'" could not find an element.');const z=A,k=T.getComputedStyle(O),P=T.getComputedStyle(z);w={left:-O.offsetLeft+(0,t.int)(P.paddingLeft)+(0,t.int)(k.marginLeft),top:-O.offsetTop+(0,t.int)(P.paddingTop)+(0,t.int)(k.marginTop),right:(0,e.innerWidth)(z)-(0,e.outerWidth)(O)-O.offsetLeft+(0,t.int)(P.paddingRight)-(0,t.int)(k.marginRight),bottom:(0,e.innerHeight)(z)-(0,e.outerHeight)(O)-O.offsetTop+(0,t.int)(P.paddingBottom)-(0,t.int)(k.marginBottom)}}return(0,t.isNum)(w.right)&&(_=Math.min(_,w.right)),(0,t.isNum)(w.bottom)&&(j=Math.min(j,w.bottom)),(0,t.isNum)(w.left)&&(_=Math.max(_,w.left)),(0,t.isNum)(w.top)&&(j=Math.max(j,w.top)),[_,j]}function s(b,_,j){const w=Math.round(_/b[0])*b[0],O=Math.round(j/b[1])*b[1];return[w,O]}function i(b){return b.props.axis==="both"||b.props.axis==="x"}function o(b){return b.props.axis==="both"||b.props.axis==="y"}function d(b,_,j){const w=typeof _=="number"?(0,e.getTouch)(b,_):null;if(typeof _=="number"&&!w)return null;const O=v(j),R=j.props.offsetParent||O.offsetParent||O.ownerDocument.body;return(0,e.offsetXYFromParent)(w||b,R,j.props.scale)}function f(b,_,j){const w=!(0,t.isNum)(b.lastX),O=v(b);return w?{node:O,deltaX:0,deltaY:0,lastX:_,lastY:j,x:_,y:j}:{node:O,deltaX:_-b.lastX,deltaY:j-b.lastY,lastX:b.lastX,lastY:b.lastY,x:_,y:j}}function m(b,_){const j=b.props.scale;return{node:_.node,x:b.state.x+_.deltaX/j,y:b.state.y+_.deltaY/j,deltaX:_.deltaX/j,deltaY:_.deltaY/j,lastX:b.state.x,lastY:b.state.y}}function y(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function v(b){const _=b.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return cl}var Ip={},Z0={},I3;function u8(){if(I3)return Z0;I3=1,Object.defineProperty(Z0,"__esModule",{value:!0}),Z0.default=t;function t(){}return Z0}var J3;function vA(){if(J3)return Ip;J3=1,Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default=void 0;var t=m(gl()),e=f(I1()),n=f(Gb()),s=Cv(),i=o8(),o=J1(),d=f(u8());function f(O){return O&&O.__esModule?O:{default:O}}function m(O,R){if(typeof WeakMap=="function")var T=new WeakMap,A=new WeakMap;return(m=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,B={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return B;if(P=k?A:T){if(P.has(z))return P.get(z);P.set(z,B)}for(const L in z)L!=="default"&&{}.hasOwnProperty.call(z,L)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,L))&&(H.get||H.set)?P(B,L,H):B[L]=z[L]);return B})(O,R)}function y(O,R,T){return(R=v(R))in O?Object.defineProperty(O,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):O[R]=T,O}function v(O){var R=b(O,"string");return typeof R=="symbol"?R:R+""}function b(O,R){if(typeof O!="object"||!O)return O;var T=O[Symbol.toPrimitive];if(T!==void 0){var A=T.call(O,R);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(O)}const _={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let j=_.mouse,w=class extends t.Component{constructor(){super(...arguments),y(this,"dragging",!1),y(this,"lastX",NaN),y(this,"lastY",NaN),y(this,"touchIdentifier",null),y(this,"mounted",!1),y(this,"handleDragStart",R=>{if(this.props.onMouseDown(R),!this.props.allowAnyClick&&typeof R.button=="number"&&R.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:A}=T;if(this.props.disabled||!(R.target instanceof A.defaultView.Node)||this.props.handle&&!(0,s.matchesSelectorAndParentsTo)(R.target,this.props.handle,T)||this.props.cancel&&(0,s.matchesSelectorAndParentsTo)(R.target,this.props.cancel,T))return;R.type==="touchstart"&&!this.props.allowMobileScroll&&R.preventDefault();const z=(0,s.getTouchIdentifier)(R);this.touchIdentifier=z;const k=(0,i.getControlPosition)(R,z,this);if(k==null)return;const{x:P,y:H}=k,B=(0,i.createCoreData)(this,P,H);(0,d.default)("DraggableCore: handleDragStart: %j",B),(0,d.default)("calling",this.props.onStart),!(this.props.onStart(R,B)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,s.addUserSelectStyles)(A),this.dragging=!0,this.lastX=P,this.lastY=H,(0,s.addEvent)(A,j.move,this.handleDrag),(0,s.addEvent)(A,j.stop,this.handleDragStop))}),y(this,"handleDrag",R=>{const T=(0,i.getControlPosition)(R,this.touchIdentifier,this);if(T==null)return;let{x:A,y:z}=T;if(Array.isArray(this.props.grid)){let H=A-this.lastX,B=z-this.lastY;if([H,B]=(0,i.snapToGrid)(this.props.grid,H,B),!H&&!B)return;A=this.lastX+H,z=this.lastY+B}const k=(0,i.createCoreData)(this,A,z);if((0,d.default)("DraggableCore: handleDrag: %j",k),this.props.onDrag(R,k)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const B=document.createEvent("MouseEvents");B.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(B)}return}this.lastX=A,this.lastY=z}),y(this,"handleDragStop",R=>{if(!this.dragging)return;const T=(0,i.getControlPosition)(R,this.touchIdentifier,this);if(T==null)return;let{x:A,y:z}=T;if(Array.isArray(this.props.grid)){let B=A-this.lastX||0,L=z-this.lastY||0;[B,L]=(0,i.snapToGrid)(this.props.grid,B,L),A=this.lastX+B,z=this.lastY+L}const k=(0,i.createCoreData)(this,A,z);if(this.props.onStop(R,k)===!1||this.mounted===!1)return!1;const H=this.findDOMNode();H&&this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(H.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",k),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,H&&((0,d.default)("DraggableCore: Removing handlers"),(0,s.removeEvent)(H.ownerDocument,j.move,this.handleDrag),(0,s.removeEvent)(H.ownerDocument,j.stop,this.handleDragStop))}),y(this,"onMouseDown",R=>(j=_.mouse,this.handleDragStart(R))),y(this,"onMouseUp",R=>(j=_.mouse,this.handleDragStop(R))),y(this,"onTouchStart",R=>(j=_.touch,this.handleDragStart(R))),y(this,"onTouchEnd",R=>(j=_.touch,this.handleDragStop(R)))}componentDidMount(){this.mounted=!0;const R=this.findDOMNode();R&&(0,s.addEvent)(R,_.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const R=this.findDOMNode();if(R){const{ownerDocument:T}=R;(0,s.removeEvent)(T,_.mouse.move,this.handleDrag),(0,s.removeEvent)(T,_.touch.move,this.handleDrag),(0,s.removeEvent)(T,_.mouse.stop,this.handleDragStop),(0,s.removeEvent)(T,_.touch.stop,this.handleDragStop),(0,s.removeEvent)(R,_.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var R,T,A;return(R=this.props)!=null&&R.nodeRef?(A=(T=this.props)==null?void 0:T.nodeRef)==null?void 0:A.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ip.default=w,y(w,"displayName","DraggableCore"),y(w,"propTypes",{allowAnyClick:e.default.bool,allowMobileScroll:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(O,R){if(O[R]&&O[R].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),y(w,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ip}var W3;function SA(){return W3||(W3=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return m.default}}),t.default=void 0;var e=b(gl()),n=v(I1()),s=v(Gb()),i=xA(),o=Cv(),d=o8(),f=J1(),m=v(vA()),y=v(u8());function v(T){return T&&T.__esModule?T:{default:T}}function b(T,A){if(typeof WeakMap=="function")var z=new WeakMap,k=new WeakMap;return(b=function(P,H){if(!H&&P&&P.__esModule)return P;var B,L,V={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return V;if(B=H?k:z){if(B.has(P))return B.get(P);B.set(P,V)}for(const Z in P)Z!=="default"&&{}.hasOwnProperty.call(P,Z)&&((L=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,Z))&&(L.get||L.set)?B(V,Z,L):V[Z]=P[Z]);return V})(T,A)}function _(){return _=Object.assign?Object.assign.bind():function(T){for(var A=1;A<arguments.length;A++){var z=arguments[A];for(var k in z)({}).hasOwnProperty.call(z,k)&&(T[k]=z[k])}return T},_.apply(null,arguments)}function j(T,A,z){return(A=w(A))in T?Object.defineProperty(T,A,{value:z,enumerable:!0,configurable:!0,writable:!0}):T[A]=z,T}function w(T){var A=O(T,"string");return typeof A=="symbol"?A:A+""}function O(T,A){if(typeof T!="object"||!T)return T;var z=T[Symbol.toPrimitive];if(z!==void 0){var k=z.call(T,A);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(T)}class R extends e.Component{static getDerivedStateFromProps(A,z){let{position:k}=A,{prevPropsPosition:P}=z;return k&&(!P||k.x!==P.x||k.y!==P.y)?((0,y.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:P}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(A){super(A),j(this,"onDragStart",(z,k)=>{if((0,y.default)("Draggable: onDragStart: %j",k),this.props.onStart(z,(0,d.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),j(this,"onDrag",(z,k)=>{if(!this.state.dragging)return!1;(0,y.default)("Draggable: onDrag: %j",k);const P=(0,d.createDraggableData)(this,k),H={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:L,y:V}=H;H.x+=this.state.slackX,H.y+=this.state.slackY;const[Z,oe]=(0,d.getBoundPosition)(this,H.x,H.y);H.x=Z,H.y=oe,H.slackX=this.state.slackX+(L-H.x),H.slackY=this.state.slackY+(V-H.y),P.x=H.x,P.y=H.y,P.deltaX=H.x-this.state.x,P.deltaY=H.y-this.state.y}if(this.props.onDrag(z,P)===!1)return!1;this.setState(H)}),j(this,"onDragStop",(z,k)=>{if(!this.state.dragging||this.props.onStop(z,(0,d.createDraggableData)(this,k))===!1)return!1;(0,y.default)("Draggable: onDragStop: %j",k);const H={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:L,y:V}=this.props.position;H.x=L,H.y=V}this.setState(H)}),this.state={dragging:!1,dragged:!1,x:A.position?A.position.x:A.defaultPosition.x,y:A.position?A.position.y:A.defaultPosition.y,prevPropsPosition:{...A.position},slackX:0,slackY:0,isElementSVG:!1},A.position&&!(A.onDrag||A.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var A,z;return((z=(A=this.props)==null?void 0:A.nodeRef)==null?void 0:z.current)??s.default.findDOMNode(this)}render(){const{axis:A,bounds:z,children:k,defaultPosition:P,defaultClassName:H,defaultClassNameDragging:B,defaultClassNameDragged:L,position:V,positionOffset:Z,scale:oe,...ne}=this.props;let J={},ie=null;const Y=!!!V||this.state.dragging,$=V||P,ae={x:(0,d.canDragX)(this)&&Y?this.state.x:$.x,y:(0,d.canDragY)(this)&&Y?this.state.y:$.y};this.state.isElementSVG?ie=(0,o.createSVGTransform)(ae,Z):J=(0,o.createCSSTransform)(ae,Z);const Ne=(0,i.clsx)(k.props.className||"",H,{[B]:this.state.dragging,[L]:this.state.dragged});return e.createElement(m.default,_({},ne,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(k),{className:Ne,style:{...k.props.style,...J},transform:ie}))}}t.default=R,j(R,"displayName","Draggable"),j(R,"propTypes",{...m.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:f.dontSetMe,style:f.dontSetMe,transform:f.dontSetMe}),j(R,"defaultProps",{...m.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(ix)),ix}var $3;function jv(){if($3)return Zp.exports;$3=1;const{default:t,DraggableCore:e}=SA();return Zp.exports=t,Zp.exports.default=t,Zp.exports.DraggableCore=e,Zp.exports}var NA=jv(),Jp={exports:{}},Wp={},I0={},e5;function _A(){if(e5)return I0;e5=1,I0.__esModule=!0,I0.cloneElement=f;var t=e(gl());function e(m){return m&&m.__esModule?m:{default:m}}function n(m,y){var v=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);y&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),v.push.apply(v,b)}return v}function s(m){for(var y=1;y<arguments.length;y++){var v=arguments[y]!=null?arguments[y]:{};y%2?n(Object(v),!0).forEach(function(b){i(m,b,v[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(v)):n(Object(v)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(v,b))})}return m}function i(m,y,v){return(y=o(y))in m?Object.defineProperty(m,y,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[y]=v,m}function o(m){var y=d(m,"string");return typeof y=="symbol"?y:y+""}function d(m,y){if(typeof m!="object"||!m)return m;var v=m[Symbol.toPrimitive];if(v!==void 0){var b=v.call(m,y);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(m)}function f(m,y){return y.style&&m.props.style&&(y.style=s(s({},m.props.style),y.style)),y.className&&m.props.className&&(y.className=`${m.props.className} ${y.className}`),t.default.cloneElement(m,y)}return I0}var $p={},t5;function c8(){if(t5)return $p;t5=1,$p.__esModule=!0,$p.resizableProps=void 0;var t=e(I1());jv();function e(n){return n&&n.__esModule?n:{default:n}}return $p.resizableProps={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<"u"?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="y"?t.default.number.isRequired(...s):t.default.number(...s)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="x"?t.default.number.isRequired(...s):t.default.number(...s)}},$p}var n5;function d8(){if(n5)return Wp;n5=1,Wp.__esModule=!0,Wp.default=void 0;var t=o(gl()),e=jv(),n=_A(),s=c8();const i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(O,R){if(typeof WeakMap=="function")var T=new WeakMap,A=new WeakMap;return(o=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,B={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return B;if(P=k?A:T){if(P.has(z))return P.get(z);P.set(z,B)}for(const L in z)L!=="default"&&{}.hasOwnProperty.call(z,L)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,L))&&(H.get||H.set)?P(B,L,H):B[L]=z[L]);return B})(O,R)}function d(){return d=Object.assign?Object.assign.bind():function(O){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var A in T)({}).hasOwnProperty.call(T,A)&&(O[A]=T[A])}return O},d.apply(null,arguments)}function f(O,R){if(O==null)return{};var T,A,z=m(O,R);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(O);for(A=0;A<k.length;A++)T=k[A],R.indexOf(T)===-1&&{}.propertyIsEnumerable.call(O,T)&&(z[T]=O[T])}return z}function m(O,R){if(O==null)return{};var T={};for(var A in O)if({}.hasOwnProperty.call(O,A)){if(R.indexOf(A)!==-1)continue;T[A]=O[A]}return T}function y(O,R){var T=Object.keys(O);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(O);R&&(A=A.filter(function(z){return Object.getOwnPropertyDescriptor(O,z).enumerable})),T.push.apply(T,A)}return T}function v(O){for(var R=1;R<arguments.length;R++){var T=arguments[R]!=null?arguments[R]:{};R%2?y(Object(T),!0).forEach(function(A){b(O,A,T[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(T)):y(Object(T)).forEach(function(A){Object.defineProperty(O,A,Object.getOwnPropertyDescriptor(T,A))})}return O}function b(O,R,T){return(R=_(R))in O?Object.defineProperty(O,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):O[R]=T,O}function _(O){var R=j(O,"string");return typeof R=="symbol"?R:R+""}function j(O,R){if(typeof O!="object"||!O)return O;var T=O[Symbol.toPrimitive];if(T!==void 0){var A=T.call(O,R);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(O)}let w=class extends t.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(R,T){const{minConstraints:A,maxConstraints:z,lockAspectRatio:k}=this.props;if(!A&&!z&&!k)return[R,T];if(k){const V=this.props.width/this.props.height,Z=R-this.props.width,oe=T-this.props.height;Math.abs(Z)>Math.abs(oe*V)?T=R/V:R=T*V}const[P,H]=[R,T];let[B,L]=this.slack||[0,0];return R+=B,T+=L,A&&(R=Math.max(A[0],R),T=Math.max(A[1],T)),z&&(R=Math.min(z[0],R),T=Math.min(z[1],T)),this.slack=[B+(P-R),L+(H-T)],[R,T]}resizeHandler(R,T){return(A,z)=>{var $;let{node:k,deltaX:P,deltaY:H}=z;R==="onResizeStart"&&this.resetData();const B=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",L=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!B&&!L)return;const V=T[0],Z=T[T.length-1],oe=k.getBoundingClientRect();if(this.lastHandleRect!=null){if(Z==="w"){const ae=oe.left-this.lastHandleRect.left;P+=ae}if(V==="n"){const ae=oe.top-this.lastHandleRect.top;H+=ae}}this.lastHandleRect=oe,Z==="w"&&(P=-P),V==="n"&&(H=-H);let ne=this.props.width+(B?P/this.props.transformScale:0),J=this.props.height+(L?H/this.props.transformScale:0);[ne,J]=this.runConstraints(ne,J),R==="onResizeStop"&&this.lastSize&&({width:ne,height:J}=this.lastSize);const ie=ne!==this.props.width||J!==this.props.height;R!=="onResizeStop"&&(this.lastSize={width:ne,height:J});const ce=typeof this.props[R]=="function"?this.props[R]:null;ce&&!(R==="onResize"&&!ie)&&(($=A.persist)==null||$.call(A),ce(A,{node:k,size:{width:ne,height:J},handle:T})),R==="onResizeStop"&&this.resetData()}}renderResizeHandle(R,T){const{handle:A}=this.props;if(!A)return t.createElement("span",{className:`react-resizable-handle react-resizable-handle-${R}`,ref:T});if(typeof A=="function")return A(R,T);const z=typeof A.type=="string",k=v({ref:T},z?{}:{handleAxis:R});return t.cloneElement(A,k)}render(){const R=this.props,{children:T,className:A,draggableOpts:z,width:k,height:P,handle:H,handleSize:B,lockAspectRatio:L,axis:V,minConstraints:Z,maxConstraints:oe,onResize:ne,onResizeStop:J,onResizeStart:ie,resizeHandles:ce,transformScale:Y}=R,$=f(R,i);return(0,n.cloneElement)(T,v(v({},$),{},{className:`${A?`${A} `:""}react-resizable`,children:[...t.Children.toArray(T.props.children),...ce.map(ae=>{const Ne=this.handleRefs[ae]??(this.handleRefs[ae]=t.createRef());return t.createElement(e.DraggableCore,d({},z,{nodeRef:Ne,key:`resizableHandle-${ae}`,onStop:this.resizeHandler("onResizeStop",ae),onStart:this.resizeHandler("onResizeStart",ae),onDrag:this.resizeHandler("onResize",ae)}),this.renderResizeHandle(ae,Ne))})]}))}};return Wp.default=w,w.propTypes=s.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Wp}var em={},a5;function CA(){if(a5)return em;a5=1,em.__esModule=!0,em.default=void 0;var t=d(gl()),e=o(I1()),n=o(d8()),s=c8();const i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(R){return R&&R.__esModule?R:{default:R}}function d(R,T){if(typeof WeakMap=="function")var A=new WeakMap,z=new WeakMap;return(d=function(k,P){if(!P&&k&&k.__esModule)return k;var H,B,L={__proto__:null,default:k};if(k===null||typeof k!="object"&&typeof k!="function")return L;if(H=P?z:A){if(H.has(k))return H.get(k);H.set(k,L)}for(const V in k)V!=="default"&&{}.hasOwnProperty.call(k,V)&&((B=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(k,V))&&(B.get||B.set)?H(L,V,B):L[V]=k[V]);return L})(R,T)}function f(){return f=Object.assign?Object.assign.bind():function(R){for(var T=1;T<arguments.length;T++){var A=arguments[T];for(var z in A)({}).hasOwnProperty.call(A,z)&&(R[z]=A[z])}return R},f.apply(null,arguments)}function m(R,T){var A=Object.keys(R);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(R);T&&(z=z.filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable})),A.push.apply(A,z)}return A}function y(R){for(var T=1;T<arguments.length;T++){var A=arguments[T]!=null?arguments[T]:{};T%2?m(Object(A),!0).forEach(function(z){v(R,z,A[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(A)):m(Object(A)).forEach(function(z){Object.defineProperty(R,z,Object.getOwnPropertyDescriptor(A,z))})}return R}function v(R,T,A){return(T=b(T))in R?Object.defineProperty(R,T,{value:A,enumerable:!0,configurable:!0,writable:!0}):R[T]=A,R}function b(R){var T=_(R,"string");return typeof T=="symbol"?T:T+""}function _(R,T){if(typeof R!="object"||!R)return R;var A=R[Symbol.toPrimitive];if(A!==void 0){var z=A.call(R,T);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(R)}function j(R,T){if(R==null)return{};var A,z,k=w(R,T);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(R);for(z=0;z<P.length;z++)A=P[z],T.indexOf(A)===-1&&{}.propertyIsEnumerable.call(R,A)&&(k[A]=R[A])}return k}function w(R,T){if(R==null)return{};var A={};for(var z in R)if({}.hasOwnProperty.call(R,z)){if(T.indexOf(z)!==-1)continue;A[z]=R[z]}return A}let O=class extends t.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(T,A)=>{var k;const{size:z}=A;this.props.onResize?((k=T.persist)==null||k.call(T),this.setState(z,()=>this.props.onResize&&this.props.onResize(T,A))):this.setState(z)}}static getDerivedStateFromProps(T,A){return A.propsWidth!==T.width||A.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:A,handleSize:z,onResize:k,onResizeStart:P,onResizeStop:H,draggableOpts:B,minConstraints:L,maxConstraints:V,lockAspectRatio:Z,axis:oe,width:ne,height:J,resizeHandles:ie,style:ce,transformScale:Y}=T,$=j(T,i);return t.createElement(n.default,{axis:oe,draggableOpts:B,handle:A,handleSize:z,height:this.state.height,lockAspectRatio:Z,maxConstraints:V,minConstraints:L,onResizeStart:P,onResize:this.onResize,onResizeStop:H,resizeHandles:ie,transformScale:Y,width:this.state.width},t.createElement("div",f({},$,{style:y(y({},ce),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return em.default=O,O.propTypes=y(y({},s.resizableProps),{},{children:e.default.element}),em}var s5;function jA(){return s5||(s5=1,Jp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Jp.exports.Resizable=d8().default,Jp.exports.ResizableBox=CA().default),Jp.exports}var wA=jA();function r5(t){const{children:e,cols:n,containerWidth:s,margin:i,containerPadding:o,rowHeight:d,maxRows:f,isDraggable:m,isResizable:y,isBounded:v,static:b,useCSSTransforms:_=!0,usePercentages:j=!1,transformScale:w=1,positionStrategy:O,dragThreshold:R=0,droppingPosition:T,className:A="",style:z,handle:k="",cancel:P="",x:H,y:B,w:L,h:V,minW:Z=1,maxW:oe=1/0,minH:ne=1,maxH:J=1/0,i:ie,resizeHandles:ce,resizeHandle:Y,constraints:$=Q6,layoutItem:ae,layout:Ne=[],onDragStart:re,onDrag:G,onDragStop:W,onResizeStart:he,onResize:xe,onResizeStop:_e}=t,[je,De]=D.useState(!1),[nt,ze]=D.useState(!1),Vt=D.useRef(null),$e=D.useRef({left:0,top:0}),At=D.useRef({top:0,left:0,width:0,height:0}),qt=D.useRef(void 0),wn=D.useRef(Ne);wn.current=Ne;const Vn=D.useRef(null),Gt=D.useRef(null),fn=D.useRef(!1),fr=D.useRef({x:0,y:0}),Ft=D.useRef(!1),Et=D.useMemo(()=>({cols:n,containerPadding:o,containerWidth:s,margin:i,maxRows:f,rowHeight:d}),[n,o,s,i,f,d]),Un=D.useMemo(()=>({cols:n,maxRows:f,containerWidth:s,containerHeight:0,rowHeight:d,margin:i,layout:[]}),[n,f,s,d,i]),hn=D.useCallback(()=>({...Un,layout:wn.current}),[Un]),Zt=D.useMemo(()=>ae??{i:ie,x:H,y:B,w:L,h:V,minW:Z,maxW:oe,minH:ne,maxH:J},[ae,ie,H,B,L,V,Z,oe,ne,J]),Qn=D.useCallback(gt=>{if(O!=null&&O.calcStyle)return O.calcStyle(gt);if(_)return X6(gt);const pt=zO(gt);return j?{...pt,left:L3(gt.left/s),width:L3(gt.width/s)}:pt},[O,_,j,s]),Ns=D.useCallback((gt,{node:pt})=>{if(!re)return;const{offsetParent:Qt}=pt;if(!Qt)return;const Mt=Qt.getBoundingClientRect(),Hn=pt.getBoundingClientRect(),rn=Hn.left/w,Xn=Mt.left/w,yn=Hn.top/w,Ra=Mt.top/w;let la;if(O!=null&&O.calcDragPosition){const et=gt;la=O.calcDragPosition(et.clientX,et.clientY,et.clientX-Hn.left,et.clientY-Hn.top)}else la={left:rn-Xn+Qt.scrollLeft,top:yn-Ra+Qt.scrollTop};if($e.current=la,R>0){const et=gt;fr.current={x:et.clientX,y:et.clientY},fn.current=!0,Ft.current=!1,De(!0);return}De(!0);const os=Q0(Et,la.top,la.left),{x:Gs,y:Ue}=X0($,Zt,os.x,os.y,hn());re(ie,Gs,Ue,{e:gt,node:pt,newPosition:la})},[re,w,Et,O,R,$,Zt,hn,ie]),hr=D.useCallback((gt,{node:pt,deltaX:Qt,deltaY:Mt})=>{if(!G||!je)return;const Hn=gt;if(fn.current&&!Ft.current){const Gs=Hn.clientX-fr.current.x,Ue=Hn.clientY-fr.current.y;if(Math.hypot(Gs,Ue)<R)return;if(Ft.current=!0,fn.current=!1,re){const Ve=Q0(Et,$e.current.top,$e.current.left),{x:ot,y:yt}=X0($,Zt,Ve.x,Ve.y,hn());re(ie,ot,yt,{e:gt,node:pt,newPosition:$e.current})}}let rn=$e.current.top+Mt,Xn=$e.current.left+Qt;if(v){const{offsetParent:Gs}=pt;if(Gs){const Ue=Gs.clientHeight-th(V,d,i[1]);rn=T1(rn,0,Ue);const et=dh(Et),Ve=s-th(L,et,i[0]);Xn=T1(Xn,0,Ve)}}const yn={top:rn,left:Xn};$e.current=yn;const Ra=Q0(Et,rn,Xn),{x:la,y:os}=X0($,Zt,Ra.x,Ra.y,hn());G(ie,la,os,{e:gt,node:pt,newPosition:yn})},[G,re,je,R,v,V,d,i,Et,s,L,ie,$,Zt,hn]),Qa=D.useCallback((gt,{node:pt})=>{if(!W||!je)return;const Qt=fn.current;if(fn.current=!1,Ft.current=!1,fr.current={x:0,y:0},Qt){De(!1),$e.current={left:0,top:0};return}const{left:Mt,top:Hn}=$e.current,rn={top:Hn,left:Mt};De(!1),$e.current={left:0,top:0};const Xn=Q0(Et,Hn,Mt),{x:yn,y:Ra}=X0($,Zt,Xn.x,Xn.y,hn());W(ie,yn,Ra,{e:gt,node:pt,newPosition:rn})},[W,je,Et,$,Zt,hn,ie]);Vn.current=Ns,Gt.current=hr;const ia=D.useCallback((gt,{node:pt,size:Qt,handle:Mt},Hn,rn)=>{const Xn=rn==="onResizeStart"?he:rn==="onResize"?xe:_e;if(!Xn)return;let yn;pt?yn=PO(Mt,Hn,Qt,s):yn={...Qt,top:Hn.top,left:Hn.left},At.current=yn;const Ra=EO(Et,yn.width,yn.height),{w:la,h:os}=DO($,Zt,Ra.w,Ra.h,Mt,hn());Xn(ie,la,os,{e:gt.nativeEvent,node:pt,size:yn,handle:Mt})},[he,xe,_e,s,Et,ie,$,Zt,hn]),Ea=D.useCallback((gt,pt)=>{ze(!0);const Qt=Fp(Et,H,B,L,V),Mt={...pt,handle:pt.handle};ia(gt,Mt,Qt,"onResizeStart")},[ia,Et,H,B,L,V]),is=D.useCallback((gt,pt)=>{const Qt=Fp(Et,H,B,L,V),Mt={...pt,handle:pt.handle};ia(gt,Mt,Qt,"onResize")},[ia,Et,H,B,L,V]),pr=D.useCallback((gt,pt)=>{ze(!1),At.current={top:0,left:0,width:0,height:0};const Qt=Fp(Et,H,B,L,V),Mt={...pt,handle:pt.handle};ia(gt,Mt,Qt,"onResizeStop")},[ia,Et,H,B,L,V]);D.useEffect(()=>{var Mt,Hn;if(!T)return;const gt=Vt.current;if(!gt)return;const pt=qt.current||{left:0,top:0},Qt=je&&(T.left!==pt.left||T.top!==pt.top);if(je){if(Qt){const rn=T.left-$e.current.left,Xn=T.top-$e.current.top,yn={node:gt,deltaX:rn,deltaY:Xn,lastX:$e.current.left,lastY:$e.current.top,x:T.left,y:T.top};(Hn=Gt.current)==null||Hn.call(Gt,T.e,yn)}}else{const rn={node:gt,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(Mt=Vn.current)==null||Mt.call(Vn,T.e,rn)}qt.current=T},[T,je,ie]);const _s=Fp(Et,H,B,L,V,je?$e.current:null,nt?At.current:null),Bs=$t.Children.only(e),$n=Fp(Et,0,0,1,1),ls=[$n.width,$n.height],ya=[1/0,1/0],Ta=Bs.props,Pu=Ta.className,Nl=Ta.style;let Cs=$t.cloneElement(Bs,{ref:Vt,className:Km("react-grid-item",Pu,A,{static:b,resizing:nt,"react-draggable":m,"react-draggable-dragging":je,dropping:!!T,cssTransforms:_}),style:{...z,...Nl,...Qn(_s)}});const mr=Y;return Cs=h.jsx(wA.Resizable,{draggableOpts:{disabled:!y},className:y?void 0:"react-resizable-hide",width:_s.width,height:_s.height,minConstraints:ls,maxConstraints:ya,onResizeStart:Ea,onResize:is,onResizeStop:pr,transformScale:w,resizeHandles:ce,handle:mr,children:Cs}),Cs=h.jsx(NA.DraggableCore,{disabled:!m,onStart:Ns,onDrag:hr,onStop:Qa,handle:k,cancel:".react-resizable-handle"+(P?","+P:""),scale:w,nodeRef:Vt,children:Cs}),Cs}var eo=()=>{},i5="react-grid-layout",f8=!1;try{f8=/firefox/i.test(navigator.userAgent)}catch{}function EA(t,e){const n=$t.Children.toArray(t),s=$t.Children.toArray(e);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],d=s[i];if((o==null?void 0:o.key)!==(d==null?void 0:d.key))return!1}return!0}function l5(t,e,n,s){const i=[],o=new Set;$t.Children.forEach(e,f=>{if(!$t.isValidElement(f)||f.key===null)return;const m=String(f.key);o.add(m);const y=t.find(v=>v.i===m);if(y)i.push(Wc(y));else{const b=f.props["data-grid"];b?i.push({i:m,x:b.x??0,y:b.y??0,w:b.w??1,h:b.h??1,minW:b.minW,maxW:b.maxW,minH:b.minH,maxH:b.maxH,static:b.static,isDraggable:b.isDraggable,isResizable:b.isResizable,resizeHandles:b.resizeHandles,isBounded:b.isBounded}):i.push({i:m,x:0,y:Q1(i),w:1,h:1})}});const d=yv(i,{cols:n});return s.compact(d,n)}function TA(t){const{children:e,width:n,gridConfig:s,dragConfig:i,resizeConfig:o,dropConfig:d,positionStrategy:f=VO,compactor:m,constraints:y=Q6,layout:v=[],droppingItem:b,autoSize:_=!0,className:j="",style:w={},innerRef:O,onLayoutChange:R=eo,onDragStart:T=eo,onDrag:A=eo,onDragStop:z=eo,onResizeStart:k=eo,onResize:P=eo,onResizeStop:H=eo,onDrop:B=eo,onDropDragOver:L=eo}=t,V=D.useMemo(()=>({...QO,...s}),[s]),Z=D.useMemo(()=>({...XO,...i}),[i]),oe=D.useMemo(()=>({...KO,...o}),[o]),ne=D.useMemo(()=>({...FO,...d}),[d]),{cols:J,rowHeight:ie,maxRows:ce,margin:Y,containerPadding:$}=V,{enabled:ae,bounded:Ne,handle:re,cancel:G,threshold:W}=Z,{enabled:he,handles:xe,handleComponent:_e}=oe,{enabled:je,defaultItem:De,onDragOver:nt}=ne,ze=m??_v("vertical"),Vt=ze.type,$e=ze.allowOverlap,At=ze.preventCollision??!1,qt=D.useMemo(()=>b??{i:"__dropping-elem__",...De},[b,De]),wn=f.type==="transform",Vn=f.scale,Gt=$??Y,[fn,fr]=D.useState(!1),[Ft,Et]=D.useState(()=>l5(v,e,J,ze)),[Un,hn]=D.useState(null),[Zt,Qn]=D.useState(!1),[Ns,hr]=D.useState(null),[Qa,ia]=D.useState(),Ea=D.useRef(null),is=D.useRef(null),pr=D.useRef(null),_s=D.useRef(0),Bs=D.useRef(Ft),$n=D.useRef(v),ls=D.useRef(e),ya=D.useRef(Vt),Ta=D.useRef(Ft);Ta.current=Ft,D.useEffect(()=>{fr(!0),ro(Ft,v)||R(Ft)},[]),D.useEffect(()=>{if(Un||Ns)return;const Ue=!ro(v,$n.current),et=!EA(e,ls.current),Ve=Vt!==ya.current;if(Ue||et||Ve){const yt=l5(Ue?v:Ft,e,J,ze);ro(yt,Ft)||Et(yt)}$n.current=v,ls.current=e,ya.current=Vt},[v,e,J,Vt,ze,Un,Ns,Ft]),D.useEffect(()=>{if(!Un&&!ro(Ft,Bs.current)){Bs.current=Ft;const Ue=Ft.filter(et=>et.i!==qt.i);R(Ue)}},[Ft,Un,R,qt.i]);const Pu=D.useMemo(()=>{if(!_)return;const Ue=Q1(Ft),et=Gt[1];return Ue*ie+(Ue-1)*Y[1]+et*2+"px"},[_,Ft,ie,Y,Gt]),Nl=D.useCallback((Ue,et,Ve,ot)=>{const yt=Ta.current,Fe=Lc(yt,Ue);if(!Fe)return;const ut={w:Fe.w,h:Fe.h,x:Fe.x,y:Fe.y,i:Ue};Ea.current=Wc(Fe),pr.current=yt,hn(ut),T(yt,Fe,Fe,null,ot.e,ot.node)},[T]),Cs=D.useCallback((Ue,et,Ve,ot)=>{const yt=Ta.current,Fe=Ea.current,ut=Lc(yt,Ue);if(!ut)return;const an={w:ut.w,h:ut.h,x:ut.x,y:ut.y,i:Ue},Tt=Uc(yt,ut,et,Ve,!0,At,Vt,J,$e);A(Tt,Fe,ut,an,ot.e,ot.node),Et(ze.compact(Tt,J)),hn(an)},[At,Vt,J,$e,ze,A]),mr=D.useCallback((Ue,et,Ve,ot)=>{if(!Un)return;const yt=Ta.current,Fe=Ea.current,ut=Lc(yt,Ue);if(!ut)return;const an=Uc(yt,ut,et,Ve,!0,At,Vt,J,$e),Tt=ze.compact(an,J);z(Tt,Fe,ut,null,ot.e,ot.node);const pn=pr.current;Ea.current=null,pr.current=null,hn(null),Et(Tt),pn&&!ro(pn,Tt)&&R(Tt)},[Un,At,Vt,J,$e,ze,z,R]),gt=D.useCallback((Ue,et,Ve,ot)=>{const yt=Ta.current,Fe=Lc(yt,Ue);Fe&&(is.current=Wc(Fe),pr.current=yt,Qn(!0),k(yt,Fe,Fe,null,ot.e,ot.node))},[k]),pt=D.useCallback((Ue,et,Ve,ot)=>{const yt=Ta.current,Fe=is.current,{handle:ut}=ot;let an=!1,Tt,pn;const[Ar,us]=OO(yt,Ue,Pt=>(Tt=Pt.x,pn=Pt.y,["sw","w","nw","n","ne"].includes(ut)&&(["sw","nw","w"].includes(ut)&&(Tt=Pt.x+(Pt.w-et),et=Pt.x!==Tt&&Tt<0?Pt.w:et,Tt=Tt<0?0:Tt),["ne","n","nw"].includes(ut)&&(pn=Pt.y+(Pt.h-Ve),Ve=Pt.y!==pn&&pn<0?Pt.h:Ve,pn=pn<0?0:pn),an=!0),At&&!$e&&Y6(yt,{...Pt,w:et,h:Ve,x:Tt??Pt.x,y:pn??Pt.y}).filter(yr=>yr.i!==Pt.i).length>0&&(pn=Pt.y,Ve=Pt.h,Tt=Pt.x,et=Pt.w,an=!1),Pt.w=et,Pt.h=Ve,Pt));if(!us)return;let Xa=Ar;an&&Tt!==void 0&&pn!==void 0&&(Xa=Uc(Ar,us,Tt,pn,!0,At,Vt,J,$e));const Ps={w:us.w,h:us.h,x:us.x,y:us.y,i:Ue,static:!0};P(Xa,Fe,us,Ps,ot.e,ot.node),Et(ze.compact(Xa,J)),hn(Ps)},[At,Vt,J,$e,ze,P]),Qt=D.useCallback((Ue,et,Ve,ot)=>{const yt=Ta.current,Fe=is.current,ut=Lc(yt,Ue),an=ze.compact(yt,J);H(an,Fe,ut??null,null,ot.e,ot.node);const Tt=pr.current;is.current=null,pr.current=null,hn(null),Qn(!1),Et(an),Tt&&!ro(Tt,an)&&R(an)},[J,ze,H,R]),Mt=D.useCallback(()=>{const Ue=Ta.current;if(!Ue.some(ot=>ot.i===qt.i)){hr(null),hn(null),ia(void 0);return}const Ve=ze.compact(Ue.filter(ot=>ot.i!==qt.i),J);Et(Ve),hr(null),hn(null),ia(void 0)},[qt.i,J,ze]),Hn=D.useCallback(Ue=>{var En;if(Ue.preventDefault(),Ue.stopPropagation(),f8&&!((En=Ue.nativeEvent.target)!=null&&En.classList.contains(i5)))return!1;const et=nt?nt(Ue.nativeEvent):L(Ue);if(et===!1)return Ns&&Mt(),!1;const{dragOffsetX:Ve=0,dragOffsetY:ot=0,...yt}=et??{},Fe={...qt,...yt},ut=Ue.currentTarget.getBoundingClientRect(),an={cols:J,margin:Y,maxRows:ce,rowHeight:ie,containerWidth:n,containerPadding:Gt},Tt=dh(an),pn=th(Fe.w,Tt,Y[0]),Ar=th(Fe.h,ie,Y[1]),us=pn/2,Xa=Ar/2,Ps=Ue.clientX-ut.left+Ve-us,Pt=Ue.clientY-ut.top+ot-Xa,gr=Math.max(0,Ps),yr=Math.max(0,Pt),js={left:gr/Vn,top:yr/Vn,e:Ue.nativeEvent};if(Ns)Qa&&(Qa.left!==js.left||Qa.top!==js.top)&&ia(js);else{const ws=wO(an,yr,gr,Fe.w,Fe.h);hr(h.jsx("div",{},Fe.i)),ia(js),Et([...Ta.current,{...Fe,x:ws.x,y:ws.y,static:!1,isDraggable:!0}])}},[Ns,Qa,qt,nt,L,Mt,Vn,J,Y,ce,ie,n,Gt]),rn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),_s.current--,_s.current<0&&(_s.current=0),_s.current===0&&Mt()},[Mt]),Xn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),_s.current++},[]),yn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation();const et=Ta.current,Ve=et.find(ot=>ot.i===qt.i);_s.current=0,Mt(),B(et,Ve,Ue.nativeEvent)},[qt.i,Mt,B]),Ra=D.useCallback((Ue,et)=>{if(!Ue||!Ue.key)return null;const Ve=Lc(Ft,String(Ue.key));if(!Ve)return null;const ot=typeof Ve.isDraggable=="boolean"?Ve.isDraggable:!Ve.static&&ae,yt=typeof Ve.isResizable=="boolean"?Ve.isResizable:!Ve.static&&he,Fe=Ve.resizeHandles||[...xe],ut=ot&&Ne&&Ve.isBounded!==!1,an=_e;return h.jsx(r5,{containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,cancel:G,handle:re,onDragStart:Nl,onDrag:Cs,onDragStop:mr,onResizeStart:gt,onResize:pt,onResizeStop:Qt,isDraggable:ot,isResizable:yt,isBounded:ut,useCSSTransforms:wn&&fn,usePercentages:!fn,transformScale:Vn,positionStrategy:f,dragThreshold:W,w:Ve.w,h:Ve.h,x:Ve.x,y:Ve.y,i:Ve.i,minH:Ve.minH,minW:Ve.minW,maxH:Ve.maxH,maxW:Ve.maxW,static:Ve.static,droppingPosition:et?Qa:void 0,resizeHandles:Fe,resizeHandle:an,constraints:y,layoutItem:Ve,layout:Ft,children:Ue},Ve.i)},[Ft,n,J,Y,Gt,ce,ie,G,re,Nl,Cs,mr,gt,pt,Qt,ae,he,Ne,wn,fn,Vn,f,W,Qa,xe,_e,y]),la=()=>Un?h.jsx(r5,{w:Un.w,h:Un.h,x:Un.x,y:Un.y,i:Un.i,className:`react-grid-placeholder ${Zt?"placeholder-resizing":""}`,containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:wn,transformScale:Vn,constraints:y,layout:Ft,children:h.jsx("div",{})}):null,os=Km(i5,j),Gs={height:Pu,...w};return h.jsxs("div",{ref:O,className:os,style:Gs,onDrop:je?yn:void 0,onDragLeave:je?rn:void 0,onDragEnter:je?Xn:void 0,onDragOver:je?Hn:void 0,children:[$t.Children.map(e,Ue=>$t.isValidElement(Ue)?Ra(Ue):null),je&&Ns&&Ra(Ns,!0),la()]})}var RA={lg:1200,md:996,sm:768,xs:480,xxs:0},OA={lg:12,md:10,sm:6,xs:4,xxs:2},cx=()=>{};function AA(t,e,n,s){const i=[];$t.Children.forEach(e,d=>{if(!$t.isValidElement(d)||d.key===null)return;const f=String(d.key),m=t.find(y=>y.i===f);if(m)i.push({...m,i:f});else{const v=d.props["data-grid"];v?i.push({i:f,x:v.x??0,y:v.y??0,w:v.w??1,h:v.h??1,minW:v.minW,maxW:v.maxW,minH:v.minH,maxH:v.maxH,static:v.static,isDraggable:v.isDraggable,isResizable:v.isResizable,resizeHandles:v.resizeHandles,isBounded:v.isBounded}):i.push({i:f,x:0,y:Q1(i),w:1,h:1})}});const o=yv(i,{cols:n});return s.compact(o,n)}function MA(t){const{children:e,width:n,breakpoint:s,breakpoints:i=RA,cols:o=OA,layouts:d={},rowHeight:f=150,maxRows:m=1/0,margin:y=[10,10],containerPadding:v=null,compactor:b,onBreakpointChange:_=cx,onLayoutChange:j=cx,onWidthChange:w=cx,...O}=t,R=b??_v("vertical"),T=R.type,A=R.allowOverlap,z=D.useMemo(()=>s??U3(i,n),[]),k=D.useMemo(()=>H3(z,o),[z,o]),P=D.useMemo(()=>rx(d,i,z,z,k,T),[]),[H,B]=D.useState(z),[L,V]=D.useState(k),[Z,oe]=D.useState(P),[ne,J]=D.useState(d),ie=D.useRef(n),ce=D.useRef(s),Y=D.useRef(i),$=D.useRef(o),ae=D.useRef(d),Ne=D.useRef(T),re=D.useRef(ne);D.useEffect(()=>{re.current=ne},[ne]);const G=D.useMemo(()=>ro(d,ae.current)?null:rx(d,i,H,H,L,R),[d,i,H,L,R]),W=G??Z;D.useEffect(()=>{G!==null&&(oe(G),J(d),re.current=d,ae.current=d)},[G,d]),D.useEffect(()=>{if(T!==Ne.current){const De=R.compact(Du(W),L),nt={...re.current,[H]:De};oe(De),J(nt),re.current=nt,j(De,nt),Ne.current=T}},[T,R,W,L,A,H,j]),D.useEffect(()=>{const De=n!==ie.current,nt=s!==ce.current,ze=!ro(i,Y.current),Vt=!ro(o,$.current);if(De||nt||ze||Vt){const $e=s??U3(i,n),At=H3($e,o),qt=H;if(qt!==$e||ze||Vt){const Gt={...re.current};Gt[qt]||(Gt[qt]=Du(Z));let fn=rx(Gt,i,$e,qt,At,R);fn=AA(fn,e,At,R),Gt[$e]=fn,B($e),V(At),oe(fn),J(Gt),re.current=Gt,_($e,At),j(fn,Gt)}const wn=K0(y,$e),Vn=v?K0(v,$e):null;w(n,wn,At,Vn),ie.current=n,ce.current=s,Y.current=i,$.current=o}},[n,s,i,o,H,L,Z,e,R,T,A,y,v,_,j,w]);const he=D.useCallback(De=>{const ze={...re.current,[H]:De};oe(De),J(ze),re.current=ze,j(De,ze)},[H,j]),xe=D.useMemo(()=>K0(y,H),[y,H]),_e=D.useMemo(()=>v===null?null:K0(v,H),[v,H]),je=D.useMemo(()=>({cols:L,rowHeight:f,maxRows:m,margin:xe,containerPadding:_e}),[L,f,m,xe,_e]);return h.jsx(TA,{...O,width:n,gridConfig:je,compactor:R,onLayoutChange:he,layout:W,children:e})}function DA({block:t,config:e,size:n,onRemove:s,onConfigChange:i}){const[o,d]=D.useState(!1),f=t.component,m=t.icon;return h.jsxs("div",{className:"flex flex-col h-full rounded-lg border border-border bg-surface shadow-sm shadow-black/5 overflow-hidden hover:shadow-md hover:shadow-black/8 transition-shadow",children:[h.jsxs("div",{className:"drag-handle flex items-center h-8 px-2 border-b border-border bg-surface/80 shrink-0 cursor-move group",children:[h.jsx(hT,{className:"h-3 w-3 text-foreground-subtle/30 group-hover:text-foreground-subtle transition-colors mr-1"}),h.jsx(m,{className:"h-3 w-3 text-primary/70 mr-1.5 shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 truncate flex-1",children:t.name}),h.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.configSchema&&t.configSchema.length>0&&h.jsx("button",{onClick:y=>{y.stopPropagation(),d(!o)},className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(Zm,{className:"h-3 w-3"})}),h.jsx("button",{onClick:y=>{y.stopPropagation(),s()},className:"p-1 rounded-md hover:bg-danger/10 text-foreground-subtle hover:text-danger transition-colors",children:h.jsx(Lu,{className:"h-3 w-3"})})]})]}),o&&t.configSchema&&h.jsx("div",{className:"p-2.5 border-b border-border bg-background/50 space-y-2",children:t.configSchema.map(y=>{var v;return h.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[h.jsx("span",{className:"text-foreground-subtle w-20 shrink-0",children:y.label}),y.type==="number"&&h.jsx("input",{type:"number",value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:Number(b.target.value)}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="text"&&h.jsx("input",{type:"text",value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:b.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="boolean"&&h.jsx("input",{type:"checkbox",checked:e[y.key]??y.defaultValue??!1,onChange:b=>i({...e,[y.key]:b.target.checked}),className:"accent-primary"}),y.type==="select"&&h.jsx("select",{value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:b.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none",children:(v=y.options)==null?void 0:v.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))})]},y.key)})}),h.jsx("div",{className:"flex-1 overflow-auto p-3",children:h.jsx(f,{config:e,size:n})})]})}function zA({open:t,onClose:e,onSelect:n}){if(!t)return null;const s=xO();return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:e,children:h.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface p-5 shadow-2xl shadow-black/20",onClick:i=>i.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Add Block"}),h.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(Lu,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(i=>{const o=i.icon;return h.jsxs("button",{onClick:()=>{n(i),e()},className:"flex items-center gap-3 rounded-lg border border-border p-3 text-left hover:bg-surface-hover hover:border-primary/30 transition-all group",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 group-hover:bg-primary/15 transition-colors shrink-0",children:h.jsx(o,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{children:[h.jsx("span",{className:"text-xs font-medium text-foreground block",children:i.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.defaultSize.w,"x",i.defaultSize.h]})]})]},i.id)})})]})})}const kA=MA,h8="camstack-dashboard-state",LA={lg:1200,md:996,sm:768,xs:0},UA={lg:12,md:8,sm:4,xs:2};function HA(){try{const t=localStorage.getItem(h8);if(t)return JSON.parse(t)}catch{}return{items:[]}}function qA(t){localStorage.setItem(h8,JSON.stringify(t))}let o5=0;function BA(){const[t,e]=D.useState(HA),[n,s]=D.useState(!1),i=D.useCallback(v=>{e(v),qA(v)},[]),o=D.useCallback(v=>{var w;o5++;const b=`${v.id}-${o5}`,_={};(w=v.configSchema)==null||w.forEach(O=>{O.defaultValue!==void 0&&(_[O.key]=O.defaultValue)});const j={i:b,blockId:v.id,x:0,y:1/0,w:v.defaultSize.w,h:v.defaultSize.h,config:_};i({items:[...t.items,j]})},[t,i]),d=D.useCallback(v=>{i({items:t.items.filter(b=>b.i!==v)})},[t,i]),f=D.useCallback((v,b)=>{i({items:t.items.map(_=>_.i===v?{..._,config:b}:_)})},[t,i]),m=D.useCallback(v=>{i({items:t.items.map(b=>{const _=v.find(j=>j.i===b.i);return _?{...b,x:_.x,y:_.y,w:_.w,h:_.h}:b})})},[t,i]),y=t.items.map(v=>{var _,j;const b=z3(v.blockId);return{i:v.i,x:v.x,y:v.y,w:v.w,h:v.h,minW:((_=b==null?void 0:b.minSize)==null?void 0:_.w)??2,minH:((j=b==null?void 0:b.minSize)==null?void 0:j.h)??2}});return h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Dashboard"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add Block"]})]}),t.items.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-foreground-subtle",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-surface border border-border mb-4",children:h.jsx(R6,{className:"h-8 w-8 text-foreground-subtle/40"})}),h.jsx("p",{className:"text-sm font-medium text-foreground/70",children:"Your dashboard is empty"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-1 mb-4",children:"Add blocks to monitor your cameras and system"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add your first block"]})]}):h.jsx(kA,{layouts:{lg:y},breakpoints:LA,cols:UA,rowHeight:60,draggableHandle:".drag-handle",onLayoutChange:m,isResizable:!0,isDraggable:!0,children:t.items.map(v=>{const b=z3(v.blockId);return b?h.jsx("div",{children:h.jsx(DA,{block:b,config:v.config,size:{w:v.w,h:v.h},onRemove:()=>d(v.i),onConfigChange:_=>f(v.i,_)})},v.i):h.jsx("div",{},v.i)})}),h.jsx(zA,{open:n,onClose:()=>s(!1),onSelect:o})]})}function GA(){return h.jsx(BA,{})}const _b={frigate:{icon:ME,color:"#3b82f6",label:"Frigate"},scrypted:{icon:C1,color:"#a855f7",label:"Scrypted"},reolink:{icon:fv,color:"#06b6d4",label:"Reolink"},homeassistant:{icon:gT,color:"#22d3ee",label:"Home Assistant"},rtsp:{icon:p3,color:"#78716c",label:"RTSP"},onvif:{icon:p3,color:"#78716c",label:"ONVIF"}},PA={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},YA={sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"};function W1({type:t,size:e="md",showLabel:n}){const s=_b[t]??_b.rtsp,i=s.icon;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`flex items-center justify-center rounded-lg ${YA[e]}`,style:{backgroundColor:`${s.color}15`},children:h.jsx(i,{className:PA[e],style:{color:s.color}})}),n&&h.jsx("span",{className:"text-xs font-medium text-foreground-subtle",children:s.label})]})}function p8(t){var e;return((e=_b[t])==null?void 0:e.label)??t}const u5={running:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Running"},stopped:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Stopped"},error:{bg:"bg-danger/10",text:"text-danger",dot:"bg-danger",label:"Error"},online:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Online"},offline:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Offline"},idle:{bg:"bg-info/10",text:"text-info",dot:"bg-info",label:"Idle"}};function nh({status:t}){const e=u5[t]??u5.stopped;return h.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium ${e.bg} ${e.text}`,children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e.dot}`}),e.label]})}const c5={online:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},running:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},watching:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},idle:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},offline:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},stopped:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},error:{label:"OFFLINE",bg:"bg-danger/15",text:"text-danger"}};function VA({id:t,name:e,status:n,detectionsToday:s,inferenceMs:i}){const o=xl(),d=c5[n]??c5.offline;return h.jsxs("button",{onClick:()=>o(`/devices/${t}`),className:"group flex flex-col rounded-lg border border-border bg-surface text-left hover:border-primary/30 hover:shadow-md hover:shadow-black/5 transition-all w-full overflow-hidden",children:[h.jsxs("div",{className:"relative aspect-video w-full bg-background flex items-center justify-center",children:[h.jsx(ku,{className:"h-8 w-8 text-foreground-subtle/20"}),h.jsx("span",{className:`absolute top-2 right-2 inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wider ${d.bg} ${d.text}`,children:d.label})]}),h.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground truncate group-hover:text-primary transition-colors",children:e}),h.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(ch,{className:"h-3 w-3"}),s," today"]}),h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(uv,{className:"h-3 w-3"}),i,"ms"]})]})]})]})}function QA({providerType:t,providerName:e,providerStatus:n,devices:s}){return h.jsxs("section",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(W1,{type:t,size:"md"}),h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground truncate",children:e||p8(t)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:[s.length," camera",s.length!==1?"s":""]})]}),h.jsx(nh,{status:n})]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:s.map(i=>h.jsx(VA,{id:i.id,name:i.name,status:i.status,detectionsToday:0,inferenceMs:0},i.id))})]})}function XA(){const{t}=Rr(),e=sn(),[n,s]=D.useState(""),{data:i,isLoading:o}=Ct({queryKey:["devices"],queryFn:()=>e.listDevices(),refetchInterval:5e3}),{data:d,isLoading:f}=Ct({queryKey:["providers"],queryFn:()=>e.listProviders()}),m=i??[],y=d??[],v=D.useMemo(()=>{const j=n.toLowerCase();return m.filter(w=>{const O=(w.type??"").toLowerCase(),R=w.capabilities??[];return O==="camera"||O.includes("camera")||R.some(k=>k.toLowerCase().includes("video")||k.toLowerCase().includes("stream"))||!O||O==="—"?j?(w.name??w.id??"").toLowerCase().includes(j):!0:!1})},[m,n]),b=D.useMemo(()=>{const j=new Map;for(const w of v){const O=w.providerId??"";j.has(O)||j.set(O,[]),j.get(O).push(w)}return j},[v]),_=o||f;return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.cameras","Cameras")}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(hv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:n,onChange:j=>s(j.target.value),placeholder:"Search cameras...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsxs("span",{className:"text-[11px] text-foreground-subtle",children:[v.length," camera",v.length!==1?"s":""]})]})]}),_&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:[1,2,3,4,5,6].map(j=>h.jsx("div",{className:"aspect-[16/12] rounded-lg border border-border bg-surface animate-pulse"},j))}),!_&&v.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx(ku,{className:"h-12 w-12 mb-4 opacity-20"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"No cameras found"}),h.jsx("p",{className:"text-xs mt-1",children:n?"Try a different search term":"Add an integration to discover cameras"})]}),!_&&Array.from(b.entries()).map(([j,w])=>{var R;const O=y.find(T=>T.id===j);return h.jsx(QA,{providerType:(O==null?void 0:O.type)??"rtsp",providerName:(O==null?void 0:O.name)??j,providerStatus:(R=O==null?void 0:O.status)!=null&&R.connected?"running":"stopped",devices:w.map(T=>{var A;return{id:T.id,name:T.name??T.id,status:(A=T.state)!=null&&A.online?"online":"offline"}})},j)})]})}function KA({onSelect:t,onClose:e}){const{t:n}=Rr(),s=sn(),i=xl(),{data:o,isLoading:d}=Ct({queryKey:["provider-types"],queryFn:()=>s.listProviderTypes()});return d?h.jsx("div",{className:"space-y-2 p-2",children:[1,2,3].map(f=>h.jsx("div",{className:"h-14 rounded-lg bg-surface animate-pulse"},f))}):h.jsxs("div",{className:"space-y-2",children:[(o??[]).map(f=>{const m=f.instanceMode==="unique"&&f.existingInstances.length>0;return h.jsxs("button",{onClick:()=>{if(m){const y=f.existingInstances[0].id;e(),i(`/integrations/${y}`)}else t(f.addonId,f.instanceMode,f.discoveryMode)},className:"flex w-full items-center gap-3 rounded-lg border border-border bg-surface p-3 text-left hover:border-foreground-subtle/30 transition-colors",children:[f.iconUrl?h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("img",{src:f.iconUrl,alt:"",className:"h-5 w-5"})}):h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("span",{className:"text-sm",style:{color:f.color},children:"◉"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:f.name}),f.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 truncate",children:f.description})]}),m?h.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium text-foreground-subtle",children:[h.jsx(Zm,{className:"h-3 w-3"}),n("integrations.manage")]}):h.jsx(Ic,{className:"h-4 w-4 text-foreground-subtle flex-shrink-0"})]},f.addonId)}),(o??[]).length===0&&h.jsx("div",{className:"py-8 text-center text-xs text-foreground-subtle",children:n("integrations.noProviders")})]})}function FA({tabs:t,active:e,onChange:n}){return h.jsx("div",{className:"flex rounded-lg border border-border bg-surface p-0.5 gap-0.5",children:t.map(s=>h.jsx("button",{type:"button",onClick:()=>n(s.id),className:["flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-primary/12 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"].join(" "),children:s.label},s.id))})}function ZA(t){const e=t.formats;if(!e)return"";const n=Object.values(e).filter(o=>o!==void 0&&o.sizeMB>0).map(o=>o.sizeMB);if(n.length===0)return"";const s=Math.min(...n),i=Math.max(...n);return s===i?`${s} MB`:`${s}-${i} MB`}function IA(t){return`${t.inputSize.width}x${t.inputSize.height}`}function JA(t){return t.formats?Object.keys(t.formats).filter(e=>t.formats[e]!==void 0):[]}function WA({entry:t,selected:e,onSelect:n,disabled:s}){const i=ZA(t),o=IA(t),d=JA(t);return h.jsxs("button",{type:"button",onClick:n,disabled:s,className:["w-full text-left rounded-lg border p-3 transition-all",e?"border-primary bg-primary/5 ring-1 ring-primary/30":"border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50",s?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:[h.jsx("div",{className:"flex items-start justify-between gap-2",children:h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-semibold text-foreground truncate",children:t.name}),e&&h.jsx(G1,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-2",children:t.description})]})}),h.jsxs("div",{className:"flex items-center gap-3 mt-2 flex-wrap",children:[h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(zf,{className:"h-3 w-3"}),o]}),i&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:i}),d.length>0&&h.jsx("div",{className:"flex gap-1",children:d.map(f=>h.jsx("span",{className:"text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono",children:f},f))}),t.labels.length>0&&h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.labels.length," label",t.labels.length!==1?"s":""]})]})]})}function $A({field:t,value:e,onChange:n,disabled:s}){const i=t.catalog??[],o=i.length>0,d=t.allowCustomPath!==!1||t.allowCustom===!0,f=[...o?[{id:"catalog",label:`Models (${i.length})`}]:[],...d?[{id:"custom",label:"Custom Path"}]:[]],[m,y]=D.useState(o?"catalog":"custom"),v=e==null?"":String(e);return h.jsxs("div",{className:"space-y-3",children:[f.length>1&&h.jsx(FA,{tabs:f,active:m,onChange:y}),m==="catalog"&&o&&h.jsx("div",{className:"space-y-1.5 max-h-[320px] overflow-y-auto pr-1",children:i.map(b=>h.jsx(WA,{entry:b,selected:v===b.id,onSelect:()=>n(b.id),disabled:s||t.disabled},b.id))}),m==="catalog"&&!o&&h.jsxs("div",{className:"rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2",children:[h.jsx(gb,{className:"h-3.5 w-3.5 text-info shrink-0 mt-0.5"}),h.jsx("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."})]}),m==="custom"&&d&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("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:v,disabled:s||t.disabled,onChange:b=>n(b.target.value)}),t.acceptFormats&&t.acceptFormats.length>0&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:["Accepted formats: ",t.acceptFormats.join(", ")]})]}),(t.compatibilityNote||t.conversionGuideUrl)&&h.jsxs("div",{className:"flex items-start justify-between gap-3 pt-1",children:[t.compatibilityNote&&h.jsxs("p",{className:"flex items-start gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(gb,{className:"h-3 w-3 mt-0.5 shrink-0"}),t.compatibilityNote]}),t.conversionGuideUrl&&h.jsxs("a",{href:t.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",h.jsx(tT,{className:"h-3 w-3"})]})]})]})}const fh="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 disabled:cursor-not-allowed",m8="block text-xs font-medium text-foreground mb-1",eM="text-[10px] text-foreground-subtle mt-0.5";function li({label:t,description:e,required:n,span:s,children:i,translationFn:o}){const d=s===2?"col-span-2":s===3?"col-span-3":s===4?"col-span-4":"col-span-1",f=$c(t,o),m=$c(e,o);return h.jsxs("div",{className:d,children:[f!==void 0&&h.jsxs("label",{className:m8,children:[f,n&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),i,m&&h.jsx("p",{className:eM,children:m})]})}function tM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("input",{type:t.inputType??"text",className:fh,value:e==null?"":String(e),placeholder:t.placeholder,maxLength:t.maxLength,pattern:t.pattern,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function nM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("input",{type:"number",className:fh,value:e==null?"":String(e),placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,disabled:s||t.disabled,onChange:o=>n(o.target.value===""?void 0:Number(o.target.value))}),t.unit&&h.jsx("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:t.unit})]})})}function aM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=!!e,d=s||t.disabled;return t.style==="checkbox"?h.jsx(li,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:o,disabled:d,onChange:f=>n(f.target.checked)}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:$c(t.label,i)}),t.required&&h.jsx("span",{className:"text-danger",children:"*"})]})}):h.jsx(li,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{className:m8+" mb-0",children:[$c(t.label,i),t.required&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":o,disabled:d,onClick:()=>!d&&n(!o),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150",o?"bg-primary":"bg-foreground-subtle/30",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",o?"translate-x-4":"translate-x-0.5"].join(" ")})})]})})}function sM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("select",{className:fh,value:e==null?"":String(e),disabled:s||t.disabled,onChange:o=>n(o.target.value),children:[!t.required&&h.jsx("option",{value:"",children:"— Select —"}),t.options.map(o=>h.jsx("option",{value:o.value,children:o.label},o.value))]})})}function rM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],d=f=>{if(o.includes(f))n(o.filter(m=>m!==f));else{if(t.maxItems!==void 0&&o.length>=t.maxItems)return;n([...o,f])}};return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("div",{className:"flex flex-wrap gap-2",children:t.options.map(f=>{const m=o.includes(f.value);return h.jsxs("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",m?"border-primary bg-primary/10 text-primary":"border-border bg-background text-foreground hover:bg-surface",s||t.disabled?"opacity-50 cursor-not-allowed":""].join(" "),children:[h.jsx("input",{type:"checkbox",className:"sr-only",checked:m,disabled:s||t.disabled,onChange:()=>d(f.value)}),f.label]},f.value)})})})}function iM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(!1),f=t.showToggle!==!1;return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:o?"text":"password",className:fh+(f?" pr-9":""),value:e==null?"":String(e),placeholder:t.placeholder,disabled:s||t.disabled,onChange:m=>n(m.target.value)}),f&&h.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>d(m=>!m),children:o?h.jsx(E6,{className:"h-3.5 w-3.5"}):h.jsx(ch,{className:"h-3.5 w-3.5"})})]})})}function lM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("textarea",{className:fh+" resize-y min-h-[60px]",value:e==null?"":String(e),placeholder:t.placeholder,rows:t.rows??3,maxLength:t.maxLength,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function oM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?t.min:Number(e),d=t.showValue!==!1;return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:t.min,max:t.max,step:t.step??1,value:o,disabled:s||t.disabled,onChange:f=>n(Number(f.target.value))}),d&&h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[2.5rem] text-right",children:[o,t.unit?` ${t.unit}`:""]})]})})}function uM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],[d,f]=D.useState(""),m=D.useRef(null),y=D.useCallback(j=>{const w=j.trim();!w||o.includes(w)||t.maxTags!==void 0&&o.length>=t.maxTags||(n([...o,w]),f(""))},[o,t.maxTags,n]),v=j=>n(o.filter(w=>w!==j)),b=j=>{j.key==="Enter"||j.key===","?(j.preventDefault(),y(d)):j.key==="Backspace"&&d===""&&o.length>0&&v(o[o.length-1])},_=s||t.disabled;return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:["flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px] cursor-text","focus-within:border-primary focus-within:ring-1 focus-within:ring-primary/30",_?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>{var j;return!_&&((j=m.current)==null?void 0:j.focus())},children:[o.map(j=>h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:[j,!_&&h.jsx("button",{type:"button",onClick:()=>v(j),className:"hover:text-danger",children:h.jsx(Lu,{className:"h-2.5 w-2.5"})})]},j)),h.jsx("input",{ref:m,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:d,placeholder:o.length===0?t.placeholder??"Add tags…":"",disabled:_,list:`tags-suggestions-${t.key}`,onChange:j=>f(j.target.value),onKeyDown:b,onBlur:()=>{d.trim()&&y(d)}}),t.suggestions&&h.jsx("datalist",{id:`tags-suggestions-${t.key}`,children:t.suggestions.map(j=>h.jsx("option",{value:j},j))})]})})}function cM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?"#000000":String(e);return h.jsxs(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-9 w-9 rounded-md border border-border bg-background cursor-pointer p-0.5 disabled:opacity-50",value:o,disabled:s||t.disabled,onChange:d=>n(d.target.value)}),h.jsx("input",{type:"text",className:fh+" flex-1 font-mono",value:o,placeholder:"#000000",disabled:s||t.disabled,onChange:d=>n(d.target.value)})]}),t.presets&&t.presets.length>0&&h.jsx("div",{className:"flex gap-1.5 mt-1.5",children:t.presets.map(d=>h.jsx("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:d},disabled:s||t.disabled,title:d,onClick:()=>n(d)},d))})]})}function dM({field:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",m=t.span===2?"col-span-2":t.span===3?"col-span-3":t.span===4?"col-span-4":"col-span-1";return h.jsx("div",{className:m,children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface/50 overflow-hidden",children:[h.jsxs("div",{className:["px-3 py-2 flex items-center justify-between",f?"cursor-pointer hover:bg-surface":""].join(" "),onClick:f?()=>d(y=>!y):void 0,children:[h.jsx("span",{className:"text-xs font-semibold text-foreground",children:$c(t.label,i)}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:"px-3 pb-3 grid grid-cols-2 gap-x-4 gap-y-3",children:t.fields.map(y=>h.jsx(g8,{field:y,values:e,onChange:n,disabled:s,translationFn:i},y.key))})]})})}function fM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx($A,{field:t,value:e,onChange:n,disabled:s})})}function hM({span:t}){const e=t===2?"col-span-2":t===3?"col-span-3":t===4?"col-span-4":"col-span-full";return h.jsx("div",{className:e,children:h.jsx("hr",{className:"border-border"})})}const d5={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}};function pM({field:t}){const e=t.variant??"info",n=d5[e]??d5.info;return h.jsx("div",{className:"col-span-full",children:h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${n.border} ${n.bg}`,children:[t.label&&h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${n.text}`,children:t.label}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:t.content})]})})}function g8({field:t,values:e,onChange:n,disabled:s,translationFn:i}){if("showWhen"in t&&t.showWhen){const f=t.showWhen,m=e[f.field];let y=!0;if(f.equals!==void 0?y=m===f.equals:f.notEquals!==void 0?y=m!==f.notEquals:f.in!==void 0?y=f.in.includes(m):f.notIn!==void 0&&(y=!f.notIn.includes(m)),!y)return null}const o=e[t.key],d=f=>n(t.key,f);switch(t.type){case"text":return h.jsx(tM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"number":return h.jsx(nM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"boolean":return h.jsx(aM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"select":return h.jsx(sM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"multiselect":return h.jsx(rM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"password":return h.jsx(iM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"textarea":return h.jsx(lM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"slider":return h.jsx(oM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"tags":return h.jsx(uM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"color":return h.jsx(cM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"group":return h.jsx(dM,{field:t,values:e,onChange:n,disabled:s,translationFn:i});case"separator":return h.jsx(hM,{});case"info":return h.jsx(pM,{field:t});case"model-selector":return h.jsx(fM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});default:return null}}function mM(t){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(t)}function $c(t,e){if(t!==void 0)return e&&mM(t)?e(t):t}function gM({section:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",m=t.columns??2,y=m===1?"grid-cols-1":m===3?"grid-cols-3":m===4?"grid-cols-4":"grid-cols-2";return h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsxs("div",{className:["flex items-center justify-between mb-3",f?"cursor-pointer":""].join(" "),onClick:f?()=>d(v=>!v):void 0,children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:$c(t.title,i)}),t.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:$c(t.description,i)})]}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs ml-2",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:`grid ${y} gap-x-4 gap-y-3`,children:t.fields.map(v=>h.jsx(g8,{field:v,values:e,onChange:n,disabled:s,translationFn:i},v.key))})]})}function $1({schema:t,values:e,onChange:n,disabled:s,translationFn:i}){const o=(d,f)=>{n({...e,[d]:f})};return h.jsx("div",{className:"space-y-4",children:t.sections.map(d=>h.jsx(gM,{section:d,values:e,onChange:o,disabled:s,translationFn:i},d.id))})}function yM({addonId:t,configSchema:e,onSave:n,onBack:s}){const{t:i}=Rr(),o=sn(),[d,f]=D.useState(""),[m,y]=D.useState({}),[v,b]=D.useState(null),_=ja({mutationFn:()=>o.trpc.providerConfig.testConnection.mutate({type:t,url:String(m.url??""),username:m.username?String(m.username):void 0,password:m.password?String(m.password):void 0}),onSuccess:j=>b(j),onError:j=>b({success:!1,error:String(j)})});return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:i("integrations.integrationName")}),h.jsx("input",{type:"text",value:d,onChange:j=>f(j.target.value),placeholder:i("integrations.integrationNamePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),e&&h.jsx($1,{schema:e,values:m,onChange:y}),v&&h.jsx("div",{className:`rounded-lg border px-3 py-2 text-xs ${v.success?"border-success/30 bg-success/5 text-success":"border-danger/30 bg-danger/5 text-danger"}`,children:v.success?i("integrations.connectionSuccess"):`${i("integrations.errorPrefix")} ${v.error}`}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:s,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:i("integrations.back")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>_.mutate(),disabled:_.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:_.isPending?i("integrations.testing"):i("integrations.testConnection")}),h.jsx("button",{onClick:()=>n({name:d,config:m}),disabled:!d.trim(),className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:i("integrations.forward")})]})]})]})}function xM({providerId:t,onImport:e,onSkip:n}){const{t:s}=Rr(),i=sn(),[o,d]=D.useState(new Set),{data:f,isLoading:m}=Ct({queryKey:["discover-devices",t],queryFn:()=>i.discoverDevices(t)});function y(b){d(_=>{const j=new Set(_);return j.has(b)?j.delete(b):j.add(b),j})}if(m)return h.jsxs("div",{className:"flex flex-col items-center py-12",children:[h.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),h.jsx("p",{className:"mt-3 text-xs text-foreground-subtle",children:s("integrations.searchingDevices")})]});const v=f??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-xs text-foreground-subtle",children:v.length>0?s("integrations.foundDevices",{count:v.length}):s("integrations.noDevicesFound")}),v.length>0&&h.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:v.map(b=>{const _=b.externalId,j=b.name??_,w=o.has(_);return h.jsxs("button",{onClick:()=>y(_),className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${w?"border-primary/40 bg-primary/5":"border-border bg-surface hover:border-foreground-subtle/30"}`,children:[h.jsx("div",{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${w?"border-primary bg-primary":"border-border"}`,children:w&&h.jsx(G1,{className:"h-3 w-3 text-primary-foreground"})}),h.jsx(ku,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:j})]},_)})}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.skip")}),v.length>0&&h.jsxs("button",{onClick:()=>e(Array.from(o)),disabled:o.size===0,className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:[s("integrations.importSelected")," (",o.size,")"]})]})]})}function bM({open:t,onClose:e}){const{t:n}=Rr(),s=sn(),i=xl(),o=wa(),[d,f]=D.useState("picker"),[m,y]=D.useState(null),[v,b]=D.useState(null),[_,j]=D.useState("manual"),{data:w}=Ct({queryKey:["addon-config-schema",m],queryFn:()=>s.getAddonConfigSchema(m),enabled:m!=null}),O=ja({mutationFn:L=>s.trpc.providerConfig.addProvider.mutate({id:L.id,type:L.type,name:L.name,...L.config}),onSuccess:()=>o.invalidateQueries({queryKey:["providers"]})}),R=ja({mutationFn:L=>s.adoptDevice(v,L),onSuccess:()=>o.invalidateQueries({queryKey:["devices"]})});async function T(L,V,Z){if(y(L),j(Z),V==="unique"){const oe=`${L}-${Date.now()}`;try{await O.mutateAsync({id:oe,type:L,name:L,config:{}}),e(),P(),i(`/integrations/${oe}`)}catch{}return}f("config")}async function A(L){if(!m)return;const V=`${m}-${Date.now()}`;try{await O.mutateAsync({id:V,type:m,name:L.name,config:L.config}),b(V),_==="auto"||_==="both"?f("discovery"):k(V)}catch{}}async function z(L){for(const V of L)await R.mutateAsync(V);k()}function k(L){const V=L??v??m;e(),P(),V&&i(`/integrations/${V}`)}function P(){f("picker"),y(null),b(null),j("manual")}function H(){e(),P()}if(!t)return null;const B={picker:n("integrations.newIntegration"),config:n("integrations.configureIntegration"),discovery:n("integrations.importDevices")};return h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:H}),h.jsxs("div",{className:"relative z-10 w-full max-w-lg rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:B[d]}),h.jsx("button",{onClick:H,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(Lu,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4",children:[d==="picker"&&h.jsx(KA,{onSelect:T,onClose:H}),d==="config"&&m&&h.jsx(yM,{addonId:m,configSchema:w??null,onSave:A,onBack:()=>f("picker")}),d==="discovery"&&v&&h.jsx(xM,{providerId:v,onImport:z,onSkip:k})]})]})]})}const vM=[{id:"all",label:"All",icon:h3},{id:"camera",label:"Camera",icon:ku},{id:"sensor",label:"Sensor",icon:fv},{id:"light",label:"Light",icon:NT},{id:"switch",label:"Switch",icon:sR},{id:"other",label:"Other",icon:h3}];function dx(t){const e=(t.type??"").toLowerCase();return e.includes("camera")||e==="camera"?"camera":e.includes("sensor")?"sensor":e.includes("light")?"light":e.includes("switch")?"switch":e?"other":"camera"}function SM(){const t=sn(),e=wa(),n=xl(),[s,i]=D.useState(!1),[o,d]=D.useState(""),[f,m]=D.useState("all"),[y,v]=D.useState("provider"),[b,_]=D.useState(new Set(["__all__"])),{data:j,isLoading:w}=Ct({queryKey:["providers"],queryFn:()=>t.listProviders(),refetchInterval:5e3}),{data:O,isLoading:R}=Ct({queryKey:["devices"],queryFn:()=>t.listDevices(),refetchInterval:5e3});ja({mutationFn:Z=>t.startProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})}),ja({mutationFn:Z=>t.stopProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})});const T=j??[],A=O??[],z=D.useMemo(()=>{const Z=o.toLowerCase();return A.filter(oe=>!(f!=="all"&&dx(oe)!==f||Z&&!(oe.name??oe.id??"").toLowerCase().includes(Z)))},[A,f,o]),k=D.useMemo(()=>{var oe;const Z=new Map;for(const ne of z){let J;switch(y){case"provider":J=ne.providerId??"unknown";break;case"type":J=dx(ne);break;case"status":J=(oe=ne.state)!=null&&oe.online?"online":"offline";break}Z.has(J)||Z.set(J,[]),Z.get(J).push(ne)}return Z},[z,y]);function P(Z){_(oe=>{const ne=new Set(oe);return ne.has(Z)?ne.delete(Z):ne.add(Z),ne})}function H(Z){if(y==="provider"){const oe=T.find(ne=>ne.id===Z);return oe?oe.name??Z:Z}return Z.charAt(0).toUpperCase()+Z.slice(1)}function B(Z){if(y==="provider"){const oe=T.find(ne=>ne.id===Z);return(oe==null?void 0:oe.type)??"rtsp"}return"rtsp"}function L(Z){var oe;if(y==="provider"){const ne=T.find(J=>J.id===Z);return(oe=ne==null?void 0:ne.status)!=null&&oe.connected?"running":"stopped"}return""}const V=w||R;return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Integrations"}),h.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"New Integration"]})]}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsxs("div",{className:"relative",children:[h.jsx(hv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:o,onChange:Z=>d(Z.target.value),placeholder:"Search devices...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsx("div",{className:"flex items-center gap-1",children:vM.map(({id:Z,label:oe})=>h.jsx("button",{onClick:()=>m(Z),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${f===Z?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:oe},Z))}),h.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Group by:"}),h.jsxs("select",{value:y,onChange:Z=>v(Z.target.value),className:"rounded-lg border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"provider",children:"Provider"}),h.jsx("option",{value:"type",children:"Type"}),h.jsx("option",{value:"status",children:"Status"})]})]})]}),V&&h.jsx("div",{className:"space-y-2",children:[1,2,3].map(Z=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},Z))}),!V&&z.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"No devices found."}),h.jsx("p",{className:"text-xs mt-1",children:o||f!=="all"?"Try adjusting your filters":"Start an integration to discover devices."})]}),!V&&Array.from(k.entries()).map(([Z,oe])=>{const ne=b.has(Z)||b.has("__all__"),J=B(Z),ie=L(Z),ce=y==="provider"?Z:null;return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>P(Z),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-surface-hover transition-colors",children:[ne?h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Ic,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),y==="provider"&&h.jsx(W1,{type:J,size:"sm"}),y==="provider"?h.jsx("span",{className:"text-xs font-semibold text-foreground hover:text-primary hover:underline cursor-pointer",onClick:Y=>{Y.stopPropagation(),n(`/integrations/${Z}`)},children:H(Z)}):h.jsx("span",{className:"text-xs font-semibold text-foreground",children:H(Z)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[oe.length," device",oe.length!==1?"s":""]}),ie&&h.jsx(nh,{status:ie}),h.jsx("div",{className:"ml-auto flex items-center gap-1",onClick:Y=>Y.stopPropagation(),children:ce&&h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Provider settings",children:h.jsx(Zm,{className:"h-3.5 w-3.5"})})})]}),ne&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2 text-[10px] font-medium text-foreground-subtle uppercase tracking-wider border-b border-border bg-background",children:[h.jsx("span",{children:"Name"}),h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Status"}),h.jsx("span",{children:"Phase"}),h.jsx("span",{children:"Today"}),h.jsx("span",{children:"Last Event"})]}),oe.map(Y=>{var W;const $=Y.id,ae=Y.name??Y.id,Ne=dx(Y),re=(W=Y.state)!=null&&W.online?"online":"offline",G=Y.phase??"—";return h.jsxs("button",{onClick:()=>n(`/devices/${$}`),className:"w-full grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2.5 text-left hover:bg-surface-hover transition-colors border-b border-border last:border-b-0",children:[h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:ae}),h.jsx("span",{className:"text-[11px] text-foreground-subtle capitalize",children:Ne}),h.jsx("span",{children:h.jsx(nh,{status:re})}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:G}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"})]},$)})]})]},Z)}),h.jsx(bM,{open:s,onClose:()=>i(!1)})]})}function NM({deviceName:t,snapshotUrl:e,status:n,resolution:s,codec:i,fps:o,lastSnapshot:d}){const{t:f}=Rr(),[m,y]=D.useState(!1);return h.jsxs("div",{className:"relative flex-shrink-0",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[h.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",title:f("integrations.preview"),children:h.jsx(ch,{className:"h-3.5 w-3.5"})}),m&&h.jsxs("div",{className:"absolute bottom-full right-0 mb-2 w-72 rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-50 overflow-hidden",children:[h.jsx("div",{className:"h-40 bg-background flex items-center justify-center",children:e&&n!=="offline"?h.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:v=>{v.target.style.display="none"}}):h.jsx("span",{className:"text-xs text-foreground-subtle",children:f(n==="offline"?"integrations.snapshotUnavailable":"integrations.noSnapshot")})}),h.jsxs("div",{className:"px-3 py-2 space-y-0.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:t}),(s||i||o)&&h.jsx("p",{className:"text-[10px] text-foreground-subtle",children:[i,s,o?`${o}fps`:null].filter(Boolean).join(" · ")}),d&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[f("integrations.lastSnapshot")," ",d]}),n==="offline"&&h.jsx("p",{className:"text-[10px] text-danger",children:f("integrations.offline")})]})]})]})}function _M({id:t,name:e,status:n,snapshotUrl:s,resolution:i,codec:o,fps:d,lastSnapshot:f}){const m=xl();return h.jsxs("div",{onClick:()=>m(`/devices/${t}`),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2.5 cursor-pointer hover:border-foreground-subtle/30 transition-colors",children:[h.jsx(ku,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground flex-1 truncate",children:e}),h.jsx(NM,{deviceName:e,snapshotUrl:s,status:n,resolution:i,codec:o,fps:d,lastSnapshot:f}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full flex-shrink-0 ${n==="online"?"bg-success":"bg-danger"}`,title:n==="online"?"Online":"Offline"})]})}function CM({name:t,externalId:e,onImport:n,importing:s}){const{t:i}=Rr();return h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-border bg-surface px-3 py-2.5 opacity-70",children:[h.jsx(ku,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-medium text-foreground flex-1 truncate",children:t}),h.jsx("button",{onClick:()=>n(e),disabled:s,className:"flex-shrink-0 rounded bg-primary/15 border border-primary/25 px-2 py-0.5 text-[9px] font-semibold text-primary hover:bg-primary/25 transition-colors disabled:opacity-50",children:s?"...":i("integrations.import")})]})}function jM({activeDevices:t,discoveredDevices:e,onImport:n,importingIds:s}){const{t:i}=Rr(),o=e&&e.length>0;return h.jsxs("div",{className:"space-y-4",children:[t.length>0&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.active")," (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:t.map(d=>h.jsx(_M,{id:d.id,name:d.name,status:d.status,snapshotUrl:d.snapshotUrl},d.id))})]}),t.length===0&&!o&&h.jsxs("div",{className:"flex flex-col items-center py-16 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:i("integrations.noDevices")}),h.jsx("p",{className:"text-xs mt-1",children:i("integrations.addFirstDevice")})]}),o&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.available")," (",e.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:e.map(d=>h.jsx(CM,{name:d.name,externalId:d.externalId,onImport:n??(()=>{}),importing:s==null?void 0:s.has(d.externalId)},d.externalId))})]})]})}function wM({open:t,providerId:e,onClose:n}){const{t:s}=Rr(),i=sn(),o=wa(),[d,f]=D.useState(""),[m,y]=D.useState(""),[v,b]=D.useState([""]),[_,j]=D.useState({}),w=ja({mutationFn:k=>i.createDevice(e,k),onSuccess:()=>{o.invalidateQueries({queryKey:["devices"]})}}),O=ja({mutationFn:async()=>{const k={};for(let P=0;P<v.length;P++){const H=v[P];if(H.trim())try{await i.trpc.providerConfig.testConnection.mutate({type:"rtsp",url:H}),k[P]={codec:"OK",resolution:"Connected"}}catch(B){k[P]={error:String(B)}}}j(k)}});function R(){b(k=>[...k,""])}function T(k){b(P=>P.filter((H,B)=>B!==k))}function A(k,P){b(H=>H.map((B,L)=>L===k?P:B))}async function z(k){const P={name:d,snapshotUrl:m||void 0,streams:v.filter(H=>H.trim())};await w.mutateAsync(P),k?(f(""),y(""),b([""])):n()}return t?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:n}),h.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("integrations.addDevice")}),h.jsx("button",{onClick:n,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(Lu,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4 space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.name")}),h.jsx("input",{type:"text",value:d,onChange:k=>f(k.target.value),placeholder:s("integrations.namePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.snapshotUrlOptional")}),h.jsx("input",{type:"text",value:m,onChange:k=>y(k.target.value),placeholder:"http://192.168.1.100/snapshot.jpg",className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[11px] font-medium text-foreground",children:s("integrations.streamUrls")}),h.jsxs("button",{onClick:R,className:"flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors",children:[h.jsx(po,{className:"h-3 w-3"})," ",s("integrations.addStream")]})]}),h.jsx("div",{className:"space-y-2",children:v.map((k,P)=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:k,onChange:H=>A(P,H.target.value),placeholder:"rtsp://192.168.1.100:554/stream1",className:"flex-1 rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"}),v.length>1&&h.jsx("button",{onClick:()=>T(P),className:"rounded-md p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",children:h.jsx(Im,{className:"h-3.5 w-3.5"})})]},P))})]}),Object.keys(_).length>0&&h.jsx("div",{className:"space-y-1",children:Object.entries(_).map(([k,P])=>h.jsx("div",{className:`rounded-lg border px-3 py-1.5 text-[10px] ${P.error?"border-danger/30 bg-danger/5 text-danger":"border-success/30 bg-success/5 text-success"}`,children:P.error?`${s("integrations.stream",{number:Number(k)+1})} ${P.error}`:`${s("integrations.stream",{number:Number(k)+1})} ${P.codec} · ${P.resolution}`},k))})]}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-5 py-3",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.cancel")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>O.mutate(),disabled:v.every(k=>!k.trim())||O.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:O.isPending?s("integrations.testing"):s("integrations.test")}),h.jsx("button",{onClick:()=>z(!1),disabled:!d.trim()||v.every(k=>!k.trim())||w.isPending,className:"rounded-l-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:w.isPending?s("integrations.saving"):s("integrations.save")}),h.jsxs("div",{className:"relative group",children:[h.jsx("button",{disabled:!d.trim()||v.every(k=>!k.trim()),className:"rounded-r-lg border-l border-primary-foreground/20 bg-primary px-2 py-1.5 text-primary-foreground disabled:opacity-50",children:h.jsx(Zc,{className:"h-3 w-3"})}),h.jsx("div",{className:"absolute right-0 bottom-full mb-1 hidden group-hover:block",children:h.jsx("button",{onClick:()=>z(!0),disabled:!d.trim()||v.every(k=>!k.trim()),className:"whitespace-nowrap rounded-lg border border-border bg-surface px-3 py-1.5 text-xs text-foreground shadow-lg hover:bg-surface-hover disabled:opacity-50",children:s("integrations.saveAndNew")})})]})]})]})]})]}):null}function EM(){const{t}=Rr(),{integrationId:e}=Wb(),n=sn(),s=wa(),[i,o]=D.useState(!1),[d,f]=D.useState(!1),{data:m,isLoading:y}=Ct({queryKey:["provider",e],queryFn:()=>n.getProvider(e),enabled:!!e}),{data:v}=Ct({queryKey:["devices"],queryFn:()=>n.listDevices(),refetchInterval:5e3}),{data:b,refetch:_}=Ct({queryKey:["discover-devices",e],queryFn:()=>n.discoverDevices(e),enabled:!!e&&(m==null?void 0:m.discoveryMode)!=="manual"}),j=ja({mutationFn:()=>n.startProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),w=ja({mutationFn:()=>n.stopProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),O=ja({mutationFn:V=>n.adoptDevice(e,V),onSuccess:()=>{s.invalidateQueries({queryKey:["devices"]}),s.invalidateQueries({queryKey:["discover-devices",e]})}}),[R,T]=D.useState(new Set);async function A(V){T(Z=>new Set([...Z,V]));try{await O.mutateAsync(V)}finally{T(Z=>{const oe=new Set(Z);return oe.delete(V),oe})}}if(y)return h.jsxs("div",{className:"p-6",children:[h.jsx("div",{className:"h-16 rounded-lg bg-surface animate-pulse mb-4"}),h.jsx("div",{className:"h-40 rounded-lg bg-surface animate-pulse"})]});if(!m)return h.jsx("div",{className:"flex items-center justify-center py-20 text-foreground-subtle text-sm",children:t("integrations.integrationNotFound")});const k=(v??[]).filter(V=>V.providerId===e).map(V=>{var Z;return{id:V.id,name:V.name??V.id,status:(Z=V.state)!=null&&Z.online?"online":"offline",snapshotUrl:null}}),P=(b??[]).map(V=>({externalId:V.externalId,name:V.name??V.externalId})),H=m.status.connected?"running":"stopped",B=m.discoveryMode!=="manual",L=m.discoveryMode==="manual";return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("img",{src:n.getAddonAssetUrl(m.type,"assets/icon.svg"),alt:"",className:"h-8 w-8 rounded-lg",onError:V=>{V.target.style.display="none"}}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:m.name}),h.jsxs("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:[m.type," · ",k.length," ",t("integrations.devices")]})]}),h.jsx(nh,{status:H})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[B&&h.jsxs("button",{onClick:()=>_(),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(yb,{className:"h-3 w-3"}),t("integrations.rediscover")]}),h.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(Zm,{className:"h-3 w-3"}),t("integrations.config")]}),H==="running"?h.jsx("button",{onClick:()=>w.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",title:"Stop",children:h.jsx(D6,{className:"h-3.5 w-3.5"})}):h.jsx("button",{onClick:()=>j.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-success hover:bg-success/10 transition-colors",title:"Start",children:h.jsx(dv,{className:"h-3.5 w-3.5"})})]})]}),h.jsx(jM,{activeDevices:k,discoveredDevices:B?P:void 0,onImport:A,importingIds:R}),h.jsx("button",{onClick:()=>{L?o(!0):_()},className:"fixed bottom-6 right-6 flex h-12 w-12 items-center justify-center rounded-full bg-primary shadow-lg shadow-primary/30 hover:shadow-primary/40 transition-shadow",title:t(L?"integrations.addDevice":"integrations.rediscover"),children:L?h.jsx(po,{className:"h-5 w-5 text-primary-foreground"}):h.jsx(yb,{className:"h-5 w-5 text-primary-foreground"})}),i&&e&&h.jsx(wM,{open:i,providerId:e,onClose:()=>o(!1)}),d&&h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>f(!1),children:h.jsxs("div",{className:"rounded-xl border border-border bg-surface p-6 shadow-xl w-80",onClick:V=>V.stopPropagation(),children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground mb-2",children:t("integrations.providerConfig")}),h.jsx("p",{className:"text-[11px] text-foreground-subtle",children:t("integrations.configComingSoon")}),h.jsx("button",{onClick:()=>f(!1),className:"mt-4 w-full rounded-lg bg-primary px-3 py-1.5 text-[11px] text-primary-foreground hover:bg-primary/90 transition-colors",children:"Close"})]})})]})}function TM({label:t,color:e,title:n,style:s}){return h.jsxs("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 z-10 group cursor-pointer",style:s,title:n,children:[h.jsx("div",{className:"h-2.5 w-2.5 rounded-full border-2 border-background shadow-sm transition-transform group-hover:scale-150",style:{backgroundColor:e}}),n&&h.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-20 pointer-events-none",children:h.jsxs("div",{className:"bg-surface border border-border rounded px-2 py-1 text-[10px] text-foreground whitespace-nowrap shadow-lg",children:[h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full mr-1 align-middle",style:{backgroundColor:e}}),t]})})]})}const fx=36e5;function RM(t){return String(t).padStart(2,"0")}function OM(t){const e=new Date(t);return`${RM(e.getHours())}:00`}function AM({startMs:t,endMs:e,segments:n,events:s,playheadMs:i,onSeek:o}){const d=D.useRef(null),f=e-t,m=D.useCallback(j=>Math.max(0,Math.min(100,(j-t)/f*100)),[t,f]);function y(j){if(!d.current)return;const w=d.current.getBoundingClientRect(),O=Math.max(0,Math.min(1,(j.clientX-w.left)/w.width));o(Math.round(t+O*f))}const v=[],b=Math.floor(t/fx),_=Math.ceil(e/fx);for(let j=b;j<=_;j++){const w=j*fx;w<t||w>e||v.push({percent:m(w),label:OM(w)})}return h.jsxs("div",{className:"select-none",children:[h.jsx("div",{className:"relative h-5 mb-1",children:v.map(({percent:j,label:w})=>h.jsx("span",{className:"absolute -translate-x-1/2 text-[10px] text-foreground-subtle",style:{left:`${j}%`},children:w},w))}),h.jsxs("div",{ref:d,className:"relative h-8 rounded bg-surface-hover cursor-pointer overflow-hidden border border-border",onClick:y,onPointerMove:j=>{j.buttons===1&&y(j)},children:[n.map((j,w)=>{const O=m(j.startMs),R=m(j.endMs)-O;return h.jsx("div",{className:"absolute top-1 bottom-1 rounded-sm bg-success/60",style:{left:`${O}%`,width:`${Math.max(R,.1)}%`}},w)}),s.map(j=>h.jsx(TM,{label:j.label,color:j.color,title:`${j.label} — ${new Date(j.timestampMs).toLocaleTimeString()}`,style:{left:`${m(j.timestampMs)}%`}},j.id)),h.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-danger z-20 pointer-events-none",style:{left:`${m(i)}%`},children:h.jsx("div",{className:"absolute -top-0.5 left-1/2 -translate-x-1/2 w-2.5 h-2.5 bg-danger rotate-45"})})]})]})}const f5={person:"#f59e0b",vehicle:"#3b82f6",car:"#3b82f6",face:"#a855f7",plate:"#ec4899",animal:"#10b981",motion:"#ef4444",unknown:"#6b7280"};function Cb(t){return f5[t.toLowerCase()]??f5.unknown}function MM(t){const e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}function DM(t){return new Date(t).toISOString().slice(0,10)}function zM(t){return new Date(t+"T00:00:00").getTime()}function kM(t){return[{startMs:t+0*36e5,endMs:t+4*36e5},{startMs:t+6*36e5,endMs:t+10*36e5},{startMs:t+12*36e5,endMs:t+16*36e5},{startMs:t+18*36e5,endMs:t+23*36e5}]}function LM(t){const e=["person","vehicle","face","motion"];return Array.from({length:24},(n,s)=>({id:`placeholder-${s}`,timestampMs:t+Math.floor(Math.random()*24*36e5),label:e[s%e.length],color:Cb(e[s%e.length])})).sort((n,s)=>n.timestampMs-s.timestampMs)}function UM(){var k,P;const{t}=Rr(),e=sn(),n=MM(new Date),[s,i]=D.useState(n),[o,d]=D.useState(null),[f,m]=D.useState(n+12*36e5),y=s,v=s+24*36e5,{data:b,isLoading:_}=Ct({queryKey:["devices"],queryFn:()=>e.listDevices(),staleTime:3e4}),j=b??[],w=D.useMemo(()=>j.filter(B=>{const L=String(B.type??"").toLowerCase(),V=B.capabilities??[];return L==="camera"||L.includes("camera")||V.some(Z=>Z.toLowerCase().includes("video")||Z.toLowerCase().includes("stream"))}).map(B=>({id:String(B.id),name:String(B.name??B.id)})),[j]),O=o??((k=w[0])==null?void 0:k.id)??null,{data:R}=Ct({queryKey:["events",O,y],queryFn:()=>O?e.getEvents(O,{limit:200}):Promise.resolve(null),enabled:!!O,staleTime:6e4}),T=D.useMemo(()=>{const H=R,L=Array.isArray(H)?H:H!=null&&typeof H=="object"&&Array.isArray(H.events)?H.events:[];return L.length===0?O?LM(y):[]:L.map((V,Z)=>{const oe=String(V.class??V.type??V.label??"unknown").toLowerCase(),ne=typeof V.timestamp=="number"?V.timestamp:y;return{id:String(V.id??Z),timestampMs:ne,label:oe,color:Cb(oe)}})},[R,O,y]),A=D.useMemo(()=>O?kM(y):[],[O,y]);function z(H){i(B=>B+H*24*36e5),m(B=>B+H*24*36e5)}return h.jsxs("div",{className:"flex flex-col h-full p-6 gap-5 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 shrink-0",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.timeline","Timeline")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>z(-1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(LE,{className:"h-4 w-4"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx(EE,{className:"absolute left-2 h-3.5 w-3.5 text-foreground-subtle pointer-events-none"}),h.jsx("input",{type:"date",value:DM(s),onChange:H=>{if(H.target.value){const B=zM(H.target.value);i(B),m(B+12*36e5)}},className:"rounded-lg border border-border bg-surface pl-7 pr-3 py-1.5 text-xs text-foreground focus:outline-none focus:border-primary/50"})]}),h.jsx("button",{onClick:()=>z(1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",disabled:s>=n,children:h.jsx(Ic,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex gap-1.5 shrink-0 overflow-x-auto pb-1",children:[_&&h.jsx("div",{className:"h-8 w-48 rounded-lg bg-surface animate-pulse"}),!_&&w.length===0&&h.jsx("span",{className:"text-xs text-foreground-subtle",children:"No cameras found"}),w.map(H=>{const B=H.id===O;return h.jsx("button",{onClick:()=>d(H.id),className:`shrink-0 rounded-lg px-3 py-1.5 text-[12px] font-medium transition-all border ${B?"bg-primary/12 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border hover:bg-surface-hover hover:text-foreground"}`,children:H.name},H.id)})]}),h.jsxs("div",{className:"relative rounded-xl border border-border bg-black shrink-0 overflow-hidden",style:{aspectRatio:"16/9",maxHeight:"45vh"},children:[h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-foreground-subtle",children:[h.jsx(T6,{className:"h-12 w-12 opacity-20"}),h.jsx("p",{className:"text-sm opacity-50",children:O?`${((P=w.find(H=>H.id===O))==null?void 0:P.name)??O} — seek to play`:"Select a camera"})]}),h.jsx("div",{className:"absolute top-3 left-3 rounded bg-black/60 px-2 py-1 text-[11px] text-white font-mono",children:new Date(f).toLocaleTimeString()})]}),h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 pt-3 pb-4 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[h.jsx("span",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Timeline"}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2 w-4 rounded-sm bg-success/60"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Recording"})]}),Array.from(new Set(T.map(H=>H.label))).slice(0,5).map(H=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:Cb(H)}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle capitalize",children:H})]},H))]}),O?h.jsx(AM,{startMs:y,endMs:v,segments:A,events:T,playheadMs:f,onSeek:m}):h.jsx("div",{className:"h-8 rounded bg-surface-hover flex items-center justify-center text-xs text-foreground-subtle",children:"Select a camera to view timeline"})]})]})}D.createContext(null);function ra(...t){return kS(Km(t))}var HM=dr("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),qM=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:ra(HM({variant:e,size:n}),t),...s}));qM.displayName="Button";var BM=dr("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),GM=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:ra(BM({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));GM.displayName="IconButton";var PM=dr("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),YM=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:ra(PM({variant:e,styleVariant:n}),t),...s}));YM.displayName="Badge";var VM=dr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),QM=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:ra(VM({variant:e}),t),...n}));QM.displayName="Card";var XM=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:ra("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));XM.displayName="Label";var KM=dr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),FM=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:ra(KM({orientation:e}),t),...n}));FM.displayName="Separator";var ZM=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ra("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));ZM.displayName="Skeleton";var h5=dr("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),IM=D.forwardRef(({className:t,state:e,leftSlot:n,rightSlot:s,...i},o)=>n||s?h.jsxs("div",{className:"relative flex items-center w-full",children:[n&&h.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),h.jsx("input",{ref:o,className:ra(h5({state:e}),n?"pl-7":"",s?"pr-7":"",t),...i}),s&&h.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:s})]}):h.jsx("input",{ref:o,className:ra(h5({state:e}),t),...i}));IM.displayName="Input";var JM=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:ra("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",t),...n,children:e.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))}),h.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:h.jsx(iv,{className:"h-3.5 w-3.5"})})]}));JM.displayName="Select";var WM=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:ra("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));WM.displayName="Checkbox";var $M=D.forwardRef(({className:t,checked:e,onCheckedChange:n,label:s,...i},o)=>h.jsxs("button",{ref:o,role:"switch","aria-checked":e,type:"button",onClick:()=>n(!e),className:ra("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:ra("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:ra("block w-3.5 h-3.5 rounded-full bg-white transition-transform",e?"translate-x-4":"translate-x-0.5")})}),s&&h.jsx("span",{className:"text-xs text-foreground",children:s})]}));$M.displayName="Switch";var eD=D.createContext(null);function tD(){const t=D.useContext(eD);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}var nD=dr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),aD=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=tD(),m=D.useRef(null),y=i??m;D.useEffect(()=>{const b=y.current;b&&(o&&!b.open&&b.showModal(),!o&&b.open&&b.close())},[o,y]);const v=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:ra(nD({width:e}),"w-full",t),onClick:v,onClose:()=>d(!1),...s,children:n})});aD.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);var sD=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ra("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));sD.displayName="ScrollArea";var rD={"object-detection":"border-l-blue-500","motion-detection":"border-l-amber-500","face-detection":"border-l-purple-500","face-recognition":"border-l-violet-500","plate-detection":"border-l-pink-500","plate-recognition":"border-l-rose-500","animal-classifier":"border-l-lime-500","bird-nabirds-classifier":"border-l-emerald-500","bird-global-classifier":"border-l-teal-500","audio-classification":"border-l-green-500","segmentation-refiner":"border-l-cyan-500"},iD={detector:"border-l-blue-500",cropper:"border-l-purple-500",classifier:"border-l-lime-500",refiner:"border-l-cyan-500"};function lD(t,e){return rD[t]??iD[e]??"border-l-primary"}var oD={cpu:"onnx",coreml:"coreml",openvino:"openvino",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt"};function uD(t,e,n){const s=t==="node"?e.runtimes.node.backends:e.runtimes.python.backends;if(!n)return s;const i=new Set;for(const o of n.models)for(const d of Object.keys(o.formats))i.add(d);return t==="node"&&i.add("onnx"),s.map(o=>{const d=oD[o.id]??"onnx",f=i.has(d);return{...o,available:o.available&&f}})}function cD(t,e,n,s){var o;if(!t)return[];const i=e==="node"?"onnx":((o=s.runtimes.python.backends.find(d=>d.id===n))==null?void 0:o.modelFormat)??"onnx";return t.models.filter(d=>d.formats[i]).map(d=>{var f;return{id:d.id,name:d.name,downloaded:((f=d.formats[i])==null?void 0:f.downloaded)??!1}})}function dD(t){const e=[{id:"node",label:"Node.js (ONNX)",available:!0}];return t.runtimes.python.available&&t.runtimes.python.backends.some(n=>n.available)&&e.unshift({id:"python",label:"Python",available:!0}),e}function hx({step:t,schema:e,allSchemas:n,capabilities:s,depth:i=0,onChange:o,onDelete:d,readOnly:f=!1}){var R;const[m,y]=D.useState(!1),v=lD(t.addonId,t.slot),b=uD(t.runtime,s,e),_=dD(s);if(!(((R=b.find(T=>T.id===t.backend))==null?void 0:R.available)??!1)&&!f){const T=b.find(A=>A.available);T&&T.id!==t.backend&&queueMicrotask(()=>o({...t,backend:T.id}))}const w=cD(e,t.runtime,t.backend,s);if(w.length>0&&!w.some(T=>T.id===t.modelId)&&!f){const A=(e!=null&&e.defaultModelId?w.find(z=>z.id===e.defaultModelId):null)??w[0];A&&A.id!==t.modelId&&queueMicrotask(()=>o({...t,modelId:A.id}))}function O(T){T.target.closest(".step-config")||y(A=>!A)}return h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:ra("rounded-xl border border-border bg-surface overflow-hidden border-l-4 shadow-sm",v,!t.enabled&&"opacity-[0.45]"),children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 cursor-pointer select-none",onClick:O,children:[h.jsx("span",{className:"text-foreground-subtle",children:m?h.jsx(iv,{className:"h-4 w-4"}):h.jsx(pC,{className:"h-4 w-4"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:t.slot}),h.jsx("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:t.addonName}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(T=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400",children:T},T)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),t.outputClasses.map(T=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400",children:T},T))]})]}),h.jsx("button",{onClick:T=>{T.stopPropagation(),o({...t,enabled:!t.enabled})},className:ra("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",t.enabled?"bg-success":"bg-foreground-subtle/30"),children:h.jsx("span",{className:ra("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",t.enabled?"translate-x-6":"translate-x-1")})})]}),m&&h.jsxs("div",{className:"step-config border-t border-border bg-background px-4 py-4 space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(J0,{label:"Agent",value:t.agentId,disabled:f,options:[{value:t.agentId||"hub",label:t.agentId||"Hub (local)"}],onChange:T=>o({...t,agentId:T})}),h.jsx(J0,{label:"Runtime",value:t.runtime,disabled:f,options:_.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,runtime:T})}),h.jsx(J0,{label:"Backend",value:t.backend,disabled:f,options:b.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,backend:T})}),h.jsx(J0,{label:"Model",value:t.modelId,disabled:f,options:w.map(T=>({value:T.id,label:`${T.name}${T.downloaded?" ✓":""}`})),onChange:T=>o({...t,modelId:T})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:"Confidence"}),h.jsxs("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[(t.confidence*100).toFixed(0),"%"]})]}),h.jsx("input",{type:"range",min:0,max:1,step:.01,value:t.confidence,disabled:f,onChange:T=>o({...t,confidence:Number(T.target.value)}),className:"w-full accent-primary h-1.5"})]})]})]})})}function J0({label:t,value:e,options:n,disabled:s,onChange:i}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:t}),h.jsxs("select",{value:e,onChange:o=>i(o.target.value),disabled:s,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",children:[n.length===0&&h.jsx("option",{value:e,children:e||"default"}),n.map(o=>h.jsx("option",{value:o.value,disabled:o.disabled,children:o.label},o.value))]})]})}function fD(t,e){const n=new Set(e.slots.flatMap(d=>d.addons.map(f=>f.id))),s=[];function i(d){if(!n.has(d.addonId))return s.push(`Addon "${d.addonId}" is no longer available — step removed`),null;const f=e.slots.flatMap(v=>v.addons).find(v=>v.id===d.addonId);let m=d.modelId;if(f&&!f.models.some(v=>v.id===m)){const v=f.defaultModelId;s.push(`Model "${m}" not available for ${d.addonId} — using "${v}"`),m=v}const y=d.children.map(v=>i(v)).filter(v=>v!==null);return{...d,modelId:m,children:y}}const o=t.map(d=>i(d)).filter(d=>d!==null);return{valid:s.length===0,steps:o,warnings:s}}function hD(t){const e=new Map;for(const n of t.slots)for(const s of n.addons)e.set(s.id,s);return e}function px(t,e,n){return{addonId:t.id,addonName:t.name,slot:t.slot,inputClasses:[...t.inputClasses],outputClasses:[...t.outputClasses],enabled:!0,agentId:"hub",runtime:t.defaultRuntime??e??"node",backend:t.defaultBackend??n??"cpu",modelId:t.defaultModelId,confidence:t.defaultConfidence,classFilters:[...t.inputClasses],children:[]}}function mx({addon:t,onClick:e}){return h.jsx("button",{type:"button",onClick:e,className:"w-full rounded-xl border-2 border-dashed border-border/60 px-4 py-3 text-left transition-all hover:border-primary/30 hover:bg-surface/60 group",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(gC,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:t.name}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/8 text-blue-400/50",children:n},n)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),t.outputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/8 text-green-400/50",children:n},n))]})]})]})})}function pD({schema:t,capabilities:e,steps:n,onChange:s,templates:i,selectedTemplateId:o,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:m,onDeleteTemplate:y,readOnly:v=!1,excludeAddons:b=[]}){var $,ae,Ne,re;const _=D.useMemo(()=>new Set(b),[b]),j=D.useMemo(()=>hD(t),[t]),[w,O]=D.useState([]),R=($=e.platformScores)==null?void 0:$.find(G=>G.available),T=e.runtimes.python.available&&e.runtimes.python.backends.some(G=>G.available),A=(R==null?void 0:R.runtime)??(T?"python":"node"),z=(R==null?void 0:R.backend)??(T?((ae=e.runtimes.python.backends.find(G=>G.available))==null?void 0:ae.id)??"cpu":((Ne=e.runtimes.node.backends.find(G=>G.available&&G.id!=="cpu"))==null?void 0:Ne.id)??"cpu"),k=o?JSON.stringify(n)!==JSON.stringify((re=i.find(G=>G.id===o))==null?void 0:re.steps):!1;function P(G){const W=G.target.value||null;if(W){const he=i.find(xe=>xe.id===W);if(he){const xe=fD(he.steps,t);O([...xe.warnings])}}else O([]);d(W)}function H(){o&&m(o,n)}function B(){const G=window.prompt("Template name:");G!=null&&G.trim()&&f(G.trim(),n)}function L(){if(!o)return;const G=i.find(W=>W.id===o);G&&window.confirm(`Delete template "${G.name}"?`)&&y(o)}function V(G){s(n.map(W=>W.addonId!==G.addonId?W:Z(G)))}function Z(G){const W=G.children.some(he=>he.enabled||he.children.some(xe=>xe.enabled));return{...G,enabled:G.enabled||W,children:G.children.map(he=>{const xe=he.children.some(_e=>_e.enabled);return{...he,enabled:he.enabled||xe}})}}function oe(G,W){const he=px(W,A,z);s(n.map(xe=>xe.addonId!==G?xe:{...xe,children:[...xe.children,he]}))}function ne(G){const W=new Set;for(const he of G){W.add(he.addonId);for(const _e of he.children)W.add(_e.addonId);const xe=ne(he.children);for(const _e of xe)W.add(_e)}return W}const J=ne(n);function ie(G){const W=j.get(G.addonId);if(!W)return[];const he=W.childSlots,xe=new Set(G.children.map(je=>je.addonId)),_e=[];for(const je of t.slots)if(he.includes(je.id))for(const De of je.addons){if(xe.has(De.id)||_.has(De.id))continue;De.inputClasses.some(ze=>G.outputClasses.includes(ze))&&_e.push(De)}return _e}function ce(G){const W=ie(G);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(hx,{step:G,schema:j.get(G.addonId)??null,allSchemas:j,capabilities:e,onChange:V,onDelete:v?void 0:he=>s(n.filter(xe=>xe.addonId!==he)),readOnly:v}),(G.children.length>0||W.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/40 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),G.children.map(he=>{const xe=ie(he);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(hx,{step:he,schema:j.get(he.addonId)??null,allSchemas:j,capabilities:e,depth:1,onChange:_e=>{V({...G,children:G.children.map(je=>je.addonId===_e.addonId?_e:je)})},onDelete:v?void 0:_e=>{V({...G,children:G.children.filter(je=>je.addonId!==_e)})},readOnly:v}),(he.children.length>0||xe.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/30 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),he.children.map(_e=>h.jsx(hx,{step:_e,schema:j.get(_e.addonId)??null,allSchemas:j,capabilities:e,depth:2,onChange:je=>{V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:De.children.map(nt=>nt.addonId===je.addonId?je:nt)}:De)})},onDelete:v?void 0:je=>{V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:De.children.filter(nt=>nt.addonId!==je)}:De)})},readOnly:v},_e.addonId)),!v&&xe.map(_e=>h.jsx(mx,{addon:_e,onClick:()=>{const je=px(_e,A,z);V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:[...De.children,je]}:De)})}},_e.id))]})]},he.addonId)}),!v&&W.map(he=>h.jsx(mx,{addon:he,onClick:()=>oe(G.addonId,he)},he.id))]})]},G.addonId)}const Y=t.slots.filter(G=>G.parentSlot===null).sort((G,W)=>G.priority-W.priority);return h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"rounded-xl border border-border bg-surface p-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"relative flex-1 min-w-0",children:h.jsxs("select",{value:o??"",onChange:P,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"",children:"No template"}),i.map(G=>h.jsx("option",{value:G.id,children:G.name},G.id))]})}),k&&h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),h.jsx("button",{onClick:H,disabled:!o||v,title:"Save",className:ra("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(vC,{className:"h-4 w-4"})}),h.jsx("button",{onClick:B,disabled:v,title:"Save As",className:ra("p-2 rounded-lg border border-border transition-colors",v?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:h.jsx(xC,{className:"h-4 w-4"})}),h.jsx("button",{onClick:L,disabled:!o||v,title:"Delete",className:ra("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(NC,{className:"h-4 w-4"})})]})}),w.length>0&&h.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-400 space-y-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-medium",children:"Template loaded with warnings:"}),h.jsx("button",{onClick:()=>O([]),className:"text-amber-400/60 hover:text-amber-400",children:h.jsx(CC,{className:"h-3.5 w-3.5"})})]}),w.map((G,W)=>h.jsxs("div",{children:["• ",G]},W))]}),Y.map(G=>{const W=n.filter(xe=>xe.slot===G.id&&!_.has(xe.addonId)),he=G.addons.filter(xe=>!J.has(xe.id)&&!_.has(xe.id));return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",G.label]}),W.map(xe=>ce(xe)),!v&&he.map(xe=>h.jsx(mx,{addon:xe,onClick:()=>{s([...n,px(xe,A,z)])}},xe.id))]},G.id)})]})}D.createContext(null);function gx({label:t,value:e,min:n,max:s,step:i=1,unit:o,hint:d,onChange:f}){return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:t}),d&&h.jsx("span",{className:"text-[9px] text-foreground-subtle/50",children:d})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:n,max:s,step:i,value:e,onChange:m=>f(Number(m.target.value))}),h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:[e,o?` ${o}`:""]})]})]})}function mD({motionFps:t,detectionFps:e,cooldownMs:n,maxConcurrentInferences:s,onMotionFpsChange:i,onDetectionFpsChange:o,onCooldownMsChange:d,onMaxConcurrentInferencesChange:f}){const m=s===null;return h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-[10px] font-semibold text-foreground uppercase tracking-wider",children:"Orchestrator"}),h.jsx(gx,{label:"Motion FPS",value:t,min:1,max:15,onChange:i,unit:"fps",hint:"Frame-diff rate"}),h.jsx(gx,{label:"Detection FPS",value:e,min:1,max:30,onChange:o,unit:"fps",hint:"Inference rate"}),h.jsx(gx,{label:"Motion Cooldown",value:n/1e3,min:1,max:60,onChange:y=>d(y*1e3),unit:"s",hint:"No motion → idle"}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:"Max Parallel"}),h.jsx("button",{type:"button",onClick:()=>f(m?2:null),className:`text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors ${m?"bg-primary/15 text-primary":"bg-surface text-foreground-subtle hover:text-foreground"}`,children:m?"Auto":"Manual"})]}),m?h.jsx("p",{className:"text-[10px] text-foreground-subtle/60",children:"Auto-detected from hardware (CPU cores, GPU)"}):h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:1,max:8,value:s,onChange:y=>f(Number(y.target.value))}),h.jsx("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:s})]})]})]})}const gD={motionFps:2,detectionFps:5,cooldownMs:1e4,maxConcurrentInferences:null};function yD(){const{t}=Rr(),e=sn(),[n,s]=D.useState(!0),[i,o]=D.useState(null),[d,f]=D.useState(null),[m,y]=D.useState([]),[v,b]=D.useState([]),[_,j]=D.useState(null),[w,O]=D.useState(gD),[R,T]=D.useState(!1),[A,z]=D.useState(!1),[k,P]=D.useState(!0);D.useEffect(()=>{var ie,ce,Y,$,ae,Ne,re,G,W,he,xe,_e,je,De,nt;const J=e.trpc;if(!J){s(!1);return}Promise.all([(Y=(ce=(ie=J.pipeline)==null?void 0:ie.getSchema)==null?void 0:ce.query)==null?void 0:Y.call(ce).catch(()=>null),(Ne=(ae=($=J.inference)==null?void 0:$.getCapabilities)==null?void 0:ae.query)==null?void 0:Ne.call(ae).catch(()=>null),(W=(G=(re=J.pipeline)==null?void 0:re.getGlobalSteps)==null?void 0:G.query)==null?void 0:W.call(G).catch(()=>null),(_e=(xe=(he=J.pipeline)==null?void 0:he.getOrchestratorSettings)==null?void 0:xe.query)==null?void 0:_e.call(xe).catch(()=>null),(nt=(De=(je=J.pipeline)==null?void 0:je.listTemplates)==null?void 0:De.query)==null?void 0:nt.call(De).catch(()=>[])]).then(([ze,Vt,$e,At,qt])=>{ze&&o(ze),Vt&&f(Vt),$e&&y($e),At&&O(At),b(qt??[]),s(!1)}).catch(()=>s(!1))},[e]);const H=D.useCallback(J=>{y(J),T(!0)},[]),B=D.useCallback(J=>{if(j(J),J&&i){const ie=v.find(ce=>ce.id===J);if(ie!=null&&ie.steps){const ce=new Map(i.slots.flatMap($=>$.addons.map(ae=>[ae.id,ae]))),Y=$=>{const ae=ce.get($.addonId);return{addonId:$.addonId,addonName:(ae==null?void 0:ae.name)??$.addonId,slot:(ae==null?void 0:ae.slot)??"detector",inputClasses:ae?[...ae.inputClasses]:[],outputClasses:ae?[...ae.outputClasses]:[],enabled:$.enabled??!0,agentId:$.agentId??"hub",runtime:$.runtime??"node",backend:$.backend??"cpu",modelId:$.modelId??(ae==null?void 0:ae.defaultModelId)??"",confidence:$.confidence??(ae==null?void 0:ae.defaultConfidence)??.3,classFilters:$.classFilters?[...$.classFilters]:[],children:($.children??[]).map(Y)}};y(ie.steps.map(Y))}}},[i,v]),L=D.useCallback(async(J,ie)=>{try{const Y=await e.trpc.pipeline.saveTemplate.mutate({name:J,steps:ie});b($=>[Y,...$]),j(Y.id)}catch{}},[e]),V=D.useCallback(async(J,ie)=>{try{const Y=await e.trpc.pipeline.updateTemplate.mutate({id:J,steps:ie});b($=>$.map(ae=>ae.id===J?Y:ae))}catch{}},[e]),Z=D.useCallback(async J=>{try{await e.trpc.pipeline.deleteTemplate.mutate({id:J}),b(ce=>ce.filter(Y=>Y.id!==J)),_===J&&j(null)}catch{}},[e,_]);async function oe(){z(!0);try{const J=e.trpc;await Promise.all([J.pipeline.setGlobalSteps.mutate({steps:m}),J.pipeline.setOrchestratorSettings.mutate(w)]),T(!1)}catch{}finally{z(!1)}}function ne(J,ie){O(ce=>({...ce,[J]:ie})),T(!0)}return n?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Loading pipeline schema…"})}):!i||!d?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle",children:"Pipeline schema not available. Make sure detection addons are loaded."})}):h.jsxs("div",{className:"flex h-full overflow-hidden",children:[h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 px-6 py-4 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(P1,{className:"h-4 w-4 text-foreground-subtle"}),h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.pipeline","Pipeline Config")})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[R&&h.jsx("span",{className:"text-[10px] text-amber-400 font-medium",children:"Unsaved changes"}),h.jsxs("button",{onClick:oe,disabled:!R||A,className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${R&&!A?"bg-primary text-white hover:bg-primary/90":"bg-surface text-foreground-subtle border border-border cursor-not-allowed"}`,children:[h.jsx(M6,{className:"h-3.5 w-3.5"}),A?"Saving…":"Save Pipeline"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx(pD,{schema:i,capabilities:d,steps:m,onChange:H,templates:v,selectedTemplateId:_,onSelectTemplate:B,onSaveTemplate:L,onUpdateTemplate:V,onDeleteTemplate:Z})})]}),h.jsxs("aside",{className:"w-72 shrink-0 border-l border-border flex flex-col overflow-hidden bg-surface/40",children:[h.jsxs("button",{onClick:()=>P(!k),className:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border text-xs font-semibold text-foreground uppercase tracking-wider hover:bg-surface-hover transition-colors",children:[h.jsx("span",{children:"Settings"}),h.jsx(Zc,{className:`h-3.5 w-3.5 text-foreground-subtle transition-transform ${k?"":"-rotate-90"}`})]}),k&&h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:h.jsx(mD,{motionFps:w.motionFps,detectionFps:w.detectionFps,cooldownMs:w.cooldownMs,maxConcurrentInferences:w.maxConcurrentInferences,onMotionFpsChange:J=>ne("motionFps",J),onDetectionFpsChange:J=>ne("detectionFps",J),onCooldownMsChange:J=>ne("cooldownMs",J),onMaxConcurrentInferencesChange:J=>ne("maxConcurrentInferences",J)})})]})]})}const xD=["WebRTC","HLS","MJPEG","go2rtc"],bD=["BBox","Segm","Zones","Trail"];function vD({deviceName:t,detectionsToday:e,inferenceMs:n,activeTracks:s,storageGb:i}){const[o,d]=D.useState("WebRTC"),[f,m]=D.useState(new Set);function y(v){m(b=>{const _=new Set(b);return _.has(v)?_.delete(v):_.add(v),_})}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"relative w-full max-w-[320px] aspect-video bg-background rounded-lg border border-border flex items-center justify-center overflow-hidden",children:[h.jsx(ku,{className:"h-10 w-10 text-foreground-subtle/20"}),h.jsx("div",{className:"absolute bottom-2 left-2 text-[10px] text-foreground-subtle bg-background/80 rounded px-1.5 py-0.5",children:t})]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Source:"}),xD.map(v=>h.jsx("button",{onClick:()=>d(v),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${o===v?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:v},v))]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Overlay:"}),bD.map(v=>{const b=f.has(v);return h.jsx("button",{onClick:()=>y(v),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${b?"bg-info/15 text-info border border-info/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:v},v)})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsx(W0,{icon:ch,label:"Today",value:String(e)}),h.jsx(W0,{icon:uv,label:"Inference",value:`${n}ms`}),h.jsx(W0,{icon:IE,label:"Tracks",value:String(s)}),h.jsx(W0,{icon:gm,label:"Storage",value:`${i.toFixed(1)}GB`})]})]})}function W0({icon:t,label:e,value:n}){return h.jsxs("div",{className:"flex flex-col items-center gap-1 rounded-lg border border-border bg-surface px-2 py-2",children:[h.jsx(t,{className:"h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("span",{className:"text-xs font-semibold text-foreground",children:n}),h.jsx("span",{className:"text-[9px] text-foreground-subtle",children:e})]})}const yx={DETECT:{bg:"bg-success/15",text:"text-success"},PHASE:{bg:"bg-info/15",text:"text-info"},MOTION:{bg:"bg-warning/15",text:"text-warning"},REC:{bg:"bg-danger/15",text:"text-danger"},STATE:{bg:"bg-primary/15",text:"text-primary"},AUDIO:{bg:"bg-purple-500/15",text:"text-purple-400"}};function SD({deviceId:t}){const[e]=D.useState([]);return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"relative flex h-2 w-2",children:[h.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-success opacity-75"}),h.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-success"})]}),h.jsx("h3",{className:"text-[11px] font-semibold text-foreground uppercase tracking-wider",children:"Live Events"})]}),h.jsx("button",{title:"Float panel",className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(S1,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-2 border-b border-border",children:Object.entries(yx).map(([n,s])=>h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n},n))}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:e.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(cv,{className:"h-6 w-6 mb-2 opacity-30"}),h.jsx("p",{className:"text-[11px]",children:"Waiting for events..."}),h.jsx("p",{className:"text-[10px] mt-0.5 opacity-70",children:"Events will stream in real-time"})]}):h.jsx("div",{className:"divide-y divide-border",children:e.map(n=>{const s=yx[n.type]??yx.DETECT;return h.jsxs("div",{className:"px-3 py-2 hover:bg-surface-hover transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n.type}),h.jsx("span",{className:"text-[10px] text-foreground-subtle ml-auto",children:n.timestamp})]}),h.jsx("p",{className:"text-[11px] text-foreground mt-1",children:n.message})]},n.id)})})})]})}const p5={person:{color:"text-success",borderColor:"border-l-success",icon:fR},vehicle:{color:"text-info",borderColor:"border-l-info",icon:OE},animal:{color:"text-warning",borderColor:"border-l-warning",icon:WE},audio:{color:"text-danger",borderColor:"border-l-danger",icon:O6},other:{color:"text-foreground-subtle",borderColor:"border-l-foreground-subtle",icon:cv}};function ND(t){const e=String(t.label??t.type??"").toLowerCase();return e.includes("person")||e.includes("face")?"person":e.includes("vehicle")||e.includes("car")||e.includes("truck")?"vehicle":e.includes("animal")||e.includes("dog")||e.includes("cat")?"animal":e.includes("audio")||e.includes("sound")?"audio":"other"}function _D({deviceId:t}){const e=sn(),{data:n,isLoading:s}=Ct({queryKey:["events",t],queryFn:()=>e.getEvents(t,{limit:50}),enabled:!!t,refetchInterval:5e3}),i=n??[];return s?h.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(o=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},o))}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Detection Events"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.length," event",i.length!==1?"s":""]})]}),h.jsx("div",{className:"flex flex-wrap gap-3",children:Object.entries(p5).map(([o,d])=>{const f=d.icon;return h.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] ${d.color}`,children:[h.jsx(f,{className:"h-3 w-3"}),o]},o)})}),i.length===0?h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(cv,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No events yet"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Detection events will appear here as they occur"})]})}):h.jsx("div",{className:"space-y-1.5",children:i.map((o,d)=>{const f=ND(o),m=p5[f],y=m.icon,v=String(o.label??o.type??"Unknown"),b=o.score!=null?Number(o.score):null,_=o.zone?String(o.zone):null,j=o.trackId?String(o.trackId):null,w=o.timestamp?new Date(o.timestamp).toLocaleTimeString("en-GB",{hour12:!1}):"";return h.jsxs("div",{className:`flex items-start gap-3 rounded-lg border border-border border-l-4 ${m.borderColor} bg-surface px-3 py-2.5 hover:bg-surface-hover transition-colors`,children:[h.jsx("div",{className:"h-10 w-10 rounded bg-background flex items-center justify-center flex-shrink-0",children:h.jsx(y,{className:`h-4 w-4 ${m.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-foreground capitalize",children:v}),b!=null&&h.jsxs("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:[(b*100).toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle",children:[j&&h.jsxs("span",{children:["Track: ",j]}),_&&h.jsxs("span",{children:["Zone: ",_]})]})]}),h.jsx("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:w})]},o.id?String(o.id):d)})})]})}function CD({deviceId:t}){const e=sn(),[n,s]=D.useState(new Set),{data:i,isLoading:o}=Ct({queryKey:["pipeline",t],queryFn:()=>e.bridgeGetPipeline(t),enabled:!!t}),d=i,f=(d==null?void 0:d.video)??[];function m(y){s(v=>{const b=new Set(v);return b.has(y)?b.delete(y):b.add(y),b})}return o?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(y=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},y))}):f.length?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Steps"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," step",f.length!==1?"s":""," — read-only"]})]}),f.map((y,v)=>{const b=n.has(y.id??String(v)),_=y.id??String(v);return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>m(_),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-surface-hover transition-colors",children:[b?h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Ic,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle w-5",children:v+1}),h.jsx("span",{className:"text-xs font-medium text-foreground flex-1 truncate",children:y.name||y.type||`Step ${v+1}`}),h.jsx("span",{className:"text-[10px] text-foreground-subtle bg-surface-hover rounded px-1.5 py-0.5",children:y.type||"unknown"}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${y.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`})]}),b&&h.jsx("div",{className:"border-t border-border px-4 py-3 bg-background",children:h.jsx("pre",{className:"text-[11px] font-mono text-foreground-subtle whitespace-pre-wrap break-all",children:JSON.stringify(y.config??y,null,2)})})]},_)})]}):h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Config"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(P1,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No pipeline configured"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Pipeline steps will appear here once configured"})]})]})}function jD(){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recording Status"})}),h.jsxs("div",{className:"px-4 py-4 flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-full p-2 bg-foreground-subtle/10",children:h.jsx(C6,{className:"h-5 w-5 text-foreground-subtle"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-foreground-subtle",children:"Not Recording"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"No active recording session"})]})]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recorded Segments"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(T6,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No recorded segments"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Recorded clips will appear here"})]})]})]})}const wD=Math.PI/180;function ED(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Hc=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Me={_global:Hc,version:"10.2.3",isBrowser:ED(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return Me.angleDeg?t*wD:t},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Me.DD.isDragging},isTransforming(){var t,e;return(e=(t=Me.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!Me.DD.node},releaseCanvasOnDestroy:!0,document:Hc.document,_injectGlobal(t){typeof Hc.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Hc.Konva=t}},Wn=t=>{Me[t.prototype.getClassName()]=t};Me._injectGlobal(Me);const TD=`Konva.js unsupported environment.
551
+
552
+ Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
553
+
554
+ To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
555
+
556
+ bash: npm install canvas
557
+ js: import "konva/canvas-backend";
558
+
559
+ or
560
+
561
+ bash: npm install skia-canvas
562
+ js: import "konva/skia-backend";
563
+ `,m5=()=>{if(typeof document>"u")throw new Error(TD)};class wr{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new wr(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),i=this.m[0]*n+this.m[2]*s,o=this.m[1]*n+this.m[3]*s,d=this.m[0]*-s+this.m[2]*n,f=this.m[1]*-s+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=d,this.m[3]=f,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const s=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*e,d=this.m[3]+this.m[1]*e;return this.m[0]=s,this.m[1]=i,this.m[2]=o,this.m[3]=d,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],s=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],d=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],f=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,s=-this.m[1]*e,i=-this.m[2]*e,o=this.m[0]*e,d=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],s=this.m[2],i=this.m[3],o=this.m[4],d=this.m[5],f=e*i-n*s,m={x:o,y:d,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const y=Math.sqrt(e*e+n*n);m.rotation=n>0?Math.acos(e/y):-Math.acos(e/y),m.scaleX=y,m.scaleY=f/y,m.skewX=(e*s+n*i)/f,m.skewY=0}else if(s!=0||i!=0){const y=Math.sqrt(s*s+i*i);m.rotation=Math.PI/2-(i>0?Math.acos(-s/y):-Math.acos(s/y)),m.scaleX=f/y,m.scaleY=y,m.skewX=0,m.skewY=(e*s+n*i)/f}return m.rotation=ee._getRotation(m.rotation),m}}const RD="[object Array]",OD="[object Number]",AD="[object String]",MD="[object Boolean]",DD=Math.PI/180,zD=180/Math.PI,tm="#",kD="",LD="0",UD="Konva warning: ",g5="Konva error: ",HD="rgb(",xx={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},qD=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let $0=[],nm=null;const BD=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,16)},ee={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===RD},_isNumber(t){return Object.prototype.toString.call(t)===OD&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===AD},_isBoolean(t){return Object.prototype.toString.call(t)===MD},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){$0.push(t),$0.length===1&&BD(function(){const e=$0;$0=[],e.forEach(function(n){n()})})},createCanvasElement(){m5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return m5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const n=ee.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(t){t=t.replace(tm,kD);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=LD+t;return tm+t},isCanvasFarblingActive(){if(nm!==null)return nm;if(typeof document>"u")return nm=!1,!1;const t=this.createCanvasElement();t.width=10,t.height=10;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const n=e.getImageData(0,0,10,10).data;let s=!1;for(let i=0;i<100;i++)if(n[i*4]!==40||n[i*4+1]!==40||n[i*4+2]!==40||n[i*4+3]!==255){s=!0;break}return nm=s,this.releaseCanvas(t),nm},getHitColor(){const t=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(t):t},getHitColorKey(t,e,n){return this.isCanvasFarblingActive()&&(t=Math.round(t/5)*5,e=Math.round(e/5)*5,n=Math.round(n/5)*5),tm+this._rgbToHex(t,e,n)},getSnappedHexColor(t){const e=this._hexToRgb(t);return tm+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(t){let e;return t in xx?(e=xx[t],{r:e[0],g:e[1],b:e[2]}):t[0]===tm?this._hexToRgb(t.substring(1)):t.substr(0,4)===HD?(e=qD.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",ee._namedColorToRBA(t)||ee._hex3ColorToRGBA(t)||ee._hex4ColorToRGBA(t)||ee._hex6ColorToRGBA(t)||ee._hex8ColorToRGBA(t)||ee._rgbColorToRGBA(t)||ee._rgbaColorToRGBA(t)||ee._hslColorToRGBA(t)},_namedColorToRBA(t){const e=xx[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((n,s)=>n.slice(-1)==="%"?s===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),s=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let d,f,m;if(i===0)return m=o*255,{r:Math.round(m),g:Math.round(m),b:Math.round(m),a:1};o<.5?d=o*(1+i):d=o+i-o*i;const y=2*o-d,v=[0,0,0];for(let b=0;b<3;b++)f=s+1/3*-(b-1),f<0&&f++,f>1&&f--,6*f<1?m=y+(d-y)*6*f:2*f<1?m=d:3*f<2?m=y+(d-y)*(2/3-f)*6:m=y,v[b]=m*255;return{r:Math.round(v[0]),g:Math.round(v[1]),b:Math.round(v[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*DD},radToDeg(t){return t*zD},_degToRad(t){return ee.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),ee.degToRad(t)},_radToDeg(t){return ee.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),ee.radToDeg(t)},_getRotation(t){return Me.angleDeg?ee.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(g5+t)},error(t){console.error(g5+t)},warn(t){Me.showWarnings&&console.warn(UD+t)},each(t,e){for(const n in t)e(n,t[n])},_inRange(t,e,n){return e<=t&&t<n},_getProjectionToSegment(t,e,n,s,i,o){let d,f,m;const y=(t-n)*(t-n)+(e-s)*(e-s);if(y==0)d=t,f=e,m=(i-n)*(i-n)+(o-s)*(o-s);else{const v=((i-t)*(n-t)+(o-e)*(s-e))/y;v<0?(d=t,f=e,m=(t-i)*(t-i)+(e-o)*(e-o)):v>1?(d=n,f=s,m=(n-i)*(n-i)+(s-o)*(s-o)):(d=t+v*(n-t),f=e+v*(s-e),m=(d-i)*(d-i)+(f-o)*(f-o))}return[d,f,m]},_getProjectionToLine(t,e,n){const s=ee.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(o,d){if(!n&&d===e.length-1)return;const f=e[(d+1)%e.length],m=ee._getProjectionToSegment(o.x,o.y,f.x,f.y,t.x,t.y),y=m[0],v=m[1],b=m[2];b<i&&(s.x=y,s.y=v,i=b)}),s},_prepareArrayForTween(t,e,n){const s=[],i=[];if(t.length>e.length){const d=e;e=t,t=d}for(let d=0;d<t.length;d+=2)s.push({x:t[d],y:t[d+1]});for(let d=0;d<e.length;d+=2)i.push({x:e[d],y:e[d+1]});const o=[];return i.forEach(function(d){const f=ee._getProjectionToLine(d,s,n);o.push(f.x),o.push(f.y)}),o},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const n in t)if(t.hasOwnProperty(n)&&t[n]&&typeof t[n]=="object"){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||ee._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(ee._prepareToStringify(t[n])===null)if(e.configurable)delete t[n];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const n in e)t[n]=e[n];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){Me.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,n,s){let i=e<0?e:0,o=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let d=0,f=0,m=0,y=0;typeof s=="number"?d=f=m=y=Math.min(s,e/2,n/2):(d=Math.min(s[0]||0,e/2,n/2),f=Math.min(s[1]||0,e/2,n/2),y=Math.min(s[2]||0,e/2,n/2),m=Math.min(s[3]||0,e/2,n/2)),t.moveTo(i+d,o),t.lineTo(i+e-f,o),t.arc(i+e-f,o+f,f,Math.PI*3/2,0,!1),t.lineTo(i+e,o+n-y),t.arc(i+e-y,o+n-y,y,0,Math.PI/2,!1),t.lineTo(i+m,o+n),t.arc(i+m,o+n-m,m,Math.PI/2,Math.PI,!1),t.lineTo(i,o+d),t.arc(i+d,o+d,d,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,n,s,i){s=Math.abs(s);for(let o=0;o<n;o++){const d=e[(o-1+n)%n],f=e[o],m=e[(o+1)%n],y={x:f.x-d.x,y:f.y-d.y},v={x:m.x-f.x,y:m.y-f.y},b=Math.hypot(y.x,y.y),_=Math.hypot(v.x,v.y);let j;typeof i=="number"?j=i:j=o<i.length?i[o]:0,j=s*Math.cos(Math.PI/n)*Math.min(1,j/s*2);const O={x:y.x/b,y:y.y/b},R={x:v.x/_,y:v.y/_},T={x:f.x-O.x*j,y:f.y-O.y*j},A={x:f.x+R.x*j,y:f.y+R.y*j};o===0?t.moveTo(T.x,T.y):t.lineTo(T.x,T.y),t.arcTo(f.x,f.y,A.x,A.y,j)}}};function GD(t){const e=[],n=t.length,s=ee;for(let i=0;i<n;i++){let o=t[i];s._isNumber(o)?o=Math.round(o*1e3)/1e3:s._isString(o)||(o=o+""),e.push(o)}return e}const y5=",",PD="(",YD=")",VD="([",QD="])",XD=";",KD="()",FD="=",x5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],ZD=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],ID=100;let e1=null;function b5(){if(e1!==null)return e1;try{const e=ee.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(e1=!1,!1)}catch{return e1=!1,!1}}class ey{constructor(e){this.canvas=e,Me.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let s=this.traceArr,i=s.length,o="",d,f,m,y;for(d=0;d<i;d++)f=s[d],m=f.method,m?(y=f.args,o+=m,e?o+=KD:ee._isArray(y[0])?o+=VD+y.join(y5)+QD:(n&&(y=y.map(v=>typeof v=="number"?Math.floor(v):v)),o+=PD+y.join(y5)+YD)):(o+=f.property,e||(o+=FD+f.val)),o+=XD;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,s;n.push(e),s=n.length,s>=ID&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,s,i,o,d){this._context.arc(e,n,s,i,o,d)}arcTo(e,n,s,i,o){this._context.arcTo(e,n,s,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,s,i,o,d){this._context.bezierCurveTo(e,n,s,i,o,d)}clearRect(e,n,s,i){this._context.clearRect(e,n,s,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const s=arguments;if(s.length===2)return this._context.createImageData(e,n);if(s.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,s,i){return this._context.createLinearGradient(e,n,s,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,s,i,o,d){return this._context.createRadialGradient(e,n,s,i,o,d)}drawImage(e,n,s,i,o,d,f,m,y){const v=arguments,b=this._context;v.length===3?b.drawImage(e,n,s):v.length===5?b.drawImage(e,n,s,i,o):v.length===9&&b.drawImage(e,n,s,i,o,d,f,m,y)}ellipse(e,n,s,i,o,d,f,m){this._context.ellipse(e,n,s,i,o,d,f,m)}isPointInPath(e,n,s,i){return s?this._context.isPointInPath(s,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,s,i){this._context.fillRect(e,n,s,i)}strokeRect(e,n,s,i){this._context.strokeRect(e,n,s,i)}fillText(e,n,s,i){i?this._context.fillText(e,n,s,i):this._context.fillText(e,n,s)}measureText(e){return this._context.measureText(e)}getImageData(e,n,s,i){return this._context.getImageData(e,n,s,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,s,i){this._context.rect(e,n,s,i)}roundRect(e,n,s,i,o){this._context.roundRect(e,n,s,i,o)}putImageData(e,n,s){this._context.putImageData(e,n,s)}quadraticCurveTo(e,n,s,i){this._context.quadraticCurveTo(e,n,s,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,s,i,o,d){this._context.setTransform(e,n,s,i,o,d)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,s,i){this._context.strokeText(e,n,s,i)}transform(e,n,s,i,o,d){this._context.transform(e,n,s,i,o,d)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=x5.length,s=this.setAttr,i,o;const d=function(f){let m=e[f],y;e[f]=function(){return o=GD(Array.prototype.slice.call(arguments,0)),y=m.apply(e,arguments),e._trace({method:f,args:o}),y}};for(i=0;i<n;i++)d(x5[i]);e.setAttr=function(){s.apply(e,arguments);const f=arguments[0];let m=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(m=m/this.canvas.getPixelRatio()),e._trace({property:f,val:m})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}ZD.forEach(function(t){Object.defineProperty(ey.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class JD extends ey{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),s=e.getFillPriority();if(n&&s==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&s==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&s==="linear-gradient"){this._fillLinearGradient(e);return}const d=e.getFillRadialGradientColorStops();if(d&&s==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):d&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),s=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,s.x,s.y);if(i){for(let d=0;d<i.length;d+=2)o.addColorStop(i[d],i[d+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),s=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!s){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),s||this.restore()}}_applyShadow(e){var n,s,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",d=(s=e.getShadowBlur())!==null&&s!==void 0?s:5,f=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},m=e.getAbsoluteScale(),y=this.canvas.getPixelRatio(),v=m.x*y,b=m.y*y;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",d*Math.min(Math.abs(v),Math.abs(b))),this.setAttr("shadowOffsetX",f.x*v),this.setAttr("shadowOffsetY",f.y*b)}}class WD extends ey{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const s=e.hitStrokeWidth(),i=s==="auto"?e.strokeWidth():s;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let t1;function $D(){if(t1)return t1;const t=ee.createCanvasElement(),e=t.getContext("2d");return t1=(function(){const n=Me._global.devicePixelRatio||1,s=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/s})(),ee.releaseCanvas(t),t1}class wv{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(e||{}).pixelRatio||Me.pixelRatio||$D();this.pixelRatio=s,this._canvas=ee.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return ee.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class xu extends wv{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new JD(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class Ev extends wv{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new WD(this),this.setSize(e.width,e.height)}}const Yt={get isDragging(){let t=!1;return Yt._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return Yt._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];Yt._dragElements.forEach((n,s)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(t),n.pointerId===void 0&&(n.pointerId=ee._getFirstPointerId(t));const d=o._changedPointerPositions.find(f=>f.id===n.pointerId);if(d){if(n.dragStatus!=="dragging"){const f=i.dragDistance();if(Math.max(Math.abs(d.x-n.startPointerPos.x),Math.abs(d.y-n.startPointerPos.y))<f||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:t},!0)})},_endDragBefore(t){const e=[];Yt._dragElements.forEach(n=>{const{node:s}=n,i=s.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(f=>f.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Yt.justDragged=!0,Me._mouseListenClick=!1,Me._touchListenClick=!1,Me._pointerListenClick=!1,n.dragStatus="stopped");const d=n.node.getLayer()||n.node instanceof Me.Stage&&n.node;d&&e.indexOf(d)===-1&&e.push(d)}),e.forEach(n=>{n.draw()})},_endDragAfter(t){Yt._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&Yt._dragElements.delete(n)})}};Me.isBrowser&&(window.addEventListener("mouseup",Yt._endDragBefore,!0),window.addEventListener("touchend",Yt._endDragBefore,!0),window.addEventListener("touchcancel",Yt._endDragBefore,!0),window.addEventListener("mousemove",Yt._drag),window.addEventListener("touchmove",Yt._drag),window.addEventListener("mouseup",Yt._endDragAfter,!1),window.addEventListener("touchend",Yt._endDragAfter,!1),window.addEventListener("touchcancel",Yt._endDragAfter,!1));function Uu(t){return ee._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||ee._isBoolean(t)?t:Object.prototype.toString.call(t)}function y8(t){return t>255?255:t<0?0:Math.round(t)}function Te(){if(Me.isUnminified)return function(t,e){return ee._isNumber(t)||ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function ty(t){if(Me.isUnminified)return function(e,n){let s=ee._isNumber(e),i=ee._isArray(e)&&e.length==t;return!s&&!i&&ee.warn(Uu(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Tv(){if(Me.isUnminified)return function(t,e){return ee._isNumber(t)||t==="auto"||ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function rd(){if(Me.isUnminified)return function(t,e){return ee._isString(t)||ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function x8(){if(Me.isUnminified)return function(t,e){const n=ee._isString(t),s=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||s||ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function ez(){if(Me.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(ee._isArray(t)?t.forEach(function(s){ee._isNumber(s)||ee.warn('"'+e+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Mi(){if(Me.isUnminified)return function(t,e){return t===!0||t===!1||ee.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function tz(t){if(Me.isUnminified)return function(e,n){return e==null||ee.isObject(e)||ee.warn(Uu(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}const am="get",sm="set",X={addGetterSetter(t,e,n,s,i){X.addGetter(t,e,n),X.addSetter(t,e,s,i),X.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){const s=am+ee._capitalize(e);t.prototype[s]=t.prototype[s]||function(){const i=this.attrs[e];return i===void 0?n:i}},addSetter(t,e,n,s){const i=sm+ee._capitalize(e);t.prototype[i]||X.overWriteSetter(t,e,n,s)},overWriteSetter(t,e,n,s){const i=sm+ee._capitalize(e);t.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,e)),this._setAttr(e,o),s&&s.call(this),this}},addComponentsGetterSetter(t,e,n,s,i){const o=n.length,d=ee._capitalize,f=am+d(e),m=sm+d(e);t.prototype[f]=function(){const v={};for(let b=0;b<o;b++){const _=n[b];v[_]=this.getAttr(e+d(_))}return v};const y=tz(n);t.prototype[m]=function(v){const b=this.attrs[e];s&&(v=s.call(this,v,e)),y&&y.call(this,v,e);for(const _ in v)v.hasOwnProperty(_)&&this._setAttr(e+d(_),v[_]);return v||n.forEach(_=>{this._setAttr(e+d(_),void 0)}),this._fireChangeEvent(e,b,v),i&&i.call(this),this},X.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=ee._capitalize(e),s=sm+n,i=am+n;t.prototype[e]=function(){return arguments.length?(this[s](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,s){ee.error("Adding deprecated "+e);const i=am+ee._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){ee.error(o);const d=this.attrs[e];return d===void 0?n:d},X.addSetter(t,e,s,function(){ee.error(o)}),X.addOverloadedGetterSetter(t,e)},backCompat(t,e){ee.each(e,function(n,s){const i=t.prototype[s],o=am+ee._capitalize(n),d=sm+ee._capitalize(n);function f(){i.apply(this,arguments),ee.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}t.prototype[n]=f,t.prototype[o]=f,t.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}};function nz(t){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(t))!==null;){const[,s,i]=n;switch(s){case"blur":{const o=parseFloat(i.replace("px",""));return function(d){this.blurRadius(o*.5);const f=Me.Filters;f&&f.Blur&&f.Blur.call(this,d)}}case"brightness":{const o=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(d){this.brightness(o);const f=Me.Filters;f&&f.Brightness&&f.Brightness.call(this,d)}}case"contrast":{const o=parseFloat(i);return function(d){const f=100*(Math.sqrt(o)-1);this.contrast(f);const m=Me.Filters;m&&m.Contrast&&m.Contrast.call(this,d)}}case"grayscale":return function(o){const d=Me.Filters;d&&d.Grayscale&&d.Grayscale.call(this,o)};case"sepia":return function(o){const d=Me.Filters;d&&d.Sepia&&d.Sepia.call(this,o)};case"invert":return function(o){const d=Me.Filters;d&&d.Invert&&d.Invert.call(this,o)};default:ee.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const g1="absoluteOpacity",v5="allEventListeners",so="absoluteTransform",S5="absoluteScale",zc="canvas",az="Change",sz="children",rz="konva",jb="listening",iz="mouseenter",lz="mouseleave",oz="pointerenter",uz="pointerleave",cz="touchenter",dz="touchleave",N5="set",_5="Shape",y1=" ",C5="stage",gu="transform",fz="Stage",wb="visible",hz=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(y1);let pz=1;class Ae{constructor(e){this._id=pz++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===gu||e===so)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let s=this._cache.get(e);return(s===void 0||(e===gu||e===so)&&s.dirty===!0)&&(s=n.call(this),this._cache.set(e,s)),s}_calculate(e,n,s){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(y1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,s)}_getCanvasCache(){return this._cache.get(zc)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===so&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(zc)){const{scene:e,filter:n,hit:s}=this._cache.get(zc);ee.releaseCanvas(e._canvas,n._canvas,s._canvas),this._cache.delete(zc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let s={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||s.width),o=Math.ceil(n.height||s.height),d=n.pixelRatio,f=n.x===void 0?Math.floor(s.x):n.x,m=n.y===void 0?Math.floor(s.y):n.y,y=n.offset||0,v=n.drawBorder||!1,b=n.hitCanvasPixelRatio||1;if(!i||!o){ee.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(s.x)-f)>.5?1:0,j=Math.abs(Math.round(s.y)-m)>.5?1:0;i+=y*2+_,o+=y*2+j,f-=y,m-=y;const w=new xu({pixelRatio:d,width:i,height:o}),O=new xu({pixelRatio:d,width:0,height:0,willReadFrequently:!0}),R=new Ev({pixelRatio:b,width:i,height:o}),T=w.getContext(),A=R.getContext(),z=new xu({width:w.width/w.pixelRatio+Math.abs(f),height:w.height/w.pixelRatio+Math.abs(m),pixelRatio:w.pixelRatio}),k=z.getContext();return R.isCache=!0,w.isCache=!0,this._cache.delete(zc),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(w.getContext()._context.imageSmoothingEnabled=!1,O.getContext()._context.imageSmoothingEnabled=!1),T.save(),A.save(),k.save(),T.translate(-f,-m),A.translate(-f,-m),k.translate(-f,-m),z.x=f,z.y=m,this._isUnderCache=!0,this._clearSelfAndDescendantCache(g1),this._clearSelfAndDescendantCache(S5),this.drawScene(w,this,z),this.drawHit(R,this),this._isUnderCache=!1,T.restore(),A.restore(),v&&(T.save(),T.beginPath(),T.rect(0,0,i,o),T.closePath(),T.setAttr("strokeStyle","red"),T.setAttr("lineWidth",5),T.stroke(),T.restore()),ee.releaseCanvas(z._canvas),this._cache.set(zc,{scene:w,filter:O,hit:R,x:f,y:m}),this._requestDraw(),this}isCached(){return this._cache.has(zc)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const s=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,d=-1/0,f=-1/0;const m=this.getAbsoluteTransform(n);return s.forEach(function(y){const v=m.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.y)}),{x:i,y:o,width:d-i,height:f-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const s=this._getCachedSceneCanvas(),i=s.pixelRatio;e.drawImage(s._canvas,0,0,s.width/i,s.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),s=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),s=n.scene,i=n.filter,o=i.getContext(),d,f,m,y;if(!e||e.length===0)return s;if(this._filterUpToDate)return i;let v=!0;for(let _=0;_<e.length;_++)if(typeof e[_]=="string"&&b5(),typeof e[_]!="string"||!b5()){v=!1;break}const b=s.pixelRatio;if(i.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),v){const _=e.join(" ");return o.save(),o.setAttr("filter",_),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),o.restore(),this._filterUpToDate=!0,i}try{for(d=e.length,o.clear(),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),f=o.getImageData(0,0,i.getWidth(),i.getHeight()),m=0;m<d;m++)y=e[m],typeof y=="string"&&(y=nz(y)),y.call(this,f),o.putImageData(f,0,0)}catch(_){ee.error("Unable to apply filter. "+_.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(...e){const n=e[0],s=e[1];if(e[2],this._cache&&this._cache.delete(v5),e.length===3)return this._delegate.apply(this,e);const i=n.split(y1);for(let o=0;o<i.length;o++){const f=i[o].split("."),m=f[0],y=f[1]||"";this.eventListeners[m]||(this.eventListeners[m]=[]),this.eventListeners[m].push({name:y,handler:s})}return this}off(e,n){let s=(e||"").split(y1),i=s.length,o,d,f,m,y,v;if(this._cache&&this._cache.delete(v5),!e)for(d in this.eventListeners)this._off(d);for(o=0;o<i;o++)if(f=s[o],m=f.split("."),y=m[0],v=m[1],y)this.eventListeners[y]&&this._off(y,v,n);else for(d in this.eventListeners)this._off(d,v,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(s){n.call(this,s.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,s){const i=this;return this.on(e,function(o){const d=o.target.findAncestors(n,!0,i);for(let f=0;f<d.length;f++)o=ee.cloneObject(o),o.currentTarget=d[f],s.call(d[f],o)}),this}remove(){return this.isDragging()&&this.stopDrag(),Yt._dragElements.delete(this._id),Yt._dragElements.forEach((e,n)=>{this.isAncestorOf(e.node)&&Yt._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(so),this._clearSelfAndDescendantCache(g1),this._clearSelfAndDescendantCache(S5),this._clearSelfAndDescendantCache(C5),this._clearSelfAndDescendantCache(wb),this._clearSelfAndDescendantCache(jb)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+ee._capitalize(e);return ee._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,s;if(!e)return this;for(n in e)n!==sz&&(s=N5+ee._capitalize(n),ee._isFunction(this[s])?this[s](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(jb,this._isListening)}_isListening(e){if(!this.listening())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isListening(e):!0}isVisible(){return this._getCache(wb,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const s=this.getLayer();let i=!1;Yt._dragElements.forEach(d=>{d.dragStatus==="dragging"&&(d.node.nodeType==="Stage"||d.node.getLayer()===s)&&(i=!0)});const o=!n&&!Me.hitOnDragEnabled&&(i||Me.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,s=0,i,o,d,f;function m(v){for(i=[],o=v.length,d=0;d<o;d++)f=v[d],s++,f.nodeType!==_5&&(i=i.concat(f.getChildren().slice())),f._id===n._id&&(d=o);i.length>0&&i[0].getDepth()<=e&&m(i)}const y=this.getStage();return n.nodeType!==fz&&y&&m(y.getChildren()),s}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(gu),this._clearSelfAndDescendantCache(so)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(n)}getAbsolutePosition(e){let n=!1,s=this.parent;for(;s;){if(s.isCached()){n=!0;break}s=s.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new wr,d=this.offset();return o.m=i.slice(),o.translate(d.x,d.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:s,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=s,this._clearCache(gu);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(gu),this._clearSelfAndDescendantCache(so),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,s=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),s!==void 0&&(o+=s),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let s=[],i=this.getParent(),o,d;if(!(n&&n._id===this._id)){for(s.unshift(this);i&&(!n||i._id!==n._id);)s.unshift(i),i=i.parent;for(o=s.length,d=0;d<o;d++)e(s[d])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return ee.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return ee.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return ee.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return ee.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return ee.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&ee.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(g1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,s,i,o,d;const f={attrs:{},className:this.getClassName()};for(n in e)s=e[n],d=ee.isObject(s)&&!ee._isPlainObject(s)&&!ee._isArray(s),!d&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=s,o!==s&&(f.attrs[n]=s));return ee._prepareToStringify(f)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,s){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===s)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,s){return this.findAncestors(e,n,s)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),s=n.length,i,o;for(i=0;i<s;i++)if(o=n[i],ee.isValidSelector(o)||(ee.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),ee.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),ee.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(C5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},s){return n.target=n.target||this,s?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(so,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new wr,this._eachAncestorReverse(function(s){const i=s.transformsEnabled();i==="all"?n.multiply(s.getTransform()):i==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},e),n;{n=this._cache.get(so)||new wr,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const s=this.transformsEnabled();if(s==="all")n.multiply(this.getTransform());else if(s==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;n.translate(i-d,o-f)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(gu,this._getTransform)}_getTransform(){var e,n;const s=this._cache.get(gu)||new wr;s.reset();const i=this.x(),o=this.y(),d=Me.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,m=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,y=this.attrs.skewX||0,v=this.attrs.skewY||0,b=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||o!==0)&&s.translate(i,o),d!==0&&s.rotate(d),(y!==0||v!==0)&&s.skew(y,v),(f!==1||m!==1)&&s.scale(f,m),(b!==0||_!==0)&&s.translate(-1*b,-1*_),s.dirty=!1,s}clone(e){let n=ee.cloneObject(this.attrs),s,i,o,d,f;for(s in e)n[s]=e[s];const m=new this.constructor(n);for(s in this.eventListeners)for(i=this.eventListeners[s],o=i.length,d=0;d<o;d++)f=i[d],f.name.indexOf(rz)<0&&(m.eventListeners[s]||(m.eventListeners[s]=[]),m.eventListeners[s].push(f));return m}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),s=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),d=e.pixelRatio||1,f=new xu({width:e.width||Math.ceil(n.width)||(s?s.width():0),height:e.height||Math.ceil(n.height)||(s?s.height():0),pixelRatio:d}),m=f.getContext(),y=new xu({width:f.width/f.pixelRatio+Math.abs(i),height:f.height/f.pixelRatio+Math.abs(o),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(m._context.imageSmoothingEnabled=!1),m.save(),(i||o)&&m.translate(-1*i,-1*o),this.drawScene(f,void 0,y),m.restore(),f}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,s=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,s);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,ee._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){s(i)}})}toBlob(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){s(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Me.dragDistance}_off(e,n,s){let i=this.eventListeners[e],o,d,f;for(o=0;o<i.length;o++)if(d=i[o].name,f=i[o].handler,(d!=="konva"||n==="konva")&&(!n||d===n)&&(!s||s===f)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,s){this._fire(e+az,{oldVal:n,newVal:s})}addName(e){if(!this.hasName(e)){const n=this.name(),s=n?n+" "+e:e;this.name(s)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),s=n.indexOf(e);return s!==-1&&(n.splice(s,1),this.name(n.join(" "))),this}setAttr(e,n){const s=this[N5+ee._capitalize(e)];return ee._isFunction(s)?s.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Me.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const s=this.attrs[e];s===n&&!ee.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,s,n),this._requestDraw())}_setComponentAttr(e,n,s){let i;s!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=s,this._fireChangeEvent(e,i,s))}_fireAndBubble(e,n,s){n&&this.nodeType===_5&&(n.target=this);const i=[iz,lz,oz,uz,cz,dz];if(!(i.indexOf(e)!==-1&&(s&&(this===s||this.isAncestorOf&&this.isAncestorOf(s))||this.nodeType==="Stage"&&!s))){this._fire(e,n);const d=i.indexOf(e)!==-1&&s&&s.isAncestorOf&&s.isAncestorOf(this)&&!s.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!d&&(s&&s.parent?this._fireAndBubble.call(this.parent,e,n,s):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,s;const{nodeType:i}=this,o=Ae.protoListenerMap.get(i)||{};let d=o==null?void 0:o[e];if(d===void 0){d=[];let f=Object.getPrototypeOf(this);for(;f;){const m=(s=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:[];d.push(...m),f=Object.getPrototypeOf(f)}o[e]=d,Ae.protoListenerMap.set(i,o)}return d}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const s=this._getProtoListeners(e);if(s)for(let o=0;o<s.length;o++)s[o].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let o=0;o<i.length;o++)i[o].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,s=this.getStage(),i=this.getAbsolutePosition();if(!s)return;const o=s._getPointerById(n)||s._changedPointerPositions[0]||i;Yt._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n,startEvent:e})}startDrag(e,n=!0){Yt._dragElements.has(this._id)||this._createDragElement(e);const s=Yt._dragElements.get(this._id);s.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:s.startEvent&&s.startEvent.evt||e&&e.evt},n)}_setDragPosition(e,n){const s=this.getStage()._getPointerById(n.pointerId);if(!s)return;let i={x:s.x-n.offset.x,y:s.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const d=o.call(this,i,e);d?i=d:ee.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Yt._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Yt._endDragBefore(e),Yt._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Yt._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Me.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Yt._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Yt._dragElements.get(this._id),s=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";s?this.stopDrag():i&&Yt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const s={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return ee.haveIntersection(s,this.getClientRect())}static create(e,n){return ee._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let s=Ae.prototype.getClassName.call(e),i=e.children,o,d,f;n&&(e.attrs.container=n),Me[s]||(ee.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const m=Me[s];if(o=new m(e.attrs),i)for(d=i.length,f=0;f<d;f++)o.add(Ae._createNode(i[f]));return o}}Ae.protoListenerMap=new Map;Ae.prototype.nodeType="Node";Ae.prototype._attrsAffectingSize=[];Ae.prototype.eventListeners={};Ae.prototype.on(hz,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(gu),this._clearSelfAndDescendantCache(so)});Ae.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(wb)});Ae.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(jb)});Ae.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(g1)});const gn=X.addGetterSetter;gn(Ae,"zIndex");gn(Ae,"absolutePosition");gn(Ae,"position");gn(Ae,"x",0,Te());gn(Ae,"y",0,Te());gn(Ae,"globalCompositeOperation","source-over",rd());gn(Ae,"opacity",1,Te());gn(Ae,"name","",rd());gn(Ae,"id","",rd());gn(Ae,"rotation",0,Te());X.addComponentsGetterSetter(Ae,"scale",["x","y"]);gn(Ae,"scaleX",1,Te());gn(Ae,"scaleY",1,Te());X.addComponentsGetterSetter(Ae,"skew",["x","y"]);gn(Ae,"skewX",0,Te());gn(Ae,"skewY",0,Te());X.addComponentsGetterSetter(Ae,"offset",["x","y"]);gn(Ae,"offsetX",0,Te());gn(Ae,"offsetY",0,Te());gn(Ae,"dragDistance",void 0,Te());gn(Ae,"width",0,Te());gn(Ae,"height",0,Te());gn(Ae,"listening",!0,Mi());gn(Ae,"preventDefault",!0,Mi());gn(Ae,"filters",void 0,function(t){return this._filterUpToDate=!1,t});gn(Ae,"visible",!0,Mi());gn(Ae,"transformsEnabled","all",rd());gn(Ae,"size");gn(Ae,"dragBoundFunc");gn(Ae,"draggable",!1,Mi());X.backCompat(Ae,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Er extends Ae{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let s=0;s<e.length;s++)this.add(e[s]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const s=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&s.push(i),!!(o&&n)}),s}_descendants(e){let n=!1;const s=this.getChildren();for(const i of s){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=Ae.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=Ae.prototype.clone.call(this,e);return this.getChildren().forEach(function(s){n.add(s.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(e)&&n.push(s)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(s){s._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,s){n.index=s}),this._requestDraw()}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas(),d=o&&o.getContext(),f=this._getCanvasCache(),m=f&&f.scene,y=o&&o.isCache;if(!this.isVisible()&&!y)return this;if(m){d.save();const v=this.getAbsoluteTransform(n).getMatrix();d.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(d),d.restore()}else this._drawChildren("drawScene",o,n,s);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const s=this.getLayer(),i=e||s&&s.hitCanvas,o=i&&i.getContext(),d=this._getCanvasCache();if(d&&d.hit){o.save();const m=this.getAbsoluteTransform(n).getMatrix();o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,s,i){var o;const d=n&&n.getContext(),f=this.clipWidth(),m=this.clipHeight(),y=this.clipFunc(),v=typeof f=="number"&&typeof m=="number"||y,b=s===this;if(v){d.save();const j=this.getAbsoluteTransform(s);let w=j.getMatrix();d.transform(w[0],w[1],w[2],w[3],w[4],w[5]),d.beginPath();let O;if(y)O=y.call(this,d,this);else{const R=this.clipX(),T=this.clipY();d.rect(R||0,T||0,f,m)}d.clip.apply(d,O),w=j.copy().invert().getMatrix(),d.transform(w[0],w[1],w[2],w[3],w[4],w[5])}const _=!b&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";_&&(d.save(),d._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(j){j[e](n,s,i)}),_&&d.restore(),v&&d.restore()}getClientRect(e={}){var n;const s=e.skipTransform,i=e.relativeTo;let o,d,f,m,y={x:1/0,y:1/0,width:0,height:0};const v=this;(n=this.children)===null||n===void 0||n.forEach(function(j){if(!j.visible())return;const w=j.getClientRect({relativeTo:v,skipShadow:e.skipShadow,skipStroke:e.skipStroke});w.width===0&&w.height===0||(o===void 0?(o=w.x,d=w.y,f=w.x+w.width,m=w.y+w.height):(o=Math.min(o,w.x),d=Math.min(d,w.y),f=Math.max(f,w.x+w.width),m=Math.max(m,w.y+w.height)))});const b=this.find("Shape");let _=!1;for(let j=0;j<b.length;j++)if(b[j]._isVisible(this)){_=!0;break}return _&&o!==void 0?y={x:o,y:d,width:f-o,height:m-d}:y={x:0,y:0,width:0,height:0},s?y:this._transformedRect(y,i)}}X.addComponentsGetterSetter(Er,"clip",["x","y","width","height"]);X.addGetterSetter(Er,"clipX",void 0,Te());X.addGetterSetter(Er,"clipY",void 0,Te());X.addGetterSetter(Er,"clipWidth",void 0,Te());X.addGetterSetter(Er,"clipHeight",void 0,Te());X.addGetterSetter(Er,"clipFunc");const zm=new Map,b8=Me._global.PointerEvent!==void 0;function bx(t){return zm.get(t)}function Rv(t){return{evt:t,pointerId:t.pointerId}}function v8(t,e){return zm.get(t)===e}function S8(t,e){bm(t),e.getStage()&&(zm.set(t,e),b8&&e._fire("gotpointercapture",Rv(new PointerEvent("gotpointercapture"))))}function bm(t,e){const n=zm.get(t);if(!n)return;const s=n.getStage();s&&s.content,zm.delete(t),b8&&n._fire("lostpointercapture",Rv(new PointerEvent("lostpointercapture")))}const mz="Stage",gz="string",j5="px",yz="mouseout",N8="mouseleave",_8="mouseover",C8="mouseenter",j8="mousemove",w8="mousedown",E8="mouseup",um="pointermove",cm="pointerdown",Df="pointerup",dm="pointercancel",xz="lostpointercapture",n1="pointerout",fm="pointerleave",a1="pointerover",s1="pointerenter",Eb="contextmenu",T8="touchstart",R8="touchend",O8="touchmove",A8="touchcancel",Tb="wheel",bz=5,vz=[[C8,"_pointerenter"],[w8,"_pointerdown"],[j8,"_pointermove"],[E8,"_pointerup"],[N8,"_pointerleave"],[T8,"_pointerdown"],[O8,"_pointermove"],[R8,"_pointerup"],[A8,"_pointercancel"],[_8,"_pointerover"],[Tb,"_wheel"],[Eb,"_contextmenu"],[cm,"_pointerdown"],[um,"_pointermove"],[Df,"_pointerup"],[dm,"_pointercancel"],[fm,"_pointerleave"],[xz,"_lostpointercapture"]],vx={mouse:{[n1]:yz,[fm]:N8,[a1]:_8,[s1]:C8,[um]:j8,[cm]:w8,[Df]:E8,[dm]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[n1]:"touchout",[fm]:"touchleave",[a1]:"touchover",[s1]:"touchenter",[um]:O8,[cm]:T8,[Df]:R8,[dm]:A8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[n1]:n1,[fm]:fm,[a1]:a1,[s1]:s1,[um]:um,[cm]:cm,[Df]:Df,[dm]:dm,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},hm=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Ef=t=>{const e=hm(t);if(e==="pointer")return Me.pointerEventsEnabled&&vx.pointer;if(e==="touch")return vx.touch;if(e==="mouse")return vx.mouse};function w5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&ee.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const Sz="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",vm=[];let ny=class extends Er{constructor(e){super(w5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),vm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{w5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",s=e.getType()==="FastLayer";n||s||ee.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===gz){let n;if(e.charAt(0)==="."){const s=e.slice(1);e=document.getElementsByClassName(s)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let s=0;s<n;s++)e[s].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),Er.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&ee._isInDocument(e)&&this.container().removeChild(e);const n=vm.indexOf(this);return n>-1&&vm.splice(n,1),ee.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(ee.warn(Sz),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new xu({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),s=n.getContext()._context,i=this.children;return(e.x||e.y)&&s.translate(-1*e.x,-1*e.y),i.forEach(function(o){if(!o.isVisible())return;const d=o._toKonvaCanvas(e);s.drawImage(d._canvas,e.x,e.y,d.getWidth()/d.getPixelRatio(),d.getHeight()/d.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,s=n.length,i=s-1;for(let o=i;o>=0;o--){const d=n[o].getIntersection(e);if(d)return d}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+j5,this.content.style.height=n+j5),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(s=>{s.setSize({width:e,height:n}),s.draw()})}add(e,...n){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const s=this.children.length;return s>bz&&ee.warn("The stage has "+s+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Me.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return v8(e,this)}setPointerCapture(e){S8(e,this)}releaseCapture(e){bm(e)}getLayers(){return this.children}_bindContentEvents(){Me.isBrowser&&vz.forEach(([e,n])=>{this.content.addEventListener(e,s=>{this[n](s)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Ef(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(s),o=!(Me.isDragging()||Me.isTransforming())||Me.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:e}),i._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[s+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Ef(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(o=>{const d=this.getIntersection(o);if(Yt.justDragged=!1,Me["_"+s+"ListenClick"]=!0,!d||!d.isListening()){this[s+"ClickStartShape"]=void 0;return}Me.capturePointerEventsEnabled&&d.setPointerCapture(o.id),this[s+"ClickStartShape"]=d,d._fireAndBubble(n.pointerdown,{evt:e,pointerId:o.id}),i=!0;const f=e.type.indexOf("touch")>=0;d.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),i||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Ef(e.type),s=hm(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(Me.isDragging()&&Yt.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(Me.isDragging()||Me.isTransforming())||Me.hitOnDragEnabled))return;const d={};let f=!1;const m=this._getTargetShape(s);this._changedPointerPositions.forEach(y=>{const v=bx(y.id)||this.getIntersection(y),b=y.id,_={evt:e,pointerId:b},j=m!==v;if(j&&m&&(m._fireAndBubble(n.pointerout,{..._},v),m._fireAndBubble(n.pointerleave,{..._},v)),v){if(d[v._id])return;d[v._id]=!0}v&&v.isListening()?(f=!0,j&&(v._fireAndBubble(n.pointerover,{..._},m),v._fireAndBubble(n.pointerenter,{..._},m),this[s+"targetShape"]=v),v._fireAndBubble(n.pointermove,{..._})):m&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:b}),this[s+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Ef(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);const i=this[s+"ClickStartShape"],o=this[s+"ClickEndShape"],d={};let f=!1;this._changedPointerPositions.forEach(m=>{const y=bx(m.id)||this.getIntersection(m);if(y){if(y.releaseCapture(m.id),d[y._id])return;d[y._id]=!0}const v=m.id,b={evt:e,pointerId:v};let _=!1;Me["_"+s+"InDblClickWindow"]?(_=!0,clearTimeout(this[s+"DblTimeout"])):Yt.justDragged||(Me["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){Me["_"+s+"InDblClickWindow"]=!1},Me.dblClickWindow),y&&y.isListening()?(f=!0,this[s+"ClickEndShape"]=y,y._fireAndBubble(n.pointerup,{...b}),Me["_"+s+"ListenClick"]&&i&&i===y&&(y._fireAndBubble(n.pointerclick,{...b}),_&&o&&o===y&&y._fireAndBubble(n.pointerdblclick,{...b}))):(this[s+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),Me["_"+s+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:v}),_&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:v}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Me["_"+s+"ListenClick"]=!1,e.cancelable&&s!=="touch"&&s!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Eb,{evt:e}):this._fire(Eb,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Tb,{evt:e}):this._fire(Tb,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=bx(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Df,Rv(e)),bm(e.pointerId)}_lostpointercapture(e){bm(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let s=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(s=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:s,y:i},this._pointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}],this._changedPointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}])}_setPointerPosition(e){ee.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new xu({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Ev({pixelRatio:1,width:this.width(),height:this.height()}),!Me.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return ee.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};ny.prototype.nodeType=mz;Wn(ny);X.addGetterSetter(ny,"container");Me.isBrowser&&document.addEventListener("visibilitychange",()=>{vm.forEach(t=>{t.batchDraw()})});const M8="hasShadow",D8="shadowRGBA",z8="patternImage",k8="linearGradient",L8="radialGradient";let r1;function Sx(){return r1||(r1=ee.createCanvasElement().getContext("2d"),r1)}const Sm={};function Nz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function _z(t){t.stroke()}function Cz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function jz(t){t.stroke()}function wz(){this._clearCache(M8)}function Ez(){this._clearCache(D8)}function Tz(){this._clearCache(z8)}function Rz(){this._clearCache(k8)}function Oz(){this._clearCache(L8)}class we extends Ae{constructor(e){super(e);let n,s=0;for(;n=ee.getHitColor(),!(n&&!(n in Sm));)if(s++,s>=1e4){ee.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=ee.getRandomColor();break}this.colorKey=n,Sm[n]=this}getContext(){return ee.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return ee.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(M8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(z8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Sx().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new wr;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(Me.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=s.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(k8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Sx(),s=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(s.x,s.y,i.x,i.y);for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}_getRadialGradient(){return this._getCache(L8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Sx(),s=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),o=n.createRadialGradient(s.x,s.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}getShadowRGBA(){return this._getCache(D8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=ee.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const s=n.bufferHitCanvas;return s.getContext().clear(),this.drawHit(s,void 0,!0),s.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return Ae.prototype.destroy.call(this),delete Sm[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=e||this.hasFill(),o=this.hasStroke(),d=this.getAbsoluteOpacity()!==1;if(i&&o&&d)return!0;const f=this.hasShadow(),m=this.shadowForStrokeEnabled();return!!(i&&o&&f&&m)}setStrokeHitEnabled(e){ee.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,s=this.getParent();for(;s;){if(s.isCached()){n=!0;break}s=s.getParent()}const i=e.skipTransform,o=e.relativeTo||n&&this.getStage()||void 0,d=this.getSelfRect(),m=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,y=d.width+m,v=d.height+m,b=!e.skipShadow&&this.hasShadow(),_=b?this.shadowOffsetX():0,j=b?this.shadowOffsetY():0,w=y+Math.abs(_),O=v+Math.abs(j),R=b&&this.shadowBlur()||0,T=w+R*2,A=O+R*2,z={width:T,height:A,x:-(m/2+R)+Math.min(_,0)+d.x,y:-(m/2+R)+Math.min(j,0)+d.y};return i?z:this._transformedRect(z,o)}drawScene(e,n,s){const i=this.getLayer(),o=e||i.getCanvas(),d=o.getContext(),f=this._getCanvasCache(),m=this.getSceneFunc(),y=this.hasShadow();let v;const b=n===this;if(!this.isVisible()&&!b)return this;if(f){d.save();const _=this.getAbsoluteTransform(n).getMatrix();return d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(d),d.restore(),this}if(!m)return this;if(d.save(),this._useBufferCanvas()){v=this.getStage();const _=s||v.bufferCanvas,j=_.getContext();s?(j.save(),j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,_.width,_.height),j.restore()):j.clear(),j.save(),j._applyLineJoin(this),j._applyMiterLimit(this);const w=this.getAbsoluteTransform(n).getMatrix();j.transform(w[0],w[1],w[2],w[3],w[4],w[5]),m.call(this,j,this),j.restore();const O=_.pixelRatio;y&&d._applyShadow(this),b||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(_._canvas,_.x||0,_.y||0,_.width/O,_.height/O)}else{if(d._applyLineJoin(this),d._applyMiterLimit(this),!b){const _=this.getAbsoluteTransform(n).getMatrix();d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),d._applyOpacity(this),d._applyGlobalCompositeOperation(this)}y&&d._applyShadow(this),m.call(this,d,this)}return d.restore(),this}drawHit(e,n,s=!1){if(!this.shouldDrawHit(n,s))return this;const i=this.getLayer(),o=e||i.hitCanvas,d=o&&o.getContext(),f=this.hitFunc()||this.sceneFunc(),m=this._getCanvasCache(),y=m&&m.hit;if(this.colorKey||ee.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),y){d.save();const b=this.getAbsoluteTransform(n).getMatrix();return d.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedHitCanvas(d),d.restore(),this}if(!f)return this;if(d.save(),d._applyLineJoin(this),d._applyMiterLimit(this),!(this===n)){const b=this.getAbsoluteTransform(n).getMatrix();d.transform(b[0],b[1],b[2],b[3],b[4],b[5])}return f.call(this,d,this),d.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),s=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),d=i.getWidth(),f=i.getHeight();o.clear(),o.drawImage(s._canvas,0,0,d,f);try{const m=o.getImageData(0,0,d,f),y=m.data,v=y.length,b=ee._hexToRgb(this.colorKey);for(let _=0;_<v;_+=4)y[_+3]>e?(y[_]=b.r,y[_+1]=b.g,y[_+2]=b.b,y[_+3]=255):y[_+3]=0;o.putImageData(m,0,0)}catch(m){ee.error("Unable to draw hit graph from cached scene canvas. "+m.message)}return this}hasPointerCapture(e){return v8(e,this)}setPointerCapture(e){S8(e,this)}releaseCapture(e){bm(e)}}we.prototype._fillFunc=Nz;we.prototype._strokeFunc=_z;we.prototype._fillFuncHit=Cz;we.prototype._strokeFuncHit=jz;we.prototype._centroid=!1;we.prototype.nodeType="Shape";Wn(we);we.prototype.eventListeners={};we.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",wz);we.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Ez);we.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Tz);we.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Rz);we.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",Oz);X.addGetterSetter(we,"stroke",void 0,x8());X.addGetterSetter(we,"strokeWidth",2,Te());X.addGetterSetter(we,"fillAfterStrokeEnabled",!1);X.addGetterSetter(we,"hitStrokeWidth","auto",Tv());X.addGetterSetter(we,"strokeHitEnabled",!0,Mi());X.addGetterSetter(we,"perfectDrawEnabled",!0,Mi());X.addGetterSetter(we,"shadowForStrokeEnabled",!0,Mi());X.addGetterSetter(we,"lineJoin");X.addGetterSetter(we,"lineCap");X.addGetterSetter(we,"miterLimit");X.addGetterSetter(we,"sceneFunc");X.addGetterSetter(we,"hitFunc");X.addGetterSetter(we,"dash");X.addGetterSetter(we,"dashOffset",0,Te());X.addGetterSetter(we,"shadowColor",void 0,rd());X.addGetterSetter(we,"shadowBlur",0,Te());X.addGetterSetter(we,"shadowOpacity",1,Te());X.addComponentsGetterSetter(we,"shadowOffset",["x","y"]);X.addGetterSetter(we,"shadowOffsetX",0,Te());X.addGetterSetter(we,"shadowOffsetY",0,Te());X.addGetterSetter(we,"fillPatternImage");X.addGetterSetter(we,"fill",void 0,x8());X.addGetterSetter(we,"fillPatternX",0,Te());X.addGetterSetter(we,"fillPatternY",0,Te());X.addGetterSetter(we,"fillLinearGradientColorStops");X.addGetterSetter(we,"strokeLinearGradientColorStops");X.addGetterSetter(we,"fillRadialGradientStartRadius",0);X.addGetterSetter(we,"fillRadialGradientEndRadius",0);X.addGetterSetter(we,"fillRadialGradientColorStops");X.addGetterSetter(we,"fillPatternRepeat","repeat");X.addGetterSetter(we,"fillEnabled",!0);X.addGetterSetter(we,"strokeEnabled",!0);X.addGetterSetter(we,"shadowEnabled",!0);X.addGetterSetter(we,"dashEnabled",!0);X.addGetterSetter(we,"strokeScaleEnabled",!0);X.addGetterSetter(we,"fillPriority","color");X.addComponentsGetterSetter(we,"fillPatternOffset",["x","y"]);X.addGetterSetter(we,"fillPatternOffsetX",0,Te());X.addGetterSetter(we,"fillPatternOffsetY",0,Te());X.addComponentsGetterSetter(we,"fillPatternScale",["x","y"]);X.addGetterSetter(we,"fillPatternScaleX",1,Te());X.addGetterSetter(we,"fillPatternScaleY",1,Te());X.addComponentsGetterSetter(we,"fillLinearGradientStartPoint",["x","y"]);X.addComponentsGetterSetter(we,"strokeLinearGradientStartPoint",["x","y"]);X.addGetterSetter(we,"fillLinearGradientStartPointX",0);X.addGetterSetter(we,"strokeLinearGradientStartPointX",0);X.addGetterSetter(we,"fillLinearGradientStartPointY",0);X.addGetterSetter(we,"strokeLinearGradientStartPointY",0);X.addComponentsGetterSetter(we,"fillLinearGradientEndPoint",["x","y"]);X.addComponentsGetterSetter(we,"strokeLinearGradientEndPoint",["x","y"]);X.addGetterSetter(we,"fillLinearGradientEndPointX",0);X.addGetterSetter(we,"strokeLinearGradientEndPointX",0);X.addGetterSetter(we,"fillLinearGradientEndPointY",0);X.addGetterSetter(we,"strokeLinearGradientEndPointY",0);X.addComponentsGetterSetter(we,"fillRadialGradientStartPoint",["x","y"]);X.addGetterSetter(we,"fillRadialGradientStartPointX",0);X.addGetterSetter(we,"fillRadialGradientStartPointY",0);X.addComponentsGetterSetter(we,"fillRadialGradientEndPoint",["x","y"]);X.addGetterSetter(we,"fillRadialGradientEndPointX",0);X.addGetterSetter(we,"fillRadialGradientEndPointY",0);X.addGetterSetter(we,"fillPatternRotation",0);X.addGetterSetter(we,"fillRule",void 0,rd());X.backCompat(we,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const Az="beforeDraw",Mz="draw",U8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Dz=U8.length;let id=class extends Er{constructor(e){super(e),this.canvas=new xu,this.hitCanvas=new Ev({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ae.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Ae.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ae.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ae.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Ae.prototype.remove.call(this),e&&e.parentNode&&ee._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Ae.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){ee.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ee.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ee.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,s=!1;for(;;){for(let i=0;i<Dz;i++){const o=U8[i],d=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),f=d.shape;if(f)return f;if(s=!!d.antialiased,!d.antialiased)break}if(s)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,s=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=s[3];if(i===255){const o=ee.getHitColorKey(s[0],s[1],s[2]),d=Sm[o];return d?{shape:d}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas();return this._fire(Az,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),Er.prototype.drawScene.call(this,o,n,s),this._fire(Mz,{node:this}),this}drawHit(e,n){const s=this.getLayer(),i=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Er.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return ee.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};id.prototype.nodeType="Layer";Wn(id);X.addGetterSetter(id,"imageSmoothingEnabled",!0);X.addGetterSetter(id,"clearBeforeDraw",!0);X.addGetterSetter(id,"hitGraphEnabled",!0,Mi());class Ov extends id{constructor(e){super(e),this.listening(!1),ee.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Ov.prototype.nodeType="FastLayer";Wn(Ov);let ah=class extends Er{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to groups.")}};ah.prototype.nodeType="Group";Wn(ah);const Nx=(function(){return Hc.performance&&Hc.performance.now?function(){return Hc.performance.now()}:function(){return new Date().getTime()}})();class ii{constructor(e,n){this.id=ii.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Nx(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,s=n.length;for(let i=0;i<s;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=ii.animations,s=n.length;for(let i=0;i<s;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Nx(),ii._addAnimation(this),this}stop(){return ii._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,s=this.animations,i=s.length;for(let o=0;o<i;o++)if(s[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let s=0;s<n.length;s++){const i=n[s],o=i.layers,d=i.func;i._updateFrameObject(Nx());const f=o.length;let m;if(d?m=d.call(i,i.frame)!==!1:m=!0,!!m)for(let y=0;y<f;y++){const v=o[y];v._id!==void 0&&(e[v._id]=v)}}for(const s in e)e.hasOwnProperty(s)&&e[s].batchDraw()}static _animationLoop(){const e=ii;e.animations.length?(e._runFrames(),ee.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,ee.requestAnimFrame(this._animationLoop))}}ii.animations=[];ii.animIdCounter=0;ii.animRunning=!1;const zz={node:1,duration:1,easing:1,onFinish:1,yoyo:1},kz=1,E5=2,T5=3,R5=["fill","stroke","shadowColor"];let Lz=0;class Uz{constructor(e,n,s,i,o,d,f){this.prop=e,this.propFunc=n,this.begin=i,this._pos=i,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=f,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=s,this._change=o-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=E5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=T5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===E5?this.setTime(e):this.state===T5&&this.setTime(this.duration-e)}pause(){this.state=kz,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _n{constructor(e){const n=this,s=e.node,i=s._id,o=e.easing||Nm.Linear,d=!!e.yoyo;let f,m;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=s,this._id=Lz++;const y=s.getLayer()||(s instanceof Me.Stage?s.getLayers():null);y||ee.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ii(function(){n.tween.onEnterFrame()},y),this.tween=new Uz(m,function(v){n._tweenFunc(v)},o,0,1,f*1e3,d),this._addListeners(),_n.attrs[i]||(_n.attrs[i]={}),_n.attrs[i][this._id]||(_n.attrs[i][this._id]={}),_n.tweens[i]||(_n.tweens[i]={});for(m in e)zz[m]===void 0&&this._addAttr(m,e[m]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const s=this.node,i=s._id;let o,d,f,m,y;const v=_n.tweens[i][e];v&&delete _n.attrs[i][v][e];let b=s.getAttr(e);if(ee._isArray(n))if(o=[],d=Math.max(n.length,b.length),e==="points"&&n.length!==b.length&&(n.length>b.length?(m=b,b=ee._prepareArrayForTween(b,n,s.closed())):(f=n,n=ee._prepareArrayForTween(n,b,s.closed()))),e.indexOf("fill")===0)for(let _=0;_<d;_++)if(_%2===0)o.push(n[_]-b[_]);else{const j=ee.colorToRGBA(b[_]);y=ee.colorToRGBA(n[_]),b[_]=j,o.push({r:y.r-j.r,g:y.g-j.g,b:y.b-j.b,a:y.a-j.a})}else for(let _=0;_<d;_++)o.push(n[_]-b[_]);else R5.indexOf(e)!==-1?(b=ee.colorToRGBA(b),y=ee.colorToRGBA(n),o={r:y.r-b.r,g:y.g-b.g,b:y.b-b.b,a:y.a-b.a}):o=n-b;_n.attrs[i][this._id][e]={start:b,diff:o,end:n,trueEnd:f,trueStart:m},_n.tweens[i][e]=this._id}_tweenFunc(e){const n=this.node,s=_n.attrs[n._id][this._id];let i,o,d,f,m,y,v,b;for(i in s){if(o=s[i],d=o.start,f=o.diff,b=o.end,ee._isArray(d))if(m=[],v=Math.max(d.length,b.length),i.indexOf("fill")===0)for(y=0;y<v;y++)y%2===0?m.push((d[y]||0)+f[y]*e):m.push("rgba("+Math.round(d[y].r+f[y].r*e)+","+Math.round(d[y].g+f[y].g*e)+","+Math.round(d[y].b+f[y].b*e)+","+(d[y].a+f[y].a*e)+")");else for(y=0;y<v;y++)m.push((d[y]||0)+f[y]*e);else R5.indexOf(i)!==-1?m="rgba("+Math.round(d.r+f.r*e)+","+Math.round(d.g+f.g*e)+","+Math.round(d.b+f.b*e)+","+(d.a+f.a*e)+")":m=d+f*e;n.setAttr(i,m)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,s=_n.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in s)delete _n.tweens[e][i];delete _n.attrs[e][n],_n.tweens[e]&&(Object.keys(_n.tweens[e]).length===0&&delete _n.tweens[e],Object.keys(_n.attrs[e]).length===0&&delete _n.attrs[e])}}_n.attrs={};_n.tweens={};Ae.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new _n(t).play()};const Nm={BackEaseIn(t,e,n,s){return n*(t/=s)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,n,s){return n*((t=t/s-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,n,s){let i=1.70158;return(t/=s/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e)},ElasticEaseOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*s-d)*(2*Math.PI)/o)+n+e)},ElasticEaseInOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s/2)===2?e+n:(o||(o=s*(.3*1.5)),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o)*.5+n+e)},BounceEaseOut(t,e,n,s){return(t/=s)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,n,s){return n-Nm.BounceEaseOut(s-t,0,n,s)+e},BounceEaseInOut(t,e,n,s){return t<s/2?Nm.BounceEaseIn(t*2,0,n,s)*.5+e:Nm.BounceEaseOut(t*2-s,0,n,s)*.5+n*.5+e},EaseIn(t,e,n,s){return n*(t/=s)*t+e},EaseOut(t,e,n,s){return-n*(t/=s)*(t-2)+e},EaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,n,s){return n*(t/=s)*t*t*t*t+e},StrongEaseOut(t,e,n,s){return n*((t=t/s-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,n,s){return n*t/s+e}},sh=ee._assign(Me,{Util:ee,Transform:wr,Node:Ae,Container:Er,Stage:ny,stages:vm,Layer:id,FastLayer:Ov,Group:ah,DD:Yt,Shape:we,shapes:Sm,Animation:ii,Tween:_n,Easings:Nm,Context:ey,Canvas:wv});class mo extends we{_sceneFunc(e){const n=Me.getAngle(this.angle()),s=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,s),e.arc(0,0,this.innerRadius(),n,0,!s),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),s=this.clockwise(),i=Me.getAngle(s?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),d=1,f=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),m=Math.sin(Math.min(i,Math.PI/2)),y=o*(o>0?e:n),v=d*n,b=f*(f>0?e:n),_=m*(m>0?n:e);return{x:y,y:s?-1*_:b,width:v-y,height:_-b}}}mo.prototype._centroid=!0;mo.prototype.className="Arc";mo.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Wn(mo);X.addGetterSetter(mo,"innerRadius",0,Te());X.addGetterSetter(mo,"outerRadius",0,Te());X.addGetterSetter(mo,"angle",0,Te());X.addGetterSetter(mo,"clockwise",!1,Mi());function Rb(t,e,n,s,i,o,d){const f=Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2)),m=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-s,2)),y=d*f/(f+m),v=d*m/(f+m),b=n-y*(i-t),_=s-y*(o-e),j=n+v*(i-t),w=s+v*(o-e);return[b,_,j,w]}function O5(t,e){const n=t.length,s=[];for(let i=2;i<n-2;i+=2){const o=Rb(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(s.push(o[0]),s.push(o[1]),s.push(t[i]),s.push(t[i+1]),s.push(o[2]),s.push(o[3]))}return s}function Hz(t){const e=[[t[0],t[2],t[4],t[6]],[t[1],t[3],t[5],t[7]]],n=[];for(const s of e){const i=-3*s[0]+9*s[1]-9*s[2]+3*s[3];if(i!==0){const o=6*s[0]-12*s[1]+6*s[2],d=-3*s[0]+3*s[1],f=o*o-4*i*d;if(f>=0){const m=Math.sqrt(f);n.push((-o+m)/(2*i)),n.push((-o-m)/(2*i))}}}return n.filter(s=>s>0&&s<1).flatMap(s=>e.map(i=>{const o=1-s;return o*o*o*i[0]+3*o*o*s*i[1]+3*o*s*s*i[2]+s*s*s*i[3]}))}let go=class extends we{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),s=n.length,i=this.tension(),o=this.closed(),d=this.bezier();if(!s)return;let f=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&s>4){const m=this.getTensionPoints(),y=m.length;for(f=o?0:4,o||e.quadraticCurveTo(m[0],m[1],m[2],m[3]);f<y-2;)e.bezierCurveTo(m[f++],m[f++],m[f++],m[f++],m[f++],m[f++]);o||e.quadraticCurveTo(m[y-2],m[y-1],n[s-2],n[s-1])}else if(d)for(f=2;f<s;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<s;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():O5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,s=this.tension(),i=Rb(e[n-2],e[n-1],e[0],e[1],e[2],e[3],s),o=Rb(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],s),d=O5(e,s);return[i[2],i[3]].concat(d).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],...Hz(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let m=0;m<e.length/2;m++)d=e[m*2],f=e[m*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);return{x:n,y:i,width:s-n,height:o-i}}};go.prototype.className="Line";go.prototype._attrsAffectingSize=["points","bezier","tension"];Wn(go);X.addGetterSetter(go,"closed",!1);X.addGetterSetter(go,"bezier",!1);X.addGetterSetter(go,"tension",0,Te());X.addGetterSetter(go,"points",[],ez());const qz=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Bz=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Gz=[[1],[1,1],[1,2,1],[1,3,3,1]],A5=(t,e,n)=>{let s,i;const d=n/2;s=0;for(let f=0;f<20;f++)i=d*qz[20][f]+d,s+=Bz[20][f]*Pz(t,e,i);return d*s},M5=(t,e,n)=>{n===void 0&&(n=1);const s=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],d=2*e[1]-2*e[0],f=4*(s*s+i*i),m=4*(s*o+i*d),y=o*o+d*d;if(f===0)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const v=m/(2*f),b=y/f,_=n+v,j=b-v*v,w=_*_+j>0?Math.sqrt(_*_+j):0,O=v*v+j>0?Math.sqrt(v*v+j):0,R=v+Math.sqrt(v*v+j)!==0?j*Math.log(Math.abs((_+w)/(v+O))):0;return Math.sqrt(f)/2*(_*w-v*O+R)};function Pz(t,e,n){const s=Ob(1,n,t),i=Ob(1,n,e),o=s*s+i*i;return Math.sqrt(o)}const Ob=(t,e,n)=>{const s=n.length-1;let i,o;if(s===0)return 0;if(t===0){o=0;for(let d=0;d<=s;d++)o+=Gz[s][d]*Math.pow(1-e,s-d)*Math.pow(e,d)*n[d];return o}else{i=new Array(s);for(let d=0;d<s;d++)i[d]=s*(n[d+1]-n[d]);return Ob(t-1,e,i)}},D5=(t,e,n)=>{let s=1,i=t/e,o=(t-n(i))/e,d=0;for(;s>.001;){const f=n(i+o),m=Math.abs(t-f)/e;if(m<s)s=m,i+=o;else{const y=n(i-o),v=Math.abs(t-y)/e;v<s?(s=v,i-=o):o/=2}if(d++,d>500)break}return i};class Cn extends we{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Cn.parsePathData(this.data()),this.pathLength=Cn.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let s=!1;for(let i=0;i<n.length;i++){const o=n[i].command,d=n[i].points;switch(o){case"L":e.lineTo(d[0],d[1]);break;case"M":e.moveTo(d[0],d[1]);break;case"C":e.bezierCurveTo(d[0],d[1],d[2],d[3],d[4],d[5]);break;case"Q":e.quadraticCurveTo(d[0],d[1],d[2],d[3]);break;case"A":const f=d[0],m=d[1],y=d[2],v=d[3],b=d[4],_=d[5],j=d[6],w=d[7],O=y>v?y:v,R=y>v?1:y/v,T=y>v?v/y:1;e.translate(f,m),e.rotate(j),e.scale(R,T),e.arc(0,0,O,b,b+_,1-w),e.scale(1/R,1/T),e.rotate(-j),e.translate(-f,-m);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(m){if(m.command==="A"){const y=m.points[4],v=m.points[5],b=m.points[4]+v;let _=Math.PI/180;if(Math.abs(y-b)<_&&(_=Math.abs(y-b)),v<0)for(let j=y-_;j>b;j-=_){const w=Cn.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],j,0);e.push(w.x,w.y)}else for(let j=y+_;j<b;j+=_){const w=Cn.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],j,0);e.push(w.x,w.y)}}else if(m.command==="C")for(let y=0;y<=1;y+=.01){const v=Cn.getPointOnCubicBezier(y,m.start.x,m.start.y,m.points[0],m.points[1],m.points[2],m.points[3],m.points[4],m.points[5]);e.push(v.x,v.y)}else e=e.concat(m.points)});let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let m=0;m<e.length/2;m++)d=e[m*2],f=e[m*2+1],isNaN(d)||(n=Math.min(n,d),s=Math.max(s,d)),isNaN(f)||(i=Math.min(i,f),o=Math.max(o,f));return{x:n,y:i,width:s-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return Cn.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,s,i){return Math.sqrt((s-e)*(s-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let s=0;s<e.length;++s)n+=e[s].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let s,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return s=n[i-1].points.slice(-2),{x:s[0],y:s[1]};if(e<.01)return n[i].command==="M"?(s=n[i].points.slice(0,2),{x:s[0],y:s[1]}):{x:n[i].start.x,y:n[i].start.y};const d=n[i],f=d.points;switch(d.command){case"L":return Cn.getPointOnLine(e,d.start.x,d.start.y,f[0],f[1]);case"C":return Cn.getPointOnCubicBezier(D5(e,Cn.getPathLength(n),O=>A5([d.start.x,f[0],f[2],f[4]],[d.start.y,f[1],f[3],f[5]],O)),d.start.x,d.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return Cn.getPointOnQuadraticBezier(D5(e,Cn.getPathLength(n),O=>M5([d.start.x,f[0],f[2]],[d.start.y,f[1],f[3]],O)),d.start.x,d.start.y,f[0],f[1],f[2],f[3]);case"A":const m=f[0],y=f[1],v=f[2],b=f[3],_=f[5],j=f[6];let w=f[4];return w+=_*e/d.pathLength,Cn.getPointOnEllipticalArc(m,y,v,b,w,j)}return null}static getPointOnLine(e,n,s,i,o,d,f){d=d??n,f=f??s;const m=this.getLineLength(n,s,i,o);if(m<1e-10)return{x:n,y:s};if(i===n)return{x:d,y:f+(o>s?e:-e)};const y=(o-s)/(i-n),v=Math.sqrt(e*e/(1+y*y))*(i<n?-1:1),b=y*v;if(Math.abs(f-s-y*(d-n))<1e-10)return{x:d+v,y:f+b};const _=((d-n)*(i-n)+(f-s)*(o-s))/(m*m),j=n+_*(i-n),w=s+_*(o-s),O=this.getLineLength(d,f,j,w),R=Math.sqrt(e*e-O*O),T=Math.sqrt(R*R/(1+y*y))*(i<n?-1:1),A=y*T;return{x:j+T,y:w+A}}static getPointOnCubicBezier(e,n,s,i,o,d,f,m,y){function v(R){return R*R*R}function b(R){return 3*R*R*(1-R)}function _(R){return 3*R*(1-R)*(1-R)}function j(R){return(1-R)*(1-R)*(1-R)}const w=m*v(e)+d*b(e)+i*_(e)+n*j(e),O=y*v(e)+f*b(e)+o*_(e)+s*j(e);return{x:w,y:O}}static getPointOnQuadraticBezier(e,n,s,i,o,d,f){function m(j){return j*j}function y(j){return 2*j*(1-j)}function v(j){return(1-j)*(1-j)}const b=d*m(e)+i*y(e)+n*v(e),_=f*m(e)+o*y(e)+s*v(e);return{x:b,y:_}}static getPointOnEllipticalArc(e,n,s,i,o,d){const f=Math.cos(d),m=Math.sin(d),y={x:s*Math.cos(o),y:i*Math.sin(o)};return{x:e+(y.x*f-y.y*m),y:n+(y.x*m+y.y*f)}}static parsePathData(e){if(!e)return[];let n=e;const s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let b=0;b<s.length;b++)n=n.replace(new RegExp(s[b],"g"),"|"+s[b]);const i=n.split("|"),o=[],d=[];let f=0,m=0;const y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let v;for(let b=1;b<i.length;b++){let _=i[b],j=_.charAt(0);for(_=_.slice(1),d.length=0;v=y.exec(_);)d.push(v[0]);let w=[],O=j==="A"||j==="a"?0:-1;for(let R=0,T=d.length;R<T;R++){const A=d[R];if(A==="00"){w.push(0,0),O>=0&&(O+=2,O>=7&&(O-=7));continue}if(O>=0){if(O===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(A)){w.push(parseInt(A[0],10)),w.push(parseInt(A[1],10)),w.push(parseFloat(A.slice(2))),O+=3,O>=7&&(O-=7);continue}if(A==="11"||A==="10"||A==="01"){w.push(parseInt(A[0],10)),w.push(parseInt(A[1],10)),O+=2,O>=7&&(O-=7);continue}if(A==="0"||A==="1"){w.push(parseInt(A,10)),O+=1,O>=7&&(O-=7);continue}}else if(O===4){if(/^[01]\d+(?:\.\d+)?$/.test(A)){w.push(parseInt(A[0],10)),w.push(parseFloat(A.slice(1))),O+=2,O>=7&&(O-=7);continue}if(A==="0"||A==="1"){w.push(parseInt(A,10)),O+=1,O>=7&&(O-=7);continue}}const z=parseFloat(A);isNaN(z)?w.push(0):w.push(z),O+=1,O>=7&&(O-=7)}else{const z=parseFloat(A);isNaN(z)?w.push(0):w.push(z)}}for(;w.length>0&&!isNaN(w[0]);){let R="",T=[];const A=f,z=m;let k,P,H,B,L,V,Z,oe,ne,J;switch(j){case"l":f+=w.shift(),m+=w.shift(),R="L",T.push(f,m);break;case"L":f=w.shift(),m=w.shift(),T.push(f,m);break;case"m":const ie=w.shift(),ce=w.shift();if(f+=ie,m+=ce,R="M",o.length>2&&o[o.length-1].command==="z"){for(let Y=o.length-2;Y>=0;Y--)if(o[Y].command==="M"){f=o[Y].points[0]+ie,m=o[Y].points[1]+ce;break}}T.push(f,m),j="l";break;case"M":f=w.shift(),m=w.shift(),R="M",T.push(f,m),j="L";break;case"h":f+=w.shift(),R="L",T.push(f,m);break;case"H":f=w.shift(),R="L",T.push(f,m);break;case"v":m+=w.shift(),R="L",T.push(f,m);break;case"V":m=w.shift(),R="L",T.push(f,m);break;case"C":T.push(w.shift(),w.shift(),w.shift(),w.shift()),f=w.shift(),m=w.shift(),T.push(f,m);break;case"c":T.push(f+w.shift(),m+w.shift(),f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),R="C",T.push(f,m);break;case"S":P=f,H=m,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=m+(m-k.points[3])),T.push(P,H,w.shift(),w.shift()),f=w.shift(),m=w.shift(),R="C",T.push(f,m);break;case"s":P=f,H=m,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=m+(m-k.points[3])),T.push(P,H,f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),R="C",T.push(f,m);break;case"Q":T.push(w.shift(),w.shift()),f=w.shift(),m=w.shift(),T.push(f,m);break;case"q":T.push(f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),R="Q",T.push(f,m);break;case"T":P=f,H=m,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=m+(m-k.points[1])),f=w.shift(),m=w.shift(),R="Q",T.push(P,H,f,m);break;case"t":P=f,H=m,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=m+(m-k.points[1])),f+=w.shift(),m+=w.shift(),R="Q",T.push(P,H,f,m);break;case"A":B=w.shift(),L=w.shift(),V=w.shift(),Z=w.shift(),oe=w.shift(),ne=f,J=m,f=w.shift(),m=w.shift(),R="A",T=this.convertEndpointToCenterParameterization(ne,J,f,m,Z,oe,B,L,V);break;case"a":B=w.shift(),L=w.shift(),V=w.shift(),Z=w.shift(),oe=w.shift(),ne=f,J=m,f+=w.shift(),m+=w.shift(),R="A",T=this.convertEndpointToCenterParameterization(ne,J,f,m,Z,oe,B,L,V);break}o.push({command:R||j,points:T,start:{x:A,y:z},pathLength:this.calcLength(A,z,R||j,T)})}(j==="z"||j==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,s,i){let o,d,f,m;const y=Cn;switch(s){case"L":return y.getLineLength(e,n,i[0],i[1]);case"C":return A5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return M5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const v=i[4],b=i[5],_=i[4]+b;let j=Math.PI/180;if(Math.abs(v-_)<j&&(j=Math.abs(v-_)),d=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),b<0)for(m=v-j;m>_;m-=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],m,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;else for(m=v+j;m<_;m+=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],m,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;return f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],_,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),o}return 0}static convertEndpointToCenterParameterization(e,n,s,i,o,d,f,m,y){const v=y*(Math.PI/180),b=Math.cos(v)*(e-s)/2+Math.sin(v)*(n-i)/2,_=-1*Math.sin(v)*(e-s)/2+Math.cos(v)*(n-i)/2,j=b*b/(f*f)+_*_/(m*m);j>1&&(f*=Math.sqrt(j),m*=Math.sqrt(j));let w=Math.sqrt((f*f*(m*m)-f*f*(_*_)-m*m*(b*b))/(f*f*(_*_)+m*m*(b*b)));o===d&&(w*=-1),isNaN(w)&&(w=0);const O=w*f*_/m,R=w*-m*b/f,T=(e+s)/2+Math.cos(v)*O-Math.sin(v)*R,A=(n+i)/2+Math.sin(v)*O+Math.cos(v)*R,z=function(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1])},k=function(Z,oe){return(Z[0]*oe[0]+Z[1]*oe[1])/(z(Z)*z(oe))},P=function(Z,oe){return(Z[0]*oe[1]<Z[1]*oe[0]?-1:1)*Math.acos(k(Z,oe))},H=P([1,0],[(b-O)/f,(_-R)/m]),B=[(b-O)/f,(_-R)/m],L=[(-1*b-O)/f,(-1*_-R)/m];let V=P(B,L);return k(B,L)<=-1&&(V=Math.PI),k(B,L)>=1&&(V=0),d===0&&V>0&&(V=V-2*Math.PI),d===1&&V<0&&(V=V+2*Math.PI),[T,A,f,m,H,V,v,d]}}Cn.prototype.className="Path";Cn.prototype._attrsAffectingSize=["data"];Wn(Cn);X.addGetterSetter(Cn,"data");let ld=class extends go{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,s=this.points();let i=s;const o=this.tension()!==0&&s.length>4;o&&(i=this.getTensionPoints());const d=this.pointerLength(),f=s.length;let m,y;if(o){const _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],s[f-2],s[f-1]],j=Cn.calcLength(i[i.length-4],i[i.length-3],"C",_),w=Cn.getPointOnQuadraticBezier(Math.min(1,1-d/j),_[0],_[1],_[2],_[3],_[4],_[5]);m=s[f-2]-w.x,y=s[f-1]-w.y}else m=s[f-2]-s[f-4],y=s[f-1]-s[f-3];const v=(Math.atan2(y,m)+n)%n,b=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(s[f-2],s[f-1]),e.rotate(v),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(s[0],s[1]),o?(m=(i[0]+i[2])/2-s[0],y=(i[1]+i[3])/2-s[1]):(m=s[2]-s[0],y=s[3]-s[1]),e.rotate((Math.atan2(-y,-m)+n)%n),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}};ld.prototype.className="Arrow";Wn(ld);X.addGetterSetter(ld,"pointerLength",10,Te());X.addGetterSetter(ld,"pointerWidth",10,Te());X.addGetterSetter(ld,"pointerAtBeginning",!1);X.addGetterSetter(ld,"pointerAtEnding",!0);let hh=class extends we{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};hh.prototype._centroid=!0;hh.prototype.className="Circle";hh.prototype._attrsAffectingSize=["radius"];Wn(hh);X.addGetterSetter(hh,"radius",0,Te());class Hu extends we{_sceneFunc(e){const n=this.radiusX(),s=this.radiusY();e.beginPath(),e.save(),n!==s&&e.scale(1,s/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Hu.prototype.className="Ellipse";Hu.prototype._centroid=!0;Hu.prototype._attrsAffectingSize=["radiusX","radiusY"];Wn(Hu);X.addComponentsGetterSetter(Hu,"radius",["x","y"]);X.addGetterSetter(Hu,"radiusX",0,Te());X.addGetterSetter(Hu,"radiusY",0,Te());class Or extends we{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),s=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let d;if(o){const f=this.attrs.cropWidth,m=this.attrs.cropHeight;f&&m?d=[o,this.cropX(),this.cropY(),f,m,0,0,n,s]:d=[o,0,0,n,s]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,d))}_hitFunc(e){const n=this.width(),s=this.height(),i=this.cornerRadius();e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n,s;return(s=(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&s!==void 0?s:0}getHeight(){var e,n,s;return(s=(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&s!==void 0?s:0}static fromURL(e,n,s=null){const i=ee.createImageElement();i.onload=function(){const o=new Or({image:i});n(o)},i.onerror=s,i.crossOrigin="Anonymous",i.src=e}}Or.prototype.className="Image";Or.prototype._attrsAffectingSize=["image"];Wn(Or);X.addGetterSetter(Or,"cornerRadius",0,ty(4));X.addGetterSetter(Or,"image");X.addComponentsGetterSetter(Or,"crop",["x","y","width","height"]);X.addGetterSetter(Or,"cropX",0,Te());X.addGetterSetter(Or,"cropY",0,Te());X.addGetterSetter(Or,"cropWidth",0,Te());X.addGetterSetter(Or,"cropHeight",0,Te());const H8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Yz="Change.konva",Vz="none",Ab="up",Mb="right",Db="down",zb="left",Qz=H8.length;class Av extends ah{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,s;const i=function(){n._sync()};for(s=0;s<Qz;s++)e.on(H8[s]+Yz,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),s,i,o,d,f,m,y;if(e&&n){switch(s=e.width(),i=e.height(),o=n.pointerDirection(),d=n.pointerWidth(),y=n.pointerHeight(),f=0,m=0,o){case Ab:f=s/2,m=-1*y;break;case Mb:f=s+d,m=i/2;break;case Db:f=s/2,m=i+y;break;case zb:f=-1*d,m=i/2;break}n.setAttrs({x:-1*f,y:-1*m,width:s,height:i}),e.setAttrs({x:-1*f,y:-1*m})}}}Av.prototype.className="Label";Wn(Av);class od extends we{_sceneFunc(e){const n=this.width(),s=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),d=this.pointerHeight(),f=this.cornerRadius();let m=0,y=0,v=0,b=0;typeof f=="number"?m=y=v=b=Math.min(f,n/2,s/2):(m=Math.min(f[0]||0,n/2,s/2),y=Math.min(f[1]||0,n/2,s/2),b=Math.min(f[2]||0,n/2,s/2),v=Math.min(f[3]||0,n/2,s/2)),e.beginPath(),e.moveTo(m,0),i===Ab&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*d),e.lineTo((n+o)/2,0)),e.lineTo(n-y,0),e.arc(n-y,y,y,Math.PI*3/2,0,!1),i===Mb&&(e.lineTo(n,(s-d)/2),e.lineTo(n+o,s/2),e.lineTo(n,(s+d)/2)),e.lineTo(n,s-b),e.arc(n-b,s-b,b,0,Math.PI/2,!1),i===Db&&(e.lineTo((n+o)/2,s),e.lineTo(n/2,s+d),e.lineTo((n-o)/2,s)),e.lineTo(v,s),e.arc(v,s-v,v,Math.PI/2,Math.PI,!1),i===zb&&(e.lineTo(0,(s+d)/2),e.lineTo(-1*o,s/2),e.lineTo(0,(s-d)/2)),e.lineTo(0,m),e.arc(m,m,m,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,s=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),d=this.width(),f=this.height();return o===Ab?(n-=i,f+=i):o===Db?f+=i:o===zb?(e-=s*1.5,d+=s):o===Mb&&(d+=s*1.5),{x:e,y:n,width:d,height:f}}}od.prototype.className="Tag";Wn(od);X.addGetterSetter(od,"pointerDirection",Vz);X.addGetterSetter(od,"pointerWidth",0,Te());X.addGetterSetter(od,"pointerHeight",0,Te());X.addGetterSetter(od,"cornerRadius",0,ty(4));class Jm extends we{_sceneFunc(e){const n=this.cornerRadius(),s=this.width(),i=this.height();e.beginPath(),n?ee.drawRoundedRectPath(e,s,i,n):e.rect(0,0,s,i),e.closePath(),e.fillStrokeShape(this)}}Jm.prototype.className="Rect";Wn(Jm);X.addGetterSetter(Jm,"cornerRadius",0,ty(4));class qu extends we{_sceneFunc(e){const n=this._getPoints(),s=this.radius(),i=this.sides(),o=this.cornerRadius();if(e.beginPath(),o)ee.drawRoundedPolygonPath(e,n,i,s,o);else{e.moveTo(n[0].x,n[0].y);for(let d=1;d<n.length;d++)e.lineTo(n[d].x,n[d].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,s=[];for(let i=0;i<e;i++)s.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return s}getSelfRect(){const e=this._getPoints();let n=e[0].x,s=e[0].x,i=e[0].y,o=e[0].y;return e.forEach(d=>{n=Math.min(n,d.x),s=Math.max(s,d.x),i=Math.min(i,d.y),o=Math.max(o,d.y)}),{x:n,y:i,width:s-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}qu.prototype.className="RegularPolygon";qu.prototype._centroid=!0;qu.prototype._attrsAffectingSize=["radius"];Wn(qu);X.addGetterSetter(qu,"radius",0,Te());X.addGetterSetter(qu,"sides",0,Te());X.addGetterSetter(qu,"cornerRadius",0,ty(4));const z5=Math.PI*2;class ud extends we{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,z5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),z5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}ud.prototype.className="Ring";ud.prototype._centroid=!0;ud.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Wn(ud);X.addGetterSetter(ud,"innerRadius",0,Te());X.addGetterSetter(ud,"outerRadius",0,Te());class Sl extends we{constructor(e){super(e),this._updated=!0,this.anim=new ii(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+0],m=o[i+1],y=o[i+2],v=o[i+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,y,v),e.closePath(),e.fillStrokeShape(this)),b)if(d){const _=d[n],j=s*2;e.drawImage(b,f,m,y,v,_[j+0],_[j+1],y,v)}else e.drawImage(b,f,m,y,v,0,0,y,v)}_hitFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+2],m=o[i+3];if(e.beginPath(),d){const y=d[n],v=s*2;e.rect(y[v+0],y[v+1],f,m)}else e.rect(0,0,f,m);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),s=this.animations(),i=s[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}}Sl.prototype.className="Sprite";Wn(Sl);X.addGetterSetter(Sl,"animation");X.addGetterSetter(Sl,"animations");X.addGetterSetter(Sl,"frameOffsets");X.addGetterSetter(Sl,"image");X.addGetterSetter(Sl,"frameIndex",0,Te());X.addGetterSetter(Sl,"frameRate",17,Te());X.backCompat(Sl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Bu extends we{_sceneFunc(e){const n=this.innerRadius(),s=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-s);for(let o=1;o<i*2;o++){const d=o%2===0?s:n,f=d*Math.sin(o*Math.PI/i),m=-1*d*Math.cos(o*Math.PI/i);e.lineTo(f,m)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Bu.prototype.className="Star";Bu.prototype._centroid=!0;Bu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Wn(Bu);X.addGetterSetter(Bu,"numPoints",5,Te());X.addGetterSetter(Bu,"innerRadius",0,Te());X.addGetterSetter(Bu,"outerRadius",0,Te());function yu(t){return[...t].reduce((e,n,s,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const o=i[s+1];o&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(o)?(e.push(n+o),i[s+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[s+1]||""))?e.push(n+i[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Tf="auto",Xz="center",q8="inherit",rm="justify",Kz="Change.konva",Fz="2d",k5="-",B8="left",Zz="text",Iz="Text",Jz="top",Wz="bottom",L5="middle",G8="normal",$z="px ",i1=" ",ek="right",U5="rtl",tk="word",nk="char",H5="none",_x="…",P8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],ak=P8.length;function sk(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,s=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!s&&(e=`"${e}"`),e}).join(", ")}let l1;function Cx(){return l1||(l1=ee.createCanvasElement().getContext(Fz),l1)}function rk(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ik(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function lk(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let jn=class extends we{constructor(e){super(lk(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<ak;n++)this.on(P8[n]+Kz,this._setTextData);this._setTextData()}_sceneFunc(e){var n,s;const i=this.textArr,o=i.length;if(!this.text())return;let d=this.padding(),f=this.fontSize(),m=this.lineHeight()*f,y=this.verticalAlign(),v=this.direction(),b=0,_=this.align(),j=this.getWidth(),w=this.letterSpacing(),O=this.charRenderFunc(),R=this.fill(),T=this.textDecoration(),A=this.underlineOffset(),z=T.indexOf("underline")!==-1,k=T.indexOf("line-through")!==-1,P;v=v===q8?e.direction:v;let H=m/2,B=L5;if(!Me.legacyTextRendering){const L=this.measureSize("M");B="alphabetic";const V=(n=L.fontBoundingBoxAscent)!==null&&n!==void 0?n:L.actualBoundingBoxAscent,Z=(s=L.fontBoundingBoxDescent)!==null&&s!==void 0?s:L.actualBoundingBoxDescent;H=(V-Z)/2+m/2}for(v===U5&&e.setAttr("direction",v),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",B),e.setAttr("textAlign",B8),y===L5?b=(this.getHeight()-o*m-d*2)/2:y===Wz&&(b=this.getHeight()-o*m-d*2),e.translate(d,b+d),P=0;P<o;P++){let L=0,V=0;const Z=i[P],oe=Z.text,ne=Z.width,J=Z.lastInParagraph;if(e.save(),_===ek?L+=j-ne-d*2:_===Xz&&(L+=(j-ne-d*2)/2),z){e.save(),e.beginPath();const ce=A??(Me.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Y=L,$=H+V+ce;e.moveTo(Y,$);const ae=_===rm&&!J?j-d*2:ne;e.lineTo(Y+Math.round(ae),$),e.lineWidth=f/15;const Ne=this._getLinearGradient();e.strokeStyle=Ne||R,e.stroke(),e.restore()}const ie=L;if(v!==U5&&(w!==0||_===rm||O)){const ce=oe.split(" ").length-1,Y=yu(oe);for(let $=0;$<Y.length;$++){const ae=Y[$];if(ae===" "&&!J&&_===rm&&(L+=(j-d*2-ne)/ce),this._partialTextX=L,this._partialTextY=H+V,this._partialText=ae,O){e.save();const re=i.slice(0,P).reduce((W,he)=>W+yu(he.text).length,0),G=$+re;O({char:ae,index:G,x:L,y:H+V,lineIndex:P,column:$,isLastInLine:J,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),O&&e.restore(),L+=this.measureSize(ae).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=L,this._partialTextY=H+V,this._partialText=oe,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const ce=Me.legacyTextRendering?0:-Math.round(f/4),Y=ie;e.moveTo(Y,H+V+ce);const $=_===rm&&!J?j-d*2:ne;e.lineTo(Y+Math.round($),H+V+ce),e.lineWidth=f/15;const ae=this._getLinearGradient();e.strokeStyle=ae||R,e.stroke(),e.restore()}e.restore(),o>1&&(H+=m)}}_hitFunc(e){const n=this.getWidth(),s=this.getHeight();e.beginPath(),e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=ee._isString(e)?e:e==null?"":e+"";return this._setAttr(Zz,n),this}getWidth(){return this.attrs.width===Tf||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Tf||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,s,i,o,d,f,m,y,v,b,_;let j=Cx(),w=this.fontSize(),O;j.save(),j.font=this._getContextFont(),O=j.measureText(e),j.restore();const R=w/100;return{actualBoundingBoxAscent:(n=O.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*R,actualBoundingBoxDescent:(s=O.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(i=O.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*R,actualBoundingBoxRight:(o=O.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*R,alphabeticBaseline:(d=O.alphabeticBaseline)!==null&&d!==void 0?d:0,emHeightAscent:(f=O.emHeightAscent)!==null&&f!==void 0?f:100*R,emHeightDescent:(m=O.emHeightDescent)!==null&&m!==void 0?m:-20*R,fontBoundingBoxAscent:(y=O.fontBoundingBoxAscent)!==null&&y!==void 0?y:91*R,fontBoundingBoxDescent:(v=O.fontBoundingBoxDescent)!==null&&v!==void 0?v:21*R,hangingBaseline:(b=O.hangingBaseline)!==null&&b!==void 0?b:72.80000305175781*R,ideographicBaseline:(_=O.ideographicBaseline)!==null&&_!==void 0?_:-21*R,width:O.width,height:w}}_getContextFont(){return this.fontStyle()+i1+this.fontVariant()+i1+(this.fontSize()+$z)+sk(this.fontFamily())}_addTextLine(e){this.align()===rm&&(e=e.trim());const s=this._getTextWidth(e);return this.textArr.push({text:e,width:s,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),s=e.length;return Cx().measureText(e).width+n*s}_setTextData(){let e=this.text().split(`
564
+ `),n=+this.fontSize(),s=0,i=this.lineHeight()*n,o=this.attrs.width,d=this.attrs.height,f=o!==Tf&&o!==void 0,m=d!==Tf&&d!==void 0,y=this.padding(),v=o-y*2,b=d-y*2,_=0,j=this.wrap(),w=j!==H5,O=j!==nk&&w,R=this.ellipsis();this.textArr=[],Cx().font=this._getContextFont();const T=R?this._getTextWidth(_x):0;for(let A=0,z=e.length;A<z;++A){let k=e[A],P=this._getTextWidth(k);if(f&&P>v)for(;k.length>0;){let H=0,B=yu(k).length,L="",V=0;for(;H<B;){const Z=H+B>>>1,oe=yu(k),ne=oe.slice(0,Z+1).join(""),J=this._getTextWidth(ne);(R&&m&&_+i>b?J+T:J)<=v?(H=Z+1,L=ne,V=J):B=Z}if(L){if(O){const ne=yu(k),J=yu(L),ie=ne[J.length],ce=ie===i1||ie===k5;let Y;if(ce&&V<=v)Y=J.length;else{const $=J.lastIndexOf(i1),ae=J.lastIndexOf(k5);Y=Math.max($,ae)+1}Y>0&&(H=Y,L=ne.slice(0,H).join(""),V=this._getTextWidth(L))}if(L=L.trimRight(),this._addTextLine(L),s=Math.max(s,V),_+=i,this._shouldHandleEllipsis(_)){this._tryToAddEllipsisToLastLine();break}if(k=yu(k).slice(H).join("").trimLeft(),k.length>0&&(P=this._getTextWidth(k),P<=v)){this._addTextLine(k),_+=i,s=Math.max(s,P);break}}else break}else this._addTextLine(k),_+=i,s=Math.max(s,P),this._shouldHandleEllipsis(_)&&A<z-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),m&&_+i>b)break}this.textHeight=n,this.textWidth=s}_shouldHandleEllipsis(e){const n=+this.fontSize(),s=this.lineHeight()*n,i=this.attrs.height,o=i!==Tf&&i!==void 0,d=this.padding(),f=i-d*2;return!(this.wrap()!==H5)||o&&e+s>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Tf&&e!==void 0,s=this.padding(),i=e-s*2,o=this.ellipsis(),d=this.textArr[this.textArr.length-1];!d||!o||(n&&(this._getTextWidth(d.text+_x)<i||(d.text=d.text.slice(0,d.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(d.text+_x))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};jn.prototype._fillFunc=rk;jn.prototype._strokeFunc=ik;jn.prototype.className=Iz;jn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Wn(jn);X.overWriteSetter(jn,"width",Tv());X.overWriteSetter(jn,"height",Tv());X.addGetterSetter(jn,"direction",q8);X.addGetterSetter(jn,"fontFamily","Arial");X.addGetterSetter(jn,"fontSize",12,Te());X.addGetterSetter(jn,"fontStyle",G8);X.addGetterSetter(jn,"fontVariant",G8);X.addGetterSetter(jn,"padding",0,Te());X.addGetterSetter(jn,"align",B8);X.addGetterSetter(jn,"verticalAlign",Jz);X.addGetterSetter(jn,"lineHeight",1,Te());X.addGetterSetter(jn,"wrap",tk);X.addGetterSetter(jn,"ellipsis",!1,Mi());X.addGetterSetter(jn,"letterSpacing",0,Te());X.addGetterSetter(jn,"text","",rd());X.addGetterSetter(jn,"textDecoration","");X.addGetterSetter(jn,"underlineOffset",void 0,Te());X.addGetterSetter(jn,"charRenderFunc",void 0);const ok="",Y8="normal";function V8(t){t.fillText(this.partialText,0,0)}function Q8(t){t.strokeText(this.partialText,0,0)}class Ua extends we{constructor(e){super(e),this.dummyCanvas=ee.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Cn.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Cn.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Cn.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),s=this.fill(),i=this.fontSize(),o=this.glyphInfo,d=n.indexOf("underline")!==-1,f=n.indexOf("line-through")!==-1;d&&e.beginPath();for(let m=0;m<o.length;m++){e.save();const y=o[m].p0;e.translate(y.x,y.y),e.rotate(o[m].rotation),this.partialText=o[m].text,e.fillStrokeShape(this),d&&(m===0&&e.moveTo(0,i/2+1),e.lineTo(o[m].width,i/2+1)),e.restore()}if(d&&(e.strokeStyle=s,e.lineWidth=i/20,e.stroke()),f){e.beginPath();for(let m=0;m<o.length;m++){e.save();const y=o[m].p0;e.translate(y.x,y.y),e.rotate(o[m].rotation),m===0&&e.moveTo(0,0),e.lineTo(o[m].width,0),e.restore()}e.strokeStyle=s,e.lineWidth=i/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const s=n[0].p0;e.moveTo(s.x,s.y)}for(let s=0;s<n.length;s++){const i=n[s].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return jn.prototype.setText.call(this,e)}_getContextFont(){return jn.prototype._getContextFont.call(this)}_getTextSize(e){const s=this.dummyCanvas.getContext("2d");s.save(),s.font=this._getContextFont();const i=s.measureText(e);return s.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=yu(this.text()),n=[];let s=0;for(let j=0;j<e.length;j++)n.push({char:e[j],width:this._getTextSize(e[j]).width}),s+=n[j].width;const{width:i,height:o}=this._getTextSize(this.attrs.text);if(this.textWidth=s,this.textHeight=o,this.glyphInfo=[],!this.attrs.data)return null;const d=this.letterSpacing(),f=this.align(),m=this.kerningFunc(),y=Math.max(0,s-i),v=Math.max(this.textWidth+((this.attrs.text||"").length-1)*d,0);let b=0;f==="center"&&(b=Math.max(0,this.pathLength/2-v/2)),f==="right"&&(b=Math.max(0,this.pathLength-v));let _=b;for(let j=0;j<n.length;j++){const w=this._getPointAtLength(_);if(!w)return;const O=n[j].char;let R=n[j].width+d;if(O===" "&&f==="justify"){const B=this.text().split(" ").length-1;R+=(this.pathLength-v)/B}const T=_+R,A=this._getPointAtLength(T>this.pathLength&&T-this.pathLength<=y?this.pathLength:T);if(!A)return;const z=Cn.getLineLength(w.x,w.y,A.x,A.y);let k=0;if(m)try{k=m(n[j-1].char,O)*this.fontSize()}catch{k=0}w.x+=k,A.x+=k,this.textWidth+=k;const P=Cn.getPointOnLine(k+z/2,w.x,w.y,A.x,A.y),H=Math.atan2(A.y-w.y,A.x-w.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:e[j],rotation:H,p0:w,p1:A,width:z}),_+=R}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(y){e.push(y.p0.x),e.push(y.p0.y),e.push(y.p1.x),e.push(y.p1.y)});let n=e[0]||0,s=e[0]||0,i=e[1]||0,o=e[1]||0,d,f;for(let y=0;y<e.length/2;y++)d=e[y*2],f=e[y*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);const m=this.fontSize();return{x:n-m/2,y:i-m/2,width:s-n+m,height:o-i+m}}destroy(){return ee.releaseCanvas(this.dummyCanvas),super.destroy()}}Ua.prototype._fillFunc=V8;Ua.prototype._strokeFunc=Q8;Ua.prototype._fillFuncHit=V8;Ua.prototype._strokeFuncHit=Q8;Ua.prototype.className="TextPath";Ua.prototype._attrsAffectingSize=["text","fontSize","data"];Wn(Ua);X.addGetterSetter(Ua,"data");X.addGetterSetter(Ua,"fontFamily","Arial");X.addGetterSetter(Ua,"fontSize",12,Te());X.addGetterSetter(Ua,"fontStyle",Y8);X.addGetterSetter(Ua,"align","left");X.addGetterSetter(Ua,"letterSpacing",0,Te());X.addGetterSetter(Ua,"textBaseline","middle");X.addGetterSetter(Ua,"fontVariant",Y8);X.addGetterSetter(Ua,"text",ok);X.addGetterSetter(Ua,"textDecoration","");X.addGetterSetter(Ua,"kerningFunc",void 0);const X8="tr-konva",uk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${X8}`).join(" "),q5="nodesRect",ck=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],dk={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},fk="ontouchstart"in Me._global;function hk(t,e,n){if(t==="rotater")return n;e+=ee.degToRad(dk[t]||0);const s=(ee.radToDeg(e)%360+360)%360;return ee._inRange(s,315+22.5,360)||ee._inRange(s,0,22.5)?"ns-resize":ee._inRange(s,45-22.5,45+22.5)?"nesw-resize":ee._inRange(s,90-22.5,90+22.5)?"ew-resize":ee._inRange(s,135-22.5,135+22.5)?"nwse-resize":ee._inRange(s,180-22.5,180+22.5)?"ns-resize":ee._inRange(s,225-22.5,225+22.5)?"nesw-resize":ee._inRange(s,270-22.5,270+22.5)?"ew-resize":ee._inRange(s,315-22.5,315+22.5)?"nwse-resize":(ee.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const O1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function pk(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function K8(t,e,n){const s=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:s,y:i}}function mk(t,e){const n=pk(t);return K8(t,e,n)}function gk(t,e,n){let s=e;for(let i=0;i<t.length;i++){const o=Me.getAngle(t[i]),d=Math.abs(o-e)%(Math.PI*2);Math.min(d,Math.PI*2-d)<n&&(s=o)}return s}let kb=0;class Lt extends ah{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(uk,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return ee.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return X8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(ee.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const d=i._attrsAffectingSize.map(f=>f+"Change."+this._getEventNamespace()).join(" ");i.on(d,o)}i.on(ck.map(d=>d+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,s=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(s,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,d=i.y-n.y;this.nodes().forEach(f=>{if(f===e||f.isDragging())return;const m=f.getAbsolutePosition();f.setAbsolutePosition({x:m.x+o,y:m.y+d}),f.startDrag(s)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(q5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(q5,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),s){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(s),d=e.getAbsolutePosition(s),f=i.x*o.x-e.offsetX()*o.x,m=i.y*o.y-e.offsetY()*o.y,y=(Me.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:d.x+f*Math.cos(y)+m*Math.sin(-y),y:d.y+m*Math.cos(y)+f*Math.sin(y),width:i.width*o.x,height:i.height*o.y,rotation:y};return K8(v,-Me.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(y=>{const v=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),b=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],_=y.getAbsoluteTransform();b.forEach(function(j){const w=_.point(j);n.push(w)})});const s=new wr;s.rotate(-Me.getAngle(this.rotation()));let i=1/0,o=1/0,d=-1/0,f=-1/0;n.forEach(function(y){const v=s.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.y)}),s.invert();const m=s.point({x:i,y:o});return{x:m.x,y:m.y,width:d-i,height:f-o,rotation:Me.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),O1.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new Jm({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:fk?10:"auto"}),s=this;n.on("mousedown touchstart",function(i){s._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=Me.getAngle(this.rotation()),o=this.rotateAnchorCursor(),d=hk(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=d),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new we({name:"back",width:0,height:0,sceneFunc(n,s){const i=s.getParent(),o=i.padding(),d=s.width(),f=s.height();if(n.beginPath(),n.rect(-o,-o,d+o*2,f+o*2),i.rotateEnabled()&&i.rotateLineVisible()){const m=i.rotateAnchorAngle(),y=i.rotateAnchorOffset(),v=ee.degToRad(m),b=Math.sin(v),_=-Math.cos(v),j=d/2,w=f/2;let O=1/0;_<0?O=Math.min(O,-w/_):_>0&&(O=Math.min(O,(f-w)/_)),b<0?O=Math.min(O,-j/b):b>0&&(O=Math.min(O,(d-j)/b));const R=j+b*O,T=w+_*O,A=ee._sign(f),z=R+b*y*A,k=T+_*y*A;n.moveTo(R,T),n.lineTo(z,k)}n.fillStrokeShape(s)},hitFunc:(n,s)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,s.width()+i*2,s.height()+i*2),n.fillStrokeShape(s)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),s=n.width,i=n.height,o=Math.sqrt(Math.pow(s,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(s/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const d=e.target.getAbsolutePosition(),f=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:f.x-d.x,y:f.y-d.y},kb++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(m=>{m._fire("transformstart",{evt:e.evt,target:m})})}_handleMouseMove(e){let n,s,i;const o=this.findOne("."+this._movingAnchorName),d=o.getStage();d.setPointersPositions(e);const f=d.getPointerPosition();let m={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const y=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(m=this.anchorDragBoundFunc()(y,m,e)),o.setAbsolutePosition(m);const v=o.getAbsolutePosition();if(y.x===v.x&&y.y===v.y)return;if(this._movingAnchorName==="rotater"){const A=this._getNodeRect();n=o.x()-A.width/2,s=-o.y()+A.height/2;const z=Me.getAngle(this.rotateAnchorAngle());let k=Math.atan2(-s,n)+Math.PI/2-z;A.height<0&&(k-=Math.PI);const H=Me.getAngle(this.rotation())+k,B=Me.getAngle(this.rotationSnapTolerance()),V=gk(this.rotationSnaps(),H,B)-A.rotation,Z=mk(A,V);this._fitNodesInto(Z,e);return}const b=this.shiftBehavior();let _;b==="inverted"?_=this.keepRatio()&&!e.shiftKey:b==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;let j=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){const A=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(A.x-o.x(),2)+Math.pow(A.y-o.y(),2));const z=this.findOne(".top-left").x()>A.x?-1:1,k=this.findOne(".top-left").y()>A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-left").x(A.x-n),this.findOne(".top-left").y(A.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(_){const A=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-A.x,2)+Math.pow(A.y-o.y(),2));const z=this.findOne(".top-right").x()<A.x?-1:1,k=this.findOne(".top-right").y()>A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-right").x(A.x+n),this.findOne(".top-right").y(A.y-s)}var w=o.position();this.findOne(".top-left").y(w.y),this.findOne(".bottom-right").x(w.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(_){const A=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(A.x-o.x(),2)+Math.pow(o.y()-A.y,2));const z=A.x<o.x()?-1:1,k=o.y()<A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,o.x(A.x-n),o.y(A.y+s)}w=o.position(),this.findOne(".top-left").x(w.x),this.findOne(".bottom-right").y(w.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(_){const A=j?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-A.x,2)+Math.pow(o.y()-A.y,2));const z=this.findOne(".bottom-right").x()<A.x?-1:1,k=this.findOne(".bottom-right").y()<A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".bottom-right").x(A.x+n),this.findOne(".bottom-right").y(A.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(j=this.centeredScaling()||e.altKey,j){const A=this.findOne(".top-left"),z=this.findOne(".bottom-right"),k=A.x(),P=A.y(),H=this.getWidth()-z.x(),B=this.getHeight()-z.y();z.move({x:-k,y:-P}),A.move({x:H,y:B})}const O=this.findOne(".top-left").getAbsolutePosition();n=O.x,s=O.y;const R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),T=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:s,width:R,height:T,rotation:Me.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const s=this.getNode();kb--,this._fire("transformend",{evt:e,target:s}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),s&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const s=this._getNodeRect(),i=1;if(ee._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(ee._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new wr;if(o.rotate(Me.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=o.point({x:-this.padding()*2,y:0});e.x+=_.x,e.y+=_.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=o.point({x:0,y:-this.padding()*2});e.x+=_.x,e.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(s,e);_?e=_:ee.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const d=1e7,f=new wr;f.translate(s.x,s.y),f.rotate(s.rotation),f.scale(s.width/d,s.height/d);const m=new wr,y=e.width/d,v=e.height/d;this.flipEnabled()===!1?(m.translate(e.x,e.y),m.rotate(e.rotation),m.translate(e.width<0?e.width:0,e.height<0?e.height:0),m.scale(Math.abs(y),Math.abs(v))):(m.translate(e.x,e.y),m.rotate(e.rotation),m.scale(y,v));const b=m.multiply(f.invert());this._nodes.forEach(_=>{var j;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),O=_.getTransform().copy();O.translate(_.offsetX(),_.offsetY());const R=new wr;R.multiply(w.copy().invert()).multiply(b).multiply(w).multiply(O);const T=R.decompose();_.setAttrs(T),(j=_.getLayer())===null||j===void 0||j.batchDraw()}),this.rotation(ee._getRotation(e.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:n,target:_}),_._fire("transform",{evt:n,target:_})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(ee._getRotation(n.rotation));const s=n.width,i=n.height,o=this.enabledAnchors(),d=this.resizeEnabled(),f=this.padding(),m=this.anchorSize(),y=this.find("._anchor");y.forEach(H=>{H.setAttrs({width:m,height:m,offsetX:m/2,offsetY:m/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:m/2+f,offsetY:m/2+f,visible:d&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:m/2+f,visible:d&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:m/2-f,offsetY:m/2+f,visible:d&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:m/2+f,visible:d&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:i/2,offsetX:m/2-f,visible:d&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:m/2+f,offsetY:m/2-f,visible:d&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:i,offsetY:m/2-f,visible:d&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:i,offsetX:m/2-f,offsetY:m/2-f,visible:d&&o.indexOf("bottom-right")>=0});const v=this.rotateAnchorAngle(),b=this.rotateAnchorOffset(),_=ee.degToRad(v),j=Math.sin(_),w=-Math.cos(_),O=s/2,R=i/2;let T=1/0;w<0?T=Math.min(T,-R/w):w>0&&(T=Math.min(T,(i-R)/w)),j<0?T=Math.min(T,-O/j):j>0&&(T=Math.min(T,(s-O)/j));const A=O+j*T,z=R+w*T,k=ee._sign(i);this._batchChangeChild(".rotater",{x:A+j*b*k,y:z+w*b*k-f*w,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(H=>H.draggable()),x:0,y:0});const P=this.anchorStyleFunc();P&&y.forEach(H=>{P(H)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),ah.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(ee.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return Ae.prototype.toObject.call(this)}clone(e){return Ae.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Lt.isTransforming=()=>kb>0;function yk(t){return t instanceof Array||ee.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){O1.indexOf(e)===-1&&ee.warn("Unknown anchor name: "+e+". Available names are: "+O1.join(", "))}),t||[]}Lt.prototype.className="Transformer";Wn(Lt);X.addGetterSetter(Lt,"enabledAnchors",O1,yk);X.addGetterSetter(Lt,"flipEnabled",!0,Mi());X.addGetterSetter(Lt,"resizeEnabled",!0);X.addGetterSetter(Lt,"anchorSize",10,Te());X.addGetterSetter(Lt,"rotateEnabled",!0);X.addGetterSetter(Lt,"rotateLineVisible",!0);X.addGetterSetter(Lt,"rotationSnaps",[]);X.addGetterSetter(Lt,"rotateAnchorOffset",50,Te());X.addGetterSetter(Lt,"rotateAnchorAngle",0,Te());X.addGetterSetter(Lt,"rotateAnchorCursor","crosshair");X.addGetterSetter(Lt,"rotationSnapTolerance",5,Te());X.addGetterSetter(Lt,"borderEnabled",!0);X.addGetterSetter(Lt,"anchorStroke","rgb(0, 161, 255)");X.addGetterSetter(Lt,"anchorStrokeWidth",1,Te());X.addGetterSetter(Lt,"anchorFill","white");X.addGetterSetter(Lt,"anchorCornerRadius",0,Te());X.addGetterSetter(Lt,"borderStroke","rgb(0, 161, 255)");X.addGetterSetter(Lt,"borderStrokeWidth",1,Te());X.addGetterSetter(Lt,"borderDash");X.addGetterSetter(Lt,"keepRatio",!0);X.addGetterSetter(Lt,"shiftBehavior","default");X.addGetterSetter(Lt,"centeredScaling",!1);X.addGetterSetter(Lt,"ignoreStroke",!1);X.addGetterSetter(Lt,"padding",0,Te());X.addGetterSetter(Lt,"nodes");X.addGetterSetter(Lt,"node");X.addGetterSetter(Lt,"boundBoxFunc");X.addGetterSetter(Lt,"anchorDragBoundFunc");X.addGetterSetter(Lt,"anchorStyleFunc");X.addGetterSetter(Lt,"shouldOverdrawWholeArea",!1);X.addGetterSetter(Lt,"useSingleNodeRotation",!0);X.backCompat(Lt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class yo extends we{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Me.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}yo.prototype.className="Wedge";yo.prototype._centroid=!0;yo.prototype._attrsAffectingSize=["radius"];Wn(yo);X.addGetterSetter(yo,"radius",0,Te());X.addGetterSetter(yo,"angle",0,Te());X.addGetterSetter(yo,"clockwise",!1);X.backCompat(yo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function B5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const xk=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],bk=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function vk(t,e){const n=t.data,s=t.width,i=t.height;let o,d,f,m,y,v,b,_,j,w,O,R,T,A,z,k,P,H,B,L;const V=e+e+1,Z=s-1,oe=i-1,ne=e+1,J=ne*(ne+1)/2,ie=new B5,ce=xk[e],Y=bk[e];let $=null,ae=ie,Ne=null,re=null;for(let G=1;G<V;G++)ae=ae.next=new B5,G===ne&&($=ae);ae.next=ie,f=d=0;for(let G=0;G<i;G++){R=T=A=z=m=y=v=b=0,_=ne*(k=n[d]),j=ne*(P=n[d+1]),w=ne*(H=n[d+2]),O=ne*(B=n[d+3]),m+=J*k,y+=J*P,v+=J*H,b+=J*B,ae=ie;for(let W=0;W<ne;W++)ae.r=k,ae.g=P,ae.b=H,ae.a=B,ae=ae.next;for(let W=1;W<ne;W++)o=d+((Z<W?Z:W)<<2),m+=(ae.r=k=n[o])*(L=ne-W),y+=(ae.g=P=n[o+1])*L,v+=(ae.b=H=n[o+2])*L,b+=(ae.a=B=n[o+3])*L,R+=k,T+=P,A+=H,z+=B,ae=ae.next;Ne=ie,re=$;for(let W=0;W<s;W++)n[d+3]=B=b*ce>>Y,B!==0?(B=255/B,n[d]=(m*ce>>Y)*B,n[d+1]=(y*ce>>Y)*B,n[d+2]=(v*ce>>Y)*B):n[d]=n[d+1]=n[d+2]=0,m-=_,y-=j,v-=w,b-=O,_-=Ne.r,j-=Ne.g,w-=Ne.b,O-=Ne.a,o=f+((o=W+e+1)<Z?o:Z)<<2,R+=Ne.r=n[o],T+=Ne.g=n[o+1],A+=Ne.b=n[o+2],z+=Ne.a=n[o+3],m+=R,y+=T,v+=A,b+=z,Ne=Ne.next,_+=k=re.r,j+=P=re.g,w+=H=re.b,O+=B=re.a,R-=k,T-=P,A-=H,z-=B,re=re.next,d+=4;f+=s}for(let G=0;G<s;G++){T=A=z=R=y=v=b=m=0,d=G<<2,_=ne*(k=n[d]),j=ne*(P=n[d+1]),w=ne*(H=n[d+2]),O=ne*(B=n[d+3]),m+=J*k,y+=J*P,v+=J*H,b+=J*B,ae=ie;for(let he=0;he<ne;he++)ae.r=k,ae.g=P,ae.b=H,ae.a=B,ae=ae.next;let W=s;for(let he=1;he<=e;he++)d=W+G<<2,m+=(ae.r=k=n[d])*(L=ne-he),y+=(ae.g=P=n[d+1])*L,v+=(ae.b=H=n[d+2])*L,b+=(ae.a=B=n[d+3])*L,R+=k,T+=P,A+=H,z+=B,ae=ae.next,he<oe&&(W+=s);d=G,Ne=ie,re=$;for(let he=0;he<i;he++)o=d<<2,n[o+3]=B=b*ce>>Y,B>0?(B=255/B,n[o]=(m*ce>>Y)*B,n[o+1]=(y*ce>>Y)*B,n[o+2]=(v*ce>>Y)*B):n[o]=n[o+1]=n[o+2]=0,m-=_,y-=j,v-=w,b-=O,_-=Ne.r,j-=Ne.g,w-=Ne.b,O-=Ne.a,o=G+((o=he+ne)<oe?o:oe)*s<<2,m+=R+=Ne.r=n[o],y+=T+=Ne.g=n[o+1],v+=A+=Ne.b=n[o+2],b+=z+=Ne.a=n[o+3],Ne=Ne.next,_+=k=re.r,j+=P=re.g,w+=H=re.b,O+=B=re.a,R-=k,T-=P,A-=H,z-=B,re=re.next,d+=s}}const Sk=function(e){const n=Math.round(this.blurRadius());n>0&&vk(e,n)};X.addGetterSetter(Ae,"blurRadius",0,Te(),X.afterSetFilter);const Nk=function(t){const e=this.brightness()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};X.addGetterSetter(Ae,"brightness",0,Te(),X.afterSetFilter);const _k=function(t){const e=this.brightness(),n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]=Math.min(255,n[i]*e),n[i+1]=Math.min(255,n[i+1]*e),n[i+2]=Math.min(255,n[i+2]*e)},Ck=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,s=n.length;let i=150,o=150,d=150;for(let f=0;f<s;f+=4)i=n[f],o=n[f+1],d=n[f+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,d/=255,d-=.5,d*=e,d+=.5,d*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,d=d<0?0:d>255?255:d,n[f]=i,n[f+1]=o,n[f+2]=d};X.addGetterSetter(Ae,"contrast",0,Te(),X.afterSetFilter);const jk=function(t){var e,n,s,i,o,d,f,m,y;const v=t.data,b=t.width,_=t.height,j=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),w=Math.min(1,Math.max(0,(i=(s=this.embossWhiteLevel)===null||s===void 0?void 0:s.call(this))!==null&&i!==void 0?i:.5)),R=(f={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(d=(o=this.embossDirection)===null||o===void 0?void 0:o.call(this))!==null&&d!==void 0?d:"top-left"])!==null&&f!==void 0?f:315,T=!!((y=(m=this.embossBlend)===null||m===void 0?void 0:m.call(this))!==null&&y!==void 0&&y),A=j*10,z=w*255,k=R*Math.PI/180,P=Math.cos(k),H=Math.sin(k),B=128/1020*A,L=new Uint8ClampedArray(v),V=new Float32Array(b*_);for(let ie=0,ce=0;ce<v.length;ce+=4,ie++)V[ie]=.2126*L[ce]+.7152*L[ce+1]+.0722*L[ce+2];const Z=[-1,0,1,-2,0,2,-1,0,1],oe=[-1,-2,-1,0,0,0,1,2,1],ne=[-b-1,-b,-b+1,-1,0,1,b-1,b,b+1],J=ie=>ie<0?0:ie>255?255:ie;for(let ie=1;ie<_-1;ie++)for(let ce=1;ce<b-1;ce++){const Y=ie*b+ce;let $=0,ae=0;$+=V[Y+ne[0]]*Z[0],ae+=V[Y+ne[0]]*oe[0],$+=V[Y+ne[1]]*Z[1],ae+=V[Y+ne[1]]*oe[1],$+=V[Y+ne[2]]*Z[2],ae+=V[Y+ne[2]]*oe[2],$+=V[Y+ne[3]]*Z[3],ae+=V[Y+ne[3]]*oe[3],$+=V[Y+ne[5]]*Z[5],ae+=V[Y+ne[5]]*oe[5],$+=V[Y+ne[6]]*Z[6],ae+=V[Y+ne[6]]*oe[6],$+=V[Y+ne[7]]*Z[7],ae+=V[Y+ne[7]]*oe[7],$+=V[Y+ne[8]]*Z[8],ae+=V[Y+ne[8]]*oe[8];const Ne=P*$+H*ae,re=J(z+Ne*B),G=Y*4;if(T){const W=re-z;v[G]=J(L[G]+W),v[G+1]=J(L[G+1]+W),v[G+2]=J(L[G+2]+W),v[G+3]=L[G+3]}else v[G]=v[G+1]=v[G+2]=re,v[G+3]=L[G+3]}for(let ie=0;ie<b;ie++){let ce=ie*4,Y=((_-1)*b+ie)*4;v[ce]=L[ce],v[ce+1]=L[ce+1],v[ce+2]=L[ce+2],v[ce+3]=L[ce+3],v[Y]=L[Y],v[Y+1]=L[Y+1],v[Y+2]=L[Y+2],v[Y+3]=L[Y+3]}for(let ie=1;ie<_-1;ie++){let ce=ie*b*4,Y=(ie*b+(b-1))*4;v[ce]=L[ce],v[ce+1]=L[ce+1],v[ce+2]=L[ce+2],v[ce+3]=L[ce+3],v[Y]=L[Y],v[Y+1]=L[Y+1],v[Y+2]=L[Y+2],v[Y+3]=L[Y+3]}return t};X.addGetterSetter(Ae,"embossStrength",.5,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"embossWhiteLevel",.5,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"embossDirection","top-left",void 0,X.afterSetFilter);X.addGetterSetter(Ae,"embossBlend",!1,void 0,X.afterSetFilter);function jx(t,e,n,s,i){const o=n-e,d=i-s;if(o===0)return s+d/2;if(d===0)return s;let f=(t-e)/o;return f=d*f+s,f}const wk=function(t){const e=t.data,n=e.length;let s=e[0],i=s,o,d=e[1],f=d,m,y=e[2],v=y,b;const _=this.enhance();if(_===0)return;for(let z=0;z<n;z+=4)o=e[z+0],o<s?s=o:o>i&&(i=o),m=e[z+1],m<d?d=m:m>f&&(f=m),b=e[z+2],b<y?y=b:b>v&&(v=b);i===s&&(i=255,s=0),f===d&&(f=255,d=0),v===y&&(v=255,y=0);let j,w,O,R,T,A;if(_>0)j=i+_*(255-i),w=s-_*(s-0),O=f+_*(255-f),R=d-_*(d-0),T=v+_*(255-v),A=y-_*(y-0);else{const z=(i+s)*.5;j=i+_*(i-z),w=s+_*(s-z);const k=(f+d)*.5;O=f+_*(f-k),R=d+_*(d-k);const P=(v+y)*.5;T=v+_*(v-P),A=y+_*(y-P)}for(let z=0;z<n;z+=4)e[z+0]=jx(e[z+0],s,i,w,j),e[z+1]=jx(e[z+1],d,f,R,O),e[z+2]=jx(e[z+2],y,v,A,T)};X.addGetterSetter(Ae,"enhance",0,Te(),X.afterSetFilter);const Ek=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=.34*e[s]+.5*e[s+1]+.16*e[s+2];e[s]=i,e[s+1]=i,e[s+2]=i}};X.addGetterSetter(Ae,"hue",0,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"saturation",0,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"luminance",0,Te(),X.afterSetFilter);const Tk=function(t){const e=t.data,n=e.length,s=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=this.luminance()*127,f=s*i*Math.cos(o*Math.PI/180),m=s*i*Math.sin(o*Math.PI/180),y=.299*s+.701*f+.167*m,v=.587*s-.587*f+.33*m,b=.114*s-.114*f-.497*m,_=.299*s-.299*f-.328*m,j=.587*s+.413*f+.035*m,w=.114*s-.114*f+.293*m,O=.299*s-.3*f+1.25*m,R=.587*s-.586*f-1.05*m,T=.114*s+.886*f-.2*m;let A,z,k,P;for(let H=0;H<n;H+=4)A=e[H+0],z=e[H+1],k=e[H+2],P=e[H+3],e[H+0]=y*A+v*z+b*k+d,e[H+1]=_*A+j*z+w*k+d,e[H+2]=O*A+R*z+T*k+d,e[H+3]=P},Rk=function(t){const e=t.data,n=e.length,s=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=s*i*Math.cos(o*Math.PI/180),f=s*i*Math.sin(o*Math.PI/180),m=.299*s+.701*d+.167*f,y=.587*s-.587*d+.33*f,v=.114*s-.114*d-.497*f,b=.299*s-.299*d-.328*f,_=.587*s+.413*d+.035*f,j=.114*s-.114*d+.293*f,w=.299*s-.3*d+1.25*f,O=.587*s-.586*d-1.05*f,R=.114*s+.886*d-.2*f;for(let T=0;T<n;T+=4){const A=e[T+0],z=e[T+1],k=e[T+2],P=e[T+3];e[T+0]=m*A+y*z+v*k,e[T+1]=b*A+_*z+j*k,e[T+2]=w*A+O*z+R*k,e[T+3]=P}};X.addGetterSetter(Ae,"hue",0,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"saturation",0,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"value",0,Te(),X.afterSetFilter);const Ok=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4)e[s]=255-e[s],e[s+1]=255-e[s+1],e[s+2]=255-e[s+2]},Ak=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,m=n.polarCenterY||d/2;let y=Math.sqrt(f*f+m*m),v=o-f,b=d-m;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const j=d,w=o,O=360/w*Math.PI/180;for(let R=0;R<w;R+=1){const T=Math.sin(R*O),A=Math.cos(R*O);for(let z=0;z<j;z+=1){v=Math.floor(f+y*z/j*A),b=Math.floor(m+y*z/j*T);let k=(b*o+v)*4;const P=s[k+0],H=s[k+1],B=s[k+2],L=s[k+3];k=(R+z*o)*4,i[k+0]=P,i[k+1]=H,i[k+2]=B,i[k+3]=L}}},Mk=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,m=n.polarCenterY||d/2;let y=Math.sqrt(f*f+m*m),v=o-f,b=d-m;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const j=d,w=o,O=0;let R,T;for(v=0;v<o;v+=1)for(b=0;b<d;b+=1){const A=v-f,z=b-m,k=Math.sqrt(A*A+z*z)*j/y;let P=(Math.atan2(z,A)*180/Math.PI+360+O)%360;P=P*w/360,R=Math.floor(P),T=Math.floor(k);let H=(T*o+R)*4;const B=s[H+0],L=s[H+1],V=s[H+2],Z=s[H+3];H=(b*o+v)*4,i[H+0]=B,i[H+1]=L,i[H+2]=V,i[H+3]=Z}},Dk=function(t){const e=t.width,n=t.height;let s,i,o,d,f,m,y,v,b,_,j=Math.round(this.kaleidoscopePower());const w=Math.round(this.kaleidoscopeAngle()),O=Math.floor(e*(w%360)/360);if(j<1)return;const R=ee.createCanvasElement();R.width=e,R.height=n;const T=R.getContext("2d").getImageData(0,0,e,n);ee.releaseCanvas(R),Ak(t,T,{polarCenterX:e/2,polarCenterY:n/2});let A=e/Math.pow(2,j);for(;A<=8;)A=A*2,j-=1;A=Math.ceil(A);let z=A,k=0,P=z,H=1;for(O+A>e&&(k=z,P=0,H=-1),i=0;i<n;i+=1)for(s=k;s!==P;s+=H)o=Math.round(s+O)%e,b=(e*i+o)*4,f=T.data[b+0],m=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+s)*4,T.data[_+0]=f,T.data[_+1]=m,T.data[_+2]=y,T.data[_+3]=v;for(i=0;i<n;i+=1)for(z=Math.floor(A),d=0;d<j;d+=1){for(s=0;s<z+1;s+=1)b=(e*i+s)*4,f=T.data[b+0],m=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+z*2-s-1)*4,T.data[_+0]=f,T.data[_+1]=m,T.data[_+2]=y,T.data[_+3]=v;z*=2}Mk(T,t,{})};X.addGetterSetter(Ae,"kaleidoscopePower",2,Te(),X.afterSetFilter);X.addGetterSetter(Ae,"kaleidoscopeAngle",0,Te(),X.afterSetFilter);function o1(t,e,n){let s=(n*t.width+e)*4;const i=[];return i.push(t.data[s++],t.data[s++],t.data[s++],t.data[s++]),i}function im(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function zk(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function kk(t,e){const n=o1(t,0,0),s=o1(t,t.width-1,0),i=o1(t,0,t.height-1),o=o1(t,t.width-1,t.height-1),d=e||10;if(im(n,s)<d&&im(s,o)<d&&im(o,i)<d&&im(i,n)<d){const f=zk([s,n,o,i]),m=[];for(let y=0;y<t.width*t.height;y++){const v=im(f,[t.data[y*4],t.data[y*4+1],t.data[y*4+2]]);m[y]=v<d?0:255}return m}}function Lk(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function Uk(t,e,n){const s=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const O=j*e+w,R=s[b*i+_];v+=t[O]*R}}d[y]=v===2040?255:0}return d}function Hk(t,e,n){const s=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const O=j*e+w,R=s[b*i+_];v+=t[O]*R}}d[y]=v>=1020?255:0}return d}function qk(t,e,n){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const O=j*e+w,R=s[b*i+_];v+=t[O]*R}}d[y]=v}return d}const Bk=function(t){const e=this.threshold();let n=kk(t,e);return n&&(n=Uk(n,t.width,t.height),n=Hk(n,t.width,t.height),n=qk(n,t.width,t.height),Lk(t,n)),t};X.addGetterSetter(Ae,"threshold",0,Te(),X.afterSetFilter);const Gk=function(t){const e=this.noise()*255,n=t.data,s=n.length,i=e/2;for(let o=0;o<s;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};X.addGetterSetter(Ae,"noise",.2,Te(),X.afterSetFilter);const Pk=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,s=t.height,i=Math.ceil(n/e),o=Math.ceil(s/e),d=t.data;if(e<=0){ee.error("pixelSize value can not be <= 0");return}for(let f=0;f<i;f+=1)for(let m=0;m<o;m+=1){let y=0,v=0,b=0,_=0;const j=f*e,w=j+e,O=m*e,R=O+e;let T=0;for(let A=j;A<w;A+=1)if(!(A>=n))for(let z=O;z<R;z+=1){if(z>=s)continue;const k=(n*z+A)*4;y+=d[k+0],v+=d[k+1],b+=d[k+2],_+=d[k+3],T+=1}y=y/T,v=v/T,b=b/T,_=_/T;for(let A=j;A<w;A+=1)if(!(A>=n))for(let z=O;z<R;z+=1){if(z>=s)continue;const k=(n*z+A)*4;d[k+0]=y,d[k+1]=v,d[k+2]=b,d[k+3]=_}}};X.addGetterSetter(Ae,"pixelSize",8,Te(),X.afterSetFilter);const Yk=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,s=n.length,i=255/e;for(let o=0;o<s;o+=1)n[o]=Math.floor(n[o]/i)*i};X.addGetterSetter(Ae,"levels",.5,Te(),X.afterSetFilter);const Vk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue();for(let d=0;d<n;d+=4){const f=(.34*e[d]+.5*e[d+1]+.16*e[d+2])/255;e[d]=f*s,e[d+1]=f*i,e[d+2]=f*o,e[d+3]=e[d+3]}};X.addGetterSetter(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});X.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});X.addGetterSetter(Ae,"blue",0,y8,X.afterSetFilter);const Qk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue(),d=this.alpha();for(let f=0;f<n;f+=4){const m=1-d;e[f]=s*d+e[f]*m,e[f+1]=i*d+e[f+1]*m,e[f+2]=o*d+e[f+2]*m}};X.addGetterSetter(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});X.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});X.addGetterSetter(Ae,"blue",0,y8,X.afterSetFilter);X.addGetterSetter(Ae,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const Xk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=e[s+0],o=e[s+1],d=e[s+2];e[s+0]=Math.min(255,i*.393+o*.769+d*.189),e[s+1]=Math.min(255,i*.349+o*.686+d*.168),e[s+2]=Math.min(255,i*.272+o*.534+d*.131)}},Kk=function(t){const n=t.data;for(let s=0;s<n.length;s+=4){const i=n[s],o=n[s+1],d=n[s+2];.2126*i+.7152*o+.0722*d>=128&&(n[s]=255-i,n[s+1]=255-o,n[s+2]=255-d)}return t},Fk=function(t){const e=this.threshold()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=1)n[i]=n[i]<e?0:255};X.addGetterSetter(Ae,"threshold",.5,Te(),X.afterSetFilter);sh.Util._assign(sh,{Arc:mo,Arrow:ld,Circle:hh,Ellipse:Hu,Image:Or,Label:Av,Tag:od,Line:go,Path:Cn,Rect:Jm,RegularPolygon:qu,Ring:ud,Sprite:Sl,Star:Bu,Text:jn,TextPath:Ua,Transformer:Lt,Wedge:yo,Filters:{Blur:Sk,Brightness:_k,Brighten:Nk,Contrast:Ck,Emboss:jk,Enhance:wk,Grayscale:Ek,HSL:Tk,HSV:Rk,Invert:Ok,Kaleidoscope:Dk,Mask:Bk,Noise:Gk,Pixelate:Pk,Posterize:Yk,RGB:Vk,RGBA:Qk,Sepia:Xk,Solarize:Kk,Threshold:Fk}});var wx={exports:{}},Ex={exports:{}};/**
565
+ * @license React
566
+ * react-reconciler.production.js
567
+ *
568
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
569
+ *
570
+ * This source code is licensed under the MIT license found in the
571
+ * LICENSE file in the root directory of this source tree.
572
+ */var G5;function Zk(){return G5||(G5=1,(function(t){t.exports=function(e){function n(l,u,g,x){return new Ph(l,u,g,x)}function s(){}function i(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){var u=l,g=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(g=u.return),l=u.return;while(l)}return u.tag===3?g:null}function d(l){if(o(l)!==l)throw Error(i(188))}function f(l){var u=l.alternate;if(!u){if(u=o(l),u===null)throw Error(i(188));return u!==l?null:l}for(var g=l,x=u;;){var C=g.return;if(C===null)break;var E=C.alternate;if(E===null){if(x=C.return,x!==null){g=x;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===g)return d(C),l;if(E===x)return d(C),u;E=E.sibling}throw Error(i(188))}if(g.return!==x.return)g=C,x=E;else{for(var U=!1,F=C.child;F;){if(F===g){U=!0,g=C,x=E;break}if(F===x){U=!0,x=C,g=E;break}F=F.sibling}if(!U){for(F=E.child;F;){if(F===g){U=!0,g=E,x=C;break}if(F===x){U=!0,x=E,g=C;break}F=F.sibling}if(!U)throw Error(i(189))}}if(g.alternate!==x)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:u}function m(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(u=m(l),u!==null)return u;l=l.sibling}return null}function y(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(u=y(l),u!==null))return u;l=l.sibling}return null}function v(l){return l===null||typeof l!="object"?null:(l=xi&&l[xi]||l["@@iterator"],typeof l=="function"?l:null)}function b(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Xi?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case kl:return"Fragment";case Ul:return"Profiler";case Ll:return"StrictMode";case Qd:return"Suspense";case yi:return"SuspenseList";case fc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case zl:return"Portal";case Is:return l.displayName||"Context";case dc:return(l._context.displayName||"Context")+".Consumer";case Bo:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Xd:return u=l.displayName||null,u!==null?u:b(l.type)||"Memo";case Ia:u=l._payload,l=l._init;try{return b(l(u))}catch{}}return null}function _(l){return{current:l}}function j(l){0>Pl||(l.current=rf[Pl],rf[Pl]=null,Pl--)}function w(l,u){Pl++,rf[Pl]=l.current,l.current=u}function O(l){return l>>>=0,l===0?32:31-(lf(l)/m0|0)|0}function R(l){var u=l&42;if(u!==0)return u;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function T(l,u,g){var x=l.pendingLanes;if(x===0)return 0;var C=0,E=l.suspendedLanes,U=l.pingedLanes;l=l.warmLanes;var F=x&134217727;return F!==0?(x=F&~E,x!==0?C=R(x):(U&=F,U!==0?C=R(U):g||(g=F&~l,g!==0&&(C=R(g))))):(F=x&~E,F!==0?C=R(F):U!==0?C=R(U):g||(g=x&~l,g!==0&&(C=R(g)))),C===0?0:u!==0&&u!==C&&(u&E)===0&&(E=C&-C,g=u&-u,E>=g||E===32&&(g&4194048)!==0)?u:C}function A(l,u){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&u)===0}function z(l,u){switch(l){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function k(){var l=Ko;return Ko<<=1,(Ko&62914560)===0&&(Ko=4194304),l}function P(l){for(var u=[],g=0;31>g;g++)u.push(l);return u}function H(l,u){l.pendingLanes|=u,u!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function B(l,u,g,x,C,E){var U=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var F=l.entanglements,me=l.expirationTimes,Se=l.hiddenUpdates;for(g=U&~g;0<g;){var Re=31-ms(g),Ce=1<<Re;F[Re]=0,me[Re]=-1;var Le=Se[Re];if(Le!==null)for(Se[Re]=null,Re=0;Re<Le.length;Re++){var st=Le[Re];st!==null&&(st.lane&=-536870913)}g&=~Ce}x!==0&&L(l,x,0),E!==0&&C===0&&l.tag!==0&&(l.suspendedLanes|=E&~(U&~u))}function L(l,u,g){l.pendingLanes|=u,l.suspendedLanes&=~u;var x=31-ms(u);l.entangledLanes|=u,l.entanglements[x]=l.entanglements[x]|1073741824|g&261930}function V(l,u){var g=l.entangledLanes|=u;for(l=l.entanglements;g;){var x=31-ms(g),C=1<<x;C&u|l[x]&u&&(l[x]|=u),g&=~C}}function Z(l,u){var g=u&-u;return g=(g&42)!==0?1:oe(g),(g&(l.suspendedLanes|u))!==0?0:g}function oe(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function ne(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function J(l){if(typeof Ep=="function"&&x0(l),gs&&typeof gs.setStrictMode=="function")try{gs.setStrictMode(Vl,l)}catch{}}function ie(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}function ce(l){if(hf===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);hf=u&&u[1]||"",Kr=-1<g.stack.indexOf(`
573
+ at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
574
+ `+hf+l+Kr}function Y(l,u){if(!l||Sc)return"";Sc=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(st){var Le=st}Reflect.construct(l,[],Ce)}else{try{Ce.call()}catch(st){Le=st}l.call(Ce.prototype)}}else{try{throw Error()}catch(st){Le=st}(Ce=l())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(st){if(st&&Le&&typeof st.stack=="string")return[st.stack,Le.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),U=E[0],F=E[1];if(U&&F){var me=U.split(`
575
+ `),Se=F.split(`
576
+ `);for(C=x=0;x<me.length&&!me[x].includes("DetermineComponentFrameRoot");)x++;for(;C<Se.length&&!Se[C].includes("DetermineComponentFrameRoot");)C++;if(x===me.length||C===Se.length)for(x=me.length-1,C=Se.length-1;1<=x&&0<=C&&me[x]!==Se[C];)C--;for(;1<=x&&0<=C;x--,C--)if(me[x]!==Se[C]){if(x!==1||C!==1)do if(x--,C--,0>C||me[x]!==Se[C]){var Re=`
577
+ `+me[x].replace(" at new "," at ");return l.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",l.displayName)),Re}while(1<=x&&0<=C);break}}}finally{Sc=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?ce(g):""}function $(l,u){switch(l.tag){case 26:case 27:case 5:return ce(l.type);case 16:return ce("Lazy");case 13:return l.child!==u&&u!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Y(l.type,!1);case 11:return Y(l.type.render,!1);case 1:return Y(l.type,!0);case 31:return ce("Activity");default:return""}}function ae(l){try{var u="",g=null;do u+=$(l,g),g=l,l=l.return;while(l);return u}catch(x){return`
578
+ Error generating stack: `+x.message+`
579
+ `+x.stack}}function Ne(l,u){if(typeof l=="object"&&l!==null){var g=Tp.get(l);return g!==void 0?g:(u={value:l,source:u,stack:ae(u)},Tp.set(l,u),u)}return{value:l,source:u,stack:ae(u)}}function re(l,u){Si[Fr++]=Nc,Si[Fr++]=tn,tn=l,Nc=u}function G(l,u,g){$s[zs++]=Aa,$s[zs++]=vr,$s[zs++]=er,er=l;var x=Aa;l=vr;var C=32-ms(x)-1;x&=~(1<<C),g+=1;var E=32-ms(u)+C;if(30<E){var U=C-C%5;E=(x&(1<<U)-1).toString(32),x>>=U,C-=U,Aa=1<<32-ms(u)+C|g<<C|x,vr=E+l}else Aa=1<<E|g<<C|x,vr=l}function W(l){l.return!==null&&(re(l,1),G(l,1,0))}function he(l){for(;l===tn;)tn=Si[--Fr],Si[Fr]=null,Nc=Si[--Fr],Si[Fr]=null;for(;l===er;)er=$s[--zs],$s[zs]=null,vr=$s[--zs],$s[zs]=null,Aa=$s[--zs],$s[zs]=null}function xe(l,u){$s[zs++]=Aa,$s[zs++]=vr,$s[zs++]=er,Aa=u.id,vr=u.overflow,er=l}function _e(l,u){w(Ma,u),w(Ni,l),w(Sa,null),l=Ag(u),j(Sa),w(Sa,l)}function je(){j(Sa),j(Ni),j(Ma)}function De(l){l.memoizedState!==null&&w(_c,l);var u=Sa.current,g=Yo(u,l.type);u!==g&&(w(Ni,l),w(Sa,g))}function nt(l){Ni.current===l&&(j(Sa),j(Ni)),_c.current===l&&(j(_c),Kn?Bl._currentValue=ql:Bl._currentValue2=ql)}function ze(l){var u=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vn(Ne(u,l)),pf}function Vt(l,u){if(!vn)throw Error(i(175));a0(l.stateNode,l.type,l.memoizedProps,u,l)||ze(l,!0)}function $e(l){for(ca=l.return;ca;)switch(ca.tag){case 5:case 31:case 13:Wa=!1;return;case 27:case 3:Wa=!0;return;default:ca=ca.return}}function At(l){if(!vn||l!==ca)return!1;if(!St)return $e(l),St=!0,!1;var u=l.tag;if(ua?u!==3&&u!==27&&(u!==5||Xo(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l):u!==3&&(u!==5||Xo(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l),$e(l),u===13){if(!vn)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=gp(l)}else if(u===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=r0(l)}else Sn=ua&&u===27?Zg(l.type,Sn):ca?Fg(l.stateNode):null;return!0}function qt(){vn&&(Sn=ca=null,St=!1)}function wn(){var l=Zr;return l!==null&&(xs===null?xs=l:xs.push.apply(xs,l),Zr=null),l}function Vn(l){Zr===null?Zr=[l]:Zr.push(l)}function Gt(l,u,g){Kn?(w(tr,u._currentValue),u._currentValue=g):(w(tr,u._currentValue2),u._currentValue2=g)}function fn(l){var u=tr.current;Kn?l._currentValue=u:l._currentValue2=u,j(tr)}function fr(l,u,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),l===g)break;l=l.return}}function Ft(l,u,g,x){var C=l.child;for(C!==null&&(C.return=l);C!==null;){var E=C.dependencies;if(E!==null){var U=C.child;E=E.firstContext;e:for(;E!==null;){var F=E;E=C;for(var me=0;me<u.length;me++)if(F.context===u[me]){E.lanes|=g,F=E.alternate,F!==null&&(F.lanes|=g),fr(E.return,g,l),x||(U=null);break e}E=F.next}}else if(C.tag===18){if(U=C.return,U===null)throw Error(i(341));U.lanes|=g,E=U.alternate,E!==null&&(E.lanes|=g),fr(U,g,l),U=null}else U=C.child;if(U!==null)U.return=C;else for(U=C;U!==null;){if(U===l){U=null;break}if(C=U.sibling,C!==null){C.return=U.return,U=C;break}U=U.return}C=U}}function Et(l,u,g,x){l=null;for(var C=u,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var U=C.alternate;if(U===null)throw Error(i(387));if(U=U.memoizedProps,U!==null){var F=C.type;Zn(C.pendingProps.value,U.value)||(l!==null?l.push(F):l=[F])}}else if(C===_c.current){if(U=C.alternate,U===null)throw Error(i(387));U.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(l!==null?l.push(Bl):l=[Bl])}C=C.return}l!==null&&Ft(u,l,g,x),u.flags|=262144}function Un(l){for(l=l.firstContext;l!==null;){var u=l.context;if(!Zn(Kn?u._currentValue:u._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function hn(l){un=l,Sr=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Zt(l){return Ns(un,l)}function Qn(l,u){return un===null&&hn(l),Ns(l,u)}function Ns(l,u){var g=Kn?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Sr===null){if(l===null)throw Error(i(308));Sr=u,l.dependencies={lanes:0,firstContext:u},l.flags|=524288}else Sr=Sr.next=u;return g}function hr(){return{controller:new b0,data:new Map,refCount:0}}function Qa(l){l.refCount--,l.refCount===0&&Na(gy,function(){l.controller.abort()})}function ia(){}function Ea(l){l!==It&&l.next===null&&(It===null?Cc=It=l:It=It.next=l),nr=!0,Pa||(Pa=!0,ya())}function is(l,u){if(!mf&&nr){mf=!0;do for(var g=!1,x=Cc;x!==null;){if(l!==0){var C=x.pendingLanes;if(C===0)var E=0;else{var U=x.suspendedLanes,F=x.pingedLanes;E=(1<<31-ms(42|l)+1)-1,E&=C&~(U&~F),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,ls(x,E))}else E=Nt,E=T(x,x===ht?E:0,x.cancelPendingCommit!==null||x.timeoutHandle!==ps),(E&3)===0||A(x,E)||(g=!0,ls(x,E));x=x.next}while(g);mf=!1}}function pr(){_s()}function _s(){nr=Pa=!1;var l=0;Ji!==0&&Hl()&&(l=Ji);for(var u=Ga(),g=null,x=Cc;x!==null;){var C=x.next,E=Bs(x,u);E===0?(x.next=null,g===null?Cc=C:g.next=C,C===null&&(It=g)):(g=x,(l!==0||(E&3)!==0)&&(nr=!0)),x=C}aa!==0&&aa!==5||is(l),Ji!==0&&(Ji=0)}function Bs(l,u){for(var g=l.suspendedLanes,x=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes&-62914561;0<E;){var U=31-ms(E),F=1<<U,me=C[U];me===-1?((F&g)===0||(F&x)!==0)&&(C[U]=z(F,u)):me<=u&&(l.expiredLanes|=F),E&=~F}if(u=ht,g=Nt,g=T(l,l===u?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==ps),x=l.callbackNode,g===0||l===u&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&uf(x),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||A(l,g)){if(u=g&-g,u===l.callbackPriority)return u;switch(x!==null&&uf(x),ne(g)){case 2:case 8:g=y0;break;case 32:g=vc;break;case 268435456:g=df;break;default:g=vc}return x=$n.bind(null,l),g=bc(g,x),l.callbackPriority=u,l.callbackNode=g,u}return x!==null&&x!==null&&uf(x),l.callbackPriority=2,l.callbackNode=null,2}function $n(l,u){if(aa!==0&&aa!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(Vr()&&l.callbackNode!==g)return null;var x=Nt;return x=T(l,l===ht?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==ps),x===0?null:(br(l,x,u),Bs(l,Ga()),l.callbackNode!=null&&l.callbackNode===g?$n.bind(null,l):null)}function ls(l,u){if(Vr())return null;br(l,u,!0)}function ya(){ep?tp(function(){(xt&6)!==0?bc(cf,pr):_s()}):bc(cf,pr)}function Ta(){if(Ji===0){var l=_i;l===0&&(l=of,of<<=1,(of&261888)===0&&(of=256)),Ji=l}return Ji}function Pu(l,u){if(Fo===null){var g=Fo=[];Rp=0,_i=Ta(),da={status:"pending",value:void 0,then:function(x){g.push(x)}}}return Rp++,u.then(Nl,Nl),u}function Nl(){if(--Rp===0&&Fo!==null){da!==null&&(da.status="fulfilled");var l=Fo;Fo=null,_i=0,da=null;for(var u=0;u<l.length;u++)(0,l[u])()}}function Cs(l,u){var g=[],x={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return l.then(function(){x.status="fulfilled",x.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(x.status="rejected",x.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),x}function mr(){var l=Wi.current;return l!==null?l:ht.pooledCache}function gt(l,u){u===null?w(Wi,Wi.current):w(Wi,u.pool)}function pt(){var l=mr();return l===null?null:{parent:Kn?Nn._currentValue:Nn._currentValue2,pool:l}}function Qt(l,u){if(Zn(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var g=Object.keys(l),x=Object.keys(u);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var C=g[x];if(!my.call(u,C)||!Zn(l[C],u[C]))return!1}return!0}function Mt(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Hn(l,u,g){switch(g=l[g],g===void 0?l.push(u):g!==u&&(u.then(ia,ia),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,yn(l),l;default:if(typeof u.status=="string")u.then(ia,ia);else{if(l=ht,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=u,l.status="pending",l.then(function(x){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=x}},function(x){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,yn(l),l}throw $a=u,fa}}function rn(l){try{var u=l._init;return u(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?($a=g,fa):g}}function Xn(){if($a===null)throw Error(i(459));var l=$a;return $a=null,l}function yn(l){if(l===fa||l===sr)throw Error(i(483))}function Ra(l){var u=Ql;return Ql+=1,$i===null&&($i=[]),Hn($i,l,u)}function la(l,u){u=u.props.ref,l.ref=u!==void 0?u:null}function os(l,u){throw u.$$typeof===Dl?Error(i(525)):(l=Object.prototype.toString.call(u),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l)))}function Gs(l){function u(de,se){if(l){var pe=de.deletions;pe===null?(de.deletions=[se],de.flags|=16):pe.push(se)}}function g(de,se){if(!l)return null;for(;se!==null;)u(de,se),se=se.sibling;return null}function x(de){for(var se=new Map;de!==null;)de.key!==null?se.set(de.key,de):se.set(de.index,de),de=de.sibling;return se}function C(de,se){return de=Ms(de,se),de.index=0,de.sibling=null,de}function E(de,se,pe){return de.index=pe,l?(pe=de.alternate,pe!==null?(pe=pe.index,pe<se?(de.flags|=67108866,se):pe):(de.flags|=67108866,se)):(de.flags|=1048576,se)}function U(de){return l&&de.alternate===null&&(de.flags|=67108866),de}function F(de,se,pe,Ee){return se===null||se.tag!==6?(se=Yh(pe,de.mode,Ee),se.return=de,se):(se=C(se,pe),se.return=de,se)}function me(de,se,pe,Ee){var Ke=pe.type;return Ke===kl?Re(de,se,pe.props.children,Ee,pe.key):se!==null&&(se.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===Ia&&rn(Ke)===se.type)?(se=C(se,pe.props),la(se,pe),se.return=de,se):(se=gi(pe.type,pe.key,pe.props,null,de.mode,Ee),la(se,pe),se.return=de,se)}function Se(de,se,pe,Ee){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=Qh(pe,de.mode,Ee),se.return=de,se):(se=C(se,pe.children||[]),se.return=de,se)}function Re(de,se,pe,Ee,Ke){return se===null||se.tag!==7?(se=Zs(pe,de.mode,Ee,Ke),se.return=de,se):(se=C(se,pe),se.return=de,se)}function Ce(de,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Yh(""+se,de.mode,pe),se.return=de,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Qr:return pe=gi(se.type,se.key,se.props,null,de.mode,pe),la(pe,se),pe.return=de,pe;case zl:return se=Qh(se,de.mode,pe),se.return=de,se;case Ia:return se=rn(se),Ce(de,se,pe)}if(Ki(se)||v(se))return se=Zs(se,de.mode,pe,null),se.return=de,se;if(typeof se.then=="function")return Ce(de,Ra(se),pe);if(se.$$typeof===Is)return Ce(de,Qn(de,se),pe);os(de,se)}return null}function Le(de,se,pe,Ee){var Ke=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Ke!==null?null:F(de,se,""+pe,Ee);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Qr:return pe.key===Ke?me(de,se,pe,Ee):null;case zl:return pe.key===Ke?Se(de,se,pe,Ee):null;case Ia:return pe=rn(pe),Le(de,se,pe,Ee)}if(Ki(pe)||v(pe))return Ke!==null?null:Re(de,se,pe,Ee,null);if(typeof pe.then=="function")return Le(de,se,Ra(pe),Ee);if(pe.$$typeof===Is)return Le(de,se,Qn(de,pe),Ee);os(de,pe)}return null}function st(de,se,pe,Ee,Ke){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return de=de.get(pe)||null,F(se,de,""+Ee,Ke);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case Qr:return de=de.get(Ee.key===null?pe:Ee.key)||null,me(se,de,Ee,Ke);case zl:return de=de.get(Ee.key===null?pe:Ee.key)||null,Se(se,de,Ee,Ke);case Ia:return Ee=rn(Ee),st(de,se,pe,Ee,Ke)}if(Ki(Ee)||v(Ee))return de=de.get(pe)||null,Re(se,de,Ee,Ke,null);if(typeof Ee.then=="function")return st(de,se,pe,Ra(Ee),Ke);if(Ee.$$typeof===Is)return st(de,se,pe,Qn(se,Ee),Ke);os(se,Ee)}return null}function _a(de,se,pe,Ee){for(var Ke=null,kn=null,Ze=se,Dt=se=0,Ca=null;Ze!==null&&Dt<pe.length;Dt++){Ze.index>Dt?(Ca=Ze,Ze=null):Ca=Ze.sibling;var Bt=Le(de,Ze,pe[Dt],Ee);if(Bt===null){Ze===null&&(Ze=Ca);break}l&&Ze&&Bt.alternate===null&&u(de,Ze),se=E(Bt,se,Dt),kn===null?Ke=Bt:kn.sibling=Bt,kn=Bt,Ze=Ca}if(Dt===pe.length)return g(de,Ze),St&&re(de,Dt),Ke;if(Ze===null){for(;Dt<pe.length;Dt++)Ze=Ce(de,pe[Dt],Ee),Ze!==null&&(se=E(Ze,se,Dt),kn===null?Ke=Ze:kn.sibling=Ze,kn=Ze);return St&&re(de,Dt),Ke}for(Ze=x(Ze);Dt<pe.length;Dt++)Ca=st(Ze,de,Dt,pe[Dt],Ee),Ca!==null&&(l&&Ca.alternate!==null&&Ze.delete(Ca.key===null?Dt:Ca.key),se=E(Ca,se,Dt),kn===null?Ke=Ca:kn.sibling=Ca,kn=Ca);return l&&Ze.forEach(function(lr){return u(de,lr)}),St&&re(de,Dt),Ke}function nu(de,se,pe,Ee){if(pe==null)throw Error(i(151));for(var Ke=null,kn=null,Ze=se,Dt=se=0,Ca=null,Bt=pe.next();Ze!==null&&!Bt.done;Dt++,Bt=pe.next()){Ze.index>Dt?(Ca=Ze,Ze=null):Ca=Ze.sibling;var lr=Le(de,Ze,Bt.value,Ee);if(lr===null){Ze===null&&(Ze=Ca);break}l&&Ze&&lr.alternate===null&&u(de,Ze),se=E(lr,se,Dt),kn===null?Ke=lr:kn.sibling=lr,kn=lr,Ze=Ca}if(Bt.done)return g(de,Ze),St&&re(de,Dt),Ke;if(Ze===null){for(;!Bt.done;Dt++,Bt=pe.next())Bt=Ce(de,Bt.value,Ee),Bt!==null&&(se=E(Bt,se,Dt),kn===null?Ke=Bt:kn.sibling=Bt,kn=Bt);return St&&re(de,Dt),Ke}for(Ze=x(Ze);!Bt.done;Dt++,Bt=pe.next())Bt=st(Ze,de,Dt,Bt.value,Ee),Bt!==null&&(l&&Bt.alternate!==null&&Ze.delete(Bt.key===null?Dt:Bt.key),se=E(Bt,se,Dt),kn===null?Ke=Bt:kn.sibling=Bt,kn=Bt);return l&&Ze.forEach(function(yy){return u(de,yy)}),St&&re(de,Dt),Ke}function ll(de,se,pe,Ee){if(typeof pe=="object"&&pe!==null&&pe.type===kl&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Qr:e:{for(var Ke=pe.key;se!==null;){if(se.key===Ke){if(Ke=pe.type,Ke===kl){if(se.tag===7){g(de,se.sibling),Ee=C(se,pe.props.children),Ee.return=de,de=Ee;break e}}else if(se.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===Ia&&rn(Ke)===se.type){g(de,se.sibling),Ee=C(se,pe.props),la(Ee,pe),Ee.return=de,de=Ee;break e}g(de,se);break}else u(de,se);se=se.sibling}pe.type===kl?(Ee=Zs(pe.props.children,de.mode,Ee,pe.key),Ee.return=de,de=Ee):(Ee=gi(pe.type,pe.key,pe.props,null,de.mode,Ee),la(Ee,pe),Ee.return=de,de=Ee)}return U(de);case zl:e:{for(Ke=pe.key;se!==null;){if(se.key===Ke)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){g(de,se.sibling),Ee=C(se,pe.children||[]),Ee.return=de,de=Ee;break e}else{g(de,se);break}else u(de,se);se=se.sibling}Ee=Qh(pe,de.mode,Ee),Ee.return=de,de=Ee}return U(de);case Ia:return pe=rn(pe),ll(de,se,pe,Ee)}if(Ki(pe))return _a(de,se,pe,Ee);if(v(pe)){if(Ke=v(pe),typeof Ke!="function")throw Error(i(150));return pe=Ke.call(pe),nu(de,se,pe,Ee)}if(typeof pe.then=="function")return ll(de,se,Ra(pe),Ee);if(pe.$$typeof===Is)return ll(de,se,Qn(de,pe),Ee);os(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(g(de,se.sibling),Ee=C(se,pe),Ee.return=de,de=Ee):(g(de,se),Ee=Yh(pe,de.mode,Ee),Ee.return=de,de=Ee),U(de)):g(de,se)}return function(de,se,pe,Ee){try{Ql=0;var Ke=ll(de,se,pe,Ee);return $i=null,Ke}catch(Ze){if(Ze===fa||Ze===sr)throw Ze;var kn=n(29,Ze,null,de.mode);return kn.lanes=Ee,kn.return=de,kn}finally{}}}function Ue(){for(var l=Jr,u=Xl=Jr=0;u<l;){var g=za[u];za[u++]=null;var x=za[u];za[u++]=null;var C=za[u];za[u++]=null;var E=za[u];if(za[u++]=null,x!==null&&C!==null){var U=x.pending;U===null?C.next=C:(C.next=U.next,U.next=C),x.pending=C}E!==0&&yt(g,C,E)}}function et(l,u,g,x){za[Jr++]=l,za[Jr++]=u,za[Jr++]=g,za[Jr++]=x,Xl|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Ve(l,u,g,x){return et(l,u,g,x),Fe(l)}function ot(l,u){return et(l,null,null,u),Fe(l)}function yt(l,u,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var C=!1,E=l.return;E!==null;)E.childLanes|=g,x=E.alternate,x!==null&&(x.childLanes|=g),E.tag===22&&(l=E.stateNode,l===null||l._visibility&1||(C=!0)),l=E,E=E.return;return l.tag===3?(E=l.stateNode,C&&u!==null&&(C=31-ms(g),l=E.hiddenUpdates,x=l[C],x===null?l[C]=[u]:x.push(u),u.lane=g|536870912),E):null}function Fe(l){if(50<Ut)throw Ut=0,Oc=null,Error(i(185));for(var u=l.return;u!==null;)l=u,u=l.return;return l.tag===3?l.stateNode:null}function ut(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function an(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Tt(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function pn(l,u,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(xt&2)!==0){var C=x.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),x.pending=u,u=Fe(l),yt(l,null,g),u}return et(l,x,u,g),Fe(l)}function Ar(l,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194048)!==0)){var x=u.lanes;x&=l.pendingLanes,g|=x,u.lanes=g,V(l,g)}}function us(l,u){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var C=null,E=null;if(g=g.firstBaseUpdate,g!==null){do{var U={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};E===null?C=E=U:E=E.next=U,g=g.next}while(g!==null);E===null?C=E=u:E=E.next=u}else C=E=u;g={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:x.shared,callbacks:x.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=u:l.next=u,g.lastBaseUpdate=u}function Xa(){if(yf){var l=da;if(l!==null)throw l}}function Ps(l,u,g,x){yf=!1;var C=l.updateQueue;ks=!1;var E=C.firstBaseUpdate,U=C.lastBaseUpdate,F=C.shared.pending;if(F!==null){C.shared.pending=null;var me=F,Se=me.next;me.next=null,U===null?E=Se:U.next=Se,U=me;var Re=l.alternate;Re!==null&&(Re=Re.updateQueue,F=Re.lastBaseUpdate,F!==U&&(F===null?Re.firstBaseUpdate=Se:F.next=Se,Re.lastBaseUpdate=me))}if(E!==null){var Ce=C.baseState;U=0,Re=Se=me=null,F=E;do{var Le=F.lane&-536870913,st=Le!==F.lane;if(st?(Nt&Le)===Le:(x&Le)===Le){Le!==0&&Le===_i&&(yf=!0),Re!==null&&(Re=Re.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var _a=l,nu=F;Le=u;var ll=g;switch(nu.tag){case 1:if(_a=nu.payload,typeof _a=="function"){Ce=_a.call(ll,Ce,Le);break e}Ce=_a;break e;case 3:_a.flags=_a.flags&-65537|128;case 0:if(_a=nu.payload,Le=typeof _a=="function"?_a.call(ll,Ce,Le):_a,Le==null)break e;Ce=Vd({},Ce,Le);break e;case 2:ks=!0}}Le=F.callback,Le!==null&&(l.flags|=64,st&&(l.flags|=8192),st=C.callbacks,st===null?C.callbacks=[Le]:st.push(Le))}else st={lane:Le,tag:F.tag,payload:F.payload,callback:F.callback,next:null},Re===null?(Se=Re=st,me=Ce):Re=Re.next=st,U|=Le;if(F=F.next,F===null){if(F=C.shared.pending,F===null)break;st=F,F=st.next,st.next=null,C.lastBaseUpdate=st,C.shared.pending=null}}while(!0);Re===null&&(me=Ce),C.baseState=me,C.firstBaseUpdate=Se,C.lastBaseUpdate=Re,E===null&&(C.shared.lanes=0),ji|=U,l.lanes=U,l.memoizedState=Ce}}function Pt(l,u){if(typeof l!="function")throw Error(i(191,l));l.call(u)}function gr(l,u){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Pt(g[l],u)}function yr(l,u){l=$r,w(el,l),w(Kl,u),$r=l|u.baseLanes}function js(){w(el,$r),w(Kl,Kl.current)}function En(){$r=el.current,j(Kl),j(el)}function ws(l){var u=l.alternate;w(Bn,Bn.current&1),w(ys,l),es===null&&(u===null||Kl.current!==null||u.memoizedState!==null)&&(es=l)}function cd(l){w(Bn,Bn.current),w(ys,l),es===null&&(es=l)}function Di(l){l.tag===22?(w(Bn,Bn.current),w(ys,l),es===null&&(es=l)):Es()}function Es(){w(Bn,Bn.current),w(ys,ys.current)}function Ts(l){j(ys),es===l&&(es=null),j(Bn)}function Yu(l){for(var u=l;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Zi(g)||Wd(g)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function Tn(){throw Error(i(321))}function ph(l,u){if(u===null)return!1;for(var g=0;g<u.length&&g<l.length;g++)if(!Zn(l[g],u[g]))return!1;return!0}function xo(l,u,g,x,C,E){return Ci=E,it=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Qe.H=l===null||l.memoizedState===null?Mn:Wr,Rt=!1,E=g(x,C),Rt=!1,ct&&(E=Mr(u,g,x,C)),Vu(l),E}function Vu(l){Qe.H=Ls;var u=Ye!==null&&Ye.next!==null;if(Ci=0,tt=Ye=it=null,ft=!1,rr=0,Nr=null,u)throw Error(i(300));l===null||mn||(l=l.dependencies,l!==null&&Un(l)&&(mn=!0))}function Mr(l,u,g,x){it=l;var C=0;do{if(ct&&(Nr=null),rr=0,ct=!1,25<=C)throw Error(i(301));if(C+=1,tt=Ye=null,l.updateQueue!=null){var E=l.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Qe.H=tl,E=u(g,x)}while(ct);return E}function Ys(){var l=Qe.H,u=l.useState()[0];return u=typeof u.then=="function"?qa(u):u,l=l.useState()[0],(Ye!==null?Ye.memoizedState:null)!==l&&(it.flags|=1024),u}function dd(){var l=Ya!==0;return Ya=0,l}function mh(l,u,g){u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~g}function Qu(l){if(ft){for(l=l.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}ft=!1}Ci=0,tt=Ye=it=null,ct=!1,rr=Ya=0,Nr=null}function Ha(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?it.memoizedState=tt=l:tt=tt.next=l,tt}function xn(){if(Ye===null){var l=it.alternate;l=l!==null?l.memoizedState:null}else l=Ye.next;var u=tt===null?it.memoizedState:tt.next;if(u!==null)tt=u,Ye=l;else{if(l===null)throw it.alternate===null?Error(i(467)):Error(i(310));Ye=l,l={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},tt===null?it.memoizedState=tt=l:tt=tt.next=l}return tt}function fd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qa(l){var u=rr;return rr+=1,Nr===null&&(Nr=[]),l=Hn(Nr,l,u),u=it,(tt===null?u.memoizedState:tt.next)===null&&(u=u.alternate,Qe.H=u===null||u.memoizedState===null?Mn:Wr),l}function bo(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return qa(l);if(l.$$typeof===Is)return Zt(l)}throw Error(i(438,String(l)))}function hd(l){var u=null,g=it.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var x=it.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=fd(),it.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(l),x=0;x<l;x++)g[x]=Kh;return u.index++,g}function xr(l,u){return typeof u=="function"?u(l):u}function ui(l){var u=xn();return pd(u,Ye,l)}function pd(l,u,g){var x=l.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var C=l.baseQueue,E=x.pending;if(E!==null){if(C!==null){var U=C.next;C.next=E.next,E.next=U}u.baseQueue=C=E,x.pending=null}if(E=l.baseState,C===null)l.memoizedState=E;else{u=C.next;var F=U=null,me=null,Se=u,Re=!1;do{var Ce=Se.lane&-536870913;if(Ce!==Se.lane?(Nt&Ce)===Ce:(Ci&Ce)===Ce){var Le=Se.revertLane;if(Le===0)me!==null&&(me=me.next={lane:0,revertLane:0,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null}),Ce===_i&&(Re=!0);else if((Ci&Le)===Le){Se=Se.next,Le===_i&&(Re=!0);continue}else Ce={lane:0,revertLane:Se.revertLane,gesture:null,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},me===null?(F=me=Ce,U=E):me=me.next=Ce,it.lanes|=Le,ji|=Le;Ce=Se.action,Rt&&g(E,Ce),E=Se.hasEagerState?Se.eagerState:g(E,Ce)}else Le={lane:Ce,revertLane:Se.revertLane,gesture:Se.gesture,action:Se.action,hasEagerState:Se.hasEagerState,eagerState:Se.eagerState,next:null},me===null?(F=me=Le,U=E):me=me.next=Le,it.lanes|=Ce,ji|=Ce;Se=Se.next}while(Se!==null&&Se!==u);if(me===null?U=E:me.next=F,!Zn(E,l.memoizedState)&&(mn=!0,Re&&(g=da,g!==null)))throw g;l.memoizedState=E,l.baseState=U,l.baseQueue=me,x.lastRenderedState=E}return C===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function md(l){var u=xn(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var x=g.dispatch,C=g.pending,E=u.memoizedState;if(C!==null){g.pending=null;var U=C=C.next;do E=l(E,U.action),U=U.next;while(U!==C);Zn(E,u.memoizedState)||(mn=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),g.lastRenderedState=E}return[E,x]}function _l(l,u,g){var x=it,C=xn(),E=St;if(E){if(g===void 0)throw Error(i(407));g=g()}else g=u();var U=!Zn((Ye||C).memoizedState,g);if(U&&(C.memoizedState=g,mn=!0),C=C.queue,No(yh.bind(null,x,C,l),[l]),C.getSnapshot!==u||U||tt!==null&&tt.memoizedState.tag&1){if(x.flags|=2048,Rs(9,{destroy:void 0},gh.bind(null,x,C,g,u),null),ht===null)throw Error(i(349));E||(Ci&127)!==0||Wm(x,u,g)}return g}function Wm(l,u,g){l.flags|=16384,l={getSnapshot:u,value:g},u=it.updateQueue,u===null?(u=fd(),it.updateQueue=u,u.stores=[l]):(g=u.stores,g===null?u.stores=[l]:g.push(l))}function gh(l,u,g,x){u.value=g,u.getSnapshot=x,gd(u)&&$m(l)}function yh(l,u,g){return g(function(){gd(u)&&$m(l)})}function gd(l){var u=l.getSnapshot;l=l.value;try{var g=u();return!Zn(l,g)}catch{return!0}}function $m(l){var u=ot(l,2);u!==null&&On(u,l,2)}function xh(l){var u=Ha();if(typeof l=="function"){var g=l;if(l=g(),Rt){J(!0);try{g()}finally{J(!1)}}}return u.memoizedState=u.baseState=l,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:l},u}function Xu(l,u,g,x){return l.baseState=g,pd(l,Ye,typeof x=="function"?x:xr)}function ci(l,u,g,x,C){if(Cd(l))throw Error(i(485));if(l=u.action,l!==null){var E={payload:C,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){E.listeners.push(U)}};Qe.T!==null?g(!0):E.isTransition=!1,x(E),g=u.pending,g===null?(E.next=u.pending=E,yd(u,E)):(E.next=g.next,u.pending=g.next=E)}}function yd(l,u){var g=u.action,x=u.payload,C=l.state;if(u.isTransition){var E=Qe.T,U={};Qe.T=U;try{var F=g(C,x),me=Qe.S;me!==null&&me(U,F),xd(l,u,F)}catch(Se){zi(l,u,Se)}finally{E!==null&&U.types!==null&&(E.types=U.types),Qe.T=E}}else try{E=g(C,x),xd(l,u,E)}catch(Se){zi(l,u,Se)}}function xd(l,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){Cl(l,u,x)},function(x){return zi(l,u,x)}):Cl(l,u,g)}function Cl(l,u,g){u.status="fulfilled",u.value=g,bh(u),l.state=g,u=l.pending,u!==null&&(g=u.next,g===u?l.pending=null:(g=g.next,u.next=g,yd(l,g)))}function zi(l,u,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=g,bh(u),u=u.next;while(u!==x)}l.action=null}function bh(l){l=l.listeners;for(var u=0;u<l.length;u++)(0,l[u])()}function bd(l,u){return u}function vh(l,u){if(St){var g=ht.formState;if(g!==null){e:{var x=it;if(St){if(Sn){var C=Kg(Sn,Wa);if(C){Sn=Fg(C),x=fp(C);break e}}ze(x)}x=!1}x&&(u=g[0])}}g=Ha(),g.memoizedState=g.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:u},g.queue=x,g=rg.bind(null,it,x),x.dispatch=g,x=xh(!1);var E=_d.bind(null,it,!1,x.queue);return x=Ha(),C={state:u,dispatch:null,action:l,pending:null},x.queue=C,g=ci.bind(null,it,C,E,g),C.dispatch=g,x.memoizedState=l,[u,g,!1]}function vo(l){var u=xn();return Dr(u,Ye,l)}function Dr(l,u,g){if(u=pd(l,u,bd)[0],l=ui(xr)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=qa(u)}catch(U){throw U===fa?sr:U}else x=u;u=xn();var C=u.queue,E=C.dispatch;return g!==u.memoizedState&&(it.flags|=2048,Rs(9,{destroy:void 0},Sh.bind(null,C,g),null)),[x,E,l]}function Sh(l,u){l.action=u}function So(l){var u=xn(),g=Ye;if(g!==null)return Dr(u,g,l);xn(),u=u.memoizedState,g=xn();var x=g.queue.dispatch;return g.memoizedState=l,[u,x,!1]}function Rs(l,u,g,x){return l={tag:l,create:g,deps:x,inst:u,next:null},u=it.updateQueue,u===null&&(u=fd(),it.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,u.lastEffect=l),l}function vd(){return xn().memoizedState}function jl(l,u,g,x){var C=Ha();it.flags|=l,C.memoizedState=Rs(1|u,{destroy:void 0},g,x===void 0?null:x)}function Ku(l,u,g,x){var C=xn();x=x===void 0?null:x;var E=C.memoizedState.inst;Ye!==null&&x!==null&&ph(x,Ye.memoizedState.deps)?C.memoizedState=Rs(u,E,g,x):(it.flags|=l,C.memoizedState=Rs(1|u,E,g,x))}function Fu(l,u){jl(8390656,8,l,u)}function No(l,u){Ku(2048,8,l,u)}function eg(l){it.flags|=4;var u=it.updateQueue;if(u===null)u=fd(),it.updateQueue=u,u.events=[l];else{var g=u.events;g===null?u.events=[l]:g.push(l)}}function Ka(l){var u=xn().memoizedState;return eg({ref:u,nextImpl:l}),function(){if((xt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}function ki(l,u){return Ku(4,2,l,u)}function Zu(l,u){return Ku(4,4,l,u)}function _o(l,u){if(typeof u=="function"){l=l();var g=u(l);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function tg(l,u,g){g=g!=null?g.concat([l]):null,Ku(4,4,_o.bind(null,u,l),g)}function Iu(){}function Sd(l,u){var g=xn();u=u===void 0?null:u;var x=g.memoizedState;return u!==null&&ph(u,x[1])?x[0]:(g.memoizedState=[l,u],l)}function Co(l,u){var g=xn();u=u===void 0?null:u;var x=g.memoizedState;if(u!==null&&ph(u,x[1]))return x[0];if(x=l(),Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,u],x}function jo(l,u,g){return g===void 0||(Ci&1073741824)!==0&&(Nt&261930)===0?l.memoizedState=u:(l.memoizedState=g,l=hi(),it.lanes|=l,ji|=l,g)}function Nh(l,u,g,x){return Zn(g,u)?g:Kl.current!==null?(l=jo(l,g,x),Zn(l,u)||(mn=!0),l):(Ci&42)===0||(Ci&1073741824)!==0&&(Nt&261930)===0?(mn=!0,l.memoizedState=g):(l=hi(),it.lanes|=l,ji|=l,u)}function ng(l,u,g,x,C){var E=Js();vt(E!==0&&8>E?E:8);var U=Qe.T,F={};Qe.T=F,_d(l,!1,u,g);try{var me=C(),Se=Qe.S;if(Se!==null&&Se(F,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var Re=Cs(me,x);Ju(l,u,Re,bn(l))}else Ju(l,u,x,bn(l))}catch(Ce){Ju(l,u,{then:function(){},status:"rejected",reason:Ce},bn())}finally{vt(E),U!==null&&F.types!==null&&(U.types=F.types),Qe.T=U}}function ag(l){var u=l.memoizedState;if(u!==null)return u;u={memoizedState:ql,baseState:ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:ql},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:g},next:null},l.memoizedState=u,l=l.alternate,l!==null&&(l.memoizedState=u),u}function _h(){return Zt(Bl)}function Nd(){return xn().memoizedState}function sg(){return xn().memoizedState}function ry(l){for(var u=l.return;u!==null;){switch(u.tag){case 24:case 3:var g=bn();l=Tt(g);var x=pn(u,l,g);x!==null&&(On(x,u,g),Ar(x,u,g)),u={cache:hr()},l.payload=u;return}u=u.return}}function iy(l,u,g){var x=bn();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Cd(l)?ig(u,g):(g=Ve(l,u,g,x),g!==null&&(On(g,l,x),lg(g,u,x)))}function rg(l,u,g){var x=bn();Ju(l,u,g,x)}function Ju(l,u,g,x){var C={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(Cd(l))ig(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var U=u.lastRenderedState,F=E(U,g);if(C.hasEagerState=!0,C.eagerState=F,Zn(F,U))return et(l,u,C,0),ht===null&&Ue(),!1}catch{}finally{}if(g=Ve(l,u,C,x),g!==null)return On(g,l,x),lg(g,u,x),!0}return!1}function _d(l,u,g,x){if(x={lane:2,revertLane:Ta(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Cd(l)){if(u)throw Error(i(479))}else u=Ve(l,g,x,2),u!==null&&On(u,l,2)}function Cd(l){var u=l.alternate;return l===it||u!==null&&u===it}function ig(l,u){ct=ft=!0;var g=l.pending;g===null?u.next=u:(u.next=g.next,g.next=u),l.pending=u}function lg(l,u,g){if((g&4194048)!==0){var x=u.lanes;x&=l.pendingLanes,g|=x,u.lanes=g,V(l,g)}}function Ch(l,u,g,x){u=l.memoizedState,g=g(x,u),g=g==null?u:Vd({},u,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}function jd(l,u,g,x,C,E,U){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,E,U):u.prototype&&u.prototype.isPureReactComponent?!Qt(g,x)||!Qt(C,E):!0}function og(l,u,g,x){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,x),u.state!==l&&jc.enqueueReplaceState(u,u.state,null)}function wl(l,u){var g=u;if("ref"in u){g={};for(var x in u)x!=="ref"&&(g[x]=u[x])}if(l=l.defaultProps){g===u&&(g=Vd({},g));for(var C in l)g[C]===void 0&&(g[C]=l[C])}return g}function wd(l,u){try{var g=l.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function jh(l,u,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function wh(l,u,g){return g=Tt(g),g.tag=3,g.payload={element:null},g.callback=function(){wd(l,u)},g}function ug(l){return l=Tt(l),l.tag=3,l}function cg(l,u,g,x){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var E=x.value;l.payload=function(){return C(E)},l.callback=function(){jh(u,g,x)}}var U=g.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(l.callback=function(){jh(u,g,x),typeof C!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var F=x.stack;this.componentDidCatch(x.value,{componentStack:F!==null?F:""})})}function ly(l,u,g,x,C){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=g.alternate,u!==null&&Et(u,g,C,!0),g=ys.current,g!==null){switch(g.tag){case 31:case 13:return es===null?Lo():g.alternate===null&&zn===0&&(zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,x===Ir?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([x]):u.add(x),qo(l,x,C)),!1;case 22:return g.flags|=65536,x===Ir?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([x]):g.add(x)),qo(l,x,C)),!1}throw Error(i(435,g.tag))}return qo(l,x,C),Lo(),!1}if(St)return u=ys.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,x!==pf&&(l=Error(i(422),{cause:x}),Vn(Ne(l,g)))):(x!==pf&&(u=Error(i(423),{cause:x}),Vn(Ne(u,g))),l=l.current.alternate,l.flags|=65536,C&=-C,l.lanes|=C,x=Ne(x,g),C=wh(l.stateNode,x,C),us(l,C),zn!==4&&(zn=2)),!1;var E=Error(i(520),{cause:x});if(E=Ne(E,g),Ec===null?Ec=[E]:Ec.push(E),zn!==4&&(zn=2),u===null)return!0;x=Ne(x,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,l=C&-C,g.lanes|=l,l=wh(g.stateNode,x,l),us(g,l),!1;case 1:if(u=g.type,E=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(wi===null||!wi.has(E))))return g.flags|=65536,C&=-C,g.lanes|=C,C=ug(C),cg(C,l,g,x),us(g,C),!1}g=g.return}while(g!==null);return!1}function Oa(l,u,g,x){u.child=l===null?Op(u,null,g,x):Da(u,l.child,g,x)}function dg(l,u,g,x,C){g=g.render;var E=u.ref;if("ref"in x){var U={};for(var F in x)F!=="ref"&&(U[F]=x[F])}else U=x;return hn(u),x=xo(l,u,g,U,E,C),F=dd(),l!==null&&!mn?(mh(l,u,C),zr(l,u,C)):(St&&F&&W(u),u.flags|=1,Oa(l,u,x,C),u.child)}function fg(l,u,g,x,C){if(l===null){var E=g.type;return typeof E=="function"&&!Al(E)&&E.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=E,hg(l,u,E,x,C)):(l=gi(g.type,null,x,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,!$u(l,C)){var U=E.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(U,x)&&l.ref===u.ref)return zr(l,u,C)}return u.flags|=1,l=Ms(E,x),l.ref=u.ref,l.return=u,u.child=l}function hg(l,u,g,x,C){if(l!==null){var E=l.memoizedProps;if(Qt(E,x)&&l.ref===u.ref)if(mn=!1,u.pendingProps=x=E,$u(l,C))(l.flags&131072)!==0&&(mn=!0);else return u.lanes=l.lanes,zr(l,u,C)}return Td(l,u,g,x,C)}function pg(l,u,g,x){var C=x.children,E=l!==null?l.memoizedState:null;if(l===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(E=E!==null?E.baseLanes|g:g,l!==null){for(x=u.child=l.child,C=0;x!==null;)C=C|x.lanes|x.childLanes,x=x.sibling;x=C&~E}else x=0,u.child=null;return wo(l,u,E,g,x)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},l!==null&&gt(u,E!==null?E.cachePool:null),E!==null?yr(u,E):js(),Di(u);else return x=u.lanes=536870912,wo(l,u,E!==null?E.baseLanes|g:g,g,x)}else E!==null?(gt(u,E.cachePool),yr(u,E),Es(),u.memoizedState=null):(l!==null&&gt(u,null),js(),Es());return Oa(l,u,C,g),u.child}function El(l,u){return l!==null&&l.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function wo(l,u,g,x,C){var E=mr();return E=E===null?null:{parent:Kn?Nn._currentValue:Nn._currentValue2,pool:E},u.memoizedState={baseLanes:g,cachePool:E},l!==null&&gt(u,null),js(),Di(u),l!==null&&Et(l,u,x,!0),u.childLanes=C,null}function Ed(l,u){return u=Li({mode:u.mode,children:u.children},l.mode),u.ref=l.ref,l.child=u,u.return=l,u}function Eh(l,u,g){return Da(u,l.child,null,g),l=Ed(u,u.pendingProps),l.flags|=2,Ts(u),u.memoizedState=null,l}function mg(l,u,g){var x=u.pendingProps,C=(u.flags&128)!==0;if(u.flags&=-129,l===null){if(St){if(x.mode==="hidden")return l=Ed(u,x),u.lanes=536870912,El(null,l);if(cd(u),(l=Sn)?(l=pp(l,Wa),l!==null&&(u.memoizedState={dehydrated:l,treeContext:er!==null?{id:Aa,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},g=Vh(l),g.return=u,u.child=g,ca=u,Sn=null)):l=null,l===null)throw ze(u);return u.lanes=536870912,null}return Ed(u,x)}var E=l.memoizedState;if(E!==null){var U=E.dehydrated;if(cd(u),C)if(u.flags&256)u.flags&=-257,u=Eh(l,u,g);else if(u.memoizedState!==null)u.child=l.child,u.flags|=128,u=null;else throw Error(i(558));else if(mn||Et(l,u,g,!1),C=(g&l.childLanes)!==0,mn||C){if(x=ht,x!==null&&(U=Z(x,g),U!==0&&U!==E.retryLane))throw E.retryLane=U,ot(l,U),On(x,l,U),ts;Lo(),u=Eh(l,u,g)}else l=E.treeContext,vn&&(Sn=Wg(U),ca=u,St=!0,Zr=null,Wa=!1,l!==null&&xe(u,l)),u=Ed(u,x),u.flags|=4096;return u}return l=Ms(l.child,{mode:x.mode,children:x.children}),l.ref=u.ref,u.child=l,l.return=u,l}function Wu(l,u){var g=u.ref;if(g===null)l!==null&&l.ref!==null&&(u.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(l===null||l.ref!==g)&&(u.flags|=4194816)}}function Td(l,u,g,x,C){return hn(u),g=xo(l,u,g,x,void 0,C),x=dd(),l!==null&&!mn?(mh(l,u,C),zr(l,u,C)):(St&&x&&W(u),u.flags|=1,Oa(l,u,g,C),u.child)}function Th(l,u,g,x,C,E){return hn(u),u.updateQueue=null,g=Mr(u,x,g,C),Vu(l),x=dd(),l!==null&&!mn?(mh(l,u,E),zr(l,u,E)):(St&&x&&W(u),u.flags|=1,Oa(l,u,g,E),u.child)}function Tl(l,u,g,x,C){if(hn(u),u.stateNode===null){var E=Xr,U=g.contextType;typeof U=="object"&&U!==null&&(E=Zt(U)),E=new g(x,E),u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=jc,u.stateNode=E,E._reactInternals=u,E=u.stateNode,E.props=x,E.state=u.memoizedState,E.refs={},ut(u),U=g.contextType,E.context=typeof U=="object"&&U!==null?Zt(U):Xr,E.state=u.memoizedState,U=g.getDerivedStateFromProps,typeof U=="function"&&(Ch(u,g,U,x),E.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(U=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),U!==E.state&&jc.enqueueReplaceState(E,E.state,null),Ps(u,x,E,C),Xa(),E.state=u.memoizedState),typeof E.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(l===null){E=u.stateNode;var F=u.memoizedProps,me=wl(g,F);E.props=me;var Se=E.context,Re=g.contextType;U=Xr,typeof Re=="object"&&Re!==null&&(U=Zt(Re));var Ce=g.getDerivedStateFromProps;Re=typeof Ce=="function"||typeof E.getSnapshotBeforeUpdate=="function",F=u.pendingProps!==F,Re||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(F||Se!==U)&&og(u,E,x,U),ks=!1;var Le=u.memoizedState;E.state=Le,Ps(u,x,E,C),Xa(),Se=u.memoizedState,F||Le!==Se||ks?(typeof Ce=="function"&&(Ch(u,g,Ce,x),Se=u.memoizedState),(me=ks||jd(u,g,me,x,Le,Se,U))?(Re||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(u.flags|=4194308)):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=Se),E.props=x,E.state=Se,E.context=U,x=me):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{E=u.stateNode,an(l,u),U=u.memoizedProps,Re=wl(g,U),E.props=Re,Ce=u.pendingProps,Le=E.context,Se=g.contextType,me=Xr,typeof Se=="object"&&Se!==null&&(me=Zt(Se)),F=g.getDerivedStateFromProps,(Se=typeof F=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==Ce||Le!==me)&&og(u,E,x,me),ks=!1,Le=u.memoizedState,E.state=Le,Ps(u,x,E,C),Xa();var st=u.memoizedState;U!==Ce||Le!==st||ks||l!==null&&l.dependencies!==null&&Un(l.dependencies)?(typeof F=="function"&&(Ch(u,g,F,x),st=u.memoizedState),(Re=ks||jd(u,g,Re,x,Le,st,me)||l!==null&&l.dependencies!==null&&Un(l.dependencies))?(Se||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(x,st,me),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(x,st,me)),typeof E.componentDidUpdate=="function"&&(u.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=st),E.props=x,E.state=st,E.context=me,x=Re):(typeof E.componentDidUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=1024),x=!1)}return E=x,Wu(l,u),x=(u.flags&128)!==0,E||x?(E=u.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:E.render(),u.flags|=1,l!==null&&x?(u.child=Da(u,l.child,null,C),u.child=Da(u,null,g,C)):Oa(l,u,g,C),u.memoizedState=E.state,l=u.child):l=zr(l,u,C),l}function gg(l,u,g,x){return qt(),u.flags|=256,Oa(l,u,g,x),u.child}function Rh(l){return{baseLanes:l,cachePool:pt()}}function Oh(l,u,g){return l=l!==null?l.childLanes&~g:0,u&&(l|=ns),l}function Ah(l,u,g){var x=u.pendingProps,C=!1,E=(u.flags&128)!==0,U;if((U=E)||(U=l!==null&&l.memoizedState===null?!1:(Bn.current&2)!==0),U&&(C=!0,u.flags&=-129),U=(u.flags&32)!==0,u.flags&=-33,l===null){if(St){if(C?ws(u):Es(),(l=Sn)?(l=n0(l,Wa),l!==null&&(u.memoizedState={dehydrated:l,treeContext:er!==null?{id:Aa,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},g=Vh(l),g.return=u,u.child=g,ca=u,Sn=null)):l=null,l===null)throw ze(u);return Wd(l)?u.lanes=32:u.lanes=536870912,null}var F=x.children;return x=x.fallback,C?(Es(),C=u.mode,F=Li({mode:"hidden",children:F},C),x=Zs(x,C,g,null),F.return=u,x.return=u,F.sibling=x,u.child=F,x=u.child,x.memoizedState=Rh(g),x.childLanes=Oh(l,U,g),u.memoizedState=Fl,El(null,x)):(ws(u),Rd(u,F))}var me=l.memoizedState;if(me!==null&&(F=me.dehydrated,F!==null)){if(E)u.flags&256?(ws(u),u.flags&=-257,u=Rl(l,u,g)):u.memoizedState!==null?(Es(),u.child=l.child,u.flags|=128,u=null):(Es(),F=x.fallback,C=u.mode,x=Li({mode:"visible",children:x.children},C),F=Zs(F,C,g,null),F.flags|=2,x.return=u,F.return=u,x.sibling=F,u.child=x,Da(u,l.child,null,g),x=u.child,x.memoizedState=Rh(g),x.childLanes=Oh(l,U,g),u.memoizedState=Fl,u=El(null,x));else if(ws(u),Wd(F))U=$d(F).digest,x=Error(i(419)),x.stack="",x.digest=U,Vn({value:x,source:null,stack:null}),u=Rl(l,u,g);else if(mn||Et(l,u,g,!1),U=(g&l.childLanes)!==0,mn||U){if(U=ht,U!==null&&(x=Z(U,g),x!==0&&x!==me.retryLane))throw me.retryLane=x,ot(l,x),On(U,l,x),ts;Zi(F)||Lo(),u=Rl(l,u,g)}else Zi(F)?(u.flags|=192,u.child=l.child,u=null):(l=me.treeContext,vn&&(Sn=$g(F),ca=u,St=!0,Zr=null,Wa=!1,l!==null&&xe(u,l)),u=Rd(u,x.children),u.flags|=4096);return u}return C?(Es(),F=x.fallback,C=u.mode,me=l.child,E=me.sibling,x=Ms(me,{mode:"hidden",children:x.children}),x.subtreeFlags=me.subtreeFlags&65011712,E!==null?F=Ms(E,F):(F=Zs(F,C,g,null),F.flags|=2),F.return=u,x.return=u,x.sibling=F,u.child=x,El(null,x),x=u.child,F=l.child.memoizedState,F===null?F=Rh(g):(C=F.cachePool,C!==null?(me=Kn?Nn._currentValue:Nn._currentValue2,C=C.parent!==me?{parent:me,pool:me}:C):C=pt(),F={baseLanes:F.baseLanes|g,cachePool:C}),x.memoizedState=F,x.childLanes=Oh(l,U,g),u.memoizedState=Fl,El(l.child,x)):(ws(u),g=l.child,l=g.sibling,g=Ms(g,{mode:"visible",children:x.children}),g.return=u,g.sibling=null,l!==null&&(U=u.deletions,U===null?(u.deletions=[l],u.flags|=16):U.push(l)),u.child=g,u.memoizedState=null,g)}function Rd(l,u){return u=Li({mode:"visible",children:u},l.mode),u.return=l,l.child=u}function Li(l,u){return l=n(22,l,null,u),l.lanes=0,l}function Rl(l,u,g){return Da(u,l.child,null,g),l=Rd(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function yg(l,u,g){l.lanes|=u;var x=l.alternate;x!==null&&(x.lanes|=u),fr(l.return,u,g)}function Eo(l,u,g,x,C,E){var U=l.memoizedState;U===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:C,treeForkCount:E}:(U.isBackwards=u,U.rendering=null,U.renderingStartTime=0,U.last=x,U.tail=g,U.tailMode=C,U.treeForkCount=E)}function Mh(l,u,g){var x=u.pendingProps,C=x.revealOrder,E=x.tail;x=x.children;var U=Bn.current,F=(U&2)!==0;if(F?(U=U&1|2,u.flags|=128):U&=1,w(Bn,U),Oa(l,u,x,g),x=St?Nc:0,!F&&l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&yg(l,g,u);else if(l.tag===19)yg(l,g,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(C){case"forwards":for(g=u.child,C=null;g!==null;)l=g.alternate,l!==null&&Yu(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),Eo(u,!1,C,g,E,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Yu(l)===null){u.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}Eo(u,!0,g,null,E,x);break;case"together":Eo(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function zr(l,u,g){if(l!==null&&(u.dependencies=l.dependencies),ji|=u.lanes,(g&u.childLanes)===0)if(l!==null){if(Et(l,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(l!==null&&u.child!==l.child)throw Error(i(153));if(u.child!==null){for(l=u.child,g=Ms(l,l.pendingProps),u.child=g,g.return=u;l.sibling!==null;)l=l.sibling,g=g.sibling=Ms(l,l.pendingProps),g.return=u;g.sibling=null}return u.child}function $u(l,u){return(l.lanes&u)!==0?!0:(l=l.dependencies,!!(l!==null&&Un(l)))}function Dh(l,u,g){switch(u.tag){case 3:_e(u,u.stateNode.containerInfo),Gt(u,Nn,l.memoizedState.cache),qt();break;case 27:case 5:De(u);break;case 4:_e(u,u.stateNode.containerInfo);break;case 10:Gt(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,cd(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(ws(u),u.flags|=128,null):(g&u.child.childLanes)!==0?Ah(l,u,g):(ws(u),l=zr(l,u,g),l!==null?l.sibling:null);ws(u);break;case 19:var C=(l.flags&128)!==0;if(x=(g&u.childLanes)!==0,x||(Et(l,u,g,!1),x=(g&u.childLanes)!==0),C){if(x)return Mh(l,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(Bn,Bn.current),x)break;return null;case 22:return u.lanes=0,pg(l,u,g,u.pendingProps);case 24:Gt(u,Nn,l.memoizedState.cache)}return zr(l,u,g)}function zh(l,u,g){if(l!==null)if(l.memoizedProps!==u.pendingProps)mn=!0;else{if(!$u(l,g)&&(u.flags&128)===0)return mn=!1,Dh(l,u,g);mn=(l.flags&131072)!==0}else mn=!1,St&&(u.flags&1048576)!==0&&G(u,Nc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(l=rn(u.elementType),u.type=l,typeof l=="function")Al(l)?(x=wl(l,x),u.tag=1,u=Tl(null,u,l,x,g)):(u.tag=0,u=Td(null,u,l,x,g));else{if(l!=null){var C=l.$$typeof;if(C===Bo){u.tag=11,u=dg(null,u,l,x,g);break e}else if(C===Xd){u.tag=14,u=fg(null,u,l,x,g);break e}}throw u=b(l)||l,Error(i(306,u,""))}}return u;case 0:return Td(l,u,u.type,u.pendingProps,g);case 1:return x=u.type,C=wl(x,u.pendingProps),Tl(l,u,x,C,g);case 3:e:{if(_e(u,u.stateNode.containerInfo),l===null)throw Error(i(387));var E=u.pendingProps;C=u.memoizedState,x=C.element,an(l,u),Ps(u,E,null,g);var U=u.memoizedState;if(E=U.cache,Gt(u,Nn,E),E!==C.cache&&Ft(u,[Nn],g,!0),Xa(),E=U.element,vn&&C.isDehydrated)if(C={element:E,isDehydrated:!1,cache:U.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=gg(l,u,E,g);break e}else if(E!==x){x=Ne(Error(i(424)),u),Vn(x),u=gg(l,u,E,g);break e}else for(vn&&(Sn=Jg(u.stateNode.containerInfo),ca=u,St=!0,Zr=null,Wa=!0),g=Op(u,null,E,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(qt(),E===x){u=zr(l,u,g);break e}Oa(l,u,E,g)}u=u.child}return u;case 26:if(Ws)return Wu(l,u),l===null?(g=bp(u.type,null,u.pendingProps,null))?u.memoizedState=g:St||(u.stateNode=af(u.type,u.pendingProps,Ma.current,u)):u.memoizedState=bp(u.type,l.memoizedProps,u.pendingProps,l.memoizedState),null;case 27:if(ua)return De(u),l===null&&ua&&St&&(x=u.stateNode=sf(u.type,u.pendingProps,Ma.current,Sa.current,!1),ca=u,Wa=!0,Sn=hp(u.type,x,Sn)),Oa(l,u,u.pendingProps.children,g),Wu(l,u),l===null&&(u.flags|=4194304),u.child;case 5:return l===null&&St&&(d0(u.type,u.pendingProps,Sa.current),(C=x=Sn)&&(x=e0(x,u.type,u.pendingProps,Wa),x!==null?(u.stateNode=x,ca=u,Sn=Ig(x),Wa=!1,C=!0):C=!1),C||ze(u)),De(u),C=u.type,E=u.pendingProps,U=l!==null?l.memoizedProps:null,x=E.children,Ja(C,E)?x=null:U!==null&&Ja(C,U)&&(u.flags|=32),u.memoizedState!==null&&(C=xo(l,u,Ys,null,null,g),Kn?Bl._currentValue=C:Bl._currentValue2=C),Wu(l,u),Oa(l,u,x,g),u.child;case 6:return l===null&&St&&(xp(u.pendingProps,Sa.current),(l=g=Sn)&&(g=t0(g,u.pendingProps,Wa),g!==null?(u.stateNode=g,ca=u,Sn=null,l=!0):l=!1),l||ze(u)),null;case 13:return Ah(l,u,g);case 4:return _e(u,u.stateNode.containerInfo),x=u.pendingProps,l===null?u.child=Da(u,null,x,g):Oa(l,u,x,g),u.child;case 11:return dg(l,u,u.type,u.pendingProps,g);case 7:return Oa(l,u,u.pendingProps,g),u.child;case 8:return Oa(l,u,u.pendingProps.children,g),u.child;case 12:return Oa(l,u,u.pendingProps.children,g),u.child;case 10:return x=u.pendingProps,Gt(u,u.type,x.value),Oa(l,u,x.children,g),u.child;case 9:return C=u.type._context,x=u.pendingProps.children,hn(u),C=Zt(C),x=x(C),u.flags|=1,Oa(l,u,x,g),u.child;case 14:return fg(l,u,u.type,u.pendingProps,g);case 15:return hg(l,u,u.type,u.pendingProps,g);case 19:return Mh(l,u,g);case 31:return mg(l,u,g);case 22:return pg(l,u,g,u.pendingProps);case 24:return hn(u),x=Zt(Nn),l===null?(C=mr(),C===null&&(C=ht,E=hr(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=g),C=E),u.memoizedState={parent:x,cache:C},ut(u),Gt(u,Nn,C)):((l.lanes&g)!==0&&(an(l,u),Ps(u,null,null,g),Xa()),C=l.memoizedState,E=u.memoizedState,C.parent!==x?(C={parent:x,cache:x},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),Gt(u,Nn,x)):(x=E.cache,Gt(u,Nn,x),x!==C.cache&&Ft(u,[Nn],g,!0))),Oa(l,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function Vs(l){l.flags|=4}function ec(l){Ds&&(l.flags|=8)}function xg(l,u){if(l!==null&&l.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(l=u.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function kh(l,u,g,x){if(wt)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)pc(l,g.stateNode);else if(!(g.tag===4||ua&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ds)for(var C=u.child;C!==null;){if(C.tag===5){var E=C.stateNode;g&&x&&(E=Xg(E,C.type,C.memoizedProps)),pc(l,E)}else if(C.tag===6)E=C.stateNode,g&&x&&(E=dp(E,C.memoizedProps)),pc(l,E);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),kh(l,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function bg(l,u,g,x){var C=!1;if(Ds)for(var E=u.child;E!==null;){if(E.tag===5){var U=E.stateNode;g&&x&&(U=Xg(U,E.type,E.memoizedProps)),up(l,U)}else if(E.tag===6)U=E.stateNode,g&&x&&(U=dp(U,E.memoizedProps)),up(l,U);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)C=E.child,C!==null&&(C.return=E),bg(l,E,!0,!0),C=!0;else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===u)break;for(;E.sibling===null;){if(E.return===null||E.return===u)return C;E=E.return}E.sibling.return=E.return,E=E.sibling}return C}function vg(l,u){if(Ds&&xg(l,u)){l=u.stateNode;var g=l.containerInfo,x=op();bg(x,u,!1,!1),l.pendingChildren=x,Vs(u),Qg(g,x)}}function Lh(l,u,g,x){if(wt)l.memoizedProps!==x&&Vs(u);else if(Ds){var C=l.stateNode,E=l.memoizedProps;if((l=xg(l,u))||E!==x){var U=Sa.current;E=Vg(C,g,E,x,!l,null),E===C?u.stateNode=C:(ec(u),hs(E,g,x,U)&&Vs(u),u.stateNode=E,l&&kh(E,u,!1,!1))}else u.stateNode=C}}function Fa(l,u,g,x,C){if((l.mode&32)!==0&&(g===null?mc(u,x):Qo(u,g,x))){if(l.flags|=16777216,(C&335544128)===C||Jh(u,x))if(An(l.stateNode,u,x))l.flags|=8192;else if(jt())l.flags|=8192;else throw $a=Ir,gf}else l.flags&=-16777217}function To(l,u){if(_p(u)){if(l.flags|=16777216,!Cp(u))if(jt())l.flags|=8192;else throw $a=Ir,gf}else l.flags&=-16777217}function tc(l,u){u!==null&&(l.flags|=4),l.flags&16384&&(u=l.tag!==22?k():536870912,l.lanes|=u,eu|=u)}function Ro(l,u){if(!St)switch(l.tailMode){case"hidden":u=l.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function ln(l){var u=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(u)for(var C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags&65011712,x|=C.flags&65011712,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=x,l.childLanes=g,u}function Sg(l,u,g){var x=u.pendingProps;switch(he(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(u),null;case 1:return ln(u),null;case 3:return g=u.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),fn(Nn),je(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(At(u)?Vs(u):l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,wn())),vg(l,u),ln(u),null;case 26:if(Ws){var C=u.type,E=u.memoizedState;return l===null?(Vs(u),E!==null?(ln(u),To(u,E)):(ln(u),Fa(u,C,null,x,g))):E?E!==l.memoizedState?(Vs(u),ln(u),To(u,E)):(ln(u),u.flags&=-16777217):(E=l.memoizedProps,wt?E!==x&&Vs(u):Lh(l,u,C,x),ln(u),Fa(u,C,E,x,g)),null}case 27:if(ua){if(nt(u),g=Ma.current,C=u.type,l!==null&&u.stateNode!=null)wt?l.memoizedProps!==x&&Vs(u):Lh(l,u,C,x);else{if(!x){if(u.stateNode===null)throw Error(i(166));return ln(u),null}l=Sa.current,At(u)?Vt(u,l):(l=sf(C,x,g,l,!0),u.stateNode=l,Vs(u))}return ln(u),null}case 5:if(nt(u),C=u.type,l!==null&&u.stateNode!=null)Lh(l,u,C,x);else{if(!x){if(u.stateNode===null)throw Error(i(166));return ln(u),null}if(E=Sa.current,At(u))Vt(u,E),o0(u.stateNode,C,x,E)&&(u.flags|=64);else{var U=Zh(C,x,Ma.current,E,u);ec(u),kh(U,u,!1,!1),u.stateNode=U,hs(U,C,x,E)&&Vs(u)}}return ln(u),Fa(u,u.type,l===null?null:l.memoizedProps,u.pendingProps,g),null;case 6:if(l&&u.stateNode!=null)g=l.memoizedProps,wt?g!==x&&Vs(u):Ds&&(g!==x?(l=Ma.current,g=Sa.current,ec(u),u.stateNode=bi(x,l,g,u)):u.stateNode=l.stateNode);else{if(typeof x!="string"&&u.stateNode===null)throw Error(i(166));if(l=Ma.current,g=Sa.current,At(u)){if(!vn)throw Error(i(176));if(l=u.stateNode,g=u.memoizedProps,x=null,C=ca,C!==null)switch(C.tag){case 27:case 5:x=C.memoizedProps}fy(l,g,u,x)||ze(u,!0)}else ec(u),u.stateNode=bi(x,l,g,u)}return ln(u),null;case 31:if(g=u.memoizedState,l===null||l.memoizedState!==null){if(x=At(u),g!==null){if(l===null){if(!x)throw Error(i(318));if(!vn)throw Error(i(556));if(l=u.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));mp(l,u)}else qt(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ln(u),l=!1}else g=wn(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return u.flags&256?(Ts(u),u):(Ts(u),null);if((u.flags&128)!==0)throw Error(i(558))}return ln(u),null;case 13:if(x=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(C=At(u),x!==null&&x.dehydrated!==null){if(l===null){if(!C)throw Error(i(318));if(!vn)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));s0(C,u)}else qt(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ln(u),C=!1}else C=wn(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=C),C=!0;if(!C)return u.flags&256?(Ts(u),u):(Ts(u),null)}return Ts(u),(u.flags&128)!==0?(u.lanes=g,u):(g=x!==null,l=l!==null&&l.memoizedState!==null,g&&(x=u.child,C=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(C=x.alternate.memoizedState.cachePool.pool),E=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(E=x.memoizedState.cachePool.pool),E!==C&&(x.flags|=2048)),g!==l&&g&&(u.child.flags|=8192),tc(u,u.updateQueue),ln(u),null);case 4:return je(),vg(l,u),l===null&&en(u.stateNode.containerInfo),ln(u),null;case 10:return fn(u.type),ln(u),null;case 19:if(j(Bn),x=u.memoizedState,x===null)return ln(u),null;if(C=(u.flags&128)!==0,E=x.rendering,E===null)if(C)Ro(x,!1);else{if(zn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(E=Yu(l),E!==null){for(u.flags|=128,Ro(x,!1),l=E.updateQueue,u.updateQueue=l,tc(u,l),u.subtreeFlags=0,l=g,g=u.child;g!==null;)Gd(g,l),g=g.sibling;return w(Bn,Bn.current&1|2),St&&re(u,x.treeForkCount),u.child}l=l.sibling}x.tail!==null&&Ga()>il&&(u.flags|=128,C=!0,Ro(x,!1),u.lanes=4194304)}else{if(!C)if(l=Yu(E),l!==null){if(u.flags|=128,C=!0,l=l.updateQueue,u.updateQueue=l,tc(u,l),Ro(x,!0),x.tail===null&&x.tailMode==="hidden"&&!E.alternate&&!St)return ln(u),null}else 2*Ga()-x.renderingStartTime>il&&g!==536870912&&(u.flags|=128,C=!0,Ro(x,!1),u.lanes=4194304);x.isBackwards?(E.sibling=u.child,u.child=E):(l=x.last,l!==null?l.sibling=E:u.child=E,x.last=E)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Ga(),l.sibling=null,g=Bn.current,w(Bn,C?g&1|2:g&1),St&&re(u,x.treeForkCount),l):(ln(u),null);case 22:case 23:return Ts(u),En(),x=u.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(g&536870912)!==0&&(u.flags&128)===0&&(ln(u),u.subtreeFlags&6&&(u.flags|=8192)):ln(u),g=u.updateQueue,g!==null&&tc(u,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==g&&(u.flags|=2048),l!==null&&j(Wi),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),fn(Nn),ln(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function Uh(l,u){switch(he(u),u.tag){case 1:return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return fn(Nn),je(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 26:case 27:case 5:return nt(u),null;case 31:if(u.memoizedState!==null){if(Ts(u),u.alternate===null)throw Error(i(340));qt()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 13:if(Ts(u),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(i(340));qt()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return j(Bn),null;case 4:return je(),null;case 10:return fn(u.type),null;case 22:case 23:return Ts(u),En(),l!==null&&j(Wi),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 24:return fn(Nn),null;case 25:return null;default:return null}}function Ng(l,u){switch(he(u),u.tag){case 3:fn(Nn),je();break;case 26:case 27:case 5:nt(u);break;case 4:je();break;case 31:u.memoizedState!==null&&Ts(u);break;case 13:Ts(u);break;case 19:j(Bn);break;case 10:fn(u.type);break;case 22:case 23:Ts(u),En(),l!==null&&j(Wi);break;case 24:fn(Nn)}}function kr(l,u){try{var g=u.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var C=x.next;g=C;do{if((g.tag&l)===l){x=void 0;var E=g.create,U=g.inst;x=E(),U.destroy=x}g=g.next}while(g!==C)}}catch(F){We(u,u.return,F)}}function Lr(l,u,g){try{var x=u.updateQueue,C=x!==null?x.lastEffect:null;if(C!==null){var E=C.next;x=E;do{if((x.tag&l)===l){var U=x.inst,F=U.destroy;if(F!==void 0){U.destroy=void 0,C=u;var me=g,Se=F;try{Se()}catch(Re){We(C,me,Re)}}}x=x.next}while(x!==E)}}catch(Re){We(u,u.return,Re)}}function Oo(l){var u=l.updateQueue;if(u!==null){var g=l.stateNode;try{gr(u,g)}catch(x){We(l,l.return,x)}}}function Od(l,u,g){g.props=wl(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){We(l,u,x)}}function Ao(l,u){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var x=Po(l.stateNode);break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof g=="function"?l.refCleanup=g(x):g.current=x}}catch(C){We(l,u,C)}}function Ba(l,u){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(C){We(l,u,C)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){We(l,u,C)}else g.current=null}function Ol(l){var u=l.type,g=l.memoizedProps,x=l.stateNode;try{Lg(x,u,g,l)}catch(C){We(l,l.return,C)}}function nc(l,u,g){try{Ug(l.stateNode,l.type,g,u,l)}catch(x){We(l,l.return,x)}}function Hh(l){return l.tag===5||l.tag===3||(Ws?l.tag===26:!1)||(ua?l.tag===27&&Gl(l.type):!1)||l.tag===4}function di(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Hh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(ua&&l.tag===27&&Gl(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ad(l,u,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,u?qg(g,l,u):sp(g,l);else if(x!==4&&(ua&&x===27&&Gl(l.type)&&(g=l.stateNode,u=null),l=l.child,l!==null))for(Ad(l,u,g),l=l.sibling;l!==null;)Ad(l,u,g),l=l.sibling}function ac(l,u,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,u?Hg(g,l,u):ap(g,l);else if(x!==4&&(ua&&x===27&&Gl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(ac(l,u,g),l=l.sibling;l!==null;)ac(l,u,g),l=l.sibling}function qh(l,u,g){l=l.containerInfo;try{cp(l,g)}catch(x){We(u,u.return,x)}}function _g(l){var u=l.stateNode,g=l.memoizedProps;try{ta(l.type,g,u,l)}catch(x){We(l,l.return,x)}}function oy(l,u){for(Kd(l.containerInfo),In=u;In!==null;)if(l=In,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,In=u;else for(;In!==null;){l=In;var g=l.alternate;switch(u=l.flags,l.tag){case 0:if((u&4)!==0&&(u=l.updateQueue,u=u!==null?u.events:null,u!==null))for(var x=0;x<u.length;x++){var C=u[x];C.ref.impl=C.nextImpl}break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0,x=l,C=g.memoizedProps,g=g.memoizedState;var E=x.stateNode;try{var U=wl(x.type,C);u=E.getSnapshotBeforeUpdate(U,g),E.__reactInternalSnapshotBeforeUpdate=u}catch(F){We(x,x.return,F)}}break;case 3:(u&1024)!==0&&wt&&lp(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=l.sibling,u!==null){u.return=l.return,In=u;break}In=l.return}}function Cg(l,u,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Za(l,g),x&4&&kr(5,g);break;case 1:if(Za(l,g),x&4)if(l=g.stateNode,u===null)try{l.componentDidMount()}catch(U){We(g,g.return,U)}else{var C=wl(g.type,u.memoizedProps);u=u.memoizedState;try{l.componentDidUpdate(C,u,l.__reactInternalSnapshotBeforeUpdate)}catch(U){We(g,g.return,U)}}x&64&&Oo(g),x&512&&Ao(g,g.return);break;case 3:if(Za(l,g),x&64&&(x=g.updateQueue,x!==null)){if(l=null,g.child!==null)switch(g.child.tag){case 27:case 5:l=Po(g.child.stateNode);break;case 1:l=g.child.stateNode}try{gr(x,l)}catch(U){We(g,g.return,U)}}break;case 27:ua&&u===null&&x&4&&_g(g);case 26:case 5:if(Za(l,g),u===null){if(x&4)Ol(g);else if(x&64){l=g.type,u=g.memoizedProps,C=g.stateNode;try{i0(C,l,u,g)}catch(U){We(g,g.return,U)}}}x&512&&Ao(g,g.return);break;case 12:Za(l,g);break;case 31:Za(l,g),x&4&&Xs(l,g);break;case 13:Za(l,g),x&4&&rc(l,g),x&64&&(x=g.memoizedState,x!==null&&(x=x.dehydrated,x!==null&&(g=uy.bind(null,g),ef(x,g))));break;case 22:if(x=g.memoizedState!==null||Gn,!x){u=u!==null&&u.memoizedState!==null||Pn,C=Gn;var E=Pn;Gn=x,(Pn=u)&&!E?Fs(l,g,(g.subtreeFlags&8772)!==0):Za(l,g),Gn=C,Pn=E}break;case 30:break;default:Za(l,g)}}function Bh(l){var u=l.alternate;u!==null&&(l.alternate=null,Bh(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&Fd(u)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Qs(l,u,g){for(g=g.child;g!==null;)sc(l,u,g),g=g.sibling}function sc(l,u,g){if(gs&&typeof gs.onCommitFiberUnmount=="function")try{gs.onCommitFiberUnmount(Vl,g)}catch{}switch(g.tag){case 26:if(Ws){Pn||Ba(g,u),Qs(l,u,g),g.memoizedState?Ii(g.memoizedState):g.stateNode&&Np(g.stateNode);break}case 27:if(ua){Pn||Ba(g,u);var x=Dn,C=Jn;Gl(g.type)&&(Dn=g.stateNode,Jn=!1),Qs(l,u,g),va(g.stateNode),Dn=x,Jn=C;break}case 5:Pn||Ba(g,u);case 6:if(wt){if(x=Dn,C=Jn,Dn=null,Qs(l,u,g),Dn=x,Jn=C,Dn!==null)if(Jn)try{rp(Dn,g.stateNode)}catch(E){We(g,u,E)}else try{Bg(Dn,g.stateNode)}catch(E){We(g,u,E)}}else Qs(l,u,g);break;case 18:wt&&Dn!==null&&(Jn?tf(Dn,g.stateNode):yp(Dn,g.stateNode));break;case 4:wt?(x=Dn,C=Jn,Dn=g.stateNode.containerInfo,Jn=!0,Qs(l,u,g),Dn=x,Jn=C):(Ds&&qh(g.stateNode,g,op()),Qs(l,u,g));break;case 0:case 11:case 14:case 15:Lr(2,g,u),Pn||Lr(4,g,u),Qs(l,u,g);break;case 1:Pn||(Ba(g,u),x=g.stateNode,typeof x.componentWillUnmount=="function"&&Od(g,u,x)),Qs(l,u,g);break;case 21:Qs(l,u,g);break;case 22:Pn=(x=Pn)||g.memoizedState!==null,Qs(l,u,g),Pn=x;break;default:Qs(l,u,g)}}function Xs(l,u){if(vn&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{hy(l)}catch(g){We(u,u.return,g)}}}function rc(l,u){if(vn&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{py(l)}catch(g){We(u,u.return,g)}}function Ks(l){switch(l.tag){case 31:case 13:case 19:var u=l.stateNode;return u===null&&(u=l.stateNode=new Mp),u;case 22:return l=l.stateNode,u=l._retryCache,u===null&&(u=l._retryCache=new Mp),u;default:throw Error(i(435,l.tag))}}function fi(l,u){var g=Ks(l);u.forEach(function(x){if(!g.has(x)){g.add(x);var C=cy.bind(null,l,x);x.then(C,C)}})}function xa(l,u){var g=u.deletions;if(g!==null)for(var x=0;x<g.length;x++){var C=g[x],E=l,U=u;if(wt){var F=U;e:for(;F!==null;){switch(F.tag){case 27:if(ua){if(Gl(F.type)){Dn=F.stateNode,Jn=!1;break e}break}case 5:Dn=F.stateNode,Jn=!1;break e;case 3:case 4:Dn=F.stateNode.containerInfo,Jn=!0;break e}F=F.return}if(Dn===null)throw Error(i(160));sc(E,U,C),Dn=null,Jn=!1}else sc(E,U,C);E=C.alternate,E!==null&&(E.return=null),C.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)ic(u,l),u=u.sibling}function ic(l,u){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:xa(u,l),ba(l),x&4&&(Lr(3,l,l.return),kr(3,l),Lr(5,l,l.return));break;case 1:xa(u,l),ba(l),x&512&&(Pn||g===null||Ba(g,g.return)),x&64&&Gn&&(l=l.updateQueue,l!==null&&(x=l.callbacks,x!==null&&(g=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=g===null?x:g.concat(x))));break;case 26:if(Ws){var C=Jt;if(xa(u,l),ba(l),x&512&&(Pn||g===null||Ba(g,g.return)),x&4){x=g!==null?g.memoizedState:null;var E=l.memoizedState;g===null?E===null?l.stateNode===null?l.stateNode=f0(C,l.type,l.memoizedProps,l):Sp(C,l.type,l.stateNode):l.stateNode=vp(C,E,l.memoizedProps):x!==E?(x===null?g.stateNode!==null&&Np(g.stateNode):Ii(x),E===null?Sp(C,l.type,l.stateNode):vp(C,E,l.memoizedProps)):E===null&&l.stateNode!==null&&nc(l,l.memoizedProps,g.memoizedProps)}break}case 27:if(ua){xa(u,l),ba(l),x&512&&(Pn||g===null||Ba(g,g.return)),g!==null&&x&4&&nc(l,l.memoizedProps,g.memoizedProps);break}case 5:if(xa(u,l),ba(l),x&512&&(Pn||g===null||Ba(g,g.return)),wt){if(l.flags&32){C=l.stateNode;try{ip(C)}catch(Ce){We(l,l.return,Ce)}}x&4&&l.stateNode!=null&&(C=l.memoizedProps,nc(l,C,g!==null?g.memoizedProps:C)),x&1024&&(Zo=!0)}else Ds&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(xa(u,l),ba(l),x&4&&wt){if(l.stateNode===null)throw Error(i(162));x=l.memoizedProps,g=g!==null?g.memoizedProps:x,C=l.stateNode;try{kg(C,g,x)}catch(Ce){We(l,l.return,Ce)}}break;case 3:if(Ws?(h0(),C=Jt,Jt=xc(u.containerInfo),xa(u,l),Jt=C):xa(u,l),ba(l),x&4){if(wt&&vn&&g!==null&&g.memoizedState.isDehydrated)try{l0(u.containerInfo)}catch(Ce){We(l,l.return,Ce)}if(Ds){x=u.containerInfo,g=u.pendingChildren;try{cp(x,g)}catch(Ce){We(l,l.return,Ce)}}}Zo&&(Zo=!1,Md(l));break;case 4:Ws?(g=Jt,Jt=xc(l.stateNode.containerInfo),xa(u,l),ba(l),Jt=g):(xa(u,l),ba(l)),x&4&&Ds&&qh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:xa(u,l),ba(l);break;case 31:xa(u,l),ba(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 13:xa(u,l),ba(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Tc=Ga()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 22:C=l.memoizedState!==null;var U=g!==null&&g.memoizedState!==null,F=Gn,me=Pn;if(Gn=F||C,Pn=me||U,xa(u,l),Pn=me,Gn=F,ba(l),x&8192&&(u=l.stateNode,u._visibility=C?u._visibility&-2:u._visibility|1,C&&(g===null||U||Gn||Pn||Ui(l)),wt)){e:if(g=null,wt)for(u=l;;){if(u.tag===5||Ws&&u.tag===26){if(g===null){U=g=u;try{E=U.stateNode,C?dy(E):Pg(U.stateNode,U.memoizedProps)}catch(Ce){We(U,U.return,Ce)}}}else if(u.tag===6){if(g===null){U=u;try{var Se=U.stateNode;C?Gg(Se):Yg(Se,U.memoizedProps)}catch(Ce){We(U,U.return,Ce)}}}else if(u.tag===18){if(g===null){U=u;try{var Re=U.stateNode;C?u0(Re):c0(U.stateNode)}catch(Ce){We(U,U.return,Ce)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===l)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break e;for(;u.sibling===null;){if(u.return===null||u.return===l)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}x&4&&(x=l.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,fi(l,g))));break;case 19:xa(u,l),ba(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 30:break;case 21:break;default:xa(u,l),ba(l)}}function ba(l){var u=l.flags;if(u&2){try{for(var g,x=l.return;x!==null;){if(Hh(x)){g=x;break}x=x.return}if(wt){if(g==null)throw Error(i(160));switch(g.tag){case 27:if(ua){var C=g.stateNode,E=di(l);ac(l,E,C);break}case 5:var U=g.stateNode;g.flags&32&&(ip(U),g.flags&=-33);var F=di(l);ac(l,F,U);break;case 3:case 4:var me=g.stateNode.containerInfo,Se=di(l);Ad(l,Se,me);break;default:throw Error(i(161))}}}catch(Re){We(l,l.return,Re)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Md(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var u=l;Md(u),u.tag===5&&u.flags&1024&&$h(u.stateNode),l=l.sibling}}function Za(l,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)Cg(l,u.alternate,u),u=u.sibling}function Ui(l){for(l=l.child;l!==null;){var u=l;switch(u.tag){case 0:case 11:case 14:case 15:Lr(4,u,u.return),Ui(u);break;case 1:Ba(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&Od(u,u.return,g),Ui(u);break;case 27:ua&&va(u.stateNode);case 26:case 5:Ba(u,u.return),Ui(u);break;case 22:u.memoizedState===null&&Ui(u);break;case 30:Ui(u);break;default:Ui(u)}l=l.sibling}}function Fs(l,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,C=l,E=u,U=E.flags;switch(E.tag){case 0:case 11:case 15:Fs(C,E,g),kr(4,E);break;case 1:if(Fs(C,E,g),x=E,C=x.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Se){We(x,x.return,Se)}if(x=E,C=x.updateQueue,C!==null){var F=x.stateNode;try{var me=C.shared.hiddenCallbacks;if(me!==null)for(C.shared.hiddenCallbacks=null,C=0;C<me.length;C++)Pt(me[C],F)}catch(Se){We(x,x.return,Se)}}g&&U&64&&Oo(E),Ao(E,E.return);break;case 27:ua&&_g(E);case 26:case 5:Fs(C,E,g),g&&x===null&&U&4&&Ol(E),Ao(E,E.return);break;case 12:Fs(C,E,g);break;case 31:Fs(C,E,g),g&&U&4&&Xs(C,E);break;case 13:Fs(C,E,g),g&&U&4&&rc(C,E);break;case 22:E.memoizedState===null&&Fs(C,E,g),Ao(E,E.return);break;case 30:break;default:Fs(C,E,g)}u=u.sibling}}function Hi(l,u){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(l=u.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&Qa(g))}function Gh(l,u){l=null,u.alternate!==null&&(l=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==l&&(u.refCount++,l!=null&&Qa(l))}function Rn(l,u,g,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)Dd(l,u,g,x),u=u.sibling}function Dd(l,u,g,x){var C=u.flags;switch(u.tag){case 0:case 11:case 15:Rn(l,u,g,x),C&2048&&kr(9,u);break;case 1:Rn(l,u,g,x);break;case 3:Rn(l,u,g,x),C&2048&&(l=null,u.alternate!==null&&(l=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==l&&(u.refCount++,l!=null&&Qa(l)));break;case 12:if(C&2048){Rn(l,u,g,x),l=u.stateNode;try{var E=u.memoizedProps,U=E.id,F=E.onPostCommit;typeof F=="function"&&F(U,u.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(me){We(u,u.return,me)}}else Rn(l,u,g,x);break;case 31:Rn(l,u,g,x);break;case 13:Rn(l,u,g,x);break;case 23:break;case 22:E=u.stateNode,U=u.alternate,u.memoizedState!==null?E._visibility&2?Rn(l,u,g,x):Mo(l,u):E._visibility&2?Rn(l,u,g,x):(E._visibility|=2,cs(l,u,g,x,(u.subtreeFlags&10256)!==0||!1)),C&2048&&Hi(U,u);break;case 24:Rn(l,u,g,x),C&2048&&Gh(u.alternate,u);break;default:Rn(l,u,g,x)}}function cs(l,u,g,x,C){for(C=C&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var E=l,U=u,F=g,me=x,Se=U.flags;switch(U.tag){case 0:case 11:case 15:cs(E,U,F,me,C),kr(8,U);break;case 23:break;case 22:var Re=U.stateNode;U.memoizedState!==null?Re._visibility&2?cs(E,U,F,me,C):Mo(E,U):(Re._visibility|=2,cs(E,U,F,me,C)),C&&Se&2048&&Hi(U.alternate,U);break;case 24:cs(E,U,F,me,C),C&&Se&2048&&Gh(U.alternate,U);break;default:cs(E,U,F,me,C)}u=u.sibling}}function Mo(l,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=l,x=u,C=x.flags;switch(x.tag){case 22:Mo(g,x),C&2048&&Hi(x.alternate,x);break;case 24:Mo(g,x),C&2048&&Gh(x.alternate,x);break;default:Mo(g,x)}u=u.sibling}}function Ur(l,u,g){if(l.subtreeFlags&Us)for(l=l.child;l!==null;)qi(l,u,g),l=l.sibling}function qi(l,u,g){switch(l.tag){case 26:if(Ur(l,u,g),l.flags&Us)if(l.memoizedState!==null)p0(g,Jt,l.memoizedState,l.memoizedProps);else{var x=l.stateNode,C=l.type;l=l.memoizedProps,((u&335544128)===u||Jh(C,l))&&Zd(g,x,C,l)}break;case 5:Ur(l,u,g),l.flags&Us&&(x=l.stateNode,C=l.type,l=l.memoizedProps,((u&335544128)===u||Jh(C,l))&&Zd(g,x,C,l));break;case 3:case 4:Ws?(x=Jt,Jt=xc(l.stateNode.containerInfo),Ur(l,u,g),Jt=x):Ur(l,u,g);break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=Us,Us=16777216,Ur(l,u,g),Us=x):Ur(l,u,g));break;default:Ur(l,u,g)}}function zd(l){var u=l.alternate;if(u!==null&&(l=u.child,l!==null)){u.child=null;do u=l.sibling,l.sibling=null,l=u;while(l!==null)}}function Do(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var x=u[g];In=x,Os(x,l)}zd(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)kd(l),l=l.sibling}function kd(l){switch(l.tag){case 0:case 11:case 15:Do(l),l.flags&2048&&Lr(9,l,l.return);break;case 3:Do(l);break;case 12:Do(l);break;case 22:var u=l.stateNode;l.memoizedState!==null&&u._visibility&2&&(l.return===null||l.return.tag!==13)?(u._visibility&=-3,lc(l)):Do(l);break;default:Do(l)}}function lc(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var x=u[g];In=x,Os(x,l)}zd(l)}for(l=l.child;l!==null;){switch(u=l,u.tag){case 0:case 11:case 15:Lr(8,u,u.return),lc(u);break;case 22:g=u.stateNode,g._visibility&2&&(g._visibility&=-3,lc(u));break;default:lc(u)}l=l.sibling}}function Os(l,u){for(;In!==null;){var g=In;switch(g.tag){case 0:case 11:case 15:Lr(8,g,u);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var x=g.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:Qa(g.memoizedState.cache)}if(x=g.child,x!==null)x.return=g,In=x;else e:for(g=l;In!==null;){x=In;var C=x.sibling,E=x.return;if(Bh(x),x===g){In=null;break e}if(C!==null){C.return=E,In=C;break e}In=E}}}function Bi(l){var u=rt(l);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(l=Fn(l),l===null)throw Error(i(362));return l.stateNode.current}function Gi(l,u){var g=l.tag;switch(u.$$typeof){case ir:if(l.type===u.value)return!0;break;case Jo:e:{for(u=u.value,l=[l,0],g=0;g<l.length;){var x=l[g++],C=x.tag,E=l[g++],U=u[E];if(C!==5&&C!==26&&C!==27||!Fi(x)){for(;U!=null&&Gi(x,U);)E++,U=u[E];if(E===u.length){u=!0;break e}else for(x=x.child;x!==null;)l.push(x,E),x=x.sibling}}u=!1}return u;case Wo:if((g===5||g===26||g===27)&&np(l.stateNode,u.value))return!0;break;case nl:if((g===5||g===6||g===26||g===27)&&(l=gc(l),l!==null&&0<=l.indexOf(u.value)))return!0;break;case wc:if((g===5||g===26||g===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function zo(l){switch(l.$$typeof){case ir:return"<"+(b(l.value)||"Unknown")+">";case Jo:return":has("+(zo(l)||"")+")";case Wo:return'[role="'+l.value+'"]';case nl:return'"'+l.value+'"';case wc:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function ko(l,u){var g=[];l=[l,0];for(var x=0;x<l.length;){var C=l[x++],E=C.tag,U=l[x++],F=u[U];if(E!==5&&E!==26&&E!==27||!Fi(C)){for(;F!=null&&Gi(C,F);)U++,F=u[U];if(U===u.length)g.push(C);else for(C=C.child;C!==null;)l.push(C,U),C=C.sibling}}return g}function ds(l,u){if(!oa)throw Error(i(363));l=Bi(l),l=ko(l,u),u=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++],C=x.tag;if(C===5||C===26||C===27)Fi(x)||u.push(x.stateNode);else for(x=x.child;x!==null;)l.push(x),x=x.sibling}return u}function bn(){return(xt&2)!==0&&Nt!==0?Nt&-Nt:Qe.T!==null?Ta():Vo()}function hi(){if(ns===0)if((Nt&536870912)===0||St){var l=Yl;Yl<<=1,(Yl&3932160)===0&&(Yl=262144),ns=l}else ns=536870912;return l=ys.current,l!==null&&(l.flags|=32),ns}function On(l,u,g){(l===ht&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)&&(qn(l,0),qr(l,Nt,ns,!1)),H(l,g),((xt&2)===0||l!==ht)&&(l===ht&&((xt&2)===0&&(rl|=g),zn===4&&qr(l,Nt,ns,!1)),Ea(l))}function br(l,u,g){if((xt&6)!==0)throw Error(i(327));var x=!g&&(u&127)===0&&(u&l.expiredLanes)===0||A(l,u),C=x?Eg(l,u):Br(l,u,!0),E=x;do{if(C===0){al&&!x&&qr(l,u,0,!1);break}else{if(g=l.current.alternate,E&&!jg(g)){C=Br(l,u,!1),E=!1;continue}if(C===2){if(E=u,l.errorRecoveryDisabledLanes&E)var U=0;else U=l.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){u=U;e:{var F=l;C=Ec;var me=vn&&F.current.memoizedState.isDehydrated;if(me&&(qn(F,U).flags|=256),U=Br(F,U,!1),U!==2){if(sl&&!me){F.errorRecoveryDisabledLanes|=E,rl|=E,C=4;break e}E=xs,xs=C,E!==null&&(xs===null?xs=E:xs.push.apply(xs,E))}C=U}if(E=!1,C!==2)continue}}if(C===1){qn(l,0),qr(l,u,0,!0);break}e:{switch(x=l,E=C,E){case 0:case 1:throw Error(i(345));case 4:if((u&4194048)!==u)break;case 6:qr(x,u,ns,!_r);break e;case 2:xs=null;break;case 3:case 5:break;default:throw Error(i(329))}if((u&62914560)===u&&(C=Tc+300-Ga(),10<C)){if(qr(x,u,ns,!_r),T(x,0,!0)!==0)break e;ei=u,x.timeoutHandle=Ih(Hr.bind(null,x,g,xs,Rc,xf,u,ns,rl,eu,_r,E,"Throttled",-0,0),C);break e}Hr(x,g,xs,Rc,xf,u,ns,rl,eu,_r,E,null,-0,0)}}break}while(!0);Ea(l)}function Hr(l,u,g,x,C,E,U,F,me,Se,Re,Ce,Le,st){if(l.timeoutHandle=ps,Ce=u.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce=Wh(),qi(u,E,Ce);var _a=(E&62914560)===E?Tc-Ga():(E&4194048)===E?Il-Ga():0;if(_a=zg(Ce,_a),_a!==null){ei=E,l.cancelPendingCommit=_a(Pr.bind(null,l,u,E,g,x,C,U,F,me,Re,Ce,null,Le,st)),qr(l,E,U,!Se);return}}Pr(l,u,E,g,x,C,U,F,me)}function jg(l){for(var u=l;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var C=g[x],E=C.getSnapshot;C=C.value;try{if(!Zn(E(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function qr(l,u,g,x){u&=~$o,u&=~rl,l.suspendedLanes|=u,l.pingedLanes&=~u,x&&(l.warmLanes|=u),x=l.expirationTimes;for(var C=u;0<C;){var E=31-ms(C),U=1<<E;x[E]=-1,C&=~U}g!==0&&L(l,g,u)}function Ld(){return(xt&6)===0?(is(0),!1):!0}function Ud(){if(bt!==null){if(Wt===0)var l=bt.return;else l=bt,Sr=un=null,Qu(l),$i=null,Ql=0,l=bt;for(;l!==null;)Ng(l.alternate,l),l=l.return;bt=null}}function qn(l,u){var g=l.timeoutHandle;g!==ps&&(l.timeoutHandle=ps,Dg(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),ei=0,Ud(),ht=l,bt=g=Ms(l.current,null),Nt=u,Wt=0,na=null,_r=!1,al=A(l,u),sl=!1,eu=ns=$o=rl=ji=zn=0,xs=Ec=null,xf=!1,(u&8)!==0&&(u|=u&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=u;0<x;){var C=31-ms(x),E=1<<C;u|=l[C],x&=~E}return $r=u,Ue(),g}function on(l,u){it=null,Qe.H=Ls,u===fa||u===sr?(u=Xn(),Wt=3):u===gf?(u=Xn(),Wt=4):Wt=u===ts?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,na=u,bt===null&&(zn=1,wd(l,Ne(u,l.current)))}function jt(){var l=ys.current;return l===null?!0:(Nt&4194048)===Nt?es===null:(Nt&62914560)===Nt||(Nt&536870912)!==0?l===es:!1}function pi(){var l=Qe.H;return Qe.H=Ls,l===null?Ls:l}function As(){var l=Qe.A;return Qe.A=Io,l}function Lo(){zn=4,_r||(Nt&4194048)!==Nt&&ys.current!==null||(al=!0),(ji&134217727)===0&&(rl&134217727)===0||ht===null||qr(ht,Nt,ns,!1)}function Br(l,u,g){var x=xt;xt|=2;var C=pi(),E=As();(ht!==l||Nt!==u)&&(Rc=null,qn(l,u)),u=!1;var U=zn;e:do try{if(Wt!==0&&bt!==null){var F=bt,me=na;switch(Wt){case 8:Ud(),U=6;break e;case 3:case 2:case 9:case 6:ys.current===null&&(u=!0);var Se=Wt;if(Wt=0,na=null,Gr(l,F,me,Se),g&&al){U=0;break e}break;default:Se=Wt,Wt=0,na=null,Gr(l,F,me,Se)}}wg(),U=zn;break}catch(Re){on(l,Re)}while(!0);return u&&l.shellSuspendCounter++,Sr=un=null,xt=x,Qe.H=C,Qe.A=E,bt===null&&(ht=null,Nt=0,Ue()),U}function wg(){for(;bt!==null;)Pi(bt)}function Eg(l,u){var g=xt;xt|=2;var x=pi(),C=As();ht!==l||Nt!==u?(Rc=null,il=Ga()+500,qn(l,u)):al=A(l,u);e:do try{if(Wt!==0&&bt!==null){u=bt;var E=na;t:switch(Wt){case 1:Wt=0,na=null,Gr(l,u,E,1);break;case 2:case 9:if(Mt(E)){Wt=0,na=null,Hd(u);break}u=function(){Wt!==2&&Wt!==9||ht!==l||(Wt=7),Ea(l)},E.then(u,u);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:Mt(E)?(Wt=0,na=null,Hd(u)):(Wt=0,na=null,Gr(l,u,E,7));break;case 5:var U=null;switch(bt.tag){case 26:U=bt.memoizedState;case 5:case 27:var F=bt,me=F.type,Se=F.pendingProps;if(U?Cp(U):An(F.stateNode,me,Se)){Wt=0,na=null;var Re=F.sibling;if(Re!==null)bt=Re;else{var Ce=F.return;Ce!==null?(bt=Ce,Ho(Ce)):bt=null}break t}}Wt=0,na=null,Gr(l,u,E,5);break;case 6:Wt=0,na=null,Gr(l,u,E,6);break;case 8:Ud(),zn=6;break e;default:throw Error(i(462))}}Uo();break}catch(Le){on(l,Le)}while(!0);return Sr=un=null,Qe.H=x,Qe.A=C,xt=g,bt!==null?0:(ht=null,Nt=0,Ue(),zn)}function Uo(){for(;bt!==null&&!g0();)Pi(bt)}function Pi(l){var u=zh(l.alternate,l,$r);l.memoizedProps=l.pendingProps,u===null?Ho(l):bt=u}function Hd(l){var u=l,g=u.alternate;switch(u.tag){case 15:case 0:u=Th(g,u,u.pendingProps,u.type,void 0,Nt);break;case 11:u=Th(g,u,u.pendingProps,u.type.render,u.ref,Nt);break;case 5:Qu(u);default:Ng(g,u),u=bt=Gd(u,$r),u=zh(g,u,$r)}l.memoizedProps=l.pendingProps,u===null?Ho(l):bt=u}function Gr(l,u,g,x){Sr=un=null,Qu(u),$i=null,Ql=0;var C=u.return;try{if(ly(l,C,u,g,Nt)){zn=1,wd(l,Ne(g,l.current)),bt=null;return}}catch(E){if(C!==null)throw bt=C,E;zn=1,wd(l,Ne(g,l.current)),bt=null;return}u.flags&32768?(St||x===1?l=!0:al||(Nt&536870912)!==0?l=!1:(_r=l=!0,(x===2||x===9||x===3||x===6)&&(x=ys.current,x!==null&&x.tag===13&&(x.flags|=16384))),Yi(u,l)):Ho(u)}function Ho(l){var u=l;do{if((u.flags&32768)!==0){Yi(u,_r);return}l=u.return;var g=Sg(u.alternate,u,$r);if(g!==null){bt=g;return}if(u=u.sibling,u!==null){bt=u;return}bt=u=l}while(u!==null);zn===0&&(zn=5)}function Yi(l,u){do{var g=Uh(l.alternate,l);if(g!==null){g.flags&=32767,bt=g;return}if(g=l.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!u&&(l=l.sibling,l!==null)){bt=l;return}bt=l=g}while(l!==null);zn=6,bt=null}function Pr(l,u,g,x,C,E,U,F,me){l.cancelPendingCommit=null;do Vr();while(aa!==0);if((xt&6)!==0)throw Error(i(327));if(u!==null){if(u===l.current)throw Error(i(177));if(E=u.lanes|u.childLanes,E|=Xl,B(l,g,E,U,F,me),l===ht&&(bt=ht=null,Nt=0),Jl=u,Ei=l,ei=g,tu=E,bf=C,Dp=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,ea(vc,function(){return oc(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=Qe.T,Qe.T=null,C=Js(),vt(2),U=xt,xt|=4;try{oy(l,u,g)}finally{xt=U,vt(C),Qe.T=x}}aa=1,mi(),Yr(),qd()}}function mi(){if(aa===1){aa=0;var l=Ei,u=Jl,g=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||g){g=Qe.T,Qe.T=null;var x=Js();vt(2);var C=xt;xt|=4;try{ic(u,l),Mg(l.containerInfo)}finally{xt=C,vt(x),Qe.T=g}}l.current=u,aa=2}}function Yr(){if(aa===2){aa=0;var l=Ei,u=Jl,g=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||g){g=Qe.T,Qe.T=null;var x=Js();vt(2);var C=xt;xt|=4;try{Cg(l,u.alternate,u)}finally{xt=C,vt(x),Qe.T=g}}aa=3}}function qd(){if(aa===4||aa===3){aa=0,wp();var l=Ei,u=Jl,g=ei,x=Dp;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?aa=5:(aa=0,Jl=Ei=null,Bd(l,l.pendingLanes));var C=l.pendingLanes;if(C===0&&(wi=null),ne(g),u=u.stateNode,gs&&typeof gs.onCommitFiberRoot=="function")try{gs.onCommitFiberRoot(Vl,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=Qe.T,C=Js(),vt(2),Qe.T=null;try{for(var E=l.onRecoverableError,U=0;U<x.length;U++){var F=x[U];E(F.value,{componentStack:F.stack})}}finally{Qe.T=u,vt(C)}}(ei&3)!==0&&Vr(),Ea(l),C=l.pendingLanes,(g&261930)!==0&&(C&42)!==0?l===Oc?Ut++:(Ut=0,Oc=l):Ut=0,vn&&yc(),is(0)}}function Bd(l,u){(l.pooledCacheLanes&=u)===0&&(u=l.pooledCache,u!=null&&(l.pooledCache=null,Qa(u)))}function Vr(){return mi(),Yr(),qd(),oc()}function oc(){if(aa!==5)return!1;var l=Ei,u=tu;tu=0;var g=ne(ei),x=32>g?32:g;g=Qe.T;var C=Js();try{vt(x),Qe.T=null,x=bf,bf=null;var E=Ei,U=ei;if(aa=0,Jl=Ei=null,ei=0,(xt&6)!==0)throw Error(i(331));var F=xt;if(xt|=4,kd(E.current),Dd(E,E.current,U,x),xt=F,is(0,!1),gs&&typeof gs.onPostCommitFiberRoot=="function")try{gs.onPostCommitFiberRoot(Vl,E)}catch{}return!0}finally{vt(C),Qe.T=g,Bd(l,u)}}function Vi(l,u,g){u=Ne(g,u),u=wh(l.stateNode,u,2),l=pn(l,u,2),l!==null&&(H(l,2),Ea(l))}function We(l,u,g){if(l.tag===3)Vi(l,l,g);else for(;u!==null;){if(u.tag===3){Vi(u,l,g);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(wi===null||!wi.has(x))){l=Ne(g,l),g=ug(2),x=pn(u,g,2),x!==null&&(cg(g,x,u,l),H(x,2),Ea(x));break}}u=u.return}}function qo(l,u,g){var x=l.pingCache;if(x===null){x=l.pingCache=new Hs;var C=new Set;x.set(u,C)}else C=x.get(u),C===void 0&&(C=new Set,x.set(u,C));C.has(g)||(sl=!0,C.add(g),l=Tg.bind(null,l,u,g),u.then(l,l))}function Tg(l,u,g){var x=l.pingCache;x!==null&&x.delete(u),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,ht===l&&(Nt&g)===g&&(zn===4||zn===3&&(Nt&62914560)===Nt&&300>Ga()-Tc?(xt&2)===0&&qn(l,0):$o|=g,eu===Nt&&(eu=0)),Ea(l)}function Rg(l,u){u===0&&(u=k()),l=ot(l,u),l!==null&&(H(l,u),Ea(l))}function uy(l){var u=l.memoizedState,g=0;u!==null&&(g=u.retryLane),Rg(l,g)}function cy(l,u){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(i(314))}x!==null&&x.delete(u),Rg(l,g)}function ea(l,u){return bc(l,u)}function Ph(l,u,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Al(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ms(l,u){var g=l.alternate;return g===null?(g=n(l.tag,u,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=u,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&65011712,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,u=l.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Gd(l,u){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=u,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,u=g.dependencies,l.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),l}function gi(l,u,g,x,C,E){var U=0;if(x=l,typeof l=="function")Al(l)&&(U=1);else if(typeof l=="string")U=Ws&&ua?nf(l,g,Sa.current)?26:jp(l)?27:5:Ws?nf(l,g,Sa.current)?26:5:ua&&jp(l)?27:5;else e:switch(l){case fc:return l=n(31,g,u,C),l.elementType=fc,l.lanes=E,l;case kl:return Zs(g.children,C,E,u);case Ll:U=8,C|=24;break;case Ul:return l=n(12,g,u,C|2),l.elementType=Ul,l.lanes=E,l;case Qd:return l=n(13,g,u,C),l.elementType=Qd,l.lanes=E,l;case yi:return l=n(19,g,u,C),l.elementType=yi,l.lanes=E,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Is:U=10;break e;case dc:U=9;break e;case Bo:U=11;break e;case Xd:U=14;break e;case Ia:U=16,x=null;break e}U=29,g=Error(i(130,l===null?"null":typeof l,"")),x=null}return u=n(U,g,u,C),u.elementType=l,u.type=x,u.lanes=E,u}function Zs(l,u,g,x){return l=n(7,l,x,u),l.lanes=g,l}function Yh(l,u,g){return l=n(6,l,null,u),l.lanes=g,l}function Vh(l){var u=n(18,null,null,0);return u.stateNode=l,u}function Qh(l,u,g){return u=n(4,l.children!==null?l.children:[],l.key,u),u.lanes=g,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function Og(l,u,g,x,C,E,U,F,me){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ps,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=P(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P(0),this.hiddenUpdates=P(null),this.identifierPrefix=x,this.onUncaughtError=C,this.onCaughtError=E,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=me,this.incompleteTransitions=new Map}function Qi(l,u,g,x,C,E,U,F,me,Se,Re,Ce){return l=new Og(l,u,g,U,me,Se,Re,Ce,F),u=1,E===!0&&(u|=24),E=n(3,null,null,u),l.current=E,E.stateNode=l,u=hr(),u.refCount++,l.pooledCache=u,u.refCount++,E.memoizedState={element:x,isDehydrated:g,cache:u},ut(E),l}function Pd(l){return l?(l=Xr,l):Xr}function uc(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=f(u),l=l!==null?m(l):null,l===null?null:Po(l.stateNode)}function Xh(l,u,g,x,C,E){C=Pd(C),x.context===null?x.context=C:x.pendingContext=C,x=Tt(u),x.payload={element:g},E=E===void 0?null:E,E!==null&&(x.callback=E),g=pn(l,x,u),g!==null&&(On(g,l,u),Ar(g,l,u))}function Ml(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<u?g:u}}function cc(l,u){Ml(l,u),(l=l.alternate)&&Ml(l,u)}var dt={},Yd=gl(),fs=Bb(),Vd=Object.assign,Dl=Symbol.for("react.element"),Qr=Symbol.for("react.transitional.element"),zl=Symbol.for("react.portal"),kl=Symbol.for("react.fragment"),Ll=Symbol.for("react.strict_mode"),Ul=Symbol.for("react.profiler"),dc=Symbol.for("react.consumer"),Is=Symbol.for("react.context"),Bo=Symbol.for("react.forward_ref"),Qd=Symbol.for("react.suspense"),yi=Symbol.for("react.suspense_list"),Xd=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),fc=Symbol.for("react.activity"),Kh=Symbol.for("react.memo_cache_sentinel"),xi=Symbol.iterator,Xi=Symbol.for("react.client.reference"),Ki=Array.isArray,Qe=Yd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Fh=e.rendererVersion,hc=e.rendererPackageName,Go=e.extraDevToolsConfig,Po=e.getPublicInstance,Ag=e.getRootHostContext,Yo=e.getChildHostContext,Kd=e.prepareForCommit,Mg=e.resetAfterCommit,Zh=e.createInstance;e.cloneMutableInstance;var pc=e.appendInitialChild,hs=e.finalizeInitialChildren,Ja=e.shouldSetTextContent,bi=e.createTextInstance;e.cloneMutableTextInstance;var Ih=e.scheduleTimeout,Dg=e.cancelTimeout,ps=e.noTimeout,Kn=e.isPrimaryRenderer;e.warnsIfNotActing;var wt=e.supportsMutation,Ds=e.supportsPersistence,vn=e.supportsHydration,rt=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var en=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var vt=e.setCurrentUpdatePriority,Js=e.getCurrentUpdatePriority,Vo=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Hl=e.shouldAttemptEagerTransition,Fd=e.detachDeletedInstance;e.requestPostPaintCallback;var mc=e.maySuspendCommit,Qo=e.maySuspendCommitOnUpdate,Jh=e.maySuspendCommitInSyncRender,An=e.preloadInstance,Wh=e.startSuspendingCommit,Zd=e.suspendInstance;e.suspendOnActiveViewTransition;var zg=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ql=e.NotPendingTransition,Bl=e.HostTransitionContext,$h=e.resetFormInstance;e.bindToConsole;var ep=e.supportsMicrotasks,tp=e.scheduleMicrotask,oa=e.supportsTestSelectors,Fn=e.findFiberRoot,Id=e.getBoundingRect,gc=e.getTextContent,Fi=e.isHiddenSubtree,np=e.matchAccessibilityRole,vi=e.setFocusIfFocusable,Jd=e.setupIntersectionObserver,ap=e.appendChild,sp=e.appendChildToContainer,kg=e.commitTextUpdate,Lg=e.commitMount,Ug=e.commitUpdate,Hg=e.insertBefore,qg=e.insertInContainerBefore,Bg=e.removeChild,rp=e.removeChildFromContainer,ip=e.resetTextContent,dy=e.hideInstance,Gg=e.hideTextInstance,Pg=e.unhideInstance,Yg=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var lp=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Vg=e.cloneInstance,op=e.createContainerChildSet,up=e.appendChildToContainerChildSet,Qg=e.finalizeContainerChildren,cp=e.replaceContainerChildren,Xg=e.cloneHiddenInstance,dp=e.cloneHiddenTextInstance,Zi=e.isSuspenseInstancePending,Wd=e.isSuspenseInstanceFallback,$d=e.getSuspenseInstanceFallbackErrorDetails,ef=e.registerSuspenseInstanceRetry,Kg=e.canHydrateFormStateMarker,fp=e.isFormStateMarkerMatching,Fg=e.getNextHydratableSibling,Zg=e.getNextHydratableSiblingAfterSingleton,Ig=e.getFirstHydratableChild,Jg=e.getFirstHydratableChildWithinContainer,Wg=e.getFirstHydratableChildWithinActivityInstance,$g=e.getFirstHydratableChildWithinSuspenseInstance,hp=e.getFirstHydratableChildWithinSingleton,e0=e.canHydrateInstance,t0=e.canHydrateTextInstance,pp=e.canHydrateActivityInstance,n0=e.canHydrateSuspenseInstance,a0=e.hydrateInstance,fy=e.hydrateTextInstance,mp=e.hydrateActivityInstance,s0=e.hydrateSuspenseInstance,r0=e.getNextHydratableInstanceAfterActivityInstance,gp=e.getNextHydratableInstanceAfterSuspenseInstance,i0=e.commitHydratedInstance,l0=e.commitHydratedContainer,hy=e.commitHydratedActivityInstance,py=e.commitHydratedSuspenseInstance,o0=e.finalizeHydratedChildren,yc=e.flushHydrationEvents;e.clearActivityBoundary;var yp=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var tf=e.clearSuspenseBoundaryFromContainer,u0=e.hideDehydratedBoundary,c0=e.unhideDehydratedBoundary,Xo=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var d0=e.validateHydratableInstance,xp=e.validateHydratableTextInstance,Ws=e.supportsResources,nf=e.isHostHoistableType,xc=e.getHoistableRoot,bp=e.getResource,vp=e.acquireResource,Ii=e.releaseResource,f0=e.hydrateHoistable,Sp=e.mountHoistable,Np=e.unmountHoistable,af=e.createHoistableInstance,h0=e.prepareToCommitHoistables,_p=e.mayResourceSuspendCommit,Cp=e.preloadResource,p0=e.suspendResource,ua=e.supportsSingletons,sf=e.resolveSingletonInstance,ta=e.acquireSingletonInstance,va=e.releaseSingletonInstance,jp=e.isHostSingletonType,Gl=e.isSingletonScope,rf=[],Pl=-1,Xr={},ms=Math.clz32?Math.clz32:O,lf=Math.log,m0=Math.LN2,of=256,Yl=262144,Ko=4194304,bc=fs.unstable_scheduleCallback,uf=fs.unstable_cancelCallback,g0=fs.unstable_shouldYield,wp=fs.unstable_requestPaint,Ga=fs.unstable_now,cf=fs.unstable_ImmediatePriority,y0=fs.unstable_UserBlockingPriority,vc=fs.unstable_NormalPriority,df=fs.unstable_IdlePriority,Ep=fs.log,x0=fs.unstable_setDisableYieldValue,Vl=null,gs=null,Zn=typeof Object.is=="function"?Object.is:ie,ff=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},my=Object.prototype.hasOwnProperty,hf,Kr,Sc=!1,Tp=new WeakMap,Si=[],Fr=0,tn=null,Nc=0,$s=[],zs=0,er=null,Aa=1,vr="",Sa=_(null),Ni=_(null),Ma=_(null),_c=_(null),ca=null,Sn=null,St=!1,Zr=null,Wa=!1,pf=Error(i(519)),tr=_(null),un=null,Sr=null,b0=typeof AbortController<"u"?AbortController:function(){var l=[],u=this.signal={aborted:!1,addEventListener:function(g,x){l.push(x)}};this.abort=function(){u.aborted=!0,l.forEach(function(g){return g()})}},Na=fs.unstable_scheduleCallback,gy=fs.unstable_NormalPriority,Nn={$$typeof:Is,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Cc=null,It=null,Pa=!1,nr=!1,mf=!1,Ji=0,Fo=null,Rp=0,_i=0,da=null,ar=Qe.S;Qe.S=function(l,u){Il=Ga(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&Pu(l,u),ar!==null&&ar(l,u)};var Wi=_(null),fa=Error(i(460)),gf=Error(i(474)),sr=Error(i(542)),Ir={then:function(){}},$a=null,$i=null,Ql=0,Da=Gs(!0),Op=Gs(!1),za=[],Jr=0,Xl=0,ks=!1,yf=!1,Kl=_(null),el=_(0),ys=_(null),es=null,Bn=_(0),Ci=0,it=null,Ye=null,tt=null,ft=!1,ct=!1,Rt=!1,Ya=0,rr=0,Nr=null,Ap=0,Ls={readContext:Zt,use:bo,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn};Ls.useEffectEvent=Tn;var Mn={readContext:Zt,use:bo,useCallback:function(l,u){return Ha().memoizedState=[l,u===void 0?null:u],l},useContext:Zt,useEffect:Fu,useImperativeHandle:function(l,u,g){g=g!=null?g.concat([l]):null,jl(4194308,4,_o.bind(null,u,l),g)},useLayoutEffect:function(l,u){return jl(4194308,4,l,u)},useInsertionEffect:function(l,u){jl(4,2,l,u)},useMemo:function(l,u){var g=Ha();u=u===void 0?null:u;var x=l();if(Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,u],x},useReducer:function(l,u,g){var x=Ha();if(g!==void 0){var C=g(u);if(Rt){J(!0);try{g(u)}finally{J(!1)}}}else C=u;return x.memoizedState=x.baseState=C,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:C},x.queue=l,l=l.dispatch=iy.bind(null,it,l),[x.memoizedState,l]},useRef:function(l){var u=Ha();return l={current:l},u.memoizedState=l},useState:function(l){l=xh(l);var u=l.queue,g=rg.bind(null,it,u);return u.dispatch=g,[l.memoizedState,g]},useDebugValue:Iu,useDeferredValue:function(l,u){var g=Ha();return jo(g,l,u)},useTransition:function(){var l=xh(!1);return l=ng.bind(null,it,l.queue,!0,!1),Ha().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,u,g){var x=it,C=Ha();if(St){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),ht===null)throw Error(i(349));(Nt&127)!==0||Wm(x,u,g)}C.memoizedState=g;var E={value:g,getSnapshot:u};return C.queue=E,Fu(yh.bind(null,x,E,l),[l]),x.flags|=2048,Rs(9,{destroy:void 0},gh.bind(null,x,E,g,u),null),g},useId:function(){var l=Ha(),u=ht.identifierPrefix;if(St){var g=vr,x=Aa;g=(x&~(1<<32-ms(x)-1)).toString(32)+g,u="_"+u+"R_"+g,g=Ya++,0<g&&(u+="H"+g.toString(32)),u+="_"}else g=Ap++,u="_"+u+"r_"+g.toString(32)+"_";return l.memoizedState=u},useHostTransitionStatus:_h,useFormState:vh,useActionState:vh,useOptimistic:function(l){var u=Ha();u.memoizedState=u.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=_d.bind(null,it,!0,g),g.dispatch=u,[l,u]},useMemoCache:hd,useCacheRefresh:function(){return Ha().memoizedState=ry.bind(null,it)},useEffectEvent:function(l){var u=Ha(),g={impl:l};return u.memoizedState=g,function(){if((xt&2)!==0)throw Error(i(440));return g.impl.apply(void 0,arguments)}}},Wr={readContext:Zt,use:bo,useCallback:Sd,useContext:Zt,useEffect:No,useImperativeHandle:tg,useInsertionEffect:ki,useLayoutEffect:Zu,useMemo:Co,useReducer:ui,useRef:vd,useState:function(){return ui(xr)},useDebugValue:Iu,useDeferredValue:function(l,u){var g=xn();return Nh(g,Ye.memoizedState,l,u)},useTransition:function(){var l=ui(xr)[0],u=xn().memoizedState;return[typeof l=="boolean"?l:qa(l),u]},useSyncExternalStore:_l,useId:Nd,useHostTransitionStatus:_h,useFormState:vo,useActionState:vo,useOptimistic:function(l,u){var g=xn();return Xu(g,Ye,l,u)},useMemoCache:hd,useCacheRefresh:sg};Wr.useEffectEvent=Ka;var tl={readContext:Zt,use:bo,useCallback:Sd,useContext:Zt,useEffect:No,useImperativeHandle:tg,useInsertionEffect:ki,useLayoutEffect:Zu,useMemo:Co,useReducer:md,useRef:vd,useState:function(){return md(xr)},useDebugValue:Iu,useDeferredValue:function(l,u){var g=xn();return Ye===null?jo(g,l,u):Nh(g,Ye.memoizedState,l,u)},useTransition:function(){var l=md(xr)[0],u=xn().memoizedState;return[typeof l=="boolean"?l:qa(l),u]},useSyncExternalStore:_l,useId:Nd,useHostTransitionStatus:_h,useFormState:So,useActionState:So,useOptimistic:function(l,u){var g=xn();return Ye!==null?Xu(g,Ye,l,u):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:hd,useCacheRefresh:sg};tl.useEffectEvent=Ka;var jc={enqueueSetState:function(l,u,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.payload=u,g!=null&&(C.callback=g),u=pn(l,C,x),u!==null&&(On(u,l,x),Ar(u,l,x))},enqueueReplaceState:function(l,u,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=pn(l,C,x),u!==null&&(On(u,l,x),Ar(u,l,x))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var g=bn(),x=Tt(g);x.tag=2,u!=null&&(x.callback=u),u=pn(l,x,g),u!==null&&(On(u,l,g),Ar(u,l,g))}},ts=Error(i(461)),mn=!1,Fl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Gn=!1,Pn=!1,Zo=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,In=null,Dn=null,Jn=!1,Jt=null,Us=8192,Io={getCacheForType:function(l){var u=Zt(Nn),g=u.data.get(l);return g===void 0&&(g=l(),u.data.set(l,g)),g},cacheSignal:function(){return Zt(Nn).controller.signal}},ir=0,Jo=1,Wo=2,wc=3,nl=4;if(typeof Symbol=="function"&&Symbol.for){var Zl=Symbol.for;ir=Zl("selector.component"),Jo=Zl("selector.has_pseudo_class"),Wo=Zl("selector.role"),wc=Zl("selector.test_id"),nl=Zl("selector.text")}var Hs=typeof WeakMap=="function"?WeakMap:Map,xt=0,ht=null,bt=null,Nt=0,Wt=0,na=null,_r=!1,al=!1,sl=!1,$r=0,zn=0,ji=0,rl=0,$o=0,ns=0,eu=0,Ec=null,xs=null,xf=!1,Tc=0,Il=0,il=1/0,Rc=null,wi=null,aa=0,Ei=null,Jl=null,ei=0,tu=0,bf=null,Dp=null,Ut=0,Oc=null;return dt.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var u=ot(l,67108864);u!==null&&On(u,l,67108864),cc(l,67108864)}},dt.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var u=bn();u=oe(u);var g=ot(l,u);g!==null&&On(g,l,u),cc(l,u)}},dt.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var u=R(l.pendingLanes);if(u!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;u;){var g=1<<31-ms(u);l.entanglements[1]|=g,u&=~g}Ea(l),(xt&6)===0&&(il=Ga()+500,is(0))}}break;case 31:case 13:u=ot(l,2),u!==null&&On(u,l,2),Ld(),cc(l,2)}},dt.batchedUpdates=function(l,u){return l(u)},dt.createComponentSelector=function(l){return{$$typeof:ir,value:l}},dt.createContainer=function(l,u,g,x,C,E,U,F,me,Se){return Qi(l,u,!1,null,g,x,E,null,U,F,me,Se)},dt.createHasPseudoClassSelector=function(l){return{$$typeof:Jo,value:l}},dt.createHydrationContainer=function(l,u,g,x,C,E,U,F,me,Se,Re,Ce,Le,st){return l=Qi(g,x,!0,l,C,E,F,st,me,Se,Re,Ce),l.context=Pd(null),g=l.current,x=bn(),x=oe(x),C=Tt(x),C.callback=u??null,pn(g,C,x),u=x,l.current.lanes=u,H(l,u),Ea(l),l},dt.createPortal=function(l,u,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zl,key:x==null?null:""+x,children:l,containerInfo:u,implementation:g}},dt.createRoleSelector=function(l){return{$$typeof:Wo,value:l}},dt.createTestNameSelector=function(l){return{$$typeof:wc,value:l}},dt.createTextSelector=function(l){return{$$typeof:nl,value:l}},dt.defaultOnCaughtError=function(l){console.error(l)},dt.defaultOnRecoverableError=function(l){ff(l)},dt.defaultOnUncaughtError=function(l){ff(l)},dt.deferredUpdates=function(l){var u=Qe.T,g=Js();try{return vt(32),Qe.T=null,l()}finally{vt(g),Qe.T=u}},dt.discreteUpdates=function(l,u,g,x,C){var E=Qe.T,U=Js();try{return vt(2),Qe.T=null,l(u,g,x,C)}finally{vt(U),Qe.T=E,xt===0&&(il=Ga()+500)}},dt.findAllNodes=ds,dt.findBoundingRects=function(l,u){if(!oa)throw Error(i(363));u=ds(l,u),l=[];for(var g=0;g<u.length;g++)l.push(Id(u[g]));for(u=l.length-1;0<u;u--){g=l[u];for(var x=g.x,C=x+g.width,E=g.y,U=E+g.height,F=u-1;0<=F;F--)if(u!==F){var me=l[F],Se=me.x,Re=Se+me.width,Ce=me.y,Le=Ce+me.height;if(x>=Se&&E>=Ce&&C<=Re&&U<=Le){l.splice(u,1);break}else if(x!==Se||g.width!==me.width||Le<E||Ce>U){if(!(E!==Ce||g.height!==me.height||Re<x||Se>C)){Se>x&&(me.width+=Se-x,me.x=x),Re<C&&(me.width=C-Se),l.splice(u,1);break}}else{Ce>E&&(me.height+=Ce-E,me.y=E),Le<U&&(me.height=U-Ce),l.splice(u,1);break}}}return l},dt.findHostInstance=uc,dt.findHostInstanceWithNoPortals=function(l){return l=f(l),l=l!==null?y(l):null,l===null?null:Po(l.stateNode)},dt.findHostInstanceWithWarning=function(l){return uc(l)},dt.flushPassiveEffects=Vr,dt.flushSyncFromReconciler=function(l){var u=xt;xt|=1;var g=Qe.T,x=Js();try{if(vt(2),Qe.T=null,l)return l()}finally{vt(x),Qe.T=g,xt=u,(xt&6)===0&&is(0)}},dt.flushSyncWork=Ld,dt.focusWithin=function(l,u){if(!oa)throw Error(i(363));for(l=Bi(l),u=ko(l,u),u=Array.from(u),l=0;l<u.length;){var g=u[l++],x=g.tag;if(!Fi(g)){if((x===5||x===26||x===27)&&vi(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},dt.getFindAllNodesFailureDescription=function(l,u){if(!oa)throw Error(i(363));var g=0,x=[];l=[Bi(l),0];for(var C=0;C<l.length;){var E=l[C++],U=E.tag,F=l[C++],me=u[F];if((U!==5&&U!==26&&U!==27||!Fi(E))&&(Gi(E,me)&&(x.push(zo(me)),F++,F>g&&(g=F)),F<u.length))for(E=E.child;E!==null;)l.push(E,F),E=E.sibling}if(g<u.length){for(l=[];g<u.length;g++)l.push(zo(u[g]));return`findAllNodes was able to match part of the selector:
580
+ `+(x.join(" > ")+`
581
+
582
+ No matching component was found for:
583
+ `)+l.join(" > ")}return null},dt.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Po(l.child.stateNode);default:return l.child.stateNode}},dt.injectIntoDevTools=function(){var l={bundleType:0,version:Fh,rendererPackageName:hc,currentDispatcherRef:Qe,reconcilerVersion:"19.2.0"};if(Go!==null&&(l.rendererConfig=Go),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{Vl=u.inject(l),gs=u}catch{}l=!!u.checkDCE}}return l},dt.isAlreadyRendering=function(){return(xt&6)!==0},dt.observeVisibleRects=function(l,u,g,x){if(!oa)throw Error(i(363));l=ds(l,u);var C=Jd(l,g,x).disconnect;return{disconnect:function(){C()}}},dt.shouldError=function(){return null},dt.shouldSuspend=function(){return!1},dt.startHostTransition=function(l,u,g,x){if(l.tag!==5)throw Error(i(476));var C=ag(l).queue;ng(l,C,u,ql,g===null?s:function(){var E=ag(l);return E.next===null&&(E=l.alternate.memoizedState),Ju(l,E.next.queue,{},bn()),g(x)})},dt.updateContainer=function(l,u,g,x){var C=u.current,E=bn();return Xh(C,E,l,u,g,x),E},dt.updateContainerSync=function(l,u,g,x){return Xh(u.current,2,l,u,g,x),2},dt},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Ex)),Ex.exports}var P5;function Ik(){return P5||(P5=1,wx.exports=Zk()),wx.exports}var Jk=Ik();const Wk=qb(Jk);var Tx={exports:{}},to={};/**
584
+ * @license React
585
+ * react-reconciler-constants.production.js
586
+ *
587
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
588
+ *
589
+ * This source code is licensed under the MIT license found in the
590
+ * LICENSE file in the root directory of this source tree.
591
+ */var Y5;function $k(){return Y5||(Y5=1,to.ConcurrentRoot=1,to.ContinuousEventPriority=8,to.DefaultEventPriority=32,to.DiscreteEventPriority=2,to.IdleEventPriority=268435456,to.LegacyRoot=0,to.NoEventPriority=0),to}var V5;function eL(){return V5||(V5=1,Tx.exports=$k()),Tx.exports}var ay=eL();const Q5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let X5=!1,K5=!1;const A1=".react-konva-event",tL=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
592
+ Position of a node will be changed during drag&drop, so you should update state of the react app as well.
593
+ Consider to add onDragMove or onDragEnd events.
594
+ For more info see: https://github.com/konvajs/react-konva/issues/256
595
+ `,nL=`ReactKonva: You are using "zIndex" attribute for a Konva node.
596
+ react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
597
+ For more info see: https://github.com/konvajs/react-konva/issues/194
598
+ `,aL={};function sy(t,e,n=aL){if(!X5&&"zIndex"in e&&(console.warn(nL),X5=!0),!K5&&e.draggable){var s=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;s&&!i&&(console.warn(tL),K5=!0)}for(var o in n)if(!Q5[o]){var d=o.slice(0,2)==="on",f=n[o]!==e[o];if(d&&f){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),t.off(m,n[o])}var y=!e.hasOwnProperty(o);y&&t.setAttr(o,void 0)}var v=e._useStrictMode,b={},_=!1;const j={};for(var o in e)if(!Q5[o]){var d=o.slice(0,2)==="on",w=n[o]!==e[o];if(d&&w){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),e[o]&&(j[m]=e[o])}!d&&(e[o]!==n[o]||v&&e[o]!==t.getAttr(o))&&(_=!0,b[o]=e[o])}_&&(t.setAttrs(b),Gu(t));for(var m in j)t.off(m+A1),t.on(m+A1,j[m])}function Gu(t){if(!Me.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Rx=Bb();const F8={},sL={};sh.Node.prototype._applyProps=sy;let Z8=ay.DefaultEventPriority;function rL(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Gu(t)}function iL(t,e,n){let s=sh[t];s||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=sh.Group);const i={},o={};for(var d in e)if(d!=="ref"){var f=d.slice(0,2)==="on";f?o[d]=e[d]:i[d]=e[d]}const m=new s(i);return sy(m,o),m}function lL(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function oL(t,e,n){return!1}function uL(t){return t}function cL(){return null}function dL(){return null}function fL(t,e,n,s){return sL}function hL(){}function pL(t){}function mL(t,e){return!1}function gL(){return F8}function yL(){return F8}const xL=setTimeout,bL=clearTimeout,vL=!0,SL=t=>{t()},NL=-1;function _L(t,e){return!1}const CL=!1,jL=!1,wL=!0,EL=!1,TL=!1;function RL(t,e){e.parent===t?e.moveToTop():t.add(e),Gu(t)}function OL(t,e){e.parent===t?e.moveToTop():t.add(e),Gu(t)}function I8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Gu(t)}function AL(t,e,n){I8(t,e,n)}function ML(t,e){e.destroy(),e.off(A1),Gu(t)}function DL(t,e){e.destroy(),e.off(A1),Gu(t)}function zL(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function kL(t,e,n){}function LL(t,e,n,s){sy(t,s,n)}function UL(t){t.hide(),Gu(t)}function HL(t){}function qL(t,e){(e.visible==null||e.visible)&&t.show()}function BL(t,e){}function GL(t){}function PL(){}function YL(){return null}function VL(){}function QL(){}function XL(){return ay.DefaultEventPriority}function KL(){}function FL(){return null}function ZL(t){Z8=t}function IL(){return Z8}function JL(){return ay.DiscreteEventPriority}function WL(){return!1}function $L(){}function eU(){return null}function tU(){return-1.1}function nU(){}function aU(){return!1}function sU(){return!0}function rU(){}function iU(){}function lU(){return null}const oU=null,uU=$t.createContext(null);function cU(){}const dU=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:uU,NotPendingTransition:oU,afterActiveInstanceBlur:QL,appendChild:RL,appendChildToContainer:OL,appendInitialChild:rL,beforeActiveInstanceBlur:VL,cancelTimeout:bL,clearContainer:GL,commitMount:kL,commitTextUpdate:zL,commitUpdate:LL,createInstance:iL,createTextInstance:lL,detachDeletedInstance:PL,finalizeInitialChildren:oL,getChildHostContext:yL,getCurrentEventPriority:XL,getCurrentUpdatePriority:IL,getInstanceFromNode:YL,getInstanceFromScope:FL,getPublicInstance:uL,getRootHostContext:gL,hideInstance:UL,hideTextInstance:HL,idlePriority:Rx.unstable_IdlePriority,insertBefore:I8,insertInContainerBefore:AL,isPrimaryRenderer:CL,maySuspendCommit:aU,noTimeout:NL,now:Rx.unstable_now,preloadInstance:sU,prepareForCommit:cL,preparePortalMount:dL,prepareScopeUpdate:KL,prepareUpdate:fL,removeChild:ML,removeChildFromContainer:DL,requestPostPaintCallback:nU,resetAfterCommit:hL,resetFormInstance:cU,resetTextContent:pL,resolveEventTimeStamp:tU,resolveEventType:eU,resolveUpdatePriority:JL,run:Rx.unstable_runWithPriority,scheduleMicrotask:SL,scheduleTimeout:xL,setCurrentUpdatePriority:ZL,shouldAttemptEagerTransition:WL,shouldDeprioritizeSubtree:mL,shouldSetTextContent:_L,startSuspendingCommit:rU,supportsHydration:TL,supportsMicrotasks:vL,supportsMutation:wL,supportsPersistence:EL,suspendInstance:iU,trackSchedulerEvent:$L,unhideInstance:qL,unhideTextInstance:BL,waitForCommitToBeReady:lU,warnsIfNotActing:jL},Symbol.toStringTag,{value:"Module"}));function J8(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const i=J8(s,e,n);if(i)return i;s=s.sibling}}function W8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Mv=W8(D.createContext(null));class $8 extends D.Component{render(){return D.createElement(Mv.Provider,{value:this._reactInternals},this.props.children)}}function fU(){const t=D.useContext(Mv);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=D.useId();return D.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const s=J8(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(s)return s}},[t,e])}const hU=Symbol.for("react.context"),pU=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===hU;function mU(){const t=fU(),[e]=D.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;pU(s)&&s!==Mv&&!e.has(s)&&e.set(s,D.use(W8(s))),n=n.return}return e}function gU(){const t=mU();return D.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>s=>D.createElement(e,null,D.createElement(n.Provider,{...s,value:t.get(n)})),e=>D.createElement($8,{...e})),[t])}if($t.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function yU(t){const e=$t.useRef({});return $t.useLayoutEffect(()=>{e.current=t}),$t.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const xU=()=>{const t=$t.useRef(0);return $t.useMemo(()=>{t.current++},[]),t.current>1},bU=t=>{const e=$t.useRef(null),n=$t.useRef(null),s=$t.useRef(null),i=yU(t),o=gU(),d=$t.useRef(null),f=v=>{const{forwardedRef:b}=t;b&&(typeof b=="function"?b(v):b.current=v)},m=xU(),y=()=>{var v;f(null),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(null,s.current,null)}),(v=n.current)==null||v.destroy(),n.current=null};return $t.useLayoutEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),n.current?f(n.current):(n.current=new sh.Stage({width:t.width,height:t.height,container:e.current}),f(n.current),s.current=Rf.createContainer(n.current,ay.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Rf.updateContainer($t.createElement(o,{},t.children),s.current,null,()=>{})),()=>{m?d.current=setTimeout(y,0):y()}),[]),$t.useLayoutEffect(()=>{f(n.current),sy(n.current,t,i),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer($t.createElement(o,{},t.children),s.current,null)})}),$t.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},Ox="Layer",F5="Group",Z5="Circle",kc="Line",vU="Text",SU="Arrow",Rf=Wk(dU),NU=$t.forwardRef((t,e)=>$t.createElement($8,{},$t.createElement(bU,{...t,forwardedRef:e})));function lm(t,e,n){return{x:t.x*e,y:t.y*n}}function I5(t,e,n){return{x:t.x/e,y:t.y/n}}function J5(t,e,n){return t.flatMap(s=>[s.x*e,s.y*n])}function _U(t,e){return e?"#6366f1":t.color}const W5=16,$5=9;function CU({zones:t,selectedZoneId:e,onSelectZone:n,onZonePointsChange:s,onZoneComplete:i,drawingType:o}){const d=D.useRef(null),[f,m]=D.useState({w:800,h:450}),[y,v]=D.useState([]),[b,_]=D.useState(null);D.useEffect(()=>{const A=d.current;if(!A)return;const z=new ResizeObserver(k=>{const P=k[0];if(P){const{width:H}=P.contentRect;m({w:H,h:H*9/16})}});return z.observe(A),()=>z.disconnect()},[]);const j=o!==null,w=D.useCallback(A=>{if(!j){n(null);return}const z=A.target.getStage();if(!z)return;const k=z.getPointerPosition();if(!k)return;const P=I5(k,f.w,f.h),H=o==="tripwire";if(y.length===0){v([P]);return}if(H&&y.length===1){const B=[...y,P],L={id:crypto.randomUUID(),name:"Tripwire",type:"tripwire",color:"#f59e0b",points:B};i(L),v([]);return}if(y.length>=3&&!H){const B=lm(y[0],f.w,f.h);if(Math.hypot(k.x-B.x,k.y-B.y)<12){const V={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(V),v([]);return}}v(B=>[...B,P])},[j,y,f,o,i,n]),O=D.useCallback(A=>{if(!j||o==="tripwire"||y.length<3)return;A.cancelBubble=!0;const z={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(z),v([])},[j,o,y,i]),R=D.useCallback(A=>{const z=A.target.getStage();if(!z)return;const k=z.getPointerPosition();_(k??null)},[]),T=[];for(let A=1;A<W5;A++){const z=f.w/W5*A;T.push(h.jsx(kc,{points:[z,0,z,f.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${A}`))}for(let A=1;A<$5;A++){const z=f.h/$5*A;T.push(h.jsx(kc,{points:[0,z,f.w,z],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gh-${A}`))}return h.jsxs("div",{ref:d,className:"w-full bg-zinc-900 rounded-lg overflow-hidden",style:{cursor:j?"crosshair":"default"},children:[h.jsxs(NU,{width:f.w,height:f.h,onClick:w,onDblClick:O,onMouseMove:R,children:[h.jsxs(Ox,{children:[h.jsx(kc,{points:[0,0,f.w,0,f.w,f.h,0,f.h,0,0],stroke:"transparent",strokeWidth:0}),T]}),h.jsx(Ox,{children:t.map(A=>{const z=A.id===e,k=_U(A,z),P=J5(A.points,f.w,f.h),H=A.type==="tripwire";return h.jsxs(F5,{onClick:B=>{B.cancelBubble=!0,j||n(A.id)},children:[H?h.jsx(SU,{points:P,stroke:k,strokeWidth:z?3:2,fill:k,pointerLength:10,pointerWidth:8,opacity:z?1:.8}):h.jsx(kc,{points:P,closed:!0,fill:k+"33",stroke:k,strokeWidth:z?2.5:1.5,opacity:z?1:.85}),A.points.length>0&&h.jsx(vU,{x:lm(A.points[0],f.w,f.h).x+4,y:lm(A.points[0],f.w,f.h).y+4,text:A.name,fontSize:11,fill:k,fontStyle:"bold"}),z&&A.points.map((B,L)=>{const V=lm(B,f.w,f.h);return h.jsx(Z5,{x:V.x,y:V.y,radius:5,fill:k,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:Z=>{const oe=I5({x:Z.target.x(),y:Z.target.y()},f.w,f.h),ne=A.points.map((J,ie)=>ie===L?oe:J);s(A.id,ne)}},L)})]},A.id)})}),h.jsx(Ox,{children:j&&y.length>0&&h.jsxs(F5,{children:[y.length>=2&&o!=="tripwire"&&h.jsx(kc,{points:J5(y,f.w,f.h),stroke:"#6366f1",strokeWidth:1.5,dash:[6,3],opacity:.8}),y.length===1&&o==="tripwire"&&b&&h.jsx(kc,{points:[y[0].x*f.w,y[0].y*f.h,b.x,b.y],stroke:"#f59e0b",strokeWidth:1.5,dash:[6,3],opacity:.7}),b&&y.length>=1&&o!=="tripwire"&&h.jsx(kc,{points:[y[y.length-1].x*f.w,y[y.length-1].y*f.h,b.x,b.y],stroke:"#6366f1",strokeWidth:1,dash:[4,4],opacity:.5}),y.map((A,z)=>{const k=lm(A,f.w,f.h),P=z===0;return h.jsx(Z5,{x:k.x,y:k.y,radius:P&&y.length>=3?7:4,fill:P&&y.length>=3?"#6366f1":"#ffffff",stroke:"#6366f1",strokeWidth:1.5,opacity:.9},z)})]})})]}),j&&h.jsx("div",{className:"px-3 py-1.5 bg-zinc-800/80 text-[11px] text-zinc-400 border-t border-zinc-700",children:o==="tripwire"?"Click to set start point, click again to complete the tripwire":y.length<3?"Click to add points (min 3). Double-click or click first point to close.":"Continue adding points. Double-click or click first point to close."})]})}const jU={intrusion:"Intrusion","package-watch":"Package",tripwire:"Tripwire"},wU={intrusion:"bg-danger/10 text-danger","package-watch":"bg-success/10 text-success",tripwire:"bg-warning/10 text-warning"};function EU({zones:t,selectedZoneId:e,drawingType:n,onSelectZone:s,onDeleteZone:i,onStartDraw:o,onCancelDraw:d}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("div",{className:"flex flex-col gap-1.5",children:n?h.jsxs("button",{type:"button",onClick:d,className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-3 py-1.5 text-xs font-medium text-warning hover:bg-warning/20 transition-colors",children:[h.jsx(OT,{className:"h-3 w-3"}),"Cancel drawing"]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>o("intrusion"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Zone"]}),h.jsxs("button",{type:"button",onClick:()=>o("tripwire"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Tripwire"]})]})}),t.length===0?h.jsx("p",{className:"text-center text-[11px] text-foreground-subtle py-4",children:'No zones yet. Click "Add Zone" or "Add Tripwire" to start.'}):h.jsx("div",{className:"flex flex-col gap-1",children:t.map(f=>{const m=f.id===e;return h.jsxs("div",{className:["flex items-center gap-2 rounded-md border px-2 py-1.5 cursor-pointer transition-colors",m?"border-primary/50 bg-primary/10":"border-border bg-surface hover:bg-surface-hover"].join(" "),onClick:()=>s(m?null:f.id),children:[h.jsx("div",{className:"h-3 w-3 rounded-sm flex-shrink-0",style:{backgroundColor:f.color}}),h.jsx("span",{className:"flex-1 truncate text-xs font-medium text-foreground",children:f.name}),h.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium flex-shrink-0 ${wU[f.type]}`,children:jU[f.type]}),h.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[h.jsx("button",{type:"button",title:"Select",className:"p-0.5 text-foreground-subtle hover:text-primary rounded transition-colors",onClick:y=>{y.stopPropagation(),s(f.id)},children:h.jsx(HT,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",title:"Delete",className:"p-0.5 text-foreground-subtle hover:text-danger rounded transition-colors",onClick:y=>{y.stopPropagation(),i(f.id)},children:h.jsx(Im,{className:"h-3 w-3"})})]})]},f.id)})})]})}const TU=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#f97316","#ec4899"],RU=[{value:"intrusion",label:"Intrusion"},{value:"package-watch",label:"Package Watch"},{value:"tripwire",label:"Tripwire"}],Ax="w-full rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none";function OU({zone:t,onChange:e,onDelete:n}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:"Edit Zone"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Name"}),h.jsx("input",{type:"text",className:Ax,value:t.name,onChange:s=>e({...t,name:s.target.value}),placeholder:"Zone name"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Type"}),h.jsx("select",{className:Ax,value:t.type,onChange:s=>e({...t,type:s.target.value}),children:RU.map(s=>h.jsx("option",{value:s.value,children:s.label},s.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1.5",children:"Color"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:TU.map(s=>h.jsx("button",{type:"button",title:s,className:["h-5 w-5 rounded-md border-2 transition-transform hover:scale-110",t.color===s?"border-white scale-110":"border-transparent"].join(" "),style:{backgroundColor:s},onClick:()=>e({...t,color:s})},s))}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-7 w-7 rounded border border-border bg-background cursor-pointer p-0.5",value:t.color,onChange:s=>e({...t,color:s.target.value})}),h.jsx("input",{type:"text",className:Ax+" font-mono flex-1",value:t.color,placeholder:"#000000",onChange:s=>e({...t,color:s.target.value})})]})]}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[t.type==="tripwire"?"Tripwire: 2 points":`Polygon: ${t.points.length} points`,t.points.length>0&&" — drag handles on canvas to reshape"]}),h.jsxs("button",{type:"button",onClick:n,className:"mt-1 flex items-center justify-center gap-1.5 w-full rounded-md border border-danger/40 bg-danger/10 px-3 py-1.5 text-xs font-medium text-danger hover:bg-danger/20 transition-colors",children:[h.jsx(Im,{className:"h-3 w-3"}),"Delete zone"]})]})}function AU(){const[t,e]=D.useState([]),[n,s]=D.useState(null),[i,o]=D.useState(null),d=t.find(_=>_.id===n)??null,f=_=>{e(j=>[...j,_]),s(_.id),o(null)},m=(_,j)=>{e(w=>w.map(O=>O.id===_?{...O,points:j}:O))},y=_=>{e(j=>j.map(w=>w.id===_.id?_:w))},v=_=>{e(j=>j.filter(w=>w.id!==_)),n===_&&s(null)},b=_=>{s(null),o(_)};return h.jsx("div",{className:"space-y-4",children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Zone Editor"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Define detection zones and tripwire lines"})]}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.length," zone",t.length!==1?"s":""]})]}),h.jsxs("div",{className:"flex flex-col lg:flex-row",children:[h.jsx("div",{className:"flex-1 p-4",children:h.jsx(CU,{zones:t,selectedZoneId:n,onSelectZone:s,onZonePointsChange:m,onZoneComplete:f,drawingType:i})}),h.jsxs("div",{className:"w-full lg:w-64 border-t lg:border-t-0 lg:border-l border-border p-4 flex flex-col gap-4",children:[h.jsx(EU,{zones:t,selectedZoneId:n,drawingType:i,onSelectZone:s,onDeleteZone:v,onStartDraw:b,onCancelDraw:()=>o(null)}),d&&!i&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t border-border"}),h.jsx(OU,{zone:d,onChange:y,onDelete:()=>v(d.id)})]})]})]})]})})}function MU(t){return{id:t.id,name:t.packageName??t.id,type:t.slot??"addon",enabled:!0}}function DU({deviceId:t}){const e=sn(),{data:n,isLoading:s}=Ct({queryKey:["bridge-addons"],queryFn:()=>e.bridgeListAddons()}),o=(n??[]).map(MU),d=o.filter(m=>m.type==="vision"||m.type==="detection"||m.type==="inference");if(s)return h.jsx("div",{className:"space-y-2",children:[1,2,3].map(m=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},m))});if(!d.length&&!o.length)return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(Mm,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No vision addons installed"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Install addons to enable detection and inference"})]})]});const f=d.length>0?d:o;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," addon",f.length!==1?"s":""]})]}),h.jsx("div",{className:"space-y-2",children:f.map(m=>h.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-primary/10 flex-shrink-0",children:h.jsx(Mm,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:m.name||m.id}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[m.type," ",m.version?`v${m.version}`:""]})]}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${m.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`}),h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Settings",children:h.jsx(Zm,{className:"h-3.5 w-3.5"})})]},m.id))})]})}function zU({deviceId:t}){const e=sn(),[n,s]=D.useState(null),{data:i}=Ct({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t}),o=e.serverUrl??window.location.origin,d=[{id:"webrtc",label:"WebRTC",resolution:"Native",codec:"H.264",url:`${o}/webrtc/${t}`},{id:"hls",label:"HLS",resolution:"Native",codec:"H.264",url:`${o}/hls/${t}/index.m3u8`},{id:"mjpeg",label:"MJPEG",resolution:"Scaled",codec:"MJPEG",url:`${o}/mjpeg/${t}`}];async function f(m){try{await navigator.clipboard.writeText(m),s(m),setTimeout(()=>s(null),2e3)}catch{}}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Available Streams"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[d.length," streams"]})]}),h.jsx("div",{className:"divide-y divide-border",children:d.map(m=>h.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-info/10 flex-shrink-0",children:h.jsx(fv,{className:"h-4 w-4 text-info"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs font-medium text-foreground",children:m.label}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:m.resolution}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:m.codec})]}),h.jsx("p",{className:"text-[10px] font-mono text-foreground-subtle mt-0.5 truncate",children:m.url})]}),h.jsx("button",{onClick:()=>f(m.url),className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0",title:"Copy URL",children:n===m.url?h.jsx(G1,{className:"h-3.5 w-3.5 text-success"}):h.jsx(KE,{className:"h-3.5 w-3.5"})})]},m.id))})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Restreamer"})}),h.jsxs("div",{className:"px-4 py-8 flex flex-col items-center text-center text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"Restreamer URLs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Restreamer endpoints will be displayed here when a restreamer is configured"})]})]})]})}function kU(){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Device Logs"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Scoped log stream for this device"})]}),h.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-info/10 px-2.5 py-0.5 text-[10px] font-medium text-info",children:"Coming with backend integration"})]}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(Y1,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"Device logs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Device logs — coming with backend integration"})]})]})}let e4=0;function LU({deviceId:t}){const e=sn(),[n,s]=D.useState(""),[i,o]=D.useState([]),d=D.useRef(null),f=ja({mutationFn:b=>e.replEval(b,{type:"device",deviceId:t}),onSuccess:(b,_)=>{const j=typeof b=="string"?b:JSON.stringify(b,null,2);o(w=>[...w,{id:++e4,code:_,result:j,error:!1,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}]),s("")},onError:(b,_)=>{const j=b instanceof Error?b.message:String(b);o(w=>[...w,{id:++e4,code:_,result:j,error:!0,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}])}});function m(){const b=n.trim();b&&f.mutate(b)}function y(b){(b.metaKey||b.ctrlKey)&&b.key==="Enter"&&(b.preventDefault(),m())}function v(b){var _;s(b),(_=d.current)==null||_.focus()}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-xs text-foreground-subtle",children:["Scoped to device: ",h.jsx("span",{className:"font-mono text-foreground",children:t})]}),i.length>0&&h.jsxs("button",{onClick:()=>o([]),className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground",children:[h.jsx(Im,{className:"h-3 w-3"}),"Clear history"]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle font-mono",children:"JavaScript — Ctrl+Enter to run"}),h.jsxs("button",{onClick:m,disabled:f.isPending||!n.trim(),className:"inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-[10px] font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[h.jsx(dv,{className:"h-3 w-3"}),f.isPending?"Running...":"Execute"]})]}),h.jsx("textarea",{ref:d,value:n,onChange:b=>s(b.target.value),onKeyDown:y,rows:5,placeholder:"// Enter JavaScript code scoped to this device...",className:"w-full resize-y bg-background p-3 font-mono text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none",spellCheck:!1})]}),i.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No evaluations yet"}),i.length>0&&h.jsx("div",{className:"space-y-3",children:[...i].reverse().map(b=>h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2 border-b border-border bg-background px-3 py-2",children:[h.jsx("pre",{className:"font-mono text-xs text-foreground whitespace-pre-wrap break-all flex-1",children:b.code}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:b.ts}),h.jsx("button",{onClick:()=>v(b.code),title:"Reuse",className:"text-foreground-subtle hover:text-foreground",children:h.jsx(S1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("pre",{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-all ${b.error?"text-danger":"text-success"}`,children:b.result})]},b.id))})]})}const UU=[{id:"events",label:"Events"},{id:"pipeline",label:"Pipeline"},{id:"recording",label:"Recording"},{id:"zones",label:"Zones"},{id:"addons",label:"Addons"},{id:"streams",label:"Streams"},{id:"logs",label:"Logs"},{id:"repl",label:"REPL"}];function HU(){const{deviceId:t}=Wb(),e=sn(),[n,s]=D.useState("events"),{data:i,isLoading:o}=Ct({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t,refetchInterval:5e3}),d=i??{},f=String(d.name??t??"Device"),m=String(d.status??"offline"),y=String(d.providerId??d.provider??"rtsp"),v=String(d.phase??"—"),b=d.priority!=null?String(d.priority):null;function _(){if(!t)return null;switch(n){case"events":return h.jsx(_D,{deviceId:t});case"pipeline":return h.jsx(CD,{deviceId:t});case"recording":return h.jsx(jD,{});case"zones":return h.jsx(AU,{});case"addons":return h.jsx(DU,{deviceId:t});case"streams":return h.jsx(zU,{deviceId:t});case"logs":return h.jsx(kU,{});case"repl":return h.jsx(LU,{deviceId:t});default:return null}}return o?h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsx("div",{className:"h-4 w-48 rounded bg-surface-hover animate-pulse mb-3"}),h.jsx("div",{className:"h-8 w-64 rounded bg-surface-hover animate-pulse"})]}),h.jsx("div",{className:"flex-1 p-6",children:h.jsx("div",{className:"h-40 rounded-lg border border-border bg-surface animate-pulse"})})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsxs("nav",{className:"flex items-center gap-1 text-[11px] text-foreground-subtle mb-3",children:[h.jsx(av,{to:"/cameras",className:"hover:text-foreground transition-colors",children:"Cameras"}),h.jsx(Ic,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground-subtle",children:p8(y)}),h.jsx(Ic,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground",children:f})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(W1,{type:y,size:"lg"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-base font-semibold text-foreground truncate",children:f}),h.jsx(nh,{status:m})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${m==="online"||m==="running"?"bg-success":"bg-foreground-subtle/30"}`}),m==="online"||m==="running"?"Online":"Offline"]}),h.jsxs("span",{children:["Phase: ",h.jsx("span",{className:"text-foreground",children:v})]}),b&&h.jsxs("span",{children:["Priority: ",h.jsx("span",{className:"text-foreground",children:b})]})]})]})]})]}),h.jsxs("div",{className:"flex border-b border-border",children:[h.jsx("div",{className:"flex-1 p-4 border-r border-border",children:h.jsx(vD,{deviceName:f,detectionsToday:0,inferenceMs:0,activeTracks:0,storageGb:0})}),h.jsx("div",{className:"w-[300px] flex-shrink-0 bg-surface",children:h.jsx(SD,{deviceId:t??""})})]}),h.jsx("div",{className:"border-b border-border bg-surface px-6",children:h.jsx("div",{className:"flex items-center gap-0 overflow-x-auto",children:UU.map(j=>{const w=n===j.id;return h.jsxs("button",{onClick:()=>s(j.id),className:`relative flex-shrink-0 px-4 py-3 text-xs font-medium transition-colors ${w?"text-primary":"text-foreground-subtle hover:text-foreground"}`,children:[j.label,w&&h.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-primary"})]},j.id)})})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_()})]})}const e7=D.createContext(null);function qU(){const t=D.useContext(e7);if(!t)throw new Error("useConfirm must be used within ConfirmDialogProvider");return t.confirm}function BU({children:t}){const[e,n]=D.useState(null),s=D.useCallback(m=>new Promise(y=>{n({...m,resolve:y})}),[]),i=()=>{e==null||e.resolve(!0),n(null)},o=()=>{e==null||e.resolve(!1),n(null)},d={danger:{icon:"text-red-400",button:"bg-red-500 hover:bg-red-600 text-white"},warning:{icon:"text-orange-400",button:"bg-orange-500 hover:bg-orange-600 text-white"},default:{icon:"text-primary",button:"bg-primary hover:bg-primary/90 text-white"}},f=e?d[e.variant??"default"]:d.default;return h.jsxs(e7.Provider,{value:{confirm:s},children:[t,e&&h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:o}),h.jsxs("div",{className:"relative z-10 w-full max-w-sm mx-4 rounded-xl border border-border bg-surface shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",onClick:m=>m.stopPropagation(),children:[h.jsxs("div",{className:"px-5 pt-5 pb-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),h.jsx("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:e.message})]}),h.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[h.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:e.cancelLabel??"Cancel"}),h.jsx("button",{type:"button",onClick:i,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${f.button}`,children:e.confirmLabel??"Confirm"})]})]})]})]})}const t4={core:"bg-blue-500/20 text-blue-300",addon:"bg-purple-500/20 text-purple-300",provider:"bg-green-500/20 text-green-300",page:"bg-orange-500/20 text-orange-300"};function GU({group:t,isBundle:e}){const n=t4[t??"addon"]??t4.addon;return h.jsx("div",{className:`flex-shrink-0 h-9 w-9 rounded-lg flex items-center justify-center ${n}`,children:e?h.jsx(Mm,{className:"h-4 w-4"}):h.jsx(_1,{className:"h-4 w-4"})})}function Lb({addon:t,agents:e=[],hideVersion:n,availableUpdate:s,onUpdate:i,bundle:o}){var ae,Ne;const[d,f]=D.useState(!1),[m,y]=D.useState(!1),v=sn(),b=wa(),_=qU(),{manifest:j}=t,w=t.installedOn??[],O=!o&&!j.protected&&j.removable!==!1,R=!!o,T=(o==null?void 0:o.displayName)??j.name,A=(o==null?void 0:o.packageName)??j.packageName,z=(o==null?void 0:o.version)??j.version,k=(o==null?void 0:o.installSource)??t.installSource,P=o?(ae=o.addons[0])==null?void 0:ae.manifest.description:j.description,H=!o&&(t.hasConfigSchema||j.components&&j.components.length>0||e.length>=2),B=R||H,{data:L,isLoading:V}=Ct({queryKey:["addon-config-schema",j.id],queryFn:()=>v.trpc.addons.getConfigSchema.query({addonId:j.id}),enabled:!R&&d&&t.hasConfigSchema,staleTime:6e4}),{data:Z}=Ct({queryKey:["addon-config",j.id],queryFn:()=>v.trpc.addons.getConfig.query({addonId:j.id}),enabled:!R&&d&&t.hasConfigSchema,staleTime:3e4}),[oe,ne]=D.useState({}),[J,ie]=D.useState(!1);D.useEffect(()=>{Z&&(ne(Z),ie(!1))},[Z]);const ce=re=>{ne(re),ie(!0)},Y=ja({mutationFn:()=>v.trpc.addons.updateConfig.mutate({addonId:j.id,config:oe}),onSuccess:()=>{ie(!1),b.invalidateQueries({queryKey:["addon-config",j.id]})}}),$=ja({mutationFn:()=>(console.log(`[AddonCard] Uninstalling ${j.packageName}`),v.trpc.bridgeAddons.uninstallPackage.mutate({packageName:j.packageName})),onSuccess:()=>{console.log(`[AddonCard] Uninstalled ${j.packageName}`),b.invalidateQueries({queryKey:["addons"]}),b.invalidateQueries({queryKey:["addon-pages"]}),b.invalidateQueries({queryKey:["capabilities"]})},onError:re=>{console.error("[AddonCard] Uninstall failed:",re)}});return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:["flex items-start gap-3 px-4 py-3 transition-colors",B&&!R?"cursor-pointer hover:bg-surface-hover/50":""].join(" "),onClick:()=>!R&&B&&f(re=>!re),children:[h.jsx(GU,{group:t.group,isBundle:R||!!j.components&&j.components.length>1}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:T}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle font-mono shrink-0",children:["(",A,")"]}),R&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1",children:[h.jsx(Mm,{className:"h-3 w-3"}),o.addons.length]}),k==="workspace"&&h.jsx("span",{className:"text-[10px] rounded-full bg-orange-500/15 text-orange-400 px-2 py-0.5 font-medium shrink-0",title:"Installed from local workspace",children:"DEV"})]}),P&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-1",children:P})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 pt-0.5",children:[!n&&h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s&&i&&h.jsx("button",{type:"button",onClick:re=>{re.stopPropagation(),i()},className:"rounded-full bg-primary/10 text-primary hover:bg-primary/20 p-1 transition-colors",title:`Update to v${s}`,children:h.jsx(w6,{className:"h-3 w-3"})}),h.jsx(FC,{version:z})]}),O&&h.jsxs("button",{type:"button",onClick:async re=>{re.stopPropagation(),await _({title:`Uninstall ${j.name}?`,message:"This will remove the addon package and all its data. This action cannot be undone.",confirmLabel:"Uninstall",variant:"danger"})&&$.mutate()},disabled:$.isPending,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-red-400 hover:bg-red-500/10 disabled:opacity-50 transition-colors",title:`Uninstall ${j.name}`,children:[h.jsx(Im,{className:"h-3 w-3"}),$.isPending&&"Removing..."]}),H&&!R&&(d?h.jsx(S1,{className:"h-4 w-4 text-foreground-subtle"}):h.jsx(Zc,{className:"h-4 w-4 text-foreground-subtle"}))]})]}),R&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>f(re=>!re),className:"w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors",children:d?h.jsx(S1,{className:"h-3.5 w-3.5 text-foreground-subtle"}):h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle"})}),d&&h.jsx("div",{className:"border-t border-border px-3 py-2 space-y-2",children:o.addons.map(re=>h.jsx(Lb,{addon:re,agents:e,hideVersion:!0},re.manifest.id))})]}),!R&&d&&h.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-4",children:[t.hasConfigSchema&&h.jsxs("div",{children:[V&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle py-2",children:[h.jsx(eh,{className:"h-3.5 w-3.5 animate-spin"}),"Loading configuration..."]}),L&&((Ne=L.sections)==null?void 0:Ne.some(re=>{var G;return((G=re.fields)==null?void 0:G.length)>0}))&&h.jsxs("div",{className:"space-y-3",children:[h.jsx($1,{schema:L,values:oe,onChange:ce}),J&&h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsxs("button",{type:"button",onClick:re=>{re.stopPropagation(),Y.mutate()},disabled:Y.isPending,className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors",children:[Y.isPending?h.jsx(eh,{className:"h-3 w-3 animate-spin"}):h.jsx(M6,{className:"h-3 w-3"}),Y.isPending?"Saving...":"Save"]})]}),Y.isError&&h.jsxs("div",{className:"text-[10px] text-red-400",children:["Save failed: ",Y.error instanceof Error?Y.error.message:"Unknown error"]})]})]}),j.components&&j.components.length>0&&h.jsxs("div",{children:[h.jsxs("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Components (",j.components.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1",children:j.components.map(re=>h.jsx("span",{className:"text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono",children:re},re))})]}),e.length>=2&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:"Installed on"}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[w.length===0&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Hub (local)"}),w.map(re=>h.jsx("span",{className:"rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle",children:re},re)),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:re=>{re.stopPropagation(),y(G=>!G)},className:"inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors",title:"Install on more agents",children:[h.jsx(po,{className:"h-3 w-3"}),"Add agent"]}),m&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden",children:[e.filter(re=>!re.isHub&&!w.includes(re.name)).map(re=>h.jsx("button",{type:"button",onClick:G=>{G.stopPropagation(),y(!1)},className:"w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors",children:re.name},re.id)),e.filter(re=>!re.isHub&&!w.includes(re.name)).length===0&&h.jsx("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle",children:"No available agents"})]})]})]})]})]})]})}const PU=".tgz,.tar.gz,.zip";function YU({onUploadSuccess:t}){const[e,n]=D.useState(!1),s=D.useRef(null),i=D.useCallback(async d=>{n(!0);const f=new FormData;f.append("file",d);const m=localStorage.getItem("camstack_admin_token")??"";try{(await(await fetch("/api/addons/upload",{method:"POST",headers:{Authorization:`Bearer ${m}`},body:f})).json()).success&&t()}finally{n(!1)}},[t]),o=D.useCallback(d=>{var m;const f=(m=d.target.files)==null?void 0:m[0];f&&i(f),d.target.value=""},[i]);return h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:s,type:"file",accept:PU,onChange:o,className:"hidden"}),h.jsxs("button",{type:"button",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},disabled:e,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[e?h.jsx(eh,{className:"w-3.5 h-3.5 animate-spin"}):h.jsx(cR,{className:"w-3.5 h-3.5"}),e?"Uploading...":"Upload"]})]})}function VU(t,e){if(e==="core"||t.packageName==="@camstack/core")return"core";const n=t.packageName.toLowerCase();return n.includes("provider")?"provider":n.includes("page")||n.includes("benchmark")?"page":"addon"}function QU(t){return t!=null&&t.manifest?{manifest:{...t.manifest,capabilities:t.manifest.capabilities??[]},enabled:!0,hasConfigSchema:t.hasConfigSchema??!1,group:VU(t.manifest,t.source),source:t.source,installSource:t.installSource,installedOn:[]}:null}function XU(t){const e=new Map,n=[];for(const i of t){const o=i.manifest.packageName;if(!o){n.push(i);continue}const d=e.get(o);d?d.addons.push(i):e.set(o,{packageName:o,displayName:i.manifest.packageDisplayName??i.manifest.name,version:i.manifest.packageVersion,installSource:i.installSource,addons:[i]})}const s=[];for(const i of e.values())i.addons.length>=2?s.push({bundle:i,representative:i.addons[0]}):s.push(i.addons[0]);return s.push(...n),s}function KU(t){return"bundle"in t}function FU({addons:t,agents:e,onRefresh:n,isRefreshing:s}){const i=sn(),o=wa(),[d,f]=D.useState(""),m=D.useDeferredValue(d),[y,v]=D.useState(!1),{data:b,isFetching:_}=Ct({queryKey:["addon-search",m],queryFn:()=>i.trpc.bridgeAddons.searchAvailable.query({query:m||void 0}),enabled:y,staleTime:6e4}),j=ja({mutationFn:R=>i.trpc.bridgeAddons.installPackage.mutate({packageName:R}),onSuccess:(R,T)=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["addon-search"]}),o.invalidateQueries({queryKey:["addon-pages"]}),o.invalidateQueries({queryKey:["capabilities"]}),console.log(`[Addons] Installed ${T}`)},onError:(R,T)=>{console.error(`[Addons] Install failed for ${T}:`,R)}}),w=XU(t),O=(b??[]).filter(R=>!R.installed);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(hv,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:d,onChange:R=>{f(R.target.value),v(!0)},onFocus:()=>v(!0),placeholder:"Search addons by name or capability...",className:"w-full rounded-md border border-border bg-background pl-9 pr-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"}),_&&h.jsx(eh,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle animate-spin"})]}),h.jsx(YU,{onUploadSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),n()}}),h.jsxs("button",{type:"button",onClick:n,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[h.jsx(yb,{className:`w-3.5 h-3.5 ${s?"animate-spin":""}`}),"Refresh"]})]}),y&&O.length>0&&h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border flex justify-between",children:[h.jsxs("span",{children:["Available on npm (",O.length,")"]}),h.jsx("button",{type:"button",onClick:()=>v(!1),className:"text-foreground-subtle hover:text-foreground",children:"close"})]}),h.jsx("div",{className:"max-h-64 overflow-auto divide-y divide-border",children:O.map(R=>h.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-surface-hover transition-colors",children:[h.jsx("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[10px] font-bold shrink-0",children:R.name.replace("@camstack/addon-","").charAt(0).toUpperCase()}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-semibold truncate",children:R.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:["v",R.version]})]}),h.jsx("div",{className:"text-[10px] text-foreground-subtle truncate",children:R.description}),R.keywords&&R.keywords.length>0&&h.jsx("div",{className:"flex gap-1 mt-0.5 flex-wrap",children:R.keywords.filter(T=>T!=="camstack"&&T!=="addon"&&T!=="camstack-addon").slice(0,5).map(T=>h.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded bg-primary/5 text-foreground-subtle",children:T},T))})]}),h.jsxs("button",{type:"button",onClick:()=>j.mutate(R.name),disabled:j.isPending,className:"flex items-center gap-1 px-2.5 py-1 text-[10px] font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors shrink-0",children:[j.isPending?h.jsx(eh,{className:"h-3 w-3 animate-spin"}):h.jsx(w6,{className:"h-3 w-3"}),"Install"]})]},R.name))})]}),y&&b&&O.length===0&&b.length>0&&h.jsxs("div",{className:"text-xs text-foreground-subtle flex items-center gap-1.5 px-1",children:[h.jsx(G1,{className:"h-3.5 w-3.5 text-green-500"}),"All matching addons are already installed"]}),t.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No addons installed"}),h.jsx("div",{className:"space-y-2",children:w.map(R=>KU(R)?h.jsx(Lb,{addon:R.representative,agents:e,bundle:R.bundle},R.bundle.packageName):h.jsx(Lb,{addon:R,agents:e},R.manifest.id))})]})}function ZU(){const t=sn(),e=wa(),{data:n,isLoading:s,isError:i}=Ct({queryKey:["addons","list"],queryFn:()=>t.listAddons()}),{data:o=[]}=Ct({queryKey:["agents","list"],queryFn:()=>t.listAgents(),staleTime:3e4}),d=D.useMemo(()=>o.map(y=>({id:y.info.id,name:y.info.name??y.info.id,isHub:y.isHub})),[o]),f=ja({mutationFn:async()=>{await t.trpc.update.forceRefresh.mutate(),await t.trpc.bridgeAddons.reloadPackages.mutate()},onSuccess:()=>{e.invalidateQueries({queryKey:["addons"]}),e.invalidateQueries({queryKey:["updates"]})}}),m=(n??[]).map(QU).filter(y=>y!==null);return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Addons"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Manage installed addons and explore capability providers."})]}),!s&&!i&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:[m.length," installed"]})]}),s&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading…"}),i&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load addons"}),!s&&!i&&h.jsx(FU,{addons:m,agents:d,onRefresh:()=>f.mutate(),isRefreshing:f.isPending})]})}function Ub(t){return t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}function IU(t){const e=Math.floor((Date.now()-t)/1e3);if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m`;const n=Math.floor(e/3600),s=Math.floor(e%3600/60);return`${n}h ${s}m`}function JU(t){if(t<60)return`${t}s`;if(t<3600)return`${Math.floor(t/60)}m ${t%60}s`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function WU(t){return new Date(t).toLocaleString("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function $U(t){switch(t){case"running":return"bg-green-400";case"stopped":return"bg-foreground-subtle";case"crashed":return"bg-red-400";default:return"bg-foreground-subtle"}}function eH({proc:t,isLast:e}){return h.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-foreground-subtle pl-6 py-1",children:[h.jsx("span",{className:"text-foreground-subtle/40 font-mono select-none",children:e?"└──":"├──"}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${$U(t.state)}`}),h.jsx("span",{className:"font-mono text-foreground truncate",children:t.name}),h.jsxs("span",{className:"text-foreground-subtle/60",children:["PID ",t.pid]}),h.jsxs("span",{children:["CPU ",t.cpuPercent.toFixed(1),"%"]}),h.jsx("span",{children:Ub(t.memoryRss/1024/1024)}),t.uptimeSeconds>0&&h.jsxs("span",{className:"text-foreground-subtle/60",children:["up ",JU(t.uptimeSeconds)]})]})}function tH({entry:t,isSelected:e,onSelectAgent:n}){const[s,i]=D.useState(t.isHub);return h.jsxs("div",{className:"border border-border rounded-lg bg-surface overflow-hidden",children:[h.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-4 py-3 hover:bg-primary/5 transition-colors text-left",onClick:()=>i(o=>!o),children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s?h.jsx(Zc,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}):h.jsx(Ic,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}),h.jsx("span",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${t.state==="running"?"bg-green-400":"bg-red-400"}`}),h.jsx(C1,{className:"h-4 w-4 shrink-0 text-foreground-subtle"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:t.name}),t.isHub&&h.jsx("span",{className:"rounded-full bg-primary/10 text-primary px-2 py-0.5 text-[10px] font-medium shrink-0",children:"HUB"})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle flex-wrap",children:[t.host&&h.jsx("span",{className:"font-mono",children:t.host}),h.jsxs("span",{children:[t.platform,"/",t.arch]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(zf,{className:"h-2.5 w-2.5"}),t.cpuPercent.toFixed(0),"%"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(gm,{className:"h-2.5 w-2.5"}),t.memoryPercent.toFixed(0),"% (",Ub(t.memoryMB),")"]})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{children:["up ",IU(t.connectedSince)]}),t.subProcesses.length>0&&h.jsxs("span",{className:"rounded-full bg-info/10 text-info px-2 py-0.5 font-medium",children:[t.subProcesses.length," proc",t.subProcesses.length!==1?"s":""]}),n&&h.jsxs("button",{type:"button",onClick:o=>{o.stopPropagation(),n(t.isHub?"Hub":t.name)},className:`inline-flex items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-medium transition-colors ${e?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-primary/5"}`,title:"View logs for this agent",children:[h.jsx(Y1,{className:"h-3 w-3"}),"Logs"]})]})]}),!s&&h.jsxs("div",{className:"px-4 pb-2 space-y-1",children:[h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})})]}),s&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(C1,{className:"h-3 w-3"}),"System Details"]}),h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-1 text-[10px] text-foreground-subtle",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(N1,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Platform: ",h.jsx("span",{className:"text-foreground font-medium",children:t.platform})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Arch: ",h.jsx("span",{className:"text-foreground font-medium",children:t.arch})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(gm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Memory: ",h.jsx("span",{className:"text-foreground font-medium",children:Ub(t.memoryMB)})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["CPU: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.cpuPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(gm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Mem usage: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.memoryPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(j6,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Connected: ",h.jsx("span",{className:"text-foreground font-medium",children:WU(t.connectedSince)})]})]})]}),h.jsxs("div",{className:"mt-2 space-y-1",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"CPU"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.cpuPercent.toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"MEM"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.memoryPercent.toFixed(0),"%"]})]})]})]}),t.installedAddons.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(Mm,{className:"h-3 w-3"}),"Installed Addons (",t.installedAddons.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.installedAddons.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary",children:o},o))})]}),t.capabilities.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(N1,{className:"h-3 w-3"}),"Capabilities (",t.capabilities.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.capabilities.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-400",children:o},o))})]}),t.subProcesses.length>0&&h.jsxs("div",{className:"px-4 py-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(P1,{className:"h-3 w-3"}),"Sub-Processes (",t.subProcesses.length,")"]}),t.subProcesses.map((o,d)=>h.jsx(eH,{proc:o,isLast:d===t.subProcesses.length-1},o.pid))]}),t.subProcesses.length===0&&t.installedAddons.length===0&&t.capabilities.length===0&&h.jsx("div",{className:"px-4 py-3 text-[10px] text-foreground-subtle italic",children:"No sub-processes or addons reported"})]})]})}function nH({entries:t,isLoading:e,selectedAgentName:n,onSelectAgent:s}){if(e)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading process tree..."});if(t.length===0)return h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No agents connected"});const i=[...t].sort((o,d)=>o.isHub&&!d.isHub?-1:!o.isHub&&d.isHub?1:o.name.localeCompare(d.name));return h.jsx("div",{className:"space-y-2",children:i.map(o=>h.jsx(tH,{entry:o,isSelected:n===o.name,onSelectAgent:s},o.id))})}const n4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function aH({agentNames:t,addonNames:e,preselectedAgent:n}){const s=sn(),[i,o]=D.useState("all"),[d,f]=D.useState(n??"all"),[m,y]=D.useState("all"),v=D.useRef(n);D.useEffect(()=>{n!==v.current&&(f(n??"all"),v.current=n)},[n]);const[b,_]=D.useState(!0),j=D.useRef(null),w=D.useMemo(()=>{const H=[];return d!=="all"&&H.push(d),m!=="all"&&H.push(m),H.length>0?H:void 0},[d,m]),{data:O,isLoading:R,isError:T}=Ct({queryKey:["agent-logs",i,d,m],queryFn:()=>s.getLogs({...i!=="all"?{level:i}:{},limit:300,...w?{scope:w}:{}}),refetchInterval:3e3}),A=O??[],z=D.useMemo(()=>[...A].reverse(),[A]);D.useEffect(()=>{var H;b&&((H=j.current)==null||H.scrollTo({top:0,behavior:"smooth"}))},[z,b]);const k=D.useCallback(()=>{const H=j.current;if(!H)return;const B=H.scrollTop<40;_(B)},[]);function P(H){return H?new Date(typeof H=="number"?H:String(H)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"--"}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(oT,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),h.jsxs("select",{value:d,onChange:H=>f(H.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All agents"}),h.jsx("option",{value:"Hub",children:"Hub"}),t.map(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:m,onChange:H=>y(H.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All addons"}),e.map(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:i,onChange:H=>o(H.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{type:"button",onClick:()=>{var B;const H=!b;_(H),H&&((B=j.current)==null||B.scrollTo({top:0,behavior:"smooth"}))},className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${b?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[h.jsx(SE,{className:"h-3.5 w-3.5"}),"Auto-scroll: ",b?"ON":"OFF"]})]}),R&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading logs..."}),T&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load logs"}),!R&&!T&&z.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No logs match the current filters"}),z.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsx("div",{ref:j,onScroll:k,className:"max-h-[400px] overflow-y-auto",children:h.jsxs("table",{className:"w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0",children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-24",children:"Time"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-14",children:"Level"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-28",children:"Scope"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:z.map((H,B)=>{const L=String(H.level??"info").toLowerCase(),V=n4[L]??n4.info,Z=String(H.message??H.msg??H.text??""),oe=Array.isArray(H.scope)?H.scope.join(" > "):String(H.scope??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-2.5 py-1 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:P(H.timestamp??H.ts??H.time)}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase ${V.badge}`,children:L})}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border text-foreground-subtle font-mono truncate max-w-[180px]",title:oe,children:oe||"--"}),h.jsx("td",{className:`px-2.5 py-1 border-b border-border font-mono ${V.text} break-all`,children:Z})]},B)})})]})})})]})}function sH(t){const e=t.info??t,n=t.status??{};return{id:String(e.id??t.id??""),name:String(e.name??t.name??""),pid:Number(t.pid??0),state:String(t.state??"running"),cpuPercent:Number(n.cpuPercent??t.cpuPercent??0),memoryPercent:Number(n.memoryPercent??t.memoryPercent??0),memoryMB:Number(e.memoryMB??t.memoryMB??0),isHub:!!(t.isHub??!1),platform:String(e.platform??t.platform??""),arch:String(e.arch??t.arch??""),host:String(e.host??t.host??""),capabilities:e.capabilities??t.capabilities??[],installedAddons:e.installedAddons??t.installedAddons??[],pythonRuntimes:e.pythonRuntimes??t.pythonRuntimes??[],connectedSince:Number(t.connectedSince??Date.now()),subProcesses:rH(t.subProcesses)}}function rH(t){return Array.isArray(t)?t.map(e=>({pid:Number(e.pid??0),name:String(e.name??""),command:String(e.command??""),state:e.state??"running",cpuPercent:Number(e.cpuPercent??0),memoryRss:Number(e.memoryRss??0),uptimeSeconds:Number(e.uptimeSeconds??0)})):[]}function u1({icon:t,label:e,value:n,color:s}){return h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-3 flex items-center gap-3",children:[h.jsx("div",{className:`flex-shrink-0 h-9 w-9 rounded-lg flex items-center justify-center ${s}`,children:h.jsx(t,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-xl font-bold text-foreground leading-none",children:n}),h.jsx("div",{className:"text-[10px] text-foreground-subtle mt-0.5",children:e})]})]})}function a4({tab:t,active:e,icon:n,label:s,onClick:i}){return h.jsxs("button",{type:"button",onClick:i,className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${e?"bg-primary/10 text-primary border border-primary/30":"bg-surface text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/5"}`,children:[h.jsx(n,{className:"h-3.5 w-3.5"}),s]})}function iH(){const t=sn(),e=wa(),[n,s]=D.useState("tree"),[i,o]=D.useState(null),{data:d}=Ct({queryKey:["agents","testWorker","status"],queryFn:()=>t.trpc.agents.isTestWorkerRunning.query(),refetchInterval:5e3}),f=(d==null?void 0:d.running)??!1,m=ja({mutationFn:()=>t.trpc.agents.startTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),y=ja({mutationFn:()=>t.trpc.agents.stopTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),{data:v=[],isLoading:b}=Ct({queryKey:["agent","processTree"],queryFn:()=>t.trpc.agent.processTree.query(),refetchInterval:5e3}),{data:_=[]}=Ct({queryKey:["agents","list"],queryFn:()=>t.listAgents(),refetchInterval:5e3}),j=D.useMemo(()=>v.map(sH),[v]),w=j.length,O=j.reduce((z,k)=>z+k.subProcesses.length,0),R=j.reduce((z,k)=>z+k.installedAddons.length,0),T=D.useMemo(()=>j.filter(z=>!z.isHub).map(z=>z.name),[j]),A=D.useMemo(()=>{const z=new Set;for(const k of j)for(const P of k.installedAddons)z.add(P);return[...z].sort()},[j]);return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Agents & Process Tree"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Distributed processing agents, sub-processes, and system logs."})]}),h.jsx("div",{className:"shrink-0",children:f?h.jsxs("button",{type:"button",onClick:()=>y.mutate(),disabled:y.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-danger/30 bg-danger/10 text-danger px-3 py-1.5 text-xs font-medium hover:bg-danger/20 transition-colors disabled:opacity-50",children:[h.jsx(D6,{className:"h-3.5 w-3.5"}),y.isPending?"Stopping...":"Stop Test Agent"]}):h.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:m.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface text-foreground-subtle px-3 py-1.5 text-xs font-medium hover:text-foreground hover:bg-primary/5 transition-colors disabled:opacity-50",children:[h.jsx(iT,{className:"h-3.5 w-3.5"}),m.isPending?"Starting...":"Start Test Agent"]})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-3",children:[h.jsx(u1,{icon:mb,label:"Agents online",value:w,color:"bg-green-500/10 text-green-400"}),h.jsx(u1,{icon:zf,label:"Sub-processes",value:O,color:"bg-blue-500/10 text-blue-400"}),h.jsx(u1,{icon:CT,label:"Installed addons",value:R,color:"bg-purple-500/10 text-purple-400"}),h.jsx(u1,{icon:mb,label:"Capabilities",value:[...new Set(j.flatMap(z=>z.capabilities))].length,color:"bg-cyan-500/10 text-cyan-400"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(a4,{tab:"tree",active:n==="tree",icon:lR,label:"Process Tree",onClick:()=>s("tree")}),h.jsx(a4,{tab:"logs",active:n==="logs",icon:Y1,label:"Logs",onClick:()=>s("logs")})]}),n==="tree"&&h.jsxs(h.Fragment,{children:[w===0&&!b&&h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-border bg-surface py-12 text-foreground-subtle",children:[h.jsx(xR,{className:"h-8 w-8 mb-2 opacity-40"}),h.jsx("div",{className:"text-sm",children:"No agents connected"}),h.jsxs("div",{className:"text-xs mt-1 opacity-70",children:["Run"," ",h.jsx("code",{className:"font-mono bg-border px-1 rounded",children:"camstack --agent --hub wss://<host>:4443"})," ","to connect one."]})]}),h.jsx(nH,{entries:j,isLoading:b,selectedAgentName:i,onSelectAgent:z=>{o(z),s("logs")}})]}),n==="logs"&&h.jsxs(h.Fragment,{children:[i&&h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Filtered to agent:"}),h.jsx("span",{className:"font-semibold text-foreground",children:i}),h.jsxs("button",{type:"button",onClick:()=>o(null),className:"inline-flex items-center gap-1 rounded-lg border border-border bg-surface px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-primary/5 transition-colors",children:[h.jsx(Lu,{className:"h-3 w-3"}),"Clear selection"]})]}),h.jsx(aH,{agentNames:T,addonNames:A,preselectedAgent:i??void 0})]})]})}const s4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function lH(){const t=sn(),[e,n]=D.useState("all"),[s,i]=D.useState(!1),o=D.useRef(null),{data:d,isLoading:f,isError:m}=Ct({queryKey:["logs",e],queryFn:()=>t.getLogs(e!=="all"?{level:e,limit:500}:{limit:500}),refetchInterval:s?!1:3e3}),y=d??[],v=D.useMemo(()=>[...y].reverse(),[y]);D.useEffect(()=>{var _;s||(_=o.current)==null||_.scrollIntoView({behavior:"smooth"})},[v,s]);function b(_){return _?new Date(typeof _=="number"?_:String(_)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"—"}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Logs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("select",{value:e,onChange:_=>n(_.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{onClick:()=>i(_=>!_),className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${s?"border-primary/30 bg-primary/10 text-primary hover:bg-primary/20":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[s?h.jsx(dv,{className:"h-3.5 w-3.5"}):h.jsx(LT,{className:"h-3.5 w-3.5"}),s?"Resume":"Pause"]})]})]}),f&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),m&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!f&&!m&&v.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),v.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"max-h-[calc(100vh-220px)] overflow-y-auto",children:[h.jsx("div",{ref:o}),h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:"sticky top-0",children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border w-36",children:"Time"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border w-16",children:"Level"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:v.map((_,j)=>{const w=String(_.level??"info").toLowerCase(),O=s4[w]??s4.info,R=String(_.message??_.msg??_.text??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-1.5 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:b(_.timestamp??_.ts??_.time)}),h.jsx("td",{className:"px-3 py-1.5 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium uppercase ${O.badge}`,children:w})}),h.jsx("td",{className:`px-3 py-1.5 border-b border-border font-mono ${O.text} break-all`,children:R})]},j)})})]})]})})]})}const r4={super_admin:"bg-danger/10 text-danger",admin:"bg-primary/10 text-primary",viewer:"bg-foreground-subtle/10 text-foreground-subtle"};function oH(){const t=sn(),e=wa(),[n,s]=D.useState(!1),[i,o]=D.useState(""),[d,f]=D.useState(""),[m,y]=D.useState("viewer"),[v,b]=D.useState(null),{data:_,isLoading:j,isError:w}=Ct({queryKey:["users"],queryFn:()=>t.listUsers()}),O=ja({mutationFn:()=>t.createUser(i,d,m),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),s(!1),o(""),f(""),y("viewer"),b(null)},onError:A=>{b(A instanceof Error?A.message:"Failed to create user")}}),R=_??[];function T(A){return A?new Date(typeof A=="number"?A:String(A)).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"—"}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Users"}),h.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm hover:bg-primary/90",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Create User"]})]}),n&&h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"New User"}),h.jsx("button",{onClick:()=>s(!1),className:"text-foreground-subtle hover:text-foreground",children:h.jsx(Lu,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Username"}),h.jsx("input",{type:"text",value:i,onChange:A=>o(A.target.value),placeholder:"john",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Password"}),h.jsx("input",{type:"password",value:d,onChange:A=>f(A.target.value),placeholder:"••••••••",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Role"}),h.jsxs("select",{value:m,onChange:A=>y(A.target.value),className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"viewer",children:"Viewer"}),h.jsx("option",{value:"admin",children:"Admin"}),h.jsx("option",{value:"super_admin",children:"Super Admin"})]})]})]}),v&&h.jsx("p",{className:"text-[10px] text-danger",children:v}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>s(!1),className:"rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground",children:"Cancel"}),h.jsx("button",{onClick:()=>O.mutate(),disabled:O.isPending||!i||!d,className:"rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:O.isPending?"Creating...":"Create"})]})]}),j&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),w&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!j&&!w&&R.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),R.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Username"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Role"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Created"})]})}),h.jsx("tbody",{children:R.map(A=>{const z=String(A.role??"viewer"),k=r4[z]??r4.viewer;return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:String(A.username??A.name??"")}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium ${k}`,children:z.replace("_"," ")})}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border text-foreground-subtle",children:T(A.createdAt??A.created_at??A.createdAt)})]},String(A.id??A.username))})})]})})]})}function uH({section:t}){var T,A,z;const e=sn(),n=wa(),[s,i]=D.useState(null),[o,d]=D.useState(!1),[f,m]=D.useState(null),y=Ct({queryKey:["settings-schema",t],queryFn:()=>e.getSettingsSchema(t),staleTime:1/0}),v=Ct({queryKey:["settings",t],queryFn:()=>e.getSettings(t)}),b=(T=y.data)==null?void 0:T.schema,_=((A=y.data)==null?void 0:A.readOnly)??!1,j=((z=v.data)==null?void 0:z.data)??{},w=s??j,O=s!==null,R=ja({mutationFn:k=>e.updateSettings(t,k),onSuccess:()=>{d(!0),m(null),i(null),n.invalidateQueries({queryKey:["settings",t]}),setTimeout(()=>d(!1),2e3)},onError:k=>{m(k instanceof Error?k.message:"Failed to save")}});return y.isLoading||v.isLoading?h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse py-4",children:"Loading..."}):y.isError||v.isError?h.jsx("div",{className:"text-xs text-danger py-4",children:"Failed to load settings"}):!b||b.sections.length===0?h.jsx("div",{className:"text-xs text-foreground-subtle py-4",children:"No configurable settings for this section."}):h.jsxs("div",{className:"space-y-4",children:[h.jsx($1,{schema:b,values:w,onChange:k=>i(k),disabled:_}),!_&&h.jsxs("div",{className:"flex items-center justify-end gap-3",children:[o&&h.jsx("span",{className:"text-xs text-success",children:"Saved successfully"}),f&&h.jsx("span",{className:"text-xs text-danger",children:f}),O&&h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsx("button",{type:"button",onClick:()=>R.mutate(w),disabled:R.isPending||!O,className:"rounded-md bg-primary px-4 py-1.5 text-xs font-medium text-white hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:R.isPending?"Saving...":"Save"})]})]})}function cH(){var d;const t=sn(),e=Ct({queryKey:["settings-schema-all"],queryFn:()=>t.getSettingsSchema(),staleTime:1/0}),n=((d=e.data)==null?void 0:d.tabs)??[],[s,i]=D.useState(null),o=s??(n.length>0?n[0].id:null);return e.isLoading?h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading settings..."})}):h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Settings"}),h.jsx("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:"system"})]}),h.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto scrollbar-hide",children:n.map(f=>h.jsx("button",{onClick:()=>i(f.id),className:["px-3 py-1.5 text-xs font-medium rounded-t transition-colors whitespace-nowrap",o===f.id?"text-primary border-b-2 border-primary -mb-px bg-surface":"text-foreground-subtle hover:text-foreground"].join(" "),children:f.label},f.id))}),o&&h.jsx(uH,{section:o},o)]})}const dH={streaming:{icon:gR,label:"Stream"},detection:{icon:ch,label:"Detection"},recording:{icon:C6,label:"Recording"},audio:{icon:O6,label:"Audio"}};function fH({capabilities:t}){return h.jsx("div",{className:"flex items-center gap-1",children:t.map(e=>{const n=dH[e];if(!n)return null;const s=n.icon;return h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] text-foreground-subtle",title:n.label,children:h.jsx(s,{className:"h-3 w-3"})},e)})})}function no({title:t,children:e}){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:t})}),h.jsx("div",{className:"p-4",children:e})]})}function or({name:t,cssVar:e,hex:n}){const s=e?`var(${e})`:n;return h.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[h.jsx("div",{className:"h-10 w-10 rounded-lg border border-border shadow-inner",style:{backgroundColor:s}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle text-center leading-tight",children:t})]})}const hH={sections:[{id:"demo",title:"Demo Fields",columns:2,fields:[{key:"name",type:"text",label:"Name",placeholder:"Enter name"},{key:"count",type:"number",label:"Count",min:0,max:100,unit:"items"},{key:"enabled",type:"boolean",label:"Enabled"},{key:"mode",type:"select",label:"Mode",options:[{value:"a",label:"Alpha"},{value:"b",label:"Beta"}]},{key:"tags",type:"tags",label:"Tags",span:2,suggestions:["camera","zone","alert"]},{key:"confidence",type:"slider",label:"Confidence",min:0,max:100,step:5,unit:"%",span:2},{key:"info",type:"info",label:"Note",content:"This is an informational message for the user.",variant:"info"}]}]};function pH(){const[t,e]=D.useState({name:"Example",count:10,enabled:!0,mode:"a",tags:["camera"],confidence:60});return h.jsxs("div",{className:"p-6 space-y-6 max-w-5xl mx-auto",children:[h.jsxs("div",{className:"mb-6",children:[h.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Component Showroom"}),h.jsx("p",{className:"text-sm text-foreground-subtle mt-1",children:"All UI components at a glance"})]}),h.jsx(no,{title:"Typography",children:h.jsxs("div",{className:"space-y-3",children:[h.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Heading 1 — Display title"}),h.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Heading 2 — Section title"}),h.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Heading 3 — Card title"}),h.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Heading 4 — Sub-section"}),h.jsx("p",{className:"text-sm text-foreground",children:"Body text — Regular paragraph content goes here. It uses the foreground color."}),h.jsx("p",{className:"text-sm text-foreground-subtle",children:"Subtle text — Secondary/descriptive text with reduced emphasis."}),h.jsx("p",{className:"text-xs text-foreground-subtle uppercase tracking-wider font-semibold",children:"Label / Caption"}),h.jsx("p",{className:"text-xs text-foreground-disabled",children:"Disabled / placeholder text"})]})}),h.jsx(no,{title:"Colors",children:h.jsxs("div",{className:"flex flex-wrap gap-4",children:[h.jsx(or,{name:"primary",cssVar:"--color-primary"}),h.jsx(or,{name:"background",cssVar:"--color-background"}),h.jsx(or,{name:"surface",cssVar:"--color-surface"}),h.jsx(or,{name:"foreground",cssVar:"--color-foreground"}),h.jsx(or,{name:"success",cssVar:"--color-success"}),h.jsx(or,{name:"warning",cssVar:"--color-warning"}),h.jsx(or,{name:"danger",cssVar:"--color-danger"}),h.jsx(or,{name:"info",cssVar:"--color-info"}),h.jsx(or,{name:"border",cssVar:"--color-border"}),h.jsx("div",{className:"w-px"}),h.jsx(or,{name:"frigate",hex:"#3b82f6"}),h.jsx(or,{name:"scrypted",hex:"#a855f7"}),h.jsx(or,{name:"reolink",hex:"#06b6d4"}),h.jsx(or,{name:"ha",hex:"#22d3ee"}),h.jsx(or,{name:"rtsp",hex:"#78716c"})]})}),h.jsx(no,{title:"Buttons",children:h.jsxs("div",{className:"flex flex-wrap gap-3",children:[h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity",children:"Primary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors",children:"Secondary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors",children:"Danger"}),h.jsx("button",{disabled:!0,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed",children:"Disabled"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors",children:"Warning"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors",children:"Success"})]})}),h.jsx(no,{title:"Inputs",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Text input"}),h.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"Type something..."})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Number input"}),h.jsx("input",{type:"number",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"0"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Password input"}),h.jsx("input",{type:"password",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"••••••••"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Select"}),h.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",children:[h.jsx("option",{children:"Option A"}),h.jsx("option",{children:"Option B"}),h.jsx("option",{children:"Option C"})]})]}),h.jsxs("div",{className:"md:col-span-2",children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Textarea"}),h.jsx("textarea",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]",placeholder:"Enter multi-line text...",rows:3})]}),h.jsx("div",{children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",defaultChecked:!0}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Checkbox (checked)"})]})}),h.jsx("div",{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Toggle switch"}),h.jsx(mH,{})]})}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Slider"}),h.jsx("input",{type:"range",className:"w-full h-1 accent-primary cursor-pointer",min:0,max:100,defaultValue:60})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Tags example"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]",children:["camera","zone","alert"].map(n=>h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:n},n))})]})]})}),h.jsx(no,{title:"Badges",children:h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"StatusBadge"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:["running","stopped","error","online","offline","idle"].map(n=>h.jsx(nh,{status:n},n))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"CapabilityBadges"}),h.jsx(fH,{capabilities:["streaming","detection","recording","audio"]})]})]})}),h.jsx(no,{title:"Cards",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"rounded-lg bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Surface card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-surface`. Default card background."})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Bordered card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `border border-border bg-surface`."})]}),h.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-primary mb-1",children:"Accent card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Highlighted with primary color."})]}),h.jsxs("div",{className:"rounded-lg bg-background p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Background card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-background`. Inset card."})]})]})}),h.jsx(no,{title:"Provider Icons",children:h.jsx("div",{className:"flex flex-wrap gap-4",children:["frigate","scrypted","reolink","homeassistant","rtsp","onvif"].map(n=>h.jsx(W1,{type:n,size:"lg",showLabel:!0},n))})}),h.jsxs(no,{title:"Form Builder Demo",children:[h.jsx($1,{schema:hH,values:t,onChange:e}),h.jsxs("details",{className:"mt-3",children:[h.jsx("summary",{className:"text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground",children:"View current values"}),h.jsx("pre",{className:"mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto",children:JSON.stringify(t,null,2)})]})]}),h.jsx(no,{title:"Info Boxes",children:h.jsx("div",{className:"space-y-2",children:[{variant:"info",label:"Info",content:"This is an informational message. Use it for tips and hints."},{variant:"warning",label:"Warning",content:"This action may have side effects. Proceed with caution."},{variant:"success",label:"Success",content:"Operation completed successfully. All systems are green."},{variant:"danger",label:"Danger",content:"This operation is irreversible. Data will be permanently deleted."}].map(({variant:n,label:s,content:i})=>{const d={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}}[n];return h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${d.border} ${d.bg}`,children:[h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${d.text}`,children:s}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:i})]},n)})})})]})}function mH(){const[t,e]=D.useState(!0);return h.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>e(n=>!n),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer",t?"bg-primary":"bg-foreground-subtle/30"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",t?"translate-x-4":"translate-x-0.5"].join(" ")})})}const i4={info:{bg:"bg-blue-500/10",border:"border-blue-500/30",icon:gb},warning:{bg:"bg-orange-500/10",border:"border-orange-500/30",icon:z6},critical:{bg:"bg-red-500/10",border:"border-red-500/30",icon:BE}};function gH({toast:t,onDismiss:e}){const n=i4[t.severity]??i4.info,s=n.icon;return D.useEffect(()=>{const i=t.duration??5e3;if(i<=0)return;const o=setTimeout(()=>e(t.id),i);return()=>clearTimeout(o)},[t.id,t.duration,e]),h.jsxs("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:[h.jsx(s,{className:"h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-semibold text-foreground",children:t.title}),h.jsx("div",{className:"text-[11px] text-foreground-subtle mt-0.5",children:t.message})]}),h.jsx("button",{type:"button",onClick:()=>e(t.id),className:"shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors",children:h.jsx(Lu,{className:"h-3.5 w-3.5 text-foreground-subtle"})})]})}function yH(){const[t,e]=D.useState([]),n=sn(),s=D.useCallback(i=>{e(o=>o.filter(d=>d.id!==i))},[]);return D.useEffect(()=>{var o;let i=null;try{const d=(o=n.trpc.toast)==null?void 0:o.onToast.subscribe(void 0,{onData:f=>{const m=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(y=>[...y,{...f,id:m,timestamp:Date.now()}])},onError:f=>{console.warn("[ToastContainer] Subscription error:",f)}});i=()=>d==null?void 0:d.unsubscribe()}catch{}return()=>i==null?void 0:i()},[n]),t.length===0?null:h.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(i=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(gH,{toast:i,onDismiss:s})},i.id))})}const xH=new Y4({defaultOptions:{queries:{staleTime:3e4,retry:!1,refetchOnWindowFocus:!1}}});function bH(){return h.jsx(x_,{defaultMode:"dark",children:h.jsx(V4,{client:xH,children:h.jsx(BU,{children:h.jsxs(hE,{children:[h.jsx(l_,{children:h.jsxs(UN,{children:[h.jsx(La,{path:"/login",element:h.jsx(gO,{})}),h.jsx(La,{path:"/access-denied",element:h.jsx(yO,{})}),h.jsx(La,{path:"/showroom",element:h.jsx(pH,{})}),h.jsxs(La,{element:h.jsx(Mc,{children:h.jsx(mO,{})}),children:[h.jsx(La,{index:!0,element:h.jsx(ab,{to:"/dashboard",replace:!0})}),h.jsx(La,{path:"/dashboard",element:h.jsx(GA,{})}),h.jsx(La,{path:"/cameras",element:h.jsx(XA,{})}),h.jsx(La,{path:"/integrations",element:h.jsx(SM,{})}),h.jsx(La,{path:"/integrations/:integrationId",element:h.jsx(EM,{})}),h.jsx(La,{path:"/timeline",element:h.jsx(UM,{})}),h.jsx(La,{path:"/pipeline",element:h.jsx(yD,{})}),h.jsx(La,{path:"/devices/:deviceId",element:h.jsx(HU,{})}),h.jsx(La,{path:"/system/agents",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(iH,{})})}),h.jsx(La,{path:"/system/logs",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(lH,{})})}),h.jsx(La,{path:"/system/users",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(oH,{})})}),h.jsx(La,{path:"/system/settings",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(cH,{})})}),h.jsx(La,{path:"/system/addons",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(ZU,{})})}),h.jsx(La,{path:"/addon/:pagePath",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(fO,{})})})]})]})}),h.jsx(yH,{})]})})})})}const vH={dashboard:"Dashboard",integrations:"Integrations",metrics:"Metrics"},SH={title:"System",addons:"Addons",agents:"Agents",processes:"Processes",logs:"Logs",users:"Users",settings:"Settings",repl:"REPL",models:"Models"},NH={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"},_H={online:"Online",offline:"Offline",connecting:"Connecting",error:"Error",disabled:"Disabled",enabled:"Enabled",active:"Active",inactive:"Inactive",running:"Running",stopped:"Stopped",pending:"Pending",unknown:"Unknown"},CH={login:"Login",logout:"Logout",username:"Username",password:"Password",signIn:"Sign In",invalidCredentials:"Invalid username or password"},jH={dark:"Dark",light:"Light",system:"System"},wH={select:"Language",en:"English",it:"Italian"},EH={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"}},TH={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"},RH={nav:vH,system:SH,common:NH,status:_H,auth:CH,theme:jH,language:wH,pages:EH,integrations:TH},OH={dashboard:"Dashboard",integrations:"Integrazioni",metrics:"Metriche"},AH={title:"Sistema",addons:"Addon",agents:"Agenti",processes:"Processi",logs:"Log",users:"Utenti",settings:"Impostazioni",repl:"REPL",models:"Modelli"},MH={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"},DH={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"},zH={login:"Accesso",logout:"Esci",username:"Nome utente",password:"Password",signIn:"Accedi",invalidCredentials:"Nome utente o password non validi"},kH={dark:"Scuro",light:"Chiaro",system:"Sistema"},LH={select:"Lingua",en:"Inglese",it:"Italiano"},UH={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"}},HH={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"},qH={nav:OH,system:AH,common:MH,status:DH,auth:zH,theme:kH,language:LH,pages:UH,integrations:HH},t7="camstack_language",BH=localStorage.getItem(t7)??"en";Ss.use(aO).init({resources:{en:{translation:RH},it:{translation:qH}},lng:BH,fallbackLng:"en",interpolation:{escapeValue:!1}});Ss.on("languageChanged",t=>{localStorage.setItem(t7,t)});window.__camstackReact=G7;U9();Pb.createRoot(document.getElementById("root")).render(h.jsx(D.StrictMode,{children:h.jsx(bH,{})}));