diff --git "a/static/assets/index-928bebf1.js" "b/static/assets/index-928bebf1.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-928bebf1.js" @@ -0,0 +1,367 @@ +function R1(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 Yl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ls(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hh={exports:{}},Os={},gh={exports:{}},se={};/** + * @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 Mo=Symbol.for("react.element"),I1=Symbol.for("react.portal"),M1=Symbol.for("react.fragment"),L1=Symbol.for("react.strict_mode"),O1=Symbol.for("react.profiler"),D1=Symbol.for("react.provider"),z1=Symbol.for("react.context"),F1=Symbol.for("react.forward_ref"),B1=Symbol.for("react.suspense"),$1=Symbol.for("react.memo"),U1=Symbol.for("react.lazy"),Nf=Symbol.iterator;function V1(e){return e===null||typeof e!="object"?null:(e=Nf&&e[Nf]||e["@@iterator"],typeof e=="function"?e:null)}var yh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xh=Object.assign,vh={};function Ci(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||yh}Ci.prototype.isReactComponent={};Ci.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")};Ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wh(){}wh.prototype=Ci.prototype;function Uc(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||yh}var Vc=Uc.prototype=new wh;Vc.constructor=Uc;xh(Vc,Ci.prototype);Vc.isPureReactComponent=!0;var Ef=Array.isArray,Sh=Object.prototype.hasOwnProperty,Hc={current:null},kh={key:!0,ref:!0,__self:!0,__source:!0};function bh(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)Sh.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,Q=P[U];if(0>>1;Ui(de,k))rei(G,de)?(P[U]=G,P[re]=k,U=re):(P[U]=de,P[ne]=k,U=ne);else if(rei(G,k))P[U]=G,P[re]=k,U=re;else break e}}return z}function i(P,z){var k=P.sortIndex-z.sortIndex;return k!==0?k:P.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=[],c=[],f=1,d=null,p=3,m=!1,w=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(P){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=P)r(c),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(c)}}function b(P){if(y=!1,v(P),!w)if(n(a)!==null)w=!0,L(E);else{var z=n(c);z!==null&&B(b,z.startTime-P)}}function E(P,z){w=!1,y&&(y=!1,x(T),T=-1),m=!0;var k=p;try{for(v(z),d=n(a);d!==null&&(!(d.expirationTime>z)||P&&!R());){var U=d.callback;if(typeof U=="function"){d.callback=null,p=d.priorityLevel;var Q=U(d.expirationTime<=z);z=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(a)&&r(a),v(z)}else r(a);d=n(a)}if(d!==null)var C=!0;else{var ne=n(c);ne!==null&&B(b,ne.startTime-z),C=!1}return C}finally{d=null,p=k,m=!1}}var N=!1,j=null,T=-1,O=5,M=-1;function R(){return!(e.unstable_now()-MP||125U?(P.sortIndex=k,t(c,P),n(a)===null&&P===n(c)&&(y?(x(T),T=-1):y=!0,B(b,k-U))):(P.sortIndex=Q,t(a,P),w||m||(w=!0,L(E))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var z=p;return function(){var k=p;p=z;try{return P.apply(this,arguments)}finally{p=k}}}})(Ph);jh.exports=Ph;var ew=jh.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 tw=g,Nt=ew;function F(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"),xu=Object.prototype.hasOwnProperty,nw=/^[: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]*$/,Pf={},Tf={};function rw(e){return xu.call(Tf,e)?!0:xu.call(Pf,e)?!1:nw.test(e)?Tf[e]=!0:(Pf[e]=!0,!1)}function iw(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 ow(e,t,n,r){if(t===null||typeof t>"u"||iw(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 lt(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 Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new lt(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){Ge[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gc=/[\-:]([a-z])/g;function Qc(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(Gc,Qc);Ge[t]=new lt(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(Gc,Qc);Ge[t]=new lt(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(Gc,Qc);Ge[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yc(e,t,n,r){var i=Ge.hasOwnProperty(t)?Ge[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{ba=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qi(e):""}function lw(e){switch(e.tag){case 5:return Qi(e.type);case 16:return Qi("Lazy");case 13:return Qi("Suspense");case 19:return Qi("SuspenseList");case 0:case 2:case 15:return e=Ca(e.type,!1),e;case 11:return e=Ca(e.type.render,!1),e;case 1:return e=Ca(e.type,!0),e;default:return""}}function ku(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 Hr:return"Fragment";case Vr:return"Portal";case vu:return"Profiler";case qc:return"StrictMode";case wu:return"Suspense";case Su:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ah:return(e.displayName||"Context")+".Consumer";case _h:return(e._context.displayName||"Context")+".Provider";case Xc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jc:return t=e.displayName||null,t!==null?t:ku(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return ku(e(t))}catch{}}return null}function sw(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 ku(t);case 8:return t===qc?"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 Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ih(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aw(e){var t=Ih(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 Jo(e){e._valueTracker||(e._valueTracker=aw(e))}function Mh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ih(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ql(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 bu(e,t){var n=t.checked;return Re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Af(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xn(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 Lh(e,t){t=t.checked,t!=null&&Yc(e,"checked",t,!1)}function Cu(e,t){Lh(e,t);var n=Xn(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")?Nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&Nu(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rf(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 Nu(e,t,n){(t!=="number"||ql(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yi=Array.isArray;function ni(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Zo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zi={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},uw=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){uw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function Fh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function Bh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Fh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cw=Re({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 Pu(e,t){if(t){if(cw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Tu(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 _u=null;function Zc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Au=null,ri=null,ii=null;function Lf(e){if(e=Do(e)){if(typeof Au!="function")throw Error(F(280));var t=e.stateNode;t&&(t=$s(t),Au(e.stateNode,e.type,t))}}function $h(e){ri?ii?ii.push(e):ii=[e]:ri=e}function Uh(){if(ri){var e=ri,t=ii;if(ii=ri=null,Lf(e),t)for(e=0;e>>=0,e===0?32:31-(Sw(e)/kw|0)|0}var el=64,tl=4194304;function qi(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 es(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=qi(s):(o&=l,o!==0&&(r=qi(o)))}else l=n&~i,l!==0?r=qi(l):o!==0&&(r=qi(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 Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Kt(t),e[t]=n}function Ew(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=to),Hf=String.fromCharCode(32),Wf=!1;function ag(e,t){switch(e){case"keyup":return eS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ug(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function nS(e,t){switch(e){case"compositionend":return ug(t);case"keypress":return t.which!==32?null:(Wf=!0,Hf);case"textInput":return e=t.data,e===Hf&&Wf?null:e;default:return null}}function rS(e,t){if(Wr)return e==="compositionend"||!sd&&ag(e,t)?(e=lg(),El=id=Dn=null,Wr=!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=Yf(n)}}function pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mg(){for(var e=window,t=ql();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ql(e.document)}return t}function ad(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 fS(e){var t=mg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pg(n.ownerDocument.documentElement,n)){if(r!==null&&ad(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=qf(n,o);var l=qf(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,Kr=null,Du=null,ro=null,zu=!1;function Xf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;zu||Kr==null||Kr!==ql(r)||(r=Kr,"selectionStart"in r&&ad(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}),ro&&vo(ro,r)||(ro=r,r=rs(Du,"onSelect"),0Yr||(e.current=Hu[Yr],Hu[Yr]=null,Yr--)}function Ce(e,t){Yr++,Hu[Yr]=e.current,e.current=t}var Jn={},Ze=ir(Jn),dt=ir(!1),Cr=Jn;function hi(e,t){var n=e.type.contextTypes;if(!n)return Jn;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 ft(e){return e=e.childContextTypes,e!=null}function os(){Pe(dt),Pe(Ze)}function ip(e,t,n){if(Ze.current!==Jn)throw Error(F(168));Ce(Ze,t),Ce(dt,n)}function bg(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(F(108,sw(e)||"Unknown",i));return Re({},n,r)}function ls(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jn,Cr=Ze.current,Ce(Ze,e),Ce(dt,dt.current),!0}function op(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=bg(e,t,Cr),r.__reactInternalMemoizedMergedChildContext=e,Pe(dt),Pe(Ze),Ce(Ze,e)):Pe(dt),Ce(dt,n)}var yn=null,Us=!1,za=!1;function Cg(e){yn===null?yn=[e]:yn.push(e)}function CS(e){Us=!0,Cg(e)}function or(){if(!za&&yn!==null){za=!0;var e=0,t=Se;try{var n=yn;for(Se=1;e>=l,i-=l,xn=1<<32-Kt(t)+i|n<T?(O=j,j=null):O=j.sibling;var M=p(x,j,v[T],b);if(M===null){j===null&&(j=O);break}e&&j&&M.alternate===null&&t(x,j),h=o(M,h,T),N===null?E=M:N.sibling=M,N=M,j=O}if(T===v.length)return n(x,j),Te&&fr(x,T),E;if(j===null){for(;TT?(O=j,j=null):O=j.sibling;var R=p(x,j,M.value,b);if(R===null){j===null&&(j=O);break}e&&j&&R.alternate===null&&t(x,j),h=o(R,h,T),N===null?E=R:N.sibling=R,N=R,j=O}if(M.done)return n(x,j),Te&&fr(x,T),E;if(j===null){for(;!M.done;T++,M=v.next())M=d(x,M.value,b),M!==null&&(h=o(M,h,T),N===null?E=M:N.sibling=M,N=M);return Te&&fr(x,T),E}for(j=r(x,j);!M.done;T++,M=v.next())M=m(j,x,T,M.value,b),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?T:M.key),h=o(M,h,T),N===null?E=M:N.sibling=M,N=M);return e&&j.forEach(function(_){return t(x,_)}),Te&&fr(x,T),E}function S(x,h,v,b){if(typeof v=="object"&&v!==null&&v.type===Hr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Xo:e:{for(var E=v.key,N=h;N!==null;){if(N.key===E){if(E=v.type,E===Hr){if(N.tag===7){n(x,N.sibling),h=i(N,v.props.children),h.return=x,x=h;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===In&&ap(E)===N.type){n(x,N.sibling),h=i(N,v.props),h.ref=$i(x,N,v),h.return=x,x=h;break e}n(x,N);break}else t(x,N);N=N.sibling}v.type===Hr?(h=Sr(v.props.children,x.mode,b,v.key),h.return=x,x=h):(b=Ml(v.type,v.key,v.props,null,x.mode,b),b.ref=$i(x,h,v),b.return=x,x=b)}return l(x);case Vr:e:{for(N=v.key;h!==null;){if(h.key===N)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(x,h.sibling),h=i(h,v.children||[]),h.return=x,x=h;break e}else{n(x,h);break}else t(x,h);h=h.sibling}h=Ka(v,x.mode,b),h.return=x,x=h}return l(x);case In:return N=v._init,S(x,h,N(v._payload),b)}if(Yi(v))return w(x,h,v,b);if(Oi(v))return y(x,h,v,b);al(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(x,h.sibling),h=i(h,v),h.return=x,x=h):(n(x,h),h=Wa(v,x.mode,b),h.return=x,x=h),l(x)):n(x,h)}return S}var yi=Pg(!0),Tg=Pg(!1),us=ir(null),cs=null,Jr=null,fd=null;function pd(){fd=Jr=cs=null}function md(e){var t=us.current;Pe(us),e._currentValue=t}function Gu(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 li(e,t){cs=e,fd=Jr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ct=!0),e.firstContext=null)}function Lt(e){var t=e._currentValue;if(fd!==e)if(e={context:e,memoizedValue:t,next:null},Jr===null){if(cs===null)throw Error(F(308));Jr=e,cs.dependencies={lanes:0,firstContext:e}}else Jr=Jr.next=e;return t}var yr=null;function hd(e){yr===null?yr=[e]:yr.push(e)}function _g(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,hd(t)):(n.next=i.next,i.next=n),t.interleaved=n,bn(e,r)}function bn(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 Mn=!1;function gd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ag(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 wn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,bn(e,n)}return i=r.interleaved,i===null?(t.next=t,hd(r)):(t.next=i.next,i.next=t),r.interleaved=t,bn(e,n)}function Pl(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,td(e,n)}}function up(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 ds(e,t,n,r){var i=e.updateQueue;Mn=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,c=a.next;a.next=null,l===null?o=c:l.next=c,l=a;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,f=c=a=null,s=o;do{var p=s.lane,m=s.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:m,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var w=e,y=s;switch(p=t,m=n,y.tag){case 1:if(w=y.payload,typeof w=="function"){d=w.call(m,d,p);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=y.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Re({},d,p);break e;case 2:Mn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else m={eventTime:m,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=m,a=d):f=f.next=m,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);if(f===null&&(a=d),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=f,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);jr|=l,e.lanes=l,e.memoizedState=d}}function cp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ba.transition;Ba.transition={};try{e(!1),t()}finally{Se=n,Ba.transition=r}}function Qg(){return Ot().memoizedState}function PS(e,t,n){var r=Gn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Yg(e))qg(t,n);else if(n=_g(e,t,n,r),n!==null){var i=it();Gt(n,e,r,i),Xg(n,t,r)}}function TS(e,t,n){var r=Gn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yg(e))qg(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,Qt(s,l)){var a=t.interleaved;a===null?(i.next=i,hd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=_g(e,t,i,r),n!==null&&(i=it(),Gt(n,e,r,i),Xg(n,t,r))}}function Yg(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function qg(e,t){io=ps=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,td(e,n)}}var ms={readContext:Lt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},_S={readContext:Lt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:Lt,useEffect:fp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,Vg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _l(4194308,4,e,t)},useInsertionEffect:function(e,t){return _l(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();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=PS.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:dp,useDebugValue:Cd,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=dp(!1),t=e[0];return e=jS.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ae,i=nn();if(Te){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),He===null)throw Error(F(349));Er&30||Lg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,fp(Dg.bind(null,r,o,e),[e]),r.flags|=2048,jo(9,Og.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=nn(),t=He.identifierPrefix;if(Te){var n=vn,r=xn;n=(r&~(1<<32-Kt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=No++,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[on]=t,e[ko]=r,sy(e,t,!1,!1),t.stateNode=e;e:{switch(l=Tu(n,r),n){case"dialog":je("cancel",e),je("close",e),i=r;break;case"iframe":case"object":case"embed":je("load",e),i=r;break;case"video":case"audio":for(i=0;iwi&&(t.flags|=128,r=!0,Ui(o,!1),t.lanes=4194304)}else{if(!r)if(e=fs(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ui(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Te)return Ye(t),null}else 2*Le()-o.renderingStartTime>wi&&n!==1073741824&&(t.flags|=128,r=!0,Ui(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=Le(),t.sibling=null,n=_e.current,Ce(_e,r?n&1|2:n&1),t):(Ye(t),null);case 22:case 23:return _d(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function zS(e,t){switch(cd(t),t.tag){case 1:return ft(t.type)&&os(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xi(),Pe(dt),Pe(Ze),vd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xd(t),null;case 13:if(Pe(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(_e),null;case 4:return xi(),null;case 10:return md(t.type._context),null;case 22:case 23:return _d(),null;case 24:return null;default:return null}}var cl=!1,qe=!1,FS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Zr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function nc(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var bp=!1;function BS(e,t){if(Fu=ts,e=mg(),ad(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,c=0,f=0,d=e,p=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===e)break t;if(p===n&&++c===i&&(s=l),p===o&&++f===r&&(a=l),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bu={focusedElem:e,selectionRange:n},ts=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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,x=t.stateNode,h=x.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ut(t.type,y),S);x.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(b){Ie(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return w=bp,bp=!1,w}function oo(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&&nc(t,n,o)}i=i.next}while(i!==r)}}function Ws(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 rc(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 cy(e){var t=e.alternate;t!==null&&(e.alternate=null,cy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[on],delete t[ko],delete t[Vu],delete t[kS],delete t[bS])),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 dy(e){return e.tag===5||e.tag===3||e.tag===4}function Cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dy(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 ic(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=is));else if(r!==4&&(e=e.child,e!==null))for(ic(e,t,n),e=e.sibling;e!==null;)ic(e,t,n),e=e.sibling}function oc(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(oc(e,t,n),e=e.sibling;e!==null;)oc(e,t,n),e=e.sibling}var We=null,Ht=!1;function Tn(e,t,n){for(n=n.child;n!==null;)fy(e,t,n),n=n.sibling}function fy(e,t,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(Ds,n)}catch{}switch(n.tag){case 5:qe||Zr(n,t);case 6:var r=We,i=Ht;We=null,Tn(e,t,n),We=r,Ht=i,We!==null&&(Ht?(e=We,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):We.removeChild(n.stateNode));break;case 18:We!==null&&(Ht?(e=We,n=n.stateNode,e.nodeType===8?Da(e.parentNode,n):e.nodeType===1&&Da(e,n),yo(e)):Da(We,n.stateNode));break;case 4:r=We,i=Ht,We=n.stateNode.containerInfo,Ht=!0,Tn(e,t,n),We=r,Ht=i;break;case 0:case 11:case 14:case 15:if(!qe&&(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)&&nc(n,t,l),i=i.next}while(i!==r)}Tn(e,t,n);break;case 1:if(!qe&&(Zr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ie(n,t,s)}Tn(e,t,n);break;case 21:Tn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,Tn(e,t,n),qe=r):Tn(e,t,n);break;default:Tn(e,t,n)}}function Np(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FS),t.forEach(function(r){var i=YS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ft(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Le()-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,zn===null)var r=!1;else{if(e=zn,zn=null,ys=0,fe&6)throw Error(F(331));var i=fe;for(fe|=4,K=e.current;K!==null;){var o=K,l=o.child;if(K.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aLe()-Pd?wr(e,0):jd|=n),pt(e,t)}function wy(e,t){t===0&&(e.mode&1?(t=tl,tl<<=1,!(tl&130023424)&&(tl=4194304)):t=1);var n=it();e=bn(e,t),e!==null&&(Lo(e,t,n),pt(e,n))}function QS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wy(e,n)}function YS(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(F(314))}r!==null&&r.delete(t),wy(e,n)}var Sy;Sy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dt.current)ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ct=!1,OS(e,t,n);ct=!!(e.flags&131072)}else ct=!1,Te&&t.flags&1048576&&Ng(t,as,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Al(e,t),e=t.pendingProps;var i=hi(t,Ze.current);li(t,n),i=Sd(null,t,r,e,i,n);var o=kd();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,ft(r)?(o=!0,ls(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,gd(t),i.updater=Hs,t.stateNode=i,i._reactInternals=t,Yu(t,r,e,n),t=Ju(null,t,r,!0,o,n)):(t.tag=0,Te&&o&&ud(t),rt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Al(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=XS(r),e=Ut(r,e),i){case 0:t=Xu(null,t,r,e,n);break e;case 1:t=wp(null,t,r,e,n);break e;case 11:t=xp(null,t,r,e,n);break e;case 14:t=vp(null,t,r,Ut(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),Xu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),wp(e,t,r,i,n);case 3:e:{if(iy(t),e===null)throw Error(F(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Ag(e,t),ds(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=vi(Error(F(423)),t),t=Sp(e,t,r,n,i);break e}else if(r!==i){i=vi(Error(F(424)),t),t=Sp(e,t,r,n,i);break e}else for(St=Hn(t.stateNode.containerInfo.firstChild),bt=t,Te=!0,Wt=null,n=Tg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gi(),r===i){t=Cn(e,t,n);break e}rt(e,t,r,n)}t=t.child}return t;case 5:return Rg(t),e===null&&Ku(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,$u(r,i)?l=null:o!==null&&$u(r,o)&&(t.flags|=32),ry(e,t),rt(e,t,l,n),t.child;case 6:return e===null&&Ku(t),null;case 13:return oy(e,t,n);case 4:return yd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yi(t,null,r,n):rt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),xp(e,t,r,i,n);case 7:return rt(e,t,t.pendingProps,n),t.child;case 8:return rt(e,t,t.pendingProps.children,n),t.child;case 12:return rt(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,Ce(us,r._currentValue),r._currentValue=l,o!==null)if(Qt(o.value,l)){if(o.children===i.children&&!dt.current){t=Cn(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=wn(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?a.next=a:(a.next=f.next,f.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Gu(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(F(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Gu(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}rt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,li(t,n),i=Lt(i),r=r(i),t.flags|=1,rt(e,t,r,n),t.child;case 14:return r=t.type,i=Ut(r,t.pendingProps),i=Ut(r.type,i),vp(e,t,r,i,n);case 15:return ty(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ut(r,i),Al(e,t),t.tag=1,ft(r)?(e=!0,ls(t)):e=!1,li(t,n),Jg(t,r,i),Yu(t,r,i,n),Ju(null,t,r,!0,e,n);case 19:return ly(e,t,n);case 22:return ny(e,t,n)}throw Error(F(156,t.tag))};function ky(e,t){return Yh(e,t)}function qS(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 At(e,t,n,r){return new qS(e,t,n,r)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XS(e){if(typeof e=="function")return Rd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Xc)return 11;if(e===Jc)return 14}return 2}function Qn(e,t){var n=e.alternate;return n===null?(n=At(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 Ml(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Rd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Hr:return Sr(n.children,i,o,t);case qc:l=8,i|=8;break;case vu:return e=At(12,n,t,i|2),e.elementType=vu,e.lanes=o,e;case wu:return e=At(13,n,t,i),e.elementType=wu,e.lanes=o,e;case Su:return e=At(19,n,t,i),e.elementType=Su,e.lanes=o,e;case Rh:return Gs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _h:l=10;break e;case Ah:l=9;break e;case Xc:l=11;break e;case Jc:l=14;break e;case In:l=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=At(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Sr(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Gs(e,t,n,r){return e=At(22,e,r,t),e.elementType=Rh,e.lanes=n,e.stateNode={isHidden:!1},e}function Wa(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function Ka(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JS(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 Id(e,t,n,r,i,o,l,s,a){return e=new JS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=At(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gd(o),e}function ZS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ey)}catch(e){console.error(e)}}Ey(),Eh.exports=Et;var ji=Eh.exports;const ik=Ls(ji);var Ip=ji;yu.createRoot=Ip.createRoot,yu.hydrateRoot=Ip.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 To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function jy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function lk(){return Math.random().toString(36).substr(2,8)}function Lp(e,t){return{usr:e.state,key:e.key,idx:t}}function cc(e,t,n,r){return n===void 0&&(n=null),To({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pi(t):t,{state:n,key:t&&t.key||r||lk()})}function ws(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 Pi(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 sk(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Fn.Pop,a=null,c=f();c==null&&(c=0,l.replaceState(To({},l.state,{idx:c}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Fn.Pop;let S=f(),x=S==null?null:S-c;c=S,a&&a({action:s,location:y.location,delta:x})}function p(S,x){s=Fn.Push;let h=cc(y.location,S,x);n&&n(h,S),c=f()+1;let v=Lp(h,c),b=y.createHref(h);try{l.pushState(v,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}o&&a&&a({action:s,location:y.location,delta:1})}function m(S,x){s=Fn.Replace;let h=cc(y.location,S,x);n&&n(h,S),c=f();let v=Lp(h,c),b=y.createHref(h);l.replaceState(v,"",b),o&&a&&a({action:s,location:y.location,delta:0})}function w(S){let x=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:ws(S);return h=h.replace(/ $/,"%20"),Fe(x,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,x)}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(Mp,d),a=S,()=>{i.removeEventListener(Mp,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let x=w(S);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(S){return l.go(S)}};return y}var Op;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Op||(Op={}));function ak(e,t,n){return n===void 0&&(n="/"),uk(e,t,n,!1)}function uk(e,t,n,r){let i=typeof t=="string"?Pi(t):t,o=Dd(i.pathname||"/",n);if(o==null)return null;let l=Py(e);ck(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("/")&&(Fe(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 c=Yn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Fe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Py(o.children,t,f,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:yk(c,o.index),routesMeta:f})};return e.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Ty(o.path))i(o,l,a)}),t}function Ty(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=Ty(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 ck(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const dk=/^:[\w-]+$/,fk=3,pk=2,mk=1,hk=10,gk=-2,Dp=e=>e==="*";function yk(e,t){let n=e.split("/"),r=n.length;return n.some(Dp)&&(r+=gk),t&&(r+=pk),n.filter(i=>!Dp(i)).reduce((i,o)=>i+(dk.test(o)?fk:o===""?mk:hk),r)}function xk(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 vk(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:p,isOptional:m}=f;if(p==="*"){let y=s[d]||"";l=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const w=s[d];return m&&!w?c[p]=void 0:c[p]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:l,pattern:e}}function wk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),jy(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 Sk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jy(!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 Dd(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 kk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pi(e):e;return{pathname:n?n.startsWith("/")?n:bk(n,t):t,search:Ek(r),hash:jk(i)}}function bk(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 Ga(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 Ck(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _y(e,t){let n=Ck(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ay(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pi(e):(i=To({},e),Fe(!i.pathname||!i.pathname.includes("?"),Ga("?","pathname","search",i)),Fe(!i.pathname||!i.pathname.includes("#"),Ga("#","pathname","hash",i)),Fe(!i.search||!i.search.includes("#"),Ga("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}s=d>=0?t[d]:"/"}let a=kk(i,s),c=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(c||f)&&(a.pathname+="/"),a}const Yn=e=>e.join("/").replace(/\/\/+/g,"/"),Nk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ek=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ry=["post","put","patch","delete"];new Set(Ry);const Tk=["get",...Ry];new Set(Tk);/** + * 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 _o(){return _o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),g.useCallback(function(c,f){if(f===void 0&&(f={}),!s.current)return;if(typeof c=="number"){r.go(c);return}let d=Ay(c,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Yn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Ik=g.createContext(null);function Mk(e){let t=g.useContext(lr).outlet;return t&&g.createElement(Ik.Provider,{value:e},t)}function Ly(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Lr),{matches:i}=g.useContext(lr),{pathname:o}=Bo(),l=JSON.stringify(_y(i,r.v7_relativeSplatPath));return g.useMemo(()=>Ay(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Lk(e,t){return Ok(e,t)}function Ok(e,t,n,r){Fo()||Fe(!1);let{navigator:i}=g.useContext(Lr),{matches:o}=g.useContext(lr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let c=Bo(),f;if(t){var d;let S=typeof t=="string"?Pi(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Fe(!1),f=S}else f=c;let p=f.pathname||"/",m=p;if(a!=="/"){let S=a.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=ak(e,{pathname:m}),y=$k(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Yn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Yn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&y?g.createElement(Js.Provider,{value:{location:_o({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Fn.Pop}},y):y}function Dk(){let e=Wk(),t=Pk(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 zk=g.createElement(Dk,null);class Fk 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(lr.Provider,{value:this.props.routeContext},g.createElement(Iy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bk(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(zd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(lr.Provider,{value:t},r)}function $k(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 f=l.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||Fe(!1),l=l.slice(0,Math.min(l.length,f+1))}let a=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,w=!1,y=null,S=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||zk,a&&(c<0&&p===0?(Gk("route-fallback",!1),w=!0,S=null):c===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let x=t.concat(l.slice(0,p+1)),h=()=>{let v;return m?v=y:w?v=S:d.route.Component?v=g.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=f,g.createElement(Bk,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Fk,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:h(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):h()},null)}var Oy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Oy||{}),Ss=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}(Ss||{});function Uk(e){let t=g.useContext(zd);return t||Fe(!1),t}function Vk(e){let t=g.useContext(_k);return t||Fe(!1),t}function Hk(e){let t=g.useContext(lr);return t||Fe(!1),t}function Dy(e){let t=Hk(),n=t.matches[t.matches.length-1];return n.route.id||Fe(!1),n.route.id}function Wk(){var e;let t=g.useContext(Iy),n=Vk(Ss.UseRouteError),r=Dy(Ss.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Kk(){let{router:e}=Uk(Oy.UseNavigateStable),t=Dy(Ss.UseNavigateStable),n=g.useRef(!1);return My(()=>{n.current=!0}),g.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,_o({fromRouteId:t},o)))},[e,t])}const Fp={};function Gk(e,t,n){!t&&!Fp[e]&&(Fp[e]=!0)}function Qk(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 Mk(e.context)}function mr(e){Fe(!1)}function qk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Fn.Pop,navigator:o,static:l=!1,future:s}=e;Fo()&&Fe(!1);let a=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:a,navigator:o,static:l,future:_o({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Pi(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,y=g.useMemo(()=>{let S=Dd(f,a);return S==null?null:{location:{pathname:S,search:d,hash:p,state:m,key:w},navigationType:i}},[a,f,d,p,m,w,i]);return y==null?null:g.createElement(Lr.Provider,{value:c},g.createElement(Js.Provider,{children:n,value:y}))}function Xk(e){let{children:t,location:n}=e;return Lk(dc(t),n)}new Promise(()=>{});function dc(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,dc(r.props.children,o));return}r.type!==mr&&Fe(!1),!r.props.index||!r.props.children||Fe(!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=dc(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 fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Zk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eb(e,t){return e.button===0&&(!t||t==="_self")&&!Zk(e)}const tb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nb="6";try{window.__reactRouterVersion=nb}catch{}const rb="startTransition",Bp=Kc[rb];function ib(e){let{basename:t,children:n,future:r,window:i}=e,o=g.useRef();o.current==null&&(o.current=ok({window:i,v5Compat:!0}));let l=o.current,[s,a]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},f=g.useCallback(d=>{c&&Bp?Bp(()=>a(d)):a(d)},[a,c]);return g.useLayoutEffect(()=>l.listen(f),[l,f]),g.useEffect(()=>Qk(r),[r]),g.createElement(qk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const ob=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$p=g.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:c,preventScrollReset:f,viewTransition:d}=t,p=Jk(t,tb),{basename:m}=g.useContext(Lr),w,y=!1;if(typeof c=="string"&&lb.test(c)&&(w=c,ob))try{let v=new URL(window.location.href),b=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=Dd(b.pathname,m);b.origin===v.origin&&E!=null?c=E+b.search+b.hash:y=!0}catch{}let S=Ak(c,{relative:i}),x=sb(c,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function h(v){r&&r(v),v.defaultPrevented||x(v)}return g.createElement("a",fc({},p,{href:w||S,onClick:y||o?r:h,ref:n,target:a}))});var Up;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Up||(Up={}));var Vp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Vp||(Vp={}));function sb(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Zs(),c=Bo(),f=Ly(e,{relative:l});return g.useCallback(d=>{if(eb(d,n)){d.preventDefault();let p=r!==void 0?r:ws(c)===ws(f);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[c,a,f,r,i,n,e,o,l,s])}function zy(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 Uy="!";function hb(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,c=0,f,d=0;dc?f-c:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:S}}}function gb(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 yb(e){return{cache:mb(e.cacheSize),splitModifiers:hb(e),...ub(e)}}var xb=/\s+/;function vb(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(xb).map(function(l){var s=n(l),a=s.modifiers,c=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,p=r(d?f.substring(0,d):f),m=!!d;if(!p){if(!d)return{isTailwindClass:!1,originalClassName:l};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:l};m=!1}var w=gb(a).join(":"),y=c?w+Uy:w;return{isTailwindClass:!0,modifierId:y,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,c=l.hasPostfixModifier,f=s+a;return o.has(f)?!1:(o.add(f),i(a,c).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function wb(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Db=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Gp=e=>{const t=Db(e);return t.charAt(0).toUpperCase()+t.slice(1)},Wy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),zb=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 Fb={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 Bb=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,...Fb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Wy("lucide",i),...!o&&!zb(s)&&{"aria-hidden":"true"},...s},[...l.map(([c,f])=>g.createElement(c,f)),...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 J=(e,t)=>{const n=g.forwardRef(({className:r,...i},o)=>g.createElement(Bb,{ref:o,iconNode:t,className:Wy(`lucide-${Ob(Gp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Gp(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 $b=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ub=J("arrow-left",$b);/** + * @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 Vb=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Hb=J("award",Vb);/** + * @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 Wb=[["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"}]],ea=J("book-open",Wb);/** + * @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 Kb=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Gb=J("bookmark",Kb);/** + * @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 Qb=[["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"}]],ti=J("bot",Qb);/** + * @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 Yb=[["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"}]],Zn=J("brain",Yb);/** + * @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 qb=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Xb=J("check",qb);/** + * @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 Jb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ky=J("chevron-down",Jb);/** + * @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 Zb=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Qp=J("chevron-left",Zb);/** + * @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 eC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yp=J("chevron-right",eC);/** + * @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 tC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],nC=J("chevron-up",tC);/** + * @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:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],iC=J("circle-check-big",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 oC=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lC=J("clock",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 sC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ks=J("cloud",sC);/** + * @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=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],Gy=J("crown",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 uC=[["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"}]],cC=J("download",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:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],fC=J("eye",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 pC=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],mC=J("file",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 hC=[["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"}]],Qy=J("hard-drive",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 gC=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],yC=J("heart",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 xC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yy=J("info",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 vC=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],wC=J("layers",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 SC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],hc=J("loader-circle",SC);/** + * @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:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],bC=J("menu",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:"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"}]],$o=J("message-square",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 NC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bs=J("plus",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 EC=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],qy=J("save",EC);/** + * @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:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],qp=J("search",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 PC=[["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"}]],TC=J("send",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 _C=[["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"}]],AC=J("server",_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 RC=[["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"}]],kr=J("settings",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 IC=[["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"}]],gc=J("shield",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=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],LC=J("sliders-vertical",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"}]],DC=J("square",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 zC=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],FC=J("star",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 BC=[["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"}]],Xy=J("trash-2",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 $C=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Jy=J("trending-up",$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 UC=[["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"}]],VC=J("upload",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 HC=[["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"}]],Bd=J("user",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 WC=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],KC=J("users",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zy=J("x",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 QC=[["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"}]],Cs=J("zap",QC),YC=[{name:"Templates",href:"/templates",icon:Zn,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:$o,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:ea,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:kr,description:"Application settings"}];function qC(){const e=Bo();return u.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[u.jsx("div",{className:"p-6 border-b",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:u.jsx(Zn,{className:"h-5 w-5 text-primary-foreground"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),u.jsxs("div",{className:"flex-1 px-3 py-4 space-y-8",children:[u.jsx("div",{children:u.jsxs($p,{to:"/",className:"flex items-center gap-3 rounded-lg px-3 py-2 text-sm transition-all hover:bg-accent text-muted-foreground hover:text-foreground",children:[u.jsx(Ub,{className:"h-4 w-4"}),u.jsx("span",{children:"Back to Home"})]})}),u.jsxs("div",{children:[u.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),u.jsx("nav",{className:"space-y-1",children:YC.map(t=>{const n=e.pathname===t.href;return u.jsxs($p,{to:t.href,className:ue("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:[u.jsx(t.icon,{className:"h-4 w-4"}),u.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})]})]})}function XC(){return u.jsxs("div",{className:"flex h-screen bg-background",children:[u.jsx("div",{className:"w-64 border-r",children:u.jsx(qC,{})}),u.jsx("div",{className:"flex-1 overflow-hidden",children:u.jsx(Yk,{})})]})}function Xp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ex(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Xp(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(tN);if(a){const c=a.props.children,f=s.map(d=>d===a?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return u.jsx(t,{...l,ref:i,children:g.isValidElement(c)?g.cloneElement(c,void 0,f):null})}return u.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var JC=Si("Slot");function ZC(e){const t=g.forwardRef((n,r)=>{const{children:i,...o}=n;if(g.isValidElement(i)){const l=rN(i),s=nN(o,i.props);return i.type!==g.Fragment&&(s.ref=r?ex(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 tx=Symbol("radix.slottable");function eN(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=tx,t}function tN(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tx}function nN(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 rN(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 Jp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zp=Fy,$d=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Zp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],d=o==null?void 0:o[c];if(f===null)return null;const p=Jp(f)||Jp(d);return i[c][p]}),s=n&&Object.entries(n).reduce((c,f)=>{let[d,p]=f;return p===void 0||(c[d]=p),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(w=>{let[y,S]=w;return Array.isArray(S)?S.includes({...o,...s}[y]):{...o,...s}[y]===S})?[...c,d,p]:c},[]);return Zp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Ud=$d("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"}}),ve=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?JC:"button";return u.jsx(l,{className:ue(Ud({variant:t,size:n,className:e})),ref:o,...i})});ve.displayName="Button";function iN(){const e=Zs();return u.jsxs("div",{className:"min-h-screen bg-gray-50",children:[u.jsx("nav",{className:"bg-white border-b border-gray-200",children:u.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:u.jsxs("div",{className:"flex justify-between items-center h-16",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("img",{src:"/images/logo.png",alt:"EdgeLLM Logo",className:"h-10 w-10",onError:t=>{console.error("Logo failed to load"),t.currentTarget.style.display="none"}}),u.jsx("span",{className:"text-xl font-bold text-gray-900",children:"EdgeLLM"})]}),u.jsxs("div",{className:"hidden md:flex items-center space-x-8",children:[u.jsx("a",{href:"#",className:"text-white bg-purple-600 px-4 py-2 rounded-md font-medium",children:"Home"}),u.jsx("a",{href:"#technology",className:"text-gray-700 hover:text-purple-600 font-medium",children:"Technology"}),u.jsx("a",{href:"#usecases",className:"text-gray-700 hover:text-purple-600 font-medium",children:"Use Cases"}),u.jsx(ve,{variant:"outline",onClick:()=>e("/playground"),className:"border-purple-600 text-purple-600 hover:bg-purple-50",children:"My device"})]}),u.jsx("div",{className:"md:hidden",children:u.jsx(ve,{variant:"ghost",size:"sm",children:u.jsx(bC,{className:"h-5 w-5"})})})]})})}),u.jsx("div",{className:"relative py-24 px-4 sm:px-6 lg:px-8",children:u.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[u.jsx("div",{className:"relative mb-8",children:u.jsxs("h1",{className:"text-5xl md:text-7xl lg:text-8xl font-bold text-black leading-tight",children:["Offline AI that",u.jsx("br",{}),"works where the",u.jsx("br",{}),"cloud cannot"]})}),u.jsx("p",{className:"text-xl md:text-2xl text-purple-700 font-semibold mb-12 max-w-3xl mx-auto",children:"AI that stays reliable, private, and resilient in any environment"}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-20",children:[u.jsx(ve,{size:"lg",className:"bg-purple-600 hover:bg-purple-700 text-white px-8 py-3 text-lg font-medium",onClick:()=>e("/playground"),children:"Learn More"}),u.jsx(ve,{size:"lg",variant:"outline",className:"border-purple-600 text-purple-600 hover:bg-purple-50 px-8 py-3 text-lg font-medium",onClick:()=>e("/playground"),children:"I already have a device"})]})]})}),u.jsx("div",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-white",children:u.jsx("div",{className:"max-w-6xl mx-auto",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[u.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:u.jsx(lC,{className:"h-12 w-12 text-purple-600"})}),u.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Always Available"})]}),u.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud AI fails without internet. Our offline AI runs fully on-device, ready to assist anywhere — from airplanes to remote mountains."})]}),u.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:u.jsx(gc,{className:"h-12 w-12 text-purple-600"})}),u.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Privacy & Security"})]}),u.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud AI requires uploading sensitive data. Offline AI keeps all processing local, protecting personal privacy and enterprise security."})]}),u.jsxs("div",{className:"bg-white rounded-2xl p-8 shadow-lg border border-gray-200",children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("div",{className:"w-18 h-18 bg-purple-100 rounded-2xl flex items-center justify-center mb-6",children:u.jsx(Cs,{className:"h-12 w-12 text-purple-600"})}),u.jsx("h3",{className:"text-2xl font-bold text-black mb-4",children:"Reliability"})]}),u.jsx("p",{className:"text-gray-700 text-base leading-relaxed",children:"Cloud latency can cost lives in emergencies. Offline AI responds instantly, built for survival, healthcare, and safety-critical moments."})]})]})})}),u.jsx("div",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-50",children:u.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[u.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-8",children:"Get Started with EdgeLLM"}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[u.jsxs(ve,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2 border-2 hover:border-purple-600 hover:bg-purple-50",onClick:()=>e("/templates"),children:[u.jsx(Zn,{className:"h-6 w-6 text-purple-600"}),u.jsx("span",{className:"font-medium",children:"AI Templates"})]}),u.jsxs(ve,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2 border-2 hover:border-purple-600 hover:bg-purple-50",onClick:()=>e("/playground"),children:[u.jsx($o,{className:"h-6 w-6 text-purple-600"}),u.jsx("span",{className:"font-medium",children:"Playground"})]}),u.jsxs(ve,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2 border-2 hover:border-purple-600 hover:bg-purple-50",onClick:()=>e("/models"),children:[u.jsx(wC,{className:"h-6 w-6 text-purple-600"}),u.jsx("span",{className:"font-medium",children:"Models"})]}),u.jsxs(ve,{variant:"outline",className:"h-24 flex flex-col items-center justify-center gap-2 border-2 hover:border-purple-600 hover:bg-purple-50",onClick:()=>e("/settings"),children:[u.jsx(kr,{className:"h-6 w-6 text-purple-600"}),u.jsx("span",{className:"font-medium",children:"Settings"})]})]})]})}),u.jsx("footer",{className:"bg-gray-900 text-white py-12 px-4 sm:px-6 lg:px-8",children:u.jsxs("div",{className:"max-w-6xl mx-auto text-center",children:[u.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[u.jsx("img",{src:"/images/logo.png",alt:"EdgeLLM Logo",className:"h-8 w-8",onError:t=>{console.error("Footer logo failed to load"),t.currentTarget.style.display="none"}}),u.jsx("span",{className:"text-xl font-bold",children:"EdgeLLM"})]}),u.jsx("p",{className:"text-gray-400 mb-6",children:"Need help? Contact us to get customized device and services"}),u.jsxs("div",{className:"flex justify-center space-x-6",children:[u.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Privacy Policy"}),u.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Terms of Service"}),u.jsx("a",{href:"#",className:"text-gray-400 hover:text-white",children:"Support"})]})]})})]})}const oN=$d("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 we({className:e,variant:t,...n}){return u.jsx("div",{className:ue(oN({variant:t}),e),...n})}const Je=g.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Je.displayName="Card";const It=g.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("flex flex-col space-y-1.5 p-6",e),...t}));It.displayName="CardHeader";const Mt=g.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:ue("text-2xl font-semibold leading-none tracking-tight",e),...t}));Mt.displayName="CardTitle";const lN=g.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));lN.displayName="CardDescription";const mt=g.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("p-6 pt-0",e),...t}));mt.displayName="CardContent";const sN=g.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:ue("flex items-center p-6 pt-0",e),...t}));sN.displayName="CardFooter";const nx=g.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:ue("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium 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:r,...n}));nx.displayName="Input";function aN(){return[{id:"code-reviewer",name:"Code Review Expert",description:"Professional code reviewer for detailed analysis and suggestions. Helps identify bugs, security issues, and performance optimizations.",author:"EdgeLLM Team",category:"Developer Tools",tags:["code review","programming","debugging"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a senior software engineer. Analyze code for quality, best practices, performance, and security. Provide constructive feedback with specific examples.",temperature:.3,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-15",icon:"🔍",usageCount:1247,rating:4.8},{id:"writing-tutor",name:"Writing Assistant",description:"Helps improve writing with structure suggestions and clarity enhancements. Perfect for essays, articles, and professional documents.",author:"Community",category:"Writing",tags:["writing","editing","grammar"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a writing tutor. Help improve writing through structure, clarity, grammar, and style suggestions. Provide specific feedback and examples.",temperature:.4,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"📝",usageCount:892,rating:4.6},{id:"creative-writer",name:"Creative Writing Coach",description:"Inspires creativity and helps develop compelling stories and characters. Great for fiction writers and storytellers.",author:"Community",category:"Writing",tags:["creative","storytelling","fiction"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a creative writing coach. Help develop stories, characters, and narrative techniques. Provide encouraging feedback and creative suggestions.",temperature:.8,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-30",icon:"✨",usageCount:634,rating:4.7},{id:"data-analyst",name:"Data Analysis Expert",description:"Helps analyze data patterns, create insights, and generate comprehensive reports with statistical analysis.",author:"EdgeLLM Team",category:"Data & Analytics",tags:["data","analytics","statistics"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a data analysis expert. Help users understand data patterns, create visualizations, and provide statistical insights.",temperature:.2,maxTokens:1200,isOfficial:!0,createdAt:"2024-01-18",icon:"📊",usageCount:567,rating:4.9},{id:"language-tutor",name:"Language Learning Tutor",description:"Interactive language tutor for vocabulary, grammar, and conversation practice. Supports multiple languages.",author:"Community",category:"Education",tags:["language","learning","education"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a friendly language tutor. Help users learn languages through interactive exercises, explanations, and conversation practice.",temperature:.6,maxTokens:800,isOfficial:!1,createdAt:"2024-01-20",icon:"🌐",usageCount:423,rating:4.5},{id:"business-advisor",name:"Business Strategy Advisor",description:"Provides strategic business advice, market analysis, and growth recommendations for entrepreneurs and businesses.",author:"EdgeLLM Team",category:"Business",tags:["strategy","business","consulting"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a business strategy consultant. Provide strategic advice, market insights, and growth recommendations based on business principles.",temperature:.4,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-22",icon:"💼",usageCount:789,rating:4.7},{id:"research-assistant",name:"Research Assistant",description:"Helps with academic and professional research, source analysis, and comprehensive report writing.",author:"Community",category:"Research",tags:["research","academic","analysis"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a research assistant. Help users conduct thorough research, analyze sources, and organize findings into comprehensive reports.",temperature:.3,maxTokens:1200,isOfficial:!1,createdAt:"2024-01-25",icon:"📚",usageCount:356,rating:4.4},{id:"math-tutor",name:"Math & Science Tutor",description:"Expert tutor for mathematics, physics, chemistry, and other STEM subjects with step-by-step explanations.",author:"EdgeLLM Team",category:"Education",tags:["math","science","tutoring"],model:"Qwen/Qwen3-30B-A3B",systemPrompt:"You are a math and science tutor. Provide clear, step-by-step explanations for mathematical and scientific concepts.",temperature:.2,maxTokens:1e3,isOfficial:!0,createdAt:"2024-01-28",icon:"🔬",usageCount:678,rating:4.8}]}function uN(){const e=Zs(),[t,n]=g.useState(!1),[r]=g.useState(aN()),[i,o]=g.useState([]),[l,s]=g.useState(""),[a,c]=g.useState("All");g.useEffect(()=>{f(),d()},[]);const f=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,v=await fetch(`${h}/models`);n(v.ok)}catch{n(!1)}},d=()=>{try{const h=JSON.parse(localStorage.getItem("likedTemplates")||"[]");o(h)}catch(h){console.error("Failed to load liked templates:",h)}},p=h=>{const v=i.includes(h)?i.filter(b=>b!==h):[...i,h];o(v),localStorage.setItem("likedTemplates",JSON.stringify(v))},m=h=>{const v={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(v)),e("/playground")},w=r.filter(h=>{const v=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(E=>E.toLowerCase().includes(l.toLowerCase())),b=a==="All"||h.category===a;return v&&b}),y=w.filter(h=>h.isOfficial),S=[...w].sort((h,v)=>v.usageCount-h.usageCount).slice(0,6),x=["All",...Array.from(new Set(r.map(h=>h.category)))];return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("div",{className:"flex items-center gap-4",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:u.jsx(Zn,{className:"h-5 w-5 text-white"})}),u.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),u.jsx(we,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),u.jsxs(ve,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[u.jsx(ti,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[u.jsxs("div",{className:"text-center mb-12",children:[u.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),u.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto mb-8",children:"Discover, customize and deploy specialized AI assistants. Start with proven templates or build from scratch."}),u.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[u.jsx(qp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),u.jsx(nx,{type:"text",placeholder:"Search assistants...",value:l,onChange:h=>s(h.target.value),className:"pl-12 pr-4 py-3 text-lg rounded-full border-2 border-gray-200 focus:border-blue-500"})]}),u.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:x.map(h=>u.jsx(ve,{variant:a===h?"default":"outline",size:"sm",onClick:()=>c(h),className:"rounded-full",children:h},h))})]}),a==="All"&&y.length>0&&u.jsxs("div",{className:"mb-12",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[u.jsx(Gy,{className:"h-5 w-5 text-yellow-600"}),u.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),u.jsx(we,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:y.slice(0,3).map(h=>u.jsx(Qa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),a==="All"&&u.jsxs("div",{className:"mb-12",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[u.jsx(Jy,{className:"h-5 w-5 text-green-600"}),u.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),u.jsx(we,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>u.jsx(Qa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),u.jsxs("div",{className:"mb-12",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[u.jsx(KC,{className:"h-5 w-5 text-blue-600"}),u.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),u.jsxs(we,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>u.jsx(Qa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):u.jsx(Je,{className:"p-12 text-center",children:u.jsxs("div",{className:"flex flex-col items-center gap-4",children:[u.jsx(qp,{className:"h-12 w-12 text-gray-400"}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),u.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),u.jsx(ve,{variant:"outline",onClick:()=>{s(""),c("All")},children:"Clear filters"})]})})]})]})]})}function Qa({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return u.jsxs(Je,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&u.jsxs("div",{className:"absolute -top-2 -right-2 bg-yellow-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[u.jsx(Gy,{className:"h-3 w-3"}),"Featured"]}),o&&u.jsxs("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white text-xs px-2 py-1 rounded-full font-medium flex items-center gap-1",children:[u.jsx(Jy,{className:"h-3 w-3"}),"Trending"]}),u.jsx(It,{className:"pb-4",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-xl flex items-center justify-center text-2xl",children:e.icon}),u.jsxs("div",{children:[u.jsx(Mt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&u.jsxs(we,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[u.jsx(Hb,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),u.jsx(ve,{variant:"ghost",size:"sm",onClick:n,className:`${t?"text-red-500":"text-gray-400 hover:text-red-500"} transition-colors`,title:t?"Unlike":"Like",children:u.jsx(yC,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),u.jsxs(mt,{className:"space-y-4",children:[u.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),u.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>u.jsx(we,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),u.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(fC,{className:"h-4 w-4"}),u.jsx("span",{children:e.usageCount.toLocaleString()})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(FC,{className:"h-4 w-4 text-yellow-500 fill-current"}),u.jsx("span",{children:e.rating})]})]}),u.jsx(we,{variant:"outline",className:"text-xs",children:e.category})]}),u.jsx("div",{className:"pt-2",children:u.jsxs(ve,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[u.jsx($o,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function ee(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 cN(e,t){const n=g.createContext(t),r=o=>{const{children:l,...s}=o,a=g.useMemo(()=>s,Object.values(s));return u.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 sr(e,t=[]){let n=[];function r(o,l){const s=g.createContext(l),a=n.length;n=[...n,l];const c=d=>{var x;const{scope:p,children:m,...w}=d,y=((x=p==null?void 0:p[e])==null?void 0:x[a])||s,S=g.useMemo(()=>w,Object.values(w));return u.jsx(y.Provider,{value:S,children:m})};c.displayName=o+"Provider";function f(d,p){var y;const m=((y=p==null?void 0:p[e])==null?void 0:y[a])||s,w=g.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,f]}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,dN(i,...t)]}function dN(...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:c})=>{const d=a(o)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Vd(e){const t=e+"CollectionProvider",[n,r]=sr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:S,children:x}=y,h=Vt.useRef(null),v=Vt.useRef(new Map).current;return u.jsx(i,{scope:S,itemMap:v,collectionRef:h,children:x})};l.displayName=t;const s=e+"CollectionSlot",a=Si(s),c=Vt.forwardRef((y,S)=>{const{scope:x,children:h}=y,v=o(s,x),b=ye(S,v.collectionRef);return u.jsx(a,{ref:b,children:h})});c.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Si(f),m=Vt.forwardRef((y,S)=>{const{scope:x,children:h,...v}=y,b=Vt.useRef(null),E=ye(S,b),N=o(f,x);return Vt.useEffect(()=>(N.itemMap.set(b,{ref:b,...v}),()=>void N.itemMap.delete(b))),u.jsx(p,{[d]:"",ref:E,children:h})});m.displayName=f;function w(y){const S=o(e+"CollectionConsumer",y);return Vt.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((N,j)=>v.indexOf(N.ref.current)-v.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:c,ItemSlot:m},w,r]}var et=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},fN=Kc[" useId ".trim().toString()]||(()=>{}),pN=0;function qn(e){const[t,n]=g.useState(fN());return et(()=>{e||n(r=>r??String(pN++))},[e]),e||(t?`radix-${t}`:"")}var mN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=mN.reduce((e,t)=>{const n=Si(`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),u.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hN(e,t){e&&ji.flushSync(()=>e.dispatchEvent(t))}function er(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)},[])}var gN=Kc[" useInsertionEffect ".trim().toString()]||et;function ki({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=yN({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const f=g.useRef(e!==void 0);g.useEffect(()=>{const d=f.current;d!==s&&console.warn(`${r} is changing from ${d?"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.`),f.current=s},[s,r])}const c=g.useCallback(f=>{var d;if(s){const p=xN(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[s,e,o,l]);return[a,c]}function yN({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),i=g.useRef(n),o=g.useRef(t);return gN(()=>{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 xN(e){return typeof e=="function"}var vN=g.createContext(void 0);function ta(e){const t=g.useContext(vN);return e||t||"ltr"}var Ya="rovingFocusGroup.onEntryFocus",wN={bubbles:!1,cancelable:!0},Uo="RovingFocusGroup",[yc,rx,SN]=Vd(Uo),[kN,ix]=sr(Uo,[SN]),[bN,CN]=kN(Uo),ox=g.forwardRef((e,t)=>u.jsx(yc.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(yc.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(NN,{...e,ref:t})})}));ox.displayName=Uo;var NN=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=e,p=g.useRef(null),m=ye(t,p),w=ta(o),[y,S]=ki({prop:l,defaultProp:s??null,onChange:a,caller:Uo}),[x,h]=g.useState(!1),v=er(c),b=rx(n),E=g.useRef(!1),[N,j]=g.useState(0);return g.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(Ya,v),()=>T.removeEventListener(Ya,v)},[v]),u.jsx(bN,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:y,onItemFocus:g.useCallback(T=>S(T),[S]),onItemShiftTab:g.useCallback(()=>h(!0),[]),onFocusableItemAdd:g.useCallback(()=>j(T=>T+1),[]),onFocusableItemRemove:g.useCallback(()=>j(T=>T-1),[]),children:u.jsx(oe.div,{tabIndex:x||N===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:ee(e.onMouseDown,()=>{E.current=!0}),onFocus:ee(e.onFocus,T=>{const O=!E.current;if(T.target===T.currentTarget&&O&&!x){const M=new CustomEvent(Ya,wN);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const R=b().filter(L=>L.focusable),_=R.find(L=>L.active),H=R.find(L=>L.id===y),I=[_,H,...R].filter(Boolean).map(L=>L.ref.current);ax(I,f)}}E.current=!1}),onBlur:ee(e.onBlur,()=>h(!1))})})}),lx="RovingFocusGroupItem",sx=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=qn(),c=o||a,f=CN(lx,n),d=f.currentTabStopId===c,p=rx(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:y}=f;return g.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),u.jsx(yc.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:u.jsx(oe.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:ee(e.onMouseDown,S=>{r?f.onItemFocus(c):S.preventDefault()}),onFocus:ee(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:ee(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const x=PN(S,f.orientation,f.dir);if(x!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let v=p().filter(b=>b.focusable).map(b=>b.ref.current);if(x==="last")v.reverse();else if(x==="prev"||x==="next"){x==="prev"&&v.reverse();const b=v.indexOf(S.currentTarget);v=f.loop?TN(v,b+1):v.slice(b+1)}setTimeout(()=>ax(v))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});sx.displayName=lx;var EN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PN(e,t,n){const r=jN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EN[r]}function ax(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function TN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var _N=ox,AN=sx;function RN(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Vo=e=>{const{present:t,children:n}=e,r=IN(t),i=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),o=ye(r.ref,MN(i));return typeof n=="function"||r.isPresent?g.cloneElement(i,{ref:o}):null};Vo.displayName="Presence";function IN(e){const[t,n]=g.useState(),r=g.useRef(null),i=g.useRef(e),o=g.useRef("none"),l=e?"mounted":"unmounted",[s,a]=RN(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=ml(r.current);o.current=s==="mounted"?c:"none"},[s]),et(()=>{const c=r.current,f=i.current;if(f!==e){const p=o.current,m=ml(c);e?a("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),et(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,d=m=>{const y=ml(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=ml(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function ml(e){return(e==null?void 0:e.animationName)||"none"}function MN(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 na="Tabs",[LN,RI]=sr(na,[ix]),ux=ix(),[ON,Hd]=LN(na),cx=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...c}=e,f=ta(s),[d,p]=ki({prop:r,onChange:i,defaultProp:o??"",caller:na});return u.jsx(ON,{scope:n,baseId:qn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:a,children:u.jsx(oe.div,{dir:f,"data-orientation":l,...c,ref:t})})});cx.displayName=na;var dx="TabsList",fx=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Hd(dx,n),l=ux(n);return u.jsx(_N,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:u.jsx(oe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});fx.displayName=dx;var px="TabsTrigger",mx=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Hd(px,n),s=ux(n),a=yx(l.baseId,r),c=xx(l.baseId,r),f=r===l.value;return u.jsx(AN,{asChild:!0,...s,focusable:!i,active:f,children:u.jsx(oe.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":c,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:ee(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:ee(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:ee(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});mx.displayName=px;var hx="TabsContent",gx=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Hd(hx,n),a=yx(s.baseId,r),c=xx(s.baseId,r),f=r===s.value,d=g.useRef(f);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),u.jsx(Vo,{present:i||f,children:({present:p})=>u.jsx(oe.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:c,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});gx.displayName=hx;function yx(e,t){return`${e}-trigger-${t}`}function xx(e,t){return`${e}-content-${t}`}var DN=cx,vx=fx,wx=mx,Sx=gx;const zN=DN,kx=g.forwardRef(({className:e,...t},n)=>u.jsx(vx,{ref:n,className:ue("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));kx.displayName=vx.displayName;const Ll=g.forwardRef(({className:e,...t},n)=>u.jsx(wx,{ref:n,className:ue("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ll.displayName=wx.displayName;const Ol=g.forwardRef(({className:e,...t},n)=>u.jsx(Sx,{ref:n,className:ue("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ol.displayName=Sx.displayName;var FN="Label",bx=g.forwardRef((e,t)=>u.jsx(oe.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())}}));bx.displayName=FN;var Cx=bx;const BN=$d("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Xe=g.forwardRef(({className:e,...t},n)=>u.jsx(Cx,{ref:n,className:ue(BN(),e),...t}));Xe.displayName=Cx.displayName;function $N(e,t=globalThis==null?void 0:globalThis.document){const n=er(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 UN="DismissableLayer",xc="dismissableLayer.update",VN="dismissableLayer.pointerDownOutside",HN="dismissableLayer.focusOutside",em,Nx=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wd=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,c=g.useContext(Nx),[f,d]=g.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=g.useState({}),w=ye(t,j=>d(j)),y=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(S),h=f?y.indexOf(f):-1,v=c.layersWithOutsidePointerEventsDisabled.size>0,b=h>=x,E=GN(j=>{const T=j.target,O=[...c.branches].some(M=>M.contains(T));!b||O||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=QN(j=>{const T=j.target;[...c.branches].some(M=>M.contains(T))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return $N(j=>{h===c.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),g.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(em=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),tm(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=em)}},[f,p,n,c]),g.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),tm())},[f,c]),g.useEffect(()=>{const j=()=>m({});return document.addEventListener(xc,j),()=>document.removeEventListener(xc,j)},[]),u.jsx(oe.div,{...a,ref:w,style:{pointerEvents:v?b?"auto":"none":void 0,...e.style},onFocusCapture:ee(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ee(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ee(e.onPointerDownCapture,E.onPointerDownCapture)})});Wd.displayName=UN;var WN="DismissableLayerBranch",KN=g.forwardRef((e,t)=>{const n=g.useContext(Nx),r=g.useRef(null),i=ye(t,r);return g.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(oe.div,{...e,ref:i})});KN.displayName=WN;function GN(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1),i=g.useRef(()=>{});return g.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Ex(VN,n,c,{discrete:!0})};const c={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 QN(e,t=globalThis==null?void 0:globalThis.document){const n=er(e),r=g.useRef(!1);return g.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ex(HN,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 tm(){const e=new CustomEvent(xc);document.dispatchEvent(e)}function Ex(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?hN(i,o):i.dispatchEvent(o)}var qa="focusScope.autoFocusOnMount",Xa="focusScope.autoFocusOnUnmount",nm={bubbles:!1,cancelable:!0},YN="FocusScope",Kd=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=g.useState(null),c=er(i),f=er(o),d=g.useRef(null),p=ye(t,y=>a(y)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let y=function(v){if(m.paused||!s)return;const b=v.target;s.contains(b)?d.current=b:Rn(d.current,{select:!0})},S=function(v){if(m.paused||!s)return;const b=v.relatedTarget;b!==null&&(s.contains(b)||Rn(d.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const E of v)E.removedNodes.length>0&&Rn(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const h=new MutationObserver(x);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),h.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){im.add(m);const y=document.activeElement;if(!s.contains(y)){const x=new CustomEvent(qa,nm);s.addEventListener(qa,c),s.dispatchEvent(x),x.defaultPrevented||(qN(tE(jx(s)),{select:!0}),document.activeElement===y&&Rn(s))}return()=>{s.removeEventListener(qa,c),setTimeout(()=>{const x=new CustomEvent(Xa,nm);s.addEventListener(Xa,f),s.dispatchEvent(x),x.defaultPrevented||Rn(y??document.body,{select:!0}),s.removeEventListener(Xa,f),im.remove(m)},0)}}},[s,c,f,m]);const w=g.useCallback(y=>{if(!n&&!r||m.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,x=document.activeElement;if(S&&x){const h=y.currentTarget,[v,b]=XN(h);v&&b?!y.shiftKey&&x===b?(y.preventDefault(),n&&Rn(v,{select:!0})):y.shiftKey&&x===v&&(y.preventDefault(),n&&Rn(b,{select:!0})):x===h&&y.preventDefault()}},[n,r,m.paused]);return u.jsx(oe.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Kd.displayName=YN;function qN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Rn(r,{select:t}),document.activeElement!==n)return}function XN(e){const t=jx(e),n=rm(t,e),r=rm(t.reverse(),e);return[n,r]}function jx(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 rm(e,t){for(const n of e)if(!JN(n,{upTo:t}))return n}function JN(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 ZN(e){return e instanceof HTMLInputElement&&"select"in e}function Rn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZN(e)&&t&&e.select()}}var im=eE();function eE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=om(e,t),e.unshift(t)},remove(t){var n;e=om(e,t),(n=e[0])==null||n.resume()}}}function om(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tE(e){return e.filter(t=>t.tagName!=="A")}var nE="Portal",Gd=g.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=g.useState(!1);et(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ik.createPortal(u.jsx(oe.div,{...r,ref:t}),l):null});Gd.displayName=nE;var Ja=0;function Px(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lm()),document.body.insertAdjacentElement("beforeend",e[1]??lm()),Ja++,()=>{Ja===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ja--}},[])}function lm(){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 ln=function(){return ln=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return vE;var t=wE(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])}},kE=Rx(),ai="data-scroll-locked",bE=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(iE,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(ai,`] { + 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(Dl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(zl,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Dl," .").concat(Dl,` { + right: 0 `).concat(r,`; + } + + .`).concat(zl," .").concat(zl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(ai,`] { + `).concat(oE,": ").concat(s,`px; + } +`)},um=function(){var e=parseInt(document.body.getAttribute(ai)||"0",10);return isFinite(e)?e:0},CE=function(){g.useEffect(function(){return document.body.setAttribute(ai,(um()+1).toString()),function(){var e=um()-1;e<=0?document.body.removeAttribute(ai):document.body.setAttribute(ai,e.toString())}},[])},NE=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;CE();var o=g.useMemo(function(){return SE(i)},[i]);return g.createElement(kE,{styles:bE(o,!t,i,n?"":"!important")})},vc=!1;if(typeof window<"u")try{var hl=Object.defineProperty({},"passive",{get:function(){return vc=!0,!0}});window.addEventListener("test",hl,hl),window.removeEventListener("test",hl,hl)}catch{vc=!1}var Fr=vc?{passive:!1}:!1,EE=function(e){return e.tagName==="TEXTAREA"},Ix=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EE(e)&&n[t]==="visible")},jE=function(e){return Ix(e,"overflowY")},PE=function(e){return Ix(e,"overflowX")},cm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Mx(e,r);if(i){var o=Lx(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_E=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Mx=function(e,t){return e==="v"?jE(t):PE(t)},Lx=function(e,t){return e==="v"?TE(t):_E(t)},AE=function(e,t){return e==="h"&&t==="rtl"?-1:1},RE=function(e,t,n,r,i){var o=AE(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),c=!1,f=l>0,d=0,p=0;do{if(!s)break;var m=Lx(e,s),w=m[0],y=m[1],S=m[2],x=y-S-o*w;(w||x)&&Mx(e,s)&&(d+=x,p+=w);var h=s.parentNode;s=h&&h.nodeType===Node.DOCUMENT_FRAGMENT_NODE?h.host:h}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(p)<1||!i&&-l>p))&&(c=!0),c},gl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dm=function(e){return[e.deltaX,e.deltaY]},fm=function(e){return e&&"current"in e?e.current:e},IE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ME=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},LE=0,Br=[];function OE(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(LE++)[0],o=g.useState(Rx)[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=rE([e.lockRef.current],(e.shards||[]).map(fm),!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 x=gl(y),h=n.current,v="deltaX"in y?y.deltaX:h[0]-x[0],b="deltaY"in y?y.deltaY:h[1]-x[1],E,N=y.target,j=Math.abs(v)>Math.abs(b)?"h":"v";if("touches"in y&&j==="h"&&N.type==="range")return!1;var T=cm(j,N);if(!T)return!0;if(T?E=j:(E=j==="v"?"h":"v",T=cm(j,N)),!T)return!1;if(!r.current&&"changedTouches"in y&&(v||b)&&(r.current=E),!E)return!0;var O=r.current||E;return RE(O,S,y,O==="h"?v:b,!0)},[]),a=g.useCallback(function(y){var S=y;if(!(!Br.length||Br[Br.length-1]!==o)){var x="deltaY"in S?dm(S):gl(S),h=t.current.filter(function(E){return E.name===S.type&&(E.target===S.target||S.target===E.shadowParent)&&IE(E.delta,x)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var v=(l.current.shards||[]).map(fm).filter(Boolean).filter(function(E){return E.contains(S.target)}),b=v.length>0?s(S,v[0]):!l.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),c=g.useCallback(function(y,S,x,h){var v={name:y,delta:S,target:x,should:h,shadowParent:DE(x)};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(b){return b!==v})},1)},[]),f=g.useCallback(function(y){n.current=gl(y),r.current=void 0},[]),d=g.useCallback(function(y){c(y.type,dm(y),y.target,s(y,e.lockRef.current))},[]),p=g.useCallback(function(y){c(y.type,gl(y),y.target,s(y,e.lockRef.current))},[]);g.useEffect(function(){return Br.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Fr),document.addEventListener("touchmove",a,Fr),document.addEventListener("touchstart",f,Fr),function(){Br=Br.filter(function(y){return y!==o}),document.removeEventListener("wheel",a,Fr),document.removeEventListener("touchmove",a,Fr),document.removeEventListener("touchstart",f,Fr)}},[]);var m=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(o,{styles:ME(i)}):null,m?g.createElement(NE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zE=fE(Ax,OE);var Ox=g.forwardRef(function(e,t){return g.createElement(ra,ln({},e,{ref:t,sideCar:zE}))});Ox.classNames=ra.classNames;const Dx=Ox;var FE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$r=new WeakMap,yl=new WeakMap,xl={},nu=0,zx=function(e){return e&&(e.host||zx(e.parentNode))},BE=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=zx(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})},$E=function(e,t,n,r){var i=BE(t,Array.isArray(e)?e:[e]);xl[n]||(xl[n]=new WeakMap);var o=xl[n],l=[],s=new Set,a=new Set(i),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};i.forEach(c);var f=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))f(p);else try{var m=p.getAttribute(r),w=m!==null&&m!=="false",y=($r.get(p)||0)+1,S=(o.get(p)||0)+1;$r.set(p,y),o.set(p,S),l.push(p),y===1&&w&&yl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return f(t),s.clear(),nu++,function(){l.forEach(function(d){var p=$r.get(d)-1,m=o.get(d)-1;$r.set(d,p),o.set(d,m),p||(yl.has(d)||d.removeAttribute(r),yl.delete(d)),m||d.removeAttribute(n)}),nu--,nu||($r=new WeakMap,$r=new WeakMap,yl=new WeakMap,xl={})}},Fx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||FE(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),$E(r,i,n,"aria-hidden")):function(){return null}},ia="Dialog",[Bx,$x]=sr(ia),[UE,Xt]=Bx(ia),Ux=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=g.useRef(null),a=g.useRef(null),[c,f]=ki({prop:r,defaultProp:i??!1,onChange:o,caller:ia});return u.jsx(UE,{scope:t,triggerRef:s,contentRef:a,contentId:qn(),titleId:qn(),descriptionId:qn(),open:c,onOpenChange:f,onOpenToggle:g.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};Ux.displayName=ia;var Vx="DialogTrigger",Hx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xt(Vx,n),o=ye(t,i.triggerRef);return u.jsx(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qd(i.open),...r,ref:o,onClick:ee(e.onClick,i.onOpenToggle)})});Hx.displayName=Vx;var Qd="DialogPortal",[VE,Wx]=Bx(Qd,{forceMount:void 0}),Kx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Xt(Qd,t);return u.jsx(VE,{scope:t,forceMount:n,children:g.Children.map(r,l=>u.jsx(Vo,{present:n||o.open,children:u.jsx(Gd,{asChild:!0,container:i,children:l})}))})};Kx.displayName=Qd;var Ns="DialogOverlay",Gx=g.forwardRef((e,t)=>{const n=Wx(Ns,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Xt(Ns,e.__scopeDialog);return o.modal?u.jsx(Vo,{present:r||o.open,children:u.jsx(WE,{...i,ref:t})}):null});Gx.displayName=Ns;var HE=Si("DialogOverlay.RemoveScroll"),WE=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xt(Ns,n);return u.jsx(Dx,{as:HE,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(oe.div,{"data-state":qd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Tr="DialogContent",Qx=g.forwardRef((e,t)=>{const n=Wx(Tr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Xt(Tr,e.__scopeDialog);return u.jsx(Vo,{present:r||o.open,children:o.modal?u.jsx(KE,{...i,ref:t}):u.jsx(GE,{...i,ref:t})})});Qx.displayName=Tr;var KE=g.forwardRef((e,t)=>{const n=Xt(Tr,e.__scopeDialog),r=g.useRef(null),i=ye(t,n.contentRef,r);return g.useEffect(()=>{const o=r.current;if(o)return Fx(o)},[]),u.jsx(Yx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:ee(e.onFocusOutside,o=>o.preventDefault())})}),GE=g.forwardRef((e,t)=>{const n=Xt(Tr,e.__scopeDialog),r=g.useRef(!1),i=g.useRef(!1);return u.jsx(Yx,{...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,c;(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;((c=n.triggerRef.current)==null?void 0:c.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Yx=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Xt(Tr,n),a=g.useRef(null),c=ye(t,a);return Px(),u.jsxs(u.Fragment,{children:[u.jsx(Kd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:u.jsx(Wd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":qd(s.open),...l,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(YE,{titleId:s.titleId}),u.jsx(XE,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Yd="DialogTitle",qx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xt(Yd,n);return u.jsx(oe.h2,{id:i.titleId,...r,ref:t})});qx.displayName=Yd;var Xx="DialogDescription",Jx=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xt(Xx,n);return u.jsx(oe.p,{id:i.descriptionId,...r,ref:t})});Jx.displayName=Xx;var Zx="DialogClose",ev=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Xt(Zx,n);return u.jsx(oe.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>i.onOpenChange(!1))})});ev.displayName=Zx;function qd(e){return e?"open":"closed"}var tv="DialogTitleWarning",[QE,nv]=cN(tv,{contentName:Tr,titleName:Yd,docsSlug:"dialog"}),YE=({titleId:e})=>{const t=nv(tv),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},qE="DialogDescriptionWarning",XE=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${nv(qE).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},JE=Ux,ZE=Hx,e2=Kx,t2=Gx,n2=Qx,r2=qx,i2=Jx,rv=ev,iv="AlertDialog",[o2,II]=sr(iv,[$x]),Pn=$x(),ov=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pn(t);return u.jsx(JE,{...r,...n,modal:!0})};ov.displayName=iv;var l2="AlertDialogTrigger",s2=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return u.jsx(ZE,{...i,...r,ref:t})});s2.displayName=l2;var a2="AlertDialogPortal",lv=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pn(t);return u.jsx(e2,{...r,...n})};lv.displayName=a2;var u2="AlertDialogOverlay",sv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return u.jsx(t2,{...i,...r,ref:t})});sv.displayName=u2;var ui="AlertDialogContent",[c2,d2]=o2(ui),f2=eN("AlertDialogContent"),av=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Pn(n),l=g.useRef(null),s=ye(t,l),a=g.useRef(null);return u.jsx(QE,{contentName:ui,titleName:uv,docsSlug:"alert-dialog",children:u.jsx(c2,{scope:n,cancelRef:a,children:u.jsxs(n2,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:ee(i.onOpenAutoFocus,c=>{var f;c.preventDefault(),(f=a.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(f2,{children:r}),u.jsx(m2,{contentRef:l})]})})})});av.displayName=ui;var uv="AlertDialogTitle",cv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return u.jsx(r2,{...i,...r,ref:t})});cv.displayName=uv;var dv="AlertDialogDescription",fv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return u.jsx(i2,{...i,...r,ref:t})});fv.displayName=dv;var p2="AlertDialogAction",pv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pn(n);return u.jsx(rv,{...i,...r,ref:t})});pv.displayName=p2;var mv="AlertDialogCancel",hv=g.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=d2(mv,n),o=Pn(n),l=ye(t,i);return u.jsx(rv,{...o,...r,ref:l})});hv.displayName=mv;var m2=({contentRef:e})=>{const t=`\`${ui}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${ui}\` by passing a \`${dv}\` 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 \`${ui}\`. 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},h2=ov,g2=lv,gv=sv,yv=av,xv=pv,vv=hv,wv=cv,Sv=fv;const ru=h2,y2=g2,kv=g.forwardRef(({className:e,...t},n)=>u.jsx(gv,{className:ue("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}));kv.displayName=gv.displayName;const Fl=g.forwardRef(({className:e,...t},n)=>u.jsxs(y2,{children:[u.jsx(kv,{}),u.jsx(yv,{ref:n,className:ue("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})]}));Fl.displayName=yv.displayName;const Bl=({className:e,...t})=>u.jsx("div",{className:ue("flex flex-col space-y-2 text-center sm:text-left",e),...t});Bl.displayName="AlertDialogHeader";const $l=({className:e,...t})=>u.jsx("div",{className:ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$l.displayName="AlertDialogFooter";const Ul=g.forwardRef(({className:e,...t},n)=>u.jsx(wv,{ref:n,className:ue("text-lg font-semibold",e),...t}));Ul.displayName=wv.displayName;const Vl=g.forwardRef(({className:e,...t},n)=>u.jsx(Sv,{ref:n,className:ue("text-sm text-muted-foreground",e),...t}));Vl.displayName=Sv.displayName;const Hl=g.forwardRef(({className:e,...t},n)=>u.jsx(xv,{ref:n,className:ue(Ud(),e),...t}));Hl.displayName=xv.displayName;const Wl=g.forwardRef(({className:e,...t},n)=>u.jsx(vv,{ref:n,className:ue(Ud({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Wl.displayName=vv.displayName;const bv=g.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:ue("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}));bv.displayName="Textarea";function x2(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const v2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S2={};function pm(e,t){return((t||S2).jsx?w2:v2).test(e)}const k2=/[ \t\n\f\r]/g;function b2(e){return typeof e=="object"?e.type==="text"?mm(e.value):!1:mm(e)}function mm(e){return e.replace(k2,"")===""}class Ho{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ho.prototype.normal={};Ho.prototype.property={};Ho.prototype.space=void 0;function Cv(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ho(n,r,t)}function wc(e){return e.toLowerCase()}class gt{constructor(t,n){this.attribute=n,this.property=t}}gt.prototype.attribute="";gt.prototype.booleanish=!1;gt.prototype.boolean=!1;gt.prototype.commaOrSpaceSeparated=!1;gt.prototype.commaSeparated=!1;gt.prototype.defined=!1;gt.prototype.mustUseProperty=!1;gt.prototype.number=!1;gt.prototype.overloadedBoolean=!1;gt.prototype.property="";gt.prototype.spaceSeparated=!1;gt.prototype.space=void 0;let C2=0;const Z=Dr(),De=Dr(),Sc=Dr(),$=Dr(),be=Dr(),ci=Dr(),xt=Dr();function Dr(){return 2**++C2}const kc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:De,commaOrSpaceSeparated:xt,commaSeparated:ci,number:$,overloadedBoolean:Sc,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),iu=Object.keys(kc);class Xd extends gt{constructor(t,n,r,i){let o=-1;if(super(t,n),hm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&T2.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gm,R2);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gm.test(o)){let l=o.replace(P2,A2);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Xd}return new i(r,t)}function A2(e){return"-"+e.toLowerCase()}function R2(e){return e.charAt(1).toUpperCase()}const I2=Cv([Nv,N2,Pv,Tv,_v],"html"),Jd=Cv([Nv,E2,Pv,Tv,_v],"svg");function M2(e){return e.join(" ").trim()}var Zd={},ym=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,L2=/\n/g,O2=/^\s*/,D2=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,z2=/^:\s*/,F2=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B2=/^[;\s]*/,$2=/^\s+|\s+$/g,U2=` +`,xm="/",vm="*",hr="",V2="comment",H2="declaration",W2=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(L2);y&&(n+=y.length);var S=w.lastIndexOf(U2);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),c(),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 c(){a(O2)}function f(w){var y;for(w=w||[];y=d();)y!==!1&&w.push(y);return w}function d(){var w=o();if(!(xm!=e.charAt(0)||vm!=e.charAt(1))){for(var y=2;hr!=e.charAt(y)&&(vm!=e.charAt(y)||xm!=e.charAt(y+1));)++y;if(y+=2,hr===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:V2,comment:S})}}function p(){var w=o(),y=a(D2);if(y){if(d(),!a(z2))return s("property missing ':'");var S=a(F2),x=w({type:H2,property:wm(y[0].replace(ym,hr)),value:S?wm(S[0].replace(ym,hr)):hr});return a(B2),x}}function m(){var w=[];f(w);for(var y;y=p();)y!==!1&&(w.push(y),f(w));return w}return c(),m()};function wm(e){return e?e.replace($2,hr):hr}var K2=Yl&&Yl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zd,"__esModule",{value:!0});Zd.default=Q2;var G2=K2(W2);function Q2(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,G2.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 oa={};Object.defineProperty(oa,"__esModule",{value:!0});oa.camelCase=void 0;var Y2=/^--[a-zA-Z0-9_-]+$/,q2=/-([a-z])/g,X2=/^[^-]+$/,J2=/^-(webkit|moz|ms|o|khtml)-/,Z2=/^-(ms)-/,ej=function(e){return!e||X2.test(e)||Y2.test(e)},tj=function(e,t){return t.toUpperCase()},Sm=function(e,t){return"".concat(t,"-")},nj=function(e,t){return t===void 0&&(t={}),ej(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Z2,Sm):e=e.replace(J2,Sm),e.replace(q2,tj))};oa.camelCase=nj;var rj=Yl&&Yl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ij=rj(Zd),oj=oa;function bc(e,t){var n={};return!e||typeof e!="string"||(0,ij.default)(e,function(r,i){r&&i&&(n[(0,oj.camelCase)(r,t)]=i)}),n}bc.default=bc;var lj=bc;const sj=Ls(lj),Av=Rv("end"),ef=Rv("start");function Rv(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 aj(e){const t=ef(e),n=Av(e);if(t&&n)return{start:t,end:n}}function ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?km(e.position):"start"in e||"end"in e?km(e):"line"in e||"column"in e?Cc(e):""}function Cc(e){return bm(e&&e.line)+":"+bm(e&&e.column)}function km(e){return Cc(e&&e.start)+"-"+Cc(e&&e.end)}function bm(e){return e&&typeof e=="number"?e:1}class tt 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=ao(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}}tt.prototype.file="";tt.prototype.name="";tt.prototype.reason="";tt.prototype.message="";tt.prototype.stack="";tt.prototype.column=void 0;tt.prototype.line=void 0;tt.prototype.ancestors=void 0;tt.prototype.cause=void 0;tt.prototype.fatal=void 0;tt.prototype.place=void 0;tt.prototype.ruleId=void 0;tt.prototype.source=void 0;const tf={}.hasOwnProperty,uj=new Map,cj=/[A-Z]/g,dj=new Set(["table","tbody","thead","tfoot","tr"]),fj=new Set(["td","th"]),Iv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pj(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=Sj(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=wj(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"?Jd:I2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Mv(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Mv(e,t,n){if(t.type==="element")return mj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return hj(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yj(e,t,n);if(t.type==="mdxjsEsm")return gj(e,t);if(t.type==="root")return xj(e,t,n);if(t.type==="text")return vj(e,t)}function mj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jd,e.schema=i),e.ancestors.push(t);const o=Ov(e,t.tagName,!1),l=kj(e,t);let s=rf(e,t);return dj.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!b2(a):!0})),Lv(e,l,o,t),nf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function hj(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)}Ao(e,t.position)}function gj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ao(e,t.position)}function yj(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ov(e,t.name,!0),l=bj(e,t),s=rf(e,t);return Lv(e,l,o,t),nf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function xj(e,t,n){const r={};return nf(r,rf(e,t)),e.create(t,e.Fragment,r,n)}function vj(e,t){return t.value}function Lv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function nf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function wj(e,t,n){return r;function r(i,o,l,s){const c=Array.isArray(l.children)?n:t;return s?c(o,l,s):c(o,l)}}function Sj(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=ef(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 kj(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&tf.call(t.properties,i)){const o=Cj(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&fj.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 bj(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 Ao(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 Ao(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function rf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:uj;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?(fn(e,e.length,0,t),e):t}const Em={}.hasOwnProperty;function Rj(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 di(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=ar(/[A-Za-z]/),kt=ar(/[\dA-Za-z]/),Lj=ar(/[#-'*+\--9=?A-Z^-~]/);function Nc(e){return e!==null&&(e<32||e===127)}const Ec=ar(/\d/),Oj=ar(/[\dA-Fa-f]/),Dj=ar(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function ht(e){return e!==null&&(e<0||e===32)}function ge(e){return e===-2||e===-1||e===32}const zj=ar(/\p{P}|\p{S}/u),Fj=ar(/\s/);function ar(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 Ne(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return ge(a)?(e.enter(n),s(a)):t(a)}function s(a){return ge(a)&&o++l))return;const j=t.events.length;let T=j,O,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(O){M=t.events[T][1].end;break}O=!0}for(x(r),N=j;Nv;){const E=n[b];t.containerState=E[1],E[0].exit.call(t,e)}n.length=v}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Hj(e,t,n){return Ne(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pm(e){if(e===null||ht(e)||Fj(e))return 1;if(zj(e))return 2}function lf(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};Tm(d,-a),Tm(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},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},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=_t(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=_t(c,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),c=_t(c,lf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=_t(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=_t(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,fn(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n0&&ge(N)?Ne(e,h,"linePrefix",o+1)(N):h(N)}function h(N){return N===null||Y(N)?e.check(_m,y,b)(N):(e.enter("codeFlowValue"),v(N))}function v(N){return N===null||Y(N)?(e.exit("codeFlowValue"),h(N)):(e.consume(N),v)}function b(N){return e.exit("codeFenced"),t(N)}function E(N,j,T){let O=0;return M;function M(I){return N.enter("lineEnding"),N.consume(I),N.exit("lineEnding"),R}function R(I){return N.enter("codeFencedFence"),ge(I)?Ne(N,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):_(I)}function _(I){return I===s?(N.enter("codeFencedFenceSequence"),H(I)):T(I)}function H(I){return I===s?(O++,N.consume(I),H):O>=l?(N.exit("codeFencedFenceSequence"),ge(I)?Ne(N,W,"whitespace")(I):W(I)):T(I)}function W(I){return I===null||Y(I)?(N.exit("codeFencedFence"),j(I)):T(I)}}}function nP(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 lu={name:"codeIndented",tokenize:iP},rP={partial:!0,tokenize:oP};function iP(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ne(e,o,"linePrefix",4+1)(c)}function o(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(c):n(c)}function l(c){return c===null?a(c):Y(c)?e.attempt(rP,l,a)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Y(c)?(e.exit("codeFlowValue"),l(c)):(e.consume(c),s)}function a(c){return e.exit("codeIndented"),t(c)}}function oP(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Y(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Ne(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):Y(l)?i(l):n(l)}}const lP={name:"codeText",previous:aP,resolve:sP,tokenize:uP};function sP(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&&Ki(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),Ki(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ki(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 Vv(e,t,n,r,i,o,l,s,a){const c=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||Nc(x)?n(x):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(s),p(x)):x===null||x===60||Y(x)?n(x):(e.consume(x),x===92?w:m)}function w(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function y(x){return!f&&(x===null||x===41||ht(x))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(x)):f999||m===null||m===91||m===93&&!a||m===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(m):m===93?(e.exit(o),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Y(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Y(m)||s++>999?(e.exit("chunkString"),f(m)):(e.consume(m),a||(a=!ge(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function Wv(e,t,n,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,a):n(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),c(p))}function c(p){return p===l?(e.exit(o),a(l)):p===null?n(p):Y(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ne(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||Y(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:f)}function d(p){return p===l||p===92?(e.consume(p),f):f(p)}}function uo(e,t){let n;return r;function r(i){return Y(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ge(i)?Ne(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const yP={name:"definition",tokenize:vP},xP={partial:!0,tokenize:wP};function vP(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return Hv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return i=di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),a):n(m)}function a(m){return ht(m)?uo(e,c)(m):c(m)}function c(m){return Vv(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(xP,d,d)(m)}function d(m){return ge(m)?Ne(e,p,"whitespace")(m):p(m)}function p(m){return m===null||Y(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function wP(e,t,n){return r;function r(s){return ht(s)?uo(e,i)(s):n(s)}function i(s){return Wv(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return ge(s)?Ne(e,l,"whitespace")(s):l(s)}function l(s){return s===null||Y(s)?t(s):n(s)}}const SP={name:"hardBreakEscape",tokenize:kP};function kP(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Y(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const bP={name:"headingAtx",resolve:CP,tokenize:NP};function CP(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"},fn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function NP(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||ht(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||Y(f)?(e.exit("atxHeading"),t(f)):ge(f)?Ne(e,s,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function c(f){return f===null||f===35||ht(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),c)}}const EP=["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"],Rm=["pre","script","style","textarea"],jP={concrete:!0,name:"htmlFlow",resolveTo:_P,tokenize:AP},PP={partial:!0,tokenize:IP},TP={partial:!0,tokenize:RP};function _P(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 AP(e,t,n){const r=this;let i,o,l,s,a;return c;function c(C){return f(C)}function f(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),p):C===47?(e.consume(C),o=!0,y):C===63?(e.consume(C),i=3,r.interrupt?t:k):sn(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function p(C){return C===45?(e.consume(C),i=2,m):C===91?(e.consume(C),i=5,s=0,w):sn(C)?(e.consume(C),i=4,r.interrupt?t:k):n(C)}function m(C){return C===45?(e.consume(C),r.interrupt?t:k):n(C)}function w(C){const ne="CDATA[";return C===ne.charCodeAt(s++)?(e.consume(C),s===ne.length?r.interrupt?t:_:w):n(C)}function y(C){return sn(C)?(e.consume(C),l=String.fromCharCode(C),S):n(C)}function S(C){if(C===null||C===47||C===62||ht(C)){const ne=C===47,de=l.toLowerCase();return!ne&&!o&&Rm.includes(de)?(i=1,r.interrupt?t(C):_(C)):EP.includes(l.toLowerCase())?(i=6,ne?(e.consume(C),x):r.interrupt?t(C):_(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?h(C):v(C))}return C===45||kt(C)?(e.consume(C),l+=String.fromCharCode(C),S):n(C)}function x(C){return C===62?(e.consume(C),r.interrupt?t:_):n(C)}function h(C){return ge(C)?(e.consume(C),h):M(C)}function v(C){return C===47?(e.consume(C),M):C===58||C===95||sn(C)?(e.consume(C),b):ge(C)?(e.consume(C),v):M(C)}function b(C){return C===45||C===46||C===58||C===95||kt(C)?(e.consume(C),b):E(C)}function E(C){return C===61?(e.consume(C),N):ge(C)?(e.consume(C),E):v(C)}function N(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,j):ge(C)?(e.consume(C),N):T(C)}function j(C){return C===a?(e.consume(C),a=null,O):C===null||Y(C)?n(C):(e.consume(C),j)}function T(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||ht(C)?E(C):(e.consume(C),T)}function O(C){return C===47||C===62||ge(C)?v(C):n(C)}function M(C){return C===62?(e.consume(C),R):n(C)}function R(C){return C===null||Y(C)?_(C):ge(C)?(e.consume(C),R):n(C)}function _(C){return C===45&&i===2?(e.consume(C),L):C===60&&i===1?(e.consume(C),B):C===62&&i===4?(e.consume(C),U):C===63&&i===3?(e.consume(C),k):C===93&&i===5?(e.consume(C),z):Y(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(PP,Q,H)(C)):C===null||Y(C)?(e.exit("htmlFlowData"),H(C)):(e.consume(C),_)}function H(C){return e.check(TP,W,Q)(C)}function W(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),I}function I(C){return C===null||Y(C)?H(C):(e.enter("htmlFlowData"),_(C))}function L(C){return C===45?(e.consume(C),k):_(C)}function B(C){return C===47?(e.consume(C),l="",P):_(C)}function P(C){if(C===62){const ne=l.toLowerCase();return Rm.includes(ne)?(e.consume(C),U):_(C)}return sn(C)&&l.length<8?(e.consume(C),l+=String.fromCharCode(C),P):_(C)}function z(C){return C===93?(e.consume(C),k):_(C)}function k(C){return C===62?(e.consume(C),U):C===45&&i===2?(e.consume(C),k):_(C)}function U(C){return C===null||Y(C)?(e.exit("htmlFlowData"),Q(C)):(e.consume(C),U)}function Q(C){return e.exit("htmlFlow"),t(C)}}function RP(e,t,n){const r=this;return i;function i(l){return Y(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 IP(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(la,t,n)}}const MP={name:"htmlText",tokenize:LP};function LP(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),c):k===47?(e.consume(k),E):k===63?(e.consume(k),v):sn(k)?(e.consume(k),T):n(k)}function c(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,w):sn(k)?(e.consume(k),h):n(k)}function f(k){return k===45?(e.consume(k),m):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),p):Y(k)?(l=d,B(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?L(k):k===45?p(k):d(k)}function w(k){const U="CDATA[";return k===U.charCodeAt(o++)?(e.consume(k),o===U.length?y:w):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),S):Y(k)?(l=y,B(k)):(e.consume(k),y)}function S(k){return k===93?(e.consume(k),x):y(k)}function x(k){return k===62?L(k):k===93?(e.consume(k),x):y(k)}function h(k){return k===null||k===62?L(k):Y(k)?(l=h,B(k)):(e.consume(k),h)}function v(k){return k===null?n(k):k===63?(e.consume(k),b):Y(k)?(l=v,B(k)):(e.consume(k),v)}function b(k){return k===62?L(k):v(k)}function E(k){return sn(k)?(e.consume(k),N):n(k)}function N(k){return k===45||kt(k)?(e.consume(k),N):j(k)}function j(k){return Y(k)?(l=j,B(k)):ge(k)?(e.consume(k),j):L(k)}function T(k){return k===45||kt(k)?(e.consume(k),T):k===47||k===62||ht(k)?O(k):n(k)}function O(k){return k===47?(e.consume(k),L):k===58||k===95||sn(k)?(e.consume(k),M):Y(k)?(l=O,B(k)):ge(k)?(e.consume(k),O):L(k)}function M(k){return k===45||k===46||k===58||k===95||kt(k)?(e.consume(k),M):R(k)}function R(k){return k===61?(e.consume(k),_):Y(k)?(l=R,B(k)):ge(k)?(e.consume(k),R):O(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,H):Y(k)?(l=_,B(k)):ge(k)?(e.consume(k),_):(e.consume(k),W)}function H(k){return k===i?(e.consume(k),i=void 0,I):k===null?n(k):Y(k)?(l=H,B(k)):(e.consume(k),H)}function W(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ht(k)?O(k):(e.consume(k),W)}function I(k){return k===47||k===62||ht(k)?O(k):n(k)}function L(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function B(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return ge(k)?Ne(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 sf={name:"labelEnd",resolveAll:FP,resolveTo:BP,tokenize:$P},OP={tokenize:UP},DP={tokenize:VP},zP={tokenize:HP};function FP(e){let t=-1;const n=[];for(;++t=3&&(c===null||Y(c))?(e.exit("thematicBreak"),t(c)):n(c)}function a(c){return c===i?(e.consume(c),r++,a):(e.exit("thematicBreakSequence"),ge(c)?Ne(e,s,"whitespace")(c):s(c))}}const at={continuation:{tokenize:eT},exit:nT,name:"list",tokenize:ZP},XP={partial:!0,tokenize:rT},JP={partial:!0,tokenize:tT};function ZP(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(m){const w=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ec(m)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Kl,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return Ec(m)&&++l<10?(e.consume(m),a):(!r.interrupt||l<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(la,r.interrupt?n:f,e.attempt(XP,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return ge(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function eT(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(la,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ne(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!ge(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(JP,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ne(e,e.attempt(at,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function tT(e,t,n){const r=this;return Ne(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 nT(e){e.exit(this.containerState.type)}function rT(e,t,n){const r=this;return Ne(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!ge(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Im={name:"setextUnderline",resolveTo:iT,tokenize:oT};function iT(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 oT(e,t,n){const r=this;let i;return o;function o(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,l(c)):n(c)}function l(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),ge(c)?Ne(e,a,"lineSuffix")(c):a(c))}function a(c){return c===null||Y(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const lT={tokenize:sT};function sT(e){const t=this,n=e.attempt(la,r,e.attempt(this.parser.constructs.flowInitial,i,Ne(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fP,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 aT={resolveAll:Gv()},uT=Kv("string"),cT=Kv("text");function Kv(e){return{resolveAll:Gv(e==="text"?dT: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(f){return c(f)?o(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return c(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function c(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p-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 CT(e,t){let n=-1;const r=[];let i;for(;++n0){const yt=X.tokenStack[X.tokenStack.length-1];(yt[1]||Lm).call(X,void 0,yt[0])}for(V.position={start:An(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:An(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function $T(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 UT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qv(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 VT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(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 HT(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 WT(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 KT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qv(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 QT(e,t,n){const r=e.all(t),i=n?YT(n):Xv(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.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 qT(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=ef(t.children[1]),a=Av(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 t_(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 c=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(zm(t.slice(i),i>0,!1)),o.join("")}function zm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Om||o===Dm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Om||o===Dm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function i_(e,t){const n={type:"text",value:r_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function o_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const l_={blockquote:LT,break:OT,code:DT,delete:zT,emphasis:FT,footnoteReference:BT,heading:$T,html:UT,imageReference:VT,image:HT,inlineCode:WT,linkReference:KT,link:GT,listItem:QT,list:qT,paragraph:XT,root:JT,strong:ZT,table:e_,tableCell:n_,tableRow:t_,text:i_,thematicBreak:o_,toml:vl,yaml:vl,definition:vl,footnoteDefinition:vl};function vl(){}const Jv=-1,sa=0,co=1,Es=2,af=3,uf=4,cf=5,df=6,Zv=7,e0=8,Fm=typeof self=="object"?self:globalThis,s_=(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 sa:case Jv:return n(l,i);case co:{const s=n([],i);for(const a of l)s.push(r(a));return s}case Es:{const s=n({},i);for(const[a,c]of l)s[r(a)]=r(c);return s}case af:return n(new Date(l),i);case uf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case cf:{const s=n(new Map,i);for(const[a,c]of l)s.set(r(a),r(c));return s}case df:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case Zv:{const{name:s,message:a}=l;return n(new Fm[s](a),i)}case e0: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 Fm[o](l),i)};return r},Bm=e=>s_(new Map,e)(0),Ur="",{toString:a_}={},{keys:u_}=Object,Gi=e=>{const t=typeof e;if(t!=="object"||!e)return[sa,t];const n=a_.call(e).slice(8,-1);switch(n){case"Array":return[co,Ur];case"Object":return[Es,Ur];case"Date":return[af,Ur];case"RegExp":return[uf,Ur];case"Map":return[cf,Ur];case"Set":return[df,Ur];case"DataView":return[co,n]}return n.includes("Array")?[co,n]:n.includes("Error")?[Zv,n]:[Es,n]},wl=([e,t])=>e===sa&&(t==="function"||t==="symbol"),c_=(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]=Gi(l);switch(s){case sa:{let f=l;switch(a){case"bigint":s=e0,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([Jv],l)}return i([s,f],l)}case co:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const f=[],d=i([s,f],l);for(const p of l)f.push(o(p));return d}case Es:{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 f=[],d=i([s,f],l);for(const p of u_(l))(e||!wl(Gi(l[p])))&&f.push([o(p),o(l[p])]);return d}case af:return i([s,l.toISOString()],l);case uf:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case cf:{const f=[],d=i([s,f],l);for(const[p,m]of l)(e||!(wl(Gi(p))||wl(Gi(m))))&&f.push([o(p),o(m)]);return d}case df:{const f=[],d=i([s,f],l);for(const p of l)(e||!wl(Gi(p)))&&f.push(o(p));return d}}const{message:c}=l;return i([s,{name:a,message:c}],l)};return o},$m=(e,{json:t,lossy:n}={})=>{const r=[];return c_(!(t||n),!!t,new Map,r)(e),r},js=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Bm($m(e,t)):structuredClone(e):(e,t)=>Bm($m(e,t));function d_(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 f_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function p_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||d_,r=e.options.footnoteBackLabel||f_,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 h=typeof n=="string"?n:n(a,m);typeof h=="string"&&(h={type:"text",value:h}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,m),className:["data-footnote-backref"]},children:Array.isArray(h)?h:[h]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const h=S.children[S.children.length-1];h&&h.type==="text"?h.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else f.push(...w);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(c,x),s.push(x)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...js(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 t0=function(e){if(e==null)return y_;if(typeof e=="function")return aa(e);if(typeof e=="object")return Array.isArray(e)?m_(e):h_(e);if(typeof e=="string")return g_(e);throw new Error("Expected function, string, or object as test")};function m_(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=n0,w,y,S;if((!t||o(a,c,f[f.length-1]||void 0))&&(m=k_(n(a,f)),m[0]===Um))return m;if("children"in a&&a.children){const x=a;if(x.children&&m[0]!==w_)for(y=(r?x.children.length:-1)+l,S=f.concat(x);y>-1&&y0&&n.push({type:"text",value:` +`}),n}function Vm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Hm(e,t){const n=C_(e,t),r=n.one(e,void 0),i=p_(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function T_(e,t){return e&&"run"in e?async function(n,r){const i=Hm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Hm(n,{file:r,...e||t})}}function Wm(e){if(e)throw e}var Gl=Object.prototype.hasOwnProperty,i0=Object.prototype.toString,Km=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,Qm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):i0.call(t)==="[object Array]"},Ym=function(t){if(!t||i0.call(t)!=="[object Object]")return!1;var n=Gl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Gl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Gl.call(t,i)},qm=function(t,n){Km&&n.name==="__proto__"?Km(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Xm=function(t,n){if(n==="__proto__")if(Gl.call(t,n)){if(Gm)return Gm(t,n).value}else return;return t[n]},__=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,c=arguments.length,f=!1;for(typeof s=="boolean"&&(f=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(c){const f=c;if(s&&n)throw f;return i(f)}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 rn={basename:I_,dirname:M_,extname:L_,join:O_,sep:"/"};function I_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wo(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 M_(e){if(Wo(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 L_(e){Wo(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 O_(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function z_(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 Wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const F_={cwd:B_};function B_(){return"/"}function _c(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $_(e){if(typeof e=="string")e=new URL(e);else if(!_c(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 U_(e)}function U_(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[m,...w]=f;const y=r[p][1];Tc(y)&&Tc(m)&&(m=au(!0,y,m)),r[p]=[c,m,...w]}}}}const K_=new ff().freeze();function fu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mu(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 Zm(e){if(!Tc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function eh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sl(e){return G_(e)?e:new o0(e)}function G_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Q_(e){return typeof e=="string"||Y_(e)}function Y_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const q_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",th=[],nh={allowDangerousHtml:!0},X_=/^(https?|ircs?|mailto|xmpp)$/i,J_=[{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 Z_(e){const t=eA(e),n=tA(e);return nA(t.runSync(t.parse(n),n),e)}function eA(e){const t=e.rehypePlugins||th,n=e.remarkPlugins||th,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nh}:nh;return K_().use(MT).use(n).use(T_,r).use(t)}function tA(e){const t=e.children||"",n=new o0;return typeof t=="string"&&(n.value=t),n}function nA(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||rA;for(const f of J_)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+q_+f.id,void 0);return r0(e,c),pj(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function c(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return l?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in ou)if(Object.hasOwn(ou,m)&&Object.hasOwn(f.properties,m)){const w=f.properties[m],y=ou[m];(y===null||y.includes(f.tagName))&&(f.properties[m]=a(String(w||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(f,d,p)),m&&p&&typeof d=="number")return s&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function rA(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||X_.test(e.slice(0,t))?e:""}const l0=g.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const c=g.useRef(null),f=()=>{var d;(d=c.current)==null||d.scrollIntoView({behavior:"smooth"})};return g.useEffect(()=>{console.log("Chat component - messages updated:",t.length,t.map(d=>({id:d.id,role:d.role,content:d.content.slice(0,50)+"..."}))),f()},[t]),u.jsxs("div",{className:ue("flex h-full flex-col",e),ref:a,...s,children:[u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?u.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:u.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>u.jsxs("div",{className:ue("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&u.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:u.jsx(ti,{className:"h-4 w-4 text-primary-foreground"})}),u.jsxs("div",{className:ue("max-w-[75%] flex flex-col gap-2 rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[u.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[u.jsx("span",{children:d.role==="user"?"You":d.assistantInfo?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-medium",children:d.assistantInfo.name}),d.assistantInfo.type!=="default"&&u.jsx("span",{className:ue("inline-block px-1.5 py-0.5 rounded text-[10px] font-medium ml-1",d.assistantInfo.type==="user"&&"bg-blue-100 text-blue-700",d.assistantInfo.type==="template"&&"bg-gray-100 text-gray-700",d.assistantInfo.type==="new"&&"bg-green-100 text-green-700"),children:d.assistantInfo.type==="user"?"Mine":d.assistantInfo.type==="template"?"Template":"New"}),d.assistantInfo.originalTemplate&&u.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",d.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),u.jsx("span",{children:"•"}),u.jsxs("span",{children:["#",p+1]})]}),u.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:u.jsx(Z_,{components:{p:({children:m})=>u.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>u.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>u.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>u.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?u.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):u.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>u.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>u.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>u.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>u.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>u.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>u.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>u.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:d.content})})]}),d.role==="user"&&u.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:u.jsx(Bd,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),u.jsx("div",{ref:c})]}),u.jsx("div",{className:"border-t p-4",children:u.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[u.jsx(bv,{value:n,onChange:r,placeholder:"Type your message...",className:"min-h-[60px] resize-none",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),i(d))}}),o?u.jsx(ve,{type:"button",onClick:l,variant:"outline",size:"icon",children:u.jsx(DC,{className:"h-4 w-4"})}):u.jsx(ve,{type:"submit",disabled:!n.trim(),size:"icon",children:u.jsx(TC,{className:"h-4 w-4"})})]})})]})});l0.displayName="Chat";const tn={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function s0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function iA(){return s0()}class oA{getAllSessions(){const t=localStorage.getItem(tn.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:s0(),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(tn.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(tn.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(tn.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(tn.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:iA(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(tn.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(tn.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(tn.currentSession,t)}clear(){localStorage.removeItem(tn.sessions),localStorage.removeItem(tn.currentSession)}}const Me=new oA;function lA(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,c]=g.useState(""),[f,d]=g.useState({isLoading:!1,error:null}),[p,m]=g.useState(n),[w,y]=g.useState(r),[S,x]=g.useState(.7),[h,v]=g.useState(1024),b=Vt.useMemo(()=>{var L;const I=i.find(B=>B.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!I,messageCount:((L=I==null?void 0:I.messages)==null?void 0:L.length)||0,sessionTitle:(I==null?void 0:I.title)||"No session"}),I},[i,l]),E=Vt.useMemo(()=>{const I=(b==null?void 0:b.messages)||[];return console.log("useChat - messages computed:",I.length,I.map(L=>({id:L.id,role:L.role}))),I},[b==null?void 0:b.messages]);g.useEffect(()=>{const I=Me.getAllSessions();o(I);const L=Me.getCurrentSession();L&&s(L.id)},[]);const N=g.useCallback(()=>{const I=Me.createSession(void 0,p,w),L=Me.getAllSessions();return o([...L]),s(I.id),Me.setCurrentSession(I.id),I.id},[p,w]),j=g.useCallback(I=>{console.log("selectSession called with:",I),s(I),Me.setCurrentSession(I),console.log("currentSessionId updated to:",I)},[]),T=g.useCallback(I=>{Me.deleteSession(I);const L=Me.getAllSessions();o([...L]),l===I&&(L.length>0?(s(L[0].id),Me.setCurrentSession(L[0].id)):s(null))},[l]),O=g.useCallback((I,L)=>{Me.updateSession(I,{title:L});const B=Me.getAllSessions();o([...B])},[]),M=g.useCallback(I=>{if(!l)return;Me.addMessageToSession(l,I);const L=Me.getAllSessions();o([...L])},[l]),R=g.useCallback(async(I,L)=>{var z,k;if(!a.trim()||f.isLoading)return;let B=l;B||(B=N());const P=a.trim();if(c(""),d({isLoading:!0,error:null}),B){Me.addMessageToSession(B,{role:"user",content:P});const U=Me.getAllSessions();o([...U])}try{const U=Me.getSession(B),Q=((k=(z=U==null?void 0:U.messages)==null?void 0:z.filter(de=>de.role!=="system"))==null?void 0:k.map(de=>({role:de.role,content:de.content})))||[],C=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:P,messages:Q,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h,use_rag:(L==null?void 0:L.useRag)||!1,retrieval_count:(L==null?void 0:L.retrievalCount)||3})});if(!C.ok){const de=await C.json();throw new Error(de.detail||`HTTP error! status: ${C.status}`)}const ne=await C.json();if(B){Me.addMessageToSession(B,{role:"assistant",content:ne.content,thinking_content:ne.thinking_content,model_used:ne.model_used,supports_thinking:ne.supports_thinking,assistantInfo:I});const de=Me.getAllSessions();o([...de])}d({isLoading:!1,error:null})}catch(U){const Q=U instanceof Error?U.message:"An error occurred";if(d({isLoading:!1,error:Q}),B){Me.addMessageToSession(B,{role:"assistant",content:`Sorry, I encountered an error: ${Q}`,assistantInfo:I});const C=Me.getAllSessions();o([...C])}}},[a,f.isLoading,l,N,M,w,E.length,t,p,S,h]),_=g.useCallback(()=>{d({isLoading:!1,error:null})},[]),H=g.useCallback(()=>{Me.clear(),o([]),s(null)},[]),W=g.useCallback(()=>{s(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:b,currentSessionId:l,createNewSession:N,selectSession:j,deleteSession:T,renameSession:O,clearAllSessions:H,clearCurrentSession:W,messages:E,input:a,setInput:c,sendMessage:R,stopGeneration:_,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:y,temperature:S,setTemperature:x,maxTokens:h,setMaxTokens:v}}function Ps(e,[t,n]){return Math.min(n,Math.max(t,e))}function a0(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 u0(e){const[t,n]=g.useState(void 0);return et(()=>{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,c=Array.isArray(a)?a[0]:a;l=c.inlineSize,s=c.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 c0=["PageUp","PageDown"],d0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],f0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ai="Slider",[Ac,sA,aA]=Vd(Ai),[p0,MI]=sr(Ai,[aA]),[uA,ua]=p0(Ai),m0=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:c=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...y}=e,S=g.useRef(new Set),x=g.useRef(0),v=l==="horizontal"?cA:dA,[b=[],E]=ki({prop:f,defaultProp:c,onChange:R=>{var H;(H=[...S.current][x.current])==null||H.focus(),d(R)}}),N=g.useRef(b);function j(R){const _=gA(b,R);M(R,_)}function T(R){M(R,x.current)}function O(){const R=N.current[x.current];b[x.current]!==R&&p(b)}function M(R,_,{commit:H}={commit:!1}){const W=wA(o),I=SA(Math.round((R-r)/o)*o+r,W),L=Ps(I,[r,i]);E((B=[])=>{const P=mA(B,L,_);if(vA(P,a*o)){x.current=P.indexOf(L);const z=String(P)!==String(B);return z&&H&&p(P),z?P:B}else return B})}return u.jsx(uA,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:x,thumbs:S.current,values:b,orientation:l,form:w,children:u.jsx(Ac.Provider,{scope:e.__scopeSlider,children:u.jsx(Ac.Slot,{scope:e.__scopeSlider,children:u.jsx(v,{"aria-disabled":s,"data-disabled":s?"":void 0,...y,ref:t,onPointerDown:ee(y.onPointerDown,()=>{s||(N.current=b)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:O,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,b.length-1,{commit:!0}),onStepKeyDown:({event:R,direction:_})=>{if(!s){const I=c0.includes(R.key)||R.shiftKey&&d0.includes(R.key)?10:1,L=x.current,B=b[L],P=o*I*_;M(B+P,L,{commit:!0})}}})})})})});m0.displayName=Ai;var[h0,g0]=p0(Ai,{startEdge:"left",endEdge:"right",size:"width",direction:1}),cA=g.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:c,...f}=e,[d,p]=g.useState(null),m=ye(t,v=>p(v)),w=g.useRef(void 0),y=ta(i),S=y==="ltr",x=S&&!o||!S&&o;function h(v){const b=w.current||d.getBoundingClientRect(),E=[0,b.width],j=pf(E,x?[n,r]:[r,n]);return w.current=b,j(v-b.left)}return u.jsx(h0,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:u.jsx(y0,{dir:y,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:v=>{const b=h(v.clientX);l==null||l(b)},onSlideMove:v=>{const b=h(v.clientX);s==null||s(b)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:v=>{const E=f0[x?"from-left":"from-right"].includes(v.key);c==null||c({event:v,direction:E?-1:1})}})})}),dA=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...c}=e,f=g.useRef(null),d=ye(t,f),p=g.useRef(void 0),m=!i;function w(y){const S=p.current||f.current.getBoundingClientRect(),x=[0,S.height],v=pf(x,m?[r,n]:[n,r]);return p.current=S,v(y-S.top)}return u.jsx(h0,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:u.jsx(y0,{"data-orientation":"vertical",...c,ref:d,style:{...c.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:()=>{p.current=void 0,s==null||s()},onStepKeyDown:y=>{const x=f0[m?"from-bottom":"from-top"].includes(y.key);a==null||a({event:y,direction:x?-1:1})}})})}),y0=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...c}=e,f=ua(Ai,n);return u.jsx(oe.span,{...c,ref:t,onKeyDown:ee(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):c0.concat(d0).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:ee(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:ee(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:ee(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),x0="SliderTrack",v0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ua(x0,n);return u.jsx(oe.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});v0.displayName=x0;var Rc="SliderRange",w0=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=ua(Rc,n),o=g0(Rc,n),l=g.useRef(null),s=ye(t,l),a=i.values.length,c=i.values.map(p=>b0(p,i.min,i.max)),f=a>1?Math.min(...c):0,d=100-Math.max(...c);return u.jsx(oe.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});w0.displayName=Rc;var Ic="SliderThumb",S0=g.forwardRef((e,t)=>{const n=sA(e.__scopeSlider),[r,i]=g.useState(null),o=ye(t,s=>i(s)),l=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return u.jsx(fA,{...e,ref:o,index:l})}),fA=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=ua(Ic,n),s=g0(Ic,n),[a,c]=g.useState(null),f=ye(t,h=>c(h)),d=a?l.form||!!a.closest("form"):!0,p=u0(a),m=l.values[r],w=m===void 0?0:b0(m,l.min,l.max),y=hA(r,l.values.length),S=p==null?void 0:p[s.size],x=S?yA(S,w,s.direction):0;return g.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),u.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${x}px)`},children:[u.jsx(Ac.ItemSlot,{scope:e.__scopeSlider,children:u.jsx(oe.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":l.min,"aria-valuenow":m,"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:f,style:m===void 0?{display:"none"}:e.style,onFocus:ee(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&u.jsx(k0,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});S0.displayName=Ic;var pA="RadioBubbleInput",k0=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=g.useRef(null),o=ye(i,r),l=a0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("input",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),u.jsx(oe.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});k0.displayName=pA;function mA(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function b0(e,t,n){const o=100/(n-t)*(e-t);return Ps(o,[0,100])}function hA(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function gA(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 yA(e,t,n){const r=e/2,o=pf([0,50],[0,r]);return(r-o(t)*n)*n}function xA(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function vA(e,t){if(t>0){const n=xA(e);return Math.min(...n)>=t}return!0}function pf(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 wA(e){return(String(e).split(".")[1]||"").length}function SA(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var C0=m0,kA=v0,bA=w0,CA=S0;const Ts=g.forwardRef(({className:e,...t},n)=>u.jsxs(C0,{ref:n,className:ue("relative flex w-full touch-none select-none items-center",e),...t,children:[u.jsx(kA,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:u.jsx(bA,{className:"absolute h-full bg-primary"})}),u.jsx(CA,{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"})]}));Ts.displayName=C0.displayName;const NA=["top","right","bottom","left"],tr=Math.min,wt=Math.max,_s=Math.round,kl=Math.floor,dn=e=>({x:e,y:e}),EA={left:"right",right:"left",bottom:"top",top:"bottom"},jA={start:"end",end:"start"};function Mc(e,t,n){return wt(e,tr(t,n))}function Nn(e,t){return typeof e=="function"?e(t):e}function En(e){return e.split("-")[0]}function Ri(e){return e.split("-")[1]}function mf(e){return e==="x"?"y":"x"}function hf(e){return e==="y"?"height":"width"}const PA=new Set(["top","bottom"]);function an(e){return PA.has(En(e))?"y":"x"}function gf(e){return mf(an(e))}function TA(e,t,n){n===void 0&&(n=!1);const r=Ri(e),i=gf(e),o=hf(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 _A(e){const t=As(e);return[Lc(e),t,Lc(t)]}function Lc(e){return e.replace(/start|end/g,t=>jA[t])}const rh=["left","right"],ih=["right","left"],AA=["top","bottom"],RA=["bottom","top"];function IA(e,t,n){switch(e){case"top":case"bottom":return n?t?ih:rh:t?rh:ih;case"left":case"right":return t?AA:RA;default:return[]}}function MA(e,t,n,r){const i=Ri(e);let o=IA(En(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Lc)))),o}function As(e){return e.replace(/left|right|bottom|top/g,t=>EA[t])}function LA(e){return{top:0,right:0,bottom:0,left:0,...e}}function N0(e){return typeof e!="number"?LA(e):{top:e,right:e,bottom:e,left:e}}function Rs(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 oh(e,t,n){let{reference:r,floating:i}=e;const o=an(t),l=gf(t),s=hf(l),a=En(t),c=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let m;switch(a){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ri(t)){case"start":m[l]-=p*(n&&c?-1:1);break;case"end":m[l]+=p*(n&&c?-1:1);break}return m}const OA=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 c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=oh(c,r,a),p=r,m={},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:c,padding:f=0}=Nn(e,t)||{};if(c==null)return{};const d=N0(f),p={x:n,y:r},m=gf(i),w=hf(m),y=await l.getDimensions(c),S=m==="y",x=S?"top":"left",h=S?"bottom":"right",v=S?"clientHeight":"clientWidth",b=o.reference[w]+o.reference[m]-p[m]-o.floating[w],E=p[m]-o.reference[m],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let j=N?N[v]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[v]||o.floating[w]);const T=b/2-E/2,O=j/2-y[w]/2-1,M=tr(d[x],O),R=tr(d[h],O),_=M,H=j-y[w]-R,W=j/2-y[w]/2+T,I=Mc(_,W,H),L=!a.arrow&&Ri(i)!=null&&W!==I&&o.reference[w]/2-(W<_?M:R)-y[w]/2<0,B=L?W<_?W-_:W-H:0;return{[m]:p[m]+B,data:{[m]:I,centerOffset:W-I-B,...L&&{alignmentOffset:B}},reset:L}}}),zA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:y=!0,...S}=Nn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=En(i),h=an(s),v=En(s)===s,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),E=p||(v||!y?[As(s)]:_A(s)),N=w!=="none";!p&&N&&E.push(...MA(s,y,w,b));const j=[s,...E],T=await Ro(t,S),O=[];let M=((r=o.flip)==null?void 0:r.overflows)||[];if(f&&O.push(T[x]),d){const W=TA(i,l,b);O.push(T[W[0]],T[W[1]])}if(M=[...M,{placement:i,overflows:O}],!O.every(W=>W<=0)){var R,_;const W=(((R=o.flip)==null?void 0:R.index)||0)+1,I=j[W];if(I&&(!(d==="alignment"?h!==an(I):!1)||M.every(P=>an(P.placement)===h?P.overflows[0]>0:!0)))return{data:{index:W,overflows:M},reset:{placement:I}};let L=(_=M.filter(B=>B.overflows[0]<=0).sort((B,P)=>B.overflows[1]-P.overflows[1])[0])==null?void 0:_.placement;if(!L)switch(m){case"bestFit":{var H;const B=(H=M.filter(P=>{if(N){const z=an(P.placement);return z===h||z==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((P,z)=>P[1]-z[1])[0])==null?void 0:H[0];B&&(L=B);break}case"initialPlacement":L=s;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function lh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sh(e){return NA.some(t=>e[t]>=0)}const FA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Nn(e,t);switch(r){case"referenceHidden":{const o=await Ro(t,{...i,elementContext:"reference"}),l=lh(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:sh(l)}}}case"escaped":{const o=await Ro(t,{...i,altBoundary:!0}),l=lh(o,n.floating);return{data:{escapedOffsets:l,escaped:sh(l)}}}default:return{}}}}},E0=new Set(["left","top"]);async function BA(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=En(n),s=Ri(n),a=an(n)==="y",c=E0.has(l)?-1:1,f=o&&a?-1:1,d=Nn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof w=="number"&&(m=s==="end"?w*-1:w),a?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const $A=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 BA(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}}}}},UA=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,y:h}=S;return{x,y:h}}},...a}=Nn(e,t),c={x:n,y:r},f=await Ro(t,a),d=an(En(i)),p=mf(d);let m=c[p],w=c[d];if(o){const S=p==="y"?"top":"left",x=p==="y"?"bottom":"right",h=m+f[S],v=m-f[x];m=Mc(h,m,v)}if(l){const S=d==="y"?"top":"left",x=d==="y"?"bottom":"right",h=w+f[S],v=w-f[x];w=Mc(h,w,v)}const y=s.fn({...t,[p]:m,[d]:w});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:o,[d]:l}}}}}},VA=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:c=!0}=Nn(e,t),f={x:n,y:r},d=an(i),p=mf(d);let m=f[p],w=f[d];const y=Nn(s,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const v=p==="y"?"height":"width",b=o.reference[p]-o.floating[v]+S.mainAxis,E=o.reference[p]+o.reference[v]-S.mainAxis;mE&&(m=E)}if(c){var x,h;const v=p==="y"?"width":"height",b=E0.has(En(i)),E=o.reference[d]-o.floating[v]+(b&&((x=l.offset)==null?void 0:x[d])||0)+(b?0:S.crossAxis),N=o.reference[d]+o.reference[v]+(b?0:((h=l.offset)==null?void 0:h[d])||0)-(b?S.crossAxis:0);wN&&(w=N)}return{[p]:m,[d]:w}}}},HA=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=()=>{},...c}=Nn(e,t),f=await Ro(t,c),d=En(i),p=Ri(i),m=an(i)==="y",{width:w,height:y}=o.floating;let S,x;d==="top"||d==="bottom"?(S=d,x=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(x=d,S=p==="end"?"top":"bottom");const h=y-f.top-f.bottom,v=w-f.left-f.right,b=tr(y-f[S],h),E=tr(w-f[x],v),N=!t.middlewareData.shift;let j=b,T=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=v),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=h),N&&!p){const M=wt(f.left,0),R=wt(f.right,0),_=wt(f.top,0),H=wt(f.bottom,0);m?T=w-2*(M!==0||R!==0?M+R:wt(f.left,f.right)):j=y-2*(_!==0||H!==0?_+H:wt(f.top,f.bottom))}await a({...t,availableWidth:T,availableHeight:j});const O=await l.getDimensions(s.floating);return w!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function ca(){return typeof window<"u"}function Ii(e){return j0(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(j0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j0(e){return ca()?e instanceof Node||e instanceof Ct(e).Node:!1}function Yt(e){return ca()?e instanceof Element||e instanceof Ct(e).Element:!1}function pn(e){return ca()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function ah(e){return!ca()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}const WA=new Set(["inline","contents"]);function Ko(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!WA.has(i)}const KA=new Set(["table","td","th"]);function GA(e){return KA.has(Ii(e))}const QA=[":popover-open",":modal"];function da(e){return QA.some(t=>{try{return e.matches(t)}catch{return!1}})}const YA=["transform","translate","scale","rotate","perspective"],qA=["transform","translate","scale","rotate","perspective","filter"],XA=["paint","layout","strict","content"];function yf(e){const t=xf(),n=Yt(e)?qt(e):e;return YA.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)||qA.some(r=>(n.willChange||"").includes(r))||XA.some(r=>(n.contain||"").includes(r))}function JA(e){let t=nr(e);for(;pn(t)&&!bi(t);){if(yf(t))return t;if(da(t))return null;t=nr(t)}return null}function xf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ZA=new Set(["html","body","#document"]);function bi(e){return ZA.has(Ii(e))}function qt(e){return Ct(e).getComputedStyle(e)}function fa(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nr(e){if(Ii(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ah(e)&&e.host||mn(e);return ah(t)?t.host:t}function P0(e){const t=nr(e);return bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:pn(t)&&Ko(t)?t:P0(t)}function Io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=P0(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Ct(i);if(o){const s=Oc(l);return t.concat(l,l.visualViewport||[],Ko(i)?i:[],s&&n?Io(s):[])}return t.concat(i,Io(i,[],n))}function Oc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T0(e){const t=qt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=pn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=_s(n)!==o||_s(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function vf(e){return Yt(e)?e:e.contextElement}function fi(e){const t=vf(e);if(!pn(t))return dn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=T0(t);let l=(o?_s(n.width):n.width)/r,s=(o?_s(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eR=dn(0);function _0(e){const t=Ct(e);return!xf()||!t.visualViewport?eR:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tR(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ct(e)?!1:t}function _r(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=vf(e);let l=dn(1);t&&(r?Yt(r)&&(l=fi(r)):l=fi(e));const s=tR(o,n,r)?_0(o):dn(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=Ct(o),m=r&&Yt(r)?Ct(r):r;let w=p,y=Oc(w);for(;y&&r&&m!==w;){const S=fi(y),x=y.getBoundingClientRect(),h=qt(y),v=x.left+(y.clientLeft+parseFloat(h.paddingLeft))*S.x,b=x.top+(y.clientTop+parseFloat(h.paddingTop))*S.y;a*=S.x,c*=S.y,f*=S.x,d*=S.y,a+=v,c+=b,w=Ct(y),y=Oc(w)}}return Rs({width:f,height:d,x:a,y:c})}function pa(e,t){const n=fa(e).scrollLeft;return t?t.left+n:_r(mn(e)).left+n}function A0(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pa(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function nR(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=mn(r),s=t?da(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},c=dn(1);const f=dn(0),d=pn(r);if((d||!d&&!o)&&((Ii(r)!=="body"||Ko(l))&&(a=fa(r)),pn(r))){const m=_r(r);c=fi(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=l&&!d&&!o?A0(l,a):dn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-a.scrollTop*c.y+f.y+p.y}}function rR(e){return Array.from(e.getClientRects())}function iR(e){const t=mn(e),n=fa(e),r=e.ownerDocument.body,i=wt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=wt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+pa(e);const s=-n.scrollTop;return qt(r).direction==="rtl"&&(l+=wt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const uh=25;function oR(e,t){const n=Ct(e),r=mn(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const f=xf();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const c=pa(r);if(c<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-d.clientWidth-m);w<=uh&&(o-=w)}else c<=uh&&(o+=c);return{width:o,height:l,x:s,y:a}}const lR=new Set(["absolute","fixed"]);function sR(e,t){const n=_r(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=pn(e)?fi(e):dn(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:l,height:s,x:a,y:c}}function ch(e,t,n){let r;if(t==="viewport")r=oR(e,n);else if(t==="document")r=iR(mn(e));else if(Yt(t))r=sR(t,n);else{const i=_0(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Rs(r)}function R0(e,t){const n=nr(e);return n===t||!Yt(n)||bi(n)?!1:qt(n).position==="fixed"||R0(n,t)}function aR(e,t){const n=t.get(e);if(n)return n;let r=Io(e,[],!1).filter(s=>Yt(s)&&Ii(s)!=="body"),i=null;const o=qt(e).position==="fixed";let l=o?nr(e):e;for(;Yt(l)&&!bi(l);){const s=qt(l),a=yf(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&lR.has(i.position)||Ko(l)&&!a&&R0(e,l))?r=r.filter(f=>f!==l):i=s,l=nr(l)}return t.set(e,r),r}function uR(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?da(t)?[]:aR(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((c,f)=>{const d=ch(t,f,i);return c.top=wt(d.top,c.top),c.right=tr(d.right,c.right),c.bottom=tr(d.bottom,c.bottom),c.left=wt(d.left,c.left),c},ch(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function cR(e){const{width:t,height:n}=T0(e);return{width:t,height:n}}function dR(e,t,n){const r=pn(t),i=mn(t),o=n==="fixed",l=_r(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=dn(0);function c(){a.x=pa(i)}if(r||!r&&!o)if((Ii(t)!=="body"||Ko(i))&&(s=fa(t)),r){const m=_r(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&c();o&&!r&&i&&c();const f=i&&!r&&!o?A0(i,s):dn(0),d=l.left+s.scrollLeft-a.x-f.x,p=l.top+s.scrollTop-a.y-f.y;return{x:d,y:p,width:l.width,height:l.height}}function hu(e){return qt(e).position==="static"}function dh(e,t){if(!pn(e)||qt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function I0(e,t){const n=Ct(e);if(da(e))return n;if(!pn(e)){let i=nr(e);for(;i&&!bi(i);){if(Yt(i)&&!hu(i))return i;i=nr(i)}return n}let r=dh(e,t);for(;r&&GA(r)&&hu(r);)r=dh(r,t);return r&&bi(r)&&hu(r)&&!yf(r)?n:r||JA(e)||n}const fR=async function(e){const t=this.getOffsetParent||I0,n=this.getDimensions,r=await n(e.floating);return{reference:dR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pR(e){return qt(e).direction==="rtl"}const mR={convertOffsetParentRelativeRectToViewportRelativeRect:nR,getDocumentElement:mn,getClippingRect:uR,getOffsetParent:I0,getElementRects:fR,getClientRects:rR,getDimensions:cR,getScale:fi,isElement:Yt,isRTL:pR};function M0(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hR(e,t){let n=null,r;const i=mn(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 c=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=c;if(s||t(),!p||!m)return;const w=kl(d),y=kl(i.clientWidth-(f+p)),S=kl(i.clientHeight-(d+m)),x=kl(f),v={rootMargin:-w+"px "+-y+"px "+-S+"px "+-x+"px",threshold:wt(0,tr(1,a))||1};let b=!0;function E(N){const j=N[0].intersectionRatio;if(j!==a){if(!b)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!M0(c,e.getBoundingClientRect())&&l(),b=!1}try{n=new IntersectionObserver(E,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(e)}return l(!0),o}function gR(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,c=vf(e),f=i||o?[...c?Io(c):[],...Io(t)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const d=c&&s?hR(c,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(x=>{let[h]=x;h&&h.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),c&&!a&&m.observe(c),m.observe(t));let w,y=a?_r(e):null;a&&S();function S(){const x=_r(e);y&&!M0(y,x)&&n(),y=x,w=requestAnimationFrame(S)}return n(),()=>{var x;f.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d==null||d(),(x=m)==null||x.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const yR=$A,xR=UA,vR=zA,wR=HA,SR=FA,fh=DA,kR=VA,bR=(e,t,n)=>{const r=new Map,i={platform:mR,...n},o={...i.platform,_c:r};return OA(e,t,{...i,platform:o})};var CR=typeof document<"u",NR=function(){},Ql=CR?g.useLayoutEffect:NR;function Is(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(!Is(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)&&!Is(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function L0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ph(e,t){const n=L0(e);return Math.round(t*n)/n}function gu(e){const t=g.useRef(e);return Ql(()=>{t.current=e}),t}function ER(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:c}=e,[f,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=g.useState(r);Is(p,r)||m(r);const[w,y]=g.useState(null),[S,x]=g.useState(null),h=g.useCallback(P=>{P!==N.current&&(N.current=P,y(P))},[]),v=g.useCallback(P=>{P!==j.current&&(j.current=P,x(P))},[]),b=o||w,E=l||S,N=g.useRef(null),j=g.useRef(null),T=g.useRef(f),O=a!=null,M=gu(a),R=gu(i),_=gu(c),H=g.useCallback(()=>{if(!N.current||!j.current)return;const P={placement:t,strategy:n,middleware:p};R.current&&(P.platform=R.current),bR(N.current,j.current,P).then(z=>{const k={...z,isPositioned:_.current!==!1};W.current&&!Is(T.current,k)&&(T.current=k,ji.flushSync(()=>{d(k)}))})},[p,t,n,R,_]);Ql(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[c]);const W=g.useRef(!1);Ql(()=>(W.current=!0,()=>{W.current=!1}),[]),Ql(()=>{if(b&&(N.current=b),E&&(j.current=E),b&&E){if(M.current)return M.current(b,E,H);H()}},[b,E,H,M,O]);const I=g.useMemo(()=>({reference:N,floating:j,setReference:h,setFloating:v}),[h,v]),L=g.useMemo(()=>({reference:b,floating:E}),[b,E]),B=g.useMemo(()=>{const P={position:n,left:0,top:0};if(!L.floating)return P;const z=ph(L.floating,f.x),k=ph(L.floating,f.y);return s?{...P,transform:"translate("+z+"px, "+k+"px)",...L0(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,L.floating,f.x,f.y]);return g.useMemo(()=>({...f,update:H,refs:I,elements:L,floatingStyles:B}),[f,H,I,L,B])}const jR=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?fh({element:r.current,padding:i}).fn(n):{}:r?fh({element:r,padding:i}).fn(n):{}}}},PR=(e,t)=>({...yR(e),options:[e,t]}),TR=(e,t)=>({...xR(e),options:[e,t]}),_R=(e,t)=>({...kR(e),options:[e,t]}),AR=(e,t)=>({...vR(e),options:[e,t]}),RR=(e,t)=>({...wR(e),options:[e,t]}),IR=(e,t)=>({...SR(e),options:[e,t]}),MR=(e,t)=>({...jR(e),options:[e,t]});var LR="Arrow",O0=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(oe.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});O0.displayName=LR;var OR=O0,wf="Popper",[D0,z0]=sr(wf),[DR,F0]=D0(wf),B0=e=>{const{__scopePopper:t,children:n}=e,[r,i]=g.useState(null);return u.jsx(DR,{scope:t,anchor:r,onAnchorChange:i,children:n})};B0.displayName=wf;var $0="PopperAnchor",U0=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=F0($0,n),l=g.useRef(null),s=ye(t,l),a=g.useRef(null);return g.useEffect(()=>{const c=a.current;a.current=(r==null?void 0:r.current)||l.current,c!==a.current&&o.onAnchorChange(a.current)}),r?null:u.jsx(oe.div,{...i,ref:s})});U0.displayName=$0;var Sf="PopperContent",[zR,FR]=D0(Sf),V0=g.forwardRef((e,t)=>{var G,te,me,ie,ce,pe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...y}=e,S=F0(Sf,n),[x,h]=g.useState(null),v=ye(t,Ue=>h(Ue)),[b,E]=g.useState(null),N=u0(b),j=(N==null?void 0:N.width)??0,T=(N==null?void 0:N.height)??0,O=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},R=Array.isArray(c)?c:[c],_=R.length>0,H={padding:M,boundary:R.filter($R),altBoundary:_},{refs:W,floatingStyles:I,placement:L,isPositioned:B,middlewareData:P}=ER({strategy:"fixed",placement:O,whileElementsMounted:(...Ue)=>gR(...Ue,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[PR({mainAxis:i+T,alignmentAxis:l}),a&&TR({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?_R():void 0,...H}),a&&AR({...H}),RR({...H,apply:({elements:Ue,rects:nt,availableWidth:Jt,availableHeight:Dt})=>{const{width:Zt,height:Li}=nt.reference,hn=Ue.floating.style;hn.setProperty("--radix-popper-available-width",`${Jt}px`),hn.setProperty("--radix-popper-available-height",`${Dt}px`),hn.setProperty("--radix-popper-anchor-width",`${Zt}px`),hn.setProperty("--radix-popper-anchor-height",`${Li}px`)}}),b&&MR({element:b,padding:s}),UR({arrowWidth:j,arrowHeight:T}),p&&IR({strategy:"referenceHidden",...H})]}),[z,k]=K0(L),U=er(w);et(()=>{B&&(U==null||U())},[B,U]);const Q=(G=P.arrow)==null?void 0:G.x,C=(te=P.arrow)==null?void 0:te.y,ne=((me=P.arrow)==null?void 0:me.centerOffset)!==0,[de,re]=g.useState();return et(()=>{x&&re(window.getComputedStyle(x).zIndex)},[x]),u.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:B?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(ie=P.transformOrigin)==null?void 0:ie.x,(ce=P.transformOrigin)==null?void 0:ce.y].join(" "),...((pe=P.hide)==null?void 0:pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(zR,{scope:n,placedSide:z,onArrowChange:E,arrowX:Q,arrowY:C,shouldHideArrow:ne,children:u.jsx(oe.div,{"data-side":z,"data-align":k,...y,ref:v,style:{...y.style,animation:B?void 0:"none"}})})})});V0.displayName=Sf;var H0="PopperArrow",BR={top:"bottom",right:"left",bottom:"top",left:"right"},W0=g.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=FR(H0,r),l=BR[o.placedSide];return u.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:u.jsx(OR,{...i,ref:n,style:{...i.style,display:"block"}})})});W0.displayName=H0;function $R(e){return e!==null}var UR=e=>({name:"transformOrigin",options:e,fn(t){var S,x,h;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,[c,f]=K0(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((x=i.arrow)==null?void 0:x.x)??0)+s/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+a/2;let w="",y="";return c==="bottom"?(w=l?d:`${p}px`,y=`${-a}px`):c==="top"?(w=l?d:`${p}px`,y=`${r.floating.height+a}px`):c==="right"?(w=`${-a}px`,y=l?d:`${m}px`):c==="left"&&(w=`${r.floating.width+a}px`,y=l?d:`${m}px`),{data:{x:w,y}}}});function K0(e){const[t,n="center"]=e.split("-");return[t,n]}var VR=B0,HR=U0,WR=V0,KR=W0,G0=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"}),GR="VisuallyHidden",QR=g.forwardRef((e,t)=>u.jsx(oe.span,{...e,ref:t,style:{...G0,...e.style}}));QR.displayName=GR;var YR=[" ","Enter","ArrowUp","ArrowDown"],qR=[" ","Enter"],Ar="Select",[ma,ha,XR]=Vd(Ar),[Mi,LI]=sr(Ar,[XR,z0]),ga=z0(),[JR,ur]=Mi(Ar),[ZR,eI]=Mi(Ar),Q0=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:c,name:f,autoComplete:d,disabled:p,required:m,form:w}=e,y=ga(t),[S,x]=g.useState(null),[h,v]=g.useState(null),[b,E]=g.useState(!1),N=ta(c),[j,T]=ki({prop:r,defaultProp:i??!1,onChange:o,caller:Ar}),[O,M]=ki({prop:l,defaultProp:s,onChange:a,caller:Ar}),R=g.useRef(null),_=S?w||!!S.closest("form"):!0,[H,W]=g.useState(new Set),I=Array.from(H).map(L=>L.props.value).join(";");return u.jsx(VR,{...y,children:u.jsxs(JR,{required:m,scope:t,trigger:S,onTriggerChange:x,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:E,contentId:qn(),value:O,onValueChange:M,open:j,onOpenChange:T,dir:N,triggerPointerDownPosRef:R,disabled:p,children:[u.jsx(ma.Provider,{scope:t,children:u.jsx(ZR,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(L=>{W(B=>new Set(B).add(L))},[]),onNativeOptionRemove:g.useCallback(L=>{W(B=>{const P=new Set(B);return P.delete(L),P})},[]),children:n})}),_?u.jsxs(v1,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:O,onChange:L=>M(L.target.value),disabled:p,form:w,children:[O===void 0?u.jsx("option",{value:""}):null,Array.from(H)]},I):null]})})};Q0.displayName=Ar;var Y0="SelectTrigger",q0=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=ga(n),l=ur(Y0,n),s=l.disabled||r,a=ye(t,l.onTriggerChange),c=ha(n),f=g.useRef("touch"),[d,p,m]=S1(y=>{const S=c().filter(v=>!v.disabled),x=S.find(v=>v.value===l.value),h=k1(S,y,x);h!==void 0&&l.onValueChange(h.value)}),w=y=>{s||(l.onOpenChange(!0),m()),y&&(l.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return u.jsx(HR,{asChild:!0,...o,children:u.jsx(oe.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":w1(l.value)?"":void 0,...i,ref:a,onClick:ee(i.onClick,y=>{y.currentTarget.focus(),f.current!=="mouse"&&w(y)}),onPointerDown:ee(i.onPointerDown,y=>{f.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:ee(i.onKeyDown,y=>{const S=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(S&&y.key===" ")&&YR.includes(y.key)&&(w(),y.preventDefault())})})})});q0.displayName=Y0;var X0="SelectValue",J0=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=ur(X0,n),{onValueNodeHasChildrenChange:c}=a,f=o!==void 0,d=ye(t,a.onValueNodeChange);return et(()=>{c(f)},[c,f]),u.jsx(oe.span,{...s,ref:d,style:{pointerEvents:"none"},children:w1(a.value)?u.jsx(u.Fragment,{children:l}):o})});J0.displayName=X0;var tI="SelectIcon",Z0=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(oe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Z0.displayName=tI;var nI="SelectPortal",e1=e=>u.jsx(Gd,{asChild:!0,...e});e1.displayName=nI;var Rr="SelectContent",t1=g.forwardRef((e,t)=>{const n=ur(Rr,e.__scopeSelect),[r,i]=g.useState();if(et(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ji.createPortal(u.jsx(n1,{scope:e.__scopeSelect,children:u.jsx(ma.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(r1,{...e,ref:t})});t1.displayName=Rr;var $t=10,[n1,cr]=Mi(Rr),rI="SelectContentImpl",iI=Si("SelectContent.RemoveScroll"),r1=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S,...x}=e,h=ur(Rr,n),[v,b]=g.useState(null),[E,N]=g.useState(null),j=ye(t,G=>b(G)),[T,O]=g.useState(null),[M,R]=g.useState(null),_=ha(n),[H,W]=g.useState(!1),I=g.useRef(!1);g.useEffect(()=>{if(v)return Fx(v)},[v]),Px();const L=g.useCallback(G=>{const[te,...me]=_().map(pe=>pe.ref.current),[ie]=me.slice(-1),ce=document.activeElement;for(const pe of G)if(pe===ce||(pe==null||pe.scrollIntoView({block:"nearest"}),pe===te&&E&&(E.scrollTop=0),pe===ie&&E&&(E.scrollTop=E.scrollHeight),pe==null||pe.focus(),document.activeElement!==ce))return},[_,E]),B=g.useCallback(()=>L([T,v]),[L,T,v]);g.useEffect(()=>{H&&B()},[H,B]);const{onOpenChange:P,triggerPointerDownPosRef:z}=h;g.useEffect(()=>{if(v){let G={x:0,y:0};const te=ie=>{var ce,pe;G={x:Math.abs(Math.round(ie.pageX)-(((ce=z.current)==null?void 0:ce.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((pe=z.current)==null?void 0:pe.y)??0))}},me=ie=>{G.x<=10&&G.y<=10?ie.preventDefault():v.contains(ie.target)||P(!1),document.removeEventListener("pointermove",te),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",me,{capture:!0})}}},[v,P,z]),g.useEffect(()=>{const G=()=>P(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[P]);const[k,U]=S1(G=>{const te=_().filter(ce=>!ce.disabled),me=te.find(ce=>ce.ref.current===document.activeElement),ie=k1(te,G,me);ie&&setTimeout(()=>ie.ref.current.focus())}),Q=g.useCallback((G,te,me)=>{const ie=!I.current&&!me;(h.value!==void 0&&h.value===te||ie)&&(O(G),ie&&(I.current=!0))},[h.value]),C=g.useCallback(()=>v==null?void 0:v.focus(),[v]),ne=g.useCallback((G,te,me)=>{const ie=!I.current&&!me;(h.value!==void 0&&h.value===te||ie)&&R(G)},[h.value]),de=r==="popper"?Dc:i1,re=de===Dc?{side:s,sideOffset:a,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return u.jsx(n1,{scope:n,content:v,viewport:E,onViewportChange:N,itemRefCallback:Q,selectedItem:T,onItemLeave:C,itemTextRefCallback:ne,focusSelectedItem:B,selectedItemText:M,position:r,isPositioned:H,searchRef:k,children:u.jsx(Dx,{as:iI,allowPinchZoom:!0,children:u.jsx(Kd,{asChild:!0,trapped:h.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ee(i,G=>{var te;(te=h.trigger)==null||te.focus({preventScroll:!0}),G.preventDefault()}),children:u.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:u.jsx(de,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:G=>G.preventDefault(),...x,...re,onPlaced:()=>W(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ee(x.onKeyDown,G=>{const te=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!te&&G.key.length===1&&U(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let ie=_().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);if(["ArrowUp","End"].includes(G.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ce=G.target,pe=ie.indexOf(ce);ie=ie.slice(pe+1)}setTimeout(()=>L(ie)),G.preventDefault()}})})})})})})});r1.displayName=rI;var oI="SelectItemAlignedPosition",i1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ur(Rr,n),l=cr(Rr,n),[s,a]=g.useState(null),[c,f]=g.useState(null),d=ye(t,j=>f(j)),p=ha(n),m=g.useRef(!1),w=g.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:x,focusSelectedItem:h}=l,v=g.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&y&&S&&x){const j=o.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),O=o.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(o.dir!=="rtl"){const ce=M.left-T.left,pe=O.left-ce,Ue=j.left-pe,nt=j.width+Ue,Jt=Math.max(nt,T.width),Dt=window.innerWidth-$t,Zt=Ps(pe,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=nt+"px",s.style.left=Zt+"px"}else{const ce=T.right-M.right,pe=window.innerWidth-O.right-ce,Ue=window.innerWidth-j.right-pe,nt=j.width+Ue,Jt=Math.max(nt,T.width),Dt=window.innerWidth-$t,Zt=Ps(pe,[$t,Math.max($t,Dt-Jt)]);s.style.minWidth=nt+"px",s.style.right=Zt+"px"}const R=p(),_=window.innerHeight-$t*2,H=y.scrollHeight,W=window.getComputedStyle(c),I=parseInt(W.borderTopWidth,10),L=parseInt(W.paddingTop,10),B=parseInt(W.borderBottomWidth,10),P=parseInt(W.paddingBottom,10),z=I+L+H+P+B,k=Math.min(S.offsetHeight*5,z),U=window.getComputedStyle(y),Q=parseInt(U.paddingTop,10),C=parseInt(U.paddingBottom,10),ne=j.top+j.height/2-$t,de=_-ne,re=S.offsetHeight/2,G=S.offsetTop+re,te=I+L+G,me=z-te;if(te<=ne){const ce=R.length>0&&S===R[R.length-1].ref.current;s.style.bottom="0px";const pe=c.clientHeight-y.offsetTop-y.offsetHeight,Ue=Math.max(de,re+(ce?C:0)+pe+B),nt=te+Ue;s.style.height=nt+"px"}else{const ce=R.length>0&&S===R[0].ref.current;s.style.top="0px";const Ue=Math.max(ne,I+y.offsetTop+(ce?Q:0)+re)+me;s.style.height=Ue+"px",y.scrollTop=te-ne+y.offsetTop}s.style.margin=`${$t}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,c,y,S,x,o.dir,r]);et(()=>v(),[v]);const[b,E]=g.useState();et(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const N=g.useCallback(j=>{j&&w.current===!0&&(v(),h==null||h(),w.current=!1)},[v,h]);return u.jsx(sI,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:u.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:u.jsx(oe.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});i1.displayName=oI;var lI="SelectPopperPosition",Dc=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=$t,...o}=e,l=ga(n);return u.jsx(WR,{...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)"}})});Dc.displayName=lI;var[sI,kf]=Mi(Rr,{}),zc="SelectViewport",o1=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=cr(zc,n),l=kf(zc,n),s=ye(t,o.onViewportChange),a=g.useRef(0);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(ma.Slot,{scope:n,children:u.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ee(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=l;if(p!=null&&p.current&&d){const m=Math.abs(a.current-f.scrollTop);if(m>0){const w=window.innerHeight-$t*2,y=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),x=Math.max(y,S);if(x0?b:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});o1.displayName=zc;var l1="SelectGroup",[aI,uI]=Mi(l1),s1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=qn();return u.jsx(aI,{scope:n,id:i,children:u.jsx(oe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});s1.displayName=l1;var a1="SelectLabel",u1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=uI(a1,n);return u.jsx(oe.div,{id:i.id,...r,ref:t})});u1.displayName=a1;var Ms="SelectItem",[cI,c1]=Mi(Ms),d1=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=ur(Ms,n),a=cr(Ms,n),c=s.value===r,[f,d]=g.useState(o??""),[p,m]=g.useState(!1),w=ye(t,h=>{var v;return(v=a.itemRefCallback)==null?void 0:v.call(a,h,r,i)}),y=qn(),S=g.useRef("touch"),x=()=>{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 u.jsx(cI,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:g.useCallback(h=>{d(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:u.jsx(ma.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:u.jsx(oe.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:ee(l.onFocus,()=>m(!0)),onBlur:ee(l.onBlur,()=>m(!1)),onClick:ee(l.onClick,()=>{S.current!=="mouse"&&x()}),onPointerUp:ee(l.onPointerUp,()=>{S.current==="mouse"&&x()}),onPointerDown:ee(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:ee(l.onPointerMove,h=>{var v;S.current=h.pointerType,i?(v=a.onItemLeave)==null||v.call(a):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(l.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=a.onItemLeave)==null||v.call(a))}),onKeyDown:ee(l.onKeyDown,h=>{var b;((b=a.searchRef)==null?void 0:b.current)!==""&&h.key===" "||(qR.includes(h.key)&&x(),h.key===" "&&h.preventDefault())})})})})});d1.displayName=Ms;var Ji="SelectItemText",f1=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ur(Ji,n),s=cr(Ji,n),a=c1(Ji,n),c=eI(Ji,n),[f,d]=g.useState(null),p=ye(t,x=>d(x),a.onItemTextChange,x=>{var h;return(h=s.itemTextRefCallback)==null?void 0:h.call(s,x,a.value,a.disabled)}),m=f==null?void 0:f.textContent,w=g.useMemo(()=>u.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=c;return et(()=>(y(w),()=>S(w)),[y,S,w]),u.jsxs(u.Fragment,{children:[u.jsx(oe.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ji.createPortal(o.children,l.valueNode):null]})});f1.displayName=Ji;var p1="SelectItemIndicator",m1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c1(p1,n).isSelected?u.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});m1.displayName=p1;var Fc="SelectScrollUpButton",h1=g.forwardRef((e,t)=>{const n=cr(Fc,e.__scopeSelect),r=kf(Fc,e.__scopeSelect),[i,o]=g.useState(!1),l=ye(t,r.onScrollButtonChange);return et(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?u.jsx(y1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});h1.displayName=Fc;var Bc="SelectScrollDownButton",g1=g.forwardRef((e,t)=>{const n=cr(Bc,e.__scopeSelect),r=kf(Bc,e.__scopeSelect),[i,o]=g.useState(!1),l=ye(t,r.onScrollButtonChange);return et(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=a.scrollHeight-a.clientHeight,f=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?u.jsx(y1,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});g1.displayName=Bc;var y1=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=cr("SelectScrollButton",n),l=g.useRef(null),s=ha(n),a=g.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),et(()=>{var f;const c=s().find(d=>d.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),u.jsx(oe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ee(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ee(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ee(i.onPointerLeave,()=>{a()})})}),dI="SelectSeparator",x1=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});x1.displayName=dI;var $c="SelectArrow",fI=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ga(n),o=ur($c,n),l=cr($c,n);return o.open&&l.position==="popper"?u.jsx(KR,{...i,...r,ref:t}):null});fI.displayName=$c;var pI="SelectBubbleInput",v1=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=g.useRef(null),o=ye(r,i),l=a0(t);return g.useEffect(()=>{const s=i.current;if(!s)return;const a=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==t&&f){const d=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(d)}},[l,t]),u.jsx(oe.select,{...n,style:{...G0,...n.style},ref:o,defaultValue:t})});v1.displayName=pI;function w1(e){return e===""||e===void 0}function S1(e){const t=er(e),n=g.useRef(""),r=g.useRef(0),i=g.useCallback(l=>{const s=n.current+l;t(s),function a(c){n.current=c,window.clearTimeout(r.current),c!==""&&(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 k1(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=mI(e,Math.max(o,0));i.length===1&&(l=l.filter(c=>c!==n));const a=l.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function mI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hI=Q0,b1=q0,gI=J0,yI=Z0,xI=e1,C1=t1,vI=o1,wI=s1,N1=u1,E1=d1,SI=f1,kI=m1,j1=h1,P1=g1,T1=x1;const bf=hI,pi=wI,Cf=gI,ya=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(b1,{ref:r,className:ue("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,u.jsx(yI,{asChild:!0,children:u.jsx(Ky,{className:"h-4 w-4 opacity-50"})})]}));ya.displayName=b1.displayName;const _1=g.forwardRef(({className:e,...t},n)=>u.jsx(j1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(nC,{className:"h-4 w-4"})}));_1.displayName=j1.displayName;const A1=g.forwardRef(({className:e,...t},n)=>u.jsx(P1,{ref:n,className:ue("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ky,{className:"h-4 w-4"})}));A1.displayName=P1.displayName;const xa=g.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx(xI,{children:u.jsxs(C1,{ref:i,className:ue("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:[u.jsx(_1,{}),u.jsx(vI,{className:ue("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(A1,{})]})}));xa.displayName=C1.displayName;const br=g.forwardRef(({className:e,...t},n)=>u.jsx(N1,{ref:n,className:ue("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));br.displayName=N1.displayName;const Bn=g.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(E1,{ref:r,className:ue("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(kI,{children:u.jsx(Xb,{className:"h-4 w-4"})})}),u.jsx(SI,{children:t})]}));Bn.displayName=E1.displayName;const bI=g.forwardRef(({className:e,...t},n)=>u.jsx(T1,{ref:n,className:ue("-mx-1 my-1 h-px bg-muted",e),...t}));bI.displayName=T1.displayName;function CI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:s}){return u.jsxs(u.Fragment,{children:[u.jsxs(Je,{children:[u.jsx(It,{children:u.jsx(Mt,{className:"text-base",children:"Model"})}),u.jsx(mt,{className:"space-y-4",children:u.jsx("div",{children:u.jsxs(bf,{value:t||"",onValueChange:n,children:[u.jsx(ya,{className:"w-full",children:u.jsx(Cf,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(f=>f.model_name===t);if(!a)return t;const c=a.type==="api";return u.jsxs("div",{className:"flex items-center gap-2",children:[c?u.jsx(ks,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?u.jsx(Zn,{className:"h-4 w-4 text-purple-500"}):u.jsx(Cs,{className:"h-4 w-4 text-green-500"}),u.jsx("span",{className:"truncate",children:a.name}),r===t?u.jsx(we,{variant:"outline",className:"text-xs",children:"Loading..."}):u.jsx(we,{variant:"outline",className:"text-xs",children:c?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),u.jsxs(xa,{children:[u.jsxs(pi,{children:[u.jsx(br,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>u.jsx(Bn,{value:a.model_name,children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ks,{className:"h-4 w-4 text-blue-500"}),u.jsx("span",{children:a.name}),u.jsx(we,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),u.jsxs(pi,{children:[u.jsx(br,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>u.jsx(Bn,{value:a.model_name,children:u.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?u.jsx(Zn,{className:"h-4 w-4 text-purple-500"}):u.jsx(Cs,{className:"h-4 w-4 text-green-500"}),u.jsx("span",{children:a.name}),r===a.model_name?u.jsx(we,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?u.jsx(we,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):u.jsx(we,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})})})]}),u.jsxs(Je,{children:[u.jsx(It,{children:u.jsx(Mt,{className:"text-base",children:"Parameters"})}),u.jsxs(mt,{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Temperature"}),u.jsx(we,{variant:"outline",className:"text-xs",children:i})]}),u.jsx(Ts,{value:[i],onValueChange:a=>o(a[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),u.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[u.jsx("span",{children:"0.0 (Focused)"}),u.jsx("span",{children:"1.0 (Balanced)"}),u.jsx("span",{children:"2.0 (Creative)"})]}),u.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:i<=.3?"🎯 Very focused and deterministic responses":i<=.7?"⚖️ Balanced creativity and consistency":i<=1.2?"🎨 More creative and varied responses":"🚀 Highly creative, unpredictable responses"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Max Tokens"}),u.jsx(we,{variant:"outline",className:"text-xs",children:l})]}),u.jsx(Ts,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),u.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[u.jsx("span",{children:"50 (Short)"}),u.jsx("span",{children:"1024 (Medium)"}),u.jsx("span",{children:"4000 (Long)"})]}),u.jsx("div",{className:"text-xs text-muted-foreground bg-gray-50 p-2 rounded",children:l<=200?"📝 Brief responses, good for quick answers":l<=1e3?"📄 Medium responses, balanced length":l<=2e3?"📋 Long responses, detailed explanations":"📚 Very long responses, comprehensive content"})]})]})]})]})}function NI({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:s,clearCurrentAssistant:a,openRenameDialog:c,systemPrompt:f}){const d=y=>{if(y==="create_new")s();else if(y==="clear_current")a();else if(y.startsWith("user_")){const S=y.replace("user_","");t(S)}else i(y)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=y=>{switch(y){case"user":return{variant:"secondary",text:"Mine"};case"template":return{variant:"outline",text:"Template"};case"new":return{variant:"default",text:"New",className:"bg-green-100 text-green-700"}}},w=e.length+r.length;return u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(Xe,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),u.jsxs(bf,{value:p(),onValueChange:d,children:[u.jsx(ya,{className:"w-full",children:u.jsx(Cf,{placeholder:`Choose assistant (${w} available)`,children:l?u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ti,{className:"h-4 w-4"}),u.jsx("span",{children:l.name}),l.originalTemplate&&u.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),u.jsx(we,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ti,{className:"h-4 w-4"}),u.jsx("span",{children:"Choose assistant"}),u.jsx(we,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),u.jsxs(xa,{children:[u.jsxs(pi,{children:[u.jsxs(br,{className:"flex items-center gap-2 text-sm font-medium",children:[u.jsx(bs,{className:"h-4 w-4"}),"Actions"]}),u.jsx(Bn,{value:"create_new",children:u.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.jsx(bs,{className:"h-4 w-4 text-green-600"}),u.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),u.jsx(we,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&u.jsx(Bn,{value:"clear_current",children:u.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.jsx(Zy,{className:"h-4 w-4 text-gray-600"}),u.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),u.jsx(we,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&u.jsxs(pi,{children:[u.jsxs(br,{className:"flex items-center gap-2 text-sm font-medium",children:[u.jsx(Bd,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(y=>u.jsx(Bn,{value:`user_${y.id}`,children:u.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.jsx(ti,{className:"h-4 w-4 text-blue-600"}),u.jsx("span",{className:"truncate flex-1",children:y.name}),u.jsx(we,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${y.id}`))]}),r.length>0&&u.jsxs(pi,{children:[u.jsxs(br,{className:"flex items-center gap-2 text-sm font-medium",children:[u.jsx(Gb,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(y=>u.jsx(Bn,{value:y.name,children:u.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u.jsx(ti,{className:"h-4 w-4 text-green-600"}),u.jsx("span",{className:"truncate flex-1",children:y.name}),u.jsx(we,{variant:"outline",className:"text-xs",children:"Template"})]})},y.name))]}),w===0&&u.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&u.jsxs(ve,{onClick:c,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[u.jsx(kr,{className:"h-4 w-4 mr-2"}),"Rename"]}),u.jsxs(ve,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!f.trim(),children:[u.jsx(qy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function EI({systemPrompt:e,setSystemPrompt:t,isLoading:n}){const r=[{title:"Helpful Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses. If you're unsure about something, say so."},{title:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include helpful comments."},{title:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{title:"Teacher/Tutor",prompt:"You are a patient and knowledgeable teacher. Break down complex concepts into simple, understandable parts. Use examples and analogies to help explain ideas."}],i=["Be specific about the assistant's role and expertise","Include desired communication style and tone","Specify output format if needed (lists, paragraphs, etc.)","Add ethical guidelines and behavior expectations"];return u.jsxs("div",{className:"space-y-4 pb-6",children:[u.jsxs(Je,{children:[u.jsx(It,{children:u.jsx(Mt,{className:"text-base",children:"System Instructions"})}),u.jsx(mt,{children:u.jsxs("div",{className:"space-y-4",children:[u.jsx(Xe,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),u.jsx("textarea",{value:e,onChange:o=>t(o.target.value),placeholder:"Define your AI assistant's role, personality, and behavior...",className:"w-full h-[250px] text-base p-4 border-2 border-blue-200 rounded-lg bg-white focus:border-blue-400 focus:ring-2 focus:ring-blue-100 resize-none overflow-y-auto",disabled:n}),u.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"text-sm flex items-center",children:[u.jsx(Zn,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),u.jsx(mt,{children:u.jsxs("div",{className:"space-y-3",children:[u.jsx(Xe,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),u.jsxs(bf,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[u.jsx(ya,{className:"w-full h-10",children:u.jsx(Cf,{placeholder:"Select example prompt..."})}),u.jsx(xa,{children:u.jsxs(pi,{children:[u.jsx(br,{children:"Example Prompts"}),r.map((o,l)=>u.jsx(Bn,{value:l.toString(),children:u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{className:"font-medium text-sm",children:o.title}),u.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"text-sm flex items-center",children:[u.jsx($o,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),u.jsx(mt,{children:u.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>u.jsxs("li",{className:"flex items-start",children:[u.jsx("span",{className:"inline-block w-1.5 h-1.5 bg-blue-400 rounded-full mt-1.5 mr-2 flex-shrink-0"}),o]},l))})})]})]})}function jI({isLoading:e,ragEnabled:t,setRagEnabled:n,retrievalCount:r,setRetrievalCount:i,currentAssistant:o}){const[l,s]=g.useState([]),[a,c]=g.useState(!1);g.useEffect(()=>{(async()=>{if(!o){s([]);return}try{const m=await fetch("/rag/documents");if(m.ok){const w=await m.json();if(w.documents){const y=Object.entries(w.documents).map(([S,x])=>({id:S,name:x.filename,size:0,type:x.file_type,uploadedAt:new Date().toISOString(),status:x.status,chunks:x.chunks,assistantId:x.assistant_id||null}));s(y)}}}catch(m){console.error("Error loading documents:",m)}})()},[o]);const f=async p=>{const m=p.target.files;if(!(!m||!o)){c(!0);try{const w=new FormData;w.append("assistant_id",o.id);for(const S of Array.from(m))w.append("files",S);const y=await fetch("/rag/upload",{method:"POST",body:w});if(y.ok){const S=await y.json(),x=S.results.filter(v=>v.success).map(v=>({id:v.doc_id,name:v.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:v.chunks,assistantId:o==null?void 0:o.id}));s(v=>[...v,...x]);const h=S.results.filter(v=>!v.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",y.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{c(!1)}}},d=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?s(w=>w.filter(y=>y.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),s(w=>w.filter(y=>y.id!==p))}};return u.jsx("div",{className:"space-y-4 pb-6",children:o?u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Bd,{className:"h-4 w-4 text-blue-600"}),u.jsx("span",{children:o.name}),u.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${o.type==="user"?"bg-blue-100 text-blue-700":o.type==="template"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-700"}`,children:o.type==="user"?"My Assistant":o.type==="template"?"Template":"New Assistant"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Xe,{className:"text-xs text-muted-foreground",children:"RAG"}),u.jsx("input",{type:"checkbox",checked:t,onChange:p=>n(p.target.checked),className:"rounded",disabled:e||l.length===0}),t&&l.length>0&&u.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[u.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),u.jsx("span",{className:"text-xs font-medium",children:"Active"})]})]})]})}),u.jsxs(mt,{className:"space-y-4",children:[t&&u.jsxs("div",{className:"border-l-2 border-blue-200 pl-3 space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Xe,{className:"text-xs font-medium",children:"Retrieval Depth"}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," chunks"]})]}),u.jsx(Ts,{value:[r],onValueChange:p=>i(p[0]),max:10,min:1,step:1,className:"w-full"})]}),u.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-4 text-center hover:border-gray-300 transition-colors",children:[u.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:f,className:"hidden",disabled:a||e}),u.jsxs(Xe,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[u.jsx(VC,{className:"h-6 w-6 text-gray-400"}),u.jsx("span",{className:"text-sm",children:a?"Uploading...":"Drop files or click to upload"}),u.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD supported"})]})]}),l.length>0&&u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs(Xe,{className:"text-sm font-medium",children:["Documents (",l.length,")"]}),t&&u.jsxs("span",{className:"text-xs text-green-600",children:["Using ",Math.min(r,l.length)," for context"]})]}),u.jsx("div",{className:"space-y-1",children:l.map(p=>u.jsxs("div",{className:"flex items-center justify-between p-2 border rounded bg-gray-50/50 hover:bg-gray-50",children:[u.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[u.jsx(mC,{className:"h-3 w-3 text-blue-600 flex-shrink-0"}),u.jsx("span",{className:"text-sm truncate",children:p.name}),p.chunks&&u.jsxs("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:[p.chunks," chunks"]})]}),u.jsx(ve,{size:"sm",variant:"ghost",onClick:()=>d(p.id),disabled:e,className:"h-6 w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:u.jsx(Zy,{className:"h-3 w-3"})})]},p.id))})]}),l.length===0&&u.jsx("div",{className:"text-center py-3",children:u.jsx("p",{className:"text-xs text-muted-foreground",children:"No documents uploaded yet"})})]})]}):u.jsx(Je,{children:u.jsxs(mt,{className:"pt-6 text-center",children:[u.jsx(ea,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an assistant to manage documents"})]})})})}function PI(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:s,sendMessage:a,stopGeneration:c,isLoading:f,selectedModel:d,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:y,setTemperature:S,maxTokens:x,setMaxTokens:h}=lA(),[v,b]=g.useState(!1),[E,N]=g.useState(3),[j,T]=g.useState(!1),[O,M]=g.useState(!1),[R,_]=g.useState(null),[H,W]=g.useState(!1),[I,L]=g.useState(null),[B,P]=g.useState([]),[z,k]=g.useState([]),[U,Q]=g.useState(null),[C,ne]=g.useState(!1),[de,re]=g.useState(""),[G,te]=g.useState(!1),[me,ie]=g.useState(""),ce=()=>{try{const D=JSON.parse(localStorage.getItem("savedAssistants")||"[]");k(D)}catch(D){console.error("Failed to load saved assistants:",D)}},pe=()=>{if(!m.trim())return;let D="My Assistant";U&&(U.type==="new"?D=U.name:U.type==="template"?D=`My ${U.name}`:D=U.name+" Copy"),re(D),ne(!0)},Ue=()=>{if(!de.trim()||!m.trim())return;const D={id:Date.now().toString(),name:de.trim(),systemPrompt:m,temperature:y,maxTokens:x,model:d,ragEnabled:v,retrievalCount:E,documents:[],createdAt:new Date().toISOString()},q=[...z,D];k(q),localStorage.setItem("savedAssistants",JSON.stringify(q)),Q({id:D.id,name:D.name,type:"user"}),ne(!1),re("")},nt=()=>{ne(!1),re("")},Jt=D=>{const q=z.find(he=>he.id===D);q&&(w(q.systemPrompt),S(q.temperature),h(q.maxTokens),b(q.ragEnabled||!1),N(q.retrievalCount||3),q.model&&p(q.model),Q({id:q.id,name:q.name,type:"user"}))},Dt=[{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:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."}],Zt=D=>{const q=Dt.find(he=>he.name===D);q&&(w(q.prompt),b(!1),N(3),Q({id:D,name:q.name,type:"template"}))},Li=()=>{w(""),S(.7),h(1024),b(!1),N(3),Q({id:"new_assistant",name:"New Assistant",type:"new"})},hn=()=>{Q(null)},Go=()=>{U&&(ie(U.name),te(!0))},Qo=()=>{if(!U||!me.trim())return;const D={...U,name:me.trim()};if(Q(D),U.type==="user"){const q=z.map(he=>he.id===U.id?{...he,name:me.trim()}:he);k(q),localStorage.setItem("savedAssistants",JSON.stringify(q))}te(!1),ie("")},Yo=()=>{te(!1),ie("")},va=()=>({name:(U==null?void 0:U.name)||"Default Assistant",type:(U==null?void 0:U.type)||"default",systemPrompt:m,temperature:y,maxTokens:x,originalTemplate:U==null?void 0:U.originalTemplate}),dr=()=>{U&&U.type==="template"&&Q({id:"new_assistant",name:`Custom ${U.name}`,type:"new",originalTemplate:U.name})},wa=D=>{w(D),dr()},A=D=>{S(D),dr()},V=D=>{h(D),dr()},X=D=>{b(D),dr()},le=D=>{N(D),dr()};g.useEffect(()=>{zt(),ce()},[]),g.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:j,configCollapsed:O,sessionsCount:e.length,currentSessionId:t})},[j,O,e.length,t]),g.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(D=>({id:D.id,title:D.title})))},[e]),g.useEffect(()=>{if(d&&!B.find(D=>D.model_name===d)){const D=B[0];D&&p(D.model_name)}},[B,d,p]),g.useEffect(()=>{(async()=>{if(!d||!B.length)return;const q=B.find(Oe=>Oe.model_name===d);if(!q)return;const he=`${window.location.protocol}//${window.location.host}`;if(q.type==="local"&&!q.is_loaded){L(q),W(!0);return}const ke=B.filter(Oe=>Oe.type==="local"&&Oe.is_loaded&&Oe.model_name!==d);for(const Oe of ke)try{(await fetch(`${he}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Oe.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Oe.model_name}`)}catch(st){console.error(`Error auto-unloading model ${Oe.model_name}:`,st)}ke.length>0&&zt()})()},[d,B]);const xe=async()=>{if(I){W(!1),_(I.model_name);try{const D=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${D}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:I.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${I.model_name}`),zt();else{console.error(`❌ Failed to load model: ${I.model_name}`);const he=B.find(ke=>ke.type==="api");he&&p(he.model_name)}}catch(D){console.error("Error loading model:",D);const q=B.find(he=>he.type==="api");q&&p(q.model_name)}finally{_(null),L(null)}}},yt=()=>{W(!1),L(null);const D=B.find(q=>q.type==="api");D&&p(D.model_name)};g.useEffect(()=>{const D=async()=>{const q=`${window.location.protocol}//${window.location.host}`,he=B.filter(ke=>ke.type==="local"&&ke.is_loaded);for(const ke of he)try{await fetch(`${q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ke.model_name})}),console.log(`✅ Cleanup: unloaded ${ke.model_name}`)}catch(Oe){console.error(`Error cleaning up model ${ke.model_name}:`,Oe)}};return()=>{D()}},[B]);const zt=async()=>{try{const D=`${window.location.protocol}//${window.location.host}`,q=await fetch(`${D}/models`);if(q.ok){const he=await q.json();if(P(he.models),he.current_model&&d!==he.current_model)p(he.current_model);else if(!d&&he.models.length>0){const Oe=he.models.find(st=>st.type==="api")||he.models[0];p(Oe.model_name)}}}catch(D){console.error("Failed to fetch models:",D)}};return u.jsxs("div",{className:"h-screen bg-background flex",children:[u.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${j?"w-12":"w-80"} + `,children:u.jsxs("div",{className:"p-4 space-y-4 h-full",children:[u.jsxs("div",{className:`flex items-center ${j?"justify-center":"justify-between"}`,children:[!j&&u.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),u.jsxs("div",{className:"flex gap-1",children:[!j&&u.jsxs(ve,{onClick:i,size:"sm",children:[u.jsx(bs,{className:"h-4 w-4 mr-1"}),"New"]}),u.jsx(ve,{onClick:()=>T(!j),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:j?"Expand Sessions":"Collapse Sessions",children:j?u.jsx(Yp,{className:"h-4 w-4"}):u.jsx(Qp,{className:"h-4 w-4"})})]})]}),j&&u.jsx(ve,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:u.jsx(bs,{className:"h-4 w-4"})}),u.jsxs("div",{className:"space-y-2",children:[!j&&e.map(D=>u.jsxs(Je,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===D.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",D.id,D.title),n(D.id)},children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-sm font-medium truncate",children:D.title}),u.jsx(ve,{size:"sm",variant:"ghost",onClick:q=>{q.stopPropagation(),r(D.id)},className:"h-6 w-6 p-0",children:u.jsx(Xy,{className:"h-3 w-3"})})]}),u.jsxs("div",{className:"text-xs text-muted-foreground",children:[D.messages.length," messages"]})]},D.id)),j&&e.map(D=>u.jsxs(ve,{variant:t===D.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:D.title,onClick:()=>{console.log("Session icon clicked:",D.id,D.title),n(D.id)},children:[u.jsx($o,{className:"h-4 w-4"}),D.messages&&D.messages.length>0&&u.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-500 text-white text-xs rounded-full flex items-center justify-center",children:Math.min(D.messages.length,9)})]},D.id))]})]})}),u.jsx("div",{className:"flex-1 flex flex-col h-full",children:u.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[u.jsx("div",{className:"flex-1 flex flex-col",children:u.jsx(l0,{messages:o.map(D=>({id:D.id,role:D.role,content:D.content,createdAt:new Date(D.timestamp),assistantInfo:D.assistantInfo})),input:l,handleInputChange:D=>s(D.target.value),handleSubmit:async D=>{if(D.preventDefault(),!d||!B.find(ke=>ke.model_name===d))return;const q=va();await a(q,{useRag:v,retrievalCount:E})},isGenerating:f,stop:c,className:"flex-1"})}),u.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${O?"w-12":"w-[480px] xl:w-[520px]"} + `,children:u.jsxs("div",{className:"p-4 space-y-4 h-full",children:[u.jsxs("div",{className:`flex items-center ${O?"justify-center":"justify-between"}`,children:[!O&&u.jsx("h2",{className:"font-semibold",children:"Configuration"}),u.jsx("div",{className:"flex gap-1",children:u.jsx(ve,{onClick:()=>M(!O),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:O?"Expand Configuration":"Collapse Configuration",children:O?u.jsx(Qp,{className:"h-4 w-4"}):u.jsx(Yp,{className:"h-4 w-4"})})})]}),O&&u.jsx(ve,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:u.jsx(kr,{className:"h-4 w-4"})}),u.jsx("div",{className:"space-y-2",children:!O&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:u.jsx(NI,{savedAssistants:z,loadSavedAssistant:Jt,openSaveDialog:pe,presets:Dt,onPresetSelect:Zt,isLoading:f,selectedAssistant:U,createNewAssistant:Li,clearCurrentAssistant:hn,openRenameDialog:Go,systemPrompt:m})}),u.jsxs(zN,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[u.jsxs(kx,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[u.jsxs(Ll,{value:"parameters",className:"flex items-center gap-2",children:[u.jsx(LC,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),u.jsxs(Ll,{value:"instructions",className:"flex items-center gap-2",children:[u.jsx(kr,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),u.jsxs(Ll,{value:"documents",className:"flex items-center gap-2",children:[u.jsx(ea,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),u.jsxs("div",{className:"flex-1 overflow-hidden",children:[u.jsx(Ol,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:u.jsx(CI,{models:B,selectedModel:d,setSelectedModel:p,autoLoadingModel:R,temperature:y,setTemperature:A,maxTokens:x,setMaxTokens:V})}),u.jsx(Ol,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:u.jsx(EI,{systemPrompt:m,setSystemPrompt:wa,isLoading:f})}),u.jsx(Ol,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:u.jsx(jI,{isLoading:f,ragEnabled:v,setRagEnabled:X,retrievalCount:E,setRetrievalCount:le,currentAssistant:U})})]})]})]})})]})})]})}),u.jsx(ru,{open:H,onOpenChange:W,children:u.jsxs(Fl,{children:[u.jsxs(Bl,{children:[u.jsx(Ul,{children:"Load Local Model"}),u.jsxs(Vl,{children:["Loading ",u.jsx("strong",{children:I==null?void 0:I.name})," will use approximately ",u.jsx("strong",{children:I==null?void 0:I.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),u.jsxs($l,{children:[u.jsx(Wl,{onClick:yt,children:"Cancel"}),u.jsx(Hl,{onClick:xe,children:"Load Model"})]})]})}),u.jsx(ru,{open:C,onOpenChange:ne,children:u.jsxs(Fl,{children:[u.jsxs(Bl,{children:[u.jsx(Ul,{children:"Save Assistant"}),u.jsx(Vl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),u.jsxs("div",{className:"py-4",children:[u.jsx(Xe,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),u.jsx("input",{id:"assistant-name",type:"text",value:de,onChange:D=>re(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter a name for your assistant...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&de.trim()&&Ue(),D.key==="Escape"&&nt()}}),u.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[de.length,"/100 characters"]})]}),u.jsxs($l,{children:[u.jsx(Wl,{onClick:nt,children:"Cancel"}),u.jsxs(Hl,{onClick:Ue,disabled:!de.trim(),children:[u.jsx(qy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),u.jsx(ru,{open:G,onOpenChange:te,children:u.jsxs(Fl,{children:[u.jsxs(Bl,{children:[u.jsx(Ul,{children:"Rename Assistant"}),u.jsxs(Vl,{children:['Enter a new name for "',U==null?void 0:U.name,'".']})]}),u.jsxs("div",{className:"py-4",children:[u.jsx(Xe,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),u.jsx("input",{id:"rename-assistant-name",type:"text",value:me,onChange:D=>ie(D.target.value),className:"mt-2 w-full px-3 py-2 text-sm border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"Enter new assistant name...",maxLength:100,autoFocus:!0,onKeyDown:D=>{D.key==="Enter"&&me.trim()&&Qo(),D.key==="Escape"&&Yo()}}),u.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[me.length,"/100 characters"]})]}),u.jsxs($l,{children:[u.jsx(Wl,{onClick:Yo,children:"Cancel"}),u.jsxs(Hl,{onClick:Qo,disabled:!me.trim(),children:[u.jsx(kr,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function TI(){const e=Zs(),[t,n]=g.useState([]),[r,i]=g.useState(!0),[o,l]=g.useState(null);g.useEffect(()=>{s()},[]);const s=async()=>{try{const f=`${window.location.protocol}//${window.location.host}`,d=await fetch(`${f}/models`);if(!d.ok)throw new Error(`Failed to fetch models: ${d.status}`);const p=await d.json();n(p.models)}catch(f){console.error("Error fetching models:",f)}finally{i(!1)}},a=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to load model: ${p.status}`);s()}catch(d){console.error("Error loading model:",d)}finally{l(null)}},c=async f=>{l(f);try{const d=`${window.location.protocol}//${window.location.host}`,p=await fetch(`${d}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:f})});if(!p.ok)throw new Error(`Failed to unload model: ${p.status}`);s()}catch(d){console.error("Error unloading model:",d)}finally{l(null)}};return r?u.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:u.jsx(hc,{className:"h-8 w-8 animate-spin"})}):u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto p-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:u.jsx(ea,{className:"h-5 w-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),u.jsxs(ve,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[u.jsx(Cs,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[u.jsx(Je,{className:"bg-blue-50 border-blue-200",children:u.jsx(mt,{className:"pt-6",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(Yy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),u.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."})]})]})})}),u.jsxs("div",{children:[u.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[u.jsx(ks,{className:"h-5 w-5"}),"API Models",u.jsx(we,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(f=>f.type==="api").map(f=>u.jsx(mh,{model:f,modelLoading:o,onLoad:a,onUnload:c},f.model_name))})]}),u.jsxs("div",{children:[u.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[u.jsx(Qy,{className:"h-5 w-5"}),"Local Models",u.jsx(we,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(f=>f.type==="local").map(f=>u.jsx(mh,{model:f,modelLoading:o,onLoad:a,onUnload:c},f.model_name))})]})]})})]})}function mh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return u.jsxs(Je,{className:"hover:shadow-md transition-shadow",children:[u.jsx(It,{className:"pb-3",children:u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs(Mt,{className:"text-base flex items-center gap-2",children:[i?u.jsx(ks,{className:"h-4 w-4 text-blue-600"}):u.jsx(Qy,{className:"h-4 w-4 text-green-600"}),e.name]}),u.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&u.jsx(iC,{className:"h-5 w-5 text-green-600"})]})}),u.jsxs(mt,{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Size:"}),u.jsx(we,{variant:"outline",className:"text-xs",children:e.size_gb})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),u.jsx(we,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Type:"}),u.jsx(we,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&u.jsxs("div",{className:"flex justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Features:"}),u.jsxs(we,{variant:"outline",className:"text-xs",children:[u.jsx(Zn,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),u.jsx("div",{className:"pt-2",children:l?u.jsxs(ve,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?u.jsx(hc,{className:"h-4 w-4 mr-2 animate-spin"}):u.jsx(Xy,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):u.jsxs(ve,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?u.jsx(hc,{className:"h-4 w-4 mr-2 animate-spin"}):u.jsx(cC,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function _I(){return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:u.jsx("div",{className:"max-w-6xl mx-auto p-6",children:u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:u.jsx(kr,{className:"h-5 w-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),u.jsx("div",{className:"flex-1 p-6",children:u.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"flex items-center gap-2",children:[u.jsx(AC,{className:"h-5 w-5"}),"Server Configuration"]})}),u.jsx(mt,{className:"space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Backend URL"}),u.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),u.jsxs("div",{children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Frontend URL"}),u.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"flex items-center gap-2",children:[u.jsx(gc,{className:"h-5 w-5"}),"Privacy & Security"]})}),u.jsx(mt,{className:"space-y-4",children:u.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[u.jsx(gc,{className:"h-4 w-4 text-green-600"}),u.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),u.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),u.jsxs(Je,{children:[u.jsx(It,{children:u.jsxs(Mt,{className:"flex items-center gap-2",children:[u.jsx(Yy,{className:"h-5 w-5"}),"System Information"]})}),u.jsx(mt,{className:"space-y-4",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Platform"}),u.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[u.jsx(we,{variant:"outline",children:"Local"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),u.jsxs("div",{children:[u.jsx(Xe,{className:"text-sm font-medium",children:"Status"}),u.jsx("div",{className:"mt-1",children:u.jsx(we,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function AI(){return u.jsx(ib,{children:u.jsxs(Xk,{children:[u.jsx(mr,{path:"/",element:u.jsx(iN,{})}),u.jsxs(mr,{path:"/",element:u.jsx(XC,{}),children:[u.jsx(mr,{path:"templates",element:u.jsx(uN,{})}),u.jsx(mr,{path:"playground",element:u.jsx(PI,{})}),u.jsx(mr,{path:"models",element:u.jsx(TI,{})}),u.jsx(mr,{path:"settings",element:u.jsx(_I,{})})]})]})})}yu.createRoot(document.getElementById("root")).render(u.jsx(Vt.StrictMode,{children:u.jsx(AI,{})})); +//# sourceMappingURL=index-928bebf1.js.map