var xT=Object.defineProperty;var HS=e=>{throw TypeError(e)};var bT=(e,t,n)=>t in e?xT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>bT(e,typeof t!="symbol"?t+"":t,n),i2=(e,t,n)=>t.has(e)||HS("Cannot "+n);var ge=(e,t,n)=>(i2(e,t,"read from private field"),n?n.call(e):t.get(e)),Vt=(e,t,n)=>t.has(e)?HS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xt=(e,t,n,r)=>(i2(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Dn=(e,t,n)=>(i2(e,t,"access private method"),n);var by=(e,t,n,r)=>({set _(s){xt(e,t,s,n)},get _(){return ge(e,t,r)}});function LT(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Ly=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function D8(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s2={exports:{}},Mp={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var IS;function wT(){if(IS)return Mp;IS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var h in s)h!=="key"&&(a[h]=s[h])}else a=s;return s=a.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:a}}return Mp.Fragment=t,Mp.jsx=n,Mp.jsxs=n,Mp}var $S;function ST(){return $S||($S=1,s2.exports=wT()),s2.exports}var f=ST(),o2={exports:{}},fn={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var VS;function CT(){if(VS)return fn;VS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.iterator;function w(Y){return Y===null||typeof Y!="object"?null:(Y=b&&Y[b]||Y["@@iterator"],typeof Y=="function"?Y:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,C={};function S(Y,ne,X){this.props=Y,this.context=ne,this.refs=C,this.updater=X||E}S.prototype.isReactComponent={},S.prototype.setState=function(Y,ne){if(typeof Y!="object"&&typeof Y!="function"&&Y!=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,Y,ne,"setState")},S.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function _(){}_.prototype=S.prototype;function N(Y,ne,X){this.props=Y,this.context=ne,this.refs=C,this.updater=X||E}var c=N.prototype=new _;c.constructor=N,M(c,S.prototype),c.isPureReactComponent=!0;var j=Array.isArray,D={H:null,A:null,T:null,S:null,V:null},B=Object.prototype.hasOwnProperty;function T(Y,ne,X,ue,pe,Se){return X=Se.ref,{$$typeof:e,type:Y,key:ne,ref:X!==void 0?X:null,props:Se}}function A(Y,ne){return T(Y.type,ne,void 0,void 0,void 0,Y.props)}function H(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function F(Y){var ne={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(X){return ne[X]})}var V=/\/+/g;function ee(Y,ne){return typeof Y=="object"&&Y!==null&&Y.key!=null?F(""+Y.key):ne.toString(36)}function G(){}function se(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(G,G):(Y.status="pending",Y.then(function(ne){Y.status==="pending"&&(Y.status="fulfilled",Y.value=ne)},function(ne){Y.status==="pending"&&(Y.status="rejected",Y.reason=ne)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function Ce(Y,ne,X,ue,pe){var Se=typeof Y;(Se==="undefined"||Se==="boolean")&&(Y=null);var Re=!1;if(Y===null)Re=!0;else switch(Se){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(Y.$$typeof){case e:case t:Re=!0;break;case x:return Re=Y._init,Ce(Re(Y._payload),ne,X,ue,pe)}}if(Re)return pe=pe(Y),Re=ue===""?"."+ee(Y,0):ue,j(pe)?(X="",Re!=null&&(X=Re.replace(V,"$&/")+"/"),Ce(pe,ne,X,"",function(he){return he})):pe!=null&&(H(pe)&&(pe=A(pe,X+(pe.key==null||Y&&Y.key===pe.key?"":(""+pe.key).replace(V,"$&/")+"/")+Re)),ne.push(pe)),1;Re=0;var ye=ue===""?".":ue+":";if(j(Y))for(var ve=0;ve<Y.length;ve++)ue=Y[ve],Se=ye+ee(ue,ve),Re+=Ce(ue,ne,X,Se,pe);else if(ve=w(Y),typeof ve=="function")for(Y=ve.call(Y),ve=0;!(ue=Y.next()).done;)ue=ue.value,Se=ye+ee(ue,ve++),Re+=Ce(ue,ne,X,Se,pe);else if(Se==="object"){if(typeof Y.then=="function")return Ce(se(Y),ne,X,ue,pe);throw ne=String(Y),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return Re}function te(Y,ne,X){if(Y==null)return Y;var ue=[],pe=0;return Ce(Y,ue,"","",function(Se){return ne.call(X,Se,pe++)}),ue}function K(Y){if(Y._status===-1){var ne=Y._result;ne=ne(),ne.then(function(X){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=X)},function(X){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=X)}),Y._status===-1&&(Y._status=0,Y._result=ne)}if(Y._status===1)return Y._result.default;throw Y._result}var Z=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)};function oe(){}return fn.Children={map:te,forEach:function(Y,ne,X){te(Y,function(){ne.apply(this,arguments)},X)},count:function(Y){var ne=0;return te(Y,function(){ne++}),ne},toArray:function(Y){return te(Y,function(ne){return ne})||[]},only:function(Y){if(!H(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}},fn.Component=S,fn.Fragment=n,fn.Profiler=s,fn.PureComponent=N,fn.StrictMode=r,fn.Suspense=m,fn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,fn.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return D.H.useMemoCache(Y)}},fn.cache=function(Y){return function(){return Y.apply(null,arguments)}},fn.cloneElement=function(Y,ne,X){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var ue=M({},Y.props),pe=Y.key,Se=void 0;if(ne!=null)for(Re in ne.ref!==void 0&&(Se=void 0),ne.key!==void 0&&(pe=""+ne.key),ne)!B.call(ne,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&ne.ref===void 0||(ue[Re]=ne[Re]);var Re=arguments.length-2;if(Re===1)ue.children=X;else if(1<Re){for(var ye=Array(Re),ve=0;ve<Re;ve++)ye[ve]=arguments[ve+2];ue.children=ye}return T(Y.type,pe,void 0,void 0,Se,ue)},fn.createContext=function(Y){return Y={$$typeof:l,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:a,_context:Y},Y},fn.createElement=function(Y,ne,X){var ue,pe={},Se=null;if(ne!=null)for(ue in ne.key!==void 0&&(Se=""+ne.key),ne)B.call(ne,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(pe[ue]=ne[ue]);var Re=arguments.length-2;if(Re===1)pe.children=X;else if(1<Re){for(var ye=Array(Re),ve=0;ve<Re;ve++)ye[ve]=arguments[ve+2];pe.children=ye}if(Y&&Y.defaultProps)for(ue in Re=Y.defaultProps,Re)pe[ue]===void 0&&(pe[ue]=Re[ue]);return T(Y,Se,void 0,void 0,null,pe)},fn.createRef=function(){return{current:null}},fn.forwardRef=function(Y){return{$$typeof:h,render:Y}},fn.isValidElement=H,fn.lazy=function(Y){return{$$typeof:x,_payload:{_status:-1,_result:Y},_init:K}},fn.memo=function(Y,ne){return{$$typeof:p,type:Y,compare:ne===void 0?null:ne}},fn.startTransition=function(Y){var ne=D.T,X={};D.T=X;try{var ue=Y(),pe=D.S;pe!==null&&pe(X,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(oe,Z)}catch(Se){Z(Se)}finally{D.T=ne}},fn.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},fn.use=function(Y){return D.H.use(Y)},fn.useActionState=function(Y,ne,X){return D.H.useActionState(Y,ne,X)},fn.useCallback=function(Y,ne){return D.H.useCallback(Y,ne)},fn.useContext=function(Y){return D.H.useContext(Y)},fn.useDebugValue=function(){},fn.useDeferredValue=function(Y,ne){return D.H.useDeferredValue(Y,ne)},fn.useEffect=function(Y,ne,X){var ue=D.H;if(typeof X=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ue.useEffect(Y,ne)},fn.useId=function(){return D.H.useId()},fn.useImperativeHandle=function(Y,ne,X){return D.H.useImperativeHandle(Y,ne,X)},fn.useInsertionEffect=function(Y,ne){return D.H.useInsertionEffect(Y,ne)},fn.useLayoutEffect=function(Y,ne){return D.H.useLayoutEffect(Y,ne)},fn.useMemo=function(Y,ne){return D.H.useMemo(Y,ne)},fn.useOptimistic=function(Y,ne){return D.H.useOptimistic(Y,ne)},fn.useReducer=function(Y,ne,X){return D.H.useReducer(Y,ne,X)},fn.useRef=function(Y){return D.H.useRef(Y)},fn.useState=function(Y){return D.H.useState(Y)},fn.useSyncExternalStore=function(Y,ne,X){return D.H.useSyncExternalStore(Y,ne,X)},fn.useTransition=function(){return D.H.useTransition()},fn.version="19.1.0",fn}var qS;function bu(){return qS||(qS=1,o2.exports=CT()),o2.exports}var y=bu();const Un=D8(y),A8=LT({__proto__:null,default:Un},[y]);var a2={exports:{}},Np={},l2={exports:{}},c2={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var WS;function ET(){return WS||(WS=1,function(e){function t(te,K){var Z=te.length;te.push(K);e:for(;0<Z;){var oe=Z-1>>>1,Y=te[oe];if(0<s(Y,K))te[oe]=K,te[Z]=Y,Z=oe;else break e}}function n(te){return te.length===0?null:te[0]}function r(te){if(te.length===0)return null;var K=te[0],Z=te.pop();if(Z!==K){te[0]=Z;e:for(var oe=0,Y=te.length,ne=Y>>>1;oe<ne;){var X=2*(oe+1)-1,ue=te[X],pe=X+1,Se=te[pe];if(0>s(ue,Z))pe<Y&&0>s(Se,ue)?(te[oe]=Se,te[pe]=Z,oe=pe):(te[oe]=ue,te[X]=Z,oe=X);else if(pe<Y&&0>s(Se,Z))te[oe]=Se,te[pe]=Z,oe=pe;else break e}}return K}function s(te,K){var Z=te.sortIndex-K.sortIndex;return Z!==0?Z:te.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,h=l.now();e.unstable_now=function(){return l.now()-h}}var m=[],p=[],x=1,b=null,w=3,E=!1,M=!1,C=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;function j(te){for(var K=n(p);K!==null;){if(K.callback===null)r(p);else if(K.startTime<=te)r(p),K.sortIndex=K.expirationTime,t(m,K);else break;K=n(p)}}function D(te){if(C=!1,j(te),!M)if(n(m)!==null)M=!0,B||(B=!0,ee());else{var K=n(p);K!==null&&Ce(D,K.startTime-te)}}var B=!1,T=-1,A=5,H=-1;function F(){return S?!0:!(e.unstable_now()-H<A)}function V(){if(S=!1,B){var te=e.unstable_now();H=te;var K=!0;try{e:{M=!1,C&&(C=!1,N(T),T=-1),E=!0;var Z=w;try{t:{for(j(te),b=n(m);b!==null&&!(b.expirationTime>te&&F());){var oe=b.callback;if(typeof oe=="function"){b.callback=null,w=b.priorityLevel;var Y=oe(b.expirationTime<=te);if(te=e.unstable_now(),typeof Y=="function"){b.callback=Y,j(te),K=!0;break t}b===n(m)&&r(m),j(te)}else r(m);b=n(m)}if(b!==null)K=!0;else{var ne=n(p);ne!==null&&Ce(D,ne.startTime-te),K=!1}}break e}finally{b=null,w=Z,E=!1}K=void 0}}finally{K?ee():B=!1}}}var ee;if(typeof c=="function")ee=function(){c(V)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,se=G.port2;G.port1.onmessage=V,ee=function(){se.postMessage(null)}}else ee=function(){_(V,0)};function Ce(te,K){T=_(function(){te(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(te){te.callback=null},e.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<te?Math.floor(1e3/te):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(te){switch(w){case 1:case 2:case 3:var K=3;break;default:K=w}var Z=w;w=K;try{return te()}finally{w=Z}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(te,K){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var Z=w;w=te;try{return K()}finally{w=Z}},e.unstable_scheduleCallback=function(te,K,Z){var oe=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?oe+Z:oe):Z=oe,te){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=Z+Y,te={id:x++,callback:K,priorityLevel:te,startTime:Z,expirationTime:Y,sortIndex:-1},Z>oe?(te.sortIndex=Z,t(p,te),n(m)===null&&te===n(p)&&(C?(N(T),T=-1):C=!0,Ce(D,Z-oe))):(te.sortIndex=Y,t(m,te),M||E||(M=!0,B||(B=!0,ee()))),te},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(te){var K=w;return function(){var Z=w;w=K;try{return te.apply(this,arguments)}finally{w=Z}}}}(c2)),c2}var GS;function RT(){return GS||(GS=1,l2.exports=ET()),l2.exports}var u2={exports:{}},Bi={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var YS;function _T(){if(YS)return Bi;YS=1;var e=bu();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(m,p,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:m,containerInfo:p,implementation:x}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Bi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Bi.createPortal=function(m,p){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return a(m,p,null,x)},Bi.flushSync=function(m){var p=l.T,x=r.p;try{if(l.T=null,r.p=2,m)return m()}finally{l.T=p,r.p=x,r.d.f()}},Bi.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(m,p))},Bi.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Bi.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var x=p.as,b=h(x,p.crossOrigin),w=typeof p.integrity=="string"?p.integrity:void 0,E=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?r.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:b,integrity:w,fetchPriority:E}):x==="script"&&r.d.X(m,{crossOrigin:b,integrity:w,fetchPriority:E,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Bi.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=h(p.as,p.crossOrigin);r.d.M(m,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(m)},Bi.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,b=h(x,p.crossOrigin);r.d.L(m,x,{crossOrigin:b,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Bi.preloadModule=function(m,p){if(typeof m=="string")if(p){var x=h(p.as,p.crossOrigin);r.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(m)},Bi.requestFormReset=function(m){r.d.r(m)},Bi.unstable_batchedUpdates=function(m,p){return m(p)},Bi.useFormState=function(m,p,x){return l.H.useFormState(m,p,x)},Bi.useFormStatus=function(){return l.H.useHostTransitionStatus()},Bi.version="19.1.0",Bi}var XS;function Kx(){if(XS)return u2.exports;XS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),u2.exports=_T(),u2.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var KS;function MT(){if(KS)return Np;KS=1;var e=RT(),t=bu(),n=Kx();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)o+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function a(i){var o=i,u=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(u=o.return),i=o.return;while(i)}return o.tag===3?u:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function h(i){if(a(i)!==i)throw Error(r(188))}function m(i){var o=i.alternate;if(!o){if(o=a(i),o===null)throw Error(r(188));return o!==i?null:i}for(var u=i,v=o;;){var L=u.return;if(L===null)break;var O=L.alternate;if(O===null){if(v=L.return,v!==null){u=v;continue}break}if(L.child===O.child){for(O=L.child;O;){if(O===u)return h(L),i;if(O===v)return h(L),o;O=O.sibling}throw Error(r(188))}if(u.return!==v.return)u=L,v=O;else{for(var U=!1,W=L.child;W;){if(W===u){U=!0,u=L,v=O;break}if(W===v){U=!0,v=L,u=O;break}W=W.sibling}if(!U){for(W=O.child;W;){if(W===u){U=!0,u=O,v=L;break}if(W===v){U=!0,v=O,u=L;break}W=W.sibling}if(!U)throw Error(r(189))}}if(u.alternate!==v)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:o}function p(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=p(i),o!==null)return o;i=i.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),N=Symbol.for("react.consumer"),c=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function ee(i){return i===null||typeof i!="object"?null:(i=V&&i[V]||i["@@iterator"],typeof i=="function"?i:null)}var G=Symbol.for("react.client.reference");function se(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===G?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case M:return"Fragment";case S:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case B:return"SuspenseList";case H:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case E:return"Portal";case c:return(i.displayName||"Context")+".Provider";case N:return(i._context.displayName||"Context")+".Consumer";case j:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case T:return o=i.displayName||null,o!==null?o:se(i.type)||"Memo";case A:o=i._payload,i=i._init;try{return se(i(o))}catch{}}return null}var Ce=Array.isArray,te=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},oe=[],Y=-1;function ne(i){return{current:i}}function X(i){0>Y||(i.current=oe[Y],oe[Y]=null,Y--)}function ue(i,o){Y++,oe[Y]=i.current,i.current=o}var pe=ne(null),Se=ne(null),Re=ne(null),ye=ne(null);function ve(i,o){switch(ue(Re,o),ue(Se,i),ue(pe,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?mr(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=mr(o),i=xr(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}X(pe),ue(pe,i)}function he(){X(pe),X(Se),X(Re)}function de(i){i.memoizedState!==null&&ue(ye,i);var o=pe.current,u=xr(o,i.type);o!==u&&(ue(Se,i),ue(pe,u))}function ke(i){Se.current===i&&(X(pe),X(Se)),ye.current===i&&(X(ye),Xc._currentValue=Z)}var Ee=Object.prototype.hasOwnProperty,Ke=e.unstable_scheduleCallback,ae=e.unstable_cancelCallback,We=e.unstable_shouldYield,bt=e.unstable_requestPaint,tt=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,Xe=e.unstable_ImmediatePriority,at=e.unstable_UserBlockingPriority,ot=e.unstable_NormalPriority,Ct=e.unstable_LowPriority,Ot=e.unstable_IdlePriority,kn=e.log,_t=e.unstable_setDisableYieldValue,kt=null,$=null;function k(i){if(typeof kn=="function"&&_t(i),$&&typeof $.setStrictMode=="function")try{$.setStrictMode(kt,i)}catch{}}var z=Math.clz32?Math.clz32:xe,J=Math.log,le=Math.LN2;function xe(i){return i>>>=0,i===0?32:31-(J(i)/le|0)|0}var Ae=256,wt=4194304;function Mt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function nt(i,o,u){var v=i.pendingLanes;if(v===0)return 0;var L=0,O=i.suspendedLanes,U=i.pingedLanes;i=i.warmLanes;var W=v&134217727;return W!==0?(v=W&~O,v!==0?L=Mt(v):(U&=W,U!==0?L=Mt(U):u||(u=W&~i,u!==0&&(L=Mt(u))))):(W=v&~O,W!==0?L=Mt(W):U!==0?L=Mt(U):u||(u=v&~i,u!==0&&(L=Mt(u)))),L===0?0:o!==0&&o!==L&&(o&O)===0&&(O=L&-L,u=o&-o,O>=u||O===32&&(u&4194048)!==0)?o:L}function pt(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Bt(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 gr(){var i=Ae;return Ae<<=1,(Ae&4194048)===0&&(Ae=256),i}function Lr(){var i=wt;return wt<<=1,(wt&62914560)===0&&(wt=4194304),i}function wr(i){for(var o=[],u=0;31>u;u++)o.push(i);return o}function ft(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function jt(i,o,u,v,L,O){var U=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var W=i.entanglements,ie=i.expirationTimes,Ne=i.hiddenUpdates;for(u=U&~u;0<u;){var Ie=31-z(u),Ge=1<<Ie;W[Ie]=0,ie[Ie]=-1;var De=Ne[Ie];if(De!==null)for(Ne[Ie]=null,Ie=0;Ie<De.length;Ie++){var Oe=De[Ie];Oe!==null&&(Oe.lane&=-536870913)}u&=~Ge}v!==0&&qt(i,v,0),O!==0&&L===0&&i.tag!==0&&(i.suspendedLanes|=O&~(U&~o))}function qt(i,o,u){i.pendingLanes|=o,i.suspendedLanes&=~o;var v=31-z(o);i.entangledLanes|=o,i.entanglements[v]=i.entanglements[v]|1073741824|u&4194090}function Pt(i,o){var u=i.entangledLanes|=o;for(i=i.entanglements;u;){var v=31-z(u),L=1<<v;L&o|i[v]&o&&(i[v]|=o),u&=~L}}function Wt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Me(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function gt(){var i=K.p;return i!==0?i:(i=window.event,i===void 0?32:my(i.type))}function Jt(i,o){var u=K.p;try{return K.p=i,o()}finally{K.p=u}}var St=Math.random().toString(36).slice(2),dt="__reactFiber$"+St,en="__reactProps$"+St,bn="__reactContainer$"+St,rt="__reactEvents$"+St,Tt="__reactListeners$"+St,ce="__reactHandles$"+St,Ue="__reactResources$"+St,ze="__reactMarker$"+St;function $e(i){delete i[dt],delete i[en],delete i[rt],delete i[Tt],delete i[ce]}function ht(i){var o=i[dt];if(o)return o;for(var u=i.parentNode;u;){if(o=u[bn]||u[dt]){if(u=o.alternate,o.child!==null||u!==null&&u.child!==null)for(i=ny(i);i!==null;){if(u=i[dt])return u;i=ny(i)}return o}i=u,u=i.parentNode}return null}function vt(i){if(i=i[dt]||i[bn]){var o=i.tag;if(o===5||o===6||o===13||o===26||o===27||o===3)return i}return null}function Nt(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function ln(i){var o=i[Ue];return o||(o=i[Ue]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function En(i){i[ze]=!0}var Gr=new Set,ni={};function Sr(i,o){_n(i,o),_n(i+"Capture",o)}function _n(i,o){for(ni[i]=o,i=0;i<o.length;i++)Gr.add(o[i])}var zs=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]*$"),Bs={},fs={};function gl(i){return Ee.call(fs,i)?!0:Ee.call(Bs,i)?!1:zs.test(i)?fs[i]=!0:(Bs[i]=!0,!1)}function Us(i,o,u){if(gl(o))if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var v=o.toLowerCase().slice(0,5);if(v!=="data-"&&v!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+u)}}function vl(i,o,u){if(u===null)i.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+u)}}function Wi(i,o,u,v){if(v===null)i.removeAttribute(u);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(o,u,""+v)}}var je,it;function st(i){if(je===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);je=o&&o[1]||"",it=-1<u.stack.indexOf(`
    at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
`+je+i+it}var rn=!1;function gn(i,o){if(!i||rn)return"";rn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(o){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Oe){var De=Oe}Reflect.construct(i,[],Ge)}else{try{Ge.call()}catch(Oe){De=Oe}i.call(Ge.prototype)}}else{try{throw Error()}catch(Oe){De=Oe}(Ge=i())&&typeof Ge.catch=="function"&&Ge.catch(function(){})}}catch(Oe){if(Oe&&De&&typeof Oe.stack=="string")return[Oe.stack,De.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var L=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");L&&L.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=v.DetermineComponentFrameRoot(),U=O[0],W=O[1];if(U&&W){var ie=U.split(`
`),Ne=W.split(`
`);for(L=v=0;v<ie.length&&!ie[v].includes("DetermineComponentFrameRoot");)v++;for(;L<Ne.length&&!Ne[L].includes("DetermineComponentFrameRoot");)L++;if(v===ie.length||L===Ne.length)for(v=ie.length-1,L=Ne.length-1;1<=v&&0<=L&&ie[v]!==Ne[L];)L--;for(;1<=v&&0<=L;v--,L--)if(ie[v]!==Ne[L]){if(v!==1||L!==1)do if(v--,L--,0>L||ie[v]!==Ne[L]){var Ie=`
`+ie[v].replace(" at new "," at ");return i.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",i.displayName)),Ie}while(1<=v&&0<=L);break}}}finally{rn=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?st(u):""}function lr(i){switch(i.tag){case 26:case 27:case 5:return st(i.type);case 16:return st("Lazy");case 13:return st("Suspense");case 19:return st("SuspenseList");case 0:case 15:return gn(i.type,!1);case 11:return gn(i.type.render,!1);case 1:return gn(i.type,!0);case 31:return st("Activity");default:return""}}function zr(i){try{var o="";do o+=lr(i),i=i.return;while(i);return o}catch(u){return`
Error generating stack: `+u.message+`
`+u.stack}}function Yr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function va(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Do(i){var o=va(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),v=""+i[o];if(!i.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var L=u.get,O=u.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return L.call(this)},set:function(U){v=""+U,O.call(this,U)}}),Object.defineProperty(i,o,{enumerable:u.enumerable}),{getValue:function(){return v},setValue:function(U){v=""+U},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Ao(i){i._valueTracker||(i._valueTracker=Do(i))}function Fs(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var u=o.getValue(),v="";return i&&(v=va(i)?i.checked?"true":"false":i.value),i=v,i!==u?(o.setValue(i),!0):!1}function Gi(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Zn=/[\n"\\]/g;function Wn(i){return i.replace(Zn,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function cr(i,o,u,v,L,O,U,W){i.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.type=U:i.removeAttribute("type"),o!=null?U==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Yr(o)):i.value!==""+Yr(o)&&(i.value=""+Yr(o)):U!=="submit"&&U!=="reset"||i.removeAttribute("value"),o!=null?Yi(i,U,Yr(o)):u!=null?Yi(i,U,Yr(u)):v!=null&&i.removeAttribute("value"),L==null&&O!=null&&(i.defaultChecked=!!O),L!=null&&(i.checked=L&&typeof L!="function"&&typeof L!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+Yr(W):i.removeAttribute("name")}function Cr(i,o,u,v,L,O,U,W){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(i.type=O),o!=null||u!=null){if(!(O!=="submit"&&O!=="reset"||o!=null))return;u=u!=null?""+Yr(u):"",o=o!=null?""+Yr(o):u,W||o===i.value||(i.value=o),i.defaultValue=o}v=v??L,v=typeof v!="function"&&typeof v!="symbol"&&!!v,i.checked=W?i.checked:!!v,i.defaultChecked=!!v,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(i.name=U)}function Yi(i,o,u){o==="number"&&Gi(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Jn(i,o,u,v){if(i=i.options,o){o={};for(var L=0;L<u.length;L++)o["$"+u[L]]=!0;for(u=0;u<i.length;u++)L=o.hasOwnProperty("$"+i[u].value),i[u].selected!==L&&(i[u].selected=L),L&&v&&(i[u].defaultSelected=!0)}else{for(u=""+Yr(u),o=null,L=0;L<i.length;L++){if(i[L].value===u){i[L].selected=!0,v&&(i[L].defaultSelected=!0);return}o!==null||i[L].disabled||(o=i[L])}o!==null&&(o.selected=!0)}}function Hs(i,o,u){if(o!=null&&(o=""+Yr(o),o!==i.value&&(i.value=o),u==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=u!=null?""+Yr(u):""}function Xi(i,o,u,v){if(o==null){if(v!=null){if(u!=null)throw Error(r(92));if(Ce(v)){if(1<v.length)throw Error(r(93));v=v[0]}u=v}u==null&&(u=""),o=u}u=Yr(o),i.defaultValue=u,v=i.textContent,v===u&&v!==""&&v!==null&&(i.value=v)}function ri(i,o){if(o){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=o;return}}i.textContent=o}var vr=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 ic(i,o,u){var v=o.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?v?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":v?i.setProperty(o,u):typeof u!="number"||u===0||vr.has(o)?o==="float"?i.cssFloat=u:i[o]=(""+u).trim():i[o]=u+"px"}function sc(i,o,u){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,u!=null){for(var v in u)!u.hasOwnProperty(v)||o!=null&&o.hasOwnProperty(v)||(v.indexOf("--")===0?i.setProperty(v,""):v==="float"?i.cssFloat="":i[v]="");for(var L in o)v=o[L],o.hasOwnProperty(L)&&u[L]!==v&&ic(i,L,v)}else for(var O in o)o.hasOwnProperty(O)&&ic(i,O,o[O])}function oc(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ac=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"]]),lc=/^[\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 jo(i){return lc.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var yl=null;function Eu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ko=null,yr=null;function Xr(i){var o=vt(i);if(o&&(i=o.stateNode)){var u=i[en]||null;e:switch(i=o.stateNode,o.type){case"input":if(cr(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),o=u.name,u.type==="radio"&&o!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Wn(""+o)+'"][type="radio"]'),o=0;o<u.length;o++){var v=u[o];if(v!==i&&v.form===i.form){var L=v[en]||null;if(!L)throw Error(r(90));cr(v,L.value,L.defaultValue,L.defaultValue,L.checked,L.defaultChecked,L.type,L.name)}}for(o=0;o<u.length;o++)v=u[o],v.form===i.form&&Fs(v)}break e;case"textarea":Hs(i,u.value,u.defaultValue);break e;case"select":o=u.value,o!=null&&Jn(i,!!u.multiple,o,!1)}}}var Po=!1;function cc(i,o,u){if(Po)return i(o,u);Po=!0;try{var v=i(o);return v}finally{if(Po=!1,(ko!==null||yr!==null)&&(Sh(),ko&&(o=ko,i=yr,yr=ko=null,Xr(o),i)))for(o=0;o<i.length;o++)Xr(i[o])}}function ya(i,o){var u=i.stateNode;if(u===null)return null;var v=u[en]||null;if(v===null)return null;u=v[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(v=!v.disabled)||(i=i.type,v=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!v;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,o,typeof u));return u}var hs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xa=!1;if(hs)try{var Is={};Object.defineProperty(Is,"passive",{get:function(){xa=!0}}),window.addEventListener("test",Is,Is),window.removeEventListener("test",Is,Is)}catch{xa=!1}var ms=null,Ru=null,Cf=null;function a0(){if(Cf)return Cf;var i,o=Ru,u=o.length,v,L="value"in ms?ms.value:ms.textContent,O=L.length;for(i=0;i<u&&o[i]===L[i];i++);var U=u-i;for(v=1;v<=U&&o[u-v]===L[O-v];v++);return Cf=L.slice(i,1<v?1-v:void 0)}function Gn(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Hn(){return!0}function l0(){return!1}function Ei(i){function o(u,v,L,O,U){this._reactName=u,this._targetInst=L,this.type=v,this.nativeEvent=O,this.target=U,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(u=i[W],this[W]=u?u(O):O[W]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Hn:l0,this.isPropagationStopped=l0,this}return x(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Hn)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Hn)},persist:function(){},isPersistent:Hn}),o}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ef=Ei(xl),_u=x({},xl,{view:0,detail:0}),tL=Ei(_u),Rf,Jm,Or,uc=x({},_u,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:io,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Or&&(Or&&i.type==="mousemove"?(Rf=i.screenX-Or.screenX,Jm=i.screenY-Or.screenY):Jm=Rf=0,Or=i),Rf)},movementY:function(i){return"movementY"in i?i.movementY:Jm}}),ba=Ei(uc),c0=x({},uc,{dataTransfer:0}),e1=Ei(c0),ps=x({},_u,{relatedTarget:0}),_f=Ei(ps),u0=x({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),d0=Ei(u0),f0=x({},xl,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),h0=Ei(f0),m0=x({},xl,{data:0}),Ri=Ei(m0),nL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gs={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"},rL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p0(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=rL[i])?!!o[i]:!1}function io(){return p0}var Mf=x({},_u,{key:function(i){if(i.key){var o=nL[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Gn(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?gs[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:io,charCode:function(i){return i.type==="keypress"?Gn(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Gn(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),t1=Ei(Mf),ur=x({},uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zo=Ei(ur),n1=x({},_u,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:io}),iL=Ei(n1),r1=x({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),sL=Ei(r1),oL=x({},uc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),aL=Ei(oL),g0=x({},xl,{newState:0,oldState:0}),Nf=Ei(g0),dc=[9,13,27,32],i1=hs&&"CompositionEvent"in window,fc=null;hs&&"documentMode"in document&&(fc=document.documentMode);var v0=hs&&"TextEvent"in window&&!fc,Of=hs&&(!i1||fc&&8<fc&&11>=fc),Tf=" ",s1=!1;function y0(i,o){switch(i){case"keyup":return dc.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Df(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var La=!1;function lL(i,o){switch(i){case"compositionend":return Df(o);case"keypress":return o.which!==32?null:(s1=!0,Tf);case"textInput":return i=o.data,i===Tf&&s1?null:i;default:return null}}function x0(i,o){if(La)return i==="compositionend"||!i1&&y0(i,o)?(i=a0(),Cf=Ru=ms=null,La=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Of&&o.locale!=="ko"?null:o.data;default:return null}}var Ki={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 Af(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!Ki[i.type]:o==="textarea"}function hc(i,o,u,v){ko?yr?yr.push(v):yr=[v]:ko=v,o=Oh(o,"onChange"),0<o.length&&(u=new Ef("onChange","change",null,u,v),i.push({event:u,listeners:o}))}var mc=null,pc=null;function cL(i){Yv(i,0)}function jf(i){var o=Nt(i);if(Fs(o))return i}function b0(i,o){if(i==="change")return o}var L0=!1;if(hs){var o1;if(hs){var wa="oninput"in document;if(!wa){var w0=document.createElement("div");w0.setAttribute("oninput","return;"),wa=typeof w0.oninput=="function"}o1=wa}else o1=!1;L0=o1&&(!document.documentMode||9<document.documentMode)}function S0(){mc&&(mc.detachEvent("onpropertychange",kf),pc=mc=null)}function kf(i){if(i.propertyName==="value"&&jf(pc)){var o=[];hc(o,pc,i,Eu(i)),cc(cL,o)}}function C0(i,o,u){i==="focusin"?(S0(),mc=o,pc=u,mc.attachEvent("onpropertychange",kf)):i==="focusout"&&S0()}function Sa(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return jf(pc)}function Pf(i,o){if(i==="click")return jf(o)}function uL(i,o){if(i==="input"||i==="change")return jf(o)}function dL(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Qi=typeof Object.is=="function"?Object.is:dL;function so(i,o){if(Qi(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var u=Object.keys(i),v=Object.keys(o);if(u.length!==v.length)return!1;for(v=0;v<u.length;v++){var L=u[v];if(!Ee.call(o,L)||!Qi(i[L],o[L]))return!1}return!0}function vs(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function a1(i,o){var u=vs(i);i=0;for(var v;u;){if(u.nodeType===3){if(v=i+u.textContent.length,i<=o&&v>=o)return{node:u,offset:o-i};i=v}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=vs(u)}}function E0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?E0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function R0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=Gi(i.document);o instanceof i.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)i=o.contentWindow;else break;o=Gi(i.document)}return o}function l1(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var fL=hs&&"documentMode"in document&&11>=document.documentMode,gc=null,Ca=null,be=null,Fe=!1;function Pe(i,o,u){var v=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Fe||gc==null||gc!==Gi(v)||(v=gc,"selectionStart"in v&&l1(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),be&&so(be,v)||(be=v,v=Oh(Ca,"onSelect"),0<v.length&&(o=new Ef("onSelect","select",null,o,u),i.push({event:o,listeners:v}),o.target=gc)))}function lt(i,o){var u={};return u[i.toLowerCase()]=o.toLowerCase(),u["Webkit"+i]="webkit"+o,u["Moz"+i]="moz"+o,u}var $t={animationend:lt("Animation","AnimationEnd"),animationiteration:lt("Animation","AnimationIteration"),animationstart:lt("Animation","AnimationStart"),transitionrun:lt("Transition","TransitionRun"),transitionstart:lt("Transition","TransitionStart"),transitioncancel:lt("Transition","TransitionCancel"),transitionend:lt("Transition","TransitionEnd")},Mn={},jr={};hs&&(jr=document.createElement("div").style,"AnimationEvent"in window||(delete $t.animationend.animation,delete $t.animationiteration.animation,delete $t.animationstart.animation),"TransitionEvent"in window||delete $t.transitionend.transition);function Nn(i){if(Mn[i])return Mn[i];if(!$t[i])return i;var o=$t[i],u;for(u in o)if(o.hasOwnProperty(u)&&u in jr)return Mn[i]=o[u];return i}var zf=Nn("animationend"),_0=Nn("animationiteration"),Zi=Nn("animationstart"),Bf=Nn("transitionrun"),hL=Nn("transitionstart"),vc=Nn("transitioncancel"),Mu=Nn("transitionend"),Nu=new Map,zn="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(" ");zn.push("scrollEnd");function $s(i,o){Nu.set(i,o),Sr(o,[i])}var c1=new WeakMap;function pi(i,o){if(typeof i=="object"&&i!==null){var u=c1.get(i);return u!==void 0?u:(o={value:i,source:o,stack:zr(o)},c1.set(i,o),o)}return{value:i,source:o,stack:zr(o)}}var ys=[],yc=0,u1=0;function bl(){for(var i=yc,o=u1=yc=0;o<i;){var u=ys[o];ys[o++]=null;var v=ys[o];ys[o++]=null;var L=ys[o];ys[o++]=null;var O=ys[o];if(ys[o++]=null,v!==null&&L!==null){var U=v.pending;U===null?L.next=L:(L.next=U.next,U.next=L),v.pending=L}O!==0&&Ou(u,L,O)}}function Vs(i,o,u,v){ys[yc++]=i,ys[yc++]=o,ys[yc++]=u,ys[yc++]=v,u1|=v,i.lanes|=v,i=i.alternate,i!==null&&(i.lanes|=v)}function xc(i,o,u,v){return Vs(i,o,u,v),Tu(i)}function Ll(i,o){return Vs(i,null,null,o),Tu(i)}function Ou(i,o,u){i.lanes|=u;var v=i.alternate;v!==null&&(v.lanes|=u);for(var L=!1,O=i.return;O!==null;)O.childLanes|=u,v=O.alternate,v!==null&&(v.childLanes|=u),O.tag===22&&(i=O.stateNode,i===null||i._visibility&1||(L=!0)),i=O,O=O.return;return i.tag===3?(O=i.stateNode,L&&o!==null&&(L=31-z(u),i=O.hiddenUpdates,v=i[L],v===null?i[L]=[o]:v.push(o),o.lane=u|536870912),O):null}function Tu(i){if(50<Hc)throw Hc=0,ip=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var wl={};function Uf(i,o,u,v){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _i(i,o,u,v){return new Uf(i,o,u,v)}function Sl(i){return i=i.prototype,!(!i||!i.isReactComponent)}function gi(i,o){var u=i.alternate;return u===null?(u=_i(i.tag,o,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=o,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,o=i.dependencies,u.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Du(i,o){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,o=u.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Ff(i,o,u,v,L,O){var U=0;if(v=i,typeof i=="function")Sl(i)&&(U=1);else if(typeof i=="string")U=VL(i,u,pe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case H:return i=_i(31,u,o,L),i.elementType=H,i.lanes=O,i;case M:return Cl(u.children,L,O,o);case C:U=8,L|=24;break;case S:return i=_i(12,u,o,L|2),i.elementType=S,i.lanes=O,i;case D:return i=_i(13,u,o,L),i.elementType=D,i.lanes=O,i;case B:return i=_i(19,u,o,L),i.elementType=B,i.lanes=O,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case _:case c:U=10;break e;case N:U=9;break e;case j:U=11;break e;case T:U=14;break e;case A:U=16,v=null;break e}U=29,u=Error(r(130,i===null?"null":typeof i,"")),v=null}return o=_i(U,u,o,L),o.elementType=i,o.type=v,o.lanes=O,o}function Cl(i,o,u,v){return i=_i(7,i,v,o),i.lanes=u,i}function d1(i,o,u){return i=_i(6,i,null,o),i.lanes=u,i}function bc(i,o,u){return o=_i(4,i.children!==null?i.children:[],i.key,o),o.lanes=u,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Bo=[],Ea=0,Hf=null,Au=0,xs=[],bs=0,or=null,dr=1,Uo="";function El(i,o){Bo[Ea++]=Au,Bo[Ea++]=Hf,Hf=i,Au=o}function f1(i,o,u){xs[bs++]=dr,xs[bs++]=Uo,xs[bs++]=or,or=i;var v=dr;i=Uo;var L=32-z(v)-1;v&=~(1<<L),u+=1;var O=32-z(o)+L;if(30<O){var U=L-L%5;O=(v&(1<<U)-1).toString(32),v>>=U,L-=U,dr=1<<32-z(o)+L|u<<L|v,Uo=O+i}else dr=1<<O|u<<L|v,Uo=i}function h1(i){i.return!==null&&(El(i,1),f1(i,1,0))}function ju(i){for(;i===Hf;)Hf=Bo[--Ea],Bo[Ea]=null,Au=Bo[--Ea],Bo[Ea]=null;for(;i===or;)or=xs[--bs],xs[bs]=null,Uo=xs[--bs],xs[bs]=null,dr=xs[--bs],xs[bs]=null}var Br=null,fr=null,Ln=!1,qs=null,Mi=!1,Lc=Error(r(519));function Ls(i){var o=Error(r(418,""));throw Ra(pi(o,i)),Lc}function M0(i){var o=i.stateNode,u=i.type,v=i.memoizedProps;switch(o[dt]=i,o[en]=v,u){case"dialog":yn("cancel",o),yn("close",o);break;case"iframe":case"object":case"embed":yn("load",o);break;case"video":case"audio":for(u=0;u<wd.length;u++)yn(wd[u],o);break;case"source":yn("error",o);break;case"img":case"image":case"link":yn("error",o),yn("load",o);break;case"details":yn("toggle",o);break;case"input":yn("invalid",o),Cr(o,v.value,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name,!0),Ao(o);break;case"select":yn("invalid",o);break;case"textarea":yn("invalid",o),Xi(o,v.value,v.defaultValue,v.children),Ao(o)}u=v.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||o.textContent===""+u||v.suppressHydrationWarning===!0||Qv(o.textContent,u)?(v.popover!=null&&(yn("beforetoggle",o),yn("toggle",o)),v.onScroll!=null&&yn("scroll",o),v.onScrollEnd!=null&&yn("scrollend",o),v.onClick!=null&&(o.onclick=Th),o=!0):o=!1,o||Ls(i)}function N0(i){for(Br=i.return;Br;)switch(Br.tag){case 5:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Br=Br.return}}function ku(i){if(i!==Br)return!1;if(!Ln)return N0(i),Ln=!0,!1;var o=i.tag,u;if((u=o!==3&&o!==27)&&((u=o===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Ah(i.type,i.memoizedProps)),u=!u),u&&fr&&Ls(i),N0(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,o=0;i;){if(i.nodeType===8)if(u=i.data,u==="/$"){if(o===0){fr=Qs(i.nextSibling);break e}o--}else u!=="$"&&u!=="$!"&&u!=="$?"||o++;i=i.nextSibling}fr=null}}else o===27?(o=fr,_s(i.type)?(i=yp,yp=null,fr=i):fr=o):fr=Br?Qs(i.stateNode.nextSibling):null;return!0}function Pu(){fr=Br=null,Ln=!1}function O0(){var i=qs;return i!==null&&(Pi===null?Pi=i:Pi.push.apply(Pi,i),qs=null),i}function Ra(i){qs===null?qs=[i]:qs.push(i)}var Rl=ne(null),_a=null,q=null;function Ji(i,o,u){ue(Rl,o._currentValue),o._currentValue=u}function ws(i){i._currentValue=Rl.current,X(Rl)}function Ni(i,o,u){for(;i!==null;){var v=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,v!==null&&(v.childLanes|=o)):v!==null&&(v.childLanes&o)!==o&&(v.childLanes|=o),i===u)break;i=i.return}}function hn(i,o,u,v){var L=i.child;for(L!==null&&(L.return=i);L!==null;){var O=L.dependencies;if(O!==null){var U=L.child;O=O.firstContext;e:for(;O!==null;){var W=O;O=L;for(var ie=0;ie<o.length;ie++)if(W.context===o[ie]){O.lanes|=u,W=O.alternate,W!==null&&(W.lanes|=u),Ni(O.return,u,i),v||(U=null);break e}O=W.next}}else if(L.tag===18){if(U=L.return,U===null)throw Error(r(341));U.lanes|=u,O=U.alternate,O!==null&&(O.lanes|=u),Ni(U,u,i),U=null}else U=L.child;if(U!==null)U.return=L;else for(U=L;U!==null;){if(U===i){U=null;break}if(L=U.sibling,L!==null){L.return=U.return,U=L;break}U=U.return}L=U}}function zu(i,o,u,v){i=null;for(var L=o,O=!1;L!==null;){if(!O){if((L.flags&524288)!==0)O=!0;else if((L.flags&262144)!==0)break}if(L.tag===10){var U=L.alternate;if(U===null)throw Error(r(387));if(U=U.memoizedProps,U!==null){var W=L.type;Qi(L.pendingProps.value,U.value)||(i!==null?i.push(W):i=[W])}}else if(L===ye.current){if(U=L.alternate,U===null)throw Error(r(387));U.memoizedState.memoizedState!==L.memoizedState.memoizedState&&(i!==null?i.push(Xc):i=[Xc])}L=L.return}i!==null&&hn(o,i,u,v),o.flags|=262144}function If(i){for(i=i.firstContext;i!==null;){if(!Qi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function _l(i){_a=i,q=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Er(i){return T0(_a,i)}function $f(i,o){return _a===null&&_l(i),T0(i,o)}function T0(i,o){var u=o._currentValue;if(o={context:o,memoizedValue:u,next:null},q===null){if(i===null)throw Error(r(308));q=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else q=q.next=o;return u}var mL=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(u,v){i.push(v)}};this.abort=function(){o.aborted=!0,i.forEach(function(u){return u()})}},pL=e.unstable_scheduleCallback,gL=e.unstable_NormalPriority,er={$$typeof:c,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function m1(){return{controller:new mL,data:new Map,refCount:0}}function Bu(i){i.refCount--,i.refCount===0&&pL(gL,function(){i.controller.abort()})}var Uu=null,p1=0,wc=0,Oi=null;function vL(i,o){if(Uu===null){var u=Uu=[];p1=0,wc=Nh(),Oi={status:"pending",value:void 0,then:function(v){u.push(v)}}}return p1++,o.then(D0,D0),o}function D0(){if(--p1===0&&Uu!==null){Oi!==null&&(Oi.status="fulfilled");var i=Uu;Uu=null,wc=0,Oi=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function yL(i,o){var u=[],v={status:"pending",value:null,reason:null,then:function(L){u.push(L)}};return i.then(function(){v.status="fulfilled",v.value=o;for(var L=0;L<u.length;L++)(0,u[L])(o)},function(L){for(v.status="rejected",v.reason=L,L=0;L<u.length;L++)(0,u[L])(void 0)}),v}var A0=te.S;te.S=function(i,o){typeof o=="object"&&o!==null&&typeof o.then=="function"&&vL(i,o),A0!==null&&A0(i,o)};var Ml=ne(null);function Fo(){var i=Ml.current;return i!==null?i:ir.pooledCache}function Vf(i,o){o===null?ue(Ml,Ml.current):ue(Ml,o.pool)}function j0(){var i=Fo();return i===null?null:{parent:er._currentValue,pool:i}}var vi=Error(r(460)),k0=Error(r(474)),qf=Error(r(542)),g1={then:function(){}};function P0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Wf(){}function v1(i,o,u){switch(u=i[u],u===void 0?i.push(o):u!==o&&(o.then(Wf,Wf),o=u),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,B0(i),i;default:if(typeof o.status=="string")o.then(Wf,Wf);else{if(i=ir,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(v){if(o.status==="pending"){var L=o;L.status="fulfilled",L.value=v}},function(v){if(o.status==="pending"){var L=o;L.status="rejected",L.reason=v}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,B0(i),i}throw Sc=o,vi}}var Sc=null;function z0(){if(Sc===null)throw Error(r(459));var i=Sc;return Sc=null,i}function B0(i){if(i===vi||i===qf)throw Error(r(483))}var oo=!1;function Nl(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cc(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ma(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ho(i,o,u){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,($n&2)!==0){var L=v.pending;return L===null?o.next=o:(o.next=L.next,L.next=o),v.pending=o,o=Tu(i),Ou(i,null,u),o}return Vs(i,v,o,u),Tu(i)}function Fu(i,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var v=o.lanes;v&=i.pendingLanes,u|=v,o.lanes=u,Pt(i,u)}}function Ws(i,o){var u=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,u===v)){var L=null,O=null;if(u=u.firstBaseUpdate,u!==null){do{var U={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};O===null?L=O=U:O=O.next=U,u=u.next}while(u!==null);O===null?L=O=o:O=O.next=o}else L=O=o;u={baseState:v.baseState,firstBaseUpdate:L,lastBaseUpdate:O,shared:v.shared,callbacks:v.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=o:i.next=o,u.lastBaseUpdate=o}var Hu=!1;function Gs(){if(Hu){var i=Oi;if(i!==null)throw i}}function ci(i,o,u,v){Hu=!1;var L=i.updateQueue;oo=!1;var O=L.firstBaseUpdate,U=L.lastBaseUpdate,W=L.shared.pending;if(W!==null){L.shared.pending=null;var ie=W,Ne=ie.next;ie.next=null,U===null?O=Ne:U.next=Ne,U=ie;var Ie=i.alternate;Ie!==null&&(Ie=Ie.updateQueue,W=Ie.lastBaseUpdate,W!==U&&(W===null?Ie.firstBaseUpdate=Ne:W.next=Ne,Ie.lastBaseUpdate=ie))}if(O!==null){var Ge=L.baseState;U=0,Ie=Ne=ie=null,W=O;do{var De=W.lane&-536870913,Oe=De!==W.lane;if(Oe?(Rn&De)===De:(v&De)===De){De!==0&&De===wc&&(Hu=!0),Ie!==null&&(Ie=Ie.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Ht=i,Ut=W;De=o;var Xn=u;switch(Ut.tag){case 1:if(Ht=Ut.payload,typeof Ht=="function"){Ge=Ht.call(Xn,Ge,De);break e}Ge=Ht;break e;case 3:Ht.flags=Ht.flags&-65537|128;case 0:if(Ht=Ut.payload,De=typeof Ht=="function"?Ht.call(Xn,Ge,De):Ht,De==null)break e;Ge=x({},Ge,De);break e;case 2:oo=!0}}De=W.callback,De!==null&&(i.flags|=64,Oe&&(i.flags|=8192),Oe=L.callbacks,Oe===null?L.callbacks=[De]:Oe.push(De))}else Oe={lane:De,tag:W.tag,payload:W.payload,callback:W.callback,next:null},Ie===null?(Ne=Ie=Oe,ie=Ge):Ie=Ie.next=Oe,U|=De;if(W=W.next,W===null){if(W=L.shared.pending,W===null)break;Oe=W,W=Oe.next,Oe.next=null,L.lastBaseUpdate=Oe,L.shared.pending=null}}while(!0);Ie===null&&(ie=Ge),L.baseState=ie,L.firstBaseUpdate=Ne,L.lastBaseUpdate=Ie,O===null&&(L.shared.lanes=0),za|=U,i.lanes=U,i.memoizedState=Ge}}function U0(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function y1(i,o){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)U0(u[i],o)}var Ol=ne(null),Na=ne(0);function Io(i,o){i=Qo,ue(Na,i),ue(Ol,o),Qo=i|o.baseLanes}function Gf(){ue(Na,Qo),ue(Ol,Ol.current)}function x1(){Qo=Na.current,X(Ol),X(Na)}var Ys=0,dn=null,In=null,wn=null,Ec=!1,Tl=!1,ui=!1,Rc=0,Oa=0,Ss=null,F0=0;function Sn(){throw Error(r(321))}function Iu(i,o){if(o===null)return!1;for(var u=0;u<o.length&&u<i.length;u++)if(!Qi(i[u],o[u]))return!1;return!0}function b1(i,o,u,v,L,O){return Ys=O,dn=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,te.H=i===null||i.memoizedState===null?J0:B1,ui=!1,O=u(v,L),ui=!1,Tl&&(O=I0(o,u,v,L)),H0(i),O}function H0(i){te.H=Ju;var o=In!==null&&In.next!==null;if(Ys=0,wn=In=dn=null,Ec=!1,Oa=0,Ss=null,o)throw Error(r(300));i===null||Kr||(i=i.dependencies,i!==null&&If(i)&&(Kr=!0))}function I0(i,o,u,v){dn=i;var L=0;do{if(Tl&&(Ss=null),Oa=0,Tl=!1,25<=L)throw Error(r(301));if(L+=1,wn=In=null,i.updateQueue!=null){var O=i.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}te.H=ev,O=o(u,v)}while(Tl);return O}function L1(){var i=te.H,o=i.useState()[0];return o=typeof o.then=="function"?$u(o):o,i=i.useState()[0],(In!==null?In.memoizedState:null)!==i&&(dn.flags|=1024),o}function w1(){var i=Rc!==0;return Rc=0,i}function Dl(i,o,u){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~u}function Yf(i){if(Ec){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}Ec=!1}Ys=0,wn=In=dn=null,Tl=!1,Oa=Rc=0,Ss=null}function Ti(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?dn.memoizedState=wn=i:wn=wn.next=i,wn}function kr(){if(In===null){var i=dn.alternate;i=i!==null?i.memoizedState:null}else i=In.next;var o=wn===null?dn.memoizedState:wn.next;if(o!==null)wn=o,In=i;else{if(i===null)throw dn.alternate===null?Error(r(467)):Error(r(310));In=i,i={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},wn===null?dn.memoizedState=wn=i:wn=wn.next=i}return wn}function Al(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $u(i){var o=Oa;return Oa+=1,Ss===null&&(Ss=[]),i=v1(Ss,i,o),o=dn,(wn===null?o.memoizedState:wn.next)===null&&(o=o.alternate,te.H=o===null||o.memoizedState===null?J0:B1),i}function Xf(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return $u(i);if(i.$$typeof===c)return Er(i)}throw Error(r(438,String(i)))}function Vu(i){var o=null,u=dn.updateQueue;if(u!==null&&(o=u.memoCache),o==null){var v=dn.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(o={data:v.data.map(function(L){return L.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),u===null&&(u=Al(),dn.updateQueue=u),u.memoCache=o,u=o.data[o.index],u===void 0)for(u=o.data[o.index]=Array(i),v=0;v<i;v++)u[v]=F;return o.index++,u}function ao(i,o){return typeof o=="function"?o(i):o}function Kf(i){var o=kr();return S1(o,In,i)}function S1(i,o,u){var v=i.queue;if(v===null)throw Error(r(311));v.lastRenderedReducer=u;var L=i.baseQueue,O=v.pending;if(O!==null){if(L!==null){var U=L.next;L.next=O.next,O.next=U}o.baseQueue=L=O,v.pending=null}if(O=i.baseState,L===null)i.memoizedState=O;else{o=L.next;var W=U=null,ie=null,Ne=o,Ie=!1;do{var Ge=Ne.lane&-536870913;if(Ge!==Ne.lane?(Rn&Ge)===Ge:(Ys&Ge)===Ge){var De=Ne.revertLane;if(De===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),Ge===wc&&(Ie=!0);else if((Ys&De)===De){Ne=Ne.next,De===wc&&(Ie=!0);continue}else Ge={lane:0,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ie===null?(W=ie=Ge,U=O):ie=ie.next=Ge,dn.lanes|=De,za|=De;Ge=Ne.action,ui&&u(O,Ge),O=Ne.hasEagerState?Ne.eagerState:u(O,Ge)}else De={lane:Ge,revertLane:Ne.revertLane,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ie===null?(W=ie=De,U=O):ie=ie.next=De,dn.lanes|=Ge,za|=Ge;Ne=Ne.next}while(Ne!==null&&Ne!==o);if(ie===null?U=O:ie.next=W,!Qi(O,i.memoizedState)&&(Kr=!0,Ie&&(u=Oi,u!==null)))throw u;i.memoizedState=O,i.baseState=U,i.baseQueue=ie,v.lastRenderedState=O}return L===null&&(v.lanes=0),[i.memoizedState,v.dispatch]}function C1(i){var o=kr(),u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var v=u.dispatch,L=u.pending,O=o.memoizedState;if(L!==null){u.pending=null;var U=L=L.next;do O=i(O,U.action),U=U.next;while(U!==L);Qi(O,o.memoizedState)||(Kr=!0),o.memoizedState=O,o.baseQueue===null&&(o.baseState=O),u.lastRenderedState=O}return[O,v]}function E1(i,o,u){var v=dn,L=kr(),O=Ln;if(O){if(u===void 0)throw Error(r(407));u=u()}else u=o();var U=!Qi((In||L).memoizedState,u);U&&(L.memoizedState=u,Kr=!0),L=L.queue;var W=Zf.bind(null,v,L,i);if(Gu(2048,8,W,[i]),L.getSnapshot!==o||U||wn!==null&&wn.memoizedState.tag&1){if(v.flags|=2048,_c(9,rh(),$0.bind(null,v,L,u,o),null),ir===null)throw Error(r(349));O||(Ys&124)!==0||Qf(v,o,u)}return u}function Qf(i,o,u){i.flags|=16384,i={getSnapshot:o,value:u},o=dn.updateQueue,o===null?(o=Al(),dn.updateQueue=o,o.stores=[i]):(u=o.stores,u===null?o.stores=[i]:u.push(i))}function $0(i,o,u,v){o.value=u,o.getSnapshot=v,R1(o)&&_1(i)}function Zf(i,o,u){return u(function(){R1(o)&&_1(i)})}function R1(i){var o=i.getSnapshot;i=i.value;try{var u=o();return!Qi(i,u)}catch{return!0}}function _1(i){var o=Ll(i,2);o!==null&&is(o,i,2)}function Jf(i){var o=Ti();if(typeof i=="function"){var u=i;if(i=u(),ui){k(!0);try{u()}finally{k(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:i},o}function qu(i,o,u,v){return i.baseState=u,S1(i,In,typeof v=="function"?v:ao)}function xL(i,o,u,v,L){if(ah(i))throw Error(r(485));if(i=o.action,i!==null){var O={payload:L,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){O.listeners.push(U)}};te.T!==null?u(!0):O.isTransition=!1,v(O),u=o.pending,u===null?(O.next=o.pending=O,M1(o,O)):(O.next=u.next,o.pending=u.next=O)}}function M1(i,o){var u=o.action,v=o.payload,L=i.state;if(o.isTransition){var O=te.T,U={};te.T=U;try{var W=u(L,v),ie=te.S;ie!==null&&ie(U,W),N1(i,o,W)}catch(Ne){eh(i,o,Ne)}finally{te.T=O}}else try{O=u(L,v),N1(i,o,O)}catch(Ne){eh(i,o,Ne)}}function N1(i,o,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(v){V0(i,o,v)},function(v){return eh(i,o,v)}):V0(i,o,u)}function V0(i,o,u){o.status="fulfilled",o.value=u,q0(o),i.state=u,o=i.pending,o!==null&&(u=o.next,u===o?i.pending=null:(u=u.next,o.next=u,M1(i,u)))}function eh(i,o,u){var v=i.pending;if(i.pending=null,v!==null){v=v.next;do o.status="rejected",o.reason=u,q0(o),o=o.next;while(o!==v)}i.action=null}function q0(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function th(i,o){return o}function O1(i,o){if(Ln){var u=ir.formState;if(u!==null){e:{var v=dn;if(Ln){if(fr){t:{for(var L=fr,O=Mi;L.nodeType!==8;){if(!O){L=null;break t}if(L=Qs(L.nextSibling),L===null){L=null;break t}}O=L.data,L=O==="F!"||O==="F"?L:null}if(L){fr=Qs(L.nextSibling),v=L.data==="F!";break e}}Ls(v)}v=!1}v&&(o=u[0])}}return u=Ti(),u.memoizedState=u.baseState=o,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:th,lastRenderedState:o},u.queue=v,u=k1.bind(null,dn,v),v.dispatch=u,v=Jf(!1),O=P1.bind(null,dn,!1,v.queue),v=Ti(),L={state:o,dispatch:null,action:i,pending:null},v.queue=L,u=xL.bind(null,dn,L,O,u),L.dispatch=u,v.memoizedState=i,[o,u,!1]}function nh(i){var o=kr();return W0(o,In,i)}function W0(i,o,u){if(o=S1(i,o,th)[0],i=Kf(ao)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var v=$u(o)}catch(U){throw U===vi?qf:U}else v=o;o=kr();var L=o.queue,O=L.dispatch;return u!==o.memoizedState&&(dn.flags|=2048,_c(9,rh(),T1.bind(null,L,u),null)),[v,O,i]}function T1(i,o){i.action=o}function cn(i){var o=kr(),u=In;if(u!==null)return W0(o,u,i);kr(),o=o.memoizedState,u=kr();var v=u.queue.dispatch;return u.memoizedState=i,[o,v,!1]}function _c(i,o,u,v){return i={tag:i,create:u,deps:v,inst:o,next:null},o=dn.updateQueue,o===null&&(o=Al(),dn.updateQueue=o),u=o.lastEffect,u===null?o.lastEffect=i.next=i:(v=u.next,u.next=i,i.next=v,o.lastEffect=i),i}function rh(){return{destroy:void 0,resource:void 0}}function Mc(){return kr().memoizedState}function Wu(i,o,u,v){var L=Ti();v=v===void 0?null:v,dn.flags|=i,L.memoizedState=_c(1|o,rh(),u,v)}function Gu(i,o,u,v){var L=kr();v=v===void 0?null:v;var O=L.memoizedState.inst;In!==null&&v!==null&&Iu(v,In.memoizedState.deps)?L.memoizedState=_c(o,O,u,v):(dn.flags|=i,L.memoizedState=_c(1|o,O,u,v))}function G0(i,o){Wu(8390656,8,i,o)}function es(i,o){Gu(2048,8,i,o)}function Y0(i,o){return Gu(4,2,i,o)}function Yu(i,o){return Gu(4,4,i,o)}function ih(i,o){if(typeof o=="function"){i=i();var u=o(i);return function(){typeof u=="function"?u():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function D1(i,o,u){u=u!=null?u.concat([i]):null,Gu(4,4,ih.bind(null,o,i),u)}function sh(){}function Di(i,o){var u=kr();o=o===void 0?null:o;var v=u.memoizedState;return o!==null&&Iu(o,v[1])?v[0]:(u.memoizedState=[i,o],i)}function $o(i,o){var u=kr();o=o===void 0?null:o;var v=u.memoizedState;if(o!==null&&Iu(o,v[1]))return v[0];if(v=i(),ui){k(!0);try{i()}finally{k(!1)}}return u.memoizedState=[v,o],v}function Xu(i,o,u){return u===void 0||(Ys&1073741824)!==0?i.memoizedState=o:(i.memoizedState=u,i=_v(),dn.lanes|=i,za|=i,u)}function A1(i,o,u,v){return Qi(u,o)?u:Ol.current!==null?(i=Xu(i,u,v),Qi(i,o)||(Kr=!0),i):(Ys&42)===0?(Kr=!0,i.memoizedState=u):(i=_v(),dn.lanes|=i,za|=i,o)}function Ku(i,o,u,v,L){var O=K.p;K.p=O!==0&&8>O?O:8;var U=te.T,W={};te.T=W,P1(i,!1,o,u);try{var ie=L(),Ne=te.S;if(Ne!==null&&Ne(W,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Ie=yL(ie,v);jl(i,o,Ie,fi(i))}else jl(i,o,v,fi(i))}catch(Ge){jl(i,o,{then:function(){},status:"rejected",reason:Ge},fi())}finally{K.p=O,te.T=U}}function X0(){}function Qu(i,o,u,v){if(i.tag!==5)throw Error(r(476));var L=j1(i).queue;Ku(i,L,o,Z,u===null?X0:function(){return oh(i),u(v)})}function j1(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:Z},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:u},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function oh(i){var o=j1(i).next.queue;jl(i,o,{},fi())}function Zu(){return Er(Xc)}function Vo(){return kr().memoizedState}function K0(){return kr().memoizedState}function Ta(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var u=fi();i=Ma(u);var v=Ho(o,i,u);v!==null&&(is(v,o,u),Fu(v,o,u)),o={cache:m1()},i.payload=o;return}o=o.return}}function Q0(i,o,u){var v=fi();u={lane:v,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},ah(i)?Z0(o,u):(u=xc(i,o,u,v),u!==null&&(is(u,i,v),z1(u,o,v)))}function k1(i,o,u){var v=fi();jl(i,o,u,v)}function jl(i,o,u,v){var L={lane:v,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(ah(i))Z0(o,L);else{var O=i.alternate;if(i.lanes===0&&(O===null||O.lanes===0)&&(O=o.lastRenderedReducer,O!==null))try{var U=o.lastRenderedState,W=O(U,u);if(L.hasEagerState=!0,L.eagerState=W,Qi(W,U))return Vs(i,o,L,0),ir===null&&bl(),!1}catch{}finally{}if(u=xc(i,o,L,v),u!==null)return is(u,i,v),z1(u,o,v),!0}return!1}function P1(i,o,u,v){if(v={lane:2,revertLane:Nh(),action:v,hasEagerState:!1,eagerState:null,next:null},ah(i)){if(o)throw Error(r(479))}else o=xc(i,u,v,2),o!==null&&is(o,i,2)}function ah(i){var o=i.alternate;return i===dn||o!==null&&o===dn}function Z0(i,o){Tl=Ec=!0;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}function z1(i,o,u){if((u&4194048)!==0){var v=o.lanes;v&=i.pendingLanes,u|=v,o.lanes=u,Pt(i,u)}}var Ju={readContext:Er,use:Xf,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn},J0={readContext:Er,use:Xf,useCallback:function(i,o){return Ti().memoizedState=[i,o===void 0?null:o],i},useContext:Er,useEffect:G0,useImperativeHandle:function(i,o,u){u=u!=null?u.concat([i]):null,Wu(4194308,4,ih.bind(null,o,i),u)},useLayoutEffect:function(i,o){return Wu(4194308,4,i,o)},useInsertionEffect:function(i,o){Wu(4,2,i,o)},useMemo:function(i,o){var u=Ti();o=o===void 0?null:o;var v=i();if(ui){k(!0);try{i()}finally{k(!1)}}return u.memoizedState=[v,o],v},useReducer:function(i,o,u){var v=Ti();if(u!==void 0){var L=u(o);if(ui){k(!0);try{u(o)}finally{k(!1)}}}else L=o;return v.memoizedState=v.baseState=L,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:L},v.queue=i,i=i.dispatch=Q0.bind(null,dn,i),[v.memoizedState,i]},useRef:function(i){var o=Ti();return i={current:i},o.memoizedState=i},useState:function(i){i=Jf(i);var o=i.queue,u=k1.bind(null,dn,o);return o.dispatch=u,[i.memoizedState,u]},useDebugValue:sh,useDeferredValue:function(i,o){var u=Ti();return Xu(u,i,o)},useTransition:function(){var i=Jf(!1);return i=Ku.bind(null,dn,i.queue,!0,!1),Ti().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,u){var v=dn,L=Ti();if(Ln){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),ir===null)throw Error(r(349));(Rn&124)!==0||Qf(v,o,u)}L.memoizedState=u;var O={value:u,getSnapshot:o};return L.queue=O,G0(Zf.bind(null,v,O,i),[i]),v.flags|=2048,_c(9,rh(),$0.bind(null,v,O,u,o),null),u},useId:function(){var i=Ti(),o=ir.identifierPrefix;if(Ln){var u=Uo,v=dr;u=(v&~(1<<32-z(v)-1)).toString(32)+u,o="«"+o+"R"+u,u=Rc++,0<u&&(o+="H"+u.toString(32)),o+="»"}else u=F0++,o="«"+o+"r"+u.toString(32)+"»";return i.memoizedState=o},useHostTransitionStatus:Zu,useFormState:O1,useActionState:O1,useOptimistic:function(i){var o=Ti();o.memoizedState=o.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=u,o=P1.bind(null,dn,!0,u),u.dispatch=o,[i,o]},useMemoCache:Vu,useCacheRefresh:function(){return Ti().memoizedState=Ta.bind(null,dn)}},B1={readContext:Er,use:Xf,useCallback:Di,useContext:Er,useEffect:es,useImperativeHandle:D1,useInsertionEffect:Y0,useLayoutEffect:Yu,useMemo:$o,useReducer:Kf,useRef:Mc,useState:function(){return Kf(ao)},useDebugValue:sh,useDeferredValue:function(i,o){var u=kr();return A1(u,In.memoizedState,i,o)},useTransition:function(){var i=Kf(ao)[0],o=kr().memoizedState;return[typeof i=="boolean"?i:$u(i),o]},useSyncExternalStore:E1,useId:Vo,useHostTransitionStatus:Zu,useFormState:nh,useActionState:nh,useOptimistic:function(i,o){var u=kr();return qu(u,In,i,o)},useMemoCache:Vu,useCacheRefresh:K0},ev={readContext:Er,use:Xf,useCallback:Di,useContext:Er,useEffect:es,useImperativeHandle:D1,useInsertionEffect:Y0,useLayoutEffect:Yu,useMemo:$o,useReducer:C1,useRef:Mc,useState:function(){return C1(ao)},useDebugValue:sh,useDeferredValue:function(i,o){var u=kr();return In===null?Xu(u,i,o):A1(u,In.memoizedState,i,o)},useTransition:function(){var i=C1(ao)[0],o=kr().memoizedState;return[typeof i=="boolean"?i:$u(i),o]},useSyncExternalStore:E1,useId:Vo,useHostTransitionStatus:Zu,useFormState:cn,useActionState:cn,useOptimistic:function(i,o){var u=kr();return In!==null?qu(u,In,i,o):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Vu,useCacheRefresh:K0},Ur=null,Ai=0;function lh(i){var o=Ai;return Ai+=1,Ur===null&&(Ur=[]),v1(Ur,i,o)}function ed(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function kl(i,o){throw o.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function Pl(i){var o=i._init;return o(i._payload)}function U1(i){function o(Le,me){if(i){var _e=Le.deletions;_e===null?(Le.deletions=[me],Le.flags|=16):_e.push(me)}}function u(Le,me){if(!i)return null;for(;me!==null;)o(Le,me),me=me.sibling;return null}function v(Le){for(var me=new Map;Le!==null;)Le.key!==null?me.set(Le.key,Le):me.set(Le.index,Le),Le=Le.sibling;return me}function L(Le,me){return Le=gi(Le,me),Le.index=0,Le.sibling=null,Le}function O(Le,me,_e){return Le.index=_e,i?(_e=Le.alternate,_e!==null?(_e=_e.index,_e<me?(Le.flags|=67108866,me):_e):(Le.flags|=67108866,me)):(Le.flags|=1048576,me)}function U(Le){return i&&Le.alternate===null&&(Le.flags|=67108866),Le}function W(Le,me,_e,Ve){return me===null||me.tag!==6?(me=d1(_e,Le.mode,Ve),me.return=Le,me):(me=L(me,_e),me.return=Le,me)}function ie(Le,me,_e,Ve){var yt=_e.type;return yt===M?Ie(Le,me,_e.props.children,Ve,_e.key):me!==null&&(me.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===A&&Pl(yt)===me.type)?(me=L(me,_e.props),ed(me,_e),me.return=Le,me):(me=Ff(_e.type,_e.key,_e.props,null,Le.mode,Ve),ed(me,_e),me.return=Le,me)}function Ne(Le,me,_e,Ve){return me===null||me.tag!==4||me.stateNode.containerInfo!==_e.containerInfo||me.stateNode.implementation!==_e.implementation?(me=bc(_e,Le.mode,Ve),me.return=Le,me):(me=L(me,_e.children||[]),me.return=Le,me)}function Ie(Le,me,_e,Ve,yt){return me===null||me.tag!==7?(me=Cl(_e,Le.mode,Ve,yt),me.return=Le,me):(me=L(me,_e),me.return=Le,me)}function Ge(Le,me,_e){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return me=d1(""+me,Le.mode,_e),me.return=Le,me;if(typeof me=="object"&&me!==null){switch(me.$$typeof){case w:return _e=Ff(me.type,me.key,me.props,null,Le.mode,_e),ed(_e,me),_e.return=Le,_e;case E:return me=bc(me,Le.mode,_e),me.return=Le,me;case A:var Ve=me._init;return me=Ve(me._payload),Ge(Le,me,_e)}if(Ce(me)||ee(me))return me=Cl(me,Le.mode,_e,null),me.return=Le,me;if(typeof me.then=="function")return Ge(Le,lh(me),_e);if(me.$$typeof===c)return Ge(Le,$f(Le,me),_e);kl(Le,me)}return null}function De(Le,me,_e,Ve){var yt=me!==null?me.key:null;if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return yt!==null?null:W(Le,me,""+_e,Ve);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case w:return _e.key===yt?ie(Le,me,_e,Ve):null;case E:return _e.key===yt?Ne(Le,me,_e,Ve):null;case A:return yt=_e._init,_e=yt(_e._payload),De(Le,me,_e,Ve)}if(Ce(_e)||ee(_e))return yt!==null?null:Ie(Le,me,_e,Ve,null);if(typeof _e.then=="function")return De(Le,me,lh(_e),Ve);if(_e.$$typeof===c)return De(Le,me,$f(Le,_e),Ve);kl(Le,_e)}return null}function Oe(Le,me,_e,Ve,yt){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number"||typeof Ve=="bigint")return Le=Le.get(_e)||null,W(me,Le,""+Ve,yt);if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case w:return Le=Le.get(Ve.key===null?_e:Ve.key)||null,ie(me,Le,Ve,yt);case E:return Le=Le.get(Ve.key===null?_e:Ve.key)||null,Ne(me,Le,Ve,yt);case A:var mn=Ve._init;return Ve=mn(Ve._payload),Oe(Le,me,_e,Ve,yt)}if(Ce(Ve)||ee(Ve))return Le=Le.get(_e)||null,Ie(me,Le,Ve,yt,null);if(typeof Ve.then=="function")return Oe(Le,me,_e,lh(Ve),yt);if(Ve.$$typeof===c)return Oe(Le,me,_e,$f(me,Ve),yt);kl(me,Ve)}return null}function Ht(Le,me,_e,Ve){for(var yt=null,mn=null,At=me,It=me=0,Jr=null;At!==null&&It<_e.length;It++){At.index>It?(Jr=At,At=null):Jr=At.sibling;var On=De(Le,At,_e[It],Ve);if(On===null){At===null&&(At=Jr);break}i&&At&&On.alternate===null&&o(Le,At),me=O(On,me,It),mn===null?yt=On:mn.sibling=On,mn=On,At=Jr}if(It===_e.length)return u(Le,At),Ln&&El(Le,It),yt;if(At===null){for(;It<_e.length;It++)At=Ge(Le,_e[It],Ve),At!==null&&(me=O(At,me,It),mn===null?yt=At:mn.sibling=At,mn=At);return Ln&&El(Le,It),yt}for(At=v(At);It<_e.length;It++)Jr=Oe(At,Le,It,_e[It],Ve),Jr!==null&&(i&&Jr.alternate!==null&&At.delete(Jr.key===null?It:Jr.key),me=O(Jr,me,It),mn===null?yt=Jr:mn.sibling=Jr,mn=Jr);return i&&At.forEach(function(Ga){return o(Le,Ga)}),Ln&&El(Le,It),yt}function Ut(Le,me,_e,Ve){if(_e==null)throw Error(r(151));for(var yt=null,mn=null,At=me,It=me=0,Jr=null,On=_e.next();At!==null&&!On.done;It++,On=_e.next()){At.index>It?(Jr=At,At=null):Jr=At.sibling;var Ga=De(Le,At,On.value,Ve);if(Ga===null){At===null&&(At=Jr);break}i&&At&&Ga.alternate===null&&o(Le,At),me=O(Ga,me,It),mn===null?yt=Ga:mn.sibling=Ga,mn=Ga,At=Jr}if(On.done)return u(Le,At),Ln&&El(Le,It),yt;if(At===null){for(;!On.done;It++,On=_e.next())On=Ge(Le,On.value,Ve),On!==null&&(me=O(On,me,It),mn===null?yt=On:mn.sibling=On,mn=On);return Ln&&El(Le,It),yt}for(At=v(At);!On.done;It++,On=_e.next())On=Oe(At,Le,It,On.value,Ve),On!==null&&(i&&On.alternate!==null&&At.delete(On.key===null?It:On.key),me=O(On,me,It),mn===null?yt=On:mn.sibling=On,mn=On);return i&&At.forEach(function(t2){return o(Le,t2)}),Ln&&El(Le,It),yt}function Xn(Le,me,_e,Ve){if(typeof _e=="object"&&_e!==null&&_e.type===M&&_e.key===null&&(_e=_e.props.children),typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case w:e:{for(var yt=_e.key;me!==null;){if(me.key===yt){if(yt=_e.type,yt===M){if(me.tag===7){u(Le,me.sibling),Ve=L(me,_e.props.children),Ve.return=Le,Le=Ve;break e}}else if(me.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===A&&Pl(yt)===me.type){u(Le,me.sibling),Ve=L(me,_e.props),ed(Ve,_e),Ve.return=Le,Le=Ve;break e}u(Le,me);break}else o(Le,me);me=me.sibling}_e.type===M?(Ve=Cl(_e.props.children,Le.mode,Ve,_e.key),Ve.return=Le,Le=Ve):(Ve=Ff(_e.type,_e.key,_e.props,null,Le.mode,Ve),ed(Ve,_e),Ve.return=Le,Le=Ve)}return U(Le);case E:e:{for(yt=_e.key;me!==null;){if(me.key===yt)if(me.tag===4&&me.stateNode.containerInfo===_e.containerInfo&&me.stateNode.implementation===_e.implementation){u(Le,me.sibling),Ve=L(me,_e.children||[]),Ve.return=Le,Le=Ve;break e}else{u(Le,me);break}else o(Le,me);me=me.sibling}Ve=bc(_e,Le.mode,Ve),Ve.return=Le,Le=Ve}return U(Le);case A:return yt=_e._init,_e=yt(_e._payload),Xn(Le,me,_e,Ve)}if(Ce(_e))return Ht(Le,me,_e,Ve);if(ee(_e)){if(yt=ee(_e),typeof yt!="function")throw Error(r(150));return _e=yt.call(_e),Ut(Le,me,_e,Ve)}if(typeof _e.then=="function")return Xn(Le,me,lh(_e),Ve);if(_e.$$typeof===c)return Xn(Le,me,$f(Le,_e),Ve);kl(Le,_e)}return typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint"?(_e=""+_e,me!==null&&me.tag===6?(u(Le,me.sibling),Ve=L(me,_e),Ve.return=Le,Le=Ve):(u(Le,me),Ve=d1(_e,Le.mode,Ve),Ve.return=Le,Le=Ve),U(Le)):u(Le,me)}return function(Le,me,_e,Ve){try{Ai=0;var yt=Xn(Le,me,_e,Ve);return Ur=null,yt}catch(At){if(At===vi||At===qf)throw At;var mn=_i(29,At,null,Le.mode);return mn.lanes=Ve,mn.return=Le,mn}finally{}}}var zl=U1(!0),tv=U1(!1),ts=ne(null),yi=null;function Cs(i){var o=i.alternate;ue(Rr,Rr.current&1),ue(ts,i),yi===null&&(o===null||Ol.current!==null||o.memoizedState!==null)&&(yi=i)}function nv(i){if(i.tag===22){if(ue(Rr,Rr.current),ue(ts,i),yi===null){var o=i.alternate;o!==null&&o.memoizedState!==null&&(yi=i)}}else qo()}function qo(){ue(Rr,Rr.current),ue(ts,ts.current)}function lo(i){X(ts),yi===i&&(yi=null),X(Rr)}var Rr=ne(0);function td(i){for(var o=i;o!==null;){if(o.tag===13){var u=o.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||bi(u)))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}function Nc(i,o,u,v){o=i.memoizedState,u=u(v,o),u=u==null?o:x({},o,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var nd={enqueueSetState:function(i,o,u){i=i._reactInternals;var v=fi(),L=Ma(v);L.payload=o,u!=null&&(L.callback=u),o=Ho(i,L,v),o!==null&&(is(o,i,v),Fu(o,i,v))},enqueueReplaceState:function(i,o,u){i=i._reactInternals;var v=fi(),L=Ma(v);L.tag=1,L.payload=o,u!=null&&(L.callback=u),o=Ho(i,L,v),o!==null&&(is(o,i,v),Fu(o,i,v))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var u=fi(),v=Ma(u);v.tag=2,o!=null&&(v.callback=o),o=Ho(i,v,u),o!==null&&(is(o,i,u),Fu(o,i,u))}};function rd(i,o,u,v,L,O,U){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(v,O,U):o.prototype&&o.prototype.isPureReactComponent?!so(u,v)||!so(L,O):!0}function rv(i,o,u,v){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(u,v),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(u,v),o.state!==i&&nd.enqueueReplaceState(o,o.state,null)}function Da(i,o){var u=o;if("ref"in o){u={};for(var v in o)v!=="ref"&&(u[v]=o[v])}if(i=i.defaultProps){u===o&&(u=x({},u));for(var L in i)u[L]===void 0&&(u[L]=i[L])}return u}var Bl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function F1(i){Bl(i)}function ch(i){console.error(i)}function iv(i){Bl(i)}function id(i,o){try{var u=i.onUncaughtError;u(o.value,{componentStack:o.stack})}catch(v){setTimeout(function(){throw v})}}function co(i,o,u){try{var v=i.onCaughtError;v(u.value,{componentStack:u.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(L){setTimeout(function(){throw L})}}function uh(i,o,u){return u=Ma(u),u.tag=3,u.payload={element:null},u.callback=function(){id(i,o)},u}function H1(i){return i=Ma(i),i.tag=3,i}function sv(i,o,u,v){var L=u.type.getDerivedStateFromError;if(typeof L=="function"){var O=v.value;i.payload=function(){return L(O)},i.callback=function(){co(o,u,v)}}var U=u.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(i.callback=function(){co(o,u,v),typeof L!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var W=v.stack;this.componentDidCatch(v.value,{componentStack:W!==null?W:""})})}function ov(i,o,u,v,L){if(u.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(o=u.alternate,o!==null&&zu(o,u,L,!0),u=ts.current,u!==null){switch(u.tag){case 13:return yi===null?op():u.alternate===null&&_r===0&&(_r=3),u.flags&=-257,u.flags|=65536,u.lanes=L,v===g1?u.flags|=16384:(o=u.updateQueue,o===null?u.updateQueue=new Set([v]):o.add(v),cp(i,v,L)),!1;case 22:return u.flags|=65536,v===g1?u.flags|=16384:(o=u.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([v])},u.updateQueue=o):(u=o.retryQueue,u===null?o.retryQueue=new Set([v]):u.add(v)),cp(i,v,L)),!1}throw Error(r(435,u.tag))}return cp(i,v,L),op(),!1}if(Ln)return o=ts.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=L,v!==Lc&&(i=Error(r(422),{cause:v}),Ra(pi(i,u)))):(v!==Lc&&(o=Error(r(423),{cause:v}),Ra(pi(o,u))),i=i.current.alternate,i.flags|=65536,L&=-L,i.lanes|=L,v=pi(v,u),L=uh(i.stateNode,v,L),Ws(i,L),_r!==4&&(_r=2)),!1;var O=Error(r(520),{cause:v});if(O=pi(O,u),md===null?md=[O]:md.push(O),_r!==4&&(_r=2),o===null)return!0;v=pi(v,u),u=o;do{switch(u.tag){case 3:return u.flags|=65536,i=L&-L,u.lanes|=i,i=uh(u.stateNode,v,i),Ws(u,i),!1;case 1:if(o=u.type,O=u.stateNode,(u.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Ba===null||!Ba.has(O))))return u.flags|=65536,L&=-L,u.lanes|=L,L=H1(L),sv(L,i,u,v),Ws(u,L),!1}u=u.return}while(u!==null);return!1}var av=Error(r(461)),Kr=!1;function ar(i,o,u,v){o.child=i===null?tv(o,null,u,v):zl(o,i.child,u,v)}function dh(i,o,u,v,L){u=u.render;var O=o.ref;if("ref"in v){var U={};for(var W in v)W!=="ref"&&(U[W]=v[W])}else U=v;return _l(o),v=b1(i,o,u,U,O,L),W=w1(),i!==null&&!Kr?(Dl(i,o,L),Wo(i,o,L)):(Ln&&W&&h1(o),o.flags|=1,ar(i,o,v,L),o.child)}function fh(i,o,u,v,L){if(i===null){var O=u.type;return typeof O=="function"&&!Sl(O)&&O.defaultProps===void 0&&u.compare===null?(o.tag=15,o.type=O,hh(i,o,O,v,L)):(i=Ff(u.type,null,v,o,o.mode,L),i.ref=o.ref,i.return=o,o.child=i)}if(O=i.child,!Xs(i,L)){var U=O.memoizedProps;if(u=u.compare,u=u!==null?u:so,u(U,v)&&i.ref===o.ref)return Wo(i,o,L)}return o.flags|=1,i=gi(O,v),i.ref=o.ref,i.return=o,o.child=i}function hh(i,o,u,v,L){if(i!==null){var O=i.memoizedProps;if(so(O,v)&&i.ref===o.ref)if(Kr=!1,o.pendingProps=v=O,Xs(i,L))(i.flags&131072)!==0&&(Kr=!0);else return o.lanes=i.lanes,Wo(i,o,L)}return Oc(i,o,u,v,L)}function sd(i,o,u){var v=o.pendingProps,L=v.children,O=i!==null?i.memoizedState:null;if(v.mode==="hidden"){if((o.flags&128)!==0){if(v=O!==null?O.baseLanes|u:u,i!==null){for(L=o.child=i.child,O=0;L!==null;)O=O|L.lanes|L.childLanes,L=L.sibling;o.childLanes=O&~v}else o.childLanes=0,o.child=null;return Ul(i,o,v,u)}if((u&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Vf(o,O!==null?O.cachePool:null),O!==null?Io(o,O):Gf(),nv(o);else return o.lanes=o.childLanes=536870912,Ul(i,o,O!==null?O.baseLanes|u:u,u)}else O!==null?(Vf(o,O.cachePool),Io(o,O),qo(),o.memoizedState=null):(i!==null&&Vf(o,null),Gf(),qo());return ar(i,o,L,u),o.child}function Ul(i,o,u,v){var L=Fo();return L=L===null?null:{parent:er._currentValue,pool:L},o.memoizedState={baseLanes:u,cachePool:L},i!==null&&Vf(o,null),Gf(),nv(o),i!==null&&zu(i,o,v,!0),null}function zt(i,o){var u=o.ref;if(u===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(o.flags|=4194816)}}function Oc(i,o,u,v,L){return _l(o),u=b1(i,o,u,v,void 0,L),v=w1(),i!==null&&!Kr?(Dl(i,o,L),Wo(i,o,L)):(Ln&&v&&h1(o),o.flags|=1,ar(i,o,u,L),o.child)}function mh(i,o,u,v,L,O){return _l(o),o.updateQueue=null,u=I0(o,v,u,L),H0(i),v=w1(),i!==null&&!Kr?(Dl(i,o,O),Wo(i,o,O)):(Ln&&v&&h1(o),o.flags|=1,ar(i,o,u,O),o.child)}function Aa(i,o,u,v,L){if(_l(o),o.stateNode===null){var O=wl,U=u.contextType;typeof U=="object"&&U!==null&&(O=Er(U)),O=new u(v,O),o.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=nd,o.stateNode=O,O._reactInternals=o,O=o.stateNode,O.props=v,O.state=o.memoizedState,O.refs={},Nl(o),U=u.contextType,O.context=typeof U=="object"&&U!==null?Er(U):wl,O.state=o.memoizedState,U=u.getDerivedStateFromProps,typeof U=="function"&&(Nc(o,u,U,v),O.state=o.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(U=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),U!==O.state&&nd.enqueueReplaceState(O,O.state,null),ci(o,v,O,L),Gs(),O.state=o.memoizedState),typeof O.componentDidMount=="function"&&(o.flags|=4194308),v=!0}else if(i===null){O=o.stateNode;var W=o.memoizedProps,ie=Da(u,W);O.props=ie;var Ne=O.context,Ie=u.contextType;U=wl,typeof Ie=="object"&&Ie!==null&&(U=Er(Ie));var Ge=u.getDerivedStateFromProps;Ie=typeof Ge=="function"||typeof O.getSnapshotBeforeUpdate=="function",W=o.pendingProps!==W,Ie||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(W||Ne!==U)&&rv(o,O,v,U),oo=!1;var De=o.memoizedState;O.state=De,ci(o,v,O,L),Gs(),Ne=o.memoizedState,W||De!==Ne||oo?(typeof Ge=="function"&&(Nc(o,u,Ge,v),Ne=o.memoizedState),(ie=oo||rd(o,u,ie,v,De,Ne,U))?(Ie||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(o.flags|=4194308)):(typeof O.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=v,o.memoizedState=Ne),O.props=v,O.state=Ne,O.context=U,v=ie):(typeof O.componentDidMount=="function"&&(o.flags|=4194308),v=!1)}else{O=o.stateNode,Cc(i,o),U=o.memoizedProps,Ie=Da(u,U),O.props=Ie,Ge=o.pendingProps,De=O.context,Ne=u.contextType,ie=wl,typeof Ne=="object"&&Ne!==null&&(ie=Er(Ne)),W=u.getDerivedStateFromProps,(Ne=typeof W=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==Ge||De!==ie)&&rv(o,O,v,ie),oo=!1,De=o.memoizedState,O.state=De,ci(o,v,O,L),Gs();var Oe=o.memoizedState;U!==Ge||De!==Oe||oo||i!==null&&i.dependencies!==null&&If(i.dependencies)?(typeof W=="function"&&(Nc(o,u,W,v),Oe=o.memoizedState),(Ie=oo||rd(o,u,Ie,v,De,Oe,ie)||i!==null&&i.dependencies!==null&&If(i.dependencies))?(Ne||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(v,Oe,ie),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(v,Oe,ie)),typeof O.componentDidUpdate=="function"&&(o.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof O.componentDidUpdate!="function"||U===i.memoizedProps&&De===i.memoizedState||(o.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&De===i.memoizedState||(o.flags|=1024),o.memoizedProps=v,o.memoizedState=Oe),O.props=v,O.state=Oe,O.context=ie,v=Ie):(typeof O.componentDidUpdate!="function"||U===i.memoizedProps&&De===i.memoizedState||(o.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===i.memoizedProps&&De===i.memoizedState||(o.flags|=1024),v=!1)}return O=v,zt(i,o),v=(o.flags&128)!==0,O||v?(O=o.stateNode,u=v&&typeof u.getDerivedStateFromError!="function"?null:O.render(),o.flags|=1,i!==null&&v?(o.child=zl(o,i.child,null,L),o.child=zl(o,null,u,L)):ar(i,o,u,L),o.memoizedState=O.state,i=o.child):i=Wo(i,o,L),i}function lv(i,o,u,v){return Pu(),o.flags|=256,ar(i,o,u,v),o.child}var od={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ph(i){return{baseLanes:i,cachePool:j0()}}function Qr(i,o,u){return i=i!==null?i.childLanes&~u:0,o&&(i|=Rs),i}function cv(i,o,u){var v=o.pendingProps,L=!1,O=(o.flags&128)!==0,U;if((U=O)||(U=i!==null&&i.memoizedState===null?!1:(Rr.current&2)!==0),U&&(L=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,i===null){if(Ln){if(L?Cs(o):qo(),Ln){var W=fr,ie;if(ie=W){e:{for(ie=W,W=Mi;ie.nodeType!==8;){if(!W){W=null;break e}if(ie=Qs(ie.nextSibling),ie===null){W=null;break e}}W=ie}W!==null?(o.memoizedState={dehydrated:W,treeContext:or!==null?{id:dr,overflow:Uo}:null,retryLane:536870912,hydrationErrors:null},ie=_i(18,null,null,0),ie.stateNode=W,ie.return=o,o.child=ie,Br=o,fr=null,ie=!0):ie=!1}ie||Ls(o)}if(W=o.memoizedState,W!==null&&(W=W.dehydrated,W!==null))return bi(W)?o.lanes=32:o.lanes=536870912,null;lo(o)}return W=v.children,v=v.fallback,L?(qo(),L=o.mode,W=ad({mode:"hidden",children:W},L),v=Cl(v,L,u,null),W.return=o,v.return=o,W.sibling=v,o.child=W,L=o.child,L.memoizedState=ph(u),L.childLanes=Qr(i,U,u),o.memoizedState=od,v):(Cs(o),I1(o,W))}if(ie=i.memoizedState,ie!==null&&(W=ie.dehydrated,W!==null)){if(O)o.flags&256?(Cs(o),o.flags&=-257,o=$1(i,o,u)):o.memoizedState!==null?(qo(),o.child=i.child,o.flags|=128,o=null):(qo(),L=v.fallback,W=o.mode,v=ad({mode:"visible",children:v.children},W),L=Cl(L,W,u,null),L.flags|=2,v.return=o,L.return=o,v.sibling=L,o.child=v,zl(o,i.child,null,u),v=o.child,v.memoizedState=ph(u),v.childLanes=Qr(i,U,u),o.memoizedState=od,o=L);else if(Cs(o),bi(W)){if(U=W.nextSibling&&W.nextSibling.dataset,U)var Ne=U.dgst;U=Ne,v=Error(r(419)),v.stack="",v.digest=U,Ra({value:v,source:null,stack:null}),o=$1(i,o,u)}else if(Kr||zu(i,o,u,!1),U=(u&i.childLanes)!==0,Kr||U){if(U=ir,U!==null&&(v=u&-u,v=(v&42)!==0?1:Wt(v),v=(v&(U.suspendedLanes|u))!==0?0:v,v!==0&&v!==ie.retryLane))throw ie.retryLane=v,Ll(i,v),is(U,i,v),av;W.data==="$?"||op(),o=$1(i,o,u)}else W.data==="$?"?(o.flags|=192,o.child=i.child,o=null):(i=ie.treeContext,fr=Qs(W.nextSibling),Br=o,Ln=!0,qs=null,Mi=!1,i!==null&&(xs[bs++]=dr,xs[bs++]=Uo,xs[bs++]=or,dr=i.id,Uo=i.overflow,or=o),o=I1(o,v.children),o.flags|=4096);return o}return L?(qo(),L=v.fallback,W=o.mode,ie=i.child,Ne=ie.sibling,v=gi(ie,{mode:"hidden",children:v.children}),v.subtreeFlags=ie.subtreeFlags&65011712,Ne!==null?L=gi(Ne,L):(L=Cl(L,W,u,null),L.flags|=2),L.return=o,v.return=o,v.sibling=L,o.child=v,v=L,L=o.child,W=i.child.memoizedState,W===null?W=ph(u):(ie=W.cachePool,ie!==null?(Ne=er._currentValue,ie=ie.parent!==Ne?{parent:Ne,pool:Ne}:ie):ie=j0(),W={baseLanes:W.baseLanes|u,cachePool:ie}),L.memoizedState=W,L.childLanes=Qr(i,U,u),o.memoizedState=od,v):(Cs(o),u=i.child,i=u.sibling,u=gi(u,{mode:"visible",children:v.children}),u.return=o,u.sibling=null,i!==null&&(U=o.deletions,U===null?(o.deletions=[i],o.flags|=16):U.push(i)),o.child=u,o.memoizedState=null,u)}function I1(i,o){return o=ad({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function ad(i,o){return i=_i(22,i,null,o),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function $1(i,o,u){return zl(o,i.child,null,u),i=I1(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function V1(i,o,u){i.lanes|=o;var v=i.alternate;v!==null&&(v.lanes|=o),Ni(i.return,o,u)}function q1(i,o,u,v,L){var O=i.memoizedState;O===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:v,tail:u,tailMode:L}:(O.isBackwards=o,O.rendering=null,O.renderingStartTime=0,O.last=v,O.tail=u,O.tailMode=L)}function uv(i,o,u){var v=o.pendingProps,L=v.revealOrder,O=v.tail;if(ar(i,o,v.children,u),v=Rr.current,(v&2)!==0)v=v&1|2,o.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&V1(i,u,o);else if(i.tag===19)V1(i,u,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}v&=1}switch(ue(Rr,v),L){case"forwards":for(u=o.child,L=null;u!==null;)i=u.alternate,i!==null&&td(i)===null&&(L=u),u=u.sibling;u=L,u===null?(L=o.child,o.child=null):(L=u.sibling,u.sibling=null),q1(o,!1,L,u,O);break;case"backwards":for(u=null,L=o.child,o.child=null;L!==null;){if(i=L.alternate,i!==null&&td(i)===null){o.child=L;break}i=L.sibling,L.sibling=u,u=L,L=i}q1(o,!0,u,null,O);break;case"together":q1(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function Wo(i,o,u){if(i!==null&&(o.dependencies=i.dependencies),za|=o.lanes,(u&o.childLanes)===0)if(i!==null){if(zu(i,o,u,!1),(u&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,u=gi(i,i.pendingProps),o.child=u,u.return=o;i.sibling!==null;)i=i.sibling,u=u.sibling=gi(i,i.pendingProps),u.return=o;u.sibling=null}return o.child}function Xs(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&If(i)))}function xi(i,o,u){switch(o.tag){case 3:ve(o,o.stateNode.containerInfo),Ji(o,er,i.memoizedState.cache),Pu();break;case 27:case 5:de(o);break;case 4:ve(o,o.stateNode.containerInfo);break;case 10:Ji(o,o.type,o.memoizedProps.value);break;case 13:var v=o.memoizedState;if(v!==null)return v.dehydrated!==null?(Cs(o),o.flags|=128,null):(u&o.child.childLanes)!==0?cv(i,o,u):(Cs(o),i=Wo(i,o,u),i!==null?i.sibling:null);Cs(o);break;case 19:var L=(i.flags&128)!==0;if(v=(u&o.childLanes)!==0,v||(zu(i,o,u,!1),v=(u&o.childLanes)!==0),L){if(v)return uv(i,o,u);o.flags|=128}if(L=o.memoizedState,L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),ue(Rr,Rr.current),v)break;return null;case 22:case 23:return o.lanes=0,sd(i,o,u);case 24:Ji(o,er,i.memoizedState.cache)}return Wo(i,o,u)}function gh(i,o,u){if(i!==null)if(i.memoizedProps!==o.pendingProps)Kr=!0;else{if(!Xs(i,u)&&(o.flags&128)===0)return Kr=!1,xi(i,o,u);Kr=(i.flags&131072)!==0}else Kr=!1,Ln&&(o.flags&1048576)!==0&&f1(o,Au,o.index);switch(o.lanes=0,o.tag){case 16:e:{i=o.pendingProps;var v=o.elementType,L=v._init;if(v=L(v._payload),o.type=v,typeof v=="function")Sl(v)?(i=Da(v,i),o.tag=1,o=Aa(null,o,v,i,u)):(o.tag=0,o=Oc(null,o,v,i,u));else{if(v!=null){if(L=v.$$typeof,L===j){o.tag=11,o=dh(null,o,v,i,u);break e}else if(L===T){o.tag=14,o=fh(null,o,v,i,u);break e}}throw o=se(v)||v,Error(r(306,o,""))}}return o;case 0:return Oc(i,o,o.type,o.pendingProps,u);case 1:return v=o.type,L=Da(v,o.pendingProps),Aa(i,o,v,L,u);case 3:e:{if(ve(o,o.stateNode.containerInfo),i===null)throw Error(r(387));v=o.pendingProps;var O=o.memoizedState;L=O.element,Cc(i,o),ci(o,v,null,u);var U=o.memoizedState;if(v=U.cache,Ji(o,er,v),v!==O.cache&&hn(o,[er],u,!0),Gs(),v=U.element,O.isDehydrated)if(O={element:v,isDehydrated:!1,cache:U.cache},o.updateQueue.baseState=O,o.memoizedState=O,o.flags&256){o=lv(i,o,v,u);break e}else if(v!==L){L=pi(Error(r(424)),o),Ra(L),o=lv(i,o,v,u);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(fr=Qs(i.firstChild),Br=o,Ln=!0,qs=null,Mi=!0,u=tv(o,null,v,u),o.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Pu(),v===L){o=Wo(i,o,u);break e}ar(i,o,v,u)}o=o.child}return o;case 26:return zt(i,o),i===null?(u=oy(o.type,null,o.pendingProps,null))?o.memoizedState=u:Ln||(u=o.type,i=o.pendingProps,v=Il(Re.current).createElement(u),v[dt]=o,v[en]=i,Ir(v,u,i),En(v),o.stateNode=v):o.memoizedState=oy(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return de(o),i===null&&Ln&&(v=o.stateNode=ry(o.type,o.pendingProps,Re.current),Br=o,Mi=!0,L=fr,_s(o.type)?(yp=L,fr=Qs(v.firstChild)):fr=L),ar(i,o,o.pendingProps.children,u),zt(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Ln&&((L=v=fr)&&(v=ty(v,o.type,o.pendingProps,Mi),v!==null?(o.stateNode=v,Br=o,fr=Qs(v.firstChild),Mi=!1,L=!0):L=!1),L||Ls(o)),de(o),L=o.type,O=o.pendingProps,U=i!==null?i.memoizedProps:null,v=O.children,Ah(L,O)?v=null:U!==null&&Ah(L,U)&&(o.flags|=32),o.memoizedState!==null&&(L=b1(i,o,L1,null,null,u),Xc._currentValue=L),zt(i,o),ar(i,o,v,u),o.child;case 6:return i===null&&Ln&&((i=u=fr)&&(u=kh(u,o.pendingProps,Mi),u!==null?(o.stateNode=u,Br=o,fr=null,i=!0):i=!1),i||Ls(o)),null;case 13:return cv(i,o,u);case 4:return ve(o,o.stateNode.containerInfo),v=o.pendingProps,i===null?o.child=zl(o,null,v,u):ar(i,o,v,u),o.child;case 11:return dh(i,o,o.type,o.pendingProps,u);case 7:return ar(i,o,o.pendingProps,u),o.child;case 8:return ar(i,o,o.pendingProps.children,u),o.child;case 12:return ar(i,o,o.pendingProps.children,u),o.child;case 10:return v=o.pendingProps,Ji(o,o.type,v.value),ar(i,o,v.children,u),o.child;case 9:return L=o.type._context,v=o.pendingProps.children,_l(o),L=Er(L),v=v(L),o.flags|=1,ar(i,o,v,u),o.child;case 14:return fh(i,o,o.type,o.pendingProps,u);case 15:return hh(i,o,o.type,o.pendingProps,u);case 19:return uv(i,o,u);case 31:return v=o.pendingProps,u=o.mode,v={mode:v.mode,children:v.children},i===null?(u=ad(v,u),u.ref=o.ref,o.child=u,u.return=o,o=u):(u=gi(i.child,v),u.ref=o.ref,o.child=u,u.return=o,o=u),o;case 22:return sd(i,o,u);case 24:return _l(o),v=Er(er),i===null?(L=Fo(),L===null&&(L=ir,O=m1(),L.pooledCache=O,O.refCount++,O!==null&&(L.pooledCacheLanes|=u),L=O),o.memoizedState={parent:v,cache:L},Nl(o),Ji(o,er,L)):((i.lanes&u)!==0&&(Cc(i,o),ci(o,null,null,u),Gs()),L=i.memoizedState,O=o.memoizedState,L.parent!==v?(L={parent:v,cache:v},o.memoizedState=L,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=L),Ji(o,er,v)):(v=O.cache,Ji(o,er,v),v!==L.cache&&hn(o,[er],u,!0))),ar(i,o,o.pendingProps.children,u),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Go(i){i.flags|=4}function vh(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!$r(o)){if(o=ts.current,o!==null&&((Rn&4194048)===Rn?yi!==null:(Rn&62914560)!==Rn&&(Rn&536870912)===0||o!==yi))throw Sc=g1,k0;i.flags|=8192}}function yh(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?Lr():536870912,i.lanes|=o,zc|=o)}function ld(i,o){if(!Ln)switch(i.tailMode){case"hidden":o=i.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:v.sibling=null}}function tr(i){var o=i.alternate!==null&&i.alternate.child===i.child,u=0,v=0;if(o)for(var L=i.child;L!==null;)u|=L.lanes|L.childLanes,v|=L.subtreeFlags&65011712,v|=L.flags&65011712,L.return=i,L=L.sibling;else for(L=i.child;L!==null;)u|=L.lanes|L.childLanes,v|=L.subtreeFlags,v|=L.flags,L.return=i,L=L.sibling;return i.subtreeFlags|=v,i.childLanes=u,o}function dv(i,o,u){var v=o.pendingProps;switch(ju(o),o.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tr(o),null;case 1:return tr(o),null;case 3:return u=o.stateNode,v=null,i!==null&&(v=i.memoizedState.cache),o.memoizedState.cache!==v&&(o.flags|=2048),ws(er),he(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(ku(o)?Go(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,O0())),tr(o),null;case 26:return u=o.memoizedState,i===null?(Go(o),u!==null?(tr(o),vh(o,u)):(tr(o),o.flags&=-16777217)):u?u!==i.memoizedState?(Go(o),tr(o),vh(o,u)):(tr(o),o.flags&=-16777217):(i.memoizedProps!==v&&Go(o),tr(o),o.flags&=-16777217),null;case 27:ke(o),u=Re.current;var L=o.type;if(i!==null&&o.stateNode!=null)i.memoizedProps!==v&&Go(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return tr(o),null}i=pe.current,ku(o)?M0(o):(i=ry(L,v,u),o.stateNode=i,Go(o))}return tr(o),null;case 5:if(ke(o),u=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==v&&Go(o);else{if(!v){if(o.stateNode===null)throw Error(r(166));return tr(o),null}if(i=pe.current,ku(o))M0(o);else{switch(L=Il(Re.current),i){case 1:i=L.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:i=L.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":i=L.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":i=L.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof v.is=="string"?L.createElement("select",{is:v.is}):L.createElement("select"),v.multiple?i.multiple=!0:v.size&&(i.size=v.size);break;default:i=typeof v.is=="string"?L.createElement(u,{is:v.is}):L.createElement(u)}}i[dt]=o,i[en]=v;e:for(L=o.child;L!==null;){if(L.tag===5||L.tag===6)i.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===o)break e;for(;L.sibling===null;){if(L.return===null||L.return===o)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}o.stateNode=i;e:switch(Ir(i,u,v),u){case"button":case"input":case"select":case"textarea":i=!!v.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Go(o)}}return tr(o),o.flags&=-16777217,null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==v&&Go(o);else{if(typeof v!="string"&&o.stateNode===null)throw Error(r(166));if(i=Re.current,ku(o)){if(i=o.stateNode,u=o.memoizedProps,v=null,L=Br,L!==null)switch(L.tag){case 27:case 5:v=L.memoizedProps}i[dt]=o,i=!!(i.nodeValue===u||v!==null&&v.suppressHydrationWarning===!0||Qv(i.nodeValue,u)),i||Ls(o)}else i=Il(i).createTextNode(v),i[dt]=o,o.stateNode=i}return tr(o),null;case 13:if(v=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(L=ku(o),v!==null&&v.dehydrated!==null){if(i===null){if(!L)throw Error(r(318));if(L=o.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(r(317));L[dt]=o}else Pu(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;tr(o),L=!1}else L=O0(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=L),L=!0;if(!L)return o.flags&256?(lo(o),o):(lo(o),null)}if(lo(o),(o.flags&128)!==0)return o.lanes=u,o;if(u=v!==null,i=i!==null&&i.memoizedState!==null,u){v=o.child,L=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(L=v.alternate.memoizedState.cachePool.pool);var O=null;v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(O=v.memoizedState.cachePool.pool),O!==L&&(v.flags|=2048)}return u!==i&&u&&(o.child.flags|=8192),yh(o,o.updateQueue),tr(o),null;case 4:return he(),i===null&&mp(o.stateNode.containerInfo),tr(o),null;case 10:return ws(o.type),tr(o),null;case 19:if(X(Rr),L=o.memoizedState,L===null)return tr(o),null;if(v=(o.flags&128)!==0,O=L.rendering,O===null)if(v)ld(L,!1);else{if(_r!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(O=td(i),O!==null){for(o.flags|=128,ld(L,!1),i=O.updateQueue,o.updateQueue=i,yh(o,i),o.subtreeFlags=0,i=u,u=o.child;u!==null;)Du(u,i),u=u.sibling;return ue(Rr,Rr.current&1|2),o.child}i=i.sibling}L.tail!==null&&tt()>Bc&&(o.flags|=128,v=!0,ld(L,!1),o.lanes=4194304)}else{if(!v)if(i=td(O),i!==null){if(o.flags|=128,v=!0,i=i.updateQueue,o.updateQueue=i,yh(o,i),ld(L,!0),L.tail===null&&L.tailMode==="hidden"&&!O.alternate&&!Ln)return tr(o),null}else 2*tt()-L.renderingStartTime>Bc&&u!==536870912&&(o.flags|=128,v=!0,ld(L,!1),o.lanes=4194304);L.isBackwards?(O.sibling=o.child,o.child=O):(i=L.last,i!==null?i.sibling=O:o.child=O,L.last=O)}return L.tail!==null?(o=L.tail,L.rendering=o,L.tail=o.sibling,L.renderingStartTime=tt(),o.sibling=null,i=Rr.current,ue(Rr,v?i&1|2:i&1),o):(tr(o),null);case 22:case 23:return lo(o),x1(),v=o.memoizedState!==null,i!==null?i.memoizedState!==null!==v&&(o.flags|=8192):v&&(o.flags|=8192),v?(u&536870912)!==0&&(o.flags&128)===0&&(tr(o),o.subtreeFlags&6&&(o.flags|=8192)):tr(o),u=o.updateQueue,u!==null&&yh(o,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),v=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(v=o.memoizedState.cachePool.pool),v!==u&&(o.flags|=2048),i!==null&&X(Ml),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),ws(er),tr(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function fv(i,o){switch(ju(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return ws(er),he(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return ke(o),null;case 13:if(lo(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Pu()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return X(Rr),null;case 4:return he(),null;case 10:return ws(o.type),null;case 22:case 23:return lo(o),x1(),i!==null&&X(Ml),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return ws(er),null;case 25:return null;default:return null}}function hv(i,o){switch(ju(o),o.tag){case 3:ws(er),he();break;case 26:case 27:case 5:ke(o);break;case 4:he();break;case 13:lo(o);break;case 19:X(Rr);break;case 10:ws(o.type);break;case 22:case 23:lo(o),x1(),i!==null&&X(Ml);break;case 24:ws(er)}}function cd(i,o){try{var u=o.updateQueue,v=u!==null?u.lastEffect:null;if(v!==null){var L=v.next;u=L;do{if((u.tag&i)===i){v=void 0;var O=u.create,U=u.inst;v=O(),U.destroy=v}u=u.next}while(u!==L)}}catch(W){nr(o,o.return,W)}}function ja(i,o,u){try{var v=o.updateQueue,L=v!==null?v.lastEffect:null;if(L!==null){var O=L.next;v=O;do{if((v.tag&i)===i){var U=v.inst,W=U.destroy;if(W!==void 0){U.destroy=void 0,L=o;var ie=u,Ne=W;try{Ne()}catch(Ie){nr(L,ie,Ie)}}}v=v.next}while(v!==O)}}catch(Ie){nr(o,o.return,Ie)}}function mv(i){var o=i.updateQueue;if(o!==null){var u=i.stateNode;try{y1(o,u)}catch(v){nr(i,i.return,v)}}}function W1(i,o,u){u.props=Da(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(v){nr(i,o,v)}}function Tc(i,o){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var v=i.stateNode;break;case 30:v=i.stateNode;break;default:v=i.stateNode}typeof u=="function"?i.refCleanup=u(v):u.current=v}}catch(L){nr(i,o,L)}}function uo(i,o){var u=i.ref,v=i.refCleanup;if(u!==null)if(typeof v=="function")try{v()}catch(L){nr(i,o,L)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(L){nr(i,o,L)}else u.current=null}function xh(i){var o=i.type,u=i.memoizedProps,v=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&v.focus();break e;case"img":u.src?v.src=u.src:u.srcSet&&(v.srcset=u.srcSet)}}catch(L){nr(i,i.return,L)}}function bh(i,o,u){try{var v=i.stateNode;jL(v,i.type,u,o),v[en]=o}catch(L){nr(i,i.return,L)}}function Dc(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&_s(i.type)||i.tag===4}function ud(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Dc(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&_s(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Lh(i,o,u){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(i),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Th));else if(v!==4&&(v===27&&_s(i.type)&&(u=i.stateNode,o=null),i=i.child,i!==null))for(Lh(i,o,u),i=i.sibling;i!==null;)Lh(i,o,u),i=i.sibling}function dd(i,o,u){var v=i.tag;if(v===5||v===6)i=i.stateNode,o?u.insertBefore(i,o):u.appendChild(i);else if(v!==4&&(v===27&&_s(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(dd(i,o,u),i=i.sibling;i!==null;)dd(i,o,u),i=i.sibling}function fd(i){var o=i.stateNode,u=i.memoizedProps;try{for(var v=i.type,L=o.attributes;L.length;)o.removeAttributeNode(L[0]);Ir(o,v,u),o[dt]=i,o[en]=u}catch(O){nr(i,i.return,O)}}var fo=!1,Fn=!1,Yo=!1,pv=typeof WeakSet=="function"?WeakSet:Set,Fr=null;function bL(i,o){if(i=i.containerInfo,Ks=Uh,i=R0(i),l1(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var v=u.getSelection&&u.getSelection();if(v&&v.rangeCount!==0){u=v.anchorNode;var L=v.anchorOffset,O=v.focusNode;v=v.focusOffset;try{u.nodeType,O.nodeType}catch{u=null;break e}var U=0,W=-1,ie=-1,Ne=0,Ie=0,Ge=i,De=null;t:for(;;){for(var Oe;Ge!==u||L!==0&&Ge.nodeType!==3||(W=U+L),Ge!==O||v!==0&&Ge.nodeType!==3||(ie=U+v),Ge.nodeType===3&&(U+=Ge.nodeValue.length),(Oe=Ge.firstChild)!==null;)De=Ge,Ge=Oe;for(;;){if(Ge===i)break t;if(De===u&&++Ne===L&&(W=U),De===O&&++Ie===v&&(ie=U),(Oe=Ge.nextSibling)!==null)break;Ge=De,De=Ge.parentNode}Ge=Oe}u=W===-1||ie===-1?null:{start:W,end:ie}}else u=null}u=u||{start:0,end:0}}else u=null;for(Dh={focusedElem:i,selectionRange:u},Uh=!1,Fr=o;Fr!==null;)if(o=Fr,i=o.child,(o.subtreeFlags&1024)!==0&&i!==null)i.return=o,Fr=i;else for(;Fr!==null;){switch(o=Fr,O=o.alternate,i=o.flags,o.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&O!==null){i=void 0,u=o,L=O.memoizedProps,O=O.memoizedState,v=u.stateNode;try{var Ht=Da(u.type,L,u.elementType===u.type);i=v.getSnapshotBeforeUpdate(Ht,O),v.__reactInternalSnapshotBeforeUpdate=i}catch(Ut){nr(u,u.return,Ut)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,u=i.nodeType,u===9)vp(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":vp(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,Fr=i;break}Fr=o.return}}function gv(i,o,u){var v=u.flags;switch(u.tag){case 0:case 11:case 15:ka(i,u),v&4&&cd(5,u);break;case 1:if(ka(i,u),v&4)if(i=u.stateNode,o===null)try{i.componentDidMount()}catch(U){nr(u,u.return,U)}else{var L=Da(u.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(L,o,i.__reactInternalSnapshotBeforeUpdate)}catch(U){nr(u,u.return,U)}}v&64&&mv(u),v&512&&Tc(u,u.return);break;case 3:if(ka(i,u),v&64&&(i=u.updateQueue,i!==null)){if(o=null,u.child!==null)switch(u.child.tag){case 27:case 5:o=u.child.stateNode;break;case 1:o=u.child.stateNode}try{y1(i,o)}catch(U){nr(u,u.return,U)}}break;case 27:o===null&&v&4&&fd(u);case 26:case 5:ka(i,u),o===null&&v&4&&xh(u),v&512&&Tc(u,u.return);break;case 12:ka(i,u);break;case 13:ka(i,u),v&4&&xv(i,u),v&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=Rh.bind(null,u),Vc(i,u))));break;case 22:if(v=u.memoizedState!==null||fo,!v){o=o!==null&&o.memoizedState!==null||Fn,L=fo;var O=Fn;fo=v,(Fn=o)&&!O?Ko(i,u,(u.subtreeFlags&8772)!==0):ka(i,u),fo=L,Fn=O}break;case 30:break;default:ka(i,u)}}function vv(i){var o=i.alternate;o!==null&&(i.alternate=null,vv(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&$e(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var hr=null,ji=!1;function Xo(i,o,u){for(u=u.child;u!==null;)yv(i,o,u),u=u.sibling}function yv(i,o,u){if($&&typeof $.onCommitFiberUnmount=="function")try{$.onCommitFiberUnmount(kt,u)}catch{}switch(u.tag){case 26:Fn||uo(u,o),Xo(i,o,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Fn||uo(u,o);var v=hr,L=ji;_s(u.type)&&(hr=u.stateNode,ji=!1),Xo(i,o,u),Sd(u.stateNode),hr=v,ji=L;break;case 5:Fn||uo(u,o);case 6:if(v=hr,L=ji,hr=null,Xo(i,o,u),hr=v,ji=L,hr!==null)if(ji)try{(hr.nodeType===9?hr.body:hr.nodeName==="HTML"?hr.ownerDocument.body:hr).removeChild(u.stateNode)}catch(O){nr(u,o,O)}else try{hr.removeChild(u.stateNode)}catch(O){nr(u,o,O)}break;case 18:hr!==null&&(ji?(i=hr,jh(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Td(i)):jh(hr,u.stateNode));break;case 4:v=hr,L=ji,hr=u.stateNode.containerInfo,ji=!0,Xo(i,o,u),hr=v,ji=L;break;case 0:case 11:case 14:case 15:Fn||ja(2,u,o),Fn||ja(4,u,o),Xo(i,o,u);break;case 1:Fn||(uo(u,o),v=u.stateNode,typeof v.componentWillUnmount=="function"&&W1(u,o,v)),Xo(i,o,u);break;case 21:Xo(i,o,u);break;case 22:Fn=(v=Fn)||u.memoizedState!==null,Xo(i,o,u),Fn=v;break;default:Xo(i,o,u)}}function xv(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Td(i)}catch(u){nr(o,o.return,u)}}function LL(i){switch(i.tag){case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new pv),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new pv),o;default:throw Error(r(435,i.tag))}}function G1(i,o){var u=LL(i);o.forEach(function(v){var L=_L.bind(null,i,v);u.has(v)||(u.add(v),v.then(L,L))})}function ns(i,o){var u=o.deletions;if(u!==null)for(var v=0;v<u.length;v++){var L=u[v],O=i,U=o,W=U;e:for(;W!==null;){switch(W.tag){case 27:if(_s(W.type)){hr=W.stateNode,ji=!1;break e}break;case 5:hr=W.stateNode,ji=!1;break e;case 3:case 4:hr=W.stateNode.containerInfo,ji=!0;break e}W=W.return}if(hr===null)throw Error(r(160));yv(O,U,L),hr=null,ji=!1,O=L.alternate,O!==null&&(O.return=null),L.return=null}if(o.subtreeFlags&13878)for(o=o.child;o!==null;)Y1(o,i),o=o.sibling}var Es=null;function Y1(i,o){var u=i.alternate,v=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ns(o,i),ki(i),v&4&&(ja(3,i,i.return),cd(3,i),ja(5,i,i.return));break;case 1:ns(o,i),ki(i),v&512&&(Fn||u===null||uo(u,u.return)),v&64&&fo&&(i=i.updateQueue,i!==null&&(v=i.callbacks,v!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?v:u.concat(v))));break;case 26:var L=Es;if(ns(o,i),ki(i),v&512&&(Fn||u===null||uo(u,u.return)),v&4){var O=u!==null?u.memoizedState:null;if(v=i.memoizedState,u===null)if(v===null)if(i.stateNode===null){e:{v=i.type,u=i.memoizedProps,L=L.ownerDocument||L;t:switch(v){case"title":O=L.getElementsByTagName("title")[0],(!O||O[ze]||O[dt]||O.namespaceURI==="http://www.w3.org/2000/svg"||O.hasAttribute("itemprop"))&&(O=L.createElement(v),L.head.insertBefore(O,L.querySelector("head > title"))),Ir(O,v,u),O[dt]=i,En(O),v=O;break e;case"link":var U=cy("link","href",L).get(v+(u.href||""));if(U){for(var W=0;W<U.length;W++)if(O=U[W],O.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&O.getAttribute("rel")===(u.rel==null?null:u.rel)&&O.getAttribute("title")===(u.title==null?null:u.title)&&O.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){U.splice(W,1);break t}}O=L.createElement(v),Ir(O,v,u),L.head.appendChild(O);break;case"meta":if(U=cy("meta","content",L).get(v+(u.content||""))){for(W=0;W<U.length;W++)if(O=U[W],O.getAttribute("content")===(u.content==null?null:""+u.content)&&O.getAttribute("name")===(u.name==null?null:u.name)&&O.getAttribute("property")===(u.property==null?null:u.property)&&O.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&O.getAttribute("charset")===(u.charSet==null?null:u.charSet)){U.splice(W,1);break t}}O=L.createElement(v),Ir(O,v,u),L.head.appendChild(O);break;default:throw Error(r(468,v))}O[dt]=i,En(O),v=O}i.stateNode=v}else uy(L,i.type,i.stateNode);else i.stateNode=ly(L,v,i.memoizedProps);else O!==v?(O===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):O.count--,v===null?uy(L,i.type,i.stateNode):ly(L,v,i.memoizedProps)):v===null&&i.stateNode!==null&&bh(i,i.memoizedProps,u.memoizedProps)}break;case 27:ns(o,i),ki(i),v&512&&(Fn||u===null||uo(u,u.return)),u!==null&&v&4&&bh(i,i.memoizedProps,u.memoizedProps);break;case 5:if(ns(o,i),ki(i),v&512&&(Fn||u===null||uo(u,u.return)),i.flags&32){L=i.stateNode;try{ri(L,"")}catch(Oe){nr(i,i.return,Oe)}}v&4&&i.stateNode!=null&&(L=i.memoizedProps,bh(i,L,u!==null?u.memoizedProps:L)),v&1024&&(Yo=!0);break;case 6:if(ns(o,i),ki(i),v&4){if(i.stateNode===null)throw Error(r(162));v=i.memoizedProps,u=i.stateNode;try{u.nodeValue=v}catch(Oe){nr(i,i.return,Oe)}}break;case 3:if(Yc=null,L=Es,Es=tn(o.containerInfo),ns(o,i),Es=L,ki(i),v&4&&u!==null&&u.memoizedState.isDehydrated)try{Td(o.containerInfo)}catch(Oe){nr(i,i.return,Oe)}Yo&&(Yo=!1,bv(i));break;case 4:v=Es,Es=tn(i.stateNode.containerInfo),ns(o,i),ki(i),Es=v;break;case 12:ns(o,i),ki(i);break;case 13:ns(o,i),ki(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(tp=tt()),v&4&&(v=i.updateQueue,v!==null&&(i.updateQueue=null,G1(i,v)));break;case 22:L=i.memoizedState!==null;var ie=u!==null&&u.memoizedState!==null,Ne=fo,Ie=Fn;if(fo=Ne||L,Fn=Ie||ie,ns(o,i),Fn=Ie,fo=Ne,ki(i),v&8192)e:for(o=i.stateNode,o._visibility=L?o._visibility&-2:o._visibility|1,L&&(u===null||ie||fo||Fn||Fl(i)),u=null,o=i;;){if(o.tag===5||o.tag===26){if(u===null){ie=u=o;try{if(O=ie.stateNode,L)U=O.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{W=ie.stateNode;var Ge=ie.memoizedProps.style,De=Ge!=null&&Ge.hasOwnProperty("display")?Ge.display:null;W.style.display=De==null||typeof De=="boolean"?"":(""+De).trim()}}catch(Oe){nr(ie,ie.return,Oe)}}}else if(o.tag===6){if(u===null){ie=o;try{ie.stateNode.nodeValue=L?"":ie.memoizedProps}catch(Oe){nr(ie,ie.return,Oe)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;u===o&&(u=null),o=o.return}u===o&&(u=null),o.sibling.return=o.return,o=o.sibling}v&4&&(v=i.updateQueue,v!==null&&(u=v.retryQueue,u!==null&&(v.retryQueue=null,G1(i,u))));break;case 19:ns(o,i),ki(i),v&4&&(v=i.updateQueue,v!==null&&(i.updateQueue=null,G1(i,v)));break;case 30:break;case 21:break;default:ns(o,i),ki(i)}}function ki(i){var o=i.flags;if(o&2){try{for(var u,v=i.return;v!==null;){if(Dc(v)){u=v;break}v=v.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var L=u.stateNode,O=ud(i);dd(i,O,L);break;case 5:var U=u.stateNode;u.flags&32&&(ri(U,""),u.flags&=-33);var W=ud(i);dd(i,W,U);break;case 3:case 4:var ie=u.stateNode.containerInfo,Ne=ud(i);Lh(i,Ne,ie);break;default:throw Error(r(161))}}catch(Ie){nr(i,i.return,Ie)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function bv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;bv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function ka(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)gv(i,o.alternate,o),o=o.sibling}function Fl(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:ja(4,o,o.return),Fl(o);break;case 1:uo(o,o.return);var u=o.stateNode;typeof u.componentWillUnmount=="function"&&W1(o,o.return,u),Fl(o);break;case 27:Sd(o.stateNode);case 26:case 5:uo(o,o.return),Fl(o);break;case 22:o.memoizedState===null&&Fl(o);break;case 30:Fl(o);break;default:Fl(o)}i=i.sibling}}function Ko(i,o,u){for(u=u&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var v=o.alternate,L=i,O=o,U=O.flags;switch(O.tag){case 0:case 11:case 15:Ko(L,O,u),cd(4,O);break;case 1:if(Ko(L,O,u),v=O,L=v.stateNode,typeof L.componentDidMount=="function")try{L.componentDidMount()}catch(Ne){nr(v,v.return,Ne)}if(v=O,L=v.updateQueue,L!==null){var W=v.stateNode;try{var ie=L.shared.hiddenCallbacks;if(ie!==null)for(L.shared.hiddenCallbacks=null,L=0;L<ie.length;L++)U0(ie[L],W)}catch(Ne){nr(v,v.return,Ne)}}u&&U&64&&mv(O),Tc(O,O.return);break;case 27:fd(O);case 26:case 5:Ko(L,O,u),u&&v===null&&U&4&&xh(O),Tc(O,O.return);break;case 12:Ko(L,O,u);break;case 13:Ko(L,O,u),u&&U&4&&xv(L,O);break;case 22:O.memoizedState===null&&Ko(L,O,u),Tc(O,O.return);break;case 30:break;default:Ko(L,O,u)}o=o.sibling}}function X1(i,o){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Bu(u))}function K1(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Bu(i))}function ho(i,o,u,v){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Lv(i,o,u,v),o=o.sibling}function Lv(i,o,u,v){var L=o.flags;switch(o.tag){case 0:case 11:case 15:ho(i,o,u,v),L&2048&&cd(9,o);break;case 1:ho(i,o,u,v);break;case 3:ho(i,o,u,v),L&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Bu(i)));break;case 12:if(L&2048){ho(i,o,u,v),i=o.stateNode;try{var O=o.memoizedProps,U=O.id,W=O.onPostCommit;typeof W=="function"&&W(U,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ie){nr(o,o.return,ie)}}else ho(i,o,u,v);break;case 13:ho(i,o,u,v);break;case 23:break;case 22:O=o.stateNode,U=o.alternate,o.memoizedState!==null?O._visibility&2?ho(i,o,u,v):hd(i,o):O._visibility&2?ho(i,o,u,v):(O._visibility|=2,Ac(i,o,u,v,(o.subtreeFlags&10256)!==0)),L&2048&&X1(U,o);break;case 24:ho(i,o,u,v),L&2048&&K1(o.alternate,o);break;default:ho(i,o,u,v)}}function Ac(i,o,u,v,L){for(L=L&&(o.subtreeFlags&10256)!==0,o=o.child;o!==null;){var O=i,U=o,W=u,ie=v,Ne=U.flags;switch(U.tag){case 0:case 11:case 15:Ac(O,U,W,ie,L),cd(8,U);break;case 23:break;case 22:var Ie=U.stateNode;U.memoizedState!==null?Ie._visibility&2?Ac(O,U,W,ie,L):hd(O,U):(Ie._visibility|=2,Ac(O,U,W,ie,L)),L&&Ne&2048&&X1(U.alternate,U);break;case 24:Ac(O,U,W,ie,L),L&&Ne&2048&&K1(U.alternate,U);break;default:Ac(O,U,W,ie,L)}o=o.sibling}}function hd(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var u=i,v=o,L=v.flags;switch(v.tag){case 22:hd(u,v),L&2048&&X1(v.alternate,v);break;case 24:hd(u,v),L&2048&&K1(v.alternate,v);break;default:hd(u,v)}o=o.sibling}}var di=8192;function jc(i){if(i.subtreeFlags&di)for(i=i.child;i!==null;)wv(i),i=i.sibling}function wv(i){switch(i.tag){case 26:jc(i),i.flags&di&&i.memoizedState!==null&&WL(Es,i.memoizedState,i.memoizedProps);break;case 5:jc(i);break;case 3:case 4:var o=Es;Es=tn(i.stateNode.containerInfo),jc(i),Es=o;break;case 22:i.memoizedState===null&&(o=i.alternate,o!==null&&o.memoizedState!==null?(o=di,di=16777216,jc(i),di=o):jc(i));break;default:jc(i)}}function Sv(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function kc(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var v=o[u];Fr=v,Ev(v,i)}Sv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Cv(i),i=i.sibling}function Cv(i){switch(i.tag){case 0:case 11:case 15:kc(i),i.flags&2048&&ja(9,i,i.return);break;case 3:kc(i);break;case 12:kc(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,wh(i)):kc(i);break;default:kc(i)}}function wh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var u=0;u<o.length;u++){var v=o[u];Fr=v,Ev(v,i)}Sv(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:ja(8,o,o.return),wh(o);break;case 22:u=o.stateNode,u._visibility&2&&(u._visibility&=-3,wh(o));break;default:wh(o)}i=i.sibling}}function Ev(i,o){for(;Fr!==null;){var u=Fr;switch(u.tag){case 0:case 11:case 15:ja(8,u,o);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var v=u.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:Bu(u.memoizedState.cache)}if(v=u.child,v!==null)v.return=u,Fr=v;else e:for(u=i;Fr!==null;){v=Fr;var L=v.sibling,O=v.return;if(vv(v),v===u){Fr=null;break e}if(L!==null){L.return=O,Fr=L;break e}Fr=O}}}var wL={getCacheForType:function(i){var o=Er(er),u=o.data.get(i);return u===void 0&&(u=i(),o.data.set(i,u)),u}},Q1=typeof WeakMap=="function"?WeakMap:Map,$n=0,ir=null,vn=null,Rn=0,Vn=0,rs=null,Pa=!1,Pc=!1,Z1=!1,Qo=0,_r=0,za=0,Hl=0,J1=0,Rs=0,zc=0,md=null,Pi=null,ep=!1,tp=0,Bc=1/0,pd=null,Ba=null,ii=0,Ua=null,Uc=null,Fc=0,np=0,rp=null,Rv=null,Hc=0,ip=null;function fi(){if(($n&2)!==0&&Rn!==0)return Rn&-Rn;if(te.T!==null){var i=wc;return i!==0?i:Nh()}return gt()}function _v(){Rs===0&&(Rs=(Rn&536870912)===0||Ln?gr():536870912);var i=ts.current;return i!==null&&(i.flags|=32),Rs}function is(i,o,u){(i===ir&&(Vn===2||Vn===9)||i.cancelPendingCommit!==null)&&(Ic(i,0),Fa(i,Rn,Rs,!1)),ft(i,u),(($n&2)===0||i!==ir)&&(i===ir&&(($n&2)===0&&(Hl|=u),_r===4&&Fa(i,Rn,Rs,!1)),mo(i))}function Mv(i,o,u){if(($n&6)!==0)throw Error(r(327));var v=!u&&(o&124)===0&&(o&i.expiredLanes)===0||pt(i,o),L=v?EL(i,o):ap(i,o,!0),O=v;do{if(L===0){Pc&&!v&&Fa(i,o,0,!1);break}else{if(u=i.current.alternate,O&&!SL(u)){L=ap(i,o,!1),O=!1;continue}if(L===2){if(O=o,i.errorRecoveryDisabledLanes&O)var U=0;else U=i.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){o=U;e:{var W=i;L=md;var ie=W.current.memoizedState.isDehydrated;if(ie&&(Ic(W,U).flags|=256),U=ap(W,U,!1),U!==2){if(Z1&&!ie){W.errorRecoveryDisabledLanes|=O,Hl|=O,L=4;break e}O=Pi,Pi=L,O!==null&&(Pi===null?Pi=O:Pi.push.apply(Pi,O))}L=U}if(O=!1,L!==2)continue}}if(L===1){Ic(i,0),Fa(i,o,0,!0);break}e:{switch(v=i,O=L,O){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:Fa(v,o,Rs,!Pa);break e;case 2:Pi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(L=tp+300-tt(),10<L)){if(Fa(v,o,Rs,!Pa),nt(v,0,!0)!==0)break e;v.timeoutHandle=Zv(Nv.bind(null,v,u,Pi,pd,ep,o,Rs,Hl,zc,Pa,O,2,-0,0),L);break e}Nv(v,u,Pi,pd,ep,o,Rs,Hl,zc,Pa,O,0,-0,0)}}break}while(!0);mo(i)}function Nv(i,o,u,v,L,O,U,W,ie,Ne,Ie,Ge,De,Oe){if(i.timeoutHandle=-1,Ge=o.subtreeFlags,(Ge&8192||(Ge&16785408)===16785408)&&(Zr={stylesheets:null,count:0,unsuspend:qL},wv(o),Ge=GL(),Ge!==null)){i.cancelPendingCommit=Ge(gd.bind(null,i,o,O,u,v,L,U,W,ie,Ie,1,De,Oe)),Fa(i,O,U,!Ne);return}gd(i,o,O,u,v,L,U,W,ie)}function SL(i){for(var o=i;;){var u=o.tag;if((u===0||u===11||u===15)&&o.flags&16384&&(u=o.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var v=0;v<u.length;v++){var L=u[v],O=L.getSnapshot;L=L.value;try{if(!Qi(O(),L))return!1}catch{return!1}}if(u=o.child,o.subtreeFlags&16384&&u!==null)u.return=o,o=u;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Fa(i,o,u,v){o&=~J1,o&=~Hl,i.suspendedLanes|=o,i.pingedLanes&=~o,v&&(i.warmLanes|=o),v=i.expirationTimes;for(var L=o;0<L;){var O=31-z(L),U=1<<O;v[O]=-1,L&=~U}u!==0&&qt(i,u,o)}function Sh(){return($n&6)===0?(xd(0),!1):!0}function sp(){if(vn!==null){if(Vn===0)var i=vn.return;else i=vn,q=_a=null,Yf(i),Ur=null,Ai=0,i=vn;for(;i!==null;)hv(i.alternate,i),i=i.return;vn=null}}function Ic(i,o){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,PL(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),sp(),ir=i,vn=u=gi(i.current,null),Rn=o,Vn=0,rs=null,Pa=!1,Pc=pt(i,o),Z1=!1,zc=Rs=J1=Hl=za=_r=0,Pi=md=null,ep=!1,(o&8)!==0&&(o|=o&32);var v=i.entangledLanes;if(v!==0)for(i=i.entanglements,v&=o;0<v;){var L=31-z(v),O=1<<L;o|=i[L],v&=~O}return Qo=o,bl(),u}function Ov(i,o){dn=null,te.H=Ju,o===vi||o===qf?(o=z0(),Vn=3):o===k0?(o=z0(),Vn=4):Vn=o===av?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,rs=o,vn===null&&(_r=1,id(i,pi(o,i.current)))}function Tv(){var i=te.H;return te.H=Ju,i===null?Ju:i}function Dv(){var i=te.A;return te.A=wL,i}function op(){_r=4,Pa||(Rn&4194048)!==Rn&&ts.current!==null||(Pc=!0),(za&134217727)===0&&(Hl&134217727)===0||ir===null||Fa(ir,Rn,Rs,!1)}function ap(i,o,u){var v=$n;$n|=2;var L=Tv(),O=Dv();(ir!==i||Rn!==o)&&(pd=null,Ic(i,o)),o=!1;var U=_r;e:do try{if(Vn!==0&&vn!==null){var W=vn,ie=rs;switch(Vn){case 8:sp(),U=6;break e;case 3:case 2:case 9:case 6:ts.current===null&&(o=!0);var Ne=Vn;if(Vn=0,rs=null,$c(i,W,ie,Ne),u&&Pc){U=0;break e}break;default:Ne=Vn,Vn=0,rs=null,$c(i,W,ie,Ne)}}CL(),U=_r;break}catch(Ie){Ov(i,Ie)}while(!0);return o&&i.shellSuspendCounter++,q=_a=null,$n=v,te.H=L,te.A=O,vn===null&&(ir=null,Rn=0,bl()),U}function CL(){for(;vn!==null;)lp(vn)}function EL(i,o){var u=$n;$n|=2;var v=Tv(),L=Dv();ir!==i||Rn!==o?(pd=null,Bc=tt()+500,Ic(i,o)):Pc=pt(i,o);e:do try{if(Vn!==0&&vn!==null){o=vn;var O=rs;t:switch(Vn){case 1:Vn=0,rs=null,$c(i,o,O,1);break;case 2:case 9:if(P0(O)){Vn=0,rs=null,jv(o);break}o=function(){Vn!==2&&Vn!==9||ir!==i||(Vn=7),mo(i)},O.then(o,o);break e;case 3:Vn=7;break e;case 4:Vn=5;break e;case 7:P0(O)?(Vn=0,rs=null,jv(o)):(Vn=0,rs=null,$c(i,o,O,7));break;case 5:var U=null;switch(vn.tag){case 26:U=vn.memoizedState;case 5:case 27:var W=vn;if(!U||$r(U)){Vn=0,rs=null;var ie=W.sibling;if(ie!==null)vn=ie;else{var Ne=W.return;Ne!==null?(vn=Ne,Ch(Ne)):vn=null}break t}}Vn=0,rs=null,$c(i,o,O,5);break;case 6:Vn=0,rs=null,$c(i,o,O,6);break;case 8:sp(),_r=6;break e;default:throw Error(r(462))}}Av();break}catch(Ie){Ov(i,Ie)}while(!0);return q=_a=null,te.H=v,te.A=L,$n=u,vn!==null?0:(ir=null,Rn=0,bl(),_r)}function Av(){for(;vn!==null&&!We();)lp(vn)}function lp(i){var o=gh(i.alternate,i,Qo);i.memoizedProps=i.pendingProps,o===null?Ch(i):vn=o}function jv(i){var o=i,u=o.alternate;switch(o.tag){case 15:case 0:o=mh(u,o,o.pendingProps,o.type,void 0,Rn);break;case 11:o=mh(u,o,o.pendingProps,o.type.render,o.ref,Rn);break;case 5:Yf(o);default:hv(u,o),o=vn=Du(o,Qo),o=gh(u,o,Qo)}i.memoizedProps=i.pendingProps,o===null?Ch(i):vn=o}function $c(i,o,u,v){q=_a=null,Yf(o),Ur=null,Ai=0;var L=o.return;try{if(ov(i,L,o,u,Rn)){_r=1,id(i,pi(u,i.current)),vn=null;return}}catch(O){if(L!==null)throw vn=L,O;_r=1,id(i,pi(u,i.current)),vn=null;return}o.flags&32768?(Ln||v===1?i=!0:Pc||(Rn&536870912)!==0?i=!1:(Pa=i=!0,(v===2||v===9||v===3||v===6)&&(v=ts.current,v!==null&&v.tag===13&&(v.flags|=16384))),kv(o,i)):Ch(o)}function Ch(i){var o=i;do{if((o.flags&32768)!==0){kv(o,Pa);return}i=o.return;var u=dv(o.alternate,o,Qo);if(u!==null){vn=u;return}if(o=o.sibling,o!==null){vn=o;return}vn=o=i}while(o!==null);_r===0&&(_r=5)}function kv(i,o){do{var u=fv(i.alternate,i);if(u!==null){u.flags&=32767,vn=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!o&&(i=i.sibling,i!==null)){vn=i;return}vn=i=u}while(i!==null);_r=6,vn=null}function gd(i,o,u,v,L,O,U,W,ie){i.cancelPendingCommit=null;do Eh();while(ii!==0);if(($n&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(O=o.lanes|o.childLanes,O|=u1,jt(i,u,O,U,W,ie),i===ir&&(vn=ir=null,Rn=0),Uc=o,Ua=i,Fc=u,np=O,rp=L,Rv=v,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,$v(ot,function(){return Fv(),null})):(i.callbackNode=null,i.callbackPriority=0),v=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||v){v=te.T,te.T=null,L=K.p,K.p=2,U=$n,$n|=4;try{bL(i,o,u)}finally{$n=U,K.p=L,te.T=v}}ii=1,Pv(),zv(),Bv()}}function Pv(){if(ii===1){ii=0;var i=Ua,o=Uc,u=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||u){u=te.T,te.T=null;var v=K.p;K.p=2;var L=$n;$n|=4;try{Y1(o,i);var O=Dh,U=R0(i.containerInfo),W=O.focusedElem,ie=O.selectionRange;if(U!==W&&W&&W.ownerDocument&&E0(W.ownerDocument.documentElement,W)){if(ie!==null&&l1(W)){var Ne=ie.start,Ie=ie.end;if(Ie===void 0&&(Ie=Ne),"selectionStart"in W)W.selectionStart=Ne,W.selectionEnd=Math.min(Ie,W.value.length);else{var Ge=W.ownerDocument||document,De=Ge&&Ge.defaultView||window;if(De.getSelection){var Oe=De.getSelection(),Ht=W.textContent.length,Ut=Math.min(ie.start,Ht),Xn=ie.end===void 0?Ut:Math.min(ie.end,Ht);!Oe.extend&&Ut>Xn&&(U=Xn,Xn=Ut,Ut=U);var Le=a1(W,Ut),me=a1(W,Xn);if(Le&&me&&(Oe.rangeCount!==1||Oe.anchorNode!==Le.node||Oe.anchorOffset!==Le.offset||Oe.focusNode!==me.node||Oe.focusOffset!==me.offset)){var _e=Ge.createRange();_e.setStart(Le.node,Le.offset),Oe.removeAllRanges(),Ut>Xn?(Oe.addRange(_e),Oe.extend(me.node,me.offset)):(_e.setEnd(me.node,me.offset),Oe.addRange(_e))}}}}for(Ge=[],Oe=W;Oe=Oe.parentNode;)Oe.nodeType===1&&Ge.push({element:Oe,left:Oe.scrollLeft,top:Oe.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<Ge.length;W++){var Ve=Ge[W];Ve.element.scrollLeft=Ve.left,Ve.element.scrollTop=Ve.top}}Uh=!!Ks,Dh=Ks=null}finally{$n=L,K.p=v,te.T=u}}i.current=o,ii=2}}function zv(){if(ii===2){ii=0;var i=Ua,o=Uc,u=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||u){u=te.T,te.T=null;var v=K.p;K.p=2;var L=$n;$n|=4;try{gv(i,o.alternate,o)}finally{$n=L,K.p=v,te.T=u}}ii=3}}function Bv(){if(ii===4||ii===3){ii=0,bt();var i=Ua,o=Uc,u=Fc,v=Rv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?ii=5:(ii=0,Uc=Ua=null,Uv(i,i.pendingLanes));var L=i.pendingLanes;if(L===0&&(Ba=null),Me(u),o=o.stateNode,$&&typeof $.onCommitFiberRoot=="function")try{$.onCommitFiberRoot(kt,o,void 0,(o.current.flags&128)===128)}catch{}if(v!==null){o=te.T,L=K.p,K.p=2,te.T=null;try{for(var O=i.onRecoverableError,U=0;U<v.length;U++){var W=v[U];O(W.value,{componentStack:W.stack})}}finally{te.T=o,K.p=L}}(Fc&3)!==0&&Eh(),mo(i),L=i.pendingLanes,(u&4194090)!==0&&(L&42)!==0?i===ip?Hc++:(Hc=0,ip=i):Hc=0,xd(0)}}function Uv(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Bu(o)))}function Eh(i){return Pv(),zv(),Bv(),Fv()}function Fv(){if(ii!==5)return!1;var i=Ua,o=np;np=0;var u=Me(Fc),v=te.T,L=K.p;try{K.p=32>u?32:u,te.T=null,u=rp,rp=null;var O=Ua,U=Fc;if(ii=0,Uc=Ua=null,Fc=0,($n&6)!==0)throw Error(r(331));var W=$n;if($n|=4,Cv(O.current),Lv(O,O.current,U,u),$n=W,xd(0,!1),$&&typeof $.onPostCommitFiberRoot=="function")try{$.onPostCommitFiberRoot(kt,O)}catch{}return!0}finally{K.p=L,te.T=v,Uv(i,o)}}function Hv(i,o,u){o=pi(u,o),o=uh(i.stateNode,o,2),i=Ho(i,o,2),i!==null&&(ft(i,2),mo(i))}function nr(i,o,u){if(i.tag===3)Hv(i,i,u);else for(;o!==null;){if(o.tag===3){Hv(o,i,u);break}else if(o.tag===1){var v=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ba===null||!Ba.has(v))){i=pi(u,i),u=H1(2),v=Ho(o,u,2),v!==null&&(sv(u,v,o,i),ft(v,2),mo(v));break}}o=o.return}}function cp(i,o,u){var v=i.pingCache;if(v===null){v=i.pingCache=new Q1;var L=new Set;v.set(o,L)}else L=v.get(o),L===void 0&&(L=new Set,v.set(o,L));L.has(u)||(Z1=!0,L.add(u),i=RL.bind(null,i,o,u),o.then(i,i))}function RL(i,o,u){var v=i.pingCache;v!==null&&v.delete(o),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,ir===i&&(Rn&u)===u&&(_r===4||_r===3&&(Rn&62914560)===Rn&&300>tt()-tp?($n&2)===0&&Ic(i,0):J1|=u,zc===Rn&&(zc=0)),mo(i)}function Iv(i,o){o===0&&(o=Lr()),i=Ll(i,o),i!==null&&(ft(i,o),mo(i))}function Rh(i){var o=i.memoizedState,u=0;o!==null&&(u=o.retryLane),Iv(i,u)}function _L(i,o){var u=0;switch(i.tag){case 13:var v=i.stateNode,L=i.memoizedState;L!==null&&(u=L.retryLane);break;case 19:v=i.stateNode;break;case 22:v=i.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(o),Iv(i,u)}function $v(i,o){return Ke(i,o)}var vd=null,Ha=null,_h=!1,yd=!1,Mh=!1,Ia=0;function mo(i){i!==Ha&&i.next===null&&(Ha===null?vd=Ha=i:Ha=Ha.next=i),yd=!0,_h||(_h=!0,up())}function xd(i,o){if(!Mh&&yd){Mh=!0;do for(var u=!1,v=vd;v!==null;){if(i!==0){var L=v.pendingLanes;if(L===0)var O=0;else{var U=v.suspendedLanes,W=v.pingedLanes;O=(1<<31-z(42|i)+1)-1,O&=L&~(U&~W),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(u=!0,qv(v,O))}else O=Rn,O=nt(v,v===ir?O:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(O&3)===0||pt(v,O)||(u=!0,qv(v,O));v=v.next}while(u);Mh=!1}}function ML(){bd()}function bd(){yd=_h=!1;var i=0;Ia!==0&&(kL()&&(i=Ia),Ia=0);for(var o=tt(),u=null,v=vd;v!==null;){var L=v.next,O=Ld(v,o);O===0?(v.next=null,u===null?vd=L:u.next=L,L===null&&(Ha=u)):(u=v,(i!==0||(O&3)!==0)&&(yd=!0)),v=L}xd(i)}function Ld(i,o){for(var u=i.suspendedLanes,v=i.pingedLanes,L=i.expirationTimes,O=i.pendingLanes&-62914561;0<O;){var U=31-z(O),W=1<<U,ie=L[U];ie===-1?((W&u)===0||(W&v)!==0)&&(L[U]=Bt(W,o)):ie<=o&&(i.expiredLanes|=W),O&=~W}if(o=ir,u=Rn,u=nt(i,i===o?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),v=i.callbackNode,u===0||i===o&&(Vn===2||Vn===9)||i.cancelPendingCommit!==null)return v!==null&&v!==null&&ae(v),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||pt(i,u)){if(o=u&-u,o===i.callbackPriority)return o;switch(v!==null&&ae(v),Me(u)){case 2:case 8:u=at;break;case 32:u=ot;break;case 268435456:u=Ot;break;default:u=ot}return v=Vv.bind(null,i),u=Ke(u,v),i.callbackPriority=o,i.callbackNode=u,o}return v!==null&&v!==null&&ae(v),i.callbackPriority=2,i.callbackNode=null,2}function Vv(i,o){if(ii!==0&&ii!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Eh()&&i.callbackNode!==u)return null;var v=Rn;return v=nt(i,i===ir?v:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),v===0?null:(Mv(i,v,o),Ld(i,tt()),i.callbackNode!=null&&i.callbackNode===u?Vv.bind(null,i):null)}function qv(i,o){if(Eh())return null;Mv(i,o,!0)}function up(){zL(function(){($n&6)!==0?Ke(Xe,ML):bd()})}function Nh(){return Ia===0&&(Ia=gr()),Ia}function Wv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:jo(""+i)}function Gv(i,o){var u=o.ownerDocument.createElement("input");return u.name=o.name,u.value=o.value,i.id&&u.setAttribute("form",i.id),o.parentNode.insertBefore(u,o),i=new FormData(i),u.parentNode.removeChild(u),i}function NL(i,o,u,v,L){if(o==="submit"&&u&&u.stateNode===L){var O=Wv((L[en]||null).action),U=v.submitter;U&&(o=(o=U[en]||null)?Wv(o.formAction):U.getAttribute("formAction"),o!==null&&(O=o,U=null));var W=new Ef("action","action",null,v,L);i.push({event:W,listeners:[{instance:null,listener:function(){if(v.defaultPrevented){if(Ia!==0){var ie=U?Gv(L,U):new FormData(L);Qu(u,{pending:!0,data:ie,method:L.method,action:O},null,ie)}}else typeof O=="function"&&(W.preventDefault(),ie=U?Gv(L,U):new FormData(L),Qu(u,{pending:!0,data:ie,method:L.method,action:O},O,ie))},currentTarget:L}]})}}for(var dp=0;dp<zn.length;dp++){var fp=zn[dp],OL=fp.toLowerCase(),TL=fp[0].toUpperCase()+fp.slice(1);$s(OL,"on"+TL)}$s(zf,"onAnimationEnd"),$s(_0,"onAnimationIteration"),$s(Zi,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(Bf,"onTransitionRun"),$s(hL,"onTransitionStart"),$s(vc,"onTransitionCancel"),$s(Mu,"onTransitionEnd"),_n("onMouseEnter",["mouseout","mouseover"]),_n("onMouseLeave",["mouseout","mouseover"]),_n("onPointerEnter",["pointerout","pointerover"]),_n("onPointerLeave",["pointerout","pointerover"]),Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wd="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(" "),DL=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wd));function Yv(i,o){o=(o&4)!==0;for(var u=0;u<i.length;u++){var v=i[u],L=v.event;v=v.listeners;e:{var O=void 0;if(o)for(var U=v.length-1;0<=U;U--){var W=v[U],ie=W.instance,Ne=W.currentTarget;if(W=W.listener,ie!==O&&L.isPropagationStopped())break e;O=W,L.currentTarget=Ne;try{O(L)}catch(Ie){Bl(Ie)}L.currentTarget=null,O=ie}else for(U=0;U<v.length;U++){if(W=v[U],ie=W.instance,Ne=W.currentTarget,W=W.listener,ie!==O&&L.isPropagationStopped())break e;O=W,L.currentTarget=Ne;try{O(L)}catch(Ie){Bl(Ie)}L.currentTarget=null,O=ie}}}}function yn(i,o){var u=o[rt];u===void 0&&(u=o[rt]=new Set);var v=i+"__bubble";u.has(v)||(Xv(o,i,2,!1),u.add(v))}function hp(i,o,u){var v=0;o&&(v|=4),Xv(u,i,v,o)}var zi="_reactListening"+Math.random().toString(36).slice(2);function mp(i){if(!i[zi]){i[zi]=!0,Gr.forEach(function(u){u!=="selectionchange"&&(DL.has(u)||hp(u,!1,i),hp(u,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[zi]||(o[zi]=!0,hp("selectionchange",!1,o))}}function Xv(i,o,u,v){switch(my(o)){case 2:var L=KL;break;case 8:L=Kc;break;default:L=Cp}u=L.bind(null,o,u,i),L=void 0,!xa||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(L=!0),v?L!==void 0?i.addEventListener(o,u,{capture:!0,passive:L}):i.addEventListener(o,u,!0):L!==void 0?i.addEventListener(o,u,{passive:L}):i.addEventListener(o,u,!1)}function Zo(i,o,u,v,L){var O=v;if((o&1)===0&&(o&2)===0&&v!==null)e:for(;;){if(v===null)return;var U=v.tag;if(U===3||U===4){var W=v.stateNode.containerInfo;if(W===L)break;if(U===4)for(U=v.return;U!==null;){var ie=U.tag;if((ie===3||ie===4)&&U.stateNode.containerInfo===L)return;U=U.return}for(;W!==null;){if(U=ht(W),U===null)return;if(ie=U.tag,ie===5||ie===6||ie===26||ie===27){v=O=U;continue e}W=W.parentNode}}v=v.return}cc(function(){var Ne=O,Ie=Eu(u),Ge=[];e:{var De=Nu.get(i);if(De!==void 0){var Oe=Ef,Ht=i;switch(i){case"keypress":if(Gn(u)===0)break e;case"keydown":case"keyup":Oe=t1;break;case"focusin":Ht="focus",Oe=_f;break;case"focusout":Ht="blur",Oe=_f;break;case"beforeblur":case"afterblur":Oe=_f;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=ba;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=e1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=iL;break;case zf:case _0:case Zi:Oe=d0;break;case Mu:Oe=sL;break;case"scroll":case"scrollend":Oe=tL;break;case"wheel":Oe=aL;break;case"copy":case"cut":case"paste":Oe=h0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=zo;break;case"toggle":case"beforetoggle":Oe=Nf}var Ut=(o&4)!==0,Xn=!Ut&&(i==="scroll"||i==="scrollend"),Le=Ut?De!==null?De+"Capture":null:De;Ut=[];for(var me=Ne,_e;me!==null;){var Ve=me;if(_e=Ve.stateNode,Ve=Ve.tag,Ve!==5&&Ve!==26&&Ve!==27||_e===null||Le===null||(Ve=ya(me,Le),Ve!=null&&Ut.push(Kt(me,Ve,_e))),Xn)break;me=me.return}0<Ut.length&&(De=new Oe(De,Ht,null,u,Ie),Ge.push({event:De,listeners:Ut}))}}if((o&7)===0){e:{if(De=i==="mouseover"||i==="pointerover",Oe=i==="mouseout"||i==="pointerout",De&&u!==yl&&(Ht=u.relatedTarget||u.fromElement)&&(ht(Ht)||Ht[bn]))break e;if((Oe||De)&&(De=Ie.window===Ie?Ie:(De=Ie.ownerDocument)?De.defaultView||De.parentWindow:window,Oe?(Ht=u.relatedTarget||u.toElement,Oe=Ne,Ht=Ht?ht(Ht):null,Ht!==null&&(Xn=a(Ht),Ut=Ht.tag,Ht!==Xn||Ut!==5&&Ut!==27&&Ut!==6)&&(Ht=null)):(Oe=null,Ht=Ne),Oe!==Ht)){if(Ut=ba,Ve="onMouseLeave",Le="onMouseEnter",me="mouse",(i==="pointerout"||i==="pointerover")&&(Ut=zo,Ve="onPointerLeave",Le="onPointerEnter",me="pointer"),Xn=Oe==null?De:Nt(Oe),_e=Ht==null?De:Nt(Ht),De=new Ut(Ve,me+"leave",Oe,u,Ie),De.target=Xn,De.relatedTarget=_e,Ve=null,ht(Ie)===Ne&&(Ut=new Ut(Le,me+"enter",Ht,u,Ie),Ut.target=_e,Ut.relatedTarget=Xn,Ve=Ut),Xn=Ve,Oe&&Ht)t:{for(Ut=Oe,Le=Ht,me=0,_e=Ut;_e;_e=Hr(_e))me++;for(_e=0,Ve=Le;Ve;Ve=Hr(Ve))_e++;for(;0<me-_e;)Ut=Hr(Ut),me--;for(;0<_e-me;)Le=Hr(Le),_e--;for(;me--;){if(Ut===Le||Le!==null&&Ut===Le.alternate)break t;Ut=Hr(Ut),Le=Hr(Le)}Ut=null}else Ut=null;Oe!==null&&Mr(Ge,De,Oe,Ut,!1),Ht!==null&&Xn!==null&&Mr(Ge,Xn,Ht,Ut,!0)}}e:{if(De=Ne?Nt(Ne):window,Oe=De.nodeName&&De.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&De.type==="file")var yt=b0;else if(Af(De))if(L0)yt=uL;else{yt=Sa;var mn=C0}else Oe=De.nodeName,!Oe||Oe.toLowerCase()!=="input"||De.type!=="checkbox"&&De.type!=="radio"?Ne&&oc(Ne.elementType)&&(yt=b0):yt=Pf;if(yt&&(yt=yt(i,Ne))){hc(Ge,yt,u,Ie);break e}mn&&mn(i,De,Ne),i==="focusout"&&Ne&&De.type==="number"&&Ne.memoizedProps.value!=null&&Yi(De,"number",De.value)}switch(mn=Ne?Nt(Ne):window,i){case"focusin":(Af(mn)||mn.contentEditable==="true")&&(gc=mn,Ca=Ne,be=null);break;case"focusout":be=Ca=gc=null;break;case"mousedown":Fe=!0;break;case"contextmenu":case"mouseup":case"dragend":Fe=!1,Pe(Ge,u,Ie);break;case"selectionchange":if(fL)break;case"keydown":case"keyup":Pe(Ge,u,Ie)}var At;if(i1)e:{switch(i){case"compositionstart":var It="onCompositionStart";break e;case"compositionend":It="onCompositionEnd";break e;case"compositionupdate":It="onCompositionUpdate";break e}It=void 0}else La?y0(i,u)&&(It="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(It="onCompositionStart");It&&(Of&&u.locale!=="ko"&&(La||It!=="onCompositionStart"?It==="onCompositionEnd"&&La&&(At=a0()):(ms=Ie,Ru="value"in ms?ms.value:ms.textContent,La=!0)),mn=Oh(Ne,It),0<mn.length&&(It=new Ri(It,i,null,u,Ie),Ge.push({event:It,listeners:mn}),At?It.data=At:(At=Df(u),At!==null&&(It.data=At)))),(At=v0?lL(i,u):x0(i,u))&&(It=Oh(Ne,"onBeforeInput"),0<It.length&&(mn=new Ri("onBeforeInput","beforeinput",null,u,Ie),Ge.push({event:mn,listeners:It}),mn.data=At)),NL(Ge,i,Ne,u,Ie)}Yv(Ge,o)})}function Kt(i,o,u){return{instance:i,listener:o,currentTarget:u}}function Oh(i,o){for(var u=o+"Capture",v=[];i!==null;){var L=i,O=L.stateNode;if(L=L.tag,L!==5&&L!==26&&L!==27||O===null||(L=ya(i,u),L!=null&&v.unshift(Kt(i,L,O)),L=ya(i,o),L!=null&&v.push(Kt(i,L,O))),i.tag===3)return v;i=i.return}return[]}function Hr(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Mr(i,o,u,v,L){for(var O=o._reactName,U=[];u!==null&&u!==v;){var W=u,ie=W.alternate,Ne=W.stateNode;if(W=W.tag,ie!==null&&ie===v)break;W!==5&&W!==26&&W!==27||Ne===null||(ie=Ne,L?(Ne=ya(u,O),Ne!=null&&U.unshift(Kt(u,Ne,ie))):L||(Ne=ya(u,O),Ne!=null&&U.push(Kt(u,Ne,ie)))),u=u.return}U.length!==0&&i.push({event:o,listeners:U})}var AL=/\r\n?/g,$a=/\u0000|\uFFFD/g;function Kv(i){return(typeof i=="string"?i:""+i).replace(AL,`
`).replace($a,"")}function Qv(i,o){return o=Kv(o),Kv(i)===o}function Th(){}function Yn(i,o,u,v,L,O){switch(u){case"children":typeof v=="string"?o==="body"||o==="textarea"&&v===""||ri(i,v):(typeof v=="number"||typeof v=="bigint")&&o!=="body"&&ri(i,""+v);break;case"className":vl(i,"class",v);break;case"tabIndex":vl(i,"tabindex",v);break;case"dir":case"role":case"viewBox":case"width":case"height":vl(i,u,v);break;case"style":sc(i,v,O);break;case"data":if(o!=="object"){vl(i,"data",v);break}case"src":case"href":if(v===""&&(o!=="a"||u!=="href")){i.removeAttribute(u);break}if(v==null||typeof v=="function"||typeof v=="symbol"||typeof v=="boolean"){i.removeAttribute(u);break}v=jo(""+v),i.setAttribute(u,v);break;case"action":case"formAction":if(typeof v=="function"){i.setAttribute(u,"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 O=="function"&&(u==="formAction"?(o!=="input"&&Yn(i,o,"name",L.name,L,null),Yn(i,o,"formEncType",L.formEncType,L,null),Yn(i,o,"formMethod",L.formMethod,L,null),Yn(i,o,"formTarget",L.formTarget,L,null)):(Yn(i,o,"encType",L.encType,L,null),Yn(i,o,"method",L.method,L,null),Yn(i,o,"target",L.target,L,null)));if(v==null||typeof v=="symbol"||typeof v=="boolean"){i.removeAttribute(u);break}v=jo(""+v),i.setAttribute(u,v);break;case"onClick":v!=null&&(i.onclick=Th);break;case"onScroll":v!=null&&yn("scroll",i);break;case"onScrollEnd":v!=null&&yn("scrollend",i);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(u=v.__html,u!=null){if(L.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=v&&typeof v!="function"&&typeof v!="symbol";break;case"muted":i.muted=v&&typeof v!="function"&&typeof v!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(v==null||typeof v=="function"||typeof v=="boolean"||typeof v=="symbol"){i.removeAttribute("xlink:href");break}u=jo(""+v),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":v!=null&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(u,""+v):i.removeAttribute(u);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":v&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":v===!0?i.setAttribute(u,""):v!==!1&&v!=null&&typeof v!="function"&&typeof v!="symbol"?i.setAttribute(u,v):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":v!=null&&typeof v!="function"&&typeof v!="symbol"&&!isNaN(v)&&1<=v?i.setAttribute(u,v):i.removeAttribute(u);break;case"rowSpan":case"start":v==null||typeof v=="function"||typeof v=="symbol"||isNaN(v)?i.removeAttribute(u):i.setAttribute(u,v);break;case"popover":yn("beforetoggle",i),yn("toggle",i),Us(i,"popover",v);break;case"xlinkActuate":Wi(i,"http://www.w3.org/1999/xlink","xlink:actuate",v);break;case"xlinkArcrole":Wi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",v);break;case"xlinkRole":Wi(i,"http://www.w3.org/1999/xlink","xlink:role",v);break;case"xlinkShow":Wi(i,"http://www.w3.org/1999/xlink","xlink:show",v);break;case"xlinkTitle":Wi(i,"http://www.w3.org/1999/xlink","xlink:title",v);break;case"xlinkType":Wi(i,"http://www.w3.org/1999/xlink","xlink:type",v);break;case"xmlBase":Wi(i,"http://www.w3.org/XML/1998/namespace","xml:base",v);break;case"xmlLang":Wi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",v);break;case"xmlSpace":Wi(i,"http://www.w3.org/XML/1998/namespace","xml:space",v);break;case"is":Us(i,"is",v);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=ac.get(u)||u,Us(i,u,v))}}function pp(i,o,u,v,L,O){switch(u){case"style":sc(i,v,O);break;case"dangerouslySetInnerHTML":if(v!=null){if(typeof v!="object"||!("__html"in v))throw Error(r(61));if(u=v.__html,u!=null){if(L.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof v=="string"?ri(i,v):(typeof v=="number"||typeof v=="bigint")&&ri(i,""+v);break;case"onScroll":v!=null&&yn("scroll",i);break;case"onScrollEnd":v!=null&&yn("scrollend",i);break;case"onClick":v!=null&&(i.onclick=Th);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ni.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(L=u.endsWith("Capture"),o=u.slice(2,L?u.length-7:void 0),O=i[en]||null,O=O!=null?O[u]:null,typeof O=="function"&&i.removeEventListener(o,O,L),typeof v=="function")){typeof O!="function"&&O!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(o,v,L);break e}u in i?i[u]=v:v===!0?i.setAttribute(u,""):Us(i,u,v)}}}function Ir(i,o,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yn("error",i),yn("load",i);var v=!1,L=!1,O;for(O in u)if(u.hasOwnProperty(O)){var U=u[O];if(U!=null)switch(O){case"src":v=!0;break;case"srcSet":L=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Yn(i,o,O,U,u,null)}}L&&Yn(i,o,"srcSet",u.srcSet,u,null),v&&Yn(i,o,"src",u.src,u,null);return;case"input":yn("invalid",i);var W=O=U=L=null,ie=null,Ne=null;for(v in u)if(u.hasOwnProperty(v)){var Ie=u[v];if(Ie!=null)switch(v){case"name":L=Ie;break;case"type":U=Ie;break;case"checked":ie=Ie;break;case"defaultChecked":Ne=Ie;break;case"value":O=Ie;break;case"defaultValue":W=Ie;break;case"children":case"dangerouslySetInnerHTML":if(Ie!=null)throw Error(r(137,o));break;default:Yn(i,o,v,Ie,u,null)}}Cr(i,O,W,ie,Ne,U,L,!1),Ao(i);return;case"select":yn("invalid",i),v=U=O=null;for(L in u)if(u.hasOwnProperty(L)&&(W=u[L],W!=null))switch(L){case"value":O=W;break;case"defaultValue":U=W;break;case"multiple":v=W;default:Yn(i,o,L,W,u,null)}o=O,u=U,i.multiple=!!v,o!=null?Jn(i,!!v,o,!1):u!=null&&Jn(i,!!v,u,!0);return;case"textarea":yn("invalid",i),O=L=v=null;for(U in u)if(u.hasOwnProperty(U)&&(W=u[U],W!=null))switch(U){case"value":v=W;break;case"defaultValue":L=W;break;case"children":O=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:Yn(i,o,U,W,u,null)}Xi(i,v,L,O),Ao(i);return;case"option":for(ie in u)if(u.hasOwnProperty(ie)&&(v=u[ie],v!=null))switch(ie){case"selected":i.selected=v&&typeof v!="function"&&typeof v!="symbol";break;default:Yn(i,o,ie,v,u,null)}return;case"dialog":yn("beforetoggle",i),yn("toggle",i),yn("cancel",i),yn("close",i);break;case"iframe":case"object":yn("load",i);break;case"video":case"audio":for(v=0;v<wd.length;v++)yn(wd[v],i);break;case"image":yn("error",i),yn("load",i);break;case"details":yn("toggle",i);break;case"embed":case"source":case"link":yn("error",i),yn("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ne in u)if(u.hasOwnProperty(Ne)&&(v=u[Ne],v!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:Yn(i,o,Ne,v,u,null)}return;default:if(oc(o)){for(Ie in u)u.hasOwnProperty(Ie)&&(v=u[Ie],v!==void 0&&pp(i,o,Ie,v,u,void 0));return}}for(W in u)u.hasOwnProperty(W)&&(v=u[W],v!=null&&Yn(i,o,W,v,u,null))}function jL(i,o,u,v){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var L=null,O=null,U=null,W=null,ie=null,Ne=null,Ie=null;for(Oe in u){var Ge=u[Oe];if(u.hasOwnProperty(Oe)&&Ge!=null)switch(Oe){case"checked":break;case"value":break;case"defaultValue":ie=Ge;default:v.hasOwnProperty(Oe)||Yn(i,o,Oe,null,v,Ge)}}for(var De in v){var Oe=v[De];if(Ge=u[De],v.hasOwnProperty(De)&&(Oe!=null||Ge!=null))switch(De){case"type":O=Oe;break;case"name":L=Oe;break;case"checked":Ne=Oe;break;case"defaultChecked":Ie=Oe;break;case"value":U=Oe;break;case"defaultValue":W=Oe;break;case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(r(137,o));break;default:Oe!==Ge&&Yn(i,o,De,Oe,v,Ge)}}cr(i,U,W,ie,Ne,Ie,O,L);return;case"select":Oe=U=W=De=null;for(O in u)if(ie=u[O],u.hasOwnProperty(O)&&ie!=null)switch(O){case"value":break;case"multiple":Oe=ie;default:v.hasOwnProperty(O)||Yn(i,o,O,null,v,ie)}for(L in v)if(O=v[L],ie=u[L],v.hasOwnProperty(L)&&(O!=null||ie!=null))switch(L){case"value":De=O;break;case"defaultValue":W=O;break;case"multiple":U=O;default:O!==ie&&Yn(i,o,L,O,v,ie)}o=W,u=U,v=Oe,De!=null?Jn(i,!!u,De,!1):!!v!=!!u&&(o!=null?Jn(i,!!u,o,!0):Jn(i,!!u,u?[]:"",!1));return;case"textarea":Oe=De=null;for(W in u)if(L=u[W],u.hasOwnProperty(W)&&L!=null&&!v.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:Yn(i,o,W,null,v,L)}for(U in v)if(L=v[U],O=u[U],v.hasOwnProperty(U)&&(L!=null||O!=null))switch(U){case"value":De=L;break;case"defaultValue":Oe=L;break;case"children":break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:L!==O&&Yn(i,o,U,L,v,O)}Hs(i,De,Oe);return;case"option":for(var Ht in u)if(De=u[Ht],u.hasOwnProperty(Ht)&&De!=null&&!v.hasOwnProperty(Ht))switch(Ht){case"selected":i.selected=!1;break;default:Yn(i,o,Ht,null,v,De)}for(ie in v)if(De=v[ie],Oe=u[ie],v.hasOwnProperty(ie)&&De!==Oe&&(De!=null||Oe!=null))switch(ie){case"selected":i.selected=De&&typeof De!="function"&&typeof De!="symbol";break;default:Yn(i,o,ie,De,v,Oe)}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 Ut in u)De=u[Ut],u.hasOwnProperty(Ut)&&De!=null&&!v.hasOwnProperty(Ut)&&Yn(i,o,Ut,null,v,De);for(Ne in v)if(De=v[Ne],Oe=u[Ne],v.hasOwnProperty(Ne)&&De!==Oe&&(De!=null||Oe!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(r(137,o));break;default:Yn(i,o,Ne,De,v,Oe)}return;default:if(oc(o)){for(var Xn in u)De=u[Xn],u.hasOwnProperty(Xn)&&De!==void 0&&!v.hasOwnProperty(Xn)&&pp(i,o,Xn,void 0,v,De);for(Ie in v)De=v[Ie],Oe=u[Ie],!v.hasOwnProperty(Ie)||De===Oe||De===void 0&&Oe===void 0||pp(i,o,Ie,De,v,Oe);return}}for(var Le in u)De=u[Le],u.hasOwnProperty(Le)&&De!=null&&!v.hasOwnProperty(Le)&&Yn(i,o,Le,null,v,De);for(Ge in v)De=v[Ge],Oe=u[Ge],!v.hasOwnProperty(Ge)||De===Oe||De==null&&Oe==null||Yn(i,o,Ge,De,v,Oe)}var Ks=null,Dh=null;function Il(i){return i.nodeType===9?i:i.ownerDocument}function mr(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xr(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function Ah(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var gp=null;function kL(){var i=window.event;return i&&i.type==="popstate"?i===gp?!1:(gp=i,!0):(gp=null,!1)}var Zv=typeof setTimeout=="function"?setTimeout:void 0,PL=typeof clearTimeout=="function"?clearTimeout:void 0,Jv=typeof Promise=="function"?Promise:void 0,zL=typeof queueMicrotask=="function"?queueMicrotask:typeof Jv<"u"?function(i){return Jv.resolve(null).then(i).catch(ey)}:Zv;function ey(i){setTimeout(function(){throw i})}function _s(i){return i==="head"}function jh(i,o){var u=o,v=0,L=0;do{var O=u.nextSibling;if(i.removeChild(u),O&&O.nodeType===8)if(u=O.data,u==="/$"){if(0<v&&8>v){u=v;var U=i.ownerDocument;if(u&1&&Sd(U.documentElement),u&2&&Sd(U.body),u&4)for(u=U.head,Sd(u),U=u.firstChild;U;){var W=U.nextSibling,ie=U.nodeName;U[ze]||ie==="SCRIPT"||ie==="STYLE"||ie==="LINK"&&U.rel.toLowerCase()==="stylesheet"||u.removeChild(U),U=W}}if(L===0){i.removeChild(O),Td(o);return}L--}else u==="$"||u==="$?"||u==="$!"?L++:v=u.charCodeAt(0)-48;else v=0;u=O}while(u);Td(o)}function vp(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var u=o;switch(o=o.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":vp(u),$e(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function ty(i,o,u,v){for(;i.nodeType===1;){var L=u;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!v&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(v){if(!i[ze])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(O=i.getAttribute("rel"),O==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(O!==L.rel||i.getAttribute("href")!==(L.href==null||L.href===""?null:L.href)||i.getAttribute("crossorigin")!==(L.crossOrigin==null?null:L.crossOrigin)||i.getAttribute("title")!==(L.title==null?null:L.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(O=i.getAttribute("src"),(O!==(L.src==null?null:L.src)||i.getAttribute("type")!==(L.type==null?null:L.type)||i.getAttribute("crossorigin")!==(L.crossOrigin==null?null:L.crossOrigin))&&O&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var O=L.name==null?null:""+L.name;if(L.type==="hidden"&&i.getAttribute("name")===O)return i}else return i;if(i=Qs(i.nextSibling),i===null)break}return null}function kh(i,o,u){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Qs(i.nextSibling),i===null))return null;return i}function bi(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function Vc(i,o){var u=i.ownerDocument;if(i.data!=="$?"||u.readyState==="complete")o();else{var v=function(){o(),u.removeEventListener("DOMContentLoaded",v)};u.addEventListener("DOMContentLoaded",v),i._reactRetry=v}}function Qs(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="F!"||o==="F")break;if(o==="/$")return null}}return i}var yp=null;function ny(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(o===0)return i;o--}else u==="/$"&&o++}i=i.previousSibling}return null}function ry(i,o,u){switch(o=Il(u),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Sd(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);$e(i)}var ss=new Map,po=new Set;function tn(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var go=K.d;K.d={f:Ms,r:iy,D:BL,C:sy,L:Ph,m:UL,X:HL,S:FL,M:IL};function Ms(){var i=go.f(),o=Sh();return i||o}function iy(i){var o=vt(i);o!==null&&o.tag===5&&o.type==="form"?oh(o):go.r(i)}var qc=typeof document>"u"?null:document;function Bn(i,o,u){var v=qc;if(v&&typeof o=="string"&&o){var L=Wn(o);L='link[rel="'+i+'"][href="'+L+'"]',typeof u=="string"&&(L+='[crossorigin="'+u+'"]'),po.has(L)||(po.add(L),i={rel:i,crossOrigin:u,href:o},v.querySelector(L)===null&&(o=v.createElement("link"),Ir(o,"link",i),En(o),v.head.appendChild(o)))}}function BL(i){go.D(i),Bn("dns-prefetch",i,null)}function sy(i,o){go.C(i,o),Bn("preconnect",i,o)}function Ph(i,o,u){go.L(i,o,u);var v=qc;if(v&&i&&o){var L='link[rel="preload"][as="'+Wn(o)+'"]';o==="image"&&u&&u.imageSrcSet?(L+='[imagesrcset="'+Wn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(L+='[imagesizes="'+Wn(u.imageSizes)+'"]')):L+='[href="'+Wn(i)+'"]';var O=L;switch(o){case"style":O=Wc(i);break;case"script":O=Gc(i)}ss.has(O)||(i=x({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:i,as:o},u),ss.set(O,i),v.querySelector(L)!==null||o==="style"&&v.querySelector(Cd(O))||o==="script"&&v.querySelector(Ed(O))||(o=v.createElement("link"),Ir(o,"link",i),En(o),v.head.appendChild(o)))}}function UL(i,o){go.m(i,o);var u=qc;if(u&&i){var v=o&&typeof o.as=="string"?o.as:"script",L='link[rel="modulepreload"][as="'+Wn(v)+'"][href="'+Wn(i)+'"]',O=L;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=Gc(i)}if(!ss.has(O)&&(i=x({rel:"modulepreload",href:i},o),ss.set(O,i),u.querySelector(L)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ed(O)))return}v=u.createElement("link"),Ir(v,"link",i),En(v),u.head.appendChild(v)}}}function FL(i,o,u){go.S(i,o,u);var v=qc;if(v&&i){var L=ln(v).hoistableStyles,O=Wc(i);o=o||"default";var U=L.get(O);if(!U){var W={loading:0,preload:null};if(U=v.querySelector(Cd(O)))W.loading=5;else{i=x({rel:"stylesheet",href:i,"data-precedence":o},u),(u=ss.get(O))&&Rd(i,u);var ie=U=v.createElement("link");En(ie),Ir(ie,"link",i),ie._p=new Promise(function(Ne,Ie){ie.onload=Ne,ie.onerror=Ie}),ie.addEventListener("load",function(){W.loading|=1}),ie.addEventListener("error",function(){W.loading|=2}),W.loading|=4,zh(U,o,v)}U={type:"stylesheet",instance:U,count:1,state:W},L.set(O,U)}}}function HL(i,o){go.X(i,o);var u=qc;if(u&&i){var v=ln(u).hoistableScripts,L=Gc(i),O=v.get(L);O||(O=u.querySelector(Ed(L)),O||(i=x({src:i,async:!0},o),(o=ss.get(L))&&xp(i,o),O=u.createElement("script"),En(O),Ir(O,"link",i),u.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},v.set(L,O))}}function IL(i,o){go.M(i,o);var u=qc;if(u&&i){var v=ln(u).hoistableScripts,L=Gc(i),O=v.get(L);O||(O=u.querySelector(Ed(L)),O||(i=x({src:i,async:!0,type:"module"},o),(o=ss.get(L))&&xp(i,o),O=u.createElement("script"),En(O),Ir(O,"link",i),u.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},v.set(L,O))}}function oy(i,o,u,v){var L=(L=Re.current)?tn(L):null;if(!L)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=Wc(u.href),u=ln(L).hoistableStyles,v=u.get(o),v||(v={type:"style",instance:null,count:0,state:null},u.set(o,v)),v):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Wc(u.href);var O=ln(L).hoistableStyles,U=O.get(i);if(U||(L=L.ownerDocument||L,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(i,U),(O=L.querySelector(Cd(i)))&&!O._p&&(U.instance=O,U.state.loading=5),ss.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},ss.set(i,u),O||$L(L,i,u,U.state))),o&&v===null)throw Error(r(528,""));return U}if(o&&v!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Gc(u),u=ln(L).hoistableScripts,v=u.get(o),v||(v={type:"script",instance:null,count:0,state:null},u.set(o,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Wc(i){return'href="'+Wn(i)+'"'}function Cd(i){return'link[rel="stylesheet"]['+i+"]"}function ay(i){return x({},i,{"data-precedence":i.precedence,precedence:null})}function $L(i,o,u,v){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?v.loading=1:(o=i.createElement("link"),v.preload=o,o.addEventListener("load",function(){return v.loading|=1}),o.addEventListener("error",function(){return v.loading|=2}),Ir(o,"link",u),En(o),i.head.appendChild(o))}function Gc(i){return'[src="'+Wn(i)+'"]'}function Ed(i){return"script[async]"+i}function ly(i,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var v=i.querySelector('style[data-href~="'+Wn(u.href)+'"]');if(v)return o.instance=v,En(v),v;var L=x({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return v=(i.ownerDocument||i).createElement("style"),En(v),Ir(v,"style",L),zh(v,u.precedence,i),o.instance=v;case"stylesheet":L=Wc(u.href);var O=i.querySelector(Cd(L));if(O)return o.state.loading|=4,o.instance=O,En(O),O;v=ay(u),(L=ss.get(L))&&Rd(v,L),O=(i.ownerDocument||i).createElement("link"),En(O);var U=O;return U._p=new Promise(function(W,ie){U.onload=W,U.onerror=ie}),Ir(O,"link",v),o.state.loading|=4,zh(O,u.precedence,i),o.instance=O;case"script":return O=Gc(u.src),(L=i.querySelector(Ed(O)))?(o.instance=L,En(L),L):(v=u,(L=ss.get(O))&&(v=x({},u),xp(v,L)),i=i.ownerDocument||i,L=i.createElement("script"),En(L),Ir(L,"link",v),i.head.appendChild(L),o.instance=L);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(v=o.instance,o.state.loading|=4,zh(v,u.precedence,i));return o.instance}function zh(i,o,u){for(var v=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),L=v.length?v[v.length-1]:null,O=L,U=0;U<v.length;U++){var W=v[U];if(W.dataset.precedence===o)O=W;else if(O!==L)break}O?O.parentNode.insertBefore(i,O.nextSibling):(o=u.nodeType===9?u.head:u,o.insertBefore(i,o.firstChild))}function Rd(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function xp(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Yc=null;function cy(i,o,u){if(Yc===null){var v=new Map,L=Yc=new Map;L.set(u,v)}else L=Yc,v=L.get(u),v||(v=new Map,L.set(u,v));if(v.has(i))return v;for(v.set(i,null),u=u.getElementsByTagName(i),L=0;L<u.length;L++){var O=u[L];if(!(O[ze]||O[dt]||i==="link"&&O.getAttribute("rel")==="stylesheet")&&O.namespaceURI!=="http://www.w3.org/2000/svg"){var U=O.getAttribute(o)||"";U=i+U;var W=v.get(U);W?W.push(O):v.set(U,[O])}}return v}function uy(i,o,u){i=i.ownerDocument||i,i.head.insertBefore(u,o==="title"?i.querySelector("head > title"):null)}function VL(i,o,u){if(u===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function $r(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Zr=null;function qL(){}function WL(i,o,u){if(Zr===null)throw Error(r(475));var v=Zr;if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var L=Wc(u.href),O=i.querySelector(Cd(L));if(O){i=O._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(v.count++,v=_d.bind(v),i.then(v,v)),o.state.loading|=4,o.instance=O,En(O);return}O=i.ownerDocument||i,u=ay(u),(L=ss.get(L))&&Rd(u,L),O=O.createElement("link"),En(O);var U=O;U._p=new Promise(function(W,ie){U.onload=W,U.onerror=ie}),Ir(O,"link",u),o.instance=O}v.stylesheets===null&&(v.stylesheets=new Map),v.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(v.count++,o=_d.bind(v),i.addEventListener("load",o),i.addEventListener("error",o))}}function GL(){if(Zr===null)throw Error(r(475));var i=Zr;return i.stylesheets&&i.count===0&&bp(i,i.stylesheets),0<i.count?function(o){var u=setTimeout(function(){if(i.stylesheets&&bp(i,i.stylesheets),i.unsuspend){var v=i.unsuspend;i.unsuspend=null,v()}},6e4);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(u)}}:null}function _d(){if(this.count--,this.count===0){if(this.stylesheets)bp(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Bh=null;function bp(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Bh=new Map,o.forEach(YL,i),Bh=null,_d.call(i))}function YL(i,o){if(!(o.state.loading&4)){var u=Bh.get(i);if(u)var v=u.get(null);else{u=new Map,Bh.set(i,u);for(var L=i.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O<L.length;O++){var U=L[O];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(u.set(U.dataset.precedence,U),v=U)}v&&u.set(null,v)}L=o.instance,U=L.getAttribute("data-precedence"),O=u.get(U)||v,O===v&&u.set(null,L),u.set(U,L),this.count++,v=_d.bind(this),L.addEventListener("load",v),L.addEventListener("error",v),O?O.parentNode.insertBefore(L,O.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(L,i.firstChild)),o.state.loading|=4}}var Xc={$$typeof:c,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function XL(i,o,u,v,L,O,U,W){this.tag=1,this.containerInfo=i,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=wr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wr(0),this.hiddenUpdates=wr(null),this.identifierPrefix=v,this.onUncaughtError=L,this.onCaughtError=O,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function dy(i,o,u,v,L,O,U,W,ie,Ne,Ie,Ge){return i=new XL(i,o,u,U,W,ie,Ne,Ge),o=1,O===!0&&(o|=24),O=_i(3,null,null,o),i.current=O,O.stateNode=i,o=m1(),o.refCount++,i.pooledCache=o,o.refCount++,O.memoizedState={element:v,isDehydrated:u,cache:o},Nl(O),i}function fy(i){return i?(i=wl,i):wl}function Lp(i,o,u,v,L,O){L=fy(L),v.context===null?v.context=L:v.pendingContext=L,v=Ma(o),v.payload={element:u},O=O===void 0?null:O,O!==null&&(v.callback=O),u=Ho(i,v,o),u!==null&&(is(u,i,o),Fu(u,i,o))}function wp(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<o?u:o}}function Sp(i,o){wp(i,o),(i=i.alternate)&&wp(i,o)}function hy(i){if(i.tag===13){var o=Ll(i,67108864);o!==null&&is(o,i,67108864),Sp(i,67108864)}}var Uh=!0;function KL(i,o,u,v){var L=te.T;te.T=null;var O=K.p;try{K.p=2,Cp(i,o,u,v)}finally{K.p=O,te.T=L}}function Kc(i,o,u,v){var L=te.T;te.T=null;var O=K.p;try{K.p=8,Cp(i,o,u,v)}finally{K.p=O,te.T=L}}function Cp(i,o,u,v){if(Uh){var L=Ep(v);if(L===null)Zo(i,o,v,Fh,u),py(i,v);else if(ZL(L,i,o,u,v))v.stopPropagation();else if(py(i,v),o&4&&-1<QL.indexOf(i)){for(;L!==null;){var O=vt(L);if(O!==null)switch(O.tag){case 3:if(O=O.stateNode,O.current.memoizedState.isDehydrated){var U=Mt(O.pendingLanes);if(U!==0){var W=O;for(W.pendingLanes|=2,W.entangledLanes|=2;U;){var ie=1<<31-z(U);W.entanglements[1]|=ie,U&=~ie}mo(O),($n&6)===0&&(Bc=tt()+500,xd(0))}}break;case 13:W=Ll(O,2),W!==null&&is(W,O,2),Sh(),Sp(O,2)}if(O=Ep(v),O===null&&Zo(i,o,v,Fh,u),O===L)break;L=O}L!==null&&v.stopPropagation()}else Zo(i,o,v,null,u)}}function Ep(i){return i=Eu(i),Rp(i)}var Fh=null;function Rp(i){if(Fh=null,i=ht(i),i!==null){var o=a(i);if(o===null)i=null;else{var u=o.tag;if(u===13){if(i=l(o),i!==null)return i;i=null}else if(u===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Fh=i,null}function my(i){switch(i){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(mt()){case Xe:return 2;case at:return 8;case ot:case Ct:return 32;case Ot:return 268435456;default:return 32}default:return 32}}var Hh=!1,Jo=null,Va=null,qa=null,Md=new Map,Nd=new Map,Wa=[],QL="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 py(i,o){switch(i){case"focusin":case"focusout":Jo=null;break;case"dragenter":case"dragleave":Va=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Md.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nd.delete(o.pointerId)}}function Od(i,o,u,v,L,O){return i===null||i.nativeEvent!==O?(i={blockedOn:o,domEventName:u,eventSystemFlags:v,nativeEvent:O,targetContainers:[L]},o!==null&&(o=vt(o),o!==null&&hy(o)),i):(i.eventSystemFlags|=v,o=i.targetContainers,L!==null&&o.indexOf(L)===-1&&o.push(L),i)}function ZL(i,o,u,v,L){switch(o){case"focusin":return Jo=Od(Jo,i,o,u,v,L),!0;case"dragenter":return Va=Od(Va,i,o,u,v,L),!0;case"mouseover":return qa=Od(qa,i,o,u,v,L),!0;case"pointerover":var O=L.pointerId;return Md.set(O,Od(Md.get(O)||null,i,o,u,v,L)),!0;case"gotpointercapture":return O=L.pointerId,Nd.set(O,Od(Nd.get(O)||null,i,o,u,v,L)),!0}return!1}function gy(i){var o=ht(i.target);if(o!==null){var u=a(o);if(u!==null){if(o=u.tag,o===13){if(o=l(u),o!==null){i.blockedOn=o,Jt(i.priority,function(){if(u.tag===13){var v=fi();v=Wt(v);var L=Ll(u,v);L!==null&&is(L,u,v),Sp(u,v)}});return}}else if(o===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ih(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var u=Ep(i.nativeEvent);if(u===null){u=i.nativeEvent;var v=new u.constructor(u.type,u);yl=v,u.target.dispatchEvent(v),yl=null}else return o=vt(u),o!==null&&hy(o),i.blockedOn=u,!1;o.shift()}return!0}function vy(i,o,u){Ih(i)&&u.delete(o)}function JL(){Hh=!1,Jo!==null&&Ih(Jo)&&(Jo=null),Va!==null&&Ih(Va)&&(Va=null),qa!==null&&Ih(qa)&&(qa=null),Md.forEach(vy),Nd.forEach(vy)}function $h(i,o){i.blockedOn===o&&(i.blockedOn=null,Hh||(Hh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JL)))}var Vh=null;function yy(i){Vh!==i&&(Vh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vh===i&&(Vh=null);for(var o=0;o<i.length;o+=3){var u=i[o],v=i[o+1],L=i[o+2];if(typeof v!="function"){if(Rp(v||u)===null)continue;break}var O=vt(u);O!==null&&(i.splice(o,3),o-=3,Qu(O,{pending:!0,data:L,method:u.method,action:v},v,L))}}))}function Td(i){function o(ie){return $h(ie,i)}Jo!==null&&$h(Jo,i),Va!==null&&$h(Va,i),qa!==null&&$h(qa,i),Md.forEach(o),Nd.forEach(o);for(var u=0;u<Wa.length;u++){var v=Wa[u];v.blockedOn===i&&(v.blockedOn=null)}for(;0<Wa.length&&(u=Wa[0],u.blockedOn===null);)gy(u),u.blockedOn===null&&Wa.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(v=0;v<u.length;v+=3){var L=u[v],O=u[v+1],U=L[en]||null;if(typeof O=="function")U||yy(u);else if(U){var W=null;if(O&&O.hasAttribute("formAction")){if(L=O,U=O[en]||null)W=U.formAction;else if(Rp(L)!==null)continue}else W=U.action;typeof W=="function"?u[v+1]=W:(u.splice(v,3),v-=3),yy(u)}}}function _p(i){this._internalRoot=i}qh.prototype.render=_p.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var u=o.current,v=fi();Lp(u,v,i,o,null,null)},qh.prototype.unmount=_p.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;Lp(i.current,2,null,i,null,null),Sh(),o[bn]=null}};function qh(i){this._internalRoot=i}qh.prototype.unstable_scheduleHydration=function(i){if(i){var o=gt();i={blockedOn:null,target:i,priority:o};for(var u=0;u<Wa.length&&o!==0&&o<Wa[u].priority;u++);Wa.splice(u,0,i),u===0&&gy(i)}};var xy=t.version;if(xy!=="19.1.0")throw Error(r(527,xy,"19.1.0"));K.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=m(o),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var e2={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wh.isDisabled&&Wh.supportsFiber)try{kt=Wh.inject(e2),$=Wh}catch{}}return Np.createRoot=function(i,o){if(!s(i))throw Error(r(299));var u=!1,v="",L=F1,O=ch,U=iv,W=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(v=o.identifierPrefix),o.onUncaughtError!==void 0&&(L=o.onUncaughtError),o.onCaughtError!==void 0&&(O=o.onCaughtError),o.onRecoverableError!==void 0&&(U=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(W=o.unstable_transitionCallbacks)),o=dy(i,1,!1,null,null,u,v,L,O,U,W,null),i[bn]=o.current,mp(i),new _p(o)},Np.hydrateRoot=function(i,o,u){if(!s(i))throw Error(r(299));var v=!1,L="",O=F1,U=ch,W=iv,ie=null,Ne=null;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(L=u.identifierPrefix),u.onUncaughtError!==void 0&&(O=u.onUncaughtError),u.onCaughtError!==void 0&&(U=u.onCaughtError),u.onRecoverableError!==void 0&&(W=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(ie=u.unstable_transitionCallbacks),u.formState!==void 0&&(Ne=u.formState)),o=dy(i,1,!0,o,u??null,v,L,O,U,W,ie,Ne),o.context=fy(null),u=o.current,v=fi(),v=Wt(v),L=Ma(v),L.callback=null,Ho(u,L,v),u=v,o.current.lanes=u,ft(o,u),mo(o),i[bn]=o.current,mp(i),new qh(o)},Np.version="19.1.0",Np}var QS;function NT(){if(QS)return a2.exports;QS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),a2.exports=MT(),a2.exports}var OT=NT();/**
 * react-router v7.13.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var ZS="popstate";function TT(e={}){function t(r,s){let{pathname:a,search:l,hash:h}=r.location;return sw("",{pathname:a,search:l,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:sg(s)}return AT(t,n,null,e)}function Nr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function la(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DT(){return Math.random().toString(36).substring(2,10)}function JS(e,t){return{usr:e.state,key:e.key,idx:t}}function sw(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Am(t):t,state:n,key:t&&t.key||r||DT()}}function sg({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Am(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function AT(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,l=s.history,h="POP",m=null,p=x();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function x(){return(l.state||{idx:null}).idx}function b(){h="POP";let S=x(),_=S==null?null:S-p;p=S,m&&m({action:h,location:C.location,delta:_})}function w(S,_){h="PUSH";let N=sw(C.location,S,_);p=x()+1;let c=JS(N,p),j=C.createHref(N);try{l.pushState(c,"",j)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(j)}a&&m&&m({action:h,location:C.location,delta:1})}function E(S,_){h="REPLACE";let N=sw(C.location,S,_);p=x();let c=JS(N,p),j=C.createHref(N);l.replaceState(c,"",j),a&&m&&m({action:h,location:C.location,delta:0})}function M(S){return jT(S)}let C={get action(){return h},get location(){return e(s,l)},listen(S){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(ZS,b),m=S,()=>{s.removeEventListener(ZS,b),m=null}},createHref(S){return t(s,S)},createURL:M,encodeLocation(S){let _=M(S);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:w,replace:E,go(S){return l.go(S)}};return C}function jT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Nr(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:sg(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function j8(e,t,n="/"){return kT(e,t,n,!1)}function kT(e,t,n,r){let s=typeof t=="string"?Am(t):t,a=ec(s.pathname||"/",n);if(a==null)return null;let l=k8(e);PT(l);let h=null;for(let m=0;h==null&&m<l.length;++m){let p=GT(a);h=qT(l[m],p,r)}return h}function k8(e,t=[],n=[],r="",s=!1){let a=(l,h,m=s,p)=>{let x={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:h,route:l};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(r)&&m)return;Nr(x.relativePath.startsWith(r),`Absolute route path "${x.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(r.length)}let b=Zl([r,x.relativePath]),w=n.concat(x);l.children&&l.children.length>0&&(Nr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),k8(l.children,t,w,b,m)),!(l.path==null&&!l.index)&&t.push({path:b,score:$T(b,l.index),routesMeta:w})};return e.forEach((l,h)=>{var m;if(l.path===""||!((m=l.path)!=null&&m.includes("?")))a(l,h);else for(let p of P8(l.path))a(l,h,!0,p)}),t}function P8(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let l=P8(r.join("/")),h=[];return h.push(...l.map(m=>m===""?a:[a,m].join("/"))),s&&h.push(...l),h.map(m=>e.startsWith("/")&&m===""?"/":m)}function PT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:VT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var zT=/^:[\w-]+$/,BT=3,UT=2,FT=1,HT=10,IT=-2,eC=e=>e==="*";function $T(e,t){let n=e.split("/"),r=n.length;return n.some(eC)&&(r+=IT),t&&(r+=UT),n.filter(s=>!eC(s)).reduce((s,a)=>s+(zT.test(a)?BT:a===""?FT:HT),r)}function VT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function qT(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",l=[];for(let h=0;h<r.length;++h){let m=r[h],p=h===r.length-1,x=a==="/"?t:t.slice(a.length)||"/",b=ux({path:m.relativePath,caseSensitive:m.caseSensitive,end:p},x),w=m.route;if(!b&&p&&n&&!r[r.length-1].route.index&&(b=ux({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},x)),!b)return null;Object.assign(s,b.params),l.push({params:s,pathname:Zl([a,b.pathname]),pathnameBase:QT(Zl([a,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(a=Zl([a,b.pathnameBase]))}return l}function ux(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=WT(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],l=a.replace(/(.)\/+$/,"$1"),h=s.slice(1);return{params:r.reduce((p,{paramName:x,isOptional:b},w)=>{if(x==="*"){let M=h[w]||"";l=a.slice(0,a.length-M.length).replace(/(.)\/+$/,"$1")}const E=h[w];return b&&!E?p[x]=void 0:p[x]=(E||"").replace(/%2F/g,"/"),p},{}),pathname:a,pathnameBase:l,pattern:e}}function WT(e,t=!1,n=!0){la(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,h,m)=>(r.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function GT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return la(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ec(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var YT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function XT(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Am(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=tC(n.substring(1),"/"):a=tC(n,t)):a=t,{pathname:a,search:ZT(r),hash:JT(s)}}function tC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function d2(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function KT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function T9(e){let t=KT(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function D9(e,t,n,r=!1){let s;typeof e=="string"?s=Am(e):(s={...e},Nr(!s.pathname||!s.pathname.includes("?"),d2("?","pathname","search",s)),Nr(!s.pathname||!s.pathname.includes("#"),d2("#","pathname","hash",s)),Nr(!s.search||!s.search.includes("#"),d2("#","search","hash",s)));let a=e===""||s.pathname==="",l=a?"/":s.pathname,h;if(l==null)h=n;else{let b=t.length-1;if(!r&&l.startsWith("..")){let w=l.split("/");for(;w[0]==="..";)w.shift(),b-=1;s.pathname=w.join("/")}h=b>=0?t[b]:"/"}let m=XT(s,h),p=l&&l!=="/"&&l.endsWith("/"),x=(a||l===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(p||x)&&(m.pathname+="/"),m}var Zl=e=>e.join("/").replace(/\/\/+/g,"/"),QT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ZT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,JT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,eD=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function tD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function nD(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var z8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function B8(e,t){let n=e;if(typeof n!="string"||!YT.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(z8)try{let a=new URL(window.location.href),l=n.startsWith("//")?new URL(a.protocol+n):new URL(n),h=ec(l.pathname,t);l.origin===a.origin&&h!=null?n=h+l.search+l.hash:s=!0}catch{la(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var U8=["POST","PUT","PATCH","DELETE"];new Set(U8);var rD=["GET",...U8];new Set(rD);var jm=y.createContext(null);jm.displayName="DataRouter";var Qx=y.createContext(null);Qx.displayName="DataRouterState";var iD=y.createContext(!1),F8=y.createContext({isTransitioning:!1});F8.displayName="ViewTransition";var sD=y.createContext(new Map);sD.displayName="Fetchers";var oD=y.createContext(null);oD.displayName="Await";var no=y.createContext(null);no.displayName="Navigation";var Ag=y.createContext(null);Ag.displayName="Location";var Oo=y.createContext({outlet:null,matches:[],isDataRoute:!1});Oo.displayName="Route";var A9=y.createContext(null);A9.displayName="RouteError";var H8="REACT_ROUTER_ERROR",aD="REDIRECT",lD="ROUTE_ERROR_RESPONSE";function cD(e){if(e.startsWith(`${H8}:${aD}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function uD(e){if(e.startsWith(`${H8}:${lD}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new eD(t.status,t.statusText,t.data)}catch{}}function dD(e,{relative:t}={}){Nr(km(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(no),{hash:s,pathname:a,search:l}=jg(e,{relative:t}),h=a;return n!=="/"&&(h=a==="/"?n:Zl([n,a])),r.createHref({pathname:h,search:l,hash:s})}function km(){return y.useContext(Ag)!=null}function To(){return Nr(km(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ag).location}var I8="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $8(e){y.useContext(no).static||y.useLayoutEffect(e)}function ma(){let{isDataRoute:e}=y.useContext(Oo);return e?RD():fD()}function fD(){Nr(km(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(jm),{basename:t,navigator:n}=y.useContext(no),{matches:r}=y.useContext(Oo),{pathname:s}=To(),a=JSON.stringify(T9(r)),l=y.useRef(!1);return $8(()=>{l.current=!0}),y.useCallback((m,p={})=>{if(la(l.current,I8),!l.current)return;if(typeof m=="number"){n.go(m);return}let x=D9(m,JSON.parse(a),s,p.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Zl([t,x.pathname])),(p.replace?n.replace:n.push)(x,p.state,p)},[t,n,a,s,e])}var hD=y.createContext(null);function mD(e){let t=y.useContext(Oo).outlet;return y.useMemo(()=>t&&y.createElement(hD.Provider,{value:e},t),[t,e])}function Zx(){let{matches:e}=y.useContext(Oo),t=e[e.length-1];return t?t.params:{}}function jg(e,{relative:t}={}){let{matches:n}=y.useContext(Oo),{pathname:r}=To(),s=JSON.stringify(T9(n));return y.useMemo(()=>D9(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function pD(e,t){return V8(e,t)}function V8(e,t,n,r,s){var N;Nr(km(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(no),{matches:l}=y.useContext(Oo),h=l[l.length-1],m=h?h.params:{},p=h?h.pathname:"/",x=h?h.pathnameBase:"/",b=h&&h.route;{let c=b&&b.path||"";W8(p,!b||c.endsWith("*")||c.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${c}">) 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.

Please change the parent <Route path="${c}"> to <Route path="${c==="/"?"*":`${c}/*`}">.`)}let w=To(),E;if(t){let c=typeof t=="string"?Am(t):t;Nr(x==="/"||((N=c.pathname)==null?void 0:N.startsWith(x)),`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 "${x}" but pathname "${c.pathname}" was given in the \`location\` prop.`),E=c}else E=w;let M=E.pathname||"/",C=M;if(x!=="/"){let c=x.replace(/^\//,"").split("/");C="/"+M.replace(/^\//,"").split("/").slice(c.length).join("/")}let S=j8(e,{pathname:C});la(b||S!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),la(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.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 _=bD(S&&S.map(c=>Object.assign({},c,{params:Object.assign({},m,c.params),pathname:Zl([x,a.encodeLocation?a.encodeLocation(c.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:c.pathname]),pathnameBase:c.pathnameBase==="/"?x:Zl([x,a.encodeLocation?a.encodeLocation(c.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:c.pathnameBase])})),l,n,r,s);return t&&_?y.createElement(Ag.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...E},navigationType:"POP"}},_):_}function gD(){let e=ED(),t=tD(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,l)}var vD=y.createElement(gD,null),q8=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=uD(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(Oo.Provider,{value:this.props.routeContext},y.createElement(A9.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(yD,{error:e},t):t}};q8.contextType=iD;var f2=new WeakMap;function yD({children:e,error:t}){let{basename:n}=y.useContext(no);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=cD(t.digest);if(r){let s=f2.get(t);if(s)throw s;let a=B8(r.location,n);if(z8&&!f2.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw f2.set(t,l),l}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function xD({routeContext:e,match:t,children:n}){let r=y.useContext(jm);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Oo.Provider,{value:e},n)}function bD(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=n==null?void 0:n.errors;if(l!=null){let x=a.findIndex(b=>b.route.id&&(l==null?void 0:l[b.route.id])!==void 0);Nr(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),a=a.slice(0,Math.min(a.length,x+1))}let h=!1,m=-1;if(n)for(let x=0;x<a.length;x++){let b=a[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=x),b.route.id){let{loaderData:w,errors:E}=n,M=b.route.loader&&!w.hasOwnProperty(b.route.id)&&(!E||E[b.route.id]===void 0);if(b.route.lazy||M){h=!0,m>=0?a=a.slice(0,m+1):a=[a[0]];break}}}let p=n&&r?(x,b)=>{var w,E;r(x,{location:n.location,params:((E=(w=n.matches)==null?void 0:w[0])==null?void 0:E.params)??{},unstable_pattern:nD(n.matches),errorInfo:b})}:void 0;return a.reduceRight((x,b,w)=>{let E,M=!1,C=null,S=null;n&&(E=l&&b.route.id?l[b.route.id]:void 0,C=b.route.errorElement||vD,h&&(m<0&&w===0?(W8("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),M=!0,S=null):m===w&&(M=!0,S=b.route.hydrateFallbackElement||null)));let _=t.concat(a.slice(0,w+1)),N=()=>{let c;return E?c=C:M?c=S:b.route.Component?c=y.createElement(b.route.Component,null):b.route.element?c=b.route.element:c=x,y.createElement(xD,{match:b,routeContext:{outlet:x,matches:_,isDataRoute:n!=null},children:c})};return n&&(b.route.ErrorBoundary||b.route.errorElement||w===0)?y.createElement(q8,{location:n.location,revalidation:n.revalidation,component:C,error:E,children:N(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:p}):N()},null)}function j9(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function LD(e){let t=y.useContext(jm);return Nr(t,j9(e)),t}function wD(e){let t=y.useContext(Qx);return Nr(t,j9(e)),t}function SD(e){let t=y.useContext(Oo);return Nr(t,j9(e)),t}function k9(e){let t=SD(e),n=t.matches[t.matches.length-1];return Nr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function CD(){return k9("useRouteId")}function ED(){var r;let e=y.useContext(A9),t=wD("useRouteError"),n=k9("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function RD(){let{router:e}=LD("useNavigate"),t=k9("useNavigate"),n=y.useRef(!1);return $8(()=>{n.current=!0}),y.useCallback(async(s,a={})=>{la(n.current,I8),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var nC={};function W8(e,t,n){!t&&!nC[e]&&(nC[e]=!0,la(!1,n))}y.memo(_D);function _D({routes:e,future:t,state:n,onError:r}){return V8(e,void 0,n,r,t)}function Xl({to:e,replace:t,state:n,relative:r}){Nr(km(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=y.useContext(no);la(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=y.useContext(Oo),{pathname:l}=To(),h=ma(),m=D9(e,T9(a),l,r==="path"),p=JSON.stringify(m);return y.useEffect(()=>{h(JSON.parse(p),{replace:t,state:n,relative:r})},[h,p,r,t,n]),null}function MD(e){return mD(e.context)}function oi(e){Nr(!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 ND({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1,unstable_useTransitions:l}){Nr(!km(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=e.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:h,navigator:s,static:a,unstable_useTransitions:l,future:{}}),[h,s,a,l]);typeof n=="string"&&(n=Am(n));let{pathname:p="/",search:x="",hash:b="",state:w=null,key:E="default"}=n,M=y.useMemo(()=>{let C=ec(p,h);return C==null?null:{location:{pathname:C,search:x,hash:b,state:w,key:E},navigationType:r}},[h,p,x,b,w,E,r]);return la(M!=null,`<Router basename="${h}"> is not able to match the URL "${p}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),M==null?null:y.createElement(no.Provider,{value:m},y.createElement(Ag.Provider,{children:t,value:M}))}function G8({children:e,location:t}){return pD(ow(e),t)}function ow(e,t=[]){let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let a=[...t,s];if(r.type===y.Fragment){n.push.apply(n,ow(r.props.children,a));return}Nr(r.type===oi,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=ow(r.props.children,a)),n.push(l)}),n}var Yy="get",Xy="application/x-www-form-urlencoded";function Jx(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OD(e){return Jx(e)&&e.tagName.toLowerCase()==="button"}function TD(e){return Jx(e)&&e.tagName.toLowerCase()==="form"}function DD(e){return Jx(e)&&e.tagName.toLowerCase()==="input"}function AD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jD(e,t){return e.button===0&&(!t||t==="_self")&&!AD(e)}var wy=null;function kD(){if(wy===null)try{new FormData(document.createElement("form"),0),wy=!1}catch{wy=!0}return wy}var PD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function h2(e){return e!=null&&!PD.has(e)?(la(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xy}"`),null):e}function zD(e,t){let n,r,s,a,l;if(TD(e)){let h=e.getAttribute("action");r=h?ec(h,t):null,n=e.getAttribute("method")||Yy,s=h2(e.getAttribute("enctype"))||Xy,a=new FormData(e)}else if(OD(e)||DD(e)&&(e.type==="submit"||e.type==="image")){let h=e.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||h.getAttribute("action");if(r=m?ec(m,t):null,n=e.getAttribute("formmethod")||h.getAttribute("method")||Yy,s=h2(e.getAttribute("formenctype"))||h2(h.getAttribute("enctype"))||Xy,a=new FormData(h,e),!kD()){let{name:p,type:x,value:b}=e;if(x==="image"){let w=p?`${p}.`:"";a.append(`${w}x`,"0"),a.append(`${w}y`,"0")}else p&&a.append(p,b)}}else{if(Jx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Yy,r=null,s=Xy,l=e}return a&&s==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function P9(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function BD(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&ec(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function UD(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function HD(e,t,n){let r=await Promise.all(e.map(async s=>{let a=t.routes[s.route.id];if(a){let l=await UD(a,n);return l.links?l.links():[]}return[]}));return qD(r.flat(1).filter(FD).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function rC(e,t,n,r,s,a){let l=(m,p)=>n[p]?m.route.id!==n[p].route.id:!0,h=(m,p)=>{var x;return n[p].pathname!==m.pathname||((x=n[p].route.path)==null?void 0:x.endsWith("*"))&&n[p].params["*"]!==m.params["*"]};return a==="assets"?t.filter((m,p)=>l(m,p)||h(m,p)):a==="data"?t.filter((m,p)=>{var b;let x=r.routes[m.route.id];if(!x||!x.hasLoader)return!1;if(l(m,p)||h(m,p))return!0;if(m.route.shouldRevalidate){let w=m.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function ID(e,t,{includeHydrateFallback:n}={}){return $D(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let a=[s.module];return s.clientActionModule&&(a=a.concat(s.clientActionModule)),s.clientLoaderModule&&(a=a.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(a=a.concat(s.hydrateFallbackModule)),s.imports&&(a=a.concat(s.imports)),a}).flat(1))}function $D(e){return[...new Set(e)]}function VD(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function qD(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let a=JSON.stringify(VD(s));return n.has(a)||(n.add(a),r.push({key:a,link:s})),r},[])}function Y8(){let e=y.useContext(jm);return P9(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function WD(){let e=y.useContext(Qx);return P9(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var z9=y.createContext(void 0);z9.displayName="FrameworkContext";function X8(){let e=y.useContext(z9);return P9(e,"You must render this element inside a <HydratedRouter> element"),e}function GD(e,t){let n=y.useContext(z9),[r,s]=y.useState(!1),[a,l]=y.useState(!1),{onFocus:h,onBlur:m,onMouseEnter:p,onMouseLeave:x,onTouchStart:b}=t,w=y.useRef(null);y.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let C=_=>{_.forEach(N=>{l(N.isIntersecting)})},S=new IntersectionObserver(C,{threshold:.5});return w.current&&S.observe(w.current),()=>{S.disconnect()}}},[e]),y.useEffect(()=>{if(r){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[r]);let E=()=>{s(!0)},M=()=>{s(!1),l(!1)};return n?e!=="intent"?[a,w,{}]:[a,w,{onFocus:Op(h,E),onBlur:Op(m,M),onMouseEnter:Op(p,E),onMouseLeave:Op(x,M),onTouchStart:Op(b,E)}]:[!1,w,{}]}function Op(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YD({page:e,...t}){let{router:n}=Y8(),r=y.useMemo(()=>j8(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(KD,{page:e,matches:r,...t}):null}function XD(e){let{manifest:t,routeModules:n}=X8(),[r,s]=y.useState([]);return y.useEffect(()=>{let a=!1;return HD(e,t,n).then(l=>{a||s(l)}),()=>{a=!0}},[e,t,n]),r}function KD({page:e,matches:t,...n}){let r=To(),{future:s,manifest:a,routeModules:l}=X8(),{basename:h}=Y8(),{loaderData:m,matches:p}=WD(),x=y.useMemo(()=>rC(e,t,p,a,r,"data"),[e,t,p,a,r]),b=y.useMemo(()=>rC(e,t,p,a,r,"assets"),[e,t,p,a,r]),w=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,S=!1;if(t.forEach(N=>{var j;let c=a.routes[N.route.id];!c||!c.hasLoader||(!x.some(D=>D.route.id===N.route.id)&&N.route.id in m&&((j=l[N.route.id])!=null&&j.shouldRevalidate)||c.hasClientLoader?S=!0:C.add(N.route.id))}),C.size===0)return[];let _=BD(e,h,s.unstable_trailingSlashAwareDataRequests,"data");return S&&C.size>0&&_.searchParams.set("_routes",t.filter(N=>C.has(N.route.id)).map(N=>N.route.id).join(",")),[_.pathname+_.search]},[h,s.unstable_trailingSlashAwareDataRequests,m,r,a,x,t,e,l]),E=y.useMemo(()=>ID(b,a),[b,a]),M=XD(b);return y.createElement(y.Fragment,null,w.map(C=>y.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),E.map(C=>y.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),M.map(({key:C,link:S})=>y.createElement("link",{key:C,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function QD(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var ZD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ZD&&(window.__reactRouterVersion="7.13.0")}catch{}function JD({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=y.useRef();s.current==null&&(s.current=TT({window:r,v5Compat:!0}));let a=s.current,[l,h]=y.useState({action:a.action,location:a.location}),m=y.useCallback(p=>{n===!1?h(p):y.startTransition(()=>h(p))},[n]);return y.useLayoutEffect(()=>a.listen(m),[a,m]),y.createElement(ND,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,unstable_useTransitions:n})}var K8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eb=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:a,replace:l,state:h,target:m,to:p,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:w,...E},M){let{basename:C,unstable_useTransitions:S}=y.useContext(no),_=typeof p=="string"&&K8.test(p),N=B8(p,C);p=N.to;let c=dD(p,{relative:s}),[j,D,B]=GD(r,E),T=rA(p,{replace:l,state:h,target:m,preventScrollReset:x,relative:s,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:S});function A(F){t&&t(F),F.defaultPrevented||T(F)}let H=y.createElement("a",{...E,...B,href:N.absoluteURL||c,onClick:N.isExternal||a?t:A,ref:QD(M,D),target:m,"data-discover":!_&&n==="render"?"true":void 0});return j&&!_?y.createElement(y.Fragment,null,H,y.createElement(YD,{page:c})):H});eb.displayName="Link";var eA=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:a,to:l,viewTransition:h,children:m,...p},x){let b=jg(l,{relative:p.relative}),w=To(),E=y.useContext(Qx),{navigator:M,basename:C}=y.useContext(no),S=E!=null&&lA(b)&&h===!0,_=M.encodeLocation?M.encodeLocation(b).pathname:b.pathname,N=w.pathname,c=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;n||(N=N.toLowerCase(),c=c?c.toLowerCase():null,_=_.toLowerCase()),c&&C&&(c=ec(c,C)||c);const j=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let D=N===_||!s&&N.startsWith(_)&&N.charAt(j)==="/",B=c!=null&&(c===_||!s&&c.startsWith(_)&&c.charAt(_.length)==="/"),T={isActive:D,isPending:B,isTransitioning:S},A=D?t:void 0,H;typeof r=="function"?H=r(T):H=[r,D?"active":null,B?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(T):a;return y.createElement(eb,{...p,"aria-current":A,className:H,ref:x,style:F,to:l,viewTransition:h},typeof m=="function"?m(T):m)});eA.displayName="NavLink";var tA=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:a,method:l=Yy,action:h,onSubmit:m,relative:p,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:w,...E},M)=>{let{unstable_useTransitions:C}=y.useContext(no),S=oA(),_=aA(h,{relative:p}),N=l.toLowerCase()==="get"?"get":"post",c=typeof h=="string"&&K8.test(h),j=D=>{if(m&&m(D),D.defaultPrevented)return;D.preventDefault();let B=D.nativeEvent.submitter,T=(B==null?void 0:B.getAttribute("formmethod"))||l,A=()=>S(B||D.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:s,state:a,relative:p,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:w});C&&n!==!1?y.startTransition(()=>A()):A()};return y.createElement("form",{ref:M,method:N,action:_,onSubmit:r?m:j,...E,"data-discover":!c&&e==="render"?"true":void 0})});tA.displayName="Form";function nA(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Q8(e){let t=y.useContext(jm);return Nr(t,nA(e)),t}function rA(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:h,unstable_useTransitions:m}={}){let p=ma(),x=To(),b=jg(e,{relative:a});return y.useCallback(w=>{if(jD(w,t)){w.preventDefault();let E=n!==void 0?n:sg(x)===sg(b),M=()=>p(e,{replace:E,state:r,preventScrollReset:s,relative:a,viewTransition:l,unstable_defaultShouldRevalidate:h});m?y.startTransition(()=>M()):M()}},[x,p,b,n,r,t,e,s,a,l,h,m])}var iA=0,sA=()=>`__${String(++iA)}__`;function oA(){let{router:e}=Q8("useSubmit"),{basename:t}=y.useContext(no),n=CD(),r=e.fetch,s=e.navigate;return y.useCallback(async(a,l={})=>{let{action:h,method:m,encType:p,formData:x,body:b}=zD(a,t);if(l.navigate===!1){let w=l.fetcherKey||sA();await r(w,n,l.action||h,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:x,body:b,formMethod:l.method||m,formEncType:l.encType||p,flushSync:l.flushSync})}else await s(l.action||h,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:x,body:b,formMethod:l.method||m,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,s,t,n])}function aA(e,{relative:t}={}){let{basename:n}=y.useContext(no),r=y.useContext(Oo);Nr(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),a={...jg(e||".",{relative:t})},l=To();if(e==null){a.search=l.search;let h=new URLSearchParams(a.search),m=h.getAll("index");if(m.some(x=>x==="")){h.delete("index"),m.filter(b=>b).forEach(b=>h.append("index",b));let x=h.toString();a.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Zl([n,a.pathname])),sg(a)}function lA(e,{relative:t}={}){let n=y.useContext(F8);Nr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Q8("useViewTransitionState"),s=jg(e,{relative:t});if(!n.isTransitioning)return!1;let a=ec(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ec(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ux(s.pathname,l)!=null||ux(s.pathname,a)!=null}var ol=Kx();const cA=D8(ol);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),iC=e=>{const t=dA(e);return t.charAt(0).toUpperCase()+t.slice(1)},Z8=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),fA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var hA={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"};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mA=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:l,...h},m)=>y.createElement("svg",{ref:m,...hA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Z8("lucide",s),...!a&&!fA(h)&&{"aria-hidden":"true"},...h},[...l.map(([p,x])=>y.createElement(p,x)),...Array.isArray(a)?a:[a]]));/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Je=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(mA,{ref:a,iconNode:t,className:Z8(`lucide-${uA(iC(e))}`,`lucide-${e}`,r),...s}));return n.displayName=iC(e),n};/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pA=[["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"}]],B9=Je("activity",pA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gA=[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]],vA=Je("alarm-clock",gA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yA=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],xA=Je("align-center",yA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sa=Je("arrow-left",bA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wA=Je("arrow-right",LA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SA=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],CA=Je("audio-lines",SA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EA=[["path",{d:"M15 7h1a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-2",key:"1sdynx"}],["path",{d:"M6 7H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h1",key:"1gkd3k"}],["path",{d:"m11 7-3 5h4l-3 5",key:"b4a64w"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]],J8=Je("battery-charging",EA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RA=[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]],U9=Je("battery",RA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _A=[["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"}]],e3=Je("bell",_A);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MA=[["path",{d:"M3 3h18",key:"o7r712"}],["path",{d:"M20 7H8",key:"gd2fo2"}],["path",{d:"M20 11H8",key:"1ynp89"}],["path",{d:"M10 19h10",key:"19hjk5"}],["path",{d:"M8 15h12",key:"1yqzne"}],["path",{d:"M4 3v14",key:"fggqzn"}],["circle",{cx:"4",cy:"19",r:"2",key:"p3m9r0"}]],t3=Je("blinds",MA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NA=[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],n3=Je("calendar-days",NA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OA=[["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"}]],TA=Je("calendar",OA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DA=[["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"}]],AA=Je("camera",DA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jA=[["path",{d:"m21 8-2 2-1.5-3.7A2 2 0 0 0 15.646 5H8.4a2 2 0 0 0-1.903 1.257L5 10 3 8",key:"1imjwt"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 14h.01",key:"7oqj8z"}],["rect",{width:"18",height:"8",x:"3",y:"10",rx:"2",key:"a7itu8"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]],kA=Je("car-front",jA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PA=[["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"}]],zA=Je("car",PA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BA=[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]],UA=Je("cat",BA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],aw=Je("check",FA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wo=Je("chevron-down",HA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Zd=Je("chevron-left",IA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jd=Je("chevron-right",$A);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pu=Je("chevron-up",VA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qA=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],WA=Je("chevrons-up-down",qA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GA=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],YA=Je("chevrons-up",GA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],KA=Je("circle-x",XA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZA=Je("circle",QA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JA=[["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"}]],ej=Je("crosshair",JA);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tj=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],nj=Je("database",tj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rj=[["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"}]],ij=Je("dog",rj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sj=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],F9=Je("door-open",sj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oj=[["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"}]],aj=Je("download",oj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lj=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],cj=Je("droplets",lj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uj=[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]],dj=Je("fan",uj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fj=[["polygon",{points:"13 19 22 12 13 5 13 19",key:"587y9g"}],["polygon",{points:"2 19 11 12 2 5 2 19",key:"3pweh0"}]],hj=Je("fast-forward",fj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mj=[["path",{d:"M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z",key:"18jl4k"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.5 15H9",key:"1oz8nu"}]],pj=Je("feather",mj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gj=[["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"}]],ef=Je("film",gj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vj=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],yj=Je("flame",vj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xj=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],r3=Je("gauge",xj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bj=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Lj=Je("git-merge",bj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wj=[["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"}]],Sj=Je("grip-vertical",wj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cj=[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]],Ej=Je("hourglass",Cj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rj=[["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"}]],_j=Je("house",Rj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Nj=Je("image",Mj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oj=[["path",{d:"M10.293 2.293a1 1 0 0 1 1.414 0l2.5 2.5 5.994 1.227a1 1 0 0 1 .506 1.687l-7 7a1 1 0 0 1-1.687-.506l-1.227-5.994-2.5-2.5a1 1 0 0 1 0-1.414z",key:"sb8slu"}],["path",{d:"m14.207 4.793-3.414 3.414",key:"m2x3oj"}],["path",{d:"M3 20a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z",key:"8b3myj"}],["path",{d:"m9.086 6.5-4.793 4.793a1 1 0 0 0-.18 1.17L7 18",key:"43s6cu"}]],Tj=Je("lamp-desk",Oj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dj=[["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M4.077 10.615A1 1 0 0 0 5 12h14a1 1 0 0 0 .923-1.385l-3.077-7.384A2 2 0 0 0 15 2H9a2 2 0 0 0-1.846 1.23Z",key:"1l7kg2"}],["path",{d:"M8 20a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z",key:"1mmzpi"}]],Aj=Je("lamp",Dj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jj=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],tb=Je("layout-grid",jj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kj=[["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"}]],H9=Je("lightbulb",kj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],i3=Je("loader-circle",Pj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zj=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],s3=Je("lock",zj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bj=[["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"}]],Uj=Je("log-out",Bj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fj=[["path",{d:"M22 17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.5C2 7 4 5 6.5 5H18c2.2 0 4 1.8 4 4v8Z",key:"1lbycx"}],["polyline",{points:"15,9 18,9 18,11",key:"1pm9c0"}],["path",{d:"M6.5 5C9 5 11 7 11 9.5V17a2 2 0 0 1-2 2",key:"15i455"}],["line",{x1:"6",x2:"7",y1:"10",y2:"10",key:"1e2scm"}]],Hj=Je("mailbox",Fj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ij=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],$j=Je("maximize-2",Ij);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vj=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],qj=Je("mic-off",Vj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wj=[["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"}]],Gj=Je("mic",Wj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yj=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Xj=Je("minimize-2",Yj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kj=[["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"}]],Qj=Je("monitor",Kj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zj=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],nb=Je("moon",Zj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jj=[["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"}]],ek=Je("package",Jj);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tk=[["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"}]],og=Je("pause",tk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nk=[["circle",{cx:"11",cy:"4",r:"2",key:"vol9p0"}],["circle",{cx:"18",cy:"8",r:"2",key:"17gozi"}],["circle",{cx:"20",cy:"16",r:"2",key:"1v9bxh"}],["path",{d:"M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z",key:"1ydw1z"}]],sC=Je("paw-print",nk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rk=[["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"}]],lw=Je("pencil",rk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ik=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]],sk=Je("person-standing",ik);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ok=[["path",{d:"M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4",key:"daa4of"}],["rect",{width:"10",height:"7",x:"12",y:"13",rx:"2",key:"1nb8gs"}]],ak=Je("picture-in-picture-2",ok);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lk=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],tf=Je("play",lk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ck=[["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"}]],uk=Je("plug",ck);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oC=Je("plus",dk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fk=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],hk=Je("power",fk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mk=[["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"}]],dx=Je("radio",mk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pk=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o3=Je("rotate-ccw",pk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gk=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 9h.01",key:"x1ddxp"}]],vk=Je("scan-face",gk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],a3=Je("search",yk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xk=[["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"}]],ag=Je("settings",xk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bk=[["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"}]],l3=Je("shield",bk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lk=[["path",{d:"M7 18v-6a5 5 0 1 1 10 0v6",key:"pcx96s"}],["path",{d:"M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z",key:"1b4s83"}],["path",{d:"M21 12h1",key:"jtio3y"}],["path",{d:"M18.5 4.5 18 5",key:"g5sp9y"}],["path",{d:"M2 12h1",key:"1uaihz"}],["path",{d:"M12 2v1",key:"11qlp1"}],["path",{d:"m4.929 4.929.707.707",key:"1i51kw"}],["path",{d:"M12 12v6",key:"3ahymv"}]],c3=Je("siren",Lk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wk=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Sk=Je("smartphone",wk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ck=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],u3=Je("sparkles",Ck);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ek=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["circle",{cx:"12",cy:"14",r:"4",key:"1jruaj"}],["path",{d:"M12 14h.01",key:"1etili"}]],Rk=Je("speaker",Ek);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _k=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],I9=Je("square",_k);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mk=[["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"}]],d3=Je("sun",Mk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nk=[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]],f3=Je("tags",Nk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ok=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],Tk=Je("thermometer",Ok);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dk=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],aC=Je("timer",Dk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ak=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],h3=Je("toggle-left",Ak);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jk=[["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"}]],kk=Je("trash-2",jk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pk=[["path",{d:"m17 2-5 5-5-5",key:"16satq"}],["rect",{width:"20",height:"15",x:"2",y:"7",rx:"2",key:"1e6viu"}]],zk=Je("tv",Pk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bk=[["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"}]],pf=Je("video",Bk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uk=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],Xd=Je("volume-2",Uk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fk=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],fx=Je("volume-x",Fk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hk=[["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"}]],m3=Je("wifi-off",Hk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ik=[["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"}]],$k=Je("wifi",Ik);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vk=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],cw=Je("wind",Vk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gf=Je("x",qk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wk=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],$9=Je("zap",Wk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gk=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],uw=Je("zoom-in",Gk);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yk=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],dw=Je("zoom-out",Yk);function p3(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=p3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function kg(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=p3(e))&&(r&&(r+=" "),r+=t);return r}const V9="-",Xk=e=>{const t=Qk(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const h=l.split(V9);return h[0]===""&&h.length!==1&&h.shift(),g3(h,t)||Kk(l)},getConflictingClassGroupIds:(l,h)=>{const m=n[l]||[];return h&&r[l]?[...m,...r[l]]:m}}},g3=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?g3(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(V9);return(l=t.validators.find(({validator:h})=>h(a)))==null?void 0:l.classGroupId},lC=/^\[(.+)\]$/,Kk=e=>{if(lC.test(e)){const t=lC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Qk=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)fw(n[s],r,s,t);return r},fw=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:cC(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(Zk(s)){fw(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,l])=>{fw(l,cC(t,a),n,r)})})},cC=(e,t)=>{let n=e;return t.split(V9).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Zk=e=>e.isThemeGetter,Jk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return s(a,l),l},set(a,l){n.has(a)?n.set(a,l):s(a,l)}}},hw="!",mw=":",eP=mw.length,tP=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const a=[];let l=0,h=0,m=0,p;for(let M=0;M<s.length;M++){let C=s[M];if(l===0&&h===0){if(C===mw){a.push(s.slice(m,M)),m=M+eP;continue}if(C==="/"){p=M;continue}}C==="["?l++:C==="]"?l--:C==="("?h++:C===")"&&h--}const x=a.length===0?s:s.substring(m),b=nP(x),w=b!==x,E=p&&p>m?p-m:void 0;return{modifiers:a,hasImportantModifier:w,baseClassName:b,maybePostfixModifierPosition:E}};if(t){const s=t+mw,a=r;r=l=>l.startsWith(s)?a(l.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=a=>n({className:a,parseClassName:s})}return r},nP=e=>e.endsWith(hw)?e.substring(0,e.length-1):e.startsWith(hw)?e.substring(1):e,rP=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let a=[];return r.forEach(l=>{l[0]==="["||t[l]?(s.push(...a.sort(),l),a=[]):a.push(l)}),s.push(...a.sort()),s}},iP=e=>({cache:Jk(e.cacheSize),parseClassName:tP(e),sortModifiers:rP(e),...Xk(e)}),sP=/\s+/,oP=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],h=e.trim().split(sP);let m="";for(let p=h.length-1;p>=0;p-=1){const x=h[p],{isExternal:b,modifiers:w,hasImportantModifier:E,baseClassName:M,maybePostfixModifierPosition:C}=n(x);if(b){m=x+(m.length>0?" "+m:m);continue}let S=!!C,_=r(S?M.substring(0,C):M);if(!_){if(!S){m=x+(m.length>0?" "+m:m);continue}if(_=r(M),!_){m=x+(m.length>0?" "+m:m);continue}S=!1}const N=a(w).join(":"),c=E?N+hw:N,j=c+_;if(l.includes(j))continue;l.push(j);const D=s(_,S);for(let B=0;B<D.length;++B){const T=D[B];l.push(c+T)}m=x+(m.length>0?" "+m:m)}return m};function aP(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=v3(t))&&(r&&(r+=" "),r+=n);return r}const v3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=v3(e[r]))&&(n&&(n+=" "),n+=t);return n};function lP(e,...t){let n,r,s,a=l;function l(m){const p=t.reduce((x,b)=>b(x),e());return n=iP(p),r=n.cache.get,s=n.cache.set,a=h,h(m)}function h(m){const p=r(m);if(p)return p;const x=oP(m,n);return s(m,x),x}return function(){return a(aP.apply(null,arguments))}}const si=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},y3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,x3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cP=/^\d+\/\d+$/,uP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dP=/\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$/,fP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,hP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gh=e=>cP.test(e),xn=e=>!!e&&!Number.isNaN(Number(e)),Qc=e=>!!e&&Number.isInteger(Number(e)),m2=e=>e.endsWith("%")&&xn(e.slice(0,-1)),Vl=e=>uP.test(e),pP=()=>!0,gP=e=>dP.test(e)&&!fP.test(e),b3=()=>!1,vP=e=>hP.test(e),yP=e=>mP.test(e),xP=e=>!Et(e)&&!Rt(e),bP=e=>Pm(e,S3,b3),Et=e=>y3.test(e),Dd=e=>Pm(e,C3,gP),p2=e=>Pm(e,EP,xn),uC=e=>Pm(e,L3,b3),LP=e=>Pm(e,w3,yP),Sy=e=>Pm(e,E3,vP),Rt=e=>x3.test(e),Tp=e=>zm(e,C3),wP=e=>zm(e,RP),dC=e=>zm(e,L3),SP=e=>zm(e,S3),CP=e=>zm(e,w3),Cy=e=>zm(e,E3,!0),Pm=(e,t,n)=>{const r=y3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zm=(e,t,n=!1)=>{const r=x3.exec(e);return r?r[1]?t(r[1]):n:!1},L3=e=>e==="position"||e==="percentage",w3=e=>e==="image"||e==="url",S3=e=>e==="length"||e==="size"||e==="bg-size",C3=e=>e==="length",EP=e=>e==="number",RP=e=>e==="family-name",E3=e=>e==="shadow",_P=()=>{const e=si("color"),t=si("font"),n=si("text"),r=si("font-weight"),s=si("tracking"),a=si("leading"),l=si("breakpoint"),h=si("container"),m=si("spacing"),p=si("radius"),x=si("shadow"),b=si("inset-shadow"),w=si("text-shadow"),E=si("drop-shadow"),M=si("blur"),C=si("perspective"),S=si("aspect"),_=si("ease"),N=si("animate"),c=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...j(),Rt,Et],B=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[Rt,Et,m],H=()=>[Gh,"full","auto",...A()],F=()=>[Qc,"none","subgrid",Rt,Et],V=()=>["auto",{span:["full",Qc,Rt,Et]},Qc,Rt,Et],ee=()=>[Qc,"auto",Rt,Et],G=()=>["auto","min","max","fr",Rt,Et],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Ce=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...A()],K=()=>[Gh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],Z=()=>[e,Rt,Et],oe=()=>[...j(),dC,uC,{position:[Rt,Et]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",SP,bP,{size:[Rt,Et]}],X=()=>[m2,Tp,Dd],ue=()=>["","none","full",p,Rt,Et],pe=()=>["",xn,Tp,Dd],Se=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[xn,m2,dC,uC],ve=()=>["","none",M,Rt,Et],he=()=>["none",xn,Rt,Et],de=()=>["none",xn,Rt,Et],ke=()=>[xn,Rt,Et],Ee=()=>[Gh,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vl],breakpoint:[Vl],color:[pP],container:[Vl],"drop-shadow":[Vl],ease:["in","out","in-out"],font:[xP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vl],shadow:[Vl],spacing:["px",xn],text:[Vl],"text-shadow":[Vl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gh,Et,Rt,S]}],container:["container"],columns:[{columns:[xn,Et,Rt,h]}],"break-after":[{"break-after":c()}],"break-before":[{"break-before":c()}],"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:D()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:H()}],"inset-x":[{"inset-x":H()}],"inset-y":[{"inset-y":H()}],start:[{start:H()}],end:[{end:H()}],top:[{top:H()}],right:[{right:H()}],bottom:[{bottom:H()}],left:[{left:H()}],visibility:["visible","invisible","collapse"],z:[{z:[Qc,"auto",Rt,Et]}],basis:[{basis:[Gh,"full","auto",h,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xn,Gh,"auto","initial","none",Et]}],grow:[{grow:["",xn,Rt,Et]}],shrink:[{shrink:["",xn,Rt,Et]}],order:[{order:[Qc,"first","last","none",Rt,Et]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...Ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...Ce()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...Ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...Ce(),"baseline"]}],"place-self":[{"place-self":["auto",...Ce()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[h,"screen",...K()]}],"min-w":[{"min-w":[h,"screen","none",...K()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[l]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,Tp,Dd]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Rt,p2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",m2,Et]}],"font-family":[{font:[wP,Et,t]}],"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:[s,Rt,Et]}],"line-clamp":[{"line-clamp":[xn,"none",Rt,p2]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",Rt,Et]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Rt,Et]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[xn,"from-font","auto",Rt,Dd]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[xn,"auto",Rt,Et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Rt,Et]}],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",Rt,Et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qc,Rt,Et],radial:["",Rt,Et],conic:[Qc,Rt,Et]},CP,LP]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xn,Rt,Et]}],"outline-w":[{outline:["",xn,Tp,Dd]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",x,Cy,Sy]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",b,Cy,Sy]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[xn,Dd]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",w,Cy,Sy]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[xn,Rt,Et]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"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":[xn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[Rt,Et]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"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":j()}],"mask-image-conic-pos":[{"mask-conic":[xn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Rt,Et]}],filter:[{filter:["","none",Rt,Et]}],blur:[{blur:ve()}],brightness:[{brightness:[xn,Rt,Et]}],contrast:[{contrast:[xn,Rt,Et]}],"drop-shadow":[{"drop-shadow":["","none",E,Cy,Sy]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",xn,Rt,Et]}],"hue-rotate":[{"hue-rotate":[xn,Rt,Et]}],invert:[{invert:["",xn,Rt,Et]}],saturate:[{saturate:[xn,Rt,Et]}],sepia:[{sepia:["",xn,Rt,Et]}],"backdrop-filter":[{"backdrop-filter":["","none",Rt,Et]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[xn,Rt,Et]}],"backdrop-contrast":[{"backdrop-contrast":[xn,Rt,Et]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xn,Rt,Et]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xn,Rt,Et]}],"backdrop-invert":[{"backdrop-invert":["",xn,Rt,Et]}],"backdrop-opacity":[{"backdrop-opacity":[xn,Rt,Et]}],"backdrop-saturate":[{"backdrop-saturate":[xn,Rt,Et]}],"backdrop-sepia":[{"backdrop-sepia":["",xn,Rt,Et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Rt,Et]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xn,"initial",Rt,Et]}],ease:[{ease:["linear","initial",_,Rt,Et]}],delay:[{delay:[xn,Rt,Et]}],animate:[{animate:["none",N,Rt,Et]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Rt,Et]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ke()}],"skew-x":[{"skew-x":ke()}],"skew-y":[{"skew-y":ke()}],transform:[{transform:[Rt,Et,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"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",Rt,Et]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Rt,Et]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[xn,Tp,Dd,p2]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},MP=lP(_P);function He(...e){return MP(kg(e))}function fC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function cl(...e){return t=>{let n=!1;const r=e.map(s=>{const a=fC(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():fC(e[s],null)}}}}function Qt(...e){return y.useCallback(cl(...e),e)}function tc(e){const t=NP(e),n=y.forwardRef((r,s)=>{const{children:a,...l}=r,h=y.Children.toArray(a),m=h.find(TP);if(m){const p=m.props.children,x=h.map(b=>b===m?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:b);return f.jsx(t,{...l,ref:s,children:y.isValidElement(p)?y.cloneElement(p,void 0,x):null})}return f.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}var q9=tc("Slot");function NP(e){const t=y.forwardRef((n,r)=>{const{children:s,...a}=n;if(y.isValidElement(s)){const l=AP(s),h=DP(a,s.props);return s.type!==y.Fragment&&(h.ref=r?cl(r,l):l),y.cloneElement(s,h)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var R3=Symbol("radix.slottable");function OP(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=R3,t}function TP(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R3}function DP(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...h)=>{const m=a(...h);return s(...h),m}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function AP(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const hC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mC=kg,rb=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(p=>{const x=n==null?void 0:n[p],b=a==null?void 0:a[p];if(x===null)return null;const w=hC(x)||hC(b);return s[p][w]}),h=n&&Object.entries(n).reduce((p,x)=>{let[b,w]=x;return w===void 0||(p[b]=w),p},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((p,x)=>{let{class:b,className:w,...E}=x;return Object.entries(E).every(M=>{let[C,S]=M;return Array.isArray(S)?S.includes({...a,...h}[C]):{...a,...h}[C]===S})?[...p,b,w]:p},[]);return mC(e,l,m,n==null?void 0:n.class,n==null?void 0:n.className)},pw=rb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Qe({className:e,variant:t,size:n,asChild:r=!1,...s}){const a=r?q9:"button";return f.jsx(a,{"data-slot":"button",className:He(pw({variant:t,size:n,className:e})),...s})}function nf({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:He("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function jP({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:He("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function kP({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:He("leading-none font-semibold",e),...t})}function PP({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:He("text-muted-foreground text-sm",e),...t})}function zP({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:He("px-6",e),...t})}function Li({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:He("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var BP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=BP.reduce((e,t)=>{const n=tc(`Primitive.${t}`),r=y.forwardRef((s,a)=>{const{asChild:l,...h}=s,m=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...h,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ib(e,t){e&&ol.flushSync(()=>e.dispatchEvent(t))}var UP="Label",_3=y.forwardRef((e,t)=>f.jsx(Lt.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));_3.displayName=UP;var FP=_3;function Tr({className:e,...t}){return f.jsx(FP,{"data-slot":"label",className:He("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function M3(e,t){return function(){return e.apply(t,arguments)}}const{toString:HP}=Object.prototype,{getPrototypeOf:W9}=Object,{iterator:sb,toStringTag:N3}=Symbol,ob=(e=>t=>{const n=HP.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pa=e=>(e=e.toLowerCase(),t=>ob(t)===e),ab=e=>t=>typeof t===e,{isArray:Bm}=Array,lg=ab("undefined");function IP(e){return e!==null&&!lg(e)&&e.constructor!==null&&!lg(e.constructor)&&Ds(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const O3=pa("ArrayBuffer");function $P(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&O3(e.buffer),t}const VP=ab("string"),Ds=ab("function"),T3=ab("number"),lb=e=>e!==null&&typeof e=="object",qP=e=>e===!0||e===!1,Ky=e=>{if(ob(e)!=="object")return!1;const t=W9(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(N3 in e)&&!(sb in e)},WP=pa("Date"),GP=pa("File"),YP=pa("Blob"),XP=pa("FileList"),KP=e=>lb(e)&&Ds(e.pipe),QP=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ds(e.append)&&((t=ob(e))==="formdata"||t==="object"&&Ds(e.toString)&&e.toString()==="[object FormData]"))},ZP=pa("URLSearchParams"),[JP,ez,tz,nz]=["ReadableStream","Request","Response","Headers"].map(pa),rz=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pg(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Bm(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),l=a.length;let h;for(r=0;r<l;r++)h=a[r],t.call(null,e[h],h,e)}}function D3(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const zd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,A3=e=>!lg(e)&&e!==zd;function gw(){const{caseless:e}=A3(this)&&this||{},t={},n=(r,s)=>{const a=e&&D3(t,s)||s;Ky(t[a])&&Ky(r)?t[a]=gw(t[a],r):Ky(r)?t[a]=gw({},r):Bm(r)?t[a]=r.slice():t[a]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Pg(arguments[r],n);return t}const iz=(e,t,n,{allOwnKeys:r}={})=>(Pg(t,(s,a)=>{n&&Ds(s)?e[a]=M3(s,n):e[a]=s},{allOwnKeys:r}),e),sz=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),oz=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},az=(e,t,n,r)=>{let s,a,l;const h={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),a=s.length;a-- >0;)l=s[a],(!r||r(l,e,t))&&!h[l]&&(t[l]=e[l],h[l]=!0);e=n!==!1&&W9(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},lz=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cz=e=>{if(!e)return null;if(Bm(e))return e;let t=e.length;if(!T3(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},uz=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&W9(Uint8Array)),dz=(e,t)=>{const r=(e&&e[sb]).call(e);let s;for(;(s=r.next())&&!s.done;){const a=s.value;t.call(e,a[0],a[1])}},fz=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},hz=pa("HTMLFormElement"),mz=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),pC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pz=pa("RegExp"),j3=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Pg(n,(s,a)=>{let l;(l=t(s,a,e))!==!1&&(r[a]=l||s)}),Object.defineProperties(e,r)},gz=e=>{j3(e,(t,n)=>{if(Ds(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ds(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vz=(e,t)=>{const n={},r=s=>{s.forEach(a=>{n[a]=!0})};return Bm(e)?r(e):r(String(e).split(t)),n},yz=()=>{},xz=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bz(e){return!!(e&&Ds(e.append)&&e[N3]==="FormData"&&e[sb])}const Lz=e=>{const t=new Array(10),n=(r,s)=>{if(lb(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const a=Bm(r)?[]:{};return Pg(r,(l,h)=>{const m=n(l,s+1);!lg(m)&&(a[h]=m)}),t[s]=void 0,a}}return r};return n(e,0)},wz=pa("AsyncFunction"),Sz=e=>e&&(lb(e)||Ds(e))&&Ds(e.then)&&Ds(e.catch),k3=((e,t)=>e?setImmediate:t?((n,r)=>(zd.addEventListener("message",({source:s,data:a})=>{s===zd&&a===n&&r.length&&r.shift()()},!1),s=>{r.push(s),zd.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ds(zd.postMessage)),Cz=typeof queueMicrotask<"u"?queueMicrotask.bind(zd):typeof process<"u"&&process.nextTick||k3,Ez=e=>e!=null&&Ds(e[sb]),Be={isArray:Bm,isArrayBuffer:O3,isBuffer:IP,isFormData:QP,isArrayBufferView:$P,isString:VP,isNumber:T3,isBoolean:qP,isObject:lb,isPlainObject:Ky,isReadableStream:JP,isRequest:ez,isResponse:tz,isHeaders:nz,isUndefined:lg,isDate:WP,isFile:GP,isBlob:YP,isRegExp:pz,isFunction:Ds,isStream:KP,isURLSearchParams:ZP,isTypedArray:uz,isFileList:XP,forEach:Pg,merge:gw,extend:iz,trim:rz,stripBOM:sz,inherits:oz,toFlatObject:az,kindOf:ob,kindOfTest:pa,endsWith:lz,toArray:cz,forEachEntry:dz,matchAll:fz,isHTMLForm:hz,hasOwnProperty:pC,hasOwnProp:pC,reduceDescriptors:j3,freezeMethods:gz,toObjectSet:vz,toCamelCase:mz,noop:yz,toFiniteNumber:xz,findKey:D3,global:zd,isContextDefined:A3,isSpecCompliantForm:bz,toJSONObject:Lz,isAsyncFn:wz,isThenable:Sz,setImmediate:k3,asap:Cz,isIterable:Ez};function un(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Be.inherits(un,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.status}}});const P3=un.prototype,z3={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{z3[e]={value:e}});Object.defineProperties(un,z3);Object.defineProperty(P3,"isAxiosError",{value:!0});un.from=(e,t,n,r,s,a)=>{const l=Object.create(P3);return Be.toFlatObject(e,l,function(m){return m!==Error.prototype},h=>h!=="isAxiosError"),un.call(l,e.message,t,n,r,s),l.cause=e,l.name=e.name,a&&Object.assign(l,a),l};const Rz=null;function vw(e){return Be.isPlainObject(e)||Be.isArray(e)}function B3(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function gC(e,t,n){return e?e.concat(t).map(function(s,a){return s=B3(s),!n&&a?"["+s+"]":s}).join(n?".":""):t}function _z(e){return Be.isArray(e)&&!e.some(vw)}const Mz=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function cb(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!Be.isUndefined(S[C])});const r=n.metaTokens,s=n.visitor||x,a=n.dots,l=n.indexes,m=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(s))throw new TypeError("visitor must be a function");function p(M){if(M===null)return"";if(Be.isDate(M))return M.toISOString();if(!m&&Be.isBlob(M))throw new un("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(M)||Be.isTypedArray(M)?m&&typeof Blob=="function"?new Blob([M]):Buffer.from(M):M}function x(M,C,S){let _=M;if(M&&!S&&typeof M=="object"){if(Be.endsWith(C,"{}"))C=r?C:C.slice(0,-2),M=JSON.stringify(M);else if(Be.isArray(M)&&_z(M)||(Be.isFileList(M)||Be.endsWith(C,"[]"))&&(_=Be.toArray(M)))return C=B3(C),_.forEach(function(c,j){!(Be.isUndefined(c)||c===null)&&t.append(l===!0?gC([C],j,a):l===null?C:C+"[]",p(c))}),!1}return vw(M)?!0:(t.append(gC(S,C,a),p(M)),!1)}const b=[],w=Object.assign(Mz,{defaultVisitor:x,convertValue:p,isVisitable:vw});function E(M,C){if(!Be.isUndefined(M)){if(b.indexOf(M)!==-1)throw Error("Circular reference detected in "+C.join("."));b.push(M),Be.forEach(M,function(_,N){(!(Be.isUndefined(_)||_===null)&&s.call(t,_,Be.isString(N)?N.trim():N,C,w))===!0&&E(_,C?C.concat(N):[N])}),b.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return E(e),t}function vC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function G9(e,t){this._pairs=[],e&&cb(e,this,t)}const U3=G9.prototype;U3.append=function(t,n){this._pairs.push([t,n])};U3.toString=function(t){const n=t?function(r){return t.call(this,r,vC)}:vC;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nz(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function F3(e,t,n){if(!t)return e;const r=n&&n.encode||Nz;Be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let a;if(s?a=s(t,n):a=Be.isURLSearchParams(t)?t.toString():new G9(t,n).toString(r),a){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class yC{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(r){r!==null&&t(r)})}}const H3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Oz=typeof URLSearchParams<"u"?URLSearchParams:G9,Tz=typeof FormData<"u"?FormData:null,Dz=typeof Blob<"u"?Blob:null,Az={isBrowser:!0,classes:{URLSearchParams:Oz,FormData:Tz,Blob:Dz},protocols:["http","https","file","blob","url","data"]},Y9=typeof window<"u"&&typeof document<"u",yw=typeof navigator=="object"&&navigator||void 0,jz=Y9&&(!yw||["ReactNative","NativeScript","NS"].indexOf(yw.product)<0),kz=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Pz=Y9&&window.location.href||"http://localhost",zz=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Y9,hasStandardBrowserEnv:jz,hasStandardBrowserWebWorkerEnv:kz,navigator:yw,origin:Pz},Symbol.toStringTag,{value:"Module"})),$i={...zz,...Az};function Bz(e,t){return cb(e,new $i.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,a){return $i.isNode&&Be.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function Uz(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Fz(e){const t={},n=Object.keys(e);let r;const s=n.length;let a;for(r=0;r<s;r++)a=n[r],t[a]=e[a];return t}function I3(e){function t(n,r,s,a){let l=n[a++];if(l==="__proto__")return!0;const h=Number.isFinite(+l),m=a>=n.length;return l=!l&&Be.isArray(s)?s.length:l,m?(Be.hasOwnProp(s,l)?s[l]=[s[l],r]:s[l]=r,!h):((!s[l]||!Be.isObject(s[l]))&&(s[l]=[]),t(n,r,s[l],a)&&Be.isArray(s[l])&&(s[l]=Fz(s[l])),!h)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(r,s)=>{t(Uz(r),s,n,0)}),n}return null}function Hz(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const zg={transitional:H3,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,a=Be.isObject(t);if(a&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return s?JSON.stringify(I3(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t)||Be.isReadableStream(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let h;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Bz(t,this.formSerializer).toString();if((h=Be.isFileList(t))||r.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return cb(h?{"files[]":t}:t,m&&new m,this.formSerializer)}}return a||s?(n.setContentType("application/json",!1),Hz(t)):t}],transformResponse:[function(t){const n=this.transitional||zg.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(Be.isResponse(t)||Be.isReadableStream(t))return t;if(t&&Be.isString(t)&&(r&&!this.responseType||s)){const l=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(h){if(l)throw h.name==="SyntaxError"?un.from(h,un.ERR_BAD_RESPONSE,this,null,this.response):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$i.classes.FormData,Blob:$i.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Be.forEach(["delete","get","head","post","put","patch"],e=>{zg.headers[e]={}});const Iz=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$z=e=>{const t={};let n,r,s;return e&&e.split(`
`).forEach(function(l){s=l.indexOf(":"),n=l.substring(0,s).trim().toLowerCase(),r=l.substring(s+1).trim(),!(!n||t[n]&&Iz[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xC=Symbol("internals");function Dp(e){return e&&String(e).trim().toLowerCase()}function Qy(e){return e===!1||e==null?e:Be.isArray(e)?e.map(Qy):String(e)}function Vz(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const qz=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function g2(e,t,n,r,s){if(Be.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!Be.isString(t)){if(Be.isString(r))return t.indexOf(r)!==-1;if(Be.isRegExp(r))return r.test(t)}}function Wz(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Gz(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,a,l){return this[r].call(this,t,s,a,l)},configurable:!0})})}let As=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function a(h,m,p){const x=Dp(m);if(!x)throw new Error("header name must be a non-empty string");const b=Be.findKey(s,x);(!b||s[b]===void 0||p===!0||p===void 0&&s[b]!==!1)&&(s[b||m]=Qy(h))}const l=(h,m)=>Be.forEach(h,(p,x)=>a(p,x,m));if(Be.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(Be.isString(t)&&(t=t.trim())&&!qz(t))l($z(t),n);else if(Be.isObject(t)&&Be.isIterable(t)){let h={},m,p;for(const x of t){if(!Be.isArray(x))throw TypeError("Object iterator must return a key-value pair");h[p=x[0]]=(m=h[p])?Be.isArray(m)?[...m,x[1]]:[m,x[1]]:x[1]}l(h,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=Dp(t),t){const r=Be.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Vz(s);if(Be.isFunction(n))return n.call(this,s,r);if(Be.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Dp(t),t){const r=Be.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||g2(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function a(l){if(l=Dp(l),l){const h=Be.findKey(r,l);h&&(!n||g2(r,r[h],h,n))&&(delete r[h],s=!0)}}return Be.isArray(t)?t.forEach(a):a(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const a=n[r];(!t||g2(this,this[a],a,t,!0))&&(delete this[a],s=!0)}return s}normalize(t){const n=this,r={};return Be.forEach(this,(s,a)=>{const l=Be.findKey(r,a);if(l){n[l]=Qy(s),delete n[a];return}const h=t?Wz(a):String(a).trim();h!==a&&delete n[a],n[h]=Qy(s),r[h]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&Be.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[xC]=this[xC]={accessors:{}}).accessors,s=this.prototype;function a(l){const h=Dp(l);r[h]||(Gz(s,l),r[h]=!0)}return Be.isArray(t)?t.forEach(a):a(t),this}};As.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Be.reduceDescriptors(As.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Be.freezeMethods(As);function v2(e,t){const n=this||zg,r=t||n,s=As.from(r.headers);let a=r.data;return Be.forEach(e,function(h){a=h.call(n,a,s.normalize(),t?t.status:void 0)}),s.normalize(),a}function $3(e){return!!(e&&e.__CANCEL__)}function Um(e,t,n){un.call(this,e??"canceled",un.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(Um,un,{__CANCEL__:!0});function V3(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new un("Request failed with status code "+n.status,[un.ERR_BAD_REQUEST,un.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Yz(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xz(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,a=0,l;return t=t!==void 0?t:1e3,function(m){const p=Date.now(),x=r[a];l||(l=p),n[s]=m,r[s]=p;let b=a,w=0;for(;b!==s;)w+=n[b++],b=b%e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),p-l<t)return;const E=x&&p-x;return E?Math.round(w*1e3/E):void 0}}function Kz(e,t){let n=0,r=1e3/t,s,a;const l=(p,x=Date.now())=>{n=x,s=null,a&&(clearTimeout(a),a=null),e.apply(null,p)};return[(...p)=>{const x=Date.now(),b=x-n;b>=r?l(p,x):(s=p,a||(a=setTimeout(()=>{a=null,l(s)},r-b)))},()=>s&&l(s)]}const hx=(e,t,n=3)=>{let r=0;const s=Xz(50,250);return Kz(a=>{const l=a.loaded,h=a.lengthComputable?a.total:void 0,m=l-r,p=s(m),x=l<=h;r=l;const b={loaded:l,total:h,progress:h?l/h:void 0,bytes:m,rate:p||void 0,estimated:p&&h&&x?(h-l)/p:void 0,event:a,lengthComputable:h!=null,[t?"download":"upload"]:!0};e(b)},n)},bC=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},LC=e=>(...t)=>Be.asap(()=>e(...t)),Qz=$i.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,$i.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL($i.origin),$i.navigator&&/(msie|trident)/i.test($i.navigator.userAgent)):()=>!0,Zz=$i.hasStandardBrowserEnv?{write(e,t,n,r,s,a){const l=[e+"="+encodeURIComponent(t)];Be.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),Be.isString(r)&&l.push("path="+r),Be.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Jz(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function eB(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function q3(e,t,n){let r=!Jz(t);return e&&(r||n==!1)?eB(e,t):t}const wC=e=>e instanceof As?{...e}:e;function rf(e,t){t=t||{};const n={};function r(p,x,b,w){return Be.isPlainObject(p)&&Be.isPlainObject(x)?Be.merge.call({caseless:w},p,x):Be.isPlainObject(x)?Be.merge({},x):Be.isArray(x)?x.slice():x}function s(p,x,b,w){if(Be.isUndefined(x)){if(!Be.isUndefined(p))return r(void 0,p,b,w)}else return r(p,x,b,w)}function a(p,x){if(!Be.isUndefined(x))return r(void 0,x)}function l(p,x){if(Be.isUndefined(x)){if(!Be.isUndefined(p))return r(void 0,p)}else return r(void 0,x)}function h(p,x,b){if(b in t)return r(p,x);if(b in e)return r(void 0,p)}const m={url:a,method:a,data:a,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:h,headers:(p,x,b)=>s(wC(p),wC(x),b,!0)};return Be.forEach(Object.keys(Object.assign({},e,t)),function(x){const b=m[x]||s,w=b(e[x],t[x],x);Be.isUndefined(w)&&b!==h||(n[x]=w)}),n}const W3=e=>{const t=rf({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:a,headers:l,auth:h}=t;t.headers=l=As.from(l),t.url=F3(q3(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&l.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):"")));let m;if(Be.isFormData(n)){if($i.hasStandardBrowserEnv||$i.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((m=l.getContentType())!==!1){const[p,...x]=m?m.split(";").map(b=>b.trim()).filter(Boolean):[];l.setContentType([p||"multipart/form-data",...x].join("; "))}}if($i.hasStandardBrowserEnv&&(r&&Be.isFunction(r)&&(r=r(t)),r||r!==!1&&Qz(t.url))){const p=s&&a&&Zz.read(a);p&&l.set(s,p)}return t},tB=typeof XMLHttpRequest<"u",nB=tB&&function(e){return new Promise(function(n,r){const s=W3(e);let a=s.data;const l=As.from(s.headers).normalize();let{responseType:h,onUploadProgress:m,onDownloadProgress:p}=s,x,b,w,E,M;function C(){E&&E(),M&&M(),s.cancelToken&&s.cancelToken.unsubscribe(x),s.signal&&s.signal.removeEventListener("abort",x)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function _(){if(!S)return;const c=As.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),D={data:!h||h==="text"||h==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:c,config:e,request:S};V3(function(T){n(T),C()},function(T){r(T),C()},D),S=null}"onloadend"in S?S.onloadend=_:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(_)},S.onabort=function(){S&&(r(new un("Request aborted",un.ECONNABORTED,e,S)),S=null)},S.onerror=function(){r(new un("Network Error",un.ERR_NETWORK,e,S)),S=null},S.ontimeout=function(){let j=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||H3;s.timeoutErrorMessage&&(j=s.timeoutErrorMessage),r(new un(j,D.clarifyTimeoutError?un.ETIMEDOUT:un.ECONNABORTED,e,S)),S=null},a===void 0&&l.setContentType(null),"setRequestHeader"in S&&Be.forEach(l.toJSON(),function(j,D){S.setRequestHeader(D,j)}),Be.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),h&&h!=="json"&&(S.responseType=s.responseType),p&&([w,M]=hx(p,!0),S.addEventListener("progress",w)),m&&S.upload&&([b,E]=hx(m),S.upload.addEventListener("progress",b),S.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(x=c=>{S&&(r(!c||c.type?new Um(null,e,S):c),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(x),s.signal&&(s.signal.aborted?x():s.signal.addEventListener("abort",x)));const N=Yz(s.url);if(N&&$i.protocols.indexOf(N)===-1){r(new un("Unsupported protocol "+N+":",un.ERR_BAD_REQUEST,e));return}S.send(a||null)})},rB=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const a=function(p){if(!s){s=!0,h();const x=p instanceof Error?p:this.reason;r.abort(x instanceof un?x:new Um(x instanceof Error?x.message:x))}};let l=t&&setTimeout(()=>{l=null,a(new un(`timeout ${t} of ms exceeded`,un.ETIMEDOUT))},t);const h=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(a):p.removeEventListener("abort",a)}),e=null)};e.forEach(p=>p.addEventListener("abort",a));const{signal:m}=r;return m.unsubscribe=()=>Be.asap(h),m}},iB=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},sB=async function*(e,t){for await(const n of oB(e))yield*iB(n,t)},oB=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},SC=(e,t,n,r)=>{const s=sB(e,t);let a=0,l,h=m=>{l||(l=!0,r&&r(m))};return new ReadableStream({async pull(m){try{const{done:p,value:x}=await s.next();if(p){h(),m.close();return}let b=x.byteLength;if(n){let w=a+=b;n(w)}m.enqueue(new Uint8Array(x))}catch(p){throw h(p),p}},cancel(m){return h(m),s.return()}},{highWaterMark:2})},ub=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",G3=ub&&typeof ReadableStream=="function",aB=ub&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Y3=(e,...t)=>{try{return!!e(...t)}catch{return!1}},lB=G3&&Y3(()=>{let e=!1;const t=new Request($i.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),CC=64*1024,xw=G3&&Y3(()=>Be.isReadableStream(new Response("").body)),mx={stream:xw&&(e=>e.body)};ub&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!mx[t]&&(mx[t]=Be.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new un(`Response type '${t}' is not supported`,un.ERR_NOT_SUPPORT,r)})})})(new Response);const cB=async e=>{if(e==null)return 0;if(Be.isBlob(e))return e.size;if(Be.isSpecCompliantForm(e))return(await new Request($i.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Be.isArrayBufferView(e)||Be.isArrayBuffer(e))return e.byteLength;if(Be.isURLSearchParams(e)&&(e=e+""),Be.isString(e))return(await aB(e)).byteLength},uB=async(e,t)=>{const n=Be.toFiniteNumber(e.getContentLength());return n??cB(t)},dB=ub&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:a,timeout:l,onDownloadProgress:h,onUploadProgress:m,responseType:p,headers:x,withCredentials:b="same-origin",fetchOptions:w}=W3(e);p=p?(p+"").toLowerCase():"text";let E=rB([s,a&&a.toAbortSignal()],l),M;const C=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let S;try{if(m&&lB&&n!=="get"&&n!=="head"&&(S=await uB(x,r))!==0){let D=new Request(t,{method:"POST",body:r,duplex:"half"}),B;if(Be.isFormData(r)&&(B=D.headers.get("content-type"))&&x.setContentType(B),D.body){const[T,A]=bC(S,hx(LC(m)));r=SC(D.body,CC,T,A)}}Be.isString(b)||(b=b?"include":"omit");const _="credentials"in Request.prototype;M=new Request(t,{...w,signal:E,method:n.toUpperCase(),headers:x.normalize().toJSON(),body:r,duplex:"half",credentials:_?b:void 0});let N=await fetch(M);const c=xw&&(p==="stream"||p==="response");if(xw&&(h||c&&C)){const D={};["status","statusText","headers"].forEach(H=>{D[H]=N[H]});const B=Be.toFiniteNumber(N.headers.get("content-length")),[T,A]=h&&bC(B,hx(LC(h),!0))||[];N=new Response(SC(N.body,CC,T,()=>{A&&A(),C&&C()}),D)}p=p||"text";let j=await mx[Be.findKey(mx,p)||"text"](N,e);return!c&&C&&C(),await new Promise((D,B)=>{V3(D,B,{data:j,headers:As.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:M})})}catch(_){throw C&&C(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new un("Network Error",un.ERR_NETWORK,e,M),{cause:_.cause||_}):un.from(_,_&&_.code,e,M)}}),bw={http:Rz,xhr:nB,fetch:dB};Be.forEach(bw,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const EC=e=>`- ${e}`,fB=e=>Be.isFunction(e)||e===null||e===!1,X3={getAdapter:e=>{e=Be.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let a=0;a<t;a++){n=e[a];let l;if(r=n,!fB(n)&&(r=bw[(l=String(n)).toLowerCase()],r===void 0))throw new un(`Unknown adapter '${l}'`);if(r)break;s[l||"#"+a]=r}if(!r){const a=Object.entries(s).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let l=t?a.length>1?`since :
`+a.map(EC).join(`
`):" "+EC(a[0]):"as no adapter specified";throw new un("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:bw};function y2(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Um(null,e)}function RC(e){return y2(e),e.headers=As.from(e.headers),e.data=v2.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),X3.getAdapter(e.adapter||zg.adapter)(e).then(function(r){return y2(e),r.data=v2.call(e,e.transformResponse,r),r.headers=As.from(r.headers),r},function(r){return $3(r)||(y2(e),r&&r.response&&(r.response.data=v2.call(e,e.transformResponse,r.response),r.response.headers=As.from(r.response.headers))),Promise.reject(r)})}const K3="1.9.0",db={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{db[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _C={};db.transitional=function(t,n,r){function s(a,l){return"[Axios v"+K3+"] Transitional option '"+a+"'"+l+(r?". "+r:"")}return(a,l,h)=>{if(t===!1)throw new un(s(l," has been removed"+(n?" in "+n:"")),un.ERR_DEPRECATED);return n&&!_C[l]&&(_C[l]=!0,console.warn(s(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,l,h):!0}};db.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function hB(e,t,n){if(typeof e!="object")throw new un("options must be an object",un.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const a=r[s],l=t[a];if(l){const h=e[a],m=h===void 0||l(h,a,e);if(m!==!0)throw new un("option "+a+" must be "+m,un.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new un("Unknown option "+a,un.ERR_BAD_OPTION)}}const Zy={assertOptions:hB,validators:db},Ya=Zy.validators;let Kd=class{constructor(t){this.defaults=t||{},this.interceptors={request:new yC,response:new yC}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const a=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=rf(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:a}=n;r!==void 0&&Zy.assertOptions(r,{silentJSONParsing:Ya.transitional(Ya.boolean),forcedJSONParsing:Ya.transitional(Ya.boolean),clarifyTimeoutError:Ya.transitional(Ya.boolean)},!1),s!=null&&(Be.isFunction(s)?n.paramsSerializer={serialize:s}:Zy.assertOptions(s,{encode:Ya.function,serialize:Ya.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Zy.assertOptions(n,{baseUrl:Ya.spelling("baseURL"),withXsrfToken:Ya.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=a&&Be.merge(a.common,a[n.method]);a&&Be.forEach(["delete","get","head","post","put","patch","common"],M=>{delete a[M]}),n.headers=As.concat(l,a);const h=[];let m=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(m=m&&C.synchronous,h.unshift(C.fulfilled,C.rejected))});const p=[];this.interceptors.response.forEach(function(C){p.push(C.fulfilled,C.rejected)});let x,b=0,w;if(!m){const M=[RC.bind(this),void 0];for(M.unshift.apply(M,h),M.push.apply(M,p),w=M.length,x=Promise.resolve(n);b<w;)x=x.then(M[b++],M[b++]);return x}w=h.length;let E=n;for(b=0;b<w;){const M=h[b++],C=h[b++];try{E=M(E)}catch(S){C.call(this,S);break}}try{x=RC.call(this,E)}catch(M){return Promise.reject(M)}for(b=0,w=p.length;b<w;)x=x.then(p[b++],p[b++]);return x}getUri(t){t=rf(this.defaults,t);const n=q3(t.baseURL,t.url,t.allowAbsoluteUrls);return F3(n,t.params,t.paramsSerializer)}};Be.forEach(["delete","get","head","options"],function(t){Kd.prototype[t]=function(n,r){return this.request(rf(r||{},{method:t,url:n,data:(r||{}).data}))}});Be.forEach(["post","put","patch"],function(t){function n(r){return function(a,l,h){return this.request(rf(h||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:l}))}}Kd.prototype[t]=n(),Kd.prototype[t+"Form"]=n(!0)});let mB=class Q3{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(s=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](s);r._listeners=null}),this.promise.then=s=>{let a;const l=new Promise(h=>{r.subscribe(h),a=h}).then(s);return l.cancel=function(){r.unsubscribe(a)},l},t(function(a,l,h){r.reason||(r.reason=new Um(a,l,h),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Q3(function(s){t=s}),cancel:t}}};function pB(e){return function(n){return e.apply(null,n)}}function gB(e){return Be.isObject(e)&&e.isAxiosError===!0}const Lw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Lw).forEach(([e,t])=>{Lw[t]=e});function Z3(e){const t=new Kd(e),n=M3(Kd.prototype.request,t);return Be.extend(n,Kd.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Z3(rf(e,s))},n}const sr=Z3(zg);sr.Axios=Kd;sr.CanceledError=Um;sr.CancelToken=mB;sr.isCancel=$3;sr.VERSION=K3;sr.toFormData=cb;sr.AxiosError=un;sr.Cancel=sr.CanceledError;sr.all=function(t){return Promise.all(t)};sr.spread=pB;sr.isAxiosError=gB;sr.mergeConfig=rf;sr.AxiosHeaders=As;sr.formToJSON=e=>I3(Be.isHTMLForm(e)?new FormData(e):e);sr.getAdapter=X3.getAdapter;sr.HttpStatusCode=Lw;sr.default=sr;const{Axios:xse,AxiosError:bse,CanceledError:Lse,isCancel:wse,CancelToken:Sse,VERSION:Cse,all:Ese,Cancel:Rse,isAxiosError:_se,spread:Mse,toFormData:Nse,AxiosHeaders:Ose,HttpStatusCode:Tse,formToJSON:Dse,getAdapter:Ase,mergeConfig:jse}=sr;var nn=(e=>(e.Motion="motion",e.Person="person",e.Vehicle="vehicle",e.Animal="animal",e.Audio="audio",e.Face="face",e.Plate="plate",e.Package="package",e.Doorbell="doorbell",e.Sensor="sensor",e.Others="others",e))(nn||{});const vB={face:1,plate:1,audio:2,person:2,vehicle:3,animal:4,package:5,motion:6,others:6};var oa=(e=>(e.Timelapse="timelapseClip",e.Detection="detectionClip",e.Entry="entry",e))(oa||{});Object.values(nn);const yB=["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"],xB=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],bB=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],LB=["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"],wB=["plate","license_plate","front_plate","rear_plate","motorcycle_plate","temporary_plate","dealer_plate","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"],SB=["motion","movement","other"],CB=["package","packet"],EB=["audio","speech","babbling","yell","bellow","whoop","whispering","laughter","snicker","crying","sigh","singing","choir","sodeling","chant","mantra","child_singing","synthetic_singing","rapping","humming","groan","grunt","whistling","breathing","wheeze","snoring","gasp","pant","snort","cough","throat_clearing","sneeze","sniff","run","shuffle","footsteps","chewing","biting","gargling","stomach_rumble","burping","hiccup","fart","hands","finger_snapping","clapping","heartbeat","heart_murmur","cheering","applause","chatter","crowd","children_playing","pets","bark","yip","howl","bow-wow","growling","whimper_dog","purr","meow","hiss","caterwaul","livestock","clip-clop","neigh","cattle","moo","cowbell","pig","oink","goat","bleat","fowl","chicken","cluck","cock-a-doodle-doo","turkey","gobble","duck","quack","goose","honk","wild_animals","roaring_cats","roar","chird","chirp","squawk","coo","crow","caw","hoot","flapping_wings","dogs","rats","patter","insect","cricket","mosquito","fly","buzz","frog","croak","rattle","whale_vocalization","music","musical_instrument","plucked_string_instrument","guitar","electric_guitar","bass_guitar","acoustic_guitar","steel_guitar","tapping","strum","banjo","sitar","mandolin","zither","ukulele","keyboard","piano","electric_piano","organ","electronic_organ","hammond_organ","synthesizer","sampler","harpsichord","percussion","drum_kit","drum_machine","drum","snare_drum","rimshot","drum_roll","bass_drum","timpani","tabla","cymbal","hi-hat","wood_block","tambourine","maraca","gong","tubular_bells","mallet_percussion","marimba","glockenspiel","vibraphone","steelpan","orchestra","brass_instrument","french_horn","trumpet","trombone","bowed_string_instrument","string_section","violin","pizzicato","cello","double_bass","wind_instrument","flute","saxophone","clarinet","harp","bell","church_bell","jingle_bell","bicycle_bell","tuning_fork","chime","wind_chime","change_ringing","harmonica","accordion","bagpipes","didgeridoo","shofar","theremin","singing_bowl","scratching","pop_music","hip_hop_music","beatboxing","rock_music","heavy_metal","punk_rock","grunge","progressive_rock","rock_and_roll","psychedelic_rock","rhythm_and_blues","soul_music","reggae","country","swing_music","bluegrass","funk","folk_music","middle_eastern_music","jazz","disco","classical_music","opera","electronic_music","house_music","techno","dubstep","drum_and_bass","electronica","electronic_dance_music","ambient_music","trance_music","music_of_latin_america","salsa_music","flamenco","blues","music_for_children","new-age_music","vocal_music","a_capella","music_of_africa","afrobeat","christian_music","gospel_music","music_of_asia","carnatic_music","music_of_bollywood","ska","traditional_music","independent_music","song","background_music","theme_music","jingle","soundtrack_music","lullaby","video_game_music","christmas_music","dance_music","wedding_music","happy_music","sad_music","tender_music","exciting_music","angry_music","scary_music","wind","rustling_leaves","wind_noise","thunderstorm","thunder","water","rain","raindrop","rain_on_surface","stream","waterfall","ocean","waves","steam","gurgling","fire","crackle","sailboat","rowboat","motorboat","air_brake","air_horn","reversing_beeps","ice_cream_truck","aircraft_engine","jet_engine","propeller","fixed-wing_aircraft","engine","light_engine","dental_drill's_drill","lawn_mower","chainsaw","medium_engine","heavy_engine","engine_knocking","engine_starting","idling","accelerating","door","ding-dong","sliding_door","slam","knock","tap","squeak","cupboard_open_or_close","drawer_open_or_close","dishes","cutlery","chopping","frying","microwave_oven","blender","water_tap","sink","bathtub","hair_dryer","toilet_flush","toothbrush","electric_toothbrush","vacuum_cleaner","zipper","keys_jangling","coin","scissors","electric_shaver","shuffling_cards","typing","typewriter","computer_keyboard","writing","alarm","telephone","telephone_bell_ringing","ringtone","telephone_dialing","dial_tone","busy_signal","alarm_clock","siren","civil_defense_siren","buzzer","smoke_detector","fire_alarm","foghorn","whistle","steam_whistle","mechanisms","ratchet","clock","tick","tick-tock","gears","pulleys","sewing_machine","mechanical_fan","air_conditioning","cash_register","printer","camera","single-lens_reflex_camera","tools","hammer","jackhammer","sawing","filing","sanding","power_tool","drill","explosion","gunshot","machine_gun","fusillade","artillery_fire","cap_gun","fireworks","firecracker","burst","eruption","boom","wood","chop","splinter","crack","glass","chink","shatter","liquid","splash","slosh","squish","drip","pour","trickle","gush","fill","spray","pump","stir","boiling","sonar","arrow","whoosh","thump","thunk","electronic_tuner","effects_unit","chorus_effect","basketball_bounce","bang","slap","whack","smash","breaking","bouncing","whip","flap","scratch","scrape","rub","roll","crushing","crumpling","tearing","beep","ping","ding","clang","squeal","creak","rustle","whir","clatter","sizzle","clicking","clickety-clack","rumble","plop","jingle","hum","zing","boing","crunch","silence","sine_wave","harmonic","chirp_tone","sound_effect","pulse","inside","outside","reverberation","echo","noise","environmental_noise","static","mains_hum","distortion","sidetone","cacophony","white_noise","pink_noise","throbbing","vibration","television","radio","field_recording"],RB=["doorbell","ring"],cg={...yB.reduce((e,t)=>({...e,[t]:"animal"}),{}),...xB.reduce((e,t)=>({...e,[t]:"person"}),{}),...bB.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...SB.reduce((e,t)=>({...e,[t]:"motion"}),{}),...CB.reduce((e,t)=>({...e,[t]:"package"}),{}),...LB.reduce((e,t)=>({...e,[t]:"face"}),{}),...wB.reduce((e,t)=>({...e,[t]:"plate"}),{}),...EB.reduce((e,t)=>({...e,[t]:"audio"}),{}),...RB.reduce((e,t)=>({...e,[t]:"doorbell"}),{})},MC=e=>{let t;const n=new Set,r=(p,x)=>{const b=typeof p=="function"?p(t):p;if(!Object.is(b,t)){const w=t;t=x??(typeof b!="object"||b===null)?b:Object.assign({},t,b),n.forEach(E=>E(t,w))}},s=()=>t,h={setState:r,getState:s,getInitialState:()=>m,subscribe:p=>(n.add(p),()=>n.delete(p))},m=t=e(r,s,h);return h},_B=e=>e?MC(e):MC,MB=e=>e;function NB(e,t=MB){const n=Un.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return Un.useDebugValue(n),n}const NC=e=>{const t=_B(e),n=r=>NB(t,r);return Object.assign(n,t),n},X9=e=>e?NC(e):NC;function J3(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const l=m=>m===null?null:JSON.parse(m,void 0),h=(a=n.getItem(s))!=null?a:null;return h instanceof Promise?h.then(l):l(h)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const ww=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ww(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ww(r)(n)}}}},OB=(e,t)=>(n,r,s)=>{let a={storage:J3(()=>localStorage),partialize:C=>C,version:0,merge:(C,S)=>({...S,...C}),...t},l=!1;const h=new Set,m=new Set;let p=a.storage;if(!p)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...C)},r,s);const x=()=>{const C=a.partialize({...r()});return p.setItem(a.name,{state:C,version:a.version})},b=s.setState;s.setState=(C,S)=>{b(C,S),x()};const w=e((...C)=>{n(...C),x()},r,s);s.getInitialState=()=>w;let E;const M=()=>{var C,S;if(!p)return;l=!1,h.forEach(N=>{var c;return N((c=r())!=null?c:w)});const _=((S=a.onRehydrateStorage)==null?void 0:S.call(a,(C=r())!=null?C:w))||void 0;return ww(p.getItem.bind(p))(a.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==a.version){if(a.migrate){const c=a.migrate(N.state,N.version);return c instanceof Promise?c.then(j=>[!0,j]):[!0,c]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var c;const[j,D]=N;if(E=a.merge(D,(c=r())!=null?c:w),n(E,!0),j)return x()}).then(()=>{_==null||_(E,void 0),E=r(),l=!0,m.forEach(N=>N(E))}).catch(N=>{_==null||_(void 0,N)})};return s.persist={setOptions:C=>{a={...a,...C},C.storage&&(p=C.storage)},clearStorage:()=>{p==null||p.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>M(),hasHydrated:()=>l,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(m.add(C),()=>{m.delete(C)})},a.skipHydration||M(),E||w},TB=OB;var Ka=(e=>(e.Cameras="Cameras",e.CameraDetail="CameraDetail",e.Events="Events",e.Videoclips="Videoclips",e.Grids="Grids",e.GridView="GridView",e.Settings="Settings",e.Login="Login",e))(Ka||{}),Wp=(e=>(e.Dog="dog",e.Cat="cat",e.Horse="horse",e.Bird="bird",e))(Wp||{}),ei=(e=>(e.Auto="Auto",e.All="All",e.RawDetection="RawDetection",e.NVR="NVR",e.Frigate="Frigate",e))(ei||{}),px=(e=>(e.IT="it",e.EN_US="enUS",e))(px||{});const DB={cameraCardShowName:!0,cameraCardShowBattery:!0,cameraCardShowSleep:!0,cameraCardShowMotion:!0,cameraCardShowLight:!0,cameraCardShowDBFS:!1,cameraCardShowRms:!1,timelineDetectionSource:"RawDetection",timelineRefetchIntervalSeconds:10};function AB(e,t){let n=null,r=null,s=null;return{getItem:a=>e.getItem(a),setItem:(a,l)=>{r=a,s=l,n&&clearTimeout(n),n=setTimeout(()=>{n=null,r!==null&&s!==null&&(e.setItem(r,s),r=null,s=null)},t)},removeItem:a=>e.removeItem(a)}}const eR={highlightOnMotion:!1,highlightAudioMode:"off",highlightAudioLevelWindowSeconds:6,highlightAudioLevelDecibelThreshold:-30,highlightAudioLevelHitPercentage:80,highlightAudioLevelHoldSeconds:3,highlightOnDetection:!1,highlightDetectionClassnames:Object.values(nn),highlightDetectionLabel:void 0,highlightDetectionHoldSeconds:3},OC=[nn.Animal,nn.Audio,nn.Doorbell,nn.Face,nn.Package,nn.Person,nn.Plate,nn.Vehicle],Te=X9()(TB(e=>({sidebarOpen:void 0,setSidebarOpen:t=>e({sidebarOpen:t}),userInfo:void 0,setUserInfo:t=>e({userInfo:t}),authError:void 0,setAuthError:t=>e({authError:t}),timezone:px.IT,setTimezone:t=>e({timezone:t}),eventSource:ei.Auto,setEventSource:t=>e({eventSource:t}),page:Ka.Cameras,setPage:t=>e({page:t}),selectedCameraId:void 0,setSelectedCameraId:t=>e({selectedCameraId:t}),detectionClasses:OC,setDetectionClasses:t=>e({detectionClasses:t}),filter:"",setFilter:t=>e({filter:t}),date:new Date().getTime(),setDate:t=>e({date:t}),configs:void 0,setConfigs:t=>e({configs:t}),camerasStatus:void 0,setCamerasStatus:t=>e({camerasStatus:t}),cameras:[],setCameras:t=>e({cameras:t}),refreshTime:new Date().getTime(),setRefreshTime:t=>e({refreshTime:t}),groupingRange:5,setGroupingRange:t=>e({groupingRange:t}),lastCamerasSnapshots:void 0,setLastCamerasSnapshots:t=>e({lastCamerasSnapshots:t}),camerasListScrollTop:void 0,setCamerasListScrollTop:t=>e({camerasListScrollTop:t}),resetFilters:()=>e({detectionClasses:OC,eventSource:ei.Auto,filter:"",date:new Date().getTime(),cameras:[],groupingRange:5}),cameraGridColumns:4,setCameraGridColumns:t=>e({cameraGridColumns:Math.min(6,Math.max(1,t))}),cameraOrder:[],setCameraOrder:t=>e({cameraOrder:t}),camerasReorderEnabled:!1,setCamerasReorderEnabled:t=>e({camerasReorderEnabled:t}),playOnOpen:!0,setPlayOnOpen:t=>e({playOnOpen:t}),audioOnOpen:!0,setAudioOnOpen:t=>e({audioOnOpen:t}),streamWatchdogEnabled:!0,setStreamWatchdogEnabled:t=>e({streamWatchdogEnabled:t}),reelAutoplayEnabled:!1,setReelAutoplayEnabled:t=>e({reelAutoplayEnabled:t}),highlightOnMotion:!1,setHighlightOnMotion:t=>e({highlightOnMotion:t}),highlightOnAudio:!1,setHighlightOnAudio:t=>e({highlightOnAudio:t}),highlightAudioMode:"off",setHighlightAudioMode:t=>e({highlightAudioMode:t}),highlightAudioLevelWindowSeconds:6,setHighlightAudioLevelWindowSeconds:t=>e({highlightAudioLevelWindowSeconds:Math.max(1,Math.min(60,t))}),highlightAudioLevelDecibelThreshold:-30,setHighlightAudioLevelDecibelThreshold:t=>e({highlightAudioLevelDecibelThreshold:t}),highlightAudioLevelHitPercentage:80,setHighlightAudioLevelHitPercentage:t=>e({highlightAudioLevelHitPercentage:Math.max(0,Math.min(100,t))}),highlightAudioLevelHoldSeconds:3,setHighlightAudioLevelHoldSeconds:t=>e({highlightAudioLevelHoldSeconds:Math.max(1,Math.min(60,t))}),cameraUiSettings:{},cameraUiSettingsDefault:void 0,setCameraUiSettings:(t,n)=>e(r=>({cameraUiSettings:{...r.cameraUiSettings,[t]:{...r.cameraUiSettings[t]??{},...n}}})),streamQualitySingle:"auto",setStreamQualitySingle:t=>e({streamQualitySingle:t}),streamQualityGrid:"auto",setStreamQualityGrid:t=>e({streamQualityGrid:t}),showObjectDetectionOverlay:!1,setShowObjectDetectionOverlay:t=>e({showObjectDetectionOverlay:t}),detectionOverlayMotionColor:"#ef4444",setDetectionOverlayMotionColor:t=>e({detectionOverlayMotionColor:t||"#ef4444"}),detectionOverlayObjectColor:"rgb(59 130 246)",setDetectionOverlayObjectColor:t=>e({detectionOverlayObjectColor:t||"rgb(59 130 246)"}),detectionOverlayAudioColor:"#22c55e",setDetectionOverlayAudioColor:t=>e({detectionOverlayAudioColor:t||"#22c55e"}),detectionOverlayMotionStrokeWidth:2,setDetectionOverlayMotionStrokeWidth:t=>e({detectionOverlayMotionStrokeWidth:Math.max(.5,Math.min(20,t))}),detectionOverlayObjectStrokeWidth:2,setDetectionOverlayObjectStrokeWidth:t=>e({detectionOverlayObjectStrokeWidth:Math.max(.5,Math.min(20,t))}),detectionOverlayAudioStrokeWidth:2,setDetectionOverlayAudioStrokeWidth:t=>e({detectionOverlayAudioStrokeWidth:Math.max(.5,Math.min(20,t))}),showTimelineOnlyMotion:!1,setShowTimelineOnlyMotion:t=>e({showTimelineOnlyMotion:t}),theme:"system",setTheme:t=>e({theme:t}),grids:{},setGrids:t=>e({grids:t}),activeGridId:void 0,setActiveGridId:t=>e({activeGridId:t}),addGrid:t=>{const n=`grid-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,r={...t,id:n,layoutMode:t.layoutMode??"manual"};return e(s=>({grids:{...s.grids,[n]:r}})),n},updateGrid:(t,n)=>{e(r=>{const s=r.grids[t];if(!s)return r;const a={...s,...n};return{grids:{...r.grids,[t]:a}}})},removeGrid:t=>{e(n=>{const{[t]:r,...s}=n.grids;return{grids:s,activeGridId:n.activeGridId===t?void 0:n.activeGridId}})},cameraAudioVolumes:{},setCameraAudioVolumes:(t,n)=>e(r=>({cameraAudioVolumes:{...r.cameraAudioVolumes,[t]:{volumes:typeof n=="object"&&n!==null&&!Array.isArray(n)?{...n}:{},updatedAt:Date.now()}}})),cameraHighlightSettings:{},setCameraHighlightSettings:(t,n)=>e(r=>({cameraHighlightSettings:{...r.cameraHighlightSettings,[t]:{...r.cameraHighlightSettings[t]??{},...n}}})),cameraAssociatedDevices:{},setCameraAssociatedDevices:(t,n)=>e(r=>({cameraAssociatedDevices:{...r.cameraAssociatedDevices,[t]:Array.isArray(n)?n.map(s=>({...s})):[]}})),updateCameraAssociatedDeviceEntry:(t,n,r)=>e(s=>{const a=s.cameraAssociatedDevices[t];if(!a)return s;const l=a.map(h=>h.id===n?{...h,...r.customName!==void 0&&{customName:r.customName},...r.customIcon!==void 0&&{customIcon:r.customIcon}}:h);return{cameraAssociatedDevices:{...s.cameraAssociatedDevices,[t]:l}}})}),{name:"events-storage",storage:AB(J3(()=>localStorage),400),version:17,migrate:e=>{const t=e,n={...t};if((t==null?void 0:t.eventSource)===ei.All&&(n.eventSource=ei.Auto),(t==null?void 0:t.cameraCardMinWidth)!=null){const p=t.cameraCardMinWidth;n.cameraGridColumns=Math.min(6,Math.max(1,Math.round(6-(p-120)/70))),delete n.cameraCardMinWidth}n.cameraGridColumns==null&&(n.cameraGridColumns=4),n.playOnOpen==null&&(n.playOnOpen=!0),n.audioOnOpen==null&&(n.audioOnOpen=!0),n.streamWatchdogEnabled==null&&(n.streamWatchdogEnabled=!0),n.reelAutoplayEnabled==null&&(n.reelAutoplayEnabled=!1),n.highlightOnMotion==null&&(n.highlightOnMotion=!1),n.highlightOnAudio==null&&(n.highlightOnAudio=!1),n.highlightAudioMode==null&&(n.highlightAudioMode=n.highlightOnAudio===!0?"sensor":"off"),n.highlightAudioLevelWindowSeconds==null&&(n.highlightAudioLevelWindowSeconds=6),n.highlightAudioLevelDecibelThreshold==null&&(n.highlightAudioLevelDecibelThreshold=-30),n.highlightAudioLevelHitPercentage==null&&(n.highlightAudioLevelHitPercentage=80),n.highlightAudioLevelHoldSeconds==null&&(n.highlightAudioLevelHoldSeconds=3),n.theme==null&&(n.theme="system"),n.grids==null&&(n.grids={}),n.activeGridId==null&&(n.activeGridId=void 0),delete n.timelineDetectionSources;const r=Object.values(ei),s=t.timelineDetectionSource,a={};s!=null&&r.includes(s)&&(a.timelineDetectionSource=s),t.cameraCardShowName!=null&&(a.cameraCardShowName=t.cameraCardShowName),t.cameraCardShowBattery!=null&&(a.cameraCardShowBattery=t.cameraCardShowBattery),t.cameraCardShowSleep!=null&&(a.cameraCardShowSleep=t.cameraCardShowSleep),t.cameraCardShowMotion!=null&&(a.cameraCardShowMotion=t.cameraCardShowMotion),t.cameraCardShowLight!=null&&(a.cameraCardShowLight=t.cameraCardShowLight),t.cameraCardShowDBFS!=null&&(a.cameraCardShowDBFS=t.cameraCardShowDBFS),t.cameraCardShowRms!=null&&(a.cameraCardShowRms=t.cameraCardShowRms),Object.keys(a).length>0&&(n.cameraUiSettingsDefault=a),n.cameraUiSettings==null&&(n.cameraUiSettings={}),delete n.timelineDetectionSource,delete n.cameraCardShowName,delete n.cameraCardShowBattery,delete n.cameraCardShowSleep,delete n.cameraCardShowMotion,delete n.cameraCardShowLight,delete n.cameraCardShowDBFS,delete n.cameraCardShowRms,Array.isArray(n.cameraOrder)||(n.cameraOrder=[]),n.camerasReorderEnabled==null&&(n.camerasReorderEnabled=!1);const l=p=>p==="auto"||p==="high"||p==="medium"||p==="low"?p:"auto";n.streamQualitySingle==null?n.streamQualitySingle="auto":n.streamQualitySingle=l(n.streamQualitySingle),n.streamQualityGrid==null?n.streamQualityGrid="auto":n.streamQualityGrid=l(n.streamQualityGrid),n.showObjectDetectionOverlay==null&&(n.showObjectDetectionOverlay=!1),n.detectionOverlayMotionColor==null&&(n.detectionOverlayMotionColor="#ef4444"),n.detectionOverlayObjectColor==null&&(n.detectionOverlayObjectColor="rgb(59 130 246)"),n.detectionOverlayAudioColor==null&&(n.detectionOverlayAudioColor="#22c55e");const h=p=>typeof p=="number"&&!Number.isNaN(p)?Math.max(.5,Math.min(20,p)):2;n.detectionOverlayMotionStrokeWidth==null?n.detectionOverlayMotionStrokeWidth=2:n.detectionOverlayMotionStrokeWidth=h(n.detectionOverlayMotionStrokeWidth),n.detectionOverlayObjectStrokeWidth==null?n.detectionOverlayObjectStrokeWidth=2:n.detectionOverlayObjectStrokeWidth=h(n.detectionOverlayObjectStrokeWidth),n.detectionOverlayAudioStrokeWidth==null?n.detectionOverlayAudioStrokeWidth=2:n.detectionOverlayAudioStrokeWidth=h(n.detectionOverlayAudioStrokeWidth),n.showTimelineOnlyMotion==null&&(n.showTimelineOnlyMotion=!1),n.cameraAssociatedDevices==null&&(n.cameraAssociatedDevices={});const m=n.grids;if(m&&typeof m=="object"){const p={};for(const[x,b]of Object.entries(m))p[x]={...b,layoutMode:b.layoutMode??"manual"};n.grids=p}return n},partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>t!=="date"&&t!=="camerasListScrollTop"&&t!=="cameraAudioVolumes"))}));function fb(e,t){return{...DB,...e.cameraUiSettingsDefault,...e.cameraUiSettings[t]??{}}}var sn={},TC;function jB(){if(TC)return sn;TC=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.ScryptedMimeTypes=sn.ScryptedInterface=sn.MediaPlayerState=sn.SecuritySystemObstruction=sn.SecuritySystemMode=sn.AirQuality=sn.AirPurifierMode=sn.AirPurifierStatus=sn.ChargeState=sn.LockState=sn.PanTiltZoomMovement=sn.ThermostatMode=sn.TemperatureUnit=sn.FanMode=sn.HumidityMode=sn.ScryptedDeviceType=sn.ScryptedInterfaceDescriptors=sn.ScryptedInterfaceMethod=sn.ScryptedInterfaceProperty=sn.DeviceBase=sn.TYPES_VERSION=void 0,sn.TYPES_VERSION="0.5.45";class e{}sn.DeviceBase=e;var t;(function(c){c.id="id",c.info="info",c.interfaces="interfaces",c.mixins="mixins",c.name="name",c.nativeId="nativeId",c.pluginId="pluginId",c.providedInterfaces="providedInterfaces",c.providedName="providedName",c.providedRoom="providedRoom",c.providedType="providedType",c.providerId="providerId",c.room="room",c.type="type",c.scryptedRuntimeArguments="scryptedRuntimeArguments",c.on="on",c.brightness="brightness",c.colorTemperature="colorTemperature",c.rgb="rgb",c.hsv="hsv",c.buttons="buttons",c.sensors="sensors",c.running="running",c.paused="paused",c.docked="docked",c.temperatureSetting="temperatureSetting",c.temperature="temperature",c.temperatureUnit="temperatureUnit",c.humidity="humidity",c.resolution="resolution",c.audioVolumes="audioVolumes",c.recordingActive="recordingActive",c.ptzCapabilities="ptzCapabilities",c.lockState="lockState",c.entryOpen="entryOpen",c.batteryLevel="batteryLevel",c.chargeState="chargeState",c.online="online",c.fromMimeType="fromMimeType",c.toMimeType="toMimeType",c.converters="converters",c.binaryState="binaryState",c.tampered="tampered",c.sleeping="sleeping",c.powerDetected="powerDetected",c.audioDetected="audioDetected",c.motionDetected="motionDetected",c.ambientLight="ambientLight",c.occupied="occupied",c.flooded="flooded",c.ultraviolet="ultraviolet",c.luminance="luminance",c.position="position",c.securitySystemState="securitySystemState",c.pm10Density="pm10Density",c.pm25Density="pm25Density",c.vocDensity="vocDensity",c.noxDensity="noxDensity",c.co2ppm="co2ppm",c.airQuality="airQuality",c.airPurifierState="airPurifierState",c.filterChangeIndication="filterChangeIndication",c.filterLifeLevel="filterLifeLevel",c.humiditySetting="humiditySetting",c.fan="fan",c.applicationInfo="applicationInfo",c.chatCompletionCapabilities="chatCompletionCapabilities",c.systemDevice="systemDevice"})(t||(sn.ScryptedInterfaceProperty=t={}));var n;(function(c){c.listen="listen",c.probe="probe",c.setMixins="setMixins",c.setName="setName",c.setRoom="setRoom",c.setType="setType",c.getPluginJson="getPluginJson",c.turnOff="turnOff",c.turnOn="turnOn",c.setBrightness="setBrightness",c.getTemperatureMaxK="getTemperatureMaxK",c.getTemperatureMinK="getTemperatureMinK",c.setColorTemperature="setColorTemperature",c.setRgb="setRgb",c.setHsv="setHsv",c.pressButton="pressButton",c.sendNotification="sendNotification",c.start="start",c.stop="stop",c.pause="pause",c.resume="resume",c.dock="dock",c.setTemperature="setTemperature",c.setTemperatureUnit="setTemperatureUnit",c.getPictureOptions="getPictureOptions",c.takePicture="takePicture",c.getAudioStream="getAudioStream",c.setAudioVolumes="setAudioVolumes",c.startDisplay="startDisplay",c.stopDisplay="stopDisplay",c.getVideoStream="getVideoStream",c.getVideoStreamOptions="getVideoStreamOptions",c.getPrivacyMasks="getPrivacyMasks",c.setPrivacyMasks="setPrivacyMasks",c.getVideoTextOverlays="getVideoTextOverlays",c.setVideoTextOverlay="setVideoTextOverlay",c.getRecordingStream="getRecordingStream",c.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",c.getRecordingStreamOptions="getRecordingStreamOptions",c.getRecordingStreamThumbnail="getRecordingStreamThumbnail",c.deleteRecordingStream="deleteRecordingStream",c.setRecordingActive="setRecordingActive",c.ptzCommand="ptzCommand",c.getRecordedEvents="getRecordedEvents",c.getVideoClip="getVideoClip",c.getVideoClips="getVideoClips",c.getVideoClipThumbnail="getVideoClipThumbnail",c.removeVideoClips="removeVideoClips",c.setVideoStreamOptions="setVideoStreamOptions",c.startIntercom="startIntercom",c.stopIntercom="stopIntercom",c.lock="lock",c.unlock="unlock",c.addPassword="addPassword",c.getPasswords="getPasswords",c.removePassword="removePassword",c.activate="activate",c.deactivate="deactivate",c.isReversible="isReversible",c.closeEntry="closeEntry",c.openEntry="openEntry",c.getDevice="getDevice",c.releaseDevice="releaseDevice",c.adoptDevice="adoptDevice",c.discoverDevices="discoverDevices",c.createDevice="createDevice",c.getCreateDeviceSettings="getCreateDeviceSettings",c.reboot="reboot",c.getRefreshFrequency="getRefreshFrequency",c.refresh="refresh",c.getMediaStatus="getMediaStatus",c.load="load",c.seek="seek",c.skipNext="skipNext",c.skipPrevious="skipPrevious",c.convert="convert",c.convertMedia="convertMedia",c.getSettings="getSettings",c.putSetting="putSetting",c.armSecuritySystem="armSecuritySystem",c.disarmSecuritySystem="disarmSecuritySystem",c.setAirPurifierState="setAirPurifierState",c.getReadmeMarkdown="getReadmeMarkdown",c.getOauthUrl="getOauthUrl",c.onOauthCallback="onOauthCallback",c.canMixin="canMixin",c.getMixin="getMixin",c.releaseMixin="releaseMixin",c.onRequest="onRequest",c.onConnection="onConnection",c.onPush="onPush",c.run="run",c.eval="eval",c.loadScripts="loadScripts",c.saveScript="saveScript",c.forkInterface="forkInterface",c.getDetectionInput="getDetectionInput",c.getObjectTypes="getObjectTypes",c.detectObjects="detectObjects",c.generateObjectDetections="generateObjectDetections",c.getDetectionModel="getDetectionModel",c.setHumidity="setHumidity",c.setFan="setFan",c.startRTCSignalingSession="startRTCSignalingSession",c.createRTCSignalingSession="createRTCSignalingSession",c.getScryptedUserAccessControl="getScryptedUserAccessControl",c.generateVideoFrames="generateVideoFrames",c.connectStream="connectStream",c.getTTYSettings="getTTYSettings",c.getChatCompletion="getChatCompletion",c.streamChatCompletion="streamChatCompletion",c.getTextEmbedding="getTextEmbedding",c.getImageEmbedding="getImageEmbedding",c.callLLMTool="callLLMTool",c.getLLMTools="getLLMTools"})(n||(sn.ScryptedInterfaceMethod=n={})),sn.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Resolution:{name:"Resolution",methods:[],properties:["resolution"]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ChatCompletion:{name:"ChatCompletion",methods:["getChatCompletion","streamChatCompletion"],properties:["chatCompletionCapabilities"]},TextEmbedding:{name:"TextEmbedding",methods:["getTextEmbedding"],properties:[]},ImageEmbedding:{name:"ImageEmbedding",methods:["getImageEmbedding"],properties:[]},LLMTools:{name:"LLMTools",methods:["callLLMTool","getLLMTools"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}};var r;(function(c){c.Builtin="Builtin",c.Internal="Internal",c.Camera="Camera",c.Fan="Fan",c.Light="Light",c.Switch="Switch",c.Outlet="Outlet",c.Sensor="Sensor",c.Scene="Scene",c.Program="Program",c.Automation="Automation",c.Vacuum="Vacuum",c.Notifier="Notifier",c.Thermostat="Thermostat",c.Lock="Lock",c.PasswordControl="PasswordControl",c.Display="Display",c.SmartDisplay="SmartDisplay",c.Speaker="Speaker",c.SmartSpeaker="SmartSpeaker",c.RemoteDesktop="RemoteDesktop",c.Event="Event",c.Entry="Entry",c.Garage="Garage",c.DeviceProvider="DeviceProvider",c.DataSource="DataSource",c.API="API",c.Doorbell="Doorbell",c.Irrigation="Irrigation",c.Valve="Valve",c.Person="Person",c.SecuritySystem="SecuritySystem",c.WindowCovering="WindowCovering",c.Siren="Siren",c.AirPurifier="AirPurifier",c.Internet="Internet",c.Network="Network",c.Bridge="Bridge",c.LLM="LLM",c.Unknown="Unknown"})(r||(sn.ScryptedDeviceType=r={}));var s;(function(c){c.Humidify="Humidify",c.Dehumidify="Dehumidify",c.Auto="Auto",c.Off="Off"})(s||(sn.HumidityMode=s={}));var a;(function(c){c.Auto="Auto",c.Manual="Manual"})(a||(sn.FanMode=a={}));var l;(function(c){c.C="C",c.F="F"})(l||(sn.TemperatureUnit=l={}));var h;(function(c){c.Off="Off",c.Cool="Cool",c.Heat="Heat",c.HeatCool="HeatCool",c.Auto="Auto",c.FanOnly="FanOnly",c.Purifier="Purifier",c.Eco="Eco",c.Dry="Dry",c.On="On"})(h||(sn.ThermostatMode=h={}));var m;(function(c){c.Absolute="Absolute",c.Relative="Relative",c.Continuous="Continuous",c.Preset="Preset",c.Home="Home"})(m||(sn.PanTiltZoomMovement=m={}));var p;(function(c){c.Locked="Locked",c.Unlocked="Unlocked",c.Jammed="Jammed"})(p||(sn.LockState=p={}));var x;(function(c){c.Trickle="trickle",c.Charging="charging",c.NotCharging="not-charging"})(x||(sn.ChargeState=x={}));var b;(function(c){c.Inactive="Inactive",c.Idle="Idle",c.Active="Active",c.ActiveNightMode="ActiveNightMode"})(b||(sn.AirPurifierStatus=b={}));var w;(function(c){c.Manual="Manual",c.Automatic="Automatic"})(w||(sn.AirPurifierMode=w={}));var E;(function(c){c.Unknown="Unknown",c.Excellent="Excellent",c.Good="Good",c.Fair="Fair",c.Inferior="Inferior",c.Poor="Poor"})(E||(sn.AirQuality=E={}));var M;(function(c){c.Disarmed="Disarmed",c.HomeArmed="HomeArmed",c.AwayArmed="AwayArmed",c.NightArmed="NightArmed"})(M||(sn.SecuritySystemMode=M={}));var C;(function(c){c.Sensor="Sensor",c.Occupied="Occupied",c.Time="Time",c.Error="Error"})(C||(sn.SecuritySystemObstruction=C={}));var S;(function(c){c.Idle="Idle",c.Playing="Playing",c.Paused="Paused",c.Buffering="Buffering"})(S||(sn.MediaPlayerState=S={}));var _;(function(c){c.ScryptedDevice="ScryptedDevice",c.ScryptedPlugin="ScryptedPlugin",c.ScryptedPluginRuntime="ScryptedPluginRuntime",c.OnOff="OnOff",c.Brightness="Brightness",c.ColorSettingTemperature="ColorSettingTemperature",c.ColorSettingRgb="ColorSettingRgb",c.ColorSettingHsv="ColorSettingHsv",c.Buttons="Buttons",c.PressButtons="PressButtons",c.Sensors="Sensors",c.Notifier="Notifier",c.StartStop="StartStop",c.Pause="Pause",c.Dock="Dock",c.TemperatureSetting="TemperatureSetting",c.Thermometer="Thermometer",c.HumiditySensor="HumiditySensor",c.Camera="Camera",c.Resolution="Resolution",c.Microphone="Microphone",c.AudioVolumeControl="AudioVolumeControl",c.Display="Display",c.VideoCamera="VideoCamera",c.VideoCameraMask="VideoCameraMask",c.VideoTextOverlays="VideoTextOverlays",c.VideoRecorder="VideoRecorder",c.VideoRecorderManagement="VideoRecorderManagement",c.PanTiltZoom="PanTiltZoom",c.EventRecorder="EventRecorder",c.VideoClips="VideoClips",c.VideoCameraConfiguration="VideoCameraConfiguration",c.Intercom="Intercom",c.Lock="Lock",c.PasswordStore="PasswordStore",c.Scene="Scene",c.Entry="Entry",c.EntrySensor="EntrySensor",c.DeviceProvider="DeviceProvider",c.DeviceDiscovery="DeviceDiscovery",c.DeviceCreator="DeviceCreator",c.Battery="Battery",c.Charger="Charger",c.Reboot="Reboot",c.Refresh="Refresh",c.MediaPlayer="MediaPlayer",c.Online="Online",c.BufferConverter="BufferConverter",c.MediaConverter="MediaConverter",c.Settings="Settings",c.BinarySensor="BinarySensor",c.TamperSensor="TamperSensor",c.Sleep="Sleep",c.PowerSensor="PowerSensor",c.AudioSensor="AudioSensor",c.MotionSensor="MotionSensor",c.AmbientLightSensor="AmbientLightSensor",c.OccupancySensor="OccupancySensor",c.FloodSensor="FloodSensor",c.UltravioletSensor="UltravioletSensor",c.LuminanceSensor="LuminanceSensor",c.PositionSensor="PositionSensor",c.SecuritySystem="SecuritySystem",c.PM10Sensor="PM10Sensor",c.PM25Sensor="PM25Sensor",c.VOCSensor="VOCSensor",c.NOXSensor="NOXSensor",c.CO2Sensor="CO2Sensor",c.AirQualitySensor="AirQualitySensor",c.AirPurifier="AirPurifier",c.FilterMaintenance="FilterMaintenance",c.Readme="Readme",c.OauthClient="OauthClient",c.MixinProvider="MixinProvider",c.HttpRequestHandler="HttpRequestHandler",c.EngineIOHandler="EngineIOHandler",c.PushHandler="PushHandler",c.Program="Program",c.Scriptable="Scriptable",c.ClusterForkInterface="ClusterForkInterface",c.ObjectDetector="ObjectDetector",c.ObjectDetection="ObjectDetection",c.ObjectDetectionPreview="ObjectDetectionPreview",c.ObjectDetectionGenerator="ObjectDetectionGenerator",c.HumiditySetting="HumiditySetting",c.Fan="Fan",c.RTCSignalingChannel="RTCSignalingChannel",c.RTCSignalingClient="RTCSignalingClient",c.LauncherApplication="LauncherApplication",c.ScryptedUser="ScryptedUser",c.VideoFrameGenerator="VideoFrameGenerator",c.StreamService="StreamService",c.TTY="TTY",c.TTYSettings="TTYSettings",c.ChatCompletion="ChatCompletion",c.TextEmbedding="TextEmbedding",c.ImageEmbedding="ImageEmbedding",c.LLMTools="LLMTools",c.ScryptedSystemDevice="ScryptedSystemDevice",c.ScryptedDeviceCreator="ScryptedDeviceCreator",c.ScryptedSettings="ScryptedSettings"})(_||(sn.ScryptedInterface=_={}));var N;return function(c){c.Url="text/x-uri",c.InsecureLocalUrl="text/x-insecure-local-uri",c.LocalUrl="text/x-local-uri",c.ServerId="text/x-server-id",c.PushEndpoint="text/x-push-endpoint",c.SchemePrefix="x-scrypted/x-scrypted-scheme-",c.MediaStreamUrl="text/x-media-url",c.MediaObject="x-scrypted/x-scrypted-media-object",c.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",c.RequestMediaStream="x-scrypted/x-scrypted-request-stream",c.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",c.FFmpegInput="x-scrypted/x-ffmpeg-input",c.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",c.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",c.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",c.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",c.Image="x-scrypted/x-scrypted-image"}(N||(sn.ScryptedMimeTypes=N={})),sn}var DC=jB();const ul=Object.create(null);ul.open="0";ul.close="1";ul.ping="2";ul.pong="3";ul.message="4";ul.upgrade="5";ul.noop="6";const Jy=Object.create(null);Object.keys(ul).forEach(e=>{Jy[ul[e]]=e});const Sw={type:"error",data:"parser error"},tR=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",nR=typeof ArrayBuffer=="function",rR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,K9=({type:e,data:t},n,r)=>tR&&t instanceof Blob?n?r(t):AC(t,r):nR&&(t instanceof ArrayBuffer||rR(t))?n?r(t):AC(new Blob([t]),r):r(ul[e]+(t||"")),AC=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function jC(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x2;function kB(e,t){if(tR&&e.data instanceof Blob)return e.data.arrayBuffer().then(jC).then(t);if(nR&&(e.data instanceof ArrayBuffer||rR(e.data)))return t(jC(e.data));K9(e,!1,n=>{x2||(x2=new TextEncoder),t(x2.encode(n))})}const kC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gp=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<kC.length;e++)Gp[kC.charCodeAt(e)]=e;const PB=e=>{let t=e.length*.75,n=e.length,r,s=0,a,l,h,m;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const p=new ArrayBuffer(t),x=new Uint8Array(p);for(r=0;r<n;r+=4)a=Gp[e.charCodeAt(r)],l=Gp[e.charCodeAt(r+1)],h=Gp[e.charCodeAt(r+2)],m=Gp[e.charCodeAt(r+3)],x[s++]=a<<2|l>>4,x[s++]=(l&15)<<4|h>>2,x[s++]=(h&3)<<6|m&63;return p},zB=typeof ArrayBuffer=="function",Q9=(e,t)=>{if(typeof e!="string")return{type:"message",data:iR(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:BB(e.substring(1),t)}:Jy[n]?e.length>1?{type:Jy[n],data:e.substring(1)}:{type:Jy[n]}:Sw},BB=(e,t)=>{if(zB){const n=PB(e);return iR(n,t)}else return{base64:!0,data:e}},iR=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},sR="",UB=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((a,l)=>{K9(a,!1,h=>{r[l]=h,++s===n&&t(r.join(sR))})})},FB=(e,t)=>{const n=e.split(sR),r=[];for(let s=0;s<n.length;s++){const a=Q9(n[s],t);if(r.push(a),a.type==="error")break}return r};function HB(){return new TransformStream({transform(e,t){kB(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const a=new DataView(s.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{s=new Uint8Array(9);const a=new DataView(s.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let b2;function Ey(e){return e.reduce((t,n)=>t+n.length,0)}function Ry(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function IB(e,t){b2||(b2=new TextDecoder);const n=[];let r=0,s=-1,a=!1;return new TransformStream({transform(l,h){for(n.push(l);;){if(r===0){if(Ey(n)<1)break;const m=Ry(n,1);a=(m[0]&128)===128,s=m[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Ey(n)<2)break;const m=Ry(n,2);s=new DataView(m.buffer,m.byteOffset,m.length).getUint16(0),r=3}else if(r===2){if(Ey(n)<8)break;const m=Ry(n,8),p=new DataView(m.buffer,m.byteOffset,m.length),x=p.getUint32(0);if(x>Math.pow(2,21)-1){h.enqueue(Sw);break}s=x*Math.pow(2,32)+p.getUint32(4),r=3}else{if(Ey(n)<s)break;const m=Ry(n,s);h.enqueue(Q9(a?m:b2.decode(m),t)),r=0}if(s===0||s>e){h.enqueue(Sw);break}}}})}const oR=4;function Si(e){if(e)return $B(e)}function $B(e){for(var t in Si.prototype)e[t]=Si.prototype[t];return e}Si.prototype.on=Si.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Si.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Si.prototype.off=Si.prototype.removeListener=Si.prototype.removeAllListeners=Si.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Si.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Si.prototype.emitReserved=Si.prototype.emit;Si.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Si.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Z9=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Lo=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),VB="arraybuffer";function aR(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const qB=Lo.setTimeout,WB=Lo.clearTimeout;function J9(e,t){t.useNativeTimers?(e.setTimeoutFn=qB.bind(Lo),e.clearTimeoutFn=WB.bind(Lo)):(e.setTimeoutFn=Lo.setTimeout.bind(Lo),e.clearTimeoutFn=Lo.clearTimeout.bind(Lo))}const GB=1.33;function YB(e){return typeof e=="string"?XB(e):Math.ceil((e.byteLength||e.size)*GB)}function XB(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function lR(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function KB(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function QB(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class ZB extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class e4 extends Si{constructor(t){super(),this.writable=!1,J9(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new ZB(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Q9(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=KB(t);return n.length?"?"+n:""}}class JB extends e4{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};FB(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,UB(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=lR()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let cR=!1;try{cR=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const eU=cR;function tU(){}class nU extends JB{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,a)=>{this.onError("xhr post error",s,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let om=class ex extends Si{constructor(t,n,r){super(),this.createRequest=t,J9(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=aR(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=ex.requestsCount++,ex.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=tU,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ex.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};om.requestsCount=0;om.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",PC);else if(typeof addEventListener=="function"){const e="onpagehide"in Lo?"pagehide":"unload";addEventListener(e,PC,!1)}}function PC(){for(let e in om.requests)om.requests.hasOwnProperty(e)&&om.requests[e].abort()}const rU=function(){const e=uR({xdomain:!1});return e&&e.responseType!==null}();class iU extends nU{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=rU&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new om(uR,this.uri(),t)}}function uR(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||eU))return new XMLHttpRequest}catch{}if(!t)try{return new Lo[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const dR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class sU extends e4{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=dR?{}:aR(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;K9(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}s&&Z9(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=lR()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const L2=Lo.WebSocket||Lo.MozWebSocket;class oU extends sU{createSocket(t,n,r){return dR?new L2(t,n,r):n?new L2(t,n):new L2(t)}doWrite(t,n){this.ws.send(n)}}class aU extends e4{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=IB(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=HB();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const a=()=>{r.read().then(({done:h,value:m})=>{h||(this.onPacket(m),a())}).catch(h=>{})};a();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Z9(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const lU={websocket:oU,webtransport:aU,polling:iU},cU=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,uU=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zC(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=cU.exec(e||""),a={},l=14;for(;l--;)a[uU[l]]=s[l]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=dU(a,a.path),a.queryKey=fU(a,a.query),a}function dU(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function fU(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,a){s&&(n[s]=a)}),n}const Cw=typeof addEventListener=="function"&&typeof removeEventListener=="function",tx=[];Cw&&addEventListener("offline",()=>{tx.forEach(e=>e())},!1);class hu extends Si{constructor(t,n){if(super(),this.binaryType=VB,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=zC(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=zC(n.host).host);J9(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=QB(this.opts.query)),Cw&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tx.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=oR,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&hu.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",hu.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=YB(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Z9(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(hu.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Cw&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=tx.indexOf(this._offlineEventListener);r!==-1&&tx.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}hu.protocol=oR;class hU extends hu{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;hu.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",b=>{if(!r)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;hu.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(x(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=n.name,this.emitReserved("upgradeError",w)}}))};function a(){r||(r=!0,x(),n.close(),n=null)}const l=b=>{const w=new Error("probe error: "+b);w.transport=n.name,a(),this.emitReserved("upgradeError",w)};function h(){l("transport closed")}function m(){l("socket closed")}function p(b){n&&b.name!==n.name&&a()}const x=()=>{n.removeListener("open",s),n.removeListener("error",l),n.removeListener("close",h),this.off("close",m),this.off("upgrading",p)};n.once("open",s),n.once("error",l),n.once("close",h),this.once("close",m),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}class Ew extends hU{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>lU[s]).filter(s=>!!s)),super(t,r)}}class mU extends Error{constructor(t){super("Operation Timed Out"),this.promise=t}}function pU(e,t){return new Promise((n,r)=>{const s=setTimeout(()=>r(new mU(t)),e);t.then(a=>{clearTimeout(s),n(a)}).catch(a=>{clearTimeout(s),r(a)})})}function gU(e){return e>=200&&e<=299}function fR(e){if(!gU(e))throw new Error(`http response statusCode ${e}`);return!0}function hR(e){return e.method||(e.body?"POST":"GET")}function vU(e){switch(e){case"json":return"application/json";case"text":return"text/plain"}}function Rw(e,t){return t=t.toLowerCase(),e.find(([n])=>n.toLowerCase()===t)}function yU(e,t){t=t.toLowerCase();const n=e.filter(([r,s])=>r.toLowerCase()!==t);e.length=0,n.forEach(r=>e.push(r))}function _w(e,t,n){yU(e,t),e.push([t,n])}function mR(e,t){if(Rw(e,"Accept"))return;const n=vU(t);n&&_w(e,"Accept",n)}function pR(e){const t=[];if(!e)return t;if(e instanceof Headers){for(const[n,r]of e.entries())t.push([n,r]);return t}if(e instanceof Array){for(const[n,r]of e)t.push([n,r]);return t}for(const n of Object.keys(e)){const r=e[n];t.push([n,r])}return t}function gR(e,t){let n;return typeof t=="object"?(t=JSON.stringify(t),n="application/json"):typeof t=="string"&&(n="text/plain"),n&&!Rw(e,"Content-Type")&&_w(e,"Content-Type",n),Rw(e,"Content-Length")||(t=Buffer.from(t),_w(e,"Content-Length",t.length.toString())),t}async function xU(e,t){switch(t){case"json":return e.json();case"text":return e.text();case"readable":return e}return new Uint8Array(await e.arrayBuffer())}async function bU(e){var a;const t=pR(e.headers);mR(t,e.responseType);let{body:n}=e;n&&!(n instanceof ReadableStream)&&(n=gR(t,n));let r,s;e.timeout&&(r=new AbortController,s=setTimeout(()=>r.abort(),e.timeout),(a=e.signal)==null||a.addEventListener("abort",()=>{var l;return r.abort((l=e.signal)==null?void 0:l.reason)}));try{const{url:l}=e,h=await fetch(l,{method:hR(e),credentials:e.withCredentials?"include":void 0,headers:t,signal:(r==null?void 0:r.signal)||e.signal,body:n});if((e==null?void 0:e.checkStatusCode)===void 0||e!=null&&e.checkStatusCode)try{if(!(typeof(e==null?void 0:e.checkStatusCode)=="function"?e.checkStatusCode:fR)(h.status))throw new Error(`http response statusCode ${h.status}`)}catch(m){throw h.arrayBuffer().catch(()=>{}),m}return{statusCode:h.status,headers:h.headers,body:await xU(h,e.responseType)}}finally{clearTimeout(s)}}async function hb(e){const t=[];e.on("data",r=>t.push(r));const{once:n}=require("events");return await n(e,"end"),Buffer.concat(t)}const LU={async parse(e){return(await hb(e)).toString()}},wU={async parse(e){return JSON.parse((await hb(e)).toString())}},SU={async parse(e){return hb(e)}},CU={async parse(e){return e}};function EU(e){switch(e){case"json":return wU;case"text":return LU;case"readable":return CU}return SU}function RU(e,t){return EU(t).parse(e)}async function _U(e){var S;const t=pR(e.headers);mR(t,e.responseType);const{once:n}=require("events"),{PassThrough:r,Readable:s}=require("stream"),{http:a,https:l}=require("follow-redirects"),{url:h}=e,p=h.toString().startsWith("https:")?l:a;let{body:x}=e;if(x&&!(x instanceof s)){const _=new r;_.write(Buffer.from(gR(t,x))),_.end(),x=_}let b,w;e.timeout&&(b=new AbortController,w=setTimeout(()=>b.abort(),e.timeout),(S=e.signal)==null||S.addEventListener("abort",()=>{var _;return b.abort((_=e.signal)==null?void 0:_.reason)}));const E=(b==null?void 0:b.signal)||e.signal;E==null||E.addEventListener("abort",()=>{var _;return C.destroy(new Error(((_=e.signal)==null?void 0:_.reason)||"abort"))});const M={};for(const[_,N]of t)M[_]?M[_].push(N):M[_]=[N];const C=p.request(h,{method:hR(e),rejectUnauthorized:e.rejectUnauthorized,family:e.family,headers:M,signal:E,timeout:e.timeout});x?x.pipe(C):C.end();try{const[_]=await n(C,"response");if((e==null?void 0:e.checkStatusCode)===void 0||e!=null&&e.checkStatusCode)try{const c=typeof(e==null?void 0:e.checkStatusCode)=="function"?e.checkStatusCode:fR;if(!_.statusCode||!c(_.statusCode))throw new Error(`http response statusCode ${_.statusCode}`)}catch(c){throw hb(_).catch(()=>{}),c}const N=new Headers;for(const[c,j]of Object.entries(_.headers))for(const D of typeof j=="string"?[j]:j)N.append(c,D);return{statusCode:_.statusCode,headers:N,body:await RU(_,e.responseType)}}finally{clearTimeout(w)}}const Xx=class Xx{constructor(t,n,r,s,a){this.peer=t,this.entry=n,this.constructorName=r,this.proxyProps=s,this.proxyOneWayMethods=a}toPrimitive(){const t=this.peer;return`RpcProxy-${t.selfName}:${t.peerName}: ${this.constructorName}`}get(t,n,r){var a,l,h,m,p;if(n===Symbol.asyncIterator)return(a=this.proxyProps)!=null&&a[Symbol.asyncIterator.toString()]?()=>new Proxy(()=>{},this):void 0;if(Xx.iteratorMethods.has(n==null?void 0:n.toString())){const x=(h=(l=this.proxyProps)==null?void 0:l[Symbol.asyncIterator.toString()])==null?void 0:h[n];if(x)return new Proxy(()=>x,this)}if(n===Dr.PROPERTY_PROXY_ID)return this.entry.id;if(n==="__proxy_constructor")return this.constructorName;if(n===Dr.PROPERTY_PROXY_PEER)return this.peer;if(n===Dr.PROPERTY_PROXY_PROPERTIES)return this.proxyProps;if(n===Dr.PROPERTY_PROXY_ONEWAY_METHODS)return this.proxyOneWayMethods;if(n===Dr.PROPERTY_JSON_DISABLE_SERIALIZATION||n===Dr.PROPERTY_JSON_COPY_SERIALIZE_CHILDREN||n==="then"||n==="constructor")return;if(((m=this.proxyProps)==null?void 0:m[n])!==void 0)return(p=this.proxyProps)==null?void 0:p[n];const s=Dr.handleFunctionInvocations(this,t,n,r);return s||new Proxy(()=>n,this)}set(t,n,r,s){return n===Dr.finalizerIdSymbol?this.entry.finalizerId=r:(this.proxyProps||(this.proxyProps={}),this.proxyProps[n]=r),!0}apply(t,n,r){var b,w,E;const s=t()||null,a=(w=(b=this.proxyOneWayMethods)==null?void 0:b.includes)==null?void 0:w.call(b,s);if(Object.isFrozen(this.peer.pendingResults))return a?Promise.resolve():Promise.reject(new jd(this.peer,"RpcPeer has been killed (apply) "+t()));const l=[],h={};for(const M of r||[])l.push(this.peer.serialize(M,h));const m={type:"apply",id:void 0,proxyId:this.entry.id,args:l,method:s};if(a)return m.oneway=!0,s===null&&delete m.method,this.peer.send(m,void 0,h),Promise.resolve();const p=this.peer.createPendingResult(s,(M,C)=>{m.id=M,this.peer.send(m,C,h)}),x=(E=this.proxyProps)==null?void 0:E[Symbol.asyncIterator.toString()];return!x||s!==x.next&&s!==x.return?p:p.then(M=>s===x.return?{done:!0,value:void 0}:{value:M,done:!1}).catch(M=>{if(M.name==="StopAsyncIteration")return{done:!0,value:void 0};throw M})}};et(Xx,"iteratorMethods",new Set(["next","throw","return"]));let Mw=Xx;class jd extends Error{constructor(t,n,r,s){super(`${n}
${t.selfName}:${t.peerName}`),this.cause=r,s!=null&&s.name&&(this.name=s==null?void 0:s.name),s!=null&&s.stack&&(this.stack=`${(r==null?void 0:r.stack)||s.stack}
${t.peerName}:${t.selfName}`)}}try{const e=FinalizationRegistry}catch{window.WeakRef=class{constructor(n){et(this,"target");this.target=n}deref(){return this.target}},window.FinalizationRegistry=class{register(){}}}var Xt;let Dr=(Xt=class{constructor(t,n,r){et(this,"params",{});et(this,"pendingResults",{});et(this,"localProxied",new Map);et(this,"localProxyMap",new Map);et(this,"remoteWeakProxies",{});et(this,"finalizers",new FinalizationRegistry(t=>this.finalize(t)));et(this,"nameDeserializerMap",new Map);et(this,"onProxyTypeSerialization",new Map);et(this,"onProxySerialization");et(this,"constructorSerializerMap",new Map);et(this,"transportSafeArgumentTypes",Xt.getDefaultTransportSafeArgumentTypes());et(this,"killed");et(this,"killedSafe");et(this,"killedDeferred");et(this,"tags",{});et(this,"yieldedAsyncIterators",new Set);this.selfName=t,this.peerName=n,this.send=r,this.killed=new Promise((s,a)=>{this.killedDeferred={resolve:s,reject:a,method:void 0}}).catch(s=>s.message||"Unknown Error"),this.killedSafe=this.killed.then(()=>{}).catch(()=>{})}static isRpcProxy(t){return!!(t!=null&&t[Xt.PROPERTY_PROXY_ID])}static getDefaultTransportSafeArgumentTypes(){const t=new Set;return t.add(Number.name),t.add(String.name),t.add(Object.name),t.add(Boolean.name),t.add(Array.name),t}static handleFunctionInvocations(t,n,r,s){if(r==="apply")return(a,l)=>t.apply(n,t,l);if(r==="call")return(a,...l)=>t.apply(n,t,l);if(r==="toString"||r===Symbol.toPrimitive)return(a,...l)=>t.toPrimitive()}static getIteratorNext(t){var r;if(!t[Symbol.asyncIterator])return;const n=(r=t[this.PROPERTY_PROXY_PROPERTIES])==null?void 0:r[Symbol.asyncIterator.toString()];return(n==null?void 0:n.next)||"next"}static prepareProxyProperties(t){let n=t==null?void 0:t[Xt.PROPERTY_PROXY_PROPERTIES];return t[Symbol.asyncIterator]&&(n||(n={}),n[Symbol.asyncIterator.toString()]||(n[Symbol.asyncIterator.toString()]={next:"next",throw:"throw",return:"return"})),n}static isTransportSafe(t){var n;return t?!t[Symbol.asyncIterator]&&!t[Xt.PROPERTY_JSON_DISABLE_SERIALIZATION]&&this.getDefaultTransportSafeArgumentTypes().has((n=t.constructor)==null?void 0:n.name):!0}isTransportSafe(t){var n;return t?!t[Symbol.asyncIterator]&&!t[Xt.PROPERTY_JSON_DISABLE_SERIALIZATION]&&this.transportSafeArgumentTypes.has((n=t.constructor)==null?void 0:n.name):!0}static generateId(){return[...new Array(8)].map(()=>Xt.RANDOM_DIGITS.charAt(Math.floor(Math.random()*Xt.RANDOM_DIGITS.length))).join("")}createPendingResult(t,n){if(Object.isFrozen(this.pendingResults))return Promise.reject(new jd(this,"RpcPeer has been killed (createPendingResult)"));const r=new Promise((s,a)=>{const l=Xt.generateId();this.pendingResults[l]={resolve:s,reject:a,method:t},n(l,h=>a(new jd(this,h.message,h)))});return r.catch(()=>{}),r}kill(t){if(Object.isFrozen(this.pendingResults))return;const n=new jd(this,t||"peer was killed");this.killedDeferred.reject(n);for(const r of Object.values(this.pendingResults))r.reject(n);for(const r of this.yieldedAsyncIterators)r.throw(n).catch(()=>{});this.yieldedAsyncIterators.clear(),this.pendingResults=Object.freeze({}),this.params=Object.freeze({}),this.remoteWeakProxies=Object.freeze({}),this.localProxyMap.clear(),this.localProxied.clear()}addSerializer(t,n,r){this.nameDeserializerMap.set(n,r),this.constructorSerializerMap.set(t,n)}finalize(t){Xt.remotesCollected++,delete this.remoteWeakProxies[t.id];const n={__local_proxy_id:t.id,__local_proxy_finalizer_id:t.finalizerId,type:"finalize"};this.send(n)}async getParam(t){return this.createPendingResult("getParam",(n,r)=>{const s={id:n,type:"param",param:t};this.send(s,r)})}createErrorResult(t,n){return t.result=this.serializeError(n),t.throw=!0,t}deserialize(t,n){var w;if(!t)return t;const r=t[Xt.PROPERTY_JSON_COPY_SERIALIZE_CHILDREN];if(r){if(Array.isArray(r)){const M=[];for(const C of r)M.push(this.deserialize(C,n));return M}const E={};for(const[M,C]of Object.entries(t))E[M]=this.deserialize(C,n);return E}const{__remote_proxy_id:s,__remote_proxy_finalizer_id:a,__local_proxy_id:l,__remote_constructor_name:h,__serialized_value:m,__remote_proxy_props:p,__remote_proxy_oneway_methods:x}=t;if(h===Xt.RPC_RESULT_ERROR_NAME)return this.deserializeError(m);if(s){let E=(w=this.remoteWeakProxies[s])==null?void 0:w.deref();E||(E=this.newProxy(s,h,p,x)),E[Xt.finalizerIdSymbol]=a;const M=this.nameDeserializerMap.get(h);return M?M.deserialize(E,n):E}if(l){const E=this.localProxyMap.get(l);if(!E)throw new jd(this,`invalid local proxy id ${l}`);return E}const b=this.nameDeserializerMap.get(h);return b?b.deserialize(m,n):t}deserializeError(t){const{name:n,stack:r,message:s}=t;return new jd(this,s,void 0,{name:n,stack:r})}serializeError(t){const n={stack:t.stack||"[no stack]",name:t.name||"[no name]",message:t.message||"[no message]"};return{__remote_constructor_name:Xt.RPC_RESULT_ERROR_NAME,__remote_proxy_id:void 0,__remote_proxy_finalizer_id:void 0,__remote_proxy_oneway_methods:void 0,__remote_proxy_props:void 0,__serialized_value:n}}serialize(t,n){var b,w,E,M,C;if((t==null?void 0:t[Xt.PROPERTY_JSON_COPY_SERIALIZE_CHILDREN])===!0){if(Array.isArray(t)){const _=[];for(const N of t)_.push(this.serialize(N,n));return{[Xt.PROPERTY_JSON_COPY_SERIALIZE_CHILDREN]:_}}const S={};for(const[_,N]of Object.entries(t))S[_]=this.serialize(N,n);return S}if(this.isTransportSafe(t))return t;let r=t.__proxy_constructor||((w=(b=t.constructor)==null?void 0:b.name)==null?void 0:w.toString());if(t instanceof Error)return this.serializeError(t);const s=this.constructorSerializerMap.get(t.constructor);if(s){r=s;const S=this.nameDeserializerMap.get(s);if(!S)throw new Error("serializer not found for "+s);const _=S.serialize(t,n);return{__remote_proxy_id:void 0,__remote_proxy_finalizer_id:void 0,__remote_constructor_name:r,__remote_proxy_props:Xt.prepareProxyProperties(t),__remote_proxy_oneway_methods:t==null?void 0:t[Xt.PROPERTY_PROXY_ONEWAY_METHODS],__serialized_value:_}}let a=this.localProxied.get(t);if(a){const{proxyId:S,properties:_}=((E=this.onProxySerialization)==null?void 0:E.call(this,t))||{proxyId:a.id,properties:Xt.prepareProxyProperties(t)};if(S!==a.id)throw new Error("onProxySerialization proxy id mismatch");const N=Xt.generateId();return a.finalizerId=N,{__remote_proxy_id:S,__remote_proxy_finalizer_id:N,__remote_constructor_name:r,__remote_proxy_props:_,__remote_proxy_oneway_methods:t==null?void 0:t[Xt.PROPERTY_PROXY_ONEWAY_METHODS]}}const{__proxy_id:l,__proxy_peer:h}=t;if(l&&h===this)return{__local_proxy_id:l};(M=this.onProxyTypeSerialization.get(r))==null||M(t);const{proxyId:m,properties:p}=((C=this.onProxySerialization)==null?void 0:C.call(this,t))||{proxyId:Xt.generateId(),properties:Xt.prepareProxyProperties(t)};return a={id:m,finalizerId:m},this.localProxied.set(t,a),this.localProxyMap.set(m,t),{__remote_proxy_id:m,__remote_proxy_finalizer_id:m,__remote_constructor_name:r,__remote_proxy_props:p,__remote_proxy_oneway_methods:t==null?void 0:t[Xt.PROPERTY_PROXY_ONEWAY_METHODS]}}newProxy(t,n,r,s){Xt.remotesCreated++;const a={id:t,finalizerId:void 0},l=new Mw(this,a,n,r,s),h=n==="Function"||n==="AsyncFunction"?function(){}:l,m=new Proxy(h,l),p=new WeakRef(m);return this.remoteWeakProxies[t]=p,this.finalizers.register(l,a),m}handleMessage(t,n){try{Xt.activeRpcPeer=this,this.handleMessageInternal(t,n)}finally{Xt.activeRpcPeer=void 0}}sendResult(t,n){this.send(t,r=>{this.send(this.createErrorResult(t,r),void 0,n)},n)}async handleMessageInternal(t,n){var r;if(!Object.isFrozen(this.pendingResults))try{switch(t.type){case"param":{const s=t,a={};let l;try{l={type:"result",id:s.id,result:this.serialize(this.params[s.param],a)}}catch(h){this.createErrorResult(l,h)}this.sendResult(l,a);break}case"apply":{const s=t,a={type:"result",id:s.id||""},l={};try{const h=this.localProxyMap.get(s.proxyId);if(!h)throw new Error(`proxy id ${s.proxyId} not found`);const m=[];for(const x of s.args||[])m.push(this.deserialize(x,n));let p;if(s.method){if(!h[s.method])throw new Error(`target ${(r=h==null?void 0:h.constructor)==null?void 0:r.name} does not have method ${s.method}`);const b=Xt.getIteratorNext(h)===s.method;if(b&&this.yieldedAsyncIterators.delete(h),p=await h[s.method](...m),b){if(p.done)throw{name:"StopAsyncIteration",message:void 0};Object.isFrozen(this.pendingResults)?h.throw(new jd(this,"RpcPeer has been killed (yield)")).catch(()=>{}):this.yieldedAsyncIterators.add(h),p=p.value}}else p=await h(...m);a.result=this.serialize(p,l)}catch(h){this.createErrorResult(a,h)}s.oneway||this.sendResult(a,l);break}case"result":{const s=t,a=this.pendingResults[s.id];if(delete this.pendingResults[s.id],!a)throw new Error(`unknown result ${s.id}`);const l=this.deserialize(s.result,n);s.throw?a.reject(l):a.resolve(l);break}case"finalize":{const s=t,a=this.localProxyMap.get(s.__local_proxy_id);if(a){const l=this.localProxied.get(a);if(s.__local_proxy_finalizer_id&&s.__local_proxy_finalizer_id!==(l==null?void 0:l.finalizerId))break;this.localProxyMap.delete(s.__local_proxy_id),this.localProxied.delete(a)}break}default:throw new Error(`unknown rpc message type ${t.type}`)}}catch(s){console.error("unhandled rpc error",this.peerName,s);return}}},et(Xt,"finalizerIdSymbol",Symbol("rpcFinalizerId")),et(Xt,"remotesCollected",0),et(Xt,"remotesCreated",0),et(Xt,"activeRpcPeer"),et(Xt,"RANDOM_DIGITS","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"),et(Xt,"RPC_RESULT_ERROR_NAME","RPCResultError"),et(Xt,"PROPERTY_PROXY_ID","__proxy_id"),et(Xt,"PROPERTY_PROXY_PEER","__proxy_peer"),et(Xt,"PROPERTY_PROXY_ONEWAY_METHODS","__proxy_oneway_methods"),et(Xt,"PROPERTY_JSON_DISABLE_SERIALIZATION","__json_disable_serialization"),et(Xt,"PROPERTY_PROXY_PROPERTIES","__proxy_props"),et(Xt,"PROPERTY_JSON_COPY_SERIALIZE_CHILDREN","__json_copy_serialize_children"),et(Xt,"PROBED_PROPERTIES",new Set(["then","constructor","__proxy_id","__proxy_constructor",Xt.PROPERTY_PROXY_PEER,Xt.PROPERTY_PROXY_ONEWAY_METHODS,Xt.PROPERTY_JSON_DISABLE_SERIALIZATION,Xt.PROPERTY_PROXY_PROPERTIES,Xt.PROPERTY_JSON_COPY_SERIALIZE_CHILDREN])),Xt);class MU{constructor(t,n,r){et(this,"__proxy_props");this.mimeType=t,this.data=n,this.__proxy_props={},r||(r={}),r.mimeType=t,r.convert||(r.convert=null),r.toMimeTypes||(r.toMimeTypes=null);for(const[s,a]of Object.entries(r))Dr.isTransportSafe(a)&&(this.__proxy_props[s]=a),this[s]=a}async getData(){return Promise.resolve(this.data)}}class NU{constructor(t,n){et(this,"__proxy_oneway_methods",["removeListener"]);this.listener=t,this.listeners=n,this.listeners.add(this)}removeListener(){this.listeners.delete(this),this.listener.removeListener()}}class OU{constructor(){et(this,"listeners",new Set)}manageListener(t){return new NU(t,this.listeners)}removeListeners(){for(const t of[...this.listeners])t.removeListener();this.listeners.clear()}}class TU extends OU{constructor(n,r){super();et(this,"acl");this.api=n,this.mediaManager=r}setScryptedInterfaceDescriptors(n,r){var s;return(s=this.acl)==null||s.deny(),this.api.setScryptedInterfaceDescriptors(n,r)}setState(n,r,s){var a;return(a=this.acl)==null||a.deny(),this.api.setState(n,r,s)}onDevicesChanged(n){var r;return(r=this.acl)==null||r.deny(),this.api.onDevicesChanged(n)}onDeviceDiscovered(n){var r;return(r=this.acl)==null||r.deny(),this.api.onDeviceDiscovered(n)}onDeviceEvent(n,r,s){var a;return(a=this.acl)==null||a.deny(),this.api.onDeviceEvent(n,r,s)}onMixinEvent(n,r,s,a){var l;return(l=this.acl)==null||l.deny(),this.api.onMixinEvent(n,r,s,a)}onDeviceRemoved(n){var r;return(r=this.acl)==null||r.deny(),this.api.onDeviceRemoved(n)}setStorage(n,r){var s;return(s=this.acl)==null||s.deny(),this.api.setStorage(n,r)}getDeviceById(n){var r;if(!((r=this.acl)!=null&&r.shouldRejectDevice(n)))return this.api.getDeviceById(n)}setDeviceProperty(n,r,s){var a;return(a=this.acl)==null||a.deny(),this.api.setDeviceProperty(n,r,s)}removeDevice(n){var r;return(r=this.acl)==null||r.deny(),this.api.removeDevice(n)}async listen(n){return this.acl?this.manageListener(await this.api.listen((r,s,a)=>{this.acl.shouldRejectEvent(r,s)||n(r,s,a)})):this.manageListener(await this.api.listen(n))}async listenDevice(n,r,s){return this.acl?this.manageListener(await this.api.listenDevice(n,r,(a,l)=>{this.acl.shouldRejectEvent(n,a)||s(a,l)})):this.manageListener(await this.api.listenDevice(n,r,s))}getLogger(n){var r;return(r=this.acl)==null||r.deny(),this.api.getLogger(n)}getComponent(n){var r;return(r=this.acl)==null||r.deny(),this.api.getComponent(n)}async getMediaManager(){return this.mediaManager}async requestRestart(){var n;return(n=this.acl)==null||n.deny(),this.api.requestRestart()}}var on={},BC;function DU(){if(BC)return on;BC=1,Object.defineProperty(on,"__esModule",{value:!0}),on.ScryptedMimeTypes=on.ScryptedInterface=on.MediaPlayerState=on.SecuritySystemObstruction=on.SecuritySystemMode=on.AirQuality=on.AirPurifierMode=on.AirPurifierStatus=on.ChargeState=on.LockState=on.PanTiltZoomMovement=on.ThermostatMode=on.TemperatureUnit=on.FanMode=on.HumidityMode=on.ScryptedDeviceType=on.ScryptedInterfaceDescriptors=on.ScryptedInterfaceMethod=on.ScryptedInterfaceProperty=on.DeviceBase=on.TYPES_VERSION=void 0,on.TYPES_VERSION="0.5.43";class e{}on.DeviceBase=e;var t;(function(c){c.id="id",c.info="info",c.interfaces="interfaces",c.mixins="mixins",c.name="name",c.nativeId="nativeId",c.pluginId="pluginId",c.providedInterfaces="providedInterfaces",c.providedName="providedName",c.providedRoom="providedRoom",c.providedType="providedType",c.providerId="providerId",c.room="room",c.type="type",c.scryptedRuntimeArguments="scryptedRuntimeArguments",c.on="on",c.brightness="brightness",c.colorTemperature="colorTemperature",c.rgb="rgb",c.hsv="hsv",c.buttons="buttons",c.sensors="sensors",c.running="running",c.paused="paused",c.docked="docked",c.temperatureSetting="temperatureSetting",c.temperature="temperature",c.temperatureUnit="temperatureUnit",c.humidity="humidity",c.resolution="resolution",c.audioVolumes="audioVolumes",c.recordingActive="recordingActive",c.ptzCapabilities="ptzCapabilities",c.lockState="lockState",c.entryOpen="entryOpen",c.batteryLevel="batteryLevel",c.chargeState="chargeState",c.online="online",c.fromMimeType="fromMimeType",c.toMimeType="toMimeType",c.converters="converters",c.binaryState="binaryState",c.tampered="tampered",c.sleeping="sleeping",c.powerDetected="powerDetected",c.audioDetected="audioDetected",c.motionDetected="motionDetected",c.ambientLight="ambientLight",c.occupied="occupied",c.flooded="flooded",c.ultraviolet="ultraviolet",c.luminance="luminance",c.position="position",c.securitySystemState="securitySystemState",c.pm10Density="pm10Density",c.pm25Density="pm25Density",c.vocDensity="vocDensity",c.noxDensity="noxDensity",c.co2ppm="co2ppm",c.airQuality="airQuality",c.airPurifierState="airPurifierState",c.filterChangeIndication="filterChangeIndication",c.filterLifeLevel="filterLifeLevel",c.humiditySetting="humiditySetting",c.fan="fan",c.applicationInfo="applicationInfo",c.chatCompletionCapabilities="chatCompletionCapabilities",c.systemDevice="systemDevice"})(t||(on.ScryptedInterfaceProperty=t={}));var n;(function(c){c.listen="listen",c.probe="probe",c.setMixins="setMixins",c.setName="setName",c.setRoom="setRoom",c.setType="setType",c.getPluginJson="getPluginJson",c.turnOff="turnOff",c.turnOn="turnOn",c.setBrightness="setBrightness",c.getTemperatureMaxK="getTemperatureMaxK",c.getTemperatureMinK="getTemperatureMinK",c.setColorTemperature="setColorTemperature",c.setRgb="setRgb",c.setHsv="setHsv",c.pressButton="pressButton",c.sendNotification="sendNotification",c.start="start",c.stop="stop",c.pause="pause",c.resume="resume",c.dock="dock",c.setTemperature="setTemperature",c.setTemperatureUnit="setTemperatureUnit",c.getPictureOptions="getPictureOptions",c.takePicture="takePicture",c.getAudioStream="getAudioStream",c.setAudioVolumes="setAudioVolumes",c.startDisplay="startDisplay",c.stopDisplay="stopDisplay",c.getVideoStream="getVideoStream",c.getVideoStreamOptions="getVideoStreamOptions",c.getPrivacyMasks="getPrivacyMasks",c.setPrivacyMasks="setPrivacyMasks",c.getVideoTextOverlays="getVideoTextOverlays",c.setVideoTextOverlay="setVideoTextOverlay",c.getRecordingStream="getRecordingStream",c.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",c.getRecordingStreamOptions="getRecordingStreamOptions",c.getRecordingStreamThumbnail="getRecordingStreamThumbnail",c.deleteRecordingStream="deleteRecordingStream",c.setRecordingActive="setRecordingActive",c.ptzCommand="ptzCommand",c.getRecordedEvents="getRecordedEvents",c.getVideoClip="getVideoClip",c.getVideoClips="getVideoClips",c.getVideoClipThumbnail="getVideoClipThumbnail",c.removeVideoClips="removeVideoClips",c.setVideoStreamOptions="setVideoStreamOptions",c.startIntercom="startIntercom",c.stopIntercom="stopIntercom",c.lock="lock",c.unlock="unlock",c.addPassword="addPassword",c.getPasswords="getPasswords",c.removePassword="removePassword",c.activate="activate",c.deactivate="deactivate",c.isReversible="isReversible",c.closeEntry="closeEntry",c.openEntry="openEntry",c.getDevice="getDevice",c.releaseDevice="releaseDevice",c.adoptDevice="adoptDevice",c.discoverDevices="discoverDevices",c.createDevice="createDevice",c.getCreateDeviceSettings="getCreateDeviceSettings",c.reboot="reboot",c.getRefreshFrequency="getRefreshFrequency",c.refresh="refresh",c.getMediaStatus="getMediaStatus",c.load="load",c.seek="seek",c.skipNext="skipNext",c.skipPrevious="skipPrevious",c.convert="convert",c.convertMedia="convertMedia",c.getSettings="getSettings",c.putSetting="putSetting",c.armSecuritySystem="armSecuritySystem",c.disarmSecuritySystem="disarmSecuritySystem",c.setAirPurifierState="setAirPurifierState",c.getReadmeMarkdown="getReadmeMarkdown",c.getOauthUrl="getOauthUrl",c.onOauthCallback="onOauthCallback",c.canMixin="canMixin",c.getMixin="getMixin",c.releaseMixin="releaseMixin",c.onRequest="onRequest",c.onConnection="onConnection",c.onPush="onPush",c.run="run",c.eval="eval",c.loadScripts="loadScripts",c.saveScript="saveScript",c.forkInterface="forkInterface",c.getDetectionInput="getDetectionInput",c.getObjectTypes="getObjectTypes",c.detectObjects="detectObjects",c.generateObjectDetections="generateObjectDetections",c.getDetectionModel="getDetectionModel",c.setHumidity="setHumidity",c.setFan="setFan",c.startRTCSignalingSession="startRTCSignalingSession",c.createRTCSignalingSession="createRTCSignalingSession",c.getScryptedUserAccessControl="getScryptedUserAccessControl",c.generateVideoFrames="generateVideoFrames",c.connectStream="connectStream",c.getTTYSettings="getTTYSettings",c.getChatCompletion="getChatCompletion",c.streamChatCompletion="streamChatCompletion",c.getTextEmbedding="getTextEmbedding",c.getImageEmbedding="getImageEmbedding",c.callLLMTool="callLLMTool",c.getLLMTools="getLLMTools"})(n||(on.ScryptedInterfaceMethod=n={})),on.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Resolution:{name:"Resolution",methods:[],properties:["resolution"]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ChatCompletion:{name:"ChatCompletion",methods:["getChatCompletion","streamChatCompletion"],properties:["chatCompletionCapabilities"]},TextEmbedding:{name:"TextEmbedding",methods:["getTextEmbedding"],properties:[]},ImageEmbedding:{name:"ImageEmbedding",methods:["getImageEmbedding"],properties:[]},LLMTools:{name:"LLMTools",methods:["callLLMTool","getLLMTools"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}};var r;(function(c){c.Builtin="Builtin",c.Internal="Internal",c.Camera="Camera",c.Fan="Fan",c.Light="Light",c.Switch="Switch",c.Outlet="Outlet",c.Sensor="Sensor",c.Scene="Scene",c.Program="Program",c.Automation="Automation",c.Vacuum="Vacuum",c.Notifier="Notifier",c.Thermostat="Thermostat",c.Lock="Lock",c.PasswordControl="PasswordControl",c.Display="Display",c.SmartDisplay="SmartDisplay",c.Speaker="Speaker",c.SmartSpeaker="SmartSpeaker",c.RemoteDesktop="RemoteDesktop",c.Event="Event",c.Entry="Entry",c.Garage="Garage",c.DeviceProvider="DeviceProvider",c.DataSource="DataSource",c.API="API",c.Doorbell="Doorbell",c.Irrigation="Irrigation",c.Valve="Valve",c.Person="Person",c.SecuritySystem="SecuritySystem",c.WindowCovering="WindowCovering",c.Siren="Siren",c.AirPurifier="AirPurifier",c.Internet="Internet",c.Network="Network",c.Bridge="Bridge",c.LLM="LLM",c.Unknown="Unknown"})(r||(on.ScryptedDeviceType=r={}));var s;(function(c){c.Humidify="Humidify",c.Dehumidify="Dehumidify",c.Auto="Auto",c.Off="Off"})(s||(on.HumidityMode=s={}));var a;(function(c){c.Auto="Auto",c.Manual="Manual"})(a||(on.FanMode=a={}));var l;(function(c){c.C="C",c.F="F"})(l||(on.TemperatureUnit=l={}));var h;(function(c){c.Off="Off",c.Cool="Cool",c.Heat="Heat",c.HeatCool="HeatCool",c.Auto="Auto",c.FanOnly="FanOnly",c.Purifier="Purifier",c.Eco="Eco",c.Dry="Dry",c.On="On"})(h||(on.ThermostatMode=h={}));var m;(function(c){c.Absolute="Absolute",c.Relative="Relative",c.Continuous="Continuous",c.Preset="Preset",c.Home="Home"})(m||(on.PanTiltZoomMovement=m={}));var p;(function(c){c.Locked="Locked",c.Unlocked="Unlocked",c.Jammed="Jammed"})(p||(on.LockState=p={}));var x;(function(c){c.Trickle="trickle",c.Charging="charging",c.NotCharging="not-charging"})(x||(on.ChargeState=x={}));var b;(function(c){c.Inactive="Inactive",c.Idle="Idle",c.Active="Active",c.ActiveNightMode="ActiveNightMode"})(b||(on.AirPurifierStatus=b={}));var w;(function(c){c.Manual="Manual",c.Automatic="Automatic"})(w||(on.AirPurifierMode=w={}));var E;(function(c){c.Unknown="Unknown",c.Excellent="Excellent",c.Good="Good",c.Fair="Fair",c.Inferior="Inferior",c.Poor="Poor"})(E||(on.AirQuality=E={}));var M;(function(c){c.Disarmed="Disarmed",c.HomeArmed="HomeArmed",c.AwayArmed="AwayArmed",c.NightArmed="NightArmed"})(M||(on.SecuritySystemMode=M={}));var C;(function(c){c.Sensor="Sensor",c.Occupied="Occupied",c.Time="Time",c.Error="Error"})(C||(on.SecuritySystemObstruction=C={}));var S;(function(c){c.Idle="Idle",c.Playing="Playing",c.Paused="Paused",c.Buffering="Buffering"})(S||(on.MediaPlayerState=S={}));var _;(function(c){c.ScryptedDevice="ScryptedDevice",c.ScryptedPlugin="ScryptedPlugin",c.ScryptedPluginRuntime="ScryptedPluginRuntime",c.OnOff="OnOff",c.Brightness="Brightness",c.ColorSettingTemperature="ColorSettingTemperature",c.ColorSettingRgb="ColorSettingRgb",c.ColorSettingHsv="ColorSettingHsv",c.Buttons="Buttons",c.PressButtons="PressButtons",c.Sensors="Sensors",c.Notifier="Notifier",c.StartStop="StartStop",c.Pause="Pause",c.Dock="Dock",c.TemperatureSetting="TemperatureSetting",c.Thermometer="Thermometer",c.HumiditySensor="HumiditySensor",c.Camera="Camera",c.Resolution="Resolution",c.Microphone="Microphone",c.AudioVolumeControl="AudioVolumeControl",c.Display="Display",c.VideoCamera="VideoCamera",c.VideoCameraMask="VideoCameraMask",c.VideoTextOverlays="VideoTextOverlays",c.VideoRecorder="VideoRecorder",c.VideoRecorderManagement="VideoRecorderManagement",c.PanTiltZoom="PanTiltZoom",c.EventRecorder="EventRecorder",c.VideoClips="VideoClips",c.VideoCameraConfiguration="VideoCameraConfiguration",c.Intercom="Intercom",c.Lock="Lock",c.PasswordStore="PasswordStore",c.Scene="Scene",c.Entry="Entry",c.EntrySensor="EntrySensor",c.DeviceProvider="DeviceProvider",c.DeviceDiscovery="DeviceDiscovery",c.DeviceCreator="DeviceCreator",c.Battery="Battery",c.Charger="Charger",c.Reboot="Reboot",c.Refresh="Refresh",c.MediaPlayer="MediaPlayer",c.Online="Online",c.BufferConverter="BufferConverter",c.MediaConverter="MediaConverter",c.Settings="Settings",c.BinarySensor="BinarySensor",c.TamperSensor="TamperSensor",c.Sleep="Sleep",c.PowerSensor="PowerSensor",c.AudioSensor="AudioSensor",c.MotionSensor="MotionSensor",c.AmbientLightSensor="AmbientLightSensor",c.OccupancySensor="OccupancySensor",c.FloodSensor="FloodSensor",c.UltravioletSensor="UltravioletSensor",c.LuminanceSensor="LuminanceSensor",c.PositionSensor="PositionSensor",c.SecuritySystem="SecuritySystem",c.PM10Sensor="PM10Sensor",c.PM25Sensor="PM25Sensor",c.VOCSensor="VOCSensor",c.NOXSensor="NOXSensor",c.CO2Sensor="CO2Sensor",c.AirQualitySensor="AirQualitySensor",c.AirPurifier="AirPurifier",c.FilterMaintenance="FilterMaintenance",c.Readme="Readme",c.OauthClient="OauthClient",c.MixinProvider="MixinProvider",c.HttpRequestHandler="HttpRequestHandler",c.EngineIOHandler="EngineIOHandler",c.PushHandler="PushHandler",c.Program="Program",c.Scriptable="Scriptable",c.ClusterForkInterface="ClusterForkInterface",c.ObjectDetector="ObjectDetector",c.ObjectDetection="ObjectDetection",c.ObjectDetectionPreview="ObjectDetectionPreview",c.ObjectDetectionGenerator="ObjectDetectionGenerator",c.HumiditySetting="HumiditySetting",c.Fan="Fan",c.RTCSignalingChannel="RTCSignalingChannel",c.RTCSignalingClient="RTCSignalingClient",c.LauncherApplication="LauncherApplication",c.ScryptedUser="ScryptedUser",c.VideoFrameGenerator="VideoFrameGenerator",c.StreamService="StreamService",c.TTY="TTY",c.TTYSettings="TTYSettings",c.ChatCompletion="ChatCompletion",c.TextEmbedding="TextEmbedding",c.ImageEmbedding="ImageEmbedding",c.LLMTools="LLMTools",c.ScryptedSystemDevice="ScryptedSystemDevice",c.ScryptedDeviceCreator="ScryptedDeviceCreator",c.ScryptedSettings="ScryptedSettings"})(_||(on.ScryptedInterface=_={}));var N;return function(c){c.Url="text/x-uri",c.InsecureLocalUrl="text/x-insecure-local-uri",c.LocalUrl="text/x-local-uri",c.ServerId="text/x-server-id",c.PushEndpoint="text/x-push-endpoint",c.SchemePrefix="x-scrypted/x-scrypted-scheme-",c.MediaStreamUrl="text/x-media-url",c.MediaObject="x-scrypted/x-scrypted-media-object",c.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",c.RequestMediaStream="x-scrypted/x-scrypted-request-stream",c.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",c.FFmpegInput="x-scrypted/x-ffmpeg-input",c.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",c.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",c.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",c.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",c.Image="x-scrypted/x-scrypted-image"}(N||(on.ScryptedMimeTypes=N={})),on}var Pn=DU();class vR{serialize(t){return console.warn("Using slow buffer serialization. Ensure the peer supports SidebandBufferSerializer."),t.toString("base64")}deserialize(t){return console.warn("Using slow buffer deserialization. Ensure the peer supports SidebandBufferSerializer."),Buffer.from(t,"base64")}}class AU{constructor(){et(this,"bufferSerializer",new vR)}serialize(t,n){if(!n)return this.bufferSerializer.serialize(t);const r=n.buffers=n.buffers||[];return r.push(t),r.length-1}deserialize(t,n){return n!=null&&n.buffers?n.buffers[t]:this.bufferSerializer.deserialize(t)}}[].concat(...Object.values(Pn.ScryptedInterfaceDescriptors).map(e=>e.properties));function yR(e){const t={};for(const n of Object.values(e))for(const r of n.properties)t[r]=n.name;return t}const xR=yR(Pn.ScryptedInterfaceDescriptors);function Nw(e,t){return Object.values(e).filter(n=>t.has(n.name)).map(n=>n.methods).flat()}function UC(e,t){return Object.values(e).filter(n=>t.has(n.name)).map(n=>n.properties).flat()}function jU(e,t,n){return Nw(e,t).includes(n)||e[Pn.ScryptedInterface.ScryptedDevice].methods.includes(n)}function kU(e,t){if(e===Pn.ScryptedInterfaceProperty.id)throw new Error("id is read only");if(e===Pn.ScryptedInterfaceProperty.nativeId)throw new Error("nativeId is read only");if(e===Pn.ScryptedInterfaceProperty.mixins)throw new Error("mixins is read only");if(e===Pn.ScryptedInterfaceProperty.interfaces)throw new Error("interfaces is a read only post-mixin computed property, use providedInterfaces");if(Dr.isRpcProxy(t))throw new Error("value must be a primitive type");if(xR[e.toString()]===Pn.ScryptedInterface.ScryptedDevice&&e!==Pn.ScryptedInterfaceProperty.info)throw new Error(`${e.toString()} can not be set. Use DeviceManager.onDevicesChanges or DeviceManager.onDeviceDiscovered to update the device description.`)}class PU{constructor(t,n,r){et(this,"nativeId");et(this,"api");et(this,"logger");this.console=r,this.api=t,this.nativeId=n}async ensureLogger(){return this.logger||(this.logger=this.api.getLogger(this.nativeId)),await this.logger}async log(t,n){(await this.ensureLogger()).log(t,n)}a(t){this.log("a",t)}async clear(){(await this.ensureLogger()).clear()}async clearAlert(t){(await this.ensureLogger()).clearAlert(t)}async clearAlerts(){(await this.ensureLogger()).clearAlerts()}d(t){this.log("d",t)}e(t){this.log("e",t)}i(t){this.log("i",t)}v(t){this.log("v",t)}w(t){this.log("w",t)}}class FC{constructor(t,n,r){this.deviceManager=t,this.id=n,this.setState=r}get(t,n,r){var s;return n==="id"?this.id:n===Dr.PROPERTY_PROXY_PROPERTIES?{id:this.id}:n==="setState"?this.setState:(s=this.deviceManager.systemManager.state[this.id][n])==null?void 0:s.value}set(t,n,r,s){return kU(n.toString(),r),this.deviceManager.systemManager.state[this.id][n]={value:r},this.setState(n.toString(),r),!0}}class zU{constructor(t,n,r){et(this,"api");et(this,"nativeIds",new Map);et(this,"deviceStorage",new Map);et(this,"mixinStorage",new Map);this.systemManager=t,this.getDeviceConsole=n,this.getMixinConsole=r}async requestRestart(){return this.api.requestRestart()}getDeviceLogger(t){var n;return new PU(this.api,t,((n=this.getDeviceConsole)==null?void 0:n.call(this,t))||console)}getDeviceState(t){const n=new FC(this,this.nativeIds.get(t).id,(r,s)=>this.api.setState(t,r,s));return new Proxy(n,n)}createDeviceState(t,n){const r=new FC(this,t,n);return new Proxy(r,r)}getDeviceStorage(t){let n=this.deviceStorage.get(t);return n||(n=new ug(this,t),this.deviceStorage.set(t,n)),n}getMixinStorage(t,n){let r=this.mixinStorage.get(n);r||(r=new Map,this.mixinStorage.set(n,r));let s=r.get(t);return s||(s=new ug(this,n,`mixin:${t}:`),r.set(t,s)),s}pruneMixinStorage(){for(const t of this.nativeIds.keys()){const n=this.nativeIds.get(t).storage;for(const r of Object.keys(n)){if(!r.startsWith("mixin:"))continue;const[,s]=r.split(":");s&&!this.systemManager.state[s]&&delete n[r]}}}async onMixinEvent(t,n,r,s){return this.api.onMixinEvent(t,n,r,s)}getNativeIds(){return Array.from(this.nativeIds.keys())}async onDeviceDiscovered(t){return this.api.onDeviceDiscovered(t)}async onDeviceRemoved(t){return this.api.onDeviceRemoved(t)}async onDeviceEvent(t,n,r){return this.api.onDeviceEvent(t,n,r)}async onDevicesChanged(t){return this.api.onDevicesChanged(t)}}function _y(e){return e===null?"null":e===void 0?"undefined":e.toString()}const sm=class sm{constructor(t,n,r){et(this,"api");return this.deviceManager=t,this.nativeId=n,this.prefix=r,this.deviceManager=t,this.api=t.api,this.nativeId=n,this.prefix||(this.prefix=""),new Proxy(this,sm.indexedHandler)}get storage(){return this.deviceManager.nativeIds.get(this.nativeId).storage}get length(){return Object.keys(this.storage).filter(t=>t.startsWith(this.prefix)).length}clear(){if(!this.prefix)this.deviceManager.nativeIds.get(this.nativeId).storage={};else{const t=this.storage;Object.keys(this.storage).filter(n=>n.startsWith(this.prefix)).forEach(n=>delete t[n])}this.api.setStorage(this.nativeId,this.storage)}getItem(t){return this.storage[this.prefix+t]}key(t){return this.prefix?Object.keys(this.storage).filter(n=>n.startsWith(this.prefix))[t].substring(this.prefix.length):Object.keys(this.storage)[t]}removeItem(t){delete this.storage[this.prefix+t],this.api.setStorage(this.nativeId,this.storage)}setItem(t,n){t=_y(t),n=_y(n),this.storage[this.prefix+t]!==n&&(this.storage[this.prefix+t]=n,this.api.setStorage(this.nativeId,this.storage))}};et(sm,"allowedMethods",["length","clear","getItem","setItem","key","removeItem"]),et(sm,"indexedHandler",{get(t,n){const r=n.toString();if(sm.allowedMethods.includes(r)){const s=t[r];return r==="length"?s:s.bind(t)}return t.getItem(_y(n))},set(t,n,r){return t.setItem(_y(n),r),!0}});let ug=sm;class BU{constructor(){et(this,"deviceManager");et(this,"api");et(this,"pluginId");et(this,"mediaManager")}getEndpoint(t){var r;if(!t)return this.pluginId;const n=(r=this.deviceManager.nativeIds.get(t))==null?void 0:r.id;if(!n)throw new Error("invalid nativeId "+t);return t?n:this.pluginId}async getUrlSafeIp(){const t=await this.api.getComponent("SCRYPTED_IP_ADDRESS");return t!=null&&t.includes(":")?`[${t}]`:t}async getAuthenticatedPath(t){return this.getPath(t)}async getInsecurePublicLocalEndpoint(t){return this.getLocalEndpoint(t,{insecure:!0,public:!0})}async getPublicCloudEndpoint(t){return this.getCloudEndpoint(t,{public:!0})}async getPublicLocalEndpoint(t){return this.getLocalEndpoint(t,{public:!0})}async getPublicPushEndpoint(t){const n=await this.mediaManager.createMediaObject(Buffer.from(this.getEndpoint(t)),Pn.ScryptedMimeTypes.PushEndpoint);return this.mediaManager.convertMediaObjectToUrl(n,Pn.ScryptedMimeTypes.PushEndpoint)}async getPath(t,n){return`/endpoint/${this.getEndpoint(t)}/${n!=null&&n.public?"public/":""}`}async getLocalEndpoint(t,n){const r=n!=null&&n.insecure?"http":"https",s=await this.api.getComponent(n!=null&&n.insecure?"SCRYPTED_INSECURE_PORT":"SCRYPTED_SECURE_PORT"),a=await this.getPath(t,n);return`${r}://${await this.getUrlSafeIp()}:${s}${a}`}async getCloudEndpoint(t,n){const r=await this.getLocalEndpoint(t,n),s=await this.mediaManager.createMediaObject(Buffer.from(r),Pn.ScryptedMimeTypes.LocalUrl);return this.mediaManager.convertMediaObjectToUrl(s,Pn.ScryptedMimeTypes.LocalUrl)}async getCloudPushEndpoint(t){const n=await this.mediaManager.createMediaObject(Buffer.from(this.getEndpoint(t)),Pn.ScryptedMimeTypes.PushEndpoint);return this.mediaManager.convertMediaObjectToUrl(n,Pn.ScryptedMimeTypes.PushEndpoint)}async setLocalAddresses(t){return(await this.api.getComponent("addresses")).setLocalAddresses(t)}async getLocalAddresses(){return await(await this.api.getComponent("addresses")).getLocalAddresses()}async setAccessControlAllowOrigin(t){return(await this.deviceManager.systemManager.getComponent("setAccessControlAllowOrigin"))(t)}}class UU{constructor(){et(this,"events",{})}dispatchEvent(t){const n=this.events[t.type];if(n)for(const r of n)r(t)}addEventListener(t,n){let r=this.events[t];r||(r=this.events[t]=[]),r.push(n)}removeEventListener(t,n){const r=this.events[t];if(!r)return;const s=r.indexOf(n);s>-1&&r.splice(s,1)}}function My(e,t){Object.defineProperty(e,"on"+t,{get:function(){throw new Error(`${t} is write only`)},set:function(n){this.events[t]=[n]}})}function FU(e){class t extends UU{constructor(s,a){super();et(this,"_url");et(this,"_protocols");et(this,"readyState");this.connection=s,this._url=s.url,this._protocols=a,this.readyState=0,e(s,{connect:(l,h)=>{if(l!=null){this.dispatchEvent({type:"error",message:l.toString()});return}this.readyState=1,this.dispatchEvent({type:"open"})},end:()=>{this.readyState=3,this.dispatchEvent({type:"close",reason:"closed"})},error:l=>{this.readyState=3,this.dispatchEvent({type:"error",message:l.toString()})},data:l=>{this.dispatchEvent({type:"message",data:l,source:this})}})}send(s){this.connection.send(s)}get url(){return this._url}get extensions(){return""}close(s){this.connection.close(s)}}return My(t.prototype,"close"),My(t.prototype,"error"),My(t.prototype,"message"),My(t.prototype,"open"),t}var b8,L8;L8=Dr.PROPERTY_PROXY_PROPERTIES,b8=Dr.PROPERTY_PROXY_ONEWAY_METHODS;class HU{constructor(t,n){et(this,L8);et(this,b8,["send","close"]);this.url=t,this.websocketMethods=n,this[Dr.PROPERTY_PROXY_PROPERTIES]={url:t}}send(t){return this.websocketMethods.send(t)}close(t){return this.websocketMethods.close(t)}}class IU{constructor(){et(this,"WebSocket")}serialize(t,n){throw new Error("WebSocketSerializer should only be used for deserialization.")}deserialize(t,n){if(this.WebSocket)return new this.WebSocket(t)}}let HC=class{constructor(t){et(this,"removeListener");this.removeListener=t}};function $U(e){let{event:t,mixinId:n}=e||{};return!t&&typeof e=="string"&&(t=e),t||(t=void 0),n?`${t}-mixin-${n}`:t}const VU=new Set([Pn.ScryptedInterface.ScryptedDevice,"Logger"]);class qU{constructor(){et(this,"systemListeners",new Set);et(this,"listeners",{})}listen(t){const n=this.systemListeners;return n.add(t),new HC(()=>{n.delete(t),t=void 0})}listenDevice(t,n,r){let s=$U(n);const a=`${t}#${s}`;let l=this.listeners[a];return l||(l=new Set,this.listeners[a]=l),l.add(r),new HC(()=>{l.delete(r),r=void 0})}notify(t,n,r,s,a,l){const{changed:h,mixinId:m}=l||{};if(s&&!h)return!1;const p={eventId:void 0,eventInterface:r,eventTime:n,property:s,mixinId:m};return this.notifyEventDetails(t,p,a)}notifyEventDetails(t,n,r,s){if(n.eventId||(n.eventId=Math.random().toString(36).substring(2)),s||(s=n.eventInterface),n.property&&!n.mixinId||VU.has(s))for(const h of this.systemListeners)h(t,n,r);const a=this.listeners[`${t}#${s}`];if(a)for(const h of a)h(n,r);const l=this.listeners[`${t}#undefined`];if(l)for(const h of l)h(n,r);return!0}}function WU(e,t){const n=new GU(e,t);return new Proxy(n,n)}class GU{constructor(t,n){et(this,"customProperties");et(this,"device");this.id=t,this.systemManager=n}toPrimitive(){return`ScryptedDevice-${this.id}`}ownKeys(t){const n=new Set(this.systemManager.state[this.id].interfaces.value),r=Nw(this.systemManager.descriptors||Pn.ScryptedInterfaceDescriptors,n),s=UC(this.systemManager.descriptors||Pn.ScryptedInterfaceDescriptors,n);return[...r,...s]}getOwnPropertyDescriptor(t,n){var h;const r=new Set(this.systemManager.state[this.id].interfaces.value),s=Nw(this.systemManager.descriptors||Pn.ScryptedInterfaceDescriptors,r),a=n.toString();if(s.includes(a))return{configurable:!0};if(UC(this.systemManager.descriptors||Pn.ScryptedInterfaceDescriptors,r).includes(a))return{configurable:!0,value:(h=this.systemManager.state[this.id][a])==null?void 0:h.value}}deleteProperty(t,n){const r=n.toString();return Object.keys(Pn.ScryptedInterfaceProperty).includes(r)?!1:(this.customProperties||(this.customProperties=new Map),this.customProperties.set(n,void 0),!0)}set(t,n,r,s){const a=n.toString();return Object.keys(Pn.ScryptedInterfaceProperty).includes(a)?!1:(this.customProperties||(this.customProperties=new Map),this.customProperties.set(n,r),!0)}get(t,n,r){var m,p,x,b,w;if(n==="id")return this.id;if((m=this.customProperties)!=null&&m.has(n))return this.customProperties.get(n);const s=Dr.handleFunctionInvocations(this,t,n,r);if(s)return s;const a=new Set(((p=this.systemManager.state[this.id].interfaces)==null?void 0:p.value)||[]),l=n.toString();if(((x=this.systemManager.propertyInterfaces)==null?void 0:x[l])||xR[l])return(w=(b=this.systemManager.state[this.id])==null?void 0:b[n])==null?void 0:w.value;if(jU(this.systemManager.descriptors||Pn.ScryptedInterfaceDescriptors,a,l))return Pn.ScryptedInterfaceDescriptors[Pn.ScryptedInterface.ScryptedDevice].methods.includes(l)?this[n].bind(this):new Proxy(()=>n,this)}ensureDevice(){return this.device||(this.device=this.systemManager.api.getDeviceById(this.id)),this.device}async apply(t,n,r){const s=t();return(await this.ensureDevice())[s](...r)}listen(t,n){return this.systemManager.listenDevice(this.id,t,n)}async setName(t){return this.systemManager.api.setDeviceProperty(this.id,Pn.ScryptedInterfaceProperty.name,t)}async setRoom(t){return this.systemManager.api.setDeviceProperty(this.id,Pn.ScryptedInterfaceProperty.room,t)}async setType(t){return this.systemManager.api.setDeviceProperty(this.id,Pn.ScryptedInterfaceProperty.type,t)}async setMixins(t){await(await this.systemManager.getComponent("plugins")).setMixins(this.id,t)}async probe(){return this.apply(()=>"probe",void 0,[])}}class YU{constructor(t){et(this,"promise");this.promise=t}async removeListener(){try{const t=await this.promise;this.promise=void 0,t==null||t.removeListener()}catch(t){console.error("removeListener",t)}}}function IC(e){const t=e,n=t[Dr.PROPERTY_PROXY_ONEWAY_METHODS]||[];return n.includes(null)||n.push(null),t[Dr.PROPERTY_PROXY_ONEWAY_METHODS]=n,e}class XU{constructor(){et(this,"api");et(this,"state");et(this,"deviceProxies",{});et(this,"log");et(this,"events",new qU);et(this,"typesVersion");et(this,"descriptors");et(this,"propertyInterfaces")}getDeviceState(t){return this.state[t]}getSystemState(){return this.state}getDeviceById(t,n){var a,l;let r;if(this.state[t]){if(n!=null)return;r=t}else for(const h of Object.keys(this.state)){const m=this.state[h];if(m&&((a=m[Pn.ScryptedInterfaceProperty.pluginId])==null?void 0:a.value)===t&&((l=m[Pn.ScryptedInterfaceProperty.nativeId])==null?void 0:l.value)==n){r=h;break}}if(!r)return;let s=this.deviceProxies[r];return s||(s=this.deviceProxies[r]=WU(r,this)),s}getDeviceByName(t){var n,r,s;for(const a of Object.keys(this.state)){const l=this.state[a];if((r=(n=l.interfaces)==null?void 0:n.value)!=null&&r.includes(Pn.ScryptedInterface.ScryptedPlugin)&&((s=l.pluginId)==null?void 0:s.value)===t)return this.getDeviceById(a);if(l.name.value===t)return this.getDeviceById(a)}}listen(t){return this.events.listen(IC((n,r,s)=>t(this.getDeviceById(n),r,s)))}listenDevice(t,n,r){let{watch:s}=n||{};return s?this.events.listenDevice(t,n,(a,l)=>r(this.getDeviceById(t),a,l)):new YU(this.api.listenDevice(t,n,IC((a,l)=>r(this.getDeviceById(t),a,l))))}async removeDevice(t){return this.api.removeDevice(t)}getComponent(t){return this.api.getComponent(t)}setScryptedInterfaceDescriptors(t,n){return this.typesVersion=t,this.descriptors=n,this.propertyInterfaces=yR(n),this.api.setScryptedInterfaceDescriptors(t,n)}}var KU={};class QU{constructor(t,n,r){et(this,"clusterServicePromise");this.clusterMode=t,this.api=n,this.clusterWorkerId=r}getClusterWorkerId(){return this.clusterWorkerId}getClusterAddress(){return KU.SCRYPTED_CLUSTER_ADDRESS}getClusterMode(){return this.clusterMode}async getClusterWorkers(){return(await this.getClusterService()).getClusterWorkers()}getClusterService(){return this.clusterServicePromise||(this.clusterServicePromise=this.api.getComponent("cluster-fork")),this.clusterServicePromise}}function ZU(e,t){const{createMediaManager:n,getServicePort:r,getDeviceConsole:s,getMixinConsole:a}={};e.constructorSerializerMap.get(Buffer)||e.addSerializer(Buffer,"Buffer",new vR);const l={},h=new IU;e.addSerializer(HU,"WebSocketConnection",h);let m;const p=new Promise(x=>m=x);return e.params.getRemote=async(x,b,w)=>{var T;h.WebSocket=FU((A,H)=>{const{url:F}=A;if(F.startsWith("io://")||F.startsWith("ws://")){const V=F.substring(5);l[V]=H,H.connect(void 0,{close:ee=>A.close(ee),send:ee=>A.send(ee)})}else throw new Error("unsupported websocket")}),x=await((T=t==null?void 0:t.onGetRemote)==null?void 0:T.call(t,x,b))||x;const E=new XU,M=new zU(E,s,a),C=new BU,S=new QU(void 0,x,void 0),_=await x.getMediaManager();_||(e.params.createMediaManager=async()=>n(E,M));const N=_||await n(E,M);e.params.mediaManager=N,E.api=x,M.api=x;const c=M.getDeviceLogger(void 0);E.log=c;const j={systemManager:E,deviceManager:M,endpointManager:C,mediaManager:N,clusterManager:S,log:c,pluginHostAPI:x,pluginRemoteAPI:void 0,serverVersion:w==null?void 0:w.serverVersion,connect:void 0,fork:void 0,connectRPCObject:void 0};delete e.params.getRemote,C.api=x,C.deviceManager=M,C.mediaManager=N,C.pluginId=b;const D=new ug(M,void 0),B={[Dr.PROPERTY_JSON_DISABLE_SERIALIZATION]:!0,[Dr.PROPERTY_PROXY_ONEWAY_METHODS]:["notify","updateDeviceState","setSystemState","ioEvent","setNativeId"],getServicePort:r,async createDeviceState(A,H){return M.createDeviceState(A,H)},async ioEvent(A,H,F){const V=l[A];if(V)switch(H){case"message":V.data(F);break;case"close":V.end(),delete l[A];break}},async setNativeId(A,H,F){A===null&&(A=void 0),H?M.nativeIds.set(A==null?void 0:A.toString(),{id:H,storage:F}):M.nativeIds.delete(A)},async updateDeviceState(A,H){H?(E.state[A]=H,E.events.notify(A,void 0,Pn.ScryptedInterface.ScryptedDevice,void 0,H,{changed:!0})):(delete E.state[A],E.events.notify(void 0,void 0,Pn.ScryptedInterface.ScryptedDevice,Pn.ScryptedInterfaceProperty.id,A,{changed:!0}))},async notify(A,H,F,V,ee,G){var se,Ce;if(typeof H=="number"){const te=H,K=F;if(V){const Z=(se=E.state)==null?void 0:se[A];if(!Z){c.w(`state not found for ${A}`);return}Z[V]=ee,E.events.notify(A,te,K,V,ee.value,{changed:G})}else E.events.notify(A,te,K,V,ee,{changed:G})}else{const te=H,K=F;if(te.property&&!te.mixinId){const Z=(Ce=E.state)==null?void 0:Ce[A];if(!Z){c.w(`state not found for ${A}`);return}Z[te.property]=K,E.events.notifyEventDetails(A,te,K.value)}else E.events.notifyEventDetails(A,te,K)}},async setSystemState(A){E.state=A,M.pruneMixinStorage(),m(j)},async loadZip(A,H,F){const V={__filename:void 0,deviceManager:M,systemManager:E,mediaManager:N,endpointManager:C,localStorage:D,pluginHostAPI:x,WebSocket:function(ee){if(typeof ee=="string")throw new Error("unsupported websocket");return ee},pluginRuntimeAPI:j};V.pluginRuntimeAPI=j;try{return await t.onLoadZip(j,V,A,H,F)}catch(ee){throw console.error("plugin start/fork failed",ee),ee}}};return j.pluginRemoteAPI=B,B},p}function Ow(e){let t;const{sendMessageBuffer:n,sendMessageFinish:r}=e;let s=!0;const a=()=>{s=!1,t.kill("connection closed.")},l=(w,E,M)=>{if(!s){E==null||E(new Error("peer disconnected"));return}const C=M==null?void 0:M.buffers;if(C)for(const S of C)n(S);r(w)};let h;return{kill:w=>{t.kill(w)},sendMessage:l,setupRpcPeer:w=>{t=w,t.addSerializer(Buffer,"Buffer",new AU),t.constructorSerializerMap.set(Uint8Array,"Buffer")},onMessageBuffer:w=>{h=h||{},h.buffers||(h.buffers=[]),h.buffers.push(w)},onMessageFinish:w=>{const E=h;h=void 0,t.handleMessage(w,E)},onDisconnected:a}}function JU(e){const t=(b,w)=>{const E=Buffer.alloc(5);E.writeUInt32BE(w.length+1,0),E.writeUInt8(b,4),e.write(Buffer.concat([E,w]))},n=b=>w=>t(b,w),r=n(1),s=n(0),a=Ow({sendMessageBuffer:r,sendMessageFinish:b=>s(Buffer.from(JSON.stringify(b)))});let l,h,m,p;return{onData:b=>{for(;b.length;){if(!h){if(l?l=Buffer.concat([l,b]):l=b,l.length<5)return;b=l.slice(5);const M=l.readUInt32BE(0)-1;p=l.readUInt8(4),b.length>=M&&p===0?(h=b.length===M?b:b.slice(0,M),m=M,b=b.slice(M)):(h=Buffer.alloc(M),m=0),l=void 0}const w=h.length-m;if(w){const M=b.slice(0,w);b=b.slice(w),h.set(M,m),m+=M.length}if(m!==h.length)return;const E=h;if(h=void 0,p===0)try{const M=JSON.parse(E.toString());a.onMessageFinish(M)}catch(M){a.kill("message parse failure "+M.message)}else a.onMessageBuffer(E)}},setupRpcPeer:a.setupRpcPeer,sendMessage:a.sendMessage,onDisconnected:a.onDisconnected}}const eF="1.3.26",tF={version:eF},nF=/^(\d{1,3}\.){3,3}\d{1,3}$/,rF=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;function iF(e){return nF.test(e)}function sF(e){return rF.test(e)}function oF(e){return iF(e)||sF(e)}let gx;try{if(process.arch==="browser")throw new Error;require("net"),require("events"),gx=_U}catch{gx=bU}const aF=Dr.generateId();function Tw(e,t){return new Promise((n,r)=>{const s=h=>{l(),r(h)},a=(...h)=>{l(),n(h)},l=()=>{e.removeListener("error",s),e.removeListener(t,a)};e.once("error",s),e.once(t,a)})}function bR(){var e;return(e=globalThis.navigator)==null?void 0:e.userAgent.includes("InstalledApp")}function lF(){var e;return((e=globalThis.matchMedia)==null?void 0:e.call(globalThis,"(display-mode: standalone)").matches)||bR()}async function cF(e){let{baseUrl:t,username:n,password:r,change_password:s,maxAge:a}=e;!a&&lF()&&(a=365*24*60*60*1e3);const l=LR(t,"login"),h=await gx({url:l,body:{username:n,password:r,change_password:s,maxAge:a},rejectUnauthorized:!1,withCredentials:!0,responseType:"json"});if(h.statusCode!==200)throw new Error("status "+h.statusCode);const{body:m}=h;return{error:m.error,authorization:m.authorization,queryToken:m.queryToken,token:m.token,addresses:m.addresses,externalAddresses:m.externalAddresses,hostname:m.hostname,scryptedCloud:h.headers.get("x-scrypted-cloud")==="true",directAddress:h.headers.get("x-scrypted-direct-address"),cloudAddress:h.headers.get("x-scrypted-cloud-address"),serverId:h.headers.get("x-scrypted-server-id")}}async function $C(e){var l;let{baseUrl:t}=e||{},n=LR(t,"login");const r=new Headers;if((l=e==null?void 0:e.previousLoginResult)!=null&&l.queryToken){const h=(e==null?void 0:e.previousLoginResult.username)+":"+e.previousLoginResult.token,m=Buffer.from(h).toString("base64");r.set("Authorization",`Basic ${m}`)}const s=await gx({url:n,withCredentials:!0,headers:r,rejectUnauthorized:!1,responseType:"json"}),{body:a}=s;return{baseUrl:t,hostname:a.hostname,redirect:a.redirect,username:a.username,expiration:a.expiration,hasLogin:!!a.hasLogin,error:a.error,authorization:a.authorization,queryToken:a.queryToken,token:a.token,addresses:a.addresses,externalAddresses:a.externalAddresses,scryptedCloud:s.headers.get("x-scrypted-cloud")==="true",directAddress:s.headers.get("x-scrypted-direct-address"),cloudAddress:s.headers.get("x-scrypted-cloud-address"),serverId:s.headers.get("x-scrypted-server-id")}}class VC extends Error{constructor(t){super(t.error),this.result=t}}function LR(e,t){return e?new URL(t,e).toString():"/"+t}async function uF(e){var ue,pe,Se,Re,ye,ve,he;const t=Date.now();let{baseUrl:n,pluginId:r,clientName:s,username:a,password:l}=e,h,m,p,x,b,w,E,M,C,S;console.log("@scrypted/client",tF.version);const _={},c=!((ue=globalThis.navigator)==null?void 0:ue.userAgent.includes("Chrome"))||bR();let j=!1;if(a&&l){const de=await cF(e);de.authorization&&(_.Authorization=de.authorization),p=de.addresses,x=de.externalAddresses,b=de.scryptedCloud,w=de.directAddress,E=de.cloudAddress,h=de.authorization,m=de.queryToken,C=de.token,M=de.hostname,S=de.serverId,console.log("login result",Date.now()-t,de)}else{let de=function(We){if(We.error||We.redirect)throw new VC(We);if(!We.authorization||!We.username||!We.queryToken)throw console.error(We),new Error("malformed login result");return We};const ke=new Set;if((pe=e==null?void 0:e.previousLoginResult)!=null&&pe.token){for(const We of[...((Se=e==null?void 0:e.previousLoginResult)==null?void 0:Se.localAddresses)||[],(Re=e==null?void 0:e.previousLoginResult)==null?void 0:Re.directAddress])We&&(c||e.direct)&&ke.add(We);for(const We of[...((ye=e==null?void 0:e.previousLoginResult)==null?void 0:ye.externalAddresses)||[],(ve=e==null?void 0:e.previousLoginResult)==null?void 0:ve.cloudAddress])We&&ke.add(We)}const Ee=[...ke].map(We=>$C({baseUrl:We,previousLoginResult:e==null?void 0:e.previousLoginResult}).then(de)),Ke=$C({baseUrl:n,previousLoginResult:e==null?void 0:e.previousLoginResult}).then(de);Ee.push(Ke);let ae;try{ae=await Promise.any(Ee),j||(j=ae.baseUrl!==n)}catch{ae=await Ke}if(j&&console.log("Found direct login. Allowing alternate addresses."),ae.error||ae.redirect)throw new VC(ae);p=ae.addresses,x=ae.externalAddresses,b=ae.scryptedCloud,w=ae.directAddress,E=ae.cloudAddress,a=ae.username,h=ae.authorization,m=ae.queryToken,C=ae.token,M=ae.hostname,S=ae.serverId,console.log("login checked",Date.now()-t,ae)}let D;const B=`endpoint/${r}/engine.io/api`,A={path:n?new URL(B,n).pathname:"/"+B,query:{cacheBust:Math.random().toString(36).substring(3,10)},withCredentials:!0,extraHeaders:_,rejectUnauthorized:!1,transports:e==null?void 0:e.transports},H=n||`${globalThis.location.protocol}//${globalThis.location.host}`,F=[],V=c;j||(j=b),(j&&e.local===void 0&&V||e.local)&&p&&F.push(...p);const ee=w&&(c||!oF(w));if((j&&e.direct===void 0&&ee||e.direct)&&w&&F.push(w),j&&e.direct===void 0||e.direct){E&&F.push(E);for(const de of x||[])F.push(de)}const G=!!F.length;console.log({tryLocalAddressess:G});const se={...A,extraHeaders:{...A.extraHeaders}};(he=se.extraHeaders).Authorization||(he.Authorization=h);let Ce=[];const te=[];if(G)for(const de of new Set(F)){console.log("trying",de);const ke=new Ew(de,se);Ce.push(ke),te.push((async()=>(await Tw(ke,"open"),{connectionType:"http-direct",ready:ke,address:de}))())}const K=[...te];te.push((async()=>{const de=G?1e3:0;if(console.log("waiting",de),de)try{const Ee=Promise.any(K);await pU(de,Ee),console.log("found direct connection, aborting scrypted cloud connection");return}catch{}const ke=new Ew(H,A);return Ce.push(ke),await Tw(ke,"open"),{ready:ke,address:H,connectionType:b?"http-cloud":"http"}})());const Z=Promise.any(te);let{ready:oe,connectionType:Y,address:ne,rpcPeer:X}=await Z;console.log("connected",Y,ne),D=oe,Ce=Ce.filter(de=>de!==oe),Ce.forEach(de=>{try{de.close()}catch{}});try{if(!X){const _t=Ow({sendMessageBuffer:kt=>D.send(kt),sendMessageFinish:kt=>D.send(JSON.stringify(kt))});X=new Dr(s||"engine.io-client","api",(kt,$,k)=>{try{_t.sendMessage(kt,$,k)}catch(z){$==null||$(z)}}),D.on("message",kt=>{kt.constructor===Buffer||kt.constructor===ArrayBuffer?_t.onMessageBuffer(Buffer.from(kt)):_t.onMessageFinish(JSON.parse(kt))}),_t.setupRpcPeer(X)}const de=await ZU(X,void 0),{serverVersion:ke,systemManager:Ee,deviceManager:Ke,endpointManager:ae,mediaManager:We,clusterManager:bt,pluginHostAPI:tt,pluginRemoteAPI:mt}=de;console.log("api attached",Date.now()-t),We.createMediaObject=async(_t,kt,$)=>new MU(kt,_t,$);const[Xe]=await Promise.all([(async()=>{try{return!!await Ee.getComponent("info")}catch{}return!1})()]);console.log("api initialized",Date.now()-t);const at=Object.keys(Ee.getSystemState()).map(_t=>Ee.getDeviceById(_t)).find(_t=>_t.pluginId==="@scrypted/core"&&_t.nativeId===`user:${a}`),ot=dF(ne,Y,m,_,e==null?void 0:e.transports,aF,s),Ct={username:a,token:C,directAddress:w,localAddresses:p,externalAddresses:x,scryptedCloud:b,queryToken:m,authorization:h,cloudAddress:E,hostname:M,serverId:S},Ot=_t=>{const{worker:kt}=_t,$=Ow({sendMessageBuffer:xe=>kt.postMessage(xe),sendMessageFinish:xe=>kt.postMessage(JSON.stringify(xe))}),k=new Dr("main-client","thread",(xe,Ae,wt)=>{try{$.sendMessage(xe,Ae,wt)}catch(Mt){Ae==null||Ae(Mt)}});X.killed.finally(()=>k.kill("main rpc peer killed")),kt.addEventListener("message",async xe=>{xe.data instanceof Uint8Array?$.onMessageBuffer(Buffer.from(xe.data)):$.onMessageFinish(JSON.parse(xe.data))}),$.setupRpcPeer(k);const z=new TU(tt,We);k.killed.finally(()=>{z.removeListeners(),kt.terminate()});const J={loginResult:Ct,username:a,address:ne,connectionType:Y,extraHeaders:_,transports:e==null?void 0:e.transports,clientName:s,admin:Xe};k.params.client=J;const le=(async()=>{const Ae=await(await k.getParam("getRemote"))(z,r,{serverVersion:ke});return await Ae.setSystemState(Ee.getSystemState()),z.listen((Mt,nt,pt)=>{var Bt;if(nt.eventInterface===DC.ScryptedInterface.ScryptedDevice){nt.property===DC.ScryptedInterfaceProperty.id?Ae.updateDeviceState(pt,void 0):Ae.updateDeviceState(Mt,Ee.getSystemState()[Mt]);return}nt.property&&!nt.mixinId?Ae.notify(Mt,nt,(Bt=Ee.getSystemState()[Mt])==null?void 0:Bt[nt.property]).catch(()=>{}):Ae.notify(Mt,nt,pt).catch(()=>{})}),await k.getParam("fork")})();return le.catch(()=>{k.kill("fork setup failed"),kt.terminate()}),{[Symbol.dispose](){kt.terminate(),k.kill("disposed")},result:le,worker:{terminate(){kt.terminate()},nativeWorker:kt}}},kn={userId:at==null?void 0:at.id,serverVersion:ke,username:a,pluginRemoteAPI:mt,address:ne,connectionType:Y,admin:Xe,systemManager:Ee,clusterManager:bt,deviceManager:Ke,endpointManager:ae,mediaManager:We,disconnect(){X.kill("disconnect requested")},pluginHostAPI:tt,rpcPeer:X,loginResult:Ct,connectRPCObject:ot,fork:Ot,connect:void 0};return D.on("close",()=>{X.kill("socket closed")}),X.killed.finally(()=>{var _t;D.close(),(_t=kn.onClose)==null||_t.call(kn)}),kn}catch(de){throw D.close(),de}}function dF(e,t,n,r,s,a,l){const h=new Map,m=new FinalizationRegistry(w=>{w.kill("object finalized")}),p=(w,E)=>{if(!(E!=null&&E.dedicatedTransport)){let C=h.get(w.port);if(C)return C}const M=(async()=>{var V,ee;const C="engine.io/connectRPCObject",S=new URL(C,e).pathname,_=t==="http"?void 0:n,N={path:S,query:{cacheBust:Math.random().toString(36).substring(3,10),clusterObject:JSON.stringify(w),..._},withCredentials:!0,extraHeaders:r,rejectUnauthorized:!1,transports:s},c=new Ew(e,N);let j=!1,D,B,T;const A=()=>{D&&(clearTimeout(D),D=void 0),B&&(clearTimeout(B),B=void 0)},H=(V=E==null?void 0:E.dedicatedTransport)!=null&&V.receiveTimeout?()=>{D&&clearTimeout(D),D=setTimeout(()=>{T&&T.kill("receive timeout")},E.dedicatedTransport.receiveTimeout)}:void 0,F=(ee=E==null?void 0:E.dedicatedTransport)!=null&&ee.sendTimeout?()=>{B&&clearTimeout(B),B=setTimeout(()=>{T&&T.kill("send timeout")},E.dedicatedTransport.sendTimeout)}:void 0;c.on("close",()=>{if(T==null||T.kill("socket closed"),E!=null&&E.dedicatedTransport||h.delete(w.port),!j)throw new Error("peer disconnected before setup completed")});try{await Tw(c,"open");const G=JU({write:se=>{F==null||F(),c.send(se)}});return c.on("message",se=>{H==null||H(),G.onData(Buffer.from(se))}),T=new Dr(l||"engine.io-client","cluster-proxy",(se,Ce,te)=>{try{F==null||F(),G.sendMessage(se,Ce,te)}catch(K){Ce==null||Ce(K)}}),T.killedSafe.finally(()=>{A(),c.close()}),G.setupRpcPeer(T),T.tags.localPort=a,j=!0,H==null||H(),F==null||F(),T}catch(G){throw A(),console.error("failure ipc connect",G),c.close(),G}})();return E!=null&&E.dedicatedTransport||h.set(w.port,M),M},x=async(w,E)=>{var C;const M=await h.get(E);return M!=null&&M.remoteWeakProxies?(C=Object.values(M.remoteWeakProxies).find(S=>{var _,N;return((N=(_=S.deref())==null?void 0:_.__cluster)==null?void 0:N.proxyId)==w}))==null?void 0:C.deref():null};return async(w,E)=>{const M=w==null?void 0:w.__cluster;if(!M)return w;const{port:C,proxyId:S}=M,_=await x(S,C);if(_)return _;try{const c=await p(M,E),j=await c.getParam("connectRPCObject");try{const D=await j(M);if(!D)throw new Error("ipc object not found?");return E!=null&&E.dedicatedTransport&&m.register(D,c),D}catch(D){throw E!=null&&E.dedicatedTransport&&c.kill("connectRPCObject failed"),D}}catch(N){return console.error("failure ipc",N),w}}}const fF=3e4,hF=5e3,mF=1e4,mb=y.createContext({client:void 0,connectionError:void 0,reconnect:()=>{}}),pF=({children:e})=>{const t=Te(C=>C.userInfo),[n,r]=y.useState(),[s,a]=y.useState(),[l,h]=y.useState(0),m=t==null?void 0:t.basicAuthToken,p=y.useRef(null),x=y.useRef(void 0),b=y.useRef(null),w=y.useRef(!1),E=y.useRef(0),M=y.useCallback(()=>{if(p.current){try{p.current.disconnect()}catch{}p.current=null}x.current=void 0,b.current=null,r(void 0),a(void 0),h(C=>C+1)},[]);return y.useEffect(()=>{const C=()=>{const S=document.visibilityState==="visible";if(console.log("[ScryptedClient] visibilitychange",{visibility:document.visibilityState,focus:document.hasFocus()}),!S)return;const _=p.current;if(!_)return;const N=Date.now();if(N-E.current<mF)return;E.current=N;const c=_.systemManager.getSystemState(),j=new Promise((D,B)=>{setTimeout(()=>B(new Error("Probe timeout")),hF)});Promise.race([c,j]).then(()=>{console.log("[ScryptedClient] connection probe succeeded.")}).catch(()=>{console.warn("[ScryptedClient] connection probe failed, reconnecting API...");try{_.disconnect()}catch{}p.current=null,x.current=void 0,b.current=null,r(void 0),a(void 0),h(D=>D+1)})};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[]),y.useEffect(()=>{if(!m||!(t!=null&&t.basicAuthToken)){if(p.current){try{p.current.disconnect()}catch{}p.current=null,x.current=void 0}b.current=null,r(void 0),a(void 0);return}if(p.current&&x.current===m){r(p.current),a(void 0);return}if(p.current&&x.current!==m){try{p.current.disconnect()}catch{}p.current=null,x.current=void 0,b.current=null}w.current=!1,a(void 0);const C=T=>{w.current||(p.current=T,x.current=m,r(T),a(void 0))},S=T=>{w.current||(b.current=null,a(T),r(void 0))};if(b.current){b.current.then(C).catch(T=>{b.current=null,S(T instanceof Error?T.message:"Connection failed")});return}const[_,N]=atob(t.basicAuthToken.split("Basic ")[1]).split(":"),j=uF({baseUrl:"",pluginId:"@apocaliss92/scrypted-advanced-notifier",username:_,password:N}),D=new Promise((T,A)=>{setTimeout(()=>A(new Error("SDK connection timeout")),fF)}),B=Promise.race([j,D]);return b.current=B,B.then(T=>{w.current||C(T)}).catch(T=>{if(w.current)return;const A=T instanceof Error&&T.message==="SDK connection timeout"?"Connection to server timed out. Check the address and try again.":T instanceof Error?T.message:"Connection failed";S(A)}),()=>{w.current=!0}},[m,t==null?void 0:t.basicAuthToken,l]),y.useEffect(()=>{const C=S=>{var N;(((N=S==null?void 0:S.reason)==null?void 0:N.message)??String((S==null?void 0:S.reason)??"")).includes("RpcPeer has been killed")&&(M(),S.preventDefault(),S.stopPropagation())};return window.addEventListener("unhandledrejection",C),()=>window.removeEventListener("unhandledrejection",C)},[M]),f.jsx(mb.Provider,{value:{client:n,connectionError:s,reconnect:M},children:e})},qi=()=>y.useContext(mb).client,gF=()=>y.useContext(mb).connectionError,t4=()=>y.useContext(mb).reconnect,Ad="/endpoint/@apocaliss92/scrypted-advanced-notifier",w2=new Map,qC=new Map;function vF(e,t,n,r){const s=(n??[]).slice().sort().join(","),a=(r??[]).slice().sort().join(",");return`VideoclipsCache:${e}:${t}:${s}:${a}`}function Yh(e,t){const n=w2.get(e);if(n)return n;const r=t().finally(()=>w2.delete(e));return w2.set(e,r),r}const WC="Advanced notifier data fetcher",S2="eventsAppStateJson",ks=()=>{const e=Te(N=>N.userInfo),t=Te(N=>N.setUserInfo),n=Te(N=>N.setAuthError),r=qi(),s=y.useCallback(()=>Yh("GetConfigs",async()=>(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetConfigs"},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data),[e==null?void 0:e.basicAuthToken]),a=y.useCallback((N,c,j)=>{var T,A,H;const D=j??{},B=`GetEvents:${N}:${c}:${D.limit??"all"}:${D.offset??0}:${((T=D.sources)==null?void 0:T.join(","))??""}:${((A=D.cameras)==null?void 0:A.join(","))??""}:${((H=D.detectionClasses)==null?void 0:H.join(","))??""}:${D.eventSource??""}:${D.filter??""}:${D.groupingRange??""}`;return Yh(B,async()=>{const F={fromDate:N,tillDate:c,limit:D.limit,offset:D.offset??0,cameras:D.cameras,detectionClasses:D.detectionClasses,eventSource:D.eventSource,filter:D.filter,groupingRange:D.groupingRange};D.sources&&D.sources.length>0&&(F.sources=D.sources);const ee=(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetEvents",payload:F},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data;return{groups:ee.groups??[],total:ee.total??0,ruleArtifacts:ee.ruleArtifacts}})},[e==null?void 0:e.basicAuthToken]),l=y.useCallback((N,c,j)=>{const D=vF(N,c,j==null?void 0:j.cameras,j==null?void 0:j.detectionClasses),B=(j==null?void 0:j.offset)??0,T=j==null?void 0:j.limit,A=qC.get(D);if(A){const F=T!=null?A.slice(B,B+T):A.slice(B);return Promise.resolve({videoclips:F,total:A.length})}const H=`GetVideoclipsFull:${D}`;return Yh(H,async()=>{const V=(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetVideoclips",payload:{fromDate:N,tillDate:c,cameras:j==null?void 0:j.cameras,detectionClasses:j==null?void 0:j.detectionClasses,limit:99999,offset:0}},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data;let ee=Array.isArray(V)?V:V.videoclips??[];return ee=[...ee].sort((G,se)=>se.startTime-G.startTime),qC.set(D,ee),ee}).then(F=>({videoclips:T!=null?F.slice(B,B+T):F.slice(B),total:F.length}))},[e==null?void 0:e.basicAuthToken]),h=y.useCallback(()=>Yh("GetCamerasStatus",async()=>(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetCamerasStatus"},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data),[e==null?void 0:e.basicAuthToken]),m=y.useCallback((N,c)=>Yh(`GetCameraDayData:${N}:${c}`,async()=>(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetCameraDayData",payload:{deviceId:N,day:c}},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data),[e==null?void 0:e.basicAuthToken]),p=y.useCallback(N=>Yh(`GetLatestRuleArtifacts:${(N==null?void 0:N.limit)??30}`,async()=>(await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"GetLatestRuleArtifacts",payload:{limit:(N==null?void 0:N.limit)??30,since:(N==null?void 0:N.since)??Date.now()-6048e5}},headers:{Authorization:e==null?void 0:e.basicAuthToken}})).data),[e==null?void 0:e.basicAuthToken]),x=y.useCallback(async N=>{await sr.request({method:"POST",url:`${Ad}/eventsApp`,data:{apimethod:"RemoteLog",payload:{content:N}},headers:{Authorization:e==null?void 0:e.basicAuthToken}})},[e==null?void 0:e.basicAuthToken]),b=y.useCallback(async()=>{const N=e==null?void 0:e.username;if(!r||!N)return null;const c=r.systemManager.getDeviceByName(WC);if(!(c!=null&&c.getSettings))return null;const j=await c.getSettings(),D=j==null?void 0:j.find(B=>B.key===S2);if(!(D!=null&&D.value))return null;try{return(typeof D.value=="string"?JSON.parse(D.value):D.value)[N]??null}catch{return null}},[r,e==null?void 0:e.username]),w=y.useCallback(async N=>{const c=e==null?void 0:e.username;if(!r||!c)return;const j=r.systemManager.getDeviceByName(WC),D=await j.getSettings(),B=D==null?void 0:D.find(A=>A.key===S2);let T={};if(B!=null&&B.value)try{T=typeof B.value=="string"?JSON.parse(B.value):B.value}catch{}T[c]=N,console.log("setAppState",T),await j.putSetting(S2,JSON.stringify(T))},[r,e==null?void 0:e.username]),E=(N,c)=>c!=null&&c.thumbnailUrl?c.thumbnailUrl:null,M=N=>{const c="",j=F=>F?F.startsWith("http")?F:`${c}${F}`:"",D=j(N.thumbnailUrl),B=j(N.imageUrl),T=j(N.videoUrl),A=j(N.gifUrl);return{thumbnail:D,fullRes:B,videoUrl:T||void 0,gifUrl:A||void 0,preferredMedia:T?{url:T,type:"video"}:A?{url:A,type:"gif"}:{url:B,type:"image"}}},C=N=>{var A,H;const c=(H=(A=N.resources)==null?void 0:A.thumbnail)==null?void 0:H.href,j=c??void 0;let B=N.videoclipHref?`${N.videoclipHref}`:"",T=!1;try{T=MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')}catch{const V=document.createElement("video").canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"');(V==="probably"||V==="maybe")&&(T=!0)}return B&&(B+=`?h265=${T}`),{thumbnailUrl:j,videoUrl:B}},S=y.useCallback(async(N,c)=>{var D;const j=await sr.post("/login",{username:N,password:c,maxAge:6048e5});if((D=j.data)!=null&&D.error)t(void 0),n(j.data.error);else{const T=`Basic ${btoa(`${N}:${c}`)}`;n(void 0),t({...j.data,basicAuthToken:T})}},[t,n]),_=y.useCallback(()=>{document.cookie="login_user_token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;",t(void 0)},[t]);return{login:S,logout:_,getConfigs:s,getAppState:b,setAppState:w,getEventImageUrls:M,getEvents:a,getVideoclips:l,getVideoclipUrls:C,getCamerasStatus:h,getCameraDayData:m,getLatestRuleArtifacts:p,getCameraSnapshotUrl:E,remoteLog:x}};function yF({className:e,...t}){const{login:n}=ks(),r=Te(p=>p.authError),[s,a]=y.useState(),[l,h]=y.useState(),m=async()=>{s&&l&&await n(s,l)};return f.jsx("div",{className:He("flex flex-col gap-6",e),...t,children:f.jsxs(nf,{children:[f.jsxs(jP,{className:"text-center",children:[f.jsx(kP,{className:"text-xl",children:"Welcome back"}),f.jsx(PP,{children:"Login with your Scrypted account"})]}),f.jsx(zP,{children:f.jsx("div",{className:"grid gap-6",children:f.jsxs("div",{className:"grid gap-6",children:[f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"email",children:"Username"}),f.jsx(Li,{value:s,onChange:p=>a(p.target.value),type:"text",required:!0})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx("div",{className:"flex items-center",children:f.jsx(Tr,{htmlFor:"password",children:"Password"})}),f.jsx(Li,{value:l,onChange:p=>h(p.target.value),type:"password",required:!0})]}),r&&f.jsx("p",{className:"text-sm text-destructive",children:r}),f.jsx(Qe,{type:"submit",className:"w-full",onClick:m,children:"Login"})]})})})]})})}function xF(){return f.jsx("div",{className:"flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10",children:f.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-6",children:[f.jsxs("a",{href:"#",className:"flex items-center gap-2 self-center font-medium",children:[f.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md bg-primary text-primary-foreground",children:f.jsx(tf,{className:"size-4"})}),"Scrypted Advanced Notifier"]}),f.jsx(yF,{})]})})}const Dw=768,bF=/\b(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobi)\b/i;function wR(){return typeof navigator>"u"?!1:bF.test(navigator.userAgent)}function ml(){const e=y.useMemo(()=>wR(),[]),[t,n]=y.useState(!1);return y.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Dw-1}px)`),s=()=>{n(window.innerWidth<Dw)};return r.addEventListener("change",s),s(),()=>r.removeEventListener("change",s)},[]),e||t}const LF=600;function n4(){const e=y.useMemo(()=>wR(),[]),[t,n]=y.useState(!1);return y.useEffect(()=>{const r=()=>{const l=window.innerWidth,h=window.innerHeight,m=l>h,p=l<Dw||h<LF;n(m&&(p||e))},s=window.matchMedia("(orientation: landscape)"),a=()=>r();return window.addEventListener("resize",a),s.addEventListener("change",a),r(),()=>{window.removeEventListener("resize",a),s.removeEventListener("change",a)}},[e]),t}var wF="Separator",GC="horizontal",SF=["horizontal","vertical"],SR=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=GC,...s}=e,a=CF(r)?r:GC,h=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return f.jsx(Lt.div,{"data-orientation":a,...h,...s,ref:t})});SR.displayName=wF;function CF(e){return SF.includes(e)}var EF=SR;function YC({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(EF,{"data-slot":"separator-root",decorative:n,orientation:t,className:He("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function ut(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function RF(e,t){const n=y.createContext(t),r=a=>{const{children:l,...h}=a,m=y.useMemo(()=>h,Object.values(h));return f.jsx(n.Provider,{value:m,children:l})};r.displayName=e+"Provider";function s(a){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function cs(e,t=[]){let n=[];function r(a,l){const h=y.createContext(l),m=n.length;n=[...n,l];const p=b=>{var _;const{scope:w,children:E,...M}=b,C=((_=w==null?void 0:w[e])==null?void 0:_[m])||h,S=y.useMemo(()=>M,Object.values(M));return f.jsx(C.Provider,{value:S,children:E})};p.displayName=a+"Provider";function x(b,w){var C;const E=((C=w==null?void 0:w[e])==null?void 0:C[m])||h,M=y.useContext(E);if(M)return M;if(l!==void 0)return l;throw new Error(`\`${b}\` must be used within \`${a}\``)}return[p,x]}const s=()=>{const a=n.map(l=>y.createContext(l));return function(h){const m=(h==null?void 0:h[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...h,[e]:m}}),[h,m])}};return s.scopeName=e,[r,_F(s,...t)]}function _F(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=r.reduce((h,{useScope:m,scopeName:p})=>{const b=m(a)[`__scope${p}`];return{...h,...b}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Wr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},MF=A8[" useId ".trim().toString()]||(()=>{}),NF=0;function li(e){const[t,n]=y.useState(MF());return Wr(()=>{n(r=>r??String(NF++))},[e]),e||(t?`radix-${t}`:"")}var OF=A8[" useInsertionEffect ".trim().toString()]||Wr;function dl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,a,l]=TF({defaultProp:t,onChange:n}),h=e!==void 0,m=h?e:s;{const x=y.useRef(e!==void 0);y.useEffect(()=>{const b=x.current;b!==h&&console.warn(`${r} is changing from ${b?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=h},[h,r])}const p=y.useCallback(x=>{var b;if(h){const w=DF(x)?x(e):x;w!==e&&((b=l.current)==null||b.call(l,w))}else a(x)},[h,e,a,l]);return[m,p]}function TF({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),a=y.useRef(t);return OF(()=>{a.current=t},[t]),y.useEffect(()=>{var l;s.current!==n&&((l=a.current)==null||l.call(a,n),s.current=n)},[n,s]),[n,r,a]}function DF(e){return typeof e=="function"}function Ci(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function CR(e,t=globalThis==null?void 0:globalThis.document){const n=Ci(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var AF="DismissableLayer",Aw="dismissableLayer.update",jF="dismissableLayer.pointerDownOutside",kF="dismissableLayer.focusOutside",XC,ER=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fm=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:h,...m}=e,p=y.useContext(ER),[x,b]=y.useState(null),w=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=y.useState({}),M=Qt(t,T=>b(T)),C=Array.from(p.layers),[S]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),_=C.indexOf(S),N=x?C.indexOf(x):-1,c=p.layersWithOutsidePointerEventsDisabled.size>0,j=N>=_,D=BF(T=>{const A=T.target,H=[...p.branches].some(F=>F.contains(A));!j||H||(s==null||s(T),l==null||l(T),T.defaultPrevented||h==null||h())},w),B=UF(T=>{const A=T.target;[...p.branches].some(F=>F.contains(A))||(a==null||a(T),l==null||l(T),T.defaultPrevented||h==null||h())},w);return CR(T=>{N===p.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&h&&(T.preventDefault(),h()))},w),y.useEffect(()=>{if(x)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(XC=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),KC(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=XC)}},[x,w,n,p]),y.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),KC())},[x,p]),y.useEffect(()=>{const T=()=>E({});return document.addEventListener(Aw,T),()=>document.removeEventListener(Aw,T)},[]),f.jsx(Lt.div,{...m,ref:M,style:{pointerEvents:c?j?"auto":"none":void 0,...e.style},onFocusCapture:ut(e.onFocusCapture,B.onFocusCapture),onBlurCapture:ut(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ut(e.onPointerDownCapture,D.onPointerDownCapture)})});Fm.displayName=AF;var PF="DismissableLayerBranch",zF=y.forwardRef((e,t)=>{const n=y.useContext(ER),r=y.useRef(null),s=Qt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),f.jsx(Lt.div,{...e,ref:s})});zF.displayName=PF;function BF(e,t=globalThis==null?void 0:globalThis.document){const n=Ci(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=h=>{if(h.target&&!r.current){let m=function(){RR(jF,n,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=m,t.addEventListener("click",s.current,{once:!0})):m()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function UF(e,t=globalThis==null?void 0:globalThis.document){const n=Ci(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&RR(kF,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function KC(){const e=new CustomEvent(Aw);document.dispatchEvent(e)}function RR(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ib(s,a):s.dispatchEvent(a)}var C2="focusScope.autoFocusOnMount",E2="focusScope.autoFocusOnUnmount",QC={bubbles:!1,cancelable:!0},FF="FocusScope",Hm=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[h,m]=y.useState(null),p=Ci(s),x=Ci(a),b=y.useRef(null),w=Qt(t,C=>m(C)),E=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let C=function(c){if(E.paused||!h)return;const j=c.target;h.contains(j)?b.current=j:tu(b.current,{select:!0})},S=function(c){if(E.paused||!h)return;const j=c.relatedTarget;j!==null&&(h.contains(j)||tu(b.current,{select:!0}))},_=function(c){if(document.activeElement===document.body)for(const D of c)D.removedNodes.length>0&&tu(h)};document.addEventListener("focusin",C),document.addEventListener("focusout",S);const N=new MutationObserver(_);return h&&N.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",S),N.disconnect()}}},[r,h,E.paused]),y.useEffect(()=>{if(h){JC.add(E);const C=document.activeElement;if(!h.contains(C)){const _=new CustomEvent(C2,QC);h.addEventListener(C2,p),h.dispatchEvent(_),_.defaultPrevented||(HF(WF(_R(h)),{select:!0}),document.activeElement===C&&tu(h))}return()=>{h.removeEventListener(C2,p),setTimeout(()=>{const _=new CustomEvent(E2,QC);h.addEventListener(E2,x),h.dispatchEvent(_),_.defaultPrevented||tu(C??document.body,{select:!0}),h.removeEventListener(E2,x),JC.remove(E)},0)}}},[h,p,x,E]);const M=y.useCallback(C=>{if(!n&&!r||E.paused)return;const S=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,_=document.activeElement;if(S&&_){const N=C.currentTarget,[c,j]=IF(N);c&&j?!C.shiftKey&&_===j?(C.preventDefault(),n&&tu(c,{select:!0})):C.shiftKey&&_===c&&(C.preventDefault(),n&&tu(j,{select:!0})):_===N&&C.preventDefault()}},[n,r,E.paused]);return f.jsx(Lt.div,{tabIndex:-1,...l,ref:w,onKeyDown:M})});Hm.displayName=FF;function HF(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(tu(r,{select:t}),document.activeElement!==n)return}function IF(e){const t=_R(e),n=ZC(t,e),r=ZC(t.reverse(),e);return[n,r]}function _R(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ZC(e,t){for(const n of e)if(!$F(n,{upTo:t}))return n}function $F(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function VF(e){return e instanceof HTMLInputElement&&"select"in e}function tu(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&VF(e)&&t&&e.select()}}var JC=qF();function qF(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=e5(e,t),e.unshift(t)},remove(t){var n;e=e5(e,t),(n=e[0])==null||n.resume()}}}function e5(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WF(e){return e.filter(t=>t.tagName!=="A")}var GF="Portal",vf=y.forwardRef((e,t)=>{var h;const{container:n,...r}=e,[s,a]=y.useState(!1);Wr(()=>a(!0),[]);const l=n||s&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return l?cA.createPortal(f.jsx(Lt.div,{...r,ref:t}),l):null});vf.displayName=GF;function YF(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var ro=e=>{const{present:t,children:n}=e,r=XF(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Qt(r.ref,KF(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};ro.displayName="Presence";function XF(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),a=y.useRef("none"),l=e?"mounted":"unmounted",[h,m]=YF(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=Ny(r.current);a.current=h==="mounted"?p:"none"},[h]),Wr(()=>{const p=r.current,x=s.current;if(x!==e){const w=a.current,E=Ny(p);e?m("MOUNT"):E==="none"||(p==null?void 0:p.display)==="none"?m("UNMOUNT"):m(x&&w!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),Wr(()=>{if(t){let p;const x=t.ownerDocument.defaultView??window,b=E=>{const C=Ny(r.current).includes(E.animationName);if(E.target===t&&C&&(m("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},w=E=>{E.target===t&&(a.current=Ny(r.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{x.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(p=>{r.current=p?getComputedStyle(p):null,n(p)},[])}}function Ny(e){return(e==null?void 0:e.animationName)||"none"}function KF(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var R2=0;function pb(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??t5()),document.body.insertAdjacentElement("beforeend",e[1]??t5()),R2++,()=>{R2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),R2--}},[])}function t5(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var el=function(){return el=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},el.apply(this,arguments)};function MR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function QF(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var nx="right-scroll-bar-position",rx="width-before-scroll-bar",ZF="with-scroll-bars-hidden",JF="--removed-body-scroll-bar-size";function _2(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function eH(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var tH=typeof window<"u"?y.useLayoutEffect:y.useEffect,n5=new WeakMap;function nH(e,t){var n=eH(null,function(r){return e.forEach(function(s){return _2(s,r)})});return tH(function(){var r=n5.get(n);if(r){var s=new Set(r),a=new Set(e),l=n.current;s.forEach(function(h){a.has(h)||_2(h,null)}),a.forEach(function(h){s.has(h)||_2(h,l)})}n5.set(n,e)},[e]),n}function rH(e){return e}function iH(e,t){t===void 0&&(t=rH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,r);return n.push(l),function(){n=n.filter(function(h){return h!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(h){return a(h)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var h=n;n=[],h.forEach(a),l=n}var m=function(){var x=l;l=[],x.forEach(a)},p=function(){return Promise.resolve().then(m)};p(),n={push:function(x){l.push(x),p()},filter:function(x){return l=l.filter(x),n}}}};return s}function sH(e){e===void 0&&(e={});var t=iH(null);return t.options=el({async:!0,ssr:!1},e),t}var NR=function(e){var t=e.sideCar,n=MR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,el({},n))};NR.isSideCarExport=!0;function oH(e,t){return e.useMedium(t),NR}var OR=sH(),M2=function(){},gb=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:M2,onWheelCapture:M2,onTouchMoveCapture:M2}),s=r[0],a=r[1],l=e.forwardProps,h=e.children,m=e.className,p=e.removeScrollBar,x=e.enabled,b=e.shards,w=e.sideCar,E=e.noRelative,M=e.noIsolation,C=e.inert,S=e.allowPinchZoom,_=e.as,N=_===void 0?"div":_,c=e.gapMode,j=MR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=w,B=nH([n,t]),T=el(el({},j),s);return y.createElement(y.Fragment,null,x&&y.createElement(D,{sideCar:OR,removeScrollBar:p,shards:b,noRelative:E,noIsolation:M,inert:C,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:c}),l?y.cloneElement(y.Children.only(h),el(el({},T),{ref:B})):y.createElement(N,el({},T,{className:m,ref:B}),h))});gb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gb.classNames={fullWidth:rx,zeroRight:nx};var aH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=aH();return t&&e.setAttribute("nonce",t),e}function cH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lH())&&(cH(t,n),uH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fH=function(){var e=dH();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},TR=function(){var e=fH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},hH={left:0,top:0,right:0,gap:0},N2=function(e){return parseInt(e||"",10)||0},mH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[N2(n),N2(r),N2(s)]},pH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return hH;var t=mH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},gH=TR(),am="data-scroll-locked",vH=function(e,t,n,r){var s=e.left,a=e.top,l=e.right,h=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(ZF,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(h,"px ").concat(r,`;
  }
  body[`).concat(am,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(s,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(l,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(h,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(h,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(nx,` {
    right: `).concat(h,"px ").concat(r,`;
  }
  
  .`).concat(rx,` {
    margin-right: `).concat(h,"px ").concat(r,`;
  }
  
  .`).concat(nx," .").concat(nx,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(rx," .").concat(rx,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(am,`] {
    `).concat(JF,": ").concat(h,`px;
  }
`)},r5=function(){var e=parseInt(document.body.getAttribute(am)||"0",10);return isFinite(e)?e:0},yH=function(){y.useEffect(function(){return document.body.setAttribute(am,(r5()+1).toString()),function(){var e=r5()-1;e<=0?document.body.removeAttribute(am):document.body.setAttribute(am,e.toString())}},[])},xH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;yH();var a=y.useMemo(function(){return pH(s)},[s]);return y.createElement(gH,{styles:vH(a,!t,s,n?"":"!important")})},jw=!1;if(typeof window<"u")try{var Oy=Object.defineProperty({},"passive",{get:function(){return jw=!0,!0}});window.addEventListener("test",Oy,Oy),window.removeEventListener("test",Oy,Oy)}catch{jw=!1}var Xh=jw?{passive:!1}:!1,bH=function(e){return e.tagName==="TEXTAREA"},DR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bH(e)&&n[t]==="visible")},LH=function(e){return DR(e,"overflowY")},wH=function(e){return DR(e,"overflowX")},i5=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=AR(e,r);if(s){var a=jR(e,r),l=a[1],h=a[2];if(l>h)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},SH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},CH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},AR=function(e,t){return e==="v"?LH(t):wH(t)},jR=function(e,t){return e==="v"?SH(t):CH(t)},EH=function(e,t){return e==="h"&&t==="rtl"?-1:1},RH=function(e,t,n,r,s){var a=EH(e,window.getComputedStyle(t).direction),l=a*r,h=n.target,m=t.contains(h),p=!1,x=l>0,b=0,w=0;do{var E=jR(e,h),M=E[0],C=E[1],S=E[2],_=C-S-a*M;(M||_)&&AR(e,h)&&(b+=_,w+=M),h=h.parentNode.host||h.parentNode}while(!m&&h!==document.body||m&&(t.contains(h)||t===h));return(x&&Math.abs(b)<1||!x&&Math.abs(w)<1)&&(p=!0),p},Ty=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},s5=function(e){return[e.deltaX,e.deltaY]},o5=function(e){return e&&"current"in e?e.current:e},_H=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MH=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},NH=0,Kh=[];function OH(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(NH++)[0],a=y.useState(TR)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=QF([e.lockRef.current],(e.shards||[]).map(o5),!0).filter(Boolean);return C.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var h=y.useCallback(function(C,S){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var _=Ty(C),N=n.current,c="deltaX"in C?C.deltaX:N[0]-_[0],j="deltaY"in C?C.deltaY:N[1]-_[1],D,B=C.target,T=Math.abs(c)>Math.abs(j)?"h":"v";if("touches"in C&&T==="h"&&B.type==="range")return!1;var A=i5(T,B);if(!A)return!0;if(A?D=T:(D=T==="v"?"h":"v",A=i5(T,B)),!A)return!1;if(!r.current&&"changedTouches"in C&&(c||j)&&(r.current=D),!D)return!0;var H=r.current||D;return RH(H,S,C,H==="h"?c:j)},[]),m=y.useCallback(function(C){var S=C;if(!(!Kh.length||Kh[Kh.length-1]!==a)){var _="deltaY"in S?s5(S):Ty(S),N=t.current.filter(function(D){return D.name===S.type&&(D.target===S.target||S.target===D.shadowParent)&&_H(D.delta,_)})[0];if(N&&N.should){S.cancelable&&S.preventDefault();return}if(!N){var c=(l.current.shards||[]).map(o5).filter(Boolean).filter(function(D){return D.contains(S.target)}),j=c.length>0?h(S,c[0]):!l.current.noIsolation;j&&S.cancelable&&S.preventDefault()}}},[]),p=y.useCallback(function(C,S,_,N){var c={name:C,delta:S,target:_,should:N,shadowParent:TH(_)};t.current.push(c),setTimeout(function(){t.current=t.current.filter(function(j){return j!==c})},1)},[]),x=y.useCallback(function(C){n.current=Ty(C),r.current=void 0},[]),b=y.useCallback(function(C){p(C.type,s5(C),C.target,h(C,e.lockRef.current))},[]),w=y.useCallback(function(C){p(C.type,Ty(C),C.target,h(C,e.lockRef.current))},[]);y.useEffect(function(){return Kh.push(a),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:w}),document.addEventListener("wheel",m,Xh),document.addEventListener("touchmove",m,Xh),document.addEventListener("touchstart",x,Xh),function(){Kh=Kh.filter(function(C){return C!==a}),document.removeEventListener("wheel",m,Xh),document.removeEventListener("touchmove",m,Xh),document.removeEventListener("touchstart",x,Xh)}},[]);var E=e.removeScrollBar,M=e.inert;return y.createElement(y.Fragment,null,M?y.createElement(a,{styles:MH(s)}):null,E?y.createElement(xH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DH=oH(OR,OH);var Im=y.forwardRef(function(e,t){return y.createElement(gb,el({},e,{ref:t,sideCar:DH}))});Im.classNames=gb.classNames;var AH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Qh=new WeakMap,Dy=new WeakMap,Ay={},O2=0,kR=function(e){return e&&(e.host||kR(e.parentNode))},jH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kR(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kH=function(e,t,n,r){var s=jH(t,Array.isArray(e)?e:[e]);Ay[n]||(Ay[n]=new WeakMap);var a=Ay[n],l=[],h=new Set,m=new Set(s),p=function(b){!b||h.has(b)||(h.add(b),p(b.parentNode))};s.forEach(p);var x=function(b){!b||m.has(b)||Array.prototype.forEach.call(b.children,function(w){if(h.has(w))x(w);else try{var E=w.getAttribute(r),M=E!==null&&E!=="false",C=(Qh.get(w)||0)+1,S=(a.get(w)||0)+1;Qh.set(w,C),a.set(w,S),l.push(w),C===1&&M&&Dy.set(w,!0),S===1&&w.setAttribute(n,"true"),M||w.setAttribute(r,"true")}catch(_){console.error("aria-hidden: cannot operate on ",w,_)}})};return x(t),h.clear(),O2++,function(){l.forEach(function(b){var w=Qh.get(b)-1,E=a.get(b)-1;Qh.set(b,w),a.set(b,E),w||(Dy.has(b)||b.removeAttribute(r),Dy.delete(b)),E||b.removeAttribute(n)}),O2--,O2||(Qh=new WeakMap,Qh=new WeakMap,Dy=new WeakMap,Ay={})}},Bg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=AH(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),kH(r,s,n,"aria-hidden")):function(){return null}},vb="Dialog",[PR,Bse]=cs(vb),[PH,ga]=PR(vb),zR=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,h=y.useRef(null),m=y.useRef(null),[p,x]=dl({prop:r,defaultProp:s??!1,onChange:a,caller:vb});return f.jsx(PH,{scope:t,triggerRef:h,contentRef:m,contentId:li(),titleId:li(),descriptionId:li(),open:p,onOpenChange:x,onOpenToggle:y.useCallback(()=>x(b=>!b),[x]),modal:l,children:n})};zR.displayName=vb;var BR="DialogTrigger",UR=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ga(BR,n),a=Qt(t,s.triggerRef);return f.jsx(Lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":a4(s.open),...r,ref:a,onClick:ut(e.onClick,s.onOpenToggle)})});UR.displayName=BR;var r4="DialogPortal",[zH,FR]=PR(r4,{forceMount:void 0}),HR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=ga(r4,t);return f.jsx(zH,{scope:t,forceMount:n,children:y.Children.map(r,l=>f.jsx(ro,{present:n||a.open,children:f.jsx(vf,{asChild:!0,container:s,children:l})}))})};HR.displayName=r4;var vx="DialogOverlay",IR=y.forwardRef((e,t)=>{const n=FR(vx,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ga(vx,e.__scopeDialog);return a.modal?f.jsx(ro,{present:r||a.open,children:f.jsx(UH,{...s,ref:t})}):null});IR.displayName=vx;var BH=tc("DialogOverlay.RemoveScroll"),UH=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ga(vx,n);return f.jsx(Im,{as:BH,allowPinchZoom:!0,shards:[s.contentRef],children:f.jsx(Lt.div,{"data-state":a4(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),sf="DialogContent",$R=y.forwardRef((e,t)=>{const n=FR(sf,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ga(sf,e.__scopeDialog);return f.jsx(ro,{present:r||a.open,children:a.modal?f.jsx(FH,{...s,ref:t}):f.jsx(HH,{...s,ref:t})})});$R.displayName=sf;var FH=y.forwardRef((e,t)=>{const n=ga(sf,e.__scopeDialog),r=y.useRef(null),s=Qt(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return Bg(a)},[]),f.jsx(VR,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ut(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,h=l.button===0&&l.ctrlKey===!0;(l.button===2||h)&&a.preventDefault()}),onFocusOutside:ut(e.onFocusOutside,a=>a.preventDefault())})}),HH=y.forwardRef((e,t)=>{const n=ga(sf,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return f.jsx(VR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,h;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(h=n.triggerRef.current)==null||h.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var m,p;(m=e.onInteractOutside)==null||m.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((p=n.triggerRef.current)==null?void 0:p.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),VR=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,h=ga(sf,n),m=y.useRef(null),p=Qt(t,m);return pb(),f.jsxs(f.Fragment,{children:[f.jsx(Hm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:f.jsx(Fm,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":a4(h.open),...l,ref:p,onDismiss:()=>h.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(IH,{titleId:h.titleId}),f.jsx(VH,{contentRef:m,descriptionId:h.descriptionId})]})]})}),i4="DialogTitle",s4=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ga(i4,n);return f.jsx(Lt.h2,{id:s.titleId,...r,ref:t})});s4.displayName=i4;var qR="DialogDescription",o4=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ga(qR,n);return f.jsx(Lt.p,{id:s.descriptionId,...r,ref:t})});o4.displayName=qR;var WR="DialogClose",GR=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ga(WR,n);return f.jsx(Lt.button,{type:"button",...r,ref:t,onClick:ut(e.onClick,()=>s.onOpenChange(!1))})});GR.displayName=WR;function a4(e){return e?"open":"closed"}var YR="DialogTitleWarning",[Use,XR]=RF(YR,{contentName:sf,titleName:i4,docsSlug:"dialog"}),IH=({titleId:e})=>{const t=XR(YR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$H="DialogDescriptionWarning",VH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${XR($H).contentName}}.`;return y.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},l4=zR,qH=UR,c4=HR,u4=IR,d4=$R,KR=s4,WH=o4,QR=GR;function ZR({...e}){return f.jsx(l4,{"data-slot":"sheet",...e})}function GH({...e}){return f.jsx(c4,{"data-slot":"sheet-portal",...e})}function YH({className:e,...t}){return f.jsx(u4,{"data-slot":"sheet-overlay",className:He("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function JR({className:e,children:t,side:n="right",...r}){return f.jsxs(GH,{children:[f.jsx(YH,{}),f.jsxs(d4,{"data-slot":"sheet-content",className:He("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,f.jsxs(QR,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[f.jsx(gf,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function e_({className:e,...t}){return f.jsx("div",{"data-slot":"sheet-header",className:He("flex flex-col gap-1.5 p-4",e),...t})}function t_({className:e,...t}){return f.jsx(KR,{"data-slot":"sheet-title",className:He("text-foreground font-semibold",e),...t})}function n_({className:e,...t}){return f.jsx(WH,{"data-slot":"sheet-description",className:He("text-muted-foreground text-sm",e),...t})}function Ts({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:He("bg-accent animate-pulse rounded-md",e),...t})}const XH=["top","right","bottom","left"],gu=Math.min,eo=Math.max,yx=Math.round,jy=Math.floor,ll=e=>({x:e,y:e}),KH={left:"right",right:"left",bottom:"top",top:"bottom"},QH={start:"end",end:"start"};function kw(e,t,n){return eo(e,gu(t,n))}function nc(e,t){return typeof e=="function"?e(t):e}function rc(e){return e.split("-")[0]}function $m(e){return e.split("-")[1]}function f4(e){return e==="x"?"y":"x"}function h4(e){return e==="y"?"height":"width"}function Jl(e){return["top","bottom"].includes(rc(e))?"y":"x"}function m4(e){return f4(Jl(e))}function ZH(e,t,n){n===void 0&&(n=!1);const r=$m(e),s=m4(e),a=h4(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=xx(l)),[l,xx(l)]}function JH(e){const t=xx(e);return[Pw(e),t,Pw(t)]}function Pw(e){return e.replace(/start|end/g,t=>QH[t])}function eI(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:l;default:return[]}}function tI(e,t,n,r){const s=$m(e);let a=eI(rc(e),n==="start",r);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Pw)))),a}function xx(e){return e.replace(/left|right|bottom|top/g,t=>KH[t])}function nI(e){return{top:0,right:0,bottom:0,left:0,...e}}function r_(e){return typeof e!="number"?nI(e):{top:e,right:e,bottom:e,left:e}}function bx(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function a5(e,t,n){let{reference:r,floating:s}=e;const a=Jl(t),l=m4(t),h=h4(l),m=rc(t),p=a==="y",x=r.x+r.width/2-s.width/2,b=r.y+r.height/2-s.height/2,w=r[h]/2-s[h]/2;let E;switch(m){case"top":E={x,y:r.y-s.height};break;case"bottom":E={x,y:r.y+r.height};break;case"right":E={x:r.x+r.width,y:b};break;case"left":E={x:r.x-s.width,y:b};break;default:E={x:r.x,y:r.y}}switch($m(t)){case"start":E[l]-=w*(n&&p?-1:1);break;case"end":E[l]+=w*(n&&p?-1:1);break}return E}const rI=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,h=a.filter(Boolean),m=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:s}),{x,y:b}=a5(p,r,m),w=r,E={},M=0;for(let C=0;C<h.length;C++){const{name:S,fn:_}=h[C],{x:N,y:c,data:j,reset:D}=await _({x,y:b,initialPlacement:r,placement:w,strategy:s,middlewareData:E,rects:p,platform:l,elements:{reference:e,floating:t}});x=N??x,b=c??b,E={...E,[S]:{...E[S],...j}},D&&M<=50&&(M++,typeof D=="object"&&(D.placement&&(w=D.placement),D.rects&&(p=D.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x,y:b}=a5(p,w,m)),C=-1)}return{x,y:b,placement:w,strategy:s,middlewareData:E}};async function dg(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:l,elements:h,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:x="viewport",elementContext:b="floating",altBoundary:w=!1,padding:E=0}=nc(t,e),M=r_(E),S=h[w?b==="floating"?"reference":"floating":b],_=bx(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(S)))==null||n?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(h.floating)),boundary:p,rootBoundary:x,strategy:m})),N=b==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,c=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h.floating)),j=await(a.isElement==null?void 0:a.isElement(c))?await(a.getScale==null?void 0:a.getScale(c))||{x:1,y:1}:{x:1,y:1},D=bx(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:N,offsetParent:c,strategy:m}):N);return{top:(_.top-D.top+M.top)/j.y,bottom:(D.bottom-_.bottom+M.bottom)/j.y,left:(_.left-D.left+M.left)/j.x,right:(D.right-_.right+M.right)/j.x}}const iI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:l,elements:h,middlewareData:m}=t,{element:p,padding:x=0}=nc(e,t)||{};if(p==null)return{};const b=r_(x),w={x:n,y:r},E=m4(s),M=h4(E),C=await l.getDimensions(p),S=E==="y",_=S?"top":"left",N=S?"bottom":"right",c=S?"clientHeight":"clientWidth",j=a.reference[M]+a.reference[E]-w[E]-a.floating[M],D=w[E]-a.reference[E],B=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let T=B?B[c]:0;(!T||!await(l.isElement==null?void 0:l.isElement(B)))&&(T=h.floating[c]||a.floating[M]);const A=j/2-D/2,H=T/2-C[M]/2-1,F=gu(b[_],H),V=gu(b[N],H),ee=F,G=T-C[M]-V,se=T/2-C[M]/2+A,Ce=kw(ee,se,G),te=!m.arrow&&$m(s)!=null&&se!==Ce&&a.reference[M]/2-(se<ee?F:V)-C[M]/2<0,K=te?se<ee?se-ee:se-G:0;return{[E]:w[E]+K,data:{[E]:Ce,centerOffset:se-Ce-K,...te&&{alignmentOffset:K}},reset:te}}}),sI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:l,initialPlacement:h,platform:m,elements:p}=t,{mainAxis:x=!0,crossAxis:b=!0,fallbackPlacements:w,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:M="none",flipAlignment:C=!0,...S}=nc(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const _=rc(s),N=Jl(h),c=rc(h)===h,j=await(m.isRTL==null?void 0:m.isRTL(p.floating)),D=w||(c||!C?[xx(h)]:JH(h)),B=M!=="none";!w&&B&&D.push(...tI(h,C,M,j));const T=[h,...D],A=await dg(t,S),H=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(x&&H.push(A[_]),b){const Ce=ZH(s,l,j);H.push(A[Ce[0]],A[Ce[1]])}if(F=[...F,{placement:s,overflows:H}],!H.every(Ce=>Ce<=0)){var V,ee;const Ce=(((V=a.flip)==null?void 0:V.index)||0)+1,te=T[Ce];if(te){var G;const Z=b==="alignment"?N!==Jl(te):!1,oe=((G=F[0])==null?void 0:G.overflows[0])>0;if(!Z||oe)return{data:{index:Ce,overflows:F},reset:{placement:te}}}let K=(ee=F.filter(Z=>Z.overflows[0]<=0).sort((Z,oe)=>Z.overflows[1]-oe.overflows[1])[0])==null?void 0:ee.placement;if(!K)switch(E){case"bestFit":{var se;const Z=(se=F.filter(oe=>{if(B){const Y=Jl(oe.placement);return Y===N||Y==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(Y=>Y>0).reduce((Y,ne)=>Y+ne,0)]).sort((oe,Y)=>oe[1]-Y[1])[0])==null?void 0:se[0];Z&&(K=Z);break}case"initialPlacement":K=h;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function l5(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function c5(e){return XH.some(t=>e[t]>=0)}const oI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=nc(e,t);switch(r){case"referenceHidden":{const a=await dg(t,{...s,elementContext:"reference"}),l=l5(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:c5(l)}}}case"escaped":{const a=await dg(t,{...s,altBoundary:!0}),l=l5(a,n.floating);return{data:{escapedOffsets:l,escaped:c5(l)}}}default:return{}}}}};async function aI(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=rc(n),h=$m(n),m=Jl(n)==="y",p=["left","top"].includes(l)?-1:1,x=a&&m?-1:1,b=nc(t,e);let{mainAxis:w,crossAxis:E,alignmentAxis:M}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof M=="number"&&(E=h==="end"?M*-1:M),m?{x:E*x,y:w*p}:{x:w*p,y:E*x}}const lI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:l,middlewareData:h}=t,m=await aI(t,e);return l===((n=h.offset)==null?void 0:n.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:s+m.x,y:a+m.y,data:{...m,placement:l}}}}},cI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:h={fn:S=>{let{x:_,y:N}=S;return{x:_,y:N}}},...m}=nc(e,t),p={x:n,y:r},x=await dg(t,m),b=Jl(rc(s)),w=f4(b);let E=p[w],M=p[b];if(a){const S=w==="y"?"top":"left",_=w==="y"?"bottom":"right",N=E+x[S],c=E-x[_];E=kw(N,E,c)}if(l){const S=b==="y"?"top":"left",_=b==="y"?"bottom":"right",N=M+x[S],c=M-x[_];M=kw(N,M,c)}const C=h.fn({...t,[w]:E,[b]:M});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[w]:a,[b]:l}}}}}},uI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:l}=t,{offset:h=0,mainAxis:m=!0,crossAxis:p=!0}=nc(e,t),x={x:n,y:r},b=Jl(s),w=f4(b);let E=x[w],M=x[b];const C=nc(h,t),S=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(m){const c=w==="y"?"height":"width",j=a.reference[w]-a.floating[c]+S.mainAxis,D=a.reference[w]+a.reference[c]-S.mainAxis;E<j?E=j:E>D&&(E=D)}if(p){var _,N;const c=w==="y"?"width":"height",j=["top","left"].includes(rc(s)),D=a.reference[b]-a.floating[c]+(j&&((_=l.offset)==null?void 0:_[b])||0)+(j?0:S.crossAxis),B=a.reference[b]+a.reference[c]+(j?0:((N=l.offset)==null?void 0:N[b])||0)-(j?S.crossAxis:0);M<D?M=D:M>B&&(M=B)}return{[w]:E,[b]:M}}}},dI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:l,elements:h}=t,{apply:m=()=>{},...p}=nc(e,t),x=await dg(t,p),b=rc(s),w=$m(s),E=Jl(s)==="y",{width:M,height:C}=a.floating;let S,_;b==="top"||b==="bottom"?(S=b,_=w===(await(l.isRTL==null?void 0:l.isRTL(h.floating))?"start":"end")?"left":"right"):(_=b,S=w==="end"?"top":"bottom");const N=C-x.top-x.bottom,c=M-x.left-x.right,j=gu(C-x[S],N),D=gu(M-x[_],c),B=!t.middlewareData.shift;let T=j,A=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=c),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=N),B&&!w){const F=eo(x.left,0),V=eo(x.right,0),ee=eo(x.top,0),G=eo(x.bottom,0);E?A=M-2*(F!==0||V!==0?F+V:eo(x.left,x.right)):T=C-2*(ee!==0||G!==0?ee+G:eo(x.top,x.bottom))}await m({...t,availableWidth:A,availableHeight:T});const H=await l.getDimensions(h.floating);return M!==H.width||C!==H.height?{reset:{rects:!0}}:{}}}};function yb(){return typeof window<"u"}function Vm(e){return i_(e)?(e.nodeName||"").toLowerCase():"#document"}function to(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pl(e){var t;return(t=(i_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function i_(e){return yb()?e instanceof Node||e instanceof to(e).Node:!1}function ca(e){return yb()?e instanceof Element||e instanceof to(e).Element:!1}function fl(e){return yb()?e instanceof HTMLElement||e instanceof to(e).HTMLElement:!1}function u5(e){return!yb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof to(e).ShadowRoot}function Ug(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ua(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function fI(e){return["table","td","th"].includes(Vm(e))}function xb(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function p4(e){const t=g4(),n=ca(e)?ua(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function hI(e){let t=vu(e);for(;fl(t)&&!Mm(t);){if(p4(t))return t;if(xb(t))return null;t=vu(t)}return null}function g4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Mm(e){return["html","body","#document"].includes(Vm(e))}function ua(e){return to(e).getComputedStyle(e)}function bb(e){return ca(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vu(e){if(Vm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||u5(e)&&e.host||pl(e);return u5(t)?t.host:t}function s_(e){const t=vu(e);return Mm(t)?e.ownerDocument?e.ownerDocument.body:e.body:fl(t)&&Ug(t)?t:s_(t)}function fg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=s_(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),l=to(s);if(a){const h=zw(l);return t.concat(l,l.visualViewport||[],Ug(s)?s:[],h&&n?fg(h):[])}return t.concat(s,fg(s,[],n))}function zw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function o_(e){const t=ua(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=fl(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:r,h=yx(n)!==a||yx(r)!==l;return h&&(n=a,r=l),{width:n,height:r,$:h}}function v4(e){return ca(e)?e:e.contextElement}function lm(e){const t=v4(e);if(!fl(t))return ll(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=o_(t);let l=(a?yx(n.width):n.width)/r,h=(a?yx(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!h||!Number.isFinite(h))&&(h=1),{x:l,y:h}}const mI=ll(0);function a_(e){const t=to(e);return!g4()||!t.visualViewport?mI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==to(e)?!1:t}function of(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=v4(e);let l=ll(1);t&&(r?ca(r)&&(l=lm(r)):l=lm(e));const h=pI(a,n,r)?a_(a):ll(0);let m=(s.left+h.x)/l.x,p=(s.top+h.y)/l.y,x=s.width/l.x,b=s.height/l.y;if(a){const w=to(a),E=r&&ca(r)?to(r):r;let M=w,C=zw(M);for(;C&&r&&E!==M;){const S=lm(C),_=C.getBoundingClientRect(),N=ua(C),c=_.left+(C.clientLeft+parseFloat(N.paddingLeft))*S.x,j=_.top+(C.clientTop+parseFloat(N.paddingTop))*S.y;m*=S.x,p*=S.y,x*=S.x,b*=S.y,m+=c,p+=j,M=to(C),C=zw(M)}}return bx({width:x,height:b,x:m,y:p})}function y4(e,t){const n=bb(e).scrollLeft;return t?t.left+n:of(pl(e)).left+n}function l_(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:y4(e,r)),a=r.top+t.scrollTop;return{x:s,y:a}}function gI(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",l=pl(r),h=t?xb(t.floating):!1;if(r===l||h&&a)return n;let m={scrollLeft:0,scrollTop:0},p=ll(1);const x=ll(0),b=fl(r);if((b||!b&&!a)&&((Vm(r)!=="body"||Ug(l))&&(m=bb(r)),fl(r))){const E=of(r);p=lm(r),x.x=E.x+r.clientLeft,x.y=E.y+r.clientTop}const w=l&&!b&&!a?l_(l,m,!0):ll(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-m.scrollLeft*p.x+x.x+w.x,y:n.y*p.y-m.scrollTop*p.y+x.y+w.y}}function vI(e){return Array.from(e.getClientRects())}function yI(e){const t=pl(e),n=bb(e),r=e.ownerDocument.body,s=eo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=eo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+y4(e);const h=-n.scrollTop;return ua(r).direction==="rtl"&&(l+=eo(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:l,y:h}}function xI(e,t){const n=to(e),r=pl(e),s=n.visualViewport;let a=r.clientWidth,l=r.clientHeight,h=0,m=0;if(s){a=s.width,l=s.height;const p=g4();(!p||p&&t==="fixed")&&(h=s.offsetLeft,m=s.offsetTop)}return{width:a,height:l,x:h,y:m}}function bI(e,t){const n=of(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=fl(e)?lm(e):ll(1),l=e.clientWidth*a.x,h=e.clientHeight*a.y,m=s*a.x,p=r*a.y;return{width:l,height:h,x:m,y:p}}function d5(e,t,n){let r;if(t==="viewport")r=xI(e,n);else if(t==="document")r=yI(pl(e));else if(ca(t))r=bI(t,n);else{const s=a_(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return bx(r)}function c_(e,t){const n=vu(e);return n===t||!ca(n)||Mm(n)?!1:ua(n).position==="fixed"||c_(n,t)}function LI(e,t){const n=t.get(e);if(n)return n;let r=fg(e,[],!1).filter(h=>ca(h)&&Vm(h)!=="body"),s=null;const a=ua(e).position==="fixed";let l=a?vu(e):e;for(;ca(l)&&!Mm(l);){const h=ua(l),m=p4(l);!m&&h.position==="fixed"&&(s=null),(a?!m&&!s:!m&&h.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ug(l)&&!m&&c_(e,l))?r=r.filter(x=>x!==l):s=h,l=vu(l)}return t.set(e,r),r}function wI(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?xb(t)?[]:LI(t,this._c):[].concat(n),r],h=l[0],m=l.reduce((p,x)=>{const b=d5(t,x,s);return p.top=eo(b.top,p.top),p.right=gu(b.right,p.right),p.bottom=gu(b.bottom,p.bottom),p.left=eo(b.left,p.left),p},d5(t,h,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function SI(e){const{width:t,height:n}=o_(e);return{width:t,height:n}}function CI(e,t,n){const r=fl(t),s=pl(t),a=n==="fixed",l=of(e,!0,a,t);let h={scrollLeft:0,scrollTop:0};const m=ll(0);function p(){m.x=y4(s)}if(r||!r&&!a)if((Vm(t)!=="body"||Ug(s))&&(h=bb(t)),r){const E=of(t,!0,a,t);m.x=E.x+t.clientLeft,m.y=E.y+t.clientTop}else s&&p();a&&!r&&s&&p();const x=s&&!r&&!a?l_(s,h):ll(0),b=l.left+h.scrollLeft-m.x-x.x,w=l.top+h.scrollTop-m.y-x.y;return{x:b,y:w,width:l.width,height:l.height}}function T2(e){return ua(e).position==="static"}function f5(e,t){if(!fl(e)||ua(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pl(e)===n&&(n=n.ownerDocument.body),n}function u_(e,t){const n=to(e);if(xb(e))return n;if(!fl(e)){let s=vu(e);for(;s&&!Mm(s);){if(ca(s)&&!T2(s))return s;s=vu(s)}return n}let r=f5(e,t);for(;r&&fI(r)&&T2(r);)r=f5(r,t);return r&&Mm(r)&&T2(r)&&!p4(r)?n:r||hI(e)||n}const EI=async function(e){const t=this.getOffsetParent||u_,n=this.getDimensions,r=await n(e.floating);return{reference:CI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function RI(e){return ua(e).direction==="rtl"}const _I={convertOffsetParentRelativeRectToViewportRelativeRect:gI,getDocumentElement:pl,getClippingRect:wI,getOffsetParent:u_,getElementRects:EI,getClientRects:vI,getDimensions:SI,getScale:lm,isElement:ca,isRTL:RI};function d_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MI(e,t){let n=null,r;const s=pl(e);function a(){var h;clearTimeout(r),(h=n)==null||h.disconnect(),n=null}function l(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),a();const p=e.getBoundingClientRect(),{left:x,top:b,width:w,height:E}=p;if(h||t(),!w||!E)return;const M=jy(b),C=jy(s.clientWidth-(x+w)),S=jy(s.clientHeight-(b+E)),_=jy(x),c={rootMargin:-M+"px "+-C+"px "+-S+"px "+-_+"px",threshold:eo(0,gu(1,m))||1};let j=!0;function D(B){const T=B[0].intersectionRatio;if(T!==m){if(!j)return l();T?l(!1,T):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!d_(p,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(D,{...c,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,c)}n.observe(e)}return l(!0),a}function f_(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:m=!1}=r,p=v4(e),x=s||a?[...p?fg(p):[],...fg(t)]:[];x.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),a&&_.addEventListener("resize",n)});const b=p&&h?MI(p,n):null;let w=-1,E=null;l&&(E=new ResizeObserver(_=>{let[N]=_;N&&N.target===p&&E&&(E.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var c;(c=E)==null||c.observe(t)})),n()}),p&&!m&&E.observe(p),E.observe(t));let M,C=m?of(e):null;m&&S();function S(){const _=of(e);C&&!d_(C,_)&&n(),C=_,M=requestAnimationFrame(S)}return n(),()=>{var _;x.forEach(N=>{s&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),b==null||b(),(_=E)==null||_.disconnect(),E=null,m&&cancelAnimationFrame(M)}}const NI=lI,OI=cI,TI=sI,DI=dI,AI=oI,h5=iI,jI=uI,kI=(e,t,n)=>{const r=new Map,s={platform:_I,...n},a={...s.platform,_c:r};return rI(e,t,{...s,platform:a})};var ix=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Lx(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lx(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!Lx(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function h_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function m5(e,t){const n=h_(e);return Math.round(t*n)/n}function D2(e){const t=y.useRef(e);return ix(()=>{t.current=e}),t}function m_(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:l}={},transform:h=!0,whileElementsMounted:m,open:p}=e,[x,b]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,E]=y.useState(r);Lx(w,r)||E(r);const[M,C]=y.useState(null),[S,_]=y.useState(null),N=y.useCallback(Z=>{Z!==B.current&&(B.current=Z,C(Z))},[]),c=y.useCallback(Z=>{Z!==T.current&&(T.current=Z,_(Z))},[]),j=a||M,D=l||S,B=y.useRef(null),T=y.useRef(null),A=y.useRef(x),H=m!=null,F=D2(m),V=D2(s),ee=D2(p),G=y.useCallback(()=>{if(!B.current||!T.current)return;const Z={placement:t,strategy:n,middleware:w};V.current&&(Z.platform=V.current),kI(B.current,T.current,Z).then(oe=>{const Y={...oe,isPositioned:ee.current!==!1};se.current&&!Lx(A.current,Y)&&(A.current=Y,ol.flushSync(()=>{b(Y)}))})},[w,t,n,V,ee]);ix(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,b(Z=>({...Z,isPositioned:!1})))},[p]);const se=y.useRef(!1);ix(()=>(se.current=!0,()=>{se.current=!1}),[]),ix(()=>{if(j&&(B.current=j),D&&(T.current=D),j&&D){if(F.current)return F.current(j,D,G);G()}},[j,D,G,F,H]);const Ce=y.useMemo(()=>({reference:B,floating:T,setReference:N,setFloating:c}),[N,c]),te=y.useMemo(()=>({reference:j,floating:D}),[j,D]),K=y.useMemo(()=>{const Z={position:n,left:0,top:0};if(!te.floating)return Z;const oe=m5(te.floating,x.x),Y=m5(te.floating,x.y);return h?{...Z,transform:"translate("+oe+"px, "+Y+"px)",...h_(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:Y}},[n,h,te.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:G,refs:Ce,elements:te,floatingStyles:K}),[x,G,Ce,te,K])}const PI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?h5({element:r.current,padding:s}).fn(n):{}:r?h5({element:r,padding:s}).fn(n):{}}}},p_=(e,t)=>({...NI(e),options:[e,t]}),g_=(e,t)=>({...OI(e),options:[e,t]}),v_=(e,t)=>({...jI(e),options:[e,t]}),y_=(e,t)=>({...TI(e),options:[e,t]}),x_=(e,t)=>({...DI(e),options:[e,t]}),b_=(e,t)=>({...AI(e),options:[e,t]}),L_=(e,t)=>({...PI(e),options:[e,t]});var zI="Arrow",w_=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return f.jsx(Lt.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});w_.displayName=zI;var S_=w_;function x4(e){const[t,n]=y.useState(void 0);return Wr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,h;if("borderBoxSize"in a){const m=a.borderBoxSize,p=Array.isArray(m)?m[0]:m;l=p.inlineSize,h=p.blockSize}else l=e.offsetWidth,h=e.offsetHeight;n({width:l,height:h})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var b4="Popper",[C_,Lu]=cs(b4),[BI,E_]=C_(b4),R_=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return f.jsx(BI,{scope:t,anchor:r,onAnchorChange:s,children:n})};R_.displayName=b4;var __="PopperAnchor",M_=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=E_(__,n),l=y.useRef(null),h=Qt(t,l);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:f.jsx(Lt.div,{...s,ref:h})});M_.displayName=__;var L4="PopperContent",[UI,FI]=C_(L4),N_=y.forwardRef((e,t)=>{var ye,ve,he,de,ke,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:M,...C}=e,S=E_(L4,n),[_,N]=y.useState(null),c=Qt(t,Ke=>N(Ke)),[j,D]=y.useState(null),B=x4(j),T=(B==null?void 0:B.width)??0,A=(B==null?void 0:B.height)??0,H=r+(a!=="center"?"-"+a:""),F=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},V=Array.isArray(p)?p:[p],ee=V.length>0,G={padding:F,boundary:V.filter(II),altBoundary:ee},{refs:se,floatingStyles:Ce,placement:te,isPositioned:K,middlewareData:Z}=m_({strategy:"fixed",placement:H,whileElementsMounted:(...Ke)=>f_(...Ke,{animationFrame:E==="always"}),elements:{reference:S.anchor},middleware:[p_({mainAxis:s+A,alignmentAxis:l}),m&&g_({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?v_():void 0,...G}),m&&y_({...G}),x_({...G,apply:({elements:Ke,rects:ae,availableWidth:We,availableHeight:bt})=>{const{width:tt,height:mt}=ae.reference,Xe=Ke.floating.style;Xe.setProperty("--radix-popper-available-width",`${We}px`),Xe.setProperty("--radix-popper-available-height",`${bt}px`),Xe.setProperty("--radix-popper-anchor-width",`${tt}px`),Xe.setProperty("--radix-popper-anchor-height",`${mt}px`)}}),j&&L_({element:j,padding:h}),$I({arrowWidth:T,arrowHeight:A}),w&&b_({strategy:"referenceHidden",...G})]}),[oe,Y]=D_(te),ne=Ci(M);Wr(()=>{K&&(ne==null||ne())},[K,ne]);const X=(ye=Z.arrow)==null?void 0:ye.x,ue=(ve=Z.arrow)==null?void 0:ve.y,pe=((he=Z.arrow)==null?void 0:he.centerOffset)!==0,[Se,Re]=y.useState();return Wr(()=>{_&&Re(window.getComputedStyle(_).zIndex)},[_]),f.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ce,transform:K?Ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(de=Z.transformOrigin)==null?void 0:de.x,(ke=Z.transformOrigin)==null?void 0:ke.y].join(" "),...((Ee=Z.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(UI,{scope:n,placedSide:oe,onArrowChange:D,arrowX:X,arrowY:ue,shouldHideArrow:pe,children:f.jsx(Lt.div,{"data-side":oe,"data-align":Y,...C,ref:c,style:{...C.style,animation:K?void 0:"none"}})})})});N_.displayName=L4;var O_="PopperArrow",HI={top:"bottom",right:"left",bottom:"top",left:"right"},T_=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=FI(O_,r),l=HI[a.placedSide];return f.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:f.jsx(S_,{...s,ref:n,style:{...s.style,display:"block"}})})});T_.displayName=O_;function II(e){return e!==null}var $I=e=>({name:"transformOrigin",options:e,fn(t){var S,_,N;const{placement:n,rects:r,middlewareData:s}=t,l=((S=s.arrow)==null?void 0:S.centerOffset)!==0,h=l?0:e.arrowWidth,m=l?0:e.arrowHeight,[p,x]=D_(n),b={start:"0%",center:"50%",end:"100%"}[x],w=(((_=s.arrow)==null?void 0:_.x)??0)+h/2,E=(((N=s.arrow)==null?void 0:N.y)??0)+m/2;let M="",C="";return p==="bottom"?(M=l?b:`${w}px`,C=`${-m}px`):p==="top"?(M=l?b:`${w}px`,C=`${r.floating.height+m}px`):p==="right"?(M=`${-m}px`,C=l?b:`${E}px`):p==="left"&&(M=`${r.floating.width+m}px`,C=l?b:`${E}px`),{data:{x:M,y:C}}}});function D_(e){const[t,n="center"]=e.split("-");return[t,n]}var Lb=R_,Fg=M_,wb=N_,Sb=T_,A_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VI="VisuallyHidden",j_=y.forwardRef((e,t)=>f.jsx(Lt.span,{...e,ref:t,style:{...A_,...e.style}}));j_.displayName=VI;var qI=j_,[Cb,Fse]=cs("Tooltip",[Lu]),Eb=Lu(),k_="TooltipProvider",WI=700,Bw="tooltip.open",[GI,w4]=Cb(k_),P_=e=>{const{__scopeTooltip:t,delayDuration:n=WI,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,l=y.useRef(!0),h=y.useRef(!1),m=y.useRef(0);return y.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),f.jsx(GI,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(m.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:h,onPointerInTransitChange:y.useCallback(p=>{h.current=p},[]),disableHoverableContent:s,children:a})};P_.displayName=k_;var hg="Tooltip",[YI,Hg]=Cb(hg),z_=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:h}=e,m=w4(hg,e.__scopeTooltip),p=Eb(t),[x,b]=y.useState(null),w=li(),E=y.useRef(0),M=l??m.disableHoverableContent,C=h??m.delayDuration,S=y.useRef(!1),[_,N]=dl({prop:r,defaultProp:s??!1,onChange:T=>{T?(m.onOpen(),document.dispatchEvent(new CustomEvent(Bw))):m.onClose(),a==null||a(T)},caller:hg}),c=y.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),j=y.useCallback(()=>{window.clearTimeout(E.current),E.current=0,S.current=!1,N(!0)},[N]),D=y.useCallback(()=>{window.clearTimeout(E.current),E.current=0,N(!1)},[N]),B=y.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{S.current=!0,N(!0),E.current=0},C)},[C,N]);return y.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]),f.jsx(Lb,{...p,children:f.jsx(YI,{scope:t,contentId:w,open:_,stateAttribute:c,trigger:x,onTriggerChange:b,onTriggerEnter:y.useCallback(()=>{m.isOpenDelayedRef.current?B():j()},[m.isOpenDelayedRef,B,j]),onTriggerLeave:y.useCallback(()=>{M?D():(window.clearTimeout(E.current),E.current=0)},[D,M]),onOpen:j,onClose:D,disableHoverableContent:M,children:n})})};z_.displayName=hg;var Uw="TooltipTrigger",B_=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Hg(Uw,n),a=w4(Uw,n),l=Eb(n),h=y.useRef(null),m=Qt(t,h,s.onTriggerChange),p=y.useRef(!1),x=y.useRef(!1),b=y.useCallback(()=>p.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),f.jsx(Fg,{asChild:!0,...l,children:f.jsx(Lt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:m,onPointerMove:ut(e.onPointerMove,w=>{w.pointerType!=="touch"&&!x.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),x.current=!0)}),onPointerLeave:ut(e.onPointerLeave,()=>{s.onTriggerLeave(),x.current=!1}),onPointerDown:ut(e.onPointerDown,()=>{s.open&&s.onClose(),p.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:ut(e.onFocus,()=>{p.current||s.onOpen()}),onBlur:ut(e.onBlur,s.onClose),onClick:ut(e.onClick,s.onClose)})})});B_.displayName=Uw;var S4="TooltipPortal",[XI,KI]=Cb(S4,{forceMount:void 0}),U_=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,a=Hg(S4,t);return f.jsx(XI,{scope:t,forceMount:n,children:f.jsx(ro,{present:n||a.open,children:f.jsx(vf,{asChild:!0,container:s,children:r})})})};U_.displayName=S4;var Nm="TooltipContent",F_=y.forwardRef((e,t)=>{const n=KI(Nm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,l=Hg(Nm,e.__scopeTooltip);return f.jsx(ro,{present:r||l.open,children:l.disableHoverableContent?f.jsx(H_,{side:s,...a,ref:t}):f.jsx(QI,{side:s,...a,ref:t})})}),QI=y.forwardRef((e,t)=>{const n=Hg(Nm,e.__scopeTooltip),r=w4(Nm,e.__scopeTooltip),s=y.useRef(null),a=Qt(t,s),[l,h]=y.useState(null),{trigger:m,onClose:p}=n,x=s.current,{onPointerInTransitChange:b}=r,w=y.useCallback(()=>{h(null),b(!1)},[b]),E=y.useCallback((M,C)=>{const S=M.currentTarget,_={x:M.clientX,y:M.clientY},N=t$(_,S.getBoundingClientRect()),c=n$(_,N),j=r$(C.getBoundingClientRect()),D=s$([...c,...j]);h(D),b(!0)},[b]);return y.useEffect(()=>()=>w(),[w]),y.useEffect(()=>{if(m&&x){const M=S=>E(S,x),C=S=>E(S,m);return m.addEventListener("pointerleave",M),x.addEventListener("pointerleave",C),()=>{m.removeEventListener("pointerleave",M),x.removeEventListener("pointerleave",C)}}},[m,x,E,w]),y.useEffect(()=>{if(l){const M=C=>{const S=C.target,_={x:C.clientX,y:C.clientY},N=(m==null?void 0:m.contains(S))||(x==null?void 0:x.contains(S)),c=!i$(_,l);N?w():c&&(w(),p())};return document.addEventListener("pointermove",M),()=>document.removeEventListener("pointermove",M)}},[m,x,l,p,w]),f.jsx(H_,{...e,ref:a})}),[ZI,JI]=Cb(hg,{isInside:!1}),e$=OP("TooltipContent"),H_=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...h}=e,m=Hg(Nm,n),p=Eb(n),{onClose:x}=m;return y.useEffect(()=>(document.addEventListener(Bw,x),()=>document.removeEventListener(Bw,x)),[x]),y.useEffect(()=>{if(m.trigger){const b=w=>{const E=w.target;E!=null&&E.contains(m.trigger)&&x()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[m.trigger,x]),f.jsx(Fm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:b=>b.preventDefault(),onDismiss:x,children:f.jsxs(wb,{"data-state":m.stateAttribute,...p,...h,ref:t,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(e$,{children:r}),f.jsx(ZI,{scope:n,isInside:!0,children:f.jsx(qI,{id:m.contentId,role:"tooltip",children:s||r})})]})})});F_.displayName=Nm;var I_="TooltipArrow",$_=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Eb(n);return JI(I_,n).isInside?null:f.jsx(Sb,{...s,...r,ref:t})});$_.displayName=I_;function t$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function n$(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function r$(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function i$(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const h=t[a],m=t[l],p=h.x,x=h.y,b=m.x,w=m.y;x>r!=w>r&&n<(b-p)*(r-x)/(w-x)+p&&(s=!s)}return s}function s$(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),o$(t)}function o$(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var a$=P_,l$=z_,c$=B_,u$=U_,d$=F_,f$=$_;function V_({delayDuration:e=0,...t}){return f.jsx(a$,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function h$({...e}){return f.jsx(V_,{children:f.jsx(l$,{"data-slot":"tooltip",...e})})}function m$({...e}){return f.jsx(c$,{"data-slot":"tooltip-trigger",...e})}function p$({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(u$,{children:f.jsxs(d$,{"data-slot":"tooltip-content",sideOffset:t,className:He("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(f$,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const q_="sidebar_state",g$=60*60*24*7;function v$(){if(typeof document>"u")return!0;const e=document.cookie.match(new RegExp(`(?:^|; )${q_}=([^;]*)`)),t=e?decodeURIComponent(e[1]):null;return t!=="false"}const y$="16rem",x$="18rem",b$="3rem",L$="b",W_=y.createContext(null);function Rb(){const e=y.useContext(W_);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function w$({defaultOpen:e,open:t,onOpenChange:n,className:r,style:s,children:a,...l}){const h=ml(),[m,p]=y.useState(!1),x=e??v$(),[b,w]=y.useState(x),E=t??b,M=y.useCallback(N=>{const c=typeof N=="function"?N(E):N;n?n(c):w(c),document.cookie=`${q_}=${c}; path=/; max-age=${g$}`},[n,E]),C=y.useCallback(()=>h?p(N=>!N):M(N=>!N),[h,M,p]);y.useEffect(()=>{const N=c=>{c.key===L$&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),C())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[C]);const S=E?"expanded":"collapsed",_=y.useMemo(()=>({state:S,open:E,setOpen:M,isMobile:h,openMobile:m,setOpenMobile:p,toggleSidebar:C}),[S,E,M,h,m,p,C]);return f.jsx(W_.Provider,{value:_,children:f.jsx(V_,{delayDuration:0,children:f.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":y$,"--sidebar-width-icon":b$,...s},className:He("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:a})})})}function S$({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...a}){const{isMobile:l,state:h,openMobile:m,setOpenMobile:p}=Rb();return n==="none"?f.jsx("div",{"data-slot":"sidebar",className:He("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...a,children:s}):l?f.jsx(ZR,{open:m,onOpenChange:p,...a,children:f.jsxs(JR,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":x$},side:e,children:[f.jsxs(e_,{className:"sr-only",children:[f.jsx(t_,{children:"Sidebar"}),f.jsx(n_,{children:"Displays the mobile sidebar."})]}),f.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):f.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[f.jsx("div",{"data-slot":"sidebar-gap",className:He("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),f.jsx("div",{"data-slot":"sidebar-container",className:He("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...a,children:f.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function C$({className:e,...t}){return f.jsx("main",{"data-slot":"sidebar-inset",className:He("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function E$({className:e,...t}){return f.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:He("flex flex-col gap-2 p-2",e),...t})}function R$({className:e,...t}){return f.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:He("flex flex-col gap-2 p-2",e),...t})}function _$({className:e,...t}){return f.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:He("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden group-data-[collapsible=icon]:items-center",e),...t})}function G_({className:e,...t}){return f.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:He("flex w-full min-w-0 flex-col gap-1","group-data-[collapsible=icon]:items-center",e),...t})}function Y_({className:e,...t}){return f.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:He("group/menu-item relative",e),...t})}const M$=rb("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function X_({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:a,...l}){const h=e?q9:"button",{isMobile:m,state:p}=Rb(),x=f.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:He(M$({variant:n,size:r}),a),...l});return s?(typeof s=="string"&&(s={children:s}),f.jsxs(h$,{children:[f.jsx(m$,{asChild:!0,children:x}),f.jsx(p$,{side:"right",align:"center",hidden:p!=="collapsed"||m,...s})]})):x}var an={},p5;function N$(){if(p5)return an;p5=1,Object.defineProperty(an,"__esModule",{value:!0}),an.ScryptedMimeTypes=an.ScryptedInterface=an.MediaPlayerState=an.SecuritySystemObstruction=an.SecuritySystemMode=an.AirQuality=an.AirPurifierMode=an.AirPurifierStatus=an.ChargeState=an.LockState=an.PanTiltZoomMovement=an.ThermostatMode=an.TemperatureUnit=an.FanMode=an.HumidityMode=an.ScryptedDeviceType=an.ScryptedInterfaceDescriptors=an.ScryptedInterfaceMethod=an.ScryptedInterfaceProperty=an.DeviceBase=an.TYPES_VERSION=void 0,an.TYPES_VERSION="0.5.54";class e{}an.DeviceBase=e;var t;(function(c){c.id="id",c.info="info",c.interfaces="interfaces",c.mixins="mixins",c.name="name",c.nativeId="nativeId",c.pluginId="pluginId",c.providedInterfaces="providedInterfaces",c.providedName="providedName",c.providedRoom="providedRoom",c.providedType="providedType",c.providerId="providerId",c.room="room",c.type="type",c.scryptedRuntimeArguments="scryptedRuntimeArguments",c.on="on",c.brightness="brightness",c.colorTemperature="colorTemperature",c.rgb="rgb",c.hsv="hsv",c.buttons="buttons",c.sensors="sensors",c.running="running",c.paused="paused",c.docked="docked",c.temperatureSetting="temperatureSetting",c.temperature="temperature",c.temperatureUnit="temperatureUnit",c.humidity="humidity",c.resolution="resolution",c.audioVolumes="audioVolumes",c.recordingActive="recordingActive",c.ptzCapabilities="ptzCapabilities",c.lockState="lockState",c.entryOpen="entryOpen",c.batteryLevel="batteryLevel",c.chargeState="chargeState",c.online="online",c.fromMimeType="fromMimeType",c.toMimeType="toMimeType",c.converters="converters",c.binaryState="binaryState",c.tampered="tampered",c.sleeping="sleeping",c.powerDetected="powerDetected",c.audioDetected="audioDetected",c.motionDetected="motionDetected",c.ambientLight="ambientLight",c.occupied="occupied",c.flooded="flooded",c.ultraviolet="ultraviolet",c.luminance="luminance",c.position="position",c.securitySystemState="securitySystemState",c.pm10Density="pm10Density",c.pm25Density="pm25Density",c.vocDensity="vocDensity",c.noxDensity="noxDensity",c.co2ppm="co2ppm",c.airQuality="airQuality",c.airPurifierState="airPurifierState",c.filterChangeIndication="filterChangeIndication",c.filterLifeLevel="filterLifeLevel",c.humiditySetting="humiditySetting",c.fan="fan",c.applicationInfo="applicationInfo",c.chatCompletionCapabilities="chatCompletionCapabilities",c.systemDevice="systemDevice"})(t||(an.ScryptedInterfaceProperty=t={}));var n;(function(c){c.listen="listen",c.probe="probe",c.setMixins="setMixins",c.setName="setName",c.setRoom="setRoom",c.setType="setType",c.getPluginJson="getPluginJson",c.turnOff="turnOff",c.turnOn="turnOn",c.setBrightness="setBrightness",c.getTemperatureMaxK="getTemperatureMaxK",c.getTemperatureMinK="getTemperatureMinK",c.setColorTemperature="setColorTemperature",c.setRgb="setRgb",c.setHsv="setHsv",c.pressButton="pressButton",c.sendNotification="sendNotification",c.start="start",c.stop="stop",c.pause="pause",c.resume="resume",c.dock="dock",c.setTemperature="setTemperature",c.setTemperatureUnit="setTemperatureUnit",c.getPictureOptions="getPictureOptions",c.takePicture="takePicture",c.getAudioStream="getAudioStream",c.setAudioVolumes="setAudioVolumes",c.startDisplay="startDisplay",c.stopDisplay="stopDisplay",c.getVideoStream="getVideoStream",c.getVideoStreamOptions="getVideoStreamOptions",c.getPrivacyMasks="getPrivacyMasks",c.setPrivacyMasks="setPrivacyMasks",c.getVideoTextOverlays="getVideoTextOverlays",c.setVideoTextOverlay="setVideoTextOverlay",c.getRecordingStream="getRecordingStream",c.getRecordingStreamCurrentTime="getRecordingStreamCurrentTime",c.getRecordingStreamOptions="getRecordingStreamOptions",c.getRecordingStreamThumbnail="getRecordingStreamThumbnail",c.deleteRecordingStream="deleteRecordingStream",c.setRecordingActive="setRecordingActive",c.ptzCommand="ptzCommand",c.getRecordedEvents="getRecordedEvents",c.getVideoClip="getVideoClip",c.getVideoClips="getVideoClips",c.getVideoClipThumbnail="getVideoClipThumbnail",c.removeVideoClips="removeVideoClips",c.setVideoStreamOptions="setVideoStreamOptions",c.startIntercom="startIntercom",c.stopIntercom="stopIntercom",c.lock="lock",c.unlock="unlock",c.addPassword="addPassword",c.getPasswords="getPasswords",c.removePassword="removePassword",c.activate="activate",c.deactivate="deactivate",c.isReversible="isReversible",c.closeEntry="closeEntry",c.openEntry="openEntry",c.getDevice="getDevice",c.releaseDevice="releaseDevice",c.adoptDevice="adoptDevice",c.discoverDevices="discoverDevices",c.createDevice="createDevice",c.getCreateDeviceSettings="getCreateDeviceSettings",c.reboot="reboot",c.getRefreshFrequency="getRefreshFrequency",c.refresh="refresh",c.getMediaStatus="getMediaStatus",c.load="load",c.seek="seek",c.skipNext="skipNext",c.skipPrevious="skipPrevious",c.convert="convert",c.convertMedia="convertMedia",c.getSettings="getSettings",c.putSetting="putSetting",c.armSecuritySystem="armSecuritySystem",c.disarmSecuritySystem="disarmSecuritySystem",c.setAirPurifierState="setAirPurifierState",c.getReadmeMarkdown="getReadmeMarkdown",c.getOauthUrl="getOauthUrl",c.onOauthCallback="onOauthCallback",c.canMixin="canMixin",c.getMixin="getMixin",c.releaseMixin="releaseMixin",c.onRequest="onRequest",c.onConnection="onConnection",c.onPush="onPush",c.run="run",c.eval="eval",c.loadScripts="loadScripts",c.saveScript="saveScript",c.forkInterface="forkInterface",c.getDetectionInput="getDetectionInput",c.getObjectTypes="getObjectTypes",c.detectObjects="detectObjects",c.generateObjectDetections="generateObjectDetections",c.getDetectionModel="getDetectionModel",c.setHumidity="setHumidity",c.setFan="setFan",c.startRTCSignalingSession="startRTCSignalingSession",c.createRTCSignalingSession="createRTCSignalingSession",c.getScryptedUserAccessControl="getScryptedUserAccessControl",c.generateVideoFrames="generateVideoFrames",c.connectStream="connectStream",c.getTTYSettings="getTTYSettings",c.getChatCompletion="getChatCompletion",c.streamChatCompletion="streamChatCompletion",c.getTextEmbedding="getTextEmbedding",c.getImageEmbedding="getImageEmbedding",c.callLLMTool="callLLMTool",c.getLLMTools="getLLMTools"})(n||(an.ScryptedInterfaceMethod=n={})),an.ScryptedInterfaceDescriptors={ScryptedDevice:{name:"ScryptedDevice",methods:["listen","probe","setMixins","setName","setRoom","setType"],properties:["id","info","interfaces","mixins","name","nativeId","pluginId","providedInterfaces","providedName","providedRoom","providedType","providerId","room","type"]},ScryptedPlugin:{name:"ScryptedPlugin",methods:["getPluginJson"],properties:[]},ScryptedPluginRuntime:{name:"ScryptedPluginRuntime",methods:[],properties:["scryptedRuntimeArguments"]},OnOff:{name:"OnOff",methods:["turnOff","turnOn"],properties:["on"]},Brightness:{name:"Brightness",methods:["setBrightness"],properties:["brightness"]},ColorSettingTemperature:{name:"ColorSettingTemperature",methods:["getTemperatureMaxK","getTemperatureMinK","setColorTemperature"],properties:["colorTemperature"]},ColorSettingRgb:{name:"ColorSettingRgb",methods:["setRgb"],properties:["rgb"]},ColorSettingHsv:{name:"ColorSettingHsv",methods:["setHsv"],properties:["hsv"]},Buttons:{name:"Buttons",methods:[],properties:["buttons"]},PressButtons:{name:"PressButtons",methods:["pressButton"],properties:[]},Sensors:{name:"Sensors",methods:[],properties:["sensors"]},Notifier:{name:"Notifier",methods:["sendNotification"],properties:[]},StartStop:{name:"StartStop",methods:["start","stop"],properties:["running"]},Pause:{name:"Pause",methods:["pause","resume"],properties:["paused"]},Dock:{name:"Dock",methods:["dock"],properties:["docked"]},TemperatureSetting:{name:"TemperatureSetting",methods:["setTemperature"],properties:["temperatureSetting"]},Thermometer:{name:"Thermometer",methods:["setTemperatureUnit"],properties:["temperature","temperatureUnit"]},HumiditySensor:{name:"HumiditySensor",methods:[],properties:["humidity"]},Camera:{name:"Camera",methods:["getPictureOptions","takePicture"],properties:[]},Resolution:{name:"Resolution",methods:[],properties:["resolution"]},Microphone:{name:"Microphone",methods:["getAudioStream"],properties:[]},AudioVolumeControl:{name:"AudioVolumeControl",methods:["setAudioVolumes"],properties:["audioVolumes"]},Display:{name:"Display",methods:["startDisplay","stopDisplay"],properties:[]},VideoCamera:{name:"VideoCamera",methods:["getVideoStream","getVideoStreamOptions"],properties:[]},VideoCameraMask:{name:"VideoCameraMask",methods:["getPrivacyMasks","setPrivacyMasks"],properties:[]},VideoTextOverlays:{name:"VideoTextOverlays",methods:["getVideoTextOverlays","setVideoTextOverlay"],properties:[]},VideoRecorder:{name:"VideoRecorder",methods:["getRecordingStream","getRecordingStreamCurrentTime","getRecordingStreamOptions","getRecordingStreamThumbnail"],properties:["recordingActive"]},VideoRecorderManagement:{name:"VideoRecorderManagement",methods:["deleteRecordingStream","setRecordingActive"],properties:[]},PanTiltZoom:{name:"PanTiltZoom",methods:["ptzCommand"],properties:["ptzCapabilities"]},EventRecorder:{name:"EventRecorder",methods:["getRecordedEvents"],properties:[]},VideoClips:{name:"VideoClips",methods:["getVideoClip","getVideoClips","getVideoClipThumbnail","removeVideoClips"],properties:[]},VideoCameraConfiguration:{name:"VideoCameraConfiguration",methods:["setVideoStreamOptions"],properties:[]},Intercom:{name:"Intercom",methods:["startIntercom","stopIntercom"],properties:[]},Lock:{name:"Lock",methods:["lock","unlock"],properties:["lockState"]},PasswordStore:{name:"PasswordStore",methods:["addPassword","getPasswords","removePassword"],properties:[]},Scene:{name:"Scene",methods:["activate","deactivate","isReversible"],properties:[]},Entry:{name:"Entry",methods:["closeEntry","openEntry"],properties:[]},EntrySensor:{name:"EntrySensor",methods:[],properties:["entryOpen"]},DeviceProvider:{name:"DeviceProvider",methods:["getDevice","releaseDevice"],properties:[]},DeviceDiscovery:{name:"DeviceDiscovery",methods:["adoptDevice","discoverDevices"],properties:[]},DeviceCreator:{name:"DeviceCreator",methods:["createDevice","getCreateDeviceSettings"],properties:[]},Battery:{name:"Battery",methods:[],properties:["batteryLevel"]},Charger:{name:"Charger",methods:[],properties:["chargeState"]},Reboot:{name:"Reboot",methods:["reboot"],properties:[]},Refresh:{name:"Refresh",methods:["getRefreshFrequency","refresh"],properties:[]},MediaPlayer:{name:"MediaPlayer",methods:["getMediaStatus","load","seek","skipNext","skipPrevious"],properties:[]},Online:{name:"Online",methods:[],properties:["online"]},BufferConverter:{name:"BufferConverter",methods:["convert"],properties:["fromMimeType","toMimeType"]},MediaConverter:{name:"MediaConverter",methods:["convertMedia"],properties:["converters"]},Settings:{name:"Settings",methods:["getSettings","putSetting"],properties:[]},BinarySensor:{name:"BinarySensor",methods:[],properties:["binaryState"]},TamperSensor:{name:"TamperSensor",methods:[],properties:["tampered"]},Sleep:{name:"Sleep",methods:[],properties:["sleeping"]},PowerSensor:{name:"PowerSensor",methods:[],properties:["powerDetected"]},AudioSensor:{name:"AudioSensor",methods:[],properties:["audioDetected"]},MotionSensor:{name:"MotionSensor",methods:[],properties:["motionDetected"]},AmbientLightSensor:{name:"AmbientLightSensor",methods:[],properties:["ambientLight"]},OccupancySensor:{name:"OccupancySensor",methods:[],properties:["occupied"]},FloodSensor:{name:"FloodSensor",methods:[],properties:["flooded"]},UltravioletSensor:{name:"UltravioletSensor",methods:[],properties:["ultraviolet"]},LuminanceSensor:{name:"LuminanceSensor",methods:[],properties:["luminance"]},PositionSensor:{name:"PositionSensor",methods:[],properties:["position"]},SecuritySystem:{name:"SecuritySystem",methods:["armSecuritySystem","disarmSecuritySystem"],properties:["securitySystemState"]},PM10Sensor:{name:"PM10Sensor",methods:[],properties:["pm10Density"]},PM25Sensor:{name:"PM25Sensor",methods:[],properties:["pm25Density"]},VOCSensor:{name:"VOCSensor",methods:[],properties:["vocDensity"]},NOXSensor:{name:"NOXSensor",methods:[],properties:["noxDensity"]},CO2Sensor:{name:"CO2Sensor",methods:[],properties:["co2ppm"]},AirQualitySensor:{name:"AirQualitySensor",methods:[],properties:["airQuality"]},AirPurifier:{name:"AirPurifier",methods:["setAirPurifierState"],properties:["airPurifierState"]},FilterMaintenance:{name:"FilterMaintenance",methods:[],properties:["filterChangeIndication","filterLifeLevel"]},Readme:{name:"Readme",methods:["getReadmeMarkdown"],properties:[]},OauthClient:{name:"OauthClient",methods:["getOauthUrl","onOauthCallback"],properties:[]},MixinProvider:{name:"MixinProvider",methods:["canMixin","getMixin","releaseMixin"],properties:[]},HttpRequestHandler:{name:"HttpRequestHandler",methods:["onRequest"],properties:[]},EngineIOHandler:{name:"EngineIOHandler",methods:["onConnection"],properties:[]},PushHandler:{name:"PushHandler",methods:["onPush"],properties:[]},Program:{name:"Program",methods:["run"],properties:[]},Scriptable:{name:"Scriptable",methods:["eval","loadScripts","saveScript"],properties:[]},ClusterForkInterface:{name:"ClusterForkInterface",methods:["forkInterface"],properties:[]},ObjectDetector:{name:"ObjectDetector",methods:["getDetectionInput","getObjectTypes"],properties:[]},ObjectDetection:{name:"ObjectDetection",methods:["detectObjects","generateObjectDetections","getDetectionModel"],properties:[]},ObjectDetectionPreview:{name:"ObjectDetectionPreview",methods:[],properties:[]},ObjectDetectionGenerator:{name:"ObjectDetectionGenerator",methods:[],properties:[]},HumiditySetting:{name:"HumiditySetting",methods:["setHumidity"],properties:["humiditySetting"]},Fan:{name:"Fan",methods:["setFan"],properties:["fan"]},RTCSignalingChannel:{name:"RTCSignalingChannel",methods:["startRTCSignalingSession"],properties:[]},RTCSignalingClient:{name:"RTCSignalingClient",methods:["createRTCSignalingSession"],properties:[]},LauncherApplication:{name:"LauncherApplication",methods:[],properties:["applicationInfo"]},ScryptedUser:{name:"ScryptedUser",methods:["getScryptedUserAccessControl"],properties:[]},VideoFrameGenerator:{name:"VideoFrameGenerator",methods:["generateVideoFrames"],properties:[]},StreamService:{name:"StreamService",methods:["connectStream"],properties:[]},TTY:{name:"TTY",methods:[],properties:[]},TTYSettings:{name:"TTYSettings",methods:["getTTYSettings"],properties:[]},ChatCompletion:{name:"ChatCompletion",methods:["getChatCompletion","streamChatCompletion"],properties:["chatCompletionCapabilities"]},TextEmbedding:{name:"TextEmbedding",methods:["getTextEmbedding"],properties:[]},ImageEmbedding:{name:"ImageEmbedding",methods:["getImageEmbedding"],properties:[]},LLMTools:{name:"LLMTools",methods:["callLLMTool","getLLMTools"],properties:[]},ScryptedSystemDevice:{name:"ScryptedSystemDevice",methods:[],properties:["systemDevice"]},ScryptedDeviceCreator:{name:"ScryptedDeviceCreator",methods:[],properties:[]},ScryptedSettings:{name:"ScryptedSettings",methods:[],properties:[]}};var r;(function(c){c.Builtin="Builtin",c.Internal="Internal",c.Camera="Camera",c.Fan="Fan",c.Light="Light",c.Switch="Switch",c.Outlet="Outlet",c.Sensor="Sensor",c.Scene="Scene",c.Program="Program",c.Automation="Automation",c.Vacuum="Vacuum",c.Notifier="Notifier",c.Thermostat="Thermostat",c.Lock="Lock",c.PasswordControl="PasswordControl",c.Display="Display",c.SmartDisplay="SmartDisplay",c.Speaker="Speaker",c.SmartSpeaker="SmartSpeaker",c.RemoteDesktop="RemoteDesktop",c.Event="Event",c.Entry="Entry",c.Garage="Garage",c.DeviceProvider="DeviceProvider",c.DataSource="DataSource",c.API="API",c.Buttons="Buttons",c.Doorbell="Doorbell",c.Irrigation="Irrigation",c.Valve="Valve",c.Person="Person",c.SecuritySystem="SecuritySystem",c.WindowCovering="WindowCovering",c.Siren="Siren",c.AirPurifier="AirPurifier",c.Internet="Internet",c.Network="Network",c.Bridge="Bridge",c.LLM="LLM",c.Unknown="Unknown"})(r||(an.ScryptedDeviceType=r={}));var s;(function(c){c.Humidify="Humidify",c.Dehumidify="Dehumidify",c.Auto="Auto",c.Off="Off"})(s||(an.HumidityMode=s={}));var a;(function(c){c.Auto="Auto",c.Manual="Manual"})(a||(an.FanMode=a={}));var l;(function(c){c.C="C",c.F="F"})(l||(an.TemperatureUnit=l={}));var h;(function(c){c.Off="Off",c.Cool="Cool",c.Heat="Heat",c.HeatCool="HeatCool",c.Auto="Auto",c.FanOnly="FanOnly",c.Purifier="Purifier",c.Eco="Eco",c.Dry="Dry",c.On="On"})(h||(an.ThermostatMode=h={}));var m;(function(c){c.Absolute="Absolute",c.Relative="Relative",c.Continuous="Continuous",c.Preset="Preset",c.Home="Home"})(m||(an.PanTiltZoomMovement=m={}));var p;(function(c){c.Locked="Locked",c.Unlocked="Unlocked",c.Jammed="Jammed"})(p||(an.LockState=p={}));var x;(function(c){c.Trickle="trickle",c.Charging="charging",c.NotCharging="not-charging"})(x||(an.ChargeState=x={}));var b;(function(c){c.Inactive="Inactive",c.Idle="Idle",c.Active="Active",c.ActiveNightMode="ActiveNightMode"})(b||(an.AirPurifierStatus=b={}));var w;(function(c){c.Manual="Manual",c.Automatic="Automatic"})(w||(an.AirPurifierMode=w={}));var E;(function(c){c.Unknown="Unknown",c.Excellent="Excellent",c.Good="Good",c.Fair="Fair",c.Inferior="Inferior",c.Poor="Poor"})(E||(an.AirQuality=E={}));var M;(function(c){c.Disarmed="Disarmed",c.HomeArmed="HomeArmed",c.AwayArmed="AwayArmed",c.NightArmed="NightArmed"})(M||(an.SecuritySystemMode=M={}));var C;(function(c){c.Sensor="Sensor",c.Occupied="Occupied",c.Time="Time",c.Error="Error"})(C||(an.SecuritySystemObstruction=C={}));var S;(function(c){c.Idle="Idle",c.Playing="Playing",c.Paused="Paused",c.Buffering="Buffering"})(S||(an.MediaPlayerState=S={}));var _;(function(c){c.ScryptedDevice="ScryptedDevice",c.ScryptedPlugin="ScryptedPlugin",c.ScryptedPluginRuntime="ScryptedPluginRuntime",c.OnOff="OnOff",c.Brightness="Brightness",c.ColorSettingTemperature="ColorSettingTemperature",c.ColorSettingRgb="ColorSettingRgb",c.ColorSettingHsv="ColorSettingHsv",c.Buttons="Buttons",c.PressButtons="PressButtons",c.Sensors="Sensors",c.Notifier="Notifier",c.StartStop="StartStop",c.Pause="Pause",c.Dock="Dock",c.TemperatureSetting="TemperatureSetting",c.Thermometer="Thermometer",c.HumiditySensor="HumiditySensor",c.Camera="Camera",c.Resolution="Resolution",c.Microphone="Microphone",c.AudioVolumeControl="AudioVolumeControl",c.Display="Display",c.VideoCamera="VideoCamera",c.VideoCameraMask="VideoCameraMask",c.VideoTextOverlays="VideoTextOverlays",c.VideoRecorder="VideoRecorder",c.VideoRecorderManagement="VideoRecorderManagement",c.PanTiltZoom="PanTiltZoom",c.EventRecorder="EventRecorder",c.VideoClips="VideoClips",c.VideoCameraConfiguration="VideoCameraConfiguration",c.Intercom="Intercom",c.Lock="Lock",c.PasswordStore="PasswordStore",c.Scene="Scene",c.Entry="Entry",c.EntrySensor="EntrySensor",c.DeviceProvider="DeviceProvider",c.DeviceDiscovery="DeviceDiscovery",c.DeviceCreator="DeviceCreator",c.Battery="Battery",c.Charger="Charger",c.Reboot="Reboot",c.Refresh="Refresh",c.MediaPlayer="MediaPlayer",c.Online="Online",c.BufferConverter="BufferConverter",c.MediaConverter="MediaConverter",c.Settings="Settings",c.BinarySensor="BinarySensor",c.TamperSensor="TamperSensor",c.Sleep="Sleep",c.PowerSensor="PowerSensor",c.AudioSensor="AudioSensor",c.MotionSensor="MotionSensor",c.AmbientLightSensor="AmbientLightSensor",c.OccupancySensor="OccupancySensor",c.FloodSensor="FloodSensor",c.UltravioletSensor="UltravioletSensor",c.LuminanceSensor="LuminanceSensor",c.PositionSensor="PositionSensor",c.SecuritySystem="SecuritySystem",c.PM10Sensor="PM10Sensor",c.PM25Sensor="PM25Sensor",c.VOCSensor="VOCSensor",c.NOXSensor="NOXSensor",c.CO2Sensor="CO2Sensor",c.AirQualitySensor="AirQualitySensor",c.AirPurifier="AirPurifier",c.FilterMaintenance="FilterMaintenance",c.Readme="Readme",c.OauthClient="OauthClient",c.MixinProvider="MixinProvider",c.HttpRequestHandler="HttpRequestHandler",c.EngineIOHandler="EngineIOHandler",c.PushHandler="PushHandler",c.Program="Program",c.Scriptable="Scriptable",c.ClusterForkInterface="ClusterForkInterface",c.ObjectDetector="ObjectDetector",c.ObjectDetection="ObjectDetection",c.ObjectDetectionPreview="ObjectDetectionPreview",c.ObjectDetectionGenerator="ObjectDetectionGenerator",c.HumiditySetting="HumiditySetting",c.Fan="Fan",c.RTCSignalingChannel="RTCSignalingChannel",c.RTCSignalingClient="RTCSignalingClient",c.LauncherApplication="LauncherApplication",c.ScryptedUser="ScryptedUser",c.VideoFrameGenerator="VideoFrameGenerator",c.StreamService="StreamService",c.TTY="TTY",c.TTYSettings="TTYSettings",c.ChatCompletion="ChatCompletion",c.TextEmbedding="TextEmbedding",c.ImageEmbedding="ImageEmbedding",c.LLMTools="LLMTools",c.ScryptedSystemDevice="ScryptedSystemDevice",c.ScryptedDeviceCreator="ScryptedDeviceCreator",c.ScryptedSettings="ScryptedSettings"})(_||(an.ScryptedInterface=_={}));var N;return function(c){c.Url="text/x-uri",c.InsecureLocalUrl="text/x-insecure-local-uri",c.LocalUrl="text/x-local-uri",c.ServerId="text/x-server-id",c.PushEndpoint="text/x-push-endpoint",c.SchemePrefix="x-scrypted/x-scrypted-scheme-",c.MediaStreamUrl="text/x-media-url",c.MediaObject="x-scrypted/x-scrypted-media-object",c.RequestMediaObject="x-scrypted/x-scrypted-request-media-object",c.RequestMediaStream="x-scrypted/x-scrypted-request-stream",c.MediaStreamFeedback="x-scrypted/x-media-stream-feedback",c.FFmpegInput="x-scrypted/x-ffmpeg-input",c.FFmpegTranscodeStream="x-scrypted/x-ffmpeg-transcode-stream",c.RTCSignalingChannel="x-scrypted/x-scrypted-rtc-signaling-channel",c.RTCSignalingSession="x-scrypted/x-scrypted-rtc-signaling-session",c.RTCConnectionManagement="x-scrypted/x-scrypted-rtc-connection-management",c.Image="x-scrypted/x-scrypted-image"}(N||(an.ScryptedMimeTypes=N={})),an}var Ft=N$();const g5=e=>Symbol.iterator in e,v5=e=>"entries"in e,y5=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[s,a]of n)if(!Object.is(a,r.get(s)))return!1;return!0},O$=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),a=r.next();for(;!s.done&&!a.done;){if(!Object.is(s.value,a.value))return!1;s=n.next(),a=r.next()}return!!s.done&&!!a.done};function T$(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:g5(e)&&g5(t)?v5(e)&&v5(t)?y5(e,t):O$(e,t):y5({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function Ig(e){const t=Un.useRef(void 0);return n=>{const r=e(n);return T$(t.current,r)?t.current:t.current=r}}const Ap=()=>({motionDetected:!1,audioDetected:!1,audioLevelHighlightUntil:0,detectionHighlightUntil:0,objectsDetected:null}),cm=X9(e=>({byDevice:{},setMotion:(t,n)=>e(r=>({byDevice:{...r.byDevice,[t]:{...r.byDevice[t]??Ap(),motionDetected:n}}})),setAudio:(t,n)=>e(r=>({byDevice:{...r.byDevice,[t]:{...r.byDevice[t]??Ap(),audioDetected:n}}})),setAudioLevelHighlightUntil:(t,n)=>e(r=>({byDevice:{...r.byDevice,[t]:{...r.byDevice[t]??Ap(),audioLevelHighlightUntil:n}}})),setDetectionHighlightUntil:(t,n)=>e(r=>({byDevice:{...r.byDevice,[t]:{...r.byDevice[t]??Ap(),detectionHighlightUntil:n}}})),setObjectsDetected:(t,n)=>e(r=>({byDevice:{...r.byDevice,[t]:{...r.byDevice[t]??Ap(),objectsDetected:n}}}))}));function C4(e){return Te(Ig(t=>({...eR,...e?t.cameraHighlightSettings[e]:void 0})))}function K_(e){const t=C4(e),n=cm(b=>e?b.byDevice[e]:void 0),r=t.highlightOnMotion?(n==null?void 0:n.motionDetected)??!1:!1,s=(n==null?void 0:n.audioDetected)??!1,a=(n==null?void 0:n.audioLevelHighlightUntil)??0,l=(n==null?void 0:n.detectionHighlightUntil)??0,h=Date.now(),m=t.highlightAudioMode==="level"&&a>0&&h<a,p=t.highlightAudioMode==="sensor"?s:t.highlightAudioMode==="level"?m:!1,x=t.highlightOnDetection&&l>0&&h<l;return{motionDetected:r,audioDetected:p,detectionDetected:x}}function jn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function qm(e){const t=e+"CollectionProvider",[n,r]=cs(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=C=>{const{scope:S,children:_}=C,N=Un.useRef(null),c=Un.useRef(new Map).current;return f.jsx(s,{scope:S,itemMap:c,collectionRef:N,children:_})};l.displayName=t;const h=e+"CollectionSlot",m=tc(h),p=Un.forwardRef((C,S)=>{const{scope:_,children:N}=C,c=a(h,_),j=Qt(S,c.collectionRef);return f.jsx(m,{ref:j,children:N})});p.displayName=h;const x=e+"CollectionItemSlot",b="data-radix-collection-item",w=tc(x),E=Un.forwardRef((C,S)=>{const{scope:_,children:N,...c}=C,j=Un.useRef(null),D=Qt(S,j),B=a(x,_);return Un.useEffect(()=>(B.itemMap.set(j,{ref:j,...c}),()=>void B.itemMap.delete(j))),f.jsx(w,{[b]:"",ref:D,children:N})});E.displayName=x;function M(C){const S=a(e+"CollectionConsumer",C);return Un.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const c=Array.from(N.querySelectorAll(`[${b}]`));return Array.from(S.itemMap.values()).sort((B,T)=>c.indexOf(B.ref.current)-c.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:p,ItemSlot:E},M,r]}var D$=y.createContext(void 0);function Wm(e){const t=y.useContext(D$);return e||t||"ltr"}var A$="DismissableLayer",Fw="dismissableLayer.update",j$="dismissableLayer.pointerDownOutside",k$="dismissableLayer.focusOutside",x5,Q_=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Z_=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:h,...m}=e,p=y.useContext(Q_),[x,b]=y.useState(null),w=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=y.useState({}),M=Qt(t,T=>b(T)),C=Array.from(p.layers),[S]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),_=C.indexOf(S),N=x?C.indexOf(x):-1,c=p.layersWithOutsidePointerEventsDisabled.size>0,j=N>=_,D=B$(T=>{const A=T.target,H=[...p.branches].some(F=>F.contains(A));!j||H||(s==null||s(T),l==null||l(T),T.defaultPrevented||h==null||h())},w),B=U$(T=>{const A=T.target;[...p.branches].some(F=>F.contains(A))||(a==null||a(T),l==null||l(T),T.defaultPrevented||h==null||h())},w);return CR(T=>{N===p.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&h&&(T.preventDefault(),h()))},w),y.useEffect(()=>{if(x)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(x5=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(x)),p.layers.add(x),b5(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(w.body.style.pointerEvents=x5)}},[x,w,n,p]),y.useEffect(()=>()=>{x&&(p.layers.delete(x),p.layersWithOutsidePointerEventsDisabled.delete(x),b5())},[x,p]),y.useEffect(()=>{const T=()=>E({});return document.addEventListener(Fw,T),()=>document.removeEventListener(Fw,T)},[]),f.jsx(Lt.div,{...m,ref:M,style:{pointerEvents:c?j?"auto":"none":void 0,...e.style},onFocusCapture:jn(e.onFocusCapture,B.onFocusCapture),onBlurCapture:jn(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:jn(e.onPointerDownCapture,D.onPointerDownCapture)})});Z_.displayName=A$;var P$="DismissableLayerBranch",z$=y.forwardRef((e,t)=>{const n=y.useContext(Q_),r=y.useRef(null),s=Qt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),f.jsx(Lt.div,{...e,ref:s})});z$.displayName=P$;function B$(e,t=globalThis==null?void 0:globalThis.document){const n=Ci(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=h=>{if(h.target&&!r.current){let m=function(){J_(j$,n,p,{discrete:!0})};const p={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=m,t.addEventListener("click",s.current,{once:!0})):m()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function U$(e,t=globalThis==null?void 0:globalThis.document){const n=Ci(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&J_(k$,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function b5(){const e=new CustomEvent(Fw);document.dispatchEvent(e)}function J_(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ib(s,a):s.dispatchEvent(a)}var A2=0;function F$(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??L5()),document.body.insertAdjacentElement("beforeend",e[1]??L5()),A2++,()=>{A2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),A2--}},[])}function L5(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var E4="Popper",[e6,t6]=cs(E4),[H$,n6]=e6(E4),r6=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return f.jsx(H$,{scope:t,anchor:r,onAnchorChange:s,children:n})};r6.displayName=E4;var i6="PopperAnchor",s6=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=n6(i6,n),l=y.useRef(null),h=Qt(t,l),m=y.useRef(null);return y.useEffect(()=>{const p=m.current;m.current=(r==null?void 0:r.current)||l.current,p!==m.current&&a.onAnchorChange(m.current)}),r?null:f.jsx(Lt.div,{...s,ref:h})});s6.displayName=i6;var R4="PopperContent",[I$,$$]=e6(R4),o6=y.forwardRef((e,t)=>{var ye,ve,he,de,ke,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:M,...C}=e,S=n6(R4,n),[_,N]=y.useState(null),c=Qt(t,Ke=>N(Ke)),[j,D]=y.useState(null),B=x4(j),T=(B==null?void 0:B.width)??0,A=(B==null?void 0:B.height)??0,H=r+(a!=="center"?"-"+a:""),F=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},V=Array.isArray(p)?p:[p],ee=V.length>0,G={padding:F,boundary:V.filter(q$),altBoundary:ee},{refs:se,floatingStyles:Ce,placement:te,isPositioned:K,middlewareData:Z}=m_({strategy:"fixed",placement:H,whileElementsMounted:(...Ke)=>f_(...Ke,{animationFrame:E==="always"}),elements:{reference:S.anchor},middleware:[p_({mainAxis:s+A,alignmentAxis:l}),m&&g_({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?v_():void 0,...G}),m&&y_({...G}),x_({...G,apply:({elements:Ke,rects:ae,availableWidth:We,availableHeight:bt})=>{const{width:tt,height:mt}=ae.reference,Xe=Ke.floating.style;Xe.setProperty("--radix-popper-available-width",`${We}px`),Xe.setProperty("--radix-popper-available-height",`${bt}px`),Xe.setProperty("--radix-popper-anchor-width",`${tt}px`),Xe.setProperty("--radix-popper-anchor-height",`${mt}px`)}}),j&&L_({element:j,padding:h}),W$({arrowWidth:T,arrowHeight:A}),w&&b_({strategy:"referenceHidden",...G})]}),[oe,Y]=c6(te),ne=Ci(M);Wr(()=>{K&&(ne==null||ne())},[K,ne]);const X=(ye=Z.arrow)==null?void 0:ye.x,ue=(ve=Z.arrow)==null?void 0:ve.y,pe=((he=Z.arrow)==null?void 0:he.centerOffset)!==0,[Se,Re]=y.useState();return Wr(()=>{_&&Re(window.getComputedStyle(_).zIndex)},[_]),f.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ce,transform:K?Ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[(de=Z.transformOrigin)==null?void 0:de.x,(ke=Z.transformOrigin)==null?void 0:ke.y].join(" "),...((Ee=Z.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(I$,{scope:n,placedSide:oe,onArrowChange:D,arrowX:X,arrowY:ue,shouldHideArrow:pe,children:f.jsx(Lt.div,{"data-side":oe,"data-align":Y,...C,ref:c,style:{...C.style,animation:K?void 0:"none"}})})})});o6.displayName=R4;var a6="PopperArrow",V$={top:"bottom",right:"left",bottom:"top",left:"right"},l6=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=$$(a6,r),l=V$[a.placedSide];return f.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:f.jsx(S_,{...s,ref:n,style:{...s.style,display:"block"}})})});l6.displayName=a6;function q$(e){return e!==null}var W$=e=>({name:"transformOrigin",options:e,fn(t){var S,_,N;const{placement:n,rects:r,middlewareData:s}=t,l=((S=s.arrow)==null?void 0:S.centerOffset)!==0,h=l?0:e.arrowWidth,m=l?0:e.arrowHeight,[p,x]=c6(n),b={start:"0%",center:"50%",end:"100%"}[x],w=(((_=s.arrow)==null?void 0:_.x)??0)+h/2,E=(((N=s.arrow)==null?void 0:N.y)??0)+m/2;let M="",C="";return p==="bottom"?(M=l?b:`${w}px`,C=`${-m}px`):p==="top"?(M=l?b:`${w}px`,C=`${r.floating.height+m}px`):p==="right"?(M=`${-m}px`,C=l?b:`${E}px`):p==="left"&&(M=`${r.floating.width+m}px`,C=l?b:`${E}px`),{data:{x:M,y:C}}}});function c6(e){const[t,n="center"]=e.split("-");return[t,n]}var G$=r6,Y$=s6,X$=o6,K$=l6;function Q$(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var $g=e=>{const{present:t,children:n}=e,r=Z$(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Qt(r.ref,J$(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};$g.displayName="Presence";function Z$(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),a=y.useRef("none"),l=e?"mounted":"unmounted",[h,m]=Q$(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=ky(r.current);a.current=h==="mounted"?p:"none"},[h]),Wr(()=>{const p=r.current,x=s.current;if(x!==e){const w=a.current,E=ky(p);e?m("MOUNT"):E==="none"||(p==null?void 0:p.display)==="none"?m("UNMOUNT"):m(x&&w!==E?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,m]),Wr(()=>{if(t){let p;const x=t.ownerDocument.defaultView??window,b=E=>{const C=ky(r.current).includes(CSS.escape(E.animationName));if(E.target===t&&C&&(m("ANIMATION_END"),!s.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",p=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},w=E=>{E.target===t&&(a.current=ky(r.current))};return t.addEventListener("animationstart",w),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{x.clearTimeout(p),t.removeEventListener("animationstart",w),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(p=>{r.current=p?getComputedStyle(p):null,n(p)},[])}}function ky(e){return(e==null?void 0:e.animationName)||"none"}function J$(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var j2="rovingFocusGroup.onEntryFocus",eV={bubbles:!1,cancelable:!0},Vg="RovingFocusGroup",[Hw,u6,tV]=qm(Vg),[nV,d6]=cs(Vg,[tV]),[rV,iV]=nV(Vg),f6=y.forwardRef((e,t)=>f.jsx(Hw.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Hw.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(sV,{...e,ref:t})})}));f6.displayName=Vg;var sV=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...b}=e,w=y.useRef(null),E=Qt(t,w),M=Wm(a),[C,S]=dl({prop:l,defaultProp:h??null,onChange:m,caller:Vg}),[_,N]=y.useState(!1),c=Ci(p),j=u6(n),D=y.useRef(!1),[B,T]=y.useState(0);return y.useEffect(()=>{const A=w.current;if(A)return A.addEventListener(j2,c),()=>A.removeEventListener(j2,c)},[c]),f.jsx(rV,{scope:n,orientation:r,dir:M,loop:s,currentTabStopId:C,onItemFocus:y.useCallback(A=>S(A),[S]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:y.useCallback(()=>T(A=>A-1),[]),children:f.jsx(Lt.div,{tabIndex:_||B===0?-1:0,"data-orientation":r,...b,ref:E,style:{outline:"none",...e.style},onMouseDown:jn(e.onMouseDown,()=>{D.current=!0}),onFocus:jn(e.onFocus,A=>{const H=!D.current;if(A.target===A.currentTarget&&H&&!_){const F=new CustomEvent(j2,eV);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const V=j().filter(te=>te.focusable),ee=V.find(te=>te.active),G=V.find(te=>te.id===C),Ce=[ee,G,...V].filter(Boolean).map(te=>te.ref.current);p6(Ce,x)}}D.current=!1}),onBlur:jn(e.onBlur,()=>N(!1))})})}),h6="RovingFocusGroupItem",m6=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...h}=e,m=li(),p=a||m,x=iV(h6,n),b=x.currentTabStopId===p,w=u6(n),{onFocusableItemAdd:E,onFocusableItemRemove:M,currentTabStopId:C}=x;return y.useEffect(()=>{if(r)return E(),()=>M()},[r,E,M]),f.jsx(Hw.ItemSlot,{scope:n,id:p,focusable:r,active:s,children:f.jsx(Lt.span,{tabIndex:b?0:-1,"data-orientation":x.orientation,...h,ref:t,onMouseDown:jn(e.onMouseDown,S=>{r?x.onItemFocus(p):S.preventDefault()}),onFocus:jn(e.onFocus,()=>x.onItemFocus(p)),onKeyDown:jn(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){x.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=lV(S,x.orientation,x.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let c=w().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")c.reverse();else if(_==="prev"||_==="next"){_==="prev"&&c.reverse();const j=c.indexOf(S.currentTarget);c=x.loop?cV(c,j+1):c.slice(j+1)}setTimeout(()=>p6(c))}}),children:typeof l=="function"?l({isCurrentTabStop:b,hasTabStop:C!=null}):l})})});m6.displayName=h6;var oV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function lV(e,t,n){const r=aV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return oV[r]}function p6(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function cV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uV=f6,dV=m6,Iw=["Enter"," "],fV=["ArrowDown","PageUp","Home"],g6=["ArrowUp","PageDown","End"],hV=[...fV,...g6],mV={ltr:[...Iw,"ArrowRight"],rtl:[...Iw,"ArrowLeft"]},pV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qg="Menu",[mg,gV,vV]=qm(qg),[yf,v6]=cs(qg,[vV,t6,d6]),_b=t6(),y6=d6(),[yV,xf]=yf(qg),[xV,Wg]=yf(qg),x6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,h=_b(t),[m,p]=y.useState(null),x=y.useRef(!1),b=Ci(a),w=Wm(s);return y.useEffect(()=>{const E=()=>{x.current=!0,document.addEventListener("pointerdown",M,{capture:!0,once:!0}),document.addEventListener("pointermove",M,{capture:!0,once:!0})},M=()=>x.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",M,{capture:!0}),document.removeEventListener("pointermove",M,{capture:!0})}},[]),f.jsx(G$,{...h,children:f.jsx(yV,{scope:t,open:n,onOpenChange:b,content:m,onContentChange:p,children:f.jsx(xV,{scope:t,onClose:y.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:x,dir:w,modal:l,children:r})})})};x6.displayName=qg;var bV="MenuAnchor",_4=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=_b(n);return f.jsx(Y$,{...s,...r,ref:t})});_4.displayName=bV;var M4="MenuPortal",[LV,b6]=yf(M4,{forceMount:void 0}),L6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=xf(M4,t);return f.jsx(LV,{scope:t,forceMount:n,children:f.jsx($g,{present:n||a.open,children:f.jsx(vf,{asChild:!0,container:s,children:r})})})};L6.displayName=M4;var So="MenuContent",[wV,N4]=yf(So),w6=y.forwardRef((e,t)=>{const n=b6(So,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=xf(So,e.__scopeMenu),l=Wg(So,e.__scopeMenu);return f.jsx(mg.Provider,{scope:e.__scopeMenu,children:f.jsx($g,{present:r||a.open,children:f.jsx(mg.Slot,{scope:e.__scopeMenu,children:l.modal?f.jsx(SV,{...s,ref:t}):f.jsx(CV,{...s,ref:t})})})})}),SV=y.forwardRef((e,t)=>{const n=xf(So,e.__scopeMenu),r=y.useRef(null),s=Qt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return Bg(a)},[]),f.jsx(O4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:jn(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),CV=y.forwardRef((e,t)=>{const n=xf(So,e.__scopeMenu);return f.jsx(O4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),EV=tc("MenuContent.ScrollLock"),O4=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:w,onDismiss:E,disableOutsideScroll:M,...C}=e,S=xf(So,n),_=Wg(So,n),N=_b(n),c=y6(n),j=gV(n),[D,B]=y.useState(null),T=y.useRef(null),A=Qt(t,T,S.onContentChange),H=y.useRef(0),F=y.useRef(""),V=y.useRef(0),ee=y.useRef(null),G=y.useRef("right"),se=y.useRef(0),Ce=M?Im:y.Fragment,te=M?{as:EV,allowPinchZoom:!0}:void 0,K=oe=>{var ye,ve;const Y=F.current+oe,ne=j().filter(he=>!he.disabled),X=document.activeElement,ue=(ye=ne.find(he=>he.ref.current===X))==null?void 0:ye.textValue,pe=ne.map(he=>he.textValue),Se=zV(pe,Y,ue),Re=(ve=ne.find(he=>he.textValue===Se))==null?void 0:ve.ref.current;(function he(de){F.current=de,window.clearTimeout(H.current),de!==""&&(H.current=window.setTimeout(()=>he(""),1e3))})(Y),Re&&setTimeout(()=>Re.focus())};y.useEffect(()=>()=>window.clearTimeout(H.current),[]),F$();const Z=y.useCallback(oe=>{var ne,X;return G.current===((ne=ee.current)==null?void 0:ne.side)&&UV(oe,(X=ee.current)==null?void 0:X.area)},[]);return f.jsx(wV,{scope:n,searchRef:F,onItemEnter:y.useCallback(oe=>{Z(oe)&&oe.preventDefault()},[Z]),onItemLeave:y.useCallback(oe=>{var Y;Z(oe)||((Y=T.current)==null||Y.focus(),B(null))},[Z]),onTriggerLeave:y.useCallback(oe=>{Z(oe)&&oe.preventDefault()},[Z]),pointerGraceTimerRef:V,onPointerGraceIntentChange:y.useCallback(oe=>{ee.current=oe},[]),children:f.jsx(Ce,{...te,children:f.jsx(Hm,{asChild:!0,trapped:s,onMountAutoFocus:jn(a,oe=>{var Y;oe.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:f.jsx(Z_,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:f.jsx(uV,{asChild:!0,...c,dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:B,onEntryFocus:jn(m,oe=>{_.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(X$,{role:"menu","aria-orientation":"vertical","data-state":B6(S.open),"data-radix-menu-content":"",dir:_.dir,...N,...C,ref:A,style:{outline:"none",...C.style},onKeyDown:jn(C.onKeyDown,oe=>{const ne=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,X=oe.ctrlKey||oe.altKey||oe.metaKey,ue=oe.key.length===1;ne&&(oe.key==="Tab"&&oe.preventDefault(),!X&&ue&&K(oe.key));const pe=T.current;if(oe.target!==pe||!hV.includes(oe.key))return;oe.preventDefault();const Re=j().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);g6.includes(oe.key)&&Re.reverse(),kV(Re)}),onBlur:jn(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(H.current),F.current="")}),onPointerMove:jn(e.onPointerMove,pg(oe=>{const Y=oe.target,ne=se.current!==oe.clientX;if(oe.currentTarget.contains(Y)&&ne){const X=oe.clientX>se.current?"right":"left";G.current=X,se.current=oe.clientX}}))})})})})})})});w6.displayName=So;var RV="MenuGroup",T4=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{role:"group",...r,ref:t})});T4.displayName=RV;var _V="MenuLabel",S6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{...r,ref:t})});S6.displayName=_V;var wx="MenuItem",w5="menu.itemSelect",Mb=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=y.useRef(null),l=Wg(wx,e.__scopeMenu),h=N4(wx,e.__scopeMenu),m=Qt(t,a),p=y.useRef(!1),x=()=>{const b=a.current;if(!n&&b){const w=new CustomEvent(w5,{bubbles:!0,cancelable:!0});b.addEventListener(w5,E=>r==null?void 0:r(E),{once:!0}),ib(b,w),w.defaultPrevented?p.current=!1:l.onClose()}};return f.jsx(C6,{...s,ref:m,disabled:n,onClick:jn(e.onClick,x),onPointerDown:b=>{var w;(w=e.onPointerDown)==null||w.call(e,b),p.current=!0},onPointerUp:jn(e.onPointerUp,b=>{var w;p.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:jn(e.onKeyDown,b=>{const w=h.searchRef.current!=="";n||w&&b.key===" "||Iw.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})});Mb.displayName=wx;var C6=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=N4(wx,n),h=y6(n),m=y.useRef(null),p=Qt(t,m),[x,b]=y.useState(!1),[w,E]=y.useState("");return y.useEffect(()=>{const M=m.current;M&&E((M.textContent??"").trim())},[a.children]),f.jsx(mg.ItemSlot,{scope:n,disabled:r,textValue:s??w,children:f.jsx(dV,{asChild:!0,...h,focusable:!r,children:f.jsx(Lt.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:p,onPointerMove:jn(e.onPointerMove,pg(M=>{r?l.onItemLeave(M):(l.onItemEnter(M),M.defaultPrevented||M.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:jn(e.onPointerLeave,pg(M=>l.onItemLeave(M))),onFocus:jn(e.onFocus,()=>b(!0)),onBlur:jn(e.onBlur,()=>b(!1))})})})}),MV="MenuCheckboxItem",E6=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return f.jsx(O6,{scope:e.__scopeMenu,checked:n,children:f.jsx(Mb,{role:"menuitemcheckbox","aria-checked":Sx(n)?"mixed":n,...s,ref:t,"data-state":A4(n),onSelect:jn(s.onSelect,()=>r==null?void 0:r(Sx(n)?!0:!n),{checkForDefaultPrevented:!1})})})});E6.displayName=MV;var R6="MenuRadioGroup",[NV,OV]=yf(R6,{value:void 0,onValueChange:()=>{}}),_6=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Ci(r);return f.jsx(NV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:f.jsx(T4,{...s,ref:t})})});_6.displayName=R6;var M6="MenuRadioItem",N6=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=OV(M6,e.__scopeMenu),a=n===s.value;return f.jsx(O6,{scope:e.__scopeMenu,checked:a,children:f.jsx(Mb,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":A4(a),onSelect:jn(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});N6.displayName=M6;var D4="MenuItemIndicator",[O6,TV]=yf(D4,{checked:!1}),T6=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=TV(D4,n);return f.jsx($g,{present:r||Sx(a.checked)||a.checked===!0,children:f.jsx(Lt.span,{...s,ref:t,"data-state":A4(a.checked)})})});T6.displayName=D4;var DV="MenuSeparator",D6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});D6.displayName=DV;var AV="MenuArrow",A6=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=_b(n);return f.jsx(K$,{...s,...r,ref:t})});A6.displayName=AV;var jV="MenuSub",[Hse,j6]=yf(jV),Yp="MenuSubTrigger",k6=y.forwardRef((e,t)=>{const n=xf(Yp,e.__scopeMenu),r=Wg(Yp,e.__scopeMenu),s=j6(Yp,e.__scopeMenu),a=N4(Yp,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:m}=a,p={__scopeMenu:e.__scopeMenu},x=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>x,[x]),y.useEffect(()=>{const b=h.current;return()=>{window.clearTimeout(b),m(null)}},[h,m]),f.jsx(_4,{asChild:!0,...p,children:f.jsx(C6,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":B6(n.open),...e,ref:cl(t,s.onTriggerChange),onClick:b=>{var w;(w=e.onClick)==null||w.call(e,b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:jn(e.onPointerMove,pg(b=>{a.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:jn(e.onPointerLeave,pg(b=>{var E,M;x();const w=(E=n.content)==null?void 0:E.getBoundingClientRect();if(w){const C=(M=n.content)==null?void 0:M.dataset.side,S=C==="right",_=S?-5:5,N=w[S?"left":"right"],c=w[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:b.clientX+_,y:b.clientY},{x:N,y:w.top},{x:c,y:w.top},{x:c,y:w.bottom},{x:N,y:w.bottom}],side:C}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(b),b.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:jn(e.onKeyDown,b=>{var E;const w=a.searchRef.current!=="";e.disabled||w&&b.key===" "||mV[r.dir].includes(b.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),b.preventDefault())})})})});k6.displayName=Yp;var P6="MenuSubContent",z6=y.forwardRef((e,t)=>{const n=b6(So,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=xf(So,e.__scopeMenu),l=Wg(So,e.__scopeMenu),h=j6(P6,e.__scopeMenu),m=y.useRef(null),p=Qt(t,m);return f.jsx(mg.Provider,{scope:e.__scopeMenu,children:f.jsx($g,{present:r||a.open,children:f.jsx(mg.Slot,{scope:e.__scopeMenu,children:f.jsx(O4,{id:h.contentId,"aria-labelledby":h.triggerId,...s,ref:p,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{var b;l.isUsingKeyboardRef.current&&((b=m.current)==null||b.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:jn(e.onFocusOutside,x=>{x.target!==h.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:jn(e.onEscapeKeyDown,x=>{l.onClose(),x.preventDefault()}),onKeyDown:jn(e.onKeyDown,x=>{var E;const b=x.currentTarget.contains(x.target),w=pV[l.dir].includes(x.key);b&&w&&(a.onOpenChange(!1),(E=h.trigger)==null||E.focus(),x.preventDefault())})})})})})});z6.displayName=P6;function B6(e){return e?"open":"closed"}function Sx(e){return e==="indeterminate"}function A4(e){return Sx(e)?"indeterminate":e?"checked":"unchecked"}function kV(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function PV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zV(e,t,n){const s=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=PV(e,Math.max(a,0));s.length===1&&(l=l.filter(p=>p!==n));const m=l.find(p=>p.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function BV(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const h=t[a],m=t[l],p=h.x,x=h.y,b=m.x,w=m.y;x>r!=w>r&&n<(b-p)*(r-x)/(w-x)+p&&(s=!s)}return s}function UV(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return BV(n,t)}function pg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var FV=x6,HV=_4,IV=L6,$V=w6,VV=T4,qV=S6,WV=Mb,GV=E6,YV=_6,XV=N6,KV=T6,QV=D6,ZV=A6,JV=k6,eq=z6,j4="ContextMenu",[tq,Ise]=cs(j4,[v6]),us=v6(),[nq,U6]=tq(j4),F6=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:a=!0}=e,[l,h]=y.useState(!1),m=us(t),p=Ci(r),x=y.useCallback(b=>{h(b),p(b)},[p]);return f.jsx(nq,{scope:t,open:l,onOpenChange:x,modal:a,children:f.jsx(FV,{...m,dir:s,open:l,onOpenChange:x,modal:a,children:n})})};F6.displayName=j4;var H6="ContextMenuTrigger",I6=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,a=U6(H6,n),l=us(n),h=y.useRef({x:0,y:0}),m=y.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...h.current})}),p=y.useRef(0),x=y.useCallback(()=>window.clearTimeout(p.current),[]),b=w=>{h.current={x:w.clientX,y:w.clientY},a.onOpenChange(!0)};return y.useEffect(()=>x,[x]),y.useEffect(()=>void(r&&x()),[r,x]),f.jsxs(f.Fragment,{children:[f.jsx(HV,{...l,virtualRef:m}),f.jsx(Lt.span,{"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:jn(e.onContextMenu,w=>{x(),b(w),w.preventDefault()}),onPointerDown:r?e.onPointerDown:jn(e.onPointerDown,Py(w=>{x(),p.current=window.setTimeout(()=>b(w),700)})),onPointerMove:r?e.onPointerMove:jn(e.onPointerMove,Py(x)),onPointerCancel:r?e.onPointerCancel:jn(e.onPointerCancel,Py(x)),onPointerUp:r?e.onPointerUp:jn(e.onPointerUp,Py(x))})]})});I6.displayName=H6;var rq="ContextMenuPortal",$6=e=>{const{__scopeContextMenu:t,...n}=e,r=us(t);return f.jsx(IV,{...r,...n})};$6.displayName=rq;var V6="ContextMenuContent",q6=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=U6(V6,n),a=us(n),l=y.useRef(!1);return f.jsx($V,{...a,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:h=>{var m;(m=e.onCloseAutoFocus)==null||m.call(e,h),!h.defaultPrevented&&l.current&&h.preventDefault(),l.current=!1},onInteractOutside:h=>{var m;(m=e.onInteractOutside)==null||m.call(e,h),!h.defaultPrevented&&!s.modal&&(l.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});q6.displayName=V6;var iq="ContextMenuGroup",sq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(VV,{...s,...r,ref:t})});sq.displayName=iq;var oq="ContextMenuLabel",aq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(qV,{...s,...r,ref:t})});aq.displayName=oq;var lq="ContextMenuItem",W6=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(WV,{...s,...r,ref:t})});W6.displayName=lq;var cq="ContextMenuCheckboxItem",uq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(GV,{...s,...r,ref:t})});uq.displayName=cq;var dq="ContextMenuRadioGroup",fq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(YV,{...s,...r,ref:t})});fq.displayName=dq;var hq="ContextMenuRadioItem",mq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(XV,{...s,...r,ref:t})});mq.displayName=hq;var pq="ContextMenuItemIndicator",gq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(KV,{...s,...r,ref:t})});gq.displayName=pq;var vq="ContextMenuSeparator",yq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(QV,{...s,...r,ref:t})});yq.displayName=vq;var xq="ContextMenuArrow",bq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(ZV,{...s,...r,ref:t})});bq.displayName=xq;var Lq="ContextMenuSubTrigger",wq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(JV,{...s,...r,ref:t})});wq.displayName=Lq;var Sq="ContextMenuSubContent",Cq=y.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=us(n);return f.jsx(eq,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cq.displayName=Sq;function Py(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var Eq=F6,Rq=I6,_q=$6,Mq=q6,Nq=W6;function Oq({...e}){return f.jsx(Eq,{"data-slot":"context-menu",...e})}function Tq({...e}){return f.jsx(Rq,{"data-slot":"context-menu-trigger",...e})}function Dq({className:e,sideOffset:t=4,...n}){return f.jsx(_q,{children:f.jsx(Mq,{"data-slot":"context-menu-content",sideOffset:t,className:He("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...n})})}function Aq({className:e,inset:t,variant:n="default",...r}){return f.jsx(Nq,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:He("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function G6({camera:e,dataUrl:t,showSnapshot:n,lightOnMotion:r,sirenOnMotion:s,isRecording:a,effectiveCardWidth:l,onSelect:h}){const m=qi(),p=Te(Ig(H=>fb(H,e.id)));K_(e.id);const x=y.useMemo(()=>m==null?void 0:m.systemManager.getDeviceById(e.id),[m,e.id]),b=y.useMemo(()=>{var H;return(H=x==null?void 0:x.interfaces)!=null&&H.includes(Ft.ScryptedInterface.Camera)?x:null},[x]),w=y.useRef(!1);y.useEffect(()=>{t&&(w.current=!0)},[t]);const[E,M]=y.useState({});y.useEffect(()=>{if(!(x!=null&&x.interfaces)){M({});return}const H=x.interfaces,F={};H.includes(Ft.ScryptedInterface.Battery)&&typeof x.batteryLevel=="number"&&(F.batteryLevel=x.batteryLevel);const V=H.includes(Ft.ScryptedInterface.Battery),ee=H.includes(Ft.ScryptedInterface.Charger);if(V||ee){const G=x.chargeState,se=G==="charging"||G==="trickle",Ce=G==="not-charging";se?F.chargingState=!0:Ce&&(F.chargingState=!1),F.chargeStatus=G??(se?"charging":Ce?"not-charging":void 0)}H.includes(Ft.ScryptedInterface.Sleep)&&(F.sleeping=!!x.sleeping),H.includes(Ft.ScryptedInterface.Online)&&(F.online=!!x.online),H.includes(Ft.ScryptedInterface.VideoRecorder)&&(F.recording=!!x.recordingActive),M(F)},[x]);const C=E,S=Math.min(20,Math.max(6,Math.round(l*.04))),_=`clamp(0.35rem, ${l*.038}px, 0.8rem)`,N=Math.round(S*.4),c=C.batteryLevel!=null,j=p.cameraCardShowBattery&&c,D=p.cameraCardShowLight&&r||p.cameraCardShowSleep&&C.sleeping===!0||C.online===!1,[B,T]=y.useState(!1),A=y.useCallback(async()=>{if(!m||!b||B)return;const H=e.name.replace(/[/\\:*?"<>|]/g,"_").trim()||"camera";T(!0);try{const F=await b.takePicture({bulkRequest:!1,reason:"event",picture:{width:3840,height:2160},timeout:15e3});if(!F){console.error("takePicture returned no media");return}const V=await m.mediaManager.convertMediaObjectToBuffer(F,"image/jpeg");if(!(V!=null&&V.length)){console.error("convertMediaObjectToBuffer returned empty");return}const ee=new Blob([V],{type:"image/jpeg"}),G=URL.createObjectURL(ee),se=document.createElement("a");se.href=G,se.download=`${H}-snapshot.jpg`,se.click(),URL.revokeObjectURL(G)}catch(F){console.error("Download snapshot failed",F)}finally{T(!1)}},[m,b,e.name,B]);return f.jsxs(Oq,{children:[f.jsx(Tq,{asChild:!0,children:f.jsxs("button",{type:"button",className:"group relative overflow-hidden bg-muted aspect-video min-h-0 w-full text-left cursor-pointer border-0 p-0",onClick:h,children:[t?f.jsx("img",{src:t,alt:e.name,className:"h-full w-full object-cover transition-transform duration-200 group-hover:scale-105"}):n&&!w.current?f.jsx("div",{className:"flex h-full w-full items-center justify-center bg-muted/90",children:f.jsx(i3,{className:"h-8 w-8 animate-spin text-muted-foreground/60","aria-hidden":!0})}):f.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-1 bg-muted/90",children:[f.jsx(pf,{className:"h-12 w-12 text-muted-foreground/40"}),!n&&f.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"Snapshots disabled"})]}),f.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-transparent to-black/60 pointer-events-none"}),p.cameraCardShowName&&f.jsx("div",{className:"absolute top-0 left-0 z-10 max-w-[75%] p-2.5 pointer-events-none",children:f.jsx("p",{className:"font-semibold text-white break-words leading-snug",style:{fontSize:`clamp(0.45rem, ${l*.042}px, 0.7rem)`,textShadow:"0 1px 2px rgba(0,0,0,0.8), 0 0 12px rgba(0,0,0,0.6)"},children:e.name})}),j&&f.jsxs("div",{className:"absolute top-0 right-0 flex items-center gap-0.5 sm:gap-1 rounded-md bg-neutral-900/95 shadow-md pointer-events-none",style:{fontSize:_,padding:`${N*.5}px ${N}px`},title:C.chargingState===!0?`Battery ${C.batteryLevel}% (charging)`:`Battery ${C.batteryLevel}%`,children:[C.chargingState===!0?f.jsx(J8,{size:S,className:He("shrink-0","text-green-400")}):f.jsx(U9,{size:S,className:"shrink-0 text-white"}),f.jsxs("span",{className:"text-white",children:[C.batteryLevel,"%"]})]}),a&&f.jsx("span",{className:"absolute bottom-0 left-0 m-1 inline-block size-1 shrink-0 rounded-full bg-red-500 drop-shadow-sm pointer-events-none",title:"Recording","aria-label":"Recording"}),D&&f.jsxs("div",{className:"absolute bottom-0 right-0 flex items-center gap-0.5 sm:gap-1 rounded-md bg-neutral-900/95 shadow-md group-hover:bg-neutral-800/95 transition-colors pointer-events-none",style:{fontSize:_,padding:`${N*.5}px ${N}px`},children:[p.cameraCardShowLight&&r&&f.jsx("span",{className:"inline-flex items-center text-amber-400 drop-shadow-sm",title:"Light on motion",children:f.jsx(H9,{size:S,className:"shrink-0"})}),p.cameraCardShowSleep&&C.sleeping===!0&&f.jsx("span",{className:"inline-flex items-center text-slate-300 drop-shadow-sm",title:"Sleeping",children:f.jsx(nb,{size:S,className:"shrink-0"})}),C.online===!1&&f.jsx("span",{className:"inline-flex items-center text-orange-400 drop-shadow-sm",title:"Offline",children:f.jsx(m3,{size:S,className:"shrink-0"})})]})]})}),f.jsx(Dq,{className:"w-48",children:f.jsxs(Aq,{disabled:!b||B,onClick:()=>void A(),children:[f.jsx(aj,{className:"size-4"}),B?"Downloading…":"Download snapshot"]})})]})}function jq(e){return Object.prototype.toString.call(e)==="[object Object]"}function S5(e){return jq(e)||Array.isArray(e)}function kq(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function k4(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),a=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==a?!1:n.every(l=>{const h=e[l],m=t[l];return typeof h=="function"?`${h}`==`${m}`:!S5(h)||!S5(m)?h===m:k4(h,m)})}function C5(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function Pq(e,t){if(e.length!==t.length)return!1;const n=C5(e),r=C5(t);return n.every((s,a)=>{const l=r[a];return k4(s,l)})}function P4(e){return typeof e=="number"}function $w(e){return typeof e=="string"}function Nb(e){return typeof e=="boolean"}function E5(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ar(e){return Math.abs(e)}function z4(e){return Math.sign(e)}function tg(e,t){return Ar(e-t)}function zq(e,t){if(e===0||t===0||Ar(e)<=Ar(t))return 0;const n=tg(Ar(e),Ar(t));return Ar(n/e)}function Bq(e){return Math.round(e*100)/100}function gg(e){return vg(e).map(Number)}function aa(e){return e[Gg(e)]}function Gg(e){return Math.max(0,e.length-1)}function B4(e,t){return t===Gg(e)}function R5(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function vg(e){return Object.keys(e)}function Y6(e,t){return[e,t].reduce((n,r)=>(vg(r).forEach(s=>{const a=n[s],l=r[s],h=E5(a)&&E5(l);n[s]=h?Y6(a,l):l}),n),{})}function Vw(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Uq(e,t){const n={start:r,center:s,end:a};function r(){return 0}function s(m){return a(m)/2}function a(m){return t-m}function l(m,p){return $w(e)?n[e](m):e(t,m,p)}return{measure:l}}function yg(){let e=[];function t(s,a,l,h={passive:!0}){let m;if("addEventListener"in s)s.addEventListener(a,l,h),m=()=>s.removeEventListener(a,l,h);else{const p=s;p.addListener(l),m=()=>p.removeListener(l)}return e.push(m),r}function n(){e=e.filter(s=>s())}const r={add:t,clear:n};return r}function Fq(e,t,n,r){const s=yg(),a=1e3/60;let l=null,h=0,m=0;function p(){s.add(e,"visibilitychange",()=>{e.hidden&&M()})}function x(){E(),s.clear()}function b(S){if(!m)return;l||(l=S,n(),n());const _=S-l;for(l=S,h+=_;h>=a;)n(),h-=a;const N=h/a;r(N),m&&(m=t.requestAnimationFrame(b))}function w(){m||(m=t.requestAnimationFrame(b))}function E(){t.cancelAnimationFrame(m),l=null,h=0,m=0}function M(){l=null,h=0}return{init:p,destroy:x,start:w,stop:E,update:n,render:r}}function Hq(e,t){const n=t==="rtl",r=e==="y",s=r?"y":"x",a=r?"x":"y",l=!r&&n?-1:1,h=x(),m=b();function p(M){const{height:C,width:S}=M;return r?C:S}function x(){return r?"top":n?"right":"left"}function b(){return r?"bottom":n?"left":"right"}function w(M){return M*l}return{scroll:s,cross:a,startEdge:h,endEdge:m,measureSize:p,direction:w}}function af(e=0,t=0){const n=Ar(e-t);function r(p){return p<e}function s(p){return p>t}function a(p){return r(p)||s(p)}function l(p){return a(p)?r(p)?e:t:p}function h(p){return n?p-n*Math.ceil((p-t)/n):p}return{length:n,max:t,min:e,constrain:l,reachedAny:a,reachedMax:s,reachedMin:r,removeOffset:h}}function X6(e,t,n){const{constrain:r}=af(0,e),s=e+1;let a=l(t);function l(w){return n?Ar((s+w)%s):r(w)}function h(){return a}function m(w){return a=l(w),b}function p(w){return x().set(h()+w)}function x(){return X6(e,h(),n)}const b={get:h,set:m,add:p,clone:x};return b}function Iq(e,t,n,r,s,a,l,h,m,p,x,b,w,E,M,C,S,_,N){const{cross:c,direction:j}=e,D=["INPUT","SELECT","TEXTAREA"],B={passive:!1},T=yg(),A=yg(),H=af(50,225).constrain(E.measure(20)),F={mouse:300,touch:400},V={mouse:500,touch:600},ee=M?43:25;let G=!1,se=0,Ce=0,te=!1,K=!1,Z=!1,oe=!1;function Y(Ee){if(!N)return;function Ke(We){(Nb(N)||N(Ee,We))&&Re(We)}const ae=t;T.add(ae,"dragstart",We=>We.preventDefault(),B).add(ae,"touchmove",()=>{},B).add(ae,"touchend",()=>{}).add(ae,"touchstart",Ke).add(ae,"mousedown",Ke).add(ae,"touchcancel",ve).add(ae,"contextmenu",ve).add(ae,"click",he,!0)}function ne(){T.clear(),A.clear()}function X(){const Ee=oe?n:t;A.add(Ee,"touchmove",ye,B).add(Ee,"touchend",ve).add(Ee,"mousemove",ye,B).add(Ee,"mouseup",ve)}function ue(Ee){const Ke=Ee.nodeName||"";return D.includes(Ke)}function pe(){return(M?V:F)[oe?"mouse":"touch"]}function Se(Ee,Ke){const ae=b.add(z4(Ee)*-1),We=x.byDistance(Ee,!M).distance;return M||Ar(Ee)<H?We:S&&Ke?We*.5:x.byIndex(ae.get(),0).distance}function Re(Ee){const Ke=Vw(Ee,r);oe=Ke,Z=M&&Ke&&!Ee.buttons&&G,G=tg(s.get(),l.get())>=2,!(Ke&&Ee.button!==0)&&(ue(Ee.target)||(te=!0,a.pointerDown(Ee),p.useFriction(0).useDuration(0),s.set(l),X(),se=a.readPoint(Ee),Ce=a.readPoint(Ee,c),w.emit("pointerDown")))}function ye(Ee){if(!Vw(Ee,r)&&Ee.touches.length>=2)return ve(Ee);const ae=a.readPoint(Ee),We=a.readPoint(Ee,c),bt=tg(ae,se),tt=tg(We,Ce);if(!K&&!oe&&(!Ee.cancelable||(K=bt>tt,!K)))return ve(Ee);const mt=a.pointerMove(Ee);bt>C&&(Z=!0),p.useFriction(.3).useDuration(.75),h.start(),s.add(j(mt)),Ee.preventDefault()}function ve(Ee){const ae=x.byDistance(0,!1).index!==b.get(),We=a.pointerUp(Ee)*pe(),bt=Se(j(We),ae),tt=zq(We,bt),mt=ee-10*tt,Xe=_+tt/50;K=!1,te=!1,A.clear(),p.useDuration(mt).useFriction(Xe),m.distance(bt,!M),oe=!1,w.emit("pointerUp")}function he(Ee){Z&&(Ee.stopPropagation(),Ee.preventDefault(),Z=!1)}function de(){return te}return{init:Y,destroy:ne,pointerDown:de}}function $q(e,t){let r,s;function a(b){return b.timeStamp}function l(b,w){const M=`client${(w||e.scroll)==="x"?"X":"Y"}`;return(Vw(b,t)?b:b.touches[0])[M]}function h(b){return r=b,s=b,l(b)}function m(b){const w=l(b)-l(s),E=a(b)-a(r)>170;return s=b,E&&(r=b),w}function p(b){if(!r||!s)return 0;const w=l(s)-l(r),E=a(b)-a(r),M=a(b)-a(s)>170,C=w/E;return E&&!M&&Ar(C)>.1?C:0}return{pointerDown:h,pointerMove:m,pointerUp:p,readPoint:l}}function Vq(){function e(n){const{offsetTop:r,offsetLeft:s,offsetWidth:a,offsetHeight:l}=n;return{top:r,right:s+a,bottom:r+l,left:s,width:a,height:l}}return{measure:e}}function qq(e){function t(r){return e*(r/100)}return{measure:t}}function Wq(e,t,n,r,s,a,l){const h=[e].concat(r);let m,p,x=[],b=!1;function w(S){return s.measureSize(l.measure(S))}function E(S){if(!a)return;p=w(e),x=r.map(w);function _(N){for(const c of N){if(b)return;const j=c.target===e,D=r.indexOf(c.target),B=j?p:x[D],T=w(j?e:r[D]);if(Ar(T-B)>=.5){S.reInit(),t.emit("resize");break}}}m=new ResizeObserver(N=>{(Nb(a)||a(S,N))&&_(N)}),n.requestAnimationFrame(()=>{h.forEach(N=>m.observe(N))})}function M(){b=!0,m&&m.disconnect()}return{init:E,destroy:M}}function Gq(e,t,n,r,s,a){let l=0,h=0,m=s,p=a,x=e.get(),b=0;function w(){const B=r.get()-e.get(),T=!m;let A=0;return T?(l=0,n.set(r),e.set(r),A=B):(n.set(e),l+=B/m,l*=p,x+=l,e.add(l),A=x-b),h=z4(A),b=x,D}function E(){const B=r.get()-t.get();return Ar(B)<.001}function M(){return m}function C(){return h}function S(){return l}function _(){return c(s)}function N(){return j(a)}function c(B){return m=B,D}function j(B){return p=B,D}const D={direction:C,duration:M,velocity:S,seek:w,settled:E,useBaseFriction:N,useBaseDuration:_,useFriction:j,useDuration:c};return D}function Yq(e,t,n,r,s){const a=s.measure(10),l=s.measure(50),h=af(.1,.99);let m=!1;function p(){return!(m||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function x(E){if(!p())return;const M=e.reachedMin(t.get())?"min":"max",C=Ar(e[M]-t.get()),S=n.get()-t.get(),_=h.constrain(C/l);n.subtract(S*_),!E&&Ar(S)<a&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function b(E){m=!E}return{shouldConstrain:p,constrain:x,toggleActive:b}}function Xq(e,t,n,r,s){const a=af(-t+e,0),l=b(),h=x(),m=w();function p(M,C){return tg(M,C)<=1}function x(){const M=l[0],C=aa(l),S=l.lastIndexOf(M),_=l.indexOf(C)+1;return af(S,_)}function b(){return n.map((M,C)=>{const{min:S,max:_}=a,N=a.constrain(M),c=!C,j=B4(n,C);return c?_:j||p(S,N)?S:p(_,N)?_:N}).map(M=>parseFloat(M.toFixed(3)))}function w(){if(t<=e+s)return[a.max];if(r==="keepSnaps")return l;const{min:M,max:C}=h;return l.slice(M,C)}return{snapsContained:m,scrollContainLimit:h}}function Kq(e,t,n){const r=t[0],s=n?r-e:aa(t);return{limit:af(s,r)}}function Qq(e,t,n,r){const a=t.min+.1,l=t.max+.1,{reachedMin:h,reachedMax:m}=af(a,l);function p(w){return w===1?m(n.get()):w===-1?h(n.get()):!1}function x(w){if(!p(w))return;const E=e*(w*-1);r.forEach(M=>M.add(E))}return{loop:x}}function Zq(e){const{max:t,length:n}=e;function r(a){const l=a-t;return n?l/-n:0}return{get:r}}function Jq(e,t,n,r,s){const{startEdge:a,endEdge:l}=e,{groupSlides:h}=s,m=b().map(t.measure),p=w(),x=E();function b(){return h(r).map(C=>aa(C)[l]-C[0][a]).map(Ar)}function w(){return r.map(C=>n[a]-C[a]).map(C=>-Ar(C))}function E(){return h(p).map(C=>C[0]).map((C,S)=>C+m[S])}return{snaps:p,snapsAligned:x}}function eW(e,t,n,r,s,a){const{groupSlides:l}=s,{min:h,max:m}=r,p=x();function x(){const w=l(a),E=!e||t==="keepSnaps";return n.length===1?[a]:E?w:w.slice(h,m).map((M,C,S)=>{const _=!C,N=B4(S,C);if(_){const c=aa(S[0])+1;return R5(c)}if(N){const c=Gg(a)-aa(S)[0]+1;return R5(c,aa(S)[0])}return M})}return{slideRegistry:p}}function tW(e,t,n,r,s){const{reachedAny:a,removeOffset:l,constrain:h}=r;function m(M){return M.concat().sort((C,S)=>Ar(C)-Ar(S))[0]}function p(M){const C=e?l(M):h(M),S=t.map((N,c)=>({diff:x(N-C,0),index:c})).sort((N,c)=>Ar(N.diff)-Ar(c.diff)),{index:_}=S[0];return{index:_,distance:C}}function x(M,C){const S=[M,M+n,M-n];if(!e)return M;if(!C)return m(S);const _=S.filter(N=>z4(N)===C);return _.length?m(_):aa(S)-n}function b(M,C){const S=t[M]-s.get(),_=x(S,C);return{index:M,distance:_}}function w(M,C){const S=s.get()+M,{index:_,distance:N}=p(S),c=!e&&a(S);if(!C||c)return{index:_,distance:M};const j=t[_]-N,D=M+x(j,0);return{index:_,distance:D}}return{byDistance:w,byIndex:b,shortcut:x}}function nW(e,t,n,r,s,a,l){function h(b){const w=b.distance,E=b.index!==t.get();a.add(w),w&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),E&&(n.set(t.get()),t.set(b.index),l.emit("select"))}function m(b,w){const E=s.byDistance(b,w);h(E)}function p(b,w){const E=t.clone().set(b),M=s.byIndex(E.get(),w);h(M)}return{distance:m,index:p}}function rW(e,t,n,r,s,a,l,h){const m={passive:!0,capture:!0};let p=0;function x(E){if(!h)return;function M(C){if(new Date().getTime()-p>10)return;l.emit("slideFocusStart"),e.scrollLeft=0;const N=n.findIndex(c=>c.includes(C));P4(N)&&(s.useDuration(0),r.index(N,0),l.emit("slideFocus"))}a.add(document,"keydown",b,!1),t.forEach((C,S)=>{a.add(C,"focus",_=>{(Nb(h)||h(E,_))&&M(S)},m)})}function b(E){E.code==="Tab"&&(p=new Date().getTime())}return{init:x}}function Xp(e){let t=e;function n(){return t}function r(m){t=l(m)}function s(m){t+=l(m)}function a(m){t-=l(m)}function l(m){return P4(m)?m:m.get()}return{get:n,set:r,add:s,subtract:a}}function K6(e,t){const n=e.scroll==="x"?l:h,r=t.style;let s=null,a=!1;function l(w){return`translate3d(${w}px,0px,0px)`}function h(w){return`translate3d(0px,${w}px,0px)`}function m(w){if(a)return;const E=Bq(e.direction(w));E!==s&&(r.transform=n(E),s=E)}function p(w){a=!w}function x(){a||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:x,to:m,toggleActive:p}}function iW(e,t,n,r,s,a,l,h,m){const x=gg(s),b=gg(s).reverse(),w=_().concat(N());function E(T,A){return T.reduce((H,F)=>H-s[F],A)}function M(T,A){return T.reduce((H,F)=>E(H,A)>0?H.concat([F]):H,[])}function C(T){return a.map((A,H)=>({start:A-r[H]+.5+T,end:A+t-.5+T}))}function S(T,A,H){const F=C(A);return T.map(V=>{const ee=H?0:-n,G=H?n:0,se=H?"end":"start",Ce=F[V][se];return{index:V,loopPoint:Ce,slideLocation:Xp(-1),translate:K6(e,m[V]),target:()=>h.get()>Ce?ee:G}})}function _(){const T=l[0],A=M(b,T);return S(A,n,!1)}function N(){const T=t-l[0]-1,A=M(x,T);return S(A,-n,!0)}function c(){return w.every(({index:T})=>{const A=x.filter(H=>H!==T);return E(A,t)<=.1})}function j(){w.forEach(T=>{const{target:A,translate:H,slideLocation:F}=T,V=A();V!==F.get()&&(H.to(V),F.set(V))})}function D(){w.forEach(T=>T.translate.clear())}return{canLoop:c,clear:D,loop:j,loopPoints:w}}function sW(e,t,n){let r,s=!1;function a(m){if(!n)return;function p(x){for(const b of x)if(b.type==="childList"){m.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(x=>{s||(Nb(n)||n(m,x))&&p(x)}),r.observe(e,{childList:!0})}function l(){r&&r.disconnect(),s=!0}return{init:a,destroy:l}}function oW(e,t,n,r){const s={};let a=null,l=null,h,m=!1;function p(){h=new IntersectionObserver(M=>{m||(M.forEach(C=>{const S=t.indexOf(C.target);s[S]=C}),a=null,l=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(M=>h.observe(M))}function x(){h&&h.disconnect(),m=!0}function b(M){return vg(s).reduce((C,S)=>{const _=parseInt(S),{isIntersecting:N}=s[_];return(M&&N||!M&&!N)&&C.push(_),C},[])}function w(M=!0){if(M&&a)return a;if(!M&&l)return l;const C=b(M);return M&&(a=C),M||(l=C),C}return{init:p,destroy:x,get:w}}function aW(e,t,n,r,s,a){const{measureSize:l,startEdge:h,endEdge:m}=e,p=n[0]&&s,x=M(),b=C(),w=n.map(l),E=S();function M(){if(!p)return 0;const N=n[0];return Ar(t[h]-N[h])}function C(){if(!p)return 0;const N=a.getComputedStyle(aa(r));return parseFloat(N.getPropertyValue(`margin-${m}`))}function S(){return n.map((N,c,j)=>{const D=!c,B=B4(j,c);return D?w[c]+x:B?w[c]+b:j[c+1][h]-N[h]}).map(Ar)}return{slideSizes:w,slideSizesWithGaps:E,startGap:x,endGap:b}}function lW(e,t,n,r,s,a,l,h,m){const{startEdge:p,endEdge:x,direction:b}=e,w=P4(n);function E(_,N){return gg(_).filter(c=>c%N===0).map(c=>_.slice(c,c+N))}function M(_){return _.length?gg(_).reduce((N,c,j)=>{const D=aa(N)||0,B=D===0,T=c===Gg(_),A=s[p]-a[D][p],H=s[p]-a[c][x],F=!r&&B?b(l):0,V=!r&&T?b(h):0,ee=Ar(H-V-(A+F));return j&&ee>t+m&&N.push(c),T&&N.push(_.length),N},[]).map((N,c,j)=>{const D=Math.max(j[c-1]||0);return _.slice(D,N)}):[]}function C(_){return w?E(_,n):M(_)}return{groupSlides:C}}function cW(e,t,n,r,s,a,l){const{align:h,axis:m,direction:p,startIndex:x,loop:b,duration:w,dragFree:E,dragThreshold:M,inViewThreshold:C,slidesToScroll:S,skipSnaps:_,containScroll:N,watchResize:c,watchSlides:j,watchDrag:D,watchFocus:B}=a,T=2,A=Vq(),H=A.measure(t),F=n.map(A.measure),V=Hq(m,p),ee=V.measureSize(H),G=qq(ee),se=Uq(h,ee),Ce=!b&&!!N,te=b||!!N,{slideSizes:K,slideSizesWithGaps:Z,startGap:oe,endGap:Y}=aW(V,H,F,n,te,s),ne=lW(V,ee,S,b,H,F,oe,Y,T),{snaps:X,snapsAligned:ue}=Jq(V,se,H,F,ne),pe=-aa(X)+aa(Z),{snapsContained:Se,scrollContainLimit:Re}=Xq(ee,pe,ue,N,T),ye=Ce?Se:ue,{limit:ve}=Kq(pe,ye,b),he=X6(Gg(ye),x,b),de=he.clone(),ke=gg(n),Ee=({dragHandler:J,scrollBody:le,scrollBounds:xe,options:{loop:Ae}})=>{Ae||xe.constrain(J.pointerDown()),le.seek()},Ke=({scrollBody:J,translate:le,location:xe,offsetLocation:Ae,previousLocation:wt,scrollLooper:Mt,slideLooper:nt,dragHandler:pt,animation:Bt,eventHandler:gr,scrollBounds:Lr,options:{loop:wr}},ft)=>{const jt=J.settled(),qt=!Lr.shouldConstrain(),Pt=wr?jt:jt&&qt,Wt=Pt&&!pt.pointerDown();Wt&&Bt.stop();const Me=xe.get()*ft+wt.get()*(1-ft);Ae.set(Me),wr&&(Mt.loop(J.direction()),nt.loop()),le.to(Ae.get()),Wt&&gr.emit("settle"),Pt||gr.emit("scroll")},ae=Fq(r,s,()=>Ee(z),J=>Ke(z,J)),We=.68,bt=ye[he.get()],tt=Xp(bt),mt=Xp(bt),Xe=Xp(bt),at=Xp(bt),ot=Gq(tt,Xe,mt,at,w,We),Ct=tW(b,ye,pe,ve,at),Ot=nW(ae,he,de,ot,Ct,at,l),kn=Zq(ve),_t=yg(),kt=oW(t,n,l,C),{slideRegistry:$}=eW(Ce,N,ye,Re,ne,ke),k=rW(e,n,$,Ot,ot,_t,l,B),z={ownerDocument:r,ownerWindow:s,eventHandler:l,containerRect:H,slideRects:F,animation:ae,axis:V,dragHandler:Iq(V,e,r,s,at,$q(V,s),tt,ae,Ot,ot,Ct,he,l,G,E,M,_,We,D),eventStore:_t,percentOfView:G,index:he,indexPrevious:de,limit:ve,location:tt,offsetLocation:Xe,previousLocation:mt,options:a,resizeHandler:Wq(t,l,s,n,V,c,A),scrollBody:ot,scrollBounds:Yq(ve,Xe,at,ot,G),scrollLooper:Qq(pe,ve,Xe,[tt,Xe,mt,at]),scrollProgress:kn,scrollSnapList:ye.map(kn.get),scrollSnaps:ye,scrollTarget:Ct,scrollTo:Ot,slideLooper:iW(V,ee,pe,K,Z,X,ye,Xe,n),slideFocus:k,slidesHandler:sW(t,l,j),slidesInView:kt,slideIndexes:ke,slideRegistry:$,slidesToScroll:ne,target:at,translate:K6(V,t)};return z}function uW(){let e={},t;function n(p){t=p}function r(p){return e[p]||[]}function s(p){return r(p).forEach(x=>x(t,p)),m}function a(p,x){return e[p]=r(p).concat([x]),m}function l(p,x){return e[p]=r(p).filter(b=>b!==x),m}function h(){e={}}const m={init:n,emit:s,off:l,on:a,clear:h};return m}const dW={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function fW(e){function t(a,l){return Y6(a,l||{})}function n(a){const l=a.breakpoints||{},h=vg(l).filter(m=>e.matchMedia(m).matches).map(m=>l[m]).reduce((m,p)=>t(m,p),{});return t(a,h)}function r(a){return a.map(l=>vg(l.breakpoints||{})).reduce((l,h)=>l.concat(h),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function hW(e){let t=[];function n(a,l){return t=l.filter(({options:h})=>e.optionsAtMedia(h).active!==!1),t.forEach(h=>h.init(a,e)),l.reduce((h,m)=>Object.assign(h,{[m.name]:m}),{})}function r(){t=t.filter(a=>a.destroy())}return{init:n,destroy:r}}function Cx(e,t,n){const r=e.ownerDocument,s=r.defaultView,a=fW(s),l=hW(a),h=yg(),m=uW(),{mergeOptions:p,optionsAtMedia:x,optionsMediaQueries:b}=a,{on:w,off:E,emit:M}=m,C=V;let S=!1,_,N=p(dW,Cx.globalOptions),c=p(N),j=[],D,B,T;function A(){const{container:ke,slides:Ee}=c;B=($w(ke)?e.querySelector(ke):ke)||e.children[0];const ae=$w(Ee)?B.querySelectorAll(Ee):Ee;T=[].slice.call(ae||B.children)}function H(ke){const Ee=cW(e,B,T,r,s,ke,m);if(ke.loop&&!Ee.slideLooper.canLoop()){const Ke=Object.assign({},ke,{loop:!1});return H(Ke)}return Ee}function F(ke,Ee){S||(N=p(N,ke),c=x(N),j=Ee||j,A(),_=H(c),b([N,...j.map(({options:Ke})=>Ke)]).forEach(Ke=>h.add(Ke,"change",V)),c.active&&(_.translate.to(_.location.get()),_.animation.init(),_.slidesInView.init(),_.slideFocus.init(de),_.eventHandler.init(de),_.resizeHandler.init(de),_.slidesHandler.init(de),_.options.loop&&_.slideLooper.loop(),B.offsetParent&&T.length&&_.dragHandler.init(de),D=l.init(de,j)))}function V(ke,Ee){const Ke=ne();ee(),F(p({startIndex:Ke},ke),Ee),m.emit("reInit")}function ee(){_.dragHandler.destroy(),_.eventStore.clear(),_.translate.clear(),_.slideLooper.clear(),_.resizeHandler.destroy(),_.slidesHandler.destroy(),_.slidesInView.destroy(),_.animation.destroy(),l.destroy(),h.clear()}function G(){S||(S=!0,h.clear(),ee(),m.emit("destroy"),m.clear())}function se(ke,Ee,Ke){!c.active||S||(_.scrollBody.useBaseFriction().useDuration(Ee===!0?0:c.duration),_.scrollTo.index(ke,Ke||0))}function Ce(ke){const Ee=_.index.add(1).get();se(Ee,ke,-1)}function te(ke){const Ee=_.index.add(-1).get();se(Ee,ke,1)}function K(){return _.index.add(1).get()!==ne()}function Z(){return _.index.add(-1).get()!==ne()}function oe(){return _.scrollSnapList}function Y(){return _.scrollProgress.get(_.offsetLocation.get())}function ne(){return _.index.get()}function X(){return _.indexPrevious.get()}function ue(){return _.slidesInView.get()}function pe(){return _.slidesInView.get(!1)}function Se(){return D}function Re(){return _}function ye(){return e}function ve(){return B}function he(){return T}const de={canScrollNext:K,canScrollPrev:Z,containerNode:ve,internalEngine:Re,destroy:G,off:E,on:w,emit:M,plugins:Se,previousScrollSnap:X,reInit:C,rootNode:ye,scrollNext:Ce,scrollPrev:te,scrollProgress:Y,scrollSnapList:oe,scrollTo:se,selectedScrollSnap:ne,slideNodes:he,slidesInView:ue,slidesNotInView:pe};return F(t,n),setTimeout(()=>m.emit("init"),0),de}Cx.globalOptions=void 0;function Ob(e={},t=[]){const n=y.useRef(e),r=y.useRef(t),[s,a]=y.useState(),[l,h]=y.useState(),m=y.useCallback(()=>{s&&s.reInit(n.current,r.current)},[s]);return y.useEffect(()=>{k4(n.current,e)||(n.current=e,m())},[e,m]),y.useEffect(()=>{Pq(r.current,t)||(r.current=t,m())},[t,m]),y.useEffect(()=>{if(kq()&&l){Cx.globalOptions=Ob.globalOptions;const p=Cx(l,n.current,r.current);return a(p),()=>p.destroy()}else a(void 0)},[l,a]),[h,s]}Ob.globalOptions=void 0;const U4=6048e5,mW=864e5,_5=Symbol.for("constructDateFrom");function ti(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&_5 in e?e[_5](t):e instanceof Date?new e.constructor(t):new Date(t)}function Qn(e,t){return ti(t||e,e)}function Hi(e,t,n){const r=Qn(e,n==null?void 0:n.in);return isNaN(t)?ti((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function da(e,t,n){const r=Qn(e,n==null?void 0:n.in);if(isNaN(t))return ti((n==null?void 0:n.in)||e,NaN);if(!t)return r;const s=r.getDate(),a=ti((n==null?void 0:n.in)||e,r.getTime());a.setMonth(r.getMonth()+t+1,0);const l=a.getDate();return s>=l?a:(r.setFullYear(a.getFullYear(),a.getMonth(),s),r)}let pW={};function Yg(){return pW}function No(e,t){var h,m,p,x;const n=Yg(),r=(t==null?void 0:t.weekStartsOn)??((m=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??n.weekStartsOn??((x=(p=n.locale)==null?void 0:p.options)==null?void 0:x.weekStartsOn)??0,s=Qn(e,t==null?void 0:t.in),a=s.getDay(),l=(a<r?7:0)+a-r;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function lf(e,t){return No(e,{...t,weekStartsOn:1})}function Q6(e,t){const n=Qn(e,t==null?void 0:t.in),r=n.getFullYear(),s=ti(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const a=lf(s),l=ti(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const h=lf(l);return n.getTime()>=a.getTime()?r+1:n.getTime()>=h.getTime()?r:r-1}function Ex(e){const t=Qn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function bf(e,...t){const n=ti.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Ii(e,t){const n=Qn(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function al(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t),a=Ii(r),l=Ii(s),h=+a-Ex(a),m=+l-Ex(l);return Math.round((h-m)/mW)}function gW(e,t){const n=Q6(e,t),r=ti(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),lf(r)}function qw(e,t,n){return Hi(e,t*7,n)}function vW(e,t,n){return da(e,t*12,n)}function yW(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=ti.bind(null,s));const a=Qn(s,r);(!n||n<a||isNaN(+a))&&(n=a)}),ti(r,n||NaN)}function xW(e,t){let n,r=t==null?void 0:t.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=ti.bind(null,s));const a=Qn(s,r);(!n||n>a||isNaN(+a))&&(n=a)}),ti(r,n||NaN)}function bW(e){return ti(e,Date.now())}function ls(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t);return+Ii(r)==+Ii(s)}function F4(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function LW(e){return!(!F4(e)&&typeof e!="number"||isNaN(+Qn(e)))}function xg(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t),a=r.getFullYear()-s.getFullYear(),l=r.getMonth()-s.getMonth();return a*12+l}function wW(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t),a=No(r,n),l=No(s,n),h=+a-Ex(a),m=+l-Ex(l);return Math.round((h-m)/U4)}function um(e,t){const n=Qn(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function H4(e,t){const n=Qn(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function js(e,t){const n=Qn(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Z6(e,t){const n=Qn(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function I4(e,t){var h,m,p,x;const n=Yg(),r=(t==null?void 0:t.weekStartsOn)??((m=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??n.weekStartsOn??((x=(p=n.locale)==null?void 0:p.options)==null?void 0:x.weekStartsOn)??0,s=Qn(e,t==null?void 0:t.in),a=s.getDay(),l=(a<r?-7:0)+6-(a-r);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function J6(e,t){return I4(e,{...t,weekStartsOn:1})}const SW={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},CW=(e,t,n)=>{let r;const s=SW[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function dm(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const EW={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},RW={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_W={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},MW={date:dm({formats:EW,defaultWidth:"full"}),time:dm({formats:RW,defaultWidth:"full"}),dateTime:dm({formats:_W,defaultWidth:"full"})},NW={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},OW=(e,t,n,r)=>NW[e];function tl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,h=n!=null&&n.width?String(n.width):l;s=e.formattingValues[h]||e.formattingValues[l]}else{const l=e.defaultWidth,h=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[h]||e.values[l]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const TW={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},DW={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},AW={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},jW={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},PW={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},zW=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},BW={ordinalNumber:zW,era:tl({values:TW,defaultWidth:"wide"}),quarter:tl({values:DW,defaultWidth:"wide",argumentCallback:e=>e-1}),month:tl({values:AW,defaultWidth:"wide"}),day:tl({values:jW,defaultWidth:"wide"}),dayPeriod:tl({values:kW,defaultWidth:"wide",formattingValues:PW,defaultFormattingWidth:"wide"})};function nl(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const l=a[0],h=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(h)?FW(h,b=>b.test(l)):UW(h,b=>b.test(l));let p;p=e.valueCallback?e.valueCallback(m):m,p=n.valueCallback?n.valueCallback(p):p;const x=t.slice(l.length);return{value:p,rest:x}}}function UW(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function FW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function e7(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],a=t.match(e.parsePattern);if(!a)return null;let l=e.valueCallback?e.valueCallback(a[0]):a[0];l=n.valueCallback?n.valueCallback(l):l;const h=t.slice(s.length);return{value:l,rest:h}}}const HW=/^(\d+)(th|st|nd|rd)?/i,IW=/\d+/i,$W={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},VW={any:[/^b/i,/^(a|c)/i]},qW={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},WW={any:[/1/i,/2/i,/3/i,/4/i]},GW={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YW={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},XW={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},KW={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},QW={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ZW={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},JW={ordinalNumber:e7({matchPattern:HW,parsePattern:IW,valueCallback:e=>parseInt(e,10)}),era:nl({matchPatterns:$W,defaultMatchWidth:"wide",parsePatterns:VW,defaultParseWidth:"any"}),quarter:nl({matchPatterns:qW,defaultMatchWidth:"wide",parsePatterns:WW,defaultParseWidth:"any",valueCallback:e=>e+1}),month:nl({matchPatterns:GW,defaultMatchWidth:"wide",parsePatterns:YW,defaultParseWidth:"any"}),day:nl({matchPatterns:XW,defaultMatchWidth:"wide",parsePatterns:KW,defaultParseWidth:"any"}),dayPeriod:nl({matchPatterns:QW,defaultMatchWidth:"any",parsePatterns:ZW,defaultParseWidth:"any"})},$4={code:"en-US",formatDistance:CW,formatLong:MW,formatRelative:OW,localize:BW,match:JW,options:{weekStartsOn:0,firstWeekContainsDate:1}};function eG(e,t){const n=Qn(e,t==null?void 0:t.in);return al(n,Z6(n))+1}function t7(e,t){const n=Qn(e,t==null?void 0:t.in),r=+lf(n)-+gW(n);return Math.round(r/U4)+1}function n7(e,t){var x,b,w,E;const n=Qn(e,t==null?void 0:t.in),r=n.getFullYear(),s=Yg(),a=(t==null?void 0:t.firstWeekContainsDate)??((b=(x=t==null?void 0:t.locale)==null?void 0:x.options)==null?void 0:b.firstWeekContainsDate)??s.firstWeekContainsDate??((E=(w=s.locale)==null?void 0:w.options)==null?void 0:E.firstWeekContainsDate)??1,l=ti((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,a),l.setHours(0,0,0,0);const h=No(l,t),m=ti((t==null?void 0:t.in)||e,0);m.setFullYear(r,0,a),m.setHours(0,0,0,0);const p=No(m,t);return+n>=+h?r+1:+n>=+p?r:r-1}function tG(e,t){var h,m,p,x;const n=Yg(),r=(t==null?void 0:t.firstWeekContainsDate)??((m=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??n.firstWeekContainsDate??((x=(p=n.locale)==null?void 0:p.options)==null?void 0:x.firstWeekContainsDate)??1,s=n7(e,t),a=ti((t==null?void 0:t.in)||e,0);return a.setFullYear(s,0,r),a.setHours(0,0,0,0),No(a,t)}function r7(e,t){const n=Qn(e,t==null?void 0:t.in),r=+No(n,t)-+tG(n,t);return Math.round(r/U4)+1}function rr(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zc={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return rr(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):rr(n+1,2)},d(e,t){return rr(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return rr(e.getHours()%12||12,t.length)},H(e,t){return rr(e.getHours(),t.length)},m(e,t){return rr(e.getMinutes(),t.length)},s(e,t){return rr(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return rr(s,t.length)}},Zh={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},M5={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Zc.y(e,t)},Y:function(e,t,n,r){const s=n7(e,r),a=s>0?s:1-s;if(t==="YY"){const l=a%100;return rr(l,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):rr(a,t.length)},R:function(e,t){const n=Q6(e);return rr(n,t.length)},u:function(e,t){const n=e.getFullYear();return rr(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return rr(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return rr(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Zc.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return rr(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=r7(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):rr(s,t.length)},I:function(e,t,n){const r=t7(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):rr(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zc.d(e,t)},D:function(e,t,n){const r=eG(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):rr(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return rr(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),a=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return rr(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return rr(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=Zh.noon:r===0?s=Zh.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=Zh.evening:r>=12?s=Zh.afternoon:r>=4?s=Zh.morning:s=Zh.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Zc.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zc.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):rr(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):rr(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zc.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zc.s(e,t)},S:function(e,t){return Zc.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return O5(r);case"XXXX":case"XX":return kd(r);case"XXXXX":case"XXX":default:return kd(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return O5(r);case"xxxx":case"xx":return kd(r);case"xxxxx":case"xxx":default:return kd(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+N5(r,":");case"OOOO":default:return"GMT"+kd(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+N5(r,":");case"zzzz":default:return"GMT"+kd(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return rr(r,t.length)},T:function(e,t,n){return rr(+e,t.length)}};function N5(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),a=r%60;return a===0?n+String(s):n+String(s)+t+rr(a,2)}function O5(e,t){return e%60===0?(e>0?"-":"+")+rr(Math.abs(e)/60,2):kd(e,t)}function kd(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=rr(Math.trunc(r/60),2),a=rr(r%60,2);return n+s+t+a}const T5=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},i7=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},nG=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return T5(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",T5(r,t)).replace("{{time}}",i7(s,t))},rG={p:i7,P:nG},iG=/^D+$/,sG=/^Y+$/,oG=["D","DD","YY","YYYY"];function aG(e){return iG.test(e)}function lG(e){return sG.test(e)}function cG(e,t,n){const r=uG(e,t,n);if(console.warn(r),oG.includes(e))throw new RangeError(r)}function uG(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const dG=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fG=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hG=/^'([^]*?)'?$/,mG=/''/g,pG=/[a-zA-Z]/;function br(e,t,n){var x,b,w,E,M,C,S,_;const r=Yg(),s=(n==null?void 0:n.locale)??r.locale??$4,a=(n==null?void 0:n.firstWeekContainsDate)??((b=(x=n==null?void 0:n.locale)==null?void 0:x.options)==null?void 0:b.firstWeekContainsDate)??r.firstWeekContainsDate??((E=(w=r.locale)==null?void 0:w.options)==null?void 0:E.firstWeekContainsDate)??1,l=(n==null?void 0:n.weekStartsOn)??((C=(M=n==null?void 0:n.locale)==null?void 0:M.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((_=(S=r.locale)==null?void 0:S.options)==null?void 0:_.weekStartsOn)??0,h=Qn(e,n==null?void 0:n.in);if(!LW(h))throw new RangeError("Invalid time value");let m=t.match(fG).map(N=>{const c=N[0];if(c==="p"||c==="P"){const j=rG[c];return j(N,s.formatLong)}return N}).join("").match(dG).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const c=N[0];if(c==="'")return{isToken:!1,value:gG(N)};if(M5[c])return{isToken:!0,value:N};if(c.match(pG))throw new RangeError("Format string contains an unescaped latin alphabet character `"+c+"`");return{isToken:!1,value:N}});s.localize.preprocessor&&(m=s.localize.preprocessor(h,m));const p={firstWeekContainsDate:a,weekStartsOn:l,locale:s};return m.map(N=>{if(!N.isToken)return N.value;const c=N.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&lG(c)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&aG(c))&&cG(c,t,String(e));const j=M5[c[0]];return j(h,c,s.localize,p)}).join("")}function gG(e){const t=e.match(hG);return t?t[1].replace(mG,"'"):e}function vG(e,t){const n=Qn(e,t==null?void 0:t.in),r=n.getFullYear(),s=n.getMonth(),a=ti(n,0);return a.setFullYear(r,s+1,0),a.setHours(0,0,0,0),a.getDate()}function yG(e){return Math.trunc(+Qn(e)/1e3)}function xG(e,t){const n=Qn(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(0,0,0,0),Qn(n,t==null?void 0:t.in)}function bG(e,t){const n=Qn(e,t==null?void 0:t.in);return wW(xG(n,t),js(n,t),t)+1}function Ww(e,t){return+Qn(e)>+Qn(t)}function s7(e,t){return+Qn(e)<+Qn(t)}function D5(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t);return+No(r,n)==+No(s,n)}function V4(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function LG(e,t,n){const[r,s]=bf(n==null?void 0:n.in,e,t);return r.getFullYear()===s.getFullYear()}function wG(e,t){return ls(ti(e,e),bW(e))}function sx(e,t,n){return Hi(e,-t,n)}function k2(e,t,n){const r=Qn(e,n==null?void 0:n.in),s=r.getFullYear(),a=r.getDate(),l=ti(e,0);l.setFullYear(s,t,15),l.setHours(0,0,0,0);const h=vG(l);return r.setMonth(t,Math.min(a,h)),r}function A5(e,t,n){const r=Qn(e,n==null?void 0:n.in);return isNaN(+r)?ti(e,NaN):(r.setFullYear(t),r)}const SG={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},CG=(e,t,n)=>{let r;const s=SG[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"tra "+r:r+" fa":r},EG={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},RG={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},_G={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},MG={date:dm({formats:EG,defaultWidth:"full"}),time:dm({formats:RG,defaultWidth:"full"}),dateTime:dm({formats:_G,defaultWidth:"full"})},q4=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function NG(e){switch(e){case 0:return"'domenica scorsa alle' p";default:return"'"+q4[e]+" scorso alle' p"}}function j5(e){return"'"+q4[e]+" alle' p"}function OG(e){switch(e){case 0:return"'domenica prossima alle' p";default:return"'"+q4[e]+" prossimo alle' p"}}const TG={lastWeek:(e,t,n)=>{const r=e.getDay();return D5(e,t,n)?j5(r):NG(r)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,t,n)=>{const r=e.getDay();return D5(e,t,n)?j5(r):OG(r)},other:"P"},DG=(e,t,n,r)=>{const s=TG[e];return typeof s=="function"?s(t,n,r):s},AG={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},jG={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},kG={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},PG={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},zG={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},BG={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},UG=(e,t)=>{const n=Number(e);return String(n)},FG={ordinalNumber:UG,era:tl({values:AG,defaultWidth:"wide"}),quarter:tl({values:jG,defaultWidth:"wide",argumentCallback:e=>e-1}),month:tl({values:kG,defaultWidth:"wide"}),day:tl({values:PG,defaultWidth:"wide"}),dayPeriod:tl({values:zG,defaultWidth:"wide",formattingValues:BG,defaultFormattingWidth:"wide"})},HG=/^(\d+)(º)?/i,IG=/\d+/i,$G={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},VG={any:[/^a/i,/^(d|e)/i]},qG={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},WG={any:[/1/i,/2/i,/3/i,/4/i]},GG={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},YG={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},XG={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},KG={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},QG={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},ZG={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},JG={ordinalNumber:e7({matchPattern:HG,parsePattern:IG,valueCallback:e=>parseInt(e,10)}),era:nl({matchPatterns:$G,defaultMatchWidth:"wide",parsePatterns:VG,defaultParseWidth:"any"}),quarter:nl({matchPatterns:qG,defaultMatchWidth:"wide",parsePatterns:WG,defaultParseWidth:"any",valueCallback:e=>e+1}),month:nl({matchPatterns:GG,defaultMatchWidth:"wide",parsePatterns:YG,defaultParseWidth:"any"}),day:nl({matchPatterns:XG,defaultMatchWidth:"wide",parsePatterns:KG,defaultParseWidth:"any"}),dayPeriod:nl({matchPatterns:QG,defaultMatchWidth:"any",parsePatterns:ZG,defaultParseWidth:"any"})},eY={code:"it",formatDistance:CG,formatLong:MG,formatRelative:DG,localize:FG,match:JG,options:{weekStartsOn:1,firstWeekContainsDate:4}};var Kp={exports:{}};/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */var tY=Kp.exports,k5;function nY(){return k5||(k5=1,function(e,t){(function(){var n,r="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",h="Invalid `variable` option passed into `_.template`",m="__lodash_hash_undefined__",p=500,x="__lodash_placeholder__",b=1,w=2,E=4,M=1,C=2,S=1,_=2,N=4,c=8,j=16,D=32,B=64,T=128,A=256,H=512,F=30,V="...",ee=800,G=16,se=1,Ce=2,te=3,K=1/0,Z=9007199254740991,oe=17976931348623157e292,Y=NaN,ne=4294967295,X=ne-1,ue=ne>>>1,pe=[["ary",T],["bind",S],["bindKey",_],["curry",c],["curryRight",j],["flip",H],["partial",D],["partialRight",B],["rearg",A]],Se="[object Arguments]",Re="[object Array]",ye="[object AsyncFunction]",ve="[object Boolean]",he="[object Date]",de="[object DOMException]",ke="[object Error]",Ee="[object Function]",Ke="[object GeneratorFunction]",ae="[object Map]",We="[object Number]",bt="[object Null]",tt="[object Object]",mt="[object Promise]",Xe="[object Proxy]",at="[object RegExp]",ot="[object Set]",Ct="[object String]",Ot="[object Symbol]",kn="[object Undefined]",_t="[object WeakMap]",kt="[object WeakSet]",$="[object ArrayBuffer]",k="[object DataView]",z="[object Float32Array]",J="[object Float64Array]",le="[object Int8Array]",xe="[object Int16Array]",Ae="[object Int32Array]",wt="[object Uint8Array]",Mt="[object Uint8ClampedArray]",nt="[object Uint16Array]",pt="[object Uint32Array]",Bt=/\b__p \+= '';/g,gr=/\b(__p \+=) '' \+/g,Lr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wr=/&(?:amp|lt|gt|quot|#39);/g,ft=/[&<>"']/g,jt=RegExp(wr.source),qt=RegExp(ft.source),Pt=/<%-([\s\S]+?)%>/g,Wt=/<%([\s\S]+?)%>/g,Me=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jt=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dt=/[\\^$.*+?()[\]{}|]/g,en=RegExp(dt.source),bn=/^\s+/,rt=/\s/,Tt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,Ue=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$e=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,vt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,ln=/^[-+]0x[0-9a-f]+$/i,En=/^0b[01]+$/i,Gr=/^\[object .+?Constructor\]$/,ni=/^0o[0-7]+$/i,Sr=/^(?:0|[1-9]\d*)$/,_n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zs=/($^)/,Bs=/['\n\r\u2028\u2029\\]/g,fs="\\ud800-\\udfff",gl="\\u0300-\\u036f",Us="\\ufe20-\\ufe2f",vl="\\u20d0-\\u20ff",Wi=gl+Us+vl,je="\\u2700-\\u27bf",it="a-z\\xdf-\\xf6\\xf8-\\xff",st="\\xac\\xb1\\xd7\\xf7",rn="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gn="\\u2000-\\u206f",lr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zr="A-Z\\xc0-\\xd6\\xd8-\\xde",Yr="\\ufe0e\\ufe0f",va=st+rn+gn+lr,Do="['’]",Ao="["+fs+"]",Fs="["+va+"]",Gi="["+Wi+"]",Zn="\\d+",Wn="["+je+"]",cr="["+it+"]",Cr="[^"+fs+va+Zn+je+it+zr+"]",Yi="\\ud83c[\\udffb-\\udfff]",Jn="(?:"+Gi+"|"+Yi+")",Hs="[^"+fs+"]",Xi="(?:\\ud83c[\\udde6-\\uddff]){2}",ri="[\\ud800-\\udbff][\\udc00-\\udfff]",vr="["+zr+"]",ic="\\u200d",sc="(?:"+cr+"|"+Cr+")",oc="(?:"+vr+"|"+Cr+")",ac="(?:"+Do+"(?:d|ll|m|re|s|t|ve))?",lc="(?:"+Do+"(?:D|LL|M|RE|S|T|VE))?",jo=Jn+"?",yl="["+Yr+"]?",Eu="(?:"+ic+"(?:"+[Hs,Xi,ri].join("|")+")"+yl+jo+")*",ko="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xr=yl+jo+Eu,Po="(?:"+[Wn,Xi,ri].join("|")+")"+Xr,cc="(?:"+[Hs+Gi+"?",Gi,Xi,ri,Ao].join("|")+")",ya=RegExp(Do,"g"),hs=RegExp(Gi,"g"),xa=RegExp(Yi+"(?="+Yi+")|"+cc+Xr,"g"),Is=RegExp([vr+"?"+cr+"+"+ac+"(?="+[Fs,vr,"$"].join("|")+")",oc+"+"+lc+"(?="+[Fs,vr+sc,"$"].join("|")+")",vr+"?"+sc+"+"+ac,vr+"+"+lc,yr,ko,Zn,Po].join("|"),"g"),ms=RegExp("["+ic+fs+Wi+Yr+"]"),Ru=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],a0=-1,Gn={};Gn[z]=Gn[J]=Gn[le]=Gn[xe]=Gn[Ae]=Gn[wt]=Gn[Mt]=Gn[nt]=Gn[pt]=!0,Gn[Se]=Gn[Re]=Gn[$]=Gn[ve]=Gn[k]=Gn[he]=Gn[ke]=Gn[Ee]=Gn[ae]=Gn[We]=Gn[tt]=Gn[at]=Gn[ot]=Gn[Ct]=Gn[_t]=!1;var Hn={};Hn[Se]=Hn[Re]=Hn[$]=Hn[k]=Hn[ve]=Hn[he]=Hn[z]=Hn[J]=Hn[le]=Hn[xe]=Hn[Ae]=Hn[ae]=Hn[We]=Hn[tt]=Hn[at]=Hn[ot]=Hn[Ct]=Hn[Ot]=Hn[wt]=Hn[Mt]=Hn[nt]=Hn[pt]=!0,Hn[ke]=Hn[Ee]=Hn[_t]=!1;var l0={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},Ei={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xl={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ef={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_u=parseFloat,tL=parseInt,Rf=typeof Ly=="object"&&Ly&&Ly.Object===Object&&Ly,Jm=typeof self=="object"&&self&&self.Object===Object&&self,Or=Rf||Jm||Function("return this")(),uc=t&&!t.nodeType&&t,ba=uc&&!0&&e&&!e.nodeType&&e,c0=ba&&ba.exports===uc,e1=c0&&Rf.process,ps=function(){try{var be=ba&&ba.require&&ba.require("util").types;return be||e1&&e1.binding&&e1.binding("util")}catch{}}(),_f=ps&&ps.isArrayBuffer,u0=ps&&ps.isDate,d0=ps&&ps.isMap,f0=ps&&ps.isRegExp,h0=ps&&ps.isSet,m0=ps&&ps.isTypedArray;function Ri(be,Fe,Pe){switch(Pe.length){case 0:return be.call(Fe);case 1:return be.call(Fe,Pe[0]);case 2:return be.call(Fe,Pe[0],Pe[1]);case 3:return be.call(Fe,Pe[0],Pe[1],Pe[2])}return be.apply(Fe,Pe)}function nL(be,Fe,Pe,lt){for(var $t=-1,Mn=be==null?0:be.length;++$t<Mn;){var jr=be[$t];Fe(lt,jr,Pe(jr),be)}return lt}function gs(be,Fe){for(var Pe=-1,lt=be==null?0:be.length;++Pe<lt&&Fe(be[Pe],Pe,be)!==!1;);return be}function rL(be,Fe){for(var Pe=be==null?0:be.length;Pe--&&Fe(be[Pe],Pe,be)!==!1;);return be}function p0(be,Fe){for(var Pe=-1,lt=be==null?0:be.length;++Pe<lt;)if(!Fe(be[Pe],Pe,be))return!1;return!0}function io(be,Fe){for(var Pe=-1,lt=be==null?0:be.length,$t=0,Mn=[];++Pe<lt;){var jr=be[Pe];Fe(jr,Pe,be)&&(Mn[$t++]=jr)}return Mn}function Mf(be,Fe){var Pe=be==null?0:be.length;return!!Pe&&dc(be,Fe,0)>-1}function t1(be,Fe,Pe){for(var lt=-1,$t=be==null?0:be.length;++lt<$t;)if(Pe(Fe,be[lt]))return!0;return!1}function ur(be,Fe){for(var Pe=-1,lt=be==null?0:be.length,$t=Array(lt);++Pe<lt;)$t[Pe]=Fe(be[Pe],Pe,be);return $t}function zo(be,Fe){for(var Pe=-1,lt=Fe.length,$t=be.length;++Pe<lt;)be[$t+Pe]=Fe[Pe];return be}function n1(be,Fe,Pe,lt){var $t=-1,Mn=be==null?0:be.length;for(lt&&Mn&&(Pe=be[++$t]);++$t<Mn;)Pe=Fe(Pe,be[$t],$t,be);return Pe}function iL(be,Fe,Pe,lt){var $t=be==null?0:be.length;for(lt&&$t&&(Pe=be[--$t]);$t--;)Pe=Fe(Pe,be[$t],$t,be);return Pe}function r1(be,Fe){for(var Pe=-1,lt=be==null?0:be.length;++Pe<lt;)if(Fe(be[Pe],Pe,be))return!0;return!1}var sL=Of("length");function oL(be){return be.split("")}function aL(be){return be.match(ze)||[]}function g0(be,Fe,Pe){var lt;return Pe(be,function($t,Mn,jr){if(Fe($t,Mn,jr))return lt=Mn,!1}),lt}function Nf(be,Fe,Pe,lt){for(var $t=be.length,Mn=Pe+(lt?1:-1);lt?Mn--:++Mn<$t;)if(Fe(be[Mn],Mn,be))return Mn;return-1}function dc(be,Fe,Pe){return Fe===Fe?dL(be,Fe,Pe):Nf(be,fc,Pe)}function i1(be,Fe,Pe,lt){for(var $t=Pe-1,Mn=be.length;++$t<Mn;)if(lt(be[$t],Fe))return $t;return-1}function fc(be){return be!==be}function v0(be,Fe){var Pe=be==null?0:be.length;return Pe?Df(be,Fe)/Pe:Y}function Of(be){return function(Fe){return Fe==null?n:Fe[be]}}function Tf(be){return function(Fe){return be==null?n:be[Fe]}}function s1(be,Fe,Pe,lt,$t){return $t(be,function(Mn,jr,Nn){Pe=lt?(lt=!1,Mn):Fe(Pe,Mn,jr,Nn)}),Pe}function y0(be,Fe){var Pe=be.length;for(be.sort(Fe);Pe--;)be[Pe]=be[Pe].value;return be}function Df(be,Fe){for(var Pe,lt=-1,$t=be.length;++lt<$t;){var Mn=Fe(be[lt]);Mn!==n&&(Pe=Pe===n?Mn:Pe+Mn)}return Pe}function La(be,Fe){for(var Pe=-1,lt=Array(be);++Pe<be;)lt[Pe]=Fe(Pe);return lt}function lL(be,Fe){return ur(Fe,function(Pe){return[Pe,be[Pe]]})}function x0(be){return be&&be.slice(0,a1(be)+1).replace(bn,"")}function Ki(be){return function(Fe){return be(Fe)}}function Af(be,Fe){return ur(Fe,function(Pe){return be[Pe]})}function hc(be,Fe){return be.has(Fe)}function mc(be,Fe){for(var Pe=-1,lt=be.length;++Pe<lt&&dc(Fe,be[Pe],0)>-1;);return Pe}function pc(be,Fe){for(var Pe=be.length;Pe--&&dc(Fe,be[Pe],0)>-1;);return Pe}function cL(be,Fe){for(var Pe=be.length,lt=0;Pe--;)be[Pe]===Fe&&++lt;return lt}var jf=Tf(l0),b0=Tf(Ei);function L0(be){return"\\"+Ef[be]}function o1(be,Fe){return be==null?n:be[Fe]}function wa(be){return ms.test(be)}function w0(be){return Ru.test(be)}function S0(be){for(var Fe,Pe=[];!(Fe=be.next()).done;)Pe.push(Fe.value);return Pe}function kf(be){var Fe=-1,Pe=Array(be.size);return be.forEach(function(lt,$t){Pe[++Fe]=[$t,lt]}),Pe}function C0(be,Fe){return function(Pe){return be(Fe(Pe))}}function Sa(be,Fe){for(var Pe=-1,lt=be.length,$t=0,Mn=[];++Pe<lt;){var jr=be[Pe];(jr===Fe||jr===x)&&(be[Pe]=x,Mn[$t++]=Pe)}return Mn}function Pf(be){var Fe=-1,Pe=Array(be.size);return be.forEach(function(lt){Pe[++Fe]=lt}),Pe}function uL(be){var Fe=-1,Pe=Array(be.size);return be.forEach(function(lt){Pe[++Fe]=[lt,lt]}),Pe}function dL(be,Fe,Pe){for(var lt=Pe-1,$t=be.length;++lt<$t;)if(be[lt]===Fe)return lt;return-1}function Qi(be,Fe,Pe){for(var lt=Pe+1;lt--;)if(be[lt]===Fe)return lt;return lt}function so(be){return wa(be)?R0(be):sL(be)}function vs(be){return wa(be)?l1(be):oL(be)}function a1(be){for(var Fe=be.length;Fe--&&rt.test(be.charAt(Fe)););return Fe}var E0=Tf(xl);function R0(be){for(var Fe=xa.lastIndex=0;xa.test(be);)++Fe;return Fe}function l1(be){return be.match(xa)||[]}function fL(be){return be.match(Is)||[]}var gc=function be(Fe){Fe=Fe==null?Or:Ca.defaults(Or.Object(),Fe,Ca.pick(Or,Cf));var Pe=Fe.Array,lt=Fe.Date,$t=Fe.Error,Mn=Fe.Function,jr=Fe.Math,Nn=Fe.Object,zf=Fe.RegExp,_0=Fe.String,Zi=Fe.TypeError,Bf=Pe.prototype,hL=Mn.prototype,vc=Nn.prototype,Mu=Fe["__core-js_shared__"],Nu=hL.toString,zn=vc.hasOwnProperty,$s=0,c1=function(){var d=/[^.]+$/.exec(Mu&&Mu.keys&&Mu.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),pi=vc.toString,ys=Nu.call(Nn),yc=Or._,u1=zf("^"+Nu.call(zn).replace(dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bl=c0?Fe.Buffer:n,Vs=Fe.Symbol,xc=Fe.Uint8Array,Ll=bl?bl.allocUnsafe:n,Ou=C0(Nn.getPrototypeOf,Nn),Tu=Nn.create,wl=vc.propertyIsEnumerable,Uf=Bf.splice,_i=Vs?Vs.isConcatSpreadable:n,Sl=Vs?Vs.iterator:n,gi=Vs?Vs.toStringTag:n,Du=function(){try{var d=Aa(Nn,"defineProperty");return d({},"",{}),d}catch{}}(),Ff=Fe.clearTimeout!==Or.clearTimeout&&Fe.clearTimeout,Cl=lt&&lt.now!==Or.Date.now&&lt.now,d1=Fe.setTimeout!==Or.setTimeout&&Fe.setTimeout,bc=jr.ceil,Bo=jr.floor,Ea=Nn.getOwnPropertySymbols,Hf=bl?bl.isBuffer:n,Au=Fe.isFinite,xs=Bf.join,bs=C0(Nn.keys,Nn),or=jr.max,dr=jr.min,Uo=lt.now,El=Fe.parseInt,f1=jr.random,h1=Bf.reverse,ju=Aa(Fe,"DataView"),Br=Aa(Fe,"Map"),fr=Aa(Fe,"Promise"),Ln=Aa(Fe,"Set"),qs=Aa(Fe,"WeakMap"),Mi=Aa(Nn,"create"),Lc=qs&&new qs,Ls={},M0=Yo(ju),N0=Yo(Br),ku=Yo(fr),Pu=Yo(Ln),O0=Yo(qs),Ra=Vs?Vs.prototype:n,Rl=Ra?Ra.valueOf:n,_a=Ra?Ra.toString:n;function q(d){if(xr(d)&&!Kt(d)&&!(d instanceof hn)){if(d instanceof Ni)return d;if(zn.call(d,"__wrapped__"))return Fr(d)}return new Ni(d)}var Ji=function(){function d(){}return function(g){if(!mr(g))return{};if(Tu)return Tu(g);d.prototype=g;var R=new d;return d.prototype=n,R}}();function ws(){}function Ni(d,g){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}q.templateSettings={escape:Pt,evaluate:Wt,interpolate:Me,variable:"",imports:{_:q}},q.prototype=ws.prototype,q.prototype.constructor=q,Ni.prototype=Ji(ws.prototype),Ni.prototype.constructor=Ni;function hn(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ne,this.__views__=[]}function zu(){var d=new hn(this.__wrapped__);return d.__actions__=Ur(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=Ur(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=Ur(this.__views__),d}function If(){if(this.__filtered__){var d=new hn(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function _l(){var d=this.__wrapped__.value(),g=this.__dir__,R=Kt(d),P=g<0,I=R?d.length:0,Q=cv(0,I,this.__views__),re=Q.start,fe=Q.end,we=fe-re,qe=P?fe:re-1,Ye=this.__iteratees__,Ze=Ye.length,ct=0,Dt=dr(we,this.__takeCount__);if(!R||!P&&I==we&&Dt==we)return X0(d,this.__actions__);var Gt=[];e:for(;we--&&ct<Dt;){qe+=g;for(var pn=-1,Yt=d[qe];++pn<Ze;){var Cn=Ye[pn],Tn=Cn.iteratee,Zs=Cn.type,os=Tn(Yt);if(Zs==Ce)Yt=os;else if(!os){if(Zs==se)continue e;break e}}Gt[ct++]=Yt}return Gt}hn.prototype=Ji(ws.prototype),hn.prototype.constructor=hn;function Er(d){var g=-1,R=d==null?0:d.length;for(this.clear();++g<R;){var P=d[g];this.set(P[0],P[1])}}function $f(){this.__data__=Mi?Mi(null):{},this.size=0}function T0(d){var g=this.has(d)&&delete this.__data__[d];return this.size-=g?1:0,g}function mL(d){var g=this.__data__;if(Mi){var R=g[d];return R===m?n:R}return zn.call(g,d)?g[d]:n}function pL(d){var g=this.__data__;return Mi?g[d]!==n:zn.call(g,d)}function gL(d,g){var R=this.__data__;return this.size+=this.has(d)?0:1,R[d]=Mi&&g===n?m:g,this}Er.prototype.clear=$f,Er.prototype.delete=T0,Er.prototype.get=mL,Er.prototype.has=pL,Er.prototype.set=gL;function er(d){var g=-1,R=d==null?0:d.length;for(this.clear();++g<R;){var P=d[g];this.set(P[0],P[1])}}function m1(){this.__data__=[],this.size=0}function Bu(d){var g=this.__data__,R=Cc(g,d);if(R<0)return!1;var P=g.length-1;return R==P?g.pop():Uf.call(g,R,1),--this.size,!0}function Uu(d){var g=this.__data__,R=Cc(g,d);return R<0?n:g[R][1]}function p1(d){return Cc(this.__data__,d)>-1}function wc(d,g){var R=this.__data__,P=Cc(R,d);return P<0?(++this.size,R.push([d,g])):R[P][1]=g,this}er.prototype.clear=m1,er.prototype.delete=Bu,er.prototype.get=Uu,er.prototype.has=p1,er.prototype.set=wc;function Oi(d){var g=-1,R=d==null?0:d.length;for(this.clear();++g<R;){var P=d[g];this.set(P[0],P[1])}}function vL(){this.size=0,this.__data__={hash:new Er,map:new(Br||er),string:new Er}}function D0(d){var g=Oc(this,d).delete(d);return this.size-=g?1:0,g}function yL(d){return Oc(this,d).get(d)}function A0(d){return Oc(this,d).has(d)}function Ml(d,g){var R=Oc(this,d),P=R.size;return R.set(d,g),this.size+=R.size==P?0:1,this}Oi.prototype.clear=vL,Oi.prototype.delete=D0,Oi.prototype.get=yL,Oi.prototype.has=A0,Oi.prototype.set=Ml;function Fo(d){var g=-1,R=d==null?0:d.length;for(this.__data__=new Oi;++g<R;)this.add(d[g])}function Vf(d){return this.__data__.set(d,m),this}function j0(d){return this.__data__.has(d)}Fo.prototype.add=Fo.prototype.push=Vf,Fo.prototype.has=j0;function vi(d){var g=this.__data__=new er(d);this.size=g.size}function k0(){this.__data__=new er,this.size=0}function qf(d){var g=this.__data__,R=g.delete(d);return this.size=g.size,R}function g1(d){return this.__data__.get(d)}function P0(d){return this.__data__.has(d)}function Wf(d,g){var R=this.__data__;if(R instanceof er){var P=R.__data__;if(!Br||P.length<s-1)return P.push([d,g]),this.size=++R.size,this;R=this.__data__=new Oi(P)}return R.set(d,g),this.size=R.size,this}vi.prototype.clear=k0,vi.prototype.delete=qf,vi.prototype.get=g1,vi.prototype.has=P0,vi.prototype.set=Wf;function v1(d,g){var R=Kt(d),P=!R&&Zo(d),I=!R&&!P&&$a(d),Q=!R&&!P&&!I&&Vc(d),re=R||P||I||Q,fe=re?La(d.length,_0):[],we=fe.length;for(var qe in d)(g||zn.call(d,qe))&&!(re&&(qe=="length"||I&&(qe=="offset"||qe=="parent")||Q&&(qe=="buffer"||qe=="byteLength"||qe=="byteOffset")||Xs(qe,we)))&&fe.push(qe);return fe}function Sc(d){var g=d.length;return g?d[nh(0,g-1)]:n}function z0(d,g){return fd(Ur(d),Gs(g,0,d.length))}function B0(d){return fd(Ur(d))}function oo(d,g,R){(R!==n&&!zi(d[g],R)||R===n&&!(g in d))&&Ws(d,g,R)}function Nl(d,g,R){var P=d[g];(!(zn.call(d,g)&&zi(P,R))||R===n&&!(g in d))&&Ws(d,g,R)}function Cc(d,g){for(var R=d.length;R--;)if(zi(d[R][0],g))return R;return-1}function Ma(d,g,R,P){return Io(d,function(I,Q,re){g(P,I,R(I),re)}),P}function Ho(d,g){return d&&Ai(g,$r(g),d)}function Fu(d,g){return d&&Ai(g,Zr(g),d)}function Ws(d,g,R){g=="__proto__"&&Du?Du(d,g,{configurable:!0,enumerable:!0,value:R,writable:!0}):d[g]=R}function Hu(d,g){for(var R=-1,P=g.length,I=Pe(P),Q=d==null;++R<P;)I[R]=Q?n:Rd(d,g[R]);return I}function Gs(d,g,R){return d===d&&(R!==n&&(d=d<=R?d:R),g!==n&&(d=d>=g?d:g)),d}function ci(d,g,R,P,I,Q){var re,fe=g&b,we=g&w,qe=g&E;if(R&&(re=I?R(d,P,I,Q):R(d)),re!==n)return re;if(!mr(d))return d;var Ye=Kt(d);if(Ye){if(re=$1(d),!fe)return Ur(d,re)}else{var Ze=Qr(d),ct=Ze==Ee||Ze==Ke;if($a(d))return k1(d,fe);if(Ze==tt||Ze==Se||ct&&!I){if(re=we||ct?{}:V1(d),!fe)return we?ed(d,Fu(re,d)):lh(d,Ho(re,d))}else{if(!Hn[Ze])return I?d:{};re=q1(d,Ze,fe)}}Q||(Q=new vi);var Dt=Q.get(d);if(Dt)return Dt;Q.set(d,re),ty(d)?d.forEach(function(Yt){re.add(ci(Yt,g,R,Yt,d,Q))}):Ah(d)&&d.forEach(function(Yt,Cn){re.set(Cn,ci(Yt,g,R,Cn,d,Q))});var Gt=qe?we?fh:dh:we?Zr:$r,pn=Ye?n:Gt(d);return gs(pn||d,function(Yt,Cn){pn&&(Cn=Yt,Yt=d[Cn]),Nl(re,Cn,ci(Yt,g,R,Cn,d,Q))}),re}function U0(d){var g=$r(d);return function(R){return y1(R,d,g)}}function y1(d,g,R){var P=R.length;if(d==null)return!P;for(d=Nn(d);P--;){var I=R[P],Q=g[I],re=d[I];if(re===n&&!(I in d)||!Q(re))return!1}return!0}function Ol(d,g,R){if(typeof d!="function")throw new Zi(l);return Dc(function(){d.apply(n,R)},g)}function Na(d,g,R,P){var I=-1,Q=Mf,re=!0,fe=d.length,we=[],qe=g.length;if(!fe)return we;R&&(g=ur(g,Ki(R))),P?(Q=t1,re=!1):g.length>=s&&(Q=hc,re=!1,g=new Fo(g));e:for(;++I<fe;){var Ye=d[I],Ze=R==null?Ye:R(Ye);if(Ye=P||Ye!==0?Ye:0,re&&Ze===Ze){for(var ct=qe;ct--;)if(g[ct]===Ze)continue e;we.push(Ye)}else Q(g,Ze,P)||we.push(Ye)}return we}var Io=U1(ui),Gf=U1(Rc,!0);function x1(d,g){var R=!0;return Io(d,function(P,I,Q){return R=!!g(P,I,Q),R}),R}function Ys(d,g,R){for(var P=-1,I=d.length;++P<I;){var Q=d[P],re=g(Q);if(re!=null&&(fe===n?re===re&&!bi(re):R(re,fe)))var fe=re,we=Q}return we}function dn(d,g,R,P){var I=d.length;for(R=tn(R),R<0&&(R=-R>I?0:I+R),P=P===n||P>I?I:tn(P),P<0&&(P+=I),P=R>P?0:go(P);R<P;)d[R++]=g;return d}function In(d,g){var R=[];return Io(d,function(P,I,Q){g(P,I,Q)&&R.push(P)}),R}function wn(d,g,R,P,I){var Q=-1,re=d.length;for(R||(R=Wo),I||(I=[]);++Q<re;){var fe=d[Q];g>0&&R(fe)?g>1?wn(fe,g-1,R,P,I):zo(I,fe):P||(I[I.length]=fe)}return I}var Ec=zl(),Tl=zl(!0);function ui(d,g){return d&&Ec(d,g,$r)}function Rc(d,g){return d&&Tl(d,g,$r)}function Oa(d,g){return io(g,function(R){return Ks(d[R])})}function Ss(d,g){g=Vo(g,d);for(var R=0,P=g.length;d!=null&&R<P;)d=d[Fn(g[R++])];return R&&R==P?d:n}function F0(d,g,R){var P=g(d);return Kt(d)?P:zo(P,R(d))}function Sn(d){return d==null?d===n?kn:bt:gi&&gi in Nn(d)?lv(d):mv(d)}function Iu(d,g){return d>g}function b1(d,g){return d!=null&&zn.call(d,g)}function H0(d,g){return d!=null&&g in Nn(d)}function I0(d,g,R){return d>=dr(g,R)&&d<or(g,R)}function L1(d,g,R){for(var P=R?t1:Mf,I=d[0].length,Q=d.length,re=Q,fe=Pe(Q),we=1/0,qe=[];re--;){var Ye=d[re];re&&g&&(Ye=ur(Ye,Ki(g))),we=dr(Ye.length,we),fe[re]=!R&&(g||I>=120&&Ye.length>=120)?new Fo(re&&Ye):n}Ye=d[0];var Ze=-1,ct=fe[0];e:for(;++Ze<I&&qe.length<we;){var Dt=Ye[Ze],Gt=g?g(Dt):Dt;if(Dt=R||Dt!==0?Dt:0,!(ct?hc(ct,Gt):P(qe,Gt,R))){for(re=Q;--re;){var pn=fe[re];if(!(pn?hc(pn,Gt):P(d[re],Gt,R)))continue e}ct&&ct.push(Gt),qe.push(Dt)}}return qe}function w1(d,g,R,P){return ui(d,function(I,Q,re){g(P,R(I),Q,re)}),P}function Dl(d,g,R){g=Vo(g,d),d=Tc(d,g);var P=d==null?d:d[Fn(di(g))];return P==null?n:Ri(P,d,R)}function Yf(d){return xr(d)&&Sn(d)==Se}function Ti(d){return xr(d)&&Sn(d)==$}function kr(d){return xr(d)&&Sn(d)==he}function Al(d,g,R,P,I){return d===g?!0:d==null||g==null||!xr(d)&&!xr(g)?d!==d&&g!==g:$u(d,g,R,P,Al,I)}function $u(d,g,R,P,I,Q){var re=Kt(d),fe=Kt(g),we=re?Re:Qr(d),qe=fe?Re:Qr(g);we=we==Se?tt:we,qe=qe==Se?tt:qe;var Ye=we==tt,Ze=qe==tt,ct=we==qe;if(ct&&$a(d)){if(!$a(g))return!1;re=!0,Ye=!1}if(ct&&!Ye)return Q||(Q=new vi),re||Vc(d)?ov(d,g,R,P,I,Q):av(d,g,we,R,P,I,Q);if(!(R&M)){var Dt=Ye&&zn.call(d,"__wrapped__"),Gt=Ze&&zn.call(g,"__wrapped__");if(Dt||Gt){var pn=Dt?d.value():d,Yt=Gt?g.value():g;return Q||(Q=new vi),I(pn,Yt,R,P,Q)}}return ct?(Q||(Q=new vi),Kr(d,g,R,P,I,Q)):!1}function Xf(d){return xr(d)&&Qr(d)==ae}function Vu(d,g,R,P){var I=R.length,Q=I,re=!P;if(d==null)return!Q;for(d=Nn(d);I--;){var fe=R[I];if(re&&fe[2]?fe[1]!==d[fe[0]]:!(fe[0]in d))return!1}for(;++I<Q;){fe=R[I];var we=fe[0],qe=d[we],Ye=fe[1];if(re&&fe[2]){if(qe===n&&!(we in d))return!1}else{var Ze=new vi;if(P)var ct=P(qe,Ye,we,d,g,Ze);if(!(ct===n?Al(Ye,qe,M|C,P,Ze):ct))return!1}}return!0}function ao(d){if(!mr(d)||yh(d))return!1;var g=Ks(d)?u1:Gr;return g.test(Yo(d))}function Kf(d){return xr(d)&&Sn(d)==at}function S1(d){return xr(d)&&Qr(d)==ot}function C1(d){return xr(d)&&Il(d.length)&&!!Gn[Sn(d)]}function E1(d){return typeof d=="function"?d:d==null?Oe:typeof d=="object"?Kt(d)?Jf(d[0],d[1]):_1(d):On(d)}function Qf(d){if(!tr(d))return bs(d);var g=[];for(var R in Nn(d))zn.call(d,R)&&R!="constructor"&&g.push(R);return g}function $0(d){if(!mr(d))return ja(d);var g=tr(d),R=[];for(var P in d)P=="constructor"&&(g||!zn.call(d,P))||R.push(P);return R}function Zf(d,g){return d<g}function R1(d,g){var R=-1,P=Hr(d)?Pe(d.length):[];return Io(d,function(I,Q,re){P[++R]=g(I,Q,re)}),P}function _1(d){var g=mh(d);return g.length==1&&g[0][2]?fv(g[0][0],g[0][1]):function(R){return R===d||Vu(R,d,g)}}function Jf(d,g){return gh(d)&&dv(g)?fv(Fn(d),g):function(R){var P=Rd(R,d);return P===n&&P===g?Yc(R,d):Al(g,P,M|C)}}function qu(d,g,R,P,I){d!==g&&Ec(g,function(Q,re){if(I||(I=new vi),mr(Q))xL(d,g,re,R,qu,P,I);else{var fe=P?P(xh(d,re),Q,re+"",d,g,I):n;fe===n&&(fe=Q),oo(d,re,fe)}},Zr)}function xL(d,g,R,P,I,Q,re){var fe=xh(d,R),we=xh(g,R),qe=re.get(we);if(qe){oo(d,R,qe);return}var Ye=Q?Q(fe,we,R+"",d,g,re):n,Ze=Ye===n;if(Ze){var ct=Kt(we),Dt=!ct&&$a(we),Gt=!ct&&!Dt&&Vc(we);Ye=we,ct||Dt||Gt?Kt(fe)?Ye=fe:Mr(fe)?Ye=Ur(fe):Dt?(Ze=!1,Ye=k1(we,!0)):Gt?(Ze=!1,Ye=z1(we,!0)):Ye=[]:_s(we)||Zo(we)?(Ye=fe,Zo(fe)?Ye=iy(fe):(!mr(fe)||Ks(fe))&&(Ye=V1(we))):Ze=!1}Ze&&(re.set(we,Ye),I(Ye,we,P,Q,re),re.delete(we)),oo(d,R,Ye)}function M1(d,g){var R=d.length;if(R)return g+=g<0?R:0,Xs(g,R)?d[g]:n}function N1(d,g,R){g.length?g=ur(g,function(Q){return Kt(Q)?function(re){return Ss(re,Q.length===1?Q[0]:Q)}:Q}):g=[Oe];var P=-1;g=ur(g,Ki(zt()));var I=R1(d,function(Q,re,fe){var we=ur(g,function(qe){return qe(Q)});return{criteria:we,index:++P,value:Q}});return y0(I,function(Q,re){return J0(Q,re,R)})}function V0(d,g){return eh(d,g,function(R,P){return Yc(d,P)})}function eh(d,g,R){for(var P=-1,I=g.length,Q={};++P<I;){var re=g[P],fe=Ss(d,re);R(fe,re)&&Mc(Q,Vo(re,d),fe)}return Q}function q0(d){return function(g){return Ss(g,d)}}function th(d,g,R,P){var I=P?i1:dc,Q=-1,re=g.length,fe=d;for(d===g&&(g=Ur(g)),R&&(fe=ur(d,Ki(R)));++Q<re;)for(var we=0,qe=g[Q],Ye=R?R(qe):qe;(we=I(fe,Ye,we,P))>-1;)fe!==d&&Uf.call(fe,we,1),Uf.call(d,we,1);return d}function O1(d,g){for(var R=d?g.length:0,P=R-1;R--;){var I=g[R];if(R==P||I!==Q){var Q=I;Xs(I)?Uf.call(d,I,1):Xu(d,I)}}return d}function nh(d,g){return d+Bo(f1()*(g-d+1))}function W0(d,g,R,P){for(var I=-1,Q=or(bc((g-d)/(R||1)),0),re=Pe(Q);Q--;)re[P?Q:++I]=d,d+=R;return re}function T1(d,g){var R="";if(!d||g<1||g>Z)return R;do g%2&&(R+=d),g=Bo(g/2),g&&(d+=d);while(g);return R}function cn(d,g){return ud(W1(d,g,Oe),d+"")}function _c(d){return Sc(Kc(d))}function rh(d,g){var R=Kc(d);return fd(R,Gs(g,0,R.length))}function Mc(d,g,R,P){if(!mr(d))return d;g=Vo(g,d);for(var I=-1,Q=g.length,re=Q-1,fe=d;fe!=null&&++I<Q;){var we=Fn(g[I]),qe=R;if(we==="__proto__"||we==="constructor"||we==="prototype")return d;if(I!=re){var Ye=fe[we];qe=P?P(Ye,we,fe):n,qe===n&&(qe=mr(Ye)?Ye:Xs(g[I+1])?[]:{})}Nl(fe,we,qe),fe=fe[we]}return d}var Wu=Lc?function(d,g){return Lc.set(d,g),d}:Oe,Gu=Du?function(d,g){return Du(d,"toString",{configurable:!0,enumerable:!1,value:Ne(g),writable:!0})}:Oe;function G0(d){return fd(Kc(d))}function es(d,g,R){var P=-1,I=d.length;g<0&&(g=-g>I?0:I+g),R=R>I?I:R,R<0&&(R+=I),I=g>R?0:R-g>>>0,g>>>=0;for(var Q=Pe(I);++P<I;)Q[P]=d[P+g];return Q}function Y0(d,g){var R;return Io(d,function(P,I,Q){return R=g(P,I,Q),!R}),!!R}function Yu(d,g,R){var P=0,I=d==null?P:d.length;if(typeof g=="number"&&g===g&&I<=ue){for(;P<I;){var Q=P+I>>>1,re=d[Q];re!==null&&!bi(re)&&(R?re<=g:re<g)?P=Q+1:I=Q}return I}return ih(d,g,Oe,R)}function ih(d,g,R,P){var I=0,Q=d==null?0:d.length;if(Q===0)return 0;g=R(g);for(var re=g!==g,fe=g===null,we=bi(g),qe=g===n;I<Q;){var Ye=Bo((I+Q)/2),Ze=R(d[Ye]),ct=Ze!==n,Dt=Ze===null,Gt=Ze===Ze,pn=bi(Ze);if(re)var Yt=P||Gt;else qe?Yt=Gt&&(P||ct):fe?Yt=Gt&&ct&&(P||!Dt):we?Yt=Gt&&ct&&!Dt&&(P||!pn):Dt||pn?Yt=!1:Yt=P?Ze<=g:Ze<g;Yt?I=Ye+1:Q=Ye}return dr(Q,X)}function D1(d,g){for(var R=-1,P=d.length,I=0,Q=[];++R<P;){var re=d[R],fe=g?g(re):re;if(!R||!zi(fe,we)){var we=fe;Q[I++]=re===0?0:re}}return Q}function sh(d){return typeof d=="number"?d:bi(d)?Y:+d}function Di(d){if(typeof d=="string")return d;if(Kt(d))return ur(d,Di)+"";if(bi(d))return _a?_a.call(d):"";var g=d+"";return g=="0"&&1/d==-1/0?"-0":g}function $o(d,g,R){var P=-1,I=Mf,Q=d.length,re=!0,fe=[],we=fe;if(R)re=!1,I=t1;else if(Q>=s){var qe=g?null:iv(d);if(qe)return Pf(qe);re=!1,I=hc,we=new Fo}else we=g?[]:fe;e:for(;++P<Q;){var Ye=d[P],Ze=g?g(Ye):Ye;if(Ye=R||Ye!==0?Ye:0,re&&Ze===Ze){for(var ct=we.length;ct--;)if(we[ct]===Ze)continue e;g&&we.push(Ze),fe.push(Ye)}else I(we,Ze,R)||(we!==fe&&we.push(Ze),fe.push(Ye))}return fe}function Xu(d,g){return g=Vo(g,d),d=Tc(d,g),d==null||delete d[Fn(di(g))]}function A1(d,g,R,P){return Mc(d,g,R(Ss(d,g)),P)}function Ku(d,g,R,P){for(var I=d.length,Q=P?I:-1;(P?Q--:++Q<I)&&g(d[Q],Q,d););return R?es(d,P?0:Q,P?Q+1:I):es(d,P?Q+1:0,P?I:Q)}function X0(d,g){var R=d;return R instanceof hn&&(R=R.value()),n1(g,function(P,I){return I.func.apply(I.thisArg,zo([P],I.args))},R)}function Qu(d,g,R){var P=d.length;if(P<2)return P?$o(d[0]):[];for(var I=-1,Q=Pe(P);++I<P;)for(var re=d[I],fe=-1;++fe<P;)fe!=I&&(Q[I]=Na(Q[I]||re,d[fe],g,R));return $o(wn(Q,1),g,R)}function j1(d,g,R){for(var P=-1,I=d.length,Q=g.length,re={};++P<I;){var fe=P<Q?g[P]:n;R(re,d[P],fe)}return re}function oh(d){return Mr(d)?d:[]}function Zu(d){return typeof d=="function"?d:Oe}function Vo(d,g){return Kt(d)?d:gh(d,g)?[d]:fo(Bn(d))}var K0=cn;function Ta(d,g,R){var P=d.length;return R=R===n?P:R,!g&&R>=P?d:es(d,g,R)}var Q0=Ff||function(d){return Or.clearTimeout(d)};function k1(d,g){if(g)return d.slice();var R=d.length,P=Ll?Ll(R):new d.constructor(R);return d.copy(P),P}function jl(d){var g=new d.constructor(d.byteLength);return new xc(g).set(new xc(d)),g}function P1(d,g){var R=g?jl(d.buffer):d.buffer;return new d.constructor(R,d.byteOffset,d.byteLength)}function ah(d){var g=new d.constructor(d.source,Nt.exec(d));return g.lastIndex=d.lastIndex,g}function Z0(d){return Rl?Nn(Rl.call(d)):{}}function z1(d,g){var R=g?jl(d.buffer):d.buffer;return new d.constructor(R,d.byteOffset,d.length)}function Ju(d,g){if(d!==g){var R=d!==n,P=d===null,I=d===d,Q=bi(d),re=g!==n,fe=g===null,we=g===g,qe=bi(g);if(!fe&&!qe&&!Q&&d>g||Q&&re&&we&&!fe&&!qe||P&&re&&we||!R&&we||!I)return 1;if(!P&&!Q&&!qe&&d<g||qe&&R&&I&&!P&&!Q||fe&&R&&I||!re&&I||!we)return-1}return 0}function J0(d,g,R){for(var P=-1,I=d.criteria,Q=g.criteria,re=I.length,fe=R.length;++P<re;){var we=Ju(I[P],Q[P]);if(we){if(P>=fe)return we;var qe=R[P];return we*(qe=="desc"?-1:1)}}return d.index-g.index}function B1(d,g,R,P){for(var I=-1,Q=d.length,re=R.length,fe=-1,we=g.length,qe=or(Q-re,0),Ye=Pe(we+qe),Ze=!P;++fe<we;)Ye[fe]=g[fe];for(;++I<re;)(Ze||I<Q)&&(Ye[R[I]]=d[I]);for(;qe--;)Ye[fe++]=d[I++];return Ye}function ev(d,g,R,P){for(var I=-1,Q=d.length,re=-1,fe=R.length,we=-1,qe=g.length,Ye=or(Q-fe,0),Ze=Pe(Ye+qe),ct=!P;++I<Ye;)Ze[I]=d[I];for(var Dt=I;++we<qe;)Ze[Dt+we]=g[we];for(;++re<fe;)(ct||I<Q)&&(Ze[Dt+R[re]]=d[I++]);return Ze}function Ur(d,g){var R=-1,P=d.length;for(g||(g=Pe(P));++R<P;)g[R]=d[R];return g}function Ai(d,g,R,P){var I=!R;R||(R={});for(var Q=-1,re=g.length;++Q<re;){var fe=g[Q],we=P?P(R[fe],d[fe],fe,R,d):n;we===n&&(we=d[fe]),I?Ws(R,fe,we):Nl(R,fe,we)}return R}function lh(d,g){return Ai(d,od(d),g)}function ed(d,g){return Ai(d,ph(d),g)}function kl(d,g){return function(R,P){var I=Kt(R)?nL:Ma,Q=g?g():{};return I(R,d,zt(P,2),Q)}}function Pl(d){return cn(function(g,R){var P=-1,I=R.length,Q=I>1?R[I-1]:n,re=I>2?R[2]:n;for(Q=d.length>3&&typeof Q=="function"?(I--,Q):n,re&&xi(R[0],R[1],re)&&(Q=I<3?n:Q,I=1),g=Nn(g);++P<I;){var fe=R[P];fe&&d(g,fe,P,Q)}return g})}function U1(d,g){return function(R,P){if(R==null)return R;if(!Hr(R))return d(R,P);for(var I=R.length,Q=g?I:-1,re=Nn(R);(g?Q--:++Q<I)&&P(re[Q],Q,re)!==!1;);return R}}function zl(d){return function(g,R,P){for(var I=-1,Q=Nn(g),re=P(g),fe=re.length;fe--;){var we=re[d?fe:++I];if(R(Q[we],we,Q)===!1)break}return g}}function tv(d,g,R){var P=g&S,I=Cs(d);function Q(){var re=this&&this!==Or&&this instanceof Q?I:d;return re.apply(P?R:this,arguments)}return Q}function ts(d){return function(g){g=Bn(g);var R=wa(g)?vs(g):n,P=R?R[0]:g.charAt(0),I=R?Ta(R,1).join(""):g.slice(1);return P[d]()+I}}function yi(d){return function(g){return n1(L(Jo(g).replace(ya,"")),d,"")}}function Cs(d){return function(){var g=arguments;switch(g.length){case 0:return new d;case 1:return new d(g[0]);case 2:return new d(g[0],g[1]);case 3:return new d(g[0],g[1],g[2]);case 4:return new d(g[0],g[1],g[2],g[3]);case 5:return new d(g[0],g[1],g[2],g[3],g[4]);case 6:return new d(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new d(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var R=Ji(d.prototype),P=d.apply(R,g);return mr(P)?P:R}}function nv(d,g,R){var P=Cs(d);function I(){for(var Q=arguments.length,re=Pe(Q),fe=Q,we=Ul(I);fe--;)re[fe]=arguments[fe];var qe=Q<3&&re[0]!==we&&re[Q-1]!==we?[]:Sa(re,we);if(Q-=qe.length,Q<R)return F1(d,g,Rr,I.placeholder,n,re,qe,n,n,R-Q);var Ye=this&&this!==Or&&this instanceof I?P:d;return Ri(Ye,this,re)}return I}function qo(d){return function(g,R,P){var I=Nn(g);if(!Hr(g)){var Q=zt(R,3);g=$r(g),R=function(fe){return Q(I[fe],fe,I)}}var re=d(g,R,P);return re>-1?I[Q?g[re]:re]:n}}function lo(d){return ar(function(g){var R=g.length,P=R,I=Ni.prototype.thru;for(d&&g.reverse();P--;){var Q=g[P];if(typeof Q!="function")throw new Zi(l);if(I&&!re&&sd(Q)=="wrapper")var re=new Ni([],!0)}for(P=re?P:R;++P<R;){Q=g[P];var fe=sd(Q),we=fe=="wrapper"?hh(Q):n;we&&vh(we[0])&&we[1]==(T|c|D|A)&&!we[4].length&&we[9]==1?re=re[sd(we[0])].apply(re,we[3]):re=Q.length==1&&vh(Q)?re[fe]():re.thru(Q)}return function(){var qe=arguments,Ye=qe[0];if(re&&qe.length==1&&Kt(Ye))return re.plant(Ye).value();for(var Ze=0,ct=R?g[Ze].apply(this,qe):Ye;++Ze<R;)ct=g[Ze].call(this,ct);return ct}})}function Rr(d,g,R,P,I,Q,re,fe,we,qe){var Ye=g&T,Ze=g&S,ct=g&_,Dt=g&(c|j),Gt=g&H,pn=ct?n:Cs(d);function Yt(){for(var Cn=arguments.length,Tn=Pe(Cn),Zs=Cn;Zs--;)Tn[Zs]=arguments[Zs];if(Dt)var os=Ul(Yt),Js=cL(Tn,os);if(P&&(Tn=B1(Tn,P,I,Dt)),Q&&(Tn=ev(Tn,Q,re,Dt)),Cn-=Js,Dt&&Cn<qe){var Vr=Sa(Tn,os);return F1(d,g,Rr,Yt.placeholder,R,Tn,Vr,fe,we,qe-Cn)}var ea=Ze?R:this,$l=ct?ea[d]:d;return Cn=Tn.length,fe?Tn=uo(Tn,fe):Gt&&Cn>1&&Tn.reverse(),Ye&&we<Cn&&(Tn.length=we),this&&this!==Or&&this instanceof Yt&&($l=pn||Cs($l)),$l.apply(ea,Tn)}return Yt}function td(d,g){return function(R,P){return w1(R,d,g(P),{})}}function Nc(d,g){return function(R,P){var I;if(R===n&&P===n)return g;if(R!==n&&(I=R),P!==n){if(I===n)return P;typeof R=="string"||typeof P=="string"?(R=Di(R),P=Di(P)):(R=sh(R),P=sh(P)),I=d(R,P)}return I}}function nd(d){return ar(function(g){return g=ur(g,Ki(zt())),cn(function(R){var P=this;return d(g,function(I){return Ri(I,P,R)})})})}function rd(d,g){g=g===n?" ":Di(g);var R=g.length;if(R<2)return R?T1(g,d):g;var P=T1(g,bc(d/so(g)));return wa(g)?Ta(vs(P),0,d).join(""):P.slice(0,d)}function rv(d,g,R,P){var I=g&S,Q=Cs(d);function re(){for(var fe=-1,we=arguments.length,qe=-1,Ye=P.length,Ze=Pe(Ye+we),ct=this&&this!==Or&&this instanceof re?Q:d;++qe<Ye;)Ze[qe]=P[qe];for(;we--;)Ze[qe++]=arguments[++fe];return Ri(ct,I?R:this,Ze)}return re}function Da(d){return function(g,R,P){return P&&typeof P!="number"&&xi(g,R,P)&&(R=P=n),g=po(g),R===n?(R=g,g=0):R=po(R),P=P===n?g<R?1:-1:po(P),W0(g,R,P,d)}}function Bl(d){return function(g,R){return typeof g=="string"&&typeof R=="string"||(g=Ms(g),R=Ms(R)),d(g,R)}}function F1(d,g,R,P,I,Q,re,fe,we,qe){var Ye=g&c,Ze=Ye?re:n,ct=Ye?n:re,Dt=Ye?Q:n,Gt=Ye?n:Q;g|=Ye?D:B,g&=~(Ye?B:D),g&N||(g&=-4);var pn=[d,g,I,Dt,Ze,Gt,ct,fe,we,qe],Yt=R.apply(n,pn);return vh(d)&&bh(Yt,pn),Yt.placeholder=P,Lh(Yt,d,g)}function ch(d){var g=jr[d];return function(R,P){if(R=Ms(R),P=P==null?0:dr(tn(P),292),P&&Au(R)){var I=(Bn(R)+"e").split("e"),Q=g(I[0]+"e"+(+I[1]+P));return I=(Bn(Q)+"e").split("e"),+(I[0]+"e"+(+I[1]-P))}return g(R)}}var iv=Ln&&1/Pf(new Ln([,-0]))[1]==K?function(d){return new Ln(d)}:yt;function id(d){return function(g){var R=Qr(g);return R==ae?kf(g):R==ot?uL(g):lL(g,d(g))}}function co(d,g,R,P,I,Q,re,fe){var we=g&_;if(!we&&typeof d!="function")throw new Zi(l);var qe=P?P.length:0;if(qe||(g&=-97,P=I=n),re=re===n?re:or(tn(re),0),fe=fe===n?fe:tn(fe),qe-=I?I.length:0,g&B){var Ye=P,Ze=I;P=I=n}var ct=we?n:hh(d),Dt=[d,g,R,P,I,Ye,Ze,Q,re,fe];if(ct&&cd(Dt,ct),d=Dt[0],g=Dt[1],R=Dt[2],P=Dt[3],I=Dt[4],fe=Dt[9]=Dt[9]===n?we?0:d.length:or(Dt[9]-qe,0),!fe&&g&(c|j)&&(g&=-25),!g||g==S)var Gt=tv(d,g,R);else g==c||g==j?Gt=nv(d,g,fe):(g==D||g==(S|D))&&!I.length?Gt=rv(d,g,R,P):Gt=Rr.apply(n,Dt);var pn=ct?Wu:bh;return Lh(pn(Gt,Dt),d,g)}function uh(d,g,R,P){return d===n||zi(d,vc[R])&&!zn.call(P,R)?g:d}function H1(d,g,R,P,I,Q){return mr(d)&&mr(g)&&(Q.set(g,d),qu(d,g,n,H1,Q),Q.delete(g)),d}function sv(d){return _s(d)?n:d}function ov(d,g,R,P,I,Q){var re=R&M,fe=d.length,we=g.length;if(fe!=we&&!(re&&we>fe))return!1;var qe=Q.get(d),Ye=Q.get(g);if(qe&&Ye)return qe==g&&Ye==d;var Ze=-1,ct=!0,Dt=R&C?new Fo:n;for(Q.set(d,g),Q.set(g,d);++Ze<fe;){var Gt=d[Ze],pn=g[Ze];if(P)var Yt=re?P(pn,Gt,Ze,g,d,Q):P(Gt,pn,Ze,d,g,Q);if(Yt!==n){if(Yt)continue;ct=!1;break}if(Dt){if(!r1(g,function(Cn,Tn){if(!hc(Dt,Tn)&&(Gt===Cn||I(Gt,Cn,R,P,Q)))return Dt.push(Tn)})){ct=!1;break}}else if(!(Gt===pn||I(Gt,pn,R,P,Q))){ct=!1;break}}return Q.delete(d),Q.delete(g),ct}function av(d,g,R,P,I,Q,re){switch(R){case k:if(d.byteLength!=g.byteLength||d.byteOffset!=g.byteOffset)return!1;d=d.buffer,g=g.buffer;case $:return!(d.byteLength!=g.byteLength||!Q(new xc(d),new xc(g)));case ve:case he:case We:return zi(+d,+g);case ke:return d.name==g.name&&d.message==g.message;case at:case Ct:return d==g+"";case ae:var fe=kf;case ot:var we=P&M;if(fe||(fe=Pf),d.size!=g.size&&!we)return!1;var qe=re.get(d);if(qe)return qe==g;P|=C,re.set(d,g);var Ye=ov(fe(d),fe(g),P,I,Q,re);return re.delete(d),Ye;case Ot:if(Rl)return Rl.call(d)==Rl.call(g)}return!1}function Kr(d,g,R,P,I,Q){var re=R&M,fe=dh(d),we=fe.length,qe=dh(g),Ye=qe.length;if(we!=Ye&&!re)return!1;for(var Ze=we;Ze--;){var ct=fe[Ze];if(!(re?ct in g:zn.call(g,ct)))return!1}var Dt=Q.get(d),Gt=Q.get(g);if(Dt&&Gt)return Dt==g&&Gt==d;var pn=!0;Q.set(d,g),Q.set(g,d);for(var Yt=re;++Ze<we;){ct=fe[Ze];var Cn=d[ct],Tn=g[ct];if(P)var Zs=re?P(Tn,Cn,ct,g,d,Q):P(Cn,Tn,ct,d,g,Q);if(!(Zs===n?Cn===Tn||I(Cn,Tn,R,P,Q):Zs)){pn=!1;break}Yt||(Yt=ct=="constructor")}if(pn&&!Yt){var os=d.constructor,Js=g.constructor;os!=Js&&"constructor"in d&&"constructor"in g&&!(typeof os=="function"&&os instanceof os&&typeof Js=="function"&&Js instanceof Js)&&(pn=!1)}return Q.delete(d),Q.delete(g),pn}function ar(d){return ud(W1(d,n,ki),d+"")}function dh(d){return F0(d,$r,od)}function fh(d){return F0(d,Zr,ph)}var hh=Lc?function(d){return Lc.get(d)}:yt;function sd(d){for(var g=d.name+"",R=Ls[g],P=zn.call(Ls,g)?R.length:0;P--;){var I=R[P],Q=I.func;if(Q==null||Q==d)return I.name}return g}function Ul(d){var g=zn.call(q,"placeholder")?q:d;return g.placeholder}function zt(){var d=q.iteratee||Ht;return d=d===Ht?E1:d,arguments.length?d(arguments[0],arguments[1]):d}function Oc(d,g){var R=d.__data__;return Go(g)?R[typeof g=="string"?"string":"hash"]:R.map}function mh(d){for(var g=$r(d),R=g.length;R--;){var P=g[R],I=d[P];g[R]=[P,I,dv(I)]}return g}function Aa(d,g){var R=o1(d,g);return ao(R)?R:n}function lv(d){var g=zn.call(d,gi),R=d[gi];try{d[gi]=n;var P=!0}catch{}var I=pi.call(d);return P&&(g?d[gi]=R:delete d[gi]),I}var od=Ea?function(d){return d==null?[]:(d=Nn(d),io(Ea(d),function(g){return wl.call(d,g)}))}:n2,ph=Ea?function(d){for(var g=[];d;)zo(g,od(d)),d=Ou(d);return g}:n2,Qr=Sn;(ju&&Qr(new ju(new ArrayBuffer(1)))!=k||Br&&Qr(new Br)!=ae||fr&&Qr(fr.resolve())!=mt||Ln&&Qr(new Ln)!=ot||qs&&Qr(new qs)!=_t)&&(Qr=function(d){var g=Sn(d),R=g==tt?d.constructor:n,P=R?Yo(R):"";if(P)switch(P){case M0:return k;case N0:return ae;case ku:return mt;case Pu:return ot;case O0:return _t}return g});function cv(d,g,R){for(var P=-1,I=R.length;++P<I;){var Q=R[P],re=Q.size;switch(Q.type){case"drop":d+=re;break;case"dropRight":g-=re;break;case"take":g=dr(g,d+re);break;case"takeRight":d=or(d,g-re);break}}return{start:d,end:g}}function I1(d){var g=d.match(ce);return g?g[1].split(Ue):[]}function ad(d,g,R){g=Vo(g,d);for(var P=-1,I=g.length,Q=!1;++P<I;){var re=Fn(g[P]);if(!(Q=d!=null&&R(d,re)))break;d=d[re]}return Q||++P!=I?Q:(I=d==null?0:d.length,!!I&&Il(I)&&Xs(re,I)&&(Kt(d)||Zo(d)))}function $1(d){var g=d.length,R=new d.constructor(g);return g&&typeof d[0]=="string"&&zn.call(d,"index")&&(R.index=d.index,R.input=d.input),R}function V1(d){return typeof d.constructor=="function"&&!tr(d)?Ji(Ou(d)):{}}function q1(d,g,R){var P=d.constructor;switch(g){case $:return jl(d);case ve:case he:return new P(+d);case k:return P1(d,R);case z:case J:case le:case xe:case Ae:case wt:case Mt:case nt:case pt:return z1(d,R);case ae:return new P;case We:case Ct:return new P(d);case at:return ah(d);case ot:return new P;case Ot:return Z0(d)}}function uv(d,g){var R=g.length;if(!R)return d;var P=R-1;return g[P]=(R>1?"& ":"")+g[P],g=g.join(R>2?", ":" "),d.replace(Tt,`{
/* [wrapped with `+g+`] */
`)}function Wo(d){return Kt(d)||Zo(d)||!!(_i&&d&&d[_i])}function Xs(d,g){var R=typeof d;return g=g??Z,!!g&&(R=="number"||R!="symbol"&&Sr.test(d))&&d>-1&&d%1==0&&d<g}function xi(d,g,R){if(!mr(R))return!1;var P=typeof g;return(P=="number"?Hr(R)&&Xs(g,R.length):P=="string"&&g in R)?zi(R[g],d):!1}function gh(d,g){if(Kt(d))return!1;var R=typeof d;return R=="number"||R=="symbol"||R=="boolean"||d==null||bi(d)?!0:Jt.test(d)||!gt.test(d)||g!=null&&d in Nn(g)}function Go(d){var g=typeof d;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?d!=="__proto__":d===null}function vh(d){var g=sd(d),R=q[g];if(typeof R!="function"||!(g in hn.prototype))return!1;if(d===R)return!0;var P=hh(R);return!!P&&d===P[0]}function yh(d){return!!c1&&c1 in d}var ld=Mu?Ks:r2;function tr(d){var g=d&&d.constructor,R=typeof g=="function"&&g.prototype||vc;return d===R}function dv(d){return d===d&&!mr(d)}function fv(d,g){return function(R){return R==null?!1:R[d]===g&&(g!==n||d in Nn(R))}}function hv(d){var g=bd(d,function(P){return R.size===p&&R.clear(),P}),R=g.cache;return g}function cd(d,g){var R=d[1],P=g[1],I=R|P,Q=I<(S|_|T),re=P==T&&R==c||P==T&&R==A&&d[7].length<=g[8]||P==(T|A)&&g[7].length<=g[8]&&R==c;if(!(Q||re))return d;P&S&&(d[2]=g[2],I|=R&S?0:N);var fe=g[3];if(fe){var we=d[3];d[3]=we?B1(we,fe,g[4]):fe,d[4]=we?Sa(d[3],x):g[4]}return fe=g[5],fe&&(we=d[5],d[5]=we?ev(we,fe,g[6]):fe,d[6]=we?Sa(d[5],x):g[6]),fe=g[7],fe&&(d[7]=fe),P&T&&(d[8]=d[8]==null?g[8]:dr(d[8],g[8])),d[9]==null&&(d[9]=g[9]),d[0]=g[0],d[1]=I,d}function ja(d){var g=[];if(d!=null)for(var R in Nn(d))g.push(R);return g}function mv(d){return pi.call(d)}function W1(d,g,R){return g=or(g===n?d.length-1:g,0),function(){for(var P=arguments,I=-1,Q=or(P.length-g,0),re=Pe(Q);++I<Q;)re[I]=P[g+I];I=-1;for(var fe=Pe(g+1);++I<g;)fe[I]=P[I];return fe[g]=R(re),Ri(d,this,fe)}}function Tc(d,g){return g.length<2?d:Ss(d,es(g,0,-1))}function uo(d,g){for(var R=d.length,P=dr(g.length,R),I=Ur(d);P--;){var Q=g[P];d[P]=Xs(Q,R)?I[Q]:n}return d}function xh(d,g){if(!(g==="constructor"&&typeof d[g]=="function")&&g!="__proto__")return d[g]}var bh=dd(Wu),Dc=d1||function(d,g){return Or.setTimeout(d,g)},ud=dd(Gu);function Lh(d,g,R){var P=g+"";return ud(d,uv(P,pv(I1(P),R)))}function dd(d){var g=0,R=0;return function(){var P=Uo(),I=G-(P-R);if(R=P,I>0){if(++g>=ee)return arguments[0]}else g=0;return d.apply(n,arguments)}}function fd(d,g){var R=-1,P=d.length,I=P-1;for(g=g===n?P:g;++R<g;){var Q=nh(R,I),re=d[Q];d[Q]=d[R],d[R]=re}return d.length=g,d}var fo=hv(function(d){var g=[];return d.charCodeAt(0)===46&&g.push(""),d.replace(St,function(R,P,I,Q){g.push(I?Q.replace(ht,"$1"):P||R)}),g});function Fn(d){if(typeof d=="string"||bi(d))return d;var g=d+"";return g=="0"&&1/d==-1/0?"-0":g}function Yo(d){if(d!=null){try{return Nu.call(d)}catch{}try{return d+""}catch{}}return""}function pv(d,g){return gs(pe,function(R){var P="_."+R[0];g&R[1]&&!Mf(d,P)&&d.push(P)}),d.sort()}function Fr(d){if(d instanceof hn)return d.clone();var g=new Ni(d.__wrapped__,d.__chain__);return g.__actions__=Ur(d.__actions__),g.__index__=d.__index__,g.__values__=d.__values__,g}function bL(d,g,R){(R?xi(d,g,R):g===n)?g=1:g=or(tn(g),0);var P=d==null?0:d.length;if(!P||g<1)return[];for(var I=0,Q=0,re=Pe(bc(P/g));I<P;)re[Q++]=es(d,I,I+=g);return re}function gv(d){for(var g=-1,R=d==null?0:d.length,P=0,I=[];++g<R;){var Q=d[g];Q&&(I[P++]=Q)}return I}function vv(){var d=arguments.length;if(!d)return[];for(var g=Pe(d-1),R=arguments[0],P=d;P--;)g[P-1]=arguments[P];return zo(Kt(R)?Ur(R):[R],wn(g,1))}var hr=cn(function(d,g){return Mr(d)?Na(d,wn(g,1,Mr,!0)):[]}),ji=cn(function(d,g){var R=di(g);return Mr(R)&&(R=n),Mr(d)?Na(d,wn(g,1,Mr,!0),zt(R,2)):[]}),Xo=cn(function(d,g){var R=di(g);return Mr(R)&&(R=n),Mr(d)?Na(d,wn(g,1,Mr,!0),n,R):[]});function yv(d,g,R){var P=d==null?0:d.length;return P?(g=R||g===n?1:tn(g),es(d,g<0?0:g,P)):[]}function xv(d,g,R){var P=d==null?0:d.length;return P?(g=R||g===n?1:tn(g),g=P-g,es(d,0,g<0?0:g)):[]}function LL(d,g){return d&&d.length?Ku(d,zt(g,3),!0,!0):[]}function G1(d,g){return d&&d.length?Ku(d,zt(g,3),!0):[]}function ns(d,g,R,P){var I=d==null?0:d.length;return I?(R&&typeof R!="number"&&xi(d,g,R)&&(R=0,P=I),dn(d,g,R,P)):[]}function Es(d,g,R){var P=d==null?0:d.length;if(!P)return-1;var I=R==null?0:tn(R);return I<0&&(I=or(P+I,0)),Nf(d,zt(g,3),I)}function Y1(d,g,R){var P=d==null?0:d.length;if(!P)return-1;var I=P-1;return R!==n&&(I=tn(R),I=R<0?or(P+I,0):dr(I,P-1)),Nf(d,zt(g,3),I,!0)}function ki(d){var g=d==null?0:d.length;return g?wn(d,1):[]}function bv(d){var g=d==null?0:d.length;return g?wn(d,K):[]}function ka(d,g){var R=d==null?0:d.length;return R?(g=g===n?1:tn(g),wn(d,g)):[]}function Fl(d){for(var g=-1,R=d==null?0:d.length,P={};++g<R;){var I=d[g];P[I[0]]=I[1]}return P}function Ko(d){return d&&d.length?d[0]:n}function X1(d,g,R){var P=d==null?0:d.length;if(!P)return-1;var I=R==null?0:tn(R);return I<0&&(I=or(P+I,0)),dc(d,g,I)}function K1(d){var g=d==null?0:d.length;return g?es(d,0,-1):[]}var ho=cn(function(d){var g=ur(d,oh);return g.length&&g[0]===d[0]?L1(g):[]}),Lv=cn(function(d){var g=di(d),R=ur(d,oh);return g===di(R)?g=n:R.pop(),R.length&&R[0]===d[0]?L1(R,zt(g,2)):[]}),Ac=cn(function(d){var g=di(d),R=ur(d,oh);return g=typeof g=="function"?g:n,g&&R.pop(),R.length&&R[0]===d[0]?L1(R,n,g):[]});function hd(d,g){return d==null?"":xs.call(d,g)}function di(d){var g=d==null?0:d.length;return g?d[g-1]:n}function jc(d,g,R){var P=d==null?0:d.length;if(!P)return-1;var I=P;return R!==n&&(I=tn(R),I=I<0?or(P+I,0):dr(I,P-1)),g===g?Qi(d,g,I):Nf(d,fc,I,!0)}function wv(d,g){return d&&d.length?M1(d,tn(g)):n}var Sv=cn(kc);function kc(d,g){return d&&d.length&&g&&g.length?th(d,g):d}function Cv(d,g,R){return d&&d.length&&g&&g.length?th(d,g,zt(R,2)):d}function wh(d,g,R){return d&&d.length&&g&&g.length?th(d,g,n,R):d}var Ev=ar(function(d,g){var R=d==null?0:d.length,P=Hu(d,g);return O1(d,ur(g,function(I){return Xs(I,R)?+I:I}).sort(Ju)),P});function wL(d,g){var R=[];if(!(d&&d.length))return R;var P=-1,I=[],Q=d.length;for(g=zt(g,3);++P<Q;){var re=d[P];g(re,P,d)&&(R.push(re),I.push(P))}return O1(d,I),R}function Q1(d){return d==null?d:h1.call(d)}function $n(d,g,R){var P=d==null?0:d.length;return P?(R&&typeof R!="number"&&xi(d,g,R)?(g=0,R=P):(g=g==null?0:tn(g),R=R===n?P:tn(R)),es(d,g,R)):[]}function ir(d,g){return Yu(d,g)}function vn(d,g,R){return ih(d,g,zt(R,2))}function Rn(d,g){var R=d==null?0:d.length;if(R){var P=Yu(d,g);if(P<R&&zi(d[P],g))return P}return-1}function Vn(d,g){return Yu(d,g,!0)}function rs(d,g,R){return ih(d,g,zt(R,2),!0)}function Pa(d,g){var R=d==null?0:d.length;if(R){var P=Yu(d,g,!0)-1;if(zi(d[P],g))return P}return-1}function Pc(d){return d&&d.length?D1(d):[]}function Z1(d,g){return d&&d.length?D1(d,zt(g,2)):[]}function Qo(d){var g=d==null?0:d.length;return g?es(d,1,g):[]}function _r(d,g,R){return d&&d.length?(g=R||g===n?1:tn(g),es(d,0,g<0?0:g)):[]}function za(d,g,R){var P=d==null?0:d.length;return P?(g=R||g===n?1:tn(g),g=P-g,es(d,g<0?0:g,P)):[]}function Hl(d,g){return d&&d.length?Ku(d,zt(g,3),!1,!0):[]}function J1(d,g){return d&&d.length?Ku(d,zt(g,3)):[]}var Rs=cn(function(d){return $o(wn(d,1,Mr,!0))}),zc=cn(function(d){var g=di(d);return Mr(g)&&(g=n),$o(wn(d,1,Mr,!0),zt(g,2))}),md=cn(function(d){var g=di(d);return g=typeof g=="function"?g:n,$o(wn(d,1,Mr,!0),n,g)});function Pi(d){return d&&d.length?$o(d):[]}function ep(d,g){return d&&d.length?$o(d,zt(g,2)):[]}function tp(d,g){return g=typeof g=="function"?g:n,d&&d.length?$o(d,n,g):[]}function Bc(d){if(!(d&&d.length))return[];var g=0;return d=io(d,function(R){if(Mr(R))return g=or(R.length,g),!0}),La(g,function(R){return ur(d,Of(R))})}function pd(d,g){if(!(d&&d.length))return[];var R=Bc(d);return g==null?R:ur(R,function(P){return Ri(g,n,P)})}var Ba=cn(function(d,g){return Mr(d)?Na(d,g):[]}),ii=cn(function(d){return Qu(io(d,Mr))}),Ua=cn(function(d){var g=di(d);return Mr(g)&&(g=n),Qu(io(d,Mr),zt(g,2))}),Uc=cn(function(d){var g=di(d);return g=typeof g=="function"?g:n,Qu(io(d,Mr),n,g)}),Fc=cn(Bc);function np(d,g){return j1(d||[],g||[],Nl)}function rp(d,g){return j1(d||[],g||[],Mc)}var Rv=cn(function(d){var g=d.length,R=g>1?d[g-1]:n;return R=typeof R=="function"?(d.pop(),R):n,pd(d,R)});function Hc(d){var g=q(d);return g.__chain__=!0,g}function ip(d,g){return g(d),d}function fi(d,g){return g(d)}var _v=ar(function(d){var g=d.length,R=g?d[0]:0,P=this.__wrapped__,I=function(Q){return Hu(Q,d)};return g>1||this.__actions__.length||!(P instanceof hn)||!Xs(R)?this.thru(I):(P=P.slice(R,+R+(g?1:0)),P.__actions__.push({func:fi,args:[I],thisArg:n}),new Ni(P,this.__chain__).thru(function(Q){return g&&!Q.length&&Q.push(n),Q}))});function is(){return Hc(this)}function Mv(){return new Ni(this.value(),this.__chain__)}function Nv(){this.__values__===n&&(this.__values__=ss(this.value()));var d=this.__index__>=this.__values__.length,g=d?n:this.__values__[this.__index__++];return{done:d,value:g}}function SL(){return this}function Fa(d){for(var g,R=this;R instanceof ws;){var P=Fr(R);P.__index__=0,P.__values__=n,g?I.__wrapped__=P:g=P;var I=P;R=R.__wrapped__}return I.__wrapped__=d,g}function Sh(){var d=this.__wrapped__;if(d instanceof hn){var g=d;return this.__actions__.length&&(g=new hn(this)),g=g.reverse(),g.__actions__.push({func:fi,args:[Q1],thisArg:n}),new Ni(g,this.__chain__)}return this.thru(Q1)}function sp(){return X0(this.__wrapped__,this.__actions__)}var Ic=kl(function(d,g,R){zn.call(d,R)?++d[R]:Ws(d,R,1)});function Ov(d,g,R){var P=Kt(d)?p0:x1;return R&&xi(d,g,R)&&(g=n),P(d,zt(g,3))}function Tv(d,g){var R=Kt(d)?io:In;return R(d,zt(g,3))}var Dv=qo(Es),op=qo(Y1);function ap(d,g){return wn(gd(d,g),1)}function CL(d,g){return wn(gd(d,g),K)}function EL(d,g,R){return R=R===n?1:tn(R),wn(gd(d,g),R)}function Av(d,g){var R=Kt(d)?gs:Io;return R(d,zt(g,3))}function lp(d,g){var R=Kt(d)?rL:Gf;return R(d,zt(g,3))}var jv=kl(function(d,g,R){zn.call(d,R)?d[R].push(g):Ws(d,R,[g])});function $c(d,g,R,P){d=Hr(d)?d:Kc(d),R=R&&!P?tn(R):0;var I=d.length;return R<0&&(R=or(I+R,0)),kh(d)?R<=I&&d.indexOf(g,R)>-1:!!I&&dc(d,g,R)>-1}var Ch=cn(function(d,g,R){var P=-1,I=typeof g=="function",Q=Hr(d)?Pe(d.length):[];return Io(d,function(re){Q[++P]=I?Ri(g,re,R):Dl(re,g,R)}),Q}),kv=kl(function(d,g,R){Ws(d,R,g)});function gd(d,g){var R=Kt(d)?ur:R1;return R(d,zt(g,3))}function Pv(d,g,R,P){return d==null?[]:(Kt(g)||(g=g==null?[]:[g]),R=P?n:R,Kt(R)||(R=R==null?[]:[R]),N1(d,g,R))}var zv=kl(function(d,g,R){d[R?0:1].push(g)},function(){return[[],[]]});function Bv(d,g,R){var P=Kt(d)?n1:s1,I=arguments.length<3;return P(d,zt(g,4),R,I,Io)}function Uv(d,g,R){var P=Kt(d)?iL:s1,I=arguments.length<3;return P(d,zt(g,4),R,I,Gf)}function Eh(d,g){var R=Kt(d)?io:In;return R(d,Ld(zt(g,3)))}function Fv(d){var g=Kt(d)?Sc:_c;return g(d)}function Hv(d,g,R){(R?xi(d,g,R):g===n)?g=1:g=tn(g);var P=Kt(d)?z0:rh;return P(d,g)}function nr(d){var g=Kt(d)?B0:G0;return g(d)}function cp(d){if(d==null)return 0;if(Hr(d))return kh(d)?so(d):d.length;var g=Qr(d);return g==ae||g==ot?d.size:Qf(d).length}function RL(d,g,R){var P=Kt(d)?r1:Y0;return R&&xi(d,g,R)&&(g=n),P(d,zt(g,3))}var Iv=cn(function(d,g){if(d==null)return[];var R=g.length;return R>1&&xi(d,g[0],g[1])?g=[]:R>2&&xi(g[0],g[1],g[2])&&(g=[g[0]]),N1(d,wn(g,1),[])}),Rh=Cl||function(){return Or.Date.now()};function _L(d,g){if(typeof g!="function")throw new Zi(l);return d=tn(d),function(){if(--d<1)return g.apply(this,arguments)}}function $v(d,g,R){return g=R?n:g,g=d&&g==null?d.length:g,co(d,T,n,n,n,n,g)}function vd(d,g){var R;if(typeof g!="function")throw new Zi(l);return d=tn(d),function(){return--d>0&&(R=g.apply(this,arguments)),d<=1&&(g=n),R}}var Ha=cn(function(d,g,R){var P=S;if(R.length){var I=Sa(R,Ul(Ha));P|=D}return co(d,P,g,R,I)}),_h=cn(function(d,g,R){var P=S|_;if(R.length){var I=Sa(R,Ul(_h));P|=D}return co(g,P,d,R,I)});function yd(d,g,R){g=R?n:g;var P=co(d,c,n,n,n,n,n,g);return P.placeholder=yd.placeholder,P}function Mh(d,g,R){g=R?n:g;var P=co(d,j,n,n,n,n,n,g);return P.placeholder=Mh.placeholder,P}function Ia(d,g,R){var P,I,Q,re,fe,we,qe=0,Ye=!1,Ze=!1,ct=!0;if(typeof d!="function")throw new Zi(l);g=Ms(g)||0,mr(R)&&(Ye=!!R.leading,Ze="maxWait"in R,Q=Ze?or(Ms(R.maxWait)||0,g):Q,ct="trailing"in R?!!R.trailing:ct);function Dt(Vr){var ea=P,$l=I;return P=I=n,qe=Vr,re=d.apply($l,ea),re}function Gt(Vr){return qe=Vr,fe=Dc(Cn,g),Ye?Dt(Vr):re}function pn(Vr){var ea=Vr-we,$l=Vr-qe,FS=g-ea;return Ze?dr(FS,Q-$l):FS}function Yt(Vr){var ea=Vr-we,$l=Vr-qe;return we===n||ea>=g||ea<0||Ze&&$l>=Q}function Cn(){var Vr=Rh();if(Yt(Vr))return Tn(Vr);fe=Dc(Cn,pn(Vr))}function Tn(Vr){return fe=n,ct&&P?Dt(Vr):(P=I=n,re)}function Zs(){fe!==n&&Q0(fe),qe=0,P=we=I=fe=n}function os(){return fe===n?re:Tn(Rh())}function Js(){var Vr=Rh(),ea=Yt(Vr);if(P=arguments,I=this,we=Vr,ea){if(fe===n)return Gt(we);if(Ze)return Q0(fe),fe=Dc(Cn,g),Dt(we)}return fe===n&&(fe=Dc(Cn,g)),re}return Js.cancel=Zs,Js.flush=os,Js}var mo=cn(function(d,g){return Ol(d,1,g)}),xd=cn(function(d,g,R){return Ol(d,Ms(g)||0,R)});function ML(d){return co(d,H)}function bd(d,g){if(typeof d!="function"||g!=null&&typeof g!="function")throw new Zi(l);var R=function(){var P=arguments,I=g?g.apply(this,P):P[0],Q=R.cache;if(Q.has(I))return Q.get(I);var re=d.apply(this,P);return R.cache=Q.set(I,re)||Q,re};return R.cache=new(bd.Cache||Oi),R}bd.Cache=Oi;function Ld(d){if(typeof d!="function")throw new Zi(l);return function(){var g=arguments;switch(g.length){case 0:return!d.call(this);case 1:return!d.call(this,g[0]);case 2:return!d.call(this,g[0],g[1]);case 3:return!d.call(this,g[0],g[1],g[2])}return!d.apply(this,g)}}function Vv(d){return vd(2,d)}var qv=K0(function(d,g){g=g.length==1&&Kt(g[0])?ur(g[0],Ki(zt())):ur(wn(g,1),Ki(zt()));var R=g.length;return cn(function(P){for(var I=-1,Q=dr(P.length,R);++I<Q;)P[I]=g[I].call(this,P[I]);return Ri(d,this,P)})}),up=cn(function(d,g){var R=Sa(g,Ul(up));return co(d,D,n,g,R)}),Nh=cn(function(d,g){var R=Sa(g,Ul(Nh));return co(d,B,n,g,R)}),Wv=ar(function(d,g){return co(d,A,n,n,n,g)});function Gv(d,g){if(typeof d!="function")throw new Zi(l);return g=g===n?g:tn(g),cn(d,g)}function NL(d,g){if(typeof d!="function")throw new Zi(l);return g=g==null?0:or(tn(g),0),cn(function(R){var P=R[g],I=Ta(R,0,g);return P&&zo(I,P),Ri(d,this,I)})}function dp(d,g,R){var P=!0,I=!0;if(typeof d!="function")throw new Zi(l);return mr(R)&&(P="leading"in R?!!R.leading:P,I="trailing"in R?!!R.trailing:I),Ia(d,g,{leading:P,maxWait:g,trailing:I})}function fp(d){return $v(d,1)}function OL(d,g){return up(Zu(g),d)}function TL(){if(!arguments.length)return[];var d=arguments[0];return Kt(d)?d:[d]}function wd(d){return ci(d,E)}function DL(d,g){return g=typeof g=="function"?g:n,ci(d,E,g)}function Yv(d){return ci(d,b|E)}function yn(d,g){return g=typeof g=="function"?g:n,ci(d,b|E,g)}function hp(d,g){return g==null||y1(d,g,$r(g))}function zi(d,g){return d===g||d!==d&&g!==g}var mp=Bl(Iu),Xv=Bl(function(d,g){return d>=g}),Zo=Yf(function(){return arguments}())?Yf:function(d){return xr(d)&&zn.call(d,"callee")&&!wl.call(d,"callee")},Kt=Pe.isArray,Oh=_f?Ki(_f):Ti;function Hr(d){return d!=null&&Il(d.length)&&!Ks(d)}function Mr(d){return xr(d)&&Hr(d)}function AL(d){return d===!0||d===!1||xr(d)&&Sn(d)==ve}var $a=Hf||r2,Kv=u0?Ki(u0):kr;function Qv(d){return xr(d)&&d.nodeType===1&&!_s(d)}function Th(d){if(d==null)return!0;if(Hr(d)&&(Kt(d)||typeof d=="string"||typeof d.splice=="function"||$a(d)||Vc(d)||Zo(d)))return!d.length;var g=Qr(d);if(g==ae||g==ot)return!d.size;if(tr(d))return!Qf(d).length;for(var R in d)if(zn.call(d,R))return!1;return!0}function Yn(d,g){return Al(d,g)}function pp(d,g,R){R=typeof R=="function"?R:n;var P=R?R(d,g):n;return P===n?Al(d,g,n,R):!!P}function Ir(d){if(!xr(d))return!1;var g=Sn(d);return g==ke||g==de||typeof d.message=="string"&&typeof d.name=="string"&&!_s(d)}function jL(d){return typeof d=="number"&&Au(d)}function Ks(d){if(!mr(d))return!1;var g=Sn(d);return g==Ee||g==Ke||g==ye||g==Xe}function Dh(d){return typeof d=="number"&&d==tn(d)}function Il(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=Z}function mr(d){var g=typeof d;return d!=null&&(g=="object"||g=="function")}function xr(d){return d!=null&&typeof d=="object"}var Ah=d0?Ki(d0):Xf;function gp(d,g){return d===g||Vu(d,g,mh(g))}function kL(d,g,R){return R=typeof R=="function"?R:n,Vu(d,g,mh(g),R)}function Zv(d){return ey(d)&&d!=+d}function PL(d){if(ld(d))throw new $t(a);return ao(d)}function Jv(d){return d===null}function zL(d){return d==null}function ey(d){return typeof d=="number"||xr(d)&&Sn(d)==We}function _s(d){if(!xr(d)||Sn(d)!=tt)return!1;var g=Ou(d);if(g===null)return!0;var R=zn.call(g,"constructor")&&g.constructor;return typeof R=="function"&&R instanceof R&&Nu.call(R)==ys}var jh=f0?Ki(f0):Kf;function vp(d){return Dh(d)&&d>=-9007199254740991&&d<=Z}var ty=h0?Ki(h0):S1;function kh(d){return typeof d=="string"||!Kt(d)&&xr(d)&&Sn(d)==Ct}function bi(d){return typeof d=="symbol"||xr(d)&&Sn(d)==Ot}var Vc=m0?Ki(m0):C1;function Qs(d){return d===n}function yp(d){return xr(d)&&Qr(d)==_t}function ny(d){return xr(d)&&Sn(d)==kt}var ry=Bl(Zf),Sd=Bl(function(d,g){return d<=g});function ss(d){if(!d)return[];if(Hr(d))return kh(d)?vs(d):Ur(d);if(Sl&&d[Sl])return S0(d[Sl]());var g=Qr(d),R=g==ae?kf:g==ot?Pf:Kc;return R(d)}function po(d){if(!d)return d===0?d:0;if(d=Ms(d),d===K||d===-1/0){var g=d<0?-1:1;return g*oe}return d===d?d:0}function tn(d){var g=po(d),R=g%1;return g===g?R?g-R:g:0}function go(d){return d?Gs(tn(d),0,ne):0}function Ms(d){if(typeof d=="number")return d;if(bi(d))return Y;if(mr(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=mr(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=x0(d);var R=En.test(d);return R||ni.test(d)?tL(d.slice(2),R?2:8):ln.test(d)?Y:+d}function iy(d){return Ai(d,Zr(d))}function qc(d){return d?Gs(tn(d),-9007199254740991,Z):d===0?d:0}function Bn(d){return d==null?"":Di(d)}var BL=Pl(function(d,g){if(tr(g)||Hr(g)){Ai(g,$r(g),d);return}for(var R in g)zn.call(g,R)&&Nl(d,R,g[R])}),sy=Pl(function(d,g){Ai(g,Zr(g),d)}),Ph=Pl(function(d,g,R,P){Ai(g,Zr(g),d,P)}),UL=Pl(function(d,g,R,P){Ai(g,$r(g),d,P)}),FL=ar(Hu);function HL(d,g){var R=Ji(d);return g==null?R:Ho(R,g)}var IL=cn(function(d,g){d=Nn(d);var R=-1,P=g.length,I=P>2?g[2]:n;for(I&&xi(g[0],g[1],I)&&(P=1);++R<P;)for(var Q=g[R],re=Zr(Q),fe=-1,we=re.length;++fe<we;){var qe=re[fe],Ye=d[qe];(Ye===n||zi(Ye,vc[qe])&&!zn.call(d,qe))&&(d[qe]=Q[qe])}return d}),oy=cn(function(d){return d.push(n,H1),Ri(_d,n,d)});function Wc(d,g){return g0(d,zt(g,3),ui)}function Cd(d,g){return g0(d,zt(g,3),Rc)}function ay(d,g){return d==null?d:Ec(d,zt(g,3),Zr)}function $L(d,g){return d==null?d:Tl(d,zt(g,3),Zr)}function Gc(d,g){return d&&ui(d,zt(g,3))}function Ed(d,g){return d&&Rc(d,zt(g,3))}function ly(d){return d==null?[]:Oa(d,$r(d))}function zh(d){return d==null?[]:Oa(d,Zr(d))}function Rd(d,g,R){var P=d==null?n:Ss(d,g);return P===n?R:P}function xp(d,g){return d!=null&&ad(d,g,b1)}function Yc(d,g){return d!=null&&ad(d,g,H0)}var cy=td(function(d,g,R){g!=null&&typeof g.toString!="function"&&(g=pi.call(g)),d[g]=R},Ne(Oe)),uy=td(function(d,g,R){g!=null&&typeof g.toString!="function"&&(g=pi.call(g)),zn.call(d,g)?d[g].push(R):d[g]=[R]},zt),VL=cn(Dl);function $r(d){return Hr(d)?v1(d):Qf(d)}function Zr(d){return Hr(d)?v1(d,!0):$0(d)}function qL(d,g){var R={};return g=zt(g,3),ui(d,function(P,I,Q){Ws(R,g(P,I,Q),P)}),R}function WL(d,g){var R={};return g=zt(g,3),ui(d,function(P,I,Q){Ws(R,I,g(P,I,Q))}),R}var GL=Pl(function(d,g,R){qu(d,g,R)}),_d=Pl(function(d,g,R,P){qu(d,g,R,P)}),Bh=ar(function(d,g){var R={};if(d==null)return R;var P=!1;g=ur(g,function(Q){return Q=Vo(Q,d),P||(P=Q.length>1),Q}),Ai(d,fh(d),R),P&&(R=ci(R,b|w|E,sv));for(var I=g.length;I--;)Xu(R,g[I]);return R});function bp(d,g){return Xc(d,Ld(zt(g)))}var YL=ar(function(d,g){return d==null?{}:V0(d,g)});function Xc(d,g){if(d==null)return{};var R=ur(fh(d),function(P){return[P]});return g=zt(g),eh(d,R,function(P,I){return g(P,I[0])})}function XL(d,g,R){g=Vo(g,d);var P=-1,I=g.length;for(I||(I=1,d=n);++P<I;){var Q=d==null?n:d[Fn(g[P])];Q===n&&(P=I,Q=R),d=Ks(Q)?Q.call(d):Q}return d}function dy(d,g,R){return d==null?d:Mc(d,g,R)}function fy(d,g,R,P){return P=typeof P=="function"?P:n,d==null?d:Mc(d,g,R,P)}var Lp=id($r),wp=id(Zr);function Sp(d,g,R){var P=Kt(d),I=P||$a(d)||Vc(d);if(g=zt(g,4),R==null){var Q=d&&d.constructor;I?R=P?new Q:[]:mr(d)?R=Ks(Q)?Ji(Ou(d)):{}:R={}}return(I?gs:ui)(d,function(re,fe,we){return g(R,re,fe,we)}),R}function hy(d,g){return d==null?!0:Xu(d,g)}function Uh(d,g,R){return d==null?d:A1(d,g,Zu(R))}function KL(d,g,R,P){return P=typeof P=="function"?P:n,d==null?d:A1(d,g,Zu(R),P)}function Kc(d){return d==null?[]:Af(d,$r(d))}function Cp(d){return d==null?[]:Af(d,Zr(d))}function Ep(d,g,R){return R===n&&(R=g,g=n),R!==n&&(R=Ms(R),R=R===R?R:0),g!==n&&(g=Ms(g),g=g===g?g:0),Gs(Ms(d),g,R)}function Fh(d,g,R){return g=po(g),R===n?(R=g,g=0):R=po(R),d=Ms(d),I0(d,g,R)}function Rp(d,g,R){if(R&&typeof R!="boolean"&&xi(d,g,R)&&(g=R=n),R===n&&(typeof g=="boolean"?(R=g,g=n):typeof d=="boolean"&&(R=d,d=n)),d===n&&g===n?(d=0,g=1):(d=po(d),g===n?(g=d,d=0):g=po(g)),d>g){var P=d;d=g,g=P}if(R||d%1||g%1){var I=f1();return dr(d+I*(g-d+_u("1e-"+((I+"").length-1))),g)}return nh(d,g)}var my=yi(function(d,g,R){return g=g.toLowerCase(),d+(R?Hh(g):g)});function Hh(d){return v(Bn(d).toLowerCase())}function Jo(d){return d=Bn(d),d&&d.replace(_n,jf).replace(hs,"")}function Va(d,g,R){d=Bn(d),g=Di(g);var P=d.length;R=R===n?P:Gs(tn(R),0,P);var I=R;return R-=g.length,R>=0&&d.slice(R,I)==g}function qa(d){return d=Bn(d),d&&qt.test(d)?d.replace(ft,b0):d}function Md(d){return d=Bn(d),d&&en.test(d)?d.replace(dt,"\\$&"):d}var Nd=yi(function(d,g,R){return d+(R?"-":"")+g.toLowerCase()}),Wa=yi(function(d,g,R){return d+(R?" ":"")+g.toLowerCase()}),QL=ts("toLowerCase");function py(d,g,R){d=Bn(d),g=tn(g);var P=g?so(d):0;if(!g||P>=g)return d;var I=(g-P)/2;return rd(Bo(I),R)+d+rd(bc(I),R)}function Od(d,g,R){d=Bn(d),g=tn(g);var P=g?so(d):0;return g&&P<g?d+rd(g-P,R):d}function ZL(d,g,R){d=Bn(d),g=tn(g);var P=g?so(d):0;return g&&P<g?rd(g-P,R)+d:d}function gy(d,g,R){return R||g==null?g=0:g&&(g=+g),El(Bn(d).replace(bn,""),g||0)}function Ih(d,g,R){return(R?xi(d,g,R):g===n)?g=1:g=tn(g),T1(Bn(d),g)}function vy(){var d=arguments,g=Bn(d[0]);return d.length<3?g:g.replace(d[1],d[2])}var JL=yi(function(d,g,R){return d+(R?"_":"")+g.toLowerCase()});function $h(d,g,R){return R&&typeof R!="number"&&xi(d,g,R)&&(g=R=n),R=R===n?ne:R>>>0,R?(d=Bn(d),d&&(typeof g=="string"||g!=null&&!jh(g))&&(g=Di(g),!g&&wa(d))?Ta(vs(d),0,R):d.split(g,R)):[]}var Vh=yi(function(d,g,R){return d+(R?" ":"")+v(g)});function yy(d,g,R){return d=Bn(d),R=R==null?0:Gs(tn(R),0,d.length),g=Di(g),d.slice(R,R+g.length)==g}function Td(d,g,R){var P=q.templateSettings;R&&xi(d,g,R)&&(g=n),d=Bn(d),g=Ph({},g,P,uh);var I=Ph({},g.imports,P.imports,uh),Q=$r(I),re=Af(I,Q),fe,we,qe=0,Ye=g.interpolate||zs,Ze="__p += '",ct=zf((g.escape||zs).source+"|"+Ye.source+"|"+(Ye===Me?vt:zs).source+"|"+(g.evaluate||zs).source+"|$","g"),Dt="//# sourceURL="+(zn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++a0+"]")+`
`;d.replace(ct,function(Yt,Cn,Tn,Zs,os,Js){return Tn||(Tn=Zs),Ze+=d.slice(qe,Js).replace(Bs,L0),Cn&&(fe=!0,Ze+=`' +
__e(`+Cn+`) +
'`),os&&(we=!0,Ze+=`';
`+os+`;
__p += '`),Tn&&(Ze+=`' +
((__t = (`+Tn+`)) == null ? '' : __t) +
'`),qe=Js+Yt.length,Yt}),Ze+=`';
`;var Gt=zn.call(g,"variable")&&g.variable;if(!Gt)Ze=`with (obj) {
`+Ze+`
}
`;else if($e.test(Gt))throw new $t(h);Ze=(we?Ze.replace(Bt,""):Ze).replace(gr,"$1").replace(Lr,"$1;"),Ze="function("+(Gt||"obj")+`) {
`+(Gt?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(fe?", __e = _.escape":"")+(we?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Ze+`return __p
}`;var pn=O(function(){return Mn(Q,Dt+"return "+Ze).apply(n,re)});if(pn.source=Ze,Ir(pn))throw pn;return pn}function _p(d){return Bn(d).toLowerCase()}function qh(d){return Bn(d).toUpperCase()}function xy(d,g,R){if(d=Bn(d),d&&(R||g===n))return x0(d);if(!d||!(g=Di(g)))return d;var P=vs(d),I=vs(g),Q=mc(P,I),re=pc(P,I)+1;return Ta(P,Q,re).join("")}function e2(d,g,R){if(d=Bn(d),d&&(R||g===n))return d.slice(0,a1(d)+1);if(!d||!(g=Di(g)))return d;var P=vs(d),I=pc(P,vs(g))+1;return Ta(P,0,I).join("")}function Wh(d,g,R){if(d=Bn(d),d&&(R||g===n))return d.replace(bn,"");if(!d||!(g=Di(g)))return d;var P=vs(d),I=mc(P,vs(g));return Ta(P,I).join("")}function i(d,g){var R=F,P=V;if(mr(g)){var I="separator"in g?g.separator:I;R="length"in g?tn(g.length):R,P="omission"in g?Di(g.omission):P}d=Bn(d);var Q=d.length;if(wa(d)){var re=vs(d);Q=re.length}if(R>=Q)return d;var fe=R-so(P);if(fe<1)return P;var we=re?Ta(re,0,fe).join(""):d.slice(0,fe);if(I===n)return we+P;if(re&&(fe+=we.length-fe),jh(I)){if(d.slice(fe).search(I)){var qe,Ye=we;for(I.global||(I=zf(I.source,Bn(Nt.exec(I))+"g")),I.lastIndex=0;qe=I.exec(Ye);)var Ze=qe.index;we=we.slice(0,Ze===n?fe:Ze)}}else if(d.indexOf(Di(I),fe)!=fe){var ct=we.lastIndexOf(I);ct>-1&&(we=we.slice(0,ct))}return we+P}function o(d){return d=Bn(d),d&&jt.test(d)?d.replace(wr,E0):d}var u=yi(function(d,g,R){return d+(R?" ":"")+g.toUpperCase()}),v=ts("toUpperCase");function L(d,g,R){return d=Bn(d),g=R?n:g,g===n?w0(d)?fL(d):aL(d):d.match(g)||[]}var O=cn(function(d,g){try{return Ri(d,n,g)}catch(R){return Ir(R)?R:new $t(R)}}),U=ar(function(d,g){return gs(g,function(R){R=Fn(R),Ws(d,R,Ha(d[R],d))}),d});function W(d){var g=d==null?0:d.length,R=zt();return d=g?ur(d,function(P){if(typeof P[1]!="function")throw new Zi(l);return[R(P[0]),P[1]]}):[],cn(function(P){for(var I=-1;++I<g;){var Q=d[I];if(Ri(Q[0],this,P))return Ri(Q[1],this,P)}})}function ie(d){return U0(ci(d,b))}function Ne(d){return function(){return d}}function Ie(d,g){return d==null||d!==d?g:d}var Ge=lo(),De=lo(!0);function Oe(d){return d}function Ht(d){return E1(typeof d=="function"?d:ci(d,b))}function Ut(d){return _1(ci(d,b))}function Xn(d,g){return Jf(d,ci(g,b))}var Le=cn(function(d,g){return function(R){return Dl(R,d,g)}}),me=cn(function(d,g){return function(R){return Dl(d,R,g)}});function _e(d,g,R){var P=$r(g),I=Oa(g,P);R==null&&!(mr(g)&&(I.length||!P.length))&&(R=g,g=d,d=this,I=Oa(g,$r(g)));var Q=!(mr(R)&&"chain"in R)||!!R.chain,re=Ks(d);return gs(I,function(fe){var we=g[fe];d[fe]=we,re&&(d.prototype[fe]=function(){var qe=this.__chain__;if(Q||qe){var Ye=d(this.__wrapped__),Ze=Ye.__actions__=Ur(this.__actions__);return Ze.push({func:we,args:arguments,thisArg:d}),Ye.__chain__=qe,Ye}return we.apply(d,zo([this.value()],arguments))})}),d}function Ve(){return Or._===this&&(Or._=yc),this}function yt(){}function mn(d){return d=tn(d),cn(function(g){return M1(g,d)})}var At=nd(ur),It=nd(p0),Jr=nd(r1);function On(d){return gh(d)?Of(Fn(d)):q0(d)}function Ga(d){return function(g){return d==null?n:Ss(d,g)}}var t2=Da(),QO=Da(!0);function n2(){return[]}function r2(){return!1}function ZO(){return{}}function JO(){return""}function eT(){return!0}function tT(d,g){if(d=tn(d),d<1||d>Z)return[];var R=ne,P=dr(d,ne);g=zt(g),d-=ne;for(var I=La(P,g);++R<d;)g(R);return I}function nT(d){return Kt(d)?ur(d,Fn):bi(d)?[d]:Ur(fo(Bn(d)))}function rT(d){var g=++$s;return Bn(d)+g}var iT=Nc(function(d,g){return d+g},0),sT=ch("ceil"),oT=Nc(function(d,g){return d/g},1),aT=ch("floor");function lT(d){return d&&d.length?Ys(d,Oe,Iu):n}function cT(d,g){return d&&d.length?Ys(d,zt(g,2),Iu):n}function uT(d){return v0(d,Oe)}function dT(d,g){return v0(d,zt(g,2))}function fT(d){return d&&d.length?Ys(d,Oe,Zf):n}function hT(d,g){return d&&d.length?Ys(d,zt(g,2),Zf):n}var mT=Nc(function(d,g){return d*g},1),pT=ch("round"),gT=Nc(function(d,g){return d-g},0);function vT(d){return d&&d.length?Df(d,Oe):0}function yT(d,g){return d&&d.length?Df(d,zt(g,2)):0}return q.after=_L,q.ary=$v,q.assign=BL,q.assignIn=sy,q.assignInWith=Ph,q.assignWith=UL,q.at=FL,q.before=vd,q.bind=Ha,q.bindAll=U,q.bindKey=_h,q.castArray=TL,q.chain=Hc,q.chunk=bL,q.compact=gv,q.concat=vv,q.cond=W,q.conforms=ie,q.constant=Ne,q.countBy=Ic,q.create=HL,q.curry=yd,q.curryRight=Mh,q.debounce=Ia,q.defaults=IL,q.defaultsDeep=oy,q.defer=mo,q.delay=xd,q.difference=hr,q.differenceBy=ji,q.differenceWith=Xo,q.drop=yv,q.dropRight=xv,q.dropRightWhile=LL,q.dropWhile=G1,q.fill=ns,q.filter=Tv,q.flatMap=ap,q.flatMapDeep=CL,q.flatMapDepth=EL,q.flatten=ki,q.flattenDeep=bv,q.flattenDepth=ka,q.flip=ML,q.flow=Ge,q.flowRight=De,q.fromPairs=Fl,q.functions=ly,q.functionsIn=zh,q.groupBy=jv,q.initial=K1,q.intersection=ho,q.intersectionBy=Lv,q.intersectionWith=Ac,q.invert=cy,q.invertBy=uy,q.invokeMap=Ch,q.iteratee=Ht,q.keyBy=kv,q.keys=$r,q.keysIn=Zr,q.map=gd,q.mapKeys=qL,q.mapValues=WL,q.matches=Ut,q.matchesProperty=Xn,q.memoize=bd,q.merge=GL,q.mergeWith=_d,q.method=Le,q.methodOf=me,q.mixin=_e,q.negate=Ld,q.nthArg=mn,q.omit=Bh,q.omitBy=bp,q.once=Vv,q.orderBy=Pv,q.over=At,q.overArgs=qv,q.overEvery=It,q.overSome=Jr,q.partial=up,q.partialRight=Nh,q.partition=zv,q.pick=YL,q.pickBy=Xc,q.property=On,q.propertyOf=Ga,q.pull=Sv,q.pullAll=kc,q.pullAllBy=Cv,q.pullAllWith=wh,q.pullAt=Ev,q.range=t2,q.rangeRight=QO,q.rearg=Wv,q.reject=Eh,q.remove=wL,q.rest=Gv,q.reverse=Q1,q.sampleSize=Hv,q.set=dy,q.setWith=fy,q.shuffle=nr,q.slice=$n,q.sortBy=Iv,q.sortedUniq=Pc,q.sortedUniqBy=Z1,q.split=$h,q.spread=NL,q.tail=Qo,q.take=_r,q.takeRight=za,q.takeRightWhile=Hl,q.takeWhile=J1,q.tap=ip,q.throttle=dp,q.thru=fi,q.toArray=ss,q.toPairs=Lp,q.toPairsIn=wp,q.toPath=nT,q.toPlainObject=iy,q.transform=Sp,q.unary=fp,q.union=Rs,q.unionBy=zc,q.unionWith=md,q.uniq=Pi,q.uniqBy=ep,q.uniqWith=tp,q.unset=hy,q.unzip=Bc,q.unzipWith=pd,q.update=Uh,q.updateWith=KL,q.values=Kc,q.valuesIn=Cp,q.without=Ba,q.words=L,q.wrap=OL,q.xor=ii,q.xorBy=Ua,q.xorWith=Uc,q.zip=Fc,q.zipObject=np,q.zipObjectDeep=rp,q.zipWith=Rv,q.entries=Lp,q.entriesIn=wp,q.extend=sy,q.extendWith=Ph,_e(q,q),q.add=iT,q.attempt=O,q.camelCase=my,q.capitalize=Hh,q.ceil=sT,q.clamp=Ep,q.clone=wd,q.cloneDeep=Yv,q.cloneDeepWith=yn,q.cloneWith=DL,q.conformsTo=hp,q.deburr=Jo,q.defaultTo=Ie,q.divide=oT,q.endsWith=Va,q.eq=zi,q.escape=qa,q.escapeRegExp=Md,q.every=Ov,q.find=Dv,q.findIndex=Es,q.findKey=Wc,q.findLast=op,q.findLastIndex=Y1,q.findLastKey=Cd,q.floor=aT,q.forEach=Av,q.forEachRight=lp,q.forIn=ay,q.forInRight=$L,q.forOwn=Gc,q.forOwnRight=Ed,q.get=Rd,q.gt=mp,q.gte=Xv,q.has=xp,q.hasIn=Yc,q.head=Ko,q.identity=Oe,q.includes=$c,q.indexOf=X1,q.inRange=Fh,q.invoke=VL,q.isArguments=Zo,q.isArray=Kt,q.isArrayBuffer=Oh,q.isArrayLike=Hr,q.isArrayLikeObject=Mr,q.isBoolean=AL,q.isBuffer=$a,q.isDate=Kv,q.isElement=Qv,q.isEmpty=Th,q.isEqual=Yn,q.isEqualWith=pp,q.isError=Ir,q.isFinite=jL,q.isFunction=Ks,q.isInteger=Dh,q.isLength=Il,q.isMap=Ah,q.isMatch=gp,q.isMatchWith=kL,q.isNaN=Zv,q.isNative=PL,q.isNil=zL,q.isNull=Jv,q.isNumber=ey,q.isObject=mr,q.isObjectLike=xr,q.isPlainObject=_s,q.isRegExp=jh,q.isSafeInteger=vp,q.isSet=ty,q.isString=kh,q.isSymbol=bi,q.isTypedArray=Vc,q.isUndefined=Qs,q.isWeakMap=yp,q.isWeakSet=ny,q.join=hd,q.kebabCase=Nd,q.last=di,q.lastIndexOf=jc,q.lowerCase=Wa,q.lowerFirst=QL,q.lt=ry,q.lte=Sd,q.max=lT,q.maxBy=cT,q.mean=uT,q.meanBy=dT,q.min=fT,q.minBy=hT,q.stubArray=n2,q.stubFalse=r2,q.stubObject=ZO,q.stubString=JO,q.stubTrue=eT,q.multiply=mT,q.nth=wv,q.noConflict=Ve,q.noop=yt,q.now=Rh,q.pad=py,q.padEnd=Od,q.padStart=ZL,q.parseInt=gy,q.random=Rp,q.reduce=Bv,q.reduceRight=Uv,q.repeat=Ih,q.replace=vy,q.result=XL,q.round=pT,q.runInContext=be,q.sample=Fv,q.size=cp,q.snakeCase=JL,q.some=RL,q.sortedIndex=ir,q.sortedIndexBy=vn,q.sortedIndexOf=Rn,q.sortedLastIndex=Vn,q.sortedLastIndexBy=rs,q.sortedLastIndexOf=Pa,q.startCase=Vh,q.startsWith=yy,q.subtract=gT,q.sum=vT,q.sumBy=yT,q.template=Td,q.times=tT,q.toFinite=po,q.toInteger=tn,q.toLength=go,q.toLower=_p,q.toNumber=Ms,q.toSafeInteger=qc,q.toString=Bn,q.toUpper=qh,q.trim=xy,q.trimEnd=e2,q.trimStart=Wh,q.truncate=i,q.unescape=o,q.uniqueId=rT,q.upperCase=u,q.upperFirst=v,q.each=Av,q.eachRight=lp,q.first=Ko,_e(q,function(){var d={};return ui(q,function(g,R){zn.call(q.prototype,R)||(d[R]=g)}),d}(),{chain:!1}),q.VERSION=r,gs(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){q[d].placeholder=q}),gs(["drop","take"],function(d,g){hn.prototype[d]=function(R){R=R===n?1:or(tn(R),0);var P=this.__filtered__&&!g?new hn(this):this.clone();return P.__filtered__?P.__takeCount__=dr(R,P.__takeCount__):P.__views__.push({size:dr(R,ne),type:d+(P.__dir__<0?"Right":"")}),P},hn.prototype[d+"Right"]=function(R){return this.reverse()[d](R).reverse()}}),gs(["filter","map","takeWhile"],function(d,g){var R=g+1,P=R==se||R==te;hn.prototype[d]=function(I){var Q=this.clone();return Q.__iteratees__.push({iteratee:zt(I,3),type:R}),Q.__filtered__=Q.__filtered__||P,Q}}),gs(["head","last"],function(d,g){var R="take"+(g?"Right":"");hn.prototype[d]=function(){return this[R](1).value()[0]}}),gs(["initial","tail"],function(d,g){var R="drop"+(g?"":"Right");hn.prototype[d]=function(){return this.__filtered__?new hn(this):this[R](1)}}),hn.prototype.compact=function(){return this.filter(Oe)},hn.prototype.find=function(d){return this.filter(d).head()},hn.prototype.findLast=function(d){return this.reverse().find(d)},hn.prototype.invokeMap=cn(function(d,g){return typeof d=="function"?new hn(this):this.map(function(R){return Dl(R,d,g)})}),hn.prototype.reject=function(d){return this.filter(Ld(zt(d)))},hn.prototype.slice=function(d,g){d=tn(d);var R=this;return R.__filtered__&&(d>0||g<0)?new hn(R):(d<0?R=R.takeRight(-d):d&&(R=R.drop(d)),g!==n&&(g=tn(g),R=g<0?R.dropRight(-g):R.take(g-d)),R)},hn.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},hn.prototype.toArray=function(){return this.take(ne)},ui(hn.prototype,function(d,g){var R=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),I=q[P?"take"+(g=="last"?"Right":""):g],Q=P||/^find/.test(g);I&&(q.prototype[g]=function(){var re=this.__wrapped__,fe=P?[1]:arguments,we=re instanceof hn,qe=fe[0],Ye=we||Kt(re),Ze=function(Cn){var Tn=I.apply(q,zo([Cn],fe));return P&&ct?Tn[0]:Tn};Ye&&R&&typeof qe=="function"&&qe.length!=1&&(we=Ye=!1);var ct=this.__chain__,Dt=!!this.__actions__.length,Gt=Q&&!ct,pn=we&&!Dt;if(!Q&&Ye){re=pn?re:new hn(this);var Yt=d.apply(re,fe);return Yt.__actions__.push({func:fi,args:[Ze],thisArg:n}),new Ni(Yt,ct)}return Gt&&pn?d.apply(this,fe):(Yt=this.thru(Ze),Gt?P?Yt.value()[0]:Yt.value():Yt)})}),gs(["pop","push","shift","sort","splice","unshift"],function(d){var g=Bf[d],R=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);q.prototype[d]=function(){var I=arguments;if(P&&!this.__chain__){var Q=this.value();return g.apply(Kt(Q)?Q:[],I)}return this[R](function(re){return g.apply(Kt(re)?re:[],I)})}}),ui(hn.prototype,function(d,g){var R=q[g];if(R){var P=R.name+"";zn.call(Ls,P)||(Ls[P]=[]),Ls[P].push({name:g,func:R})}}),Ls[Rr(n,_).name]=[{name:"wrapper",func:n}],hn.prototype.clone=zu,hn.prototype.reverse=If,hn.prototype.value=_l,q.prototype.at=_v,q.prototype.chain=is,q.prototype.commit=Mv,q.prototype.next=Nv,q.prototype.plant=Fa,q.prototype.reverse=Sh,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=sp,q.prototype.first=q.prototype.head,Sl&&(q.prototype[Sl]=SL),q},Ca=gc();ba?((ba.exports=Ca)._=Ca,uc._=Ca):Or._=Ca}).call(tY)}(Kp,Kp.exports)),Kp.exports}var o7=nY();const rY={[px.IT]:eY,[px.EN_US]:$4},a7=(e,t)=>{const n=rY[t],r=new Date(e);return wG(r)?br(r,"p",{locale:n}):br(r,"d MMM, p",{locale:n})},iY={fire_alarm:"Fire alarm",speech:"Speech",[nn.Animal]:"Animal",[nn.Vehicle]:"Vehicle",[nn.Person]:"Person",[nn.Face]:"Face",[nn.Plate]:"Plate",[nn.Doorbell]:"Doorbell",[nn.Package]:"Package",[nn.Audio]:"Audio",[nn.Motion]:"Motion",[nn.Sensor]:"Sensor",[nn.Others]:"Others",[oa.Detection]:"GIF",[oa.Timelapse]:"Timelapse",[oa.Entry]:"Sensor"},cf=e=>iY[e]??e,sY={[nn.Audio]:"bg-blue-100 text-blue-800",[nn.Face]:"bg-yellow-100 text-yellow-800",[nn.Plate]:"bg-green-100 text-green-800"},oY=e=>sY[cg[e]]??"bg-black-100 text-black-800",P5=e=>e.toLowerCase().includes("clip"),W4=e=>{const t=e.filter(r=>r!=="any_object"&&!P5(r));return o7.sortBy(t,r=>[r?vB[cg[r]??r]:100,1])[0]??e.find(r=>!P5(r))??nn.Motion},aY=(e,t)=>t?{size:e,className:t}:{size:e},yu=e=>{const{detectionClass:t,small:n,className:r}=e,a=aY(n?"16":void 0,r),l=m=>{switch(m){case nn.Animal:return f.jsx(sC,{...a});case nn.Person:return f.jsx(sk,{...a});case nn.Vehicle:return f.jsx(zA,{...a});case nn.Audio:return f.jsx(CA,{...a});case nn.Motion:return f.jsx(cw,{...a});case nn.Face:return f.jsx(vk,{...a});case nn.Plate:return f.jsx(kA,{...a});case nn.Package:return f.jsx(ek,{...a});case nn.Doorbell:return f.jsx(e3,{...a});case nn.Sensor:case oa.Entry:return f.jsx(F9,{...a});case nn.Others:return f.jsx(xA,{...a});case oa.Detection:return f.jsx(aC,{...a});case oa.Timelapse:return f.jsx(Ej,{...a});case Wp.Dog:return f.jsx(ij,{...a});case Wp.Cat:return f.jsx(UA,{...a});case Wp.Horse:return f.jsx(sC,{...a});case Wp.Bird:return f.jsx(pj,{...a})}};return l(t)??l(cg[t])??f.jsx(aC,{...a})},lY="";function ox(e){return e?e.startsWith("http")?e:`${lY}${e}`:""}function cY(e){const t=ox(e.videoUrl),n=ox(e.gifUrl),r=ox(e.imageUrl);return t?{url:t,type:"video"}:n?{url:n,type:"gif"}:{url:r,type:"image"}}const uY=10*1e3,dY=5e3,P2=220,Gw=16/9;function fY({artifact:e,isVisible:t}){var m;const n=Te(p=>p.timezone),r=y.useRef(null),{url:s,type:a}=cY(e),l=a!=="image"?ox(e.imageUrl):void 0;if(y.useEffect(()=>{const p=r.current;!p||a!=="video"||(t?p.play().catch(()=>{}):p.pause())},[t,a]),!s)return f.jsx("div",{className:"flex h-full w-full items-center justify-center rounded-lg bg-muted text-muted-foreground text-sm",children:"No media"});const h=a7(e.timestamp,n);return f.jsxs("div",{className:"relative flex w-full flex-col overflow-hidden rounded-lg bg-muted",style:{aspectRatio:Gw},children:[f.jsxs("div",{className:"relative flex-1 min-h-0 w-full",children:[a==="video"&&f.jsx("video",{ref:r,src:s,poster:l||void 0,className:"h-full w-full object-cover",playsInline:!0,muted:!0,loop:!0}),a==="gif"&&f.jsx("img",{src:s,alt:"",className:He("h-full w-full object-cover",!t&&"pointer-events-none"),loading:"lazy"}),a==="image"&&f.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover",loading:"lazy"})]}),f.jsxs("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 to-transparent px-2 py-1.5 flex items-center justify-between gap-1",children:[f.jsx("div",{className:"flex flex-wrap gap-0.5 shrink-0",children:((m=e.classes)!=null&&m.length?e.classes:e.ruleType==="Timelapse"?[oa.Timelapse]:e.ruleType==="Detection"?[oa.Detection]:[e.ruleName].filter(Boolean)).filter(p=>p&&p!=="motion").map(p=>f.jsx(yu,{small:!0,detectionClass:p,className:"text-white drop-shadow-sm"},p))}),f.jsx("p",{className:"text-[10px] text-white/80 truncate min-w-0",children:h})]})]})}function z5({cameraNames:e={},className:t,height:n=140}){const{getLatestRuleArtifacts:r}=ks(),[s,a]=y.useState([]),[l,h]=y.useState(!0),[m,p]=Ob({axis:"x",loop:!1,align:"start",containScroll:"trimSnaps",dragFree:!1}),x=Te(j=>j.reelAutoplayEnabled),[b,w]=y.useState(new Set),E=y.useRef([]),M=y.useRef(null),C=y.useRef(null),S=y.useCallback(()=>{r({limit:80}).then(({artifacts:j})=>a(j)).catch(()=>a(j=>j.length?j:[])).finally(()=>h(!1))},[r]);y.useEffect(()=>{let j=!1;return r({limit:80}).then(({artifacts:D})=>{j||a(D)}).catch(()=>{j||a([])}).finally(()=>{j||h(!1)}),()=>{j=!0}},[r]),y.useEffect(()=>{const j=setInterval(S,uY);return()=>clearInterval(j)},[S]),y.useEffect(()=>{if(!x||!p||s.length<=1){C.current&&(clearInterval(C.current),C.current=null);return}return C.current=setInterval(()=>{p.scrollNext()},dY),()=>{C.current&&(clearInterval(C.current),C.current=null)}},[x,p,s.length]);const _=y.useCallback(j=>D=>{E.current[j]=D},[]),N=y.useCallback(j=>{p&&(j.preventDefault(),j.deltaY>0?p.scrollNext():j.deltaY<0&&p.scrollPrev())},[p]),c=y.useRef(N);return c.current=N,y.useEffect(()=>{const j=m.current;if(!j)return;const D=B=>c.current(B);return j.addEventListener("wheel",D,{passive:!1}),()=>j.removeEventListener("wheel",D)},[]),y.useEffect(()=>{if(s.length===0)return;const j=new IntersectionObserver(D=>{w(B=>{const T=new Set(B);return D.forEach(A=>{const H=E.current.findIndex(F=>F===A.target);H>=0&&(A.isIntersecting?T.add(H):T.delete(H))}),T})},{root:null,rootMargin:"20px",threshold:.2});M.current=j;for(let D=0;D<s.length;D++){const B=E.current[D];B&&j.observe(B)}return()=>{j.disconnect(),M.current=null}},[s.length]),l?f.jsx("div",{className:He("relative w-full",t),style:{minHeight:n},children:f.jsx("div",{className:"flex gap-2 py-1 overflow-hidden",style:{marginLeft:"0.5rem"},children:Array.from({length:4}).map((D,B)=>f.jsxs("div",{className:"shrink-0 flex flex-col rounded-lg overflow-hidden bg-muted/50",style:{width:P2},children:[f.jsx(Ts,{className:"w-full rounded-none",style:{aspectRatio:String(Gw)}}),f.jsx("div",{className:"px-2 py-1.5",children:f.jsx(Ts,{className:"h-3 w-14 rounded"})})]},B))})}):s.length===0?f.jsx("div",{className:He("flex shrink-0 items-center justify-center rounded-lg bg-muted/30",t),style:{height:n},children:f.jsx("span",{className:"text-sm text-muted-foreground",children:"No rule artifacts yet"})}):f.jsxs("div",{className:He("relative w-full",t),children:[f.jsx("div",{className:"overflow-x-auto overflow-y-hidden",ref:m,style:{overflow:"hidden"},children:f.jsx("div",{className:"flex touch-pan-x gap-2 py-1",style:{marginLeft:"0.5rem",minHeight:P2/Gw},children:s.map((j,D)=>f.jsx("div",{ref:_(D),className:"shrink-0",style:{width:P2},children:f.jsx(fY,{artifact:j,isVisible:b.has(D)})},`${j.deviceId}-${j.ruleName}-${j.timestamp}`))})}),f.jsx(Qe,{type:"button",variant:"secondary",size:"icon",className:"absolute left-0 top-1/2 z-10 -translate-y-1/2 rounded-full border bg-background/90 shadow-md hover:bg-background",onClick:()=>p==null?void 0:p.scrollPrev(),"aria-label":"Previous",children:f.jsx(Zd,{className:"size-5"})}),f.jsx(Qe,{type:"button",variant:"secondary",size:"icon",className:"absolute right-0 top-1/2 z-10 -translate-y-1/2 rounded-full border bg-background/90 shadow-md hover:bg-background",onClick:()=>p==null?void 0:p.scrollNext(),"aria-label":"Next",children:f.jsx(Jd,{className:"size-5"})})]})}function hY(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Tb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gm(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function G4(e){return"nodeType"in e}function Ps(e){var t,n;return e?Gm(e)?e:G4(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Y4(e){const{Document:t}=Ps(e);return e instanceof t}function Xg(e){return Gm(e)?!1:e instanceof Ps(e).HTMLElement}function l7(e){return e instanceof Ps(e).SVGElement}function Ym(e){return e?Gm(e)?e.document:G4(e)?Y4(e)?e:Xg(e)||l7(e)?e.ownerDocument:document:document:document}const hl=Tb?y.useLayoutEffect:y.useEffect;function X4(e){const t=y.useRef(e);return hl(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function mY(){const e=y.useRef(null),t=y.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function bg(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return hl(()=>{n.current!==e&&(n.current=e)},t),n}function Kg(e,t){const n=y.useRef();return y.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Rx(e){const t=X4(e),n=y.useRef(null),r=y.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Yw(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let z2={};function Qg(e,t){return y.useMemo(()=>{if(t)return t;const n=z2[e]==null?0:z2[e]+1;return z2[e]=n,e+"-"+n},[e,t])}function c7(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((a,l)=>{const h=Object.entries(l);for(const[m,p]of h){const x=a[m];x!=null&&(a[m]=x+e*p)}return a},{...t})}}const fm=c7(1),_x=c7(-1);function pY(e){return"clientX"in e&&"clientY"in e}function K4(e){if(!e)return!1;const{KeyboardEvent:t}=Ps(e.target);return t&&e instanceof t}function gY(e){if(!e)return!1;const{TouchEvent:t}=Ps(e.target);return t&&e instanceof t}function Xw(e){if(gY(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pY(e)?{x:e.clientX,y:e.clientY}:null}const Om=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Om.Translate.toString(e),Om.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),B5="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function vY(e){return e.matches(B5)?e:e.querySelector(B5)}const yY={display:"none"};function xY(e){let{id:t,value:n}=e;return Un.createElement("div",{id:t,style:yY},n)}function bY(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Un.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function LY(){const[e,t]=y.useState("");return{announce:y.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const u7=y.createContext(null);function wY(e){const t=y.useContext(u7);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function SY(){const[e]=y.useState(()=>new Set),t=y.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[y.useCallback(r=>{let{type:s,event:a}=r;e.forEach(l=>{var h;return(h=l[s])==null?void 0:h.call(l,a)})},[e]),t]}const CY={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},EY={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function RY(e){let{announcements:t=EY,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=CY}=e;const{announce:a,announcement:l}=LY(),h=Qg("DndLiveRegion"),[m,p]=y.useState(!1);if(y.useEffect(()=>{p(!0)},[]),wY(y.useMemo(()=>({onDragStart(b){let{active:w}=b;a(t.onDragStart({active:w}))},onDragMove(b){let{active:w,over:E}=b;t.onDragMove&&a(t.onDragMove({active:w,over:E}))},onDragOver(b){let{active:w,over:E}=b;a(t.onDragOver({active:w,over:E}))},onDragEnd(b){let{active:w,over:E}=b;a(t.onDragEnd({active:w,over:E}))},onDragCancel(b){let{active:w,over:E}=b;a(t.onDragCancel({active:w,over:E}))}}),[a,t])),!m)return null;const x=Un.createElement(Un.Fragment,null,Un.createElement(xY,{id:r,value:s.draggable}),Un.createElement(bY,{id:h,announcement:l}));return n?ol.createPortal(x,n):x}var ai;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ai||(ai={}));function Mx(){}function d7(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function f7(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const fa=Object.freeze({x:0,y:0});function _Y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function MY(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function NY(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=s-r,h=a-n;if(r<s&&n<a){const m=t.width*t.height,p=e.width*e.height,x=l*h,b=x/(m+p-x);return Number(b.toFixed(4))}return 0}const OY=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const a of r){const{id:l}=a,h=n.get(l);if(h){const m=NY(h,t);m>0&&s.push({id:l,data:{droppableContainer:a,value:m}})}}return s.sort(_Y)};function TY(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function h7(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fa}function DY(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return s.reduce((l,h)=>({...l,top:l.top+e*h.y,bottom:l.bottom+e*h.y,left:l.left+e*h.x,right:l.right+e*h.x}),{...n})}}const AY=DY(1);function jY(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function kY(e,t,n){const r=jY(t);if(!r)return e;const{scaleX:s,scaleY:a,x:l,y:h}=r,m=e.left-l-(1-s)*parseFloat(n),p=e.top-h-(1-a)*parseFloat(n.slice(n.indexOf(" ")+1)),x=s?e.width/s:e.width,b=a?e.height/a:e.height;return{width:x,height:b,top:p,right:m+x,bottom:p+b,left:m}}const PY={ignoreTransform:!1};function Xm(e,t){t===void 0&&(t=PY);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:p,transformOrigin:x}=Ps(e).getComputedStyle(e);p&&(n=kY(n,p,x))}const{top:r,left:s,width:a,height:l,bottom:h,right:m}=n;return{top:r,left:s,width:a,height:l,bottom:h,right:m}}function U5(e){return Xm(e,{ignoreTransform:!0})}function zY(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function BY(e,t){return t===void 0&&(t=Ps(e).getComputedStyle(e)),t.position==="fixed"}function UY(e,t){t===void 0&&(t=Ps(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const a=t[s];return typeof a=="string"?n.test(a):!1})}function Q4(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Y4(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Xg(s)||l7(s)||n.includes(s))return n;const a=Ps(e).getComputedStyle(s);return s!==e&&UY(s,a)&&n.push(s),BY(s,a)?n:r(s.parentNode)}return e?r(e):n}function m7(e){const[t]=Q4(e,1);return t??null}function B2(e){return!Tb||!e?null:Gm(e)?e:G4(e)?Y4(e)||e===Ym(e).scrollingElement?window:Xg(e)?e:null:null}function p7(e){return Gm(e)?e.scrollX:e.scrollLeft}function g7(e){return Gm(e)?e.scrollY:e.scrollTop}function Kw(e){return{x:p7(e),y:g7(e)}}var mi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(mi||(mi={}));function v7(e){return!Tb||!e?!1:e===document.scrollingElement}function y7(e){const t={x:0,y:0},n=v7(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,h=e.scrollLeft>=r.x;return{isTop:s,isLeft:a,isBottom:l,isRight:h,maxScroll:r,minScroll:t}}const FY={x:.2,y:.2};function HY(e,t,n,r,s){let{top:a,left:l,right:h,bottom:m}=n;r===void 0&&(r=10),s===void 0&&(s=FY);const{isTop:p,isBottom:x,isLeft:b,isRight:w}=y7(e),E={x:0,y:0},M={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!p&&a<=t.top+C.height?(E.y=mi.Backward,M.y=r*Math.abs((t.top+C.height-a)/C.height)):!x&&m>=t.bottom-C.height&&(E.y=mi.Forward,M.y=r*Math.abs((t.bottom-C.height-m)/C.height)),!w&&h>=t.right-C.width?(E.x=mi.Forward,M.x=r*Math.abs((t.right-C.width-h)/C.width)):!b&&l<=t.left+C.width&&(E.x=mi.Backward,M.x=r*Math.abs((t.left+C.width-l)/C.width)),{direction:E,speed:M}}function IY(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function x7(e){return e.reduce((t,n)=>fm(t,Kw(n)),fa)}function $Y(e){return e.reduce((t,n)=>t+p7(n),0)}function VY(e){return e.reduce((t,n)=>t+g7(n),0)}function qY(e,t){if(t===void 0&&(t=Xm),!e)return;const{top:n,left:r,bottom:s,right:a}=t(e);m7(e)&&(s<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const WY=[["x",["left","right"],$Y],["y",["top","bottom"],VY]];class Z4{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Q4(n),s=x7(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,h]of WY)for(const m of l)Object.defineProperty(this,m,{get:()=>{const p=h(r),x=s[a]-p;return this.rect[m]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ng{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function GY(e){const{EventTarget:t}=Ps(e);return e instanceof t?e:Ym(e)}function U2(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var xo;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xo||(xo={}));function F5(e){e.preventDefault()}function YY(e){e.stopPropagation()}var qn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(qn||(qn={}));const b7={start:[qn.Space,qn.Enter],cancel:[qn.Esc],end:[qn.Space,qn.Enter,qn.Tab]},XY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case qn.Right:return{...n,x:n.x+25};case qn.Left:return{...n,x:n.x-25};case qn.Down:return{...n,y:n.y+25};case qn.Up:return{...n,y:n.y-25}}};class L7{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ng(Ym(n)),this.windowListeners=new ng(Ps(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xo.Resize,this.handleCancel),this.windowListeners.add(xo.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xo.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&qY(r),n(fa)}handleKeyDown(t){if(K4(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:a=b7,coordinateGetter:l=XY,scrollBehavior:h="smooth"}=s,{code:m}=t;if(a.end.includes(m)){this.handleEnd(t);return}if(a.cancel.includes(m)){this.handleCancel(t);return}const{collisionRect:p}=r.current,x=p?{x:p.left,y:p.top}:fa;this.referenceCoordinates||(this.referenceCoordinates=x);const b=l(t,{active:n,context:r.current,currentCoordinates:x});if(b){const w=_x(b,x),E={x:0,y:0},{scrollableAncestors:M}=r.current;for(const C of M){const S=t.code,{isTop:_,isRight:N,isLeft:c,isBottom:j,maxScroll:D,minScroll:B}=y7(C),T=IY(C),A={x:Math.min(S===qn.Right?T.right-T.width/2:T.right,Math.max(S===qn.Right?T.left:T.left+T.width/2,b.x)),y:Math.min(S===qn.Down?T.bottom-T.height/2:T.bottom,Math.max(S===qn.Down?T.top:T.top+T.height/2,b.y))},H=S===qn.Right&&!N||S===qn.Left&&!c,F=S===qn.Down&&!j||S===qn.Up&&!_;if(H&&A.x!==b.x){const V=C.scrollLeft+w.x,ee=S===qn.Right&&V<=D.x||S===qn.Left&&V>=B.x;if(ee&&!w.y){C.scrollTo({left:V,behavior:h});return}ee?E.x=C.scrollLeft-V:E.x=S===qn.Right?C.scrollLeft-D.x:C.scrollLeft-B.x,E.x&&C.scrollBy({left:-E.x,behavior:h});break}else if(F&&A.y!==b.y){const V=C.scrollTop+w.y,ee=S===qn.Down&&V<=D.y||S===qn.Up&&V>=B.y;if(ee&&!w.x){C.scrollTo({top:V,behavior:h});return}ee?E.y=C.scrollTop-V:E.y=S===qn.Down?C.scrollTop-D.y:C.scrollTop-B.y,E.y&&C.scrollBy({top:-E.y,behavior:h});break}}this.handleMove(t,fm(_x(b,this.referenceCoordinates),E))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}L7.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=b7,onActivation:s}=t,{active:a}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const h=a.activatorNode.current;return h&&e.target!==h?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function H5(e){return!!(e&&"distance"in e)}function I5(e){return!!(e&&"delay"in e)}class J4{constructor(t,n,r){var s;r===void 0&&(r=GY(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:a}=t,{target:l}=a;this.props=t,this.events=n,this.document=Ym(l),this.documentListeners=new ng(this.document),this.listeners=new ng(r),this.windowListeners=new ng(Ps(l)),this.initialCoordinates=(s=Xw(a))!=null?s:fa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xo.Resize,this.handleCancel),this.windowListeners.add(xo.DragStart,F5),this.windowListeners.add(xo.VisibilityChange,this.handleCancel),this.windowListeners.add(xo.ContextMenu,F5),this.documentListeners.add(xo.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(I5(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(H5(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xo.Click,YY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xo.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:a}=this,{onMove:l,options:{activationConstraint:h}}=a;if(!s)return;const m=(n=Xw(t))!=null?n:fa,p=_x(s,m);if(!r&&h){if(H5(h)){if(h.tolerance!=null&&U2(p,h.tolerance))return this.handleCancel();if(U2(p,h.distance))return this.handleStart()}if(I5(h)&&U2(p,h.tolerance))return this.handleCancel();this.handlePending(h,p);return}t.cancelable&&t.preventDefault(),l(m)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===qn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const KY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Db extends J4{constructor(t){const{event:n}=t,r=Ym(n.target);super(t,KY,r)}}Db.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const QY={move:{name:"mousemove"},end:{name:"mouseup"}};var Qw;(function(e){e[e.RightClick=2]="RightClick"})(Qw||(Qw={}));class ZY extends J4{constructor(t){super(t,QY,Ym(t.event.target))}}ZY.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Qw.RightClick?!1:(r==null||r({event:n}),!0)}}];const F2={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class JY extends J4{constructor(t){super(t,F2)}static setup(){return window.addEventListener(F2.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(F2.move.name,t)};function t(){}}}JY.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var rg;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(rg||(rg={}));var Nx;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Nx||(Nx={}));function eX(e){let{acceleration:t,activator:n=rg.Pointer,canScroll:r,draggingRect:s,enabled:a,interval:l=5,order:h=Nx.TreeOrder,pointerCoordinates:m,scrollableAncestors:p,scrollableAncestorRects:x,delta:b,threshold:w}=e;const E=nX({delta:b,disabled:!a}),[M,C]=mY(),S=y.useRef({x:0,y:0}),_=y.useRef({x:0,y:0}),N=y.useMemo(()=>{switch(n){case rg.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case rg.DraggableRect:return s}},[n,s,m]),c=y.useRef(null),j=y.useCallback(()=>{const B=c.current;if(!B)return;const T=S.current.x*_.current.x,A=S.current.y*_.current.y;B.scrollBy(T,A)},[]),D=y.useMemo(()=>h===Nx.TreeOrder?[...p].reverse():p,[h,p]);y.useEffect(()=>{if(!a||!p.length||!N){C();return}for(const B of D){if((r==null?void 0:r(B))===!1)continue;const T=p.indexOf(B),A=x[T];if(!A)continue;const{direction:H,speed:F}=HY(B,A,N,t,w);for(const V of["x","y"])E[V][H[V]]||(F[V]=0,H[V]=0);if(F.x>0||F.y>0){C(),c.current=B,M(j,l),S.current=F,_.current=H;return}}S.current={x:0,y:0},_.current={x:0,y:0},C()},[t,j,r,C,a,l,JSON.stringify(N),JSON.stringify(E),M,p,D,x,JSON.stringify(w)])}const tX={x:{[mi.Backward]:!1,[mi.Forward]:!1},y:{[mi.Backward]:!1,[mi.Forward]:!1}};function nX(e){let{delta:t,disabled:n}=e;const r=Yw(t);return Kg(s=>{if(n||!r||!s)return tX;const a={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[mi.Backward]:s.x[mi.Backward]||a.x===-1,[mi.Forward]:s.x[mi.Forward]||a.x===1},y:{[mi.Backward]:s.y[mi.Backward]||a.y===-1,[mi.Forward]:s.y[mi.Forward]||a.y===1}}},[n,t,r])}function rX(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Kg(s=>{var a;return t==null?null:(a=r??s)!=null?a:null},[r,t])}function iX(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,a=s.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...a]},[]),[e,t])}var Lg;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Lg||(Lg={}));var Zw;(function(e){e.Optimized="optimized"})(Zw||(Zw={}));const $5=new Map;function sX(e,t){let{dragging:n,dependencies:r,config:s}=t;const[a,l]=y.useState(null),{frequency:h,measure:m,strategy:p}=s,x=y.useRef(e),b=S(),w=bg(b),E=y.useCallback(function(_){_===void 0&&(_=[]),!w.current&&l(N=>N===null?_:N.concat(_.filter(c=>!N.includes(c))))},[w]),M=y.useRef(null),C=Kg(_=>{if(b&&!n)return $5;if(!_||_===$5||x.current!==e||a!=null){const N=new Map;for(let c of e){if(!c)continue;if(a&&a.length>0&&!a.includes(c.id)&&c.rect.current){N.set(c.id,c.rect.current);continue}const j=c.node.current,D=j?new Z4(m(j),j):null;c.rect.current=D,D&&N.set(c.id,D)}return N}return _},[e,a,n,b,m]);return y.useEffect(()=>{x.current=e},[e]),y.useEffect(()=>{b||E()},[n,b]),y.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),y.useEffect(()=>{b||typeof h!="number"||M.current!==null||(M.current=setTimeout(()=>{E(),M.current=null},h))},[h,b,E,...r]),{droppableRects:C,measureDroppableContainers:E,measuringScheduled:a!=null};function S(){switch(p){case Lg.Always:return!1;case Lg.BeforeDragging:return n;default:return!n}}}function w7(e,t){return Kg(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function oX(e,t){return w7(e,t)}function aX(e){let{callback:t,disabled:n}=e;const r=X4(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(r)},[r,n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Ab(e){let{callback:t,disabled:n}=e;const r=X4(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(r)},[n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function lX(e){return new Z4(Xm(e),e)}function V5(e,t,n){t===void 0&&(t=lX);const[r,s]=y.useState(null);function a(){s(m=>{if(!e)return null;if(e.isConnected===!1){var p;return(p=m??n)!=null?p:null}const x=t(e);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const l=aX({callback(m){if(e)for(const p of m){const{type:x,target:b}=p;if(x==="childList"&&b instanceof HTMLElement&&b.contains(e)){a();break}}}}),h=Ab({callback:a});return hl(()=>{a(),e?(h==null||h.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),l==null||l.disconnect())},[e]),r}function cX(e){const t=w7(e);return h7(e,t)}const q5=[];function uX(e){const t=y.useRef(e),n=Kg(r=>e?r&&r!==q5&&e&&t.current&&e.parentNode===t.current.parentNode?r:Q4(e):q5,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function dX(e){const[t,n]=y.useState(null),r=y.useRef(e),s=y.useCallback(a=>{const l=B2(a.target);l&&n(h=>h?(h.set(l,Kw(l)),new Map(h)):null)},[]);return y.useEffect(()=>{const a=r.current;if(e!==a){l(a);const h=e.map(m=>{const p=B2(m);return p?(p.addEventListener("scroll",s,{passive:!0}),[p,Kw(p)]):null}).filter(m=>m!=null);n(h.length?new Map(h):null),r.current=e}return()=>{l(e),l(a)};function l(h){h.forEach(m=>{const p=B2(m);p==null||p.removeEventListener("scroll",s)})}},[s,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>fm(a,l),fa):x7(e):fa,[e,t])}function W5(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==fa;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?_x(e,n.current):fa}function fX(e){y.useEffect(()=>{if(!Tb)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function hX(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:a}=r;return n[s]=l=>{a(l,t)},n},{}),[e,t])}function S7(e){return y.useMemo(()=>e?zY(e):null,[e])}const G5=[];function mX(e,t){t===void 0&&(t=Xm);const[n]=e,r=S7(n?Ps(n):null),[s,a]=y.useState(G5);function l(){a(()=>e.length?e.map(m=>v7(m)?r:new Z4(t(m),m)):G5)}const h=Ab({callback:l});return hl(()=>{h==null||h.disconnect(),l(),e.forEach(m=>h==null?void 0:h.observe(m))},[e]),s}function pX(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xg(t)?t:e}function gX(e){let{measure:t}=e;const[n,r]=y.useState(null),s=y.useCallback(p=>{for(const{target:x}of p)if(Xg(x)){r(b=>{const w=t(x);return b?{...b,width:w.width,height:w.height}:w});break}},[t]),a=Ab({callback:s}),l=y.useCallback(p=>{const x=pX(p);a==null||a.disconnect(),x&&(a==null||a.observe(x)),r(x?t(x):null)},[t,a]),[h,m]=Rx(l);return y.useMemo(()=>({nodeRef:h,rect:n,setRef:m}),[n,h,m])}const vX=[{sensor:Db,options:{}},{sensor:L7,options:{}}],yX={current:{}},ax={draggable:{measure:U5},droppable:{measure:U5,strategy:Lg.WhileDragging,frequency:Zw.Optimized},dragOverlay:{measure:Xm}};class ig extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const xX={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ig,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Mx},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ax,measureDroppableContainers:Mx,windowRect:null,measuringScheduled:!1},bX={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Mx,draggableNodes:new Map,over:null,measureDroppableContainers:Mx},jb=y.createContext(bX),C7=y.createContext(xX);function LX(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ig}}}function wX(e,t){switch(t.type){case ai.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ai.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ai.DragEnd:case ai.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ai.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new ig(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case ai.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const l=new ig(e.droppable.containers);return l.set(n,{...a,disabled:s}),{...e,droppable:{...e.droppable,containers:l}}}case ai.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new ig(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function SX(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=y.useContext(jb),a=Yw(r),l=Yw(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&a&&l!=null){if(!K4(a)||document.activeElement===a.target)return;const h=s.get(l);if(!h)return;const{activatorNode:m,node:p}=h;if(!m.current&&!p.current)return;requestAnimationFrame(()=>{for(const x of[m.current,p.current]){if(!x)continue;const b=vY(x);if(b){b.focus();break}}})}},[r,t,s,l,a]),null}function CX(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,a)=>a({transform:s,...r}),n):n}function EX(e){return y.useMemo(()=>({draggable:{...ax.draggable,...e==null?void 0:e.draggable},droppable:{...ax.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ax.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function RX(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const a=y.useRef(!1),{x:l,y:h}=typeof s=="boolean"?{x:s,y:s}:s;hl(()=>{if(!l&&!h||!t){a.current=!1;return}if(a.current||!r)return;const p=t==null?void 0:t.node.current;if(!p||p.isConnected===!1)return;const x=n(p),b=h7(x,r);if(l||(b.x=0),h||(b.y=0),a.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const w=m7(p);w&&w.scrollBy({top:b.y,left:b.x})}},[t,l,h,r,n])}const E7=y.createContext({...fa,scaleX:1,scaleY:1});var ru;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ru||(ru={}));const R7=y.memo(function(t){var n,r,s,a;let{id:l,accessibility:h,autoScroll:m=!0,children:p,sensors:x=vX,collisionDetection:b=OY,measuring:w,modifiers:E,...M}=t;const C=y.useReducer(wX,void 0,LX),[S,_]=C,[N,c]=SY(),[j,D]=y.useState(ru.Uninitialized),B=j===ru.Initialized,{draggable:{active:T,nodes:A,translate:H},droppable:{containers:F}}=S,V=T!=null?A.get(T):null,ee=y.useRef({initial:null,translated:null}),G=y.useMemo(()=>{var ft;return T!=null?{id:T,data:(ft=V==null?void 0:V.data)!=null?ft:yX,rect:ee}:null},[T,V]),se=y.useRef(null),[Ce,te]=y.useState(null),[K,Z]=y.useState(null),oe=bg(M,Object.values(M)),Y=Qg("DndDescribedBy",l),ne=y.useMemo(()=>F.getEnabled(),[F]),X=EX(w),{droppableRects:ue,measureDroppableContainers:pe,measuringScheduled:Se}=sX(ne,{dragging:B,dependencies:[H.x,H.y],config:X.droppable}),Re=rX(A,T),ye=y.useMemo(()=>K?Xw(K):null,[K]),ve=wr(),he=oX(Re,X.draggable.measure);RX({activeNode:T!=null?A.get(T):null,config:ve.layoutShiftCompensation,initialRect:he,measure:X.draggable.measure});const de=V5(Re,X.draggable.measure,he),ke=V5(Re?Re.parentElement:null),Ee=y.useRef({activatorEvent:null,active:null,activeNode:Re,collisionRect:null,collisions:null,droppableRects:ue,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ke=F.getNodeFor((n=Ee.current.over)==null?void 0:n.id),ae=gX({measure:X.dragOverlay.measure}),We=(r=ae.nodeRef.current)!=null?r:Re,bt=B?(s=ae.rect)!=null?s:de:null,tt=!!(ae.nodeRef.current&&ae.rect),mt=cX(tt?null:de),Xe=S7(We?Ps(We):null),at=uX(B?Ke??Re:null),ot=mX(at),Ct=CX(E,{transform:{x:H.x-mt.x,y:H.y-mt.y,scaleX:1,scaleY:1},activatorEvent:K,active:G,activeNodeRect:de,containerNodeRect:ke,draggingNodeRect:bt,over:Ee.current.over,overlayNodeRect:ae.rect,scrollableAncestors:at,scrollableAncestorRects:ot,windowRect:Xe}),Ot=ye?fm(ye,H):null,kn=dX(at),_t=W5(kn),kt=W5(kn,[de]),$=fm(Ct,_t),k=bt?AY(bt,Ct):null,z=G&&k?b({active:G,collisionRect:k,droppableRects:ue,droppableContainers:ne,pointerCoordinates:Ot}):null,J=MY(z,"id"),[le,xe]=y.useState(null),Ae=tt?Ct:fm(Ct,kt),wt=TY(Ae,(a=le==null?void 0:le.rect)!=null?a:null,de),Mt=y.useRef(null),nt=y.useCallback((ft,jt)=>{let{sensor:qt,options:Pt}=jt;if(se.current==null)return;const Wt=A.get(se.current);if(!Wt)return;const Me=ft.nativeEvent,gt=new qt({active:se.current,activeNode:Wt,event:Me,options:Pt,context:Ee,onAbort(St){if(!A.get(St))return;const{onDragAbort:en}=oe.current,bn={id:St};en==null||en(bn),N({type:"onDragAbort",event:bn})},onPending(St,dt,en,bn){if(!A.get(St))return;const{onDragPending:Tt}=oe.current,ce={id:St,constraint:dt,initialCoordinates:en,offset:bn};Tt==null||Tt(ce),N({type:"onDragPending",event:ce})},onStart(St){const dt=se.current;if(dt==null)return;const en=A.get(dt);if(!en)return;const{onDragStart:bn}=oe.current,rt={activatorEvent:Me,active:{id:dt,data:en.data,rect:ee}};ol.unstable_batchedUpdates(()=>{bn==null||bn(rt),D(ru.Initializing),_({type:ai.DragStart,initialCoordinates:St,active:dt}),N({type:"onDragStart",event:rt}),te(Mt.current),Z(Me)})},onMove(St){_({type:ai.DragMove,coordinates:St})},onEnd:Jt(ai.DragEnd),onCancel:Jt(ai.DragCancel)});Mt.current=gt;function Jt(St){return async function(){const{active:en,collisions:bn,over:rt,scrollAdjustedTranslate:Tt}=Ee.current;let ce=null;if(en&&Tt){const{cancelDrop:Ue}=oe.current;ce={activatorEvent:Me,active:en,collisions:bn,delta:Tt,over:rt},St===ai.DragEnd&&typeof Ue=="function"&&await Promise.resolve(Ue(ce))&&(St=ai.DragCancel)}se.current=null,ol.unstable_batchedUpdates(()=>{_({type:St}),D(ru.Uninitialized),xe(null),te(null),Z(null),Mt.current=null;const Ue=St===ai.DragEnd?"onDragEnd":"onDragCancel";if(ce){const ze=oe.current[Ue];ze==null||ze(ce),N({type:Ue,event:ce})}})}}},[A]),pt=y.useCallback((ft,jt)=>(qt,Pt)=>{const Wt=qt.nativeEvent,Me=A.get(Pt);if(se.current!==null||!Me||Wt.dndKit||Wt.defaultPrevented)return;const gt={active:Me};ft(qt,jt.options,gt)===!0&&(Wt.dndKit={capturedBy:jt.sensor},se.current=Pt,nt(qt,jt))},[A,nt]),Bt=iX(x,pt);fX(x),hl(()=>{de&&j===ru.Initializing&&D(ru.Initialized)},[de,j]),y.useEffect(()=>{const{onDragMove:ft}=oe.current,{active:jt,activatorEvent:qt,collisions:Pt,over:Wt}=Ee.current;if(!jt||!qt)return;const Me={active:jt,activatorEvent:qt,collisions:Pt,delta:{x:$.x,y:$.y},over:Wt};ol.unstable_batchedUpdates(()=>{ft==null||ft(Me),N({type:"onDragMove",event:Me})})},[$.x,$.y]),y.useEffect(()=>{const{active:ft,activatorEvent:jt,collisions:qt,droppableContainers:Pt,scrollAdjustedTranslate:Wt}=Ee.current;if(!ft||se.current==null||!jt||!Wt)return;const{onDragOver:Me}=oe.current,gt=Pt.get(J),Jt=gt&&gt.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,St={active:ft,activatorEvent:jt,collisions:qt,delta:{x:Wt.x,y:Wt.y},over:Jt};ol.unstable_batchedUpdates(()=>{xe(Jt),Me==null||Me(St),N({type:"onDragOver",event:St})})},[J]),hl(()=>{Ee.current={activatorEvent:K,active:G,activeNode:Re,collisionRect:k,collisions:z,droppableRects:ue,draggableNodes:A,draggingNode:We,draggingNodeRect:bt,droppableContainers:F,over:le,scrollableAncestors:at,scrollAdjustedTranslate:$},ee.current={initial:bt,translated:k}},[G,Re,z,k,A,We,bt,ue,F,le,at,$]),eX({...ve,delta:H,draggingRect:k,pointerCoordinates:Ot,scrollableAncestors:at,scrollableAncestorRects:ot});const gr=y.useMemo(()=>({active:G,activeNode:Re,activeNodeRect:de,activatorEvent:K,collisions:z,containerNodeRect:ke,dragOverlay:ae,draggableNodes:A,droppableContainers:F,droppableRects:ue,over:le,measureDroppableContainers:pe,scrollableAncestors:at,scrollableAncestorRects:ot,measuringConfiguration:X,measuringScheduled:Se,windowRect:Xe}),[G,Re,de,K,z,ke,ae,A,F,ue,le,pe,at,ot,X,Se,Xe]),Lr=y.useMemo(()=>({activatorEvent:K,activators:Bt,active:G,activeNodeRect:de,ariaDescribedById:{draggable:Y},dispatch:_,draggableNodes:A,over:le,measureDroppableContainers:pe}),[K,Bt,G,de,_,Y,A,le,pe]);return Un.createElement(u7.Provider,{value:c},Un.createElement(jb.Provider,{value:Lr},Un.createElement(C7.Provider,{value:gr},Un.createElement(E7.Provider,{value:wt},p)),Un.createElement(SX,{disabled:(h==null?void 0:h.restoreFocus)===!1})),Un.createElement(RY,{...h,hiddenTextDescribedById:Y}));function wr(){const ft=(Ce==null?void 0:Ce.autoScrollEnabled)===!1,jt=typeof m=="object"?m.enabled===!1:m===!1,qt=B&&!ft&&!jt;return typeof m=="object"?{...m,enabled:qt}:{enabled:qt}}}),_X=y.createContext(null),Y5="button",MX="Draggable";function NX(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const a=Qg(MX),{activators:l,activatorEvent:h,active:m,activeNodeRect:p,ariaDescribedById:x,draggableNodes:b,over:w}=y.useContext(jb),{role:E=Y5,roleDescription:M="draggable",tabIndex:C=0}=s??{},S=(m==null?void 0:m.id)===t,_=y.useContext(S?E7:_X),[N,c]=Rx(),[j,D]=Rx(),B=hX(l,t),T=bg(n);hl(()=>(b.set(t,{id:t,key:a,node:N,activatorNode:j,data:T}),()=>{const H=b.get(t);H&&H.key===a&&b.delete(t)}),[b,t]);const A=y.useMemo(()=>({role:E,tabIndex:C,"aria-disabled":r,"aria-pressed":S&&E===Y5?!0:void 0,"aria-roledescription":M,"aria-describedby":x.draggable}),[r,E,C,S,M,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:p,attributes:A,isDragging:S,listeners:r?void 0:B,node:N,over:w,setNodeRef:c,setActivatorNodeRef:D,transform:_}}function OX(){return y.useContext(C7)}const TX="Droppable",DX={timeout:25};function AX(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const a=Qg(TX),{active:l,dispatch:h,over:m,measureDroppableContainers:p}=y.useContext(jb),x=y.useRef({disabled:n}),b=y.useRef(!1),w=y.useRef(null),E=y.useRef(null),{disabled:M,updateMeasurementsFor:C,timeout:S}={...DX,...s},_=bg(C??r),N=y.useCallback(()=>{if(!b.current){b.current=!0;return}E.current!=null&&clearTimeout(E.current),E.current=setTimeout(()=>{p(Array.isArray(_.current)?_.current:[_.current]),E.current=null},S)},[S]),c=Ab({callback:N,disabled:M||!l}),j=y.useCallback((A,H)=>{c&&(H&&(c.unobserve(H),b.current=!1),A&&c.observe(A))},[c]),[D,B]=Rx(j),T=bg(t);return y.useEffect(()=>{!c||!D.current||(c.disconnect(),b.current=!1,c.observe(D.current))},[D,c]),y.useEffect(()=>(h({type:ai.RegisterDroppable,element:{id:r,key:a,disabled:n,node:D,rect:w,data:T}}),()=>h({type:ai.UnregisterDroppable,key:a,id:r})),[r]),y.useEffect(()=>{n!==x.current.disabled&&(h({type:ai.SetDroppableDisabled,id:r,key:a,disabled:n}),x.current.disabled=n)},[r,a,n,h]),{active:l,rect:w,isOver:(m==null?void 0:m.id)===r,node:D,over:m,setNodeRef:B}}function kb(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function jX(e,t){return e.reduce((n,r,s)=>{const a=t.get(r);return a&&(n[s]=a),n},Array(e.length))}function zy(e){return e!==null&&e>=0}function kX(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function PX(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const eS=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const a=kb(t,r,n),l=t[s],h=a[s];return!h||!l?null:{x:h.left-l.left,y:h.top-l.top,scaleX:h.width/l.width,scaleY:h.height/l.height}},By={scaleX:1,scaleY:1},zX=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:a,overIndex:l}=e;const h=(t=a[n])!=null?t:r;if(!h)return null;if(s===n){const p=a[l];return p?{x:0,y:n<l?p.top+p.height-(h.top+h.height):p.top-h.top,...By}:null}const m=BX(a,s,n);return s>n&&s<=l?{x:0,y:-h.height-m,...By}:s<n&&s>=l?{x:0,y:h.height+m,...By}:{x:0,y:0,...By}};function BX(e,t,n){const r=e[t],s=e[t-1],a=e[t+1];return r?n<t?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const _7="Sortable",M7=Un.createContext({activeIndex:-1,containerId:_7,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:eS,disabled:{draggable:!1,droppable:!1}});function N7(e){let{children:t,id:n,items:r,strategy:s=eS,disabled:a=!1}=e;const{active:l,dragOverlay:h,droppableRects:m,over:p,measureDroppableContainers:x}=OX(),b=Qg(_7,n),w=h.rect!==null,E=y.useMemo(()=>r.map(B=>typeof B=="object"&&"id"in B?B.id:B),[r]),M=l!=null,C=l?E.indexOf(l.id):-1,S=p?E.indexOf(p.id):-1,_=y.useRef(E),N=!kX(E,_.current),c=S!==-1&&C===-1||N,j=PX(a);hl(()=>{N&&M&&x(E)},[N,E,M,x]),y.useEffect(()=>{_.current=E},[E]);const D=y.useMemo(()=>({activeIndex:C,containerId:b,disabled:j,disableTransforms:c,items:E,overIndex:S,useDragOverlay:w,sortedRects:jX(E,m),strategy:s}),[C,b,j.draggable,j.droppable,c,E,S,m,w,s]);return Un.createElement(M7.Provider,{value:D},t)}const UX=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return kb(n,r,s).indexOf(t)},FX=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:a,newIndex:l,previousItems:h,previousContainerId:m,transition:p}=e;return!p||!r||h!==a&&s===l?!1:n?!0:l!==s&&t===m},HX={duration:200,easing:"ease"},O7="transform",IX=Om.Transition.toString({property:O7,duration:0,easing:"linear"}),$X={roleDescription:"sortable"};function VX(e){let{disabled:t,index:n,node:r,rect:s}=e;const[a,l]=y.useState(null),h=y.useRef(n);return hl(()=>{if(!t&&n!==h.current&&r.current){const m=s.current;if(m){const p=Xm(r.current,{ignoreTransform:!0}),x={x:m.left-p.left,y:m.top-p.top,scaleX:m.width/p.width,scaleY:m.height/p.height};(x.x||x.y)&&l(x)}}n!==h.current&&(h.current=n)},[t,n,r,s]),y.useEffect(()=>{a&&l(null)},[a]),a}function T7(e){let{animateLayoutChanges:t=FX,attributes:n,disabled:r,data:s,getNewIndex:a=UX,id:l,strategy:h,resizeObserverConfig:m,transition:p=HX}=e;const{items:x,containerId:b,activeIndex:w,disabled:E,disableTransforms:M,sortedRects:C,overIndex:S,useDragOverlay:_,strategy:N}=y.useContext(M7),c=qX(r,E),j=x.indexOf(l),D=y.useMemo(()=>({sortable:{containerId:b,index:j,items:x},...s}),[b,s,j,x]),B=y.useMemo(()=>x.slice(x.indexOf(l)),[x,l]),{rect:T,node:A,isOver:H,setNodeRef:F}=AX({id:l,data:D,disabled:c.droppable,resizeObserverConfig:{updateMeasurementsFor:B,...m}}),{active:V,activatorEvent:ee,activeNodeRect:G,attributes:se,setNodeRef:Ce,listeners:te,isDragging:K,over:Z,setActivatorNodeRef:oe,transform:Y}=NX({id:l,data:D,attributes:{...$X,...n},disabled:c.draggable}),ne=hY(F,Ce),X=!!V,ue=X&&!M&&zy(w)&&zy(S),pe=!_&&K,Se=pe&&ue?Y:null,ye=ue?Se??(h??N)({rects:C,activeNodeRect:G,activeIndex:w,overIndex:S,index:j}):null,ve=zy(w)&&zy(S)?a({id:l,items:x,activeIndex:w,overIndex:S}):j,he=V==null?void 0:V.id,de=y.useRef({activeId:he,items:x,newIndex:ve,containerId:b}),ke=x!==de.current.items,Ee=t({active:V,containerId:b,isDragging:K,isSorting:X,id:l,index:j,items:x,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:p,wasDragging:de.current.activeId!=null}),Ke=VX({disabled:!Ee,index:j,node:A,rect:T});return y.useEffect(()=>{X&&de.current.newIndex!==ve&&(de.current.newIndex=ve),b!==de.current.containerId&&(de.current.containerId=b),x!==de.current.items&&(de.current.items=x)},[X,ve,b,x]),y.useEffect(()=>{if(he===de.current.activeId)return;if(he!=null&&de.current.activeId==null){de.current.activeId=he;return}const We=setTimeout(()=>{de.current.activeId=he},50);return()=>clearTimeout(We)},[he]),{active:V,activeIndex:w,attributes:se,data:D,rect:T,index:j,newIndex:ve,items:x,isOver:H,isSorting:X,isDragging:K,listeners:te,node:A,overIndex:S,over:Z,setNodeRef:ne,setActivatorNodeRef:oe,setDroppableNodeRef:F,setDraggableNodeRef:Ce,transform:Ke??ye,transition:ae()};function ae(){if(Ke||ke&&de.current.newIndex===j)return IX;if(!(pe&&!K4(ee)||!p)&&(X||Ee))return Om.Transition.toString({...p,property:O7})}}function qX(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}qn.Down,qn.Right,qn.Up,qn.Left;const WX=3e4;function GX({camera:e,dataUrl:t,showSnapshot:n,lightOnMotion:r,sirenOnMotion:s,isRecording:a,onSelect:l}){return f.jsx("div",{className:"overflow-hidden bg-card border-0 leading-[0] [&>button]:block [&>button]:w-full",children:f.jsx(G6,{camera:e,dataUrl:t,showSnapshot:n,lightOnMotion:r,sirenOnMotion:s,isRecording:a,effectiveCardWidth:400,onSelect:l})})}function YX({camera:e,dataUrl:t,showSnapshot:n,lightOnMotion:r,sirenOnMotion:s,isRecording:a,onSelect:l}){const{attributes:h,listeners:m,setNodeRef:p,transform:x,transition:b,isDragging:w}=T7({id:e.id}),E={transform:Om.Transform.toString(x),transition:b};return f.jsx("div",{ref:p,style:E,...h,...m,className:He("overflow-hidden bg-card border-0 cursor-grab active:cursor-grabbing leading-[0] [&>button]:block [&>button]:w-full",w&&"z-50 opacity-80 ring-2 ring-primary"),children:f.jsx(G6,{camera:e,dataUrl:t,showSnapshot:n,lightOnMotion:r,sirenOnMotion:s,isRecording:a,effectiveCardWidth:400,onSelect:l})})}function XX(){qi();const{getCamerasStatus:e}=ks(),t=Te(F=>F.configs),n=Te(F=>F.camerasStatus),r=Te(F=>F.setCamerasStatus),a=Te(F=>F.lastCamerasSnapshots)??{},l=Te(F=>F.camerasListScrollTop),h=Te(F=>F.setCamerasListScrollTop),m=Te(F=>F.cameraOrder),p=Te(F=>F.setCameraOrder),x=Te(F=>F.camerasReorderEnabled),b=ma(),w=y.useRef(null),E=ml(),M=n4(),C=(t==null?void 0:t.cameras)??[],S=t!==void 0,_=y.useMemo(()=>{if(!C.length)return[];const F=m!=null&&m.length?m:C.map(G=>G.id),V=new Map(C.map(G=>[G.id,G])),ee=[];for(const G of F){const se=V.get(G);se&&(ee.push(se),V.delete(G))}return V.forEach(G=>ee.push(G)),ee},[C,m]),N=y.useMemo(()=>Object.fromEntries(C.map(F=>[F.id,F.name??F.id])),[C]),c=f7(d7(Db,{activationConstraint:{distance:8}})),j=y.useCallback(F=>{const{active:V,over:ee}=F;if(!ee||V.id===ee.id)return;const G=_.findIndex(te=>te.id===V.id),se=_.findIndex(te=>te.id===ee.id);if(G===-1||se===-1)return;const Ce=kb(_,G,se);p(Ce.map(te=>te.id))},[_,p]);y.useEffect(()=>{if(!S||C.length===0)return;const F=async()=>{try{const ee=await e();r(ee.cameras??{})}catch{}};F();const V=setInterval(F,WX);return()=>clearInterval(V)},[S,C.length,e,r]),y.useEffect(()=>{const F=l;if(F==null||F<=0)return;const V=()=>{const G=w.current;G&&(G.scrollTop=F)},ee=requestAnimationFrame(()=>{requestAnimationFrame(V)});return()=>cancelAnimationFrame(ee)},[l]);const D=y.useCallback(F=>{const V=w.current;V&&h(V.scrollTop),b(`/cameras/${F}`)},[b,h]);if(!S)return f.jsx("div",{className:"flex flex-1 flex-col p-0",children:f.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-px bg-border",children:[1,2,3,4,5,6].map(F=>f.jsxs("div",{className:"overflow-hidden bg-card",children:[f.jsx(Ts,{className:"aspect-video w-full rounded-none"}),f.jsx("div",{className:"p-2",children:f.jsx(Ts,{className:"h-4 w-24 rounded-none"})})]},F))})});if(C.length===0)return f.jsx("div",{className:"flex flex-1 flex-col items-center justify-center p-4 md:p-6",children:f.jsxs("div",{className:"flex flex-col items-center rounded-xl border border-dashed py-24",children:[f.jsx(pf,{className:"mb-4 h-20 w-20 text-muted-foreground/50"}),f.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"No cameras found"}),f.jsx("p",{className:"mt-1 text-sm text-muted-foreground/80",children:"Add cameras in the Advanced Notifier plugin settings"})]})});const B=E?M?"grid-cols-2":"grid-cols-1":"grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",T=F=>{var Z,oe;const V=n==null?void 0:n[F.id],ee=(V==null?void 0:V.isSnapshotsEnabled)!==!1,G=ee?a[F.id]:null,se=((Z=V==null?void 0:V.accessorySwitchStates)==null?void 0:Z.light_on_motion)===!0,Ce=((oe=V==null?void 0:V.accessorySwitchStates)==null?void 0:oe.siren_on_motion)===!0,te=(V==null?void 0:V.isRecording)===!0,K={camera:F,dataUrl:G,showSnapshot:ee,lightOnMotion:se,sirenOnMotion:Ce,isRecording:te,onSelect:()=>D(F.id)};return x?f.jsx(YX,{...K},F.id):f.jsx(GX,{...K},F.id)},[A,H]=y.useState(!1);return f.jsxs("div",{className:"flex flex-1 flex-col min-h-0",children:[f.jsx("div",{className:"shrink-0 w-full px-2 py-2 md:px-4 md:py-3",children:E?f.jsxs("div",{className:"overflow-hidden rounded-lg border bg-muted/30",children:[f.jsxs("button",{type:"button",onClick:()=>H(F=>!F),className:"flex w-full items-center justify-center gap-2 py-2 text-sm font-medium hover:bg-muted/50 transition-colors","aria-label":A?"Expand Reel":"Collapse Reel","aria-expanded":!A,children:[f.jsx(ef,{className:"size-4"}),"Reel",A?f.jsx(pu,{className:"size-4 rotate-180"}):f.jsx(pu,{className:"size-4"})]}),f.jsx("div",{className:He("grid transition-[grid-template-rows] duration-200 ease-out",A?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:f.jsx("div",{className:"min-h-0 overflow-hidden",children:f.jsx(z5,{cameraNames:N,height:120,className:"rounded-lg w-full"})})})]}):f.jsx(z5,{cameraNames:N,height:120,className:"rounded-lg w-full"})}),f.jsx("div",{ref:w,className:"flex-1 overflow-auto p-0 min-h-0",children:x?f.jsx(R7,{sensors:c,onDragEnd:j,children:f.jsx(N7,{items:_.map(F=>F.id),strategy:eS,children:f.jsx("div",{className:He("grid gap-0 content-start",B),children:_.map(T)})})}):f.jsx("div",{className:He("grid gap-0 content-start",B),children:_.map(T)})})]})}const D7=e=>y.createElement("svg",{baseProfile:"full",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg","xmlns:ev":"http://www.w3.org/2001/xml-events",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},y.createElement("defs",null),y.createElement("path",{d:"M 14.95,20.95 L 14.95,20.91 L 14.95,20.86 L 14.95,20.81 L 14.95,20.77 L 14.95,20.72 L 14.95,20.67 L 14.95,20.62 L 14.95,20.58 L 14.95,20.53 L 14.95,20.48 L 14.95,20.44 L 14.95,20.39 L 14.95,20.34 L 14.95,20.30 L 14.95,20.25 L 14.95,20.20 L 14.95,20.16 L 14.95,20.11 L 14.95,20.06 L 14.95,20.02 L 14.95,19.97 L 14.95,19.92 L 14.95,19.88 L 14.95,19.83 L 14.95,19.78 L 14.95,19.73 L 14.95,19.69 L 14.95,19.64 L 14.95,19.59 L 14.95,19.55 L 14.95,19.50 L 14.95,19.45 L 14.95,19.41 L 14.95,19.36 L 14.95,19.31 L 14.95,19.27 L 14.95,19.22 L 14.95,19.17 L 14.95,19.12 L 14.95,19.08 L 14.95,19.03 L 14.95,18.98 L 15.00,18.94 L 15.05,18.94 L 15.09,18.94 L 15.14,18.94 L 15.19,18.94 L 15.23,18.94 L 15.28,18.94 L 15.33,18.94 L 15.38,18.94 L 15.42,18.94 L 15.47,18.94 L 15.52,18.94 L 15.56,18.94 L 15.61,18.94 L 15.66,18.94 L 15.70,18.94 L 15.75,18.94 L 15.80,18.94 L 15.84,18.94 L 15.89,18.94 L 15.94,18.94 L 15.98,18.94 L 16.03,18.94 L 16.08,18.94 L 16.12,18.94 L 16.17,18.94 L 16.22,18.94 L 16.27,18.94 L 16.31,18.94 L 16.36,18.94 L 16.41,18.94 L 16.45,18.94 L 16.50,18.94 L 16.55,18.94 L 16.59,18.94 L 16.64,18.94 L 16.69,18.94 L 16.73,18.94 L 16.78,18.94 L 16.83,18.94 L 16.88,18.94 L 16.92,18.94 L 16.97,18.94 L 17.02,18.94 L 17.06,18.94 L 17.11,18.94 L 17.16,18.94 L 17.20,18.94 L 17.25,18.94 L 17.25,18.94 L 17.30,18.89 L 17.34,18.89 L 17.39,18.89 L 17.44,18.89 L 17.44,18.89 L 17.48,18.84 L 17.53,18.84 L 17.58,18.84 L 17.62,18.84 L 17.63,18.84 L 17.67,18.80 L 17.72,18.80 L 17.72,18.80 L 17.77,18.75 L 17.81,18.75 L 17.81,18.75 L 17.86,18.70 L 17.91,18.70 L 17.91,18.70 L 17.95,18.66 L 18.00,18.66 L 18.00,18.66 L 18.05,18.61 L 18.05,18.61 L 18.09,18.56 L 18.14,18.56 L 18.14,18.56 L 18.19,18.52 L 18.19,18.52 L 18.23,18.47 L 18.23,18.47 L 18.28,18.42 L 18.28,18.42 L 18.33,18.38 L 18.33,18.38 L 18.38,18.33 L 18.38,18.33 L 18.42,18.28 L 18.42,18.28 L 18.47,18.23 L 18.47,18.23 L 18.52,18.19 L 18.52,18.19 L 18.56,18.14 L 18.56,18.14 L 18.56,18.09 L 18.61,18.05 L 18.61,18.05 L 18.66,18.00 L 18.66,18.00 L 18.66,17.95 L 18.70,17.91 L 18.70,17.91 L 18.70,17.86 L 18.75,17.81 L 18.75,17.81 L 18.75,17.77 L 18.80,17.72 L 18.80,17.72 L 18.80,17.67 L 18.84,17.63 L 18.84,17.62 L 18.84,17.58 L 18.84,17.53 L 18.84,17.48 L 18.89,17.44 L 18.89,17.44 L 18.89,17.39 L 18.89,17.34 L 18.89,17.30 L 18.94,17.25 L 18.94,17.25 L 18.94,17.20 L 18.94,17.16 L 18.94,17.11 L 18.94,17.06 L 18.94,17.02 L 18.94,16.97 L 18.94,16.92 L 18.94,16.88 L 18.94,16.83 L 18.94,16.78 L 18.94,16.73 L 18.94,16.69 L 18.94,16.64 L 18.94,16.59 L 18.94,16.55 L 18.94,16.50 L 18.94,16.45 L 18.94,16.41 L 18.94,16.36 L 18.94,16.31 L 18.94,16.27 L 18.94,16.22 L 18.94,16.17 L 18.94,16.12 L 18.94,16.08 L 18.94,16.03 L 18.94,15.98 L 18.94,15.94 L 18.94,15.89 L 18.94,15.84 L 18.94,15.80 L 18.94,15.75 L 18.94,15.70 L 18.94,15.66 L 18.94,15.61 L 18.94,15.56 L 18.94,15.52 L 18.94,15.47 L 18.94,15.42 L 18.94,15.38 L 18.94,15.33 L 18.94,15.28 L 18.94,15.23 L 18.94,15.19 L 18.94,15.14 L 18.94,15.09 L 18.94,15.05 L 18.94,15.00 L 18.98,14.95 L 19.03,14.95 L 19.08,14.95 L 19.12,14.95 L 19.17,14.95 L 19.22,14.95 L 19.27,14.95 L 19.31,14.95 L 19.36,14.95 L 19.41,14.95 L 19.45,14.95 L 19.50,14.95 L 19.55,14.95 L 19.59,14.95 L 19.64,14.95 L 19.69,14.95 L 19.73,14.95 L 19.78,14.95 L 19.83,14.95 L 19.88,14.95 L 19.92,14.95 L 19.97,14.95 L 20.02,14.95 L 20.06,14.95 L 20.11,14.95 L 20.16,14.95 L 20.20,14.95 L 20.25,14.95 L 20.30,14.95 L 20.34,14.95 L 20.39,14.95 L 20.44,14.95 L 20.48,14.95 L 20.53,14.95 L 20.58,14.95 L 20.62,14.95 L 20.67,14.95 L 20.72,14.95 L 20.77,14.95 L 20.81,14.95 L 20.86,14.95 L 20.91,14.95 L 20.95,14.95 L 20.95,14.95 L 20.95,14.91 L 20.95,14.86 L 20.95,14.81 L 20.95,14.77 L 20.95,14.72 L 20.95,14.67 L 20.95,14.62 L 20.95,14.58 L 20.95,14.53 L 20.95,14.48 L 20.95,14.44 L 20.95,14.39 L 20.95,14.34 L 20.95,14.30 L 20.95,14.25 L 20.95,14.20 L 20.95,14.16 L 20.95,14.11 L 20.95,14.06 L 20.95,14.02 L 20.95,13.97 L 20.95,13.92 L 20.95,13.88 L 20.95,13.83 L 20.95,13.78 L 20.95,13.73 L 20.95,13.69 L 20.95,13.64 L 20.95,13.59 L 20.95,13.55 L 20.95,13.50 L 20.95,13.45 L 20.95,13.41 L 20.95,13.36 L 20.95,13.31 L 20.95,13.27 L 20.95,13.22 L 20.95,13.17 L 20.95,13.12 L 20.95,13.08 L 20.95,13.03 L 20.95,12.98 L 20.95,12.98 L 20.91,12.98 L 20.86,12.98 L 20.81,12.98 L 20.77,12.98 L 20.72,12.98 L 20.67,12.98 L 20.62,12.98 L 20.58,12.98 L 20.53,12.98 L 20.48,12.98 L 20.44,12.98 L 20.39,12.98 L 20.34,12.98 L 20.30,12.98 L 20.25,12.98 L 20.20,12.98 L 20.16,12.98 L 20.11,12.98 L 20.06,12.98 L 20.02,12.98 L 19.97,12.98 L 19.92,12.98 L 19.88,12.98 L 19.83,12.98 L 19.78,12.98 L 19.73,12.98 L 19.69,12.98 L 19.64,12.98 L 19.59,12.98 L 19.55,12.98 L 19.50,12.98 L 19.45,12.98 L 19.41,12.98 L 19.36,12.98 L 19.31,12.98 L 19.27,12.98 L 19.22,12.98 L 19.17,12.98 L 19.12,12.98 L 19.08,12.98 L 19.03,12.98 L 18.98,12.98 L 18.94,12.94 L 18.94,12.89 L 18.94,12.84 L 18.94,12.80 L 18.94,12.75 L 18.94,12.70 L 18.94,12.66 L 18.94,12.61 L 18.94,12.56 L 18.94,12.52 L 18.94,12.47 L 18.94,12.42 L 18.94,12.38 L 18.94,12.33 L 18.94,12.28 L 18.94,12.23 L 18.94,12.19 L 18.94,12.14 L 18.94,12.09 L 18.94,12.05 L 18.94,12.00 L 18.94,11.95 L 18.94,11.91 L 18.94,11.86 L 18.94,11.81 L 18.94,11.77 L 18.94,11.72 L 18.94,11.67 L 18.94,11.62 L 18.94,11.58 L 18.94,11.53 L 18.94,11.48 L 18.94,11.44 L 18.94,11.39 L 18.94,11.34 L 18.94,11.30 L 18.94,11.25 L 18.94,11.20 L 18.94,11.16 L 18.94,11.11 L 18.94,11.06 L 18.94,11.02 L 18.98,10.97 L 19.03,10.97 L 19.08,10.97 L 19.12,10.97 L 19.17,10.97 L 19.22,10.97 L 19.27,10.97 L 19.31,10.97 L 19.36,10.97 L 19.41,10.97 L 19.45,10.97 L 19.50,10.97 L 19.55,10.97 L 19.59,10.97 L 19.64,10.97 L 19.69,10.97 L 19.73,10.97 L 19.78,10.97 L 19.83,10.97 L 19.88,10.97 L 19.92,10.97 L 19.97,10.97 L 20.02,10.97 L 20.06,10.97 L 20.11,10.97 L 20.16,10.97 L 20.20,10.97 L 20.25,10.97 L 20.30,10.97 L 20.34,10.97 L 20.39,10.97 L 20.44,10.97 L 20.48,10.97 L 20.53,10.97 L 20.58,10.97 L 20.62,10.97 L 20.67,10.97 L 20.72,10.97 L 20.77,10.97 L 20.81,10.97 L 20.86,10.97 L 20.91,10.97 L 20.95,10.97 L 20.95,10.97 L 20.95,10.92 L 20.95,10.88 L 20.95,10.83 L 20.95,10.78 L 20.95,10.73 L 20.95,10.69 L 20.95,10.64 L 20.95,10.59 L 20.95,10.55 L 20.95,10.50 L 20.95,10.45 L 20.95,10.41 L 20.95,10.36 L 20.95,10.31 L 20.95,10.27 L 20.95,10.22 L 20.95,10.17 L 20.95,10.12 L 20.95,10.08 L 20.95,10.03 L 20.95,9.98 L 20.95,9.94 L 20.95,9.89 L 20.95,9.84 L 20.95,9.80 L 20.95,9.75 L 20.95,9.70 L 20.95,9.66 L 20.95,9.61 L 20.95,9.56 L 20.95,9.52 L 20.95,9.47 L 20.95,9.42 L 20.95,9.38 L 20.95,9.33 L 20.95,9.28 L 20.95,9.23 L 20.95,9.19 L 20.95,9.14 L 20.95,9.09 L 20.95,9.05 L 20.95,9.00 L 20.95,9.00 L 20.91,9.00 L 20.86,9.00 L 20.81,9.00 L 20.77,9.00 L 20.72,9.00 L 20.67,9.00 L 20.62,9.00 L 20.58,9.00 L 20.53,9.00 L 20.48,9.00 L 20.44,9.00 L 20.39,9.00 L 20.34,9.00 L 20.30,9.00 L 20.25,9.00 L 20.20,9.00 L 20.16,9.00 L 20.11,9.00 L 20.06,9.00 L 20.02,9.00 L 19.97,9.00 L 19.92,9.00 L 19.88,9.00 L 19.83,9.00 L 19.78,9.00 L 19.73,9.00 L 19.69,9.00 L 19.64,9.00 L 19.59,9.00 L 19.55,9.00 L 19.50,9.00 L 19.45,9.00 L 19.41,9.00 L 19.36,9.00 L 19.31,9.00 L 19.27,9.00 L 19.22,9.00 L 19.17,9.00 L 19.12,9.00 L 19.08,9.00 L 19.03,9.00 L 18.98,9.00 L 18.94,8.95 L 18.94,8.91 L 18.94,8.86 L 18.94,8.81 L 18.94,8.77 L 18.94,8.72 L 18.94,8.67 L 18.94,8.62 L 18.94,8.58 L 18.94,8.53 L 18.94,8.48 L 18.94,8.44 L 18.94,8.39 L 18.94,8.34 L 18.94,8.30 L 18.94,8.25 L 18.94,8.20 L 18.94,8.16 L 18.94,8.11 L 18.94,8.06 L 18.94,8.02 L 18.94,7.97 L 18.94,7.92 L 18.94,7.88 L 18.94,7.83 L 18.94,7.78 L 18.94,7.73 L 18.94,7.69 L 18.94,7.64 L 18.94,7.59 L 18.94,7.55 L 18.94,7.50 L 18.94,7.45 L 18.94,7.41 L 18.94,7.36 L 18.94,7.31 L 18.94,7.27 L 18.94,7.22 L 18.94,7.17 L 18.94,7.12 L 18.94,7.08 L 18.94,7.03 L 18.94,6.98 L 18.94,6.94 L 18.94,6.89 L 18.94,6.84 L 18.94,6.80 L 18.94,6.75 L 18.94,6.70 L 18.94,6.70 L 18.89,6.66 L 18.89,6.61 L 18.89,6.56 L 18.89,6.52 L 18.89,6.52 L 18.84,6.47 L 18.84,6.42 L 18.84,6.38 L 18.84,6.33 L 18.84,6.33 L 18.80,6.28 L 18.80,6.23 L 18.80,6.23 L 18.75,6.19 L 18.75,6.14 L 18.75,6.14 L 18.70,6.09 L 18.70,6.05 L 18.70,6.05 L 18.66,6.00 L 18.66,5.95 L 18.66,5.95 L 18.61,5.91 L 18.61,5.91 L 18.56,5.86 L 18.56,5.81 L 18.56,5.81 L 18.52,5.77 L 18.52,5.77 L 18.47,5.72 L 18.47,5.72 L 18.42,5.67 L 18.42,5.67 L 18.38,5.62 L 18.38,5.62 L 18.33,5.58 L 18.33,5.58 L 18.28,5.53 L 18.28,5.53 L 18.23,5.48 L 18.23,5.48 L 18.19,5.44 L 18.19,5.44 L 18.14,5.39 L 18.14,5.39 L 18.09,5.39 L 18.05,5.34 L 18.05,5.34 L 18.00,5.30 L 18.00,5.30 L 17.95,5.30 L 17.91,5.25 L 17.91,5.25 L 17.86,5.25 L 17.81,5.20 L 17.81,5.20 L 17.77,5.20 L 17.72,5.16 L 17.72,5.16 L 17.67,5.16 L 17.63,5.11 L 17.62,5.11 L 17.58,5.11 L 17.53,5.11 L 17.48,5.11 L 17.44,5.06 L 17.44,5.06 L 17.39,5.06 L 17.34,5.06 L 17.30,5.06 L 17.25,5.02 L 17.25,5.02 L 17.20,5.02 L 17.16,5.02 L 17.11,5.02 L 17.06,5.02 L 17.02,5.02 L 16.97,5.02 L 16.92,5.02 L 16.88,5.02 L 16.83,5.02 L 16.78,5.02 L 16.73,5.02 L 16.69,5.02 L 16.64,5.02 L 16.59,5.02 L 16.55,5.02 L 16.50,5.02 L 16.45,5.02 L 16.41,5.02 L 16.36,5.02 L 16.31,5.02 L 16.27,5.02 L 16.22,5.02 L 16.17,5.02 L 16.12,5.02 L 16.08,5.02 L 16.03,5.02 L 15.98,5.02 L 15.94,5.02 L 15.89,5.02 L 15.84,5.02 L 15.80,5.02 L 15.75,5.02 L 15.70,5.02 L 15.66,5.02 L 15.61,5.02 L 15.56,5.02 L 15.52,5.02 L 15.47,5.02 L 15.42,5.02 L 15.38,5.02 L 15.33,5.02 L 15.28,5.02 L 15.23,5.02 L 15.19,5.02 L 15.14,5.02 L 15.09,5.02 L 15.05,5.02 L 15.00,5.02 L 14.95,4.97 L 14.95,4.92 L 14.95,4.88 L 14.95,4.83 L 14.95,4.78 L 14.95,4.73 L 14.95,4.69 L 14.95,4.64 L 14.95,4.59 L 14.95,4.55 L 14.95,4.50 L 14.95,4.45 L 14.95,4.41 L 14.95,4.36 L 14.95,4.31 L 14.95,4.27 L 14.95,4.22 L 14.95,4.17 L 14.95,4.12 L 14.95,4.08 L 14.95,4.03 L 14.95,3.98 L 14.95,3.94 L 14.95,3.89 L 14.95,3.84 L 14.95,3.80 L 14.95,3.75 L 14.95,3.70 L 14.95,3.66 L 14.95,3.61 L 14.95,3.56 L 14.95,3.52 L 14.95,3.47 L 14.95,3.42 L 14.95,3.38 L 14.95,3.33 L 14.95,3.28 L 14.95,3.23 L 14.95,3.19 L 14.95,3.14 L 14.95,3.09 L 14.95,3.05 L 14.95,3.00 L 14.95,3.00 L 14.91,3.00 L 14.86,3.00 L 14.81,3.00 L 14.77,3.00 L 14.72,3.00 L 14.67,3.00 L 14.62,3.00 L 14.58,3.00 L 14.53,3.00 L 14.48,3.00 L 14.44,3.00 L 14.39,3.00 L 14.34,3.00 L 14.30,3.00 L 14.25,3.00 L 14.20,3.00 L 14.16,3.00 L 14.11,3.00 L 14.06,3.00 L 14.02,3.00 L 13.97,3.00 L 13.92,3.00 L 13.88,3.00 L 13.83,3.00 L 13.78,3.00 L 13.73,3.00 L 13.69,3.00 L 13.64,3.00 L 13.59,3.00 L 13.55,3.00 L 13.50,3.00 L 13.45,3.00 L 13.41,3.00 L 13.36,3.00 L 13.31,3.00 L 13.27,3.00 L 13.22,3.00 L 13.17,3.00 L 13.12,3.00 L 13.08,3.00 L 13.03,3.00 L 12.98,3.00 L 12.98,3.00 L 12.98,3.05 L 12.98,3.09 L 12.98,3.14 L 12.98,3.19 L 12.98,3.23 L 12.98,3.28 L 12.98,3.33 L 12.98,3.38 L 12.98,3.42 L 12.98,3.47 L 12.98,3.52 L 12.98,3.56 L 12.98,3.61 L 12.98,3.66 L 12.98,3.70 L 12.98,3.75 L 12.98,3.80 L 12.98,3.84 L 12.98,3.89 L 12.98,3.94 L 12.98,3.98 L 12.98,4.03 L 12.98,4.08 L 12.98,4.12 L 12.98,4.17 L 12.98,4.22 L 12.98,4.27 L 12.98,4.31 L 12.98,4.36 L 12.98,4.41 L 12.98,4.45 L 12.98,4.50 L 12.98,4.55 L 12.98,4.59 L 12.98,4.64 L 12.98,4.69 L 12.98,4.73 L 12.98,4.78 L 12.98,4.83 L 12.98,4.88 L 12.98,4.92 L 12.98,4.97 L 12.94,5.02 L 12.89,5.02 L 12.84,5.02 L 12.80,5.02 L 12.75,5.02 L 12.70,5.02 L 12.66,5.02 L 12.61,5.02 L 12.56,5.02 L 12.52,5.02 L 12.47,5.02 L 12.42,5.02 L 12.38,5.02 L 12.33,5.02 L 12.28,5.02 L 12.23,5.02 L 12.19,5.02 L 12.14,5.02 L 12.09,5.02 L 12.05,5.02 L 12.00,5.02 L 11.95,5.02 L 11.91,5.02 L 11.86,5.02 L 11.81,5.02 L 11.77,5.02 L 11.72,5.02 L 11.67,5.02 L 11.62,5.02 L 11.58,5.02 L 11.53,5.02 L 11.48,5.02 L 11.44,5.02 L 11.39,5.02 L 11.34,5.02 L 11.30,5.02 L 11.25,5.02 L 11.20,5.02 L 11.16,5.02 L 11.11,5.02 L 11.06,5.02 L 11.02,5.02 L 10.97,4.97 L 10.97,4.92 L 10.97,4.88 L 10.97,4.83 L 10.97,4.78 L 10.97,4.73 L 10.97,4.69 L 10.97,4.64 L 10.97,4.59 L 10.97,4.55 L 10.97,4.50 L 10.97,4.45 L 10.97,4.41 L 10.97,4.36 L 10.97,4.31 L 10.97,4.27 L 10.97,4.22 L 10.97,4.17 L 10.97,4.12 L 10.97,4.08 L 10.97,4.03 L 10.97,3.98 L 10.97,3.94 L 10.97,3.89 L 10.97,3.84 L 10.97,3.80 L 10.97,3.75 L 10.97,3.70 L 10.97,3.66 L 10.97,3.61 L 10.97,3.56 L 10.97,3.52 L 10.97,3.47 L 10.97,3.42 L 10.97,3.38 L 10.97,3.33 L 10.97,3.28 L 10.97,3.23 L 10.97,3.19 L 10.97,3.14 L 10.97,3.09 L 10.97,3.05 L 10.97,3.00 L 10.97,3.00 L 10.92,3.00 L 10.88,3.00 L 10.83,3.00 L 10.78,3.00 L 10.73,3.00 L 10.69,3.00 L 10.64,3.00 L 10.59,3.00 L 10.55,3.00 L 10.50,3.00 L 10.45,3.00 L 10.41,3.00 L 10.36,3.00 L 10.31,3.00 L 10.27,3.00 L 10.22,3.00 L 10.17,3.00 L 10.12,3.00 L 10.08,3.00 L 10.03,3.00 L 9.98,3.00 L 9.94,3.00 L 9.89,3.00 L 9.84,3.00 L 9.80,3.00 L 9.75,3.00 L 9.70,3.00 L 9.66,3.00 L 9.61,3.00 L 9.56,3.00 L 9.52,3.00 L 9.47,3.00 L 9.42,3.00 L 9.38,3.00 L 9.33,3.00 L 9.28,3.00 L 9.23,3.00 L 9.19,3.00 L 9.14,3.00 L 9.09,3.00 L 9.05,3.00 L 9.00,3.00 L 9.00,3.00 L 9.00,3.05 L 9.00,3.09 L 9.00,3.14 L 9.00,3.19 L 9.00,3.23 L 9.00,3.28 L 9.00,3.33 L 9.00,3.38 L 9.00,3.42 L 9.00,3.47 L 9.00,3.52 L 9.00,3.56 L 9.00,3.61 L 9.00,3.66 L 9.00,3.70 L 9.00,3.75 L 9.00,3.80 L 9.00,3.84 L 9.00,3.89 L 9.00,3.94 L 9.00,3.98 L 9.00,4.03 L 9.00,4.08 L 9.00,4.12 L 9.00,4.17 L 9.00,4.22 L 9.00,4.27 L 9.00,4.31 L 9.00,4.36 L 9.00,4.41 L 9.00,4.45 L 9.00,4.50 L 9.00,4.55 L 9.00,4.59 L 9.00,4.64 L 9.00,4.69 L 9.00,4.73 L 9.00,4.78 L 9.00,4.83 L 9.00,4.88 L 9.00,4.92 L 9.00,4.97 L 8.95,5.02 L 8.91,5.02 L 8.86,5.02 L 8.81,5.02 L 8.77,5.02 L 8.72,5.02 L 8.67,5.02 L 8.62,5.02 L 8.58,5.02 L 8.53,5.02 L 8.48,5.02 L 8.44,5.02 L 8.39,5.02 L 8.34,5.02 L 8.30,5.02 L 8.25,5.02 L 8.20,5.02 L 8.16,5.02 L 8.11,5.02 L 8.06,5.02 L 8.02,5.02 L 7.97,5.02 L 7.92,5.02 L 7.88,5.02 L 7.83,5.02 L 7.78,5.02 L 7.73,5.02 L 7.69,5.02 L 7.64,5.02 L 7.59,5.02 L 7.55,5.02 L 7.50,5.02 L 7.45,5.02 L 7.41,5.02 L 7.36,5.02 L 7.31,5.02 L 7.27,5.02 L 7.22,5.02 L 7.17,5.02 L 7.12,5.02 L 7.08,5.02 L 7.03,5.02 L 6.98,5.02 L 6.94,5.02 L 6.89,5.02 L 6.84,5.02 L 6.80,5.02 L 6.75,5.02 L 6.70,5.02 L 6.70,5.02 L 6.66,5.06 L 6.61,5.06 L 6.56,5.06 L 6.52,5.06 L 6.52,5.06 L 6.47,5.11 L 6.42,5.11 L 6.38,5.11 L 6.33,5.11 L 6.33,5.11 L 6.28,5.16 L 6.23,5.16 L 6.23,5.16 L 6.19,5.20 L 6.14,5.20 L 6.14,5.20 L 6.09,5.25 L 6.05,5.25 L 6.05,5.25 L 6.00,5.30 L 5.95,5.30 L 5.95,5.30 L 5.91,5.34 L 5.91,5.34 L 5.86,5.39 L 5.81,5.39 L 5.81,5.39 L 5.77,5.44 L 5.77,5.44 L 5.72,5.48 L 5.72,5.48 L 5.67,5.53 L 5.67,5.53 L 5.62,5.58 L 5.62,5.58 L 5.58,5.62 L 5.58,5.62 L 5.53,5.67 L 5.53,5.67 L 5.48,5.72 L 5.48,5.72 L 5.44,5.77 L 5.44,5.77 L 5.39,5.81 L 5.39,5.81 L 5.39,5.86 L 5.34,5.91 L 5.34,5.91 L 5.30,5.95 L 5.30,5.95 L 5.30,6.00 L 5.25,6.05 L 5.25,6.05 L 5.25,6.09 L 5.20,6.14 L 5.20,6.14 L 5.20,6.19 L 5.16,6.23 L 5.16,6.23 L 5.16,6.28 L 5.11,6.33 L 5.11,6.33 L 5.11,6.38 L 5.11,6.42 L 5.11,6.47 L 5.06,6.52 L 5.06,6.52 L 5.06,6.56 L 5.06,6.61 L 5.06,6.66 L 5.02,6.70 L 5.02,6.70 L 5.02,6.75 L 5.02,6.80 L 5.02,6.84 L 5.02,6.89 L 5.02,6.94 L 5.02,6.98 L 5.02,7.03 L 5.02,7.08 L 5.02,7.12 L 5.02,7.17 L 5.02,7.22 L 5.02,7.27 L 5.02,7.31 L 5.02,7.36 L 5.02,7.41 L 5.02,7.45 L 5.02,7.50 L 5.02,7.55 L 5.02,7.59 L 5.02,7.64 L 5.02,7.69 L 5.02,7.73 L 5.02,7.78 L 5.02,7.83 L 5.02,7.88 L 5.02,7.92 L 5.02,7.97 L 5.02,8.02 L 5.02,8.06 L 5.02,8.11 L 5.02,8.16 L 5.02,8.20 L 5.02,8.25 L 5.02,8.30 L 5.02,8.34 L 5.02,8.39 L 5.02,8.44 L 5.02,8.48 L 5.02,8.53 L 5.02,8.58 L 5.02,8.62 L 5.02,8.67 L 5.02,8.72 L 5.02,8.77 L 5.02,8.81 L 5.02,8.86 L 5.02,8.91 L 5.02,8.95 L 4.97,9.00 L 4.92,9.00 L 4.88,9.00 L 4.83,9.00 L 4.78,9.00 L 4.73,9.00 L 4.69,9.00 L 4.64,9.00 L 4.59,9.00 L 4.55,9.00 L 4.50,9.00 L 4.45,9.00 L 4.41,9.00 L 4.36,9.00 L 4.31,9.00 L 4.27,9.00 L 4.22,9.00 L 4.17,9.00 L 4.12,9.00 L 4.08,9.00 L 4.03,9.00 L 3.98,9.00 L 3.94,9.00 L 3.89,9.00 L 3.84,9.00 L 3.80,9.00 L 3.75,9.00 L 3.70,9.00 L 3.66,9.00 L 3.61,9.00 L 3.56,9.00 L 3.52,9.00 L 3.47,9.00 L 3.42,9.00 L 3.38,9.00 L 3.33,9.00 L 3.28,9.00 L 3.23,9.00 L 3.19,9.00 L 3.14,9.00 L 3.09,9.00 L 3.05,9.00 L 3.00,9.00 L 3.00,9.00 L 3.00,9.05 L 3.00,9.09 L 3.00,9.14 L 3.00,9.19 L 3.00,9.23 L 3.00,9.28 L 3.00,9.33 L 3.00,9.38 L 3.00,9.42 L 3.00,9.47 L 3.00,9.52 L 3.00,9.56 L 3.00,9.61 L 3.00,9.66 L 3.00,9.70 L 3.00,9.75 L 3.00,9.80 L 3.00,9.84 L 3.00,9.89 L 3.00,9.94 L 3.00,9.98 L 3.00,10.03 L 3.00,10.08 L 3.00,10.12 L 3.00,10.17 L 3.00,10.22 L 3.00,10.27 L 3.00,10.31 L 3.00,10.36 L 3.00,10.41 L 3.00,10.45 L 3.00,10.50 L 3.00,10.55 L 3.00,10.59 L 3.00,10.64 L 3.00,10.69 L 3.00,10.73 L 3.00,10.78 L 3.00,10.83 L 3.00,10.88 L 3.00,10.92 L 3.00,10.97 L 3.00,10.97 L 3.05,10.97 L 3.09,10.97 L 3.14,10.97 L 3.19,10.97 L 3.23,10.97 L 3.28,10.97 L 3.33,10.97 L 3.38,10.97 L 3.42,10.97 L 3.47,10.97 L 3.52,10.97 L 3.56,10.97 L 3.61,10.97 L 3.66,10.97 L 3.70,10.97 L 3.75,10.97 L 3.80,10.97 L 3.84,10.97 L 3.89,10.97 L 3.94,10.97 L 3.98,10.97 L 4.03,10.97 L 4.08,10.97 L 4.12,10.97 L 4.17,10.97 L 4.22,10.97 L 4.27,10.97 L 4.31,10.97 L 4.36,10.97 L 4.41,10.97 L 4.45,10.97 L 4.50,10.97 L 4.55,10.97 L 4.59,10.97 L 4.64,10.97 L 4.69,10.97 L 4.73,10.97 L 4.78,10.97 L 4.83,10.97 L 4.88,10.97 L 4.92,10.97 L 4.97,10.97 L 5.02,11.02 L 5.02,11.06 L 5.02,11.11 L 5.02,11.16 L 5.02,11.20 L 5.02,11.25 L 5.02,11.30 L 5.02,11.34 L 5.02,11.39 L 5.02,11.44 L 5.02,11.48 L 5.02,11.53 L 5.02,11.58 L 5.02,11.62 L 5.02,11.67 L 5.02,11.72 L 5.02,11.77 L 5.02,11.81 L 5.02,11.86 L 5.02,11.91 L 5.02,11.95 L 5.02,12.00 L 5.02,12.05 L 5.02,12.09 L 5.02,12.14 L 5.02,12.19 L 5.02,12.23 L 5.02,12.28 L 5.02,12.33 L 5.02,12.38 L 5.02,12.42 L 5.02,12.47 L 5.02,12.52 L 5.02,12.56 L 5.02,12.61 L 5.02,12.66 L 5.02,12.70 L 5.02,12.75 L 5.02,12.80 L 5.02,12.84 L 5.02,12.89 L 5.02,12.94 L 4.97,12.98 L 4.92,12.98 L 4.88,12.98 L 4.83,12.98 L 4.78,12.98 L 4.73,12.98 L 4.69,12.98 L 4.64,12.98 L 4.59,12.98 L 4.55,12.98 L 4.50,12.98 L 4.45,12.98 L 4.41,12.98 L 4.36,12.98 L 4.31,12.98 L 4.27,12.98 L 4.22,12.98 L 4.17,12.98 L 4.12,12.98 L 4.08,12.98 L 4.03,12.98 L 3.98,12.98 L 3.94,12.98 L 3.89,12.98 L 3.84,12.98 L 3.80,12.98 L 3.75,12.98 L 3.70,12.98 L 3.66,12.98 L 3.61,12.98 L 3.56,12.98 L 3.52,12.98 L 3.47,12.98 L 3.42,12.98 L 3.38,12.98 L 3.33,12.98 L 3.28,12.98 L 3.23,12.98 L 3.19,12.98 L 3.14,12.98 L 3.09,12.98 L 3.05,12.98 L 3.00,12.98 L 3.00,12.98 L 3.00,13.03 L 3.00,13.08 L 3.00,13.12 L 3.00,13.17 L 3.00,13.22 L 3.00,13.27 L 3.00,13.31 L 3.00,13.36 L 3.00,13.41 L 3.00,13.45 L 3.00,13.50 L 3.00,13.55 L 3.00,13.59 L 3.00,13.64 L 3.00,13.69 L 3.00,13.73 L 3.00,13.78 L 3.00,13.83 L 3.00,13.88 L 3.00,13.92 L 3.00,13.97 L 3.00,14.02 L 3.00,14.06 L 3.00,14.11 L 3.00,14.16 L 3.00,14.20 L 3.00,14.25 L 3.00,14.30 L 3.00,14.34 L 3.00,14.39 L 3.00,14.44 L 3.00,14.48 L 3.00,14.53 L 3.00,14.58 L 3.00,14.62 L 3.00,14.67 L 3.00,14.72 L 3.00,14.77 L 3.00,14.81 L 3.00,14.86 L 3.00,14.91 L 3.00,14.95 L 3.00,14.95 L 3.05,14.95 L 3.09,14.95 L 3.14,14.95 L 3.19,14.95 L 3.23,14.95 L 3.28,14.95 L 3.33,14.95 L 3.38,14.95 L 3.42,14.95 L 3.47,14.95 L 3.52,14.95 L 3.56,14.95 L 3.61,14.95 L 3.66,14.95 L 3.70,14.95 L 3.75,14.95 L 3.80,14.95 L 3.84,14.95 L 3.89,14.95 L 3.94,14.95 L 3.98,14.95 L 4.03,14.95 L 4.08,14.95 L 4.12,14.95 L 4.17,14.95 L 4.22,14.95 L 4.27,14.95 L 4.31,14.95 L 4.36,14.95 L 4.41,14.95 L 4.45,14.95 L 4.50,14.95 L 4.55,14.95 L 4.59,14.95 L 4.64,14.95 L 4.69,14.95 L 4.73,14.95 L 4.78,14.95 L 4.83,14.95 L 4.88,14.95 L 4.92,14.95 L 4.97,14.95 L 5.02,15.00 L 5.02,15.05 L 5.02,15.09 L 5.02,15.14 L 5.02,15.19 L 5.02,15.23 L 5.02,15.28 L 5.02,15.33 L 5.02,15.38 L 5.02,15.42 L 5.02,15.47 L 5.02,15.52 L 5.02,15.56 L 5.02,15.61 L 5.02,15.66 L 5.02,15.70 L 5.02,15.75 L 5.02,15.80 L 5.02,15.84 L 5.02,15.89 L 5.02,15.94 L 5.02,15.98 L 5.02,16.03 L 5.02,16.08 L 5.02,16.12 L 5.02,16.17 L 5.02,16.22 L 5.02,16.27 L 5.02,16.31 L 5.02,16.36 L 5.02,16.41 L 5.02,16.45 L 5.02,16.50 L 5.02,16.55 L 5.02,16.59 L 5.02,16.64 L 5.02,16.69 L 5.02,16.73 L 5.02,16.78 L 5.02,16.83 L 5.02,16.88 L 5.02,16.92 L 5.02,16.97 L 5.02,17.02 L 5.02,17.06 L 5.02,17.11 L 5.02,17.16 L 5.02,17.20 L 5.02,17.25 L 5.02,17.25 L 5.06,17.30 L 5.06,17.34 L 5.06,17.39 L 5.06,17.44 L 5.06,17.44 L 5.11,17.48 L 5.11,17.53 L 5.11,17.58 L 5.11,17.62 L 5.11,17.63 L 5.16,17.67 L 5.16,17.72 L 5.16,17.72 L 5.20,17.77 L 5.20,17.81 L 5.20,17.81 L 5.25,17.86 L 5.25,17.91 L 5.25,17.91 L 5.30,17.95 L 5.30,18.00 L 5.30,18.00 L 5.34,18.05 L 5.34,18.05 L 5.39,18.09 L 5.39,18.14 L 5.39,18.14 L 5.44,18.19 L 5.44,18.19 L 5.48,18.23 L 5.48,18.23 L 5.53,18.28 L 5.53,18.28 L 5.58,18.33 L 5.58,18.33 L 5.62,18.38 L 5.62,18.38 L 5.67,18.42 L 5.67,18.42 L 5.72,18.47 L 5.72,18.47 L 5.77,18.52 L 5.77,18.52 L 5.81,18.56 L 5.81,18.56 L 5.86,18.56 L 5.91,18.61 L 5.91,18.61 L 5.95,18.66 L 5.95,18.66 L 6.00,18.66 L 6.05,18.70 L 6.05,18.70 L 6.09,18.70 L 6.14,18.75 L 6.14,18.75 L 6.19,18.75 L 6.23,18.80 L 6.23,18.80 L 6.28,18.80 L 6.33,18.84 L 6.33,18.84 L 6.38,18.84 L 6.42,18.84 L 6.47,18.84 L 6.52,18.89 L 6.52,18.89 L 6.56,18.89 L 6.61,18.89 L 6.66,18.89 L 6.70,18.94 L 6.70,18.94 L 6.75,18.94 L 6.80,18.94 L 6.84,18.94 L 6.89,18.94 L 6.94,18.94 L 6.98,18.94 L 7.03,18.94 L 7.08,18.94 L 7.12,18.94 L 7.17,18.94 L 7.22,18.94 L 7.27,18.94 L 7.31,18.94 L 7.36,18.94 L 7.41,18.94 L 7.45,18.94 L 7.50,18.94 L 7.55,18.94 L 7.59,18.94 L 7.64,18.94 L 7.69,18.94 L 7.73,18.94 L 7.78,18.94 L 7.83,18.94 L 7.88,18.94 L 7.92,18.94 L 7.97,18.94 L 8.02,18.94 L 8.06,18.94 L 8.11,18.94 L 8.16,18.94 L 8.20,18.94 L 8.25,18.94 L 8.30,18.94 L 8.34,18.94 L 8.39,18.94 L 8.44,18.94 L 8.48,18.94 L 8.53,18.94 L 8.58,18.94 L 8.62,18.94 L 8.67,18.94 L 8.72,18.94 L 8.77,18.94 L 8.81,18.94 L 8.86,18.94 L 8.91,18.94 L 8.95,18.94 L 9.00,18.98 L 9.00,19.03 L 9.00,19.08 L 9.00,19.12 L 9.00,19.17 L 9.00,19.22 L 9.00,19.27 L 9.00,19.31 L 9.00,19.36 L 9.00,19.41 L 9.00,19.45 L 9.00,19.50 L 9.00,19.55 L 9.00,19.59 L 9.00,19.64 L 9.00,19.69 L 9.00,19.73 L 9.00,19.78 L 9.00,19.83 L 9.00,19.88 L 9.00,19.92 L 9.00,19.97 L 9.00,20.02 L 9.00,20.06 L 9.00,20.11 L 9.00,20.16 L 9.00,20.20 L 9.00,20.25 L 9.00,20.30 L 9.00,20.34 L 9.00,20.39 L 9.00,20.44 L 9.00,20.48 L 9.00,20.53 L 9.00,20.58 L 9.00,20.62 L 9.00,20.67 L 9.00,20.72 L 9.00,20.77 L 9.00,20.81 L 9.00,20.86 L 9.00,20.91 L 9.00,20.95 L 9.00,20.95 L 9.05,20.95 L 9.09,20.95 L 9.14,20.95 L 9.19,20.95 L 9.23,20.95 L 9.28,20.95 L 9.33,20.95 L 9.38,20.95 L 9.42,20.95 L 9.47,20.95 L 9.52,20.95 L 9.56,20.95 L 9.61,20.95 L 9.66,20.95 L 9.70,20.95 L 9.75,20.95 L 9.80,20.95 L 9.84,20.95 L 9.89,20.95 L 9.94,20.95 L 9.98,20.95 L 10.03,20.95 L 10.08,20.95 L 10.12,20.95 L 10.17,20.95 L 10.22,20.95 L 10.27,20.95 L 10.31,20.95 L 10.36,20.95 L 10.41,20.95 L 10.45,20.95 L 10.50,20.95 L 10.55,20.95 L 10.59,20.95 L 10.64,20.95 L 10.69,20.95 L 10.73,20.95 L 10.78,20.95 L 10.83,20.95 L 10.88,20.95 L 10.92,20.95 L 10.97,20.95 L 10.97,20.95 L 10.97,20.91 L 10.97,20.86 L 10.97,20.81 L 10.97,20.77 L 10.97,20.72 L 10.97,20.67 L 10.97,20.62 L 10.97,20.58 L 10.97,20.53 L 10.97,20.48 L 10.97,20.44 L 10.97,20.39 L 10.97,20.34 L 10.97,20.30 L 10.97,20.25 L 10.97,20.20 L 10.97,20.16 L 10.97,20.11 L 10.97,20.06 L 10.97,20.02 L 10.97,19.97 L 10.97,19.92 L 10.97,19.88 L 10.97,19.83 L 10.97,19.78 L 10.97,19.73 L 10.97,19.69 L 10.97,19.64 L 10.97,19.59 L 10.97,19.55 L 10.97,19.50 L 10.97,19.45 L 10.97,19.41 L 10.97,19.36 L 10.97,19.31 L 10.97,19.27 L 10.97,19.22 L 10.97,19.17 L 10.97,19.12 L 10.97,19.08 L 10.97,19.03 L 10.97,18.98 L 11.02,18.94 L 11.06,18.94 L 11.11,18.94 L 11.16,18.94 L 11.20,18.94 L 11.25,18.94 L 11.30,18.94 L 11.34,18.94 L 11.39,18.94 L 11.44,18.94 L 11.48,18.94 L 11.53,18.94 L 11.58,18.94 L 11.62,18.94 L 11.67,18.94 L 11.72,18.94 L 11.77,18.94 L 11.81,18.94 L 11.86,18.94 L 11.91,18.94 L 11.95,18.94 L 12.00,18.94 L 12.05,18.94 L 12.09,18.94 L 12.14,18.94 L 12.19,18.94 L 12.23,18.94 L 12.28,18.94 L 12.33,18.94 L 12.38,18.94 L 12.42,18.94 L 12.47,18.94 L 12.52,18.94 L 12.56,18.94 L 12.61,18.94 L 12.66,18.94 L 12.70,18.94 L 12.75,18.94 L 12.80,18.94 L 12.84,18.94 L 12.89,18.94 L 12.94,18.94 L 12.98,18.98 L 12.98,19.03 L 12.98,19.08 L 12.98,19.12 L 12.98,19.17 L 12.98,19.22 L 12.98,19.27 L 12.98,19.31 L 12.98,19.36 L 12.98,19.41 L 12.98,19.45 L 12.98,19.50 L 12.98,19.55 L 12.98,19.59 L 12.98,19.64 L 12.98,19.69 L 12.98,19.73 L 12.98,19.78 L 12.98,19.83 L 12.98,19.88 L 12.98,19.92 L 12.98,19.97 L 12.98,20.02 L 12.98,20.06 L 12.98,20.11 L 12.98,20.16 L 12.98,20.20 L 12.98,20.25 L 12.98,20.30 L 12.98,20.34 L 12.98,20.39 L 12.98,20.44 L 12.98,20.48 L 12.98,20.53 L 12.98,20.58 L 12.98,20.62 L 12.98,20.67 L 12.98,20.72 L 12.98,20.77 L 12.98,20.81 L 12.98,20.86 L 12.98,20.91 L 12.98,20.95 L 12.98,20.95 L 13.03,20.95 L 13.08,20.95 L 13.12,20.95 L 13.17,20.95 L 13.22,20.95 L 13.27,20.95 L 13.31,20.95 L 13.36,20.95 L 13.41,20.95 L 13.45,20.95 L 13.50,20.95 L 13.55,20.95 L 13.59,20.95 L 13.64,20.95 L 13.69,20.95 L 13.73,20.95 L 13.78,20.95 L 13.83,20.95 L 13.88,20.95 L 13.92,20.95 L 13.97,20.95 L 14.02,20.95 L 14.06,20.95 L 14.11,20.95 L 14.16,20.95 L 14.20,20.95 L 14.25,20.95 L 14.30,20.95 L 14.34,20.95 L 14.39,20.95 L 14.44,20.95 L 14.48,20.95 L 14.53,20.95 L 14.58,20.95 L 14.62,20.95 L 14.67,20.95 L 14.72,20.95 L 14.77,20.95 L 14.81,20.95 L 14.86,20.95 L 14.91,20.95 L 14.95,20.95 L 14.95,20.95 Z",fill:"currentColor"}),y.createElement("path",{d:"M 16.97,17.02 L 16.92,17.02 L 16.88,17.02 L 16.83,17.02 L 16.78,17.02 L 16.73,17.02 L 16.69,17.02 L 16.64,17.02 L 16.59,17.02 L 16.55,17.02 L 16.50,17.02 L 16.45,17.02 L 16.41,17.02 L 16.36,17.02 L 16.31,17.02 L 16.27,17.02 L 16.22,17.02 L 16.17,17.02 L 16.12,17.02 L 16.08,17.02 L 16.03,17.02 L 15.98,17.02 L 15.94,17.02 L 15.89,17.02 L 15.84,17.02 L 15.80,17.02 L 15.75,17.02 L 15.70,17.02 L 15.66,17.02 L 15.61,17.02 L 15.56,17.02 L 15.52,17.02 L 15.47,17.02 L 15.42,17.02 L 15.38,17.02 L 15.33,17.02 L 15.28,17.02 L 15.23,17.02 L 15.19,17.02 L 15.14,17.02 L 15.09,17.02 L 15.05,17.02 L 15.00,17.02 L 14.95,17.02 L 14.91,17.02 L 14.86,17.02 L 14.81,17.02 L 14.77,17.02 L 14.72,17.02 L 14.67,17.02 L 14.62,17.02 L 14.58,17.02 L 14.53,17.02 L 14.48,17.02 L 14.44,17.02 L 14.39,17.02 L 14.34,17.02 L 14.30,17.02 L 14.25,17.02 L 14.20,17.02 L 14.16,17.02 L 14.11,17.02 L 14.06,17.02 L 14.02,17.02 L 13.97,17.02 L 13.92,17.02 L 13.88,17.02 L 13.83,17.02 L 13.78,17.02 L 13.73,17.02 L 13.69,17.02 L 13.64,17.02 L 13.59,17.02 L 13.55,17.02 L 13.50,17.02 L 13.45,17.02 L 13.41,17.02 L 13.36,17.02 L 13.31,17.02 L 13.27,17.02 L 13.22,17.02 L 13.17,17.02 L 13.12,17.02 L 13.08,17.02 L 13.03,17.02 L 12.98,17.02 L 12.94,17.02 L 12.89,17.02 L 12.84,17.02 L 12.80,17.02 L 12.75,17.02 L 12.70,17.02 L 12.66,17.02 L 12.61,17.02 L 12.56,17.02 L 12.52,17.02 L 12.47,17.02 L 12.42,17.02 L 12.38,17.02 L 12.33,17.02 L 12.28,17.02 L 12.23,17.02 L 12.19,17.02 L 12.14,17.02 L 12.09,17.02 L 12.05,17.02 L 12.00,17.02 L 11.95,17.02 L 11.91,17.02 L 11.86,17.02 L 11.81,17.02 L 11.77,17.02 L 11.72,17.02 L 11.67,17.02 L 11.62,17.02 L 11.58,17.02 L 11.53,17.02 L 11.48,17.02 L 11.44,17.02 L 11.39,17.02 L 11.34,17.02 L 11.30,17.02 L 11.25,17.02 L 11.20,17.02 L 11.16,17.02 L 11.11,17.02 L 11.06,17.02 L 11.02,17.02 L 10.97,17.02 L 10.92,17.02 L 10.88,17.02 L 10.83,17.02 L 10.78,17.02 L 10.73,17.02 L 10.69,17.02 L 10.64,17.02 L 10.59,17.02 L 10.55,17.02 L 10.50,17.02 L 10.45,17.02 L 10.41,17.02 L 10.36,17.02 L 10.31,17.02 L 10.27,17.02 L 10.22,17.02 L 10.17,17.02 L 10.12,17.02 L 10.08,17.02 L 10.03,17.02 L 9.98,17.02 L 9.94,17.02 L 9.89,17.02 L 9.84,17.02 L 9.80,17.02 L 9.75,17.02 L 9.70,17.02 L 9.66,17.02 L 9.61,17.02 L 9.56,17.02 L 9.52,17.02 L 9.47,17.02 L 9.42,17.02 L 9.38,17.02 L 9.33,17.02 L 9.28,17.02 L 9.23,17.02 L 9.19,17.02 L 9.14,17.02 L 9.09,17.02 L 9.05,17.02 L 9.00,17.02 L 8.95,17.02 L 8.91,17.02 L 8.86,17.02 L 8.81,17.02 L 8.77,17.02 L 8.72,17.02 L 8.67,17.02 L 8.62,17.02 L 8.58,17.02 L 8.53,17.02 L 8.48,17.02 L 8.44,17.02 L 8.39,17.02 L 8.34,17.02 L 8.30,17.02 L 8.25,17.02 L 8.20,17.02 L 8.16,17.02 L 8.11,17.02 L 8.06,17.02 L 8.02,17.02 L 7.97,17.02 L 7.92,17.02 L 7.88,17.02 L 7.83,17.02 L 7.78,17.02 L 7.73,17.02 L 7.69,17.02 L 7.64,17.02 L 7.59,17.02 L 7.55,17.02 L 7.50,17.02 L 7.45,17.02 L 7.41,17.02 L 7.36,17.02 L 7.31,17.02 L 7.27,17.02 L 7.22,17.02 L 7.17,17.02 L 7.12,17.02 L 7.08,17.02 L 7.03,17.02 L 6.98,17.02 L 6.94,16.97 L 6.94,16.92 L 6.94,16.88 L 6.94,16.83 L 6.94,16.78 L 6.94,16.73 L 6.94,16.69 L 6.94,16.64 L 6.94,16.59 L 6.94,16.55 L 6.94,16.50 L 6.94,16.45 L 6.94,16.41 L 6.94,16.36 L 6.94,16.31 L 6.94,16.27 L 6.94,16.22 L 6.94,16.17 L 6.94,16.12 L 6.94,16.08 L 6.94,16.03 L 6.94,15.98 L 6.94,15.94 L 6.94,15.89 L 6.94,15.84 L 6.94,15.80 L 6.94,15.75 L 6.94,15.70 L 6.94,15.66 L 6.94,15.61 L 6.94,15.56 L 6.94,15.52 L 6.94,15.47 L 6.94,15.42 L 6.94,15.38 L 6.94,15.33 L 6.94,15.28 L 6.94,15.23 L 6.94,15.19 L 6.94,15.14 L 6.94,15.09 L 6.94,15.05 L 6.94,15.00 L 6.94,14.95 L 6.94,14.91 L 6.94,14.86 L 6.94,14.81 L 6.94,14.77 L 6.94,14.72 L 6.94,14.67 L 6.94,14.62 L 6.94,14.58 L 6.94,14.53 L 6.94,14.48 L 6.94,14.44 L 6.94,14.39 L 6.94,14.34 L 6.94,14.30 L 6.94,14.25 L 6.94,14.20 L 6.94,14.16 L 6.94,14.11 L 6.94,14.06 L 6.94,14.02 L 6.94,13.97 L 6.94,13.92 L 6.94,13.88 L 6.94,13.83 L 6.94,13.78 L 6.94,13.73 L 6.94,13.69 L 6.94,13.64 L 6.94,13.59 L 6.94,13.55 L 6.94,13.50 L 6.94,13.45 L 6.94,13.41 L 6.94,13.36 L 6.94,13.31 L 6.94,13.27 L 6.94,13.22 L 6.94,13.17 L 6.94,13.12 L 6.94,13.08 L 6.94,13.03 L 6.94,12.98 L 6.94,12.94 L 6.94,12.89 L 6.94,12.84 L 6.94,12.80 L 6.94,12.75 L 6.94,12.70 L 6.94,12.66 L 6.94,12.61 L 6.94,12.56 L 6.94,12.52 L 6.94,12.47 L 6.94,12.42 L 6.94,12.38 L 6.94,12.33 L 6.94,12.28 L 6.94,12.23 L 6.94,12.19 L 6.94,12.14 L 6.94,12.09 L 6.94,12.05 L 6.94,12.00 L 6.94,11.95 L 6.94,11.91 L 6.94,11.86 L 6.94,11.81 L 6.94,11.77 L 6.94,11.72 L 6.94,11.67 L 6.94,11.62 L 6.94,11.58 L 6.94,11.53 L 6.94,11.48 L 6.94,11.44 L 6.94,11.39 L 6.94,11.34 L 6.94,11.30 L 6.94,11.25 L 6.94,11.20 L 6.94,11.16 L 6.94,11.11 L 6.94,11.06 L 6.94,11.02 L 6.94,10.97 L 6.94,10.92 L 6.94,10.88 L 6.94,10.83 L 6.94,10.78 L 6.94,10.73 L 6.94,10.69 L 6.94,10.64 L 6.94,10.59 L 6.94,10.55 L 6.94,10.50 L 6.94,10.45 L 6.94,10.41 L 6.94,10.36 L 6.94,10.31 L 6.94,10.27 L 6.94,10.22 L 6.94,10.17 L 6.94,10.12 L 6.94,10.08 L 6.94,10.03 L 6.94,9.98 L 6.94,9.94 L 6.94,9.89 L 6.94,9.84 L 6.94,9.80 L 6.94,9.75 L 6.94,9.70 L 6.94,9.66 L 6.94,9.61 L 6.94,9.56 L 6.94,9.52 L 6.94,9.47 L 6.94,9.42 L 6.94,9.38 L 6.94,9.33 L 6.94,9.28 L 6.94,9.23 L 6.94,9.19 L 6.94,9.14 L 6.94,9.09 L 6.94,9.05 L 6.94,9.00 L 6.94,8.95 L 6.94,8.91 L 6.94,8.86 L 6.94,8.81 L 6.94,8.77 L 6.94,8.72 L 6.94,8.67 L 6.94,8.62 L 6.94,8.58 L 6.94,8.53 L 6.94,8.48 L 6.94,8.44 L 6.94,8.39 L 6.94,8.34 L 6.94,8.30 L 6.94,8.25 L 6.94,8.20 L 6.94,8.16 L 6.94,8.11 L 6.94,8.06 L 6.94,8.02 L 6.94,7.97 L 6.94,7.92 L 6.94,7.88 L 6.94,7.83 L 6.94,7.78 L 6.94,7.73 L 6.94,7.69 L 6.94,7.64 L 6.94,7.59 L 6.94,7.55 L 6.94,7.50 L 6.94,7.45 L 6.94,7.41 L 6.94,7.36 L 6.94,7.31 L 6.94,7.27 L 6.94,7.22 L 6.94,7.17 L 6.94,7.12 L 6.94,7.08 L 6.94,7.03 L 6.94,6.98 L 6.98,6.94 L 7.03,6.94 L 7.08,6.94 L 7.12,6.94 L 7.17,6.94 L 7.22,6.94 L 7.27,6.94 L 7.31,6.94 L 7.36,6.94 L 7.41,6.94 L 7.45,6.94 L 7.50,6.94 L 7.55,6.94 L 7.59,6.94 L 7.64,6.94 L 7.69,6.94 L 7.73,6.94 L 7.78,6.94 L 7.83,6.94 L 7.88,6.94 L 7.92,6.94 L 7.97,6.94 L 8.02,6.94 L 8.06,6.94 L 8.11,6.94 L 8.16,6.94 L 8.20,6.94 L 8.25,6.94 L 8.30,6.94 L 8.34,6.94 L 8.39,6.94 L 8.44,6.94 L 8.48,6.94 L 8.53,6.94 L 8.58,6.94 L 8.62,6.94 L 8.67,6.94 L 8.72,6.94 L 8.77,6.94 L 8.81,6.94 L 8.86,6.94 L 8.91,6.94 L 8.95,6.94 L 9.00,6.94 L 9.05,6.94 L 9.09,6.94 L 9.14,6.94 L 9.19,6.94 L 9.23,6.94 L 9.28,6.94 L 9.33,6.94 L 9.38,6.94 L 9.42,6.94 L 9.47,6.94 L 9.52,6.94 L 9.56,6.94 L 9.61,6.94 L 9.66,6.94 L 9.70,6.94 L 9.75,6.94 L 9.80,6.94 L 9.84,6.94 L 9.89,6.94 L 9.94,6.94 L 9.98,6.94 L 10.03,6.94 L 10.08,6.94 L 10.12,6.94 L 10.17,6.94 L 10.22,6.94 L 10.27,6.94 L 10.31,6.94 L 10.36,6.94 L 10.41,6.94 L 10.45,6.94 L 10.50,6.94 L 10.55,6.94 L 10.59,6.94 L 10.64,6.94 L 10.69,6.94 L 10.73,6.94 L 10.78,6.94 L 10.83,6.94 L 10.88,6.94 L 10.92,6.94 L 10.97,6.94 L 11.02,6.94 L 11.06,6.94 L 11.11,6.94 L 11.16,6.94 L 11.20,6.94 L 11.25,6.94 L 11.30,6.94 L 11.34,6.94 L 11.39,6.94 L 11.44,6.94 L 11.48,6.94 L 11.53,6.94 L 11.58,6.94 L 11.62,6.94 L 11.67,6.94 L 11.72,6.94 L 11.77,6.94 L 11.81,6.94 L 11.86,6.94 L 11.91,6.94 L 11.95,6.94 L 12.00,6.94 L 12.05,6.94 L 12.09,6.94 L 12.14,6.94 L 12.19,6.94 L 12.23,6.94 L 12.28,6.94 L 12.33,6.94 L 12.38,6.94 L 12.42,6.94 L 12.47,6.94 L 12.52,6.94 L 12.56,6.94 L 12.61,6.94 L 12.66,6.94 L 12.70,6.94 L 12.75,6.94 L 12.80,6.94 L 12.84,6.94 L 12.89,6.94 L 12.94,6.94 L 12.98,6.94 L 13.03,6.94 L 13.08,6.94 L 13.12,6.94 L 13.17,6.94 L 13.22,6.94 L 13.27,6.94 L 13.31,6.94 L 13.36,6.94 L 13.41,6.94 L 13.45,6.94 L 13.50,6.94 L 13.55,6.94 L 13.59,6.94 L 13.64,6.94 L 13.69,6.94 L 13.73,6.94 L 13.78,6.94 L 13.83,6.94 L 13.88,6.94 L 13.92,6.94 L 13.97,6.94 L 14.02,6.94 L 14.06,6.94 L 14.11,6.94 L 14.16,6.94 L 14.20,6.94 L 14.25,6.94 L 14.30,6.94 L 14.34,6.94 L 14.39,6.94 L 14.44,6.94 L 14.48,6.94 L 14.53,6.94 L 14.58,6.94 L 14.62,6.94 L 14.67,6.94 L 14.72,6.94 L 14.77,6.94 L 14.81,6.94 L 14.86,6.94 L 14.91,6.94 L 14.95,6.94 L 15.00,6.94 L 15.05,6.94 L 15.09,6.94 L 15.14,6.94 L 15.19,6.94 L 15.23,6.94 L 15.28,6.94 L 15.33,6.94 L 15.38,6.94 L 15.42,6.94 L 15.47,6.94 L 15.52,6.94 L 15.56,6.94 L 15.61,6.94 L 15.66,6.94 L 15.70,6.94 L 15.75,6.94 L 15.80,6.94 L 15.84,6.94 L 15.89,6.94 L 15.94,6.94 L 15.98,6.94 L 16.03,6.94 L 16.08,6.94 L 16.12,6.94 L 16.17,6.94 L 16.22,6.94 L 16.27,6.94 L 16.31,6.94 L 16.36,6.94 L 16.41,6.94 L 16.45,6.94 L 16.50,6.94 L 16.55,6.94 L 16.59,6.94 L 16.64,6.94 L 16.69,6.94 L 16.73,6.94 L 16.78,6.94 L 16.83,6.94 L 16.88,6.94 L 16.92,6.94 L 16.97,6.94 L 17.02,6.98 L 17.02,7.03 L 17.02,7.08 L 17.02,7.12 L 17.02,7.17 L 17.02,7.22 L 17.02,7.27 L 17.02,7.31 L 17.02,7.36 L 17.02,7.41 L 17.02,7.45 L 17.02,7.50 L 17.02,7.55 L 17.02,7.59 L 17.02,7.64 L 17.02,7.69 L 17.02,7.73 L 17.02,7.78 L 17.02,7.83 L 17.02,7.88 L 17.02,7.92 L 17.02,7.97 L 17.02,8.02 L 17.02,8.06 L 17.02,8.11 L 17.02,8.16 L 17.02,8.20 L 17.02,8.25 L 17.02,8.30 L 17.02,8.34 L 17.02,8.39 L 17.02,8.44 L 17.02,8.48 L 17.02,8.53 L 17.02,8.58 L 17.02,8.62 L 17.02,8.67 L 17.02,8.72 L 17.02,8.77 L 17.02,8.81 L 17.02,8.86 L 17.02,8.91 L 17.02,8.95 L 17.02,9.00 L 17.02,9.05 L 17.02,9.09 L 17.02,9.14 L 17.02,9.19 L 17.02,9.23 L 17.02,9.28 L 17.02,9.33 L 17.02,9.38 L 17.02,9.42 L 17.02,9.47 L 17.02,9.52 L 17.02,9.56 L 17.02,9.61 L 17.02,9.66 L 17.02,9.70 L 17.02,9.75 L 17.02,9.80 L 17.02,9.84 L 17.02,9.89 L 17.02,9.94 L 17.02,9.98 L 17.02,10.03 L 17.02,10.08 L 17.02,10.12 L 17.02,10.17 L 17.02,10.22 L 17.02,10.27 L 17.02,10.31 L 17.02,10.36 L 17.02,10.41 L 17.02,10.45 L 17.02,10.50 L 17.02,10.55 L 17.02,10.59 L 17.02,10.64 L 17.02,10.69 L 17.02,10.73 L 17.02,10.78 L 17.02,10.83 L 17.02,10.88 L 17.02,10.92 L 17.02,10.97 L 17.02,11.02 L 17.02,11.06 L 17.02,11.11 L 17.02,11.16 L 17.02,11.20 L 17.02,11.25 L 17.02,11.30 L 17.02,11.34 L 17.02,11.39 L 17.02,11.44 L 17.02,11.48 L 17.02,11.53 L 17.02,11.58 L 17.02,11.62 L 17.02,11.67 L 17.02,11.72 L 17.02,11.77 L 17.02,11.81 L 17.02,11.86 L 17.02,11.91 L 17.02,11.95 L 17.02,12.00 L 17.02,12.05 L 17.02,12.09 L 17.02,12.14 L 17.02,12.19 L 17.02,12.23 L 17.02,12.28 L 17.02,12.33 L 17.02,12.38 L 17.02,12.42 L 17.02,12.47 L 17.02,12.52 L 17.02,12.56 L 17.02,12.61 L 17.02,12.66 L 17.02,12.70 L 17.02,12.75 L 17.02,12.80 L 17.02,12.84 L 17.02,12.89 L 17.02,12.94 L 17.02,12.98 L 17.02,13.03 L 17.02,13.08 L 17.02,13.12 L 17.02,13.17 L 17.02,13.22 L 17.02,13.27 L 17.02,13.31 L 17.02,13.36 L 17.02,13.41 L 17.02,13.45 L 17.02,13.50 L 17.02,13.55 L 17.02,13.59 L 17.02,13.64 L 17.02,13.69 L 17.02,13.73 L 17.02,13.78 L 17.02,13.83 L 17.02,13.88 L 17.02,13.92 L 17.02,13.97 L 17.02,14.02 L 17.02,14.06 L 17.02,14.11 L 17.02,14.16 L 17.02,14.20 L 17.02,14.25 L 17.02,14.30 L 17.02,14.34 L 17.02,14.39 L 17.02,14.44 L 17.02,14.48 L 17.02,14.53 L 17.02,14.58 L 17.02,14.62 L 17.02,14.67 L 17.02,14.72 L 17.02,14.77 L 17.02,14.81 L 17.02,14.86 L 17.02,14.91 L 17.02,14.95 L 17.02,15.00 L 17.02,15.05 L 17.02,15.09 L 17.02,15.14 L 17.02,15.19 L 17.02,15.23 L 17.02,15.28 L 17.02,15.33 L 17.02,15.38 L 17.02,15.42 L 17.02,15.47 L 17.02,15.52 L 17.02,15.56 L 17.02,15.61 L 17.02,15.66 L 17.02,15.70 L 17.02,15.75 L 17.02,15.80 L 17.02,15.84 L 17.02,15.89 L 17.02,15.94 L 17.02,15.98 L 17.02,16.03 L 17.02,16.08 L 17.02,16.12 L 17.02,16.17 L 17.02,16.22 L 17.02,16.27 L 17.02,16.31 L 17.02,16.36 L 17.02,16.41 L 17.02,16.45 L 17.02,16.50 L 17.02,16.55 L 17.02,16.59 L 17.02,16.64 L 17.02,16.69 L 17.02,16.73 L 17.02,16.78 L 17.02,16.83 L 17.02,16.88 L 17.02,16.92 L 17.02,16.97 L 16.97,17.02 Z",fill:"currentColor"}),y.createElement("path",{d:"M 14.95,14.95 L 14.95,14.91 L 14.95,14.86 L 14.95,14.81 L 14.95,14.77 L 14.95,14.72 L 14.95,14.67 L 14.95,14.62 L 14.95,14.58 L 14.95,14.53 L 14.95,14.48 L 14.95,14.44 L 14.95,14.39 L 14.95,14.34 L 14.95,14.30 L 14.95,14.25 L 14.95,14.20 L 14.95,14.16 L 14.95,14.11 L 14.95,14.06 L 14.95,14.02 L 14.95,13.97 L 14.95,13.92 L 14.95,13.88 L 14.95,13.83 L 14.95,13.78 L 14.95,13.73 L 14.95,13.69 L 14.95,13.64 L 14.95,13.59 L 14.95,13.55 L 14.95,13.50 L 14.95,13.45 L 14.95,13.41 L 14.95,13.36 L 14.95,13.31 L 14.95,13.27 L 14.95,13.22 L 14.95,13.17 L 14.95,13.12 L 14.95,13.08 L 14.95,13.03 L 14.95,12.98 L 14.95,12.94 L 14.95,12.89 L 14.95,12.84 L 14.95,12.80 L 14.95,12.75 L 14.95,12.70 L 14.95,12.66 L 14.95,12.61 L 14.95,12.56 L 14.95,12.52 L 14.95,12.47 L 14.95,12.42 L 14.95,12.38 L 14.95,12.33 L 14.95,12.28 L 14.95,12.23 L 14.95,12.19 L 14.95,12.14 L 14.95,12.09 L 14.95,12.05 L 14.95,12.00 L 14.95,11.95 L 14.95,11.91 L 14.95,11.86 L 14.95,11.81 L 14.95,11.77 L 14.95,11.72 L 14.95,11.67 L 14.95,11.62 L 14.95,11.58 L 14.95,11.53 L 14.95,11.48 L 14.95,11.44 L 14.95,11.39 L 14.95,11.34 L 14.95,11.30 L 14.95,11.25 L 14.95,11.20 L 14.95,11.16 L 14.95,11.11 L 14.95,11.06 L 14.95,11.02 L 14.95,10.97 L 14.95,10.92 L 14.95,10.88 L 14.95,10.83 L 14.95,10.78 L 14.95,10.73 L 14.95,10.69 L 14.95,10.64 L 14.95,10.59 L 14.95,10.55 L 14.95,10.50 L 14.95,10.45 L 14.95,10.41 L 14.95,10.36 L 14.95,10.31 L 14.95,10.27 L 14.95,10.22 L 14.95,10.17 L 14.95,10.12 L 14.95,10.08 L 14.95,10.03 L 14.95,9.98 L 14.95,9.94 L 14.95,9.89 L 14.95,9.84 L 14.95,9.80 L 14.95,9.75 L 14.95,9.70 L 14.95,9.66 L 14.95,9.61 L 14.95,9.56 L 14.95,9.52 L 14.95,9.47 L 14.95,9.42 L 14.95,9.38 L 14.95,9.33 L 14.95,9.28 L 14.95,9.23 L 14.95,9.19 L 14.95,9.14 L 14.95,9.09 L 14.95,9.05 L 14.95,9.00 L 14.95,9.00 L 14.91,9.00 L 14.86,9.00 L 14.81,9.00 L 14.77,9.00 L 14.72,9.00 L 14.67,9.00 L 14.62,9.00 L 14.58,9.00 L 14.53,9.00 L 14.48,9.00 L 14.44,9.00 L 14.39,9.00 L 14.34,9.00 L 14.30,9.00 L 14.25,9.00 L 14.20,9.00 L 14.16,9.00 L 14.11,9.00 L 14.06,9.00 L 14.02,9.00 L 13.97,9.00 L 13.92,9.00 L 13.88,9.00 L 13.83,9.00 L 13.78,9.00 L 13.73,9.00 L 13.69,9.00 L 13.64,9.00 L 13.59,9.00 L 13.55,9.00 L 13.50,9.00 L 13.45,9.00 L 13.41,9.00 L 13.36,9.00 L 13.31,9.00 L 13.27,9.00 L 13.22,9.00 L 13.17,9.00 L 13.12,9.00 L 13.08,9.00 L 13.03,9.00 L 12.98,9.00 L 12.94,9.00 L 12.89,9.00 L 12.84,9.00 L 12.80,9.00 L 12.75,9.00 L 12.70,9.00 L 12.66,9.00 L 12.61,9.00 L 12.56,9.00 L 12.52,9.00 L 12.47,9.00 L 12.42,9.00 L 12.38,9.00 L 12.33,9.00 L 12.28,9.00 L 12.23,9.00 L 12.19,9.00 L 12.14,9.00 L 12.09,9.00 L 12.05,9.00 L 12.00,9.00 L 11.95,9.00 L 11.91,9.00 L 11.86,9.00 L 11.81,9.00 L 11.77,9.00 L 11.72,9.00 L 11.67,9.00 L 11.62,9.00 L 11.58,9.00 L 11.53,9.00 L 11.48,9.00 L 11.44,9.00 L 11.39,9.00 L 11.34,9.00 L 11.30,9.00 L 11.25,9.00 L 11.20,9.00 L 11.16,9.00 L 11.11,9.00 L 11.06,9.00 L 11.02,9.00 L 10.97,9.00 L 10.92,9.00 L 10.88,9.00 L 10.83,9.00 L 10.78,9.00 L 10.73,9.00 L 10.69,9.00 L 10.64,9.00 L 10.59,9.00 L 10.55,9.00 L 10.50,9.00 L 10.45,9.00 L 10.41,9.00 L 10.36,9.00 L 10.31,9.00 L 10.27,9.00 L 10.22,9.00 L 10.17,9.00 L 10.12,9.00 L 10.08,9.00 L 10.03,9.00 L 9.98,9.00 L 9.94,9.00 L 9.89,9.00 L 9.84,9.00 L 9.80,9.00 L 9.75,9.00 L 9.70,9.00 L 9.66,9.00 L 9.61,9.00 L 9.56,9.00 L 9.52,9.00 L 9.47,9.00 L 9.42,9.00 L 9.38,9.00 L 9.33,9.00 L 9.28,9.00 L 9.23,9.00 L 9.19,9.00 L 9.14,9.00 L 9.09,9.00 L 9.05,9.00 L 9.00,9.00 L 9.00,9.00 L 9.00,9.05 L 9.00,9.09 L 9.00,9.14 L 9.00,9.19 L 9.00,9.23 L 9.00,9.28 L 9.00,9.33 L 9.00,9.38 L 9.00,9.42 L 9.00,9.47 L 9.00,9.52 L 9.00,9.56 L 9.00,9.61 L 9.00,9.66 L 9.00,9.70 L 9.00,9.75 L 9.00,9.80 L 9.00,9.84 L 9.00,9.89 L 9.00,9.94 L 9.00,9.98 L 9.00,10.03 L 9.00,10.08 L 9.00,10.12 L 9.00,10.17 L 9.00,10.22 L 9.00,10.27 L 9.00,10.31 L 9.00,10.36 L 9.00,10.41 L 9.00,10.45 L 9.00,10.50 L 9.00,10.55 L 9.00,10.59 L 9.00,10.64 L 9.00,10.69 L 9.00,10.73 L 9.00,10.78 L 9.00,10.83 L 9.00,10.88 L 9.00,10.92 L 9.00,10.97 L 9.00,11.02 L 9.00,11.06 L 9.00,11.11 L 9.00,11.16 L 9.00,11.20 L 9.00,11.25 L 9.00,11.30 L 9.00,11.34 L 9.00,11.39 L 9.00,11.44 L 9.00,11.48 L 9.00,11.53 L 9.00,11.58 L 9.00,11.62 L 9.00,11.67 L 9.00,11.72 L 9.00,11.77 L 9.00,11.81 L 9.00,11.86 L 9.00,11.91 L 9.00,11.95 L 9.00,12.00 L 9.00,12.05 L 9.00,12.09 L 9.00,12.14 L 9.00,12.19 L 9.00,12.23 L 9.00,12.28 L 9.00,12.33 L 9.00,12.38 L 9.00,12.42 L 9.00,12.47 L 9.00,12.52 L 9.00,12.56 L 9.00,12.61 L 9.00,12.66 L 9.00,12.70 L 9.00,12.75 L 9.00,12.80 L 9.00,12.84 L 9.00,12.89 L 9.00,12.94 L 9.00,12.98 L 9.00,13.03 L 9.00,13.08 L 9.00,13.12 L 9.00,13.17 L 9.00,13.22 L 9.00,13.27 L 9.00,13.31 L 9.00,13.36 L 9.00,13.41 L 9.00,13.45 L 9.00,13.50 L 9.00,13.55 L 9.00,13.59 L 9.00,13.64 L 9.00,13.69 L 9.00,13.73 L 9.00,13.78 L 9.00,13.83 L 9.00,13.88 L 9.00,13.92 L 9.00,13.97 L 9.00,14.02 L 9.00,14.06 L 9.00,14.11 L 9.00,14.16 L 9.00,14.20 L 9.00,14.25 L 9.00,14.30 L 9.00,14.34 L 9.00,14.39 L 9.00,14.44 L 9.00,14.48 L 9.00,14.53 L 9.00,14.58 L 9.00,14.62 L 9.00,14.67 L 9.00,14.72 L 9.00,14.77 L 9.00,14.81 L 9.00,14.86 L 9.00,14.91 L 9.00,14.95 L 9.00,14.95 L 9.05,14.95 L 9.09,14.95 L 9.14,14.95 L 9.19,14.95 L 9.23,14.95 L 9.28,14.95 L 9.33,14.95 L 9.38,14.95 L 9.42,14.95 L 9.47,14.95 L 9.52,14.95 L 9.56,14.95 L 9.61,14.95 L 9.66,14.95 L 9.70,14.95 L 9.75,14.95 L 9.80,14.95 L 9.84,14.95 L 9.89,14.95 L 9.94,14.95 L 9.98,14.95 L 10.03,14.95 L 10.08,14.95 L 10.12,14.95 L 10.17,14.95 L 10.22,14.95 L 10.27,14.95 L 10.31,14.95 L 10.36,14.95 L 10.41,14.95 L 10.45,14.95 L 10.50,14.95 L 10.55,14.95 L 10.59,14.95 L 10.64,14.95 L 10.69,14.95 L 10.73,14.95 L 10.78,14.95 L 10.83,14.95 L 10.88,14.95 L 10.92,14.95 L 10.97,14.95 L 11.02,14.95 L 11.06,14.95 L 11.11,14.95 L 11.16,14.95 L 11.20,14.95 L 11.25,14.95 L 11.30,14.95 L 11.34,14.95 L 11.39,14.95 L 11.44,14.95 L 11.48,14.95 L 11.53,14.95 L 11.58,14.95 L 11.62,14.95 L 11.67,14.95 L 11.72,14.95 L 11.77,14.95 L 11.81,14.95 L 11.86,14.95 L 11.91,14.95 L 11.95,14.95 L 12.00,14.95 L 12.05,14.95 L 12.09,14.95 L 12.14,14.95 L 12.19,14.95 L 12.23,14.95 L 12.28,14.95 L 12.33,14.95 L 12.38,14.95 L 12.42,14.95 L 12.47,14.95 L 12.52,14.95 L 12.56,14.95 L 12.61,14.95 L 12.66,14.95 L 12.70,14.95 L 12.75,14.95 L 12.80,14.95 L 12.84,14.95 L 12.89,14.95 L 12.94,14.95 L 12.98,14.95 L 13.03,14.95 L 13.08,14.95 L 13.12,14.95 L 13.17,14.95 L 13.22,14.95 L 13.27,14.95 L 13.31,14.95 L 13.36,14.95 L 13.41,14.95 L 13.45,14.95 L 13.50,14.95 L 13.55,14.95 L 13.59,14.95 L 13.64,14.95 L 13.69,14.95 L 13.73,14.95 L 13.78,14.95 L 13.83,14.95 L 13.88,14.95 L 13.92,14.95 L 13.97,14.95 L 14.02,14.95 L 14.06,14.95 L 14.11,14.95 L 14.16,14.95 L 14.20,14.95 L 14.25,14.95 L 14.30,14.95 L 14.34,14.95 L 14.39,14.95 L 14.44,14.95 L 14.48,14.95 L 14.53,14.95 L 14.58,14.95 L 14.62,14.95 L 14.67,14.95 L 14.72,14.95 L 14.77,14.95 L 14.81,14.95 L 14.86,14.95 L 14.91,14.95 L 14.95,14.95 L 14.95,14.95 Z",fill:"currentColor"}),y.createElement("path",{d:"M 12.94,12.98 L 12.89,12.98 L 12.84,12.98 L 12.80,12.98 L 12.75,12.98 L 12.70,12.98 L 12.66,12.98 L 12.61,12.98 L 12.56,12.98 L 12.52,12.98 L 12.47,12.98 L 12.42,12.98 L 12.38,12.98 L 12.33,12.98 L 12.28,12.98 L 12.23,12.98 L 12.19,12.98 L 12.14,12.98 L 12.09,12.98 L 12.05,12.98 L 12.00,12.98 L 11.95,12.98 L 11.91,12.98 L 11.86,12.98 L 11.81,12.98 L 11.77,12.98 L 11.72,12.98 L 11.67,12.98 L 11.62,12.98 L 11.58,12.98 L 11.53,12.98 L 11.48,12.98 L 11.44,12.98 L 11.39,12.98 L 11.34,12.98 L 11.30,12.98 L 11.25,12.98 L 11.20,12.98 L 11.16,12.98 L 11.11,12.98 L 11.06,12.98 L 11.02,12.98 L 10.97,12.94 L 10.97,12.89 L 10.97,12.84 L 10.97,12.80 L 10.97,12.75 L 10.97,12.70 L 10.97,12.66 L 10.97,12.61 L 10.97,12.56 L 10.97,12.52 L 10.97,12.47 L 10.97,12.42 L 10.97,12.38 L 10.97,12.33 L 10.97,12.28 L 10.97,12.23 L 10.97,12.19 L 10.97,12.14 L 10.97,12.09 L 10.97,12.05 L 10.97,12.00 L 10.97,11.95 L 10.97,11.91 L 10.97,11.86 L 10.97,11.81 L 10.97,11.77 L 10.97,11.72 L 10.97,11.67 L 10.97,11.62 L 10.97,11.58 L 10.97,11.53 L 10.97,11.48 L 10.97,11.44 L 10.97,11.39 L 10.97,11.34 L 10.97,11.30 L 10.97,11.25 L 10.97,11.20 L 10.97,11.16 L 10.97,11.11 L 10.97,11.06 L 10.97,11.02 L 11.02,10.97 L 11.06,10.97 L 11.11,10.97 L 11.16,10.97 L 11.20,10.97 L 11.25,10.97 L 11.30,10.97 L 11.34,10.97 L 11.39,10.97 L 11.44,10.97 L 11.48,10.97 L 11.53,10.97 L 11.58,10.97 L 11.62,10.97 L 11.67,10.97 L 11.72,10.97 L 11.77,10.97 L 11.81,10.97 L 11.86,10.97 L 11.91,10.97 L 11.95,10.97 L 12.00,10.97 L 12.05,10.97 L 12.09,10.97 L 12.14,10.97 L 12.19,10.97 L 12.23,10.97 L 12.28,10.97 L 12.33,10.97 L 12.38,10.97 L 12.42,10.97 L 12.47,10.97 L 12.52,10.97 L 12.56,10.97 L 12.61,10.97 L 12.66,10.97 L 12.70,10.97 L 12.75,10.97 L 12.80,10.97 L 12.84,10.97 L 12.89,10.97 L 12.94,10.97 L 12.98,11.02 L 12.98,11.06 L 12.98,11.11 L 12.98,11.16 L 12.98,11.20 L 12.98,11.25 L 12.98,11.30 L 12.98,11.34 L 12.98,11.39 L 12.98,11.44 L 12.98,11.48 L 12.98,11.53 L 12.98,11.58 L 12.98,11.62 L 12.98,11.67 L 12.98,11.72 L 12.98,11.77 L 12.98,11.81 L 12.98,11.86 L 12.98,11.91 L 12.98,11.95 L 12.98,12.00 L 12.98,12.05 L 12.98,12.09 L 12.98,12.14 L 12.98,12.19 L 12.98,12.23 L 12.98,12.28 L 12.98,12.33 L 12.98,12.38 L 12.98,12.42 L 12.98,12.47 L 12.98,12.52 L 12.98,12.56 L 12.98,12.61 L 12.98,12.66 L 12.98,12.70 L 12.98,12.75 L 12.98,12.80 L 12.98,12.84 L 12.98,12.89 L 12.98,12.94 L 12.94,12.98 Z",fill:"currentColor"})),A7=e=>y.createElement("svg",{baseProfile:"full",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg","xmlns:ev":"http://www.w3.org/2001/xml-events",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},y.createElement("defs",null),y.createElement("path",{d:"M 6.47,22.03 L 6.38,22.03 L 6.28,22.03 L 6.19,21.94 L 6.19,21.94 L 6.09,21.84 L 6.09,21.84 L 6.00,21.75 L 6.00,21.75 L 5.91,21.66 L 5.91,21.66 L 5.81,21.56 L 5.81,21.47 L 5.81,21.47 L 5.72,21.38 L 5.72,21.37 L 5.63,21.28 L 5.63,21.19 L 5.62,21.19 L 5.53,21.09 L 5.53,21.09 L 5.44,21.00 L 5.44,20.91 L 5.44,20.91 L 5.34,20.81 L 5.34,20.72 L 5.34,20.72 L 5.25,20.62 L 5.25,20.62 L 5.16,20.53 L 5.16,20.44 L 5.16,20.44 L 5.06,20.34 L 5.06,20.25 L 5.06,20.25 L 4.97,20.16 L 4.97,20.06 L 4.97,20.06 L 4.88,19.97 L 4.88,19.88 L 4.88,19.87 L 4.78,19.78 L 4.78,19.69 L 4.78,19.69 L 4.69,19.59 L 4.69,19.50 L 4.69,19.50 L 4.59,19.41 L 4.59,19.31 L 4.59,19.31 L 4.50,19.22 L 4.50,19.12 L 4.50,19.12 L 4.41,19.03 L 4.41,18.94 L 4.41,18.94 L 4.31,18.84 L 4.31,18.75 L 4.31,18.75 L 4.22,18.66 L 4.22,18.56 L 4.22,18.47 L 4.22,18.47 L 4.13,18.38 L 4.13,18.28 L 4.12,18.28 L 4.03,18.19 L 4.03,18.09 L 4.03,18.00 L 4.03,18.00 L 3.94,17.91 L 3.94,17.81 L 3.94,17.72 L 3.94,17.72 L 3.84,17.62 L 3.84,17.53 L 3.84,17.44 L 3.84,17.34 L 3.84,17.34 L 3.75,17.25 L 3.75,17.16 L 3.75,17.06 L 3.75,16.97 L 3.75,16.97 L 3.66,16.88 L 3.66,16.78 L 3.66,16.69 L 3.66,16.59 L 3.66,16.50 L 3.66,16.50 L 3.56,16.41 L 3.56,16.31 L 3.56,16.22 L 3.56,16.12 L 3.56,16.03 L 3.56,15.94 L 3.56,15.94 L 3.47,15.84 L 3.47,15.75 L 3.47,15.66 L 3.47,15.56 L 3.47,15.47 L 3.47,15.38 L 3.47,15.28 L 3.47,15.19 L 3.47,15.19 L 3.38,15.09 L 3.38,15.00 L 3.38,14.91 L 3.38,14.81 L 3.38,14.72 L 3.38,14.62 L 3.38,14.53 L 3.38,14.44 L 3.38,14.34 L 3.38,14.25 L 3.38,14.16 L 3.38,14.06 L 3.47,13.97 L 3.47,13.97 L 3.47,13.88 L 3.56,13.78 L 3.56,13.78 L 3.66,13.69 L 3.66,13.69 L 3.75,13.59 L 3.84,13.59 L 3.84,13.59 L 3.94,13.50 L 3.94,13.50 L 4.03,13.41 L 4.12,13.41 L 4.13,13.41 L 4.22,13.31 L 4.31,13.31 L 4.31,13.31 L 4.41,13.22 L 4.50,13.22 L 4.50,13.22 L 4.59,13.13 L 4.69,13.13 L 4.69,13.12 L 4.78,13.03 L 4.88,13.03 L 4.88,13.03 L 4.97,12.94 L 5.06,12.94 L 5.06,12.94 L 5.16,12.84 L 5.25,12.84 L 5.34,12.84 L 5.34,12.84 L 5.44,12.75 L 5.53,12.75 L 5.53,12.75 L 5.62,12.66 L 5.72,12.66 L 5.81,12.66 L 5.81,12.66 L 5.91,12.56 L 6.00,12.56 L 6.00,12.56 L 6.09,12.47 L 6.19,12.47 L 6.28,12.47 L 6.28,12.47 L 6.38,12.38 L 6.47,12.38 L 6.56,12.38 L 6.56,12.38 L 6.66,12.28 L 6.75,12.28 L 6.75,12.28 L 6.84,12.19 L 6.94,12.19 L 7.03,12.19 L 7.03,12.19 L 7.12,12.09 L 7.22,12.09 L 7.22,12.09 L 7.31,12.00 L 7.41,12.00 L 7.50,12.00 L 7.50,12.00 L 7.59,11.91 L 7.69,11.91 L 7.69,11.91 L 7.78,11.81 L 7.88,11.81 L 7.97,11.81 L 7.97,11.81 L 8.06,11.72 L 8.16,11.72 L 8.16,11.72 L 8.25,11.63 L 8.34,11.63 L 8.34,11.62 L 8.34,11.53 L 8.34,11.53 L 8.25,11.53 L 8.16,11.44 L 8.16,11.44 L 8.06,11.44 L 7.97,11.44 L 7.88,11.44 L 7.78,11.44 L 7.69,11.44 L 7.59,11.44 L 7.50,11.44 L 7.41,11.44 L 7.31,11.44 L 7.22,11.44 L 7.12,11.44 L 7.03,11.44 L 6.94,11.44 L 6.84,11.34 L 6.84,11.34 L 6.75,11.25 L 6.75,11.16 L 6.84,11.06 L 6.94,11.06 L 6.94,11.06 L 7.03,10.97 L 7.12,10.97 L 7.22,10.97 L 7.31,10.97 L 7.41,10.97 L 7.50,10.97 L 7.59,10.97 L 7.59,10.97 L 7.69,10.88 L 7.78,10.88 L 7.88,10.88 L 7.97,10.88 L 7.97,10.88 L 8.06,10.78 L 8.16,10.78 L 8.16,10.78 L 8.25,10.69 L 8.25,10.69 L 8.34,10.59 L 8.34,10.59 L 8.44,10.50 L 8.44,10.50 L 8.53,10.41 L 8.53,10.41 L 8.62,10.31 L 8.63,10.31 L 8.72,10.22 L 8.72,10.22 L 8.81,10.13 L 8.91,10.13 L 8.91,10.12 L 9.00,10.03 L 9.09,10.03 L 9.19,10.03 L 9.19,10.03 L 9.28,9.94 L 9.38,9.94 L 9.47,9.94 L 9.47,9.94 L 9.56,9.84 L 9.66,9.84 L 9.66,9.84 L 9.75,9.75 L 9.84,9.75 L 9.84,9.75 L 9.94,9.66 L 9.94,9.66 L 10.03,9.56 L 10.03,9.56 L 10.03,9.47 L 10.12,9.38 L 10.13,9.38 L 10.22,9.28 L 10.22,9.28 L 10.22,9.19 L 10.31,9.09 L 10.31,9.09 L 10.31,9.00 L 10.41,8.91 L 10.41,8.91 L 10.41,8.81 L 10.41,8.72 L 10.50,8.63 L 10.50,8.62 L 10.50,8.53 L 10.59,8.44 L 10.59,8.44 L 10.59,8.34 L 10.59,8.25 L 10.69,8.16 L 10.69,8.16 L 10.69,8.06 L 10.69,7.97 L 10.78,7.88 L 10.78,7.88 L 10.78,7.78 L 10.78,7.69 L 10.88,7.59 L 10.88,7.59 L 10.88,7.50 L 10.88,7.41 L 10.88,7.31 L 10.88,7.22 L 10.88,7.12 L 10.88,7.03 L 10.88,7.03 L 10.78,6.94 L 10.78,6.84 L 10.78,6.84 L 10.69,6.75 L 10.69,6.66 L 10.69,6.66 L 10.59,6.56 L 10.59,6.56 L 10.50,6.47 L 10.50,6.47 L 10.41,6.38 L 10.41,6.37 L 10.31,6.28 L 10.31,6.28 L 10.22,6.19 L 10.22,6.19 L 10.13,6.09 L 10.12,6.09 L 10.03,6.00 L 10.03,6.00 L 9.94,5.91 L 9.94,5.91 L 9.84,5.81 L 9.84,5.72 L 9.84,5.72 L 9.75,5.62 L 9.75,5.62 L 9.66,5.53 L 9.66,5.44 L 9.66,5.34 L 9.66,5.25 L 9.75,5.16 L 9.75,5.16 L 9.84,5.06 L 9.84,5.06 L 9.94,4.97 L 9.94,4.97 L 10.03,4.88 L 10.03,4.88 L 10.12,4.78 L 10.22,4.78 L 10.22,4.78 L 10.31,4.69 L 10.41,4.69 L 10.41,4.69 L 10.50,4.59 L 10.59,4.59 L 10.59,4.59 L 10.69,4.50 L 10.78,4.50 L 10.78,4.50 L 10.88,4.41 L 10.97,4.41 L 11.06,4.41 L 11.06,4.41 L 11.16,4.31 L 11.25,4.31 L 11.25,4.31 L 11.34,4.22 L 11.44,4.22 L 11.44,4.22 L 11.53,4.13 L 11.62,4.13 L 11.72,4.13 L 11.72,4.12 L 11.81,4.03 L 11.91,4.03 L 11.91,4.03 L 12.00,3.94 L 12.09,3.94 L 12.19,3.94 L 12.19,3.94 L 12.28,3.84 L 12.38,3.84 L 12.38,3.84 L 12.47,3.75 L 12.56,3.75 L 12.66,3.75 L 12.66,3.75 L 12.75,3.66 L 12.84,3.66 L 12.84,3.66 L 12.94,3.56 L 13.03,3.56 L 13.12,3.56 L 13.13,3.56 L 13.22,3.47 L 13.31,3.47 L 13.41,3.47 L 13.41,3.47 L 13.50,3.38 L 13.59,3.38 L 13.69,3.38 L 13.69,3.38 L 13.78,3.28 L 13.88,3.28 L 13.88,3.28 L 13.97,3.19 L 14.06,3.19 L 14.16,3.19 L 14.16,3.19 L 14.25,3.09 L 14.34,3.09 L 14.44,3.09 L 14.44,3.09 L 14.53,3.00 L 14.62,3.00 L 14.72,3.00 L 14.81,3.00 L 14.81,3.00 L 14.91,2.91 L 15.00,2.91 L 15.09,2.91 L 15.09,2.91 L 15.19,2.81 L 15.28,2.81 L 15.38,2.81 L 15.38,2.81 L 15.47,2.72 L 15.56,2.72 L 15.66,2.72 L 15.66,2.72 L 15.75,2.63 L 15.84,2.63 L 15.94,2.63 L 15.94,2.62 L 16.03,2.53 L 16.12,2.53 L 16.22,2.53 L 16.22,2.53 L 16.31,2.44 L 16.41,2.44 L 16.50,2.44 L 16.59,2.44 L 16.59,2.44 L 16.69,2.34 L 16.78,2.34 L 16.88,2.34 L 16.88,2.34 L 16.97,2.25 L 17.06,2.25 L 17.16,2.25 L 17.16,2.25 L 17.25,2.16 L 17.34,2.16 L 17.44,2.16 L 17.53,2.16 L 17.53,2.16 L 17.62,2.06 L 17.72,2.06 L 17.81,2.06 L 17.81,2.06 L 17.91,1.97 L 18.00,1.97 L 18.09,1.97 L 18.19,1.97 L 18.19,1.97 L 18.28,1.88 L 18.38,1.88 L 18.47,1.88 L 18.47,1.88 L 18.56,1.78 L 18.66,1.78 L 18.75,1.78 L 18.84,1.78 L 18.84,1.78 L 18.94,1.69 L 19.03,1.69 L 19.12,1.69 L 19.22,1.69 L 19.22,1.69 L 19.31,1.59 L 19.41,1.59 L 19.50,1.59 L 19.50,1.59 L 19.59,1.50 L 19.69,1.50 L 19.78,1.50 L 19.88,1.50 L 19.88,1.50 L 19.97,1.41 L 20.06,1.41 L 20.16,1.41 L 20.25,1.41 L 20.25,1.41 L 20.34,1.31 L 20.44,1.31 L 20.53,1.31 L 20.62,1.31 L 20.63,1.31 L 20.72,1.22 L 20.81,1.22 L 20.91,1.22 L 21.00,1.22 L 21.09,1.22 L 21.09,1.22 L 21.19,1.13 L 21.28,1.13 L 21.38,1.13 L 21.47,1.13 L 21.56,1.13 L 21.66,1.22 L 21.66,1.31 L 21.56,1.41 L 21.56,1.41 L 21.47,1.50 L 21.38,1.50 L 21.37,1.50 L 21.28,1.59 L 21.28,1.59 L 21.19,1.69 L 21.09,1.69 L 21.09,1.69 L 21.00,1.78 L 20.91,1.78 L 20.91,1.78 L 20.81,1.87 L 20.72,1.87 L 20.72,1.88 L 20.62,1.97 L 20.53,1.97 L 20.44,1.97 L 20.44,1.97 L 20.34,2.06 L 20.25,2.06 L 20.25,2.06 L 20.16,2.16 L 20.06,2.16 L 20.06,2.16 L 19.97,2.25 L 19.88,2.25 L 19.87,2.25 L 19.78,2.34 L 19.69,2.34 L 19.59,2.34 L 19.59,2.34 L 19.50,2.44 L 19.41,2.44 L 19.41,2.44 L 19.31,2.53 L 19.22,2.53 L 19.12,2.53 L 19.12,2.53 L 19.03,2.62 L 18.94,2.62 L 18.94,2.62 L 18.84,2.72 L 18.75,2.72 L 18.75,2.72 L 18.66,2.81 L 18.56,2.81 L 18.47,2.81 L 18.47,2.81 L 18.38,2.91 L 18.28,2.91 L 18.19,2.91 L 18.19,2.91 L 18.09,3.00 L 18.00,3.00 L 18.00,3.00 L 17.91,3.09 L 17.81,3.09 L 17.72,3.09 L 17.72,3.09 L 17.62,3.19 L 17.53,3.19 L 17.44,3.19 L 17.44,3.19 L 17.34,3.28 L 17.25,3.28 L 17.25,3.28 L 17.16,3.37 L 17.06,3.37 L 16.97,3.37 L 16.97,3.38 L 16.88,3.47 L 16.78,3.47 L 16.78,3.47 L 16.69,3.56 L 16.59,3.56 L 16.50,3.56 L 16.50,3.56 L 16.41,3.66 L 16.31,3.66 L 16.31,3.66 L 16.22,3.75 L 16.12,3.75 L 16.12,3.75 L 16.03,3.84 L 15.94,3.84 L 15.84,3.84 L 15.84,3.84 L 15.75,3.94 L 15.66,3.94 L 15.66,3.94 L 15.56,4.03 L 15.47,4.03 L 15.47,4.03 L 15.38,4.12 L 15.28,4.12 L 15.28,4.12 L 15.19,4.22 L 15.09,4.22 L 15.00,4.22 L 15.00,4.22 L 14.91,4.31 L 14.81,4.31 L 14.81,4.31 L 14.72,4.41 L 14.62,4.41 L 14.62,4.41 L 14.53,4.50 L 14.44,4.50 L 14.44,4.50 L 14.34,4.59 L 14.25,4.59 L 14.25,4.59 L 14.16,4.69 L 14.06,4.69 L 14.06,4.69 L 13.97,4.78 L 13.97,4.78 L 13.88,4.87 L 13.78,4.87 L 13.78,4.88 L 13.69,4.97 L 13.69,4.97 L 13.59,5.06 L 13.50,5.06 L 13.50,5.06 L 13.50,5.16 L 13.50,5.25 L 13.50,5.34 L 13.50,5.44 L 13.50,5.53 L 13.50,5.62 L 13.50,5.63 L 13.59,5.72 L 13.59,5.81 L 13.59,5.91 L 13.59,6.00 L 13.59,6.09 L 13.59,6.19 L 13.59,6.28 L 13.50,6.37 L 13.50,6.38 L 13.50,6.47 L 13.50,6.56 L 13.50,6.66 L 13.50,6.75 L 13.50,6.84 L 13.50,6.94 L 13.50,7.03 L 13.50,7.12 L 13.41,7.22 L 13.41,7.22 L 13.41,7.31 L 13.41,7.41 L 13.41,7.50 L 13.41,7.59 L 13.41,7.69 L 13.31,7.78 L 13.31,7.78 L 13.31,7.88 L 13.31,7.97 L 13.22,8.06 L 13.22,8.06 L 13.22,8.16 L 13.22,8.25 L 13.22,8.34 L 13.12,8.44 L 13.12,8.44 L 13.12,8.53 L 13.12,8.62 L 13.12,8.72 L 13.12,8.81 L 13.12,8.91 L 13.12,9.00 L 13.12,9.09 L 13.12,9.19 L 13.12,9.28 L 13.12,9.38 L 13.12,9.47 L 13.12,9.56 L 13.12,9.56 L 13.22,9.66 L 13.22,9.75 L 13.22,9.84 L 13.22,9.84 L 13.31,9.94 L 13.31,10.03 L 13.31,10.12 L 13.31,10.13 L 13.41,10.22 L 13.41,10.22 L 13.50,10.31 L 13.50,10.31 L 13.59,10.41 L 13.59,10.41 L 13.69,10.50 L 13.69,10.50 L 13.78,10.59 L 13.78,10.59 L 13.87,10.69 L 13.88,10.69 L 13.97,10.78 L 13.97,10.78 L 14.06,10.78 L 14.16,10.88 L 14.16,10.88 L 14.25,10.88 L 14.34,10.88 L 14.44,10.88 L 14.53,10.88 L 14.62,10.88 L 14.72,10.88 L 14.81,10.88 L 14.91,10.88 L 15.00,10.88 L 15.09,10.88 L 15.19,10.88 L 15.28,10.88 L 15.38,10.88 L 15.47,10.88 L 15.56,10.88 L 15.66,10.88 L 15.75,10.88 L 15.84,10.88 L 15.94,10.88 L 16.03,10.88 L 16.12,10.88 L 16.22,10.88 L 16.31,10.88 L 16.41,10.88 L 16.50,10.88 L 16.59,10.88 L 16.69,10.88 L 16.78,10.88 L 16.88,10.88 L 16.97,10.88 L 17.06,10.88 L 17.16,10.88 L 17.25,10.97 L 17.25,10.97 L 17.34,10.97 L 17.44,10.97 L 17.53,10.97 L 17.62,10.97 L 17.72,10.97 L 17.81,11.06 L 17.81,11.06 L 17.91,11.06 L 18.00,11.16 L 18.00,11.16 L 18.09,11.25 L 18.00,11.34 L 18.00,11.34 L 17.91,11.44 L 17.81,11.44 L 17.72,11.44 L 17.62,11.44 L 17.53,11.44 L 17.44,11.44 L 17.34,11.44 L 17.34,11.44 L 17.25,11.53 L 17.16,11.53 L 17.06,11.53 L 16.97,11.53 L 16.88,11.53 L 16.78,11.53 L 16.69,11.53 L 16.59,11.53 L 16.50,11.53 L 16.41,11.53 L 16.41,11.53 L 16.31,11.62 L 16.22,11.62 L 16.22,11.62 L 16.22,11.72 L 16.22,11.72 L 16.31,11.72 L 16.41,11.72 L 16.50,11.72 L 16.59,11.72 L 16.69,11.72 L 16.78,11.72 L 16.88,11.72 L 16.97,11.72 L 17.06,11.72 L 17.16,11.72 L 17.25,11.72 L 17.34,11.72 L 17.44,11.72 L 17.53,11.72 L 17.62,11.72 L 17.72,11.72 L 17.81,11.72 L 17.91,11.81 L 17.91,11.81 L 18.00,11.81 L 18.09,11.91 L 18.09,12.00 L 18.00,12.09 L 17.91,12.09 L 17.91,12.09 L 17.81,12.19 L 17.72,12.19 L 17.62,12.19 L 17.53,12.19 L 17.44,12.19 L 17.44,12.19 L 17.34,12.28 L 17.25,12.28 L 17.16,12.28 L 17.06,12.28 L 16.97,12.28 L 16.88,12.28 L 16.78,12.28 L 16.69,12.28 L 16.59,12.28 L 16.50,12.28 L 16.41,12.28 L 16.31,12.28 L 16.22,12.19 L 16.22,12.19 L 16.12,12.19 L 16.03,12.19 L 15.94,12.19 L 15.84,12.19 L 15.75,12.19 L 15.66,12.19 L 15.56,12.19 L 15.47,12.19 L 15.38,12.19 L 15.28,12.19 L 15.19,12.19 L 15.09,12.19 L 15.00,12.19 L 14.91,12.19 L 14.81,12.19 L 14.72,12.19 L 14.62,12.19 L 14.53,12.19 L 14.44,12.19 L 14.34,12.19 L 14.25,12.19 L 14.16,12.19 L 14.06,12.19 L 13.97,12.19 L 13.88,12.09 L 13.88,12.09 L 13.78,12.09 L 13.69,12.09 L 13.59,12.09 L 13.50,12.09 L 13.41,12.09 L 13.41,12.09 L 13.41,12.19 L 13.41,12.28 L 13.31,12.37 L 13.22,12.37 L 13.12,12.37 L 13.03,12.37 L 12.94,12.37 L 12.94,12.38 L 12.84,12.47 L 12.75,12.47 L 12.66,12.47 L 12.56,12.47 L 12.47,12.47 L 12.38,12.47 L 12.28,12.47 L 12.19,12.47 L 12.09,12.47 L 12.09,12.47 L 12.00,12.56 L 11.91,12.56 L 11.81,12.56 L 11.72,12.56 L 11.62,12.56 L 11.53,12.56 L 11.44,12.56 L 11.34,12.56 L 11.25,12.56 L 11.16,12.56 L 11.06,12.56 L 10.97,12.56 L 10.88,12.56 L 10.78,12.56 L 10.69,12.56 L 10.59,12.56 L 10.50,12.56 L 10.41,12.56 L 10.31,12.56 L 10.22,12.47 L 10.22,12.47 L 10.12,12.47 L 10.03,12.47 L 9.94,12.47 L 9.94,12.47 L 9.84,12.56 L 9.75,12.56 L 9.66,12.56 L 9.66,12.56 L 9.56,12.66 L 9.47,12.66 L 9.47,12.66 L 9.38,12.75 L 9.28,12.75 L 9.28,12.75 L 9.19,12.84 L 9.09,12.84 L 9.09,12.84 L 9.00,12.94 L 8.91,12.94 L 8.91,12.94 L 8.81,13.03 L 8.81,13.03 L 8.72,13.12 L 8.62,13.12 L 8.62,13.12 L 8.53,13.22 L 8.53,13.22 L 8.44,13.31 L 8.34,13.31 L 8.34,13.31 L 8.25,13.41 L 8.25,13.41 L 8.16,13.50 L 8.06,13.50 L 8.06,13.50 L 7.97,13.59 L 7.97,13.59 L 7.88,13.69 L 7.87,13.69 L 7.78,13.78 L 7.69,13.78 L 7.69,13.78 L 7.59,13.87 L 7.59,13.88 L 7.50,13.97 L 7.50,13.97 L 7.41,14.06 L 7.41,14.06 L 7.31,14.16 L 7.22,14.16 L 7.22,14.16 L 7.12,14.25 L 7.12,14.25 L 7.03,14.34 L 7.03,14.34 L 6.94,14.44 L 6.94,14.44 L 6.84,14.53 L 6.84,14.53 L 6.75,14.62 L 6.75,14.62 L 6.66,14.72 L 6.66,14.72 L 6.56,14.81 L 6.56,14.81 L 6.47,14.91 L 6.47,14.91 L 6.38,15.00 L 6.37,15.00 L 6.28,15.09 L 6.28,15.09 L 6.19,15.19 L 6.19,15.19 L 6.19,15.28 L 6.19,15.38 L 6.09,15.47 L 6.09,15.47 L 6.09,15.56 L 6.09,15.66 L 6.09,15.75 L 6.09,15.84 L 6.09,15.94 L 6.09,16.03 L 6.00,16.12 L 6.00,16.12 L 6.00,16.22 L 6.00,16.31 L 6.00,16.41 L 6.00,16.50 L 6.00,16.59 L 6.00,16.59 L 6.09,16.69 L 6.09,16.78 L 6.09,16.88 L 6.09,16.97 L 6.09,17.06 L 6.09,17.16 L 6.09,17.25 L 6.09,17.34 L 6.09,17.44 L 6.09,17.53 L 6.09,17.62 L 6.09,17.72 L 6.09,17.81 L 6.09,17.91 L 6.09,18.00 L 6.09,18.09 L 6.09,18.19 L 6.09,18.28 L 6.09,18.38 L 6.09,18.47 L 6.09,18.56 L 6.09,18.66 L 6.09,18.75 L 6.09,18.84 L 6.09,18.94 L 6.09,19.03 L 6.09,19.12 L 6.09,19.22 L 6.09,19.31 L 6.09,19.41 L 6.09,19.50 L 6.09,19.59 L 6.09,19.69 L 6.09,19.78 L 6.09,19.88 L 6.09,19.97 L 6.09,20.06 L 6.09,20.16 L 6.09,20.25 L 6.09,20.34 L 6.09,20.44 L 6.09,20.53 L 6.09,20.62 L 6.09,20.72 L 6.09,20.81 L 6.09,20.91 L 6.09,20.91 L 6.19,21.00 L 6.19,21.09 L 6.19,21.19 L 6.19,21.19 L 6.28,21.28 L 6.28,21.38 L 6.28,21.38 L 6.37,21.47 L 6.37,21.56 L 6.38,21.56 L 6.47,21.66 L 6.47,21.66 L 6.56,21.75 L 6.56,21.84 L 6.56,21.94 L 6.47,22.03 Z",fill:"currentColor"})),KX="RuleArtifact",tS=e=>{const{eventSource:t,small:n}=e,r=n?"size-4":"size-5";switch(t){case ei.Auto:return f.jsx(u3,{className:r});case ei.Frigate:return f.jsx(A7,{className:r});case ei.NVR:return f.jsx(D7,{className:r});case ei.RawDetection:return f.jsx("span",{children:"AN"});case KX:return f.jsx(ef,{className:r});default:return null}};function j7(e){let t=(e.classes??[]).filter(n=>n!=="any_object");return t.length>1&&(t=t.filter(n=>n!==nn.Motion)),t}function QX(e){const t=(e.classes??[]).slice().sort().join(",");return`${e.timestamp}-${t}`}function ZX(e){const t=new Set;return e.filter(n=>{const r=QX(n);return t.has(r)?!1:(t.add(r),!0)})}function JX(e){return e.map(r=>({event:r,count:j7(r).length})).reduce((r,s)=>r.count>s.count||r.count===s.count&&r.event.timestamp<s.event.timestamp?r:s).event}const rm=80,eK=12;function tK(e,t,n=rm){return Math.max(1,Math.min(eK,Math.floor(t/n)))}const nS=5*60*1e3;function nK(e,t,n=nS){if(n<=0||e.length===0)return[];const r=Math.floor(t.start/n)*n,s=Math.floor((t.end-1)/n)*n,a=new Map;for(const h of e){const m=h.timestamp;if(m<t.start||m>=t.end)continue;const p=Math.floor(m/n)*n,x=a.get(p)??[];x.push(h),a.set(p,x)}const l=[];for(let h=r;h<=s;h+=n){const m=a.get(h);if(!(m!=null&&m.length))continue;const p=ZX(m);if(p.length===0)continue;const x=h+n,b=JX(p),w=o7.uniq(p.flatMap(E=>j7(E)).filter(Boolean));l.push({events:p,representative:b,classes:w,startMs:h,endMs:x})}return l.sort((h,m)=>h.startMs-m.startMs)}function rK(e,t,n,r,s=nS){if(e.length===0||n<=0)return[];if(t<=0)return e.map(p=>({...p,row:0}));const a=r/n*t,l=[...e].sort((p,x)=>p.startMs-x.startMs),h=[],m=[];for(const p of l){const x=p.startMs-a/2,b=p.startMs+a/2;let w=0;for(;w<h.length&&h[w]>x;)w++;w===h.length&&h.push(0),h[w]=b,m.push({...p,row:w})}return m}function iK(e,t,n,r=rm,s=99){if(e.length===0)return[];const a=t.end-t.start;if(a<=0)return e.map(m=>({...m,row:0}));const l=[],h=[];for(const m of e){const p=(m.startMs-t.start)/a*n,x=(m.endMs-m.startMs)/a*n,b=Math.max(x,r),w=p+b;let E=0;if(s>1){for(;E<l.length&&l[E]>p;)E++;E===l.length&&l.push(0)}E===l.length&&l.push(0),l[E]=Math.max(l[E],w),h.push({...m,row:E})}return h}const k7=y.createContext(null);function Pb(){const e=y.useContext(k7);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function P7({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:s,children:a,...l}){const[h,m]=Ob({...t,axis:e==="horizontal"?"x":"y"},r),[p,x]=y.useState(!1),[b,w]=y.useState(!1),E=y.useCallback(_=>{_&&(x(_.canScrollPrev()),w(_.canScrollNext()))},[]),M=y.useCallback(()=>{m==null||m.scrollPrev()},[m]),C=y.useCallback(()=>{m==null||m.scrollNext()},[m]),S=y.useCallback(_=>{_.key==="ArrowLeft"?(_.preventDefault(),M()):_.key==="ArrowRight"&&(_.preventDefault(),C())},[M,C]);return y.useEffect(()=>{!m||!n||n(m)},[m,n]),y.useEffect(()=>{if(m)return E(m),m.on("reInit",E),m.on("select",E),()=>{m==null||m.off("select",E)}},[m,E]),f.jsx(k7.Provider,{value:{carouselRef:h,api:m,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:M,scrollNext:C,canScrollPrev:p,canScrollNext:b},children:f.jsx("div",{onKeyDownCapture:S,className:He("relative",s),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...l,children:a})})}function z7({className:e,...t}){const{carouselRef:n,orientation:r}=Pb();return f.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:f.jsx("div",{className:He("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function B7({className:e,...t}){const{orientation:n}=Pb();return f.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:He("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function U7({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:s,scrollPrev:a,canScrollPrev:l}=Pb();return f.jsxs(Qe,{"data-slot":"carousel-previous",variant:t,size:n,className:He("absolute size-8 rounded-full",s==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:a,...r,children:[f.jsx(sa,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function F7({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:s,scrollNext:a,canScrollNext:l}=Pb();return f.jsxs(Qe,{"data-slot":"carousel-next",variant:t,size:n,className:He("absolute size-8 rounded-full",s==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:a,...r,children:[f.jsx(wA,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function H2(e,t){return e?e.startsWith("http")?e:`${t}${e}`:""}function X5(e,t){var n;for(const r of e){const s=(n=r.detections)==null?void 0:n.find(a=>a.className===t&&a.label);if(s!=null&&s.label)return s.label}return t}function K5({open:e,onOpenChange:t,payload:n,getThumbnailUrl:r,assetsBaseUrl:s=""}){const[a,l]=y.useState(!1),[h,m]=y.useState(0),p=y.useRef(null);if(y.useEffect(()=>{e&&n&&console.log("[ClusterDetailSheet] cluster opened",n)},[e,n]),!n)return null;const{cluster:x,videoclipUrl:b,ruleArtifacts:w}=n,{events:E,representative:M,classes:C}=x,S=E[h]??M,_=E.some(N=>{var c;return(c=N.detections)==null?void 0:c.length});return f.jsx(ZR,{open:e,onOpenChange:t,children:f.jsxs(JR,{side:"bottom",className:"h-[85vh] flex flex-col gap-0 p-0",children:[f.jsxs(e_,{className:"shrink-0 px-4 pt-4 pb-2",children:[f.jsxs(t_,{children:[E.length," event",E.length!==1?"s":""," ·"," ",br(x.startMs,"HH:mm:ss")," – ",br(x.endMs,"HH:mm:ss")]}),f.jsx(n_,{className:"flex flex-wrap gap-1.5",children:C.filter(N=>N!=="motion").map(N=>f.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs",children:[f.jsx(yu,{small:!0,detectionClass:N}),X5(E,N)]},N))}),f.jsxs("label",{className:He("flex items-center gap-2 pt-2 text-sm",_?"cursor-pointer":"cursor-not-allowed opacity-70"),title:_?void 0:"Available when images have detection data",children:[f.jsx("input",{type:"checkbox",checked:a,onChange:N=>l(N.target.checked),disabled:!_,className:"h-4 w-4 rounded border border-input accent-primary"}),f.jsx("span",{children:"Show bounding box on image"})]})]}),f.jsxs("div",{className:"relative flex-1 min-h-0 flex items-center justify-center bg-black/90 px-2",children:[f.jsxs(P7,{opts:{align:"center",startIndex:0,loop:!0},className:"w-full max-h-[55vh]",setApi:N=>{N&&(p.current=N,N.on("select",()=>m(N.selectedScrollSnap())))},children:[f.jsx(z7,{children:E.map((N,c)=>f.jsx(B7,{className:"flex justify-center",children:f.jsx(oK,{event:N,getImageUrl:r,showBoundingBox:a})},`${N.id}-${c}`))}),f.jsxs(U7,{className:"left-2 md:left-4 border-0 bg-black/50 hover:bg-black/70 text-white",children:[f.jsx(Zd,{className:"size-6"}),f.jsx("span",{className:"sr-only",children:"Previous"})]}),f.jsxs(F7,{className:"right-2 md:right-4 border-0 bg-black/50 hover:bg-black/70 text-white",children:[f.jsx(Jd,{className:"size-6"}),f.jsx("span",{className:"sr-only",children:"Next"})]})]}),E.length>1&&f.jsx("nav",{className:"absolute bottom-2 left-0 right-0 flex justify-center gap-1.5 z-10","aria-label":"Image navigation",children:E.map((N,c)=>f.jsx("button",{type:"button",onClick:()=>{var j;return(j=p.current)==null?void 0:j.scrollTo(c)},className:He("rounded-full transition-all",c===h?"w-2.5 h-2.5 bg-white":"w-2 h-2 bg-white/50 hover:bg-white/70"),"aria-label":`Go to image ${c+1}`},c))})]}),f.jsxs("div",{className:"shrink-0 border-t bg-muted/50 px-4 py-3 space-y-2 overflow-y-auto max-h-[28vh]",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm",children:[f.jsx("span",{className:"font-medium text-foreground",children:S.deviceName}),f.jsx("span",{className:"text-muted-foreground",children:br(S.timestamp,"HH:mm:ss.SSS")}),f.jsx("span",{className:"text-muted-foreground",children:(S.classes??[]).filter(N=>N!=="motion").map(N=>X5([S],N)).join(", ")}),f.jsxs("span",{className:"text-muted-foreground",children:["Source: ",S.source]})]}),E.length>1&&f.jsxs("p",{className:"text-xs text-muted-foreground",children:[h+1," / ",E.length]}),b&&f.jsx(Qe,{variant:"outline",size:"sm",asChild:!0,children:f.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"inline-flex gap-2",children:[f.jsx(ef,{className:"size-4"}),"Open videoclip"]})}),w&&w.length>0&&f.jsx("div",{className:"flex flex-wrap gap-2",children:w.map((N,c)=>f.jsxs("div",{className:"rounded border bg-card p-2 text-xs space-y-1",children:[f.jsx("div",{className:"font-medium",children:N.ruleName}),f.jsxs("div",{className:"flex gap-2 flex-wrap",children:[N.imageUrl&&f.jsxs("a",{href:H2(N.imageUrl,s),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[f.jsx(Nj,{className:"size-3"}),"Image"]}),N.gifUrl&&f.jsx("a",{href:H2(N.gifUrl,s),target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"GIF"}),N.videoUrl&&f.jsxs("a",{href:H2(N.videoUrl,s),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:[f.jsx(ef,{className:"size-3"}),"Video"]})]})]},`${N.ruleName}-${N.timestamp}-${c}`))})]})]})})}function sK(e,t,n){const[r,s,a,l]=e;return Math.max(r,s,a,l)>1.5?t<=0||n<=0?[0,0,0,0]:[r/t,s/n,a/t,l/n]:[r,s,a,l]}function oK({event:e,getImageUrl:t,showBoundingBox:n}){const[r,s]=y.useState(!1),[a,l]=y.useState({w:0,h:0}),h=t(e.imageUrl??e.thumbnailUrl),m=e.detections??[],p=n&&m.some(b=>{var w;return((w=b.boundingBox)==null?void 0:w.length)===4}),x=b=>{const w=b.currentTarget;l({w:w.naturalWidth,h:w.naturalHeight}),s(!0)};return f.jsxs("div",{className:"relative flex items-center justify-center w-full h-full min-h-[200px]",children:[!r&&f.jsx(Ts,{className:"absolute inset-0 max-w-full max-h-[55vh] m-auto w-full aspect-video rounded"}),f.jsxs("div",{className:"relative inline-block max-w-full max-h-[55vh]",children:[f.jsx("img",{src:h,alt:"",className:He("max-w-full max-h-[55vh] object-contain block",!r&&"invisible"),onLoad:x}),r&&p&&a.w>0&&a.h>0&&f.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:m.map((b,w)=>{if(b.className==="motion")return null;const E=b.boundingBox;if(!E||E.length!==4)return null;const[M,C,S,_]=sK(E,a.w,a.h),N=M*100,c=C*100,j=S*100,D=_*100,B=b.className==="audio"?b.label||b.className:[b.className,b.label].filter(Boolean).join(" · ")||void 0;return f.jsxs("g",{children:[f.jsx("rect",{x:N,y:c,width:j,height:D,fill:"none",stroke:"lime",strokeWidth:"0.35"}),B&&f.jsx("text",{x:N,y:c>3?c-.8:c+2.2,fontSize:"2",fill:"lime",stroke:"black",strokeWidth:"0.3",paintOrder:"stroke",children:B})]},w)})})]})]})}const aK=2;function Q5(e){const t=10**aK;return Math.round(e*t)/t}function I2(e,t,n){const r=n.end-n.start;if(r<=0)return{leftPct:0,widthPct:0};const s=Q5((e-n.start)/r*100),a=Q5((t-e)/r*100);return{leftPct:s,widthPct:a}}const $2=30*60*1e3,lK=2*60*60*1e3,Z5=5*60*1e3,cK=10,J5=45e3,uK=18e4;function dK(e){return()=>(e=(e*9301+49297)%233280,e/233280)}const eE=4;function fK(e){const t=e.end-e.start;if(t<=0)return[];const n=dK(Math.round(e.start/6e4)),r=[];for(let l=0;l<cK;l++){const h=e.start+n()*(t*.85),m=J5+n()*(uK-J5),p=Math.min(e.end,h+m);r.push({startMs:h,endMs:p})}r.sort((l,h)=>l.startMs-h.startMs);const s=[],a=[];for(const{startMs:l,endMs:h}of r){let m=0;for(;m<s.length&&s[m]>l;)m++;m>=eE&&(m=eE-1),m===s.length&&s.push(0),s[m]=h,a.push({startMs:l,endMs:h,row:m})}return a}const Uy=.4,tE=1.5,hK=.2,mK=.5,V2=64,nE=20,pK=.5,gK=72,vK=180,yK=44,xK=120,jp=400;function bK({timeRange:e,onTimeRangeChange:t,events:n,motionSegments:r=[],getVideoclipForCluster:s,getRuleArtifactsForCluster:a,artifacts:l=[],assetsBaseUrl:h="",className:m,orientation:p="vertical",liveAt:x,loading:b=!1,scrubTimeMs:w,onScrubTimeChange:E,onScrubEnd:M}){var Tt;const C=Date.now(),S=Math.min($2,e.end-e.start),_=Math.min(e.end,C+Math.round((1-Uy)*S)),N=Math.max(e.start,_-S),[c,j]=y.useState(()=>({start:N,end:_})),D=y.useRef(null),B=y.useRef(null),T=y.useRef(c),A=y.useRef(0),H=y.useRef(e),F=y.useRef(0),[V,ee]=y.useState(null),[G,se]=y.useState(!1),[Ce,te]=y.useState(null),[K,Z]=y.useState(0),[oe,Y]=y.useState(400),ne=y.useRef(!1),[X,ue]=y.useState(400),[pe,Se]=y.useState(()=>Date.now());y.useEffect(()=>{j(ce=>{const Ue=e.end-e.start,ze=Math.min(e.end,Date.now()+Math.round((1-Uy)*Math.min($2,Ue))),$e=e.start;if(ce.end<=ze&&ce.start>=$e&&Ue>0)return ce;const ht=Date.now(),vt=Math.min($2,Ue),Nt=Math.min(e.end,ht+Math.round((1-Uy)*vt));return{start:Math.max(e.start,Nt-vt),end:Nt}})},[e.start,e.end]);const Re=y.useRef({w:0,h:0}),ye=y.useRef(null);y.useEffect(()=>{const ce=D.current;if(!ce)return;const Ue=()=>{ye.current==null&&(ye.current=requestAnimationFrame(()=>{ye.current=null;const vt=ce.offsetWidth,Nt=ce.offsetHeight;Re.current.w===vt&&Re.current.h===Nt||(Re.current={w:vt,h:Nt},Y(vt),ue(Nt))}))},ze=new ResizeObserver(Ue);ze.observe(ce);const $e=ce.offsetWidth,ht=ce.offsetHeight;return Re.current={w:$e,h:ht},Y($e),ue(ht),()=>{ye.current!=null&&cancelAnimationFrame(ye.current),ze.disconnect()}},[]),y.useEffect(()=>{const ce=setInterval(()=>Se(Date.now()),2e3);return()=>clearInterval(ce)},[]);const ve=c.end-c.start,he=p==="horizontal",de=pe+Math.round((1-Uy)*ve),ke=Math.max(e.end,de),Ee=c.end>=pe-500,Ke=he?oe:((Tt=D.current)==null?void 0:Tt.offsetWidth)??400;T.current=c,H.current=e,F.current=ke;const ae=y.useCallback(()=>{const ce=(c.start+c.end)/2,Ue=Math.max(ve/tE,Z5);let ze=Math.round(ce-Ue/2),$e=Math.round(ce+Ue/2);ze=Math.max(e.start,ze),$e=Math.min(ke,$e),!($e-ze<Z5)&&(j({start:ze,end:$e}),t==null||t({start:ze,end:$e}))},[c,ve,e.start,ke,t]),We=y.useCallback(()=>{const ce=(c.start+c.end)/2,Ue=Math.min(ve*tE,lK,ke-e.start);let ze=Math.round(ce-Ue/2),$e=Math.round(ce+Ue/2);ze=Math.max(e.start,ze),$e=Math.min(ke,$e),j({start:ze,end:$e}),t==null||t({start:ze,end:$e})},[c,ve,e.start,ke,t]),bt=y.useCallback(ce=>{if(ce===0)return;let Ue=Math.round(c.start+ce),ze=Math.round(c.end+ce);Ue<e.start?(Ue=e.start,ze=e.start+ve):ze>ke&&(ze=ke,Ue=ke-ve),j({start:Ue,end:ze}),t==null||t({start:Ue,end:ze})},[c.start,c.end,ve,e.start,ke,t]),tt=y.useCallback(()=>{const ce=ke,Ue=Math.max(e.start,ce-ve);j({start:Ue,end:ce}),t==null||t({start:Ue,end:ce})},[ke,e.start,ve,t]),mt=y.useRef(!1),Xe=y.useCallback(()=>{mt.current||(mt.current=!0,requestAnimationFrame(()=>{mt.current=!1;const ce=A.current;if(A.current=0,ce===0)return;const Ue=T.current,ze=Ue.end-Ue.start;let $e=Math.round(Ue.start+ce),ht=Math.round(Ue.end+ce);const vt=H.current.start,Nt=F.current;$e<vt?($e=vt,ht=vt+ze):ht>Nt&&(ht=Nt,$e=Nt-ze),j({start:$e,end:ht}),t==null||t({start:$e,end:ht})}))},[t]),at=y.useCallback(ce=>{if(he){const Ue=ce.deltaX!==0?ce.deltaX:-ce.deltaY;if(Ue===0)return;const ze=Ke>0?ve/Ke:0;A.current+=Ue*ze*1.5,Xe(),ce.preventDefault()}else{const Ue=ce.deltaY;if(Ue===0)return;const ze=Math.max(X-100,jp),$e=ze>0?ve/ze:0;A.current+=-Ue*$e*1.5,Xe(),ce.preventDefault()}},[he,ve,Ke,X,Xe]),ot=y.useRef(at);ot.current=at,y.useEffect(()=>{const ce=B.current;if(!ce)return;const Ue=ze=>ot.current(ze);return ce.addEventListener("wheel",Ue,{passive:!1}),()=>ce.removeEventListener("wheel",Ue)},[he]);const Ct=y.useRef(null),Ot=y.useRef({spanMs:0,containerHeight:0,schedulePanApply:()=>{}});Ot.current={spanMs:ve,containerHeight:X,schedulePanApply:Xe},y.useEffect(()=>{if(he)return;const ce=B.current;if(!ce)return;const Ue=ht=>{ht.touches.length===1&&(Ct.current=ht.touches[0].clientY)},ze=ht=>{if(ht.touches.length!==1||Ct.current==null)return;ht.preventDefault();const vt=ht.touches[0].clientY-Ct.current;Ct.current=ht.touches[0].clientY;const{spanMs:Nt,containerHeight:ln,schedulePanApply:En}=Ot.current,Gr=Math.max(ln-100,jp),ni=Gr>0?Nt/Gr:0;A.current+=vt*ni*1.1,En()},$e=()=>{Ct.current=null};return ce.addEventListener("touchstart",Ue,{passive:!0}),ce.addEventListener("touchmove",ze,{passive:!1}),ce.addEventListener("touchend",$e,{passive:!0}),ce.addEventListener("touchcancel",$e,{passive:!0}),()=>{ce.removeEventListener("touchstart",Ue),ce.removeEventListener("touchmove",ze),ce.removeEventListener("touchend",$e),ce.removeEventListener("touchcancel",$e)}},[he]);const kn=ve*hK,_t=y.useCallback(()=>bt(-kn),[bt,kn]),kt=y.useCallback(()=>bt(kn),[bt,kn]),$=Math.max(ve*mK,nS*2),k=y.useMemo(()=>({start:Math.max(e.start,c.start-$),end:Math.min(ke,c.end+$)}),[e.start,ke,c.start,c.end,$]),z=y.useMemo(()=>{const ce=tK(ve,Ke,rm),Ue=ve/ce,ze=60*1e3,$e=10*60*1e3;return Math.max(ze,Math.min($e,Math.round(Ue/1e3)*1e3))},[ve,Ke]),J=Te(ce=>ce.showTimelineOnlyMotion),le=Te(ce=>ce.setShowTimelineOnlyMotion),xe=y.useMemo(()=>{const ce=nK(n,k,z);return J?ce:ce.filter(ze=>!(ze.classes.length===1&&(ze.classes[0]===nn.Motion||ze.classes[0]==="motion")))},[n,k,z,J]),Ae=y.useMemo(()=>he&&Ke>0?iK(xe,c,Ke,rm,1):xe.map(ce=>({...ce,row:0})),[xe,c,Ke,he]),wt=y.useMemo(()=>b?fK(c):[],[b,c.start,c.end]),Mt=y.useMemo(()=>l.length?l.filter(ce=>ce.timestamp>=k.start&&ce.timestamp<=k.end):[],[l,k.start,k.end]),nt=y.useCallback(ce=>ce?ce.startsWith("http")?ce:`${h}${ce}`:"",[h]),pt=y.useCallback((ce,Ue)=>{const ze=B.current;if(!ze||ve<=0)return c.start;const $e=ze.getBoundingClientRect();if(he){const vt=Math.max(0,Math.min(1,(ce-$e.left)/$e.width));return Math.round(c.start+vt*ve)}const ht=Math.max(0,Math.min(1,(Ue-$e.top)/$e.height));return Math.round(c.end-ht*ve)},[c.start,c.end,ve,he]),Bt=y.useCallback(ce=>{var $e,ht;if(!E)return;const Ue="touches"in ce?($e=ce.touches[0])==null?void 0:$e.clientX:ce.clientX,ze="touches"in ce?(ht=ce.touches[0])==null?void 0:ht.clientY:ce.clientY;Ue==null||ze==null||(ne.current=!0,E(pt(Ue,ze)))},[E,pt]);y.useEffect(()=>{if(!E)return;const ce=ze=>{var vt,Nt;if(!ne.current)return;const $e="touches"in ze?(vt=ze.touches[0])==null?void 0:vt.clientX:ze.clientX,ht="touches"in ze?(Nt=ze.touches[0])==null?void 0:Nt.clientY:ze.clientY;$e!=null&&ht!=null&&E(pt($e,ht))},Ue=()=>{const ze=ne.current;ne.current=!1,ze&&M&&M()};return document.addEventListener("mousemove",ce),document.addEventListener("mouseup",Ue),document.addEventListener("touchmove",ce,{passive:!0}),document.addEventListener("touchend",Ue),document.addEventListener("touchcancel",Ue),()=>{document.removeEventListener("mousemove",ce),document.removeEventListener("mouseup",Ue),document.removeEventListener("touchmove",ce),document.removeEventListener("touchend",Ue),document.removeEventListener("touchcancel",Ue)}},[E,pt,M]);const gr=y.useCallback(ce=>{const Ue=s==null?void 0:s(ce),ze=a==null?void 0:a(ce);ee({cluster:ce,videoclipUrl:Ue==null?void 0:Ue.url,videoclipId:Ue==null?void 0:Ue.id,ruleArtifacts:ze}),se(!0)},[s,a]),Lr=f.jsxs("div",{className:"h-2 w-full min-w-0 rounded-full overflow-hidden relative shrink-0 isolate",style:{contain:"layout paint"},children:[f.jsx("div",{className:"absolute inset-0 rounded-full bg-muted","aria-hidden":!0}),r.map((ce,Ue)=>{const{leftPct:ze,widthPct:$e}=I2(ce.start,ce.end,c);if(ze+$e<=0||ze>=100)return null;const ht=Math.max(0,ze),vt=ze<0?Math.min(100,ze+$e):Math.min(100-ze,$e);if(vt<=0)return null;const Nt=`${Math.round(ht*100)/100}%`,ln=`${Math.round(vt*100)/100}%`;return f.jsx("div",{className:"absolute inset-y-0 rounded-full bg-primary/30",style:{left:Nt,width:ln,backfaceVisibility:"hidden"}},`${ce.start}-${ce.end}-${Ue}`)})]}),wr=Mt.length>0?f.jsx("div",{className:"h-1.5 w-full min-w-0 relative shrink-0 flex items-center",style:{contain:"layout paint"},"aria-hidden":!0,children:Mt.map((ce,Ue)=>{const ze=ve>0?(ce.timestamp-c.start)/ve*100:0,$e=Math.max(0,Math.min(100,ze));return f.jsx("div",{className:"absolute w-1.5 h-1.5 rounded-full bg-amber-500 shadow-sm -translate-x-1/2",style:{left:`${$e}%`},title:ce.ruleName},`${ce.ruleName}-${ce.timestamp}-${Ue}`)})}):null,ft=y.useCallback(ce=>ve<=0?0:(c.end-ce)/ve*100,[c.end,ve]),jt=ce=>{const Ue=ce.events.length>0?ce.events.map(ze=>ze.thumbnailUrl).filter(Boolean):[ce.representative.thumbnailUrl];return Ue.length>0?Ue:[ce.representative.thumbnailUrl]},qt=(ce,Ue=V2)=>{const ze=jt(ce),$e=Ce===ce.startMs,ht=$e?Math.min(K,ze.length-1):0,vt=ze.length>1,Nt=Math.round(Ue*(nE/V2));return f.jsxs("div",{className:"relative overflow-visible flex items-center justify-center gap-0",style:{width:Ue,minWidth:Ue},onMouseEnter:()=>{te(ce.startMs),Z(0)},onMouseLeave:()=>{te(null)},children:[$e&&vt&&f.jsx("button",{type:"button",className:"absolute -left-8 top-1/2 -translate-y-1/2 z-[60] h-8 w-8 flex items-center justify-center text-foreground/80 hover:text-foreground hover:bg-muted/50 rounded-full transition-colors",onClick:ln=>{ln.stopPropagation(),Z(En=>En<=0?ze.length-1:En-1)},"aria-label":"Previous image",children:f.jsx(Zd,{className:"size-5"})}),f.jsxs("button",{type:"button",onClick:()=>gr(ce),className:"flex flex-col items-stretch rounded-lg border bg-card hover:bg-accent/50 overflow-hidden transition-all duration-200 text-left shrink-0 origin-center",style:{width:Ue,minWidth:Ue,transform:$e?"scale(1.5)":void 0,zIndex:$e?50:void 0},children:[$e&&f.jsxs("div",{className:"flex items-center justify-between gap-1 px-1 py-0.5 rounded-t bg-black/60 text-white flex-shrink-0",children:[f.jsx(tS,{eventSource:(ce.events[ht]??ce.representative).source,small:!0}),ze.length>0&&f.jsxs("span",{className:"text-[8px] font-medium leading-none tabular-nums",children:[ht+1,"/",ze.length]})]}),f.jsx("div",{className:"bg-muted flex items-center justify-center flex-shrink-0 relative",style:{width:Ue,height:Ue},children:f.jsx("img",{src:nt(ze[ht]??ce.representative.thumbnailUrl),alt:"",className:"w-full h-full object-cover"})}),f.jsx("div",{className:"flex flex-wrap gap-0.5 justify-center items-center p-1 bg-muted/80 border-t text-foreground",style:{minHeight:Nt},children:ce.classes.filter(ln=>ln!=="motion").map(ln=>f.jsx(yu,{small:!0,detectionClass:ln,className:"text-foreground shrink-0"},ln))})]}),$e&&vt&&f.jsx("button",{type:"button",className:"absolute -right-8 top-1/2 -translate-y-1/2 z-[60] h-8 w-8 flex items-center justify-center text-foreground/80 hover:text-foreground hover:bg-muted/50 rounded-full transition-colors",onClick:ln=>{ln.stopPropagation(),Z(En=>En>=ze.length-1?0:En+1)},"aria-label":"Next image",children:f.jsx(Jd,{className:"size-5"})})]})},Pt=ve>0&&pe>=c.start&&pe<=c.end,Wt=Pt?(pe-c.start)/ve*100:0,Me=Pt?(c.end-pe)/ve*100:0,gt=ve<=30*60*1e3?5*60*1e3:ve<=60*60*1e3?10*60*1e3:15*60*1e3,Jt=y.useMemo(()=>{const ce=[],Ue=Math.ceil(c.start/gt)*gt;for(let ze=Ue;ze<c.end;ze+=gt)ce.push(ze);return ce},[c.start,c.end,gt]);if(he){const ce=Math.min(vK,Math.max(gK,Math.round((X-yK)*pK))),Ue=Math.round(ce*(nE/V2)),ze=ce+Ue+4;return f.jsxs("div",{ref:D,className:`flex flex-col w-full h-full min-h-0 ${m??""}`,children:[f.jsxs("div",{ref:B,className:He("relative flex flex-col flex-1 min-h-0 w-full overflow-hidden",E&&"cursor-grab active:cursor-grabbing"),role:"slider","aria-label":"Timeline: scroll to move time range",onMouseDown:E?Bt:void 0,onTouchStart:E?Bt:void 0,children:[f.jsx("div",{className:"relative w-full h-5 shrink-0 mb-0.5",children:Jt.map($e=>f.jsx("span",{className:"absolute text-[10px] text-muted-foreground -translate-x-1/2 whitespace-nowrap",style:{left:`${($e-c.start)/ve*100}%`},children:br($e,"HH:mm")},$e))}),f.jsx(Qe,{variant:J?"default":"outline",size:"icon",className:He("absolute top-0 right-0 z-50 h-7 w-7 shadow-sm",J?"bg-primary text-primary-foreground":"bg-background/90 hover:bg-background"),onClick:()=>le(!J),"aria-label":J?"Show all events":"Only motion","aria-pressed":J,children:f.jsx(cw,{className:"size-4"})}),Pt&&f.jsxs("div",{className:"absolute top-0 bottom-0 w-0 pointer-events-none flex flex-col items-center z-[50]",style:{left:`${Wt}%`,transform:"translateX(-50%)"},"aria-hidden":!0,children:[f.jsx("span",{className:"absolute top-0 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-400/90 text-white whitespace-nowrap border border-red-400/80",children:"now"}),f.jsx("div",{className:"absolute top-6 left-1/2 -translate-x-1/2 bottom-0 bg-red-400/80",style:{width:2,minWidth:2}})]}),w!=null&&w>=c.start&&w<=c.end&&f.jsxs("div",{className:"absolute top-0 bottom-0 w-0 pointer-events-none flex flex-col items-center z-[55]",style:{left:`${(w-c.start)/ve*100}%`,transform:"translateX(-50%)"},"aria-hidden":!0,children:[f.jsx("span",{className:"absolute top-0 left-1/2 -translate-x-1/2 px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary text-primary-foreground whitespace-nowrap border border-primary/80",children:br(w,"HH:mm:ss")}),f.jsx("div",{className:"absolute top-6 left-1/2 -translate-x-1/2 bottom-0 bg-primary",style:{width:2,minWidth:2}})]}),Lr,wr,f.jsx("div",{className:"relative w-full mt-1 overflow-visible flex-shrink-0",style:{height:ze},children:b?wt.map(($e,ht)=>{const{leftPct:vt,widthPct:Nt}=I2($e.startMs,$e.endMs,c),ln=$e.row*ze;return f.jsx("div",{className:"absolute flex flex-col items-center overflow-visible",style:{left:`${vt}%`,width:`${Math.max(Nt,3)}%`,minWidth:rm,maxWidth:"100%",top:ln},children:f.jsxs("div",{className:"flex flex-col rounded-lg border border-muted overflow-hidden shrink-0",style:{width:ce,minWidth:ce},children:[f.jsx(Ts,{className:"shrink-0",style:{width:ce,height:ce}}),f.jsx(Ts,{className:"h-5 w-full"})]})},`dummy-h-${ht}-${$e.startMs}`)}):Ae.map($e=>{const{leftPct:ht,widthPct:vt}=I2($e.startMs,$e.endMs,c),Nt=$e.row*ze;return f.jsx("div",{className:"absolute flex flex-col items-center overflow-visible",style:{left:`${ht}%`,width:`${Math.max(vt,3)}%`,minWidth:rm,maxWidth:"100%",top:Nt},children:qt($e,ce)},$e.startMs)})}),f.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 z-40 pointer-events-none flex items-center",children:f.jsx(Qe,{variant:"outline",size:"icon",className:"pointer-events-auto h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:_t,"aria-label":"Back (20%)",children:f.jsx(Zd,{className:"size-4"})})}),!Ee&&f.jsxs("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 z-40 pointer-events-none flex items-center gap-1",children:[f.jsx(Qe,{variant:"outline",size:"icon",className:"pointer-events-auto h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:kt,"aria-label":"Forward (20%)",children:f.jsx(Jd,{className:"size-4"})}),f.jsx(Qe,{variant:"outline",size:"icon",className:"pointer-events-auto h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:tt,"aria-label":"Go to now",children:f.jsx(hj,{className:"size-4"})})]}),f.jsxs("div",{className:"absolute bottom-0 right-0 z-40 flex items-center gap-1.5 p-1.5 pointer-events-auto",children:[f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:ae,"aria-label":"Zoom in",children:f.jsx(uw,{className:"size-4"})}),f.jsxs("span",{className:"text-xs text-muted-foreground px-1 min-w-[4rem] text-center",children:[Math.round(ve/6e4)," min"]}),f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:We,"aria-label":"Zoom out",children:f.jsx(dw,{className:"size-4"})})]})]}),f.jsx(K5,{open:G,onOpenChange:se,payload:V,getThumbnailUrl:nt,assetsBaseUrl:h})]})}const St=Math.max(X,jp),{verticalClusterWidthPx:dt,verticalClusterHeightPx:en,verticalClustersWithRows:bn,verticalSlotHeightPx:rt}=y.useMemo(()=>{const ce=xK,Ue=Math.round(ce*(16/9)),ze=2*ce,$e=rK(xe,ve,St,ze,z);return{verticalClusterWidthPx:Ue,verticalClusterHeightPx:ce,verticalClustersWithRows:$e,verticalSlotHeightPx:ze}},[St,ve,xe,z]);return f.jsxs("div",{ref:D,className:`flex flex-col w-full h-full min-h-0 ${m??""}`,children:[f.jsxs("div",{className:"flex flex-1 min-h-0 min-w-0",children:[f.jsxs("div",{className:"shrink-0 flex flex-col items-center py-2 w-12 gap-1",style:{minHeight:jp},children:[f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:_t,"aria-label":"Back (20%)",children:f.jsx(pu,{className:"size-4"})}),!Ee&&f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:tt,"aria-label":"Go to now",children:f.jsx(YA,{className:"size-4"})}),f.jsx("div",{className:"flex-1 min-h-2"}),f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8 shadow-md bg-background/90 hover:bg-background",onClick:kt,"aria-label":"Forward (20%)",children:f.jsx(wo,{className:"size-4"})})]}),f.jsxs("div",{ref:B,className:He("relative flex-1 min-h-0 flex flex-row gap-0 overflow-hidden touch-none",E&&"cursor-grab active:cursor-grabbing"),style:{minHeight:jp},role:"slider","aria-label":"Timeline: scroll to move time range",onMouseDown:E?Bt:void 0,onTouchStart:E?Bt:void 0,children:[f.jsx(Qe,{variant:J?"default":"outline",size:"icon",className:He("absolute top-2 right-2 z-50 h-7 w-7 shadow-sm",J?"bg-primary text-primary-foreground":"bg-background/90 hover:bg-background"),onClick:()=>le(!J),"aria-label":J?"Show all events":"Only motion","aria-pressed":J,children:f.jsx(cw,{className:"size-4"})}),f.jsx("div",{className:"relative shrink-0 w-12 text-[10px] text-muted-foreground",style:{height:St},children:Jt.map(ce=>f.jsx("span",{className:"absolute right-1 -translate-y-1/2 whitespace-nowrap",style:{top:`${(c.end-ce)/ve*100}%`},children:br(ce,"HH:mm")},ce))}),Pt&&f.jsxs("div",{className:"absolute left-0 right-0 h-0 pointer-events-none flex items-center z-[50]",style:{top:`${Me}%`,transform:"translateY(-50%)"},"aria-hidden":!0,children:[f.jsx("span",{className:"absolute left-12 top-1/2 -translate-y-1/2 px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-400/90 text-white whitespace-nowrap border border-red-400/80",children:"now"}),f.jsx("div",{className:"absolute left-24 right-0 top-1/2 -translate-y-1/2 bg-red-400/80",style:{height:2,minHeight:2,marginTop:-1}})]}),w!=null&&w>=c.start&&w<=c.end&&f.jsxs("div",{className:"absolute left-0 right-0 h-0 pointer-events-none flex items-center z-[55]",style:{top:`${ft(w)}%`,transform:"translateY(-50%)"},"aria-hidden":!0,children:[f.jsx("span",{className:"absolute left-12 top-1/2 -translate-y-1/2 px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary text-primary-foreground whitespace-nowrap border border-primary/80",children:br(w,"HH:mm:ss")}),f.jsx("div",{className:"absolute left-24 right-0 top-1/2 -translate-y-1/2 bg-primary",style:{height:2,minHeight:2,marginTop:-1}})]}),f.jsxs("div",{className:"relative shrink-0 w-3 rounded-sm overflow-hidden isolate",style:{height:St,contain:"layout paint"},children:[f.jsx("div",{className:"absolute inset-0 rounded-sm bg-muted","aria-hidden":!0}),r.map((ce,Ue)=>{const ze=ft(ce.end),$e=(ce.end-ce.start)/ve*100;return $e<=0?null:f.jsx("div",{className:"absolute left-0 right-0 rounded-sm bg-primary/60",style:{top:`${ze}%`,height:`${$e}%`,backfaceVisibility:"hidden"}},`${ce.start}-${ce.end}-${Ue}`)}),x!=null&&x>=c.start&&x<=c.end&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"absolute left-0 right-0 h-0.5 bg-red-500 z-10 -translate-y-1/2",style:{top:`${ft(x)}%`}}),f.jsx("div",{className:"absolute -left-10 top-1/2 -translate-y-1/2 z-20 px-1.5 py-0.5 rounded text-[10px] font-medium bg-red-500 text-white whitespace-nowrap",style:{top:`${ft(x)}%`},children:"LIVE"})]}),Mt.map((ce,Ue)=>{const ze=ft(ce.timestamp),$e=Math.max(0,Math.min(100,ze));return f.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full bg-amber-500 shadow-sm z-10 -translate-y-1/2",style:{top:`${$e}%`},title:ce.ruleName,"aria-hidden":!0},`v-${ce.ruleName}-${ce.timestamp}-${Ue}`)})]}),f.jsx("div",{className:"relative flex-1 min-w-0 pl-2",style:{height:St,minHeight:St},children:b?wt.map((ce,Ue)=>{const $e=ft(ce.startMs)/100*St+ce.row*rt;return f.jsxs("div",{className:"absolute left-0 right-0 flex items-center gap-2 -translate-y-1/2",style:{top:$e},children:[f.jsx("div",{className:"w-px h-4 bg-border shrink-0","aria-hidden":!0}),f.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-muted overflow-hidden shrink-0",style:{width:dt,minWidth:dt},children:[f.jsx(Ts,{className:"shrink-0",style:{width:dt,height:en}}),f.jsx(Ts,{className:"h-3 w-10 rounded"})]})]},`dummy-v-${Ue}-${ce.startMs}`)}):bn.map(ce=>{const ze=ft(ce.startMs)/100*St+ce.row*rt;return f.jsxs("div",{className:"absolute left-0 right-0 flex items-center gap-2 -translate-y-1/2",style:{top:ze},children:[f.jsx("div",{className:"w-px h-4 bg-border shrink-0","aria-hidden":!0}),f.jsxs("button",{type:"button",onClick:()=>gr(ce),className:"flex items-center gap-2 rounded-lg border bg-card hover:bg-accent/50 overflow-hidden transition-colors text-left shrink-0",style:{width:dt,minWidth:dt},children:[f.jsxs("div",{className:"shrink-0 bg-muted relative flex items-center justify-center aspect-video",style:{width:dt,height:en},children:[f.jsx("img",{src:nt(ce.representative.thumbnailUrl),alt:"",className:"w-full h-full object-cover"}),f.jsx("div",{className:"absolute bottom-0 left-0 right-0 flex flex-wrap gap-0.5 p-0.5 bg-black/50",children:ce.classes.filter($e=>$e!=="motion").map($e=>f.jsx(yu,{small:!0,detectionClass:$e,className:"text-white shrink-0"},$e))})]}),f.jsx("span",{className:"text-[10px] text-muted-foreground truncate pr-1",children:br(ce.startMs,"HH:mm")})]})]},ce.startMs)})}),f.jsxs("div",{className:"absolute bottom-0 right-0 z-40 flex items-center gap-1.5 p-2 pointer-events-auto",children:[f.jsx(Qe,{variant:"outline",size:"icon",onClick:ae,"aria-label":"Zoom in",children:f.jsx(uw,{className:"size-4"})}),f.jsx(Qe,{variant:"outline",size:"icon",onClick:We,"aria-label":"Zoom out",children:f.jsx(dw,{className:"size-4"})}),f.jsxs("span",{className:"text-xs text-muted-foreground px-1 min-w-[3rem] text-center",children:[Math.round(ve/6e4)," min"]})]})]})]}),f.jsx(K5,{open:G,onOpenChange:se,payload:V,getThumbnailUrl:nt,assetsBaseUrl:h})]})}var Zt=function(){return Zt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Zt.apply(this,arguments)};function LK(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function H7(e,t,n){for(var r=0,s=t.length,a;r<s;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Zg(e){return e.mode==="multiple"}function Jg(e){return e.mode==="range"}function zb(e){return e.mode==="single"}var wK={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function SK(e,t){return br(e,"LLLL y",t)}function CK(e,t){return br(e,"d",t)}function EK(e,t){return br(e,"LLLL",t)}function RK(e){return"".concat(e)}function _K(e,t){return br(e,"cccccc",t)}function MK(e,t){return br(e,"yyyy",t)}var NK=Object.freeze({__proto__:null,formatCaption:SK,formatDay:CK,formatMonthCaption:EK,formatWeekNumber:RK,formatWeekdayName:_K,formatYearCaption:MK}),OK=function(e,t,n){return br(e,"do MMMM (EEEE)",n)},TK=function(){return"Month: "},DK=function(){return"Go to next month"},AK=function(){return"Go to previous month"},jK=function(e,t){return br(e,"cccc",t)},kK=function(e){return"Week n. ".concat(e)},PK=function(){return"Year: "},zK=Object.freeze({__proto__:null,labelDay:OK,labelMonthDropdown:TK,labelNext:DK,labelPrevious:AK,labelWeekNumber:kK,labelWeekday:jK,labelYearDropdown:PK});function BK(){var e="buttons",t=wK,n=$4,r={},s={},a=1,l={},h=new Date;return{captionLayout:e,classNames:t,formatters:NK,labels:zK,locale:n,modifiersClassNames:r,modifiers:s,numberOfMonths:a,styles:l,today:h,mode:"default"}}function UK(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,s=e.toMonth,a=e.fromDate,l=e.toDate;return r?a=js(r):t&&(a=new Date(t,0,1)),s?l=H4(s):n&&(l=new Date(n,11,31)),{fromDate:a?Ii(a):void 0,toDate:l?Ii(l):void 0}}var I7=y.createContext(void 0);function FK(e){var t,n=e.initialProps,r=BK(),s=UK(n),a=s.fromDate,l=s.toDate,h=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;h!=="buttons"&&(!a||!l)&&(h="buttons");var m;(zb(n)||Zg(n)||Jg(n))&&(m=n.onSelect);var p=Zt(Zt(Zt({},r),n),{captionLayout:h,classNames:Zt(Zt({},r.classNames),n.classNames),components:Zt({},n.components),formatters:Zt(Zt({},r.formatters),n.formatters),fromDate:a,labels:Zt(Zt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Zt(Zt({},r.modifiers),n.modifiers),modifiersClassNames:Zt(Zt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:m,styles:Zt(Zt({},r.styles),n.styles),toDate:l});return f.jsx(I7.Provider,{value:p,children:e.children})}function pr(){var e=y.useContext(I7);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function $7(e){var t=pr(),n=t.locale,r=t.classNames,s=t.styles,a=t.formatters.formatCaption;return f.jsx("div",{className:r.caption_label,style:s.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function HK(e){return f.jsx("svg",Zt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:f.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function V7(e){var t,n,r=e.onChange,s=e.value,a=e.children,l=e.caption,h=e.className,m=e.style,p=pr(),x=(n=(t=p.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:HK;return f.jsxs("div",{className:h,style:m,children:[f.jsx("span",{className:p.classNames.vhidden,children:e["aria-label"]}),f.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:p.classNames.dropdown,style:p.styles.dropdown,value:s,onChange:r,children:a}),f.jsxs("div",{className:p.classNames.caption_label,style:p.styles.caption_label,"aria-hidden":"true",children:[l,f.jsx(x,{className:p.classNames.dropdown_icon,style:p.styles.dropdown_icon})]})]})}function IK(e){var t,n=pr(),r=n.fromDate,s=n.toDate,a=n.styles,l=n.locale,h=n.formatters.formatMonthCaption,m=n.classNames,p=n.components,x=n.labels.labelMonthDropdown;if(!r)return f.jsx(f.Fragment,{});if(!s)return f.jsx(f.Fragment,{});var b=[];if(LG(r,s))for(var w=js(r),E=r.getMonth();E<=s.getMonth();E++)b.push(k2(w,E));else for(var w=js(new Date),E=0;E<=11;E++)b.push(k2(w,E));var M=function(S){var _=Number(S.target.value),N=k2(js(e.displayMonth),_);e.onChange(N)},C=(t=p==null?void 0:p.Dropdown)!==null&&t!==void 0?t:V7;return f.jsx(C,{name:"months","aria-label":x(),className:m.dropdown_month,style:a.dropdown_month,onChange:M,value:e.displayMonth.getMonth(),caption:h(e.displayMonth,{locale:l}),children:b.map(function(S){return f.jsx("option",{value:S.getMonth(),children:h(S,{locale:l})},S.getMonth())})})}function $K(e){var t,n=e.displayMonth,r=pr(),s=r.fromDate,a=r.toDate,l=r.locale,h=r.styles,m=r.classNames,p=r.components,x=r.formatters.formatYearCaption,b=r.labels.labelYearDropdown,w=[];if(!s)return f.jsx(f.Fragment,{});if(!a)return f.jsx(f.Fragment,{});for(var E=s.getFullYear(),M=a.getFullYear(),C=E;C<=M;C++)w.push(A5(Z6(new Date),C));var S=function(N){var c=A5(js(n),Number(N.target.value));e.onChange(c)},_=(t=p==null?void 0:p.Dropdown)!==null&&t!==void 0?t:V7;return f.jsx(_,{name:"years","aria-label":b(),className:m.dropdown_year,style:h.dropdown_year,onChange:S,value:n.getFullYear(),caption:x(n,{locale:l}),children:w.map(function(N){return f.jsx("option",{value:N.getFullYear(),children:x(N,{locale:l})},N.getFullYear())})})}function VK(e,t){var n=y.useState(e),r=n[0],s=n[1],a=t===void 0?r:t;return[a,s]}function qK(e){var t=e.month,n=e.defaultMonth,r=e.today,s=t||n||r||new Date,a=e.toDate,l=e.fromDate,h=e.numberOfMonths,m=h===void 0?1:h;if(a&&xg(a,s)<0){var p=-1*(m-1);s=da(a,p)}return l&&xg(s,l)<0&&(s=l),js(s)}function WK(){var e=pr(),t=qK(e),n=VK(t,e.month),r=n[0],s=n[1],a=function(l){var h;if(!e.disableNavigation){var m=js(l);s(m),(h=e.onMonthChange)===null||h===void 0||h.call(e,m)}};return[r,a]}function GK(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,s=js(e),a=js(da(s,r)),l=xg(a,s),h=[],m=0;m<l;m++){var p=da(s,m);h.push(p)}return n&&(h=h.reverse()),h}function YK(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,l=r?a:1,h=js(e);if(!n)return da(h,l);var m=xg(n,e);if(!(m<a))return da(h,l)}}function XK(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,s=t.numberOfMonths,a=s===void 0?1:s,l=r?a:1,h=js(e);if(!n)return da(h,-l);var m=xg(h,n);if(!(m<=0))return da(h,-l)}}var q7=y.createContext(void 0);function KK(e){var t=pr(),n=WK(),r=n[0],s=n[1],a=GK(r,t),l=YK(r,t),h=XK(r,t),m=function(b){return a.some(function(w){return V4(b,w)})},p=function(b,w){m(b)||(w&&s7(b,w)?s(da(b,1+t.numberOfMonths*-1)):s(b))},x={currentMonth:r,displayMonths:a,goToMonth:s,goToDate:p,previousMonth:h,nextMonth:l,isDateDisplayed:m};return f.jsx(q7.Provider,{value:x,children:e.children})}function e0(){var e=y.useContext(q7);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function rE(e){var t,n=pr(),r=n.classNames,s=n.styles,a=n.components,l=e0().goToMonth,h=function(x){l(da(x,e.displayIndex?-e.displayIndex:0))},m=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:$7,p=f.jsx(m,{id:e.id,displayMonth:e.displayMonth});return f.jsxs("div",{className:r.caption_dropdowns,style:s.caption_dropdowns,children:[f.jsx("div",{className:r.vhidden,children:p}),f.jsx(IK,{onChange:h,displayMonth:e.displayMonth}),f.jsx($K,{onChange:h,displayMonth:e.displayMonth})]})}function QK(e){return f.jsx("svg",Zt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:f.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function ZK(e){return f.jsx("svg",Zt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:f.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Ox=y.forwardRef(function(e,t){var n=pr(),r=n.classNames,s=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var l=a.join(" "),h=Zt(Zt({},s.button_reset),s.button);return e.style&&Object.assign(h,e.style),f.jsx("button",Zt({},e,{ref:t,type:"button",className:l,style:h}))});function JK(e){var t,n,r=pr(),s=r.dir,a=r.locale,l=r.classNames,h=r.styles,m=r.labels,p=m.labelPrevious,x=m.labelNext,b=r.components;if(!e.nextMonth&&!e.previousMonth)return f.jsx(f.Fragment,{});var w=p(e.previousMonth,{locale:a}),E=[l.nav_button,l.nav_button_previous].join(" "),M=x(e.nextMonth,{locale:a}),C=[l.nav_button,l.nav_button_next].join(" "),S=(t=b==null?void 0:b.IconRight)!==null&&t!==void 0?t:ZK,_=(n=b==null?void 0:b.IconLeft)!==null&&n!==void 0?n:QK;return f.jsxs("div",{className:l.nav,style:h.nav,children:[!e.hidePrevious&&f.jsx(Ox,{name:"previous-month","aria-label":w,className:E,style:h.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:s==="rtl"?f.jsx(S,{className:l.nav_icon,style:h.nav_icon}):f.jsx(_,{className:l.nav_icon,style:h.nav_icon})}),!e.hideNext&&f.jsx(Ox,{name:"next-month","aria-label":M,className:C,style:h.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:s==="rtl"?f.jsx(_,{className:l.nav_icon,style:h.nav_icon}):f.jsx(S,{className:l.nav_icon,style:h.nav_icon})})]})}function iE(e){var t=pr().numberOfMonths,n=e0(),r=n.previousMonth,s=n.nextMonth,a=n.goToMonth,l=n.displayMonths,h=l.findIndex(function(M){return V4(e.displayMonth,M)}),m=h===0,p=h===l.length-1,x=t>1&&(m||!p),b=t>1&&(p||!m),w=function(){r&&a(r)},E=function(){s&&a(s)};return f.jsx(JK,{displayMonth:e.displayMonth,hideNext:x,hidePrevious:b,nextMonth:s,previousMonth:r,onPreviousClick:w,onNextClick:E})}function eQ(e){var t,n=pr(),r=n.classNames,s=n.disableNavigation,a=n.styles,l=n.captionLayout,h=n.components,m=(t=h==null?void 0:h.CaptionLabel)!==null&&t!==void 0?t:$7,p;return s?p=f.jsx(m,{id:e.id,displayMonth:e.displayMonth}):l==="dropdown"?p=f.jsx(rE,{displayMonth:e.displayMonth,id:e.id}):l==="dropdown-buttons"?p=f.jsxs(f.Fragment,{children:[f.jsx(rE,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),f.jsx(iE,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):p=f.jsxs(f.Fragment,{children:[f.jsx(m,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),f.jsx(iE,{displayMonth:e.displayMonth,id:e.id})]}),f.jsx("div",{className:r.caption,style:a.caption,children:p})}function tQ(e){var t=pr(),n=t.footer,r=t.styles,s=t.classNames.tfoot;return n?f.jsx("tfoot",{className:s,style:r.tfoot,children:f.jsx("tr",{children:f.jsx("td",{colSpan:8,children:n})})}):f.jsx(f.Fragment,{})}function nQ(e,t,n){for(var r=n?lf(new Date):No(new Date,{locale:e,weekStartsOn:t}),s=[],a=0;a<7;a++){var l=Hi(r,a);s.push(l)}return s}function rQ(){var e=pr(),t=e.classNames,n=e.styles,r=e.showWeekNumber,s=e.locale,a=e.weekStartsOn,l=e.ISOWeek,h=e.formatters.formatWeekdayName,m=e.labels.labelWeekday,p=nQ(s,a,l);return f.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&f.jsx("td",{style:n.head_cell,className:t.head_cell}),p.map(function(x,b){return f.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":m(x,{locale:s}),children:h(x,{locale:s})},b)})]})}function iQ(){var e,t=pr(),n=t.classNames,r=t.styles,s=t.components,a=(e=s==null?void 0:s.HeadRow)!==null&&e!==void 0?e:rQ;return f.jsx("thead",{style:r.head,className:n.head,children:f.jsx(a,{})})}function sQ(e){var t=pr(),n=t.locale,r=t.formatters.formatDay;return f.jsx(f.Fragment,{children:r(e.date,{locale:n})})}var rS=y.createContext(void 0);function oQ(e){if(!Zg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return f.jsx(rS.Provider,{value:t,children:e.children})}return f.jsx(aQ,{initialProps:e.initialProps,children:e.children})}function aQ(e){var t=e.initialProps,n=e.children,r=t.selected,s=t.min,a=t.max,l=function(p,x,b){var w,E;(w=t.onDayClick)===null||w===void 0||w.call(t,p,x,b);var M=!!(x.selected&&s&&(r==null?void 0:r.length)===s);if(!M){var C=!!(!x.selected&&a&&(r==null?void 0:r.length)===a);if(!C){var S=r?H7([],r):[];if(x.selected){var _=S.findIndex(function(N){return ls(p,N)});S.splice(_,1)}else S.push(p);(E=t.onSelect)===null||E===void 0||E.call(t,S,p,x,b)}}},h={disabled:[]};r&&h.disabled.push(function(p){var x=a&&r.length>a-1,b=r.some(function(w){return ls(w,p)});return!!(x&&!b)});var m={selected:r,onDayClick:l,modifiers:h};return f.jsx(rS.Provider,{value:m,children:n})}function iS(){var e=y.useContext(rS);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function lQ(e,t){var n=t||{},r=n.from,s=n.to;return r&&s?ls(s,e)&&ls(r,e)?void 0:ls(s,e)?{from:s,to:void 0}:ls(r,e)?void 0:Ww(r,e)?{from:e,to:s}:{from:r,to:e}:s?Ww(e,s)?{from:s,to:e}:{from:e,to:s}:r?s7(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var sS=y.createContext(void 0);function cQ(e){if(!Jg(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return f.jsx(sS.Provider,{value:t,children:e.children})}return f.jsx(uQ,{initialProps:e.initialProps,children:e.children})}function uQ(e){var t=e.initialProps,n=e.children,r=t.selected,s=r||{},a=s.from,l=s.to,h=t.min,m=t.max,p=function(E,M,C){var S,_;(S=t.onDayClick)===null||S===void 0||S.call(t,E,M,C);var N=lQ(E,r);(_=t.onSelect)===null||_===void 0||_.call(t,N,E,M,C)},x={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(x.range_start=[a],l?(x.range_end=[l],ls(a,l)||(x.range_middle=[{after:a,before:l}])):x.range_end=[a]):l&&(x.range_start=[l],x.range_end=[l]),h&&(a&&!l&&x.disabled.push({after:sx(a,h-1),before:Hi(a,h-1)}),a&&l&&x.disabled.push({after:a,before:Hi(a,h-1)}),!a&&l&&x.disabled.push({after:sx(l,h-1),before:Hi(l,h-1)})),m){if(a&&!l&&(x.disabled.push({before:Hi(a,-m+1)}),x.disabled.push({after:Hi(a,m-1)})),a&&l){var b=al(l,a)+1,w=m-b;x.disabled.push({before:sx(a,w)}),x.disabled.push({after:Hi(l,w)})}!a&&l&&(x.disabled.push({before:Hi(l,-m+1)}),x.disabled.push({after:Hi(l,m-1)}))}return f.jsx(sS.Provider,{value:{selected:r,onDayClick:p,modifiers:x},children:n})}function oS(){var e=y.useContext(sS);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function lx(e){return Array.isArray(e)?H7([],e):e!==void 0?[e]:[]}function dQ(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],s=n[1];t[r]=lx(s)}),t}var ha;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(ha||(ha={}));var fQ=ha.Selected,ql=ha.Disabled,hQ=ha.Hidden,mQ=ha.Today,q2=ha.RangeEnd,W2=ha.RangeMiddle,G2=ha.RangeStart,pQ=ha.Outside;function gQ(e,t,n){var r,s=(r={},r[fQ]=lx(e.selected),r[ql]=lx(e.disabled),r[hQ]=lx(e.hidden),r[mQ]=[e.today],r[q2]=[],r[W2]=[],r[G2]=[],r[pQ]=[],r);return e.fromDate&&s[ql].push({before:e.fromDate}),e.toDate&&s[ql].push({after:e.toDate}),Zg(e)?s[ql]=s[ql].concat(t.modifiers[ql]):Jg(e)&&(s[ql]=s[ql].concat(n.modifiers[ql]),s[G2]=n.modifiers[G2],s[W2]=n.modifiers[W2],s[q2]=n.modifiers[q2]),s}var W7=y.createContext(void 0);function vQ(e){var t=pr(),n=iS(),r=oS(),s=gQ(t,n,r),a=dQ(t.modifiers),l=Zt(Zt({},s),a);return f.jsx(W7.Provider,{value:l,children:e.children})}function G7(){var e=y.useContext(W7);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function yQ(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function xQ(e){return!!(e&&typeof e=="object"&&"from"in e)}function bQ(e){return!!(e&&typeof e=="object"&&"after"in e)}function LQ(e){return!!(e&&typeof e=="object"&&"before"in e)}function wQ(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function SQ(e,t){var n,r=t.from,s=t.to;if(r&&s){var a=al(s,r)<0;a&&(n=[s,r],r=n[0],s=n[1]);var l=al(e,r)>=0&&al(s,e)>=0;return l}return s?ls(s,e):r?ls(r,e):!1}function CQ(e){return F4(e)}function EQ(e){return Array.isArray(e)&&e.every(F4)}function RQ(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(CQ(n))return ls(e,n);if(EQ(n))return n.includes(e);if(xQ(n))return SQ(e,n);if(wQ(n))return n.dayOfWeek.includes(e.getDay());if(yQ(n)){var r=al(n.before,e),s=al(n.after,e),a=r>0,l=s<0,h=Ww(n.before,n.after);return h?l&&a:a||l}return bQ(n)?al(e,n.after)>0:LQ(n)?al(n.before,e)>0:typeof n=="function"?n(e):!1})}function aS(e,t,n){var r=Object.keys(t).reduce(function(a,l){var h=t[l];return RQ(e,h)&&a.push(l),a},[]),s={};return r.forEach(function(a){return s[a]=!0}),n&&!V4(e,n)&&(s.outside=!0),s}function _Q(e,t){for(var n=js(e[0]),r=H4(e[e.length-1]),s,a,l=n;l<=r;){var h=aS(l,t),m=!h.disabled&&!h.hidden;if(!m){l=Hi(l,1);continue}if(h.selected)return l;h.today&&!a&&(a=l),s||(s=l),l=Hi(l,1)}return a||s}var MQ=365;function Y7(e,t){var n=t.moveBy,r=t.direction,s=t.context,a=t.modifiers,l=t.retry,h=l===void 0?{count:0,lastFocused:e}:l,m=s.weekStartsOn,p=s.fromDate,x=s.toDate,b=s.locale,w={day:Hi,week:qw,month:da,year:vW,startOfWeek:function(S){return s.ISOWeek?lf(S):No(S,{locale:b,weekStartsOn:m})},endOfWeek:function(S){return s.ISOWeek?J6(S):I4(S,{locale:b,weekStartsOn:m})}},E=w[n](e,r==="after"?1:-1);r==="before"&&p?E=yW([p,E]):r==="after"&&x&&(E=xW([x,E]));var M=!0;if(a){var C=aS(E,a);M=!C.disabled&&!C.hidden}return M?E:h.count>MQ?h.lastFocused:Y7(E,{moveBy:n,direction:r,context:s,modifiers:a,retry:Zt(Zt({},h),{count:h.count+1})})}var X7=y.createContext(void 0);function NQ(e){var t=e0(),n=G7(),r=y.useState(),s=r[0],a=r[1],l=y.useState(),h=l[0],m=l[1],p=_Q(t.displayMonths,n),x=s??(h&&t.isDateDisplayed(h))?h:p,b=function(){m(s),a(void 0)},w=function(S){a(S)},E=pr(),M=function(S,_){if(s){var N=Y7(s,{moveBy:S,direction:_,context:E,modifiers:n});ls(s,N)||(t.goToDate(N,s),w(N))}},C={focusedDay:s,focusTarget:x,blur:b,focus:w,focusDayAfter:function(){return M("day","after")},focusDayBefore:function(){return M("day","before")},focusWeekAfter:function(){return M("week","after")},focusWeekBefore:function(){return M("week","before")},focusMonthBefore:function(){return M("month","before")},focusMonthAfter:function(){return M("month","after")},focusYearBefore:function(){return M("year","before")},focusYearAfter:function(){return M("year","after")},focusStartOfWeek:function(){return M("startOfWeek","before")},focusEndOfWeek:function(){return M("endOfWeek","after")}};return f.jsx(X7.Provider,{value:C,children:e.children})}function lS(){var e=y.useContext(X7);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function OQ(e,t){var n=G7(),r=aS(e,n,t);return r}var cS=y.createContext(void 0);function TQ(e){if(!zb(e.initialProps)){var t={selected:void 0};return f.jsx(cS.Provider,{value:t,children:e.children})}return f.jsx(DQ,{initialProps:e.initialProps,children:e.children})}function DQ(e){var t=e.initialProps,n=e.children,r=function(a,l,h){var m,p,x;if((m=t.onDayClick)===null||m===void 0||m.call(t,a,l,h),l.selected&&!t.required){(p=t.onSelect)===null||p===void 0||p.call(t,void 0,a,l,h);return}(x=t.onSelect)===null||x===void 0||x.call(t,a,a,l,h)},s={selected:t.selected,onDayClick:r};return f.jsx(cS.Provider,{value:s,children:n})}function K7(){var e=y.useContext(cS);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function AQ(e,t){var n=pr(),r=K7(),s=iS(),a=oS(),l=lS(),h=l.focusDayAfter,m=l.focusDayBefore,p=l.focusWeekAfter,x=l.focusWeekBefore,b=l.blur,w=l.focus,E=l.focusMonthBefore,M=l.focusMonthAfter,C=l.focusYearBefore,S=l.focusYearAfter,_=l.focusStartOfWeek,N=l.focusEndOfWeek,c=function(K){var Z,oe,Y,ne;zb(n)?(Z=r.onDayClick)===null||Z===void 0||Z.call(r,e,t,K):Zg(n)?(oe=s.onDayClick)===null||oe===void 0||oe.call(s,e,t,K):Jg(n)?(Y=a.onDayClick)===null||Y===void 0||Y.call(a,e,t,K):(ne=n.onDayClick)===null||ne===void 0||ne.call(n,e,t,K)},j=function(K){var Z;w(e),(Z=n.onDayFocus)===null||Z===void 0||Z.call(n,e,t,K)},D=function(K){var Z;b(),(Z=n.onDayBlur)===null||Z===void 0||Z.call(n,e,t,K)},B=function(K){var Z;(Z=n.onDayMouseEnter)===null||Z===void 0||Z.call(n,e,t,K)},T=function(K){var Z;(Z=n.onDayMouseLeave)===null||Z===void 0||Z.call(n,e,t,K)},A=function(K){var Z;(Z=n.onDayPointerEnter)===null||Z===void 0||Z.call(n,e,t,K)},H=function(K){var Z;(Z=n.onDayPointerLeave)===null||Z===void 0||Z.call(n,e,t,K)},F=function(K){var Z;(Z=n.onDayTouchCancel)===null||Z===void 0||Z.call(n,e,t,K)},V=function(K){var Z;(Z=n.onDayTouchEnd)===null||Z===void 0||Z.call(n,e,t,K)},ee=function(K){var Z;(Z=n.onDayTouchMove)===null||Z===void 0||Z.call(n,e,t,K)},G=function(K){var Z;(Z=n.onDayTouchStart)===null||Z===void 0||Z.call(n,e,t,K)},se=function(K){var Z;(Z=n.onDayKeyUp)===null||Z===void 0||Z.call(n,e,t,K)},Ce=function(K){var Z;switch(K.key){case"ArrowLeft":K.preventDefault(),K.stopPropagation(),n.dir==="rtl"?h():m();break;case"ArrowRight":K.preventDefault(),K.stopPropagation(),n.dir==="rtl"?m():h();break;case"ArrowDown":K.preventDefault(),K.stopPropagation(),p();break;case"ArrowUp":K.preventDefault(),K.stopPropagation(),x();break;case"PageUp":K.preventDefault(),K.stopPropagation(),K.shiftKey?C():E();break;case"PageDown":K.preventDefault(),K.stopPropagation(),K.shiftKey?S():M();break;case"Home":K.preventDefault(),K.stopPropagation(),_();break;case"End":K.preventDefault(),K.stopPropagation(),N();break}(Z=n.onDayKeyDown)===null||Z===void 0||Z.call(n,e,t,K)},te={onClick:c,onFocus:j,onBlur:D,onKeyDown:Ce,onKeyUp:se,onMouseEnter:B,onMouseLeave:T,onPointerEnter:A,onPointerLeave:H,onTouchCancel:F,onTouchEnd:V,onTouchMove:ee,onTouchStart:G};return te}function jQ(){var e=pr(),t=K7(),n=iS(),r=oS(),s=zb(e)?t.selected:Zg(e)?n.selected:Jg(e)?r.selected:void 0;return s}function kQ(e){return Object.values(ha).includes(e)}function PQ(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var s=e.modifiersClassNames[r];if(s)n.push(s);else if(kQ(r)){var a=e.classNames["day_".concat(r)];a&&n.push(a)}}),n}function zQ(e,t){var n=Zt({},e.styles.day);return Object.keys(t).forEach(function(r){var s;n=Zt(Zt({},n),(s=e.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function BQ(e,t,n){var r,s,a,l=pr(),h=lS(),m=OQ(e,t),p=AQ(e,m),x=jQ(),b=!!(l.onDayClick||l.mode!=="default");y.useEffect(function(){var B;m.outside||h.focusedDay&&b&&ls(h.focusedDay,e)&&((B=n.current)===null||B===void 0||B.focus())},[h.focusedDay,e,n,b,m.outside]);var w=PQ(l,m).join(" "),E=zQ(l,m),M=!!(m.outside&&!l.showOutsideDays||m.hidden),C=(a=(s=l.components)===null||s===void 0?void 0:s.DayContent)!==null&&a!==void 0?a:sQ,S=f.jsx(C,{date:e,displayMonth:t,activeModifiers:m}),_={style:E,className:w,children:S,role:"gridcell"},N=h.focusTarget&&ls(h.focusTarget,e)&&!m.outside,c=h.focusedDay&&ls(h.focusedDay,e),j=Zt(Zt(Zt({},_),(r={disabled:m.disabled,role:"gridcell"},r["aria-selected"]=m.selected,r.tabIndex=c||N?0:-1,r)),p),D={isButton:b,isHidden:M,activeModifiers:m,selectedDays:x,buttonProps:j,divProps:_};return D}function UQ(e){var t=y.useRef(null),n=BQ(e.date,e.displayMonth,t);return n.isHidden?f.jsx("div",{role:"gridcell"}):n.isButton?f.jsx(Ox,Zt({name:"day",ref:t},n.buttonProps)):f.jsx("div",Zt({},n.divProps))}function FQ(e){var t=e.number,n=e.dates,r=pr(),s=r.onWeekNumberClick,a=r.styles,l=r.classNames,h=r.locale,m=r.labels.labelWeekNumber,p=r.formatters.formatWeekNumber,x=p(Number(t),{locale:h});if(!s)return f.jsx("span",{className:l.weeknumber,style:a.weeknumber,children:x});var b=m(Number(t),{locale:h}),w=function(E){s(t,n,E)};return f.jsx(Ox,{name:"week-number","aria-label":b,className:l.weeknumber,style:a.weeknumber,onClick:w,children:x})}function HQ(e){var t,n,r=pr(),s=r.styles,a=r.classNames,l=r.showWeekNumber,h=r.components,m=(t=h==null?void 0:h.Day)!==null&&t!==void 0?t:UQ,p=(n=h==null?void 0:h.WeekNumber)!==null&&n!==void 0?n:FQ,x;return l&&(x=f.jsx("td",{className:a.cell,style:s.cell,children:f.jsx(p,{number:e.weekNumber,dates:e.dates})})),f.jsxs("tr",{className:a.row,style:s.row,children:[x,e.dates.map(function(b){return f.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:f.jsx(m,{displayMonth:e.displayMonth,date:b})},yG(b))})]})}function sE(e,t,n){for(var r=n!=null&&n.ISOWeek?J6(t):I4(t,n),s=n!=null&&n.ISOWeek?lf(e):No(e,n),a=al(r,s),l=[],h=0;h<=a;h++)l.push(Hi(s,h));var m=l.reduce(function(p,x){var b=n!=null&&n.ISOWeek?t7(x):r7(x,n),w=p.find(function(E){return E.weekNumber===b});return w?(w.dates.push(x),p):(p.push({weekNumber:b,dates:[x]}),p)},[]);return m}function IQ(e,t){var n=sE(js(e),H4(e),t);if(t!=null&&t.useFixedWeeks){var r=bG(e,t);if(r<6){var s=n[n.length-1],a=s.dates[s.dates.length-1],l=qw(a,6-r),h=sE(qw(a,1),l,t);n.push.apply(n,h)}}return n}function $Q(e){var t,n,r,s=pr(),a=s.locale,l=s.classNames,h=s.styles,m=s.hideHead,p=s.fixedWeeks,x=s.components,b=s.weekStartsOn,w=s.firstWeekContainsDate,E=s.ISOWeek,M=IQ(e.displayMonth,{useFixedWeeks:!!p,ISOWeek:E,locale:a,weekStartsOn:b,firstWeekContainsDate:w}),C=(t=x==null?void 0:x.Head)!==null&&t!==void 0?t:iQ,S=(n=x==null?void 0:x.Row)!==null&&n!==void 0?n:HQ,_=(r=x==null?void 0:x.Footer)!==null&&r!==void 0?r:tQ;return f.jsxs("table",{id:e.id,className:l.table,style:h.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!m&&f.jsx(C,{}),f.jsx("tbody",{className:l.tbody,style:h.tbody,children:M.map(function(N){return f.jsx(S,{displayMonth:e.displayMonth,dates:N.dates,weekNumber:N.weekNumber},N.weekNumber)})}),f.jsx(_,{displayMonth:e.displayMonth})]})}function VQ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var qQ=VQ()?y.useLayoutEffect:y.useEffect,Y2=!1,WQ=0;function oE(){return"react-day-picker-".concat(++WQ)}function GQ(e){var t,n=e??(Y2?oE():null),r=y.useState(n),s=r[0],a=r[1];return qQ(function(){s===null&&a(oE())},[]),y.useEffect(function(){Y2===!1&&(Y2=!0)},[]),(t=e??s)!==null&&t!==void 0?t:void 0}function YQ(e){var t,n,r=pr(),s=r.dir,a=r.classNames,l=r.styles,h=r.components,m=e0().displayMonths,p=GQ(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),x=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,b=[a.month],w=l.month,E=e.displayIndex===0,M=e.displayIndex===m.length-1,C=!E&&!M;s==="rtl"&&(t=[E,M],M=t[0],E=t[1]),E&&(b.push(a.caption_start),w=Zt(Zt({},w),l.caption_start)),M&&(b.push(a.caption_end),w=Zt(Zt({},w),l.caption_end)),C&&(b.push(a.caption_between),w=Zt(Zt({},w),l.caption_between));var S=(n=h==null?void 0:h.Caption)!==null&&n!==void 0?n:eQ;return f.jsxs("div",{className:b.join(" "),style:w,children:[f.jsx(S,{id:p,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),f.jsx($Q,{id:x,"aria-labelledby":p,displayMonth:e.displayMonth})]},e.displayIndex)}function XQ(e){var t=pr(),n=t.classNames,r=t.styles;return f.jsx("div",{className:n.months,style:r.months,children:e.children})}function KQ(e){var t,n,r=e.initialProps,s=pr(),a=lS(),l=e0(),h=y.useState(!1),m=h[0],p=h[1];y.useEffect(function(){s.initialFocus&&a.focusTarget&&(m||(a.focus(a.focusTarget),p(!0)))},[s.initialFocus,m,a.focus,a.focusTarget,a]);var x=[s.classNames.root,s.className];s.numberOfMonths>1&&x.push(s.classNames.multiple_months),s.showWeekNumber&&x.push(s.classNames.with_weeknumber);var b=Zt(Zt({},s.styles.root),s.style),w=Object.keys(r).filter(function(M){return M.startsWith("data-")}).reduce(function(M,C){var S;return Zt(Zt({},M),(S={},S[C]=r[C],S))},{}),E=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:XQ;return f.jsx("div",Zt({className:x.join(" "),style:b,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},w,{children:f.jsx(E,{children:l.displayMonths.map(function(M,C){return f.jsx(YQ,{displayIndex:C,displayMonth:M},C)})})}))}function QQ(e){var t=e.children,n=LK(e,["children"]);return f.jsx(FK,{initialProps:n,children:f.jsx(KK,{children:f.jsx(TQ,{initialProps:n,children:f.jsx(oQ,{initialProps:n,children:f.jsx(cQ,{initialProps:n,children:f.jsx(vQ,{children:f.jsx(NQ,{children:t})})})})})})})}function ZQ(e){return f.jsx(QQ,Zt({},e,{children:f.jsx(KQ,{initialProps:e})}))}function uS({className:e,classNames:t,showOutsideDays:n=!0,...r}){return f.jsx(ZQ,{showOutsideDays:n,className:He("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:He(pw({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:He("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:He(pw({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({className:s,...a})=>f.jsx(Zd,{className:He("size-4",s),...a}),IconRight:({className:s,...a})=>f.jsx(Jd,{className:He("size-4",s),...a})},...r})}var X2="rovingFocusGroup.onEntryFocus",JQ={bubbles:!1,cancelable:!0},t0="RovingFocusGroup",[Jw,Q7,eZ]=qm(t0),[tZ,Z7]=cs(t0,[eZ]),[nZ,rZ]=tZ(t0),J7=y.forwardRef((e,t)=>f.jsx(Jw.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Jw.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(iZ,{...e,ref:t})})}));J7.displayName=t0;var iZ=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:x=!1,...b}=e,w=y.useRef(null),E=Qt(t,w),M=Wm(a),[C,S]=dl({prop:l,defaultProp:h??null,onChange:m,caller:t0}),[_,N]=y.useState(!1),c=Ci(p),j=Q7(n),D=y.useRef(!1),[B,T]=y.useState(0);return y.useEffect(()=>{const A=w.current;if(A)return A.addEventListener(X2,c),()=>A.removeEventListener(X2,c)},[c]),f.jsx(nZ,{scope:n,orientation:r,dir:M,loop:s,currentTabStopId:C,onItemFocus:y.useCallback(A=>S(A),[S]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:y.useCallback(()=>T(A=>A-1),[]),children:f.jsx(Lt.div,{tabIndex:_||B===0?-1:0,"data-orientation":r,...b,ref:E,style:{outline:"none",...e.style},onMouseDown:ut(e.onMouseDown,()=>{D.current=!0}),onFocus:ut(e.onFocus,A=>{const H=!D.current;if(A.target===A.currentTarget&&H&&!_){const F=new CustomEvent(X2,JQ);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const V=j().filter(te=>te.focusable),ee=V.find(te=>te.active),G=V.find(te=>te.id===C),Ce=[ee,G,...V].filter(Boolean).map(te=>te.ref.current);nM(Ce,x)}}D.current=!1}),onBlur:ut(e.onBlur,()=>N(!1))})})}),eM="RovingFocusGroupItem",tM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...h}=e,m=li(),p=a||m,x=rZ(eM,n),b=x.currentTabStopId===p,w=Q7(n),{onFocusableItemAdd:E,onFocusableItemRemove:M,currentTabStopId:C}=x;return y.useEffect(()=>{if(r)return E(),()=>M()},[r,E,M]),f.jsx(Jw.ItemSlot,{scope:n,id:p,focusable:r,active:s,children:f.jsx(Lt.span,{tabIndex:b?0:-1,"data-orientation":x.orientation,...h,ref:t,onMouseDown:ut(e.onMouseDown,S=>{r?x.onItemFocus(p):S.preventDefault()}),onFocus:ut(e.onFocus,()=>x.onItemFocus(p)),onKeyDown:ut(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){x.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const _=aZ(S,x.orientation,x.dir);if(_!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let c=w().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")c.reverse();else if(_==="prev"||_==="next"){_==="prev"&&c.reverse();const j=c.indexOf(S.currentTarget);c=x.loop?lZ(c,j+1):c.slice(j+1)}setTimeout(()=>nM(c))}}),children:typeof l=="function"?l({isCurrentTabStop:b,hasTabStop:C!=null}):l})})});tM.displayName=eM;var sZ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oZ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aZ(e,t,n){const r=oZ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sZ[r]}function nM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function lZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cZ=J7,uZ=tM,e9=["Enter"," "],dZ=["ArrowDown","PageUp","Home"],rM=["ArrowUp","PageDown","End"],fZ=[...dZ,...rM],hZ={ltr:[...e9,"ArrowRight"],rtl:[...e9,"ArrowLeft"]},mZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},n0="Menu",[wg,pZ,gZ]=qm(n0),[Lf,iM]=cs(n0,[gZ,Lu,Z7]),Bb=Lu(),sM=Z7(),[vZ,wf]=Lf(n0),[yZ,r0]=Lf(n0),oM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:a,modal:l=!0}=e,h=Bb(t),[m,p]=y.useState(null),x=y.useRef(!1),b=Ci(a),w=Wm(s);return y.useEffect(()=>{const E=()=>{x.current=!0,document.addEventListener("pointerdown",M,{capture:!0,once:!0}),document.addEventListener("pointermove",M,{capture:!0,once:!0})},M=()=>x.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",M,{capture:!0}),document.removeEventListener("pointermove",M,{capture:!0})}},[]),f.jsx(Lb,{...h,children:f.jsx(vZ,{scope:t,open:n,onOpenChange:b,content:m,onContentChange:p,children:f.jsx(yZ,{scope:t,onClose:y.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:x,dir:w,modal:l,children:r})})})};oM.displayName=n0;var xZ="MenuAnchor",dS=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Bb(n);return f.jsx(Fg,{...s,...r,ref:t})});dS.displayName=xZ;var fS="MenuPortal",[bZ,aM]=Lf(fS,{forceMount:void 0}),lM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,a=wf(fS,t);return f.jsx(bZ,{scope:t,forceMount:n,children:f.jsx(ro,{present:n||a.open,children:f.jsx(vf,{asChild:!0,container:s,children:r})})})};lM.displayName=fS;var Co="MenuContent",[LZ,hS]=Lf(Co),cM=y.forwardRef((e,t)=>{const n=aM(Co,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=wf(Co,e.__scopeMenu),l=r0(Co,e.__scopeMenu);return f.jsx(wg.Provider,{scope:e.__scopeMenu,children:f.jsx(ro,{present:r||a.open,children:f.jsx(wg.Slot,{scope:e.__scopeMenu,children:l.modal?f.jsx(wZ,{...s,ref:t}):f.jsx(SZ,{...s,ref:t})})})})}),wZ=y.forwardRef((e,t)=>{const n=wf(Co,e.__scopeMenu),r=y.useRef(null),s=Qt(t,r);return y.useEffect(()=>{const a=r.current;if(a)return Bg(a)},[]),f.jsx(mS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),SZ=y.forwardRef((e,t)=>{const n=wf(Co,e.__scopeMenu);return f.jsx(mS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),CZ=tc("MenuContent.ScrollLock"),mS=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:h,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:w,onDismiss:E,disableOutsideScroll:M,...C}=e,S=wf(Co,n),_=r0(Co,n),N=Bb(n),c=sM(n),j=pZ(n),[D,B]=y.useState(null),T=y.useRef(null),A=Qt(t,T,S.onContentChange),H=y.useRef(0),F=y.useRef(""),V=y.useRef(0),ee=y.useRef(null),G=y.useRef("right"),se=y.useRef(0),Ce=M?Im:y.Fragment,te=M?{as:CZ,allowPinchZoom:!0}:void 0,K=oe=>{var ye,ve;const Y=F.current+oe,ne=j().filter(he=>!he.disabled),X=document.activeElement,ue=(ye=ne.find(he=>he.ref.current===X))==null?void 0:ye.textValue,pe=ne.map(he=>he.textValue),Se=PZ(pe,Y,ue),Re=(ve=ne.find(he=>he.textValue===Se))==null?void 0:ve.ref.current;(function he(de){F.current=de,window.clearTimeout(H.current),de!==""&&(H.current=window.setTimeout(()=>he(""),1e3))})(Y),Re&&setTimeout(()=>Re.focus())};y.useEffect(()=>()=>window.clearTimeout(H.current),[]),pb();const Z=y.useCallback(oe=>{var ne,X;return G.current===((ne=ee.current)==null?void 0:ne.side)&&BZ(oe,(X=ee.current)==null?void 0:X.area)},[]);return f.jsx(LZ,{scope:n,searchRef:F,onItemEnter:y.useCallback(oe=>{Z(oe)&&oe.preventDefault()},[Z]),onItemLeave:y.useCallback(oe=>{var Y;Z(oe)||((Y=T.current)==null||Y.focus(),B(null))},[Z]),onTriggerLeave:y.useCallback(oe=>{Z(oe)&&oe.preventDefault()},[Z]),pointerGraceTimerRef:V,onPointerGraceIntentChange:y.useCallback(oe=>{ee.current=oe},[]),children:f.jsx(Ce,{...te,children:f.jsx(Hm,{asChild:!0,trapped:s,onMountAutoFocus:ut(a,oe=>{var Y;oe.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:f.jsx(Fm,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:p,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:f.jsx(cZ,{asChild:!0,...c,dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:B,onEntryFocus:ut(m,oe=>{_.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(wb,{role:"menu","aria-orientation":"vertical","data-state":EM(S.open),"data-radix-menu-content":"",dir:_.dir,...N,...C,ref:A,style:{outline:"none",...C.style},onKeyDown:ut(C.onKeyDown,oe=>{const ne=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,X=oe.ctrlKey||oe.altKey||oe.metaKey,ue=oe.key.length===1;ne&&(oe.key==="Tab"&&oe.preventDefault(),!X&&ue&&K(oe.key));const pe=T.current;if(oe.target!==pe||!fZ.includes(oe.key))return;oe.preventDefault();const Re=j().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);rM.includes(oe.key)&&Re.reverse(),jZ(Re)}),onBlur:ut(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(H.current),F.current="")}),onPointerMove:ut(e.onPointerMove,Sg(oe=>{const Y=oe.target,ne=se.current!==oe.clientX;if(oe.currentTarget.contains(Y)&&ne){const X=oe.clientX>se.current?"right":"left";G.current=X,se.current=oe.clientX}}))})})})})})})});cM.displayName=Co;var EZ="MenuGroup",pS=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{role:"group",...r,ref:t})});pS.displayName=EZ;var RZ="MenuLabel",uM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{...r,ref:t})});uM.displayName=RZ;var Tx="MenuItem",aE="menu.itemSelect",Ub=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,a=y.useRef(null),l=r0(Tx,e.__scopeMenu),h=hS(Tx,e.__scopeMenu),m=Qt(t,a),p=y.useRef(!1),x=()=>{const b=a.current;if(!n&&b){const w=new CustomEvent(aE,{bubbles:!0,cancelable:!0});b.addEventListener(aE,E=>r==null?void 0:r(E),{once:!0}),ib(b,w),w.defaultPrevented?p.current=!1:l.onClose()}};return f.jsx(dM,{...s,ref:m,disabled:n,onClick:ut(e.onClick,x),onPointerDown:b=>{var w;(w=e.onPointerDown)==null||w.call(e,b),p.current=!0},onPointerUp:ut(e.onPointerUp,b=>{var w;p.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:ut(e.onKeyDown,b=>{const w=h.searchRef.current!=="";n||w&&b.key===" "||e9.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})});Ub.displayName=Tx;var dM=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...a}=e,l=hS(Tx,n),h=sM(n),m=y.useRef(null),p=Qt(t,m),[x,b]=y.useState(!1),[w,E]=y.useState("");return y.useEffect(()=>{const M=m.current;M&&E((M.textContent??"").trim())},[a.children]),f.jsx(wg.ItemSlot,{scope:n,disabled:r,textValue:s??w,children:f.jsx(uZ,{asChild:!0,...h,focusable:!r,children:f.jsx(Lt.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:p,onPointerMove:ut(e.onPointerMove,Sg(M=>{r?l.onItemLeave(M):(l.onItemEnter(M),M.defaultPrevented||M.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(e.onPointerLeave,Sg(M=>l.onItemLeave(M))),onFocus:ut(e.onFocus,()=>b(!0)),onBlur:ut(e.onBlur,()=>b(!1))})})})}),_Z="MenuCheckboxItem",fM=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return f.jsx(vM,{scope:e.__scopeMenu,checked:n,children:f.jsx(Ub,{role:"menuitemcheckbox","aria-checked":Dx(n)?"mixed":n,...s,ref:t,"data-state":vS(n),onSelect:ut(s.onSelect,()=>r==null?void 0:r(Dx(n)?!0:!n),{checkForDefaultPrevented:!1})})})});fM.displayName=_Z;var hM="MenuRadioGroup",[MZ,NZ]=Lf(hM,{value:void 0,onValueChange:()=>{}}),mM=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,a=Ci(r);return f.jsx(MZ,{scope:e.__scopeMenu,value:n,onValueChange:a,children:f.jsx(pS,{...s,ref:t})})});mM.displayName=hM;var pM="MenuRadioItem",gM=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=NZ(pM,e.__scopeMenu),a=n===s.value;return f.jsx(vM,{scope:e.__scopeMenu,checked:a,children:f.jsx(Ub,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":vS(a),onSelect:ut(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,n)},{checkForDefaultPrevented:!1})})})});gM.displayName=pM;var gS="MenuItemIndicator",[vM,OZ]=Lf(gS,{checked:!1}),yM=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,a=OZ(gS,n);return f.jsx(ro,{present:r||Dx(a.checked)||a.checked===!0,children:f.jsx(Lt.span,{...s,ref:t,"data-state":vS(a.checked)})})});yM.displayName=gS;var TZ="MenuSeparator",xM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(Lt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});xM.displayName=TZ;var DZ="MenuArrow",bM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Bb(n);return f.jsx(Sb,{...s,...r,ref:t})});bM.displayName=DZ;var AZ="MenuSub",[$se,LM]=Lf(AZ),Qp="MenuSubTrigger",wM=y.forwardRef((e,t)=>{const n=wf(Qp,e.__scopeMenu),r=r0(Qp,e.__scopeMenu),s=LM(Qp,e.__scopeMenu),a=hS(Qp,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:m}=a,p={__scopeMenu:e.__scopeMenu},x=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>x,[x]),y.useEffect(()=>{const b=h.current;return()=>{window.clearTimeout(b),m(null)}},[h,m]),f.jsx(dS,{asChild:!0,...p,children:f.jsx(dM,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":EM(n.open),...e,ref:cl(t,s.onTriggerChange),onClick:b=>{var w;(w=e.onClick)==null||w.call(e,b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ut(e.onPointerMove,Sg(b=>{a.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:ut(e.onPointerLeave,Sg(b=>{var E,M;x();const w=(E=n.content)==null?void 0:E.getBoundingClientRect();if(w){const C=(M=n.content)==null?void 0:M.dataset.side,S=C==="right",_=S?-5:5,N=w[S?"left":"right"],c=w[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:b.clientX+_,y:b.clientY},{x:N,y:w.top},{x:c,y:w.top},{x:c,y:w.bottom},{x:N,y:w.bottom}],side:C}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(b),b.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:ut(e.onKeyDown,b=>{var E;const w=a.searchRef.current!=="";e.disabled||w&&b.key===" "||hZ[r.dir].includes(b.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),b.preventDefault())})})})});wM.displayName=Qp;var SM="MenuSubContent",CM=y.forwardRef((e,t)=>{const n=aM(Co,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,a=wf(Co,e.__scopeMenu),l=r0(Co,e.__scopeMenu),h=LM(SM,e.__scopeMenu),m=y.useRef(null),p=Qt(t,m);return f.jsx(wg.Provider,{scope:e.__scopeMenu,children:f.jsx(ro,{present:r||a.open,children:f.jsx(wg.Slot,{scope:e.__scopeMenu,children:f.jsx(mS,{id:h.contentId,"aria-labelledby":h.triggerId,...s,ref:p,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:x=>{var b;l.isUsingKeyboardRef.current&&((b=m.current)==null||b.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:ut(e.onFocusOutside,x=>{x.target!==h.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:ut(e.onEscapeKeyDown,x=>{l.onClose(),x.preventDefault()}),onKeyDown:ut(e.onKeyDown,x=>{var E;const b=x.currentTarget.contains(x.target),w=mZ[l.dir].includes(x.key);b&&w&&(a.onOpenChange(!1),(E=h.trigger)==null||E.focus(),x.preventDefault())})})})})})});CM.displayName=SM;function EM(e){return e?"open":"closed"}function Dx(e){return e==="indeterminate"}function vS(e){return Dx(e)?"indeterminate":e?"checked":"unchecked"}function jZ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function kZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function PZ(e,t,n){const s=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=kZ(e,Math.max(a,0));s.length===1&&(l=l.filter(p=>p!==n));const m=l.find(p=>p.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function zZ(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const h=t[a],m=t[l],p=h.x,x=h.y,b=m.x,w=m.y;x>r!=w>r&&n<(b-p)*(r-x)/(w-x)+p&&(s=!s)}return s}function BZ(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zZ(n,t)}function Sg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var UZ=oM,FZ=dS,HZ=lM,IZ=cM,$Z=pS,VZ=uM,qZ=Ub,WZ=fM,GZ=mM,YZ=gM,XZ=yM,KZ=xM,QZ=bM,ZZ=wM,JZ=CM,Fb="DropdownMenu",[eJ,Vse]=cs(Fb,[iM]),ds=iM(),[tJ,RM]=eJ(Fb),_M=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:a,onOpenChange:l,modal:h=!0}=e,m=ds(t),p=y.useRef(null),[x,b]=dl({prop:s,defaultProp:a??!1,onChange:l,caller:Fb});return f.jsx(tJ,{scope:t,triggerId:li(),triggerRef:p,contentId:li(),open:x,onOpenChange:b,onOpenToggle:y.useCallback(()=>b(w=>!w),[b]),modal:h,children:f.jsx(UZ,{...m,open:x,onOpenChange:b,dir:r,modal:h,children:n})})};_M.displayName=Fb;var MM="DropdownMenuTrigger",NM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,a=RM(MM,n),l=ds(n);return f.jsx(FZ,{asChild:!0,...l,children:f.jsx(Lt.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:cl(t,a.triggerRef),onPointerDown:ut(e.onPointerDown,h=>{!r&&h.button===0&&h.ctrlKey===!1&&(a.onOpenToggle(),a.open||h.preventDefault())}),onKeyDown:ut(e.onKeyDown,h=>{r||(["Enter"," "].includes(h.key)&&a.onOpenToggle(),h.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(h.key)&&h.preventDefault())})})})});NM.displayName=MM;var nJ="DropdownMenuPortal",OM=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ds(t);return f.jsx(HZ,{...r,...n})};OM.displayName=nJ;var TM="DropdownMenuContent",DM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=RM(TM,n),a=ds(n),l=y.useRef(!1);return f.jsx(IZ,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:t,onCloseAutoFocus:ut(e.onCloseAutoFocus,h=>{var m;l.current||(m=s.triggerRef.current)==null||m.focus(),l.current=!1,h.preventDefault()}),onInteractOutside:ut(e.onInteractOutside,h=>{const m=h.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,x=m.button===2||p;(!s.modal||x)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});DM.displayName=TM;var rJ="DropdownMenuGroup",iJ=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx($Z,{...s,...r,ref:t})});iJ.displayName=rJ;var sJ="DropdownMenuLabel",AM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(VZ,{...s,...r,ref:t})});AM.displayName=sJ;var oJ="DropdownMenuItem",jM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(qZ,{...s,...r,ref:t})});jM.displayName=oJ;var aJ="DropdownMenuCheckboxItem",lJ=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(WZ,{...s,...r,ref:t})});lJ.displayName=aJ;var cJ="DropdownMenuRadioGroup",kM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(GZ,{...s,...r,ref:t})});kM.displayName=cJ;var uJ="DropdownMenuRadioItem",PM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(YZ,{...s,...r,ref:t})});PM.displayName=uJ;var dJ="DropdownMenuItemIndicator",zM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(XZ,{...s,...r,ref:t})});zM.displayName=dJ;var fJ="DropdownMenuSeparator",BM=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(KZ,{...s,...r,ref:t})});BM.displayName=fJ;var hJ="DropdownMenuArrow",mJ=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(QZ,{...s,...r,ref:t})});mJ.displayName=hJ;var pJ="DropdownMenuSubTrigger",gJ=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(ZZ,{...s,...r,ref:t})});gJ.displayName=pJ;var vJ="DropdownMenuSubContent",yJ=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ds(n);return f.jsx(JZ,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yJ.displayName=vJ;var xJ=_M,bJ=NM,LJ=OM,wJ=DM,SJ=AM,CJ=jM,EJ=kM,RJ=PM,_J=zM,MJ=BM;function Ax({...e}){return f.jsx(xJ,{"data-slot":"dropdown-menu",...e})}function jx({...e}){return f.jsx(bJ,{"data-slot":"dropdown-menu-trigger",...e})}function kx({className:e,sideOffset:t=4,...n}){return f.jsx(LJ,{children:f.jsx(wJ,{"data-slot":"dropdown-menu-content",sideOffset:t,className:He("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function lE({className:e,inset:t,variant:n="default",...r}){return f.jsx(CJ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:He("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Px({...e}){return f.jsx(EJ,{"data-slot":"dropdown-menu-radio-group",...e})}function hm({className:e,children:t,...n}){return f.jsxs(RJ,{"data-slot":"dropdown-menu-radio-item",className:He("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[f.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:f.jsx(_J,{children:f.jsx(ZA,{className:"size-2 fill-current"})})}),t]})}function zx({className:e,inset:t,...n}){return f.jsx(SJ,{"data-slot":"dropdown-menu-label","data-inset":t,className:He("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function UM({className:e,...t}){return f.jsx(MJ,{"data-slot":"dropdown-menu-separator",className:He("bg-border -mx-1 my-1 h-px",e),...t})}var Hb="Popover",[FM,qse]=cs(Hb,[Lu]),i0=Lu(),[NJ,wu]=FM(Hb),HM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,h=i0(t),m=y.useRef(null),[p,x]=y.useState(!1),[b,w]=dl({prop:r,defaultProp:s??!1,onChange:a,caller:Hb});return f.jsx(Lb,{...h,children:f.jsx(NJ,{scope:t,contentId:li(),triggerRef:m,open:b,onOpenChange:w,onOpenToggle:y.useCallback(()=>w(E=>!E),[w]),hasCustomAnchor:p,onCustomAnchorAdd:y.useCallback(()=>x(!0),[]),onCustomAnchorRemove:y.useCallback(()=>x(!1),[]),modal:l,children:n})})};HM.displayName=Hb;var IM="PopoverAnchor",OJ=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=wu(IM,n),a=i0(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:h}=s;return y.useEffect(()=>(l(),()=>h()),[l,h]),f.jsx(Fg,{...a,...r,ref:t})});OJ.displayName=IM;var $M="PopoverTrigger",VM=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=wu($M,n),a=i0(n),l=Qt(t,s.triggerRef),h=f.jsx(Lt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":XM(s.open),...r,ref:l,onClick:ut(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?h:f.jsx(Fg,{asChild:!0,...a,children:h})});VM.displayName=$M;var yS="PopoverPortal",[TJ,DJ]=FM(yS,{forceMount:void 0}),qM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=wu(yS,t);return f.jsx(TJ,{scope:t,forceMount:n,children:f.jsx(ro,{present:n||a.open,children:f.jsx(vf,{asChild:!0,container:s,children:r})})})};qM.displayName=yS;var Tm="PopoverContent",WM=y.forwardRef((e,t)=>{const n=DJ(Tm,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=wu(Tm,e.__scopePopover);return f.jsx(ro,{present:r||a.open,children:a.modal?f.jsx(jJ,{...s,ref:t}):f.jsx(kJ,{...s,ref:t})})});WM.displayName=Tm;var AJ=tc("PopoverContent.RemoveScroll"),jJ=y.forwardRef((e,t)=>{const n=wu(Tm,e.__scopePopover),r=y.useRef(null),s=Qt(t,r),a=y.useRef(!1);return y.useEffect(()=>{const l=r.current;if(l)return Bg(l)},[]),f.jsx(Im,{as:AJ,allowPinchZoom:!0,children:f.jsx(GM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ut(e.onCloseAutoFocus,l=>{var h;l.preventDefault(),a.current||(h=n.triggerRef.current)==null||h.focus()}),onPointerDownOutside:ut(e.onPointerDownOutside,l=>{const h=l.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,p=h.button===2||m;a.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:ut(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),kJ=y.forwardRef((e,t)=>{const n=wu(Tm,e.__scopePopover),r=y.useRef(!1),s=y.useRef(!1);return f.jsx(GM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,h;(l=e.onCloseAutoFocus)==null||l.call(e,a),a.defaultPrevented||(r.current||(h=n.triggerRef.current)==null||h.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var m,p;(m=e.onInteractOutside)==null||m.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;((p=n.triggerRef.current)==null?void 0:p.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),GM=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,...b}=e,w=wu(Tm,n),E=i0(n);return pb(),f.jsx(Hm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:f.jsx(Fm,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:x,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),children:f.jsx(wb,{"data-state":XM(w.open),role:"dialog",id:w.contentId,...E,...b,ref:t,style:{...b.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),YM="PopoverClose",PJ=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=wu(YM,n);return f.jsx(Lt.button,{type:"button",...r,ref:t,onClick:ut(e.onClick,()=>s.onOpenChange(!1))})});PJ.displayName=YM;var zJ="PopoverArrow",BJ=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=i0(n);return f.jsx(Sb,{...s,...r,ref:t})});BJ.displayName=zJ;function XM(e){return e?"open":"closed"}var UJ=HM,FJ=VM,HJ=qM,IJ=WM;function rl({...e}){return f.jsx(UJ,{"data-slot":"popover",...e})}function il({...e}){return f.jsx(FJ,{"data-slot":"popover-trigger",...e})}function sl({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(HJ,{children:f.jsx(IJ,{"data-slot":"popover-content",align:t,sideOffset:n,className:He("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function KM(){const e=qi(),t=Te(r=>r.setLastCamerasSnapshots);return y.useCallback(async r=>{var s;if(!(!e||!r))try{const a=e.systemManager.getDeviceById(r);if(!((s=a==null?void 0:a.interfaces)!=null&&s.includes(Ft.ScryptedInterface.Camera)))return;const l=await a.takePicture({bulkRequest:!1,reason:"periodic",periodicRequest:!0,picture:{width:640},timeout:8e3});if(!l)return;const h=await e.mediaManager.convertMediaObjectToBuffer(l,"image/jpeg"),m=h==null?void 0:h.toString("base64"),p=m?`data:image/jpeg;base64,${m}`:null,x=Te.getState().lastCamerasSnapshots??{};t({...x,[r]:p})}catch{const a=Te.getState().lastCamerasSnapshots??{};t({...a,[r]:null})}},[e,t])}function Bx({...e}){return f.jsx(l4,{"data-slot":"dialog",...e})}function QM({...e}){return f.jsx(qH,{"data-slot":"dialog-trigger",...e})}function $J({...e}){return f.jsx(c4,{"data-slot":"dialog-portal",...e})}function VJ({className:e,...t}){return f.jsx(u4,{"data-slot":"dialog-overlay",className:He("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Ux({className:e,children:t,...n}){return f.jsxs($J,{"data-slot":"dialog-portal",children:[f.jsx(VJ,{}),f.jsxs(d4,{"data-slot":"dialog-content",className:He("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",e),...n,children:[t,f.jsxs(QR,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(gf,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function cE({className:e,...t}){return f.jsx(KR,{"data-slot":"dialog-title",className:He("text-lg leading-none font-semibold",e),...t})}const qJ=`${Ft.ScryptedMimeTypes.SchemePrefix}https`,WJ="x-scrypted-nvr/x-scrypted-nvr-clip";function GJ(){try{return MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')}catch{const t=document.createElement("video").canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"');return t==="probably"||t==="maybe"}}function YJ({videoclip:e,onPlayInPlayer:t}){const[n,r]=y.useState(!1),[s,a]=y.useState(null),[l,h]=y.useState(null),[m,p]=y.useState(!1),x=qi(),{getVideoclipUrls:b}=ks(),{thumbnailUrl:w,videoUrl:E}=b(e),M=y.useRef(null),C=y.useCallback(async()=>{var c;if(!x||!e.deviceId){p(!0);return}p(!1),h(null);try{const j=x.systemManager.getDeviceById(e.deviceId);if(!((c=j==null?void 0:j.interfaces)!=null&&c.includes(Ft.ScryptedInterface.VideoClips))){p(!0);return}const D=e.videoId??e.id,B=await j.getVideoClip(D);if(!B){p(!0);return}const T=x.mediaManager,A=B.mimeType??"video/mp4";let H=null;if(A===qJ||A.startsWith(Ft.ScryptedMimeTypes.SchemePrefix)){const F=await T.convertMediaObjectToBuffer(B,A);H=F==null?void 0:F.toString("base64")}else A===WJ?H=await T.convertMediaObjectToLocalUrl(B,Ft.ScryptedMimeTypes.LocalUrl):H=await T.convertMediaObjectToLocalUrl(B,A);if(H!=null&&H.trim()){const V=H.startsWith("http")?H:`${H.startsWith("/")?"":"/"}${H}`;h(`${V}${V.includes("?")?"&":"?"}h265=${GJ()}`)}}catch{}p(!0)},[x,e.deviceId,e.videoId,e.id]),S=y.useCallback(async()=>{var c;if(!(!x||w||!e.deviceId))try{const j=x.systemManager.getDeviceById(e.deviceId);if(!((c=j==null?void 0:j.interfaces)!=null&&c.includes(Ft.ScryptedInterface.VideoClips)))return;const D=e.thumbnailId??e.videoId??e.id,B=await j.getVideoClipThumbnail(D);if(!B)return;const T=await x.mediaManager.convertMediaObjectToBuffer(B,"image/jpeg"),A=T==null?void 0:T.toString("base64");A&&a(`data:image/jpeg;base64,${A}`)}catch{}},[x,e.deviceId,e.thumbnailId,e.videoId,e.id,w]);y.useEffect(()=>{S()},[S]),y.useEffect(()=>{n?C():(h(null),p(!1))},[n,C]),y.useEffect(()=>{const c=M.current;!n&&c&&(c.pause(),c.src="",c.load())},[n]);const _=l??(m?E:void 0);y.useEffect(()=>{const c=M.current;c&&n&&c.setAttribute("webkit-playsinline","true")},[n]),y.useEffect(()=>{if(!n||!_)return;const c=setTimeout(()=>{var j;(j=M.current)==null||j.play().catch(()=>{})},150);return()=>clearTimeout(c)},[n,_]);const N=w??s;return t?N?f.jsx("img",{src:N,alt:"preview",role:"button",tabIndex:0,onClick:()=>t(e),onKeyDown:c=>c.key==="Enter"&&t(e),className:"w-full h-full object-cover object-center cursor-pointer rounded shadow-sm"}):f.jsx("button",{type:"button",onClick:()=>t(e),className:"w-full h-full flex items-center justify-center bg-muted text-muted-foreground cursor-pointer rounded shadow-sm hover:bg-muted/80",children:f.jsx("span",{className:"text-sm font-medium",children:"Video"})}):f.jsxs(Bx,{open:n,onOpenChange:r,children:[f.jsx(QM,{asChild:!0,children:N?f.jsx("img",{src:N,alt:"preview",onClick:()=>r(!0),className:"w-full h-full object-cover object-center cursor-pointer rounded shadow-sm"}):f.jsx("button",{type:"button",onClick:()=>r(!0),className:"w-full h-full flex items-center justify-center bg-muted text-muted-foreground cursor-pointer rounded shadow-sm hover:bg-muted/80",children:f.jsx("span",{className:"text-sm font-medium",children:"Video"})})}),f.jsxs(Ux,{className:"max-w-[90vw] max-h-[90vh] p-0 m-0 overflow-hidden",children:[f.jsx(s4,{className:"sr-only",children:"Full res image"}),f.jsx(o4,{className:"sr-only",children:"Full res image"}),f.jsx("video",{ref:M,src:l??(m?E:void 0),controls:!0,autoPlay:!0,playsInline:!0,className:"max-w-full max-h-[80vh] object-contain mx-auto my-auto",preload:"metadata"}),f.jsx("div",{className:"w-full border-t bg-muted/50 px-4 py-3 text-sm shrink-0",children:f.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[f.jsx("span",{className:"font-medium text-foreground",children:e.deviceName}),f.jsx("span",{className:"text-muted-foreground",children:br(e.startTime,"MMM d, HH:mm:ss")}),e.duration!=null&&f.jsx("span",{className:"text-muted-foreground",children:`${Math.ceil(e.duration/1e3)}s`}),f.jsx("span",{className:"text-muted-foreground",children:(e.detectionClasses??["motion"]).filter(c=>!c.toLowerCase().includes("clip")).map(c=>cf(c)).join(", ")}),e.event&&f.jsx("span",{className:"text-muted-foreground",children:e.event}),e.description&&f.jsx("span",{className:"text-muted-foreground",children:e.description}),f.jsxs("span",{className:"text-muted-foreground",children:["Source: ",e.source]})]})})]})]})}function ZM({videoclip:e,loading:t,onPlayInPlayer:n,compact:r,compactVertical:s,compactLarge:a}){const l=Te(M=>M.timezone),h=W4(e.detectionClasses??["motion"]),m=cf(h),p=a7(e.startTime,l);if(t)return f.jsx(nf,{className:"rounded-none cursor-pointer overflow-auto relative group w-full p-0",style:{aspectRatio:"1 / 1",width:"100%"},children:f.jsx(Ts,{className:"w-full h-full"})});const x=e.duration!=null?`${Math.ceil(e.duration/1e3)}s`:null,b=f.jsxs("div",{className:"flex flex-col gap-0.5 text-left min-w-0 shrink w-full",children:[f.jsxs("span",{className:"text-xs font-semibold text-foreground truncate flex items-center justify-between gap-2 w-full",children:[f.jsx("span",{className:"truncate min-w-0",children:p}),x!=null&&f.jsx("span",{className:"text-muted-foreground font-normal shrink-0",children:x})]}),f.jsx("span",{className:"text-xs text-muted-foreground truncate",children:m})]}),w=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"w-full h-full flex items-center justify-center min-h-0",children:[!r&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"absolute top-0 left-0 w-5 h-5 bg-black/50 text-white flex items-center justify-center rounded z-10",children:f.jsx(yu,{small:!0,detectionClass:h})}),f.jsx("div",{className:"absolute top-0 right-0 w-5 h-5 bg-black/50 text-white flex items-center justify-center rounded z-10 text-[10px] font-semibold",children:x??""})]}),f.jsx(YJ,{videoclip:e,onPlayInPlayer:n})]}),r&&(s||a)&&f.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 bg-gradient-to-t from-black/75 to-transparent px-1.5 py-1 flex flex-col gap-0 justify-end min-h-0",children:[f.jsxs("span",{className:"text-[10px] font-semibold text-white truncate leading-tight",children:[p,x!=null&&` · ${x}`]}),f.jsx("span",{className:"text-[10px] text-white/90 truncate leading-tight",children:m})]})]}),E=f.jsx(nf,{className:He("rounded overflow-hidden relative group p-0 shrink-0",r?s?"h-full min-h-[80px] w-auto aspect-[4/3]":a?"w-full h-full min-w-0 min-h-0":"w-28 min-w-[7rem] aspect-video":"aspect-square w-full"),style:r&&!s&&!a||r&&s||r&&a?void 0:{aspectRatio:"1 / 1"},children:w});return r?s||a?E:f.jsxs("div",{className:"flex flex-row gap-2 items-center w-full min-w-0",children:[E,b]}):f.jsxs(f.Fragment,{children:[E,b]})}const XJ=30;function JM(e){return`${e.deviceId??""}-${e.id}-${e.startTime}`}function uE(e){const t=new Set;return e.filter(n=>{const r=JM(n);return t.has(r)?!1:(t.add(r),!0)})}function KJ({date:e,cameras:t,pageSize:n=XJ,onPlayInPlayer:r,compactItems:s=!1,compactVertical:a=!1,compactLarge:l=!1,listClassName:h="flex flex-col gap-2 overflow-y-auto md:flex-row md:overflow-y-hidden md:overflow-x-auto",itemClassName:m="shrink-0 w-full max-w-full md:w-32 md:max-w-none"}){const{getVideoclips:p}=ks(),[x,b]=y.useState([]),[w,E]=y.useState(0),[M,C]=y.useState(!0),[S,_]=y.useState(!1),N=y.useRef(null),c=y.useRef(null),j=x.length<w,D=e&&t.length?{from:Ii(new Date(e)).getTime(),to:um(new Date(e)).getTime()}:null;y.useEffect(()=>{if(!D){b([]),E(0),C(!1);return}C(!0),b([]),E(0),p(D.from,D.to,{cameras:t,limit:n,offset:0}).then(({videoclips:T,total:A})=>{b(uE(T)),E(A)}).finally(()=>C(!1))},[D==null?void 0:D.from,D==null?void 0:D.to,t,n,p]);const B=y.useCallback(()=>{if(!D||S||!j)return;const T=x.length;T>=w||(_(!0),p(D.from,D.to,{cameras:t,limit:n,offset:T}).then(({videoclips:A})=>{b(H=>uE([...H,...A]))}).finally(()=>_(!1)))},[D,t,n,p,x.length,w,j,S]);return y.useEffect(()=>{const T=N.current,A=c.current;if(!T||!A||!j)return;const H=new IntersectionObserver(F=>{var V;(V=F[0])!=null&&V.isIntersecting&&(S||B())},{root:T,rootMargin:"0px 0px 20% 0px",threshold:0});return H.observe(A),()=>H.disconnect()},[j,B,S]),e?M?f.jsx("div",{ref:N,className:h,children:Array.from({length:6}).map((A,H)=>f.jsx("div",{className:m,children:f.jsx(nf,{className:"rounded-none overflow-hidden relative w-full p-0",style:{aspectRatio:"1 / 1",width:"100%"},children:f.jsx(Ts,{className:"w-full h-full"})})},H))}):x.length===0?f.jsx("p",{className:"text-sm text-muted-foreground py-4 px-2 shrink-0",children:"No videoclips for today"}):f.jsxs("div",{ref:N,className:h,children:[x.map(T=>f.jsx("div",{className:m,children:f.jsx(ZM,{videoclip:T,loading:!1,onPlayInPlayer:r,compact:s,compactVertical:a,compactLarge:l})},JM(T))),j&&f.jsx("div",{ref:c,className:"shrink-0 flex items-center justify-center py-3 text-xs text-muted-foreground",style:s?void 0:{gridColumn:"1 / -1"},children:S?"Loading…":""}),!j&&x.length>0&&f.jsx("div",{className:"shrink-0 flex items-center justify-center py-2 text-xs text-muted-foreground",style:s?void 0:{gridColumn:"1 / -1"},children:"End of list"})]}):f.jsx("p",{className:"text-sm text-muted-foreground py-4 px-2 shrink-0",children:"Select a date"})}function dE(){var e,t;return{userAgent:typeof navigator<"u"?navigator.userAgent:void 0,capabilities:{audio:typeof RTCRtpReceiver<"u"?((e=RTCRtpReceiver.getCapabilities)==null?void 0:e.call(RTCRtpReceiver,"audio"))??void 0:void 0,video:typeof RTCRtpReceiver<"u"?((t=RTCRtpReceiver.getCapabilities)==null?void 0:t.call(RTCRtpReceiver,"video"))??void 0:void 0},screen:typeof screen<"u"?{devicePixelRatio:window.devicePixelRatio??1,width:screen.width,height:screen.height}:void 0}}function QJ(e){return e.iceConnectionState==="disconnected"||e.iceConnectionState==="failed"||e.iceConnectionState==="closed"}class eN{constructor(){et(this,"pc");et(this,"_pcResolve");et(this,"_dcResolve");et(this,"pcDeferred",{promise:new Promise(t=>{this._pcResolve=t})});et(this,"dcDeferred",{promise:new Promise(t=>{this._dcResolve=t})});et(this,"microphone");et(this,"micEnabled",!1);et(this,"onPeerConnection");et(this,"__proxy_props",{options:dE()});et(this,"options",dE())}async getOptions(){return this.options}setMicrophone(t){if(this.microphone){if(!t){this.micEnabled=!1;const n=this.microphone.track;n&&(n.stop(),this.microphone.replaceTrack(null));return}if(this.micEnabled&&this.microphone.track){this.microphone.track.enabled=!0;return}this.micEnabled=!0,navigator.mediaDevices.getUserMedia({video:!1,audio:!0}).then(n=>{const r=n.getTracks()[0];r&&this.microphone?this.microphone.replaceTrack(r):n.getTracks().forEach(s=>s.stop())}).catch(()=>{})}}close(){this.pcDeferred.promise.then(t=>{var n,r,s;for(const a of t.getTransceivers()??[])try{(s=(r=(n=a.sender)==null?void 0:n.track)==null?void 0:r.stop)==null||s.call(r)}catch{}t.close()}).catch(()=>{})}async createPeerConnection(t){var s;if(this.pc)return;const n=new RTCPeerConnection(t.configuration);this.pc=n,this._pcResolve(n);const r=()=>{QJ(n)&&this.close()};if(n.addEventListener("iceconnectionstatechange",r),await((s=this.onPeerConnection)==null?void 0:s.call(this,n)),t.datachannel){const a=n.createDataChannel(t.datachannel.label,t.datachannel.dict);a.binaryType="arraybuffer",this._dcResolve(a)}if(t.audio){const a=n.addTransceiver("audio",t.audio);(t.audio.direction==="sendrecv"||t.audio.direction==="sendonly")&&(this.microphone=a.sender)}if(t.video)if(t.video.direction==="sendrecv"||t.video.direction==="sendonly")try{const a=await navigator.mediaDevices.getUserMedia({video:!0});for(const l of a.getTracks())n.addTrack(l)}catch{}else n.addTransceiver("video",t.video)}async createLocalDescription(t,n,r){await this.createPeerConnection(n);const s=new Promise(l=>{this.pc.onicecandidate=h=>{h.candidate&&r?r(JSON.parse(JSON.stringify(h.candidate))):h.candidate||l()},this.pc.onicegatheringstatechange=()=>{this.pc.iceGatheringState==="complete"&&l()}}),a=l=>({type:l.type,sdp:l.sdp});if(t==="offer"){let l=this.pc.localDescription;return l?a(l):(l=await this.pc.createOffer({offerToReceiveAudio:!!n.audio,offerToReceiveVideo:!!n.video}),await this.pc.setLocalDescription(l),r||(await s,l=this.pc.localDescription??l),a(l??{type:"offer",sdp:""}))}else{const l=()=>this.pc.signalingState==="have-remote-offer"||this.pc.signalingState==="have-local-pranswer";if(!l()){const p=Date.now()+2500;await new Promise((x,b)=>{const w=()=>{if(l()){x();return}if(Date.now()>=p){b(new Error(`createAnswer: signalingState is ${this.pc.signalingState} (expected have-remote-offer). Remote offer may not have been set in time.`));return}setTimeout(w,80)};w()})}let h=await this.pc.createAnswer();return await this.pc.setLocalDescription(h),r||(await s,h=this.pc.localDescription??h),a(h??{type:"answer",sdp:""})}}async setRemoteDescription(t,n){await this.createPeerConnection(n),await this.pc.setRemoteDescription(t)}async addIceCandidate(t){await this.pc.addIceCandidate(t)}async endSession(){}}const Ui=X9((e,t)=>({prewarmedConnection:null,playerStartedConnection:{},playInProgressCameraId:null,setPrewarmedConnection:n=>e({prewarmedConnection:n}),consumePrewarmed:n=>{const r=t().prewarmedConnection;return(r==null?void 0:r.cameraId)!==n?null:(e({prewarmedConnection:null}),r)},markPlayerStarted:n=>e(r=>{var s;return{playerStartedConnection:{...r.playerStartedConnection,[n]:!0},prewarmedConnection:((s=r.prewarmedConnection)==null?void 0:s.cameraId)===n?null:r.prewarmedConnection}}),clearPlayerStarted:n=>e(r=>{const s={...r.playerStartedConnection};return delete s[n],{playerStartedConnection:s}}),setPlayInProgress:n=>e({playInProgressCameraId:n})}));var K2={},kp={},fE;function ZJ(){if(fE)return kp;fE=1,kp.byteLength=h,kp.toByteArray=p,kp.fromByteArray=w;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=r.length;s<a;++s)e[s]=r[s],t[r.charCodeAt(s)]=s;t[45]=62,t[95]=63;function l(E){var M=E.length;if(M%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var C=E.indexOf("=");C===-1&&(C=M);var S=C===M?0:4-C%4;return[C,S]}function h(E){var M=l(E),C=M[0],S=M[1];return(C+S)*3/4-S}function m(E,M,C){return(M+C)*3/4-C}function p(E){var M,C=l(E),S=C[0],_=C[1],N=new n(m(E,S,_)),c=0,j=_>0?S-4:S,D;for(D=0;D<j;D+=4)M=t[E.charCodeAt(D)]<<18|t[E.charCodeAt(D+1)]<<12|t[E.charCodeAt(D+2)]<<6|t[E.charCodeAt(D+3)],N[c++]=M>>16&255,N[c++]=M>>8&255,N[c++]=M&255;return _===2&&(M=t[E.charCodeAt(D)]<<2|t[E.charCodeAt(D+1)]>>4,N[c++]=M&255),_===1&&(M=t[E.charCodeAt(D)]<<10|t[E.charCodeAt(D+1)]<<4|t[E.charCodeAt(D+2)]>>2,N[c++]=M>>8&255,N[c++]=M&255),N}function x(E){return e[E>>18&63]+e[E>>12&63]+e[E>>6&63]+e[E&63]}function b(E,M,C){for(var S,_=[],N=M;N<C;N+=3)S=(E[N]<<16&16711680)+(E[N+1]<<8&65280)+(E[N+2]&255),_.push(x(S));return _.join("")}function w(E){for(var M,C=E.length,S=C%3,_=[],N=16383,c=0,j=C-S;c<j;c+=N)_.push(b(E,c,c+N>j?j:c+N));return S===1?(M=E[C-1],_.push(e[M>>2]+e[M<<4&63]+"==")):S===2&&(M=(E[C-2]<<8)+E[C-1],_.push(e[M>>10]+e[M>>4&63]+e[M<<2&63]+"=")),_.join("")}return kp}var Fy={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hE;function JJ(){return hE||(hE=1,Fy.read=function(e,t,n,r,s){var a,l,h=s*8-r-1,m=(1<<h)-1,p=m>>1,x=-7,b=n?s-1:0,w=n?-1:1,E=e[t+b];for(b+=w,a=E&(1<<-x)-1,E>>=-x,x+=h;x>0;a=a*256+e[t+b],b+=w,x-=8);for(l=a&(1<<-x)-1,a>>=-x,x+=r;x>0;l=l*256+e[t+b],b+=w,x-=8);if(a===0)a=1-p;else{if(a===m)return l?NaN:(E?-1:1)*(1/0);l=l+Math.pow(2,r),a=a-p}return(E?-1:1)*l*Math.pow(2,a-r)},Fy.write=function(e,t,n,r,s,a){var l,h,m,p=a*8-s-1,x=(1<<p)-1,b=x>>1,w=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=r?0:a-1,M=r?1:-1,C=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(h=isNaN(t)?1:0,l=x):(l=Math.floor(Math.log(t)/Math.LN2),t*(m=Math.pow(2,-l))<1&&(l--,m*=2),l+b>=1?t+=w/m:t+=w*Math.pow(2,1-b),t*m>=2&&(l++,m/=2),l+b>=x?(h=0,l=x):l+b>=1?(h=(t*m-1)*Math.pow(2,s),l=l+b):(h=t*Math.pow(2,b-1)*Math.pow(2,s),l=0));s>=8;e[n+E]=h&255,E+=M,h/=256,s-=8);for(l=l<<s|h,p+=s;p>0;e[n+E]=l&255,E+=M,l/=256,p-=8);e[n+E-M]|=C*128}),Fy}/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var mE;function eee(){return mE||(mE=1,function(e){const t=ZJ(),n=JJ(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=h,e.SlowBuffer=N,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,h.TYPED_ARRAY_SUPPORT=a(),!h.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const $=new Uint8Array(1),k={foo:function(){return 42}};return Object.setPrototypeOf(k,Uint8Array.prototype),Object.setPrototypeOf($,k),$.foo()===42}catch{return!1}}Object.defineProperty(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}});function l($){if($>s)throw new RangeError('The value "'+$+'" is invalid for option "size"');const k=new Uint8Array($);return Object.setPrototypeOf(k,h.prototype),k}function h($,k,z){if(typeof $=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b($)}return m($,k,z)}h.poolSize=8192;function m($,k,z){if(typeof $=="string")return w($,k);if(ArrayBuffer.isView($))return M($);if($==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(Ct($,ArrayBuffer)||$&&Ct($.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ct($,SharedArrayBuffer)||$&&Ct($.buffer,SharedArrayBuffer)))return C($,k,z);if(typeof $=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=$.valueOf&&$.valueOf();if(J!=null&&J!==$)return h.from(J,k,z);const le=S($);if(le)return le;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]=="function")return h.from($[Symbol.toPrimitive]("string"),k,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}h.from=function($,k,z){return m($,k,z)},Object.setPrototypeOf(h.prototype,Uint8Array.prototype),Object.setPrototypeOf(h,Uint8Array);function p($){if(typeof $!="number")throw new TypeError('"size" argument must be of type number');if($<0)throw new RangeError('The value "'+$+'" is invalid for option "size"')}function x($,k,z){return p($),$<=0?l($):k!==void 0?typeof z=="string"?l($).fill(k,z):l($).fill(k):l($)}h.alloc=function($,k,z){return x($,k,z)};function b($){return p($),l($<0?0:_($)|0)}h.allocUnsafe=function($){return b($)},h.allocUnsafeSlow=function($){return b($)};function w($,k){if((typeof k!="string"||k==="")&&(k="utf8"),!h.isEncoding(k))throw new TypeError("Unknown encoding: "+k);const z=c($,k)|0;let J=l(z);const le=J.write($,k);return le!==z&&(J=J.slice(0,le)),J}function E($){const k=$.length<0?0:_($.length)|0,z=l(k);for(let J=0;J<k;J+=1)z[J]=$[J]&255;return z}function M($){if(Ct($,Uint8Array)){const k=new Uint8Array($);return C(k.buffer,k.byteOffset,k.byteLength)}return E($)}function C($,k,z){if(k<0||$.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if($.byteLength<k+(z||0))throw new RangeError('"length" is outside of buffer bounds');let J;return k===void 0&&z===void 0?J=new Uint8Array($):z===void 0?J=new Uint8Array($,k):J=new Uint8Array($,k,z),Object.setPrototypeOf(J,h.prototype),J}function S($){if(h.isBuffer($)){const k=_($.length)|0,z=l(k);return z.length===0||$.copy(z,0,0,k),z}if($.length!==void 0)return typeof $.length!="number"||Ot($.length)?l(0):E($);if($.type==="Buffer"&&Array.isArray($.data))return E($.data)}function _($){if($>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return $|0}function N($){return+$!=$&&($=0),h.alloc(+$)}h.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==h.prototype},h.compare=function(k,z){if(Ct(k,Uint8Array)&&(k=h.from(k,k.offset,k.byteLength)),Ct(z,Uint8Array)&&(z=h.from(z,z.offset,z.byteLength)),!h.isBuffer(k)||!h.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===z)return 0;let J=k.length,le=z.length;for(let xe=0,Ae=Math.min(J,le);xe<Ae;++xe)if(k[xe]!==z[xe]){J=k[xe],le=z[xe];break}return J<le?-1:le<J?1:0},h.isEncoding=function(k){switch(String(k).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(k,z){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return h.alloc(0);let J;if(z===void 0)for(z=0,J=0;J<k.length;++J)z+=k[J].length;const le=h.allocUnsafe(z);let xe=0;for(J=0;J<k.length;++J){let Ae=k[J];if(Ct(Ae,Uint8Array))xe+Ae.length>le.length?(h.isBuffer(Ae)||(Ae=h.from(Ae)),Ae.copy(le,xe)):Uint8Array.prototype.set.call(le,Ae,xe);else if(h.isBuffer(Ae))Ae.copy(le,xe);else throw new TypeError('"list" argument must be an Array of Buffers');xe+=Ae.length}return le};function c($,k){if(h.isBuffer($))return $.length;if(ArrayBuffer.isView($)||Ct($,ArrayBuffer))return $.byteLength;if(typeof $!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);const z=$.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&z===0)return 0;let le=!1;for(;;)switch(k){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return tt($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return at($).length;default:if(le)return J?-1:tt($).length;k=(""+k).toLowerCase(),le=!0}}h.byteLength=c;function j($,k,z){let J=!1;if((k===void 0||k<0)&&(k=0),k>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,k>>>=0,z<=k))return"";for($||($="utf8");;)switch($){case"hex":return oe(this,k,z);case"utf8":case"utf-8":return se(this,k,z);case"ascii":return K(this,k,z);case"latin1":case"binary":return Z(this,k,z);case"base64":return G(this,k,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,k,z);default:if(J)throw new TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),J=!0}}h.prototype._isBuffer=!0;function D($,k,z){const J=$[k];$[k]=$[z],$[z]=J}h.prototype.swap16=function(){const k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<k;z+=2)D(this,z,z+1);return this},h.prototype.swap32=function(){const k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<k;z+=4)D(this,z,z+3),D(this,z+1,z+2);return this},h.prototype.swap64=function(){const k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<k;z+=8)D(this,z,z+7),D(this,z+1,z+6),D(this,z+2,z+5),D(this,z+3,z+4);return this},h.prototype.toString=function(){const k=this.length;return k===0?"":arguments.length===0?se(this,0,k):j.apply(this,arguments)},h.prototype.toLocaleString=h.prototype.toString,h.prototype.equals=function(k){if(!h.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:h.compare(this,k)===0},h.prototype.inspect=function(){let k="";const z=e.INSPECT_MAX_BYTES;return k=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&(k+=" ... "),"<Buffer "+k+">"},r&&(h.prototype[r]=h.prototype.inspect),h.prototype.compare=function(k,z,J,le,xe){if(Ct(k,Uint8Array)&&(k=h.from(k,k.offset,k.byteLength)),!h.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if(z===void 0&&(z=0),J===void 0&&(J=k?k.length:0),le===void 0&&(le=0),xe===void 0&&(xe=this.length),z<0||J>k.length||le<0||xe>this.length)throw new RangeError("out of range index");if(le>=xe&&z>=J)return 0;if(le>=xe)return-1;if(z>=J)return 1;if(z>>>=0,J>>>=0,le>>>=0,xe>>>=0,this===k)return 0;let Ae=xe-le,wt=J-z;const Mt=Math.min(Ae,wt),nt=this.slice(le,xe),pt=k.slice(z,J);for(let Bt=0;Bt<Mt;++Bt)if(nt[Bt]!==pt[Bt]){Ae=nt[Bt],wt=pt[Bt];break}return Ae<wt?-1:wt<Ae?1:0};function B($,k,z,J,le){if($.length===0)return-1;if(typeof z=="string"?(J=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,Ot(z)&&(z=le?0:$.length-1),z<0&&(z=$.length+z),z>=$.length){if(le)return-1;z=$.length-1}else if(z<0)if(le)z=0;else return-1;if(typeof k=="string"&&(k=h.from(k,J)),h.isBuffer(k))return k.length===0?-1:T($,k,z,J,le);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?le?Uint8Array.prototype.indexOf.call($,k,z):Uint8Array.prototype.lastIndexOf.call($,k,z):T($,[k],z,J,le);throw new TypeError("val must be string, number or Buffer")}function T($,k,z,J,le){let xe=1,Ae=$.length,wt=k.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if($.length<2||k.length<2)return-1;xe=2,Ae/=2,wt/=2,z/=2}function Mt(pt,Bt){return xe===1?pt[Bt]:pt.readUInt16BE(Bt*xe)}let nt;if(le){let pt=-1;for(nt=z;nt<Ae;nt++)if(Mt($,nt)===Mt(k,pt===-1?0:nt-pt)){if(pt===-1&&(pt=nt),nt-pt+1===wt)return pt*xe}else pt!==-1&&(nt-=nt-pt),pt=-1}else for(z+wt>Ae&&(z=Ae-wt),nt=z;nt>=0;nt--){let pt=!0;for(let Bt=0;Bt<wt;Bt++)if(Mt($,nt+Bt)!==Mt(k,Bt)){pt=!1;break}if(pt)return nt}return-1}h.prototype.includes=function(k,z,J){return this.indexOf(k,z,J)!==-1},h.prototype.indexOf=function(k,z,J){return B(this,k,z,J,!0)},h.prototype.lastIndexOf=function(k,z,J){return B(this,k,z,J,!1)};function A($,k,z,J){z=Number(z)||0;const le=$.length-z;J?(J=Number(J),J>le&&(J=le)):J=le;const xe=k.length;J>xe/2&&(J=xe/2);let Ae;for(Ae=0;Ae<J;++Ae){const wt=parseInt(k.substr(Ae*2,2),16);if(Ot(wt))return Ae;$[z+Ae]=wt}return Ae}function H($,k,z,J){return ot(tt(k,$.length-z),$,z,J)}function F($,k,z,J){return ot(mt(k),$,z,J)}function V($,k,z,J){return ot(at(k),$,z,J)}function ee($,k,z,J){return ot(Xe(k,$.length-z),$,z,J)}h.prototype.write=function(k,z,J,le){if(z===void 0)le="utf8",J=this.length,z=0;else if(J===void 0&&typeof z=="string")le=z,J=this.length,z=0;else if(isFinite(z))z=z>>>0,isFinite(J)?(J=J>>>0,le===void 0&&(le="utf8")):(le=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const xe=this.length-z;if((J===void 0||J>xe)&&(J=xe),k.length>0&&(J<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");le||(le="utf8");let Ae=!1;for(;;)switch(le){case"hex":return A(this,k,z,J);case"utf8":case"utf-8":return H(this,k,z,J);case"ascii":case"latin1":case"binary":return F(this,k,z,J);case"base64":return V(this,k,z,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,k,z,J);default:if(Ae)throw new TypeError("Unknown encoding: "+le);le=(""+le).toLowerCase(),Ae=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function G($,k,z){return k===0&&z===$.length?t.fromByteArray($):t.fromByteArray($.slice(k,z))}function se($,k,z){z=Math.min($.length,z);const J=[];let le=k;for(;le<z;){const xe=$[le];let Ae=null,wt=xe>239?4:xe>223?3:xe>191?2:1;if(le+wt<=z){let Mt,nt,pt,Bt;switch(wt){case 1:xe<128&&(Ae=xe);break;case 2:Mt=$[le+1],(Mt&192)===128&&(Bt=(xe&31)<<6|Mt&63,Bt>127&&(Ae=Bt));break;case 3:Mt=$[le+1],nt=$[le+2],(Mt&192)===128&&(nt&192)===128&&(Bt=(xe&15)<<12|(Mt&63)<<6|nt&63,Bt>2047&&(Bt<55296||Bt>57343)&&(Ae=Bt));break;case 4:Mt=$[le+1],nt=$[le+2],pt=$[le+3],(Mt&192)===128&&(nt&192)===128&&(pt&192)===128&&(Bt=(xe&15)<<18|(Mt&63)<<12|(nt&63)<<6|pt&63,Bt>65535&&Bt<1114112&&(Ae=Bt))}}Ae===null?(Ae=65533,wt=1):Ae>65535&&(Ae-=65536,J.push(Ae>>>10&1023|55296),Ae=56320|Ae&1023),J.push(Ae),le+=wt}return te(J)}const Ce=4096;function te($){const k=$.length;if(k<=Ce)return String.fromCharCode.apply(String,$);let z="",J=0;for(;J<k;)z+=String.fromCharCode.apply(String,$.slice(J,J+=Ce));return z}function K($,k,z){let J="";z=Math.min($.length,z);for(let le=k;le<z;++le)J+=String.fromCharCode($[le]&127);return J}function Z($,k,z){let J="";z=Math.min($.length,z);for(let le=k;le<z;++le)J+=String.fromCharCode($[le]);return J}function oe($,k,z){const J=$.length;(!k||k<0)&&(k=0),(!z||z<0||z>J)&&(z=J);let le="";for(let xe=k;xe<z;++xe)le+=kn[$[xe]];return le}function Y($,k,z){const J=$.slice(k,z);let le="";for(let xe=0;xe<J.length-1;xe+=2)le+=String.fromCharCode(J[xe]+J[xe+1]*256);return le}h.prototype.slice=function(k,z){const J=this.length;k=~~k,z=z===void 0?J:~~z,k<0?(k+=J,k<0&&(k=0)):k>J&&(k=J),z<0?(z+=J,z<0&&(z=0)):z>J&&(z=J),z<k&&(z=k);const le=this.subarray(k,z);return Object.setPrototypeOf(le,h.prototype),le};function ne($,k,z){if($%1!==0||$<0)throw new RangeError("offset is not uint");if($+k>z)throw new RangeError("Trying to access beyond buffer length")}h.prototype.readUintLE=h.prototype.readUIntLE=function(k,z,J){k=k>>>0,z=z>>>0,J||ne(k,z,this.length);let le=this[k],xe=1,Ae=0;for(;++Ae<z&&(xe*=256);)le+=this[k+Ae]*xe;return le},h.prototype.readUintBE=h.prototype.readUIntBE=function(k,z,J){k=k>>>0,z=z>>>0,J||ne(k,z,this.length);let le=this[k+--z],xe=1;for(;z>0&&(xe*=256);)le+=this[k+--z]*xe;return le},h.prototype.readUint8=h.prototype.readUInt8=function(k,z){return k=k>>>0,z||ne(k,1,this.length),this[k]},h.prototype.readUint16LE=h.prototype.readUInt16LE=function(k,z){return k=k>>>0,z||ne(k,2,this.length),this[k]|this[k+1]<<8},h.prototype.readUint16BE=h.prototype.readUInt16BE=function(k,z){return k=k>>>0,z||ne(k,2,this.length),this[k]<<8|this[k+1]},h.prototype.readUint32LE=h.prototype.readUInt32LE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},h.prototype.readUint32BE=h.prototype.readUInt32BE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},h.prototype.readBigUInt64LE=_t(function(k){k=k>>>0,Ke(k,"offset");const z=this[k],J=this[k+7];(z===void 0||J===void 0)&&ae(k,this.length-8);const le=z+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24,xe=this[++k]+this[++k]*2**8+this[++k]*2**16+J*2**24;return BigInt(le)+(BigInt(xe)<<BigInt(32))}),h.prototype.readBigUInt64BE=_t(function(k){k=k>>>0,Ke(k,"offset");const z=this[k],J=this[k+7];(z===void 0||J===void 0)&&ae(k,this.length-8);const le=z*2**24+this[++k]*2**16+this[++k]*2**8+this[++k],xe=this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J;return(BigInt(le)<<BigInt(32))+BigInt(xe)}),h.prototype.readIntLE=function(k,z,J){k=k>>>0,z=z>>>0,J||ne(k,z,this.length);let le=this[k],xe=1,Ae=0;for(;++Ae<z&&(xe*=256);)le+=this[k+Ae]*xe;return xe*=128,le>=xe&&(le-=Math.pow(2,8*z)),le},h.prototype.readIntBE=function(k,z,J){k=k>>>0,z=z>>>0,J||ne(k,z,this.length);let le=z,xe=1,Ae=this[k+--le];for(;le>0&&(xe*=256);)Ae+=this[k+--le]*xe;return xe*=128,Ae>=xe&&(Ae-=Math.pow(2,8*z)),Ae},h.prototype.readInt8=function(k,z){return k=k>>>0,z||ne(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},h.prototype.readInt16LE=function(k,z){k=k>>>0,z||ne(k,2,this.length);const J=this[k]|this[k+1]<<8;return J&32768?J|4294901760:J},h.prototype.readInt16BE=function(k,z){k=k>>>0,z||ne(k,2,this.length);const J=this[k+1]|this[k]<<8;return J&32768?J|4294901760:J},h.prototype.readInt32LE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},h.prototype.readInt32BE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},h.prototype.readBigInt64LE=_t(function(k){k=k>>>0,Ke(k,"offset");const z=this[k],J=this[k+7];(z===void 0||J===void 0)&&ae(k,this.length-8);const le=this[k+4]+this[k+5]*2**8+this[k+6]*2**16+(J<<24);return(BigInt(le)<<BigInt(32))+BigInt(z+this[++k]*2**8+this[++k]*2**16+this[++k]*2**24)}),h.prototype.readBigInt64BE=_t(function(k){k=k>>>0,Ke(k,"offset");const z=this[k],J=this[k+7];(z===void 0||J===void 0)&&ae(k,this.length-8);const le=(z<<24)+this[++k]*2**16+this[++k]*2**8+this[++k];return(BigInt(le)<<BigInt(32))+BigInt(this[++k]*2**24+this[++k]*2**16+this[++k]*2**8+J)}),h.prototype.readFloatLE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),n.read(this,k,!0,23,4)},h.prototype.readFloatBE=function(k,z){return k=k>>>0,z||ne(k,4,this.length),n.read(this,k,!1,23,4)},h.prototype.readDoubleLE=function(k,z){return k=k>>>0,z||ne(k,8,this.length),n.read(this,k,!0,52,8)},h.prototype.readDoubleBE=function(k,z){return k=k>>>0,z||ne(k,8,this.length),n.read(this,k,!1,52,8)};function X($,k,z,J,le,xe){if(!h.isBuffer($))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>le||k<xe)throw new RangeError('"value" argument is out of bounds');if(z+J>$.length)throw new RangeError("Index out of range")}h.prototype.writeUintLE=h.prototype.writeUIntLE=function(k,z,J,le){if(k=+k,z=z>>>0,J=J>>>0,!le){const wt=Math.pow(2,8*J)-1;X(this,k,z,J,wt,0)}let xe=1,Ae=0;for(this[z]=k&255;++Ae<J&&(xe*=256);)this[z+Ae]=k/xe&255;return z+J},h.prototype.writeUintBE=h.prototype.writeUIntBE=function(k,z,J,le){if(k=+k,z=z>>>0,J=J>>>0,!le){const wt=Math.pow(2,8*J)-1;X(this,k,z,J,wt,0)}let xe=J-1,Ae=1;for(this[z+xe]=k&255;--xe>=0&&(Ae*=256);)this[z+xe]=k/Ae&255;return z+J},h.prototype.writeUint8=h.prototype.writeUInt8=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,1,255,0),this[z]=k&255,z+1},h.prototype.writeUint16LE=h.prototype.writeUInt16LE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,2,65535,0),this[z]=k&255,this[z+1]=k>>>8,z+2},h.prototype.writeUint16BE=h.prototype.writeUInt16BE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,2,65535,0),this[z]=k>>>8,this[z+1]=k&255,z+2},h.prototype.writeUint32LE=h.prototype.writeUInt32LE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,4,4294967295,0),this[z+3]=k>>>24,this[z+2]=k>>>16,this[z+1]=k>>>8,this[z]=k&255,z+4},h.prototype.writeUint32BE=h.prototype.writeUInt32BE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,4,4294967295,0),this[z]=k>>>24,this[z+1]=k>>>16,this[z+2]=k>>>8,this[z+3]=k&255,z+4};function ue($,k,z,J,le){Ee(k,J,le,$,z,7);let xe=Number(k&BigInt(4294967295));$[z++]=xe,xe=xe>>8,$[z++]=xe,xe=xe>>8,$[z++]=xe,xe=xe>>8,$[z++]=xe;let Ae=Number(k>>BigInt(32)&BigInt(4294967295));return $[z++]=Ae,Ae=Ae>>8,$[z++]=Ae,Ae=Ae>>8,$[z++]=Ae,Ae=Ae>>8,$[z++]=Ae,z}function pe($,k,z,J,le){Ee(k,J,le,$,z,7);let xe=Number(k&BigInt(4294967295));$[z+7]=xe,xe=xe>>8,$[z+6]=xe,xe=xe>>8,$[z+5]=xe,xe=xe>>8,$[z+4]=xe;let Ae=Number(k>>BigInt(32)&BigInt(4294967295));return $[z+3]=Ae,Ae=Ae>>8,$[z+2]=Ae,Ae=Ae>>8,$[z+1]=Ae,Ae=Ae>>8,$[z]=Ae,z+8}h.prototype.writeBigUInt64LE=_t(function(k,z=0){return ue(this,k,z,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeBigUInt64BE=_t(function(k,z=0){return pe(this,k,z,BigInt(0),BigInt("0xffffffffffffffff"))}),h.prototype.writeIntLE=function(k,z,J,le){if(k=+k,z=z>>>0,!le){const Mt=Math.pow(2,8*J-1);X(this,k,z,J,Mt-1,-Mt)}let xe=0,Ae=1,wt=0;for(this[z]=k&255;++xe<J&&(Ae*=256);)k<0&&wt===0&&this[z+xe-1]!==0&&(wt=1),this[z+xe]=(k/Ae>>0)-wt&255;return z+J},h.prototype.writeIntBE=function(k,z,J,le){if(k=+k,z=z>>>0,!le){const Mt=Math.pow(2,8*J-1);X(this,k,z,J,Mt-1,-Mt)}let xe=J-1,Ae=1,wt=0;for(this[z+xe]=k&255;--xe>=0&&(Ae*=256);)k<0&&wt===0&&this[z+xe+1]!==0&&(wt=1),this[z+xe]=(k/Ae>>0)-wt&255;return z+J},h.prototype.writeInt8=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,1,127,-128),k<0&&(k=255+k+1),this[z]=k&255,z+1},h.prototype.writeInt16LE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,2,32767,-32768),this[z]=k&255,this[z+1]=k>>>8,z+2},h.prototype.writeInt16BE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,2,32767,-32768),this[z]=k>>>8,this[z+1]=k&255,z+2},h.prototype.writeInt32LE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,4,2147483647,-2147483648),this[z]=k&255,this[z+1]=k>>>8,this[z+2]=k>>>16,this[z+3]=k>>>24,z+4},h.prototype.writeInt32BE=function(k,z,J){return k=+k,z=z>>>0,J||X(this,k,z,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[z]=k>>>24,this[z+1]=k>>>16,this[z+2]=k>>>8,this[z+3]=k&255,z+4},h.prototype.writeBigInt64LE=_t(function(k,z=0){return ue(this,k,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),h.prototype.writeBigInt64BE=_t(function(k,z=0){return pe(this,k,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Se($,k,z,J,le,xe){if(z+J>$.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function Re($,k,z,J,le){return k=+k,z=z>>>0,le||Se($,k,z,4),n.write($,k,z,J,23,4),z+4}h.prototype.writeFloatLE=function(k,z,J){return Re(this,k,z,!0,J)},h.prototype.writeFloatBE=function(k,z,J){return Re(this,k,z,!1,J)};function ye($,k,z,J,le){return k=+k,z=z>>>0,le||Se($,k,z,8),n.write($,k,z,J,52,8),z+8}h.prototype.writeDoubleLE=function(k,z,J){return ye(this,k,z,!0,J)},h.prototype.writeDoubleBE=function(k,z,J){return ye(this,k,z,!1,J)},h.prototype.copy=function(k,z,J,le){if(!h.isBuffer(k))throw new TypeError("argument should be a Buffer");if(J||(J=0),!le&&le!==0&&(le=this.length),z>=k.length&&(z=k.length),z||(z=0),le>0&&le<J&&(le=J),le===J||k.length===0||this.length===0)return 0;if(z<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(le<0)throw new RangeError("sourceEnd out of bounds");le>this.length&&(le=this.length),k.length-z<le-J&&(le=k.length-z+J);const xe=le-J;return this===k&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(z,J,le):Uint8Array.prototype.set.call(k,this.subarray(J,le),z),xe},h.prototype.fill=function(k,z,J,le){if(typeof k=="string"){if(typeof z=="string"?(le=z,z=0,J=this.length):typeof J=="string"&&(le=J,J=this.length),le!==void 0&&typeof le!="string")throw new TypeError("encoding must be a string");if(typeof le=="string"&&!h.isEncoding(le))throw new TypeError("Unknown encoding: "+le);if(k.length===1){const Ae=k.charCodeAt(0);(le==="utf8"&&Ae<128||le==="latin1")&&(k=Ae)}}else typeof k=="number"?k=k&255:typeof k=="boolean"&&(k=Number(k));if(z<0||this.length<z||this.length<J)throw new RangeError("Out of range index");if(J<=z)return this;z=z>>>0,J=J===void 0?this.length:J>>>0,k||(k=0);let xe;if(typeof k=="number")for(xe=z;xe<J;++xe)this[xe]=k;else{const Ae=h.isBuffer(k)?k:h.from(k,le),wt=Ae.length;if(wt===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(xe=0;xe<J-z;++xe)this[xe+z]=Ae[xe%wt]}return this};const ve={};function he($,k,z){ve[$]=class extends z{constructor(){super(),Object.defineProperty(this,"message",{value:k.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(le){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:le,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}he("ERR_BUFFER_OUT_OF_BOUNDS",function($){return $?`${$} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),he("ERR_INVALID_ARG_TYPE",function($,k){return`The "${$}" argument must be of type number. Received type ${typeof k}`},TypeError),he("ERR_OUT_OF_RANGE",function($,k,z){let J=`The value of "${$}" is out of range.`,le=z;return Number.isInteger(z)&&Math.abs(z)>2**32?le=de(String(z)):typeof z=="bigint"&&(le=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(le=de(le)),le+="n"),J+=` It must be ${k}. Received ${le}`,J},RangeError);function de($){let k="",z=$.length;const J=$[0]==="-"?1:0;for(;z>=J+4;z-=3)k=`_${$.slice(z-3,z)}${k}`;return`${$.slice(0,z)}${k}`}function ke($,k,z){Ke(k,"offset"),($[k]===void 0||$[k+z]===void 0)&&ae(k,$.length-(z+1))}function Ee($,k,z,J,le,xe){if($>z||$<k){const Ae=typeof k=="bigint"?"n":"";let wt;throw k===0||k===BigInt(0)?wt=`>= 0${Ae} and < 2${Ae} ** ${(xe+1)*8}${Ae}`:wt=`>= -(2${Ae} ** ${(xe+1)*8-1}${Ae}) and < 2 ** ${(xe+1)*8-1}${Ae}`,new ve.ERR_OUT_OF_RANGE("value",wt,$)}ke(J,le,xe)}function Ke($,k){if(typeof $!="number")throw new ve.ERR_INVALID_ARG_TYPE(k,"number",$)}function ae($,k,z){throw Math.floor($)!==$?(Ke($,z),new ve.ERR_OUT_OF_RANGE("offset","an integer",$)):k<0?new ve.ERR_BUFFER_OUT_OF_BOUNDS:new ve.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${k}`,$)}const We=/[^+/0-9A-Za-z-_]/g;function bt($){if($=$.split("=")[0],$=$.trim().replace(We,""),$.length<2)return"";for(;$.length%4!==0;)$=$+"=";return $}function tt($,k){k=k||1/0;let z;const J=$.length;let le=null;const xe=[];for(let Ae=0;Ae<J;++Ae){if(z=$.charCodeAt(Ae),z>55295&&z<57344){if(!le){if(z>56319){(k-=3)>-1&&xe.push(239,191,189);continue}else if(Ae+1===J){(k-=3)>-1&&xe.push(239,191,189);continue}le=z;continue}if(z<56320){(k-=3)>-1&&xe.push(239,191,189),le=z;continue}z=(le-55296<<10|z-56320)+65536}else le&&(k-=3)>-1&&xe.push(239,191,189);if(le=null,z<128){if((k-=1)<0)break;xe.push(z)}else if(z<2048){if((k-=2)<0)break;xe.push(z>>6|192,z&63|128)}else if(z<65536){if((k-=3)<0)break;xe.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((k-=4)<0)break;xe.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return xe}function mt($){const k=[];for(let z=0;z<$.length;++z)k.push($.charCodeAt(z)&255);return k}function Xe($,k){let z,J,le;const xe=[];for(let Ae=0;Ae<$.length&&!((k-=2)<0);++Ae)z=$.charCodeAt(Ae),J=z>>8,le=z%256,xe.push(le),xe.push(J);return xe}function at($){return t.toByteArray(bt($))}function ot($,k,z,J){let le;for(le=0;le<J&&!(le+z>=k.length||le>=$.length);++le)k[le+z]=$[le];return le}function Ct($,k){return $ instanceof k||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===k.name}function Ot($){return $!==$}const kn=function(){const $="0123456789abcdef",k=new Array(256);for(let z=0;z<16;++z){const J=z*16;for(let le=0;le<16;++le)k[J+le]=$[z]+$[le]}return k}();function _t($){return typeof BigInt>"u"?kt:$}function kt(){throw new Error("BigInt not supported")}}(K2)),K2}var Yl=eee();const pE=0,tee=1,nee=16384;class Fx{constructor(t,n,r){et(this,"selfName");et(this,"peerName");et(this,"send");et(this,"pendingResults",{});et(this,"localProxyMap",new Map);et(this,"objectToId",new WeakMap);et(this,"_killed",!1);this.selfName=t,this.peerName=n,this.send=r}registerLocalObject(t){const n=Fx.generateId();return this.localProxyMap.set(n,t),this.objectToId.set(t,n),n}sendResult(t,n){const r=n??{};try{let s;t.throw&&t.result instanceof Error?s={__remote_constructor_name:"RPCResultError",__serialized_value:{message:t.result.message,name:t.result.name,stack:t.result.stack}}:s=this.serialize(t.result,r),this.send({...t,result:s},void 0,r)}catch(s){this.send({type:"result",id:t.id,throw:!0,result:{__remote_constructor_name:"RPCResultError",__serialized_value:{message:s instanceof Error?s.message:String(s),name:s instanceof Error?s.name:"Error",stack:s instanceof Error?s.stack:void 0}}},void 0,r)}}static generateId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return[...Array(8)].map(()=>t.charAt(Math.floor(Math.random()*t.length))).join("")}kill(t){if(this._killed)return;this._killed=!0;const n=new Error(t);for(const r of Object.values(this.pendingResults))r.reject(n);this.pendingResults={}}createPendingResult(t,n){return this._killed?Promise.reject(new Error("RpcPeer killed")):new Promise((r,s)=>{const a=Fx.generateId();this.pendingResults[a]={resolve:r,reject:s,method:t},n(a,l=>s(l))})}getParam(t){return this.createPendingResult("getParam",(n,r)=>{this.send({id:n,type:"param",param:t},r)})}serialize(t,n){if(t==null||typeof t=="number"||typeof t=="string"||typeof t=="boolean")return t;if(typeof t=="object"&&t!==null){const r=this.objectToId.get(t);if(r!==void 0)return{__remote_proxy_id:r,__remote_constructor_name:"Object"}}if(Yl.Buffer.isBuffer(t))return{__remote_constructor_name:"Buffer",__serialized_value:t};if(Array.isArray(t))return t.map(r=>this.serialize(r,n));if(typeof t=="object"&&t!==null){const r={};for(const[s,a]of Object.entries(t))r[s]=this.serialize(a,n);return r}return t}deserialize(t,n){if(t==null||typeof t!="object"||t===null)return t;const r=t,s=r.__remote_proxy_id,a=r.__remote_constructor_name;if(s&&(a==="Function"||a==="AsyncFunction"))return this.createRemoteProxy(s);if(Array.isArray(r))return r.map(h=>this.deserialize(h,n));if(r.__remote_constructor_name==="RPCResultError"){const h=r.__serialized_value,m=new Error((h==null?void 0:h.message)??"RPC error");return h!=null&&h.name&&(m.name=h.name),h!=null&&h.stack&&(m.stack=h.stack),m}const l={};for(const[h,m]of Object.entries(r))h.startsWith("__remote_")||h.startsWith("__local_")||h==="__serialized_value"||(l[h]=this.deserialize(m,n));return l}createRemoteProxy(t){const n=this;return function(...r){return n.createPendingResult("apply",(s,a)=>{const l={},h=r.map(m=>n.serialize(m,l));n.send({type:"apply",id:s,proxyId:t,args:h,method:null},a,l)})}}handleMessage(t,n){if(this._killed)return;const r=t.type;if(r==="result"){const s=t.id,a=this.pendingResults[s];if(!a){console.warn("[webrtc-datachannel-rpc] unknown result id",s);return}delete this.pendingResults[s];const l=this.deserialize(t.result,n);t.throw?a.reject(l instanceof Error?l:new Error(String(l))):a.resolve(l);return}if(r==="apply"){const s=t.proxyId,a=t.method,l=t.args??[],h=!!t.oneway,m=t.id??"",p=this.localProxyMap.get(s);if(!p){console.warn("[webrtc-datachannel-rpc] apply: proxy id not found",s);return}const x={type:"result",id:m},b={};Promise.resolve().then(()=>{const w=l.map(E=>this.deserialize(E,n));if(a){const E=p[a];if(typeof E!="function")throw new Error(`target has no method ${a}`);return E.apply(p,w)}return p(...w)}).then(w=>{x.result=w,h||this.sendResult(x,b)}).catch(w=>{x.throw=!0,x.result=w instanceof Error?w:new Error(String(w)),h||this.sendResult(x,b)});return}}}function ree(e){let t=[];function n(){if(t.length===0)return;const r=t;t=[];for(const s of r){let a=0;for(;a<s.length;){const l=s.subarray(a,Math.min(a+nee,s.length));e.send(l),a+=l.length}}}return{write(r){const s=t.length>0;t.push(r),s||setTimeout(n,0)}}}function iee(e){const t=ree(e),n=(x,b)=>{const w=Yl.Buffer.alloc(5);w.writeUInt32BE(b.length+1,0),w.writeUInt8(x,4);const E=b.length>0?Yl.Buffer.concat([w,Yl.Buffer.from(b)]):Yl.Buffer.from(w);t.write(new Uint8Array(E))},r=x=>{n(tee,x)},s=x=>{n(pE,Yl.Buffer.from(JSON.stringify(x),"utf8"))};let a=null,l;const h=(x,b,w)=>{const E=w==null?void 0:w.buffers;if(E!=null&&E.length)for(const M of E)r(M instanceof Yl.Buffer?new Uint8Array(M):M);s(x)};let m=null;return{onData:x=>{const b=x instanceof Yl.Buffer?new Uint8Array(x):x;for(m=m?(()=>{const w=new Uint8Array(m.length+b.length);return w.set(m),w.set(b,m.length),w})():b.slice(0);;){if(!m||m.length<5)return;const w=new DataView(m.buffer,m.byteOffset,4).getUint32(0,!1)-1,E=m[4];if(m.length<5+w)return;const M=m.subarray(5,5+w);if(m=m.length===5+w?null:m.subarray(5+w),E===pE)try{const C=JSON.parse(new TextDecoder().decode(M));l=void 0,a==null||a.handleMessage(C,l)}catch{a==null||a.kill("message parse failure")}else l=l||{},l.buffers=l.buffers||[],l.buffers.push(M.slice(0))}},setupRpcPeer(x){a=x},sendMessage:h}}function see(e){const t=iee(e),n=new Fx("webrtc-client","webrtc-plugin",t.sendMessage);return t.setupRpcPeer(n),e.binaryType="arraybuffer",e.onmessage=r=>{r.data instanceof ArrayBuffer&&t.onData(new Uint8Array(r.data))},{rpcPeer:n,transport:t}}function gE(e){if(e.iceConnectionState==="connected")return Promise.resolve();const t=["disconnected","failed","closed"];return t.includes(e.iceConnectionState)?Promise.reject(new Error(`iceConnectionState ${e.iceConnectionState}`)):new Promise((n,r)=>{const s=()=>{e.iceConnectionState==="connected"?(e.removeEventListener("iceconnectionstatechange",s),n()):t.includes(e.iceConnectionState)&&(e.removeEventListener("iceconnectionstatechange",s),r(new Error(`iceConnectionState ${e.iceConnectionState}`)))};e.addEventListener("iceconnectionstatechange",s)})}const tN=y.createContext(null),oee=/RpcPeer has been killed|rpc.*killed/i,vE=5;let yo=null,cx=null;function aee(){return cx||(cx=new Promise(e=>{yo=e})),cx}function lee(){yo&&(yo(null),yo=null),cx=null}let yE=Promise.resolve();function cee(e){const t=yE;let n;return yE=new Promise(r=>n=r),t.then(()=>e()).finally(()=>n())}function uee({client:e,children:t}){const n=t4(),[r,s]=y.useState(null),[a,l]=y.useState(0),[h,m]=y.useState(0),p=y.useRef(!1),x=y.useRef(null),b=y.useRef(!1),w=y.useMemo(()=>aee(),[h]);y.useEffect(()=>{if(e!=null){b.current=!0;return}s(null),p.current=!1,b.current&&(b.current=!1,lee(),m(M=>M+1))},[e]),y.useEffect(()=>{const M="[SharedRtc]";if(!e||p.current)return;p.current=!0;const C=e.mediaManager;if(typeof C.createMediaObject!="function"){console.log(M,"mediaManager.createMediaObject not available, shared connection disabled");return}console.log(M,"starting shared RTC setup (createMediaObject + convertMediaObject)...");const S=new eN;let _,N;const c=new Promise((B,T)=>{_=B,N=T});let j=!1;const D=(B,T)=>{if(!j){j=!0,console.log(M,"data channel from",T,", setting up RPC...");try{const{rpcPeer:A}=see(B),H={setRemoteDescription(F,V){return S.setRemoteDescription(F,V??{})},addIceCandidate(F){return S.addIceCandidate(F)}};A.registerLocalObject(H),A.getParam("connectRPCObject").then(F=>{typeof F=="function"?(F(H),_(F),console.log(M,"connectRPCObject wired (signaling wrapper passed)")):N(new Error("connectRPCObject not a function"))}).catch(N)}catch(A){N(A instanceof Error?A:new Error(String(A)))}}};return S.onPeerConnection=B=>(B.addEventListener("datachannel",T=>D(T.channel,"server")),Promise.resolve()),S.dcDeferred.promise.then(B=>D(B,"client")).catch(()=>{}),C.createMediaObject(S,Ft.ScryptedMimeTypes.RTCSignalingSession).then(B=>(console.log(M,"createMediaObject(RTCSignalingSession) ok, converting to RTCConnectionManagement..."),C.convertMediaObject(B,Ft.ScryptedMimeTypes.RTCConnectionManagement))).then(B=>{const T=B;if(typeof(T==null?void 0:T.probe)!="function"||typeof(T==null?void 0:T.addTrack)!="function"){console.warn(M,"convertMediaObject returned object without probe/addTrack, skipping");return}T.connectRPCObject=async F=>(await c)(F),console.log(M,"convertMediaObject ok, waiting for data channel RPC...");const A=15e3;return Promise.race([c,new Promise((F,V)=>setTimeout(()=>V(new Error("data channel RPC timeout")),A))]).then(()=>(console.log(M,"connectRPCObject ready, calling probe()..."),T.probe())).then(async()=>{console.log(M,"probe() ok, waiting for ICE connected...");const F=await S.pcDeferred.promise;return await gE(F),console.log(M,"ICE connected, shared connection ready for addTrack"),{session:S,connectionManagement:T,pcPromise:S.pcDeferred.promise.then(V=>gE(V).then(()=>V))}})}).then(B=>{B&&s(B),yo==null||yo(B??null),yo=null}).catch(B=>{yo==null||yo(null),yo=null;const T=B instanceof Error?B.message:String(B);if(oee.test(T)){p.current=!1,console.warn(M,"shared RTC setup failed (client/RPC disconnected):",T,"- reconnecting API and will retry"),n();const H=2e3;x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{x.current=null,l(F=>F<vE?F+1:F)},H)}else console.warn(M,"shared RTC setup failed (will use per-camera connection):",B)}),()=>{x.current&&(clearTimeout(x.current),x.current=null)}},[e,a]),y.useEffect(()=>{if(!e)return;const M=()=>{document.visibilityState==="visible"&&r==null&&(p.current=!1,l(C=>C<vE?C+1:C))};return document.addEventListener("visibilitychange",M),()=>document.removeEventListener("visibilitychange",M)},[e,r]);const E=y.useMemo(()=>({connection:r,readyPromise:w}),[r]);return f.jsx(tN.Provider,{value:E,children:t})}function dee(){return y.useContext(tN)}let Jh=null;function xE(){var e;if(Jh!==null)return Jh;try{if(typeof MediaSource<"u"&&((e=MediaSource.isTypeSupported)!=null&&e.call(MediaSource,'video/mp4; codecs="hvc1.1.6.L93.B0"')))return Jh=!0,!0}catch{}try{const n=document.createElement("video").canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"');Jh=n==="probably"||n==="maybe"}catch{Jh=!1}return Jh}const fee=!0,bE=25e3,hee=45e3,mee=15e3,pee=5e3,gee=80,vee=450,yee=6e3,xee=15e3;function bee(){if(typeof navigator>"u")return!1;const e=/iPad|iPhone|iPod/.test(navigator.userAgent),t=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0;return e&&t}function Pp(e){const t=e instanceof Error?e.message:String(e??"");return/backchannel|ONVIF.*audio|audio.*backchannel|engine\.io|hikvision/i.test(t)}function Zp({camera:e,deviceState:t,destination:n,muted:r,microphone:s,playOnOpen:a,showObjectDetection:l=!1,loadingSnapshotUrl:h=null,onSnapshotNeeded:m,playAllTrigger:p,pauseAllTrigger:x,onPlayingChange:b,onMutedChange:w,muteAllTrigger:E,unmuteAllTrigger:M}){var gl,Us,vl,Wi;const C=qi(),S=t4(),_=`[WebRTC ${(e==null?void 0:e.name)??(e==null?void 0:e.id)}]`,[N,c]=y.useState(!1),[j,D]=y.useState(null),[B,T]=y.useState(!1),[A,H]=y.useState(!1),[F,V]=y.useState(!1),[ee,G]=y.useState(s),[se,Ce]=y.useState(r),[te,K]=y.useState(!1),[Z,oe]=y.useState(null),[Y,ne]=y.useState(!1),X=y.useRef(null),ue=y.useRef(null),pe=y.useRef(null),Se=y.useRef(!1),Re=y.useRef(null),ye=y.useRef(null),ve=y.useRef(null),he=y.useRef(null),de=y.useRef(!1),ke=y.useRef(!1),Ee=y.useRef(!1),Ke=y.useRef(null),ae=y.useRef(0),We=y.useRef(!1),bt=y.useRef(null),tt=y.useRef(!1),mt=y.useRef(0),Xe=y.useRef(null),at=y.useRef(0),ot=y.useRef(!1),Ct=y.useRef(null),Ot=cm(je=>{var it;return e!=null&&e.id?((it=je.byDevice[e.id])==null?void 0:it.objectsDetected)??null:null}),kn=cm(je=>je.setObjectsDetected),_t=Te(je=>je.streamWatchdogEnabled),kt=C4(e==null?void 0:e.id),$=Te(je=>je.cameraAudioVolumes),k=Te(Ig(je=>fb(je,e.id))),z=Te(je=>je.detectionOverlayMotionColor),J=Te(je=>je.detectionOverlayObjectColor),le=Te(je=>je.detectionOverlayAudioColor),xe=Te(je=>je.detectionOverlayMotionStrokeWidth),Ae=Te(je=>je.detectionOverlayObjectStrokeWidth),wt=Te(je=>je.detectionOverlayAudioStrokeWidth),Mt=cm(je=>je.setDetectionHighlightUntil),nt=dee(),pt=(nt==null?void 0:nt.connection)??null,Bt=(nt==null?void 0:nt.readyPromise)??null,gr=e!=null&&e.id?$[e.id]:void 0,Lr=(gr==null?void 0:gr.volumes)??{},wr=Lr.dBFS,ft=Lr.rms,jt=k.cameraCardShowDBFS,qt=k.cameraCardShowRms,Pt=jt&&typeof wr=="number",Wt=qt&&typeof ft=="number",{motionDetected:Me,audioDetected:gt,detectionDetected:Jt}=K_(e==null?void 0:e.id),St=ml(),en=typeof document<"u"&&"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled&&!bee(),bn=!St&&en,rt=te,Tt=y.useCallback(je=>{const it=X.current;if(!it)return;it.muted=je;const st=it.srcObject;st&&typeof st.getAudioTracks=="function"&&st.getAudioTracks().forEach(rn=>{rn.enabled=!je})},[]),ce=y.useCallback(()=>{Ce(je=>{const it=!je;return Tt(it),it})},[Tt]),Ue=y.useCallback(()=>{var je;G(it=>!it),(je=pe.current)==null||je.setMicrophone(!ee)},[ee]),ze=y.useCallback(()=>{const je=X.current;je&&(console.log(_,"video onLoadedMetadata",{videoWidth:je.videoWidth,videoHeight:je.videoHeight,readyState:je.readyState}),je.videoWidth&&je.videoHeight&&oe(je.videoWidth/je.videoHeight))},[_]),$e=y.useCallback(async()=>{try{document.pictureInPictureElement?await document.exitPictureInPicture():X.current&&await X.current.requestPictureInPicture()}catch{}},[]),ht=y.useCallback(()=>K(je=>!je),[]),vt=y.useCallback(async()=>{var st,rn;Se.current=!1,he.current=null,Ke.current&&(clearInterval(Ke.current),Ke.current=null),(st=ve.current)==null||st.call(ve),ve.current=null;const je=ye.current,it=ue.current;ye.current=null,ue.current=null;try{await Promise.all([je==null?void 0:je.stop().catch(()=>{}),it==null?void 0:it.endSession().catch(()=>{})])}finally{(rn=pe.current)==null||rn.close(),pe.current=null;const gn=X.current;if(gn){const lr=gn.srcObject;lr instanceof MediaStream&&lr.getTracks().forEach(zr=>zr.stop()),gn.pause(),gn.srcObject=null}H(!1),V(!1),T(!1),c(!1),D(null)}},[]),Nt=y.useCallback(async()=>{if(de.current)return!1;const je=ye.current,it=X.current,st=(it==null?void 0:it.srcObject)instanceof MediaStream?it.srcObject:null;if(!je||!st)return!1;de.current=!0;try{await je.setPlayback({audio:!1,video:!1})}catch(rn){return console.warn(_,"soft pause setPlayback failed",rn),!1}finally{de.current=!1}return he.current=st,it&&(it.pause(),it.srcObject=null),H(!1),V(!0),T(!1),c(!1),D(null),console.log(_,"soft pause (shared connection kept)"),!0},[_]),ln=y.useCallback(async()=>{if(ke.current)return!1;const je=he.current,it=ye.current,st=X.current;if(!je||!it||!st)return!1;ke.current=!0;try{st.srcObject=je,st.muted=se,je.getAudioTracks().forEach(rn=>{rn.enabled=!se}),await it.setPlayback({audio:!se,video:!0})}catch(rn){if(Pp(rn))await it.setPlayback({audio:!1,video:!0}).catch(()=>{});else throw rn}finally{ke.current=!1}return he.current=null,H(je.getTracks().length>0),V(!0),T(!0),c(!1),D(null),console.log(_,"resumed from soft pause"),!0},[_,se]),En=y.useCallback(je=>{if(!X.current)return;const it=`[WebRTC ${e.name??e.id}]`;ue.current=je.control,pe.current=je.session,X.current.srcObject=je.mediaStream,X.current.muted=se,je.mediaStream.getAudioTracks().forEach(st=>{st.enabled=!se}),H(je.mediaStream.getTracks().length>0),je.session.pcDeferred.promise.then(st=>{st.addEventListener("iceconnectionstatechange",()=>{var rn;(st.iceConnectionState==="disconnected"||st.iceConnectionState==="failed"||st.iceConnectionState==="closed")&&((rn=je.control)==null||rn.endSession().catch(()=>{}))})}),(async()=>{try{await je.control.setPlayback({audio:!se,video:!0}),je.session.setMicrophone(ee)}catch(st){Pp(st)&&(await je.control.setPlayback({audio:!1,video:!0}).catch(()=>{}),je.session.setMicrophone(!1),G(!1))}Ee.current||T(!0),c(!1),console.log(it,"attached prewarmed stream")})()},[e==null?void 0:e.id,e==null?void 0:e.name,se,ee]),Gr=y.useRef(En);Gr.current=En;const ni=y.useCallback(async je=>{var Yr,va,Do,Ao,Fs,Gi;if(!C||!(e!=null&&e.id)||!X.current||Se.current||Ui.getState().playInProgressCameraId===e.id)return;if(Se.current=!0,Ui.getState().setPlayInProgress(e.id),Ee.current=!1,c(!0),D(null),V(!1),console.log(_,"start",{destination:je}),await Promise.resolve(),!X.current||Ee.current){Ui.getState().setPlayInProgress(null),Se.current=!1;return}(Yr=ve.current)==null||Yr.call(ve),ve.current=null,(va=ye.current)==null||va.stop().catch(()=>{}),ye.current=null,ue.current&&(ue.current.endSession().catch(()=>{}),ue.current=null),(Do=pe.current)==null||Do.close(),pe.current=null;const it=C.systemManager.getDeviceById(e.id),st=((Ao=it==null?void 0:it.interfaces)==null?void 0:Ao.includes(Ft.ScryptedInterface.Battery))??!1;let rn=pt;if(je==="Default"&&fee&&Re.current!==e.id&&Bt&&!rn)try{rn=await Promise.race([Bt,new Promise((Zn,Wn)=>setTimeout(()=>Wn(new Error("shared_ready_timeout")),bE))])}catch(Zn){Zn instanceof Error&&Zn.message==="shared_ready_timeout"&&console.warn(_,"shared connection not ready within",bE/1e3,"s, using per-device"),rn=null}const gn=rn!=null&&je==="Default"&&Re.current!==e.id;let lr=!1;if(gn&&rn){const Zn=rn,Wn=je==="Default";try{await cee(async()=>{var ko;console.log(_,"using shared RTC connection for camera",e.id);const cr=it;if(!((ko=cr==null?void 0:cr.interfaces)!=null&&ko.includes(Ft.ScryptedInterface.RTCSignalingChannel))){D("WebRTC not supported for this camera"),c(!1);return}const Cr=C.mediaManager;if(typeof Cr.createMediaObject!="function")throw new Error("No createMediaObject");const Yi=async yr=>{const Xr=yr,Po=xE()?Xr==null?void 0:Xr.video:{...Xr==null?void 0:Xr.video,codec:"h264"};return cr.getVideoStream({...Xr,...Po!=null?{video:Po}:{}})},Jn=await Cr.createMediaObject(Yi,Ft.ScryptedMimeTypes.RequestMediaStream,{sourceId:e.id});console.log(_,"RequestMediaStream created, calling addTrack...");const Hs=(Math.random()*1e9).toString(36),Xi=(Math.random()*1e9).toString(36),ri=await Zn.pcPromise,vr=new MediaStream,ic=yr=>{var ya,hs,xa;const Xr=((ya=yr.transceiver)==null?void 0:ya.mid)??((hs=yr.transceiver)==null?void 0:hs.mid),Po=Xr===Hs||Xr===Xi,cc=vr.getTracks().length;if((Po||cc<2)&&!vr.getTracks().includes(yr.track)){const Is=yr.track;if(vr.addTrack(Is),console.log(_,"shared track event",Is.kind,{mid:Xr,isOurs:Po,totalTracks:cc+1,trackId:Is.id,trackReadyState:Is.readyState,trackMuted:Is.muted,transceiverMid:(xa=yr.transceiver)==null?void 0:xa.mid}),cc===0&&X.current){const ms=X.current;ms.srcObject=vr,ms.muted=se,vr.getAudioTracks().forEach(Ru=>{Ru.enabled=!se}),H(vr.getTracks().length>0),ms.addEventListener("playing",()=>{Ee.current||(V(!0),T(!0))},{once:!0}),console.log(_,"first track received, updated video srcObject")}}};ri.addEventListener("track",ic);const sc=()=>{console.log(_,"shared PC connectionState",ri.connectionState)},oc=()=>{console.log(_,"shared PC iceConnectionState",ri.iceConnectionState)};ri.addEventListener("connectionstatechange",sc),ri.addEventListener("iceconnectionstatechange",oc);const ac=await Zn.connectionManagement.addTrack(Jn,{videoMid:Hs,audioMid:Xi,videoDirection:"sendonly",audioDirection:"sendrecv"});typeof Zn.connectionManagement.negotiateRTCSignalingSession=="function"&&(await Zn.connectionManagement.negotiateRTCSignalingSession(),console.log(_,"negotiateRTCSignalingSession done")),console.log(_,"addTrack returned, attaching stream to video element"),ye.current=ac,X.current&&(X.current.srcObject=vr,X.current.muted=se,vr.getAudioTracks().forEach(yr=>{yr.enabled=!se}),X.current.addEventListener("playing",()=>{Ee.current||(V(!0),T(!0))},{once:!0})),H(vr.getTracks().length>0);const lc=()=>{X.current&&vr.getTracks().length>0&&(X.current.srcObject=vr,X.current.muted=se,vr.getAudioTracks().forEach(yr=>{yr.enabled=!se}),X.current.addEventListener("playing",()=>{Ee.current||(V(!0),T(!0))},{once:!0}),console.log(_,"shared tracks attached",vr.getTracks().length))};vr.addEventListener("addtrack",lc);const jo=()=>{ri.removeEventListener("track",ic),ri.removeEventListener("connectionstatechange",sc),ri.removeEventListener("iceconnectionstatechange",oc),vr.removeEventListener("addtrack",lc)};ve.current=jo,setTimeout(lc,300);const yl=st?45e3:2e4,Eu=setTimeout(()=>{var yr,Xr;vr.getTracks().length===0&&(console.warn(_,"no tracks received after",yl/1e3,"s"),jo(),(yr=ye.current)==null||yr.stop().catch(()=>{}),ye.current=null,Se.current=!1,Wn?(D("No video track received. Try again or check camera."),c(!1)):(Re.current=e.id,D(null),c(!0),(Xr=Sr.current)==null||Xr.call(Sr,"Default")))},yl);ve.current=()=>{clearTimeout(Eu),jo()};try{await ac.setPlayback({audio:!se,video:!0})}catch(yr){Pp(yr)&&await ac.setPlayback({audio:!1,video:!0}).catch(()=>{})}}),Ee.current||T(!0),c(!1),console.log(_,"play via shared connection (tracks arrive async)"),Ui.getState().setPlayInProgress(null),Se.current=!1;return}catch(cr){if(console.warn(_,"shared connection failed"+(Wn?"":", falling back to per-device"),cr),(cr instanceof Error?cr.message:String(cr??"")).includes("RpcPeer has been killed")){S(),D("Connection lost. Reconnecting…"),c(!1),Ui.getState().setPlayInProgress(null),Se.current=!1;return}if(Ee.current){c(!1),Ui.getState().setPlayInProgress(null),Se.current=!1;return}const Yi=ye.current;if(ye.current=null,(Fs=ve.current)==null||Fs.call(ve),ve.current=null,Yi&&"stop"in Yi&&await Yi.stop().catch(()=>{}),Wn){D(cr instanceof Error?cr.message:String(cr)),c(!1),Ui.getState().setPlayInProgress(null),Se.current=!1;return}lr=!0}}if(Ee.current){c(!1),Ui.getState().setPlayInProgress(null),Se.current=!1;return}(!gn||lr)&&(lr?console.log(_,"shared failed, using per-device signaling"):st?console.log(_,"battery camera, trying shared RTC first (longer no-tracks timeout)"):pt&&je!=="Default"?console.log(_,"shared connection available but destination is not Default, using per-device stream"):!pt&&!rn&&console.log(_,"no shared connection, using per-device signaling")),Ui.getState().markPlayerStarted(e.id);const zr=new Promise((Zn,Wn)=>{setTimeout(()=>Wn(new Error("Connection timeout")),hee)});try{const Zn=C.systemManager.getDeviceById(e.id);if(!((Gi=Zn==null?void 0:Zn.interfaces)!=null&&Gi.includes(Ft.ScryptedInterface.RTCSignalingChannel))){D("WebRTC not supported for this camera");return}const Wn=new eN;pe.current=Wn;const cr=new MediaStream;Wn.onPeerConnection=async Jn=>{console.log(_,"PeerConnection created"),Jn.ontrack=Hs=>{if(Hs.track){const Xi=Hs.track;cr.addTrack(Xi),console.log(_,"per-device track received",{kind:Xi.kind,id:Xi.id,readyState:Xi.readyState,muted:Xi.muted,totalTracks:cr.getTracks().length})}},Jn.addEventListener("iceconnectionstatechange",()=>{console.log(_,"ICE state",Jn.iceConnectionState)}),Jn.addEventListener("connectionstatechange",()=>{console.log(_,"connection state",Jn.connectionState)})};let Cr;const Yi=async()=>{if(je==="Default")console.log(_,"starting signaling (Default)..."),Cr=await Zn.startRTCSignalingSession(Wn);else{console.log(_,"getVideoStream...",{destination:je});const Jn=await Zn.getVideoStream({destination:je,destinationId:"management",...xE()?{}:{video:{codec:"h264"}}});if(!Jn)throw new Error("No stream available");const Hs=await C.mediaManager.convertMediaObject(Jn,Ft.ScryptedMimeTypes.RTCSignalingChannel);console.log(_,"starting signaling..."),Cr=await Hs.startRTCSignalingSession(Wn)}};await Promise.race([Yi(),zr]),console.log(_,"signaling started, control:",!!Cr),Cr&&(ue.current=Cr,Wn.pcDeferred.promise.then(Jn=>{Jn.addEventListener("iceconnectionstatechange",()=>{(Jn.iceConnectionState==="disconnected"||Jn.iceConnectionState==="failed"||Jn.iceConnectionState==="closed")&&(Cr==null||Cr.endSession().catch(()=>{}))})})),X.current.srcObject=cr,X.current.muted=se,cr.getAudioTracks().forEach(Jn=>{Jn.enabled=!se}),H(cr.getTracks().length>0),Ee.current||T(!0),console.log(_,"srcObject set, tracks:",cr.getTracks().length);try{console.log(_,"setPlayback audio:",!se),await(Cr==null?void 0:Cr.setPlayback({audio:!se,video:!0})),Wn.setMicrophone(ee)}catch(Jn){if(Pp(Jn))await(Cr==null?void 0:Cr.setPlayback({audio:!1,video:!0}).catch(()=>{})),Wn.setMicrophone(!1),G(!1);else throw Jn}console.log(_,"play() done, waiting for media")}catch(Zn){console.log(_,"play() error",Zn instanceof Error?Zn.message:Zn),ue.current==null&&T(!1),Pp(Zn)?D(null):Zn instanceof Error&&Zn.message==="Connection timeout"?D("Connection timeout – camera may be slow or offline. Try again."):D(Zn instanceof Error?Zn.message:"WebRTC stream error")}finally{c(!1),Ui.getState().setPlayInProgress(null),Se.current=!1}},[C,e==null?void 0:e.id,se,ee,nt,pt,Bt,S]),Sr=y.useRef(ni);Sr.current=ni;const _n=y.useCallback(()=>{const je=Date.now();if(!(je-at.current<vee))if(at.current=je,B){Ee.current=!0;const it=ye.current,st=X.current,rn=(st==null?void 0:st.srcObject)instanceof MediaStream?st.srcObject:null;if(it&&rn){Nt().then(gn=>{gn||vt()}).catch(()=>vt());return}vt()}else Ee.current=!1,D(null),he.current&&ye.current?(Se.current=!0,c(!0),ln().then(it=>{it||ni(n)}).catch(()=>ni(n)).finally(()=>{Se.current=!1})):(Se.current=!1,ni(n))},[B,n,ni,vt,Nt,ln]),zs=y.useCallback(()=>{Ee.current=!0;const je=ye.current,it=X.current,st=(it==null?void 0:it.srcObject)instanceof MediaStream?it.srcObject:null;if(je&&st){Nt().then(rn=>{rn||vt()}).catch(()=>vt());return}vt()},[vt,Nt]);y.useEffect(()=>{Re.current=null},[e==null?void 0:e.id]),y.useEffect(()=>{B?ot.current=!1:!h&&m&&!ot.current&&(ot.current=!0,m())},[B,h,m]),y.useEffect(()=>{Ct.current=j},[j]),y.useEffect(()=>{if(!_t||!B||!X.current)return;const je=X.current,it=`[WebRTC ${(e==null?void 0:e.name)??(e==null?void 0:e.id)}]`;ae.current=Date.now(),We.current=!1;let st=!1;const rn=()=>{const zr=Date.now();st||(st=!0,console.log(it,"first data received (timeupdate/progress)",{currentTime:je.currentTime,readyState:je.readyState})),We.current=!0,ae.current=zr};je.addEventListener("timeupdate",rn),je.addEventListener("progress",rn),je.addEventListener("loadeddata",()=>{console.log(it,"loadeddata",{readyState:je.readyState})},{once:!0}),je.addEventListener("playing",()=>{console.log(it,"playing")},{once:!0});const gn=()=>console.warn(it,"stalled");je.addEventListener("stalled",gn);const lr=setInterval(()=>{if(!X.current||!ue.current||!We.current)return;Date.now()-ae.current>=mee&&(Ke.current&&(clearInterval(Ke.current),Ke.current=null),vt(),setTimeout(()=>{Ee.current||Sr.current(n)},500))},pee);return Ke.current=lr,()=>{je.removeEventListener("timeupdate",rn),je.removeEventListener("progress",rn),je.removeEventListener("stalled",gn),clearInterval(lr),Ke.current===lr&&(Ke.current=null)}},[_t,B,n,vt]),y.useEffect(()=>{if(!A||!B||!X.current)return;const it=X.current.srcObject,st=(it==null?void 0:it.getVideoTracks())??[];if(!(st.length>0))return;const gn=setTimeout(()=>{if(!X.current)return;const lr=X.current;lr.videoWidth===0&&lr.readyState>=2&&(console.warn(_,"video not decoding after 6s (possible unsupported codec)",{videoWidth:lr.videoWidth,videoHeight:lr.videoHeight,readyState:lr.readyState,videoTracks:st.length,trackIds:st.map(zr=>zr.id),trackReadyState:st.map(zr=>zr.readyState)}),D("Video codec may not be supported (e.g. H.265). Try another stream quality or use a different browser."))},yee);return()=>clearTimeout(gn)},[A,B]),y.useEffect(()=>{if(!A||!X.current)return;const je=X.current,it=()=>{if(Ee.current)return;const gn=X.current;console.log(_,"video playing event",gn?{videoWidth:gn.videoWidth,videoHeight:gn.videoHeight,readyState:gn.readyState}:"no ref"),V(!0),T(!0)};je.addEventListener("playing",it,{once:!0});let st=null;st=setInterval(()=>{if(!X.current)return;const gn=X.current;gn.videoWidth>0&&(console.log(_,"first frame (videoWidth>0 fallback)",{videoWidth:gn.videoWidth,videoHeight:gn.videoHeight,readyState:gn.readyState}),V(!0),st&&clearInterval(st))},300);const rn=setTimeout(()=>{st&&clearInterval(st)},xee);return()=>{je.removeEventListener("playing",it),st&&clearInterval(st),clearTimeout(rn)}},[A,_]),y.useEffect(()=>{if(a&&(e!=null&&e.id)&&!Ee.current){if(!C||(Xe.current&&(clearTimeout(Xe.current),Xe.current=null),mt.current=(mt.current||0)+1,Se.current||ye.current)||Ui.getState().playInProgressCameraId===e.id)return;const je=Date.now(),it=bt.current;if(it&&it.cameraId===e.id&&it.destination===n&&je-it.time<2500&&!tt.current)return;tt.current=!1,bt.current={cameraId:e.id,destination:n,time:je};const gn=Ui.getState().consumePrewarmed(e.id);gn?(c(!0),D(null),Gr.current(gn)):(Ui.getState().markPlayerStarted(e.id),c(!0),D(null),Sr.current(n))}else a||T(!1);return()=>{tt.current=!0,e!=null&&e.id&&Ui.getState().clearPlayerStarted(e.id),Xe.current&&clearTimeout(Xe.current);const je=mt.current;Xe.current=setTimeout(()=>{Xe.current=null,mt.current===je&&vt()},gee)}},[C,a,n,e==null?void 0:e.id,vt]),y.useEffect(()=>()=>{Xe.current&&(clearTimeout(Xe.current),Xe.current=null),vt()},[vt]),y.useEffect(()=>{!pt||!a||!(e!=null&&e.id)||Ee.current||Se.current||ye.current||he.current||Ui.getState().playInProgressCameraId!==e.id&&(c(!0),D(null),Ui.getState().markPlayerStarted(e.id),Sr.current(n))},[pt,a,e==null?void 0:e.id,n]),y.useEffect(()=>{!pt||!(e!=null&&e.id)||Ee.current||Ct.current==="Connection lost. Reconnecting…"&&(Se.current||ye.current||(D(null),c(!0),Sr.current(n)))},[pt,e==null?void 0:e.id,n]),y.useEffect(()=>{p!=null&&p>0&&!B&&!N&&(D(null),Sr.current(n))},[p,n,B,N]),y.useEffect(()=>{x!=null&&x>0&&B&&zs()},[x,B,zs]),y.useEffect(()=>{b==null||b(B)},[B,b]),y.useEffect(()=>{w==null||w(se)},[se,w]),y.useEffect(()=>{Tt(se)},[se,Tt]),y.useEffect(()=>{E!=null&&E>0&&(Ce(!0),Tt(!0))},[E,Tt]),y.useEffect(()=>{M!=null&&M>0&&(Ce(!1),Tt(!1))},[M,Tt]),y.useEffect(()=>{!B&&(e!=null&&e.id)&&kn(e.id,null)},[B,e==null?void 0:e.id,kn]),y.useEffect(()=>{const je=X.current;if(!je)return;const it=()=>ne(!0),st=()=>ne(!1);return je.addEventListener("enterpictureinpicture",it),je.addEventListener("leavepictureinpicture",st),()=>{je.removeEventListener("enterpictureinpicture",it),je.removeEventListener("leavepictureinpicture",st)}},[]);const Bs=!!(kt.highlightOnDetection&&((gl=Ot==null?void 0:Ot.detections)!=null&&gl.length)&&Ot.detections.some(je=>{var lr;const it=kt.highlightDetectionClassnames??[],st=(lr=kt.highlightDetectionLabel)==null?void 0:lr.trim(),rn=je.className&&it.includes(je.className)||je.className&&cg[je.className]&&it.includes(cg[je.className]),gn=!st||je.label&&je.label.toLowerCase().includes(st.toLowerCase());return rn&&gn}));y.useEffect(()=>{if(!(e!=null&&e.id)||!Bs)return;const je=kt.highlightDetectionHoldSeconds??3;Mt(e.id,Date.now()+je*1e3)},[e==null?void 0:e.id,Bs,kt.highlightDetectionHoldSeconds,Mt]);const fs=Bs||Jt;return f.jsxs("div",{className:"group relative w-full h-full max-w-full max-h-full overflow-hidden",style:{aspectRatio:Z??16/9},onMouseLeave:()=>K(!1),"data-show-motion-highlight":kt.highlightOnMotion&&Me,"data-show-audio-highlight":kt.highlightAudioMode!=="off"&&gt,"data-show-detection-highlight":fs,children:[f.jsxs("div",{className:"absolute inset-0 w-full h-full bg-black overflow-hidden",onClick:ht,children:[f.jsx("video",{ref:X,autoPlay:!0,playsInline:!0,muted:se,className:He("absolute inset-0 w-full h-full object-contain",(!B||!F)&&"opacity-0"),onLoadedData:()=>{const je=X.current;console.log(_,"video onLoadedData",je?{videoWidth:je.videoWidth,videoHeight:je.videoHeight,readyState:je.readyState}:"no ref"),c(!1),V(!0)},onLoadedMetadata:ze,onError:je=>{var st;const it=X.current;console.warn(_,"video onError",je,it?{videoWidth:it.videoWidth,videoHeight:it.videoHeight,readyState:it.readyState,error:(st=it.error)==null?void 0:st.message}:"no ref")},onCanPlay:()=>{const je=X.current;je&&console.log(_,"video onCanPlay",{videoWidth:je.videoWidth,videoHeight:je.videoHeight,readyState:je.readyState})}}),h&&(N||!B||!F)&&f.jsx("img",{src:h,alt:"",className:"absolute inset-0 w-full h-full object-contain pointer-events-none","aria-hidden":!0}),(N||B&&!F)&&!h&&f.jsxs("div",{className:"absolute top-2 left-2 z-10 flex items-center gap-1.5 rounded-md bg-black/70 px-2 py-1.5 text-white text-sm pointer-events-none",children:[f.jsx(i3,{className:"size-4 shrink-0 animate-spin"}),f.jsx("span",{children:"Loading…"})]}),j&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80 text-red-400 p-4 text-center pointer-events-none",children:j}),l&&B&&((Us=Ot==null?void 0:Ot.detections)==null?void 0:Us.length)&&((vl=Ot.inputDimensions)==null?void 0:vl[0])&&((Wi=Ot.inputDimensions)==null?void 0:Wi[1])&&(()=>{const[je,it]=Ot.inputDimensions;return f.jsx("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",viewBox:`0 0 ${je} ${it}`,preserveAspectRatio:"xMidYMid meet",children:Ot.detections.map((st,rn)=>{const gn=st.boundingBox;if(!gn||gn.length!==4)return null;const[lr,zr,Yr,va]=gn,Do=st.className==="motion"?z:st.className==="audio"?le:J,Ao=st.className==="motion"?xe:st.className==="audio"?wt:Ae,Fs=Math.max(12,15*(je/1080)),Gi=st.className!=="motion"&&st.className?[st.className,typeof st.score=="number"?`${(st.score*100).toFixed(0)}%`:"",st.label].filter(Boolean).join(" "):st.label;return f.jsxs("g",{children:[f.jsx("rect",{x:lr,y:zr,width:Yr,height:va,fill:"none",stroke:Do,strokeWidth:Math.max(.5,Ao*(je/1920))}),Gi&&f.jsx("text",{x:lr,y:zr>Fs?zr-4:zr+Fs+4,fontSize:Fs,fill:Do,stroke:"black",strokeWidth:Fs/6,paintOrder:"stroke",children:Gi})]},rn)})})})()]}),((t==null?void 0:t.batteryLevel)!=null||(t==null?void 0:t.recording)===!0||(t==null?void 0:t.sleeping)===!0||(t==null?void 0:t.online)===!1||Pt||Wt)&&f.jsxs("div",{className:He("absolute top-0 left-0 right-0 flex flex-wrap gap-1.5 justify-center py-1.5 px-2 transition-opacity duration-200 pointer-events-none",rt||Pt||Wt?"opacity-100 pointer-events-auto":"opacity-0 group-hover:opacity-100 group-hover:pointer-events-auto"),onClick:je=>je.stopPropagation(),children:[Pt&&f.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-neutral-900/95 text-xs text-white shadow-md",children:[f.jsx(Xd,{className:"size-3"}),f.jsxs("span",{children:[Number(wr).toFixed(1)," dBFS"]})]}),Wt&&f.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-neutral-900/95 text-xs text-white shadow-md",children:[f.jsx(Xd,{className:"size-3"}),f.jsxs("span",{children:["RMS ",Number(ft).toFixed(1)]})]}),(t==null?void 0:t.batteryLevel)!=null&&f.jsxs("span",{className:He("inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-neutral-900/95 text-xs text-white shadow-md",t.chargingState===!0&&"text-green-400"),children:[t.chargingState===!0?f.jsx(J8,{className:"size-3"}):f.jsx(U9,{className:"size-3"}),f.jsxs("span",{children:[t.batteryLevel,"%"]})]}),(t==null?void 0:t.recording)===!0&&f.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-red-600/90 text-xs font-semibold text-white shadow-md",children:"REC"}),(t==null?void 0:t.sleeping)===!0&&f.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-neutral-900/95 text-slate-300 text-xs shadow-md",children:[f.jsx(nb,{className:"size-3"}),"Sleep"]}),(t==null?void 0:t.online)===!1&&f.jsxs("span",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full bg-orange-600/95 text-xs text-white shadow-md",children:[f.jsx(m3,{className:"size-3"}),"Offline"]})]}),f.jsxs("div",{className:He("absolute bottom-0 left-0 right-0 flex items-center justify-between gap-2 py-2 px-2 transition-opacity duration-200 pointer-events-none",rt?"opacity-100 pointer-events-auto":"opacity-0 group-hover:opacity-100 group-hover:pointer-events-auto"),onClick:je=>je.stopPropagation(),onPointerDown:je=>je.stopPropagation(),children:[f.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/95 shadow-md p-1",children:f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-neutral-700 hover:text-white",onClick:je=>{je.stopPropagation(),_n()},onPointerDown:je=>{je.stopPropagation(),je.pointerType==="touch"&&(je.preventDefault(),_n())},"aria-label":B?"Pause stream":"Play stream",children:B?f.jsx(og,{className:"size-4"}):f.jsx(tf,{className:"size-4"})})}),f.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/95 shadow-md p-1",children:[bn&&f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-neutral-700 hover:text-white",onClick:$e,"aria-label":Y?"Exit Picture-in-Picture":"Picture-in-Picture",children:f.jsx(ak,{className:"size-4"})}),f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-neutral-700 hover:text-white",onClick:ce,"aria-label":se?"Unmute":"Mute",children:se?f.jsx(fx,{className:"size-4"}):f.jsx(Xd,{className:"size-4"})}),f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-neutral-700 hover:text-white",onClick:Ue,"aria-label":ee?"Microphone off":"Microphone on",children:ee?f.jsx(Gj,{className:"size-4"}):f.jsx(qj,{className:"size-4"})})]})]})]})}function nN(e,t){const n=e.startsWith("http")?e:`${t}${e.startsWith("/")?"":"/"}${e}`;if(typeof window>"u")return n;try{const r=new URL(n);if(r.origin===window.location.origin)return r.pathname+r.search}catch{}return n}const Lee="x-scrypted-nvr/x-scrypted-nvr-clip";function wee(){try{return MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')}catch{const t=document.createElement("video").canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"');return t==="probably"||t==="maybe"}}function See({deviceId:e,startTimeMs:t,muted:n,onBackToLive:r,onTimeUpdate:s}){const a=qi(),l=y.useRef(null),[h,m]=y.useState(null),[p,x]=y.useState(!0),[b,w]=y.useState(null),[E,M]=y.useState(!0),[C,S]=y.useState(t);y.useEffect(()=>{if(!a||!e)return;x(!0),w(null),m(null);let N=!1;return(async()=>{var c;try{const j=a.systemManager.getDeviceById(e);if(!((c=j==null?void 0:j.interfaces)!=null&&c.includes(Ft.ScryptedInterface.VideoRecorder))){N||w("Recording not supported");return}const B=await j.getRecordingStream({startTime:t});if(!B||N)return;const T=B.mimeType??"video/mp4";let A=null;if(T===Lee?A=await a.mediaManager.convertMediaObjectToLocalUrl(B,Ft.ScryptedMimeTypes.LocalUrl):A=await a.mediaManager.convertMediaObjectToLocalUrl(B,T),N)return;if(A!=null&&A.trim()){const F=nN(A,""),V=`${F}${F.includes("?")?"&":"?"}h265=${wee()}`;m(V)}else w("No stream URL")}catch(j){N||w(j instanceof Error?j.message:"Failed to load recording")}finally{N||x(!1)}})(),()=>{N=!0}},[a,e,t]),y.useEffect(()=>{S(t)},[t]),y.useEffect(()=>{const N=l.current;if(!N)return;const c=()=>{const j=Math.round(t+N.currentTime*1e3);S(j),s==null||s(j)};return N.addEventListener("timeupdate",c),()=>N.removeEventListener("timeupdate",c)},[t,s]),y.useEffect(()=>{const N=l.current;N&&(N.muted=n)},[n]);const _=y.useCallback(()=>{const N=l.current;N&&(N.paused?(N.play(),M(!0)):(N.pause(),M(!1)))},[]);return b?f.jsxs("div",{className:"absolute inset-0 bg-black flex flex-col items-center justify-center gap-2 z-10",children:[f.jsx("p",{className:"text-muted-foreground text-sm",children:b}),f.jsxs(Qe,{variant:"secondary",size:"sm",onClick:r,className:"gap-1.5",children:[f.jsx(dx,{className:"size-4"}),"Live"]})]}):f.jsxs("div",{className:"absolute inset-0 bg-black flex flex-col z-10",children:[p&&!h?f.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Loading recording…"}):f.jsx("video",{ref:l,src:h??void 0,className:He("w-full h-full object-contain",p&&"opacity-50"),autoPlay:!0,playsInline:!0,muted:n,onLoadedData:()=>x(!1),onPlay:()=>M(!0),onPause:()=>M(!1)},t),f.jsxs("div",{className:"absolute bottom-2 left-2 right-2 flex items-center justify-between gap-2",children:[f.jsxs(Qe,{variant:"secondary",size:"sm",className:"gap-1.5",onClick:r,"aria-label":"Back to live",children:[f.jsx(dx,{className:"size-4"}),"Live"]}),f.jsx("div",{className:"flex items-center gap-1",children:f.jsxs(Qe,{variant:E?"secondary":"default",size:"sm",className:"gap-1.5",onClick:_,"aria-label":E?"Pause":"Play",children:[E?f.jsx(og,{className:"size-4"}):f.jsx(tf,{className:"size-4"}),E?"Pause":"Play"]})})]}),f.jsx("span",{className:"absolute top-2 left-2 px-2 py-1 rounded bg-black/60 text-white text-xs font-mono",children:br(new Date(C),"HH:mm:ss")})]})}function Hx(e,[t,n]){return Math.min(n,Math.max(t,e))}function rN(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var iN=["PageUp","PageDown"],sN=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],oN={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Km="Slider",[t9,Cee,Eee]=qm(Km),[aN,Gse]=cs(Km,[Eee]),[Ree,Ib]=aN(Km),lN=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:a=1,orientation:l="horizontal",disabled:h=!1,minStepsBetweenThumbs:m=0,defaultValue:p=[r],value:x,onValueChange:b=()=>{},onValueCommit:w=()=>{},inverted:E=!1,form:M,...C}=e,S=y.useRef(new Set),_=y.useRef(0),c=l==="horizontal"?_ee:Mee,[j=[],D]=dl({prop:x,defaultProp:p,onChange:V=>{var G;(G=[...S.current][_.current])==null||G.focus(),b(V)}}),B=y.useRef(j);function T(V){const ee=Aee(j,V);F(V,ee)}function A(V){F(V,_.current)}function H(){const V=B.current[_.current];j[_.current]!==V&&w(j)}function F(V,ee,{commit:G}={commit:!1}){const se=zee(a),Ce=Bee(Math.round((V-r)/a)*a+r,se),te=Hx(Ce,[r,s]);D((K=[])=>{const Z=Tee(K,te,ee);if(Pee(Z,m*a)){_.current=Z.indexOf(te);const oe=String(Z)!==String(K);return oe&&G&&w(Z),oe?Z:K}else return K})}return f.jsx(Ree,{scope:e.__scopeSlider,name:n,disabled:h,min:r,max:s,valueIndexToChangeRef:_,thumbs:S.current,values:j,orientation:l,form:M,children:f.jsx(t9.Provider,{scope:e.__scopeSlider,children:f.jsx(t9.Slot,{scope:e.__scopeSlider,children:f.jsx(c,{"aria-disabled":h,"data-disabled":h?"":void 0,...C,ref:t,onPointerDown:ut(C.onPointerDown,()=>{h||(B.current=j)}),min:r,max:s,inverted:E,onSlideStart:h?void 0:T,onSlideMove:h?void 0:A,onSlideEnd:h?void 0:H,onHomeKeyDown:()=>!h&&F(r,0,{commit:!0}),onEndKeyDown:()=>!h&&F(s,j.length-1,{commit:!0}),onStepKeyDown:({event:V,direction:ee})=>{if(!h){const Ce=iN.includes(V.key)||V.shiftKey&&sN.includes(V.key)?10:1,te=_.current,K=j[te],Z=a*Ce*ee;F(K+Z,te,{commit:!0})}}})})})})});lN.displayName=Km;var[cN,uN]=aN(Km,{startEdge:"left",endEdge:"right",size:"width",direction:1}),_ee=y.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:a,onSlideStart:l,onSlideMove:h,onSlideEnd:m,onStepKeyDown:p,...x}=e,[b,w]=y.useState(null),E=Qt(t,c=>w(c)),M=y.useRef(void 0),C=Wm(s),S=C==="ltr",_=S&&!a||!S&&a;function N(c){const j=M.current||b.getBoundingClientRect(),D=[0,j.width],T=xS(D,_?[n,r]:[r,n]);return M.current=j,T(c-j.left)}return f.jsx(cN,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width",children:f.jsx(dN,{dir:C,"data-orientation":"horizontal",...x,ref:E,style:{...x.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:c=>{const j=N(c.clientX);l==null||l(j)},onSlideMove:c=>{const j=N(c.clientX);h==null||h(j)},onSlideEnd:()=>{M.current=void 0,m==null||m()},onStepKeyDown:c=>{const D=oN[_?"from-left":"from-right"].includes(c.key);p==null||p({event:c,direction:D?-1:1})}})})}),Mee=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:a,onSlideMove:l,onSlideEnd:h,onStepKeyDown:m,...p}=e,x=y.useRef(null),b=Qt(t,x),w=y.useRef(void 0),E=!s;function M(C){const S=w.current||x.current.getBoundingClientRect(),_=[0,S.height],c=xS(_,E?[r,n]:[n,r]);return w.current=S,c(C-S.top)}return f.jsx(cN,{scope:e.__scopeSlider,startEdge:E?"bottom":"top",endEdge:E?"top":"bottom",size:"height",direction:E?1:-1,children:f.jsx(dN,{"data-orientation":"vertical",...p,ref:b,style:{...p.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:C=>{const S=M(C.clientY);a==null||a(S)},onSlideMove:C=>{const S=M(C.clientY);l==null||l(S)},onSlideEnd:()=>{w.current=void 0,h==null||h()},onStepKeyDown:C=>{const _=oN[E?"from-bottom":"from-top"].includes(C.key);m==null||m({event:C,direction:_?-1:1})}})})}),dN=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:a,onHomeKeyDown:l,onEndKeyDown:h,onStepKeyDown:m,...p}=e,x=Ib(Km,n);return f.jsx(Lt.span,{...p,ref:t,onKeyDown:ut(e.onKeyDown,b=>{b.key==="Home"?(l(b),b.preventDefault()):b.key==="End"?(h(b),b.preventDefault()):iN.concat(sN).includes(b.key)&&(m(b),b.preventDefault())}),onPointerDown:ut(e.onPointerDown,b=>{const w=b.target;w.setPointerCapture(b.pointerId),b.preventDefault(),x.thumbs.has(w)?w.focus():r(b)}),onPointerMove:ut(e.onPointerMove,b=>{b.target.hasPointerCapture(b.pointerId)&&s(b)}),onPointerUp:ut(e.onPointerUp,b=>{const w=b.target;w.hasPointerCapture(b.pointerId)&&(w.releasePointerCapture(b.pointerId),a(b))})})}),fN="SliderTrack",hN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ib(fN,n);return f.jsx(Lt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});hN.displayName=fN;var n9="SliderRange",mN=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=Ib(n9,n),a=uN(n9,n),l=y.useRef(null),h=Qt(t,l),m=s.values.length,p=s.values.map(w=>vN(w,s.min,s.max)),x=m>1?Math.min(...p):0,b=100-Math.max(...p);return f.jsx(Lt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:h,style:{...e.style,[a.startEdge]:x+"%",[a.endEdge]:b+"%"}})});mN.displayName=n9;var r9="SliderThumb",pN=y.forwardRef((e,t)=>{const n=Cee(e.__scopeSlider),[r,s]=y.useState(null),a=Qt(t,h=>s(h)),l=y.useMemo(()=>r?n().findIndex(h=>h.ref.current===r):-1,[n,r]);return f.jsx(Nee,{...e,ref:a,index:l})}),Nee=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...a}=e,l=Ib(r9,n),h=uN(r9,n),[m,p]=y.useState(null),x=Qt(t,N=>p(N)),b=m?l.form||!!m.closest("form"):!0,w=x4(m),E=l.values[r],M=E===void 0?0:vN(E,l.min,l.max),C=Dee(r,l.values.length),S=w==null?void 0:w[h.size],_=S?jee(S,M,h.direction):0;return y.useEffect(()=>{if(m)return l.thumbs.add(m),()=>{l.thumbs.delete(m)}},[m,l.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[h.startEdge]:`calc(${M}% + ${_}px)`},children:[f.jsx(t9.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(Lt.span,{role:"slider","aria-label":e["aria-label"]||C,"aria-valuemin":l.min,"aria-valuenow":E,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...a,ref:x,style:E===void 0?{display:"none"}:e.style,onFocus:ut(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),b&&f.jsx(gN,{name:s??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:E},r)]})});pN.displayName=r9;var Oee="RadioBubbleInput",gN=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=y.useRef(null),a=Qt(s,r),l=rN(t);return y.useEffect(()=>{const h=s.current;if(!h)return;const m=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(m,"value").set;if(l!==t&&x){const b=new Event("input",{bubbles:!0});x.call(h,t),h.dispatchEvent(b)}},[l,t]),f.jsx(Lt.input,{style:{display:"none"},...n,ref:a,defaultValue:t})});gN.displayName=Oee;function Tee(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,a)=>s-a)}function vN(e,t,n){const a=100/(n-t)*(e-t);return Hx(a,[0,100])}function Dee(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Aee(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function jee(e,t,n){const r=e/2,a=xS([0,50],[0,r]);return(r-a(t)*n)*n}function kee(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Pee(e,t){if(t>0){const n=kee(e);return Math.min(...n)>=t}return!0}function xS(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function zee(e){return(String(e).split(".")[1]||"").length}function Bee(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Uee=lN,Fee=hN,Hee=mN,Iee=pN;function bS({className:e,defaultValue:t,value:n,min:r=0,max:s=100,...a}){const l=y.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,s],[n,t,r,s]);return f.jsxs(Uee,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:s,className:He("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...a,children:[f.jsx(Fee,{"data-slot":"slider-track",className:He("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(Hee,{"data-slot":"slider-range",className:He("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:l.length},(h,m)=>f.jsx(Iee,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}const $ee={Entry:F9,Light:H9,Switch:h3,Lock:s3,SecuritySystem:l3,Buttons:I9,WindowCovering:t3,Siren:c3,Sensor:r3},Vee={Entry:"DoorOpen",Light:"Lightbulb",Switch:"ToggleLeft",Lock:"Lock",SecuritySystem:"Shield",Buttons:"Square",WindowCovering:"Blinds",Siren:"Siren",Sensor:"Gauge"};function yN(e){return Vee[e]??"Activity"}const xN=[{value:"DoorOpen",label:"Door",Icon:F9},{value:"Lightbulb",label:"Light",Icon:H9},{value:"Lamp",label:"Lamp",Icon:Aj},{value:"LampDesk",label:"Lamp desk",Icon:Tj},{value:"ToggleLeft",label:"Switch",Icon:h3},{value:"Lock",label:"Lock",Icon:s3},{value:"Shield",label:"Security",Icon:l3},{value:"Square",label:"Button",Icon:I9},{value:"Blinds",label:"Blinds",Icon:t3},{value:"Siren",label:"Siren",Icon:c3},{value:"Bell",label:"Bell",Icon:e3},{value:"AlarmClock",label:"Alarm",Icon:vA},{value:"Gauge",label:"Sensor",Icon:r3},{value:"Activity",label:"Activity",Icon:B9},{value:"Home",label:"Home",Icon:_j},{value:"Camera",label:"Camera",Icon:AA},{value:"Thermometer",label:"Thermometer",Icon:Tk},{value:"Fan",label:"Fan",Icon:dj},{value:"Flame",label:"Flame",Icon:yj},{value:"Droplets",label:"Droplets",Icon:cj},{value:"Sun",label:"Sun",Icon:d3},{value:"Moon",label:"Moon",Icon:nb},{value:"Speaker",label:"Speaker",Icon:Rk},{value:"Volume2",label:"Volume",Icon:Xd},{value:"Tv",label:"TV",Icon:zk},{value:"Radio",label:"Radio",Icon:dx},{value:"Wifi",label:"Wi‑Fi",Icon:$k},{value:"Battery",label:"Battery",Icon:U9},{value:"Zap",label:"Zap",Icon:$9},{value:"Plug",label:"Plug",Icon:uk},{value:"Power",label:"Power",Icon:hk},{value:"Mailbox",label:"Mailbox",Icon:Hj},{value:"Smartphone",label:"Smartphone",Icon:Sk}],qee=Object.fromEntries(xN.map(e=>[e.value,e.Icon]));function bN({type:e,customIcon:t,className:n}){const r=t&&qee[t]||$ee[e]||B9;return f.jsx(r,{className:n})}const Wee={x:24,y:100};function LE(e){if(!e)return{};const t=e.securitySystemState,n=Array.isArray(e.interfaces)?e.interfaces:[],r=n.includes(Ft.ScryptedInterface.Brightness);return{interfaces:n.length>0?[...n]:void 0,name:e.name,type:e.type,on:e.on,hasBrightnessControl:r,brightness:e.brightness,lockState:e.lockState,securitySystemState:t?{mode:t.mode,supportedModes:t.supportedModes}:void 0,buttons:e.buttons?[...e.buttons]:void 0,entryOpen:e.entryOpen}}function wE({cameraId:e,onClose:t,variant:n,className:r,onOpenSettings:s}){const a=qi(),l=Te(j=>j.cameraAssociatedDevices),h=y.useMemo(()=>l[e]??[],[l,e]),[m,p]=y.useState({}),[x,b]=y.useState(null),[w,E]=y.useState(Wee),M=y.useRef(null),C=y.useRef(null),S=y.useCallback(j=>{if(a)return a.systemManager.getDeviceById(j)},[a]);y.useEffect(()=>{if(!a||h.length===0)return;const j={};for(const D of h){const B=S(D.id);B&&(j[D.id]=LE(B))}p(j)},[a,h,S]),y.useEffect(()=>{if(!a||h.length===0)return;const j=[];for(const D of h){const B=a.systemManager.listenDevice(D.id,{event:void 0},()=>{const T=S(D.id);p(A=>({...A,[D.id]:T?LE(T):A[D.id]}))});j.push(B)}return()=>j.forEach(D=>{var B;return(B=D.removeListener)==null?void 0:B.call(D)})},[a,h,S]);const _=y.useCallback(j=>{if(j.target.closest("[data-no-drag]"))return;j.preventDefault();const D=M.current;if(!D)return;const B=D.getBoundingClientRect();C.current={startX:j.clientX,startY:j.clientY,startLeft:B.left,startTop:B.top};const T=H=>{const F=C.current;if(!F)return;let V=F.startLeft+(H.clientX-F.startX),ee=F.startTop+(H.clientY-F.startY);const G=M.current;G&&(V=Math.max(0,Math.min(window.innerWidth-Math.min(G.offsetWidth,120),V)),ee=Math.max(0,Math.min(window.innerHeight-Math.min(G.offsetHeight,80),ee))),E({x:V,y:ee})},A=()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),C.current=null};window.addEventListener("pointermove",T),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},[]),N=y.useCallback(async j=>{b(null);try{await j()}catch(D){b(D instanceof Error?D.message:String(D))}},[]),c=n==="overlay";return f.jsx("div",{ref:M,className:He("fixed z-[50] w-fit",r),style:{left:w.x,top:w.y},children:f.jsxs("div",{className:He("flex flex-col bg-background border rounded-lg shadow-lg min-h-0 select-none",c?"p-2 max-h-[50vh] max-w-[90vw] w-56":"w-56 p-2 max-h-[min(100vh-120px,420px)] min-h-0 overflow-hidden"),children:[f.jsxs("div",{className:"flex items-center justify-between gap-1.5 shrink-0 mb-1.5 cursor-grab active:cursor-grabbing",onPointerDown:_,role:"button",tabIndex:0,"aria-label":"Drag to move",children:[f.jsx("span",{className:"font-medium text-xs",children:"Devices"}),f.jsxs("div",{className:"flex items-center gap-0.5","data-no-drag":!0,children:[s?f.jsxs(Qe,{variant:"ghost",size:"sm",className:"h-6 px-1.5 gap-0.5 text-[10px]",onClick:s,children:[f.jsx(lw,{className:"size-3"}),f.jsx("span",{children:"Edit"})]}):f.jsx(Qe,{variant:"ghost",size:"sm",className:"h-6 px-1.5 gap-0.5 text-[10px]",asChild:!0,children:f.jsxs(eb,{to:`/settings/cameras/${e}`,children:[f.jsx(lw,{className:"size-3"}),f.jsx("span",{children:"Edit"})]})}),f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:t,"aria-label":"Close",children:f.jsx(gf,{className:"size-3.5"})})]})]}),x&&f.jsx("p",{className:"text-[10px] text-destructive mb-1 shrink-0",role:"alert",children:x}),f.jsx("div",{className:"flex flex-col gap-1.5 overflow-y-auto min-h-0",style:{scrollbarGutter:"stable"},children:h.length===0?f.jsx("p",{className:"text-sm text-muted-foreground py-1",children:"No associated devices."}):h.map(j=>{var Se,Re,ye,ve;const D=m[j.id],B=j.customName??(D==null?void 0:D.name)??j.id,T=(D==null?void 0:D.type)??"",A=!!(D!=null&&D.hasBrightnessControl),H=T===Ft.ScryptedDeviceType.Light,F=T===Ft.ScryptedDeviceType.Switch,V=T===Ft.ScryptedDeviceType.Siren,ee=T===Ft.ScryptedDeviceType.Lock,G=T===Ft.ScryptedDeviceType.Entry,se=T===Ft.ScryptedDeviceType.WindowCovering,Ce=T===Ft.ScryptedDeviceType.SecuritySystem,te=T===Ft.ScryptedDeviceType.Buttons,K=j.id,Z=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.turnOn)==null?void 0:de.call(he))}),oe=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.turnOff)==null?void 0:de.call(he))}),Y=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.openEntry)==null?void 0:de.call(he))}),ne=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.closeEntry)==null?void 0:de.call(he))}),X=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.lock)==null?void 0:de.call(he))}),ue=()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.unlock)==null?void 0:de.call(he))}),pe="h-6 min-w-0 px-1.5 text-[10px] shrink-0";return f.jsxs("div",{className:"flex flex-col gap-1 rounded border bg-muted/30 p-1.5 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[f.jsx(bN,{type:(D==null?void 0:D.type)??"Sensor",customIcon:j.customIcon,className:"size-3.5 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"truncate text-xs font-medium min-w-0 flex-1",title:B,children:B}),(H||F||V)&&f.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[f.jsx(Qe,{variant:D!=null&&D.on?"outline":"default",size:"sm",className:pe,onClick:oe,children:"Off"}),f.jsx(Qe,{variant:D!=null&&D.on?"default":"outline",size:"sm",className:pe,onClick:Z,children:"On"})]}),ee&&f.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[f.jsx(Qe,{variant:"outline",size:"sm",className:pe,onClick:ue,children:"Unlock"}),f.jsx(Qe,{variant:"outline",size:"sm",className:pe,onClick:X,children:"Lock"}),(D==null?void 0:D.lockState)!=null&&f.jsx("span",{className:"text-[10px] text-muted-foreground self-center",children:String(D.lockState)})]}),G&&f.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[f.jsx(Qe,{variant:(D==null?void 0:D.entryOpen)===!1?"default":"outline",size:"sm",className:pe,onClick:ne,children:"Close"}),f.jsx(Qe,{variant:(D==null?void 0:D.entryOpen)===!0?"default":"outline",size:"sm",className:pe,onClick:Y,children:"Open"})]}),se&&f.jsxs("div",{className:"flex gap-0.5 shrink-0",children:[f.jsx(Qe,{variant:(D==null?void 0:D.entryOpen)===!1?"default":"outline",size:"sm",className:pe,onClick:ne,children:"Close"}),f.jsx(Qe,{variant:(D==null?void 0:D.entryOpen)===!0?"default":"outline",size:"sm",className:pe,onClick:Y,children:"Open"})]}),Ce&&f.jsxs("div",{className:"flex items-center gap-0.5 shrink-0 flex-wrap justify-end",children:[f.jsx(Qe,{variant:"outline",size:"sm",className:pe,onClick:()=>N(async()=>{var de;const he=S(K);await((de=he==null?void 0:he.disarmSecuritySystem)==null?void 0:de.call(he))}),children:"Disarm"}),(Re=(Se=D==null?void 0:D.securitySystemState)==null?void 0:Se.supportedModes)==null?void 0:Re.slice(0,3).map(he=>f.jsx(Qe,{variant:"outline",size:"sm",className:pe,onClick:()=>N(async()=>{var ke;const de=S(K);await((ke=de==null?void 0:de.armSecuritySystem)==null?void 0:ke.call(de,he))}),children:he},he))]}),te&&f.jsx("div",{className:"flex gap-0.5 shrink-0 flex-wrap justify-end",children:((ye=D==null?void 0:D.buttons)!=null&&ye.length?D.buttons:["Press"]).slice(0,4).map(he=>f.jsx(Qe,{variant:"outline",size:"sm",className:pe,onClick:()=>N(async()=>{var ke;const de=S(K);await((ke=de==null?void 0:de.pressButton)==null?void 0:ke.call(de,he))}),children:he},he))}),!H&&!F&&!V&&!ee&&!G&&!se&&!Ce&&!te&&f.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:"—"})]}),A&&f.jsxs("div",{className:"flex items-center gap-1 pl-5",children:[f.jsx(bS,{value:[(D==null?void 0:D.brightness)??100],onValueChange:([he])=>N(async()=>{var ke;const de=S(K);await((ke=de==null?void 0:de.setBrightness)==null?void 0:ke.call(de,he))}),min:0,max:100,step:5,className:"flex-1 h-1.5 min-w-0"}),f.jsxs("span",{className:"text-[10px] text-muted-foreground w-6 shrink-0",children:[(D==null?void 0:D.brightness)??100,"%"]})]}),Ce&&((ve=D==null?void 0:D.securitySystemState)==null?void 0:ve.mode)!=null&&f.jsx("span",{className:"text-[10px] text-muted-foreground pl-5",children:D.securitySystemState.mode})]},j.id)})})]})})}var Gee=[" ","Enter","ArrowUp","ArrowDown"],Yee=[" ","Enter"],uf="Select",[$b,Vb,Xee]=qm(uf),[Qm,Yse]=cs(uf,[Xee,Lu]),qb=Lu(),[Kee,Su]=Qm(uf),[Qee,Zee]=Qm(uf),LN=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:l,defaultValue:h,onValueChange:m,dir:p,name:x,autoComplete:b,disabled:w,required:E,form:M}=e,C=qb(t),[S,_]=y.useState(null),[N,c]=y.useState(null),[j,D]=y.useState(!1),B=Wm(p),[T,A]=dl({prop:r,defaultProp:s??!1,onChange:a,caller:uf}),[H,F]=dl({prop:l,defaultProp:h,onChange:m,caller:uf}),V=y.useRef(null),ee=S?M||!!S.closest("form"):!0,[G,se]=y.useState(new Set),Ce=Array.from(G).map(te=>te.props.value).join(";");return f.jsx(Lb,{...C,children:f.jsxs(Kee,{required:E,scope:t,trigger:S,onTriggerChange:_,valueNode:N,onValueNodeChange:c,valueNodeHasChildren:j,onValueNodeHasChildrenChange:D,contentId:li(),value:H,onValueChange:F,open:T,onOpenChange:A,dir:B,triggerPointerDownPosRef:V,disabled:w,children:[f.jsx($b.Provider,{scope:t,children:f.jsx(Qee,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(te=>{se(K=>new Set(K).add(te))},[]),onNativeOptionRemove:y.useCallback(te=>{se(K=>{const Z=new Set(K);return Z.delete(te),Z})},[]),children:n})}),ee?f.jsxs($N,{"aria-hidden":!0,required:E,tabIndex:-1,name:x,autoComplete:b,value:H,onChange:te=>F(te.target.value),disabled:w,form:M,children:[H===void 0?f.jsx("option",{value:""}):null,Array.from(G)]},Ce):null]})})};LN.displayName=uf;var wN="SelectTrigger",SN=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=qb(n),l=Su(wN,n),h=l.disabled||r,m=Qt(t,l.onTriggerChange),p=Vb(n),x=y.useRef("touch"),[b,w,E]=qN(C=>{const S=p().filter(c=>!c.disabled),_=S.find(c=>c.value===l.value),N=WN(S,C,_);N!==void 0&&l.onValueChange(N.value)}),M=C=>{h||(l.onOpenChange(!0),E()),C&&(l.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return f.jsx(Fg,{asChild:!0,...a,children:f.jsx(Lt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":VN(l.value)?"":void 0,...s,ref:m,onClick:ut(s.onClick,C=>{C.currentTarget.focus(),x.current!=="mouse"&&M(C)}),onPointerDown:ut(s.onPointerDown,C=>{x.current=C.pointerType;const S=C.target;S.hasPointerCapture(C.pointerId)&&S.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(M(C),C.preventDefault())}),onKeyDown:ut(s.onKeyDown,C=>{const S=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(S&&C.key===" ")&&Gee.includes(C.key)&&(M(),C.preventDefault())})})})});SN.displayName=wN;var CN="SelectValue",EN=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:l="",...h}=e,m=Su(CN,n),{onValueNodeHasChildrenChange:p}=m,x=a!==void 0,b=Qt(t,m.onValueNodeChange);return Wr(()=>{p(x)},[p,x]),f.jsx(Lt.span,{...h,ref:b,style:{pointerEvents:"none"},children:VN(m.value)?f.jsx(f.Fragment,{children:l}):a})});EN.displayName=CN;var Jee="SelectIcon",RN=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return f.jsx(Lt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});RN.displayName=Jee;var ete="SelectPortal",_N=e=>f.jsx(vf,{asChild:!0,...e});_N.displayName=ete;var df="SelectContent",MN=y.forwardRef((e,t)=>{const n=Su(df,e.__scopeSelect),[r,s]=y.useState();if(Wr(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?ol.createPortal(f.jsx(NN,{scope:e.__scopeSelect,children:f.jsx($b.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),a):null}return f.jsx(ON,{...e,ref:t})});MN.displayName=df;var ta=10,[NN,Cu]=Qm(df),tte="SelectContentImpl",nte=tc("SelectContent.RemoveScroll"),ON=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:h,sideOffset:m,align:p,alignOffset:x,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:M,hideWhenDetached:C,avoidCollisions:S,..._}=e,N=Su(df,n),[c,j]=y.useState(null),[D,B]=y.useState(null),T=Qt(t,ye=>j(ye)),[A,H]=y.useState(null),[F,V]=y.useState(null),ee=Vb(n),[G,se]=y.useState(!1),Ce=y.useRef(!1);y.useEffect(()=>{if(c)return Bg(c)},[c]),pb();const te=y.useCallback(ye=>{const[ve,...he]=ee().map(Ee=>Ee.ref.current),[de]=he.slice(-1),ke=document.activeElement;for(const Ee of ye)if(Ee===ke||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===ve&&D&&(D.scrollTop=0),Ee===de&&D&&(D.scrollTop=D.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==ke))return},[ee,D]),K=y.useCallback(()=>te([A,c]),[te,A,c]);y.useEffect(()=>{G&&K()},[G,K]);const{onOpenChange:Z,triggerPointerDownPosRef:oe}=N;y.useEffect(()=>{if(c){let ye={x:0,y:0};const ve=de=>{var ke,Ee;ye={x:Math.abs(Math.round(de.pageX)-(((ke=oe.current)==null?void 0:ke.x)??0)),y:Math.abs(Math.round(de.pageY)-(((Ee=oe.current)==null?void 0:Ee.y)??0))}},he=de=>{ye.x<=10&&ye.y<=10?de.preventDefault():c.contains(de.target)||Z(!1),document.removeEventListener("pointermove",ve),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",he,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",he,{capture:!0})}}},[c,Z,oe]),y.useEffect(()=>{const ye=()=>Z(!1);return window.addEventListener("blur",ye),window.addEventListener("resize",ye),()=>{window.removeEventListener("blur",ye),window.removeEventListener("resize",ye)}},[Z]);const[Y,ne]=qN(ye=>{const ve=ee().filter(ke=>!ke.disabled),he=ve.find(ke=>ke.ref.current===document.activeElement),de=WN(ve,ye,he);de&&setTimeout(()=>de.ref.current.focus())}),X=y.useCallback((ye,ve,he)=>{const de=!Ce.current&&!he;(N.value!==void 0&&N.value===ve||de)&&(H(ye),de&&(Ce.current=!0))},[N.value]),ue=y.useCallback(()=>c==null?void 0:c.focus(),[c]),pe=y.useCallback((ye,ve,he)=>{const de=!Ce.current&&!he;(N.value!==void 0&&N.value===ve||de)&&V(ye)},[N.value]),Se=r==="popper"?i9:TN,Re=Se===i9?{side:h,sideOffset:m,align:p,alignOffset:x,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:M,hideWhenDetached:C,avoidCollisions:S}:{};return f.jsx(NN,{scope:n,content:c,viewport:D,onViewportChange:B,itemRefCallback:X,selectedItem:A,onItemLeave:ue,itemTextRefCallback:pe,focusSelectedItem:K,selectedItemText:F,position:r,isPositioned:G,searchRef:Y,children:f.jsx(Im,{as:nte,allowPinchZoom:!0,children:f.jsx(Hm,{asChild:!0,trapped:N.open,onMountAutoFocus:ye=>{ye.preventDefault()},onUnmountAutoFocus:ut(s,ye=>{var ve;(ve=N.trigger)==null||ve.focus({preventScroll:!0}),ye.preventDefault()}),children:f.jsx(Fm,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:ye=>ye.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:f.jsx(Se,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ye=>ye.preventDefault(),..._,...Re,onPlaced:()=>se(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:ut(_.onKeyDown,ye=>{const ve=ye.ctrlKey||ye.altKey||ye.metaKey;if(ye.key==="Tab"&&ye.preventDefault(),!ve&&ye.key.length===1&&ne(ye.key),["ArrowUp","ArrowDown","Home","End"].includes(ye.key)){let de=ee().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(ye.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(ye.key)){const ke=ye.target,Ee=de.indexOf(ke);de=de.slice(Ee+1)}setTimeout(()=>te(de)),ye.preventDefault()}})})})})})})});ON.displayName=tte;var rte="SelectItemAlignedPosition",TN=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=Su(df,n),l=Cu(df,n),[h,m]=y.useState(null),[p,x]=y.useState(null),b=Qt(t,T=>x(T)),w=Vb(n),E=y.useRef(!1),M=y.useRef(!0),{viewport:C,selectedItem:S,selectedItemText:_,focusSelectedItem:N}=l,c=y.useCallback(()=>{if(a.trigger&&a.valueNode&&h&&p&&C&&S&&_){const T=a.trigger.getBoundingClientRect(),A=p.getBoundingClientRect(),H=a.valueNode.getBoundingClientRect(),F=_.getBoundingClientRect();if(a.dir!=="rtl"){const ke=F.left-A.left,Ee=H.left-ke,Ke=T.left-Ee,ae=T.width+Ke,We=Math.max(ae,A.width),bt=window.innerWidth-ta,tt=Hx(Ee,[ta,Math.max(ta,bt-We)]);h.style.minWidth=ae+"px",h.style.left=tt+"px"}else{const ke=A.right-F.right,Ee=window.innerWidth-H.right-ke,Ke=window.innerWidth-T.right-Ee,ae=T.width+Ke,We=Math.max(ae,A.width),bt=window.innerWidth-ta,tt=Hx(Ee,[ta,Math.max(ta,bt-We)]);h.style.minWidth=ae+"px",h.style.right=tt+"px"}const V=w(),ee=window.innerHeight-ta*2,G=C.scrollHeight,se=window.getComputedStyle(p),Ce=parseInt(se.borderTopWidth,10),te=parseInt(se.paddingTop,10),K=parseInt(se.borderBottomWidth,10),Z=parseInt(se.paddingBottom,10),oe=Ce+te+G+Z+K,Y=Math.min(S.offsetHeight*5,oe),ne=window.getComputedStyle(C),X=parseInt(ne.paddingTop,10),ue=parseInt(ne.paddingBottom,10),pe=T.top+T.height/2-ta,Se=ee-pe,Re=S.offsetHeight/2,ye=S.offsetTop+Re,ve=Ce+te+ye,he=oe-ve;if(ve<=pe){const ke=V.length>0&&S===V[V.length-1].ref.current;h.style.bottom="0px";const Ee=p.clientHeight-C.offsetTop-C.offsetHeight,Ke=Math.max(Se,Re+(ke?ue:0)+Ee+K),ae=ve+Ke;h.style.height=ae+"px"}else{const ke=V.length>0&&S===V[0].ref.current;h.style.top="0px";const Ke=Math.max(pe,Ce+C.offsetTop+(ke?X:0)+Re)+he;h.style.height=Ke+"px",C.scrollTop=ve-pe+C.offsetTop}h.style.margin=`${ta}px 0`,h.style.minHeight=Y+"px",h.style.maxHeight=ee+"px",r==null||r(),requestAnimationFrame(()=>E.current=!0)}},[w,a.trigger,a.valueNode,h,p,C,S,_,a.dir,r]);Wr(()=>c(),[c]);const[j,D]=y.useState();Wr(()=>{p&&D(window.getComputedStyle(p).zIndex)},[p]);const B=y.useCallback(T=>{T&&M.current===!0&&(c(),N==null||N(),M.current=!1)},[c,N]);return f.jsx(ste,{scope:n,contentWrapper:h,shouldExpandOnScrollRef:E,onScrollButtonChange:B,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:f.jsx(Lt.div,{...s,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});TN.displayName=rte;var ite="SelectPopperPosition",i9=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ta,...a}=e,l=qb(n);return f.jsx(wb,{...l,...a,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});i9.displayName=ite;var[ste,LS]=Qm(df,{}),s9="SelectViewport",DN=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=Cu(s9,n),l=LS(s9,n),h=Qt(t,a.onViewportChange),m=y.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx($b.Slot,{scope:n,children:f.jsx(Lt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ut(s.onScroll,p=>{const x=p.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=l;if(w!=null&&w.current&&b){const E=Math.abs(m.current-x.scrollTop);if(E>0){const M=window.innerHeight-ta*2,C=parseFloat(b.style.minHeight),S=parseFloat(b.style.height),_=Math.max(C,S);if(_<M){const N=_+E,c=Math.min(M,N),j=N-c;b.style.height=c+"px",b.style.bottom==="0px"&&(x.scrollTop=j>0?j:0,b.style.justifyContent="flex-end")}}}m.current=x.scrollTop})})})]})});DN.displayName=s9;var AN="SelectGroup",[ote,ate]=Qm(AN),lte=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=li();return f.jsx(ote,{scope:n,id:s,children:f.jsx(Lt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});lte.displayName=AN;var jN="SelectLabel",cte=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ate(jN,n);return f.jsx(Lt.div,{id:s.id,...r,ref:t})});cte.displayName=jN;var Ix="SelectItem",[ute,kN]=Qm(Ix),PN=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...l}=e,h=Su(Ix,n),m=Cu(Ix,n),p=h.value===r,[x,b]=y.useState(a??""),[w,E]=y.useState(!1),M=Qt(t,N=>{var c;return(c=m.itemRefCallback)==null?void 0:c.call(m,N,r,s)}),C=li(),S=y.useRef("touch"),_=()=>{s||(h.onValueChange(r),h.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(ute,{scope:n,value:r,disabled:s,textId:C,isSelected:p,onItemTextChange:y.useCallback(N=>{b(c=>c||((N==null?void 0:N.textContent)??"").trim())},[]),children:f.jsx($b.ItemSlot,{scope:n,value:r,disabled:s,textValue:x,children:f.jsx(Lt.div,{role:"option","aria-labelledby":C,"data-highlighted":w?"":void 0,"aria-selected":p&&w,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:M,onFocus:ut(l.onFocus,()=>E(!0)),onBlur:ut(l.onBlur,()=>E(!1)),onClick:ut(l.onClick,()=>{S.current!=="mouse"&&_()}),onPointerUp:ut(l.onPointerUp,()=>{S.current==="mouse"&&_()}),onPointerDown:ut(l.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:ut(l.onPointerMove,N=>{var c;S.current=N.pointerType,s?(c=m.onItemLeave)==null||c.call(m):S.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ut(l.onPointerLeave,N=>{var c;N.currentTarget===document.activeElement&&((c=m.onItemLeave)==null||c.call(m))}),onKeyDown:ut(l.onKeyDown,N=>{var j;((j=m.searchRef)==null?void 0:j.current)!==""&&N.key===" "||(Yee.includes(N.key)&&_(),N.key===" "&&N.preventDefault())})})})})});PN.displayName=Ix;var Jp="SelectItemText",zN=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,l=Su(Jp,n),h=Cu(Jp,n),m=kN(Jp,n),p=Zee(Jp,n),[x,b]=y.useState(null),w=Qt(t,_=>b(_),m.onItemTextChange,_=>{var N;return(N=h.itemTextRefCallback)==null?void 0:N.call(h,_,m.value,m.disabled)}),E=x==null?void 0:x.textContent,M=y.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:E},m.value),[m.disabled,m.value,E]),{onNativeOptionAdd:C,onNativeOptionRemove:S}=p;return Wr(()=>(C(M),()=>S(M)),[C,S,M]),f.jsxs(f.Fragment,{children:[f.jsx(Lt.span,{id:m.textId,...a,ref:w}),m.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ol.createPortal(a.children,l.valueNode):null]})});zN.displayName=Jp;var BN="SelectItemIndicator",UN=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kN(BN,n).isSelected?f.jsx(Lt.span,{"aria-hidden":!0,...r,ref:t}):null});UN.displayName=BN;var o9="SelectScrollUpButton",FN=y.forwardRef((e,t)=>{const n=Cu(o9,e.__scopeSelect),r=LS(o9,e.__scopeSelect),[s,a]=y.useState(!1),l=Qt(t,r.onScrollButtonChange);return Wr(()=>{if(n.viewport&&n.isPositioned){let h=function(){const p=m.scrollTop>0;a(p)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),s?f.jsx(IN,{...e,ref:l,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});FN.displayName=o9;var a9="SelectScrollDownButton",HN=y.forwardRef((e,t)=>{const n=Cu(a9,e.__scopeSelect),r=LS(a9,e.__scopeSelect),[s,a]=y.useState(!1),l=Qt(t,r.onScrollButtonChange);return Wr(()=>{if(n.viewport&&n.isPositioned){let h=function(){const p=m.scrollHeight-m.clientHeight,x=Math.ceil(m.scrollTop)<p;a(x)};const m=n.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[n.viewport,n.isPositioned]),s?f.jsx(IN,{...e,ref:l,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=n;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});HN.displayName=a9;var IN=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=Cu("SelectScrollButton",n),l=y.useRef(null),h=Vb(n),m=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>m(),[m]),Wr(()=>{var x;const p=h().find(b=>b.ref.current===document.activeElement);(x=p==null?void 0:p.ref.current)==null||x.scrollIntoView({block:"nearest"})},[h]),f.jsx(Lt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ut(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ut(s.onPointerMove,()=>{var p;(p=a.onItemLeave)==null||p.call(a),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ut(s.onPointerLeave,()=>{m()})})}),dte="SelectSeparator",fte=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(Lt.div,{"aria-hidden":!0,...r,ref:t})});fte.displayName=dte;var l9="SelectArrow",hte=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=qb(n),a=Su(l9,n),l=Cu(l9,n);return a.open&&l.position==="popper"?f.jsx(Sb,{...s,...r,ref:t}):null});hte.displayName=l9;var mte="SelectBubbleInput",$N=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=y.useRef(null),a=Qt(r,s),l=rN(t);return y.useEffect(()=>{const h=s.current;if(!h)return;const m=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(m,"value").set;if(l!==t&&x){const b=new Event("change",{bubbles:!0});x.call(h,t),h.dispatchEvent(b)}},[l,t]),f.jsx(Lt.select,{...n,style:{...A_,...n.style},ref:a,defaultValue:t})});$N.displayName=mte;function VN(e){return e===""||e===void 0}function qN(e){const t=Ci(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(l=>{const h=n.current+l;t(h),function m(p){n.current=p,window.clearTimeout(r.current),p!==""&&(r.current=window.setTimeout(()=>m(""),1e3))}(h)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function WN(e,t,n){const s=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=pte(e,Math.max(a,0));s.length===1&&(l=l.filter(p=>p!==n));const m=l.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function pte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var gte=LN,vte=SN,yte=EN,xte=RN,bte=_N,Lte=MN,wte=DN,Ste=PN,Cte=zN,Ete=UN,Rte=FN,_te=HN;function Eo({...e}){return f.jsx(gte,{"data-slot":"select",...e})}function Ro({...e}){return f.jsx(yte,{"data-slot":"select-value",...e})}function _o({className:e,size:t="default",children:n,...r}){return f.jsxs(vte,{"data-slot":"select-trigger","data-size":t,className:He("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(xte,{asChild:!0,children:f.jsx(wo,{className:"size-4 opacity-50"})})]})}function Mo({className:e,children:t,position:n="popper",...r}){return f.jsx(bte,{children:f.jsxs(Lte,{"data-slot":"select-content",className:He("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[f.jsx(Mte,{}),f.jsx(wte,{className:He("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(Nte,{})]})})}function Vi({className:e,children:t,...n}){return f.jsxs(Ste,{"data-slot":"select-item",className:He("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(Ete,{children:f.jsx(aw,{className:"size-4"})})}),f.jsx(Cte,{children:t})]})}function Mte({className:e,...t}){return f.jsx(Rte,{"data-slot":"select-scroll-up-button",className:He("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(pu,{className:"size-4"})})}function Nte({className:e,...t}){return f.jsx(_te,{"data-slot":"select-scroll-down-button",className:He("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(wo,{className:"size-4"})})}const Ote={x:24,y:100},Tte=400;function SE({deviceId:e,onClose:t,variant:n,className:r}){const s=qi(),[a,l]=y.useState(null),[h,m]=y.useState(Ote),p=y.useRef(null),x=y.useRef(null),b=y.useCallback(ee=>{if(ee.target.closest("[data-no-drag]"))return;ee.preventDefault();const G=p.current;if(!G)return;const se=G.getBoundingClientRect();x.current={startX:ee.clientX,startY:ee.clientY,startLeft:se.left,startTop:se.top};const Ce=K=>{const Z=x.current;if(!Z)return;let oe=Z.startLeft+(K.clientX-Z.startX),Y=Z.startTop+(K.clientY-Z.startY);const ne=p.current;if(ne){const X=ne.offsetWidth,ue=ne.offsetHeight;oe=Math.max(0,Math.min(window.innerWidth-Math.min(X,120),oe)),Y=Math.max(0,Math.min(window.innerHeight-Math.min(ue,80),Y))}else oe=Math.max(0,Math.min(window.innerWidth-200,oe)),Y=Math.max(0,Math.min(window.innerHeight-150,Y));m({x:oe,y:Y})},te=()=>{window.removeEventListener("pointermove",Ce),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te),x.current=null};window.addEventListener("pointermove",Ce),window.addEventListener("pointerup",te),window.addEventListener("pointercancel",te)},[]),w=y.useCallback(ee=>{x.current&&(x.current=null)},[]),E=y.useMemo(()=>{var G;if(!s)return;const ee=s.systemManager.getDeviceById(e);return(G=ee==null?void 0:ee.interfaces)!=null&&G.includes(Ft.ScryptedInterface.PanTiltZoom)?ee:void 0},[s,e]),M=E==null?void 0:E.ptzCapabilities,C=(M==null?void 0:M.pan)===!0,S=(M==null?void 0:M.tilt)===!0,_=(M==null?void 0:M.zoom)===!0,N=M!=null&&M.presets&&typeof M.presets=="object"?Object.entries(M.presets):[],c=y.useCallback(async ee=>{if(E!=null&&E.ptzCommand){l(null);try{await E.ptzCommand({...ee,timeout:ee.timeout??Tte})}catch(G){l(G instanceof Error?G.message:String(G))}}},[E]),j=y.useCallback(()=>c({movement:"Relative",pan:-.3,tilt:0}),[c]),D=y.useCallback(()=>c({movement:"Relative",pan:.3,tilt:0}),[c]),B=y.useCallback(()=>c({movement:"Relative",pan:0,tilt:.3}),[c]),T=y.useCallback(()=>c({movement:"Relative",pan:0,tilt:-.3}),[c]),A=y.useCallback(()=>c({movement:"Relative",zoom:.2}),[c]),H=y.useCallback(()=>c({movement:"Relative",zoom:-.2}),[c]),F=y.useCallback(ee=>c({movement:"Preset",preset:ee}),[c]);if(!E||!C&&!S&&!_&&N.length===0)return f.jsxs("div",{className:He("flex flex-col gap-2 p-3",r),children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"PTZ non supportato per questo dispositivo."}),f.jsx(Qe,{variant:"outline",size:"sm",onClick:t,children:"Chiudi"})]});const V=n==="overlay";return f.jsx("div",{ref:p,className:He("fixed z-[50] w-fit",r),style:{left:h.x,top:h.y},children:f.jsxs("div",{className:He("flex flex-col bg-background border rounded-lg shadow-lg min-h-0 select-none",V?"p-3 max-h-[40vh] max-w-[90vw]":"w-56 p-3 max-h-[min(100vh-120px,400px)] min-h-0 overflow-hidden"),children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 shrink-0 mb-2 cursor-grab active:cursor-grabbing",onPointerDown:b,onPointerUp:w,role:"button",tabIndex:0,"aria-label":"Trascina per spostare",onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&ee.preventDefault()},children:[f.jsx("span",{className:"font-medium text-sm",children:"Controlli PTZ"}),f.jsx(Qe,{"data-no-drag":!0,variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,"aria-label":"Chiudi PTZ",children:f.jsx(gf,{className:"size-4"})})]}),a&&f.jsx("p",{className:"text-xs text-destructive mb-2 shrink-0",role:"alert",children:a}),f.jsxs("div",{className:"flex flex-col gap-3 shrink-0 min-h-0 overflow-auto",children:[(C||S)&&f.jsxs("div",{className:"grid grid-cols-3 gap-0.5 w-fit place-items-center mx-auto",children:[f.jsx("div",{className:"col-start-2",children:S&&f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:B,"aria-label":"Tilt su",children:f.jsx(pu,{className:"size-4"})})}),f.jsx("div",{className:"col-start-1 row-start-2",children:C&&f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:j,"aria-label":"Pan sinistra",children:f.jsx(Zd,{className:"size-4"})})}),f.jsx("div",{className:"col-start-2 row-start-2 w-9 h-9"}),f.jsx("div",{className:"col-start-3 row-start-2",children:C&&f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:D,"aria-label":"Pan destra",children:f.jsx(Jd,{className:"size-4"})})}),f.jsx("div",{className:"col-start-2 row-start-3",children:S&&f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:T,"aria-label":"Tilt giù",children:f.jsx(wo,{className:"size-4"})})})]}),_&&f.jsxs("div",{className:"flex items-center justify-center gap-1",children:[f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:H,"aria-label":"Zoom indietro",children:f.jsx(dw,{className:"size-4"})}),f.jsx(Qe,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:A,"aria-label":"Zoom avanti",children:f.jsx(uw,{className:"size-4"})})]}),N.length>0&&f.jsx("div",{className:"w-full",children:f.jsxs(Eo,{onValueChange:ee=>{ee&&F(ee)},children:[f.jsx(_o,{className:"w-full h-8 text-xs",size:"sm",children:f.jsx(Ro,{placeholder:"Preset…"})}),f.jsx(Mo,{side:"top",position:"popper",className:"max-h-[min(200px,50vh)]",children:N.map(([ee,G])=>f.jsx(Vi,{value:ee,className:"text-xs",children:typeof G=="string"?G:ee},ee))})]})})]})]})})}function CE(e){if(!Number.isFinite(e)||e<0)return"0:00";const t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}const Dte=`${Ft.ScryptedMimeTypes.SchemePrefix}https`,Ate="x-scrypted-nvr/x-scrypted-nvr-clip";function jte(){try{return MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L93.B0"')}catch{const t=document.createElement("video").canPlayType('video/mp4; codecs="hvc1.1.6.L93.B0"');return t==="probably"||t==="maybe"}}function kte({clip:e,onStop:t}){const n=qi(),r=Te(K=>K.audioOnOpen),{getVideoclipUrls:s}=ks(),{videoUrl:a}=s(e),l=y.useRef(null),[h,m]=y.useState(null),[p,x]=y.useState(null),[b,w]=y.useState(null),[E,M]=y.useState(!0),[C,S]=y.useState(!r),[_,N]=y.useState(!1),[c,j]=y.useState(0),[D,B]=y.useState(0),T=y.useRef(!1);y.useEffect(()=>{const K=!r;S(K),l.current&&(l.current.muted=K)},[r]),y.useEffect(()=>{if(!n||!e.deviceId){m(a||null),x(a?null:"No device");return}x(null),m(null);let K=!1;return(async()=>{var Z;try{const oe=n.systemManager.getDeviceById(e.deviceId);if(!((Z=oe==null?void 0:oe.interfaces)!=null&&Z.includes(Ft.ScryptedInterface.VideoClips))){K||m(a||null);return}const Y=e.videoId??e.id,ne=await oe.getVideoClip(Y);if(!ne||K)return;const X=n.mediaManager,ue=ne.mimeType??"video/mp4";let pe=null;if(ue===Dte||ue.startsWith(Ft.ScryptedMimeTypes.SchemePrefix)){const Se=await X.convertMediaObjectToBuffer(ne,ue);pe=Se==null?void 0:Se.toString("base64")}else ue===Ate?pe=await X.convertMediaObjectToLocalUrl(ne,Ft.ScryptedMimeTypes.LocalUrl):pe=await X.convertMediaObjectToLocalUrl(ne,ue);if(K)return;if(pe!=null&&pe.trim()){const Re=nN(pe,"");m(`${Re}${Re.includes("?")?"&":"?"}h265=${jte()}`)}else m(a||null)}catch(oe){K||(x(oe instanceof Error?oe.message:"Failed to load clip"),m(a||null))}})(),()=>{K=!0}},[n,e.deviceId,e.id,e.videoId,a]);const A=y.useCallback(()=>{const K=l.current;K&&(K.paused?(K.play(),M(!0)):(K.pause(),M(!1)))},[]),H=y.useCallback(()=>{S(K=>{const Z=!K;return l.current&&(l.current.muted=Z),Z})},[]),F=y.useCallback(()=>{var K;M(!((K=l.current)!=null&&K.paused))},[]),V=y.useCallback(()=>{const K=l.current;K!=null&&K.videoWidth&&K.videoHeight&&w(K.videoWidth/K.videoHeight),K&&Number.isFinite(K.duration)&&B(K.duration)},[]),ee=h??a??void 0,G=h===null&&!a&&!p;y.useEffect(()=>{const K=l.current;if(!K)return;const Z=()=>{!T.current&&Number.isFinite(K.currentTime)&&j(K.currentTime)},oe=()=>{Number.isFinite(K.duration)&&B(K.duration)},Y=()=>{T.current=!1,Number.isFinite(K.currentTime)&&j(K.currentTime)};return K.addEventListener("timeupdate",Z),K.addEventListener("durationchange",oe),K.addEventListener("seeked",Y),()=>{K.removeEventListener("timeupdate",Z),K.removeEventListener("durationchange",oe),K.removeEventListener("seeked",Y)}},[ee]);const se=y.useCallback(K=>{const Z=K[0],oe=l.current;oe&&Number.isFinite(oe.duration)&&(T.current=!0,oe.currentTime=Math.max(0,Math.min(Z,oe.duration)),j(oe.currentTime))},[]),Ce=_,te=y.useCallback(()=>N(K=>!K),[]);return y.useEffect(()=>{ee&&(j(0),B(0))},[ee]),f.jsx("div",{className:"group relative w-full h-full max-w-full max-h-full flex items-center justify-center min-h-0 min-w-0",onMouseLeave:()=>N(!1),children:f.jsxs("div",{className:"relative w-full max-h-full min-h-0 bg-background rounded-lg overflow-hidden",style:{aspectRatio:b??16/9},children:[f.jsxs("div",{className:"absolute inset-0 w-full h-full bg-black rounded overflow-hidden",onClick:te,children:[f.jsx("video",{ref:l,src:ee,autoPlay:!0,playsInline:!0,muted:C,className:"absolute inset-0 w-full h-full min-w-0 min-h-0 object-contain",style:{objectFit:"contain"},onLoadedMetadata:V,onPlay:F,onPause:F}),G&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80 text-white rounded text-sm",children:"Loading clip…"}),p&&!ee&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/80 text-red-400 p-4 text-center rounded text-sm",children:p})]}),f.jsxs("div",{className:He("absolute bottom-0 left-0 right-0 flex flex-col gap-1.5 py-1.5 px-2 transition-opacity duration-200 pointer-events-none rounded-b-lg bg-gradient-to-t from-black/80 to-transparent pt-6",Ce?"opacity-100 pointer-events-auto":"opacity-0 group-hover:opacity-100 group-hover:pointer-events-auto"),onClick:K=>K.stopPropagation(),children:[ee&&f.jsxs("div",{className:"flex items-center gap-2 w-full px-1",children:[f.jsx("span",{className:"text-xs text-white/90 tabular-nums shrink-0 w-9",children:CE(c)}),f.jsx(bS,{min:0,max:D>0?D:100,step:.1,value:[c],onValueChange:se,className:"flex-1 py-2 [&_[data-slot=slider-track]]:h-1.5 [&_[data-slot=slider-thumb]]:size-3.5 [&_[data-slot=slider-thumb]]:bg-white [&_[data-slot=slider-thumb]]:border-0"}),f.jsx("span",{className:"text-xs text-white/90 tabular-nums shrink-0 w-9",children:CE(D)})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/95 shadow-md p-1",children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 text-white hover:bg-neutral-700 hover:text-white",onClick:A,"aria-label":E?"Pause":"Play",children:E?f.jsx(og,{className:"size-4"}):f.jsx(tf,{className:"size-4"})}),f.jsxs(Qe,{variant:"ghost",size:"sm",className:"h-9 gap-1.5 text-white hover:bg-neutral-700 hover:text-white",onClick:t,"aria-label":"Stop and resume stream",children:[f.jsx(I9,{className:"size-4 fill-current"}),f.jsx("span",{children:"Stop"})]})]}),f.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-neutral-900/95 shadow-md p-1",children:f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-neutral-700 hover:text-white",onClick:H,"aria-label":C?"Unmute":"Mute",children:C?f.jsx(fx,{className:"size-4"}):f.jsx(Xd,{className:"size-4"})})})]})]})]})})}const Pte=rb("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function EE({className:e,variant:t,asChild:n=!1,...r}){const s=n?q9:"span";return f.jsx(s,{"data-slot":"badge",className:He(Pte({variant:t}),e),...r})}var RE=1,zte=.9,Bte=.8,Ute=.17,Q2=.1,Z2=.999,Fte=.9999,Hte=.99,Ite=/[\\\/_+.#"@\[\(\{&]/,$te=/[\\\/_+.#"@\[\(\{&]/g,Vte=/[\s-]/,GN=/[\s-]/g;function c9(e,t,n,r,s,a,l){if(a===t.length)return s===e.length?RE:Hte;var h=`${s},${a}`;if(l[h]!==void 0)return l[h];for(var m=r.charAt(a),p=n.indexOf(m,s),x=0,b,w,E,M;p>=0;)b=c9(e,t,n,r,p+1,a+1,l),b>x&&(p===s?b*=RE:Ite.test(e.charAt(p-1))?(b*=Bte,E=e.slice(s,p-1).match($te),E&&s>0&&(b*=Math.pow(Z2,E.length))):Vte.test(e.charAt(p-1))?(b*=zte,M=e.slice(s,p-1).match(GN),M&&s>0&&(b*=Math.pow(Z2,M.length))):(b*=Ute,s>0&&(b*=Math.pow(Z2,p-s))),e.charAt(p)!==t.charAt(a)&&(b*=Fte)),(b<Q2&&n.charAt(p-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(p-1)!==r.charAt(a))&&(w=c9(e,t,n,r,p+1,a+2,l),w*Q2>b&&(b=w*Q2)),b>x&&(x=b),p=n.indexOf(m,p+1);return l[h]=x,x}function _E(e){return e.toLowerCase().replace(GN," ")}function qte(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,c9(e,t,_E(e),_E(t),0,0,{})}var zp='[cmdk-group=""]',J2='[cmdk-group-items=""]',Wte='[cmdk-group-heading=""]',YN='[cmdk-item=""]',ME=`${YN}:not([aria-disabled="true"])`,u9="cmdk-item-select",tm="data-value",Gte=(e,t,n)=>qte(e,t,n),XN=y.createContext(void 0),s0=()=>y.useContext(XN),KN=y.createContext(void 0),wS=()=>y.useContext(KN),QN=y.createContext(void 0),ZN=y.forwardRef((e,t)=>{let n=nm(()=>{var X,ue;return{search:"",value:(ue=(X=e.value)!=null?X:e.defaultValue)!=null?ue:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=nm(()=>new Set),s=nm(()=>new Map),a=nm(()=>new Map),l=nm(()=>new Set),h=JN(e),{label:m,children:p,value:x,onValueChange:b,filter:w,shouldFilter:E,loop:M,disablePointerSelection:C=!1,vimBindings:S=!0,..._}=e,N=li(),c=li(),j=li(),D=y.useRef(null),B=ine();ff(()=>{if(x!==void 0){let X=x.trim();n.current.value=X,T.emit()}},[x]),ff(()=>{B(6,G)},[]);let T=y.useMemo(()=>({subscribe:X=>(l.current.add(X),()=>l.current.delete(X)),snapshot:()=>n.current,setState:(X,ue,pe)=>{var Se,Re,ye,ve;if(!Object.is(n.current[X],ue)){if(n.current[X]=ue,X==="search")ee(),F(),B(1,V);else if(X==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let he=document.getElementById(j);he?he.focus():(Se=document.getElementById(N))==null||Se.focus()}if(B(7,()=>{var he;n.current.selectedItemId=(he=se())==null?void 0:he.id,T.emit()}),pe||B(5,G),((Re=h.current)==null?void 0:Re.value)!==void 0){let he=ue??"";(ve=(ye=h.current).onValueChange)==null||ve.call(ye,he);return}}T.emit()}},emit:()=>{l.current.forEach(X=>X())}}),[]),A=y.useMemo(()=>({value:(X,ue,pe)=>{var Se;ue!==((Se=a.current.get(X))==null?void 0:Se.value)&&(a.current.set(X,{value:ue,keywords:pe}),n.current.filtered.items.set(X,H(ue,pe)),B(2,()=>{F(),T.emit()}))},item:(X,ue)=>(r.current.add(X),ue&&(s.current.has(ue)?s.current.get(ue).add(X):s.current.set(ue,new Set([X]))),B(3,()=>{ee(),F(),n.current.value||V(),T.emit()}),()=>{a.current.delete(X),r.current.delete(X),n.current.filtered.items.delete(X);let pe=se();B(4,()=>{ee(),(pe==null?void 0:pe.getAttribute("id"))===X&&V(),T.emit()})}),group:X=>(s.current.has(X)||s.current.set(X,new Set),()=>{a.current.delete(X),s.current.delete(X)}),filter:()=>h.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:N,inputId:j,labelId:c,listInnerRef:D}),[]);function H(X,ue){var pe,Se;let Re=(Se=(pe=h.current)==null?void 0:pe.filter)!=null?Se:Gte;return X?Re(X,n.current.search,ue):0}function F(){if(!n.current.search||h.current.shouldFilter===!1)return;let X=n.current.filtered.items,ue=[];n.current.filtered.groups.forEach(Se=>{let Re=s.current.get(Se),ye=0;Re.forEach(ve=>{let he=X.get(ve);ye=Math.max(he,ye)}),ue.push([Se,ye])});let pe=D.current;Ce().sort((Se,Re)=>{var ye,ve;let he=Se.getAttribute("id"),de=Re.getAttribute("id");return((ye=X.get(de))!=null?ye:0)-((ve=X.get(he))!=null?ve:0)}).forEach(Se=>{let Re=Se.closest(J2);Re?Re.appendChild(Se.parentElement===Re?Se:Se.closest(`${J2} > *`)):pe.appendChild(Se.parentElement===pe?Se:Se.closest(`${J2} > *`))}),ue.sort((Se,Re)=>Re[1]-Se[1]).forEach(Se=>{var Re;let ye=(Re=D.current)==null?void 0:Re.querySelector(`${zp}[${tm}="${encodeURIComponent(Se[0])}"]`);ye==null||ye.parentElement.appendChild(ye)})}function V(){let X=Ce().find(pe=>pe.getAttribute("aria-disabled")!=="true"),ue=X==null?void 0:X.getAttribute(tm);T.setState("value",ue||void 0)}function ee(){var X,ue,pe,Se;if(!n.current.search||h.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let Re=0;for(let ye of r.current){let ve=(ue=(X=a.current.get(ye))==null?void 0:X.value)!=null?ue:"",he=(Se=(pe=a.current.get(ye))==null?void 0:pe.keywords)!=null?Se:[],de=H(ve,he);n.current.filtered.items.set(ye,de),de>0&&Re++}for(let[ye,ve]of s.current)for(let he of ve)if(n.current.filtered.items.get(he)>0){n.current.filtered.groups.add(ye);break}n.current.filtered.count=Re}function G(){var X,ue,pe;let Se=se();Se&&(((X=Se.parentElement)==null?void 0:X.firstChild)===Se&&((pe=(ue=Se.closest(zp))==null?void 0:ue.querySelector(Wte))==null||pe.scrollIntoView({block:"nearest"})),Se.scrollIntoView({block:"nearest"}))}function se(){var X;return(X=D.current)==null?void 0:X.querySelector(`${YN}[aria-selected="true"]`)}function Ce(){var X;return Array.from(((X=D.current)==null?void 0:X.querySelectorAll(ME))||[])}function te(X){let ue=Ce()[X];ue&&T.setState("value",ue.getAttribute(tm))}function K(X){var ue;let pe=se(),Se=Ce(),Re=Se.findIndex(ve=>ve===pe),ye=Se[Re+X];(ue=h.current)!=null&&ue.loop&&(ye=Re+X<0?Se[Se.length-1]:Re+X===Se.length?Se[0]:Se[Re+X]),ye&&T.setState("value",ye.getAttribute(tm))}function Z(X){let ue=se(),pe=ue==null?void 0:ue.closest(zp),Se;for(;pe&&!Se;)pe=X>0?nne(pe,zp):rne(pe,zp),Se=pe==null?void 0:pe.querySelector(ME);Se?T.setState("value",Se.getAttribute(tm)):K(X)}let oe=()=>te(Ce().length-1),Y=X=>{X.preventDefault(),X.metaKey?oe():X.altKey?Z(1):K(1)},ne=X=>{X.preventDefault(),X.metaKey?te(0):X.altKey?Z(-1):K(-1)};return y.createElement(Lt.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:X=>{var ue;(ue=_.onKeyDown)==null||ue.call(_,X);let pe=X.nativeEvent.isComposing||X.keyCode===229;if(!(X.defaultPrevented||pe))switch(X.key){case"n":case"j":{S&&X.ctrlKey&&Y(X);break}case"ArrowDown":{Y(X);break}case"p":case"k":{S&&X.ctrlKey&&ne(X);break}case"ArrowUp":{ne(X);break}case"Home":{X.preventDefault(),te(0);break}case"End":{X.preventDefault(),oe();break}case"Enter":{X.preventDefault();let Se=se();if(Se){let Re=new Event(u9);Se.dispatchEvent(Re)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:one},m),Wb(e,X=>y.createElement(KN.Provider,{value:T},y.createElement(XN.Provider,{value:A},X))))}),Yte=y.forwardRef((e,t)=>{var n,r;let s=li(),a=y.useRef(null),l=y.useContext(QN),h=s0(),m=JN(e),p=(r=(n=m.current)==null?void 0:n.forceMount)!=null?r:l==null?void 0:l.forceMount;ff(()=>{if(!p)return h.item(s,l==null?void 0:l.id)},[p]);let x=eO(s,a,[e.value,e.children,a],e.keywords),b=wS(),w=xu(B=>B.value&&B.value===x.current),E=xu(B=>p||h.filter()===!1?!0:B.search?B.filtered.items.get(s)>0:!0);y.useEffect(()=>{let B=a.current;if(!(!B||e.disabled))return B.addEventListener(u9,M),()=>B.removeEventListener(u9,M)},[E,e.onSelect,e.disabled]);function M(){var B,T;C(),(T=(B=m.current).onSelect)==null||T.call(B,x.current)}function C(){b.setState("value",x.current,!0)}if(!E)return null;let{disabled:S,value:_,onSelect:N,forceMount:c,keywords:j,...D}=e;return y.createElement(Lt.div,{ref:cl(a,t),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!w,"data-disabled":!!S,"data-selected":!!w,onPointerMove:S||h.getDisablePointerSelection()?void 0:C,onClick:S?void 0:M},e.children)}),Xte=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...a}=e,l=li(),h=y.useRef(null),m=y.useRef(null),p=li(),x=s0(),b=xu(E=>s||x.filter()===!1?!0:E.search?E.filtered.groups.has(l):!0);ff(()=>x.group(l),[]),eO(l,h,[e.value,e.heading,m]);let w=y.useMemo(()=>({id:l,forceMount:s}),[s]);return y.createElement(Lt.div,{ref:cl(h,t),...a,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},n&&y.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:p},n),Wb(e,E=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?p:void 0},y.createElement(QN.Provider,{value:w},E))))}),Kte=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=y.useRef(null),a=xu(l=>!l.search);return!n&&!a?null:y.createElement(Lt.div,{ref:cl(s,t),...r,"cmdk-separator":"",role:"separator"})}),Qte=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,a=wS(),l=xu(p=>p.search),h=xu(p=>p.selectedItemId),m=s0();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(Lt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":h,id:m.inputId,type:"text",value:s?e.value:l,onChange:p=>{s||a.setState("search",p.target.value),n==null||n(p.target.value)}})}),Zte=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,a=y.useRef(null),l=y.useRef(null),h=xu(p=>p.selectedItemId),m=s0();return y.useEffect(()=>{if(l.current&&a.current){let p=l.current,x=a.current,b,w=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let E=p.offsetHeight;x.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return w.observe(p),()=>{cancelAnimationFrame(b),w.unobserve(p)}}},[]),y.createElement(Lt.div,{ref:cl(a,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":r,id:m.listId},Wb(e,p=>y.createElement("div",{ref:cl(l,m.listInnerRef),"cmdk-list-sizer":""},p)))}),Jte=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:a,container:l,...h}=e;return y.createElement(l4,{open:n,onOpenChange:r},y.createElement(c4,{container:l},y.createElement(u4,{"cmdk-overlay":"",className:s}),y.createElement(d4,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(ZN,{ref:t,...h}))))}),ene=y.forwardRef((e,t)=>xu(n=>n.filtered.count===0)?y.createElement(Lt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),tne=y.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...a}=e;return y.createElement(Lt.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Wb(e,l=>y.createElement("div",{"aria-hidden":!0},l)))}),Sf=Object.assign(ZN,{List:Zte,Item:Yte,Input:Qte,Group:Xte,Separator:Kte,Dialog:Jte,Empty:ene,Loading:tne});function nne(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rne(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JN(e){let t=y.useRef(e);return ff(()=>{t.current=e}),t}var ff=typeof window>"u"?y.useEffect:y.useLayoutEffect;function nm(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function xu(e){let t=wS(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function eO(e,t,n,r=[]){let s=y.useRef(),a=s0();return ff(()=>{var l;let h=(()=>{var p;for(let x of n){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(p=x.current.textContent)==null?void 0:p.trim():s.current}})(),m=r.map(p=>p.trim());a.value(e,h,m),(l=t.current)==null||l.setAttribute(tm,h),s.current=h}),s}var ine=()=>{let[e,t]=y.useState(),n=nm(()=>new Map);return ff(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function sne(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Wb({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(sne(t),{ref:t.ref},n(t.props.children)):n(t)}var one={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function mm({className:e,...t}){return f.jsx(Sf,{"data-slot":"command",className:He("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function ane({className:e,...t}){return f.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[f.jsx(a3,{className:"size-4 shrink-0 opacity-50"}),f.jsx(Sf.Input,{"data-slot":"command-input",className:He("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function pm({className:e,...t}){return f.jsx(Sf.List,{"data-slot":"command-list",className:He("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function lne({...e}){return f.jsx(Sf.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function cne({className:e,...t}){return f.jsx(Sf.Group,{"data-slot":"command-group",className:He("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function $x({className:e,...t}){return f.jsx(Sf.Separator,{"data-slot":"command-separator",className:He("bg-border -mx-1 h-px",e),...t})}function ia({className:e,...t}){return f.jsx(Sf.Item,{"data-slot":"command-item",className:He("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}const NE=rb("m-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),d9=y.forwardRef(({options:e,onValueChange:t,variant:n,defaultValue:r=[],value:s,placeholder:a="Select options",animation:l=0,maxCount:h=3,modalPopover:m=!1,asChild:p=!1,className:x,searchable:b=!1,searchPlaceholder:w="Search…",...E},M)=>{const[C,S]=y.useState(r),[_,N]=y.useState(!1),c=s!==void 0,j=c?s:C,D=F=>{const V=j.includes(F)?j.filter(ee=>ee!==F):[...j,F];c||S(V),t(V)},B=()=>{c||S([]),t([])},T=()=>{N(F=>!F)},A=(F,V)=>{V.stopPropagation();const ee=j.filter(G=>G!==F);c||S(ee),t(ee)},H=()=>{if(j.length===e.length)B();else{const F=e.map(V=>V.value);c||S(F),t(F)}};return f.jsxs(rl,{open:_,onOpenChange:N,modal:m,children:[f.jsx(il,{asChild:!0,children:f.jsx("div",{ref:M,role:"button",tabIndex:0,onClick:T,onKeyDown:F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),T())},className:He("flex w-full p-1 rounded-md border min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit cursor-pointer [&_svg]:pointer-events-auto","border-input bg-background hover:bg-accent hover:text-accent-foreground",x),children:j.length>0?f.jsxs("div",{className:"flex flex-1 min-w-0 flex-wrap items-center gap-1 py-1 pl-2 pr-1",children:[j.slice(0,h).map(F=>{const V=e.find(G=>G.value===F),ee=(V==null?void 0:V.label)??F;return f.jsxs(EE,{className:He("gap-1 pr-0.5 py-0 font-normal","bg-transparent text-foreground border-foreground/10 hover:bg-transparent",NE({variant:n})),style:{animationDuration:`${l}s`},children:[f.jsx("span",{className:"truncate max-w-[120px]",children:ee}),f.jsx("button",{type:"button",className:"rounded-sm p-0.5 hover:bg-muted focus:outline-none focus:ring-1 focus:ring-ring",onClick:G=>A(F,G),"aria-label":`Remove ${ee}`,children:f.jsx(KA,{className:"h-3.5 w-3.5"})})]},F)}),j.length>h&&f.jsxs(EE,{className:He("bg-transparent text-muted-foreground border-foreground/10",NE({variant:n})),children:["+",j.length-h]}),f.jsx(wo,{className:"ml-auto h-4 shrink-0 cursor-pointer text-muted-foreground"})]}):f.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[f.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:a}),f.jsx(wo,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),f.jsx(sl,{className:"w-auto p-0",align:"start",onEscapeKeyDown:()=>N(!1),children:f.jsxs(mm,{shouldFilter:b,children:[b&&f.jsx(ane,{placeholder:w,className:"h-9"}),f.jsxs(pm,{children:[f.jsxs(cne,{children:[f.jsxs(ia,{onSelect:H,className:"cursor-pointer",children:[f.jsx("div",{className:He("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",j.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:f.jsx(aw,{className:"h-4 w-4"})}),f.jsx("span",{children:"(Select All)"})]},"all"),e.map(F=>{const V=j.includes(F.value);return f.jsxs(ia,{onSelect:()=>D(F.value),className:"cursor-pointer",children:[f.jsx("div",{className:He("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",V?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:f.jsx(aw,{className:"h-4 w-4"})}),F.icon&&f.jsx(F.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),f.jsx("span",{children:F.label})]},F.value)})]}),b&&f.jsx(lne,{children:"No results found."})]})]})})]})});d9.displayName="MultiSelect";const une=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor"];function dne(e,t){const[n,r]=y.useState([]),[s,a]=y.useState(!0),[l,h]=y.useState(null),m=y.useCallback(async()=>{if(!e){r([]),a(!1),h(null);return}a(!0),h(null);try{const p=e.systemManager.getSystemState(),x=Object.keys(p??{}),b=new Set(une),w=[];for(const E of x)if(!(t&&E===t))try{const M=e.systemManager.getDeviceById(E),C=M==null?void 0:M.type;C&&b.has(C)&&w.push({id:E,name:typeof M.name=="string"?M.name:E,type:C})}catch{}w.sort((E,M)=>E.name.localeCompare(M.name,void 0,{sensitivity:"base"})),r(w)}catch(p){h(p instanceof Error?p.message:String(p)),r([])}finally{a(!1)}},[e,t]);return y.useEffect(()=>{m()},[m]),{devices:n,loading:s,error:l,refetch:m}}const fne=Object.values(ei),im=[{id:"devices",label:"Associated devices"},{id:"highlight",label:"Highlight"},{id:"camera-card",label:"Camera card"},{id:"timeline",label:"Timeline"}],OE=[{id:"custom",label:"Custom",windowSeconds:6,decibelThreshold:-30,hitPercentage:80,holdSeconds:3},{id:"crying",label:"Crying / baby",windowSeconds:6,decibelThreshold:-30,hitPercentage:65,holdSeconds:4},{id:"alarm",label:"Alarm / siren",windowSeconds:5,decibelThreshold:-20,hitPercentage:85,holdSeconds:6},{id:"dog",label:"Dog barking",windowSeconds:5,decibelThreshold:-28,hitPercentage:55,holdSeconds:4},{id:"doorbell",label:"Doorbell / knock",windowSeconds:3,decibelThreshold:-26,hitPercentage:70,holdSeconds:3},{id:"glass",label:"Glass break",windowSeconds:4,decibelThreshold:-22,hitPercentage:60,holdSeconds:4}],hne=400;function mne({entry:e,device:t,originalName:n,onRemove:r,onUpdateEntry:s}){const{attributes:a,listeners:l,setNodeRef:h,transform:m,transition:p,isDragging:x}=T7({id:e.id}),b=e.customName??"",[w,E]=y.useState(b),M=y.useRef(null);y.useEffect(()=>{E(b)},[b]);const C=y.useCallback(()=>{M.current&&(clearTimeout(M.current),M.current=null);const N=w.trim()||void 0;N!==b&&s(e.id,{customName:N})},[e.id,w,b,s]);y.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]);const S=y.useCallback(N=>{const c=N.target.value;E(c),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{M.current=null;const j=c.trim()||void 0;j!==(e.customName??"")&&s(e.id,{customName:j})},hne)},[e.id,e.customName,s]),_={transform:Om.Transform.toString(m),transition:p};return f.jsxs("div",{ref:h,style:_,className:He("flex flex-col gap-2 rounded-md border bg-muted/30 p-3",x&&"z-10 opacity-80 ring-2 ring-primary"),children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("button",{type:"button",className:"touch-none shrink-0 cursor-grab active:cursor-grabbing rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",...a,...l,"aria-label":"Drag to reorder",children:f.jsx(Sj,{className:"size-4"})}),f.jsx(bN,{type:(t==null?void 0:t.type)??"Sensor",customIcon:e.customIcon,className:"size-5 shrink-0 text-muted-foreground"}),f.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:n}),f.jsx(Qe,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground",onClick:()=>r(e.id),"aria-label":`Remove ${n}`,children:f.jsx(gf,{className:"size-4"})})]}),f.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Tr,{htmlFor:`name-${e.id}`,className:"text-xs",children:"Custom name"}),f.jsx(Li,{id:`name-${e.id}`,placeholder:(t==null?void 0:t.name)??e.id,value:w,onChange:S,onBlur:C,className:"h-8 text-sm"})]}),f.jsxs("div",{className:"space-y-1.5",children:[f.jsx(Tr,{htmlFor:`icon-${e.id}`,className:"text-xs",children:"Icon"}),f.jsxs(Eo,{value:e.customIcon??yN((t==null?void 0:t.type)??"Sensor"),onValueChange:N=>s(e.id,{customIcon:N}),children:[f.jsx(_o,{id:`icon-${e.id}`,className:"h-8 text-sm",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:xN.map(N=>f.jsx(Vi,{value:N.value,children:f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(N.Icon,{className:"size-4 shrink-0"}),N.label]})},N.value))})]})]})]})]})}function f9({cameraId:e,activeSection:t}){const n=qi(),r=Te(A=>A.cameraAssociatedDevices),s=Te(A=>A.setCameraAssociatedDevices),a=Te(A=>A.updateCameraAssociatedDeviceEntry),l=Te(A=>A.setCameraHighlightSettings),h=Te(A=>A.setCameraUiSettings),m=Te(Ig(A=>fb(A,e))),p=C4(e),[x,b]=y.useState("custom"),{devices:w,loading:E,error:M}=dne(n,e),C=y.useMemo(()=>r[e]??[],[e,r]),S=y.useMemo(()=>C.map(A=>A.id),[C]),[_,N]=y.useState({});y.useEffect(()=>{if(!n||C.length===0){N({});return}const A=[],H=F=>{try{const V=n.systemManager.getDeviceById(F),ee={name:typeof(V==null?void 0:V.name)=="string"?V.name:F,type:typeof(V==null?void 0:V.type)=="string"?V.type:"Sensor"};N(G=>({...G,[F]:ee}))}catch{}};for(const F of C){H(F.id);const V=n.systemManager.listenDevice(F.id,{event:void 0},()=>H(F.id));A.push(V)}return()=>A.forEach(F=>{var V;return(V=F.removeListener)==null?void 0:V.call(F)})},[n,C]);const c=y.useMemo(()=>{const A=new Map,H=new Map(w.map(F=>[F.id,{name:F.name,type:F.type}]));for(const F of C){const V=H.get(F.id),ee=_[F.id];A.set(F.id,{name:(ee==null?void 0:ee.name)??(V==null?void 0:V.name)??F.id,type:(V==null?void 0:V.type)??(typeof(ee==null?void 0:ee.type)=="string"?ee.type:void 0)??"Sensor"})}return A},[C,_,w]),j=y.useCallback(A=>{const H=new Map(C.map(ee=>[ee.id,ee])),F=new Map(w.map(ee=>[ee.id,ee])),V=A.map(ee=>{const G=H.get(ee);if(G)return G;const se=c.get(ee)??F.get(ee);return{id:ee,customIcon:yN((se==null?void 0:se.type)??"Sensor")}});s(e,V)},[e,C,c,w,s]),D=y.useCallback(A=>{const H=C.filter(F=>F.id!==A);s(e,H)},[e,C,s]),B=y.useCallback(A=>{const{active:H,over:F}=A;if(!F||H.id===F.id)return;const V=C.findIndex(se=>se.id===H.id),ee=C.findIndex(se=>se.id===F.id);if(V===-1||ee===-1)return;const G=kb(C,V,ee);s(e,G)},[e,C,s]),T=f7(d7(Db,{activationConstraint:{distance:8}}));return f.jsxs(f.Fragment,{children:[(t===void 0||t==="devices")&&f.jsxs("section",{className:"rounded-lg border bg-card p-4",children:[f.jsx("h2",{className:"font-medium text-base mb-2",children:"Associated devices"}),f.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Associate actuators (lights, switches, locks, window coverings, etc.) and sensors with this camera to show in the detail view."}),M&&f.jsx("p",{className:"text-sm text-destructive mb-2",children:M}),E?f.jsx("p",{className:"text-sm text-muted-foreground italic",children:"Loading devices…"}):f.jsxs(f.Fragment,{children:[f.jsx(d9,{options:w.map(A=>({label:`${A.name} (${A.type})`,value:A.id})),value:S,onValueChange:j,placeholder:"Select devices",maxCount:5,searchable:!0,searchPlaceholder:"Search devices…"},e),C.length>0&&f.jsxs("div",{className:"mt-4 space-y-3",children:[f.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Custom name & icon (optional). Drag the handle to reorder."}),f.jsx(R7,{sensors:T,onDragEnd:B,children:f.jsx(N7,{items:C.map(A=>A.id),strategy:zX,children:f.jsx("div",{className:"flex flex-col gap-3",children:C.map(A=>{const H=c.get(A.id),F=(H==null?void 0:H.name)??A.id;return f.jsx(mne,{entry:A,device:H,originalName:F,onRemove:D,onUpdateEntry:(V,ee)=>a(e,V,ee)},A.id)})})})})]})]})]}),(t===void 0||t==="highlight")&&f.jsxs("section",{className:"rounded-lg border bg-card p-4",children:[f.jsx("h2",{className:"font-medium text-base mb-2",children:"Highlight"}),f.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Glow around the stream when motion, audio or object detection is detected (this camera only)."}),f.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer mb-3",children:[f.jsx("input",{type:"checkbox",checked:p.highlightOnMotion,onChange:A=>l(e,{highlightOnMotion:A.target.checked}),className:"h-4 w-4 rounded border border-input accent-primary"}),"Highlight on motion"]}),f.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium cursor-pointer mb-3",children:[f.jsx("input",{type:"checkbox",checked:p.highlightOnDetection,onChange:A=>l(e,{highlightOnDetection:A.target.checked}),className:"h-4 w-4 rounded border border-input accent-primary"}),"Highlight on object detection"]}),p.highlightOnDetection&&f.jsxs("div",{className:"flex flex-col gap-3 pt-2 pb-2 border-t",children:[f.jsx(Tr,{children:"Detection classes"}),f.jsx(d9,{options:Object.values(nn).map(A=>({value:A,label:A.charAt(0).toUpperCase()+A.slice(1)})),value:p.highlightDetectionClassnames??[],onValueChange:A=>l(e,{highlightDetectionClassnames:A}),placeholder:"All classes",maxCount:5,searchable:!0,searchPlaceholder:"Search classes…"},`${e}-detection-classes`),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-detection-label",children:"Filter by label (optional)"}),f.jsx(Li,{id:"hl-detection-label",type:"text",value:p.highlightDetectionLabel??"",onChange:A=>l(e,{highlightDetectionLabel:A.target.value||void 0}),placeholder:"e.g. person, car"})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-detection-hold",children:"Auto off (s)"}),f.jsx(Li,{id:"hl-detection-hold",type:"number",min:1,max:60,value:p.highlightDetectionHoldSeconds??3,onChange:A=>l(e,{highlightDetectionHoldSeconds:Math.max(1,Math.min(60,Number(A.target.value)||3))})}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Seconds to keep highlight on after last matching detection (like audio hold)."})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Tr,{children:"Highlight on audio"}),f.jsxs(Eo,{value:p.highlightAudioMode,onValueChange:A=>l(e,{highlightAudioMode:A}),children:[f.jsx(_o,{className:"w-full max-w-xs",children:f.jsx(Ro,{})}),f.jsxs(Mo,{children:[f.jsx(Vi,{value:"off",children:"Off"}),f.jsx(Vi,{value:"sensor",children:"Sensor"}),f.jsx(Vi,{value:"level",children:"Audio level (dBFS)"})]})]})]}),p.highlightAudioMode==="level"&&f.jsxs("div",{className:"flex flex-col gap-3 pt-3 border-t mt-3",children:[f.jsx(Tr,{children:"Preset"}),f.jsxs(Eo,{value:x,onValueChange:A=>{const H=OE.find(F=>F.id===A);H&&A!=="custom"&&l(e,{highlightAudioLevelWindowSeconds:H.windowSeconds,highlightAudioLevelDecibelThreshold:H.decibelThreshold,highlightAudioLevelHitPercentage:H.hitPercentage,highlightAudioLevelHoldSeconds:H.holdSeconds}),b(A)},children:[f.jsx(_o,{className:"w-full max-w-xs",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:OE.map(A=>f.jsx(Vi,{value:A.id,children:A.label},A.id))})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-window",children:"Sampling window (s)"}),f.jsx(Li,{id:"hl-window",type:"number",min:1,max:60,value:p.highlightAudioLevelWindowSeconds,onChange:A=>{l(e,{highlightAudioLevelWindowSeconds:Number(A.target.value)||6}),b("custom")}})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-dbfs",children:"dBFS threshold"}),f.jsx(Li,{id:"hl-dbfs",type:"number",value:p.highlightAudioLevelDecibelThreshold,onChange:A=>{l(e,{highlightAudioLevelDecibelThreshold:Number(A.target.value)??-30}),b("custom")}})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-pct",children:"Hit %"}),f.jsx(Li,{id:"hl-pct",type:"number",min:0,max:100,value:p.highlightAudioLevelHitPercentage,onChange:A=>{l(e,{highlightAudioLevelHitPercentage:Number(A.target.value)||80}),b("custom")}})]}),f.jsxs("div",{className:"grid gap-2",children:[f.jsx(Tr,{htmlFor:"hl-hold",children:"Hold (s)"}),f.jsx(Li,{id:"hl-hold",type:"number",min:1,max:60,value:p.highlightAudioLevelHoldSeconds,onChange:A=>{l(e,{highlightAudioLevelHoldSeconds:Number(A.target.value)||3}),b("custom")}})]})]})]}),(t===void 0||t==="camera-card")&&f.jsxs("section",{className:"rounded-lg border bg-card p-4",children:[f.jsx("h2",{className:"font-medium text-base mb-2",children:"Camera card"}),f.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Toggle which info is shown on this camera card and on the stream overlay."}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Name"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show camera name"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowName,onChange:A=>h(e,{cameraCardShowName:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Battery"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show battery percentage and charging icon"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowBattery,onChange:A=>h(e,{cameraCardShowBattery:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Sleep"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show sleep icon when camera is in sleep mode"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowSleep,onChange:A=>h(e,{cameraCardShowSleep:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Motion"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show siren icon when motion is detected"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowMotion,onChange:A=>h(e,{cameraCardShowMotion:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Light"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show light icon when light is triggered"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowLight,onChange:A=>h(e,{cameraCardShowLight:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"dBFS"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show audio level (dBFS) from stream on overlay"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowDBFS,onChange:A=>h(e,{cameraCardShowDBFS:A.target.checked}),className:"h-4 w-4 rounded border-input"})]}),f.jsxs("label",{className:"flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"RMS"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Show RMS from stream audio on overlay"})]}),f.jsx("input",{type:"checkbox",checked:m.cameraCardShowRms,onChange:A=>h(e,{cameraCardShowRms:A.target.checked}),className:"h-4 w-4 rounded border-input"})]})]})]}),(t===void 0||t==="timeline")&&f.jsxs("section",{className:"rounded-lg border bg-card p-4",children:[f.jsx("h2",{className:"font-medium text-base mb-2",children:"Timeline"}),f.jsxs("div",{className:"flex flex-col gap-2 mt-2",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Detection source on timeline"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Which detection source to show on this camera timeline. Default: RawDetection."})]}),f.jsx("div",{className:"flex flex-col gap-2 mt-2",children:fne.map(A=>f.jsxs("label",{className:He("flex items-center gap-2 rounded-lg border p-3 cursor-pointer transition-colors",m.timelineDetectionSource===A?"bg-primary/10 border-primary":"hover:bg-muted/50"),children:[f.jsx("input",{type:"radio",name:`timeline-source-${e}`,checked:m.timelineDetectionSource===A,onChange:()=>h(e,{timelineDetectionSource:A}),className:"h-4 w-4"}),f.jsx(tS,{eventSource:A,small:!0}),f.jsx("span",{children:A})]},A))}),f.jsxs("div",{className:"mt-4",children:[f.jsx("label",{className:"font-medium",children:"Timeline refetch interval (seconds)"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"How often to refetch timeline events and artifacts when viewing the timeline. 0 = disabled."}),f.jsx("input",{type:"number",min:0,max:300,step:5,value:m.timelineRefetchIntervalSeconds??10,onChange:A=>{const H=parseInt(A.target.value,10);!Number.isNaN(H)&&H>=0&&h(e,{timelineRefetchIntervalSeconds:H})},className:"mt-2 h-9 rounded-md border bg-background px-3 w-24"})]})]})]})]})}function pne(){const e=ma(),{cameraId:t}=Zx(),n=Te(h=>h.configs),r=ml(),[s,a]=y.useState("devices"),l=y.useMemo(()=>{var h;return(h=n==null?void 0:n.cameras)==null?void 0:h.find(m=>m.id===t)},[n==null?void 0:n.cameras,t]);return t?n===void 0?f.jsx("div",{className:"flex flex-1 flex-col items-center justify-center p-4",children:f.jsx("p",{className:"text-muted-foreground",children:"Loading…"})}):l?f.jsxs("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:[f.jsxs("header",{className:"shrink-0 border-b bg-background px-2 py-2 md:px-4 md:py-3",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>e("/settings/cameras"),"aria-label":"Back to camera list",children:f.jsx(sa,{className:"size-5"})}),f.jsx("h1",{className:"font-semibold text-lg truncate min-w-0 flex-1",children:l.name})]}),r?f.jsxs(Eo,{value:s,onValueChange:h=>a(h),children:[f.jsx(_o,{className:"w-full max-w-xl h-10",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:im.map(h=>f.jsx(Vi,{value:h.id,children:h.label},h.id))})]}):f.jsx("div",{className:"flex border-b -mb-px max-w-xl",children:im.map(h=>f.jsx(Qe,{variant:"ghost",size:"sm",className:He("rounded-none border-b-2 border-transparent px-4 -mb-px",s===h.id&&"border-primary text-foreground"),onClick:()=>a(h.id),children:h.label},h.id))})]}),f.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 md:p-6",children:f.jsx("div",{className:He("flex flex-col gap-6",!r&&"max-w-xl"),children:f.jsx(f9,{cameraId:t,activeSection:s})})})]}):f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center p-4",children:[f.jsx("p",{className:"text-muted-foreground",children:"Camera not found."}),f.jsx(Qe,{variant:"link",onClick:()=>e("/settings/cameras"),className:"mt-2",children:"Back to list"})]}):null}function gne(e,t){const n=[...e].sort((a,l)=>a.timestamp-l.timestamp),r=[];let s=null;for(const a of n)a.motion==="on"?s=a.timestamp:a.motion==="off"&&s!=null&&(r.push({start:s,end:a.timestamp}),s=null);return s!=null&&r.push({start:s,end:t}),r}function vne(e){if(e.length<=1)return e;const t=[...e].sort((r,s)=>r.start-s.start),n=[t[0]];for(let r=1;r<t.length;r++){const s=n[n.length-1],a=t[r];a.start<=s.end?s.end=Math.max(s.end,a.end):n.push({...a})}return n}const Hy=[{value:"auto",label:"Auto"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}];function yne(e){switch(e){case"auto":return"Default";case"high":return"local-recorder";case"medium":return"medium-resolution";case"low":return"low-resolution";default:return"Default"}}function xne(){var Pt,Wt;const e=ma(),{cameraId:t}=Zx(),n=Te(Me=>Me.selectedCameraId),r=Te(Me=>Me.configs),s=t??n??void 0,a=Te(Me=>Me.playOnOpen),l=Te(Me=>Me.audioOnOpen),h=Te(Me=>Me.lastCamerasSnapshots),m=Te(Me=>Me.streamQualitySingle),p=Te(Me=>Me.setStreamQualitySingle),x=Te(Me=>Me.showObjectDetectionOverlay),b=Te(Me=>Me.setShowObjectDetectionOverlay),w=qi(),E=s?(h??{})[s]??null:null,M=KM(),C=y.useMemo(()=>{var Me;return(Me=r==null?void 0:r.cameras)==null?void 0:Me.find(gt=>gt.id===s)},[r==null?void 0:r.cameras,s]),S=y.useMemo(()=>C!=null&&C.name?[C.name]:[],[C==null?void 0:C.name]);y.useMemo(()=>Ii(new Date).getTime(),[]);const[_,N]=y.useState(),[c,j]=y.useState(null),[D,B]=y.useState(0),[T,A]=y.useState(()=>Ii(new Date).getTime()),[H,F]=y.useState(new Map),[V,ee]=y.useState(!1),G=y.useRef(new Set),[se,Ce]=y.useState(!1),[te,K]=y.useState(!1),[Z,oe]=y.useState(!1),[Y,ne]=y.useState("timeline"),[X,ue]=y.useState(!1),[pe,Se]=y.useState(!1),[Re,ye]=y.useState(!1),[ve,he]=y.useState("devices"),[de,ke]=y.useState(null),[Ee,Ke]=y.useState(0),ae=ml(),We=n4(),bt=ae&&!We?"vertical":"horizontal",{getCameraDayData:tt}=ks(),{timelineDetectionSource:mt,timelineRefetchIntervalSeconds:Xe}=Te(Ig(Me=>fb(Me,n??""))),at=y.useMemo(()=>Date.now(),[]),ot=y.useMemo(()=>Array.from(H.keys()).sort(),[H]),Ct=y.useMemo(()=>{if(ot.length===0){const St=Math.min(um(T).getTime(),at);return{start:Ii(T).getTime(),end:St}}const Me=Ii(new Date(ot[0].replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))).getTime(),gt=ot[ot.length-1],Jt=um(new Date(gt.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))).getTime();return{start:Me,end:Math.min(Jt,at)}},[ot,T,at]),Ot=y.useMemo(()=>{if(ot.length===0)return{events:[],motion:[],artifacts:[]};const Me=[],gt=[],Jt=[];for(const St of ot){const dt=H.get(St);dt!=null&&dt.events&&Me.push(...dt.events),dt!=null&&dt.motion&&gt.push(...dt.motion),dt!=null&&dt.artifacts&&Jt.push(...dt.artifacts)}return{events:Me,motion:gt,artifacts:Jt}},[H,ot]),kn=y.useMemo(()=>Ot.events.length?mt===ei.Auto?Ot.events:Ot.events.filter(Me=>String(Me.source??"")===String(mt)):[],[Ot.events,mt]),_t=y.useMemo(()=>{const Me=gne(Ot.motion,Ct.end);return vne(Me)},[Ot.motion,Ct.end]),kt=y.useRef(null),$=y.useCallback(Me=>{ke(Me),kt.current=Me,Me!=null&&Ke(Me)},[]),k=y.useCallback(Me=>{ke(Me),kt.current=Me},[]),z=y.useCallback(Me=>{const gt=br(Me,"yyyyMMdd");H.has(gt)||G.current.has(gt)||!s||!tt||(G.current.add(gt),ee(!0),tt(s,gt).then(Jt=>{F(St=>new Map(St).set(gt,Jt))}).catch(()=>{}).finally(()=>{G.current.delete(gt),ee(G.current.size>0)}))},[s,tt,H]);y.useEffect(()=>{if(!s||!tt){F(new Map);return}z(T)},[s,T,tt,z]),y.useEffect(()=>{if(Y!=="timeline"||!s||!tt||(Xe??0)<=0)return;const Me=Xe??10,gt=br(T,"yyyyMMdd"),Jt=setInterval(()=>{tt(s,gt).then(St=>F(dt=>new Map(dt).set(gt,St))).catch(()=>{})},Me*1e3);return()=>clearInterval(Jt)},[Y,s,tt,T,Xe]);const J=y.useCallback(Me=>{const gt=(Me.start+Me.end)/2,Jt=Ii(gt).getTime();if(Jt!==T&&A(Jt),ot.length===0)return;const St=ot[0],dt=ot[ot.length-1],en=Ii(new Date(St.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))).getTime(),bn=um(new Date(dt.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))).getTime();if(Me.end>bn){const rt=Hi(new Date(dt.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3")),1).getTime();rt<=Date.now()&&z(rt)}if(Me.start<en){const rt=sx(new Date(St.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3")),1).getTime();z(rt)}},[T,ot,z]),le=y.useCallback(()=>K(Me=>!Me),[]),xe=te||Z,Ae=y.useCallback(()=>{Z||K(!1)},[Z]),wt=y.useCallback(()=>{j(null),B(Me=>Me+1)},[]),Mt=y.useMemo(()=>yne(m),[m]),nt=y.useMemo(()=>C&&w?w.systemManager.getDeviceById(C.id):void 0,[C,w]);y.useEffect(()=>{if(!(nt!=null&&nt.interfaces)){N(void 0);return}try{const Me=nt.interfaces,gt={};Me.includes(Ft.ScryptedInterface.Battery)&&typeof nt.batteryLevel=="number"&&(gt.batteryLevel=nt.batteryLevel);const Jt=Me.includes(Ft.ScryptedInterface.Battery),St=Me.includes(Ft.ScryptedInterface.Charger);if(Jt||St){const dt=nt.chargeState,en=dt==="charging"||dt==="trickle",bn=dt==="not-charging";en?gt.chargingState=!0:bn&&(gt.chargingState=!1),gt.chargeStatus=dt??(en?"charging":bn?"not-charging":void 0)}Me.includes(Ft.ScryptedInterface.Sleep)&&(gt.sleeping=!!nt.sleeping),Me.includes(Ft.ScryptedInterface.Online)&&(gt.online=!!nt.online),Me.includes(Ft.ScryptedInterface.VideoRecorder)&&(gt.recording=!!nt.recordingActive),N(gt)}catch{N(void 0)}},[nt]);const pt=y.useMemo(()=>{var Me;return((Me=nt==null?void 0:nt.interfaces)==null?void 0:Me.includes(Ft.ScryptedInterface.VideoRecorder))??!1},[nt]),Bt=y.useMemo(()=>{var Me;return((Me=nt==null?void 0:nt.interfaces)==null?void 0:Me.includes(Ft.ScryptedInterface.PanTiltZoom))??!1},[nt]),gr=()=>{e("/cameras")};if(!C)return f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center p-4",children:[f.jsx("p",{className:"text-muted-foreground",children:"Camera not found"}),f.jsx(Qe,{variant:"link",onClick:gr,className:"mt-2",children:"Back to cameras"})]});const Lr="",wr=c?f.jsx(kte,{clip:c,onStop:wt}):f.jsxs("div",{className:"relative w-full h-full min-h-0 flex flex-col",children:[f.jsx(Zp,{camera:C,deviceState:_,destination:Mt,muted:!l,microphone:!1,playOnOpen:a,showObjectDetection:x,loadingSnapshotUrl:E,onSnapshotNeeded:s?()=>M(s):void 0},`live-${D}`),de!=null&&!pt&&f.jsxs("div",{className:"absolute inset-0 bg-black flex flex-col items-center justify-center gap-2 z-10",children:[f.jsx("p",{className:"text-muted-foreground text-sm",children:"Recording playback not available for this camera"}),f.jsxs(Qe,{variant:"secondary",size:"sm",className:"gap-1.5",onClick:()=>$(null),children:[f.jsx(dx,{className:"size-4"}),"Live"]})]}),de!=null&&pt&&s&&f.jsx(See,{deviceId:s,startTimeMs:Ee,muted:!l,onBackToLive:()=>$(null),onTimeUpdate:k})]}),ft=We?"reel-list-scroll flex-1 min-h-0 flex flex-row gap-0 overflow-x-auto overflow-y-hidden px-0 items-stretch":"reel-list-scroll flex-1 min-h-0 flex flex-col gap-0 overflow-y-auto px-0 md:flex-row md:overflow-y-hidden md:overflow-x-auto md:items-stretch",jt=We?"shrink-0 h-full min-h-[80px] w-auto":"shrink-0 w-full max-w-full md:w-80 md:min-w-[20rem] md:h-full md:min-h-[140px] md:max-w-none",qt=f.jsxs("div",{className:"flex flex-1 min-h-0 flex-col border-t bg-muted/30 md:border-t-0 md:bg-muted/30 overflow-hidden",children:[f.jsxs("div",{className:"shrink-0 flex flex-wrap items-center gap-2 px-3 py-2 border-b bg-muted/50",children:[We&&f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>Ce(!1),"aria-label":"Close reel",children:f.jsx(wo,{className:"size-4"})}),f.jsxs("div",{className:"flex rounded-md border bg-background p-0.5 shrink-0",children:[f.jsxs(Qe,{variant:Y==="timeline"?"secondary":"ghost",size:"sm",className:He("h-7 gap-1.5 text-xs","px-2"),onClick:()=>ne("timeline"),"aria-label":"Timeline",children:[f.jsx(B9,{className:"size-3.5 shrink-0"}),!ae&&f.jsx("span",{children:"Timeline"})]}),f.jsxs(Qe,{variant:Y==="videoclips"?"secondary":"ghost",size:"sm",className:He("h-7 gap-1.5 text-xs","px-2"),onClick:()=>ne("videoclips"),"aria-label":"Videoclips",children:[f.jsx(ef,{className:"size-3.5 shrink-0"}),!ae&&f.jsx("span",{children:"Videoclips"})]})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs font-normal","aria-label":"Pick date",children:[f.jsx(TA,{className:"size-3.5"}),br(T,"d MMM yyyy")]})}),f.jsx(sl,{className:"w-auto p-0",align:"start",children:f.jsx(uS,{mode:"single",selected:new Date(T),onSelect:Me=>Me&&A(Ii(Me).getTime())})})]}),f.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[Bt&&f.jsxs(Qe,{variant:X?"secondary":"ghost",size:"sm",className:He("h-8 gap-1.5 text-xs",ae&&"px-2"),onClick:()=>ue(Me=>!Me),"aria-label":"PTZ controls",children:[f.jsx(ej,{className:"size-3.5 shrink-0"}),!ae&&f.jsx("span",{children:"PTZ"})]}),f.jsxs(Qe,{variant:pe?"secondary":"ghost",size:"sm",className:He("h-8 gap-1.5 text-xs",ae&&"px-2"),onClick:()=>Se(Me=>!Me),"aria-label":"Device controls",children:[f.jsx(tb,{className:"size-3.5 shrink-0"}),!ae&&f.jsx("span",{children:"Devices"})]})]})]}),f.jsxs("div",{className:"flex-1 min-h-0 px-3 pb-3 pt-2 flex flex-col overflow-y-auto overflow-x-hidden min-h-[180px] relative",children:[X&&s&&f.jsx(SE,{deviceId:s,onClose:()=>ue(!1),variant:ae?"overlay":"side"}),pe&&s&&f.jsx(wE,{cameraId:s,onClose:()=>Se(!1),variant:ae?"overlay":"side",onOpenSettings:()=>{Se(!1),ye(!0),he("devices")}}),f.jsx("div",{className:"flex-1 min-h-0 flex min-w-0",children:f.jsx("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:Y==="videoclips"?f.jsx(KJ,{date:T,cameras:S,pageSize:50,onPlayInPlayer:j,compactItems:!0,compactVertical:We,compactLarge:!We,listClassName:ft,itemClassName:jt}):We?f.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Timeline disponibile in modalità desktop"}):f.jsxs("div",{className:"flex-1 flex flex-col min-h-0 relative",children:[f.jsx(bK,{loading:V,orientation:bt,timeRange:Ct,onTimeRangeChange:J,events:kn,motionSegments:_t,artifacts:Ot.artifacts,getRuleArtifactsForCluster:Ot.artifacts.length>0?Me=>Ot.artifacts.filter(gt=>gt.timestamp>=Me.startMs&&gt.timestamp<=Me.endMs):void 0,assetsBaseUrl:Lr,className:"w-full h-full min-h-0",scrubTimeMs:de??void 0,onScrubTimeChange:Me=>$(Me??null)}),!V&&ot.length===0&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",children:"No data for this date"})]})})})]})]});return We?f.jsxs("div",{className:"fixed inset-0 flex flex-col bg-black z-[60]",children:[f.jsx("div",{className:"absolute inset-0 flex items-center justify-center",onClick:le,onMouseLeave:Ae,"aria-hidden":xe,children:wr}),f.jsxs("div",{className:`absolute top-0 left-0 right-0 flex items-center justify-between p-2 bg-gradient-to-b from-black/60 to-transparent z-10 transition-opacity duration-200 ${xe?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,onMouseLeave:Ae,children:[f.jsx("div",{children:f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-white hover:bg-white/20",onClick:gr,"aria-label":"Back to cameras",children:f.jsx(sa,{className:"size-5"})})}),f.jsxs("div",{children:[f.jsxs(Ax,{open:Z,onOpenChange:oe,children:[f.jsx(jx,{asChild:!0,children:f.jsxs(Qe,{variant:"ghost",size:"sm",className:"h-9 gap-1 shrink-0 text-white hover:bg-white/20","aria-label":"Stream resolution",children:[f.jsx("span",{children:((Pt=Hy.find(Me=>Me.value===m))==null?void 0:Pt.label)??"Auto"}),f.jsx(wo,{className:"size-4 opacity-70"})]})}),f.jsxs(kx,{align:"end",className:"w-56 z-[70]",children:[f.jsx(zx,{children:"Stream resolution"}),f.jsx(Px,{value:m,onValueChange:Me=>p(Me),children:Hy.map(Me=>f.jsx(hm,{value:Me.value,children:Me.label},Me.value))}),f.jsx(YC,{className:"my-1"}),f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 text-sm cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:x,onChange:Me=>b(Me.target.checked),className:"h-4 w-4 rounded border border-input accent-primary"}),f.jsx("span",{children:"Detection live"})]})]})]}),f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-white hover:bg-white/20","aria-label":"Camera settings",onClick:()=>ye(!0),children:f.jsx(ag,{className:"size-5"})})]})]}),!se&&f.jsx(Qe,{variant:"ghost",size:"icon",className:`fixed bottom-4 left-1/2 -translate-x-1/2 z-20 h-10 w-10 rounded-full bg-black/50 text-white hover:bg-black/70 border border-white/20 transition-opacity duration-200 ${xe?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,onClick:()=>Ce(!0),"aria-label":"Open video reel",children:f.jsx(pu,{className:"size-5"})}),f.jsx("div",{className:`fixed left-0 right-0 bottom-0 z-30 h-[min(50vh,320px)] bg-background border-t shadow-xl flex flex-col transition-transform duration-200 ease-out ${se?"translate-y-0":"translate-y-full"}`,children:f.jsx("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:qt})}),se&&f.jsx("button",{type:"button",className:"fixed inset-0 z-[25] bg-black/30","aria-label":"Close reel",onClick:()=>Ce(!1)}),X&&s&&f.jsx(SE,{deviceId:s,onClose:()=>ue(!1),variant:"overlay"}),pe&&s&&f.jsx(wE,{cameraId:s,onClose:()=>Se(!1),variant:"overlay",onOpenSettings:()=>{Se(!1),ye(!0),he("devices")}}),f.jsx(Bx,{open:Re,onOpenChange:ye,children:f.jsxs(Ux,{className:"max-h-[90vh] overflow-y-auto max-w-xl flex flex-col",children:[f.jsx(cE,{children:"Camera settings"}),ae?f.jsxs(Eo,{value:ve,onValueChange:Me=>he(Me),children:[f.jsx(_o,{className:"w-full h-10",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:im.map(Me=>f.jsx(Vi,{value:Me.id,children:Me.label},Me.id))})]}):f.jsx("div",{className:"flex border-b -mb-px",children:im.map(Me=>f.jsx(Qe,{variant:"ghost",size:"sm",className:He("rounded-none border-b-2 border-transparent px-4 -mb-px",ve===Me.id&&"border-primary text-foreground"),onClick:()=>he(Me.id),children:Me.label},Me.id))}),s&&f.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto pt-2",children:f.jsx(f9,{cameraId:s,activeSection:ve})})]})})]}):f.jsxs("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:[f.jsxs("header",{className:"shrink-0 flex items-center gap-2 px-2 py-2 border-b bg-background",children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:gr,"aria-label":"Back to cameras",children:f.jsx(sa,{className:"size-5"})}),f.jsx("h1",{className:"font-semibold text-lg truncate min-w-0 flex-1",children:C.name}),f.jsxs(Ax,{children:[f.jsx(jx,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 shrink-0","aria-label":"Stream resolution",children:[f.jsx("span",{children:((Wt=Hy.find(Me=>Me.value===m))==null?void 0:Wt.label)??"Auto"}),f.jsx(wo,{className:"size-4 opacity-50"})]})}),f.jsxs(kx,{align:"end",className:"w-56",children:[f.jsx(zx,{children:"Stream resolution"}),f.jsx(Px,{value:m,onValueChange:Me=>p(Me),children:Hy.map(Me=>f.jsx(hm,{value:Me.value,children:Me.label},Me.value))}),f.jsx(YC,{className:"my-1"}),f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 text-sm cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:x,onChange:Me=>b(Me.target.checked),className:"h-4 w-4 rounded border border-input accent-primary"}),f.jsx("span",{children:"Detection live"})]})]})]}),f.jsx(Qe,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0","aria-label":"Camera settings",onClick:()=>ye(!0),children:f.jsx(ag,{className:"size-4"})})]}),f.jsxs("div",{className:"flex-1 min-h-0 flex flex-col gap-0 overflow-hidden max-h-[100dvh] md:max-h-[100vh]",children:[f.jsx("div",{className:"shrink-0 md:flex-1 md:min-h-0 w-full overflow-hidden flex flex-col min-h-[160px] md:min-h-0",children:f.jsx("div",{className:"flex-1 min-h-0 p-0 md:p-2 flex items-center justify-center",children:wr})}),f.jsx("div",{className:"flex-1 min-h-0 flex flex-col md:flex-none md:shrink-0 md:h-[28vh] overflow-hidden",children:qt})]}),f.jsx(Bx,{open:Re,onOpenChange:ye,children:f.jsxs(Ux,{className:"max-h-[90vh] overflow-y-auto max-w-xl flex flex-col",children:[f.jsx(cE,{children:"Camera settings"}),ae?f.jsxs(Eo,{value:ve,onValueChange:Me=>he(Me),children:[f.jsx(_o,{className:"w-full h-10",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:im.map(Me=>f.jsx(Vi,{value:Me.id,children:Me.label},Me.id))})]}):f.jsx("div",{className:"flex border-b -mb-px",children:im.map(Me=>f.jsx(Qe,{variant:"ghost",size:"sm",className:He("rounded-none border-b-2 border-transparent px-4 -mb-px",ve===Me.id&&"border-primary text-foreground"),onClick:()=>he(Me.id),children:Me.label},Me.id))}),s&&f.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto pt-2",children:f.jsx(f9,{cameraId:s,activeSection:ve})})]})})]})}var o0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},bne={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},iu,O9,w8,Lne=(w8=class{constructor(){Vt(this,iu,bne);Vt(this,O9,!1)}setTimeoutProvider(e){xt(this,iu,e)}setTimeout(e,t){return ge(this,iu).setTimeout(e,t)}clearTimeout(e){ge(this,iu).clearTimeout(e)}setInterval(e,t){return ge(this,iu).setInterval(e,t)}clearInterval(e){ge(this,iu).clearInterval(e)}},iu=new WeakMap,O9=new WeakMap,w8),Bd=new Lne;function wne(e){setTimeout(e,0)}var hf=typeof window>"u"||"Deno"in globalThis;function Os(){}function Sne(e,t){return typeof e=="function"?e(t):e}function h9(e){return typeof e=="number"&&e>=0&&e!==1/0}function tO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mu(e,t){return typeof e=="function"?e(t):e}function bo(e,t){return typeof e=="function"?e(t):e}function TE(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:l,stale:h}=e;if(l){if(r){if(t.queryHash!==SS(l,t.options))return!1}else if(!Eg(t.queryKey,l))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof h=="boolean"&&t.isStale()!==h||s&&s!==t.state.fetchStatus||a&&!a(t))}function DE(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Cg(t.options.mutationKey)!==Cg(a))return!1}else if(!Eg(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function SS(e,t){return((t==null?void 0:t.queryKeyHashFn)||Cg)(e)}function Cg(e){return JSON.stringify(e,(t,n)=>p9(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Eg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Eg(e[n],t[n])):!1}var Cne=Object.prototype.hasOwnProperty;function nO(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=AE(e)&&AE(t);if(!r&&!(p9(e)&&p9(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),h=l.length,m=r?new Array(h):{};let p=0;for(let x=0;x<h;x++){const b=r?x:l[x],w=e[b],E=t[b];if(w===E){m[b]=w,(r?x<a:Cne.call(e,b))&&p++;continue}if(w===null||E===null||typeof w!="object"||typeof E!="object"){m[b]=E;continue}const M=nO(w,E,n+1);m[b]=M,M===w&&p++}return a===h&&p===a?e:m}function m9(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function AE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function p9(e){if(!jE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!jE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function jE(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ene(e){return new Promise(t=>{Bd.setTimeout(t,e)})}function g9(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?nO(e,t):t}function Rne(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _ne(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CS=Symbol();function rO(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===CS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iO(e,t){return typeof e=="function"?e(...t):!!e}function Mne(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Fd,su,gm,S8,Nne=(S8=class extends o0{constructor(){super();Vt(this,Fd);Vt(this,su);Vt(this,gm);xt(this,gm,t=>{if(!hf&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ge(this,su)||this.setEventListener(ge(this,gm))}onUnsubscribe(){var t;this.hasListeners()||((t=ge(this,su))==null||t.call(this),xt(this,su,void 0))}setEventListener(t){var n;xt(this,gm,t),(n=ge(this,su))==null||n.call(this),xt(this,su,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ge(this,Fd)!==t&&(xt(this,Fd,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ge(this,Fd)=="boolean"?ge(this,Fd):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Fd=new WeakMap,su=new WeakMap,gm=new WeakMap,S8),ES=new Nne;function v9(){let e,t;const n=new Promise((s,a)=>{e=s,t=a});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var One=wne;function Tne(){let e=[],t=0,n=h=>{h()},r=h=>{h()},s=One;const a=h=>{t?e.push(h):s(()=>{n(h)})},l=()=>{const h=e;e=[],h.length&&s(()=>{r(()=>{h.forEach(m=>{n(m)})})})};return{batch:h=>{let m;t++;try{m=h()}finally{t--,t||l()}return m},batchCalls:h=>(...m)=>{a(()=>{h(...m)})},schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:h=>{s=h}}}var wi=Tne(),vm,ou,ym,C8,Dne=(C8=class extends o0{constructor(){super();Vt(this,vm,!0);Vt(this,ou);Vt(this,ym);xt(this,ym,t=>{if(!hf&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ge(this,ou)||this.setEventListener(ge(this,ym))}onUnsubscribe(){var t;this.hasListeners()||((t=ge(this,ou))==null||t.call(this),xt(this,ou,void 0))}setEventListener(t){var n;xt(this,ym,t),(n=ge(this,ou))==null||n.call(this),xt(this,ou,t(this.setOnline.bind(this)))}setOnline(t){ge(this,vm)!==t&&(xt(this,vm,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ge(this,vm)}},vm=new WeakMap,ou=new WeakMap,ym=new WeakMap,C8),Vx=new Dne;function Ane(e){return Math.min(1e3*2**e,3e4)}function sO(e){return(e??"online")==="online"?Vx.isOnline():!0}var y9=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function oO(e){let t=!1,n=0,r;const s=v9(),a=()=>s.status!=="pending",l=C=>{var S;if(!a()){const _=new y9(C);w(_),(S=e.onCancel)==null||S.call(e,_)}},h=()=>{t=!0},m=()=>{t=!1},p=()=>ES.isFocused()&&(e.networkMode==="always"||Vx.isOnline())&&e.canRun(),x=()=>sO(e.networkMode)&&e.canRun(),b=C=>{a()||(r==null||r(),s.resolve(C))},w=C=>{a()||(r==null||r(),s.reject(C))},E=()=>new Promise(C=>{var S;r=_=>{(a()||p())&&C(_)},(S=e.onPause)==null||S.call(e)}).then(()=>{var C;r=void 0,a()||(C=e.onContinue)==null||C.call(e)}),M=()=>{if(a())return;let C;const S=n===0?e.initialPromise:void 0;try{C=S??e.fn()}catch(_){C=Promise.reject(_)}Promise.resolve(C).then(b).catch(_=>{var B;if(a())return;const N=e.retry??(hf?0:3),c=e.retryDelay??Ane,j=typeof c=="function"?c(n,_):c,D=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,_);if(t||!D){w(_);return}n++,(B=e.onFail)==null||B.call(e,n,_),Ene(j).then(()=>p()?void 0:E()).then(()=>{t?w(_):M()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(r==null||r(),s),cancelRetry:h,continueRetry:m,canStart:x,start:()=>(x()?M():E().then(M),s)}}var Hd,E8,aO=(E8=class{constructor(){Vt(this,Hd)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),h9(this.gcTime)&&xt(this,Hd,Bd.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hf?1/0:5*60*1e3))}clearGcTimeout(){ge(this,Hd)&&(Bd.clearTimeout(ge(this,Hd)),xt(this,Hd,void 0))}},Hd=new WeakMap,E8),Id,xm,vo,$d,hi,Mg,Vd,na,Gl,R8,jne=(R8=class extends aO{constructor(t){super();Vt(this,na);Vt(this,Id);Vt(this,xm);Vt(this,vo);Vt(this,$d);Vt(this,hi);Vt(this,Mg);Vt(this,Vd);xt(this,Vd,!1),xt(this,Mg,t.defaultOptions),this.setOptions(t.options),this.observers=[],xt(this,$d,t.client),xt(this,vo,ge(this,$d).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xt(this,Id,PE(this.options)),this.state=t.state??ge(this,Id),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ge(this,hi))==null?void 0:t.promise}setOptions(t){if(this.options={...ge(this,Mg),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=PE(this.options);n.data!==void 0&&(this.setState(kE(n.data,n.dataUpdatedAt)),xt(this,Id,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ge(this,vo).remove(this)}setData(t,n){const r=g9(this.state.data,t,this.options);return Dn(this,na,Gl).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Dn(this,na,Gl).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=ge(this,hi))==null?void 0:r.promise;return(s=ge(this,hi))==null||s.cancel(t),n?n.then(Os).catch(Os):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ge(this,Id))}isActive(){return this.observers.some(t=>bo(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>mu(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!tO(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ge(this,hi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ge(this,hi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ge(this,vo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ge(this,hi)&&(ge(this,Vd)?ge(this,hi).cancel({revert:!0}):ge(this,hi).cancelRetry()),this.scheduleGc()),ge(this,vo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Dn(this,na,Gl).call(this,{type:"invalidate"})}async fetch(t,n){var m,p,x,b,w,E,M,C,S,_,N,c;if(this.state.fetchStatus!=="idle"&&((m=ge(this,hi))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ge(this,hi))return ge(this,hi).continueRetry(),ge(this,hi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const j=this.observers.find(D=>D.options.queryFn);j&&this.setOptions(j.options)}const r=new AbortController,s=j=>{Object.defineProperty(j,"signal",{enumerable:!0,get:()=>(xt(this,Vd,!0),r.signal)})},a=()=>{const j=rO(this.options,n),B=(()=>{const T={client:ge(this,$d),queryKey:this.queryKey,meta:this.meta};return s(T),T})();return xt(this,Vd,!1),this.options.persister?this.options.persister(j,B,this):j(B)},h=(()=>{const j={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ge(this,$d),state:this.state,fetchFn:a};return s(j),j})();(p=this.options.behavior)==null||p.onFetch(h,this),xt(this,xm,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=h.fetchOptions)==null?void 0:x.meta))&&Dn(this,na,Gl).call(this,{type:"fetch",meta:(b=h.fetchOptions)==null?void 0:b.meta}),xt(this,hi,oO({initialPromise:n==null?void 0:n.initialPromise,fn:h.fetchFn,onCancel:j=>{j instanceof y9&&j.revert&&this.setState({...ge(this,xm),fetchStatus:"idle"}),r.abort()},onFail:(j,D)=>{Dn(this,na,Gl).call(this,{type:"failed",failureCount:j,error:D})},onPause:()=>{Dn(this,na,Gl).call(this,{type:"pause"})},onContinue:()=>{Dn(this,na,Gl).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const j=await ge(this,hi).start();if(j===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(j),(E=(w=ge(this,vo).config).onSuccess)==null||E.call(w,j,this),(C=(M=ge(this,vo).config).onSettled)==null||C.call(M,j,this.state.error,this),j}catch(j){if(j instanceof y9){if(j.silent)return ge(this,hi).promise;if(j.revert){if(this.state.data===void 0)throw j;return this.state.data}}throw Dn(this,na,Gl).call(this,{type:"error",error:j}),(_=(S=ge(this,vo).config).onError)==null||_.call(S,j,this),(c=(N=ge(this,vo).config).onSettled)==null||c.call(N,this.state.data,j,this),j}finally{this.scheduleGc()}}},Id=new WeakMap,xm=new WeakMap,vo=new WeakMap,$d=new WeakMap,hi=new WeakMap,Mg=new WeakMap,Vd=new WeakMap,na=new WeakSet,Gl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...lO(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...kE(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return xt(this,xm,t.manual?s:void 0),s;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),wi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ge(this,vo).notify({query:this,type:"updated",action:t})})},R8);function lO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sO(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function PE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ns,An,Ng,as,qd,bm,Kl,au,Og,Lm,wm,Wd,Gd,lu,Sm,Kn,eg,x9,b9,L9,w9,S9,C9,E9,cO,_8,kne=(_8=class extends o0{constructor(t,n){super();Vt(this,Kn);Vt(this,Ns);Vt(this,An);Vt(this,Ng);Vt(this,as);Vt(this,qd);Vt(this,bm);Vt(this,Kl);Vt(this,au);Vt(this,Og);Vt(this,Lm);Vt(this,wm);Vt(this,Wd);Vt(this,Gd);Vt(this,lu);Vt(this,Sm,new Set);this.options=n,xt(this,Ns,t),xt(this,au,null),xt(this,Kl,v9()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ge(this,An).addObserver(this),zE(ge(this,An),this.options)?Dn(this,Kn,eg).call(this):this.updateResult(),Dn(this,Kn,w9).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return R9(ge(this,An),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return R9(ge(this,An),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Dn(this,Kn,S9).call(this),Dn(this,Kn,C9).call(this),ge(this,An).removeObserver(this)}setOptions(t){const n=this.options,r=ge(this,An);if(this.options=ge(this,Ns).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bo(this.options.enabled,ge(this,An))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Dn(this,Kn,E9).call(this),ge(this,An).setOptions(this.options),n._defaulted&&!m9(this.options,n)&&ge(this,Ns).getQueryCache().notify({type:"observerOptionsUpdated",query:ge(this,An),observer:this});const s=this.hasListeners();s&&BE(ge(this,An),r,this.options,n)&&Dn(this,Kn,eg).call(this),this.updateResult(),s&&(ge(this,An)!==r||bo(this.options.enabled,ge(this,An))!==bo(n.enabled,ge(this,An))||mu(this.options.staleTime,ge(this,An))!==mu(n.staleTime,ge(this,An)))&&Dn(this,Kn,x9).call(this);const a=Dn(this,Kn,b9).call(this);s&&(ge(this,An)!==r||bo(this.options.enabled,ge(this,An))!==bo(n.enabled,ge(this,An))||a!==ge(this,lu))&&Dn(this,Kn,L9).call(this,a)}getOptimisticResult(t){const n=ge(this,Ns).getQueryCache().build(ge(this,Ns),t),r=this.createResult(n,t);return zne(this,r)&&(xt(this,as,r),xt(this,bm,this.options),xt(this,qd,ge(this,An).state)),r}getCurrentResult(){return ge(this,as)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ge(this,Kl).status==="pending"&&ge(this,Kl).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(t){ge(this,Sm).add(t)}getCurrentQuery(){return ge(this,An)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ge(this,Ns).defaultQueryOptions(t),r=ge(this,Ns).getQueryCache().build(ge(this,Ns),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Dn(this,Kn,eg).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ge(this,as)))}createResult(t,n){var H;const r=ge(this,An),s=this.options,a=ge(this,as),l=ge(this,qd),h=ge(this,bm),p=t!==r?t.state:ge(this,Ng),{state:x}=t;let b={...x},w=!1,E;if(n._optimisticResults){const F=this.hasListeners(),V=!F&&zE(t,n),ee=F&&BE(t,r,n,s);(V||ee)&&(b={...b,...lO(x.data,t.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:M,errorUpdatedAt:C,status:S}=b;E=b.data;let _=!1;if(n.placeholderData!==void 0&&E===void 0&&S==="pending"){let F;a!=null&&a.isPlaceholderData&&n.placeholderData===(h==null?void 0:h.placeholderData)?(F=a.data,_=!0):F=typeof n.placeholderData=="function"?n.placeholderData((H=ge(this,wm))==null?void 0:H.state.data,ge(this,wm)):n.placeholderData,F!==void 0&&(S="success",E=g9(a==null?void 0:a.data,F,n),w=!0)}if(n.select&&E!==void 0&&!_)if(a&&E===(l==null?void 0:l.data)&&n.select===ge(this,Og))E=ge(this,Lm);else try{xt(this,Og,n.select),E=n.select(E),E=g9(a==null?void 0:a.data,E,n),xt(this,Lm,E),xt(this,au,null)}catch(F){xt(this,au,F)}ge(this,au)&&(M=ge(this,au),E=ge(this,Lm),C=Date.now(),S="error");const N=b.fetchStatus==="fetching",c=S==="pending",j=S==="error",D=c&&N,B=E!==void 0,A={status:S,fetchStatus:b.fetchStatus,isPending:c,isSuccess:S==="success",isError:j,isInitialLoading:D,isLoading:D,data:E,dataUpdatedAt:b.dataUpdatedAt,error:M,errorUpdatedAt:C,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>p.dataUpdateCount||b.errorUpdateCount>p.errorUpdateCount,isFetching:N,isRefetching:N&&!c,isLoadingError:j&&!B,isPaused:b.fetchStatus==="paused",isPlaceholderData:w,isRefetchError:j&&B,isStale:RS(t,n),refetch:this.refetch,promise:ge(this,Kl),isEnabled:bo(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=A.data!==void 0,V=A.status==="error"&&!F,ee=Ce=>{V?Ce.reject(A.error):F&&Ce.resolve(A.data)},G=()=>{const Ce=xt(this,Kl,A.promise=v9());ee(Ce)},se=ge(this,Kl);switch(se.status){case"pending":t.queryHash===r.queryHash&&ee(se);break;case"fulfilled":(V||A.data!==se.value)&&G();break;case"rejected":(!V||A.error!==se.reason)&&G();break}}return A}updateResult(){const t=ge(this,as),n=this.createResult(ge(this,An),this.options);if(xt(this,qd,ge(this,An).state),xt(this,bm,this.options),ge(this,qd).data!==void 0&&xt(this,wm,ge(this,An)),m9(n,t))return;xt(this,as,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ge(this,Sm).size)return!0;const l=new Set(a??ge(this,Sm));return this.options.throwOnError&&l.add("error"),Object.keys(ge(this,as)).some(h=>{const m=h;return ge(this,as)[m]!==t[m]&&l.has(m)})};Dn(this,Kn,cO).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Dn(this,Kn,w9).call(this)}},Ns=new WeakMap,An=new WeakMap,Ng=new WeakMap,as=new WeakMap,qd=new WeakMap,bm=new WeakMap,Kl=new WeakMap,au=new WeakMap,Og=new WeakMap,Lm=new WeakMap,wm=new WeakMap,Wd=new WeakMap,Gd=new WeakMap,lu=new WeakMap,Sm=new WeakMap,Kn=new WeakSet,eg=function(t){Dn(this,Kn,E9).call(this);let n=ge(this,An).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Os)),n},x9=function(){Dn(this,Kn,S9).call(this);const t=mu(this.options.staleTime,ge(this,An));if(hf||ge(this,as).isStale||!h9(t))return;const r=tO(ge(this,as).dataUpdatedAt,t)+1;xt(this,Wd,Bd.setTimeout(()=>{ge(this,as).isStale||this.updateResult()},r))},b9=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ge(this,An)):this.options.refetchInterval)??!1},L9=function(t){Dn(this,Kn,C9).call(this),xt(this,lu,t),!(hf||bo(this.options.enabled,ge(this,An))===!1||!h9(ge(this,lu))||ge(this,lu)===0)&&xt(this,Gd,Bd.setInterval(()=>{(this.options.refetchIntervalInBackground||ES.isFocused())&&Dn(this,Kn,eg).call(this)},ge(this,lu)))},w9=function(){Dn(this,Kn,x9).call(this),Dn(this,Kn,L9).call(this,Dn(this,Kn,b9).call(this))},S9=function(){ge(this,Wd)&&(Bd.clearTimeout(ge(this,Wd)),xt(this,Wd,void 0))},C9=function(){ge(this,Gd)&&(Bd.clearInterval(ge(this,Gd)),xt(this,Gd,void 0))},E9=function(){const t=ge(this,Ns).getQueryCache().build(ge(this,Ns),this.options);if(t===ge(this,An))return;const n=ge(this,An);xt(this,An,t),xt(this,Ng,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},cO=function(t){wi.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ge(this,as))}),ge(this,Ns).getQueryCache().notify({query:ge(this,An),type:"observerResultsUpdated"})})},_8);function Pne(e,t){return bo(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zE(e,t){return Pne(e,t)||e.state.data!==void 0&&R9(e,t,t.refetchOnMount)}function R9(e,t,n){if(bo(t.enabled,e)!==!1&&mu(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&RS(e,t)}return!1}function BE(e,t,n,r){return(e!==t||bo(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&RS(e,n)}function RS(e,t){return bo(t.enabled,e)!==!1&&e.isStaleByTime(mu(t.staleTime,e))}function zne(e,t){return!m9(e.getCurrentResult(),t)}function qx(e){return{onFetch:(t,n)=>{var x,b,w,E,M;const r=t.options,s=(w=(b=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,a=((E=t.state.data)==null?void 0:E.pages)||[],l=((M=t.state.data)==null?void 0:M.pageParams)||[];let h={pages:[],pageParams:[]},m=0;const p=async()=>{let C=!1;const S=c=>{Mne(c,()=>t.signal,()=>C=!0)},_=rO(t.options,t.fetchOptions),N=async(c,j,D)=>{if(C)return Promise.reject();if(j==null&&c.pages.length)return Promise.resolve(c);const T=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:j,direction:D?"backward":"forward",meta:t.options.meta};return S(V),V})(),A=await _(T),{maxPages:H}=t.options,F=D?_ne:Rne;return{pages:F(c.pages,A,H),pageParams:F(c.pageParams,j,H)}};if(s&&a.length){const c=s==="backward",j=c?uO:_9,D={pages:a,pageParams:l},B=j(r,D);h=await N(D,B,c)}else{const c=e??a.length;do{const j=m===0?l[0]??r.initialPageParam:_9(r,h);if(m>0&&j==null)break;h=await N(h,j),m++}while(m<c)}return h};t.options.persister?t.fetchFn=()=>{var C,S;return(S=(C=t.options).persister)==null?void 0:S.call(C,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function _9(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uO(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function Bne(e,t){return t?_9(e,t)!=null:!1}function Une(e,t){return!t||!e.getPreviousPageParam?!1:uO(e,t)!=null}var Fne=class extends kne{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:qx()})}getOptimisticResult(e){return e.behavior=qx(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var M,C;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:a,isError:l,isRefetchError:h}=r,m=(C=(M=n.fetchMeta)==null?void 0:M.fetchMore)==null?void 0:C.direction,p=l&&m==="forward",x=s&&m==="forward",b=l&&m==="backward",w=s&&m==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Bne(t,n.data),hasPreviousPage:Une(t,n.data),isFetchNextPageError:p,isFetchingNextPage:x,isFetchPreviousPageError:b,isFetchingPreviousPage:w,isRefetchError:h&&!p&&!b,isRefetching:a&&!x&&!w}}},Tg,Qa,Fi,Yd,Za,nu,M8,Hne=(M8=class extends aO{constructor(t){super();Vt(this,Za);Vt(this,Tg);Vt(this,Qa);Vt(this,Fi);Vt(this,Yd);xt(this,Tg,t.client),this.mutationId=t.mutationId,xt(this,Fi,t.mutationCache),xt(this,Qa,[]),this.state=t.state||Ine(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ge(this,Qa).includes(t)||(ge(this,Qa).push(t),this.clearGcTimeout(),ge(this,Fi).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xt(this,Qa,ge(this,Qa).filter(n=>n!==t)),this.scheduleGc(),ge(this,Fi).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ge(this,Qa).length||(this.state.status==="pending"?this.scheduleGc():ge(this,Fi).remove(this))}continue(){var t;return((t=ge(this,Yd))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,h,m,p,x,b,w,E,M,C,S,_,N,c,j,D,B,T;const n=()=>{Dn(this,Za,nu).call(this,{type:"continue"})},r={client:ge(this,Tg),meta:this.options.meta,mutationKey:this.options.mutationKey};xt(this,Yd,oO({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,H)=>{Dn(this,Za,nu).call(this,{type:"failed",failureCount:A,error:H})},onPause:()=>{Dn(this,Za,nu).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ge(this,Fi).canRun(this)}));const s=this.state.status==="pending",a=!ge(this,Yd).canStart();try{if(s)n();else{Dn(this,Za,nu).call(this,{type:"pending",variables:t,isPaused:a}),ge(this,Fi).config.onMutate&&await ge(this,Fi).config.onMutate(t,this,r);const H=await((h=(l=this.options).onMutate)==null?void 0:h.call(l,t,r));H!==this.state.context&&Dn(this,Za,nu).call(this,{type:"pending",context:H,variables:t,isPaused:a})}const A=await ge(this,Yd).start();return await((p=(m=ge(this,Fi).config).onSuccess)==null?void 0:p.call(m,A,t,this.state.context,this,r)),await((b=(x=this.options).onSuccess)==null?void 0:b.call(x,A,t,this.state.context,r)),await((E=(w=ge(this,Fi).config).onSettled)==null?void 0:E.call(w,A,null,this.state.variables,this.state.context,this,r)),await((C=(M=this.options).onSettled)==null?void 0:C.call(M,A,null,t,this.state.context,r)),Dn(this,Za,nu).call(this,{type:"success",data:A}),A}catch(A){try{await((_=(S=ge(this,Fi).config).onError)==null?void 0:_.call(S,A,t,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((c=(N=this.options).onError)==null?void 0:c.call(N,A,t,this.state.context,r))}catch(H){Promise.reject(H)}try{await((D=(j=ge(this,Fi).config).onSettled)==null?void 0:D.call(j,void 0,A,this.state.variables,this.state.context,this,r))}catch(H){Promise.reject(H)}try{await((T=(B=this.options).onSettled)==null?void 0:T.call(B,void 0,A,t,this.state.context,r))}catch(H){Promise.reject(H)}throw Dn(this,Za,nu).call(this,{type:"error",error:A}),A}finally{ge(this,Fi).runNext(this)}}},Tg=new WeakMap,Qa=new WeakMap,Fi=new WeakMap,Yd=new WeakMap,Za=new WeakSet,nu=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),wi.batch(()=>{ge(this,Qa).forEach(r=>{r.onMutationUpdate(t)}),ge(this,Fi).notify({mutation:this,type:"updated",action:t})})},M8);function Ine(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ql,ra,Dg,N8,$ne=(N8=class extends o0{constructor(t={}){super();Vt(this,Ql);Vt(this,ra);Vt(this,Dg);this.config=t,xt(this,Ql,new Set),xt(this,ra,new Map),xt(this,Dg,0)}build(t,n,r){const s=new Hne({client:t,mutationCache:this,mutationId:++by(this,Dg)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){ge(this,Ql).add(t);const n=Iy(t);if(typeof n=="string"){const r=ge(this,ra).get(n);r?r.push(t):ge(this,ra).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ge(this,Ql).delete(t)){const n=Iy(t);if(typeof n=="string"){const r=ge(this,ra).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&ge(this,ra).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Iy(t);if(typeof n=="string"){const r=ge(this,ra).get(n),s=r==null?void 0:r.find(a=>a.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Iy(t);if(typeof n=="string"){const s=(r=ge(this,ra).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wi.batch(()=>{ge(this,Ql).forEach(t=>{this.notify({type:"removed",mutation:t})}),ge(this,Ql).clear(),ge(this,ra).clear()})}getAll(){return Array.from(ge(this,Ql))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>DE(n,r))}findAll(t={}){return this.getAll().filter(n=>DE(t,n))}notify(t){wi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return wi.batch(()=>Promise.all(t.map(n=>n.continue().catch(Os))))}},Ql=new WeakMap,ra=new WeakMap,Dg=new WeakMap,N8);function Iy(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ja,O8,Vne=(O8=class extends o0{constructor(t={}){super();Vt(this,Ja);this.config=t,xt(this,Ja,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??SS(s,n);let l=this.get(a);return l||(l=new jne({client:t,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){ge(this,Ja).has(t.queryHash)||(ge(this,Ja).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ge(this,Ja).get(t.queryHash);n&&(t.destroy(),n===t&&ge(this,Ja).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){wi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ge(this,Ja).get(t)}getAll(){return[...ge(this,Ja).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>TE(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>TE(t,r)):n}notify(t){wi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){wi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){wi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ja=new WeakMap,O8),Pr,cu,uu,Cm,Em,du,Rm,_m,T8,qne=(T8=class{constructor(e={}){Vt(this,Pr);Vt(this,cu);Vt(this,uu);Vt(this,Cm);Vt(this,Em);Vt(this,du);Vt(this,Rm);Vt(this,_m);xt(this,Pr,e.queryCache||new Vne),xt(this,cu,e.mutationCache||new $ne),xt(this,uu,e.defaultOptions||{}),xt(this,Cm,new Map),xt(this,Em,new Map),xt(this,du,0)}mount(){by(this,du)._++,ge(this,du)===1&&(xt(this,Rm,ES.subscribe(async e=>{e&&(await this.resumePausedMutations(),ge(this,Pr).onFocus())})),xt(this,_m,Vx.subscribe(async e=>{e&&(await this.resumePausedMutations(),ge(this,Pr).onOnline())})))}unmount(){var e,t;by(this,du)._--,ge(this,du)===0&&((e=ge(this,Rm))==null||e.call(this),xt(this,Rm,void 0),(t=ge(this,_m))==null||t.call(this),xt(this,_m,void 0))}isFetching(e){return ge(this,Pr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ge(this,cu).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ge(this,Pr).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ge(this,Pr).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ge(this,Pr).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=ge(this,Pr).get(r.queryHash),a=s==null?void 0:s.state.data,l=Sne(t,a);if(l!==void 0)return ge(this,Pr).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return wi.batch(()=>ge(this,Pr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ge(this,Pr).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ge(this,Pr);wi.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ge(this,Pr);return wi.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=wi.batch(()=>ge(this,Pr).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Os).catch(Os)}invalidateQueries(e,t={}){return wi.batch(()=>(ge(this,Pr).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=wi.batch(()=>ge(this,Pr).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(Os)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Os)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ge(this,Pr).build(this,t);return n.isStaleByTime(mu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Os).catch(Os)}fetchInfiniteQuery(e){return e.behavior=qx(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Os).catch(Os)}ensureInfiniteQueryData(e){return e.behavior=qx(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vx.isOnline()?ge(this,cu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ge(this,Pr)}getMutationCache(){return ge(this,cu)}getDefaultOptions(){return ge(this,uu)}setDefaultOptions(e){xt(this,uu,e)}setQueryDefaults(e,t){ge(this,Cm).set(Cg(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ge(this,Cm).values()],n={};return t.forEach(r=>{Eg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ge(this,Em).set(Cg(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ge(this,Em).values()],n={};return t.forEach(r=>{Eg(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ge(this,uu).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=SS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===CS&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ge(this,uu).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ge(this,Pr).clear(),ge(this,cu).clear()}},Pr=new WeakMap,cu=new WeakMap,uu=new WeakMap,Cm=new WeakMap,Em=new WeakMap,du=new WeakMap,Rm=new WeakMap,_m=new WeakMap,T8),dO=y.createContext(void 0),Wne=e=>{const t=y.useContext(dO);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Gne=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(dO.Provider,{value:e,children:t})),fO=y.createContext(!1),Yne=()=>y.useContext(fO);fO.Provider;function Xne(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Kne=y.createContext(Xne()),Qne=()=>y.useContext(Kne),Zne=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?iO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Jne=e=>{y.useEffect(()=>{e.clearReset()},[e])},ere=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||iO(n,[e.error,r])),tre=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},nre=(e,t)=>e.isLoading&&e.isFetching&&!t,rre=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,UE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ire(e,t,n){var w,E,M,C;const r=Yne(),s=Qne(),a=Wne(),l=a.defaultQueryOptions(e);(E=(w=a.getDefaultOptions().queries)==null?void 0:w._experimental_beforeQuery)==null||E.call(w,l);const h=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",tre(l),Zne(l,s,h),Jne(s);const m=!a.getQueryCache().get(l.queryHash),[p]=y.useState(()=>new t(a,l)),x=p.getOptimisticResult(l),b=!r&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(S=>{const _=b?p.subscribe(wi.batchCalls(S)):Os;return p.updateResult(),_},[p,b]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(l)},[l,p]),rre(l,x))throw UE(l,p,s);if(ere({result:x,errorResetBoundary:s,throwOnError:l.throwOnError,query:h,suspense:l.suspense}))throw x.error;if((C=(M=a.getDefaultOptions().queries)==null?void 0:M._experimental_afterQuery)==null||C.call(M,l,x),l.experimental_prefetchInRender&&!hf&&nre(x,r)){const S=m?UE(l,p,s):h==null?void 0:h.promise;S==null||S.catch(Os).finally(()=>{p.updateResult()})}return l.notifyOnChangeProps?x:p.trackResult(x)}function sre(e,t){return ire(e,Fne)}const Rg=8,ore=3,are=12,lre=120,M9=160,_g=50,hO=500;function mO({queryKey:e,queryFn:t,getNextPageParam:n,pageSize:r=_g,scrollToTopDeps:s}){const a=y.useRef(null),l=y.useRef(null),[h,m]=y.useState(()=>typeof window<"u"?window.innerWidth:400),p=y.useRef(0),x=y.useRef(0),b=y.useRef(s),{data:w,fetchNextPage:E,hasNextPage:M,isFetchingNextPage:C,isFetching:S,status:_,error:N}=sre({queryKey:e,queryFn:t,initialPageParam:0,getNextPageParam:n}),c=(w==null?void 0:w.pages.flatMap(A=>A.items))??[];x.current=c.length;const j=y.useMemo(()=>Math.min(are,Math.max(ore,Math.floor((h+Rg)/(lre+Rg)))),[h]);y.useEffect(()=>{const A=a.current;if(!A)return;m(A.clientWidth);const H=new ResizeObserver(([F])=>{m(F.contentRect.width)});return H.observe(A),()=>H.disconnect()},[]),y.useEffect(()=>{var F;if(s==null)return;const A=b.current;(A==null||A.length!==s.length||s.some((V,ee)=>A[ee]!==V))&&(b.current=s,(F=a.current)==null||F.scrollTo({top:0,left:0}))},[s]);const D=y.useRef(C);D.current=C;const B=y.useRef(c.length);B.current=c.length,y.useEffect(()=>{const A=a.current,H=l.current;if(!A||!H||!M)return;const F=new IntersectionObserver(V=>{var ee;(ee=V[0])!=null&&ee.isIntersecting&&(D.current||(p.current=B.current,E()))},{root:A,rootMargin:"0px 0px 20% 0px",threshold:0});return F.observe(H),()=>F.disconnect()},[M,E]);const T=(w==null?void 0:w.pages.length)??0;return y.useEffect(()=>{if(T!==1||!M||C)return;let A=!1;const H=()=>{if(A)return;const ee=a.current;if(!ee)return;const{scrollHeight:G,clientHeight:se}=ee;se>0&&G>se||(p.current=x.current,E())},F=requestAnimationFrame(()=>requestAnimationFrame(H)),V=setTimeout(H,250);return()=>{A=!0,cancelAnimationFrame(F),clearTimeout(V)}},[T,M,C,E]),{scrollRef:a,sentinelRef:l,containerWidth:h,columnCount:j,items:c,hasNextPage:M,fetchNextPage:E,isFetching:S,isFetchingNextPage:C,status:_,error:N}}function cre({eventsGroup:e}){const[t,n]=y.useState(!1),{getEventImageUrls:r}=ks(),s=e.representative,{thumbnail:a}=r(s),[l,h]=y.useState(e.events.findIndex(x=>x.id===s.id)),m=e.events[l]??s,p=y.useRef(null);return f.jsxs(Bx,{open:t,onOpenChange:n,children:[f.jsx(QM,{asChild:!0,children:f.jsx("img",{src:a,alt:"",className:"w-full h-full object-cover object-center cursor-pointer"})}),f.jsxs(Ux,{className:"max-w-[95vw] max-h-[95vh] w-full p-0 gap-0 overflow-hidden flex flex-col [&>button]:hidden",children:[f.jsxs("div",{className:"absolute top-3 right-3 z-10 flex items-center gap-2",children:[e.events.length>1&&f.jsx("nav",{className:"hidden md:flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-black/50 backdrop-blur-sm","aria-label":"Image navigator",children:e.events.map((x,b)=>f.jsx("button",{type:"button",onClick:()=>{var w;return(w=p.current)==null?void 0:w.scrollTo(b)},className:He("rounded-full transition-all",b===l?"w-2.5 h-2.5 bg-white":"w-2 h-2 bg-white/50 hover:bg-white/70"),"aria-label":`Go to image ${b+1}`},x.id))}),f.jsx("button",{type:"button",onClick:()=>n(!1),className:"flex size-10 items-center justify-center rounded-full bg-black/50 backdrop-blur-sm text-white hover:bg-black/70 transition-colors","aria-label":"Close",children:f.jsx(gf,{className:"size-5"})})]}),f.jsx("div",{className:"relative flex-1 min-h-0 flex items-center justify-center bg-black/90 pt-2",children:f.jsxs(P7,{opts:{align:"center",startIndex:l,loop:!0},className:"w-full max-h-[70vh]",setApi:x=>{x&&(p.current=x,x.on("select",()=>h(x.selectedScrollSnap())))},children:[f.jsx(z7,{children:e.events.map(x=>f.jsx(B7,{className:"flex justify-center",children:f.jsx(ure,{event:x,getEventImageUrls:r})},x.id))}),f.jsxs(U7,{className:"left-2 md:left-4 border-0 bg-black/50 hover:bg-black/70 text-white",children:[f.jsx(Zd,{className:"size-6"}),f.jsx("span",{className:"sr-only",children:"Previous"})]}),f.jsxs(F7,{className:"right-2 md:right-4 border-0 bg-black/50 hover:bg-black/70 text-white",children:[f.jsx(Jd,{className:"size-6"}),f.jsx("span",{className:"sr-only",children:"Next"})]})]})}),f.jsxs("div",{className:"border-t bg-muted/50 px-4 py-3 text-sm shrink-0",children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:[f.jsx("span",{className:"font-medium text-foreground",children:m.deviceName}),f.jsx("span",{className:"text-muted-foreground",children:br(m.timestamp,"MMM d, HH:mm:ss")}),f.jsxs("span",{className:"text-muted-foreground",children:[m.classes.filter(x=>!x.toLowerCase().includes("clip")).map(x=>cf(x)).join(", "),m.label?` · ${cf(m.label)}`:""]}),f.jsxs("span",{className:"text-muted-foreground",children:["Source: ",m.source]})]}),e.events.length>1&&f.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[l+1," / ",e.events.length]})]})]})]})}function ure({event:e,getEventImageUrls:t}){const[n,r]=y.useState(!1),s=y.useRef(null),{fullRes:a,preferredMedia:l,thumbnail:h}=t(e),{url:m,type:p}=l;return y.useEffect(()=>{const x=s.current;!x||p!=="video"||x.play().catch(()=>{})},[p,m]),f.jsxs("div",{className:"flex items-center justify-center w-full h-full min-h-[200px]",children:[!n&&p!=="video"&&f.jsx(Ts,{className:"absolute inset-0 max-w-full max-h-[70vh] m-auto w-full aspect-video"}),p==="video"&&f.jsx("video",{ref:s,src:m,poster:h||void 0,className:"max-w-full max-h-[70vh] object-contain",playsInline:!0,controls:!0,onLoadedData:()=>r(!0)}),p==="gif"&&f.jsx("img",{src:m,alt:"",className:`max-w-full max-h-[70vh] object-contain ${n?"":"invisible"}`,onLoad:()=>r(!0)}),p==="image"&&f.jsx("img",{src:m,alt:"",className:`max-w-full max-h-[70vh] object-contain ${n?"":"invisible"}`,onLoad:()=>r(!0)})]})}const dre="RuleArtifact";function fre(e){return e.ruleType==="Timelapse"?oa.Timelapse:e.ruleType==="Detection"?oa.Detection:W4(e.classes)}function hre({eventsGroup:e,loading:t}){const n=Te(l=>l.setFilter),r=e.representative,a=r.source===dre?fre(r):W4(r.classes);return t?f.jsx(nf,{className:"rounded-none cursor-pointer overflow-hidden relative group w-full p-0 max-w-full",style:{aspectRatio:"1 / 1"},children:f.jsx(Ts,{className:"w-full h-full"})}):f.jsx(f.Fragment,{children:f.jsx(nf,{className:"rounded-none cursor-pointer overflow-hidden relative group w-full p-0 max-w-full",style:{aspectRatio:"1 / 1"},children:f.jsxs("div",{className:"w-full h-full flex items-center justify-center",children:[f.jsx("div",{className:"absolute top-0 left-0 w-6 h-6 bg-black/50 text-white flex items-center justify-center rounded",children:f.jsx(yu,{small:!0,detectionClass:a})}),f.jsx("div",{className:"absolute top-0 right-0 w-6 h-6 bg-black/50 hover:bg-black/80 text-white flex items-center justify-center rounded cursor-pointer transition-colors duration-200",children:f.jsx("div",{className:"text-[10px] text-gray-300 hover:text-white font-semibold",children:e.events.length>1?`+${e.events.length}`:f.jsx(tS,{eventSource:r.source})})}),f.jsx(cre,{eventsGroup:e}),r.label&&f.jsx("div",{className:"absolute bottom-1 left-1",children:f.jsx("div",{className:`inline-flex items-center px-1 py-0.5 rounded-full text-[0.6rem] font-small ${oY(a)}`,onClick:()=>r.label&&n(r.label),children:cf(r.label)})})]})})})}function mre({}){const e=Te(T=>T.date),t=Te(T=>T.refreshTime),n=Te(T=>T.setUserInfo),r=Te(T=>T.cameras),s=Te(T=>T.detectionClasses),a=Te(T=>T.eventSource),l=Te(T=>T.filter),h=Te(T=>T.groupingRange),{getEvents:m}=ks(),[p,x]=y.useState({cameras:r,detectionClasses:s,eventSource:a,filter:l,groupingRange:h});y.useEffect(()=>{const T=setTimeout(()=>x({cameras:r,detectionClasses:s,eventSource:a,filter:l,groupingRange:h}),hO);return()=>clearTimeout(T)},[r,s,a,l,h]);const b=y.useCallback(async({pageParam:T})=>{const A=e?new Date(e):void 0;if(!A)return{items:[],total:0,eventGroupsLoaded:0,backendTotal:0};const{cameras:H,detectionClasses:F,eventSource:V,filter:ee,groupingRange:G}=p,se=V===ei.Auto||V===ei.All?void 0:[V],{groups:Ce,total:te,ruleArtifacts:K}=await m(Ii(A).getTime(),um(A).getTime(),{limit:_g,offset:T,sources:se,cameras:H,detectionClasses:F,eventSource:V,filter:ee,groupingRange:G}),Z=(K==null?void 0:K.length)??0,oe=T===0&&Z>0?[...K??[],...Ce].sort((ne,X)=>{var ue,pe;return(((ue=X.representative)==null?void 0:ue.timestamp)??0)-(((pe=ne.representative)==null?void 0:pe.timestamp)??0)}):Ce,Y=T===0?te+Z:te;return{items:oe,total:Y,eventGroupsLoaded:Ce.length,backendTotal:te}},[e,m,p]),w=y.useCallback((T,A)=>{var V;const H=((V=A[0])==null?void 0:V.backendTotal)??T.total,F=A.reduce((ee,G)=>ee+(G.eventGroupsLoaded??G.items.length),0);if(!(F>=H||T.items.length===0))return F},[]),{scrollRef:E,sentinelRef:M,columnCount:C,items:S,hasNextPage:_,isFetching:N,isFetchingNextPage:c,status:j,error:D}=mO({queryKey:["events",e,t,p],queryFn:b,getNextPageParam:w,pageSize:_g,scrollToTopDeps:[r,s,a,l,h]});if(y.useEffect(()=>{var T;D&&((T=D==null?void 0:D.response)==null?void 0:T.status)===401&&n(void 0)},[D,n]),!(e?new Date(e):void 0))return f.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"Select a date"});if(j==="pending"){const T=Math.max(C*3,6);return f.jsx("div",{className:"h-full min-h-0 overflow-y-auto overflow-x-hidden flex-1",style:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${C}, minmax(0, 1fr))`,gridAutoRows:"auto",gap:Rg,alignContent:"start"},children:Array.from({length:T}).map((A,H)=>f.jsx("div",{style:{width:"100%",maxWidth:M9,aspectRatio:"1",minWidth:0,minHeight:0,overflow:"hidden",justifySelf:"center"},children:f.jsx(nf,{className:"rounded-none overflow-hidden relative w-full p-0 h-full",style:{aspectRatio:"1 / 1"},children:f.jsx(Ts,{className:"w-full h-full"})})},H))})}return j==="error"?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("p",{className:"text-destructive",children:"Error loading data"})}):S.length===0?f.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-center px-4",children:f.jsx("p",{children:"No events for this date. Try changing the date or filters."})}):f.jsx("div",{ref:E,className:"h-full min-h-0 overflow-y-auto overflow-x-hidden flex-1","data-events-scroll-container":!0,children:f.jsxs("div",{style:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${C}, minmax(0, 1fr))`,gridAutoRows:"auto",gap:Rg,alignContent:"start"},children:[S.map((T,A)=>f.jsx("div",{style:{width:"100%",maxWidth:M9,aspectRatio:"1",minWidth:0,minHeight:0,overflow:"hidden",justifySelf:"center"},children:f.jsx(hre,{eventsGroup:T,loading:N&&!c})},`${T.representative.id}-${A}`)),_&&f.jsx("div",{ref:M,style:{gridColumn:"1 / -1",display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem",fontSize:"0.875rem",color:"var(--muted-foreground)"},children:c?"Loading…":""}),!_&&f.jsx("div",{style:{gridColumn:"1 / -1",display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem",fontSize:"0.875rem",color:"var(--muted-foreground)"},children:"End of list"})]})})}function pre(e){return f.jsx(mre,{...e})}var Gb="Collapsible",[gre,Xse]=cs(Gb),[vre,_S]=gre(Gb),pO=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:a,onOpenChange:l,...h}=e,[m,p]=dl({prop:r,defaultProp:s??!1,onChange:l,caller:Gb});return f.jsx(vre,{scope:n,disabled:a,contentId:li(),open:m,onOpenToggle:y.useCallback(()=>p(x=>!x),[p]),children:f.jsx(Lt.div,{"data-state":NS(m),"data-disabled":a?"":void 0,...h,ref:t})})});pO.displayName=Gb;var gO="CollapsibleTrigger",vO=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=_S(gO,n);return f.jsx(Lt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":NS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:ut(e.onClick,s.onOpenToggle)})});vO.displayName=gO;var MS="CollapsibleContent",yO=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=_S(MS,e.__scopeCollapsible);return f.jsx(ro,{present:n||s.open,children:({present:a})=>f.jsx(yre,{...r,ref:t,present:a})})});yO.displayName=MS;var yre=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...a}=e,l=_S(MS,n),[h,m]=y.useState(r),p=y.useRef(null),x=Qt(t,p),b=y.useRef(0),w=b.current,E=y.useRef(0),M=E.current,C=l.open||h,S=y.useRef(C),_=y.useRef(void 0);return y.useEffect(()=>{const N=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(N)},[]),Wr(()=>{const N=p.current;if(N){_.current=_.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const c=N.getBoundingClientRect();b.current=c.height,E.current=c.width,S.current||(N.style.transitionDuration=_.current.transitionDuration,N.style.animationName=_.current.animationName),m(r)}},[l.open,r]),f.jsx(Lt.div,{"data-state":NS(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!C,...a,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":M?`${M}px`:void 0,...e.style},children:C&&s})});function NS(e){return e?"open":"closed"}var xre=pO;function xO({...e}){return f.jsx(xre,{"data-slot":"collapsible",...e})}function bO({...e}){return f.jsx(vO,{"data-slot":"collapsible-trigger",...e})}function LO({...e}){return f.jsx(yO,{"data-slot":"collapsible-content",...e})}function bre({source:e}){switch(e){case ei.Auto:return f.jsx(u3,{className:"size-4"});case ei.Frigate:return f.jsx(A7,{className:"size-4"});case ei.NVR:return f.jsx(D7,{className:"size-4"});case ei.RawDetection:return f.jsx("span",{className:"text-xs font-medium",children:"AN"});default:return null}}function Lre(){const e=Te(T=>T.date),t=Te(T=>T.setDate),n=e?new Date(e):void 0,r=Te(T=>T.detectionClasses),s=Te(T=>T.setDetectionClasses),a=Te(T=>T.configs),l=Te(T=>T.eventSource),h=Te(T=>T.setEventSource),m=Te(T=>T.cameras),p=Te(T=>T.setCameras),x=Te(T=>T.groupingRange),b=Te(T=>T.setGroupingRange),w=Te(T=>T.filter),E=Te(T=>T.setFilter),M=Te(T=>T.resetFilters),C=T=>{s(r.includes(T)?r.filter(A=>A!==T):[...r,T])},S=T=>{p(m.includes(T)?m.filter(A=>A!==T):[...m,T])},_=((a==null?void 0:a.cameras)??[]).map(T=>T.name).sort(),N=[ei.Auto,...((a==null?void 0:a.enabledDetectionSources)??[]).filter(T=>T!==ei.All)],c=ml(),[j,D]=y.useState(!1),B=f.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-2 py-2 sm:px-4",children:[f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(n3,{className:"size-4"}),n?br(n,"MMM d"):"Date"]})}),f.jsx(sl,{className:"w-auto p-0",align:"start",children:f.jsx(uS,{mode:"single",selected:n,onSelect:T=>t(T==null?void 0:T.getTime())})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(f3,{className:"size-4"}),r.length," types"]})}),f.jsx(sl,{className:"w-56 p-0",align:"start",children:f.jsx(mm,{children:f.jsxs(pm,{children:[f.jsx(ia,{onSelect:()=>s(Object.values(nn).filter(T=>T!==nn.Motion)),children:"Reset"}),f.jsx($x,{}),Object.values(nn).map(T=>f.jsxs(ia,{onSelect:()=>C(T),children:[f.jsx(yu,{detectionClass:T,small:!0}),f.jsx("input",{type:"checkbox",checked:r.includes(T),readOnly:!0,className:"mr-2"}),cf(T)]},T))]})})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(nj,{className:"size-4"}),l]})}),f.jsx(sl,{className:"w-48 p-0",align:"start",children:f.jsx(mm,{children:f.jsx(pm,{children:N.map(T=>f.jsxs(ia,{onSelect:()=>h(T),children:[f.jsx(bre,{source:T}),f.jsx("input",{type:"checkbox",checked:T===l,readOnly:!0,className:"mr-2"}),T]},T))})})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(pf,{className:"size-4"}),m.length?`${m.length} cameras`:"All cameras"]})}),f.jsx(sl,{className:"w-56 p-0",align:"start",children:f.jsx(mm,{children:f.jsxs(pm,{children:[f.jsx(ia,{onSelect:()=>p([]),children:"Reset"}),f.jsx($x,{}),_.map(T=>f.jsxs(ia,{onSelect:()=>S(T),children:[f.jsx("input",{type:"checkbox",checked:m.includes(T),readOnly:!0,className:"mr-2"}),T]},T))]})})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(Lj,{className:"size-4"}),x,"s group"]})}),f.jsxs(sl,{className:"w-48 p-4",align:"start",children:[f.jsx(Tr,{children:"Group events within (seconds)"}),f.jsx(bS,{min:1,max:30,step:1,value:[x],className:"mt-2",onValueChange:([T])=>b(T)}),f.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[x,"s"]})]})]}),f.jsxs("div",{className:"relative flex-1 min-w-[140px] max-w-[200px]",children:[f.jsx(a3,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),f.jsx(Li,{value:w,onChange:T=>E(T.target.value),placeholder:"Search labels…",className:He("h-8 pl-8")})]}),f.jsxs(Qe,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:M,children:[f.jsx(o3,{className:"size-4"}),"Reset"]})]});return c?f.jsxs(xO,{open:j,onOpenChange:D,className:"border-b bg-background",children:[f.jsx(bO,{asChild:!0,children:f.jsxs(Qe,{variant:"ghost",className:"w-full justify-between rounded-none h-11 px-4",children:[f.jsx("span",{className:"text-muted-foreground",children:"Filtri"}),j?f.jsx(pu,{className:"size-4"}):f.jsx(wo,{className:"size-4"})]})}),f.jsx(LO,{children:f.jsx("div",{className:"max-h-[60vh] overflow-y-auto overflow-x-hidden",children:B})})]}):B}function wre(){const e=Te(S=>S.date),t=Te(S=>S.setDate),n=e?new Date(e):void 0,r=Te(S=>S.detectionClasses),s=Te(S=>S.setDetectionClasses),a=Te(S=>S.configs),l=Te(S=>S.cameras),h=Te(S=>S.setCameras),m=Te(S=>S.resetFilters),p=S=>{s(r.includes(S)?r.filter(_=>_!==S):[...r,S])},x=S=>{h(l.includes(S)?l.filter(_=>_!==S):[...l,S])},b=((a==null?void 0:a.cameras)??[]).map(S=>S.name).sort(),w=ml(),[E,M]=y.useState(!1),C=f.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-2 py-2 sm:px-4",children:[f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(n3,{className:"size-4"}),n?br(n,"MMM d"):"Date"]})}),f.jsx(sl,{className:"w-auto p-0",align:"start",children:f.jsx(uS,{mode:"single",selected:n,onSelect:S=>t(S==null?void 0:S.getTime())})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(f3,{className:"size-4"}),r.length," types"]})}),f.jsx(sl,{className:"w-56 p-0",align:"start",children:f.jsx(mm,{children:f.jsxs(pm,{children:[f.jsx(ia,{onSelect:()=>s(Object.values(nn).filter(S=>S!==nn.Motion)),children:"Reset"}),f.jsx($x,{}),Object.values(nn).map(S=>f.jsxs(ia,{onSelect:()=>p(S),children:[f.jsx(yu,{detectionClass:S,small:!0}),f.jsx("input",{type:"checkbox",checked:r.includes(S),readOnly:!0,className:"mr-2"}),cf(S)]},S))]})})})]}),f.jsxs(rl,{children:[f.jsx(il,{asChild:!0,children:f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5",children:[f.jsx(pf,{className:"size-4"}),l.length?`${l.length} cameras`:"All cameras"]})}),f.jsx(sl,{className:"w-56 p-0",align:"start",children:f.jsx(mm,{children:f.jsxs(pm,{children:[f.jsx(ia,{onSelect:()=>h([]),children:"Reset"}),f.jsx($x,{}),b.map(S=>f.jsxs(ia,{onSelect:()=>x(S),children:[f.jsx("input",{type:"checkbox",checked:l.includes(S),readOnly:!0,className:"mr-2"}),S]},S))]})})})]}),f.jsxs(Qe,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 text-muted-foreground hover:text-foreground",onClick:m,children:[f.jsx(o3,{className:"size-4"}),"Reset"]})]});return w?f.jsxs(xO,{open:E,onOpenChange:M,className:"border-b bg-background",children:[f.jsx(bO,{asChild:!0,children:f.jsxs(Qe,{variant:"ghost",className:"w-full justify-between rounded-none h-11 px-4",children:[f.jsx("span",{className:"text-muted-foreground",children:"Filtri"}),E?f.jsx(pu,{className:"size-4"}):f.jsx(wo,{className:"size-4"})]})}),f.jsx(LO,{children:f.jsx("div",{className:"max-h-[60vh] overflow-y-auto overflow-x-hidden",children:C})})]}):C}function Sre(){const e=ma(),t=Te(p=>p.grids),n=Te(p=>p.addGrid),r=Te(p=>p.removeGrid),s=Object.values(t),a=()=>{const p=n({name:"New grid",items:[]});e(`/grids/${p}/edit`,{replace:!0})},l=p=>{e(`/grids/${p}/edit`)},h=p=>{e(`/grids/${p}`)},m=p=>{window.confirm("Delete this grid?")&&r(p)};return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-4",children:[f.jsxs("header",{className:"mb-4 flex items-center justify-between gap-2",children:[f.jsx("h1",{className:"text-xl font-semibold",children:"Grids"}),f.jsxs(Qe,{size:"sm",onClick:a,children:[f.jsx(oC,{className:"size-4"}),"New grid"]})]}),s.length===0?f.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 rounded-lg border border-dashed bg-muted/30 p-8 text-center",children:[f.jsx(tb,{className:"size-12 text-muted-foreground"}),f.jsx("p",{className:"text-muted-foreground",children:"No grids yet. Create one to arrange cameras in a mosaic view."}),f.jsxs(Qe,{onClick:a,children:[f.jsx(oC,{className:"size-4"}),"Create grid"]})]}):f.jsx("ul",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:s.map(p=>f.jsxs("li",{className:He("flex items-center justify-between gap-2 rounded-lg border bg-card p-3 shadow-sm transition-colors hover:bg-muted/50"),children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("p",{className:"font-medium truncate",children:p.name}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.items.length," cameras"]})]}),f.jsxs("div",{className:"flex shrink-0 gap-1",children:[f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>h(p.id),title:"View",children:f.jsx(tf,{className:"size-4"})}),f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>l(p.id),title:"Edit",children:f.jsx(lw,{className:"size-4"})}),f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>m(p.id),title:"Delete",className:"text-destructive hover:text-destructive",children:f.jsx(kk,{className:"size-4"})})]})]},p.id))})]})}function Zm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:s}=e;return(r-t[0]*(s-1)-n[0]*2)/s}function Dm(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Bp(e,t,n,r,s,a,l){const{margin:h,containerPadding:m,rowHeight:p}=e,x=Zm(e);let b,w,E,M;if(l?(b=Math.round(l.width),w=Math.round(l.height)):(b=Dm(r,x,h[0]),w=Dm(s,p,h[1])),a?(E=Math.round(a.top),M=Math.round(a.left)):l?(E=Math.round(l.top),M=Math.round(l.left)):(E=Math.round((p+h[1])*n+m[1]),M=Math.round((x+h[0])*t+m[0])),!a&&!l){if(Number.isFinite(r)){const S=Math.round((x+h[0])*(t+r)+m[0])-M-b;S!==h[0]&&(b+=S-h[0])}if(Number.isFinite(s)){const S=Math.round((p+h[1])*(n+s)+m[1])-E-w;S!==h[1]&&(w+=S-h[1])}}return{top:E,left:M,width:b,height:w}}function Cre(e,t,n,r,s){const{margin:a,containerPadding:l,cols:h,rowHeight:m,maxRows:p}=e,x=Zm(e);let b=Math.round((n-l[0])/(x+a[0])),w=Math.round((t-l[1])/(m+a[1]));return b=Wx(b,0,h-r),w=Wx(w,0,p-s),{x:b,y:w}}function $y(e,t,n){const{margin:r,containerPadding:s,rowHeight:a}=e,l=Zm(e),h=Math.round((n-s[0])/(l+r[0])),m=Math.round((t-s[1])/(a+r[1]));return{x:h,y:m}}function Ere(e,t,n){const{margin:r,rowHeight:s}=e,a=Zm(e),l=Math.max(1,Math.round((t+r[0])/(a+r[0]))),h=Math.max(1,Math.round((n+r[1])/(s+r[1])));return{w:l,h}}function Wx(e,t,n){return Math.max(Math.min(e,n),t)}function OS(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Qd(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&OS(r,t))return r}}function wO(e,t){return e.filter(n=>OS(n,t))}function Rre(e,t){return t==="horizontal"?SO(e):t==="vertical"||t==="wrap"?N9(e):[...e]}function N9(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function SO(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function TS(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const s=r.y+r.h;s>t&&(t=s)}}return t}function Pd(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function Yb(e){return e.filter(t=>t.static===!0)}function mf(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Xb(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=mf(r))}return t}function _re(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const s=e[r];s!==void 0&&(t.i===s.i?n[r]=t:n[r]=s)}return n}function Mre(e,t,n){let r=Pd(e,t);return r?(r=n(mf(r)),[_re(e,r),r]):[[...e],null]}function Nre(e,t){const n=Yb(e);for(let r=0;r<e.length;r++){const s=e[r];if(s!==void 0)if(s.x+s.w>t.cols&&(s.x=t.cols-s.w),s.x<0&&(s.x=0,s.w=t.cols),!s.static)n.push(s);else for(;Qd(n,s);)s.y++}return e}function Ud(e,t,n,r,s,a,l,h,m){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const p=t.x,x=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let b=Rre(e,l);(l==="vertical"&&typeof r=="number"?x>=r:l==="horizontal"&&typeof n=="number"?p>=n:!1)&&(b=b.reverse());const E=wO(b,t),M=E.length>0;if(M&&m)return Xb(e);if(M&&a)return t.x=p,t.y=x,t.moved=!1,e;let C=[...e];for(let S=0;S<E.length;S++){const _=E[S];_!==void 0&&(_.moved||(_.static?C=FE(C,_,t,s,l):C=FE(C,t,_,s,l)))}return C}function FE(e,t,n,r,s,a){const l=s==="horizontal",h=s==="vertical",m=t.static;if(r){r=!1;const b={x:l?Math.max(t.x-n.w,0):n.x,y:h?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},w=Qd(e,b),E=w!==void 0&&w.y+w.h>t.y,M=w!==void 0&&t.x+t.w>w.x;if(!w)return Ud(e,n,l?b.x:void 0,h?b.y:void 0,r,m,s);if(E&&h)return Ud(e,n,void 0,n.y+1,r,m,s);if(E&&s===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(M&&l)return Ud(e,t,n.x,void 0,r,m,s)}const p=l?n.x+1:void 0,x=h?n.y+1:void 0;return p===void 0&&x===void 0?[...e]:Ud(e,n,p,x,r,m,s)}function fu(e,t,n){return Math.max(t,Math.min(n,e))}var Ore={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:s}){return{x:fu(t,0,Math.max(0,r-e.w)),y:fu(n,0,Math.max(0,s-e.h))}},constrainSize(e,t,n,r,{cols:s,maxRows:a}){const l=r==="w"||r==="nw"||r==="sw"?e.x+e.w:s-e.x,h=r==="n"||r==="nw"||r==="ne"?e.y+e.h:a-e.y;return{w:fu(t,1,Math.max(1,l)),h:fu(n,1,Math.max(1,h))}}},Tre={name:"minMaxSize",constrainSize(e,t,n){return{w:fu(t,e.minW??1,e.maxW??1/0),h:fu(n,e.minH??1,e.maxH??1/0)}}},Dre={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:s,containerHeight:a,rowHeight:l,margin:h}){const m=a>0?Math.floor((a+h[1])/(l+h[1])):s;return{x:fu(t,0,Math.max(0,r-e.w)),y:fu(n,0,Math.max(0,m-e.h))}}},Gx=[Ore,Tre];function Vy(e,t,n,r,s){let a={x:n,y:r};for(const l of e)l.constrainPosition&&(a=l.constrainPosition(t,a.x,a.y,s));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(a=l.constrainPosition(t,a.x,a.y,s));return a}function Are(e,t,n,r,s,a){let l={w:n,h:r};for(const h of e)h.constrainSize&&(l=h.constrainSize(t,l.w,l.h,s,a));if(t.constraints)for(const h of t.constraints)h.constrainSize&&(l=h.constrainSize(t,l.w,l.h,s,a));return l}function DS({top:e,left:t,width:n,height:r}){const s=`translate(${t}px,${e}px)`;return{transform:s,WebkitTransform:s,MozTransform:s,msTransform:s,OTransform:s,width:`${n}px`,height:`${r}px`,position:"absolute"}}function CO({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function HE(e){return e*100+"%"}function jre(e,t,n,r){return e+n>r?t:n}function EO(e,t,n){return e<0?t:n}function kre(e){return Math.max(0,e)}function Yx(e){return Math.max(0,e)}var AS=(e,t,n)=>{const{left:r,height:s,width:a}=t,l=e.top-(s-e.height);return{left:r,width:a,height:EO(l,e.height,s),top:Yx(l)}},jS=(e,t,n)=>{const{top:r,left:s,height:a,width:l}=t;return{top:r,height:a,width:jre(e.left,e.width,l,n),left:kre(s)}},kS=(e,t,n)=>{const{top:r,height:s,width:a}=t,l=e.left+e.width-a;return l<0?{height:s,width:e.left+e.width,top:Yx(r),left:0}:{height:s,width:a,top:Yx(r),left:l}},PS=(e,t,n)=>{const{top:r,left:s,height:a,width:l}=t;return{width:l,left:s,height:EO(r,e.height,a),top:Yx(r)}},Pre=(e,t,n)=>AS(e,jS(e,t,n)),zre=(e,t,n)=>AS(e,kS(e,t)),Bre=(e,t,n)=>PS(e,jS(e,t,n)),Ure=(e,t,n)=>PS(e,kS(e,t)),Fre={n:AS,ne:Pre,e:jS,se:Bre,s:PS,sw:Ure,w:kS,nw:zre};function Hre(e,t,n,r){const s=Fre[e];return s?s(t,{...t,...n},r):n}var RO={type:"transform",scale:1,calcStyle(e){return DS(e)}},Ire={type:"absolute",scale:1,calcStyle(e){return CO(e)}};function $re(e){return{type:"transform",scale:e,calcStyle(t){return DS(t)},calcDragPosition(t,n,r,s){return{left:(t-r)/e,top:(n-s)/e}}}}var Vre=RO,qre={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Wre={enabled:!0,bounded:!1,threshold:3},Gre={enabled:!0,handles:["se"]},Yre={enabled:!1,defaultItem:{w:1,h:1}};function zS(e,t,n,r,s){const a=r==="x"?"w":"h";t[r]+=1;const l=e.findIndex(m=>m.i===t.i),h=s??Yb(e).length>0;for(let m=l+1;m<e.length;m++){const p=e[m];if(p!==void 0&&!p.static){if(!h&&p.y>t.y+t.h)break;OS(t,p)&&zS(e,p,n+t[a],r,h)}}t[r]=n}function Xre(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Qd(e,t);)t.y--;let s;for(;(s=Qd(e,t))!==void 0;)zS(n,t,s.y+s.h,"y");return t.y=Math.max(t.y,0),t}function Kre(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Qd(e,t);)t.x--;let s;for(;(s=Qd(e,t))!==void 0;)if(zS(r,t,s.x+s.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Qd(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var _O={type:"vertical",allowOverlap:!1,compact(e,t){const n=Yb(e);let r=TS(n);const s=N9(e),a=new Array(e.length);for(let l=0;l<s.length;l++){const h=s[l];if(h===void 0)continue;let m=mf(h);m.static||(m=Xre(n,m,s,r),r=Math.max(r,m.y+m.h),n.push(m));const p=e.indexOf(h);a[p]=m,m.moved=!1}return a}},MO={type:"horizontal",allowOverlap:!1,compact(e,t){const n=Yb(e),r=SO(e),s=new Array(e.length);for(let a=0;a<r.length;a++){const l=r[a];if(l===void 0)continue;let h=mf(l);h.static||(h=Kre(n,h,t,r),n.push(h));const m=e.indexOf(l);s[m]=h,h.moved=!1}return s}},NO={type:null,allowOverlap:!1,compact(e,t){return Xb(e)}},Qre={..._O,allowOverlap:!0,compact(e,t){return Xb(e)}},Zre={...MO,allowOverlap:!0,compact(e,t){return Xb(e)}},Jre={...NO,allowOverlap:!0};function OO(e,t=!1,n=!1){let r;return t?e==="vertical"?r=Qre:e==="horizontal"?r=Zre:r=Jre:e==="vertical"?r=_O:e==="horizontal"?r=MO:r=NO,n?{...r,preventCollision:n}:r}var Up={exports:{}},ew={},tw={exports:{}},nw,IE;function eie(){if(IE)return nw;IE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nw=e,nw}var rw,$E;function tie(){if($E)return rw;$E=1;var e=eie();function t(){}function n(){}return n.resetWarningCache=t,rw=function(){function r(l,h,m,p,x,b){if(b!==e){var w=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 w.name="Invariant Violation",w}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},rw}var VE;function Kb(){return VE||(VE=1,tw.exports=tie()()),tw.exports}var qy={exports:{}},qE;function nie(){if(qE)return qy.exports;qE=1;function e(n){var r,s,a="";if(typeof n=="string"||typeof n=="number")a+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(r=0;r<l;r++)n[r]&&(s=e(n[r]))&&(a&&(a+=" "),a+=s)}else for(s in n)n[s]&&(a&&(a+=" "),a+=s);return a}function t(){for(var n,r,s=0,a="",l=arguments.length;s<l;s++)(n=arguments[s])&&(r=e(n))&&(a&&(a+=" "),a+=r);return a}return qy.exports=t,qy.exports.clsx=t,qy.exports}var qr={},Jc={},WE;function Qb(){if(WE)return Jc;WE=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.dontSetMe=s,Jc.findInArray=e,Jc.int=r,Jc.isFunction=t,Jc.isNum=n;function e(a,l){for(let h=0,m=a.length;h<m;h++)if(l.apply(l,[a[h],h,a]))return a[h]}function t(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function n(a){return typeof a=="number"&&!isNaN(a)}function r(a){return parseInt(a,10)}function s(a,l,h){if(a[l])return new Error(`Invalid prop ${l} passed to ${h} - do not set this, set it on the child.`)}return Jc}var eu={},GE;function rie(){if(GE)return eu;GE=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.browserPrefixToKey=n,eu.browserPrefixToStyle=r,eu.default=void 0,eu.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var h,m;let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=(m=(h=window.document)==null?void 0:h.documentElement)==null?void 0:m.style;if(!l||a in l)return"";for(let p=0;p<e.length;p++)if(n(a,e[p])in l)return e[p];return""}function n(a,l){return l?`${l}${s(a)}`:a}function r(a,l){return l?`-${l.toLowerCase()}-${a}`:a}function s(a){let l="",h=!0;for(let m=0;m<a.length;m++)h?(l+=a[m].toUpperCase(),h=!1):a[m]==="-"?h=!0:l+=a[m];return l}return eu.default=t(),eu}var YE;function BS(){if(YE)return qr;YE=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.addClassName=D,qr.addEvent=l,qr.addUserSelectStyles=N,qr.createCSSTransform=E,qr.createSVGTransform=M,qr.getTouch=S,qr.getTouchIdentifier=_,qr.getTranslation=C,qr.innerHeight=x,qr.innerWidth=b,qr.matchesSelector=s,qr.matchesSelectorAndParentsTo=a,qr.offsetXYFromParent=w,qr.outerHeight=m,qr.outerWidth=p,qr.removeClassName=B,qr.removeEvent=h,qr.scheduleRemoveUserSelectStyles=c;var e=Qb(),t=n(rie());function n(T,A){if(typeof WeakMap=="function")var H=new WeakMap,F=new WeakMap;return(n=function(V,ee){if(!ee&&V&&V.__esModule)return V;var G,se,Ce={__proto__:null,default:V};if(V===null||typeof V!="object"&&typeof V!="function")return Ce;if(G=ee?F:H){if(G.has(V))return G.get(V);G.set(V,Ce)}for(const te in V)te!=="default"&&{}.hasOwnProperty.call(V,te)&&((se=(G=Object.defineProperty)&&Object.getOwnPropertyDescriptor(V,te))&&(se.get||se.set)?G(Ce,te,se):Ce[te]=V[te]);return Ce})(T,A)}let r="";function s(T,A){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(H){return(0,e.isFunction)(T[H])})),(0,e.isFunction)(T[r])?T[r](A):!1}function a(T,A,H){let F=T;do{if(s(F,A))return!0;if(F===H)return!1;F=F.parentNode}while(F);return!1}function l(T,A,H,F){if(!T)return;const V={capture:!0,...F};T.addEventListener?T.addEventListener(A,H,V):T.attachEvent?T.attachEvent("on"+A,H):T["on"+A]=H}function h(T,A,H,F){if(!T)return;const V={capture:!0,...F};T.removeEventListener?T.removeEventListener(A,H,V):T.detachEvent?T.detachEvent("on"+A,H):T["on"+A]=null}function m(T){let A=T.clientHeight;const H=T.ownerDocument.defaultView.getComputedStyle(T);return A+=(0,e.int)(H.borderTopWidth),A+=(0,e.int)(H.borderBottomWidth),A}function p(T){let A=T.clientWidth;const H=T.ownerDocument.defaultView.getComputedStyle(T);return A+=(0,e.int)(H.borderLeftWidth),A+=(0,e.int)(H.borderRightWidth),A}function x(T){let A=T.clientHeight;const H=T.ownerDocument.defaultView.getComputedStyle(T);return A-=(0,e.int)(H.paddingTop),A-=(0,e.int)(H.paddingBottom),A}function b(T){let A=T.clientWidth;const H=T.ownerDocument.defaultView.getComputedStyle(T);return A-=(0,e.int)(H.paddingLeft),A-=(0,e.int)(H.paddingRight),A}function w(T,A,H){const V=A===A.ownerDocument.body?{left:0,top:0}:A.getBoundingClientRect(),ee=(T.clientX+A.scrollLeft-V.left)/H,G=(T.clientY+A.scrollTop-V.top)/H;return{x:ee,y:G}}function E(T,A){const H=C(T,A,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:H}}function M(T,A){return C(T,A,"")}function C(T,A,H){let{x:F,y:V}=T,ee=`translate(${F}${H},${V}${H})`;if(A){const G=`${typeof A.x=="string"?A.x:A.x+H}`,se=`${typeof A.y=="string"?A.y:A.y+H}`;ee=`translate(${G}, ${se})`+ee}return ee}function S(T,A){return T.targetTouches&&(0,e.findInArray)(T.targetTouches,H=>A===H.identifier)||T.changedTouches&&(0,e.findInArray)(T.changedTouches,H=>A===H.identifier)}function _(T){if(T.targetTouches&&T.targetTouches[0])return T.targetTouches[0].identifier;if(T.changedTouches&&T.changedTouches[0])return T.changedTouches[0].identifier}function N(T){if(!T)return;let A=T.getElementById("react-draggable-style-el");A||(A=T.createElement("style"),A.type="text/css",A.id="react-draggable-style-el",A.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,A.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,T.getElementsByTagName("head")[0].appendChild(A)),T.body&&D(T.body,"react-draggable-transparent-selection")}function c(T){window.requestAnimationFrame?window.requestAnimationFrame(()=>{j(T)}):j(T)}function j(T){if(T)try{if(T.body&&B(T.body,"react-draggable-transparent-selection"),T.selection)T.selection.empty();else{const A=(T.defaultView||window).getSelection();A&&A.type!=="Caret"&&A.removeAllRanges()}}catch{}}function D(T,A){T.classList?T.classList.add(A):T.className.match(new RegExp(`(?:^|\\s)${A}(?!\\S)`))||(T.className+=` ${A}`)}function B(T,A){T.classList?T.classList.remove(A):T.className=T.className.replace(new RegExp(`(?:^|\\s)${A}(?!\\S)`,"g"),"")}return qr}var Xa={},XE;function TO(){if(XE)return Xa;XE=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.canDragX=s,Xa.canDragY=a,Xa.createCoreData=h,Xa.createDraggableData=m,Xa.getBoundPosition=n,Xa.getControlPosition=l,Xa.snapToGrid=r;var e=Qb(),t=BS();function n(b,w,E){if(!b.props.bounds)return[w,E];let{bounds:M}=b.props;M=typeof M=="string"?M:p(M);const C=x(b);if(typeof M=="string"){const{ownerDocument:S}=C,_=S.defaultView;let N;if(M==="parent"?N=C.parentNode:N=C.getRootNode().querySelector(M),!(N instanceof _.HTMLElement))throw new Error('Bounds selector "'+M+'" could not find an element.');const c=N,j=_.getComputedStyle(C),D=_.getComputedStyle(c);M={left:-C.offsetLeft+(0,e.int)(D.paddingLeft)+(0,e.int)(j.marginLeft),top:-C.offsetTop+(0,e.int)(D.paddingTop)+(0,e.int)(j.marginTop),right:(0,t.innerWidth)(c)-(0,t.outerWidth)(C)-C.offsetLeft+(0,e.int)(D.paddingRight)-(0,e.int)(j.marginRight),bottom:(0,t.innerHeight)(c)-(0,t.outerHeight)(C)-C.offsetTop+(0,e.int)(D.paddingBottom)-(0,e.int)(j.marginBottom)}}return(0,e.isNum)(M.right)&&(w=Math.min(w,M.right)),(0,e.isNum)(M.bottom)&&(E=Math.min(E,M.bottom)),(0,e.isNum)(M.left)&&(w=Math.max(w,M.left)),(0,e.isNum)(M.top)&&(E=Math.max(E,M.top)),[w,E]}function r(b,w,E){const M=Math.round(w/b[0])*b[0],C=Math.round(E/b[1])*b[1];return[M,C]}function s(b){return b.props.axis==="both"||b.props.axis==="x"}function a(b){return b.props.axis==="both"||b.props.axis==="y"}function l(b,w,E){const M=typeof w=="number"?(0,t.getTouch)(b,w):null;if(typeof w=="number"&&!M)return null;const C=x(E),S=E.props.offsetParent||C.offsetParent||C.ownerDocument.body;return(0,t.offsetXYFromParent)(M||b,S,E.props.scale)}function h(b,w,E){const M=!(0,e.isNum)(b.lastX),C=x(b);return M?{node:C,deltaX:0,deltaY:0,lastX:w,lastY:E,x:w,y:E}:{node:C,deltaX:w-b.lastX,deltaY:E-b.lastY,lastX:b.lastX,lastY:b.lastY,x:w,y:E}}function m(b,w){const E=b.props.scale;return{node:w.node,x:b.state.x+w.deltaX/E,y:b.state.y+w.deltaY/E,deltaX:w.deltaX/E,deltaY:w.deltaY/E,lastX:b.state.x,lastY:b.state.y}}function p(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function x(b){const w=b.findDOMNode();if(!w)throw new Error("<DraggableCore>: Unmounted during event!");return w}return Xa}var Fp={},Wy={},KE;function DO(){if(KE)return Wy;KE=1,Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.default=e;function e(){}return Wy}var QE;function iie(){if(QE)return Fp;QE=1,Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.default=void 0;var e=m(bu()),t=h(Kb()),n=h(Kx()),r=BS(),s=TO(),a=Qb(),l=h(DO());function h(C){return C&&C.__esModule?C:{default:C}}function m(C,S){if(typeof WeakMap=="function")var _=new WeakMap,N=new WeakMap;return(m=function(c,j){if(!j&&c&&c.__esModule)return c;var D,B,T={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return T;if(D=j?N:_){if(D.has(c))return D.get(c);D.set(c,T)}for(const A in c)A!=="default"&&{}.hasOwnProperty.call(c,A)&&((B=(D=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,A))&&(B.get||B.set)?D(T,A,B):T[A]=c[A]);return T})(C,S)}function p(C,S,_){return(S=x(S))in C?Object.defineProperty(C,S,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[S]=_,C}function x(C){var S=b(C,"string");return typeof S=="symbol"?S:S+""}function b(C,S){if(typeof C!="object"||!C)return C;var _=C[Symbol.toPrimitive];if(_!==void 0){var N=_.call(C,S);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(C)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let E=w.mouse,M=class extends e.Component{constructor(){super(...arguments),p(this,"dragging",!1),p(this,"lastX",NaN),p(this,"lastY",NaN),p(this,"touchIdentifier",null),p(this,"mounted",!1),p(this,"handleDragStart",S=>{if(this.props.onMouseDown(S),!this.props.allowAnyClick&&typeof S.button=="number"&&S.button!==0)return!1;const _=this.findDOMNode();if(!_||!_.ownerDocument||!_.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:N}=_;if(this.props.disabled||!(S.target instanceof N.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(S.target,this.props.handle,_)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(S.target,this.props.cancel,_))return;S.type==="touchstart"&&!this.props.allowMobileScroll&&S.preventDefault();const c=(0,r.getTouchIdentifier)(S);this.touchIdentifier=c;const j=(0,s.getControlPosition)(S,c,this);if(j==null)return;const{x:D,y:B}=j,T=(0,s.createCoreData)(this,D,B);(0,l.default)("DraggableCore: handleDragStart: %j",T),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(S,T)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(N),this.dragging=!0,this.lastX=D,this.lastY=B,(0,r.addEvent)(N,E.move,this.handleDrag),(0,r.addEvent)(N,E.stop,this.handleDragStop))}),p(this,"handleDrag",S=>{const _=(0,s.getControlPosition)(S,this.touchIdentifier,this);if(_==null)return;let{x:N,y:c}=_;if(Array.isArray(this.props.grid)){let B=N-this.lastX,T=c-this.lastY;if([B,T]=(0,s.snapToGrid)(this.props.grid,B,T),!B&&!T)return;N=this.lastX+B,c=this.lastY+T}const j=(0,s.createCoreData)(this,N,c);if((0,l.default)("DraggableCore: handleDrag: %j",j),this.props.onDrag(S,j)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const T=document.createEvent("MouseEvents");T.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(T)}return}this.lastX=N,this.lastY=c}),p(this,"handleDragStop",S=>{if(!this.dragging)return;const _=(0,s.getControlPosition)(S,this.touchIdentifier,this);if(_==null)return;let{x:N,y:c}=_;if(Array.isArray(this.props.grid)){let T=N-this.lastX||0,A=c-this.lastY||0;[T,A]=(0,s.snapToGrid)(this.props.grid,T,A),N=this.lastX+T,c=this.lastY+A}const j=(0,s.createCoreData)(this,N,c);if(this.props.onStop(S,j)===!1||this.mounted===!1)return!1;const B=this.findDOMNode();B&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(B.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",j),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,B&&((0,l.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(B.ownerDocument,E.move,this.handleDrag),(0,r.removeEvent)(B.ownerDocument,E.stop,this.handleDragStop))}),p(this,"onMouseDown",S=>(E=w.mouse,this.handleDragStart(S))),p(this,"onMouseUp",S=>(E=w.mouse,this.handleDragStop(S))),p(this,"onTouchStart",S=>(E=w.touch,this.handleDragStart(S))),p(this,"onTouchEnd",S=>(E=w.touch,this.handleDragStop(S)))}componentDidMount(){this.mounted=!0;const S=this.findDOMNode();S&&(0,r.addEvent)(S,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const S=this.findDOMNode();if(S){const{ownerDocument:_}=S;(0,r.removeEvent)(_,w.mouse.move,this.handleDrag),(0,r.removeEvent)(_,w.touch.move,this.handleDrag),(0,r.removeEvent)(_,w.mouse.stop,this.handleDragStop),(0,r.removeEvent)(_,w.touch.stop,this.handleDragStop),(0,r.removeEvent)(S,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(_)}}findDOMNode(){var S,_,N;return(S=this.props)!=null&&S.nodeRef?(N=(_=this.props)==null?void 0:_.nodeRef)==null?void 0:N.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Fp.default=M,p(M,"displayName","DraggableCore"),p(M,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(C,S){if(C[S]&&C[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel: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,className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),p(M,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Fp}var ZE;function sie(){return ZE||(ZE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return m.default}}),e.default=void 0;var t=b(bu()),n=x(Kb()),r=x(Kx()),s=nie(),a=BS(),l=TO(),h=Qb(),m=x(iie()),p=x(DO());function x(_){return _&&_.__esModule?_:{default:_}}function b(_,N){if(typeof WeakMap=="function")var c=new WeakMap,j=new WeakMap;return(b=function(D,B){if(!B&&D&&D.__esModule)return D;var T,A,H={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return H;if(T=B?j:c){if(T.has(D))return T.get(D);T.set(D,H)}for(const F in D)F!=="default"&&{}.hasOwnProperty.call(D,F)&&((A=(T=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,F))&&(A.get||A.set)?T(H,F,A):H[F]=D[F]);return H})(_,N)}function w(){return w=Object.assign?Object.assign.bind():function(_){for(var N=1;N<arguments.length;N++){var c=arguments[N];for(var j in c)({}).hasOwnProperty.call(c,j)&&(_[j]=c[j])}return _},w.apply(null,arguments)}function E(_,N,c){return(N=M(N))in _?Object.defineProperty(_,N,{value:c,enumerable:!0,configurable:!0,writable:!0}):_[N]=c,_}function M(_){var N=C(_,"string");return typeof N=="symbol"?N:N+""}function C(_,N){if(typeof _!="object"||!_)return _;var c=_[Symbol.toPrimitive];if(c!==void 0){var j=c.call(_,N);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(_)}class S extends t.Component{static getDerivedStateFromProps(N,c){let{position:j}=N,{prevPropsPosition:D}=c;return j&&(!D||j.x!==D.x||j.y!==D.y)?((0,p.default)("Draggable: getDerivedStateFromProps %j",{position:j,prevPropsPosition:D}),{x:j.x,y:j.y,prevPropsPosition:{...j}}):null}constructor(N){super(N),E(this,"onDragStart",(c,j)=>{if((0,p.default)("Draggable: onDragStart: %j",j),this.props.onStart(c,(0,l.createDraggableData)(this,j))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),E(this,"onDrag",(c,j)=>{if(!this.state.dragging)return!1;(0,p.default)("Draggable: onDrag: %j",j);const D=(0,l.createDraggableData)(this,j),B={x:D.x,y:D.y,slackX:0,slackY:0};if(this.props.bounds){const{x:A,y:H}=B;B.x+=this.state.slackX,B.y+=this.state.slackY;const[F,V]=(0,l.getBoundPosition)(this,B.x,B.y);B.x=F,B.y=V,B.slackX=this.state.slackX+(A-B.x),B.slackY=this.state.slackY+(H-B.y),D.x=B.x,D.y=B.y,D.deltaX=B.x-this.state.x,D.deltaY=B.y-this.state.y}if(this.props.onDrag(c,D)===!1)return!1;this.setState(B)}),E(this,"onDragStop",(c,j)=>{if(!this.state.dragging||this.props.onStop(c,(0,l.createDraggableData)(this,j))===!1)return!1;(0,p.default)("Draggable: onDragStop: %j",j);const B={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:A,y:H}=this.props.position;B.x=A,B.y=H}this.setState(B)}),this.state={dragging:!1,dragged:!1,x:N.position?N.position.x:N.defaultPosition.x,y:N.position?N.position.y:N.defaultPosition.y,prevPropsPosition:{...N.position},slackX:0,slackY:0,isElementSVG:!1},N.position&&!(N.onDrag||N.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 N,c;return((c=(N=this.props)==null?void 0:N.nodeRef)==null?void 0:c.current)??r.default.findDOMNode(this)}render(){const{axis:N,bounds:c,children:j,defaultPosition:D,defaultClassName:B,defaultClassNameDragging:T,defaultClassNameDragged:A,position:H,positionOffset:F,scale:V,...ee}=this.props;let G={},se=null;const te=!!!H||this.state.dragging,K=H||D,Z={x:(0,l.canDragX)(this)&&te?this.state.x:K.x,y:(0,l.canDragY)(this)&&te?this.state.y:K.y};this.state.isElementSVG?se=(0,a.createSVGTransform)(Z,F):G=(0,a.createCSSTransform)(Z,F);const oe=(0,s.clsx)(j.props.className||"",B,{[T]:this.state.dragging,[A]:this.state.dragged});return t.createElement(m.default,w({},ee,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(j),{className:oe,style:{...j.props.style,...G},transform:se}))}}e.default=S,E(S,"displayName","Draggable"),E(S,"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:h.dontSetMe,style:h.dontSetMe,transform:h.dontSetMe}),E(S,"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})}(ew)),ew}var JE;function US(){if(JE)return Up.exports;JE=1;const{default:e,DraggableCore:t}=sie();return Up.exports=e,Up.exports.default=e,Up.exports.DraggableCore=t,Up.exports}var oie=US(),Hp={exports:{}},Ip={},Gy={},e8;function aie(){if(e8)return Gy;e8=1,Gy.__esModule=!0,Gy.cloneElement=h;var e=t(bu());function t(m){return m&&m.__esModule?m:{default:m}}function n(m,p){var x=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);p&&(b=b.filter(function(w){return Object.getOwnPropertyDescriptor(m,w).enumerable})),x.push.apply(x,b)}return x}function r(m){for(var p=1;p<arguments.length;p++){var x=arguments[p]!=null?arguments[p]:{};p%2?n(Object(x),!0).forEach(function(b){s(m,b,x[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(x)):n(Object(x)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(x,b))})}return m}function s(m,p,x){return(p=a(p))in m?Object.defineProperty(m,p,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[p]=x,m}function a(m){var p=l(m,"string");return typeof p=="symbol"?p:p+""}function l(m,p){if(typeof m!="object"||!m)return m;var x=m[Symbol.toPrimitive];if(x!==void 0){var b=x.call(m,p);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(m)}function h(m,p){return p.style&&m.props.style&&(p.style=r(r({},m.props.style),p.style)),p.className&&m.props.className&&(p.className=`${m.props.className} ${p.className}`),e.default.cloneElement(m,p)}return Gy}var $p={},t8;function AO(){if(t8)return $p;t8=1,$p.__esModule=!0,$p.resizableProps=void 0;var e=t(Kb());US();function t(n){return n&&n.__esModule?n:{default:n}}return $p.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle: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}),height:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];const[a]=r;return a.axis==="both"||a.axis==="y"?e.default.number.isRequired(...r):e.default.number(...r)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];const[a]=r;return a.axis==="both"||a.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},$p}var n8;function jO(){if(n8)return Ip;n8=1,Ip.__esModule=!0,Ip.default=void 0;var e=a(bu()),t=US(),n=aie(),r=AO();const s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(C,S){if(typeof WeakMap=="function")var _=new WeakMap,N=new WeakMap;return(a=function(c,j){if(!j&&c&&c.__esModule)return c;var D,B,T={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return T;if(D=j?N:_){if(D.has(c))return D.get(c);D.set(c,T)}for(const A in c)A!=="default"&&{}.hasOwnProperty.call(c,A)&&((B=(D=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,A))&&(B.get||B.set)?D(T,A,B):T[A]=c[A]);return T})(C,S)}function l(){return l=Object.assign?Object.assign.bind():function(C){for(var S=1;S<arguments.length;S++){var _=arguments[S];for(var N in _)({}).hasOwnProperty.call(_,N)&&(C[N]=_[N])}return C},l.apply(null,arguments)}function h(C,S){if(C==null)return{};var _,N,c=m(C,S);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(C);for(N=0;N<j.length;N++)_=j[N],S.indexOf(_)===-1&&{}.propertyIsEnumerable.call(C,_)&&(c[_]=C[_])}return c}function m(C,S){if(C==null)return{};var _={};for(var N in C)if({}.hasOwnProperty.call(C,N)){if(S.indexOf(N)!==-1)continue;_[N]=C[N]}return _}function p(C,S){var _=Object.keys(C);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(C);S&&(N=N.filter(function(c){return Object.getOwnPropertyDescriptor(C,c).enumerable})),_.push.apply(_,N)}return _}function x(C){for(var S=1;S<arguments.length;S++){var _=arguments[S]!=null?arguments[S]:{};S%2?p(Object(_),!0).forEach(function(N){b(C,N,_[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(_)):p(Object(_)).forEach(function(N){Object.defineProperty(C,N,Object.getOwnPropertyDescriptor(_,N))})}return C}function b(C,S,_){return(S=w(S))in C?Object.defineProperty(C,S,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[S]=_,C}function w(C){var S=E(C,"string");return typeof S=="symbol"?S:S+""}function E(C,S){if(typeof C!="object"||!C)return C;var _=C[Symbol.toPrimitive];if(_!==void 0){var N=_.call(C,S);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(C)}let M=class extends e.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(S,_){const{minConstraints:N,maxConstraints:c,lockAspectRatio:j}=this.props;if(!N&&!c&&!j)return[S,_];if(j){const H=this.props.width/this.props.height,F=S-this.props.width,V=_-this.props.height;Math.abs(F)>Math.abs(V*H)?_=S/H:S=_*H}const[D,B]=[S,_];let[T,A]=this.slack||[0,0];return S+=T,_+=A,N&&(S=Math.max(N[0],S),_=Math.max(N[1],_)),c&&(S=Math.min(c[0],S),_=Math.min(c[1],_)),this.slack=[T+(D-S),A+(B-_)],[S,_]}resizeHandler(S,_){return(N,c)=>{var K;let{node:j,deltaX:D,deltaY:B}=c;S==="onResizeStart"&&this.resetData();const T=(this.props.axis==="both"||this.props.axis==="x")&&_!=="n"&&_!=="s",A=(this.props.axis==="both"||this.props.axis==="y")&&_!=="e"&&_!=="w";if(!T&&!A)return;const H=_[0],F=_[_.length-1],V=j.getBoundingClientRect();if(this.lastHandleRect!=null){if(F==="w"){const Z=V.left-this.lastHandleRect.left;D+=Z}if(H==="n"){const Z=V.top-this.lastHandleRect.top;B+=Z}}this.lastHandleRect=V,F==="w"&&(D=-D),H==="n"&&(B=-B);let ee=this.props.width+(T?D/this.props.transformScale:0),G=this.props.height+(A?B/this.props.transformScale:0);[ee,G]=this.runConstraints(ee,G),S==="onResizeStop"&&this.lastSize&&({width:ee,height:G}=this.lastSize);const se=ee!==this.props.width||G!==this.props.height;S!=="onResizeStop"&&(this.lastSize={width:ee,height:G});const Ce=typeof this.props[S]=="function"?this.props[S]:null;Ce&&!(S==="onResize"&&!se)&&((K=N.persist)==null||K.call(N),Ce(N,{node:j,size:{width:ee,height:G},handle:_})),S==="onResizeStop"&&this.resetData()}}renderResizeHandle(S,_){const{handle:N}=this.props;if(!N)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${S}`,ref:_});if(typeof N=="function")return N(S,_);const c=typeof N.type=="string",j=x({ref:_},c?{}:{handleAxis:S});return e.cloneElement(N,j)}render(){const S=this.props,{children:_,className:N,draggableOpts:c,width:j,height:D,handle:B,handleSize:T,lockAspectRatio:A,axis:H,minConstraints:F,maxConstraints:V,onResize:ee,onResizeStop:G,onResizeStart:se,resizeHandles:Ce,transformScale:te}=S,K=h(S,s);return(0,n.cloneElement)(_,x(x({},K),{},{className:`${N?`${N} `:""}react-resizable`,children:[...e.Children.toArray(_.props.children),...Ce.map(Z=>{const oe=this.handleRefs[Z]??(this.handleRefs[Z]=e.createRef());return e.createElement(t.DraggableCore,l({},c,{nodeRef:oe,key:`resizableHandle-${Z}`,onStop:this.resizeHandler("onResizeStop",Z),onStart:this.resizeHandler("onResizeStart",Z),onDrag:this.resizeHandler("onResize",Z)}),this.renderResizeHandle(Z,oe))})]}))}};return Ip.default=M,M.propTypes=r.resizableProps,M.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Ip}var Vp={},r8;function lie(){if(r8)return Vp;r8=1,Vp.__esModule=!0,Vp.default=void 0;var e=l(bu()),t=a(Kb()),n=a(jO()),r=AO();const s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(S){return S&&S.__esModule?S:{default:S}}function l(S,_){if(typeof WeakMap=="function")var N=new WeakMap,c=new WeakMap;return(l=function(j,D){if(!D&&j&&j.__esModule)return j;var B,T,A={__proto__:null,default:j};if(j===null||typeof j!="object"&&typeof j!="function")return A;if(B=D?c:N){if(B.has(j))return B.get(j);B.set(j,A)}for(const H in j)H!=="default"&&{}.hasOwnProperty.call(j,H)&&((T=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(j,H))&&(T.get||T.set)?B(A,H,T):A[H]=j[H]);return A})(S,_)}function h(){return h=Object.assign?Object.assign.bind():function(S){for(var _=1;_<arguments.length;_++){var N=arguments[_];for(var c in N)({}).hasOwnProperty.call(N,c)&&(S[c]=N[c])}return S},h.apply(null,arguments)}function m(S,_){var N=Object.keys(S);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(S);_&&(c=c.filter(function(j){return Object.getOwnPropertyDescriptor(S,j).enumerable})),N.push.apply(N,c)}return N}function p(S){for(var _=1;_<arguments.length;_++){var N=arguments[_]!=null?arguments[_]:{};_%2?m(Object(N),!0).forEach(function(c){x(S,c,N[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(N)):m(Object(N)).forEach(function(c){Object.defineProperty(S,c,Object.getOwnPropertyDescriptor(N,c))})}return S}function x(S,_,N){return(_=b(_))in S?Object.defineProperty(S,_,{value:N,enumerable:!0,configurable:!0,writable:!0}):S[_]=N,S}function b(S){var _=w(S,"string");return typeof _=="symbol"?_:_+""}function w(S,_){if(typeof S!="object"||!S)return S;var N=S[Symbol.toPrimitive];if(N!==void 0){var c=N.call(S,_);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(S)}function E(S,_){if(S==null)return{};var N,c,j=M(S,_);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(S);for(c=0;c<D.length;c++)N=D[c],_.indexOf(N)===-1&&{}.propertyIsEnumerable.call(S,N)&&(j[N]=S[N])}return j}function M(S,_){if(S==null)return{};var N={};for(var c in S)if({}.hasOwnProperty.call(S,c)){if(_.indexOf(c)!==-1)continue;N[c]=S[c]}return N}let C=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(_,N)=>{var j;const{size:c}=N;this.props.onResize?((j=_.persist)==null||j.call(_),this.setState(c,()=>this.props.onResize&&this.props.onResize(_,N))):this.setState(c)}}static getDerivedStateFromProps(_,N){return N.propsWidth!==_.width||N.propsHeight!==_.height?{width:_.width,height:_.height,propsWidth:_.width,propsHeight:_.height}:null}render(){const _=this.props,{handle:N,handleSize:c,onResize:j,onResizeStart:D,onResizeStop:B,draggableOpts:T,minConstraints:A,maxConstraints:H,lockAspectRatio:F,axis:V,width:ee,height:G,resizeHandles:se,style:Ce,transformScale:te}=_,K=E(_,s);return e.createElement(n.default,{axis:V,draggableOpts:T,handle:N,handleSize:c,height:this.state.height,lockAspectRatio:F,maxConstraints:H,minConstraints:A,onResizeStart:D,onResize:this.onResize,onResizeStop:B,resizeHandles:se,transformScale:te,width:this.state.width},e.createElement("div",h({},K,{style:p(p({},Ce),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Vp.default=C,C.propTypes=p(p({},r.resizableProps),{},{children:t.default.element}),Vp}var i8;function cie(){return i8||(i8=1,Hp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Hp.exports.Resizable=jO().default,Hp.exports.ResizableBox=lie().default),Hp.exports}var uie=cie();function kO(e){return function(n,r,s,a,l,h,m){return e(n,r,m)}}function Zb(e){return function(n,r,s,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s,a);var l=a.get(n),h=a.get(r);if(l&&h)return l===r&&h===n;a.set(n,r),a.set(r,n);var m=e(n,r,s,a);return a.delete(n),a.delete(r),m}}function PO(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function s8(e){return e.constructor===Object||e.constructor==null}function o8(e){return typeof e.then=="function"}function Jb(e,t){return e===t||e!==e&&t!==t}var die="[object Arguments]",fie="[object Boolean]",hie="[object Date]",mie="[object RegExp]",pie="[object Map]",gie="[object Number]",vie="[object Object]",yie="[object Set]",xie="[object String]",a8=Object.prototype.toString;function eL(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,a=e.areRegExpsEqual,l=e.areSetsEqual,h=e.createIsNestedEqual,m=h(p);function p(x,b,w){if(x===b)return!0;if(!x||!b||typeof x!="object"||typeof b!="object")return x!==x&&b!==b;if(s8(x)&&s8(b))return s(x,b,m,w);var E=Array.isArray(x),M=Array.isArray(b);if(E||M)return E===M&&t(x,b,m,w);var C=a8.call(x);return C!==a8.call(b)?!1:C===hie?n(x,b,m,w):C===mie?a(x,b,m,w):C===pie?r(x,b,m,w):C===yie?l(x,b,m,w):C===vie||C===die?o8(x)||o8(b)?!1:s(x,b,m,w):C===fie||C===gie||C===xie?Jb(x.valueOf(),b.valueOf()):!1}return p}function zO(e,t,n,r){var s=e.length;if(t.length!==s)return!1;for(;s-- >0;)if(!n(e[s],t[s],s,s,e,t,r))return!1;return!0}var bie=Zb(zO);function BO(e,t){return Jb(e.valueOf(),t.valueOf())}function UO(e,t,n,r){var s=e.size===t.size;if(!s)return!1;if(!e.size)return!0;var a={},l=0;return e.forEach(function(h,m){if(s){var p=!1,x=0;t.forEach(function(b,w){!p&&!a[x]&&(p=n(m,w,l,x,e,t,r)&&n(h,b,m,w,e,t,r))&&(a[x]=!0),x++}),l++,s=p}}),s}var Lie=Zb(UO),wie="_owner",Sie=Object.prototype.hasOwnProperty;function FO(e,t,n,r){var s=Object.keys(e),a=s.length;if(Object.keys(t).length!==a)return!1;for(var l;a-- >0;){if(l=s[a],l===wie){var h=!!e.$$typeof,m=!!t.$$typeof;if((h||m)&&h!==m)return!1}if(!Sie.call(t,l)||!n(e[l],t[l],l,l,e,t,r))return!1}return!0}var Cie=Zb(FO);function HO(e,t){return e.source===t.source&&e.flags===t.flags}function IO(e,t,n,r){var s=e.size===t.size;if(!s)return!1;if(!e.size)return!0;var a={};return e.forEach(function(l,h){if(s){var m=!1,p=0;t.forEach(function(x,b){!m&&!a[p]&&(m=n(l,x,h,b,e,t,r))&&(a[p]=!0),p++}),s=m}}),s}var Eie=Zb(IO),$O=Object.freeze({areArraysEqual:zO,areDatesEqual:BO,areMapsEqual:UO,areObjectsEqual:FO,areRegExpsEqual:HO,areSetsEqual:IO,createIsNestedEqual:kO}),VO=Object.freeze({areArraysEqual:bie,areDatesEqual:BO,areMapsEqual:Lie,areObjectsEqual:Cie,areRegExpsEqual:HO,areSetsEqual:Eie,createIsNestedEqual:kO}),Rie=eL($O);function em(e,t){return Rie(e,t,void 0)}eL(PO($O,{createIsNestedEqual:function(){return Jb}}));eL(VO);eL(PO(VO,{createIsNestedEqual:function(){return Jb}}));function l8(e){const{children:t,cols:n,containerWidth:r,margin:s,containerPadding:a,rowHeight:l,maxRows:h,isDraggable:m,isResizable:p,isBounded:x,static:b,useCSSTransforms:w=!0,usePercentages:E=!1,transformScale:M=1,positionStrategy:C,dragThreshold:S=0,droppingPosition:_,className:N="",style:c,handle:j="",cancel:D="",x:B,y:T,w:A,h:H,minW:F=1,maxW:V=1/0,minH:ee=1,maxH:G=1/0,i:se,resizeHandles:Ce,resizeHandle:te,constraints:K=Gx,layoutItem:Z,layout:oe=[],onDragStart:Y,onDrag:ne,onDragStop:X,onResizeStart:ue,onResize:pe,onResizeStop:Se}=e,[Re,ye]=y.useState(!1),[ve,he]=y.useState(!1),de=y.useRef(null),ke=y.useRef({left:0,top:0}),Ee=y.useRef({top:0,left:0,width:0,height:0}),Ke=y.useRef(void 0),ae=y.useRef(oe);ae.current=oe;const We=y.useRef(null),bt=y.useRef(null),tt=y.useRef(!1),mt=y.useRef({x:0,y:0}),Xe=y.useRef(!1),at=y.useMemo(()=>({cols:n,containerPadding:a,containerWidth:r,margin:s,maxRows:h,rowHeight:l}),[n,a,r,s,h,l]),ot=y.useMemo(()=>({cols:n,maxRows:h,containerWidth:r,containerHeight:0,rowHeight:l,margin:s,layout:[]}),[n,h,r,l,s]),Ct=y.useCallback(()=>({...ot,layout:ae.current}),[ot]),Ot=y.useMemo(()=>Z??{i:se,x:B,y:T,w:A,h:H,minW:F,maxW:V,minH:ee,maxH:G},[Z,se,B,T,A,H,F,V,ee,G]),kn=y.useCallback(ft=>{if(C!=null&&C.calcStyle)return C.calcStyle(ft);if(w)return DS(ft);const jt=CO(ft);return E?{...jt,left:HE(ft.left/r),width:HE(ft.width/r)}:jt},[C,w,E,r]),_t=y.useCallback((ft,{node:jt})=>{if(!Y)return;const{offsetParent:qt}=jt;if(!qt)return;const Pt=qt.getBoundingClientRect(),Wt=jt.getBoundingClientRect(),Me=Wt.left/M,gt=Pt.left/M,Jt=Wt.top/M,St=Pt.top/M;let dt;if(C!=null&&C.calcDragPosition){const Tt=ft;dt=C.calcDragPosition(Tt.clientX,Tt.clientY,Tt.clientX-Wt.left,Tt.clientY-Wt.top)}else dt={left:Me-gt+qt.scrollLeft,top:Jt-St+qt.scrollTop};if(ke.current=dt,S>0){const Tt=ft;mt.current={x:Tt.clientX,y:Tt.clientY},tt.current=!0,Xe.current=!1,ye(!0);return}ye(!0);const en=$y(at,dt.top,dt.left),{x:bn,y:rt}=Vy(K,Ot,en.x,en.y,Ct());Y(se,bn,rt,{e:ft,node:jt,newPosition:dt})},[Y,M,at,C,S,K,Ot,Ct,se]),kt=y.useCallback((ft,{node:jt,deltaX:qt,deltaY:Pt})=>{if(!ne||!Re)return;const Wt=ft;if(tt.current&&!Xe.current){const bn=Wt.clientX-mt.current.x,rt=Wt.clientY-mt.current.y;if(Math.hypot(bn,rt)<S)return;if(Xe.current=!0,tt.current=!1,Y){const ce=$y(at,ke.current.top,ke.current.left),{x:Ue,y:ze}=Vy(K,Ot,ce.x,ce.y,Ct());Y(se,Ue,ze,{e:ft,node:jt,newPosition:ke.current})}}let Me=ke.current.top+Pt,gt=ke.current.left+qt;if(x){const{offsetParent:bn}=jt;if(bn){const rt=bn.clientHeight-Dm(H,l,s[1]);Me=Wx(Me,0,rt);const Tt=Zm(at),ce=r-Dm(A,Tt,s[0]);gt=Wx(gt,0,ce)}}const Jt={top:Me,left:gt};ke.current=Jt;const St=$y(at,Me,gt),{x:dt,y:en}=Vy(K,Ot,St.x,St.y,Ct());ne(se,dt,en,{e:ft,node:jt,newPosition:Jt})},[ne,Y,Re,S,x,H,l,s,at,r,A,se,K,Ot,Ct]),$=y.useCallback((ft,{node:jt})=>{if(!X||!Re)return;const qt=tt.current;if(tt.current=!1,Xe.current=!1,mt.current={x:0,y:0},qt){ye(!1),ke.current={left:0,top:0};return}const{left:Pt,top:Wt}=ke.current,Me={top:Wt,left:Pt};ye(!1),ke.current={left:0,top:0};const gt=$y(at,Wt,Pt),{x:Jt,y:St}=Vy(K,Ot,gt.x,gt.y,Ct());X(se,Jt,St,{e:ft,node:jt,newPosition:Me})},[X,Re,at,K,Ot,Ct,se]);We.current=_t,bt.current=kt;const k=y.useCallback((ft,{node:jt,size:qt,handle:Pt},Wt,Me)=>{const gt=Me==="onResizeStart"?ue:Me==="onResize"?pe:Se;if(!gt)return;let Jt;jt?Jt=Hre(Pt,Wt,qt,r):Jt={...qt,top:Wt.top,left:Wt.left},Ee.current=Jt;const St=Ere(at,Jt.width,Jt.height),{w:dt,h:en}=Are(K,Ot,St.w,St.h,Pt,Ct());gt(se,dt,en,{e:ft.nativeEvent,node:jt,size:Jt,handle:Pt})},[ue,pe,Se,r,at,se,K,Ot,Ct]),z=y.useCallback((ft,jt)=>{he(!0);const qt=Bp(at,B,T,A,H),Pt={...jt,handle:jt.handle};k(ft,Pt,qt,"onResizeStart")},[k,at,B,T,A,H]),J=y.useCallback((ft,jt)=>{const qt=Bp(at,B,T,A,H),Pt={...jt,handle:jt.handle};k(ft,Pt,qt,"onResize")},[k,at,B,T,A,H]),le=y.useCallback((ft,jt)=>{he(!1),Ee.current={top:0,left:0,width:0,height:0};const qt=Bp(at,B,T,A,H),Pt={...jt,handle:jt.handle};k(ft,Pt,qt,"onResizeStop")},[k,at,B,T,A,H]);y.useEffect(()=>{var Pt,Wt;if(!_)return;const ft=de.current;if(!ft)return;const jt=Ke.current||{left:0,top:0},qt=Re&&(_.left!==jt.left||_.top!==jt.top);if(Re){if(qt){const Me=_.left-ke.current.left,gt=_.top-ke.current.top,Jt={node:ft,deltaX:Me,deltaY:gt,lastX:ke.current.left,lastY:ke.current.top,x:_.left,y:_.top};(Wt=bt.current)==null||Wt.call(bt,_.e,Jt)}}else{const Me={node:ft,deltaX:_.left,deltaY:_.top,lastX:0,lastY:0,x:_.left,y:_.top};(Pt=We.current)==null||Pt.call(We,_.e,Me)}Ke.current=_},[_,Re,se]);const xe=Bp(at,B,T,A,H,Re?ke.current:null,ve?Ee.current:null),Ae=Un.Children.only(t),wt=Bp(at,0,0,1,1),Mt=[wt.width,wt.height],nt=[1/0,1/0],pt=Ae.props,Bt=pt.className,gr=pt.style;let Lr=Un.cloneElement(Ae,{ref:de,className:kg("react-grid-item",Bt,N,{static:b,resizing:ve,"react-draggable":m,"react-draggable-dragging":Re,dropping:!!_,cssTransforms:w}),style:{...c,...gr,...kn(xe)}});const wr=te;return Lr=f.jsx(uie.Resizable,{draggableOpts:{disabled:!p},className:p?void 0:"react-resizable-hide",width:xe.width,height:xe.height,minConstraints:Mt,maxConstraints:nt,onResizeStart:z,onResize:J,onResizeStop:le,transformScale:M,resizeHandles:Ce,handle:wr,children:Lr}),Lr=f.jsx(oie.DraggableCore,{disabled:!m,onStart:_t,onDrag:kt,onStop:$,handle:j,cancel:".react-resizable-handle"+(D?","+D:""),scale:M,nodeRef:de,children:Lr}),Lr}var Wl=()=>{},c8="react-grid-layout",qO=!1;try{qO=/firefox/i.test(navigator.userAgent)}catch{}function _ie(e,t){const n=Un.Children.toArray(e),r=Un.Children.toArray(t);if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++){const a=n[s],l=r[s];if((a==null?void 0:a.key)!==(l==null?void 0:l.key))return!1}return!0}function u8(e,t,n,r){const s=[],a=new Set;Un.Children.forEach(t,h=>{if(!Un.isValidElement(h)||h.key===null)return;const m=String(h.key);a.add(m);const p=e.find(x=>x.i===m);if(p)s.push(mf(p));else{const b=h.props["data-grid"];b?s.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}):s.push({i:m,x:0,y:TS(s),w:1,h:1})}});const l=Nre(s,{cols:n});return r.compact(l,n)}function Mie(e){const{children:t,width:n,gridConfig:r,dragConfig:s,resizeConfig:a,dropConfig:l,positionStrategy:h=Vre,compactor:m,constraints:p=Gx,layout:x=[],droppingItem:b,autoSize:w=!0,className:E="",style:M={},innerRef:C,onLayoutChange:S=Wl,onDragStart:_=Wl,onDrag:N=Wl,onDragStop:c=Wl,onResizeStart:j=Wl,onResize:D=Wl,onResizeStop:B=Wl,onDrop:T=Wl,onDropDragOver:A=Wl}=e,H=y.useMemo(()=>({...qre,...r}),[r]),F=y.useMemo(()=>({...Wre,...s}),[s]),V=y.useMemo(()=>({...Gre,...a}),[a]),ee=y.useMemo(()=>({...Yre,...l}),[l]),{cols:G,rowHeight:se,maxRows:Ce,margin:te,containerPadding:K}=H,{enabled:Z,bounded:oe,handle:Y,cancel:ne,threshold:X}=F,{enabled:ue,handles:pe,handleComponent:Se}=V,{enabled:Re,defaultItem:ye,onDragOver:ve}=ee,he=m??OO("vertical"),de=he.type,ke=he.allowOverlap,Ee=he.preventCollision??!1,Ke=y.useMemo(()=>b??{i:"__dropping-elem__",...ye},[b,ye]),ae=h.type==="transform",We=h.scale,bt=K??te,[tt,mt]=y.useState(!1),[Xe,at]=y.useState(()=>u8(x,t,G,he)),[ot,Ct]=y.useState(null),[Ot,kn]=y.useState(!1),[_t,kt]=y.useState(null),[$,k]=y.useState(),z=y.useRef(null),J=y.useRef(null),le=y.useRef(null),xe=y.useRef(0),Ae=y.useRef(Xe),wt=y.useRef(x),Mt=y.useRef(t),nt=y.useRef(de),pt=y.useRef(Xe);pt.current=Xe,y.useEffect(()=>{mt(!0),em(Xe,x)||S(Xe)},[]),y.useEffect(()=>{if(ot||_t)return;const rt=!em(x,wt.current),Tt=!_ie(t,Mt.current),ce=de!==nt.current;if(rt||Tt||ce){const ze=u8(rt?x:Xe,t,G,he);em(ze,Xe)||at(ze)}wt.current=x,Mt.current=t,nt.current=de},[x,t,G,de,he,ot,_t,Xe]),y.useEffect(()=>{if(!ot&&!em(Xe,Ae.current)){Ae.current=Xe;const rt=Xe.filter(Tt=>Tt.i!==Ke.i);S(rt)}},[Xe,ot,S,Ke.i]);const Bt=y.useMemo(()=>{if(!w)return;const rt=TS(Xe),Tt=bt[1];return rt*se+(rt-1)*te[1]+Tt*2+"px"},[w,Xe,se,te,bt]),gr=y.useCallback((rt,Tt,ce,Ue)=>{const ze=pt.current,$e=Pd(ze,rt);if(!$e)return;const ht={w:$e.w,h:$e.h,x:$e.x,y:$e.y,i:rt};z.current=mf($e),le.current=ze,Ct(ht),_(ze,$e,$e,null,Ue.e,Ue.node)},[_]),Lr=y.useCallback((rt,Tt,ce,Ue)=>{const ze=pt.current,$e=z.current,ht=Pd(ze,rt);if(!ht)return;const vt={w:ht.w,h:ht.h,x:ht.x,y:ht.y,i:rt},Nt=Ud(ze,ht,Tt,ce,!0,Ee,de,G,ke);N(Nt,$e,ht,vt,Ue.e,Ue.node),at(he.compact(Nt,G)),Ct(vt)},[Ee,de,G,ke,he,N]),wr=y.useCallback((rt,Tt,ce,Ue)=>{if(!ot)return;const ze=pt.current,$e=z.current,ht=Pd(ze,rt);if(!ht)return;const vt=Ud(ze,ht,Tt,ce,!0,Ee,de,G,ke),Nt=he.compact(vt,G);c(Nt,$e,ht,null,Ue.e,Ue.node);const ln=le.current;z.current=null,le.current=null,Ct(null),at(Nt),ln&&!em(ln,Nt)&&S(Nt)},[ot,Ee,de,G,ke,he,c,S]),ft=y.useCallback((rt,Tt,ce,Ue)=>{const ze=pt.current,$e=Pd(ze,rt);$e&&(J.current=mf($e),le.current=ze,kn(!0),j(ze,$e,$e,null,Ue.e,Ue.node))},[j]),jt=y.useCallback((rt,Tt,ce,Ue)=>{const ze=pt.current,$e=J.current,{handle:ht}=Ue;let vt=!1,Nt,ln;const[En,Gr]=Mre(ze,rt,_n=>(Nt=_n.x,ln=_n.y,["sw","w","nw","n","ne"].includes(ht)&&(["sw","nw","w"].includes(ht)&&(Nt=_n.x+(_n.w-Tt),Tt=_n.x!==Nt&&Nt<0?_n.w:Tt,Nt=Nt<0?0:Nt),["ne","n","nw"].includes(ht)&&(ln=_n.y+(_n.h-ce),ce=_n.y!==ln&&ln<0?_n.h:ce,ln=ln<0?0:ln),vt=!0),Ee&&!ke&&wO(ze,{..._n,w:Tt,h:ce,x:Nt??_n.x,y:ln??_n.y}).filter(Bs=>Bs.i!==_n.i).length>0&&(ln=_n.y,ce=_n.h,Nt=_n.x,Tt=_n.w,vt=!1),_n.w=Tt,_n.h=ce,_n));if(!Gr)return;let ni=En;vt&&Nt!==void 0&&ln!==void 0&&(ni=Ud(En,Gr,Nt,ln,!0,Ee,de,G,ke));const Sr={w:Gr.w,h:Gr.h,x:Gr.x,y:Gr.y,i:rt,static:!0};D(ni,$e,Gr,Sr,Ue.e,Ue.node),at(he.compact(ni,G)),Ct(Sr)},[Ee,de,G,ke,he,D]),qt=y.useCallback((rt,Tt,ce,Ue)=>{const ze=pt.current,$e=J.current,ht=Pd(ze,rt),vt=he.compact(ze,G);B(vt,$e,ht??null,null,Ue.e,Ue.node);const Nt=le.current;J.current=null,le.current=null,Ct(null),kn(!1),at(vt),Nt&&!em(Nt,vt)&&S(vt)},[G,he,B,S]),Pt=y.useCallback(()=>{const rt=pt.current;if(!rt.some(Ue=>Ue.i===Ke.i)){kt(null),Ct(null),k(void 0);return}const ce=he.compact(rt.filter(Ue=>Ue.i!==Ke.i),G);at(ce),kt(null),Ct(null),k(void 0)},[Ke.i,G,he]),Wt=y.useCallback(rt=>{var gl;if(rt.preventDefault(),rt.stopPropagation(),qO&&!((gl=rt.nativeEvent.target)!=null&&gl.classList.contains(c8)))return!1;const Tt=ve?ve(rt.nativeEvent):A(rt);if(Tt===!1)return _t&&Pt(),!1;const{dragOffsetX:ce=0,dragOffsetY:Ue=0,...ze}=Tt??{},$e={...Ke,...ze},ht=rt.currentTarget.getBoundingClientRect(),vt={cols:G,margin:te,maxRows:Ce,rowHeight:se,containerWidth:n,containerPadding:bt},Nt=Zm(vt),ln=Dm($e.w,Nt,te[0]),En=Dm($e.h,se,te[1]),Gr=ln/2,ni=En/2,Sr=rt.clientX-ht.left+ce-Gr,_n=rt.clientY-ht.top+Ue-ni,zs=Math.max(0,Sr),Bs=Math.max(0,_n),fs={left:zs/We,top:Bs/We,e:rt.nativeEvent};if(_t)$&&($.left!==fs.left||$.top!==fs.top)&&k(fs);else{const Us=Cre(vt,Bs,zs,$e.w,$e.h);kt(f.jsx("div",{},$e.i)),k(fs),at([...pt.current,{...$e,x:Us.x,y:Us.y,static:!1,isDraggable:!0}])}},[_t,$,Ke,ve,A,Pt,We,G,te,Ce,se,n,bt]),Me=y.useCallback(rt=>{rt.preventDefault(),rt.stopPropagation(),xe.current--,xe.current<0&&(xe.current=0),xe.current===0&&Pt()},[Pt]),gt=y.useCallback(rt=>{rt.preventDefault(),rt.stopPropagation(),xe.current++},[]),Jt=y.useCallback(rt=>{rt.preventDefault(),rt.stopPropagation();const Tt=pt.current,ce=Tt.find(Ue=>Ue.i===Ke.i);xe.current=0,Pt(),T(Tt,ce,rt.nativeEvent)},[Ke.i,Pt,T]),St=y.useCallback((rt,Tt)=>{if(!rt||!rt.key)return null;const ce=Pd(Xe,String(rt.key));if(!ce)return null;const Ue=typeof ce.isDraggable=="boolean"?ce.isDraggable:!ce.static&&Z,ze=typeof ce.isResizable=="boolean"?ce.isResizable:!ce.static&&ue,$e=ce.resizeHandles||[...pe],ht=Ue&&oe&&ce.isBounded!==!1,vt=Se;return f.jsx(l8,{containerWidth:n,cols:G,margin:te,containerPadding:bt,maxRows:Ce,rowHeight:se,cancel:ne,handle:Y,onDragStart:gr,onDrag:Lr,onDragStop:wr,onResizeStart:ft,onResize:jt,onResizeStop:qt,isDraggable:Ue,isResizable:ze,isBounded:ht,useCSSTransforms:ae&&tt,usePercentages:!tt,transformScale:We,positionStrategy:h,dragThreshold:X,w:ce.w,h:ce.h,x:ce.x,y:ce.y,i:ce.i,minH:ce.minH,minW:ce.minW,maxH:ce.maxH,maxW:ce.maxW,static:ce.static,droppingPosition:Tt?$:void 0,resizeHandles:$e,resizeHandle:vt,constraints:p,layoutItem:ce,layout:Xe,children:rt},ce.i)},[Xe,n,G,te,bt,Ce,se,ne,Y,gr,Lr,wr,ft,jt,qt,Z,ue,oe,ae,tt,We,h,X,$,pe,Se,p]),dt=()=>ot?f.jsx(l8,{w:ot.w,h:ot.h,x:ot.x,y:ot.y,i:ot.i,className:`react-grid-placeholder ${Ot?"placeholder-resizing":""}`,containerWidth:n,cols:G,margin:te,containerPadding:bt,maxRows:Ce,rowHeight:se,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:ae,transformScale:We,constraints:p,layout:Xe,children:f.jsx("div",{})}):null,en=kg(c8,E),bn={height:Bt,...M};return f.jsxs("div",{ref:C,className:en,style:bn,onDrop:Re?Jt:void 0,onDragLeave:Re?Me:void 0,onDragEnter:Re?gt:void 0,onDragOver:Re?Wt:void 0,children:[Un.Children.map(t,rt=>Un.isValidElement(rt)?St(rt):null),Re&&_t&&St(_t,!0),dt()]})}function WO(e){const{children:t,width:n,cols:r=12,rowHeight:s=150,maxRows:a=1/0,margin:l=[10,10],containerPadding:h=null,layout:m,droppingItem:p,compactType:x,preventCollision:b=!1,allowOverlap:w=!1,verticalCompact:E,isDraggable:M=!0,isBounded:C=!1,draggableHandle:S,draggableCancel:_,isResizable:N=!0,resizeHandles:c=["se"],resizeHandle:j,isDroppable:D=!1,useCSSTransforms:B=!0,transformScale:T=1,autoSize:A,className:H,style:F,innerRef:V,onLayoutChange:ee,onDragStart:G,onDrag:se,onDragStop:Ce,onResizeStart:te,onResize:K,onResizeStop:Z,onDrop:oe,onDropDragOver:Y}=e;let ne=x===void 0?"vertical":x;E===!1&&(ne=null);const X={cols:r,rowHeight:s,maxRows:a,margin:l,containerPadding:h},ue={enabled:M,bounded:C,handle:S,cancel:_,threshold:0},pe={enabled:N,handles:c,handleComponent:j},Se={enabled:D};let Re;B?T!==1?Re=$re(T):Re=RO:Re=Ire;const ye=OO(ne,w,b),ve=C?[...Gx,Dre]:Gx;return f.jsx(Mie,{width:n,gridConfig:X,dragConfig:ue,resizeConfig:pe,dropConfig:Se,positionStrategy:Re,compactor:ye,constraints:ve,layout:m,droppingItem:p,autoSize:A,className:H,style:F,innerRef:V,onLayoutChange:ee,onDragStart:G,onDrag:se,onDragStop:Ce,onResizeStart:te,onResize:K,onResizeStop:Z,onDrop:oe,onDropDragOver:Y,children:t})}WO.displayName="ReactGridLayout";var GO=WO,Nie="react-grid-layout";function YO(e){function t(n){const{measureBeforeMount:r=!1,className:s,style:a,...l}=n,[h,m]=y.useState(1280),[p,x]=y.useState(!1),b=y.useRef(null),w=y.useRef(null);return y.useEffect(()=>{x(!0)},[]),y.useEffect(()=>{const E=b.current;if(!(E instanceof HTMLElement))return;const M=new ResizeObserver(C=>{if(C[0]){const S=C[0].contentRect.width;m(S)}});return M.observe(E),w.current=M,()=>{M.unobserve(E),M.disconnect()}},[p]),r&&!p?f.jsx("div",{className:kg(s,Nie),style:a,ref:b}):f.jsx(e,{innerRef:b,className:s,style:a,...l,width:h})}return t.displayName=`WidthProvider(${e.displayName||e.name||"Component"})`,t}const d8=YO(GO),f8=12,h8=30,m8=[0,0],p8=[0,0],Oie=[{value:"auto",label:"Auto"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}];function Tie(e){switch(e){case"auto":return"Default";case"high":return"local-recorder";case"medium":return"medium-resolution";case"low":return"low-resolution";default:return"Default"}}function Die(){const{id:e}=Zx(),t=ma(),n=Te(ae=>ae.grids),r=Te(ae=>ae.setActiveGridId),s=Te(ae=>ae.configs),a=Te(ae=>ae.playOnOpen);Te(ae=>ae.setPlayOnOpen);const l=Te(ae=>ae.audioOnOpen);Te(ae=>ae.setAudioOnOpen);const h=Te(ae=>ae.lastCamerasSnapshots),m=Te(ae=>ae.streamQualityGrid),p=Te(ae=>ae.setStreamQualityGrid),x=Te(ae=>ae.showObjectDetectionOverlay),b=Te(ae=>ae.setShowObjectDetectionOverlay),w=KM(),[E,M]=y.useState(!1),[C,S]=y.useState(0),[_,N]=y.useState(0),[c,j]=y.useState(0),[D,B]=y.useState(0),[T,A]=y.useState({}),[H,F]=y.useState({}),[V,ee]=y.useState(!1),[G,se]=y.useState(!1),Ce=y.useRef(null),te=ml(),K=V||G,Z=y.useCallback(()=>ee(ae=>!ae),[]),oe=y.useCallback(()=>{G||ee(!1)},[G]),Y=e?n[e]:void 0,ne=(Y==null?void 0:Y.layoutMode)??"manual",X=y.useMemo(()=>((Y==null?void 0:Y.items)??[]).map(ae=>({i:ae.i,x:ae.x,y:ae.y,w:ae.w,h:ae.h})),[Y==null?void 0:Y.items]),ue=X.length>0&&X.some(ae=>T[ae.i]===!1),pe=X.some(ae=>H[ae.i]===!0),Se=y.useMemo(()=>Tie(m),[m]);y.useEffect(()=>{if(!Ce.current)return;const We=()=>M(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",We),()=>document.removeEventListener("fullscreenchange",We)},[]);const Re=y.useCallback(()=>{var ae,We;(We=(ae=Ce.current)==null?void 0:ae.requestFullscreen)==null||We.call(ae)},[]),ye=y.useCallback(()=>{document.fullscreenElement&&document.exitFullscreen()},[]),ve=(s==null?void 0:s.cameras)??[],he=y.useMemo(()=>Object.fromEntries(ve.map(ae=>[ae.id,ae])),[ve]),[de,ke]=y.useState(null),Ee=y.useRef(null);if(y.useEffect(()=>{if(ne!=="auto"||X.length===0)return;const ae=Ee.current;if(!ae)return;const We=X.length,bt=()=>{const mt=ae.clientWidth,Xe=ae.clientHeight;if(mt<=0||Xe<=0)return;let at={cols:1,rows:We,cellW:0,cellH:0,area:0};for(let ot=1;ot<=We;ot++){const Ct=Math.ceil(We/ot),Ot=Math.min(mt/ot,Xe/Ct*(16/9)),kn=Ot*(9/16),_t=Ot*kn;_t>at.area&&(at={cols:ot,rows:Ct,cellW:Ot,cellH:kn,area:_t})}ke({cols:at.cols,rows:at.rows,cellW:Math.floor(at.cellW),cellH:Math.floor(at.cellH)})},tt=new ResizeObserver(bt);return tt.observe(ae),bt(),()=>tt.disconnect()},[ne,X.length]),y.useEffect(()=>{e&&r(e)},[e,r]),y.useEffect(()=>{A({}),F({})},[e]),y.useEffect(()=>{if(!e||X.length===0||!a)return;const ae=setTimeout(()=>S(We=>We+1),400);return()=>clearTimeout(ae)},[e,X.length,a]),!Y)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-4",children:[f.jsx("p",{className:"text-muted-foreground",children:"Grid not found."}),f.jsxs(Qe,{variant:"outline",onClick:()=>t("/grids"),children:[f.jsx(sa,{className:"size-4"}),"Back to grids"]})]});if(X.length===0)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col p-4",children:[f.jsxs("header",{className:"mb-4 flex items-center gap-2",children:[f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>t("/grids"),children:f.jsx(sa,{className:"size-4"})}),f.jsx("h1",{className:"text-lg font-semibold",children:Y.name})]}),f.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed bg-muted/30 text-muted-foreground",children:"No cameras in this grid. Edit the grid to add some."})]});const Ke=f.jsxs(Ax,{open:G,onOpenChange:se,children:[f.jsx(jx,{asChild:!0,children:f.jsxs(Qe,{variant:te?"ghost":"outline",size:"sm",className:te?"h-8 gap-1.5 shrink-0 text-white hover:bg-white/20":"h-8 gap-1.5 shrink-0 md:border md:bg-background/95 md:backdrop-blur","aria-label":"Stream and options",children:[f.jsx(ag,{className:"size-4"}),!te&&f.jsxs(f.Fragment,{children:[f.jsx("span",{children:"Options"}),f.jsx(wo,{className:"size-4 opacity-50"})]})]})}),f.jsxs(kx,{align:"end",className:"w-56 z-[70]",children:[f.jsx(zx,{children:"Stream resolution"}),f.jsx(Px,{value:m,onValueChange:ae=>p(ae),children:Oie.map(ae=>f.jsx(hm,{value:ae.value,children:ae.label},ae.value))}),f.jsx(UM,{}),f.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 text-sm cursor-pointer",children:[f.jsx("input",{type:"checkbox",checked:x,onChange:ae=>b(ae.target.checked),className:"h-4 w-4 rounded border border-input accent-primary"}),f.jsx("span",{children:"Detection live"})]})]})]});return f.jsx("div",{ref:Ce,className:"flex min-h-0 flex-1 flex-col overflow-hidden bg-black [&:fullscreen]:h-screen [&:fullscreen]:w-screen [&:fullscreen]:min-h-0",children:te?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"relative min-h-0 flex-1 overflow-auto p-0",onClick:Z,onMouseLeave:oe,children:f.jsx("div",{className:"min-h-0 h-full w-full",children:ne==="auto"?f.jsx("div",{ref:Ee,className:"grid h-full w-full gap-0 place-content-center",style:de?{gridTemplateColumns:`repeat(${de.cols}, ${de.cellW}px)`,gridTemplateRows:`repeat(${de.rows}, ${de.cellH}px)`}:{gridTemplateColumns:`repeat(${Math.max(1,Math.ceil(Math.sqrt(X.length)))}, minmax(0, 1fr))`,gridAutoRows:"minmax(0, auto)"},children:X.map(ae=>{const We=he[ae.i],bt=void 0,tt=(h==null?void 0:h[ae.i])??null;return f.jsx("div",{className:"min-h-0 overflow-hidden bg-black",style:de?{width:de.cellW,height:de.cellH}:{aspectRatio:"16/9",width:"100%"},children:We?f.jsx(Zp,{camera:We,deviceState:bt,destination:Se,muted:!l,microphone:!1,playOnOpen:a,showObjectDetection:x,loadingSnapshotUrl:tt,onSnapshotNeeded:()=>w(ae.i),playAllTrigger:C,pauseAllTrigger:_,onPlayingChange:mt=>A(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),onMutedChange:mt=>F(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),muteAllTrigger:c,unmuteAllTrigger:D}):f.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center bg-muted text-muted-foreground text-sm",children:"Camera unavailable"})},ae.i)})}):f.jsx(d8,{layout:X,cols:f8,rowHeight:h8,margin:m8,containerPadding:p8,isDraggable:!1,isResizable:!1,compactType:"vertical",className:"grid-view-layout",children:X.map(ae=>{const We=he[ae.i],bt=void 0,tt=(h==null?void 0:h[ae.i])??null;return f.jsx("div",{className:He("overflow-hidden bg-black"),children:We?f.jsx(Zp,{camera:We,deviceState:bt,destination:Se,muted:!l,microphone:!1,playOnOpen:a,showObjectDetection:x,loadingSnapshotUrl:tt,onSnapshotNeeded:()=>w(ae.i),playAllTrigger:C,pauseAllTrigger:_,onPlayingChange:mt=>A(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),onMutedChange:mt=>F(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),muteAllTrigger:c,unmuteAllTrigger:D}):f.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center bg-muted text-muted-foreground text-sm",children:"Camera unavailable"})},ae.i)})})})}),f.jsxs("div",{className:He("absolute top-0 left-0 right-0 flex items-center justify-between gap-2 p-2 bg-gradient-to-b from-black/60 to-transparent z-10 transition-opacity duration-200",K?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onMouseLeave:oe,children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-white hover:bg-white/20",onClick:()=>t("/grids"),"aria-label":"Back to grids",children:f.jsx(sa,{className:"size-5"})}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-white hover:bg-white/20",onClick:()=>ue?S(ae=>ae+1):N(ae=>ae+1),"aria-label":ue?"Play all cameras":"Pause all cameras",children:ue?f.jsx(tf,{className:"size-5"}):f.jsx(og,{className:"size-5"})}),f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-white hover:bg-white/20",onClick:()=>pe?B(ae=>ae+1):j(ae=>ae+1),"aria-label":pe?"Unmute all":"Mute all",children:pe?f.jsx(fx,{className:"size-5"}):f.jsx(Xd,{className:"size-5"})}),f.jsx("div",{className:"[&_button]:text-white [&_button]:hover:bg-white/20 [&_button]:border-white/20",children:Ke})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsx("header",{className:"flex shrink-0 flex-col gap-0 border-b border-white/10 bg-background/95 backdrop-blur md:flex-row md:items-center md:gap-2 px-2 py-2 md:px-4 md:py-2",children:f.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>t("/grids"),title:"Back to grids",children:f.jsx(sa,{className:"size-4"})}),f.jsx("h1",{className:"truncate text-lg font-semibold flex-1 min-w-0",children:Y.name}),f.jsx(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 shrink-0",onClick:()=>ue?S(ae=>ae+1):N(ae=>ae+1),title:ue?"Play all cameras":"Pause all cameras",children:ue?f.jsxs(f.Fragment,{children:[f.jsx(tf,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Play all"})]}):f.jsxs(f.Fragment,{children:[f.jsx(og,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Pause all"})]})}),f.jsx(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 shrink-0",onClick:()=>pe?B(ae=>ae+1):j(ae=>ae+1),title:pe?"Unmute all":"Mute all",children:pe?f.jsxs(f.Fragment,{children:[f.jsx(fx,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Unmute all"})]}):f.jsxs(f.Fragment,{children:[f.jsx(Xd,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Mute all"})]})}),E?f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 shrink-0",onClick:ye,title:"Exit full screen",children:[f.jsx(Xj,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Exit full screen"})]}):f.jsxs(Qe,{variant:"outline",size:"sm",className:"h-8 gap-1.5 shrink-0",onClick:Re,title:"Full screen",children:[f.jsx($j,{className:"size-4"}),f.jsx("span",{className:"hidden md:inline",children:"Full screen"})]}),Ke]})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-auto p-0",children:ne==="auto"?f.jsx("div",{ref:Ee,className:"grid h-full w-full gap-0 place-content-center",style:de?{gridTemplateColumns:`repeat(${de.cols}, ${de.cellW}px)`,gridTemplateRows:`repeat(${de.rows}, ${de.cellH}px)`}:{gridTemplateColumns:`repeat(${Math.max(1,Math.ceil(Math.sqrt(X.length)))}, minmax(0, 1fr))`,gridAutoRows:"minmax(0, auto)"},children:X.map(ae=>{const We=he[ae.i],bt=void 0,tt=(h==null?void 0:h[ae.i])??null;return f.jsx("div",{className:"min-h-0 overflow-hidden bg-black",style:de?{width:de.cellW,height:de.cellH}:{aspectRatio:"16/9",width:"100%"},children:We?f.jsx(Zp,{camera:We,deviceState:bt,destination:Se,muted:!l,microphone:!1,playOnOpen:a,showObjectDetection:x,loadingSnapshotUrl:tt,onSnapshotNeeded:()=>w(ae.i),playAllTrigger:C,pauseAllTrigger:_,onPlayingChange:mt=>A(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),onMutedChange:mt=>F(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),muteAllTrigger:c,unmuteAllTrigger:D}):f.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center bg-muted text-muted-foreground text-sm",children:"Camera unavailable"})},ae.i)})}):f.jsx(d8,{layout:X,cols:f8,rowHeight:h8,margin:m8,containerPadding:p8,isDraggable:!1,isResizable:!1,compactType:"vertical",className:"grid-view-layout",children:X.map(ae=>{const We=he[ae.i],bt=void 0,tt=(h==null?void 0:h[ae.i])??null;return f.jsx("div",{className:He("overflow-hidden bg-black"),children:We?f.jsx(Zp,{camera:We,deviceState:bt,destination:Se,muted:!l,microphone:!1,playOnOpen:a,showObjectDetection:x,loadingSnapshotUrl:tt,onSnapshotNeeded:()=>w(ae.i),playAllTrigger:C,pauseAllTrigger:_,onPlayingChange:mt=>A(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),onMutedChange:mt=>F(Xe=>Xe[ae.i]===mt?Xe:{...Xe,[ae.i]:mt}),muteAllTrigger:c,unmuteAllTrigger:D}):f.jsx("div",{className:"flex h-full min-h-[80px] items-center justify-center bg-muted text-muted-foreground text-sm",children:"Camera unavailable"})},ae.i)})})})]})})}const Aie=[{id:"2x2",name:"2×2",slots:[{x:0,y:0,w:6,h:3},{x:6,y:0,w:6,h:3},{x:0,y:3,w:6,h:3},{x:6,y:3,w:6,h:3}]},{id:"3+1",name:"3 + 1",slots:[{x:0,y:0,w:4,h:3},{x:4,y:0,w:4,h:3},{x:8,y:0,w:4,h:3},{x:0,y:3,w:12,h:4}]},{id:"1+3",name:"1 + 3",slots:[{x:0,y:0,w:6,h:6},{x:6,y:0,w:6,h:2},{x:6,y:2,w:6,h:2},{x:6,y:4,w:6,h:2}]},{id:"4-row",name:"4 in row",slots:[{x:0,y:0,w:3,h:3},{x:3,y:0,w:3,h:3},{x:6,y:0,w:3,h:3},{x:9,y:0,w:3,h:3}]},{id:"1-big-3-small",name:"1 big + 3 small",slots:[{x:0,y:0,w:8,h:6},{x:8,y:0,w:4,h:2},{x:8,y:2,w:4,h:2},{x:8,y:4,w:4,h:2}]}];function jie(e,t){if(t<=0)return[];if(t<=e.slots.length)return e.slots.slice(0,t);const n=[...e.slots],r=e.slots[0],s=e.slots[e.slots.length-1],a=r.w,l=r.h,h=Math.round(12/a);let m=Math.floor((s.y+s.h)/l);for(let p=e.slots.length;p<t;p++){const x=p%h;n.push({x:x*(12/h),y:m*l,w:12/h,h:l}),x===h-1&&m++}return n}function kie(e){if(e<=0)return[];const t=Math.max(1,Math.ceil(Math.sqrt(e))),n=12/t,r=Math.max(2,Math.round(15/t)),s=[];for(let a=0;a<e;a++){const l=a%t,h=Math.floor(a/t);s.push({x:l*n,y:h*r,w:Math.round(n*100)/100,h:r})}return s}const Pie=YO(GO),zie=12,Bie=30,Uie=[8,8],Fie=6,Hie=4;function Iie(e){return e.length===0?{x:0,y:0}:{x:0,y:Math.max(...e.map(n=>n.y+n.h))}}function $ie(){const{id:e}=Zx(),t=ma(),n=Te(D=>D.grids),r=Te(D=>D.updateGrid),s=Te(D=>D.configs),a=Te(D=>D.lastCamerasSnapshots),l=e?n[e]:void 0,h=(s==null?void 0:s.cameras)??[],m=y.useMemo(()=>new Set(((l==null?void 0:l.items)??[]).map(D=>D.i)),[l==null?void 0:l.items]),p=y.useMemo(()=>h.filter(D=>!m.has(D.id)),[h,m]),x=y.useMemo(()=>((l==null?void 0:l.items)??[]).map(D=>({i:D.i,x:D.x,y:D.y,w:D.w,h:D.h,minW:1,minH:1})),[l==null?void 0:l.items]),b=y.useCallback(D=>{if(!e||!l)return;const B=D.map(T=>({i:T.i,x:T.x,y:T.y,w:T.w,h:T.h}));r(e,{items:B})},[e,l,r]),w=y.useCallback(D=>{if(!e||!l)return;const{x:B,y:T}=Iie(l.items),A={i:D,x:B,y:T,w:Fie,h:Hie};r(e,{items:[...l.items,A]})},[e,l,r]),E=y.useCallback(D=>{!e||!l||r(e,{items:l.items.filter(B=>B.i!==D)})},[e,l,r]),M=y.useCallback(D=>{e&&r(e,{name:D.target.value})},[e,r]),C=y.useCallback(D=>{if(!e||!l)return;const B=l.items.map(H=>H.i);if(B.length===0)return;const A=jie(D,B.length).map((H,F)=>({i:B[F],x:H.x,y:H.y,w:H.w,h:H.h}));r(e,{items:A})},[e,l,r]),S=y.useCallback(()=>{if(!e||!l)return;const D=l.items.map(A=>A.i);if(D.length===0)return;const T=kie(D.length).map((A,H)=>({i:D[H],x:A.x,y:A.y,w:A.w,h:A.h}));r(e,{items:T})},[e,l,r]);if(!e||!l)return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-4",children:[f.jsx("p",{className:"text-muted-foreground",children:"Grid not found."}),f.jsxs(Qe,{variant:"outline",onClick:()=>t("/grids"),children:[f.jsx(sa,{className:"size-4"}),"Back to grids"]})]});const _=y.useMemo(()=>Object.fromEntries(h.map(D=>[D.id,D])),[h]),[N,c]=y.useState(""),j=y.useCallback(D=>{D&&D!=="_none"&&w(D),c("")},[w]);return f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2 md:p-4",children:[f.jsxs("header",{className:"mb-4 flex shrink-0 flex-wrap items-center gap-2",children:[f.jsx(Qe,{variant:"ghost",size:"icon",onClick:()=>t("/grids"),title:"Back to grids",children:f.jsx(sa,{className:"size-4"})}),f.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Tr,{htmlFor:"grid-name",className:"sr-only",children:"Grid name"}),f.jsx(Li,{id:"grid-name",value:l.name,onChange:M,placeholder:"Grid name",className:"max-w-[200px]"})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Tr,{htmlFor:"live-layout",className:"text-sm text-muted-foreground",children:"Live layout"}),f.jsxs(Eo,{value:l.layoutMode??"manual",onValueChange:D=>r(e,{layoutMode:D}),children:[f.jsx(_o,{id:"live-layout",className:"w-[140px]",children:f.jsx(Ro,{})}),f.jsxs(Mo,{children:[f.jsx(Vi,{value:"manual",children:"Manual (saved)"}),f.jsx(Vi,{value:"auto",children:"Auto (fill space)"})]})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Tr,{htmlFor:"add-camera",className:"text-sm text-muted-foreground",children:"Add camera"}),f.jsxs(Eo,{value:N,onValueChange:D=>j(D),children:[f.jsx(_o,{id:"add-camera",className:"w-[180px]",children:f.jsx(Ro,{placeholder:"Select..."})}),f.jsx(Mo,{children:p.length===0?f.jsx(Vi,{value:"_none",disabled:!0,children:"All cameras already in grid"}):p.map(D=>f.jsx(Vi,{value:D.id,children:D.name},D.id))})]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:"text-sm text-muted-foreground",children:"Quick presets"}),f.jsxs("div",{className:"flex flex-wrap gap-1",children:[f.jsx(Qe,{variant:"outline",size:"sm",className:"h-8",onClick:S,disabled:x.length===0,title:"Apply Auto layout (16:9 cells) to current cameras",children:"Auto"}),Aie.map(D=>f.jsx(Qe,{variant:"outline",size:"sm",className:"h-8",onClick:()=>C(D),disabled:x.length===0,title:`Apply ${D.name} layout to current cameras`,children:D.name},D.id))]})]})]})]}),x.length===0?f.jsx("div",{className:"flex flex-1 items-center justify-center rounded-lg border border-dashed bg-muted/30 text-muted-foreground",children:"Add at least one camera from the menu above. Then drag and resize cells in the grid."}):f.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:f.jsx(Pie,{layout:x,cols:zie,rowHeight:Bie,margin:Uie,isDraggable:!0,isResizable:!0,compactType:"vertical",onLayoutChange:b,draggableHandle:".grid-drag-handle",className:"grid-editor-layout",children:x.map(D=>{const B=_[D.i],T=(B==null?void 0:B.name)??D.i,A=(a==null?void 0:a[D.i])??null;return f.jsxs("div",{className:He("overflow-hidden rounded-lg border bg-card"),children:[f.jsxs("div",{className:"grid-drag-handle flex cursor-grab items-center justify-between gap-2 border-b bg-muted/50 px-2 py-1 active:cursor-grabbing",children:[f.jsx("span",{className:"truncate text-sm font-medium",children:T}),f.jsx(Qe,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>E(D.i),title:"Remove from grid",children:f.jsx(gf,{className:"size-4"})})]}),f.jsx("div",{className:"relative h-[calc(100%-32px)] min-h-[60px] bg-muted/20",children:A?f.jsx("img",{src:A,alt:"",className:"h-full w-full object-cover"}):f.jsx("div",{className:"flex h-full items-center justify-center text-xs text-muted-foreground",children:"No snapshot"})})]},D.i)})})})]})}const g8=[{value:"auto",label:"Auto"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],v8=[{id:"stream",label:"Stream & playback"},{id:"highlights",label:"Highlights"}];function iw(e){if(!e||typeof e!="string")return"#808080";const t=e.trim(),n=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t);if(n)return`#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`;const r=/^#([0-9a-fA-F]{6})$/.exec(t);if(r)return`#${r[1].toLowerCase()}`;const s=/^rgb\s*\(\s*(\d+)\s*[, ]\s*(\d+)\s*[, ]\s*(\d+)\s*\)$/.exec(t);if(s){const a=Math.max(0,Math.min(255,parseInt(s[1],10))),l=Math.max(0,Math.min(255,parseInt(s[2],10))),h=Math.max(0,Math.min(255,parseInt(s[3],10)));return"#"+[a,l,h].map(m=>m.toString(16).padStart(2,"0")).join("")}if(typeof document<"u"){const a=document.createElement("div");a.style.color=t,document.body.appendChild(a);const l=getComputedStyle(a).color;a.remove();const h=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/.exec(l);if(h){const m=parseInt(h[1],10),p=parseInt(h[2],10),x=parseInt(h[3],10);return"#"+[m,p,x].map(b=>b.toString(16).padStart(2,"0")).join("")}}return"#808080"}function qp({title:e,description:t,checked:n,onCheckedChange:r}){return f.jsxs("label",{className:He("flex items-center justify-between gap-4 rounded-lg border p-4 cursor-pointer transition-colors hover:bg-muted/50"),children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:e}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:t})]}),f.jsx("input",{type:"checkbox",checked:n,onChange:s=>r(s.target.checked),className:"h-4 w-4 rounded border-input"})]})}function Vie(){const[e,t]=y.useState("stream"),n=Te(G=>G.playOnOpen),r=Te(G=>G.setPlayOnOpen),s=Te(G=>G.audioOnOpen),a=Te(G=>G.setAudioOnOpen),l=Te(G=>G.streamWatchdogEnabled),h=Te(G=>G.setStreamWatchdogEnabled),m=Te(G=>G.reelAutoplayEnabled),p=Te(G=>G.setReelAutoplayEnabled),x=Te(G=>G.camerasReorderEnabled),b=Te(G=>G.setCamerasReorderEnabled),w=Te(G=>G.streamQualitySingle),E=Te(G=>G.setStreamQualitySingle),M=Te(G=>G.streamQualityGrid),C=Te(G=>G.setStreamQualityGrid);Te(G=>G.configs);const S=Te(G=>G.detectionOverlayMotionColor),_=Te(G=>G.setDetectionOverlayMotionColor),N=Te(G=>G.detectionOverlayObjectColor),c=Te(G=>G.setDetectionOverlayObjectColor),j=Te(G=>G.detectionOverlayAudioColor),D=Te(G=>G.setDetectionOverlayAudioColor),B=Te(G=>G.detectionOverlayMotionStrokeWidth),T=Te(G=>G.setDetectionOverlayMotionStrokeWidth),A=Te(G=>G.detectionOverlayObjectStrokeWidth),H=Te(G=>G.setDetectionOverlayObjectStrokeWidth),F=Te(G=>G.detectionOverlayAudioStrokeWidth),V=Te(G=>G.setDetectionOverlayAudioStrokeWidth),ee=ml();return f.jsxs("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:[f.jsx("header",{className:"shrink-0 border-b bg-background px-4 pt-4 md:px-6 md:pt-6",children:f.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[ee?f.jsxs(Eo,{value:e,onValueChange:G=>t(G),children:[f.jsx(_o,{className:"w-auto min-w-[180px] h-10",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:v8.map(G=>f.jsx(Vi,{value:G.id,children:G.label},G.id))})]}):f.jsx("div",{className:"flex border-b -mb-px",children:v8.map(G=>f.jsx(Qe,{variant:"ghost",size:"sm",className:He("rounded-none border-b-2 border-transparent px-4 -mb-px",e===G.id&&"border-primary text-foreground"),onClick:()=>t(G.id),children:G.label},G.id))}),f.jsx(eb,{to:"/settings/cameras",className:He("shrink-0 text-sm font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","inline-flex items-center py-2 px-3 -mb-px border-b-2 border-transparent",!ee&&"rounded-none"),children:"Camera settings"})]})}),f.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto overflow-x-hidden p-4 md:p-6",children:f.jsxs("div",{className:"flex flex-col gap-4 max-w-xl",children:[e==="stream"&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(qp,{title:"Auto-play",description:"Start stream automatically when opening camera view or grid view",checked:n,onCheckedChange:r}),f.jsx(qp,{title:"Start with audio",description:"Stream audio unmuted when opening camera view or grid view",checked:s,onCheckedChange:a}),f.jsx(qp,{title:"Stream watchdog",description:"Restart stream when no data is received (disable for battery cameras that wake from sleep)",checked:l,onCheckedChange:h}),f.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-4",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Stream quality (camera view)"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Resolution when viewing a single camera (full screen)."})]}),f.jsxs(Eo,{value:w,onValueChange:G=>E(G),children:[f.jsx(_o,{className:"w-full max-w-[180px]",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:g8.map(G=>f.jsx(Vi,{value:G.value,children:G.label},G.value))})]})]}),f.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-4",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Stream quality (grid view)"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Resolution when viewing multiple cameras in a grid."})]}),f.jsxs(Eo,{value:M,onValueChange:G=>C(G),children:[f.jsx(_o,{className:"w-full max-w-[180px]",children:f.jsx(Ro,{})}),f.jsx(Mo,{children:g8.map(G=>f.jsx(Vi,{value:G.value,children:G.label},G.value))})]})]}),f.jsx(qp,{title:"Allow reordering",description:"Allow drag-and-drop to reorder cameras in the cameras list",checked:x,onCheckedChange:b}),f.jsx(qp,{title:"Reel autoplay",description:"Auto-advance the events reel on the Cameras page",checked:m,onCheckedChange:p})]}),e==="highlights"&&f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:"Highlight (motion/audio glow) and detection overlay colors are configured per camera: open a camera, then use the Settings button next to the resolution dropdown to configure that camera."}),f.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border p-4",children:[f.jsxs("div",{children:[f.jsx("span",{className:"font-medium",children:"Detection overlay"}),f.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Color and border width per type (motion, object, audio). Color: picker or CSS (e.g. #ef4444). Border: 0.5–20, scales with resolution."})]}),f.jsxs("div",{className:"grid gap-6",children:[f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Tr,{htmlFor:"detection-overlay-motion",children:"Motion"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{id:"detection-overlay-motion",type:"color",value:iw(S),onChange:G=>_(G.target.value),className:"h-10 w-14 shrink-0 cursor-pointer rounded border border-input bg-transparent p-0","aria-label":"Motion color picker"}),f.jsx(Li,{type:"text",value:S,onChange:G=>_(G.target.value),placeholder:"#ef4444",className:"font-mono flex-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 pl-0",children:[f.jsx(Tr,{htmlFor:"stroke-motion",className:"text-muted-foreground text-xs shrink-0 w-20",children:"Border"}),f.jsx("input",{id:"stroke-motion",type:"range",min:.5,max:20,step:.5,value:B,onChange:G=>T(parseFloat(G.target.value)),className:"flex-1 h-2 rounded-full accent-primary"}),f.jsx(Li,{type:"number",min:.5,max:20,step:.5,value:B,onChange:G=>{const se=parseFloat(G.target.value);Number.isNaN(se)||T(se)},className:"w-14 font-mono shrink-0 h-8"})]})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Tr,{htmlFor:"detection-overlay-object",children:"Object"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{id:"detection-overlay-object",type:"color",value:iw(N),onChange:G=>c(G.target.value),className:"h-10 w-14 shrink-0 cursor-pointer rounded border border-input bg-transparent p-0","aria-label":"Object color picker"}),f.jsx(Li,{type:"text",value:N,onChange:G=>c(G.target.value),placeholder:"rgb(59 130 246)",className:"font-mono flex-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 pl-0",children:[f.jsx(Tr,{htmlFor:"stroke-object",className:"text-muted-foreground text-xs shrink-0 w-20",children:"Border"}),f.jsx("input",{id:"stroke-object",type:"range",min:.5,max:20,step:.5,value:A,onChange:G=>H(parseFloat(G.target.value)),className:"flex-1 h-2 rounded-full accent-primary"}),f.jsx(Li,{type:"number",min:.5,max:20,step:.5,value:A,onChange:G=>{const se=parseFloat(G.target.value);Number.isNaN(se)||H(se)},className:"w-14 font-mono shrink-0 h-8"})]})]}),f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(Tr,{htmlFor:"detection-overlay-audio",children:"Audio"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{id:"detection-overlay-audio",type:"color",value:iw(j),onChange:G=>D(G.target.value),className:"h-10 w-14 shrink-0 cursor-pointer rounded border border-input bg-transparent p-0","aria-label":"Audio color picker"}),f.jsx(Li,{type:"text",value:j,onChange:G=>D(G.target.value),placeholder:"#22c55e",className:"font-mono flex-1"})]}),f.jsxs("div",{className:"flex items-center gap-2 pl-0",children:[f.jsx(Tr,{htmlFor:"stroke-audio",className:"text-muted-foreground text-xs shrink-0 w-20",children:"Border"}),f.jsx("input",{id:"stroke-audio",type:"range",min:.5,max:20,step:.5,value:F,onChange:G=>V(parseFloat(G.target.value)),className:"flex-1 h-2 rounded-full accent-primary"}),f.jsx(Li,{type:"number",min:.5,max:20,step:.5,value:F,onChange:G=>{const se=parseFloat(G.target.value);Number.isNaN(se)||V(se)},className:"w-14 font-mono shrink-0 h-8"})]})]})]})]})]})]})})]})}const XO=["date","camerasListScrollTop","cameraAudioVolumes","lastCamerasSnapshots","camerasStatus"];function KO(){const e=Te.getState();return Object.fromEntries(Object.entries(e).filter(([t,n])=>!XO.includes(t)&&typeof n!="function"))}function y8(){return JSON.stringify(KO())}function qie(e){if(e==null||typeof e!="object"||Array.isArray(e))return;const t=e,n=new Set(XO),r=Object.fromEntries(Object.entries(t).filter(([s])=>!n.has(s)));Object.keys(r).length!==0&&Te.setState(r)}const Wie=1e3;function Gie(){const{getAppState:e,setAppState:t}=ks(),n=qi(),r=Te(x=>x.userInfo),s=y.useRef(!1),a=y.useRef(null),l=y.useRef(null),h=y.useCallback(async()=>{try{const x=await e();qie(x),l.current=y8()}catch(x){console.warn("[useAppStateSync] load failed",x)}},[e]),m=y.useCallback(async()=>{try{const x=KO(),b=JSON.stringify(x);if(b===l.current)return;l.current=b,await t(x)}catch(x){console.warn("[useAppStateSync] save failed",x)}},[t]),p=!!(r&&n);y.useEffect(()=>{p&&(s.current||(s.current=!0,h()))},[p,h]),y.useEffect(()=>{if(!p)return;const x=()=>{document.visibilityState==="visible"?h():document.visibilityState==="hidden"&&m()};return document.addEventListener("visibilitychange",x),()=>document.removeEventListener("visibilitychange",x)},[p,h,m]),y.useEffect(()=>{if(!p)return;const x=Te.subscribe(()=>{y8()!==l.current&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{a.current=null,m()},Wie))});return()=>{x(),a.current&&(clearTimeout(a.current),a.current=null)}},[p,m])}function x8(e){return e===!0?!0:e&&typeof e=="object"&&"detected"in e?e.detected===!0:!1}function Yie(){const e=qi(),t=t4(),r=Te(x=>{var b;return((b=x.configs)==null?void 0:b.cameras)??[]}).map(x=>x.id),s=Te(x=>x.setCameraAudioVolumes),{setMotion:a,setAudio:l,setAudioLevelHighlightUntil:h,setObjectsDetected:m}=cm(),p=y.useRef({});y.useEffect(()=>{if(!e||r.length===0)return;const x=[];for(const w of r){const E=e.systemManager.getDeviceById(w),M=(E==null?void 0:E.interfaces)??[];M.includes(Ft.ScryptedInterface.MotionSensor)&&x.push(e.systemManager.listenDevice(w,{event:Ft.ScryptedInterface.MotionSensor},(C,S,_)=>a(w,x8(_)))),M.includes(Ft.ScryptedInterface.AudioSensor)&&x.push(e.systemManager.listenDevice(w,{event:Ft.ScryptedInterface.AudioSensor},(C,S,_)=>l(w,x8(_)))),M.includes(Ft.ScryptedInterface.AudioVolumeControl)&&x.push(e.systemManager.listenDevice(w,{event:Ft.ScryptedInterface.AudioVolumeControl},(C,S,_)=>{if(_!=null&&typeof _=="object"&&!Array.isArray(_)){const N={};for(const[j,D]of Object.entries(_))if(typeof D=="number")N[j]=D;else if(typeof D=="string"){const B=Number(D);Number.isNaN(B)||(N[j]=B)}Object.keys(N).length&&s(w,N);const c={...eR,...Te.getState().cameraHighlightSettings[w]};if(c.highlightAudioMode==="level"&&typeof _.dBFS=="number"){const j=_.dBFS,D=Date.now(),B=c.highlightAudioLevelWindowSeconds,T=c.highlightAudioLevelDecibelThreshold,A=c.highlightAudioLevelHitPercentage,H=c.highlightAudioLevelHoldSeconds,V=[...p.current[w]??[],{dBs:j,timestamp:D}].filter(ee=>D-ee.timestamp<=B*1e3);p.current[w]=V,V.length>0&&V.filter(se=>se.dBs>=T).length/V.length*100>=A&&h(w,D+H*1e3)}}})),M.includes(Ft.ScryptedInterface.ObjectDetector)&&x.push(e.systemManager.listenDevice(w,{event:Ft.ScryptedInterface.ObjectDetector},(C,S,_)=>m(w,_??null)))}const b=setInterval(()=>{const w=Date.now(),{byDevice:E}=cm.getState();for(const[M,C]of Object.entries(E))C.audioLevelHighlightUntil>0&&w>=C.audioLevelHighlightUntil&&h(M,0)},200);return()=>{clearInterval(b);try{x.forEach(w=>w.removeListener())}catch(w){(w instanceof Error?w.message:String(w??"")).includes("RpcPeer has been killed")&&t()}}},[e,r.join(","),t,a,l,h,m,s])}const Xie=1e4;function Kie(){var a;const e=qi(),t=Te(l=>l.configs),n=Te(l=>l.setLastCamerasSnapshots),r=y.useRef(null),s=y.useCallback(async()=>{if(!e||document.visibilityState!=="visible")return;const l=(t==null?void 0:t.cameras)??[];if(l.length===0)return;const m={...Te.getState().lastCamerasSnapshots??{}};await Promise.all(l.map(async p=>{var x;try{const b=e.systemManager.getDeviceById(p.id);if(!((x=b==null?void 0:b.interfaces)!=null&&x.includes(Ft.ScryptedInterface.Camera)))return;const w=await b.takePicture({bulkRequest:!0,reason:"periodic",picture:{width:640},timeout:8e3});if(!w)return;const E=await e.mediaManager.convertMediaObjectToBuffer(w,"image/jpeg"),M=E==null?void 0:E.toString("base64");m[p.id]=M?`data:image/jpeg;base64,${M}`:null}catch{m[p.id]=null}})),n(m)},[e,t==null?void 0:t.cameras,n]);y.useEffect(()=>{var x;if(!e||!((x=t==null?void 0:t.cameras)!=null&&x.length))return;const l=()=>{document.visibilityState==="visible"&&s()},h=()=>{r.current||(l(),r.current=setInterval(l,Xie))},m=()=>{r.current&&(clearInterval(r.current),r.current=null)},p=()=>{document.visibilityState==="visible"?h():m()};return h(),document.addEventListener("visibilitychange",p),()=>{m(),document.removeEventListener("visibilitychange",p)}},[e,(a=t==null?void 0:t.cameras)==null?void 0:a.length,s])}function Qie(e){return`${e.deviceId??""}-${e.id}-${e.startTime}`}function Zie({}){const e=Te(j=>j.date),t=Te(j=>j.refreshTime),n=Te(j=>j.setUserInfo),r=Te(j=>j.cameras),s=Te(j=>j.detectionClasses),{getVideoclips:a}=ks(),[l,h]=y.useState({cameras:r,detectionClasses:s});y.useEffect(()=>{const j=setTimeout(()=>h({cameras:r,detectionClasses:s}),hO);return()=>clearTimeout(j)},[r,s]);const m=y.useCallback(async({pageParam:j})=>{var A,H;const D=e?new Date(e):void 0;if(!D)return{items:[],total:0};const{videoclips:B,total:T}=await a(Ii(D).getTime(),um(D).getTime(),{limit:_g,offset:j,cameras:(A=l.cameras)!=null&&A.length?l.cameras:void 0,detectionClasses:(H=l.detectionClasses)!=null&&H.length?l.detectionClasses:void 0});return{items:B,total:T}},[e,a,l.cameras,l.detectionClasses]),p=y.useCallback((j,D)=>{const B=D.reduce((T,A)=>T+A.items.length,0);if(!(B>=j.total||j.items.length===0))return B},[]),{scrollRef:x,sentinelRef:b,columnCount:w,items:E,hasNextPage:M,isFetching:C,isFetchingNextPage:S,status:_,error:N}=mO({queryKey:["videoclips",e,t,l],queryFn:m,getNextPageParam:p,pageSize:_g,scrollToTopDeps:[r,s]});return y.useEffect(()=>{var j;N&&((j=N==null?void 0:N.response)==null?void 0:j.status)===401&&n(void 0)},[N,n]),(e?new Date(e):void 0)?_==="pending"?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("p",{className:"text-muted-foreground",children:"Loading…"})}):_==="error"?f.jsx("div",{className:"h-full flex items-center justify-center",children:f.jsx("p",{className:"text-destructive",children:"Error loading data"})}):E.length===0?f.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground text-center px-4",children:f.jsx("p",{children:"No videoclips for this date. Try changing the date or filters."})}):f.jsx("div",{ref:x,className:"h-full min-h-0 overflow-y-auto overflow-x-hidden flex-1","data-videoclips-scroll-container":!0,children:f.jsxs("div",{style:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${w}, minmax(0, 1fr))`,gridAutoRows:"auto",gap:Rg,alignContent:"start"},children:[E.map(j=>f.jsx("div",{style:{width:"100%",maxWidth:M9,aspectRatio:"1",minWidth:0,minHeight:0,overflow:"hidden",justifySelf:"center"},children:f.jsx(ZM,{videoclip:j,loading:C&&!S})},Qie(j))),M&&f.jsx("div",{ref:b,style:{gridColumn:"1 / -1",display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem",fontSize:"0.875rem",color:"var(--muted-foreground)"},children:S?"Loading…":""}),!M&&f.jsx("div",{style:{gridColumn:"1 / -1",display:"flex",alignItems:"center",justifyContent:"center",padding:"1rem",fontSize:"0.875rem",color:"var(--muted-foreground)"},children:"End of list"})]})}):f.jsx("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:"Select a date"})}var Jie=function(e){y.useEffect(e,[])};function ese(){const{isMobile:e}=Rb(),{logout:t}=ks(),n=Te(l=>l.userInfo),r=Te(l=>l.theme),s=Te(l=>l.setTheme),a=()=>{t()};return f.jsx(G_,{children:f.jsx(Y_,{children:f.jsxs(Ax,{children:[f.jsx(jx,{asChild:!0,children:f.jsxs(X_,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[f.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:f.jsx("span",{className:"truncate font-semibold",children:n==null?void 0:n.username})}),f.jsx(WA,{className:"ml-auto size-4"})]})}),f.jsxs(kx,{className:"w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",side:e?"bottom":"right",align:"end",sideOffset:4,children:[f.jsx(zx,{children:"Theme"}),f.jsxs(Px,{value:r,onValueChange:l=>s(l),children:[f.jsxs(hm,{value:"light",children:[f.jsx(d3,{className:"mr-2 size-4"}),"Light"]}),f.jsxs(hm,{value:"dark",children:[f.jsx(nb,{className:"mr-2 size-4"}),"Dark"]}),f.jsxs(hm,{value:"system",children:[f.jsx(Qj,{className:"mr-2 size-4"}),"System"]})]}),f.jsx(UM,{}),f.jsx(lE,{asChild:!0,children:f.jsx("a",{href:typeof window<"u"?window.location.origin:"#",children:"Scrypted"})}),f.jsxs(lE,{onClick:a,children:[f.jsx(Uj,{}),"Log out"]})]})]})})})}const tse=[{path:"/cameras",label:"Cameras",icon:pf},{path:"/grids",label:"Grids",icon:tb},{path:"/events",label:"Events",icon:$9},{path:"/videoclips",label:"Videoclips",icon:ef},{path:"/settings",label:"Settings",icon:ag}];function nse(){const e=To(),t=ma(),n=e.pathname,r=Te(b=>b.grids),s=Te(b=>b.activeGridId),a=Te(b=>b.selectedCameraId),l=s&&r[s]?`/grids/${s}`:"/grids",h=a?`/cameras/${a}`:"/cameras",m=n.startsWith("/cameras/")&&n!=="/cameras",p=/^\/grids\/[^/]+$/.test(n),x=m||p;return f.jsx(G_,{children:tse.map(({path:b,label:w,icon:E})=>{const M=b==="/grids"?x?"/grids":l:b==="/cameras"?m?"/cameras":h:b,C=n===b||b==="/cameras"&&n.startsWith("/cameras/")||b==="/grids"&&n.startsWith("/grids")||b==="/settings"&&n.startsWith("/settings");return f.jsx(Y_,{children:f.jsxs(X_,{size:"sm",isActive:C,tooltip:w,onClick:()=>t(M),className:He("cursor-pointer",C&&"bg-sidebar-accent text-sidebar-accent-foreground border-l-2 border-l-brand"),children:[f.jsx(E,{className:"size-4 shrink-0"}),f.jsx("span",{children:w})]})},b)})})}function rse(e){return!!(e==="/"||e==="/cameras"||e==="/events"||e==="/videoclips"||e==="/grids"||e==="/settings"||e.match(/^\/grids\/[^/]+\/edit$/))}function ise(){const e=Te(l=>l.setSidebarOpen),{open:t,state:n}=Rb(),r=To(),a=n4()&&rse(r.pathname);return y.useEffect(()=>e(t),[t]),f.jsxs(S$,{collapsible:"icon",className:He(a?"flex":"hidden","md:flex"),children:[f.jsx(E$,{className:He("bg-sidebar-brand/30",n==="collapsed"&&"flex items-center justify-center"),children:f.jsx("div",{className:"px-2 py-2 text-sm font-semibold",children:n==="collapsed"?"AN":"Advanced Notifier"})}),f.jsx(_$,{children:f.jsx(nse,{})}),f.jsx(R$,{children:f.jsx(ese,{})})]})}const sse=[{path:"/cameras",label:"Cameras",icon:pf},{path:"/grids",label:"Grids",icon:tb},{path:"/events",label:"Events",icon:$9},{path:"/videoclips",label:"Videoclips",icon:ef},{path:"/settings",label:"Settings",icon:ag}];function ose(){const e=To(),t=ma(),n=e.pathname,r=Te(b=>b.grids),s=Te(b=>b.activeGridId),a=Te(b=>b.selectedCameraId),l=s&&r[s]?`/grids/${s}`:"/grids",h=a?`/cameras/${a}`:"/cameras",m=n.startsWith("/cameras/")&&n!=="/cameras",p=/^\/grids\/[^/]+$/.test(n),x=m||p;return f.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 border-t bg-brand-muted/20 backdrop-blur supports-[backdrop-filter]:bg-background/60 md:hidden",children:f.jsx("div",{className:"flex h-14 items-center justify-around",children:sse.map(({path:b,label:w,icon:E})=>{const M=b==="/grids"?x?"/grids":l:b==="/cameras"?m?"/cameras":h:b,C=n===b||b==="/cameras"&&n.startsWith("/cameras/")||b==="/grids"&&n.startsWith("/grids")||b==="/settings"&&n.startsWith("/settings");return f.jsxs("button",{onClick:()=>t(M),className:He("flex flex-col items-center justify-center gap-1 px-4 py-2 text-xs font-medium transition-colors",C?"text-primary":"text-muted-foreground hover:text-foreground"),children:[f.jsx(E,{className:"size-5"}),f.jsx("span",{children:w})]},b)})})})}function ase(){const e=ma(),t=Te(s=>s.configs),n=ml(),r=(t==null?void 0:t.cameras)??[];return f.jsxs("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:[f.jsxs("header",{className:"shrink-0 flex items-center gap-2 px-2 py-2 border-b bg-background",children:[f.jsx(Qe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0",onClick:()=>e("/settings"),"aria-label":"Back to settings",children:f.jsx(sa,{className:"size-5"})}),f.jsx("h1",{className:"font-semibold text-lg truncate min-w-0 flex-1",children:"Camera settings"})]}),f.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 md:p-6",children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-xl",children:"Choose a camera to configure its specific options."}),r.length===0?f.jsx("div",{className:"rounded-lg border bg-muted/30 p-6 text-center text-muted-foreground",children:"No cameras configured."}):f.jsx("ul",{className:He("flex flex-col gap-2",!n&&"max-w-xl"),children:r.map(s=>f.jsx("li",{children:f.jsxs("button",{type:"button",onClick:()=>e(`/settings/cameras/${s.id}`),className:He("w-full flex items-center gap-3 rounded-lg border bg-card p-4 text-left transition-colors","hover:bg-accent/50 hover:border-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[f.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted",children:f.jsx(pf,{className:"size-5 text-muted-foreground"})}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("span",{className:"font-medium truncate block",children:s.name}),s.hasNvr&&f.jsx("span",{className:"text-xs text-muted-foreground",children:"NVR"})]}),f.jsx("span",{className:"text-muted-foreground shrink-0","aria-hidden":!0,children:"→"})]})},s.id))})]})]})}function lse(){return f.jsx(MD,{})}function cse(){const{getConfigs:e}=ks(),t=qi(),n=gF(),r=Te(m=>m.setConfigs),s=Te(m=>m.setPage),a=Te(m=>m.setSelectedCameraId),l=To();Kie(),Gie(),Yie(),y.useEffect(()=>{const m=l.pathname;if(m==="/events")s(Ka.Events);else if(m==="/videoclips")s(Ka.Videoclips);else if(m==="/grids")s(Ka.Grids);else if(m.match(/^\/grids\/[^/]+\/edit$/))s(Ka.Grids);else if(m.match(/^\/grids\/[^/]+$/))s(Ka.GridView);else if(m.startsWith("/cameras/")){const p=m.slice(9).split("/")[0];a(p??void 0),s(Ka.CameraDetail)}else m.startsWith("/settings")?s(Ka.Settings):(m==="/cameras"||m==="/")&&(a(void 0),s(Ka.Cameras))},[l.pathname,s,a]);const h=Te(m=>m.setUserInfo);return Jie(()=>{e().then(m=>{r(m)}).catch(m=>{var p;((p=m==null?void 0:m.response)==null?void 0:p.status)===401&&h(void 0)})}),f.jsx(uee,{client:t,children:f.jsxs(w$,{defaultOpen:!1,children:[f.jsx(ise,{}),f.jsxs(C$,{className:"flex h-svh max-h-svh min-h-0 flex-col overflow-hidden",children:[n&&f.jsx("div",{className:"shrink-0 bg-destructive/15 text-destructive px-4 py-2 text-sm text-center border-b border-destructive/30",children:n}),f.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-hidden pb-14 md:pb-0",children:f.jsxs(G8,{children:[f.jsx(oi,{index:!0,element:f.jsx(Xl,{to:"/cameras",replace:!0})}),f.jsx(oi,{path:"/",element:f.jsx(Xl,{to:"/cameras",replace:!0})}),f.jsx(oi,{path:"cameras",element:f.jsx(XX,{})}),f.jsx(oi,{path:"cameras/:cameraId",element:f.jsx(xne,{})}),f.jsx(oi,{path:"events",element:f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[f.jsx("header",{className:"shrink-0 border-b bg-background",children:f.jsx(Lre,{})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-hidden flex flex-col px-2 sm:px-4 pt-3",children:f.jsx(pre,{})})]})}),f.jsx(oi,{path:"videoclips",element:f.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[f.jsx("header",{className:"shrink-0 border-b bg-background",children:f.jsx(wre,{})}),f.jsx("div",{className:"min-h-0 flex-1 overflow-hidden flex flex-col px-2 sm:px-4 pt-3",children:f.jsx(Zie,{})})]})}),f.jsx(oi,{path:"grids",element:f.jsx(Sre,{})}),f.jsx(oi,{path:"grids/:id/edit",element:f.jsx($ie,{})}),f.jsx(oi,{path:"grids/:id",element:f.jsx(Die,{})}),f.jsxs(oi,{path:"settings",element:f.jsx(lse,{}),children:[f.jsx(oi,{index:!0,element:f.jsx(Vie,{})}),f.jsx(oi,{path:"cameras",element:f.jsx(ase,{})}),f.jsx(oi,{path:"cameras/:cameraId",element:f.jsx(pne,{})})]}),f.jsx(oi,{path:"*",element:f.jsx(Xl,{to:"/cameras",replace:!0})})]})}),f.jsx(ose,{})]})]})})}function use(){const e=Te(t=>t.theme);return y.useLayoutEffect(()=>{const t=document.documentElement,n=a=>{a?t.classList.add("dark"):t.classList.remove("dark")};if(e==="light"){n(!1);return}if(e==="dark"){n(!0);return}const r=window.matchMedia("(prefers-color-scheme: dark)");n(r.matches);const s=()=>n(r.matches);return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[e]),null}globalThis.Buffer=Yl.Buffer;function dse(){const e=Te(n=>n.userInfo),{remoteLog:t}=ks();return y.useEffect(()=>{window.onerror=(...n)=>t(n.join(" "))},[t]),f.jsxs(f.Fragment,{children:[f.jsx(use,{}),f.jsx(pF,{children:f.jsxs(G8,{children:[f.jsx(oi,{path:"/login",element:e?f.jsx(Xl,{to:"/cameras",replace:!0}):f.jsx(xF,{})}),f.jsx(oi,{index:!0,element:e?f.jsx(Xl,{to:"/cameras",replace:!0}):f.jsx(Xl,{to:"/login",replace:!0})}),f.jsx(oi,{path:"/",element:e?f.jsx(Xl,{to:"/cameras",replace:!0}):f.jsx(Xl,{to:"/login",replace:!0})}),f.jsx(oi,{path:"/*",element:e?f.jsx(cse,{}):f.jsx(Xl,{to:"/login",replace:!0})})]})})]})}const fse=new qne({defaultOptions:{queries:{staleTime:6e4}}});function hse({children:e}){return f.jsx(Gne,{client:fse,children:e})}const mse="/endpoint/@apocaliss92/scrypted-advanced-notifier/public/app/",pse=mse.replace(/\/+$/,"")||"/";OT.createRoot(document.getElementById("root")).render(f.jsx(y.StrictMode,{children:f.jsx(JD,{basename:pse,children:f.jsx(hse,{children:f.jsx(dse,{})})})}));
