diff --git "a/static/assets/index-b3464058.js" "b/static/assets/index-b3464058.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-b3464058.js" @@ -0,0 +1,320 @@ +function Z0(e,t){for(var n=0;nr[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Al=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fh={exports:{}},gs={},Bh={exports:{}},Z={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var To=Symbol.for("react.element"),e1=Symbol.for("react.portal"),t1=Symbol.for("react.fragment"),n1=Symbol.for("react.strict_mode"),r1=Symbol.for("react.profiler"),i1=Symbol.for("react.provider"),o1=Symbol.for("react.context"),l1=Symbol.for("react.forward_ref"),s1=Symbol.for("react.suspense"),a1=Symbol.for("react.memo"),u1=Symbol.for("react.lazy"),qd=Symbol.iterator;function c1(e){return e===null||typeof e!="object"?null:(e=qd&&e[qd]||e["@@iterator"],typeof e=="function"?e:null)}var $h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Uh=Object.assign,Vh={};function xi(e,t,n){this.props=e,this.context=t,this.refs=Vh,this.updater=n||$h}xi.prototype.isReactComponent={};xi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};xi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hh(){}Hh.prototype=xi.prototype;function hc(e,t,n){this.props=e,this.context=t,this.refs=Vh,this.updater=n||$h}var mc=hc.prototype=new Hh;mc.constructor=hc;Uh(mc,xi.prototype);mc.isPureReactComponent=!0;var Jd=Array.isArray,Wh=Object.prototype.hasOwnProperty,gc={current:null},Kh={key:!0,ref:!0,__self:!0,__source:!0};function Gh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)Wh.call(t,r)&&!Kh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,A=_[G];if(0>>1;Gi(ue,k))Qi(K,ue)?(_[G]=K,_[Q]=k,G=Q):(_[G]=ue,_[Y]=k,G=Y);else if(Qi(K,k))_[G]=K,_[Q]=k,G=Q;else break e}}return z}function i(_,z){var k=_.sortIndex-z.sortIndex;return k!==0?k:_.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],d=1,c=null,h=3,p=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(_){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=_)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function E(_){if(y=!1,x(_),!w)if(n(a)!==null)w=!0,U(N);else{var z=n(u);z!==null&&H(E,z.startTime-_)}}function N(_,z){w=!1,y&&(y=!1,m(R),R=-1),p=!0;var k=h;try{for(x(z),c=n(a);c!==null&&(!(c.expirationTime>z)||_&&!M());){var G=c.callback;if(typeof G=="function"){c.callback=null,h=c.priorityLevel;var A=G(c.expirationTime<=z);z=e.unstable_now(),typeof A=="function"?c.callback=A:c===n(a)&&r(a),x(z)}else r(a);c=n(a)}if(c!==null)var C=!0;else{var Y=n(u);Y!==null&&H(E,Y.startTime-z),C=!1}return C}finally{c=null,h=k,p=!1}}var b=!1,P=null,R=-1,B=5,O=-1;function M(){return!(e.unstable_now()-O_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(_){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var k=h;h=z;try{return _()}finally{h=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var k=h;h=_;try{return z()}finally{h=k}},e.unstable_scheduleCallback=function(_,z,k){var G=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0G?(_.sortIndex=k,t(u,_),n(a)===null&&_===n(u)&&(y?(m(R),R=-1):y=!0,H(E,k-G))):(_.sortIndex=A,t(a,_),w||p||(w=!0,U(N))),_},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(_){var z=h;return function(){var k=h;h=z;try{return _.apply(this,arguments)}finally{h=k}}}})(Jh);qh.exports=Jh;var S1=qh.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var k1=g,yt=S1;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Va=Object.prototype.hasOwnProperty,C1=/^[: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]*$/,ef={},tf={};function E1(e){return Va.call(tf,e)?!0:Va.call(ef,e)?!1:C1.test(e)?tf[e]=!0:(ef[e]=!0,!1)}function b1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function N1(e,t,n,r){if(t===null||typeof t>"u"||b1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var xc=/[\-:]([a-z])/g;function wc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xc,wc);$e[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xc,wc);$e[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xc,wc);$e[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sc(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2s||i[l]!==o[s]){var a=` +`+i[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{qs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hi(e):""}function P1(e){switch(e.tag){case 5:return Hi(e.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("SuspenseList");case 0:case 2:case 15:return e=Js(e.type,!1),e;case 11:return e=Js(e.type.render,!1),e;case 1:return e=Js(e.type,!0),e;default:return""}}function Ga(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Fr:return"Portal";case Ha:return"Profiler";case kc:return"StrictMode";case Wa:return"Suspense";case Ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case tm:return(e.displayName||"Context")+".Consumer";case em:return(e._context.displayName||"Context")+".Provider";case Cc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ec:return t=e.displayName||null,t!==null?t:Ga(e.type)||"Memo";case jn:t=e._payload,e=e._init;try{return Ga(e(t))}catch{}}return null}function j1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ga(t);case 8:return t===kc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _1(e){var t=rm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ho(e){e._valueTracker||(e._valueTracker=_1(e))}function im(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=rm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Il(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ya(e,t){var n=t.checked;return je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function rf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Hn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function om(e,t){t=t.checked,t!=null&&Sc(e,"checked",t,!1)}function Qa(e,t){om(e,t);var n=Hn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xa(e,t.type,Hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function of(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xa(e,t,n){(t!=="number"||Il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wi=Array.isArray;function qr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ao(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},R1=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(e){R1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qi[t]=Qi[e]})});function um(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qi.hasOwnProperty(e)&&Qi[e]?(""+t).trim():t+"px"}function cm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=um(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var T1=je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Za(e,t){if(t){if(T1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 tu=null;function bc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,Jr=null,Zr=null;function af(e){if(e=Mo(e)){if(typeof nu!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Ss(t),nu(e.stateNode,e.type,t))}}function dm(e){Jr?Zr?Zr.push(e):Zr=[e]:Jr=e}function fm(){if(Jr){var e=Jr,t=Zr;if(Zr=Jr=null,af(e),t)for(e=0;e>>=0,e===0?32:31-(U1(e)/V1|0)|0}var Ko=64,Go=4194304;function Ki(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Ki(s):(o&=l,o!==0&&(r=Ki(o)))}else l=n&~i,l!==0?r=Ki(l):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ao(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function G1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=qi),yf=String.fromCharCode(32),vf=!1;function Am(e,t){switch(e){case"keyup":return Sw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Im(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $r=!1;function Cw(e,t){switch(e){case"compositionend":return Im(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function Ew(e,t){if($r)return e==="compositionend"||!Ic&&Am(e,t)?(e=Rm(),vl=Rc=An=null,$r=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kf(n)}}function Dm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zm(){for(var e=window,t=Il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Il(e.document)}return t}function Mc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Iw(e){var t=zm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Dm(n.ownerDocument.documentElement,n)){if(r!==null&&Mc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Cf(n,o);var l=Cf(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ur=null,au=null,Zi=null,uu=!1;function Ef(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||Ur==null||Ur!==Il(r)||(r=Ur,"selectionStart"in r&&Mc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zi&&mo(Zi,r)||(Zi=r,r=Bl(au,"onSelect"),0Wr||(e.current=mu[Wr],mu[Wr]=null,Wr--)}function ye(e,t){Wr++,mu[Wr]=e.current,e.current=t}var Wn={},Ge=Qn(Wn),it=Qn(!1),hr=Wn;function ci(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ot(e){return e=e.childContextTypes,e!=null}function Ul(){ke(it),ke(Ge)}function Tf(e,t,n){if(Ge.current!==Wn)throw Error(L(168));ye(Ge,t),ye(it,n)}function Gm(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(L(108,j1(e)||"Unknown",i));return je({},n,r)}function Vl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,hr=Ge.current,ye(Ge,e),ye(it,it.current),!0}function Af(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Gm(e,t,hr),r.__reactInternalMemoizedMergedChildContext=e,ke(it),ke(Ge),ye(Ge,e)):ke(it),ye(it,n)}var un=null,ks=!1,fa=!1;function Ym(e){un===null?un=[e]:un.push(e)}function Ww(e){ks=!0,Ym(e)}function Xn(){if(!fa&&un!==null){fa=!0;var e=0,t=he;try{var n=un;for(he=1;e>=l,i-=l,cn=1<<32-Dt(t)+i|n<R?(B=P,P=null):B=P.sibling;var O=h(m,P,x[R],E);if(O===null){P===null&&(P=B);break}e&&P&&O.alternate===null&&t(m,P),v=o(O,v,R),b===null?N=O:b.sibling=O,b=O,P=B}if(R===x.length)return n(m,P),Ee&&rr(m,R),N;if(P===null){for(;RR?(B=P,P=null):B=P.sibling;var M=h(m,P,O.value,E);if(M===null){P===null&&(P=B);break}e&&P&&M.alternate===null&&t(m,P),v=o(M,v,R),b===null?N=M:b.sibling=M,b=M,P=B}if(O.done)return n(m,P),Ee&&rr(m,R),N;if(P===null){for(;!O.done;R++,O=x.next())O=c(m,O.value,E),O!==null&&(v=o(O,v,R),b===null?N=O:b.sibling=O,b=O);return Ee&&rr(m,R),N}for(P=r(m,P);!O.done;R++,O=x.next())O=p(P,m,R,O.value,E),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?R:O.key),v=o(O,v,R),b===null?N=O:b.sibling=O,b=O);return e&&P.forEach(function(j){return t(m,j)}),Ee&&rr(m,R),N}function S(m,v,x,E){if(typeof x=="object"&&x!==null&&x.type===Br&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Vo:e:{for(var N=x.key,b=v;b!==null;){if(b.key===N){if(N=x.type,N===Br){if(b.tag===7){n(m,b.sibling),v=i(b,x.props.children),v.return=m,m=v;break e}}else if(b.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===jn&&Of(N)===b.type){n(m,b.sibling),v=i(b,x.props),v.ref=Di(m,b,x),v.return=m,m=v;break e}n(m,b);break}else t(m,b);b=b.sibling}x.type===Br?(v=dr(x.props.children,m.mode,E,x.key),v.return=m,m=v):(E=Nl(x.type,x.key,x.props,null,m.mode,E),E.ref=Di(m,v,x),E.return=m,m=E)}return l(m);case Fr:e:{for(b=x.key;v!==null;){if(v.key===b)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(m,v.sibling),v=i(v,x.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=wa(x,m.mode,E),v.return=m,m=v}return l(m);case jn:return b=x._init,S(m,v,b(x._payload),E)}if(Wi(x))return w(m,v,x,E);if(Ai(x))return y(m,v,x,E);el(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(m,v.sibling),v=i(v,x),v.return=m,m=v):(n(m,v),v=xa(x,m.mode,E),v.return=m,m=v),l(m)):n(m,v)}return S}var fi=Jm(!0),Zm=Jm(!1),Kl=Qn(null),Gl=null,Yr=null,zc=null;function Fc(){zc=Yr=Gl=null}function Bc(e){var t=Kl.current;ke(Kl),e._currentValue=t}function vu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ti(e,t){Gl=e,zc=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rt=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(zc!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(Gl===null)throw Error(L(308));Yr=e,Gl.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var sr=null;function $c(e){sr===null?sr=[e]:sr.push(e)}function eg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$c(t)):(n.next=i.next,i.next=n),t.interleaved=n,mn(e,r)}function mn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function Uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,mn(e,n)}return i=r.interleaved,i===null?(t.next=t,$c(r)):(t.next=i.next,i.next=t),r.interleaved=t,mn(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pc(e,n)}}function Lf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Yl(e,t,n,r){var i=e.updateQueue;_n=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==l&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=a))}if(o!==null){var c=i.baseState;l=0,d=u=a=null,s=o;do{var h=s.lane,p=s.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(h=t,p=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){c=w.call(p,c,h);break e}c=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,h=typeof w=="function"?w.call(p,c,h):w,h==null)break e;c=je({},c,h);break e;case 2:_n=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},d===null?(u=d=p,a=c):d=d.next=p,l|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(d===null&&(a=c),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);yr|=l,e.lanes=l,e.memoizedState=c}}function Df(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ha.transition;ha.transition={};try{e(!1),t()}finally{he=n,ha.transition=r}}function vg(){return jt().memoizedState}function Qw(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xg(e))wg(t,n);else if(n=eg(e,t,n,r),n!==null){var i=Je();zt(n,e,r,i),Sg(n,t,r)}}function Xw(e,t,n){var r=$n(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xg(e))wg(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,Bt(s,l)){var a=t.interleaved;a===null?(i.next=i,$c(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=eg(e,t,i,r),n!==null&&(i=Je(),zt(n,e,r,i),Sg(n,t,r))}}function xg(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function wg(e,t){eo=Xl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pc(e,n)}}var ql={readContext:Pt,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},qw={readContext:Pt,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:Ff,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,kl(4194308,4,pg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var n=Kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Qw.bind(null,Pe,e),[r.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:zf,useDebugValue:Xc,useDeferredValue:function(e){return Kt().memoizedState=e},useTransition:function(){var e=zf(!1),t=e[0];return e=Yw.bind(null,e[1]),Kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pe,i=Kt();if(Ee){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ze===null)throw Error(L(349));gr&30||og(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ff(sg.bind(null,r,o,e),[e]),r.flags|=2048,Co(9,lg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Kt(),t=ze.identifierPrefix;if(Ee){var n=dn,r=cn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=So++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Yt]=t,e[vo]=r,Tg(e,t,!1,!1),t.stateNode=e;e:{switch(l=eu(n,r),n){case"dialog":Se("cancel",e),Se("close",e),i=r;break;case"iframe":case"object":case"embed":Se("load",e),i=r;break;case"video":case"audio":for(i=0;imi&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ql(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ee)return He(t),null}else 2*Re()-o.renderingStartTime>mi&&n!==1073741824&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Re(),t.sibling=null,n=Ne.current,ye(Ne,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return nd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?dt&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function oS(e,t){switch(Lc(t),t.tag){case 1:return ot(t.type)&&Ul(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),ke(it),ke(Ge),Wc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hc(t),null;case 13:if(ke(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ne),null;case 4:return pi(),null;case 10:return Bc(t.type._context),null;case 22:case 23:return nd(),null;case 24:return null;default:return null}}var nl=!1,We=!1,lS=typeof WeakSet=="function"?WeakSet:Set,W=null;function Qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_e(e,t,r)}else n.current=null}function Pu(e,t,n){try{n()}catch(r){_e(e,t,r)}}var Xf=!1;function sS(e,t){if(cu=zl,e=zm(),Mc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,d=0,c=e,h=null;t:for(;;){for(var p;c!==n||i!==0&&c.nodeType!==3||(s=l+i),c!==o||r!==0&&c.nodeType!==3||(a=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(p=c.firstChild)!==null;)h=c,c=p;for(;;){if(c===e)break t;if(h===n&&++u===i&&(s=l),h===o&&++d===r&&(a=l),(p=c.nextSibling)!==null)break;c=h,h=c.parentNode}c=p}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},zl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var y=w.memoizedProps,S=w.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:It(t.type,y),S);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(E){_e(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=Xf,Xf=!1,w}function to(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Pu(t,n,o)}i=i.next}while(i!==r)}}function bs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ju(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mg(e){var t=e.alternate;t!==null&&(e.alternate=null,Mg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[vo],delete t[hu],delete t[Vw],delete t[Hw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Og(e){return e.tag===5||e.tag===3||e.tag===4}function qf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Og(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _u(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$l));else if(r!==4&&(e=e.child,e!==null))for(_u(e,t,n),e=e.sibling;e!==null;)_u(e,t,n),e=e.sibling}function Ru(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ru(e,t,n),e=e.sibling;e!==null;)Ru(e,t,n),e=e.sibling}var Fe=null,Ot=!1;function En(e,t,n){for(n=n.child;n!==null;)Lg(e,t,n),n=n.sibling}function Lg(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(ys,n)}catch{}switch(n.tag){case 5:We||Qr(n,t);case 6:var r=Fe,i=Ot;Fe=null,En(e,t,n),Fe=r,Ot=i,Fe!==null&&(Ot?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Ot?(e=Fe,n=n.stateNode,e.nodeType===8?da(e.parentNode,n):e.nodeType===1&&da(e,n),po(e)):da(Fe,n.stateNode));break;case 4:r=Fe,i=Ot,Fe=n.stateNode.containerInfo,Ot=!0,En(e,t,n),Fe=r,Ot=i;break;case 0:case 11:case 14:case 15:if(!We&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Pu(n,t,l),i=i.next}while(i!==r)}En(e,t,n);break;case 1:if(!We&&(Qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){_e(n,t,s)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?(We=(r=We)||n.memoizedState!==null,En(e,t,n),We=r):En(e,t,n);break;default:En(e,t,n)}}function Jf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lS),t.forEach(function(r){var i=gS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Rt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,es=0,se&6)throw Error(L(331));var i=se;for(se|=4,W=e.current;W!==null;){var o=W,l=o.child;if(W.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aRe()-ed?cr(e,0):Zc|=n),lt(e,t)}function Hg(e,t){t===0&&(e.mode&1?(t=Go,Go<<=1,!(Go&130023424)&&(Go=4194304)):t=1);var n=Je();e=mn(e,t),e!==null&&(Ao(e,t,n),lt(e,n))}function mS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hg(e,n)}function gS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),Hg(e,n)}var Wg;Wg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rt=!1,rS(e,t,n);rt=!!(e.flags&131072)}else rt=!1,Ee&&t.flags&1048576&&Qm(t,Wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cl(e,t),e=t.pendingProps;var i=ci(t,Ge.current);ti(t,n),i=Gc(null,t,r,e,i,n);var o=Yc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)?(o=!0,Vl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Uc(t),i.updater=Es,t.stateNode=i,i._reactInternals=t,wu(t,r,e,n),t=Cu(null,t,r,!0,o,n)):(t.tag=0,Ee&&o&&Oc(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=vS(r),e=It(r,e),i){case 0:t=ku(null,t,r,e,n);break e;case 1:t=Gf(null,t,r,e,n);break e;case 11:t=Wf(null,t,r,e,n);break e;case 14:t=Kf(null,t,r,It(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),ku(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Gf(e,t,r,i,n);case 3:e:{if(jg(t),e===null)throw Error(L(387));r=t.pendingProps,o=t.memoizedState,i=o.element,tg(e,t),Yl(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=hi(Error(L(423)),t),t=Yf(e,t,r,n,i);break e}else if(r!==i){i=hi(Error(L(424)),t),t=Yf(e,t,r,n,i);break e}else for(pt=zn(t.stateNode.containerInfo.firstChild),mt=t,Ee=!0,Lt=null,n=Zm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=gn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return ng(t),e===null&&yu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,fu(r,i)?l=null:o!==null&&fu(r,o)&&(t.flags|=32),Pg(e,t),Xe(e,t,l,n),t.child;case 6:return e===null&&yu(t),null;case 13:return _g(e,t,n);case 4:return Vc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fi(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Wf(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,ye(Kl,r._currentValue),r._currentValue=l,o!==null)if(Bt(o.value,l)){if(o.children===i.children&&!it.current){t=gn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=fn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?a.next=a:(a.next=d.next,d.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),vu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(L(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),vu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ti(t,n),i=Pt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=It(r,t.pendingProps),i=It(r.type,i),Kf(e,t,r,i,n);case 15:return bg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Cl(e,t),t.tag=1,ot(r)?(e=!0,Vl(t)):e=!1,ti(t,n),kg(t,r,i),wu(t,r,i,n),Cu(null,t,r,!0,e,n);case 19:return Rg(e,t,n);case 22:return Ng(e,t,n)}throw Error(L(156,t.tag))};function Kg(e,t){return xm(e,t)}function yS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,n,r){return new yS(e,t,n,r)}function id(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vS(e){if(typeof e=="function")return id(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cc)return 11;if(e===Ec)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")id(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Br:return dr(n.children,i,o,t);case kc:l=8,i|=8;break;case Ha:return e=Et(12,n,t,i|2),e.elementType=Ha,e.lanes=o,e;case Wa:return e=Et(13,n,t,i),e.elementType=Wa,e.lanes=o,e;case Ka:return e=Et(19,n,t,i),e.elementType=Ka,e.lanes=o,e;case nm:return Ps(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case em:l=10;break e;case tm:l=9;break e;case Cc:l=11;break e;case Ec:l=14;break e;case jn:l=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Et(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function dr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function Ps(e,t,n,r){return e=Et(22,e,r,t),e.elementType=nm,e.lanes=n,e.stateNode={isHidden:!1},e}function xa(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function wa(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ea(0),this.expirationTimes=ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function od(e,t,n,r,i,o,l,s,a){return e=new xS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Et(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uc(o),e}function wS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xg)}catch(e){console.error(e)}}Xg(),Xh.exports=vt;var ki=Xh.exports;const bS=ms(ki);var lp=ki;Ua.createRoot=lp.createRoot,Ua.hydrateRoot=lp.hydrateRoot;/** + * @remix-run/router v1.23.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 + */function bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function qg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function PS(){return Math.random().toString(36).substr(2,8)}function ap(e,t){return{usr:e.state,key:e.key,idx:t}}function Ou(e,t,n,r){return n===void 0&&(n=null),bo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ci(t):t,{state:n,key:t&&t.key||r||PS()})}function rs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ci(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function jS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Mn.Pop,a=null,u=d();u==null&&(u=0,l.replaceState(bo({},l.state,{idx:u}),""));function d(){return(l.state||{idx:null}).idx}function c(){s=Mn.Pop;let S=d(),m=S==null?null:S-u;u=S,a&&a({action:s,location:y.location,delta:m})}function h(S,m){s=Mn.Push;let v=Ou(y.location,S,m);n&&n(v,S),u=d()+1;let x=ap(v,u),E=y.createHref(v);try{l.pushState(x,"",E)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(E)}o&&a&&a({action:s,location:y.location,delta:1})}function p(S,m){s=Mn.Replace;let v=Ou(y.location,S,m);n&&n(v,S),u=d();let x=ap(v,u),E=y.createHref(v);l.replaceState(x,"",E),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let m=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof S=="string"?S:rs(S);return v=v.replace(/ $/,"%20"),Me(m,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,m)}let y={get action(){return s},get location(){return e(i,l)},listen(S){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(sp,c),a=S,()=>{i.removeEventListener(sp,c),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let m=w(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:h,replace:p,go(S){return l.go(S)}};return y}var up;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(up||(up={}));function _S(e,t,n){return n===void 0&&(n="/"),RS(e,t,n,!1)}function RS(e,t,n,r){let i=typeof t=="string"?Ci(t):t,o=ud(i.pathname||"/",n);if(o==null)return null;let l=Jg(e);TS(l);let s=null;for(let a=0;s==null&&a{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Me(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Vn([r,a.relativePath]),d=n.concat(a);o.children&&o.children.length>0&&(Me(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Jg(o.children,t,d,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:zS(u,o.index),routesMeta:d})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Zg(o.path))i(o,l,a)}),t}function Zg(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=Zg(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>e.startsWith("/")&&a===""?"/":a)}function TS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:FS(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const AS=/^:[\w-]+$/,IS=3,MS=2,OS=1,LS=10,DS=-2,cp=e=>e==="*";function zS(e,t){let n=e.split("/"),r=n.length;return n.some(cp)&&(r+=DS),t&&(r+=MS),n.filter(i=>!cp(i)).reduce((i,o)=>i+(AS.test(o)?IS:o===""?OS:LS),r)}function FS(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function BS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:h,isOptional:p}=d;if(h==="*"){let y=s[c]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[c];return p&&!w?u[h]=void 0:u[h]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function $S(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),qg(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function US(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qg(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ud(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function VS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ci(e):e;return{pathname:n?n.startsWith("/")?n:HS(n,t):t,search:GS(r),hash:YS(i)}}function HS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Sa(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 and the router will parse it for you.'}function WS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ey(e,t){let n=WS(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ty(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ci(e):(i=bo({},e),Me(!i.pathname||!i.pathname.includes("?"),Sa("?","pathname","search",i)),Me(!i.pathname||!i.pathname.includes("#"),Sa("#","pathname","hash",i)),Me(!i.search||!i.search.includes("#"),Sa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let c=t.length-1;if(!r&&l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),c-=1;i.pathname=h.join("/")}s=c>=0?t[c]:"/"}let a=VS(i,s),u=l&&l!=="/"&&l.endsWith("/"),d=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||d)&&(a.pathname+="/"),a}const Vn=e=>e.join("/").replace(/\/\/+/g,"/"),KS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),GS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,YS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function QS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ny=["post","put","patch","delete"];new Set(ny);const XS=["get",...ny];new Set(XS);/** + * React Router v6.30.1 + * + * 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 + */function No(){return No=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let c=ty(u,JSON.parse(l),o,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Vn([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,l,o,e])}const tk=g.createContext(null);function nk(e){let t=g.useContext(qn).outlet;return t&&g.createElement(tk.Provider,{value:e},t)}function oy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Pr),{matches:i}=g.useContext(qn),{pathname:o}=Do(),l=JSON.stringify(ey(i,r.v7_relativeSplatPath));return g.useMemo(()=>ty(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function rk(e,t){return ik(e,t)}function ik(e,t,n,r){Lo()||Me(!1);let{navigator:i}=g.useContext(Pr),{matches:o}=g.useContext(qn),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Do(),d;if(t){var c;let S=typeof t=="string"?Ci(t):t;a==="/"||(c=S.pathname)!=null&&c.startsWith(a)||Me(!1),d=S}else d=u;let h=d.pathname||"/",p=h;if(a!=="/"){let S=a.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=_S(e,{pathname:p}),y=uk(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Vn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Vn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?g.createElement(As.Provider,{value:{location:No({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Mn.Pop}},y):y}function ok(){let e=pk(),t=QS(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,o)}const lk=g.createElement(ok,null);class sk extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(qn.Provider,{value:this.props.routeContext},g.createElement(ry.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ak(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(cd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(qn.Provider,{value:t},r)}function uk(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let d=l.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);d>=0||Me(!1),l=l.slice(0,Math.min(l.length,d+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((d,c,h)=>{let p,w=!1,y=null,S=null;n&&(p=s&&c.route.id?s[c.route.id]:void 0,y=c.route.errorElement||lk,a&&(u<0&&h===0?(mk("route-fallback",!1),w=!0,S=null):u===h&&(w=!0,S=c.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,h+1)),v=()=>{let x;return p?x=y:w?x=S:c.route.Component?x=g.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=d,g.createElement(ak,{match:c,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?g.createElement(sk,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:v(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):v()},null)}var ly=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ly||{}),is=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(is||{});function ck(e){let t=g.useContext(cd);return t||Me(!1),t}function dk(e){let t=g.useContext(qS);return t||Me(!1),t}function fk(e){let t=g.useContext(qn);return t||Me(!1),t}function sy(e){let t=fk(),n=t.matches[t.matches.length-1];return n.route.id||Me(!1),n.route.id}function pk(){var e;let t=g.useContext(ry),n=dk(is.UseRouteError),r=sy(is.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function hk(){let{router:e}=ck(ly.UseNavigateStable),t=sy(is.UseNavigateStable),n=g.useRef(!1);return iy(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,No({fromRouteId:t},o)))},[e,t])}const fp={};function mk(e,t,n){!t&&!fp[e]&&(fp[e]=!0)}function gk(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function yk(e){return nk(e.context)}function Dr(e){Me(!1)}function vk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Mn.Pop,navigator:o,static:l=!1,future:s}=e;Lo()&&Me(!1);let a=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:a,navigator:o,static:l,future:No({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Ci(r));let{pathname:d="/",search:c="",hash:h="",state:p=null,key:w="default"}=r,y=g.useMemo(()=>{let S=ud(d,a);return S==null?null:{location:{pathname:S,search:c,hash:h,state:p,key:w},navigationType:i}},[a,d,c,h,p,w,i]);return y==null?null:g.createElement(Pr.Provider,{value:u},g.createElement(As.Provider,{children:n,value:y}))}function xk(e){let{children:t,location:n}=e;return rk(Lu(t),n)}new Promise(()=>{});function Lu(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let o=[...t,i];if(r.type===g.Fragment){n.push.apply(n,Lu(r.props.children,o));return}r.type!==Dr&&Me(!1),!r.props.index||!r.props.children||Me(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary: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=Lu(r.props.children,o)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * 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 + */function Du(){return Du=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Sk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kk(e,t){return e.button===0&&(!t||t==="_self")&&!Sk(e)}const Ck=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ek="6";try{window.__reactRouterVersion=Ek}catch{}const bk="startTransition",pp=vc[bk];function Nk(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=NS({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},d=g.useCallback(c=>{u&&pp?pp(()=>a(c)):a(c)},[a,u]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>gk(r),[r]),g.createElement(vk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const Pk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zr=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:d,viewTransition:c}=t,h=wk(t,Ck),{basename:p}=g.useContext(Pr),w,y=!1;if(typeof u=="string"&&jk.test(u)&&(w=u,Pk))try{let x=new URL(window.location.href),E=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=ud(E.pathname,p);E.origin===x.origin&&N!=null?u=N+E.search+E.hash:y=!0}catch{}let S=JS(u,{relative:i}),m=_k(u,{replace:l,state:s,target:a,preventScrollReset:d,relative:i,viewTransition:c});function v(x){r&&r(x),x.defaultPrevented||m(x)}return g.createElement("a",Du({},h,{href:w||S,onClick:y||o?r:v,ref:n,target:a}))});var hp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(hp||(hp={}));var mp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mp||(mp={}));function _k(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=ZS(),u=Do(),d=oy(e,{relative:l});return g.useCallback(c=>{if(kk(c,n)){c.preventDefault();let h=r!==void 0?r:rs(u)===rs(d);a(e,{replace:h,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,d,r,i,n,e,o,l,s])}function ay(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;te&&(t=0,r=n,n=new Map)}return{get:function(l){var s=n.get(l);if(s!==void 0)return s;if((s=r.get(l))!==void 0)return i(l,s),s},set:function(l,s){n.has(l)?n.set(l,s):i(l,s)}}}var fy="!";function Dk(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,d,c=0;cu?d-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function zk(e){if(e.length<=1)return e;var t=[],n=[];return e.forEach(function(r){var i=r[0]==="[";i?(t.push.apply(t,n.sort().concat([r])),n=[]):n.push(r)}),t.push.apply(t,n.sort()),t}function Fk(e){return{cache:Lk(e.cacheSize),splitModifiers:Dk(e),...Tk(e)}}var Bk=/\s+/;function $k(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(Bk).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,d=s.baseClassName,c=s.maybePostfixModifierPosition,h=r(c?d.substring(0,c):d),p=!!c;if(!h){if(!c)return{isTailwindClass:!1,originalClassName:l};if(h=r(d),!h)return{isTailwindClass:!1,originalClassName:l};p=!1}var w=zk(a).join(":"),y=u?w+fy:w;return{isTailwindClass:!0,modifierId:y,classGroupId:h,originalClassName:l,hasPostfixModifier:p}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,d=s+a;return o.has(d)?!1:(o.add(d),i(a,u).forEach(function(c){return o.add(s+c)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function Uk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),xp=e=>{const t=oC(e);return t.charAt(0).toUpperCase()+t.slice(1)},my=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),lC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var sC={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.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aC=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>g.createElement("svg",{ref:a,...sC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:my("lucide",i),...!o&&!lC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ae=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(aC,{ref:o,iconNode:t,className:my(`lucide-${iC(xp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=xp(e),n};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],cC=ae("arrow-right",uC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dC=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],gi=ae("book-open",dC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fC=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],pC=ae("bot",fC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hC=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],fr=ae("brain",hC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],gC=ae("check",mC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fd=ae("chevron-down",yC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],xC=ae("chevron-up",vC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],SC=ae("circle-check-big",wC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ri=ae("cloud",kC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CC=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],EC=ae("code",CC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bC=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],gy=ae("cpu",bC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NC=[["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"}]],yy=ae("download",NC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PC=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],vy=ae("hard-drive",PC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jC=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],_C=ae("history",jC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RC=[["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"}]],TC=ae("house",RC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xy=ae("info",AC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],wy=ae("loader-circle",IC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MC=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],xr=ae("message-square",MC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],LC=ae("panel-left-close",OC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],zC=ae("panel-left-open",DC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],BC=ae("plus",FC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $C=[["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"}]],UC=ae("rotate-ccw",$C);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],HC=ae("send",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WC=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],KC=ae("server",WC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pd=ae("settings",GC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],QC=ae("share",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["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"}]],Bu=ae("shield",XC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],JC=ae("square",qC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Sy=ae("trash-2",ZC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eE=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],tE=ae("triangle-alert",eE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nE=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],rE=ae("upload",nE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iE=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],oE=ae("user",iE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lE=[["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"}]],os=ae("zap",lE),sE=[{name:"Home",href:"/",icon:TC,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:xr,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:gi,description:"Browse and manage models"},{name:"Settings",href:"/settings",icon:pd,description:"Application settings"}];function aE(){const e=Do();return f.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[f.jsx("div",{className:"p-6 border-b",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:f.jsx(fr,{className:"h-5 w-5 text-primary-foreground"})}),f.jsxs("div",{children:[f.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),f.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:f.jsxs("div",{children:[f.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),f.jsx("nav",{className:"space-y-1",children:sE.map(t=>{const n=e.pathname===t.href;return f.jsxs(zr,{to:t.href,className:de("flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent",n?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:[f.jsx(t.icon,{className:"h-4 w-4"}),f.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function uE(){return f.jsxs("div",{className:"flex h-screen bg-background",children:[f.jsx("div",{className:"w-64 border-r",children:f.jsx(aE,{})}),f.jsx("div",{className:"flex-1 overflow-hidden",children:f.jsx(yk,{})})]})}const Ke=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ke.displayName="Card";const bt=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("flex flex-col space-y-1.5 p-6",e),...t}));bt.displayName="CardHeader";const Ft=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:de("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ft.displayName="CardTitle";const cE=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:de("text-sm text-muted-foreground",e),...t}));cE.displayName="CardDescription";const qe=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("p-6 pt-0",e),...t}));qe.displayName="CardContent";const dE=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("flex items-center p-6 pt-0",e),...t}));dE.displayName="CardFooter";function wp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ky(...e){return t=>{let n=!1;const r=e.map(i=>{const o=wp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=g.Children.toArray(o),a=s.find(mE);if(a){const u=a.props.children,d=s.map(c=>c===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:c);return f.jsx(t,{...l,ref:i,children:g.isValidElement(u)?g.cloneElement(u,void 0,d):null})}return f.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var fE=yi("Slot");function pE(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=yE(i),s=gE(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ky(r,l):l),g.cloneElement(i,s)}return g.Children.count(i)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cy=Symbol("radix.slottable");function hE(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Cy,t}function mE(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cy}function gE(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{const a=o(...s);return i(...s),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function yE(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Sp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kp=uy,hd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return kp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],c=o==null?void 0:o[u];if(d===null)return null;const h=Sp(d)||Sp(c);return i[u][h]}),s=n&&Object.entries(n).reduce((u,d)=>{let[c,h]=d;return h===void 0||(u[c]=h),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:h,...p}=d;return Object.entries(p).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...u,c,h]:u},[]);return kp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},md=hd("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ce=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?fE:"button";return f.jsx(l,{className:de(md({variant:t,size:n,className:e})),ref:o,...i})});Ce.displayName="Button";const vE=[{icon:fr,title:"Local AI Models",description:"Run powerful language models locally on your machine with full privacy control.",color:"text-blue-500"},{icon:xr,title:"Interactive Chat",description:"Playground interface for testing prompts and exploring model capabilities.",color:"text-green-500"},{icon:Bu,title:"Privacy First",description:"Your data never leaves your machine. Complete privacy and security guaranteed.",color:"text-purple-500"},{icon:os,title:"High Performance",description:"Optimized for speed with model caching and efficient resource management.",color:"text-yellow-500"}],xE=[{title:"Start Chatting",description:"Jump into the playground and start experimenting",href:"/playground",icon:xr,primary:!0},{title:"Browse Models",description:"Explore available models and their capabilities",href:"/models",icon:gi,primary:!1},{title:"View Settings",description:"Configure your application preferences",href:"/settings",icon:gy,primary:!1}];function wE(){return f.jsx("div",{className:"min-h-screen bg-background",children:f.jsxs("div",{className:"container mx-auto px-4 py-8",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("div",{className:"flex items-center justify-center mb-4",children:f.jsx("div",{className:"w-16 h-16 bg-primary rounded-2xl flex items-center justify-center",children:f.jsx(fr,{className:"h-8 w-8 text-primary-foreground"})})}),f.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Edge LLM"}),f.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto mb-8",children:"Your local AI companion. Run powerful language models on your own hardware with complete privacy and control."}),f.jsxs("div",{className:"flex items-center justify-center gap-4",children:[f.jsx(zr,{to:"/playground",children:f.jsxs(Ce,{size:"lg",children:[f.jsx(xr,{className:"h-5 w-5 mr-2"}),"Start Chatting"]})}),f.jsx(zr,{to:"/models",children:f.jsxs(Ce,{variant:"outline",size:"lg",children:[f.jsx(gi,{className:"h-5 w-5 mr-2"}),"Browse Models"]})})]})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:vE.map((e,t)=>f.jsx(Ke,{className:"text-center",children:f.jsxs(qe,{className:"pt-6",children:[f.jsx(e.icon,{className:`h-12 w-12 mx-auto mb-4 ${e.color}`}),f.jsx("h3",{className:"font-semibold mb-2",children:e.title}),f.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})},t))}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:xE.map((e,t)=>f.jsx(Ke,{className:"hover:shadow-lg transition-shadow",children:f.jsxs(qe,{className:"pt-6",children:[f.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[f.jsx(e.icon,{className:"h-6 w-6 text-primary"}),f.jsx("h3",{className:"font-semibold",children:e.title})]}),f.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e.description}),f.jsx(zr,{to:e.href,children:f.jsxs(Ce,{variant:e.primary?"default":"outline",className:"w-full",children:["Get Started",f.jsx(cC,{className:"h-4 w-4 ml-2"})]})})]})},t))}),f.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{children:"Getting Started"})}),f.jsxs(qe,{children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"1"}),f.jsx("h4",{className:"font-medium",children:"Browse Available Models"})]}),f.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Check out our model catalog to see what's available for your use case."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"2"}),f.jsx("h4",{className:"font-medium",children:"Load a Model"})]}),f.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Select and load a model that fits your hardware and requirements."})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"3"}),f.jsx("h4",{className:"font-medium",children:"Start Chatting"})]}),f.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Go to the playground and start experimenting with prompts."})]})]}),f.jsx("div",{className:"pt-4 border-t",children:f.jsx(zr,{to:"/playground",children:f.jsxs(Ce,{className:"w-full md:w-auto",children:[f.jsx(xr,{className:"h-4 w-4 mr-2"}),"Open Playground"]})})})]})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{children:"System Status"})}),f.jsxs(qe,{children:[f.jsxs("div",{className:"space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm",children:"Backend Status"}),f.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-green-600",children:[f.jsx("div",{className:"w-2 h-2 bg-green-600 rounded-full"}),"Online"]})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm",children:"Models Loaded"}),f.jsx("span",{className:"text-sm font-medium",children:"Ready"})]}),f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm",children:"Memory Usage"}),f.jsx("span",{className:"text-sm font-medium",children:"Optimized"})]})]}),f.jsx("div",{className:"pt-4 border-t",children:f.jsx(zr,{to:"/settings",children:f.jsxs(Ce,{variant:"outline",className:"w-full md:w-auto",children:[f.jsx(gy,{className:"h-4 w-4 mr-2"}),"View Settings"]})})})]})]})]})]})})}function ls(e,[t,n]){return Math.min(n,Math.max(t,e))}function le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function SE(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,a=g.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=g.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function _r(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const u=c=>{var m;const{scope:h,children:p,...w}=c,y=((m=h==null?void 0:h[e])==null?void 0:m[a])||s,S=g.useMemo(()=>w,Object.values(w));return f.jsx(y.Provider,{value:S,children:p})};u.displayName=o+"Provider";function d(c,h){var y;const p=((y=h==null?void 0:h[e])==null?void 0:y[a])||s,w=g.useContext(p);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,d]}const i=()=>{const o=n.map(l=>g.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,kE(i,...t)]}function kE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const c=a(o)[`__scope${u}`];return{...s,...c}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Ue=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},CE=vc[" useInsertionEffect ".trim().toString()]||Ue;function Po({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=EE({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const d=g.useRef(e!==void 0);g.useEffect(()=>{const c=d.current;c!==s&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${s?"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.`),d.current=s},[s,r])}const u=g.useCallback(d=>{var c;if(s){const h=bE(d)?d(e):d;h!==e&&((c=l.current)==null||c.call(l,h))}else o(d)},[s,e,o,l]);return[a,u]}function EE({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return CE(()=>{o.current=t},[t]),g.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function bE(e){return typeof e=="function"}var NE=g.createContext(void 0);function Ey(e){const t=g.useContext(NE);return e||t||"ltr"}function by(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ny(e){const[t,n]=g.useState(void 0);return Ue(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var PE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ne=PE.reduce((e,t)=>{const n=yi(`Primitive.${t}`),r=g.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function jE(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}function Py(e){const t=e+"CollectionProvider",[n,r]=_r(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:m}=y,v=Mt.useRef(null),x=Mt.useRef(new Map).current;return f.jsx(i,{scope:S,itemMap:x,collectionRef:v,children:m})};l.displayName=t;const s=e+"CollectionSlot",a=yi(s),u=Mt.forwardRef((y,S)=>{const{scope:m,children:v}=y,x=o(s,m),E=pe(S,x.collectionRef);return f.jsx(a,{ref:E,children:v})});u.displayName=s;const d=e+"CollectionItemSlot",c="data-radix-collection-item",h=yi(d),p=Mt.forwardRef((y,S)=>{const{scope:m,children:v,...x}=y,E=Mt.useRef(null),N=pe(S,E),b=o(d,m);return Mt.useEffect(()=>(b.itemMap.set(E,{ref:E,...x}),()=>void b.itemMap.delete(E))),f.jsx(h,{[c]:"",ref:N,children:v})});p.displayName=d;function w(y){const S=o(e+"CollectionConsumer",y);return Mt.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${c}]`));return Array.from(S.itemMap.values()).sort((b,P)=>x.indexOf(b.ref.current)-x.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:p},w,r]}var jy=["PageUp","PageDown"],_y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ry={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ei="Slider",[$u,_E,RE]=Py(Ei),[Ty,MA]=_r(Ei,[RE]),[TE,Is]=Ty(Ei),Ay=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:d,onValueChange:c=()=>{},onValueCommit:h=()=>{},inverted:p=!1,form:w,...y}=e,S=g.useRef(new Set),m=g.useRef(0),x=l==="horizontal"?AE:IE,[E=[],N]=Po({prop:d,defaultProp:u,onChange:M=>{var V;(V=[...S.current][m.current])==null||V.focus(),c(M)}}),b=g.useRef(E);function P(M){const j=zE(E,M);O(M,j)}function R(M){O(M,m.current)}function B(){const M=b.current[m.current];E[m.current]!==M&&h(E)}function O(M,j,{commit:V}={commit:!1}){const T=UE(o),D=VE(Math.round((M-r)/o)*o+r,T),U=ls(D,[r,i]);N((H=[])=>{const _=LE(H,U,j);if($E(_,a*o)){m.current=_.indexOf(U);const z=String(_)!==String(H);return z&&V&&h(_),z?_:H}else return H})}return f.jsx(TE,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:m,thumbs:S.current,values:E,orientation:l,form:w,children:f.jsx($u.Provider,{scope:e.__scopeSlider,children:f.jsx($u.Slot,{scope:e.__scopeSlider,children:f.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:le(y.onPointerDown,()=>{s||(b.current=E)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:P,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:B,onHomeKeyDown:()=>!s&&O(r,0,{commit:!0}),onEndKeyDown:()=>!s&&O(i,E.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:j})=>{if(!s){const D=jy.includes(M.key)||M.shiftKey&&_y.includes(M.key)?10:1,U=m.current,H=E[U],_=o*D*j;O(H+_,U,{commit:!0})}}})})})})});Ay.displayName=Ei;var[Iy,My]=Ty(Ei,{startEdge:"left",endEdge:"right",size:"width",direction:1}),AE=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...d}=e,[c,h]=g.useState(null),p=pe(t,x=>h(x)),w=g.useRef(void 0),y=Ey(i),S=y==="ltr",m=S&&!o||!S&&o;function v(x){const E=w.current||c.getBoundingClientRect(),N=[0,E.width],P=gd(N,m?[n,r]:[r,n]);return w.current=E,P(x-E.left)}return f.jsx(Iy,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:f.jsx(Oy,{dir:y,"data-orientation":"horizontal",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const E=v(x.clientX);l==null||l(E)},onSlideMove:x=>{const E=v(x.clientX);s==null||s(E)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const N=Ry[m?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:N?-1:1})}})})}),IE=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,d=g.useRef(null),c=pe(t,d),h=g.useRef(void 0),p=!i;function w(y){const S=h.current||d.current.getBoundingClientRect(),m=[0,S.height],x=gd(m,p?[r,n]:[n,r]);return h.current=S,x(y-S.top)}return f.jsx(Iy,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:f.jsx(Oy,{"data-orientation":"vertical",...u,ref:c,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const S=w(y.clientY);o==null||o(S)},onSlideMove:y=>{const S=w(y.clientY);l==null||l(S)},onSlideEnd:()=>{h.current=void 0,s==null||s()},onStepKeyDown:y=>{const m=Ry[p?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:m?-1:1})}})})}),Oy=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,d=Is(Ei,n);return f.jsx(ne.span,{...u,ref:t,onKeyDown:le(e.onKeyDown,c=>{c.key==="Home"?(l(c),c.preventDefault()):c.key==="End"?(s(c),c.preventDefault()):jy.concat(_y).includes(c.key)&&(a(c),c.preventDefault())}),onPointerDown:le(e.onPointerDown,c=>{const h=c.target;h.setPointerCapture(c.pointerId),c.preventDefault(),d.thumbs.has(h)?h.focus():r(c)}),onPointerMove:le(e.onPointerMove,c=>{c.target.hasPointerCapture(c.pointerId)&&i(c)}),onPointerUp:le(e.onPointerUp,c=>{const h=c.target;h.hasPointerCapture(c.pointerId)&&(h.releasePointerCapture(c.pointerId),o(c))})})}),Ly="SliderTrack",Dy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Is(Ly,n);return f.jsx(ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Dy.displayName=Ly;var Uu="SliderRange",zy=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Is(Uu,n),o=My(Uu,n),l=g.useRef(null),s=pe(t,l),a=i.values.length,u=i.values.map(h=>$y(h,i.min,i.max)),d=a>1?Math.min(...u):0,c=100-Math.max(...u);return f.jsx(ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:d+"%",[o.endEdge]:c+"%"}})});zy.displayName=Uu;var Vu="SliderThumb",Fy=g.forwardRef((e,t)=>{const n=_E(e.__scopeSlider),[r,i]=g.useState(null),o=pe(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(ME,{...e,ref:o,index:l})}),ME=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Is(Vu,n),s=My(Vu,n),[a,u]=g.useState(null),d=pe(t,v=>u(v)),c=a?l.form||!!a.closest("form"):!0,h=Ny(a),p=l.values[r],w=p===void 0?0:$y(p,l.min,l.max),y=DE(r,l.values.length),S=h==null?void 0:h[s.size],m=S?FE(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${m}px)`},children:[f.jsx($u.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(ne.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":p,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:d,style:p===void 0?{display:"none"}:e.style,onFocus:le(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),c&&f.jsx(By,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:p},r)]})});Fy.displayName=Vu;var OE="RadioBubbleInput",By=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=pe(i,r),l=by(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const c=new Event("input",{bubbles:!0});d.call(s,t),s.dispatchEvent(c)}},[l,t]),f.jsx(ne.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});By.displayName=OE;function LE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function $y(e,t,n){const o=100/(n-t)*(e-t);return ls(o,[0,100])}function DE(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function zE(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function FE(e,t,n){const r=e/2,o=gd([0,50],[0,r]);return(r-o(t)*n)*n}function BE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function $E(e,t){if(t>0){const n=BE(e);return Math.min(...n)>=t}return!0}function gd(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 UE(e){return(String(e).split(".")[1]||"").length}function VE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Uy=Ay,HE=Dy,WE=zy,KE=Fy;const Hu=g.forwardRef(({className:e,...t},n)=>f.jsxs(Uy,{ref:n,className:de("relative flex w-full touch-none select-none items-center",e),...t,children:[f.jsx(HE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:f.jsx(WE,{className:"absolute h-full bg-primary"})}),f.jsx(KE,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Hu.displayName=Uy.displayName;var GE="Label",Vy=g.forwardRef((e,t)=>f.jsx(ne.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Vy.displayName=GE;var Hy=Vy;const YE=hd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qt=g.forwardRef(({className:e,...t},n)=>f.jsx(Hy,{ref:n,className:de(YE(),e),...t}));Qt.displayName=Hy.displayName;const QE=hd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ae({className:e,variant:t,...n}){return f.jsx("div",{className:de(QE({variant:t}),e),...n})}function wr(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function XE(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e);g.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var qE="DismissableLayer",Wu="dismissableLayer.update",JE="dismissableLayer.pointerDownOutside",ZE="dismissableLayer.focusOutside",Cp,Wy=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=g.useContext(Wy),[d,c]=g.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),w=pe(t,P=>c(P)),y=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(S),v=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=m,N=nb(P=>{const R=P.target,B=[...u.branches].some(O=>O.contains(R));!E||B||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},h),b=rb(P=>{const R=P.target;[...u.branches].some(O=>O.contains(R))||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},h);return XE(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),g.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Cp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ep(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Cp)}},[d,h,n,u]),g.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ep())},[d,u]),g.useEffect(()=>{const P=()=>p({});return document.addEventListener(Wu,P),()=>document.removeEventListener(Wu,P)},[]),f.jsx(ne.div,{...a,ref:w,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:le(e.onFocusCapture,b.onFocusCapture),onBlurCapture:le(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:le(e.onPointerDownCapture,N.onPointerDownCapture)})});yd.displayName=qE;var eb="DismissableLayerBranch",tb=g.forwardRef((e,t)=>{const n=g.useContext(Wy),r=g.useRef(null),i=pe(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),f.jsx(ne.div,{...e,ref:i})});tb.displayName=eb;function nb(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Ky(JE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function rb(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ky(ZE,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ep(){const e=new CustomEvent(Wu);document.dispatchEvent(e)}function Ky(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?jE(i,o):i.dispatchEvent(o)}var ka=0;function Gy(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bp()),document.body.insertAdjacentElement("beforeend",e[1]??bp()),ka++,()=>{ka===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ka--}},[])}function bp(){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 Ca="focusScope.autoFocusOnMount",Ea="focusScope.autoFocusOnUnmount",Np={bubbles:!1,cancelable:!0},ib="FocusScope",vd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=g.useState(null),u=wr(i),d=wr(o),c=g.useRef(null),h=pe(t,y=>a(y)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(x){if(p.paused||!s)return;const E=x.target;s.contains(E)?c.current=E:Pn(c.current,{select:!0})},S=function(x){if(p.paused||!s)return;const E=x.relatedTarget;E!==null&&(s.contains(E)||Pn(c.current,{select:!0}))},m=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&Pn(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const v=new MutationObserver(m);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,p.paused]),g.useEffect(()=>{if(s){jp.add(p);const y=document.activeElement;if(!s.contains(y)){const m=new CustomEvent(Ca,Np);s.addEventListener(Ca,u),s.dispatchEvent(m),m.defaultPrevented||(ob(cb(Yy(s)),{select:!0}),document.activeElement===y&&Pn(s))}return()=>{s.removeEventListener(Ca,u),setTimeout(()=>{const m=new CustomEvent(Ea,Np);s.addEventListener(Ea,d),s.dispatchEvent(m),m.defaultPrevented||Pn(y??document.body,{select:!0}),s.removeEventListener(Ea,d),jp.remove(p)},0)}}},[s,u,d,p]);const w=g.useCallback(y=>{if(!n&&!r||p.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(S&&m){const v=y.currentTarget,[x,E]=lb(v);x&&E?!y.shiftKey&&m===E?(y.preventDefault(),n&&Pn(x,{select:!0})):y.shiftKey&&m===x&&(y.preventDefault(),n&&Pn(E,{select:!0})):m===v&&y.preventDefault()}},[n,r,p.paused]);return f.jsx(ne.div,{tabIndex:-1,...l,ref:h,onKeyDown:w})});vd.displayName=ib;function ob(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function lb(e){const t=Yy(e),n=Pp(t,e),r=Pp(t.reverse(),e);return[n,r]}function Yy(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Pp(e,t){for(const n of e)if(!sb(n,{upTo:t}))return n}function sb(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 ab(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ab(e)&&t&&e.select()}}var jp=ub();function ub(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_p(e,t),e.unshift(t)},remove(t){var n;e=_p(e,t),(n=e[0])==null||n.resume()}}}function _p(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function cb(e){return e.filter(t=>t.tagName!=="A")}var db=vc[" useId ".trim().toString()]||(()=>{}),fb=0;function pr(e){const[t,n]=g.useState(db());return Ue(()=>{e||n(r=>r??String(fb++))},[e]),e||(t?`radix-${t}`:"")}const pb=["top","right","bottom","left"],Kn=Math.min,ft=Math.max,ss=Math.round,ll=Math.floor,tn=e=>({x:e,y:e}),hb={left:"right",right:"left",bottom:"top",top:"bottom"},mb={start:"end",end:"start"};function Ku(e,t,n){return ft(e,Kn(t,n))}function yn(e,t){return typeof e=="function"?e(t):e}function vn(e){return e.split("-")[0]}function bi(e){return e.split("-")[1]}function xd(e){return e==="x"?"y":"x"}function wd(e){return e==="y"?"height":"width"}const gb=new Set(["top","bottom"]);function Jt(e){return gb.has(vn(e))?"y":"x"}function Sd(e){return xd(Jt(e))}function yb(e,t,n){n===void 0&&(n=!1);const r=bi(e),i=Sd(e),o=wd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=as(l)),[l,as(l)]}function vb(e){const t=as(e);return[Gu(e),t,Gu(t)]}function Gu(e){return e.replace(/start|end/g,t=>mb[t])}const Rp=["left","right"],Tp=["right","left"],xb=["top","bottom"],wb=["bottom","top"];function Sb(e,t,n){switch(e){case"top":case"bottom":return n?t?Tp:Rp:t?Rp:Tp;case"left":case"right":return t?xb:wb;default:return[]}}function kb(e,t,n,r){const i=bi(e);let o=Sb(vn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Gu)))),o}function as(e){return e.replace(/left|right|bottom|top/g,t=>hb[t])}function Cb(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qy(e){return typeof e!="number"?Cb(e):{top:e,right:e,bottom:e,left:e}}function us(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ap(e,t,n){let{reference:r,floating:i}=e;const o=Jt(t),l=Sd(t),s=wd(l),a=vn(t),u=o==="y",d=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(a){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:c};break;case"left":p={x:r.x-i.width,y:c};break;default:p={x:r.x,y:r.y}}switch(bi(t)){case"start":p[l]-=h*(n&&u?-1:1);break;case"end":p[l]+=h*(n&&u?-1:1);break}return p}const Eb=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:c}=Ap(u,r,a),h=r,p={},w=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:d=0}=yn(e,t)||{};if(u==null)return{};const c=Qy(d),h={x:n,y:r},p=Sd(i),w=wd(p),y=await l.getDimensions(u),S=p==="y",m=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",E=o.reference[w]+o.reference[p]-h[p]-o.floating[w],N=h[p]-o.reference[p],b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=b?b[x]:0;(!P||!await(l.isElement==null?void 0:l.isElement(b)))&&(P=s.floating[x]||o.floating[w]);const R=E/2-N/2,B=P/2-y[w]/2-1,O=Kn(c[m],B),M=Kn(c[v],B),j=O,V=P-y[w]-M,T=P/2-y[w]/2+R,D=Ku(j,T,V),U=!a.arrow&&bi(i)!=null&&T!==D&&o.reference[w]/2-(TT<=0)){var M,j;const T=(((M=o.flip)==null?void 0:M.index)||0)+1,D=P[T];if(D&&(!(c==="alignment"?v!==Jt(D):!1)||O.every(_=>Jt(_.placement)===v?_.overflows[0]>0:!0)))return{data:{index:T,overflows:O},reset:{placement:D}};let U=(j=O.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:j.placement;if(!U)switch(p){case"bestFit":{var V;const H=(V=O.filter(_=>{if(b){const z=Jt(_.placement);return z===v||z==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((_,z)=>_[1]-z[1])[0])==null?void 0:V[0];H&&(U=H);break}case"initialPlacement":U=s;break}if(i!==U)return{reset:{placement:U}}}return{}}}};function Ip(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Mp(e){return pb.some(t=>e[t]>=0)}const Pb=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=yn(e,t);switch(r){case"referenceHidden":{const o=await jo(t,{...i,elementContext:"reference"}),l=Ip(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Mp(l)}}}case"escaped":{const o=await jo(t,{...i,altBoundary:!0}),l=Ip(o,n.floating);return{data:{escapedOffsets:l,escaped:Mp(l)}}}default:return{}}}}},Xy=new Set(["left","top"]);async function jb(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=vn(n),s=bi(n),a=Jt(n)==="y",u=Xy.has(l)?-1:1,d=o&&a?-1:1,c=yn(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:w}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof w=="number"&&(p=s==="end"?w*-1:w),a?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const _b=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:s}=t,a=await jb(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},Rb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:S=>{let{x:m,y:v}=S;return{x:m,y:v}}},...a}=yn(e,t),u={x:n,y:r},d=await jo(t,a),c=Jt(vn(i)),h=xd(c);let p=u[h],w=u[c];if(o){const S=h==="y"?"top":"left",m=h==="y"?"bottom":"right",v=p+d[S],x=p-d[m];p=Ku(v,p,x)}if(l){const S=c==="y"?"top":"left",m=c==="y"?"bottom":"right",v=w+d[S],x=w-d[m];w=Ku(v,w,x)}const y=s.fn({...t,[h]:p,[c]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:o,[c]:l}}}}}},Tb=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=yn(e,t),d={x:n,y:r},c=Jt(i),h=xd(c);let p=d[h],w=d[c];const y=yn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=h==="y"?"height":"width",E=o.reference[h]-o.floating[x]+S.mainAxis,N=o.reference[h]+o.reference[x]-S.mainAxis;pN&&(p=N)}if(u){var m,v;const x=h==="y"?"width":"height",E=Xy.has(vn(i)),N=o.reference[c]-o.floating[x]+(E&&((m=l.offset)==null?void 0:m[c])||0)+(E?0:S.crossAxis),b=o.reference[c]+o.reference[x]+(E?0:((v=l.offset)==null?void 0:v[c])||0)-(E?S.crossAxis:0);wb&&(w=b)}return{[h]:p,[c]:w}}}},Ab=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=yn(e,t),d=await jo(t,u),c=vn(i),h=bi(i),p=Jt(i)==="y",{width:w,height:y}=o.floating;let S,m;c==="top"||c==="bottom"?(S=c,m=h===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,S=h==="end"?"top":"bottom");const v=y-d.top-d.bottom,x=w-d.left-d.right,E=Kn(y-d[S],v),N=Kn(w-d[m],x),b=!t.middlewareData.shift;let P=E,R=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),b&&!h){const O=ft(d.left,0),M=ft(d.right,0),j=ft(d.top,0),V=ft(d.bottom,0);p?R=w-2*(O!==0||M!==0?O+M:ft(d.left,d.right)):P=y-2*(j!==0||V!==0?j+V:ft(d.top,d.bottom))}await a({...t,availableWidth:R,availableHeight:P});const B=await l.getDimensions(s.floating);return w!==B.width||y!==B.height?{reset:{rects:!0}}:{}}}};function Ms(){return typeof window<"u"}function Ni(e){return qy(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function on(e){var t;return(t=(qy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qy(e){return Ms()?e instanceof Node||e instanceof gt(e).Node:!1}function $t(e){return Ms()?e instanceof Element||e instanceof gt(e).Element:!1}function nn(e){return Ms()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function Op(e){return!Ms()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}const Ib=new Set(["inline","contents"]);function zo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ib.has(i)}const Mb=new Set(["table","td","th"]);function Ob(e){return Mb.has(Ni(e))}const Lb=[":popover-open",":modal"];function Os(e){return Lb.some(t=>{try{return e.matches(t)}catch{return!1}})}const Db=["transform","translate","scale","rotate","perspective"],zb=["transform","translate","scale","rotate","perspective","filter"],Fb=["paint","layout","strict","content"];function kd(e){const t=Cd(),n=$t(e)?Ut(e):e;return Db.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)||zb.some(r=>(n.willChange||"").includes(r))||Fb.some(r=>(n.contain||"").includes(r))}function Bb(e){let t=Gn(e);for(;nn(t)&&!vi(t);){if(kd(t))return t;if(Os(t))return null;t=Gn(t)}return null}function Cd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $b=new Set(["html","body","#document"]);function vi(e){return $b.has(Ni(e))}function Ut(e){return gt(e).getComputedStyle(e)}function Ls(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gn(e){if(Ni(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Op(e)&&e.host||on(e);return Op(t)?t.host:t}function Jy(e){const t=Gn(e);return vi(t)?e.ownerDocument?e.ownerDocument.body:e.body:nn(t)&&zo(t)?t:Jy(t)}function _o(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Jy(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=gt(i);if(o){const s=Yu(l);return t.concat(l,l.visualViewport||[],zo(i)?i:[],s&&n?_o(s):[])}return t.concat(i,_o(i,[],n))}function Yu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zy(e){const t=Ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=nn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ss(n)!==o||ss(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Ed(e){return $t(e)?e:e.contextElement}function ii(e){const t=Ed(e);if(!nn(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Zy(t);let l=(o?ss(n.width):n.width)/r,s=(o?ss(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Ub=tn(0);function ev(e){const t=gt(e);return!Cd()||!t.visualViewport?Ub:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vb(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function Sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Ed(e);let l=tn(1);t&&(r?$t(r)&&(l=ii(r)):l=ii(e));const s=Vb(o,n,r)?ev(o):tn(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,d=i.width/l.x,c=i.height/l.y;if(o){const h=gt(o),p=r&&$t(r)?gt(r):r;let w=h,y=Yu(w);for(;y&&r&&p!==w;){const S=ii(y),m=y.getBoundingClientRect(),v=Ut(y),x=m.left+(y.clientLeft+parseFloat(v.paddingLeft))*S.x,E=m.top+(y.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,d*=S.x,c*=S.y,a+=x,u+=E,w=gt(y),y=Yu(w)}}return us({width:d,height:c,x:a,y:u})}function Ds(e,t){const n=Ls(e).scrollLeft;return t?t.left+n:Sr(on(e)).left+n}function tv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ds(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Hb(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=on(r),s=t?Os(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=tn(1);const d=tn(0),c=nn(r);if((c||!c&&!o)&&((Ni(r)!=="body"||zo(l))&&(a=Ls(r)),nn(r))){const p=Sr(r);u=ii(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=l&&!c&&!o?tv(l,a):tn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-a.scrollTop*u.y+d.y+h.y}}function Wb(e){return Array.from(e.getClientRects())}function Kb(e){const t=on(e),n=Ls(e),r=e.ownerDocument.body,i=ft(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ft(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ds(e);const s=-n.scrollTop;return Ut(r).direction==="rtl"&&(l+=ft(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const Lp=25;function Gb(e,t){const n=gt(e),r=on(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const d=Cd();(!d||d&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Ds(r);if(u<=0){const d=r.ownerDocument,c=d.body,h=getComputedStyle(c),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-c.clientWidth-p);w<=Lp&&(o-=w)}else u<=Lp&&(o+=u);return{width:o,height:l,x:s,y:a}}const Yb=new Set(["absolute","fixed"]);function Qb(e,t){const n=Sr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=nn(e)?ii(e):tn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function Dp(e,t,n){let r;if(t==="viewport")r=Gb(e,n);else if(t==="document")r=Kb(on(e));else if($t(t))r=Qb(t,n);else{const i=ev(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return us(r)}function nv(e,t){const n=Gn(e);return n===t||!$t(n)||vi(n)?!1:Ut(n).position==="fixed"||nv(n,t)}function Xb(e,t){const n=t.get(e);if(n)return n;let r=_o(e,[],!1).filter(s=>$t(s)&&Ni(s)!=="body"),i=null;const o=Ut(e).position==="fixed";let l=o?Gn(e):e;for(;$t(l)&&!vi(l);){const s=Ut(l),a=kd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&Yb.has(i.position)||zo(l)&&!a&&nv(e,l))?r=r.filter(d=>d!==l):i=s,l=Gn(l)}return t.set(e,r),r}function qb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Os(t)?[]:Xb(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,d)=>{const c=Dp(t,d,i);return u.top=ft(c.top,u.top),u.right=Kn(c.right,u.right),u.bottom=Kn(c.bottom,u.bottom),u.left=ft(c.left,u.left),u},Dp(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Jb(e){const{width:t,height:n}=Zy(e);return{width:t,height:n}}function Zb(e,t,n){const r=nn(t),i=on(t),o=n==="fixed",l=Sr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=tn(0);function u(){a.x=Ds(i)}if(r||!r&&!o)if((Ni(t)!=="body"||zo(i))&&(s=Ls(t)),r){const p=Sr(t,!0,o,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else i&&u();o&&!r&&i&&u();const d=i&&!r&&!o?tv(i,s):tn(0),c=l.left+s.scrollLeft-a.x-d.x,h=l.top+s.scrollTop-a.y-d.y;return{x:c,y:h,width:l.width,height:l.height}}function ba(e){return Ut(e).position==="static"}function zp(e,t){if(!nn(e)||Ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return on(e)===n&&(n=n.ownerDocument.body),n}function rv(e,t){const n=gt(e);if(Os(e))return n;if(!nn(e)){let i=Gn(e);for(;i&&!vi(i);){if($t(i)&&!ba(i))return i;i=Gn(i)}return n}let r=zp(e,t);for(;r&&Ob(r)&&ba(r);)r=zp(r,t);return r&&vi(r)&&ba(r)&&!kd(r)?n:r||Bb(e)||n}const eN=async function(e){const t=this.getOffsetParent||rv,n=this.getDimensions,r=await n(e.floating);return{reference:Zb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tN(e){return Ut(e).direction==="rtl"}const nN={convertOffsetParentRelativeRectToViewportRelativeRect:Hb,getDocumentElement:on,getClippingRect:qb,getOffsetParent:rv,getElementRects:eN,getClientRects:Wb,getDimensions:Jb,getScale:ii,isElement:$t,isRTL:tN};function iv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rN(e,t){let n=null,r;const i=on(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:d,top:c,width:h,height:p}=u;if(s||t(),!h||!p)return;const w=ll(c),y=ll(i.clientWidth-(d+h)),S=ll(i.clientHeight-(c+p)),m=ll(d),x={rootMargin:-w+"px "+-y+"px "+-S+"px "+-m+"px",threshold:ft(0,Kn(1,a))||1};let E=!0;function N(b){const P=b[0].intersectionRatio;if(P!==a){if(!E)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!iv(u,e.getBoundingClientRect())&&l(),E=!1}try{n=new IntersectionObserver(N,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,x)}n.observe(e)}return l(!0),o}function iN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Ed(e),d=i||o?[...u?_o(u):[],..._o(t)]:[];d.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const c=u&&s?rN(u,n):null;let h=-1,p=null;l&&(p=new ResizeObserver(m=>{let[v]=m;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),u&&!a&&p.observe(u),p.observe(t));let w,y=a?Sr(e):null;a&&S();function S(){const m=Sr(e);y&&!iv(y,m)&&n(),y=m,w=requestAnimationFrame(S)}return n(),()=>{var m;d.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),c==null||c(),(m=p)==null||m.disconnect(),p=null,a&&cancelAnimationFrame(w)}}const oN=_b,lN=Rb,sN=Nb,aN=Ab,uN=Pb,Fp=bb,cN=Tb,dN=(e,t,n)=>{const r=new Map,i={platform:nN,...n},o={...i.platform,_c:r};return Eb(e,t,{...i,platform:o})};var fN=typeof document<"u",pN=function(){},Pl=fN?g.useLayoutEffect:pN;function cs(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,i;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(!cs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!cs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ov(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bp(e,t){const n=ov(e);return Math.round(t*n)/n}function Na(e){const t=g.useRef(e);return Pl(()=>{t.current=e}),t}function hN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[d,c]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=g.useState(r);cs(h,r)||p(r);const[w,y]=g.useState(null),[S,m]=g.useState(null),v=g.useCallback(_=>{_!==b.current&&(b.current=_,y(_))},[]),x=g.useCallback(_=>{_!==P.current&&(P.current=_,m(_))},[]),E=o||w,N=l||S,b=g.useRef(null),P=g.useRef(null),R=g.useRef(d),B=a!=null,O=Na(a),M=Na(i),j=Na(u),V=g.useCallback(()=>{if(!b.current||!P.current)return;const _={placement:t,strategy:n,middleware:h};M.current&&(_.platform=M.current),dN(b.current,P.current,_).then(z=>{const k={...z,isPositioned:j.current!==!1};T.current&&!cs(R.current,k)&&(R.current=k,ki.flushSync(()=>{c(k)}))})},[h,t,n,M,j]);Pl(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,c(_=>({..._,isPositioned:!1})))},[u]);const T=g.useRef(!1);Pl(()=>(T.current=!0,()=>{T.current=!1}),[]),Pl(()=>{if(E&&(b.current=E),N&&(P.current=N),E&&N){if(O.current)return O.current(E,N,V);V()}},[E,N,V,O,B]);const D=g.useMemo(()=>({reference:b,floating:P,setReference:v,setFloating:x}),[v,x]),U=g.useMemo(()=>({reference:E,floating:N}),[E,N]),H=g.useMemo(()=>{const _={position:n,left:0,top:0};if(!U.floating)return _;const z=Bp(U.floating,d.x),k=Bp(U.floating,d.y);return s?{..._,transform:"translate("+z+"px, "+k+"px)",...ov(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,U.floating,d.x,d.y]);return g.useMemo(()=>({...d,update:V,refs:D,elements:U,floatingStyles:H}),[d,V,D,U,H])}const mN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Fp({element:r.current,padding:i}).fn(n):{}:r?Fp({element:r,padding:i}).fn(n):{}}}},gN=(e,t)=>({...oN(e),options:[e,t]}),yN=(e,t)=>({...lN(e),options:[e,t]}),vN=(e,t)=>({...cN(e),options:[e,t]}),xN=(e,t)=>({...sN(e),options:[e,t]}),wN=(e,t)=>({...aN(e),options:[e,t]}),SN=(e,t)=>({...uN(e),options:[e,t]}),kN=(e,t)=>({...mN(e),options:[e,t]});var CN="Arrow",lv=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return f.jsx(ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});lv.displayName=CN;var EN=lv,bd="Popper",[sv,av]=_r(bd),[bN,uv]=sv(bd),cv=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return f.jsx(bN,{scope:t,anchor:r,onAnchorChange:i,children:n})};cv.displayName=bd;var dv="PopperAnchor",fv=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=uv(dv,n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return g.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:f.jsx(ne.div,{...i,ref:s})});fv.displayName=dv;var Nd="PopperContent",[NN,PN]=sv(Nd),pv=g.forwardRef((e,t)=>{var K,re,be,ie,oe,fe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:w,...y}=e,S=uv(Nd,n),[m,v]=g.useState(null),x=pe(t,Qe=>v(Qe)),[E,N]=g.useState(null),b=Ny(E),P=(b==null?void 0:b.width)??0,R=(b==null?void 0:b.height)??0,B=r+(o!=="center"?"-"+o:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],j=M.length>0,V={padding:O,boundary:M.filter(_N),altBoundary:j},{refs:T,floatingStyles:D,placement:U,isPositioned:H,middlewareData:_}=hN({strategy:"fixed",placement:B,whileElementsMounted:(...Qe)=>iN(...Qe,{animationFrame:p==="always"}),elements:{reference:S.anchor},middleware:[gN({mainAxis:i+R,alignmentAxis:l}),a&&yN({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?vN():void 0,...V}),a&&xN({...V}),wN({...V,apply:({elements:Qe,rects:wt,availableWidth:Sn,availableHeight:kn})=>{const{width:Cn,height:Ys}=wt.reference,tr=Qe.floating.style;tr.setProperty("--radix-popper-available-width",`${Sn}px`),tr.setProperty("--radix-popper-available-height",`${kn}px`),tr.setProperty("--radix-popper-anchor-width",`${Cn}px`),tr.setProperty("--radix-popper-anchor-height",`${Ys}px`)}}),E&&kN({element:E,padding:s}),RN({arrowWidth:P,arrowHeight:R}),h&&SN({strategy:"referenceHidden",...V})]}),[z,k]=gv(U),G=wr(w);Ue(()=>{H&&(G==null||G())},[H,G]);const A=(K=_.arrow)==null?void 0:K.x,C=(re=_.arrow)==null?void 0:re.y,Y=((be=_.arrow)==null?void 0:be.centerOffset)!==0,[ue,Q]=g.useState();return Ue(()=>{m&&Q(window.getComputedStyle(m).zIndex)},[m]),f.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:H?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(ie=_.transformOrigin)==null?void 0:ie.x,(oe=_.transformOrigin)==null?void 0:oe.y].join(" "),...((fe=_.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(NN,{scope:n,placedSide:z,onArrowChange:N,arrowX:A,arrowY:C,shouldHideArrow:Y,children:f.jsx(ne.div,{"data-side":z,"data-align":k,...y,ref:x,style:{...y.style,animation:H?void 0:"none"}})})})});pv.displayName=Nd;var hv="PopperArrow",jN={top:"bottom",right:"left",bottom:"top",left:"right"},mv=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=PN(hv,r),l=jN[o.placedSide];return f.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:f.jsx(EN,{...i,ref:n,style:{...i.style,display:"block"}})})});mv.displayName=hv;function _N(e){return e!==null}var RN=e=>({name:"transformOrigin",options:e,fn(t){var S,m,v;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,d]=gv(n),c={start:"0%",center:"50%",end:"100%"}[d],h=(((m=i.arrow)==null?void 0:m.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+a/2;let w="",y="";return u==="bottom"?(w=l?c:`${h}px`,y=`${-a}px`):u==="top"?(w=l?c:`${h}px`,y=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,y=l?c:`${p}px`):u==="left"&&(w=`${r.floating.width+a}px`,y=l?c:`${p}px`),{data:{x:w,y}}}});function gv(e){const[t,n="center"]=e.split("-");return[t,n]}var TN=cv,AN=fv,IN=pv,MN=mv,ON="Portal",Pd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);Ue(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?bS.createPortal(f.jsx(ne.div,{...r,ref:t}),l):null});Pd.displayName=ON;var yv=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"}),LN="VisuallyHidden",DN=g.forwardRef((e,t)=>f.jsx(ne.span,{...e,ref:t,style:{...yv,...e.style}}));DN.displayName=LN;var zN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ir=new WeakMap,sl=new WeakMap,al={},Pa=0,vv=function(e){return e&&(e.host||vv(e.parentNode))},FN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vv(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})},BN=function(e,t,n,r){var i=FN(t,Array.isArray(e)?e:[e]);al[n]||(al[n]=new WeakMap);var o=al[n],l=[],s=new Set,a=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.forEach(u);var d=function(c){!c||a.has(c)||Array.prototype.forEach.call(c.children,function(h){if(s.has(h))d(h);else try{var p=h.getAttribute(r),w=p!==null&&p!=="false",y=(Ir.get(h)||0)+1,S=(o.get(h)||0)+1;Ir.set(h,y),o.set(h,S),l.push(h),y===1&&w&&sl.set(h,!0),S===1&&h.setAttribute(n,"true"),w||h.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",h,m)}})};return d(t),s.clear(),Pa++,function(){l.forEach(function(c){var h=Ir.get(c)-1,p=o.get(c)-1;Ir.set(c,h),o.set(c,p),h||(sl.has(c)||c.removeAttribute(r),sl.delete(c)),p||c.removeAttribute(n)}),Pa--,Pa||(Ir=new WeakMap,Ir=new WeakMap,sl=new WeakMap,al={})}},xv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||zN(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),BN(r,i,n,"aria-hidden")):function(){return null}},Xt=function(){return Xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return r2;var t=i2(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])}},l2=Cv(),oi="data-scroll-locked",s2=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(UN,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(oi,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(jl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(_l,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jl," .").concat(jl,` { + right: 0 `).concat(r,`; + } + + .`).concat(_l," .").concat(_l,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(oi,`] { + `).concat(VN,": ").concat(s,`px; + } +`)},Vp=function(){var e=parseInt(document.body.getAttribute(oi)||"0",10);return isFinite(e)?e:0},a2=function(){g.useEffect(function(){return document.body.setAttribute(oi,(Vp()+1).toString()),function(){var e=Vp()-1;e<=0?document.body.removeAttribute(oi):document.body.setAttribute(oi,e.toString())}},[])},u2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;a2();var o=g.useMemo(function(){return o2(i)},[i]);return g.createElement(l2,{styles:s2(o,!t,i,n?"":"!important")})},Qu=!1;if(typeof window<"u")try{var ul=Object.defineProperty({},"passive",{get:function(){return Qu=!0,!0}});window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{Qu=!1}var Mr=Qu?{passive:!1}:!1,c2=function(e){return e.tagName==="TEXTAREA"},Ev=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!c2(e)&&n[t]==="visible")},d2=function(e){return Ev(e,"overflowY")},f2=function(e){return Ev(e,"overflowX")},Hp=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=bv(e,r);if(i){var o=Nv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},p2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},h2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bv=function(e,t){return e==="v"?d2(t):f2(t)},Nv=function(e,t){return e==="v"?p2(t):h2(t)},m2=function(e,t){return e==="h"&&t==="rtl"?-1:1},g2=function(e,t,n,r,i){var o=m2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,d=l>0,c=0,h=0;do{if(!s)break;var p=Nv(e,s),w=p[0],y=p[1],S=p[2],m=y-S-o*w;(w||m)&&bv(e,s)&&(c+=m,h+=w);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(d&&(i&&Math.abs(c)<1||!i&&l>c)||!d&&(i&&Math.abs(h)<1||!i&&-l>h))&&(u=!0),u},cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wp=function(e){return[e.deltaX,e.deltaY]},Kp=function(e){return e&&"current"in e?e.current:e},y2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},v2=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},x2=0,Or=[];function w2(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(x2++)[0],o=g.useState(Cv)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=$N([e.lockRef.current],(e.shards||[]).map(Kp),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var m=cl(y),v=n.current,x="deltaX"in y?y.deltaX:v[0]-m[0],E="deltaY"in y?y.deltaY:v[1]-m[1],N,b=y.target,P=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in y&&P==="h"&&b.type==="range")return!1;var R=Hp(P,b);if(!R)return!0;if(R?N=P:(N=P==="v"?"h":"v",R=Hp(P,b)),!R)return!1;if(!r.current&&"changedTouches"in y&&(x||E)&&(r.current=N),!N)return!0;var B=r.current||N;return g2(B,S,y,B==="h"?x:E,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Or.length||Or[Or.length-1]!==o)){var m="deltaY"in S?Wp(S):cl(S),v=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&y2(N.delta,m)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(l.current.shards||[]).map(Kp).filter(Boolean).filter(function(N){return N.contains(S.target)}),E=x.length>0?s(S,x[0]):!l.current.noIsolation;E&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(y,S,m,v){var x={name:y,delta:S,target:m,should:v,shadowParent:S2(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),d=g.useCallback(function(y){n.current=cl(y),r.current=void 0},[]),c=g.useCallback(function(y){u(y.type,Wp(y),y.target,s(y,e.lockRef.current))},[]),h=g.useCallback(function(y){u(y.type,cl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Or.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",a,Mr),document.addEventListener("touchmove",a,Mr),document.addEventListener("touchstart",d,Mr),function(){Or=Or.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Mr),document.removeEventListener("touchmove",a,Mr),document.removeEventListener("touchstart",d,Mr)}},[]);var p=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:v2(i)}):null,p?g.createElement(u2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function S2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const k2=XN(kv,w2);var Pv=g.forwardRef(function(e,t){return g.createElement(zs,Xt({},e,{ref:t,sideCar:k2}))});Pv.classNames=zs.classNames;const jv=Pv;var C2=[" ","Enter","ArrowUp","ArrowDown"],E2=[" ","Enter"],kr="Select",[Fs,Bs,b2]=Py(kr),[Pi,OA]=_r(kr,[b2,av]),$s=av(),[N2,Jn]=Pi(kr),[P2,j2]=Pi(kr),_v=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:d,autoComplete:c,disabled:h,required:p,form:w}=e,y=$s(t),[S,m]=g.useState(null),[v,x]=g.useState(null),[E,N]=g.useState(!1),b=Ey(u),[P,R]=Po({prop:r,defaultProp:i??!1,onChange:o,caller:kr}),[B,O]=Po({prop:l,defaultProp:s,onChange:a,caller:kr}),M=g.useRef(null),j=S?w||!!S.closest("form"):!0,[V,T]=g.useState(new Set),D=Array.from(V).map(U=>U.props.value).join(";");return f.jsx(TN,{...y,children:f.jsxs(N2,{required:p,scope:t,trigger:S,onTriggerChange:m,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:N,contentId:pr(),value:B,onValueChange:O,open:P,onOpenChange:R,dir:b,triggerPointerDownPosRef:M,disabled:h,children:[f.jsx(Fs.Provider,{scope:t,children:f.jsx(P2,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(U=>{T(H=>new Set(H).add(U))},[]),onNativeOptionRemove:g.useCallback(U=>{T(H=>{const _=new Set(H);return _.delete(U),_})},[]),children:n})}),j?f.jsxs(ex,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:c,value:B,onChange:U=>O(U.target.value),disabled:h,form:w,children:[B===void 0?f.jsx("option",{value:""}):null,Array.from(V)]},D):null]})})};_v.displayName=kr;var Rv="SelectTrigger",Tv=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=$s(n),l=Jn(Rv,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=Bs(n),d=g.useRef("touch"),[c,h,p]=nx(y=>{const S=u().filter(x=>!x.disabled),m=S.find(x=>x.value===l.value),v=rx(S,y,m);v!==void 0&&l.onValueChange(v.value)}),w=y=>{s||(l.onOpenChange(!0),p()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return f.jsx(AN,{asChild:!0,...o,children:f.jsx(ne.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:s,"data-disabled":s?"":void 0,"data-placeholder":tx(l.value)?"":void 0,...i,ref:a,onClick:le(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&w(y)}),onPointerDown:le(i.onPointerDown,y=>{d.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(w(y),y.preventDefault())}),onKeyDown:le(i.onKeyDown,y=>{const S=c.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(S&&y.key===" ")&&C2.includes(y.key)&&(w(),y.preventDefault())})})})});Tv.displayName=Rv;var Av="SelectValue",Iv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=Jn(Av,n),{onValueNodeHasChildrenChange:u}=a,d=o!==void 0,c=pe(t,a.onValueNodeChange);return Ue(()=>{u(d)},[u,d]),f.jsx(ne.span,{...s,ref:c,style:{pointerEvents:"none"},children:tx(a.value)?f.jsx(f.Fragment,{children:l}):o})});Iv.displayName=Av;var _2="SelectIcon",Mv=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return f.jsx(ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Mv.displayName=_2;var R2="SelectPortal",Ov=e=>f.jsx(Pd,{asChild:!0,...e});Ov.displayName=R2;var Cr="SelectContent",Lv=g.forwardRef((e,t)=>{const n=Jn(Cr,e.__scopeSelect),[r,i]=g.useState();if(Ue(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ki.createPortal(f.jsx(Dv,{scope:e.__scopeSelect,children:f.jsx(Fs.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),o):null}return f.jsx(zv,{...e,ref:t})});Lv.displayName=Cr;var At=10,[Dv,Zn]=Pi(Cr),T2="SelectContentImpl",A2=yi("SelectContent.RemoveScroll"),zv=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:y,avoidCollisions:S,...m}=e,v=Jn(Cr,n),[x,E]=g.useState(null),[N,b]=g.useState(null),P=pe(t,K=>E(K)),[R,B]=g.useState(null),[O,M]=g.useState(null),j=Bs(n),[V,T]=g.useState(!1),D=g.useRef(!1);g.useEffect(()=>{if(x)return xv(x)},[x]),Gy();const U=g.useCallback(K=>{const[re,...be]=j().map(fe=>fe.ref.current),[ie]=be.slice(-1),oe=document.activeElement;for(const fe of K)if(fe===oe||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===re&&N&&(N.scrollTop=0),fe===ie&&N&&(N.scrollTop=N.scrollHeight),fe==null||fe.focus(),document.activeElement!==oe))return},[j,N]),H=g.useCallback(()=>U([R,x]),[U,R,x]);g.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:_,triggerPointerDownPosRef:z}=v;g.useEffect(()=>{if(x){let K={x:0,y:0};const re=ie=>{var oe,fe;K={x:Math.abs(Math.round(ie.pageX)-(((oe=z.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((fe=z.current)==null?void 0:fe.y)??0))}},be=ie=>{K.x<=10&&K.y<=10?ie.preventDefault():x.contains(ie.target)||_(!1),document.removeEventListener("pointermove",re),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",be,{capture:!0})}}},[x,_,z]),g.useEffect(()=>{const K=()=>_(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[_]);const[k,G]=nx(K=>{const re=j().filter(oe=>!oe.disabled),be=re.find(oe=>oe.ref.current===document.activeElement),ie=rx(re,K,be);ie&&setTimeout(()=>ie.ref.current.focus())}),A=g.useCallback((K,re,be)=>{const ie=!D.current&&!be;(v.value!==void 0&&v.value===re||ie)&&(B(K),ie&&(D.current=!0))},[v.value]),C=g.useCallback(()=>x==null?void 0:x.focus(),[x]),Y=g.useCallback((K,re,be)=>{const ie=!D.current&&!be;(v.value!==void 0&&v.value===re||ie)&&M(K)},[v.value]),ue=r==="popper"?Xu:Fv,Q=ue===Xu?{side:s,sideOffset:a,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return f.jsx(Dv,{scope:n,content:x,viewport:N,onViewportChange:b,itemRefCallback:A,selectedItem:R,onItemLeave:C,itemTextRefCallback:Y,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:V,searchRef:k,children:f.jsx(jv,{as:A2,allowPinchZoom:!0,children:f.jsx(vd,{asChild:!0,trapped:v.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:le(i,K=>{var re;(re=v.trigger)==null||re.focus({preventScroll:!0}),K.preventDefault()}),children:f.jsx(yd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:K=>K.preventDefault(),...m,...Q,onPlaced:()=>T(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:le(m.onKeyDown,K=>{const re=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!re&&K.key.length===1&&G(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ie=j().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const oe=K.target,fe=ie.indexOf(oe);ie=ie.slice(fe+1)}setTimeout(()=>U(ie)),K.preventDefault()}})})})})})})});zv.displayName=T2;var I2="SelectItemAlignedPosition",Fv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Jn(Cr,n),l=Zn(Cr,n),[s,a]=g.useState(null),[u,d]=g.useState(null),c=pe(t,P=>d(P)),h=Bs(n),p=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:m,focusSelectedItem:v}=l,x=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&y&&S&&m){const P=o.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),B=o.valueNode.getBoundingClientRect(),O=m.getBoundingClientRect();if(o.dir!=="rtl"){const oe=O.left-R.left,fe=B.left-oe,Qe=P.left-fe,wt=P.width+Qe,Sn=Math.max(wt,R.width),kn=window.innerWidth-At,Cn=ls(fe,[At,Math.max(At,kn-Sn)]);s.style.minWidth=wt+"px",s.style.left=Cn+"px"}else{const oe=R.right-O.right,fe=window.innerWidth-B.right-oe,Qe=window.innerWidth-P.right-fe,wt=P.width+Qe,Sn=Math.max(wt,R.width),kn=window.innerWidth-At,Cn=ls(fe,[At,Math.max(At,kn-Sn)]);s.style.minWidth=wt+"px",s.style.right=Cn+"px"}const M=h(),j=window.innerHeight-At*2,V=y.scrollHeight,T=window.getComputedStyle(u),D=parseInt(T.borderTopWidth,10),U=parseInt(T.paddingTop,10),H=parseInt(T.borderBottomWidth,10),_=parseInt(T.paddingBottom,10),z=D+U+V+_+H,k=Math.min(S.offsetHeight*5,z),G=window.getComputedStyle(y),A=parseInt(G.paddingTop,10),C=parseInt(G.paddingBottom,10),Y=P.top+P.height/2-At,ue=j-Y,Q=S.offsetHeight/2,K=S.offsetTop+Q,re=D+U+K,be=z-re;if(re<=Y){const oe=M.length>0&&S===M[M.length-1].ref.current;s.style.bottom="0px";const fe=u.clientHeight-y.offsetTop-y.offsetHeight,Qe=Math.max(ue,Q+(oe?C:0)+fe+H),wt=re+Qe;s.style.height=wt+"px"}else{const oe=M.length>0&&S===M[0].ref.current;s.style.top="0px";const Qe=Math.max(Y,D+y.offsetTop+(oe?A:0)+Q)+be;s.style.height=Qe+"px",y.scrollTop=re-Y+y.offsetTop}s.style.margin=`${At}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,u,y,S,m,o.dir,r]);Ue(()=>x(),[x]);const[E,N]=g.useState();Ue(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const b=g.useCallback(P=>{P&&w.current===!0&&(x(),v==null||v(),w.current=!1)},[x,v]);return f.jsx(O2,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:b,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:f.jsx(ne.div,{...i,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Fv.displayName=I2;var M2="SelectPopperPosition",Xu=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=At,...o}=e,l=$s(n);return f.jsx(IN,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});Xu.displayName=M2;var[O2,jd]=Pi(Cr,{}),qu="SelectViewport",Bv=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Zn(qu,n),l=jd(qu,n),s=pe(t,o.onViewportChange),a=g.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(Fs.Slot,{scope:n,children:f.jsx(ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:le(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:h}=l;if(h!=null&&h.current&&c){const p=Math.abs(a.current-d.scrollTop);if(p>0){const w=window.innerHeight-At*2,y=parseFloat(c.style.minHeight),S=parseFloat(c.style.height),m=Math.max(y,S);if(m0?E:0,c.style.justifyContent="flex-end")}}}a.current=d.scrollTop})})})]})});Bv.displayName=qu;var $v="SelectGroup",[L2,D2]=Pi($v),Uv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pr();return f.jsx(L2,{scope:n,id:i,children:f.jsx(ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Uv.displayName=$v;var Vv="SelectLabel",Hv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=D2(Vv,n);return f.jsx(ne.div,{id:i.id,...r,ref:t})});Hv.displayName=Vv;var ds="SelectItem",[z2,Wv]=Pi(ds),Kv=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=Jn(ds,n),a=Zn(ds,n),u=s.value===r,[d,c]=g.useState(o??""),[h,p]=g.useState(!1),w=pe(t,v=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,v,r,i)}),y=pr(),S=g.useRef("touch"),m=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A 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(z2,{scope:n,value:r,disabled:i,textId:y,isSelected:u,onItemTextChange:g.useCallback(v=>{c(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:f.jsx(Fs.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:f.jsx(ne.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:le(l.onFocus,()=>p(!0)),onBlur:le(l.onBlur,()=>p(!1)),onClick:le(l.onClick,()=>{S.current!=="mouse"&&m()}),onPointerUp:le(l.onPointerUp,()=>{S.current==="mouse"&&m()}),onPointerDown:le(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:le(l.onPointerMove,v=>{var x;S.current=v.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:le(l.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:le(l.onKeyDown,v=>{var E;((E=a.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(E2.includes(v.key)&&m(),v.key===" "&&v.preventDefault())})})})})});Kv.displayName=ds;var Yi="SelectItemText",Gv=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=Jn(Yi,n),s=Zn(Yi,n),a=Wv(Yi,n),u=j2(Yi,n),[d,c]=g.useState(null),h=pe(t,m=>c(m),a.onItemTextChange,m=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,m,a.value,a.disabled)}),p=d==null?void 0:d.textContent,w=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:p},a.value),[a.disabled,a.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=u;return Ue(()=>(y(w),()=>S(w)),[y,S,w]),f.jsxs(f.Fragment,{children:[f.jsx(ne.span,{id:a.textId,...o,ref:h}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ki.createPortal(o.children,l.valueNode):null]})});Gv.displayName=Yi;var Yv="SelectItemIndicator",Qv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Wv(Yv,n).isSelected?f.jsx(ne.span,{"aria-hidden":!0,...r,ref:t}):null});Qv.displayName=Yv;var Ju="SelectScrollUpButton",Xv=g.forwardRef((e,t)=>{const n=Zn(Ju,e.__scopeSelect),r=jd(Ju,e.__scopeSelect),[i,o]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return Ue(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?f.jsx(Jv,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Xv.displayName=Ju;var Zu="SelectScrollDownButton",qv=g.forwardRef((e,t)=>{const n=Zn(Zu,e.__scopeSelect),r=jd(Zu,e.__scopeSelect),[i,o]=g.useState(!1),l=pe(t,r.onScrollButtonChange);return Ue(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?f.jsx(Jv,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});qv.displayName=Zu;var Jv=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Zn("SelectScrollButton",n),l=g.useRef(null),s=Bs(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),Ue(()=>{var d;const u=s().find(c=>c.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),f.jsx(ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:le(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:le(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:le(i.onPointerLeave,()=>{a()})})}),F2="SelectSeparator",Zv=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ne.div,{"aria-hidden":!0,...r,ref:t})});Zv.displayName=F2;var ec="SelectArrow",B2=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$s(n),o=Jn(ec,n),l=Zn(ec,n);return o.open&&l.position==="popper"?f.jsx(MN,{...i,...r,ref:t}):null});B2.displayName=ec;var $2="SelectBubbleInput",ex=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=pe(r,i),l=by(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&d){const c=new Event("change",{bubbles:!0});d.call(s,t),s.dispatchEvent(c)}},[l,t]),f.jsx(ne.select,{...n,style:{...yv,...n.style},ref:o,defaultValue:t})});ex.displayName=$2;function tx(e){return e===""||e===void 0}function nx(e){const t=wr(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function rx(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=U2(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function U2(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var V2=_v,ix=Tv,H2=Iv,W2=Mv,K2=Ov,ox=Lv,G2=Bv,Y2=Uv,lx=Hv,sx=Kv,Q2=Gv,X2=Qv,ax=Xv,ux=qv,cx=Zv;const q2=V2,Gp=Y2,J2=H2,dx=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(ix,{ref:r,className:de("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,f.jsx(W2,{asChild:!0,children:f.jsx(fd,{className:"h-4 w-4 opacity-50"})})]}));dx.displayName=ix.displayName;const fx=g.forwardRef(({className:e,...t},n)=>f.jsx(ax,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(xC,{className:"h-4 w-4"})}));fx.displayName=ax.displayName;const px=g.forwardRef(({className:e,...t},n)=>f.jsx(ux,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(fd,{className:"h-4 w-4"})}));px.displayName=ux.displayName;const hx=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>f.jsx(K2,{children:f.jsxs(ox,{ref:i,className:de("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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(fx,{}),f.jsx(G2,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(px,{})]})}));hx.displayName=ox.displayName;const tc=g.forwardRef(({className:e,...t},n)=>f.jsx(lx,{ref:n,className:de("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));tc.displayName=lx.displayName;const nc=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(sx,{ref:r,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(X2,{children:f.jsx(gC,{className:"h-4 w-4"})})}),f.jsx(Q2,{children:t})]}));nc.displayName=sx.displayName;const Z2=g.forwardRef(({className:e,...t},n)=>f.jsx(cx,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));Z2.displayName=cx.displayName;function eP(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Fo=e=>{const{present:t,children:n}=e,r=tP(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=pe(r.ref,nP(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Fo.displayName="Presence";function tP(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=eP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=dl(r.current);o.current=s==="mounted"?u:"none"},[s]),Ue(()=>{const u=r.current,d=i.current;if(d!==e){const h=o.current,p=dl(u);e?a("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Ue(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=p=>{const y=dl(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},h=p=>{p.target===t&&(o.current=dl(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function dl(e){return(e==null?void 0:e.animationName)||"none"}function nP(e){var r,i;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=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Us="Collapsible",[rP,LA]=_r(Us),[iP,_d]=rP(Us),mx=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=e,[a,u]=Po({prop:r,defaultProp:i??!1,onChange:l,caller:Us});return f.jsx(iP,{scope:n,disabled:o,contentId:pr(),open:a,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),children:f.jsx(ne.div,{"data-state":Td(a),"data-disabled":o?"":void 0,...s,ref:t})})});mx.displayName=Us;var gx="CollapsibleTrigger",yx=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=_d(gx,n);return f.jsx(ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Td(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:le(e.onClick,i.onOpenToggle)})});yx.displayName=gx;var Rd="CollapsibleContent",vx=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=_d(Rd,e.__scopeCollapsible);return f.jsx(Fo,{present:n||i.open,children:({present:o})=>f.jsx(oP,{...r,ref:t,present:o})})});vx.displayName=Rd;var oP=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=_d(Rd,n),[s,a]=g.useState(r),u=g.useRef(null),d=pe(t,u),c=g.useRef(0),h=c.current,p=g.useRef(0),w=p.current,y=l.open||s,S=g.useRef(y),m=g.useRef(void 0);return g.useEffect(()=>{const v=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(v)},[]),Ue(()=>{const v=u.current;if(v){m.current=m.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();c.current=x.height,p.current=x.width,S.current||(v.style.transitionDuration=m.current.transitionDuration,v.style.animationName=m.current.animationName),a(r)}},[l.open,r]),f.jsx(ne.div,{"data-state":Td(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:y&&i})});function Td(e){return e?"open":"closed"}var lP=mx;const sP=lP,aP=yx,uP=vx;var Vs="Dialog",[xx,wx]=_r(Vs),[cP,Vt]=xx(Vs),Sx=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[u,d]=Po({prop:r,defaultProp:i??!1,onChange:o,caller:Vs});return f.jsx(cP,{scope:t,triggerRef:s,contentRef:a,contentId:pr(),titleId:pr(),descriptionId:pr(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(c=>!c),[d]),modal:l,children:n})};Sx.displayName=Vs;var kx="DialogTrigger",Cx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(kx,n),o=pe(t,i.triggerRef);return f.jsx(ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Md(i.open),...r,ref:o,onClick:le(e.onClick,i.onOpenToggle)})});Cx.displayName=kx;var Ad="DialogPortal",[dP,Ex]=xx(Ad,{forceMount:void 0}),bx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Vt(Ad,t);return f.jsx(dP,{scope:t,forceMount:n,children:g.Children.map(r,l=>f.jsx(Fo,{present:n||o.open,children:f.jsx(Pd,{asChild:!0,container:i,children:l})}))})};bx.displayName=Ad;var fs="DialogOverlay",Nx=g.forwardRef((e,t)=>{const n=Ex(fs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vt(fs,e.__scopeDialog);return o.modal?f.jsx(Fo,{present:r||o.open,children:f.jsx(pP,{...i,ref:t})}):null});Nx.displayName=fs;var fP=yi("DialogOverlay.RemoveScroll"),pP=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(fs,n);return f.jsx(jv,{as:fP,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(ne.div,{"data-state":Md(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Er="DialogContent",Px=g.forwardRef((e,t)=>{const n=Ex(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Vt(Er,e.__scopeDialog);return f.jsx(Fo,{present:r||o.open,children:o.modal?f.jsx(hP,{...i,ref:t}):f.jsx(mP,{...i,ref:t})})});Px.displayName=Er;var hP=g.forwardRef((e,t)=>{const n=Vt(Er,e.__scopeDialog),r=g.useRef(null),i=pe(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return xv(o)},[]),f.jsx(jx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:le(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:le(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:le(e.onFocusOutside,o=>o.preventDefault())})}),mP=g.forwardRef((e,t)=>{const n=Vt(Er,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return f.jsx(jx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),jx=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Vt(Er,n),a=g.useRef(null),u=pe(t,a);return Gy(),f.jsxs(f.Fragment,{children:[f.jsx(vd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:f.jsx(yd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Md(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(yP,{titleId:s.titleId}),f.jsx(xP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Id="DialogTitle",_x=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(Id,n);return f.jsx(ne.h2,{id:i.titleId,...r,ref:t})});_x.displayName=Id;var Rx="DialogDescription",Tx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(Rx,n);return f.jsx(ne.p,{id:i.descriptionId,...r,ref:t})});Tx.displayName=Rx;var Ax="DialogClose",Ix=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vt(Ax,n);return f.jsx(ne.button,{type:"button",...r,ref:t,onClick:le(e.onClick,()=>i.onOpenChange(!1))})});Ix.displayName=Ax;function Md(e){return e?"open":"closed"}var Mx="DialogTitleWarning",[gP,Ox]=SE(Mx,{contentName:Er,titleName:Id,docsSlug:"dialog"}),yP=({titleId:e})=>{const t=Ox(Mx),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 g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vP="DialogDescriptionWarning",xP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ox(vP).contentName}}.`;return g.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},wP=Sx,SP=Cx,kP=bx,CP=Nx,EP=Px,bP=_x,NP=Tx,Lx=Ix,Dx="AlertDialog",[PP,DA]=_r(Dx,[wx]),wn=wx(),zx=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(wP,{...r,...n,modal:!0})};zx.displayName=Dx;var jP="AlertDialogTrigger",_P=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(SP,{...i,...r,ref:t})});_P.displayName=jP;var RP="AlertDialogPortal",Fx=e=>{const{__scopeAlertDialog:t,...n}=e,r=wn(t);return f.jsx(kP,{...r,...n})};Fx.displayName=RP;var TP="AlertDialogOverlay",Bx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(CP,{...i,...r,ref:t})});Bx.displayName=TP;var li="AlertDialogContent",[AP,IP]=PP(li),MP=hE("AlertDialogContent"),$x=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=wn(n),l=g.useRef(null),s=pe(t,l),a=g.useRef(null);return f.jsx(gP,{contentName:li,titleName:Ux,docsSlug:"alert-dialog",children:f.jsx(AP,{scope:n,cancelRef:a,children:f.jsxs(EP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:le(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=a.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[f.jsx(MP,{children:r}),f.jsx(LP,{contentRef:l})]})})})});$x.displayName=li;var Ux="AlertDialogTitle",Vx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(bP,{...i,...r,ref:t})});Vx.displayName=Ux;var Hx="AlertDialogDescription",Wx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(NP,{...i,...r,ref:t})});Wx.displayName=Hx;var OP="AlertDialogAction",Kx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=wn(n);return f.jsx(Lx,{...i,...r,ref:t})});Kx.displayName=OP;var Gx="AlertDialogCancel",Yx=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=IP(Gx,n),o=wn(n),l=pe(t,i);return f.jsx(Lx,{...o,...r,ref:l})});Yx.displayName=Gx;var LP=({contentRef:e})=>{const t=`\`${li}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${li}\` by passing a \`${Hx}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${li}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},DP=zx,zP=Fx,Qx=Bx,Xx=$x,qx=Kx,Jx=Yx,Zx=Vx,e0=Wx;const FP=DP,BP=zP,t0=g.forwardRef(({className:e,...t},n)=>f.jsx(Qx,{className:de("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));t0.displayName=Qx.displayName;const n0=g.forwardRef(({className:e,...t},n)=>f.jsxs(BP,{children:[f.jsx(t0,{}),f.jsx(Xx,{ref:n,className:de("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));n0.displayName=Xx.displayName;const r0=({className:e,...t})=>f.jsx("div",{className:de("flex flex-col space-y-2 text-center sm:text-left",e),...t});r0.displayName="AlertDialogHeader";const i0=({className:e,...t})=>f.jsx("div",{className:de("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});i0.displayName="AlertDialogFooter";const o0=g.forwardRef(({className:e,...t},n)=>f.jsx(Zx,{ref:n,className:de("text-lg font-semibold",e),...t}));o0.displayName=Zx.displayName;const l0=g.forwardRef(({className:e,...t},n)=>f.jsx(e0,{ref:n,className:de("text-sm text-muted-foreground",e),...t}));l0.displayName=e0.displayName;const s0=g.forwardRef(({className:e,...t},n)=>f.jsx(qx,{ref:n,className:de(md(),e),...t}));s0.displayName=qx.displayName;const a0=g.forwardRef(({className:e,...t},n)=>f.jsx(Jx,{ref:n,className:de(md({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));a0.displayName=Jx.displayName;const u0=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:de("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));u0.displayName="Textarea";function $P(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const UP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HP={};function Yp(e,t){return((t||HP).jsx?VP:UP).test(e)}const WP=/[ \t\n\f\r]/g;function KP(e){return typeof e=="object"?e.type==="text"?Qp(e.value):!1:Qp(e)}function Qp(e){return e.replace(WP,"")===""}class Bo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bo.prototype.normal={};Bo.prototype.property={};Bo.prototype.space=void 0;function c0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bo(n,r,t)}function rc(e){return e.toLowerCase()}class at{constructor(t,n){this.attribute=n,this.property=t}}at.prototype.attribute="";at.prototype.booleanish=!1;at.prototype.boolean=!1;at.prototype.commaOrSpaceSeparated=!1;at.prototype.commaSeparated=!1;at.prototype.defined=!1;at.prototype.mustUseProperty=!1;at.prototype.number=!1;at.prototype.overloadedBoolean=!1;at.prototype.property="";at.prototype.spaceSeparated=!1;at.prototype.space=void 0;let GP=0;const J=Rr(),Te=Rr(),ic=Rr(),F=Rr(),ge=Rr(),si=Rr(),ct=Rr();function Rr(){return 2**++GP}const oc=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Te,commaOrSpaceSeparated:ct,commaSeparated:si,number:F,overloadedBoolean:ic,spaceSeparated:ge},Symbol.toStringTag,{value:"Module"})),Ta=Object.keys(oc);class Od extends at{constructor(t,n,r,i){let o=-1;if(super(t,n),Xp(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&JP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(qp,tj);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!qp.test(o)){let l=o.replace(qP,ej);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Od}return new i(r,t)}function ej(e){return"-"+e.toLowerCase()}function tj(e){return e.charAt(1).toUpperCase()}const nj=c0([d0,YP,h0,m0,g0],"html"),Ld=c0([d0,QP,h0,m0,g0],"svg");function rj(e){return e.join(" ").trim()}var Dd={},Jp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ij=/\n/g,oj=/^\s*/,lj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,sj=/^:\s*/,aj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,uj=/^[;\s]*/,cj=/^\s+|\s+$/g,dj=` +`,Zp="/",eh="*",or="",fj="comment",pj="declaration",hj=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var y=w.match(ij);y&&(n+=y.length);var S=w.lastIndexOf(dj);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(y){return y.position=new l(w),u(),y}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var y=new Error(t.source+":"+n+":"+r+": "+w);if(y.reason=w,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function a(w){var y=w.exec(e);if(y){var S=y[0];return i(S),e=e.slice(S.length),y}}function u(){a(oj)}function d(w){var y;for(w=w||[];y=c();)y!==!1&&w.push(y);return w}function c(){var w=o();if(!(Zp!=e.charAt(0)||eh!=e.charAt(1))){for(var y=2;or!=e.charAt(y)&&(eh!=e.charAt(y)||Zp!=e.charAt(y+1));)++y;if(y+=2,or===e.charAt(y-1))return s("End of comment missing");var S=e.slice(2,y-2);return r+=2,i(S),e=e.slice(y),r+=2,w({type:fj,comment:S})}}function h(){var w=o(),y=a(lj);if(y){if(c(),!a(sj))return s("property missing ':'");var S=a(aj),m=w({type:pj,property:th(y[0].replace(Jp,or)),value:S?th(S[0].replace(Jp,or)):or});return a(uj),m}}function p(){var w=[];d(w);for(var y;y=h();)y!==!1&&(w.push(y),d(w));return w}return u(),p()};function th(e){return e?e.replace(cj,or):or}var mj=Al&&Al.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=yj;var gj=mj(hj);function yj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,gj.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.camelCase=void 0;var vj=/^--[a-zA-Z0-9_-]+$/,xj=/-([a-z])/g,wj=/^[^-]+$/,Sj=/^-(webkit|moz|ms|o|khtml)-/,kj=/^-(ms)-/,Cj=function(e){return!e||wj.test(e)||vj.test(e)},Ej=function(e,t){return t.toUpperCase()},nh=function(e,t){return"".concat(t,"-")},bj=function(e,t){return t===void 0&&(t={}),Cj(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(kj,nh):e=e.replace(Sj,nh),e.replace(xj,Ej))};Hs.camelCase=bj;var Nj=Al&&Al.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Pj=Nj(Dd),jj=Hs;function lc(e,t){var n={};return!e||typeof e!="string"||(0,Pj.default)(e,function(r,i){r&&i&&(n[(0,jj.camelCase)(r,t)]=i)}),n}lc.default=lc;var _j=lc;const Rj=ms(_j),y0=v0("end"),zd=v0("start");function v0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Tj(e){const t=zd(e),n=y0(e);if(t&&n)return{start:t,end:n}}function io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rh(e.position):"start"in e||"end"in e?rh(e):"line"in e||"column"in e?sc(e):""}function sc(e){return ih(e&&e.line)+":"+ih(e&&e.column)}function rh(e){return sc(e&&e.start)+"-"+sc(e&&e.end)}function ih(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=io(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const Fd={}.hasOwnProperty,Aj=new Map,Ij=/[A-Z]/g,Mj=new Set(["table","tbody","thead","tfoot","tr"]),Oj=new Set(["td","th"]),x0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Lj(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Hj(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Vj(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ld:nj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=w0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function w0(e,t,n){if(t.type==="element")return Dj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return zj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Bj(e,t,n);if(t.type==="mdxjsEsm")return Fj(e,t);if(t.type==="root")return $j(e,t,n);if(t.type==="text")return Uj(e,t)}function Dj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ld,e.schema=i),e.ancestors.push(t);const o=k0(e,t.tagName,!1),l=Wj(e,t);let s=$d(e,t);return Mj.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!KP(a):!0})),S0(e,l,o,t),Bd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zj(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ro(e,t.position)}function Fj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function Bj(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ld,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:k0(e,t.name,!0),l=Kj(e,t),s=$d(e,t);return S0(e,l,o,t),Bd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function $j(e,t,n){const r={};return Bd(r,$d(e,t)),e.create(t,e.Fragment,r,n)}function Uj(e,t){return t.value}function S0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Bd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Vj(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function Hj(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=zd(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function Wj(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Fd.call(t.properties,i)){const o=Gj(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&Oj.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Kj(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Ro(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Ro(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function $d(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Aj;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(rn(e,e.length,0,t),e):t}const sh={}.hasOwnProperty;function t_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ai(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qt=er(/[A-Za-z]/),ht=er(/[\dA-Za-z]/),i_=er(/[#-'*+\--9=?A-Z^-~]/);function ac(e){return e!==null&&(e<32||e===127)}const uc=er(/\d/),o_=er(/[\dA-Fa-f]/),l_=er(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function st(e){return e!==null&&(e<0||e===32)}function ce(e){return e===-2||e===-1||e===32}const s_=er(/\p{P}|\p{S}/u),a_=er(/\s/);function er(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _i(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ve(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return ce(a)?(e.enter(n),s(a)):t(a)}function s(a){return ce(a)&&o++l))return;const P=t.events.length;let R=P,B,O;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){O=t.events[R][1].end;break}B=!0}for(m(r),b=P;bx;){const N=n[E];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function p_(e,t,n){return ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function uh(e){if(e===null||st(e)||a_(e))return 1;if(s_(e))return 2}function Vd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};ch(c,-a),ch(h,a),l={type:a>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ct(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ct(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=Ct(u,Vd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ct(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Ct(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,rn(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&ce(b)?ve(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||X(b)?e.check(dh,y,E)(b):(e.enter("codeFlowValue"),x(b))}function x(b){return b===null||X(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),x)}function E(b){return e.exit("codeFenced"),t(b)}function N(b,P,R){let B=0;return O;function O(D){return b.enter("lineEnding"),b.consume(D),b.exit("lineEnding"),M}function M(D){return b.enter("codeFencedFence"),ce(D)?ve(b,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):j(D)}function j(D){return D===s?(b.enter("codeFencedFenceSequence"),V(D)):R(D)}function V(D){return D===s?(B++,b.consume(D),V):B>=l?(b.exit("codeFencedFenceSequence"),ce(D)?ve(b,T,"whitespace")(D):T(D)):R(D)}function T(D){return D===null||X(D)?(b.exit("codeFencedFence"),P(D)):R(D)}}}function b_(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ia={name:"codeIndented",tokenize:P_},N_={partial:!0,tokenize:j_};function P_(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ve(e,o,"linePrefix",4+1)(u)}function o(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):X(u)?e.attempt(N_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||X(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function j_(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):ve(e,o,"linePrefix",4+1)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):X(l)?i(l):n(l)}}const __={name:"codeText",previous:T_,resolve:R_,tokenize:A_};function R_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ui(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ui(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ui(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function _0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let d=0;return c;function c(m){return m===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(m),e.exit(o),h):m===null||m===32||m===41||ac(m)?n(m):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(m))}function h(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(s),h(m)):m===null||m===60||X(m)?n(m):(e.consume(m),m===92?w:p)}function w(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function y(m){return!d&&(m===null||m===41||st(m))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(m)):d999||p===null||p===91||p===93&&!a||p===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):X(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||X(p)||s++>999?(e.exit("chunkString"),d(p)):(e.consume(p),a||(a=!ce(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}}function T0(e,t,n,r,i,o){let l;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),l=h===40?41:h,a):n(h)}function a(h){return h===l?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===l?(e.exit(o),a(l)):h===null?n(h):X(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ve(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===l||h===null||X(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:d)}function c(h){return h===l||h===92?(e.consume(h),d):d(h)}}function oo(e,t){let n;return r;function r(i){return X(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ce(i)?ve(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const B_={name:"definition",tokenize:U_},$_={partial:!0,tokenize:V_};function U_(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return R0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return st(p)?oo(e,u)(p):u(p)}function u(p){return _0(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt($_,c,c)(p)}function c(p){return ce(p)?ve(e,h,"whitespace")(p):h(p)}function h(p){return p===null||X(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function V_(e,t,n){return r;function r(s){return st(s)?oo(e,i)(s):n(s)}function i(s){return T0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ce(s)?ve(e,l,"whitespace")(s):l(s)}function l(s){return s===null||X(s)?t(s):n(s)}}const H_={name:"hardBreakEscape",tokenize:W_};function W_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return X(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const K_={name:"headingAtx",resolve:G_,tokenize:Y_};function G_(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},rn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Y_(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),l(d)}function l(d){return d===35&&r++<6?(e.consume(d),l):d===null||st(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),a(d)):d===null||X(d)?(e.exit("atxHeading"),t(d)):ce(d)?ve(e,s,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function a(d){return d===35?(e.consume(d),a):(e.exit("atxHeadingSequence"),s(d))}function u(d){return d===null||d===35||st(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const Q_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ph=["pre","script","style","textarea"],X_={concrete:!0,name:"htmlFlow",resolveTo:Z_,tokenize:eR},q_={partial:!0,tokenize:nR},J_={partial:!0,tokenize:tR};function Z_(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function eR(e,t,n){const r=this;let i,o,l,s,a;return u;function u(C){return d(C)}function d(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),o=!0,y):C===63?(e.consume(C),i=3,r.interrupt?t:k):qt(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function h(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,s=0,w):qt(C)?(e.consume(C),i=4,r.interrupt?t:k):n(C)}function p(C){return C===45?(e.consume(C),r.interrupt?t:k):n(C)}function w(C){const Y="CDATA[";return C===Y.charCodeAt(s++)?(e.consume(C),s===Y.length?r.interrupt?t:j:w):n(C)}function y(C){return qt(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function S(C){if(C===null||C===47||C===62||st(C)){const Y=C===47,ue=l.toLowerCase();return!Y&&!o&&ph.includes(ue)?(i=1,r.interrupt?t(C):j(C)):Q_.includes(l.toLowerCase())?(i=6,Y?(e.consume(C),m):r.interrupt?t(C):j(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?v(C):x(C))}return C===45||ht(C)?(e.consume(C),l+=String.fromCharCode(C),S):n(C)}function m(C){return C===62?(e.consume(C),r.interrupt?t:j):n(C)}function v(C){return ce(C)?(e.consume(C),v):O(C)}function x(C){return C===47?(e.consume(C),O):C===58||C===95||qt(C)?(e.consume(C),E):ce(C)?(e.consume(C),x):O(C)}function E(C){return C===45||C===46||C===58||C===95||ht(C)?(e.consume(C),E):N(C)}function N(C){return C===61?(e.consume(C),b):ce(C)?(e.consume(C),N):x(C)}function b(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,P):ce(C)?(e.consume(C),b):R(C)}function P(C){return C===a?(e.consume(C),a=null,B):C===null||X(C)?n(C):(e.consume(C),P)}function R(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||st(C)?N(C):(e.consume(C),R)}function B(C){return C===47||C===62||ce(C)?x(C):n(C)}function O(C){return C===62?(e.consume(C),M):n(C)}function M(C){return C===null||X(C)?j(C):ce(C)?(e.consume(C),M):n(C)}function j(C){return C===45&&i===2?(e.consume(C),U):C===60&&i===1?(e.consume(C),H):C===62&&i===4?(e.consume(C),G):C===63&&i===3?(e.consume(C),k):C===93&&i===5?(e.consume(C),z):X(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(q_,A,V)(C)):C===null||X(C)?(e.exit("htmlFlowData"),V(C)):(e.consume(C),j)}function V(C){return e.check(J_,T,A)(C)}function T(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),D}function D(C){return C===null||X(C)?V(C):(e.enter("htmlFlowData"),j(C))}function U(C){return C===45?(e.consume(C),k):j(C)}function H(C){return C===47?(e.consume(C),l="",_):j(C)}function _(C){if(C===62){const Y=l.toLowerCase();return ph.includes(Y)?(e.consume(C),G):j(C)}return qt(C)&&l.length<8?(e.consume(C),l+=String.fromCharCode(C),_):j(C)}function z(C){return C===93?(e.consume(C),k):j(C)}function k(C){return C===62?(e.consume(C),G):C===45&&i===2?(e.consume(C),k):j(C)}function G(C){return C===null||X(C)?(e.exit("htmlFlowData"),A(C)):(e.consume(C),G)}function A(C){return e.exit("htmlFlow"),t(C)}}function tR(e,t,n){const r=this;return i;function i(l){return X(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function nR(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ws,t,n)}}const rR={name:"htmlText",tokenize:iR};function iR(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),N):k===63?(e.consume(k),x):qt(k)?(e.consume(k),R):n(k)}function u(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),o=0,w):qt(k)?(e.consume(k),v):n(k)}function d(k){return k===45?(e.consume(k),p):n(k)}function c(k){return k===null?n(k):k===45?(e.consume(k),h):X(k)?(l=c,H(k)):(e.consume(k),c)}function h(k){return k===45?(e.consume(k),p):c(k)}function p(k){return k===62?U(k):k===45?h(k):c(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(o++)?(e.consume(k),o===G.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):X(k)?(l=y,H(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),m):y(k)}function m(k){return k===62?U(k):k===93?(e.consume(k),m):y(k)}function v(k){return k===null||k===62?U(k):X(k)?(l=v,H(k)):(e.consume(k),v)}function x(k){return k===null?n(k):k===63?(e.consume(k),E):X(k)?(l=x,H(k)):(e.consume(k),x)}function E(k){return k===62?U(k):x(k)}function N(k){return qt(k)?(e.consume(k),b):n(k)}function b(k){return k===45||ht(k)?(e.consume(k),b):P(k)}function P(k){return X(k)?(l=P,H(k)):ce(k)?(e.consume(k),P):U(k)}function R(k){return k===45||ht(k)?(e.consume(k),R):k===47||k===62||st(k)?B(k):n(k)}function B(k){return k===47?(e.consume(k),U):k===58||k===95||qt(k)?(e.consume(k),O):X(k)?(l=B,H(k)):ce(k)?(e.consume(k),B):U(k)}function O(k){return k===45||k===46||k===58||k===95||ht(k)?(e.consume(k),O):M(k)}function M(k){return k===61?(e.consume(k),j):X(k)?(l=M,H(k)):ce(k)?(e.consume(k),M):B(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,V):X(k)?(l=j,H(k)):ce(k)?(e.consume(k),j):(e.consume(k),T)}function V(k){return k===i?(e.consume(k),i=void 0,D):k===null?n(k):X(k)?(l=V,H(k)):(e.consume(k),V)}function T(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||st(k)?B(k):(e.consume(k),T)}function D(k){return k===47||k===62||st(k)?B(k):n(k)}function U(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return ce(k)?ve(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return e.enter("htmlTextData"),l(k)}}const Hd={name:"labelEnd",resolveAll:aR,resolveTo:uR,tokenize:cR},oR={tokenize:dR},lR={tokenize:fR},sR={tokenize:pR};function aR(e){let t=-1;const n=[];for(;++t=3&&(u===null||X(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),ce(u)?ve(e,s,"whitespace")(u):s(u))}}const tt={continuation:{tokenize:CR},exit:bR,name:"list",tokenize:kR},wR={partial:!0,tokenize:NR},SR={partial:!0,tokenize:ER};function kR(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(p){const w=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:uc(p)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Rl,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return uc(p)&&++l<10?(e.consume(p),a):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ws,r.interrupt?n:d,e.attempt(wR,h,c))}function d(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function c(p){return ce(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function CR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ws,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ve(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ce(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(SR,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ve(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function ER(e,t,n){const r=this;return ve(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function bR(e){e.exit(this.containerState.type)}function NR(e,t,n){const r=this;return ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const l=r.events[r.events.length-1];return!ce(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const hh={name:"setextUnderline",resolveTo:PR,tokenize:jR};function PR(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function jR(e,t,n){const r=this;let i;return o;function o(u){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ce(u)?ve(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||X(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const _R={tokenize:RR};function RR(e){const t=this,n=e.attempt(Ws,r,e.attempt(this.parser.constructs.flowInitial,i,ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt(O_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const TR={resolveAll:I0()},AR=A0("string"),IR=A0("text");function A0(e){return{resolveAll:I0(e==="text"?MR:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(d){return u(d)?o(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),a}function a(d){return u(d)?(n.exit("data"),o(d)):(n.consume(d),a)}function u(d){if(d===null)return!0;const c=i[d];let h=-1;if(c)for(;++h-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function GR(e,t){let n=-1;const r=[];let i;for(;++n0){const _t=q.tokenStack[q.tokenStack.length-1];(_t[1]||gh).call(q,void 0,_t[0])}for($.position={start:Nn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Nn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function cT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function L0(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function fT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return L0(e,t);const i={src:_i(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function pT(e,t){const n={src:_i(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function hT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function mT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return L0(e,t);const i={href:_i(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function gT(e,t){const n={href:_i(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yT(e,t,n){const r=e.all(t),i=n?vT(n):D0(t),o={},l=[];if(typeof t.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function xT(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=zd(t.children[1]),a=y0(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function ET(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(xh(t.slice(i),i>0,!1)),o.join("")}function xh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===yh||o===vh;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===yh||o===vh;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function PT(e,t){const n={type:"text",value:NT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function jT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _T={blockquote:iT,break:oT,code:lT,delete:sT,emphasis:aT,footnoteReference:uT,heading:cT,html:dT,imageReference:fT,image:pT,inlineCode:hT,linkReference:mT,link:gT,listItem:yT,list:xT,paragraph:wT,root:ST,strong:kT,table:CT,tableCell:bT,tableRow:ET,text:PT,thematicBreak:jT,toml:fl,yaml:fl,definition:fl,footnoteDefinition:fl};function fl(){}const z0=-1,Ks=0,lo=1,ps=2,Wd=3,Kd=4,Gd=5,Yd=6,F0=7,B0=8,wh=typeof self=="object"?self:globalThis,RT=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Ks:case z0:return n(l,i);case lo:{const s=n([],i);for(const a of l)s.push(r(a));return s}case ps:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case Wd:return n(new Date(l),i);case Kd:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case Gd:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case Yd:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case F0:{const{name:s,message:a}=l;return n(new wh[s](a),i)}case B0:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(new wh[o](l),i)};return r},Sh=e=>RT(new Map,e)(0),Lr="",{toString:TT}={},{keys:AT}=Object,Vi=e=>{const t=typeof e;if(t!=="object"||!e)return[Ks,t];const n=TT.call(e).slice(8,-1);switch(n){case"Array":return[lo,Lr];case"Object":return[ps,Lr];case"Date":return[Wd,Lr];case"RegExp":return[Kd,Lr];case"Map":return[Gd,Lr];case"Set":return[Yd,Lr];case"DataView":return[lo,n]}return n.includes("Array")?[lo,n]:n.includes("Error")?[F0,n]:[ps,n]},pl=([e,t])=>e===Ks&&(t==="function"||t==="symbol"),IT=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Vi(l);switch(s){case Ks:{let d=l;switch(a){case"bigint":s=B0,d=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);d=null;break;case"undefined":return i([z0],l)}return i([s,d],l)}case lo:{if(a){let h=l;return a==="DataView"?h=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(h=new Uint8Array(l)),i([a,[...h]],l)}const d=[],c=i([s,d],l);for(const h of l)d.push(o(h));return c}case ps:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const d=[],c=i([s,d],l);for(const h of AT(l))(e||!pl(Vi(l[h])))&&d.push([o(h),o(l[h])]);return c}case Wd:return i([s,l.toISOString()],l);case Kd:{const{source:d,flags:c}=l;return i([s,{source:d,flags:c}],l)}case Gd:{const d=[],c=i([s,d],l);for(const[h,p]of l)(e||!(pl(Vi(h))||pl(Vi(p))))&&d.push([o(h),o(p)]);return c}case Yd:{const d=[],c=i([s,d],l);for(const h of l)(e||!pl(Vi(h)))&&d.push(o(h));return c}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},kh=(e,{json:t,lossy:n}={})=>{const r=[];return IT(!(t||n),!!t,new Map,r)(e),r},hs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sh(kh(e,t)):structuredClone(e):(e,t)=>Sh(kh(e,t));function MT(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function OT(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function LT(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||MT,r=e.options.footnoteBackLabel||OT,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&w.push({type:"text",value:" "});let v=typeof n=="string"?n:n(a,p);typeof v=="string"&&(v={type:"text",value:v}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=d[d.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else d.push(...w);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,m),s.push(m)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...hs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const $0=function(e){if(e==null)return BT;if(typeof e=="function")return Gs(e);if(typeof e=="object")return Array.isArray(e)?DT(e):zT(e);if(typeof e=="string")return FT(e);throw new Error("Expected function, string, or object as test")};function DT(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=U0,w,y,S;if((!t||o(a,u,d[d.length-1]||void 0))&&(p=WT(n(a,d)),p[0]===Ch))return p;if("children"in a&&a.children){const m=a;if(m.children&&p[0]!==VT)for(y=(r?m.children.length:-1)+l,S=d.concat(m);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function Eh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bh(e,t){const n=GT(e,t),r=n.one(e,void 0),i=LT(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function JT(e,t){return e&&"run"in e?async function(n,r){const i=bh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return bh(n,{file:r,...e||t})}}function Nh(e){if(e)throw e}var Tl=Object.prototype.hasOwnProperty,H0=Object.prototype.toString,Ph=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,_h=function(t){return typeof Array.isArray=="function"?Array.isArray(t):H0.call(t)==="[object Array]"},Rh=function(t){if(!t||H0.call(t)!=="[object Object]")return!1;var n=Tl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Tl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Tl.call(t,i)},Th=function(t,n){Ph&&n.name==="__proto__"?Ph(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ah=function(t,n){if(n==="__proto__")if(Tl.call(t,n)){if(jh)return jh(t,n).value}else return;return t[n]},ZT=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,d=!1;for(typeof s=="boolean"&&(d=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});al.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const d=u;if(s&&n)throw d;return i(d)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const Gt={basename:nA,dirname:rA,extname:iA,join:oA,sep:"/"};function nA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$o(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function rA(e){if($o(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function iA(e){$o(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function oA(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function sA(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function $o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const aA={cwd:uA};function uA(){return"/"}function pc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function cA(e){if(typeof e=="string")e=new URL(e);else if(!pc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dA(e)}function dA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...w]=d;const y=r[h][1];fc(y)&&fc(p)&&(p=Oa(!0,y,p)),r[h]=[u,p,...w]}}}}const mA=new Qd().freeze();function Fa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ba(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $a(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Mh(e){if(!fc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Oh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return gA(e)?e:new W0(e)}function gA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yA(e){return typeof e=="string"||vA(e)}function vA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const xA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lh=[],Dh={allowDangerousHtml:!0},wA=/^(https?|ircs?|mailto|xmpp)$/i,SA=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function kA(e){const t=CA(e),n=EA(e);return bA(t.runSync(t.parse(n),n),e)}function CA(e){const t=e.rehypePlugins||Lh,n=e.remarkPlugins||Lh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dh}:Dh;return mA().use(rT).use(n).use(JT,r).use(t)}function EA(e){const t=e.children||"",n=new W0;return typeof t=="string"&&(n.value=t),n}function bA(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||NA;for(const d of SA)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+xA+d.id,void 0);return V0(e,u),Lj(e,{Fragment:f.Fragment,components:i,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function u(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return l?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let p;for(p in Aa)if(Object.hasOwn(Aa,p)&&Object.hasOwn(d.properties,p)){const w=d.properties[p],y=Aa[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=a(String(w||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):o?o.includes(d.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(d,c,h)),p&&h&&typeof c=="number")return s&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function NA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||wA.test(e.slice(0,t))?e:""}const K0=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=g.useRef(null),d=()=>{var c;(c=u.current)==null||c.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(c=>({id:c.id,role:c.role,content:c.content.slice(0,50)+"..."}))),d()},[t]),f.jsxs("div",{className:de("flex h-full flex-col",e),ref:a,...s,children:[f.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?f.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:f.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((c,h)=>f.jsxs("div",{className:de("flex gap-3 w-full",c.role==="user"?"justify-end":"justify-start"),children:[c.role!=="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:f.jsx(pC,{className:"h-4 w-4 text-primary-foreground"})}),f.jsxs("div",{className:de("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",c.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[f.jsxs("div",{className:"text-xs opacity-70",children:[c.role==="user"?"You":"Assistant"," • #",h+1]}),f.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:f.jsx(kA,{components:{p:({children:p})=>f.jsx("p",{className:"mb-2 last:mb-0",children:p}),ul:({children:p})=>f.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:p}),ol:({children:p})=>f.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:p}),li:({children:p})=>f.jsx("li",{className:"mb-1",children:p}),code:({children:p,className:w})=>!w?f.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:p}):f.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:p}),pre:({children:p})=>f.jsx("div",{className:"mb-2 last:mb-0",children:p}),strong:({children:p})=>f.jsx("strong",{className:"font-semibold",children:p}),em:({children:p})=>f.jsx("em",{className:"italic",children:p}),blockquote:({children:p})=>f.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:p}),h1:({children:p})=>f.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:p}),h2:({children:p})=>f.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:p}),h3:({children:p})=>f.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:p})},children:c.content})})]}),c.role==="user"&&f.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:f.jsx(oE,{className:"h-4 w-4"})})]},`${c.id}-${h}`)),f.jsx("div",{ref:u})]}),f.jsx("div",{className:"border-t p-4",children:f.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[f.jsx(u0,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),i(c))}}),o?f.jsx(Ce,{type:"button",onClick:l,variant:"outline",size:"icon",children:f.jsx(JC,{className:"h-4 w-4"})}):f.jsx(Ce,{type:"submit",disabled:!n.trim(),size:"icon",children:f.jsx(HC,{className:"h-4 w-4"})})]})})]})});K0.displayName="Chat";const Wt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function G0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function PA(){return G0()}class jA{getAllSessions(){const t=localStorage.getItem(Wt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:G0(),title:t||`New Chat ${new Date().toLocaleString()}`,messages:[],model:n,systemPrompt:r,createdAt:Date.now(),updatedAt:Date.now()},o=this.getAllSessions();return o.unshift(i),localStorage.setItem(Wt.sessions,JSON.stringify(o)),i}updateSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);i!==-1&&(r[i]={...r[i],...n,updatedAt:Date.now()},localStorage.setItem(Wt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Wt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Wt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:PA(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Wt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Wt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Wt.currentSession,t)}clear(){localStorage.removeItem(Wt.sessions),localStorage.removeItem(Wt.currentSession)}}const we=new jA;function _A(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=g.useState([]),[l,s]=g.useState(null),[a,u]=g.useState(""),[d,c]=g.useState({isLoading:!1,error:null}),[h,p]=g.useState(n),[w,y]=g.useState(r),[S,m]=g.useState(.7),[v,x]=g.useState(1024),E=Mt.useMemo(()=>{var D;const T=i.find(U=>U.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!T,messageCount:((D=T==null?void 0:T.messages)==null?void 0:D.length)||0}),T},[i,l]),N=Mt.useMemo(()=>{const T=(E==null?void 0:E.messages)||[];return console.log("useChat - messages computed:",T.length,T.map(D=>({id:D.id,role:D.role}))),T},[E==null?void 0:E.messages]);g.useEffect(()=>{const T=we.getAllSessions();o(T);const D=we.getCurrentSession();D?s(D.id):T.length>0&&(s(T[0].id),we.setCurrentSession(T[0].id))},[]);const b=g.useCallback(()=>{const T=we.createSession(void 0,h,w),D=we.getAllSessions();return o([...D]),s(T.id),we.setCurrentSession(T.id),T.id},[h,w]),P=g.useCallback(T=>{s(T),we.setCurrentSession(T)},[]),R=g.useCallback(T=>{we.deleteSession(T);const D=we.getAllSessions();o([...D]),l===T&&(D.length>0?(s(D[0].id),we.setCurrentSession(D[0].id)):s(null))},[l]),B=g.useCallback((T,D)=>{we.updateSession(T,{title:D});const U=we.getAllSessions();o([...U])},[]),O=g.useCallback(T=>{if(!l)return;we.addMessageToSession(l,T);const D=we.getAllSessions();o([...D])},[l]),M=g.useCallback(async()=>{var _,z;if(!a.trim()||d.isLoading)return;let T=l;T||(T=b());const D=a.trim();if(u(""),c({isLoading:!0,error:null}),T){we.addMessageToSession(T,{role:"user",content:D});const k=we.getAllSessions();o([...k])}const U=we.getSession(T),H=(U==null?void 0:U.messages)&&U.messages.length>1;if(w&&!H&&T){we.addMessageToSession(T,{role:"system",content:w});const k=we.getAllSessions();o([...k])}try{const k=we.getSession(T),G=((z=(_=k==null?void 0:k.messages)==null?void 0:_.filter(Y=>Y.role!=="system"))==null?void 0:z.map(Y=>({role:Y.role,content:Y.content})))||[],A=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:G,system_prompt:w||null,model_name:h,temperature:S,max_new_tokens:v})});if(!A.ok){const Y=await A.json();throw new Error(Y.detail||`HTTP error! status: ${A.status}`)}const C=await A.json();if(T){we.addMessageToSession(T,{role:"assistant",content:C.content,thinking_content:C.thinking_content,model_used:C.model_used,supports_thinking:C.supports_thinking});const Y=we.getAllSessions();o([...Y])}c({isLoading:!1,error:null})}catch(k){const G=k instanceof Error?k.message:"An error occurred";if(c({isLoading:!1,error:G}),T){we.addMessageToSession(T,{role:"assistant",content:`Sorry, I encountered an error: ${G}`});const A=we.getAllSessions();o([...A])}}},[a,d.isLoading,l,b,O,w,N.length,t,h,S,v]),j=g.useCallback(()=>{c({isLoading:!1,error:null})},[]),V=g.useCallback(()=>{we.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:E,currentSessionId:l,createNewSession:b,selectSession:P,deleteSession:R,renameSession:B,clearAllSessions:V,messages:N,input:a,setInput:u,sendMessage:M,stopGeneration:j,isLoading:d.isLoading,error:d.error,selectedModel:h,setSelectedModel:p,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}}function RA(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:d,isLoading:c,selectedModel:h,setSelectedModel:p,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:m,maxTokens:v,setMaxTokens:x}=_A(),[E,N]=g.useState(!1),[b,P]=g.useState(!1),[R,B]=g.useState(null),[O,M]=g.useState(!1),[j,V]=g.useState(null),[T,D]=g.useState([]),U=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Technical Writer",prompt:"You are a technical writer. Create clear, comprehensive documentation and explanations. Use proper formatting and structure your responses logically."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{name:"Research Assistant",prompt:"You are a research assistant. Provide detailed, well-researched responses with clear reasoning. Cite sources when relevant and present information objectively."},{name:"Teacher",prompt:"You are an experienced teacher. Explain concepts clearly, use examples, and break down complex topics into understandable parts. Be encouraging and patient."}],H=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];g.useEffect(()=>{k()},[]),g.useEffect(()=>{if(h&&!T.find(A=>A.model_name===h)){const A=T[0];A&&p(A.model_name)}},[T,h,p]),g.useEffect(()=>{(async()=>{if(!h||!T.length)return;const C=T.find(Q=>Q.model_name===h);if(!C)return;const Y=`${window.location.protocol}//${window.location.host}`;if(C.type==="local"&&!C.is_loaded){V(C),M(!0);return}const ue=T.filter(Q=>Q.type==="local"&&Q.is_loaded&&Q.model_name!==h);for(const Q of ue)try{(await fetch(`${Y}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Q.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Q.model_name}`)}catch(K){console.error(`Error auto-unloading model ${Q.model_name}:`,K)}ue.length>0&&k()})()},[h,T]);const _=async()=>{if(j){M(!1),B(j.model_name);try{const A=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${A}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:j.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${j.model_name}`),k();else{console.error(`❌ Failed to load model: ${j.model_name}`);const Y=T.find(ue=>ue.type==="api");Y&&p(Y.model_name)}}catch(A){console.error("Error loading model:",A);const C=T.find(Y=>Y.type==="api");C&&p(C.model_name)}finally{B(null),V(null)}}},z=()=>{M(!1),V(null);const A=T.find(C=>C.type==="api");A&&p(A.model_name)};g.useEffect(()=>{const A=async()=>{const C=`${window.location.protocol}//${window.location.host}`,Y=T.filter(ue=>ue.type==="local"&&ue.is_loaded);for(const ue of Y)try{await fetch(`${C}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ue.model_name})}),console.log(`✅ Cleanup: unloaded ${ue.model_name}`)}catch(Q){console.error(`Error cleaning up model ${ue.model_name}:`,Q)}};return()=>{A()}},[T]);const k=async()=>{try{const A=`${window.location.protocol}//${window.location.host}`,C=await fetch(`${A}/models`);if(C.ok){const Y=await C.json();if(D(Y.models),Y.current_model&&h!==Y.current_model)p(Y.current_model);else if(!h&&Y.models.length>0){const Q=Y.models.find(K=>K.type==="api")||Y.models[0];p(Q.model_name)}}}catch(A){console.error("Failed to fetch models:",A)}},G=A=>{a(A)};return f.jsxs("div",{className:"min-h-screen bg-background flex",children:[f.jsx("div",{className:` + ${E?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:f.jsxs("div",{className:"p-4 space-y-4",children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),f.jsxs(Ce,{onClick:r,size:"sm",children:[f.jsx(BC,{className:"h-4 w-4 mr-1"}),"New"]})]}),f.jsx("div",{className:"space-y-2",children:e.map(A=>f.jsxs(Ke,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===A.id?"bg-accent border-primary":""}`,onClick:()=>i(A.id),children:[f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsx("span",{className:"text-sm font-medium truncate",children:A.title}),f.jsx(Ce,{size:"sm",variant:"ghost",onClick:C=>{C.stopPropagation(),o(A.id)},className:"h-6 w-6 p-0",children:f.jsx(Sy,{className:"h-3 w-3"})})]}),f.jsxs("div",{className:"text-xs text-muted-foreground",children:[A.messages.length," messages"]})]},A.id))})]})}),E&&f.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>N(!1)}),f.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[f.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:f.jsxs("div",{className:"flex h-14 items-center px-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Ce,{variant:"ghost",size:"sm",onClick:()=>N(!E),className:"lg:hidden",children:E?f.jsx(LC,{className:"h-4 w-4"}):f.jsx(zC,{className:"h-4 w-4"})}),f.jsx(xr,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&f.jsxs(Ae,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),f.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[f.jsxs(Ce,{variant:"outline",size:"sm",onClick:()=>N(!E),className:"hidden lg:flex flex-shrink-0",children:[f.jsx(_C,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),f.jsxs(Ce,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[f.jsx(EC,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"View code"}),f.jsx("span",{className:"sm:hidden",children:"Code"})]}),f.jsxs(Ce,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[f.jsx(rE,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),f.jsxs(Ce,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[f.jsx(QC,{className:"h-4 w-4 mr-2"}),f.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),f.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[f.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&f.jsx("div",{className:"p-6 border-b",children:f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{className:"text-base",children:"Start with a sample prompt"})}),f.jsx(qe,{children:f.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:H.map((A,C)=>f.jsx(Ce,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>G(A.prompt),disabled:c,children:f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:A.title}),f.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:A.description})]})},C))})})]})}),f.jsx(K0,{messages:l.map(A=>({id:A.id,role:A.role,content:A.content,createdAt:new Date(A.timestamp)})),input:s,handleInputChange:A=>a(A.target.value),handleSubmit:async A=>{A.preventDefault(),!(!h||!T.find(C=>C.model_name===h))&&await u()},isGenerating:c,stop:d,className:"flex-1"})]}),f.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:f.jsxs("div",{className:"p-4 space-y-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(pd,{className:"h-4 w-4"}),f.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{className:"text-sm",children:"Model Selection"})}),f.jsxs(qe,{className:"space-y-3",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-xs font-medium mb-2",children:"Active Model"}),f.jsxs(q2,{value:h||"",onValueChange:p,children:[f.jsx(dx,{className:"w-full",children:f.jsx(J2,{placeholder:"Select a model...",children:h&&(()=>{const A=T.find(Y=>Y.model_name===h);if(!A)return h;const C=A.type==="api";return f.jsxs("div",{className:"flex items-center gap-2",children:[C?f.jsx(ri,{className:"h-4 w-4 text-blue-500"}):A.supports_thinking?f.jsx(fr,{className:"h-4 w-4 text-purple-500"}):f.jsx(os,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{className:"truncate",children:A.name}),R===h?f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Loading..."}):f.jsx(Ae,{variant:"outline",className:"text-xs",children:C?"API":A.is_loaded?"Loaded":"Available"})]})})()})}),f.jsxs(hx,{children:[f.jsxs(Gp,{children:[f.jsx(tc,{children:"🌐 API Models"}),T.filter(A=>A.type==="api").map(A=>f.jsx(nc,{value:A.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ri,{className:"h-4 w-4 text-blue-500"}),f.jsx("span",{children:A.name}),f.jsx(Ae,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},A.model_name))]}),f.jsxs(Gp,{children:[f.jsx(tc,{children:"💻 Local Models"}),T.filter(A=>A.type==="local").map(A=>f.jsx(nc,{value:A.model_name,children:f.jsxs("div",{className:"flex items-center gap-2",children:[A.supports_thinking?f.jsx(fr,{className:"h-4 w-4 text-purple-500"}):f.jsx(os,{className:"h-4 w-4 text-green-500"}),f.jsx("span",{children:A.name}),R===A.model_name?f.jsx(Ae,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):A.is_loaded?f.jsx(Ae,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):f.jsx(Ae,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},A.model_name))]})]})]})]}),f.jsx("div",{className:"pt-2 border-t",children:f.jsx(Ce,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:f.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[f.jsx(gi,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{className:"text-sm",children:"Parameters"})}),f.jsxs(qe,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsxs(Qt,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),f.jsx(Hu,{value:[S],onValueChange:A=>m(A[0]),min:0,max:2,step:.01,className:"mt-2",disabled:c}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),f.jsxs("div",{children:[f.jsxs(Qt,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),f.jsx(Hu,{value:[v],onValueChange:A=>x(A[0]),min:100,max:4096,step:100,className:"mt-2",disabled:c})]})]})]}),f.jsx(Ke,{children:f.jsxs(sP,{open:b,onOpenChange:P,children:[f.jsx(bt,{children:f.jsx(aP,{asChild:!0,children:f.jsxs(Ce,{variant:"ghost",className:"w-full justify-between p-0",disabled:c,children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(xr,{className:"h-4 w-4"}),f.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),w&&f.jsx(Ae,{variant:"secondary",className:"text-xs",children:"Custom"})]}),f.jsx(fd,{className:`h-4 w-4 transition-transform ${b?"transform rotate-180":""}`})]})})}),f.jsx(uP,{children:f.jsxs(qe,{className:"space-y-3",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),f.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:U.map(A=>f.jsx(Ce,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>y(A.prompt),disabled:c,children:A.name},A.name))})]}),f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center justify-between mb-2",children:[f.jsx(Qt,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),w&&f.jsxs(Ce,{variant:"ghost",size:"sm",onClick:()=>y(""),className:"h-6 px-2 text-xs",disabled:c,children:[f.jsx(UC,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),f.jsx("textarea",{id:"system-prompt",value:w,onChange:A=>y(A.target.value),placeholder:"Enter custom system prompt to define how the model should behave...",className:"w-full min-h-[80px] text-xs p-2 border rounded-md bg-background",disabled:c}),f.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),f.jsx(FP,{open:O,onOpenChange:M,children:f.jsxs(n0,{children:[f.jsxs(r0,{children:[f.jsxs(o0,{className:"flex items-center gap-2",children:[f.jsx(yy,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),f.jsx(l0,{asChild:!0,children:f.jsxs("div",{className:"space-y-3",children:[f.jsxs("p",{children:["You're about to load ",f.jsx("strong",{children:j==null?void 0:j.name})," locally."]}),f.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(tE,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),f.jsxs("div",{className:"text-sm",children:[f.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),f.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[f.jsxs("li",{children:["• ",f.jsx("strong",{children:"Storage:"})," ",j==null?void 0:j.size_gb]}),f.jsxs("li",{children:["• ",f.jsx("strong",{children:"RAM:"})," ~",j==null?void 0:j.size_gb," (while running)"]}),f.jsxs("li",{children:["• ",f.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),f.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:f.jsxs("div",{className:"text-sm text-blue-700",children:[f.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),f.jsx("p",{className:"mt-1",children:j==null?void 0:j.description}),(j==null?void 0:j.supports_thinking)&&f.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[f.jsx(fr,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),f.jsxs(i0,{children:[f.jsx(a0,{onClick:z,children:"Cancel"}),f.jsx(s0,{onClick:_,children:"Load Model"})]})]})})]})}function TA(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[i,o]=g.useState(null);g.useEffect(()=>{l()},[]);const l=async()=>{try{const u=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${u}/models`);if(d.ok){const c=await d.json();t(c.models)}}catch(u){console.error("Failed to fetch models:",u)}finally{r(!1)}},s=async u=>{o(u);try{const d=`${window.location.protocol}//${window.location.host}`;(await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(d){console.error("Failed to load model:",d)}finally{o(null)}},a=async u=>{try{const d=`${window.location.protocol}//${window.location.host}`;(await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:u})})).ok&&await l()}catch(d){console.error("Failed to unload model:",d)}};return n?f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b",children:f.jsx("div",{className:"flex h-14 items-center px-6",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(gi,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]})})}),f.jsx("div",{className:"flex items-center justify-center h-64",children:f.jsx(wy,{className:"h-8 w-8 animate-spin"})})]}):f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b",children:f.jsxs("div",{className:"flex h-14 items-center px-6",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(gi,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]}),f.jsx("div",{className:"ml-auto",children:f.jsx(Ce,{variant:"outline",size:"sm",onClick:l,children:"Refresh"})})]})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[f.jsx(Ke,{className:"bg-blue-50 border-blue-200",children:f.jsx(qe,{className:"pt-6",children:f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(xy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),f.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Load models to use them in the playground. Models are cached locally for faster access. Each model requires significant storage space and initial download time."})]})]})})}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(ri,{className:"h-5 w-5"}),"API Models",f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:e.filter(u=>u.type==="api").map(u=>f.jsx(zh,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),f.jsxs("div",{children:[f.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[f.jsx(vy,{className:"h-5 w-5"}),"Local Models",f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Privacy-First"})]}),f.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(u=>u.type==="local").map(u=>f.jsx(zh,{model:u,modelLoading:i,onLoad:s,onUnload:a},u.model_name))})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsx(Ft,{children:"Model Statistics"})}),f.jsx(qe,{children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),f.jsx("div",{className:"text-sm text-muted-foreground",children:"Available Models"})]}),f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(u=>u.is_loaded).length}),f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(u=>u.supports_thinking).length}),f.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function zh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api";return f.jsxs(Ke,{className:"relative",children:[f.jsx(bt,{children:f.jsx("div",{className:"flex items-start justify-between",children:f.jsxs("div",{className:"flex items-center gap-3",children:[i?f.jsx(ri,{className:"h-6 w-6 text-blue-500"}):e.supports_thinking?f.jsx(fr,{className:"h-6 w-6 text-blue-500"}):f.jsx(os,{className:"h-6 w-6 text-green-500"}),f.jsxs("div",{children:[f.jsx(Ft,{className:"text-lg",children:e.name}),f.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[i?f.jsxs(Ae,{variant:"default",className:"bg-blue-600",children:[f.jsx(ri,{className:"h-3 w-3 mr-1"}),"API Model"]}):f.jsxs(Ae,{variant:e.supports_thinking?"default":"secondary",children:[f.jsx(vy,{className:"h-3 w-3 mr-1"}),e.supports_thinking?"Thinking Model":"Instruction Model"]}),e.is_loaded&&f.jsxs(Ae,{variant:"outline",className:"text-green-600 border-green-600",children:[f.jsx(SC,{className:"h-3 w-3 mr-1"}),i?"Ready":"Loaded"]})]})]})]})})}),f.jsxs(qe,{className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),f.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[f.jsxs("span",{children:["Size: ",e.size_gb]}),!i&&f.jsx("span",{children:"Format: Safetensors"}),i&&f.jsx("span",{children:"Type: Cloud API"})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("h4",{className:"text-sm font-medium",children:"Capabilities"}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Text Generation"}),f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Conversation"}),f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Code"}),e.supports_thinking&&f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Reasoning"}),i&&e.model_name.includes("vl")&&f.jsx(Ae,{variant:"outline",className:"text-xs",children:"Vision"})]})]}),f.jsx("div",{className:"pt-2 border-t",children:e.is_loaded?f.jsxs("div",{className:"flex gap-2",children:[!i&&f.jsxs(Ce,{variant:"outline",size:"sm",onClick:()=>r(e.model_name),className:"flex-1",children:[f.jsx(Sy,{className:"h-4 w-4 mr-2"}),"Unload"]}),f.jsx(Ce,{size:"sm",className:"flex-1",asChild:!0,children:f.jsx("a",{href:"/playground",children:"Use in Playground"})})]}):f.jsx(Ce,{onClick:()=>n(e.model_name),disabled:t===e.model_name,className:"w-full",size:"sm",children:t===e.model_name?f.jsxs(f.Fragment,{children:[f.jsx(wy,{className:"h-4 w-4 mr-2 animate-spin"}),i?"Connecting...":"Loading..."]}):f.jsxs(f.Fragment,{children:[i?f.jsx(ri,{className:"h-4 w-4 mr-2"}):f.jsx(yy,{className:"h-4 w-4 mr-2"}),i?"Connect":"Load Model"]})})})]})]})}function AA(){return f.jsxs("div",{className:"min-h-screen bg-background",children:[f.jsx("div",{className:"border-b",children:f.jsx("div",{className:"flex h-14 items-center px-6",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(pd,{className:"h-5 w-5"}),f.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),f.jsx("div",{className:"flex-1 p-6",children:f.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(KC,{className:"h-5 w-5"}),"Server Configuration"]})}),f.jsx(qe,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium",children:"Backend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium",children:"Frontend URL"}),f.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(Bu,{className:"h-5 w-5"}),"Privacy & Security"]})}),f.jsx(qe,{className:"space-y-4",children:f.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[f.jsx(Bu,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),f.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),f.jsxs(Ke,{children:[f.jsx(bt,{children:f.jsxs(Ft,{className:"flex items-center gap-2",children:[f.jsx(xy,{className:"h-5 w-5"}),"System Information"]})}),f.jsx(qe,{className:"space-y-4",children:f.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium",children:"Platform"}),f.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[f.jsx(Ae,{variant:"outline",children:"Local"}),f.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),f.jsxs("div",{children:[f.jsx(Qt,{className:"text-sm font-medium",children:"Status"}),f.jsx("div",{className:"mt-1",children:f.jsx(Ae,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function IA(){return f.jsx(Nk,{children:f.jsx(xk,{children:f.jsxs(Dr,{path:"/",element:f.jsx(uE,{}),children:[f.jsx(Dr,{index:!0,element:f.jsx(wE,{})}),f.jsx(Dr,{path:"playground",element:f.jsx(RA,{})}),f.jsx(Dr,{path:"models",element:f.jsx(TA,{})}),f.jsx(Dr,{path:"settings",element:f.jsx(AA,{})})]})})})}Ua.createRoot(document.getElementById("root")).render(f.jsx(Mt.StrictMode,{children:f.jsx(IA,{})})); +//# sourceMappingURL=index-b3464058.js.map