diff --git "a/static/assets/index-ea1ae8fd.js" "b/static/assets/index-ea1ae8fd.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-ea1ae8fd.js" @@ -0,0 +1,357 @@ +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 Wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mh={exports:{}},As={},hh={exports:{}},ie={};/** + * @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"),O1=Symbol.for("react.strict_mode"),L1=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"),Cf=Symbol.iterator;function V1(e){return e===null||typeof e!="object"?null:(e=Cf&&e[Cf]||e["@@iterator"],typeof e=="function"?e:null)}var gh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yh=Object.assign,vh={};function Ci(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||gh}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 xh(){}xh.prototype=Ci.prototype;function Fc(e,t,n){this.props=e,this.context=t,this.refs=vh,this.updater=n||gh}var Bc=Fc.prototype=new xh;Bc.constructor=Fc;yh(Bc,Ci.prototype);Bc.isPureReactComponent=!0;var bf=Array.isArray,wh=Object.prototype.hasOwnProperty,$c={current:null},Sh={key:!0,ref:!0,__self:!0,__source:!0};function kh(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)wh.call(t,r)&&!Sh.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,Y=T[G];if(0>>1;Gi(ge,k))nei(Q,ge)?(T[G]=Q,T[ne]=k,G=ne):(T[G]=ge,T[X]=k,G=X);else if(nei(Q,k))T[G]=Q,T[ne]=k,G=ne;else break e}}return B}function i(T,B){var k=T.sortIndex-B.sortIndex;return k!==0?k:T.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],f=1,d=null,p=3,m=!1,w=!1,g=!1,S=typeof setTimeout=="function"?setTimeout:null,v=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 x(T){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=T)r(u),B.sortIndex=B.expirationTime,t(a,B);else break;B=n(u)}}function C(T){if(g=!1,x(T),!w)if(n(a)!==null)w=!0,O(E);else{var B=n(u);B!==null&&D(C,B.startTime-T)}}function E(T,B){w=!1,g&&(g=!1,v(_),_=-1),m=!0;var k=p;try{for(x(B),d=n(a);d!==null&&(!(d.expirationTime>B)||T&&!A());){var G=d.callback;if(typeof G=="function"){d.callback=null,p=d.priorityLevel;var Y=G(d.expirationTime<=B);B=e.unstable_now(),typeof Y=="function"?d.callback=Y:d===n(a)&&r(a),x(B)}else r(a);d=n(a)}if(d!==null)var b=!0;else{var X=n(u);X!==null&&D(C,X.startTime-B),b=!1}return b}finally{d=null,p=k,m=!1}}var N=!1,j=null,_=-1,F=5,M=-1;function A(){return!(e.unstable_now()-MT||125G?(T.sortIndex=k,t(u,T),n(a)===null&&T===n(u)&&(g?(v(_),_=-1):g=!0,D(C,k-G))):(T.sortIndex=Y,t(a,T),w||m||(w=!0,O(E))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var B=p;return function(){var k=p;p=B;try{return T.apply(this,arguments)}finally{p=k}}}})(jh);Eh.exports=jh;var ew=Eh.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=y,kt=ew;function z(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"),hu=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]*$/,Ef={},jf={};function rw(e){return hu.call(jf,e)?!0:hu.call(Ef,e)?!1:nw.test(e)?jf[e]=!0:(Ef[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 nt(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 He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new nt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new nt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new nt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new nt(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){He[e]=new nt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new nt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new nt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new nt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new nt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hc=/[\-:]([a-z])/g;function Wc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Hc,Wc);He[t]=new nt(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(Hc,Wc);He[t]=new nt(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(Hc,Wc);He[t]=new nt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new nt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Kc(e,t,n,r){var i=He.hasOwnProperty(t)?He[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{wa=!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=Sa(e.type,!1),e;case 11:return e=Sa(e.type.render,!1),e;case 1:return e=Sa(e.type,!0),e;default:return""}}function xu(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 $r:return"Fragment";case Br:return"Portal";case gu:return"Profiler";case Gc:return"StrictMode";case yu:return"Suspense";case vu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _h:return(e.displayName||"Context")+".Consumer";case Th:return(e._context.displayName||"Context")+".Provider";case Qc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yc:return t=e.displayName||null,t!==null?t:xu(e.type)||"Memo";case _n:t=e._payload,e=e._init;try{return xu(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 xu(t);case 8:return t===Gc?"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 Qn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aw(e){var t=Rh(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 Qo(e){e._valueTracker||(e._valueTracker=aw(e))}function Ih(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Rh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kl(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 wu(e,t){var n=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qn(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 Mh(e,t){t=t.checked,t!=null&&Kc(e,"checked",t,!1)}function Su(e,t){Mh(e,t);var n=Qn(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")?ku(e,t.type,n):t.hasOwnProperty("defaultValue")&&ku(e,t.type,Qn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _f(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 ku(e,t,n){(t!=="number"||Kl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yi=Array.isArray;function Zr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Yo.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 zh(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 Fh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=zh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var cw=Pe({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 Nu(e,t){if(t){if(cw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function Eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ju=null;function qc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pu=null,ei=null,ti=null;function If(e){if(e=Do(e)){if(typeof Pu!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Ls(t),Pu(e.stateNode,e.type,t))}}function Bh(e){ei?ti?ti.push(e):ti=[e]:ei=e}function $h(){if(ei){var e=ei,t=ti;if(ti=ei=null,If(e),t)for(e=0;e>>=0,e===0?32:31-(Sw(e)/kw|0)|0}var qo=64,Xo=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 ql(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 Oo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$t(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),Uf=String.fromCharCode(32),Vf=!1;function sg(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 ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ur=!1;function nS(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(Vf=!0,Uf);case"textInput":return e=t.data,e===Uf&&Vf?null:e;default:return null}}function rS(e,t){if(Ur)return e==="compositionend"||!id&&sg(e,t)?(e=og(),kl=td=Mn=null,Ur=!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=Gf(n)}}function fg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pg(){for(var e=window,t=Kl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kl(e.document)}return t}function od(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=pg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fg(n.ownerDocument.documentElement,n)){if(r!==null&&od(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,Vr=null,Mu=null,ro=null,Ou=!1;function Yf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ou||Vr==null||Vr!==Kl(r)||(r=Vr,"selectionStart"in r&&od(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&&xo(ro,r)||(ro=r,r=Zl(Mu,"onSelect"),0Kr||(e.current=$u[Kr],$u[Kr]=null,Kr--)}function xe(e,t){Kr++,$u[Kr]=e.current,e.current=t}var Yn={},qe=er(Yn),st=er(!1),yr=Yn;function pi(e,t){var n=e.type.contextTypes;if(!n)return Yn;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 at(e){return e=e.childContextTypes,e!=null}function ts(){be(st),be(qe)}function np(e,t,n){if(qe.current!==Yn)throw Error(z(168));xe(qe,t),xe(st,n)}function kg(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(z(108,sw(e)||"Unknown",i));return Pe({},n,r)}function ns(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yn,yr=qe.current,xe(qe,e),xe(st,st.current),!0}function rp(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=kg(e,t,yr),r.__reactInternalMemoizedMergedChildContext=e,be(st),be(qe),xe(qe,e)):be(st),xe(st,n)}var mn=null,Ds=!1,Oa=!1;function Cg(e){mn===null?mn=[e]:mn.push(e)}function bS(e){Ds=!0,Cg(e)}function tr(){if(!Oa&&mn!==null){Oa=!0;var e=0,t=he;try{var n=mn;for(he=1;e>=l,i-=l,hn=1<<32-$t(t)+i|n<_?(F=j,j=null):F=j.sibling;var M=p(v,j,x[_],C);if(M===null){j===null&&(j=F);break}e&&j&&M.alternate===null&&t(v,j),h=o(M,h,_),N===null?E=M:N.sibling=M,N=M,j=F}if(_===x.length)return n(v,j),Ne&&sr(v,_),E;if(j===null){for(;__?(F=j,j=null):F=j.sibling;var A=p(v,j,M.value,C);if(A===null){j===null&&(j=F);break}e&&j&&A.alternate===null&&t(v,j),h=o(A,h,_),N===null?E=A:N.sibling=A,N=A,j=F}if(M.done)return n(v,j),Ne&&sr(v,_),E;if(j===null){for(;!M.done;_++,M=x.next())M=d(v,M.value,C),M!==null&&(h=o(M,h,_),N===null?E=M:N.sibling=M,N=M);return Ne&&sr(v,_),E}for(j=r(v,j);!M.done;_++,M=x.next())M=m(j,v,_,M.value,C),M!==null&&(e&&M.alternate!==null&&j.delete(M.key===null?_:M.key),h=o(M,h,_),N===null?E=M:N.sibling=M,N=M);return e&&j.forEach(function(R){return t(v,R)}),Ne&&sr(v,_),E}function S(v,h,x,C){if(typeof x=="object"&&x!==null&&x.type===$r&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Go:e:{for(var E=x.key,N=h;N!==null;){if(N.key===E){if(E=x.type,E===$r){if(N.tag===7){n(v,N.sibling),h=i(N,x.props.children),h.return=v,v=h;break e}}else if(N.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_n&&lp(E)===N.type){n(v,N.sibling),h=i(N,x.props),h.ref=$i(v,N,x),h.return=v,v=h;break e}n(v,N);break}else t(v,N);N=N.sibling}x.type===$r?(h=hr(x.props.children,v.mode,C,x.key),h.return=v,v=h):(C=_l(x.type,x.key,x.props,null,v.mode,C),C.ref=$i(v,h,x),C.return=v,v=C)}return l(v);case Br:e:{for(N=x.key;h!==null;){if(h.key===N)if(h.tag===4&&h.stateNode.containerInfo===x.containerInfo&&h.stateNode.implementation===x.implementation){n(v,h.sibling),h=i(h,x.children||[]),h.return=v,v=h;break e}else{n(v,h);break}else t(v,h);h=h.sibling}h=Va(x,v.mode,C),h.return=v,v=h}return l(v);case _n:return N=x._init,S(v,h,N(x._payload),C)}if(Yi(x))return w(v,h,x,C);if(Li(x))return g(v,h,x,C);il(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,h!==null&&h.tag===6?(n(v,h.sibling),h=i(h,x),h.return=v,v=h):(n(v,h),h=Ua(x,v.mode,C),h.return=v,v=h),l(v)):n(v,h)}return S}var hi=jg(!0),Pg=jg(!1),os=er(null),ls=null,Yr=null,ud=null;function cd(){ud=Yr=ls=null}function dd(e){var t=os.current;be(os),e._currentValue=t}function Hu(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 ri(e,t){ls=e,ud=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function At(e){var t=e._currentValue;if(ud!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(ls===null)throw Error(z(308));Yr=e,ls.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var dr=null;function fd(e){dr===null?dr=[e]:dr.push(e)}function Tg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,fd(t)):(n.next=i.next,i.next=n),t.interleaved=n,wn(e,r)}function wn(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 An=!1;function pd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _g(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 yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Un(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,wn(e,n)}return i=r.interleaved,i===null?(t.next=t,fd(r)):(t.next=i.next,i.next=t),r.interleaved=t,wn(e,n)}function bl(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,Jc(e,n)}}function sp(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 ss(e,t,n,r){var i=e.updateQueue;An=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,f=u=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,g=s;switch(p=t,m=n,g.tag){case 1:if(w=g.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=g.payload,p=typeof w=="function"?w.call(m,d,p):w,p==null)break e;d=Pe({},d,p);break e;case 2:An=!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?(u=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=u,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);wr|=l,e.lanes=l,e.memoizedState=d}}function ap(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Da.transition;Da.transition={};try{e(!1),t()}finally{he=n,Da.transition=r}}function Gg(){return Rt().memoizedState}function PS(e,t,n){var r=Hn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qg(e))Yg(t,n);else if(n=Tg(e,t,n,r),n!==null){var i=et();Ut(n,e,r,i),qg(n,t,r)}}function TS(e,t,n){var r=Hn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qg(e))Yg(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,Vt(s,l)){var a=t.interleaved;a===null?(i.next=i,fd(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Tg(e,t,i,r),n!==null&&(i=et(),Ut(n,e,r,i),qg(n,t,r))}}function Qg(e){var t=e.alternate;return e===je||t!==null&&t===je}function Yg(e,t){io=us=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jc(e,n)}}var cs={readContext:At,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},_S={readContext:At,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:cp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,El(4194308,4,Ug.bind(null,t,e),n)},useLayoutEffect:function(e,t){return El(4194308,4,e,t)},useInsertionEffect:function(e,t){return El(4,2,e,t)},useMemo:function(e,t){var n=Xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xt();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,je,e),[r.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:up,useDebugValue:Sd,useDeferredValue:function(e){return Xt().memoizedState=e},useTransition:function(){var e=up(!1),t=e[0];return e=jS.bind(null,e[1]),Xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=Xt();if(Ne){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Be===null)throw Error(z(349));xr&30||Mg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,cp(Lg.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=Xt(),t=Be.identifierPrefix;if(Ne){var n=gn,r=hn;n=(r&~(1<<32-$t(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[Zt]=t,e[ko]=r,ly(e,t,!1,!1),t.stateNode=e;e:{switch(l=Eu(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),i=r;break;case"iframe":case"object":case"embed":Ce("load",e),i=r;break;case"video":case"audio":for(i=0;ivi&&(t.flags|=128,r=!0,Ui(o,!1),t.lanes=4194304)}else{if(!r)if(e=as(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&&!Ne)return Ke(t),null}else 2*Re()-o.renderingStartTime>vi&&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=Re(),t.sibling=null,n=Ee.current,xe(Ee,r?n&1|2:n&1),t):(Ke(t),null);case 22:case 23:return jd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function zS(e,t){switch(sd(t),t.tag){case 1:return at(t.type)&&ts(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return gi(),be(st),be(qe),gd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return hd(t),null;case 13:if(be(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return be(Ee),null;case 4:return gi(),null;case 10:return dd(t.type._context),null;case 22:case 23:return jd(),null;case 24:return null;default:return null}}var ll=!1,Ge=!1,FS=typeof WeakSet=="function"?WeakSet:Set,W=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Zu(e,t,n){try{n()}catch(r){Te(e,t,r)}}var Sp=!1;function BS(e,t){if(Lu=Xl,e=pg(),od(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,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&&++u===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(Du={focusedElem:e,selectionRange:n},Xl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,S=w.memoizedState,v=t.stateNode,h=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Dt(t.type,g),S);v.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(C){Te(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return w=Sp,Sp=!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&&Zu(t,n,o)}i=i.next}while(i!==r)}}function Bs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ec(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 uy(e){var t=e.alternate;t!==null&&(e.alternate=null,uy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[ko],delete t[Bu],delete t[kS],delete t[CS])),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 cy(e){return e.tag===5||e.tag===3||e.tag===4}function kp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cy(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 tc(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=es));else if(r!==4&&(e=e.child,e!==null))for(tc(e,t,n),e=e.sibling;e!==null;)tc(e,t,n),e=e.sibling}function nc(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(nc(e,t,n),e=e.sibling;e!==null;)nc(e,t,n),e=e.sibling}var Ue=null,Ft=!1;function En(e,t,n){for(n=n.child;n!==null;)dy(e,t,n),n=n.sibling}function dy(e,t,n){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(Rs,n)}catch{}switch(n.tag){case 5:Ge||qr(n,t);case 6:var r=Ue,i=Ft;Ue=null,En(e,t,n),Ue=r,Ft=i,Ue!==null&&(Ft?(e=Ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ue.removeChild(n.stateNode));break;case 18:Ue!==null&&(Ft?(e=Ue,n=n.stateNode,e.nodeType===8?Ma(e.parentNode,n):e.nodeType===1&&Ma(e,n),yo(e)):Ma(Ue,n.stateNode));break;case 4:r=Ue,i=Ft,Ue=n.stateNode.containerInfo,Ft=!0,En(e,t,n),Ue=r,Ft=i;break;case 0:case 11:case 14:case 15:if(!Ge&&(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)&&Zu(n,t,l),i=i.next}while(i!==r)}En(e,t,n);break;case 1:if(!Ge&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Te(n,t,s)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?(Ge=(r=Ge)||n.memoizedState!==null,En(e,t,n),Ge=r):En(e,t,n);break;default:En(e,t,n)}}function Cp(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 Mt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*US(r/1960))-r,10e?16:e,On===null)var r=!1;else{if(e=On,On=null,ps=0,de&6)throw Error(z(331));var i=de;for(de|=4,W=e.current;W!==null;){var o=W,l=o.child;if(W.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aRe()-Nd?mr(e,0):bd|=n),ut(e,t)}function xy(e,t){t===0&&(e.mode&1?(t=Xo,Xo<<=1,!(Xo&130023424)&&(Xo=4194304)):t=1);var n=et();e=wn(e,t),e!==null&&(Oo(e,t,n),ut(e,n))}function QS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xy(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(z(314))}r!==null&&r.delete(t),xy(e,n)}var wy;wy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||st.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,LS(e,t,n);lt=!!(e.flags&131072)}else lt=!1,Ne&&t.flags&1048576&&bg(t,is,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;jl(e,t),e=t.pendingProps;var i=pi(t,qe.current);ri(t,n),i=vd(null,t,r,e,i,n);var o=xd();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,at(r)?(o=!0,ns(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,pd(t),i.updater=Fs,t.stateNode=i,i._reactInternals=t,Ku(t,r,e,n),t=Yu(null,t,r,!0,o,n)):(t.tag=0,Ne&&o&&ld(t),Ze(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(jl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=XS(r),e=Dt(r,e),i){case 0:t=Qu(null,t,r,e,n);break e;case 1:t=vp(null,t,r,e,n);break e;case 11:t=gp(null,t,r,e,n);break e;case 14:t=yp(null,t,r,Dt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),Qu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),vp(e,t,r,i,n);case 3:e:{if(ry(t),e===null)throw Error(z(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_g(e,t),ss(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=yi(Error(z(423)),t),t=xp(e,t,r,n,i);break e}else if(r!==i){i=yi(Error(z(424)),t),t=xp(e,t,r,n,i);break e}else for(vt=$n(t.stateNode.containerInfo.firstChild),wt=t,Ne=!0,Bt=null,n=Pg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mi(),r===i){t=Sn(e,t,n);break e}Ze(e,t,r,n)}t=t.child}return t;case 5:return Ag(t),e===null&&Vu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,zu(r,i)?l=null:o!==null&&zu(r,o)&&(t.flags|=32),ny(e,t),Ze(e,t,l,n),t.child;case 6:return e===null&&Vu(t),null;case 13:return iy(e,t,n);case 4:return md(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hi(t,null,r,n):Ze(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),gp(e,t,r,i,n);case 7:return Ze(e,t,t.pendingProps,n),t.child;case 8:return Ze(e,t,t.pendingProps.children,n),t.child;case 12:return Ze(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,xe(os,r._currentValue),r._currentValue=l,o!==null)if(Vt(o.value,l)){if(o.children===i.children&&!st.current){t=Sn(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=yn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Hu(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(z(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Hu(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}Ze(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ri(t,n),i=At(i),r=r(i),t.flags|=1,Ze(e,t,r,n),t.child;case 14:return r=t.type,i=Dt(r,t.pendingProps),i=Dt(r.type,i),yp(e,t,r,i,n);case 15:return ey(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Dt(r,i),jl(e,t),t.tag=1,at(r)?(e=!0,ns(t)):e=!1,ri(t,n),Xg(t,r,i),Ku(t,r,i,n),Yu(null,t,r,!0,e,n);case 19:return oy(e,t,n);case 22:return ty(e,t,n)}throw Error(z(156,t.tag))};function Sy(e,t){return Qh(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 Tt(e,t,n,r){return new qS(e,t,n,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XS(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qc)return 11;if(e===Yc)return 14}return 2}function Wn(e,t){var n=e.alternate;return n===null?(n=Tt(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 _l(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Td(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case $r:return hr(n.children,i,o,t);case Gc:l=8,i|=8;break;case gu:return e=Tt(12,n,t,i|2),e.elementType=gu,e.lanes=o,e;case yu:return e=Tt(13,n,t,i),e.elementType=yu,e.lanes=o,e;case vu:return e=Tt(19,n,t,i),e.elementType=vu,e.lanes=o,e;case Ah:return Us(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Th:l=10;break e;case _h:l=9;break e;case Qc:l=11;break e;case Yc:l=14;break e;case _n:l=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Tt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function hr(e,t,n,r){return e=Tt(7,e,r,t),e.lanes=n,e}function Us(e,t,n,r){return e=Tt(22,e,r,t),e.elementType=Ah,e.lanes=n,e.stateNode={isHidden:!1},e}function Ua(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function Va(e,t,n){return t=Tt(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=Ca(0),this.expirationTimes=Ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ca(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _d(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=Tt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},pd(o),e}function ZS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ny)}catch(e){console.error(e)}}Ny(),Nh.exports=Ct;var Ei=Nh.exports;const ik=_s(Ei);var Ap=Ei;mu.createRoot=Ap.createRoot,mu.hydrateRoot=Ap.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 Ey(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 Ip(e,t){return{usr:e.state,key:e.key,idx:t}}function sc(e,t,n,r){return n===void 0&&(n=null),To({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ji(t):t,{state:n,key:t&&t.key||r||lk()})}function gs(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 ji(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=Ln.Pop,a=null,u=f();u==null&&(u=0,l.replaceState(To({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Ln.Pop;let S=f(),v=S==null?null:S-u;u=S,a&&a({action:s,location:g.location,delta:v})}function p(S,v){s=Ln.Push;let h=sc(g.location,S,v);n&&n(h,S),u=f()+1;let x=Ip(h,u),C=g.createHref(h);try{l.pushState(x,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(C)}o&&a&&a({action:s,location:g.location,delta:1})}function m(S,v){s=Ln.Replace;let h=sc(g.location,S,v);n&&n(h,S),u=f();let x=Ip(h,u),C=g.createHref(h);l.replaceState(x,"",C),o&&a&&a({action:s,location:g.location,delta:0})}function w(S){let v=i.location.origin!=="null"?i.location.origin:i.location.href,h=typeof S=="string"?S:gs(S);return h=h.replace(/ $/,"%20"),Oe(v,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,v)}let g={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(Rp,d),a=S,()=>{i.removeEventListener(Rp,d),a=null}},createHref(S){return t(i,S)},createURL:w,encodeLocation(S){let v=w(S);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(S){return l.go(S)}};return g}var Mp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mp||(Mp={}));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"?ji(t):t,o=Md(i.pathname||"/",n);if(o==null)return null;let l=jy(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("/")&&(Oe(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Kn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Oe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),jy(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:yk(u,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 Py(o.path))i(o,l,a)}),t}function Py(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=Py(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:vk(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,Op=e=>e==="*";function yk(e,t){let n=e.split("/"),r=n.length;return n.some(Op)&&(r+=gk),t&&(r+=pk),n.filter(i=>!Op(i)).reduce((i,o)=>i+(dk.test(o)?fk:o===""?mk:hk),r)}function vk(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 xk(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 g=s[d]||"";l=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const w=s[d];return m&&!w?u[p]=void 0:u[p]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function wk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ey(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 Ey(!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 Md(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"?ji(e):e;return{pathname:n?n.startsWith("/")?n:Ck(n,t):t,search:Ek(r),hash:jk(i)}}function Ck(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 Ha(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 bk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ty(e,t){let n=bk(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function _y(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ji(e):(i=To({},e),Oe(!i.pathname||!i.pathname.includes("?"),Ha("?","pathname","search",i)),Oe(!i.pathname||!i.pathname.includes("#"),Ha("#","pathname","hash",i)),Oe(!i.search||!i.search.includes("#"),Ha("#","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),u=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Kn=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 Ay=["post","put","patch","delete"];new Set(Ay);const Tk=["get",...Ay];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}),y.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){r.go(u);return}let d=_y(u,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Kn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const Ik=y.createContext(null);function Mk(e){let t=y.useContext(nr).outlet;return t&&y.createElement(Ik.Provider,{value:e},t)}function My(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Pr),{matches:i}=y.useContext(nr),{pathname:o}=Bo(),l=JSON.stringify(Ty(i,r.v7_relativeSplatPath));return y.useMemo(()=>_y(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function Ok(e,t){return Lk(e,t)}function Lk(e,t,n,r){Fo()||Oe(!1);let{navigator:i}=y.useContext(Pr),{matches:o}=y.useContext(nr),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Bo(),f;if(t){var d;let S=typeof t=="string"?ji(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Oe(!1),f=S}else f=u;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}),g=$k(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Kn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Kn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&g?y.createElement(Gs.Provider,{value:{location:_o({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Ln.Pop}},g):g}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 y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,o)}const zk=y.createElement(Dk,null);class Fk extends y.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?y.createElement(nr.Provider,{value:this.props.routeContext},y.createElement(Ry.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bk(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(Od);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(nr.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||Oe(!1),l=l.slice(0,Math.min(l.length,f+1))}let a=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((f,d,p)=>{let m,w=!1,g=null,S=null;n&&(m=s&&d.route.id?s[d.route.id]:void 0,g=d.route.errorElement||zk,a&&(u<0&&p===0?(Gk("route-fallback",!1),w=!0,S=null):u===p&&(w=!0,S=d.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,p+1)),h=()=>{let x;return m?x=g:w?x=S:d.route.Component?x=y.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,y.createElement(Bk,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?y.createElement(Fk,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):h()},null)}var Oy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Oy||{}),ys=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}(ys||{});function Uk(e){let t=y.useContext(Od);return t||Oe(!1),t}function Vk(e){let t=y.useContext(_k);return t||Oe(!1),t}function Hk(e){let t=y.useContext(nr);return t||Oe(!1),t}function Ly(e){let t=Hk(),n=t.matches[t.matches.length-1];return n.route.id||Oe(!1),n.route.id}function Wk(){var e;let t=y.useContext(Ry),n=Vk(ys.UseRouteError),r=Ly(ys.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Kk(){let{router:e}=Uk(Oy.UseNavigateStable),t=Ly(ys.UseNavigateStable),n=y.useRef(!1);return Iy(()=>{n.current=!0}),y.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 Dp={};function Gk(e,t,n){!t&&!Dp[e]&&(Dp[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 Fr(e){Oe(!1)}function qk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ln.Pop,navigator:o,static:l=!1,future:s}=e;Fo()&&Oe(!1);let a=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:a,navigator:o,static:l,future:_o({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=ji(r));let{pathname:f="/",search:d="",hash:p="",state:m=null,key:w="default"}=r,g=y.useMemo(()=>{let S=Md(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 g==null?null:y.createElement(Pr.Provider,{value:u},y.createElement(Gs.Provider,{children:n,value:g}))}function Xk(e){let{children:t,location:n}=e;return Ok(ac(t),n)}new Promise(()=>{});function ac(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let o=[...t,i];if(r.type===y.Fragment){n.push.apply(n,ac(r.props.children,o));return}r.type!==Fr&&Oe(!1),!r.props.index||!r.props.children||Oe(!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=ac(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 uc(){return uc=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 eC(e,t){return e.button===0&&(!t||t==="_self")&&!Zk(e)}const tC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nC="6";try{window.__reactRouterVersion=nC}catch{}const rC="startTransition",zp=Vc[rC];function iC(e){let{basename:t,children:n,future:r,window:i}=e,o=y.useRef();o.current==null&&(o.current=ok({window:i,v5Compat:!0}));let l=o.current,[s,a]=y.useState({action:l.action,location:l.location}),{v7_startTransition:u}=r||{},f=y.useCallback(d=>{u&&zp?zp(()=>a(d)):a(d)},[a,u]);return y.useLayoutEffect(()=>l.listen(f),[l,f]),y.useEffect(()=>Qk(r),[r]),y.createElement(qk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const oC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sC=y.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:l,state:s,target:a,to:u,preventScrollReset:f,viewTransition:d}=t,p=Jk(t,tC),{basename:m}=y.useContext(Pr),w,g=!1;if(typeof u=="string"&&lC.test(u)&&(w=u,oC))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),E=Md(C.pathname,m);C.origin===x.origin&&E!=null?u=E+C.search+C.hash:g=!0}catch{}let S=Ak(u,{relative:i}),v=aC(u,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function h(x){r&&r(x),x.defaultPrevented||v(x)}return y.createElement("a",uc({},p,{href:w||S,onClick:g||o?r:h,ref:n,target:a}))});var Fp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Fp||(Fp={}));var Bp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Bp||(Bp={}));function aC(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=Ld(),u=Bo(),f=My(e,{relative:l});return y.useCallback(d=>{if(eC(d,n)){d.preventDefault();let p=r!==void 0?r:gs(u)===gs(f);a(e,{replace:p,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,f,r,i,n,e,o,l,s])}function Dy(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 $y="!";function gC(e){var t=e.separator||":",n=t.length===1,r=t[0],i=t.length;return function(l){for(var s=[],a=0,u=0,f,d=0;du?f-u:void 0;return{modifiers:s,hasImportantModifier:w,baseClassName:g,maybePostfixModifierPosition:S}}}function yC(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 vC(e){return{cache:hC(e.cacheSize),splitModifiers:gC(e),...cC(e)}}var xC=/\s+/;function wC(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(xC).map(function(l){var s=n(l),a=s.modifiers,u=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=yC(a).join(":"),g=u?w+$y:w;return{isTailwindClass:!0,modifierId:g,classGroupId:p,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,f=s+a;return o.has(f)?!1:(o.add(f),i(a,u).forEach(function(d){return o.add(s+d)}),!0)}).reverse().map(function(l){return l.originalClassName}).join(" ")}function SC(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Hp=e=>{const t=zC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Hy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),FC=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 BC={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 $C=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...s},a)=>y.createElement("svg",{ref:a,...BC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Hy("lucide",i),...!o&&!FC(s)&&{"aria-hidden":"true"},...s},[...l.map(([u,f])=>y.createElement(u,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 te=(e,t)=>{const n=y.forwardRef(({className:r,...i},o)=>y.createElement($C,{ref:o,iconNode:t,className:Hy(`lucide-${DC(Hp(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Hp(e),n};/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const UC=[["path",{d:"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"}]],VC=te("award",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:"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"}]],zd=te("book-open",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:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],KC=te("bookmark",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:"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"}]],Jr=te("bot",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:"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"}]],xi=te("brain",QC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qC=te("check",YC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Wy=te("chevron-down",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 JC=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Wp=te("chevron-left",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 ZC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Kp=te("chevron-right",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 eb=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],tb=te("chevron-up",eb);/** + * @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 nb=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rb=te("circle-check-big",nb);/** + * @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 ib=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],vs=te("cloud",ib);/** + * @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 ob=[["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"}]],Ky=te("crown",ob);/** + * @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 lb=[["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"}]],sb=te("download",lb);/** + * @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 ab=[["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"}]],ub=te("eye",ab);/** + * @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 cb=[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],db=te("file-text",cb);/** + * @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 fb=[["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"}]],pb=te("file",fb);/** + * @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 mb=[["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"}]],Gy=te("hard-drive",mb);/** + * @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 hb=[["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"}]],gb=te("heart",hb);/** + * @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:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],vb=te("house",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 xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Qy=te("info",xb);/** + * @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:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fc=te("loader-circle",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 Sb=[["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"}]],Qs=te("message-square",Sb);/** + * @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:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xs=te("plus",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 Cb=[["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"}]],Yy=te("save",Cb);/** + * @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=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Gp=te("search",bb);/** + * @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 Nb=[["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"}]],Eb=te("send",Nb);/** + * @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=[["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"}]],Pb=te("server",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 Tb=[["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"}]],oi=te("settings",Tb);/** + * @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:"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"}]],Qp=te("shield",_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 Ab=[["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"}]],Rb=te("sliders-vertical",Ab);/** + * @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 Ib=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Mb=te("square",Ib);/** + * @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 Ob=[["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"}]],Lb=te("star",Ob);/** + * @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 Db=[["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"}]],qy=te("trash-2",Db);/** + * @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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Xy=te("trending-up",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 Fb=[["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"}]],Yp=te("upload",Fb);/** + * @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=[["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"}]],Jy=te("user",Bb);/** + * @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:"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"}]],Ub=te("users",$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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zy=te("x",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 Hb=[["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"}]],pc=te("zap",Hb),Wb=[{name:"Templates",href:"/",icon:vb,description:"Browse assistant templates and examples"},{name:"Assistant Studio",href:"/playground",icon:Qs,description:"Build, test and refine your AI assistants"},{name:"Model Catalog",href:"/models",icon:zd,description:"Browse and manage AI models"},{name:"Settings",href:"/settings",icon:oi,description:"Application settings"}];function Kb(){const e=Bo();return c.jsxs("div",{className:"flex h-full flex-col bg-background border-r",children:[c.jsx("div",{className:"p-6 border-b",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:c.jsx(xi,{className:"h-5 w-5 text-primary-foreground"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-lg",children:"Edge LLM"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Local AI Platform"})]})]})}),c.jsx("div",{className:"flex-1 px-3 py-4 space-y-8",children:c.jsxs("div",{children:[c.jsx("h2",{className:"mb-2 px-3 text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Get started"}),c.jsx("nav",{className:"space-y-1",children:Wb.map(t=>{const n=e.pathname===t.href;return c.jsxs(sC,{to:t.href,className:ae("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:[c.jsx(t.icon,{className:"h-4 w-4"}),c.jsx("div",{className:"flex-1",children:t.name})]},t.name)})})]})})]})}function Gb(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(Kb,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(Yk,{})})]})}const qp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Xp=zy,Fd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Xp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],d=o==null?void 0:o[u];if(f===null)return null;const p=qp(f)||qp(d);return i[u][p]}),s=n&&Object.entries(n).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(w=>{let[g,S]=w;return Array.isArray(S)?S.includes({...o,...s}[g]):{...o,...s}[g]===S})?[...u,d,p]:u},[]);return Xp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Qb=Fd("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 me({className:e,variant:t,...n}){return c.jsx("div",{className:ae(Qb({variant:t}),e),...n})}function Jp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ev(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Jp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{children:o,...l}=r,s=y.Children.toArray(o),a=s.find(Jb);if(a){const u=a.props.children,f=s.map(d=>d===a?y.Children.count(u)>1?y.Children.only(null):y.isValidElement(u)?u.props.children:null:d);return c.jsx(t,{...l,ref:i,children:y.isValidElement(u)?y.cloneElement(u,void 0,f):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Yb=wi("Slot");function qb(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const l=eN(i),s=Zb(o,i.props);return i.type!==y.Fragment&&(s.ref=r?ev(r,l):l),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tv=Symbol("radix.slottable");function Xb(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=tv,t}function Jb(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tv}function Zb(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 eN(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 Bd=Fd("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"}}),Ae=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?Yb:"button";return c.jsx(l,{className:ae(Bd({variant:t,size:n,className:e})),ref:o,...i})});Ae.displayName="Button";const Fe=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ae("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Fe.displayName="Card";const ct=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ae("flex flex-col space-y-1.5 p-6",e),...t}));ct.displayName="CardHeader";const dt=y.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ae("text-2xl font-semibold leading-none tracking-tight",e),...t}));dt.displayName="CardTitle";const tN=y.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));tN.displayName="CardDescription";const Qe=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ae("p-6 pt-0",e),...t}));Qe.displayName="CardContent";const nN=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ae("flex items-center p-6 pt-0",e),...t}));nN.displayName="CardFooter";const nv=y.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ae("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}));nv.displayName="Input";function rN(){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 iN(){const e=Ld(),[t,n]=y.useState(!1),[r]=y.useState(rN()),[i,o]=y.useState([]),[l,s]=y.useState(""),[a,u]=y.useState("All");y.useEffect(()=>{f(),d()},[]);const f=async()=>{try{const h=`${window.location.protocol}//${window.location.host}`,x=await fetch(`${h}/models`);n(x.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 x=i.includes(h)?i.filter(C=>C!==h):[...i,h];o(x),localStorage.setItem("likedTemplates",JSON.stringify(x))},m=h=>{const x={name:h.name,description:h.description,model:h.model,systemPrompt:h.systemPrompt,temperature:h.temperature,maxTokens:h.maxTokens};localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),e("/playground")},w=r.filter(h=>{const x=h.name.toLowerCase().includes(l.toLowerCase())||h.description.toLowerCase().includes(l.toLowerCase())||h.tags.some(E=>E.toLowerCase().includes(l.toLowerCase())),C=a==="All"||h.category===a;return x&&C}),g=w.filter(h=>h.isOfficial),S=[...w].sort((h,x)=>x.usageCount-h.usageCount).slice(0,6),v=["All",...Array.from(new Set(r.map(h=>h.category)))];return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"sticky top-0 z-40 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto px-6 py-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(xi,{className:"h-5 w-5 text-white"})}),c.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"Assistant Templates"}),c.jsx(me,{variant:t?"default":"secondary",className:"text-xs",children:t?"Online":"Offline"})]})}),c.jsxs(Ae,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[c.jsx(Jr,{className:"h-4 w-4"}),"Create Assistant"]})]})})}),c.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Explore AI Assistants"}),c.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."}),c.jsxs("div",{className:"relative max-w-2xl mx-auto mb-8",children:[c.jsx(Gp,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),c.jsx(nv,{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"})]}),c.jsx("div",{className:"flex flex-wrap justify-center gap-2 mb-8",children:v.map(h=>c.jsx(Ae,{variant:a===h?"default":"outline",size:"sm",onClick:()=>u(h),className:"rounded-full",children:h},h))})]}),a==="All"&&g.length>0&&c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(Ky,{className:"h-5 w-5 text-yellow-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured"}),c.jsx(me,{variant:"secondary",className:"text-xs",children:"Curated by EdgeLLM Team"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:g.slice(0,3).map(h=>c.jsx(Wa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),featured:!0},h.id))})]}),a==="All"&&c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(Xy,{className:"h-5 w-5 text-green-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Trending"}),c.jsx(me,{variant:"secondary",className:"text-xs",children:"Most popular this week"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:S.slice(0,6).map(h=>c.jsx(Wa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h),trending:!0},h.id))})]}),c.jsxs("div",{className:"mb-12",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[c.jsx(Ub,{className:"h-5 w-5 text-blue-600"}),c.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:a==="All"?"All Templates":a}),c.jsxs(me,{variant:"outline",className:"text-xs",children:[w.length," available"]})]}),w.length>0?c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:w.map(h=>c.jsx(Wa,{template:h,isLiked:i.includes(h.id),onLike:()=>p(h.id),onUse:()=>m(h)},h.id))}):c.jsx(Fe,{className:"p-12 text-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsx(Gp,{className:"h-12 w-12 text-gray-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No templates found"}),c.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or category filters"})]}),c.jsx(Ae,{variant:"outline",onClick:()=>{s(""),u("All")},children:"Clear filters"})]})})]})]})]})}function Wa({template:e,isLiked:t,onLike:n,onUse:r,featured:i=!1,trending:o=!1}){return c.jsxs(Fe,{className:"group hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border-2 hover:border-blue-200 relative",children:[i&&c.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:[c.jsx(Ky,{className:"h-3 w-3"}),"Featured"]}),o&&c.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:[c.jsx(Xy,{className:"h-3 w-3"}),"Trending"]}),c.jsx(ct,{className:"pb-4",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.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}),c.jsxs("div",{children:[c.jsx(dt,{className:"text-lg group-hover:text-blue-600 transition-colors",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsxs("p",{className:"text-sm text-blue-600 font-medium",children:["by ",e.author]}),e.isOfficial&&c.jsxs(me,{variant:"default",className:"text-xs px-2 py-0 bg-blue-600",children:[c.jsx(VC,{className:"h-3 w-3 mr-1"}),"Official"]})]})]})]}),c.jsx(Ae,{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:c.jsx(gb,{className:`h-4 w-4 ${t?"fill-current":""}`})})]})}),c.jsxs(Qe,{className:"space-y-4",children:[c.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 leading-relaxed",children:e.description}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.slice(0,3).map(l=>c.jsx(me,{variant:"secondary",className:"text-xs bg-gray-100 hover:bg-gray-200 transition-colors",children:l},l))}),c.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(ub,{className:"h-4 w-4"}),c.jsx("span",{children:e.usageCount.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Lb,{className:"h-4 w-4 text-yellow-500 fill-current"}),c.jsx("span",{children:e.rating})]})]}),c.jsx(me,{variant:"outline",className:"text-xs",children:e.category})]}),c.jsx("div",{className:"pt-2",children:c.jsxs(Ae,{onClick:r,className:"w-full group-hover:bg-blue-600 group-hover:text-white transition-all",variant:"outline",children:[c.jsx(Qs,{className:"h-4 w-4 mr-2"}),"Build Assistant"]})})]})]})}function Z(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 oN(e,t){const n=y.createContext(t),r=o=>{const{children:l,...s}=o,a=y.useMemo(()=>s,Object.values(s));return c.jsx(n.Provider,{value:a,children:l})};r.displayName=e+"Provider";function i(o){const l=y.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 rr(e,t=[]){let n=[];function r(o,l){const s=y.createContext(l),a=n.length;n=[...n,l];const u=d=>{var v;const{scope:p,children:m,...w}=d,g=((v=p==null?void 0:p[e])==null?void 0:v[a])||s,S=y.useMemo(()=>w,Object.values(w));return c.jsx(g.Provider,{value:S,children:m})};u.displayName=o+"Provider";function f(d,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[a])||s,w=y.useContext(m);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(l=>y.createContext(l));return function(s){const a=(s==null?void 0:s[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return i.scopeName=e,[r,lN(i,...t)]}function lN(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function $d(e){const t=e+"CollectionProvider",[n,r]=rr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=g=>{const{scope:S,children:v}=g,h=zt.useRef(null),x=zt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:x,collectionRef:h,children:v})};l.displayName=t;const s=e+"CollectionSlot",a=wi(s),u=zt.forwardRef((g,S)=>{const{scope:v,children:h}=g,x=o(s,v),C=pe(S,x.collectionRef);return c.jsx(a,{ref:C,children:h})});u.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=wi(f),m=zt.forwardRef((g,S)=>{const{scope:v,children:h,...x}=g,C=zt.useRef(null),E=pe(S,C),N=o(f,v);return zt.useEffect(()=>(N.itemMap.set(C,{ref:C,...x}),()=>void N.itemMap.delete(C))),c.jsx(p,{[d]:"",ref:E,children:h})});m.displayName=f;function w(g){const S=o(e+"CollectionConsumer",g);return zt.useCallback(()=>{const h=S.collectionRef.current;if(!h)return[];const x=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((N,j)=>x.indexOf(N.ref.current)-x.indexOf(j.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:m},w,r]}var Xe=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},sN=Vc[" useId ".trim().toString()]||(()=>{}),aN=0;function Gn(e){const[t,n]=y.useState(sN());return Xe(()=>{e||n(r=>r??String(aN++))},[e]),e||(t?`radix-${t}`:"")}var uN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=uN.reduce((e,t)=>{const n=wi(`Primitive.${t}`),r=y.forwardRef((i,o)=>{const{asChild:l,...s}=i,a=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cN(e,t){e&&Ei.flushSync(()=>e.dispatchEvent(t))}function qn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var dN=Vc[" useInsertionEffect ".trim().toString()]||Xe;function Si({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=fN({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:i;{const f=y.useRef(e!==void 0);y.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 u=y.useCallback(f=>{var d;if(s){const p=pN(f)?f(e):f;p!==e&&((d=l.current)==null||d.call(l,p))}else o(f)},[s,e,o,l]);return[a,u]}function fN({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),o=y.useRef(t);return dN(()=>{o.current=t},[t]),y.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function pN(e){return typeof e=="function"}var mN=y.createContext(void 0);function Ys(e){const t=y.useContext(mN);return e||t||"ltr"}var Ka="rovingFocusGroup.onEntryFocus",hN={bubbles:!1,cancelable:!0},$o="RovingFocusGroup",[mc,rv,gN]=$d($o),[yN,iv]=rr($o,[gN]),[vN,xN]=yN($o),ov=y.forwardRef((e,t)=>c.jsx(mc.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(mc.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(wN,{...e,ref:t})})}));ov.displayName=$o;var wN=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=y.useRef(null),m=pe(t,p),w=Ys(o),[g,S]=Si({prop:l,defaultProp:s??null,onChange:a,caller:$o}),[v,h]=y.useState(!1),x=qn(u),C=rv(n),E=y.useRef(!1),[N,j]=y.useState(0);return y.useEffect(()=>{const _=p.current;if(_)return _.addEventListener(Ka,x),()=>_.removeEventListener(Ka,x)},[x]),c.jsx(vN,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:g,onItemFocus:y.useCallback(_=>S(_),[S]),onItemShiftTab:y.useCallback(()=>h(!0),[]),onFocusableItemAdd:y.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:y.useCallback(()=>j(_=>_-1),[]),children:c.jsx(re.div,{tabIndex:v||N===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:Z(e.onMouseDown,()=>{E.current=!0}),onFocus:Z(e.onFocus,_=>{const F=!E.current;if(_.target===_.currentTarget&&F&&!v){const M=new CustomEvent(Ka,hN);if(_.currentTarget.dispatchEvent(M),!M.defaultPrevented){const A=C().filter(O=>O.focusable),R=A.find(O=>O.active),U=A.find(O=>O.id===g),L=[R,U,...A].filter(Boolean).map(O=>O.ref.current);av(L,f)}}E.current=!1}),onBlur:Z(e.onBlur,()=>h(!1))})})}),lv="RovingFocusGroupItem",sv=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...s}=e,a=Gn(),u=o||a,f=xN(lv,n),d=f.currentTabStopId===u,p=rv(n),{onFocusableItemAdd:m,onFocusableItemRemove:w,currentTabStopId:g}=f;return y.useEffect(()=>{if(r)return m(),()=>w()},[r,m,w]),c.jsx(mc.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:c.jsx(re.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,S=>{r?f.onItemFocus(u):S.preventDefault()}),onFocus:Z(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:Z(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const v=CN(S,f.orientation,f.dir);if(v!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let x=p().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const C=x.indexOf(S.currentTarget);x=f.loop?bN(x,C+1):x.slice(C+1)}setTimeout(()=>av(x))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:g!=null}):l})})});sv.displayName=lv;var SN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CN(e,t,n){const r=kN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return SN[r]}function av(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var NN=ov,EN=sv;function jN(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Uo=e=>{const{present:t,children:n}=e,r=PN(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=pe(r.ref,TN(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:o}):null};Uo.displayName="Presence";function PN(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[s,a]=jN(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=cl(r.current);o.current=s==="mounted"?u:"none"},[s]),Xe(()=>{const u=r.current,f=i.current;if(f!==e){const p=o.current,m=cl(u);e?a("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),Xe(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const g=cl(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&g&&(a("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=m=>{m.target===t&&(o.current=cl(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function cl(e){return(e==null?void 0:e.animationName)||"none"}function TN(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 qs="Tabs",[_N,jI]=rr(qs,[iv]),uv=iv(),[AN,Ud]=_N(qs),cv=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:s,activationMode:a="automatic",...u}=e,f=Ys(s),[d,p]=Si({prop:r,onChange:i,defaultProp:o??"",caller:qs});return c.jsx(AN,{scope:n,baseId:Gn(),value:d,onValueChange:p,orientation:l,dir:f,activationMode:a,children:c.jsx(re.div,{dir:f,"data-orientation":l,...u,ref:t})})});cv.displayName=qs;var dv="TabsList",fv=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Ud(dv,n),l=uv(n);return c.jsx(NN,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(re.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});fv.displayName=dv;var pv="TabsTrigger",mv=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=Ud(pv,n),s=uv(n),a=yv(l.baseId,r),u=vv(l.baseId,r),f=r===l.value;return c.jsx(EN,{asChild:!0,...s,focusable:!i,active:f,children:c.jsx(re.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:a,...o,ref:t,onMouseDown:Z(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?l.onValueChange(r):d.preventDefault()}),onKeyDown:Z(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&l.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{const d=l.activationMode!=="manual";!f&&!i&&d&&l.onValueChange(r)})})})});mv.displayName=pv;var hv="TabsContent",gv=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,s=Ud(hv,n),a=yv(s.baseId,r),u=vv(s.baseId,r),f=r===s.value,d=y.useRef(f);return y.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(Uo,{present:i||f,children:({present:p})=>c.jsx(re.div,{"data-state":f?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":a,hidden:!p,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&o})})});gv.displayName=hv;function yv(e,t){return`${e}-trigger-${t}`}function vv(e,t){return`${e}-content-${t}`}var RN=cv,xv=fv,wv=mv,Sv=gv;const IN=RN,kv=y.forwardRef(({className:e,...t},n)=>c.jsx(xv,{ref:n,className:ae("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));kv.displayName=xv.displayName;const Al=y.forwardRef(({className:e,...t},n)=>c.jsx(wv,{ref:n,className:ae("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}));Al.displayName=wv.displayName;const Rl=y.forwardRef(({className:e,...t},n)=>c.jsx(Sv,{ref:n,className:ae("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rl.displayName=Sv.displayName;function ws(e,[t,n]){return Math.min(n,Math.max(t,e))}function Cv(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function bv(e){const[t,n]=y.useState(void 0);return Xe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=e.offsetWidth,s=e.offsetHeight;n({width:l,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Nv=["PageUp","PageDown"],Ev=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jv={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Pi="Slider",[hc,MN,ON]=$d(Pi),[Pv,PI]=rr(Pi,[ON]),[LN,Xs]=Pv(Pi),Tv=y.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:s=!1,minStepsBetweenThumbs:a=0,defaultValue:u=[r],value:f,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:w,...g}=e,S=y.useRef(new Set),v=y.useRef(0),x=l==="horizontal"?DN:zN,[C=[],E]=Si({prop:f,defaultProp:u,onChange:A=>{var U;(U=[...S.current][v.current])==null||U.focus(),d(A)}}),N=y.useRef(C);function j(A){const R=VN(C,A);M(A,R)}function _(A){M(A,v.current)}function F(){const A=N.current[v.current];C[v.current]!==A&&p(C)}function M(A,R,{commit:U}={commit:!1}){const H=GN(o),L=QN(Math.round((A-r)/o)*o+r,H),O=ws(L,[r,i]);E((D=[])=>{const T=$N(D,O,R);if(KN(T,a*o)){v.current=T.indexOf(O);const B=String(T)!==String(D);return B&&U&&p(T),B?T:D}else return D})}return c.jsx(LN,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:S.current,values:C,orientation:l,form:w,children:c.jsx(hc.Provider,{scope:e.__scopeSlider,children:c.jsx(hc.Slot,{scope:e.__scopeSlider,children:c.jsx(x,{"aria-disabled":s,"data-disabled":s?"":void 0,...g,ref:t,onPointerDown:Z(g.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:j,onSlideMove:s?void 0:_,onSlideEnd:s?void 0:F,onHomeKeyDown:()=>!s&&M(r,0,{commit:!0}),onEndKeyDown:()=>!s&&M(i,C.length-1,{commit:!0}),onStepKeyDown:({event:A,direction:R})=>{if(!s){const L=Nv.includes(A.key)||A.shiftKey&&Ev.includes(A.key)?10:1,O=v.current,D=C[O],T=o*L*R;M(D+T,O,{commit:!0})}}})})})})});Tv.displayName=Pi;var[_v,Av]=Pv(Pi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),DN=y.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[d,p]=y.useState(null),m=pe(t,x=>p(x)),w=y.useRef(void 0),g=Ys(i),S=g==="ltr",v=S&&!o||!S&&o;function h(x){const C=w.current||d.getBoundingClientRect(),E=[0,C.width],j=Vd(E,v?[n,r]:[r,n]);return w.current=C,j(x-C.left)}return c.jsx(_v,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:c.jsx(Rv,{dir:g,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=h(x.clientX);l==null||l(C)},onSlideMove:x=>{const C=h(x.clientX);s==null||s(C)},onSlideEnd:()=>{w.current=void 0,a==null||a()},onStepKeyDown:x=>{const E=jv[v?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:E?-1:1})}})})}),zN=y.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:s,onStepKeyDown:a,...u}=e,f=y.useRef(null),d=pe(t,f),p=y.useRef(void 0),m=!i;function w(g){const S=p.current||f.current.getBoundingClientRect(),v=[0,S.height],x=Vd(v,m?[r,n]:[n,r]);return p.current=S,x(g-S.top)}return c.jsx(_v,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:c.jsx(Rv,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const S=w(g.clientY);o==null||o(S)},onSlideMove:g=>{const S=w(g.clientY);l==null||l(S)},onSlideEnd:()=>{p.current=void 0,s==null||s()},onStepKeyDown:g=>{const v=jv[m?"from-bottom":"from-top"].includes(g.key);a==null||a({event:g,direction:v?-1:1})}})})}),Rv=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=Xs(Pi,n);return c.jsx(re.span,{...u,ref:t,onKeyDown:Z(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Nv.concat(Ev).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:Z(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(p)?p.focus():r(d)}),onPointerMove:Z(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:Z(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),o(d))})})}),Iv="SliderTrack",Mv=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Xs(Iv,n);return c.jsx(re.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Mv.displayName=Iv;var gc="SliderRange",Ov=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Xs(gc,n),o=Av(gc,n),l=y.useRef(null),s=pe(t,l),a=i.values.length,u=i.values.map(p=>zv(p,i.min,i.max)),f=a>1?Math.min(...u):0,d=100-Math.max(...u);return c.jsx(re.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});Ov.displayName=gc;var yc="SliderThumb",Lv=y.forwardRef((e,t)=>{const n=MN(e.__scopeSlider),[r,i]=y.useState(null),o=pe(t,s=>i(s)),l=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(FN,{...e,ref:o,index:l})}),FN=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Xs(yc,n),s=Av(yc,n),[a,u]=y.useState(null),f=pe(t,h=>u(h)),d=a?l.form||!!a.closest("form"):!0,p=bv(a),m=l.values[r],w=m===void 0?0:zv(m,l.min,l.max),g=UN(r,l.values.length),S=p==null?void 0:p[s.size],v=S?HN(S,w,s.direction):0;return y.useEffect(()=>{if(a)return l.thumbs.add(a),()=>{l.thumbs.delete(a)}},[a,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${w}% + ${v}px)`},children:[c.jsx(hc.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(re.span,{role:"slider","aria-label":e["aria-label"]||g,"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:Z(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&c.jsx(Dv,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:m},r)]})});Lv.displayName=yc;var BN="RadioBubbleInput",Dv=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=y.useRef(null),o=pe(i,r),l=Cv(t);return y.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]),c.jsx(re.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Dv.displayName=BN;function $N(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function zv(e,t,n){const o=100/(n-t)*(e-t);return ws(o,[0,100])}function UN(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function VN(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 HN(e,t,n){const r=e/2,o=Vd([0,50],[0,r]);return(r-o(t)*n)*n}function WN(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function KN(e,t){if(t>0){const n=WN(e);return Math.min(...n)>=t}return!0}function Vd(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 GN(e){return(String(e).split(".")[1]||"").length}function QN(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Fv=Tv,YN=Mv,qN=Ov,XN=Lv;const Ss=y.forwardRef(({className:e,...t},n)=>c.jsxs(Fv,{ref:n,className:ae("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(YN,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(qN,{className:"absolute h-full bg-primary"})}),c.jsx(XN,{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"})]}));Ss.displayName=Fv.displayName;var JN="Label",Bv=y.forwardRef((e,t)=>c.jsx(re.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())}}));Bv.displayName=JN;var $v=Bv;const ZN=Fd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ye=y.forwardRef(({className:e,...t},n)=>c.jsx($v,{ref:n,className:ae(ZN(),e),...t}));Ye.displayName=$v.displayName;function eE(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e);y.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 tE="DismissableLayer",vc="dismissableLayer.update",nE="dismissableLayer.pointerDownOutside",rE="dismissableLayer.focusOutside",Zp,Uv=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=y.useContext(Uv),[f,d]=y.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),w=pe(t,j=>d(j)),g=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(S),h=f?g.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=h>=v,E=lE(j=>{const _=j.target,F=[...u.branches].some(M=>M.contains(_));!C||F||(i==null||i(j),l==null||l(j),j.defaultPrevented||s==null||s())},p),N=sE(j=>{const _=j.target;[...u.branches].some(M=>M.contains(_))||(o==null||o(j),l==null||l(j),j.defaultPrevented||s==null||s())},p);return eE(j=>{h===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&s&&(j.preventDefault(),s()))},p),y.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),em(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zp)}},[f,p,n,u]),y.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),em())},[f,u]),y.useEffect(()=>{const j=()=>m({});return document.addEventListener(vc,j),()=>document.removeEventListener(vc,j)},[]),c.jsx(re.div,{...a,ref:w,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Z(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Z(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Z(e.onPointerDownCapture,E.onPointerDownCapture)})});Hd.displayName=tE;var iE="DismissableLayerBranch",oE=y.forwardRef((e,t)=>{const n=y.useContext(Uv),r=y.useRef(null),i=pe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(re.div,{...e,ref:i})});oE.displayName=iE;function lE(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){Vv(nE,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sE(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=y.useRef(!1);return y.useEffect(()=>{const i=o=>{o.target&&!r.current&&Vv(rE,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 em(){const e=new CustomEvent(vc);document.dispatchEvent(e)}function Vv(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?cN(i,o):i.dispatchEvent(o)}var Ga=0;function Hv(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tm()),document.body.insertAdjacentElement("beforeend",e[1]??tm()),Ga++,()=>{Ga===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ga--}},[])}function tm(){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 Qa="focusScope.autoFocusOnMount",Ya="focusScope.autoFocusOnUnmount",nm={bubbles:!1,cancelable:!0},aE="FocusScope",Wd=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=y.useState(null),u=qn(i),f=qn(o),d=y.useRef(null),p=pe(t,g=>a(g)),m=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let g=function(x){if(m.paused||!s)return;const C=x.target;s.contains(C)?d.current=C:Tn(d.current,{select:!0})},S=function(x){if(m.paused||!s)return;const C=x.relatedTarget;C!==null&&(s.contains(C)||Tn(d.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&Tn(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",S);const h=new MutationObserver(v);return s&&h.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",S),h.disconnect()}}},[r,s,m.paused]),y.useEffect(()=>{if(s){im.add(m);const g=document.activeElement;if(!s.contains(g)){const v=new CustomEvent(Qa,nm);s.addEventListener(Qa,u),s.dispatchEvent(v),v.defaultPrevented||(uE(mE(Wv(s)),{select:!0}),document.activeElement===g&&Tn(s))}return()=>{s.removeEventListener(Qa,u),setTimeout(()=>{const v=new CustomEvent(Ya,nm);s.addEventListener(Ya,f),s.dispatchEvent(v),v.defaultPrevented||Tn(g??document.body,{select:!0}),s.removeEventListener(Ya,f),im.remove(m)},0)}}},[s,u,f,m]);const w=y.useCallback(g=>{if(!n&&!r||m.paused)return;const S=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(S&&v){const h=g.currentTarget,[x,C]=cE(h);x&&C?!g.shiftKey&&v===C?(g.preventDefault(),n&&Tn(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),n&&Tn(C,{select:!0})):v===h&&g.preventDefault()}},[n,r,m.paused]);return c.jsx(re.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Wd.displayName=aE;function uE(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Tn(r,{select:t}),document.activeElement!==n)return}function cE(e){const t=Wv(e),n=rm(t,e),r=rm(t.reverse(),e);return[n,r]}function Wv(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(!dE(n,{upTo:t}))return n}function dE(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 fE(e){return e instanceof HTMLInputElement&&"select"in e}function Tn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fE(e)&&t&&e.select()}}var im=pE();function pE(){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 mE(e){return e.filter(t=>t.tagName!=="A")}const hE=["top","right","bottom","left"],Xn=Math.min,yt=Math.max,ks=Math.round,dl=Math.floor,ln=e=>({x:e,y:e}),gE={left:"right",right:"left",bottom:"top",top:"bottom"},yE={start:"end",end:"start"};function xc(e,t,n){return yt(e,Xn(t,n))}function kn(e,t){return typeof e=="function"?e(t):e}function Cn(e){return e.split("-")[0]}function Ti(e){return e.split("-")[1]}function Kd(e){return e==="x"?"y":"x"}function Gd(e){return e==="y"?"height":"width"}const vE=new Set(["top","bottom"]);function nn(e){return vE.has(Cn(e))?"y":"x"}function Qd(e){return Kd(nn(e))}function xE(e,t,n){n===void 0&&(n=!1);const r=Ti(e),i=Qd(e),o=Gd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Cs(l)),[l,Cs(l)]}function wE(e){const t=Cs(e);return[wc(e),t,wc(t)]}function wc(e){return e.replace(/start|end/g,t=>yE[t])}const lm=["left","right"],sm=["right","left"],SE=["top","bottom"],kE=["bottom","top"];function CE(e,t,n){switch(e){case"top":case"bottom":return n?t?sm:lm:t?lm:sm;case"left":case"right":return t?SE:kE;default:return[]}}function bE(e,t,n,r){const i=Ti(e);let o=CE(Cn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(wc)))),o}function Cs(e){return e.replace(/left|right|bottom|top/g,t=>gE[t])}function NE(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kv(e){return typeof e!="number"?NE(e):{top:e,right:e,bottom:e,left:e}}function bs(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 am(e,t,n){let{reference:r,floating:i}=e;const o=nn(t),l=Qd(t),s=Gd(l),a=Cn(t),u=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(Ti(t)){case"start":m[l]-=p*(n&&u?-1:1);break;case"end":m[l]+=p*(n&&u?-1:1);break}return m}const EE=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=am(u,r,a),p=r,m={},w=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=t,{element:u,padding:f=0}=kn(e,t)||{};if(u==null)return{};const d=Kv(f),p={x:n,y:r},m=Qd(i),w=Gd(m),g=await l.getDimensions(u),S=m==="y",v=S?"top":"left",h=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=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(u));let j=N?N[x]:0;(!j||!await(l.isElement==null?void 0:l.isElement(N)))&&(j=s.floating[x]||o.floating[w]);const _=C/2-E/2,F=j/2-g[w]/2-1,M=Xn(d[v],F),A=Xn(d[h],F),R=M,U=j-g[w]-A,H=j/2-g[w]/2+_,L=xc(R,H,U),O=!a.arrow&&Ti(i)!=null&&H!==L&&o.reference[w]/2-(HH<=0)){var A,R;const H=(((A=o.flip)==null?void 0:A.index)||0)+1,L=j[H];if(L&&(!(d==="alignment"?h!==nn(L):!1)||M.every(T=>nn(T.placement)===h?T.overflows[0]>0:!0)))return{data:{index:H,overflows:M},reset:{placement:L}};let O=(R=M.filter(D=>D.overflows[0]<=0).sort((D,T)=>D.overflows[1]-T.overflows[1])[0])==null?void 0:R.placement;if(!O)switch(m){case"bestFit":{var U;const D=(U=M.filter(T=>{if(N){const B=nn(T.placement);return B===h||B==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(B=>B>0).reduce((B,k)=>B+k,0)]).sort((T,B)=>T[1]-B[1])[0])==null?void 0:U[0];D&&(O=D);break}case"initialPlacement":O=s;break}if(i!==O)return{reset:{placement:O}}}return{}}}};function um(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cm(e){return hE.some(t=>e[t]>=0)}const TE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=kn(e,t);switch(r){case"referenceHidden":{const o=await Ao(t,{...i,elementContext:"reference"}),l=um(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:cm(l)}}}case"escaped":{const o=await Ao(t,{...i,altBoundary:!0}),l=um(o,n.floating);return{data:{escapedOffsets:l,escaped:cm(l)}}}default:return{}}}}},Gv=new Set(["left","top"]);async function _E(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Cn(n),s=Ti(n),a=nn(n)==="y",u=Gv.has(l)?-1:1,f=o&&a?-1:1,d=kn(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*u}:{x:p*u,y:m*f}}const AE=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 _E(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}}}}},RE=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:v,y:h}=S;return{x:v,y:h}}},...a}=kn(e,t),u={x:n,y:r},f=await Ao(t,a),d=nn(Cn(i)),p=Kd(d);let m=u[p],w=u[d];if(o){const S=p==="y"?"top":"left",v=p==="y"?"bottom":"right",h=m+f[S],x=m-f[v];m=xc(h,m,x)}if(l){const S=d==="y"?"top":"left",v=d==="y"?"bottom":"right",h=w+f[S],x=w-f[v];w=xc(h,w,x)}const g=s.fn({...t,[p]:m,[d]:w});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[d]:l}}}}}},IE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=kn(e,t),f={x:n,y:r},d=nn(i),p=Kd(d);let m=f[p],w=f[d];const g=kn(s,t),S=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const x=p==="y"?"height":"width",C=o.reference[p]-o.floating[x]+S.mainAxis,E=o.reference[p]+o.reference[x]-S.mainAxis;mE&&(m=E)}if(u){var v,h;const x=p==="y"?"width":"height",C=Gv.has(Cn(i)),E=o.reference[d]-o.floating[x]+(C&&((v=l.offset)==null?void 0:v[d])||0)+(C?0:S.crossAxis),N=o.reference[d]+o.reference[x]+(C?0:((h=l.offset)==null?void 0:h[d])||0)-(C?S.crossAxis:0);wN&&(w=N)}return{[p]:m,[d]:w}}}},ME=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:s}=t,{apply:a=()=>{},...u}=kn(e,t),f=await Ao(t,u),d=Cn(i),p=Ti(i),m=nn(i)==="y",{width:w,height:g}=o.floating;let S,v;d==="top"||d==="bottom"?(S=d,v=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,S=p==="end"?"top":"bottom");const h=g-f.top-f.bottom,x=w-f.left-f.right,C=Xn(g-f[S],h),E=Xn(w-f[v],x),N=!t.middlewareData.shift;let j=C,_=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=h),N&&!p){const M=yt(f.left,0),A=yt(f.right,0),R=yt(f.top,0),U=yt(f.bottom,0);m?_=w-2*(M!==0||A!==0?M+A:yt(f.left,f.right)):j=g-2*(R!==0||U!==0?R+U:yt(f.top,f.bottom))}await a({...t,availableWidth:_,availableHeight:j});const F=await l.getDimensions(s.floating);return w!==F.width||g!==F.height?{reset:{rects:!0}}:{}}}};function Js(){return typeof window<"u"}function _i(e){return Qv(e)?(e.nodeName||"").toLowerCase():"#document"}function St(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function un(e){var t;return(t=(Qv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qv(e){return Js()?e instanceof Node||e instanceof St(e).Node:!1}function Ht(e){return Js()?e instanceof Element||e instanceof St(e).Element:!1}function sn(e){return Js()?e instanceof HTMLElement||e instanceof St(e).HTMLElement:!1}function dm(e){return!Js()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof St(e).ShadowRoot}const OE=new Set(["inline","contents"]);function Vo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!OE.has(i)}const LE=new Set(["table","td","th"]);function DE(e){return LE.has(_i(e))}const zE=[":popover-open",":modal"];function Zs(e){return zE.some(t=>{try{return e.matches(t)}catch{return!1}})}const FE=["transform","translate","scale","rotate","perspective"],BE=["transform","translate","scale","rotate","perspective","filter"],$E=["paint","layout","strict","content"];function Yd(e){const t=qd(),n=Ht(e)?Wt(e):e;return FE.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)||BE.some(r=>(n.willChange||"").includes(r))||$E.some(r=>(n.contain||"").includes(r))}function UE(e){let t=Jn(e);for(;sn(t)&&!ki(t);){if(Yd(t))return t;if(Zs(t))return null;t=Jn(t)}return null}function qd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const VE=new Set(["html","body","#document"]);function ki(e){return VE.has(_i(e))}function Wt(e){return St(e).getComputedStyle(e)}function ea(e){return Ht(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(_i(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dm(e)&&e.host||un(e);return dm(t)?t.host:t}function Yv(e){const t=Jn(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:sn(t)&&Vo(t)?t:Yv(t)}function Ro(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Yv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=St(i);if(o){const s=Sc(l);return t.concat(l,l.visualViewport||[],Vo(i)?i:[],s&&n?Ro(s):[])}return t.concat(i,Ro(i,[],n))}function Sc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qv(e){const t=Wt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ks(n)!==o||ks(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Xd(e){return Ht(e)?e:e.contextElement}function li(e){const t=Xd(e);if(!sn(t))return ln(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=qv(t);let l=(o?ks(n.width):n.width)/r,s=(o?ks(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const HE=ln(0);function Xv(e){const t=St(e);return!qd()||!t.visualViewport?HE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==St(e)?!1:t}function kr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Xd(e);let l=ln(1);t&&(r?Ht(r)&&(l=li(r)):l=li(e));const s=WE(o,n,r)?Xv(o):ln(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,f=i.width/l.x,d=i.height/l.y;if(o){const p=St(o),m=r&&Ht(r)?St(r):r;let w=p,g=Sc(w);for(;g&&r&&m!==w;){const S=li(g),v=g.getBoundingClientRect(),h=Wt(g),x=v.left+(g.clientLeft+parseFloat(h.paddingLeft))*S.x,C=v.top+(g.clientTop+parseFloat(h.paddingTop))*S.y;a*=S.x,u*=S.y,f*=S.x,d*=S.y,a+=x,u+=C,w=St(g),g=Sc(w)}}return bs({width:f,height:d,x:a,y:u})}function ta(e,t){const n=ea(e).scrollLeft;return t?t.left+n:kr(un(e)).left+n}function Jv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ta(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function KE(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=un(r),s=t?Zs(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=ln(1);const f=ln(0),d=sn(r);if((d||!d&&!o)&&((_i(r)!=="body"||Vo(l))&&(a=ea(r)),sn(r))){const m=kr(r);u=li(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=l&&!d&&!o?Jv(l,a):ln(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-a.scrollTop*u.y+f.y+p.y}}function GE(e){return Array.from(e.getClientRects())}function QE(e){const t=un(e),n=ea(e),r=e.ownerDocument.body,i=yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ta(e);const s=-n.scrollTop;return Wt(r).direction==="rtl"&&(l+=yt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const fm=25;function YE(e,t){const n=St(e),r=un(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=qd();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=ta(r);if(u<=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<=fm&&(o-=w)}else u<=fm&&(o+=u);return{width:o,height:l,x:s,y:a}}const qE=new Set(["absolute","fixed"]);function XE(e,t){const n=kr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=sn(e)?li(e):ln(1),l=e.clientWidth*o.x,s=e.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function pm(e,t,n){let r;if(t==="viewport")r=YE(e,n);else if(t==="document")r=QE(un(e));else if(Ht(t))r=XE(t,n);else{const i=Xv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return bs(r)}function Zv(e,t){const n=Jn(e);return n===t||!Ht(n)||ki(n)?!1:Wt(n).position==="fixed"||Zv(n,t)}function JE(e,t){const n=t.get(e);if(n)return n;let r=Ro(e,[],!1).filter(s=>Ht(s)&&_i(s)!=="body"),i=null;const o=Wt(e).position==="fixed";let l=o?Jn(e):e;for(;Ht(l)&&!ki(l);){const s=Wt(l),a=Yd(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&qE.has(i.position)||Vo(l)&&!a&&Zv(e,l))?r=r.filter(f=>f!==l):i=s,l=Jn(l)}return t.set(e,r),r}function ZE(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Zs(t)?[]:JE(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const d=pm(t,f,i);return u.top=yt(d.top,u.top),u.right=Xn(d.right,u.right),u.bottom=Xn(d.bottom,u.bottom),u.left=yt(d.left,u.left),u},pm(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function e2(e){const{width:t,height:n}=qv(e);return{width:t,height:n}}function t2(e,t,n){const r=sn(t),i=un(t),o=n==="fixed",l=kr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=ln(0);function u(){a.x=ta(i)}if(r||!r&&!o)if((_i(t)!=="body"||Vo(i))&&(s=ea(t)),r){const m=kr(t,!0,o,t);a.x=m.x+t.clientLeft,a.y=m.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?Jv(i,s):ln(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 qa(e){return Wt(e).position==="static"}function mm(e,t){if(!sn(e)||Wt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return un(e)===n&&(n=n.ownerDocument.body),n}function ex(e,t){const n=St(e);if(Zs(e))return n;if(!sn(e)){let i=Jn(e);for(;i&&!ki(i);){if(Ht(i)&&!qa(i))return i;i=Jn(i)}return n}let r=mm(e,t);for(;r&&DE(r)&&qa(r);)r=mm(r,t);return r&&ki(r)&&qa(r)&&!Yd(r)?n:r||UE(e)||n}const n2=async function(e){const t=this.getOffsetParent||ex,n=this.getDimensions,r=await n(e.floating);return{reference:t2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function r2(e){return Wt(e).direction==="rtl"}const i2={convertOffsetParentRelativeRectToViewportRelativeRect:KE,getDocumentElement:un,getClippingRect:ZE,getOffsetParent:ex,getElementRects:n2,getClientRects:GE,getDimensions:e2,getScale:li,isElement:Ht,isRTL:r2};function tx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function o2(e,t){let n=null,r;const i=un(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const u=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=u;if(s||t(),!p||!m)return;const w=dl(d),g=dl(i.clientWidth-(f+p)),S=dl(i.clientHeight-(d+m)),v=dl(f),x={rootMargin:-w+"px "+-g+"px "+-S+"px "+-v+"px",threshold:yt(0,Xn(1,a))||1};let C=!0;function E(N){const j=N[0].intersectionRatio;if(j!==a){if(!C)return l();j?l(!1,j):r=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!tx(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return l(!0),o}function l2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Xd(e),f=i||o?[...u?Ro(u):[],...Ro(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&s?o2(u,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(v=>{let[h]=v;h&&h.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!a&&m.observe(u),m.observe(t));let w,g=a?kr(e):null;a&&S();function S(){const v=kr(e);g&&!tx(g,v)&&n(),g=v,w=requestAnimationFrame(S)}return n(),()=>{var v;f.forEach(h=>{i&&h.removeEventListener("scroll",n),o&&h.removeEventListener("resize",n)}),d==null||d(),(v=m)==null||v.disconnect(),m=null,a&&cancelAnimationFrame(w)}}const s2=AE,a2=RE,u2=PE,c2=ME,d2=TE,hm=jE,f2=IE,p2=(e,t,n)=>{const r=new Map,i={platform:i2,...n},o={...i.platform,_c:r};return EE(e,t,{...i,platform:o})};var m2=typeof document<"u",h2=function(){},Il=m2?y.useLayoutEffect:h2;function Ns(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(!Ns(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)&&!Ns(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function nx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gm(e,t){const n=nx(e);return Math.round(t*n)/n}function Xa(e){const t=y.useRef(e);return Il(()=>{t.current=e}),t}function g2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=e,[f,d]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=y.useState(r);Ns(p,r)||m(r);const[w,g]=y.useState(null),[S,v]=y.useState(null),h=y.useCallback(T=>{T!==N.current&&(N.current=T,g(T))},[]),x=y.useCallback(T=>{T!==j.current&&(j.current=T,v(T))},[]),C=o||w,E=l||S,N=y.useRef(null),j=y.useRef(null),_=y.useRef(f),F=a!=null,M=Xa(a),A=Xa(i),R=Xa(u),U=y.useCallback(()=>{if(!N.current||!j.current)return;const T={placement:t,strategy:n,middleware:p};A.current&&(T.platform=A.current),p2(N.current,j.current,T).then(B=>{const k={...B,isPositioned:R.current!==!1};H.current&&!Ns(_.current,k)&&(_.current=k,Ei.flushSync(()=>{d(k)}))})},[p,t,n,A,R]);Il(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[u]);const H=y.useRef(!1);Il(()=>(H.current=!0,()=>{H.current=!1}),[]),Il(()=>{if(C&&(N.current=C),E&&(j.current=E),C&&E){if(M.current)return M.current(C,E,U);U()}},[C,E,U,M,F]);const L=y.useMemo(()=>({reference:N,floating:j,setReference:h,setFloating:x}),[h,x]),O=y.useMemo(()=>({reference:C,floating:E}),[C,E]),D=y.useMemo(()=>{const T={position:n,left:0,top:0};if(!O.floating)return T;const B=gm(O.floating,f.x),k=gm(O.floating,f.y);return s?{...T,transform:"translate("+B+"px, "+k+"px)",...nx(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:k}},[n,s,O.floating,f.x,f.y]);return y.useMemo(()=>({...f,update:U,refs:L,elements:O,floatingStyles:D}),[f,U,L,O,D])}const y2=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?hm({element:r.current,padding:i}).fn(n):{}:r?hm({element:r,padding:i}).fn(n):{}}}},v2=(e,t)=>({...s2(e),options:[e,t]}),x2=(e,t)=>({...a2(e),options:[e,t]}),w2=(e,t)=>({...f2(e),options:[e,t]}),S2=(e,t)=>({...u2(e),options:[e,t]}),k2=(e,t)=>({...c2(e),options:[e,t]}),C2=(e,t)=>({...d2(e),options:[e,t]}),b2=(e,t)=>({...y2(e),options:[e,t]});var N2="Arrow",rx=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(re.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});rx.displayName=N2;var E2=rx,Jd="Popper",[ix,ox]=rr(Jd),[j2,lx]=ix(Jd),sx=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return c.jsx(j2,{scope:t,anchor:r,onAnchorChange:i,children:n})};sx.displayName=Jd;var ax="PopperAnchor",ux=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=lx(ax,n),l=y.useRef(null),s=pe(t,l),a=y.useRef(null);return y.useEffect(()=>{const u=a.current;a.current=(r==null?void 0:r.current)||l.current,u!==a.current&&o.onAnchorChange(a.current)}),r?null:c.jsx(re.div,{...i,ref:s})});ux.displayName=ax;var Zd="PopperContent",[P2,T2]=ix(Zd),cx=y.forwardRef((e,t)=>{var Q,oe,ye,le,ue,ce;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:s=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:w,...g}=e,S=lx(Zd,n),[v,h]=y.useState(null),x=pe(t,$e=>h($e)),[C,E]=y.useState(null),N=bv(C),j=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,F=r+(o!=="center"?"-"+o:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(u)?u:[u],R=A.length>0,U={padding:M,boundary:A.filter(A2),altBoundary:R},{refs:H,floatingStyles:L,placement:O,isPositioned:D,middlewareData:T}=g2({strategy:"fixed",placement:F,whileElementsMounted:(...$e)=>l2(...$e,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[v2({mainAxis:i+_,alignmentAxis:l}),a&&x2({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?w2():void 0,...U}),a&&S2({...U}),k2({...U,apply:({elements:$e,rects:rt,availableWidth:Gt,availableHeight:Qt})=>{const{width:It,height:Ar}=rt.reference,cn=$e.floating.style;cn.setProperty("--radix-popper-available-width",`${Gt}px`),cn.setProperty("--radix-popper-available-height",`${Qt}px`),cn.setProperty("--radix-popper-anchor-width",`${It}px`),cn.setProperty("--radix-popper-anchor-height",`${Ar}px`)}}),C&&b2({element:C,padding:s}),R2({arrowWidth:j,arrowHeight:_}),p&&C2({strategy:"referenceHidden",...U})]}),[B,k]=px(O),G=qn(w);Xe(()=>{D&&(G==null||G())},[D,G]);const Y=(Q=T.arrow)==null?void 0:Q.x,b=(oe=T.arrow)==null?void 0:oe.y,X=((ye=T.arrow)==null?void 0:ye.centerOffset)!==0,[ge,ne]=y.useState();return Xe(()=>{v&&ne(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:D?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(le=T.transformOrigin)==null?void 0:le.x,(ue=T.transformOrigin)==null?void 0:ue.y].join(" "),...((ce=T.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(P2,{scope:n,placedSide:B,onArrowChange:E,arrowX:Y,arrowY:b,shouldHideArrow:X,children:c.jsx(re.div,{"data-side":B,"data-align":k,...g,ref:x,style:{...g.style,animation:D?void 0:"none"}})})})});cx.displayName=Zd;var dx="PopperArrow",_2={top:"bottom",right:"left",bottom:"top",left:"right"},fx=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=T2(dx,r),l=_2[o.placedSide];return c.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:c.jsx(E2,{...i,ref:n,style:{...i.style,display:"block"}})})});fx.displayName=dx;function A2(e){return e!==null}var R2=e=>({name:"transformOrigin",options:e,fn(t){var S,v,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,[u,f]=px(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((v=i.arrow)==null?void 0:v.x)??0)+s/2,m=(((h=i.arrow)==null?void 0:h.y)??0)+a/2;let w="",g="";return u==="bottom"?(w=l?d:`${p}px`,g=`${-a}px`):u==="top"?(w=l?d:`${p}px`,g=`${r.floating.height+a}px`):u==="right"?(w=`${-a}px`,g=l?d:`${m}px`):u==="left"&&(w=`${r.floating.width+a}px`,g=l?d:`${m}px`),{data:{x:w,y:g}}}});function px(e){const[t,n="center"]=e.split("-");return[t,n]}var I2=sx,M2=ux,O2=cx,L2=fx,D2="Portal",ef=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=y.useState(!1);Xe(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?ik.createPortal(c.jsx(re.div,{...r,ref:t}),l):null});ef.displayName=D2;var mx=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"}),z2="VisuallyHidden",F2=y.forwardRef((e,t)=>c.jsx(re.span,{...e,ref:t,style:{...mx,...e.style}}));F2.displayName=z2;var B2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Or=new WeakMap,fl=new WeakMap,pl={},Ja=0,hx=function(e){return e&&(e.host||hx(e.parentNode))},$2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hx(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})},U2=function(e,t,n,r){var i=$2(t,Array.isArray(e)?e:[e]);pl[n]||(pl[n]=new WeakMap);var o=pl[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);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",g=(Or.get(p)||0)+1,S=(o.get(p)||0)+1;Or.set(p,g),o.set(p,S),l.push(p),g===1&&w&&fl.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return f(t),s.clear(),Ja++,function(){l.forEach(function(d){var p=Or.get(d)-1,m=o.get(d)-1;Or.set(d,p),o.set(d,m),p||(fl.has(d)||d.removeAttribute(r),fl.delete(d)),m||d.removeAttribute(n)}),Ja--,Ja||(Or=new WeakMap,Or=new WeakMap,fl=new WeakMap,pl={})}},gx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||B2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),U2(r,i,n,"aria-hidden")):function(){return null}},en=function(){return en=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return oj;var t=lj(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])}},aj=wx(),si="data-scroll-locked",uj=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(H2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(si,`] { + 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(Ml,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Ol,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Ml," .").concat(Ml,` { + right: 0 `).concat(r,`; + } + + .`).concat(Ol," .").concat(Ol,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(si,`] { + `).concat(W2,": ").concat(s,`px; + } +`)},xm=function(){var e=parseInt(document.body.getAttribute(si)||"0",10);return isFinite(e)?e:0},cj=function(){y.useEffect(function(){return document.body.setAttribute(si,(xm()+1).toString()),function(){var e=xm()-1;e<=0?document.body.removeAttribute(si):document.body.setAttribute(si,e.toString())}},[])},dj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;cj();var o=y.useMemo(function(){return sj(i)},[i]);return y.createElement(aj,{styles:uj(o,!t,i,n?"":"!important")})},kc=!1;if(typeof window<"u")try{var ml=Object.defineProperty({},"passive",{get:function(){return kc=!0,!0}});window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{kc=!1}var Lr=kc?{passive:!1}:!1,fj=function(e){return e.tagName==="TEXTAREA"},Sx=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fj(e)&&n[t]==="visible")},pj=function(e){return Sx(e,"overflowY")},mj=function(e){return Sx(e,"overflowX")},wm=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=kx(e,r);if(i){var o=Cx(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gj=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kx=function(e,t){return e==="v"?pj(t):mj(t)},Cx=function(e,t){return e==="v"?hj(t):gj(t)},yj=function(e,t){return e==="h"&&t==="rtl"?-1:1},vj=function(e,t,n,r,i){var o=yj(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,f=l>0,d=0,p=0;do{if(!s)break;var m=Cx(e,s),w=m[0],g=m[1],S=m[2],v=g-S-o*w;(w||v)&&kx(e,s)&&(d+=v,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))&&(u=!0),u},hl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Sm=function(e){return[e.deltaX,e.deltaY]},km=function(e){return e&&"current"in e?e.current:e},xj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wj=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Sj=0,Dr=[];function kj(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(Sj++)[0],o=y.useState(wx)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=V2([e.lockRef.current],(e.shards||[]).map(km),!0).filter(Boolean);return g.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(g,S){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!l.current.allowPinchZoom;var v=hl(g),h=n.current,x="deltaX"in g?g.deltaX:h[0]-v[0],C="deltaY"in g?g.deltaY:h[1]-v[1],E,N=g.target,j=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in g&&j==="h"&&N.type==="range")return!1;var _=wm(j,N);if(!_)return!0;if(_?E=j:(E=j==="v"?"h":"v",_=wm(j,N)),!_)return!1;if(!r.current&&"changedTouches"in g&&(x||C)&&(r.current=E),!E)return!0;var F=r.current||E;return vj(F,S,g,F==="h"?x:C,!0)},[]),a=y.useCallback(function(g){var S=g;if(!(!Dr.length||Dr[Dr.length-1]!==o)){var v="deltaY"in S?Sm(S):hl(S),h=t.current.filter(function(E){return E.name===S.type&&(E.target===S.target||S.target===E.shadowParent)&&xj(E.delta,v)})[0];if(h&&h.should){S.cancelable&&S.preventDefault();return}if(!h){var x=(l.current.shards||[]).map(km).filter(Boolean).filter(function(E){return E.contains(S.target)}),C=x.length>0?s(S,x[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=y.useCallback(function(g,S,v,h){var x={name:g,delta:S,target:v,should:h,shadowParent:Cj(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),f=y.useCallback(function(g){n.current=hl(g),r.current=void 0},[]),d=y.useCallback(function(g){u(g.type,Sm(g),g.target,s(g,e.lockRef.current))},[]),p=y.useCallback(function(g){u(g.type,hl(g),g.target,s(g,e.lockRef.current))},[]);y.useEffect(function(){return Dr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,Lr),document.addEventListener("touchmove",a,Lr),document.addEventListener("touchstart",f,Lr),function(){Dr=Dr.filter(function(g){return g!==o}),document.removeEventListener("wheel",a,Lr),document.removeEventListener("touchmove",a,Lr),document.removeEventListener("touchstart",f,Lr)}},[]);var m=e.removeScrollBar,w=e.inert;return y.createElement(y.Fragment,null,w?y.createElement(o,{styles:wj(i)}):null,m?y.createElement(dj,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Cj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const bj=J2(xx,kj);var bx=y.forwardRef(function(e,t){return y.createElement(na,en({},e,{ref:t,sideCar:bj}))});bx.classNames=na.classNames;const Nx=bx;var Nj=[" ","Enter","ArrowUp","ArrowDown"],Ej=[" ","Enter"],Cr="Select",[ra,ia,jj]=$d(Cr),[Ai,TI]=rr(Cr,[jj,ox]),oa=ox(),[Pj,ir]=Ai(Cr),[Tj,_j]=Ai(Cr),Ex=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:f,autoComplete:d,disabled:p,required:m,form:w}=e,g=oa(t),[S,v]=y.useState(null),[h,x]=y.useState(null),[C,E]=y.useState(!1),N=Ys(u),[j,_]=Si({prop:r,defaultProp:i??!1,onChange:o,caller:Cr}),[F,M]=Si({prop:l,defaultProp:s,onChange:a,caller:Cr}),A=y.useRef(null),R=S?w||!!S.closest("form"):!0,[U,H]=y.useState(new Set),L=Array.from(U).map(O=>O.props.value).join(";");return c.jsx(I2,{...g,children:c.jsxs(Pj,{required:m,scope:t,trigger:S,onTriggerChange:v,valueNode:h,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:E,contentId:Gn(),value:F,onValueChange:M,open:j,onOpenChange:_,dir:N,triggerPointerDownPosRef:A,disabled:p,children:[c.jsx(ra.Provider,{scope:t,children:c.jsx(Tj,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(O=>{H(D=>new Set(D).add(O))},[]),onNativeOptionRemove:y.useCallback(O=>{H(D=>{const T=new Set(D);return T.delete(O),T})},[]),children:n})}),R?c.jsxs(Xx,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:F,onChange:O=>M(O.target.value),disabled:p,form:w,children:[F===void 0?c.jsx("option",{value:""}):null,Array.from(U)]},L):null]})})};Ex.displayName=Cr;var jx="SelectTrigger",Px=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=oa(n),l=ir(jx,n),s=l.disabled||r,a=pe(t,l.onTriggerChange),u=ia(n),f=y.useRef("touch"),[d,p,m]=Zx(g=>{const S=u().filter(x=>!x.disabled),v=S.find(x=>x.value===l.value),h=e0(S,g,v);h!==void 0&&l.onValueChange(h.value)}),w=g=>{s||(l.onOpenChange(!0),m()),g&&(l.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return c.jsx(M2,{asChild:!0,...o,children:c.jsx(re.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":Jx(l.value)?"":void 0,...i,ref:a,onClick:Z(i.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&w(g)}),onPointerDown:Z(i.onPointerDown,g=>{f.current=g.pointerType;const S=g.target;S.hasPointerCapture(g.pointerId)&&S.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(w(g),g.preventDefault())}),onKeyDown:Z(i.onKeyDown,g=>{const S=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(S&&g.key===" ")&&Nj.includes(g.key)&&(w(),g.preventDefault())})})})});Px.displayName=jx;var Tx="SelectValue",_x=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=ir(Tx,n),{onValueNodeHasChildrenChange:u}=a,f=o!==void 0,d=pe(t,a.onValueNodeChange);return Xe(()=>{u(f)},[u,f]),c.jsx(re.span,{...s,ref:d,style:{pointerEvents:"none"},children:Jx(a.value)?c.jsx(c.Fragment,{children:l}):o})});_x.displayName=Tx;var Aj="SelectIcon",Ax=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(re.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Ax.displayName=Aj;var Rj="SelectPortal",Rx=e=>c.jsx(ef,{asChild:!0,...e});Rx.displayName=Rj;var br="SelectContent",Ix=y.forwardRef((e,t)=>{const n=ir(br,e.__scopeSelect),[r,i]=y.useState();if(Xe(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Ei.createPortal(c.jsx(Mx,{scope:e.__scopeSelect,children:c.jsx(ra.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(Ox,{...e,ref:t})});Ix.displayName=br;var Lt=10,[Mx,or]=Ai(br),Ij="SelectContentImpl",Mj=wi("SelectContent.RemoveScroll"),Ox=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:g,avoidCollisions:S,...v}=e,h=ir(br,n),[x,C]=y.useState(null),[E,N]=y.useState(null),j=pe(t,Q=>C(Q)),[_,F]=y.useState(null),[M,A]=y.useState(null),R=ia(n),[U,H]=y.useState(!1),L=y.useRef(!1);y.useEffect(()=>{if(x)return gx(x)},[x]),Hv();const O=y.useCallback(Q=>{const[oe,...ye]=R().map(ce=>ce.ref.current),[le]=ye.slice(-1),ue=document.activeElement;for(const ce of Q)if(ce===ue||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===oe&&E&&(E.scrollTop=0),ce===le&&E&&(E.scrollTop=E.scrollHeight),ce==null||ce.focus(),document.activeElement!==ue))return},[R,E]),D=y.useCallback(()=>O([_,x]),[O,_,x]);y.useEffect(()=>{U&&D()},[U,D]);const{onOpenChange:T,triggerPointerDownPosRef:B}=h;y.useEffect(()=>{if(x){let Q={x:0,y:0};const oe=le=>{var ue,ce;Q={x:Math.abs(Math.round(le.pageX)-(((ue=B.current)==null?void 0:ue.x)??0)),y:Math.abs(Math.round(le.pageY)-(((ce=B.current)==null?void 0:ce.y)??0))}},ye=le=>{Q.x<=10&&Q.y<=10?le.preventDefault():x.contains(le.target)||T(!1),document.removeEventListener("pointermove",oe),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ye,{capture:!0})}}},[x,T,B]),y.useEffect(()=>{const Q=()=>T(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[T]);const[k,G]=Zx(Q=>{const oe=R().filter(ue=>!ue.disabled),ye=oe.find(ue=>ue.ref.current===document.activeElement),le=e0(oe,Q,ye);le&&setTimeout(()=>le.ref.current.focus())}),Y=y.useCallback((Q,oe,ye)=>{const le=!L.current&&!ye;(h.value!==void 0&&h.value===oe||le)&&(F(Q),le&&(L.current=!0))},[h.value]),b=y.useCallback(()=>x==null?void 0:x.focus(),[x]),X=y.useCallback((Q,oe,ye)=>{const le=!L.current&&!ye;(h.value!==void 0&&h.value===oe||le)&&A(Q)},[h.value]),ge=r==="popper"?Cc:Lx,ne=ge===Cc?{side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:w,hideWhenDetached:g,avoidCollisions:S}:{};return c.jsx(Mx,{scope:n,content:x,viewport:E,onViewportChange:N,itemRefCallback:Y,selectedItem:_,onItemLeave:b,itemTextRefCallback:X,focusSelectedItem:D,selectedItemText:M,position:r,isPositioned:U,searchRef:k,children:c.jsx(Nx,{as:Mj,allowPinchZoom:!0,children:c.jsx(Wd,{asChild:!0,trapped:h.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Z(i,Q=>{var oe;(oe=h.trigger)==null||oe.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(Hd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:c.jsx(ge,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:Q=>Q.preventDefault(),...v,...ne,onPlaced:()=>H(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Z(v.onKeyDown,Q=>{const oe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!oe&&Q.key.length===1&&G(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let le=R().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const ue=Q.target,ce=le.indexOf(ue);le=le.slice(ce+1)}setTimeout(()=>O(le)),Q.preventDefault()}})})})})})})});Ox.displayName=Ij;var Oj="SelectItemAlignedPosition",Lx=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ir(br,n),l=or(br,n),[s,a]=y.useState(null),[u,f]=y.useState(null),d=pe(t,j=>f(j)),p=ia(n),m=y.useRef(!1),w=y.useRef(!0),{viewport:g,selectedItem:S,selectedItemText:v,focusSelectedItem:h}=l,x=y.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&g&&S&&v){const j=o.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),M=v.getBoundingClientRect();if(o.dir!=="rtl"){const ue=M.left-_.left,ce=F.left-ue,$e=j.left-ce,rt=j.width+$e,Gt=Math.max(rt,_.width),Qt=window.innerWidth-Lt,It=ws(ce,[Lt,Math.max(Lt,Qt-Gt)]);s.style.minWidth=rt+"px",s.style.left=It+"px"}else{const ue=_.right-M.right,ce=window.innerWidth-F.right-ue,$e=window.innerWidth-j.right-ce,rt=j.width+$e,Gt=Math.max(rt,_.width),Qt=window.innerWidth-Lt,It=ws(ce,[Lt,Math.max(Lt,Qt-Gt)]);s.style.minWidth=rt+"px",s.style.right=It+"px"}const A=p(),R=window.innerHeight-Lt*2,U=g.scrollHeight,H=window.getComputedStyle(u),L=parseInt(H.borderTopWidth,10),O=parseInt(H.paddingTop,10),D=parseInt(H.borderBottomWidth,10),T=parseInt(H.paddingBottom,10),B=L+O+U+T+D,k=Math.min(S.offsetHeight*5,B),G=window.getComputedStyle(g),Y=parseInt(G.paddingTop,10),b=parseInt(G.paddingBottom,10),X=j.top+j.height/2-Lt,ge=R-X,ne=S.offsetHeight/2,Q=S.offsetTop+ne,oe=L+O+Q,ye=B-oe;if(oe<=X){const ue=A.length>0&&S===A[A.length-1].ref.current;s.style.bottom="0px";const ce=u.clientHeight-g.offsetTop-g.offsetHeight,$e=Math.max(ge,ne+(ue?b:0)+ce+D),rt=oe+$e;s.style.height=rt+"px"}else{const ue=A.length>0&&S===A[0].ref.current;s.style.top="0px";const $e=Math.max(X,L+g.offsetTop+(ue?Y:0)+ne)+ye;s.style.height=$e+"px",g.scrollTop=oe-X+g.offsetTop}s.style.margin=`${Lt}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=R+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,o.trigger,o.valueNode,s,u,g,S,v,o.dir,r]);Xe(()=>x(),[x]);const[C,E]=y.useState();Xe(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const N=y.useCallback(j=>{j&&w.current===!0&&(x(),h==null||h(),w.current=!1)},[x,h]);return c.jsx(Dj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(re.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Lx.displayName=Oj;var Lj="SelectPopperPosition",Cc=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Lt,...o}=e,l=oa(n);return c.jsx(O2,{...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)"}})});Cc.displayName=Lj;var[Dj,tf]=Ai(br,{}),bc="SelectViewport",Dx=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=or(bc,n),l=tf(bc,n),s=pe(t,o.onViewportChange),a=y.useRef(0);return c.jsxs(c.Fragment,{children:[c.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}),c.jsx(ra.Slot,{scope:n,children:c.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Z(i.onScroll,u=>{const f=u.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-Lt*2,g=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),v=Math.max(g,S);if(v0?C:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});Dx.displayName=bc;var zx="SelectGroup",[zj,Fj]=Ai(zx),Fx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Gn();return c.jsx(zj,{scope:n,id:i,children:c.jsx(re.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Fx.displayName=zx;var Bx="SelectLabel",$x=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Fj(Bx,n);return c.jsx(re.div,{id:i.id,...r,ref:t})});$x.displayName=Bx;var Es="SelectItem",[Bj,Ux]=Ai(Es),Vx=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=ir(Es,n),a=or(Es,n),u=s.value===r,[f,d]=y.useState(o??""),[p,m]=y.useState(!1),w=pe(t,h=>{var x;return(x=a.itemRefCallback)==null?void 0:x.call(a,h,r,i)}),g=Gn(),S=y.useRef("touch"),v=()=>{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 c.jsx(Bj,{scope:n,value:r,disabled:i,textId:g,isSelected:u,onItemTextChange:y.useCallback(h=>{d(x=>x||((h==null?void 0:h.textContent)??"").trim())},[]),children:c.jsx(ra.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:c.jsx(re.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:Z(l.onFocus,()=>m(!0)),onBlur:Z(l.onBlur,()=>m(!1)),onClick:Z(l.onClick,()=>{S.current!=="mouse"&&v()}),onPointerUp:Z(l.onPointerUp,()=>{S.current==="mouse"&&v()}),onPointerDown:Z(l.onPointerDown,h=>{S.current=h.pointerType}),onPointerMove:Z(l.onPointerMove,h=>{var x;S.current=h.pointerType,i?(x=a.onItemLeave)==null||x.call(a):S.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Z(l.onPointerLeave,h=>{var x;h.currentTarget===document.activeElement&&((x=a.onItemLeave)==null||x.call(a))}),onKeyDown:Z(l.onKeyDown,h=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&h.key===" "||(Ej.includes(h.key)&&v(),h.key===" "&&h.preventDefault())})})})})});Vx.displayName=Es;var Ji="SelectItemText",Hx=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=ir(Ji,n),s=or(Ji,n),a=Ux(Ji,n),u=_j(Ji,n),[f,d]=y.useState(null),p=pe(t,v=>d(v),a.onItemTextChange,v=>{var h;return(h=s.itemTextRefCallback)==null?void 0:h.call(s,v,a.value,a.disabled)}),m=f==null?void 0:f.textContent,w=y.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:m},a.value),[a.disabled,a.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:S}=u;return Xe(()=>(g(w),()=>S(w)),[g,S,w]),c.jsxs(c.Fragment,{children:[c.jsx(re.span,{id:a.textId,...o,ref:p}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ei.createPortal(o.children,l.valueNode):null]})});Hx.displayName=Ji;var Wx="SelectItemIndicator",Kx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ux(Wx,n).isSelected?c.jsx(re.span,{"aria-hidden":!0,...r,ref:t}):null});Kx.displayName=Wx;var Nc="SelectScrollUpButton",Gx=y.forwardRef((e,t)=>{const n=or(Nc,e.__scopeSelect),r=tf(Nc,e.__scopeSelect),[i,o]=y.useState(!1),l=pe(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollTop>0;o(u)};const a=n.viewport;return s(),a.addEventListener("scroll",s),()=>a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(Yx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});Gx.displayName=Nc;var Ec="SelectScrollDownButton",Qx=y.forwardRef((e,t)=>{const n=or(Ec,e.__scopeSelect),r=tf(Ec,e.__scopeSelect),[i,o]=y.useState(!1),l=pe(t,r.onScrollButtonChange);return Xe(()=>{if(n.viewport&&n.isPositioned){let s=function(){const u=a.scrollHeight-a.clientHeight,f=Math.ceil(a.scrollTop)a.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?c.jsx(Yx,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});Qx.displayName=Ec;var Yx=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=or("SelectScrollButton",n),l=y.useRef(null),s=ia(n),a=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>a(),[a]),Xe(()=>{var f;const u=s().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),c.jsx(re.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Z(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Z(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Z(i.onPointerLeave,()=>{a()})})}),$j="SelectSeparator",qx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(re.div,{"aria-hidden":!0,...r,ref:t})});qx.displayName=$j;var jc="SelectArrow",Uj=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=oa(n),o=ir(jc,n),l=or(jc,n);return o.open&&l.position==="popper"?c.jsx(L2,{...i,...r,ref:t}):null});Uj.displayName=jc;var Vj="SelectBubbleInput",Xx=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),o=pe(r,i),l=Cv(t);return y.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]),c.jsx(re.select,{...n,style:{...mx,...n.style},ref:o,defaultValue:t})});Xx.displayName=Vj;function Jx(e){return e===""||e===void 0}function Zx(e){const t=qn(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(l=>{const s=n.current+l;t(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function e0(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Hj(e,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function Hj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Wj=Ex,t0=Px,Kj=_x,Gj=Ax,Qj=Rx,n0=Ix,Yj=Dx,qj=Fx,r0=$x,i0=Vx,Xj=Hx,Jj=Kx,o0=Gx,l0=Qx,s0=qx;const nf=Wj,ai=qj,rf=Kj,la=y.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(t0,{ref:r,className:ae("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,c.jsx(Gj,{asChild:!0,children:c.jsx(Wy,{className:"h-4 w-4 opacity-50"})})]}));la.displayName=t0.displayName;const a0=y.forwardRef(({className:e,...t},n)=>c.jsx(o0,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(tb,{className:"h-4 w-4"})}));a0.displayName=o0.displayName;const u0=y.forwardRef(({className:e,...t},n)=>c.jsx(l0,{ref:n,className:ae("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Wy,{className:"h-4 w-4"})}));u0.displayName=l0.displayName;const sa=y.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(Qj,{children:c.jsxs(n0,{ref:i,className:ae("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:[c.jsx(a0,{}),c.jsx(Yj,{className:ae("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(u0,{})]})}));sa.displayName=n0.displayName;const gr=y.forwardRef(({className:e,...t},n)=>c.jsx(r0,{ref:n,className:ae("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));gr.displayName=r0.displayName;const Dn=y.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(i0,{ref:r,className:ae("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:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Jj,{children:c.jsx(qC,{className:"h-4 w-4"})})}),c.jsx(Xj,{children:t})]}));Dn.displayName=i0.displayName;const Zj=y.forwardRef(({className:e,...t},n)=>c.jsx(s0,{ref:n,className:ae("-mx-1 my-1 h-px bg-muted",e),...t}));Zj.displayName=s0.displayName;var aa="Dialog",[c0,d0]=rr(aa),[eP,Kt]=c0(aa),f0=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,s=y.useRef(null),a=y.useRef(null),[u,f]=Si({prop:r,defaultProp:i??!1,onChange:o,caller:aa});return c.jsx(eP,{scope:t,triggerRef:s,contentRef:a,contentId:Gn(),titleId:Gn(),descriptionId:Gn(),open:u,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};f0.displayName=aa;var p0="DialogTrigger",m0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(p0,n),o=pe(t,i.triggerRef);return c.jsx(re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":sf(i.open),...r,ref:o,onClick:Z(e.onClick,i.onOpenToggle)})});m0.displayName=p0;var of="DialogPortal",[tP,h0]=c0(of,{forceMount:void 0}),g0=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Kt(of,t);return c.jsx(tP,{scope:t,forceMount:n,children:y.Children.map(r,l=>c.jsx(Uo,{present:n||o.open,children:c.jsx(ef,{asChild:!0,container:i,children:l})}))})};g0.displayName=of;var js="DialogOverlay",y0=y.forwardRef((e,t)=>{const n=h0(js,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(js,e.__scopeDialog);return o.modal?c.jsx(Uo,{present:r||o.open,children:c.jsx(rP,{...i,ref:t})}):null});y0.displayName=js;var nP=wi("DialogOverlay.RemoveScroll"),rP=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(js,n);return c.jsx(Nx,{as:nP,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(re.div,{"data-state":sf(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nr="DialogContent",v0=y.forwardRef((e,t)=>{const n=h0(Nr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kt(Nr,e.__scopeDialog);return c.jsx(Uo,{present:r||o.open,children:o.modal?c.jsx(iP,{...i,ref:t}):c.jsx(oP,{...i,ref:t})})});v0.displayName=Nr;var iP=y.forwardRef((e,t)=>{const n=Kt(Nr,e.__scopeDialog),r=y.useRef(null),i=pe(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return gx(o)},[]),c.jsx(x0,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,o=>o.preventDefault())})}),oP=y.forwardRef((e,t)=>{const n=Kt(Nr,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return c.jsx(x0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,s;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var a,u;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),x0=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Kt(Nr,n),a=y.useRef(null),u=pe(t,a);return Hv(),c.jsxs(c.Fragment,{children:[c.jsx(Wd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(Hd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":sf(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(sP,{titleId:s.titleId}),c.jsx(uP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),lf="DialogTitle",w0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(lf,n);return c.jsx(re.h2,{id:i.titleId,...r,ref:t})});w0.displayName=lf;var S0="DialogDescription",k0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(S0,n);return c.jsx(re.p,{id:i.descriptionId,...r,ref:t})});k0.displayName=S0;var C0="DialogClose",b0=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kt(C0,n);return c.jsx(re.button,{type:"button",...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})});b0.displayName=C0;function sf(e){return e?"open":"closed"}var N0="DialogTitleWarning",[lP,E0]=oN(N0,{contentName:Nr,titleName:lf,docsSlug:"dialog"}),sP=({titleId:e})=>{const t=E0(N0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aP="DialogDescriptionWarning",uP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E0(aP).contentName}}.`;return y.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},cP=f0,dP=m0,fP=g0,pP=y0,mP=v0,hP=w0,gP=k0,j0=b0,P0="AlertDialog",[yP,_I]=rr(P0,[d0]),Nn=d0(),T0=e=>{const{__scopeAlertDialog:t,...n}=e,r=Nn(t);return c.jsx(cP,{...r,...n,modal:!0})};T0.displayName=P0;var vP="AlertDialogTrigger",xP=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Nn(n);return c.jsx(dP,{...i,...r,ref:t})});xP.displayName=vP;var wP="AlertDialogPortal",_0=e=>{const{__scopeAlertDialog:t,...n}=e,r=Nn(t);return c.jsx(fP,{...r,...n})};_0.displayName=wP;var SP="AlertDialogOverlay",A0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Nn(n);return c.jsx(pP,{...i,...r,ref:t})});A0.displayName=SP;var ui="AlertDialogContent",[kP,CP]=yP(ui),bP=Xb("AlertDialogContent"),R0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Nn(n),l=y.useRef(null),s=pe(t,l),a=y.useRef(null);return c.jsx(lP,{contentName:ui,titleName:I0,docsSlug:"alert-dialog",children:c.jsx(kP,{scope:n,cancelRef:a,children:c.jsxs(mP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Z(i.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=a.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[c.jsx(bP,{children:r}),c.jsx(EP,{contentRef:l})]})})})});R0.displayName=ui;var I0="AlertDialogTitle",M0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Nn(n);return c.jsx(hP,{...i,...r,ref:t})});M0.displayName=I0;var O0="AlertDialogDescription",L0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Nn(n);return c.jsx(gP,{...i,...r,ref:t})});L0.displayName=O0;var NP="AlertDialogAction",D0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Nn(n);return c.jsx(j0,{...i,...r,ref:t})});D0.displayName=NP;var z0="AlertDialogCancel",F0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=CP(z0,n),o=Nn(n),l=pe(t,i);return c.jsx(j0,{...o,...r,ref:l})});F0.displayName=z0;var EP=({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 \`${O0}\` 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 y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},jP=T0,PP=_0,B0=A0,$0=R0,U0=D0,V0=F0,H0=M0,W0=L0;const nu=jP,TP=PP,K0=y.forwardRef(({className:e,...t},n)=>c.jsx(B0,{className:ae("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}));K0.displayName=B0.displayName;const Ll=y.forwardRef(({className:e,...t},n)=>c.jsxs(TP,{children:[c.jsx(K0,{}),c.jsx($0,{ref:n,className:ae("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})]}));Ll.displayName=$0.displayName;const Dl=({className:e,...t})=>c.jsx("div",{className:ae("flex flex-col space-y-2 text-center sm:text-left",e),...t});Dl.displayName="AlertDialogHeader";const zl=({className:e,...t})=>c.jsx("div",{className:ae("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zl.displayName="AlertDialogFooter";const Fl=y.forwardRef(({className:e,...t},n)=>c.jsx(H0,{ref:n,className:ae("text-lg font-semibold",e),...t}));Fl.displayName=H0.displayName;const Bl=y.forwardRef(({className:e,...t},n)=>c.jsx(W0,{ref:n,className:ae("text-sm text-muted-foreground",e),...t}));Bl.displayName=W0.displayName;const $l=y.forwardRef(({className:e,...t},n)=>c.jsx(U0,{ref:n,className:ae(Bd(),e),...t}));$l.displayName=U0.displayName;const Ul=y.forwardRef(({className:e,...t},n)=>c.jsx(V0,{ref:n,className:ae(Bd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Ul.displayName=V0.displayName;const G0=y.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ae("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}));G0.displayName="Textarea";function _P(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,RP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IP={};function Cm(e,t){return((t||IP).jsx?RP:AP).test(e)}const MP=/[ \t\n\f\r]/g;function OP(e){return typeof e=="object"?e.type==="text"?bm(e.value):!1:bm(e)}function bm(e){return e.replace(MP,"")===""}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 Q0(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 Pc(e){return e.toLowerCase()}class pt{constructor(t,n){this.attribute=n,this.property=t}}pt.prototype.attribute="";pt.prototype.booleanish=!1;pt.prototype.boolean=!1;pt.prototype.commaOrSpaceSeparated=!1;pt.prototype.commaSeparated=!1;pt.prototype.defined=!1;pt.prototype.mustUseProperty=!1;pt.prototype.number=!1;pt.prototype.overloadedBoolean=!1;pt.prototype.property="";pt.prototype.spaceSeparated=!1;pt.prototype.space=void 0;let LP=0;const J=_r(),Ie=_r(),Tc=_r(),$=_r(),ve=_r(),ci=_r(),ht=_r();function _r(){return 2**++LP}const _c=Object.freeze(Object.defineProperty({__proto__:null,boolean:J,booleanish:Ie,commaOrSpaceSeparated:ht,commaSeparated:ci,number:$,overloadedBoolean:Tc,spaceSeparated:ve},Symbol.toStringTag,{value:"Module"})),ru=Object.keys(_c);class af extends pt{constructor(t,n,r,i){let o=-1;if(super(t,n),Nm(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&$P.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Em,HP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Em.test(o)){let l=o.replace(BP,VP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=af}return new i(r,t)}function VP(e){return"-"+e.toLowerCase()}function HP(e){return e.charAt(1).toUpperCase()}const WP=Q0([Y0,DP,J0,Z0,e1],"html"),uf=Q0([Y0,zP,J0,Z0,e1],"svg");function KP(e){return e.join(" ").trim()}var cf={},jm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,GP=/\n/g,QP=/^\s*/,YP=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,qP=/^:\s*/,XP=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,JP=/^[;\s]*/,ZP=/^\s+|\s+$/g,eT=` +`,Pm="/",Tm="*",ur="",tT="comment",nT="declaration",rT=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 g=w.match(GP);g&&(n+=g.length);var S=w.lastIndexOf(eT);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(g){return g.position=new l(w),u(),g}}function l(w){this.start=w,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(w){var g=new Error(t.source+":"+n+":"+r+": "+w);if(g.reason=w,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function a(w){var g=w.exec(e);if(g){var S=g[0];return i(S),e=e.slice(S.length),g}}function u(){a(QP)}function f(w){var g;for(w=w||[];g=d();)g!==!1&&w.push(g);return w}function d(){var w=o();if(!(Pm!=e.charAt(0)||Tm!=e.charAt(1))){for(var g=2;ur!=e.charAt(g)&&(Tm!=e.charAt(g)||Pm!=e.charAt(g+1));)++g;if(g+=2,ur===e.charAt(g-1))return s("End of comment missing");var S=e.slice(2,g-2);return r+=2,i(S),e=e.slice(g),r+=2,w({type:tT,comment:S})}}function p(){var w=o(),g=a(YP);if(g){if(d(),!a(qP))return s("property missing ':'");var S=a(XP),v=w({type:nT,property:_m(g[0].replace(jm,ur)),value:S?_m(S[0].replace(jm,ur)):ur});return a(JP),v}}function m(){var w=[];f(w);for(var g;g=p();)g!==!1&&(w.push(g),f(w));return w}return u(),m()};function _m(e){return e?e.replace(ZP,ur):ur}var iT=Wl&&Wl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cf,"__esModule",{value:!0});cf.default=lT;var oT=iT(rT);function lT(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,oT.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 ua={};Object.defineProperty(ua,"__esModule",{value:!0});ua.camelCase=void 0;var sT=/^--[a-zA-Z0-9_-]+$/,aT=/-([a-z])/g,uT=/^[^-]+$/,cT=/^-(webkit|moz|ms|o|khtml)-/,dT=/^-(ms)-/,fT=function(e){return!e||uT.test(e)||sT.test(e)},pT=function(e,t){return t.toUpperCase()},Am=function(e,t){return"".concat(t,"-")},mT=function(e,t){return t===void 0&&(t={}),fT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(dT,Am):e=e.replace(cT,Am),e.replace(aT,pT))};ua.camelCase=mT;var hT=Wl&&Wl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gT=hT(cf),yT=ua;function Ac(e,t){var n={};return!e||typeof e!="string"||(0,gT.default)(e,function(r,i){r&&i&&(n[(0,yT.camelCase)(r,t)]=i)}),n}Ac.default=Ac;var vT=Ac;const xT=_s(vT),t1=n1("end"),df=n1("start");function n1(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 wT(e){const t=df(e),n=t1(e);if(t&&n)return{start:t,end:n}}function ao(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rm(e.position):"start"in e||"end"in e?Rm(e):"line"in e||"column"in e?Rc(e):""}function Rc(e){return Im(e&&e.line)+":"+Im(e&&e.column)}function Rm(e){return Rc(e&&e.start)+"-"+Rc(e&&e.end)}function Im(e){return e&&typeof e=="number"?e:1}class Je 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}}Je.prototype.file="";Je.prototype.name="";Je.prototype.reason="";Je.prototype.message="";Je.prototype.stack="";Je.prototype.column=void 0;Je.prototype.line=void 0;Je.prototype.ancestors=void 0;Je.prototype.cause=void 0;Je.prototype.fatal=void 0;Je.prototype.place=void 0;Je.prototype.ruleId=void 0;Je.prototype.source=void 0;const ff={}.hasOwnProperty,ST=new Map,kT=/[A-Z]/g,CT=new Set(["table","tbody","thead","tfoot","tr"]),bT=new Set(["td","th"]),r1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function NT(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=IT(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=RT(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"?uf:WP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=i1(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function i1(e,t,n){if(t.type==="element")return ET(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return jT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return TT(e,t,n);if(t.type==="mdxjsEsm")return PT(e,t);if(t.type==="root")return _T(e,t,n);if(t.type==="text")return AT(e,t)}function ET(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=uf,e.schema=i),e.ancestors.push(t);const o=l1(e,t.tagName,!1),l=MT(e,t);let s=mf(e,t);return CT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!OP(a):!0})),o1(e,l,o,t),pf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function jT(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)}Io(e,t.position)}function PT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Io(e,t.position)}function TT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=uf,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:l1(e,t.name,!0),l=OT(e,t),s=mf(e,t);return o1(e,l,o,t),pf(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function _T(e,t,n){const r={};return pf(r,mf(e,t)),e.create(t,e.Fragment,r,n)}function AT(e,t){return t.value}function o1(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function pf(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function RT(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function IT(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=df(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 MT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ff.call(t.properties,i)){const o=LT(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&bT.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 OT(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 Io(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 Io(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function mf(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ST;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?(an(e,e.length,0,t),e):t}const Lm={}.hasOwnProperty;function HT(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 tn=lr(/[A-Za-z]/),xt=lr(/[\dA-Za-z]/),GT=lr(/[#-'*+\--9=?A-Z^-~]/);function Ic(e){return e!==null&&(e<32||e===127)}const Mc=lr(/\d/),QT=lr(/[\dA-Fa-f]/),YT=lr(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function ft(e){return e!==null&&(e<0||e===32)}function fe(e){return e===-2||e===-1||e===32}const qT=lr(/\p{P}|\p{S}/u),XT=lr(/\s/);function lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ii(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 we(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return fe(a)?(e.enter(n),s(a)):t(a)}function s(a){return fe(a)&&o++l))return;const j=t.events.length;let _=j,F,M;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(F){M=t.events[_][1].end;break}F=!0}for(v(r),N=j;Nx;){const E=n[C];t.containerState=E[1],E[0].exit.call(t,e)}n.length=x}function h(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function n_(e,t,n){return we(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zm(e){if(e===null||ft(e)||XT(e))return 1;if(qT(e))return 2}function gf(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};Fm(d,-a),Fm(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},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Pt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Pt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=Pt(u,gf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Pt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Pt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,an(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&fe(N)?we(e,h,"linePrefix",o+1)(N):h(N)}function h(N){return N===null||q(N)?e.check(Bm,g,C)(N):(e.enter("codeFlowValue"),x(N))}function x(N){return N===null||q(N)?(e.exit("codeFlowValue"),h(N)):(e.consume(N),x)}function C(N){return e.exit("codeFenced"),t(N)}function E(N,j,_){let F=0;return M;function M(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),A}function A(L){return N.enter("codeFencedFence"),fe(L)?we(N,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):R(L)}function R(L){return L===s?(N.enter("codeFencedFenceSequence"),U(L)):_(L)}function U(L){return L===s?(F++,N.consume(L),U):F>=l?(N.exit("codeFencedFenceSequence"),fe(L)?we(N,H,"whitespace")(L):H(L)):_(L)}function H(L){return L===null||q(L)?(N.exit("codeFencedFence"),j(L)):_(L)}}}function m_(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 ou={name:"codeIndented",tokenize:g_},h_={partial:!0,tokenize:y_};function g_(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),we(e,o,"linePrefix",4+1)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):q(u)?e.attempt(h_,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||q(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function y_(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):q(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):we(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):q(l)?i(l):n(l)}}const v_={name:"codeText",previous:w_,resolve:x_,tokenize:S_};function x_(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 p1(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),p):v===null||v===32||v===41||Ic(v)?n(v):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(v))}function p(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(s),p(v)):v===null||v===60||q(v)?n(v):(e.consume(v),v===92?w:m)}function w(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function g(v){return!f&&(v===null||v===41||ft(v))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(v)):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):q(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||q(m)||s++>999?(e.exit("chunkString"),f(m)):(e.consume(m),a||(a=!fe(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function h1(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),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?n(p):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),we(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||q(p)?(e.exit("chunkString"),u(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 q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):fe(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const T_={name:"definition",tokenize:A_},__={partial:!0,tokenize:R_};function A_(e,t,n){const r=this;let i;return o;function o(m){return e.enter("definition"),l(m)}function l(m){return m1.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 ft(m)?uo(e,u)(m):u(m)}function u(m){return p1(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(__,d,d)(m)}function d(m){return fe(m)?we(e,p,"whitespace")(m):p(m)}function p(m){return m===null||q(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function R_(e,t,n){return r;function r(s){return ft(s)?uo(e,i)(s):n(s)}function i(s){return h1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return fe(s)?we(e,l,"whitespace")(s):l(s)}function l(s){return s===null||q(s)?t(s):n(s)}}const I_={name:"hardBreakEscape",tokenize:M_};function M_(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return q(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const O_={name:"headingAtx",resolve:L_,tokenize:D_};function L_(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"},an(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function D_(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||ft(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||q(f)?(e.exit("atxHeading"),t(f)):fe(f)?we(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||ft(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const z_=["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"],Um=["pre","script","style","textarea"],F_={concrete:!0,name:"htmlFlow",resolveTo:U_,tokenize:V_},B_={partial:!0,tokenize:W_},$_={partial:!0,tokenize:H_};function U_(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 V_(e,t,n){const r=this;let i,o,l,s,a;return u;function u(b){return f(b)}function f(b){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(b),d}function d(b){return b===33?(e.consume(b),p):b===47?(e.consume(b),o=!0,g):b===63?(e.consume(b),i=3,r.interrupt?t:k):tn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function p(b){return b===45?(e.consume(b),i=2,m):b===91?(e.consume(b),i=5,s=0,w):tn(b)?(e.consume(b),i=4,r.interrupt?t:k):n(b)}function m(b){return b===45?(e.consume(b),r.interrupt?t:k):n(b)}function w(b){const X="CDATA[";return b===X.charCodeAt(s++)?(e.consume(b),s===X.length?r.interrupt?t:R:w):n(b)}function g(b){return tn(b)?(e.consume(b),l=String.fromCharCode(b),S):n(b)}function S(b){if(b===null||b===47||b===62||ft(b)){const X=b===47,ge=l.toLowerCase();return!X&&!o&&Um.includes(ge)?(i=1,r.interrupt?t(b):R(b)):z_.includes(l.toLowerCase())?(i=6,X?(e.consume(b),v):r.interrupt?t(b):R(b)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(b):o?h(b):x(b))}return b===45||xt(b)?(e.consume(b),l+=String.fromCharCode(b),S):n(b)}function v(b){return b===62?(e.consume(b),r.interrupt?t:R):n(b)}function h(b){return fe(b)?(e.consume(b),h):M(b)}function x(b){return b===47?(e.consume(b),M):b===58||b===95||tn(b)?(e.consume(b),C):fe(b)?(e.consume(b),x):M(b)}function C(b){return b===45||b===46||b===58||b===95||xt(b)?(e.consume(b),C):E(b)}function E(b){return b===61?(e.consume(b),N):fe(b)?(e.consume(b),E):x(b)}function N(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),a=b,j):fe(b)?(e.consume(b),N):_(b)}function j(b){return b===a?(e.consume(b),a=null,F):b===null||q(b)?n(b):(e.consume(b),j)}function _(b){return b===null||b===34||b===39||b===47||b===60||b===61||b===62||b===96||ft(b)?E(b):(e.consume(b),_)}function F(b){return b===47||b===62||fe(b)?x(b):n(b)}function M(b){return b===62?(e.consume(b),A):n(b)}function A(b){return b===null||q(b)?R(b):fe(b)?(e.consume(b),A):n(b)}function R(b){return b===45&&i===2?(e.consume(b),O):b===60&&i===1?(e.consume(b),D):b===62&&i===4?(e.consume(b),G):b===63&&i===3?(e.consume(b),k):b===93&&i===5?(e.consume(b),B):q(b)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(B_,Y,U)(b)):b===null||q(b)?(e.exit("htmlFlowData"),U(b)):(e.consume(b),R)}function U(b){return e.check($_,H,Y)(b)}function H(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),L}function L(b){return b===null||q(b)?U(b):(e.enter("htmlFlowData"),R(b))}function O(b){return b===45?(e.consume(b),k):R(b)}function D(b){return b===47?(e.consume(b),l="",T):R(b)}function T(b){if(b===62){const X=l.toLowerCase();return Um.includes(X)?(e.consume(b),G):R(b)}return tn(b)&&l.length<8?(e.consume(b),l+=String.fromCharCode(b),T):R(b)}function B(b){return b===93?(e.consume(b),k):R(b)}function k(b){return b===62?(e.consume(b),G):b===45&&i===2?(e.consume(b),k):R(b)}function G(b){return b===null||q(b)?(e.exit("htmlFlowData"),Y(b)):(e.consume(b),G)}function Y(b){return e.exit("htmlFlow"),t(b)}}function H_(e,t,n){const r=this;return i;function i(l){return q(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 W_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ca,t,n)}}const K_={name:"htmlText",tokenize:G_};function G_(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),E):k===63?(e.consume(k),x):tn(k)?(e.consume(k),_):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,w):tn(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):q(k)?(l=d,D(k)):(e.consume(k),d)}function p(k){return k===45?(e.consume(k),m):d(k)}function m(k){return k===62?O(k):k===45?p(k):d(k)}function w(k){const G="CDATA[";return k===G.charCodeAt(o++)?(e.consume(k),o===G.length?g:w):n(k)}function g(k){return k===null?n(k):k===93?(e.consume(k),S):q(k)?(l=g,D(k)):(e.consume(k),g)}function S(k){return k===93?(e.consume(k),v):g(k)}function v(k){return k===62?O(k):k===93?(e.consume(k),v):g(k)}function h(k){return k===null||k===62?O(k):q(k)?(l=h,D(k)):(e.consume(k),h)}function x(k){return k===null?n(k):k===63?(e.consume(k),C):q(k)?(l=x,D(k)):(e.consume(k),x)}function C(k){return k===62?O(k):x(k)}function E(k){return tn(k)?(e.consume(k),N):n(k)}function N(k){return k===45||xt(k)?(e.consume(k),N):j(k)}function j(k){return q(k)?(l=j,D(k)):fe(k)?(e.consume(k),j):O(k)}function _(k){return k===45||xt(k)?(e.consume(k),_):k===47||k===62||ft(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),O):k===58||k===95||tn(k)?(e.consume(k),M):q(k)?(l=F,D(k)):fe(k)?(e.consume(k),F):O(k)}function M(k){return k===45||k===46||k===58||k===95||xt(k)?(e.consume(k),M):A(k)}function A(k){return k===61?(e.consume(k),R):q(k)?(l=A,D(k)):fe(k)?(e.consume(k),A):F(k)}function R(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,U):q(k)?(l=R,D(k)):fe(k)?(e.consume(k),R):(e.consume(k),H)}function U(k){return k===i?(e.consume(k),i=void 0,L):k===null?n(k):q(k)?(l=U,D(k)):(e.consume(k),U)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||ft(k)?F(k):(e.consume(k),H)}function L(k){return k===47||k===62||ft(k)?F(k):n(k)}function O(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function D(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),T}function T(k){return fe(k)?we(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):B(k)}function B(k){return e.enter("htmlTextData"),l(k)}}const yf={name:"labelEnd",resolveAll:X_,resolveTo:J_,tokenize:Z_},Q_={tokenize:eA},Y_={tokenize:tA},q_={tokenize:nA};function X_(e){let t=-1;const n=[];for(;++t=3&&(u===null||q(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),fe(u)?we(e,s,"whitespace")(u):s(u))}}const it={continuation:{tokenize:fA},exit:mA,name:"list",tokenize:dA},uA={partial:!0,tokenize:hA},cA={partial:!0,tokenize:pA};function dA(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:Mc(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(Vl,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(m)}return n(m)}function a(m){return Mc(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"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(ca,r.interrupt?n:f,e.attempt(uA,p,d))}function f(m){return r.containerState.initialBlankLine=!0,o++,p(m)}function d(m){return fe(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 fA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ca,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!fe(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(cA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(it,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function pA(e,t,n){const r=this;return we(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 mA(e){e.exit(this.containerState.type)}function hA(e,t,n){const r=this;return we(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!fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Vm={name:"setextUnderline",resolveTo:gA,tokenize:yA};function gA(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 yA(e,t,n){const r=this;let i;return o;function o(u){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=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),fe(u)?we(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||q(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const vA={tokenize:xA};function xA(e){const t=this,n=e.attempt(ca,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(b_,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 wA={resolveAll:y1()},SA=g1("string"),kA=g1("text");function g1(e){return{resolveAll:y1(e==="text"?CA: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 u(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 u(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function u(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 LA(e,t){let n=-1;const r=[];let i;for(;++n0){const Se=V.tokenStack[V.tokenStack.length-1];(Se[1]||Wm).call(V,void 0,Se[0])}for(P.position={start:Pn(I.length>0?I[0][1].start:{line:1,column:1,offset:0}),end:Pn(I.length>0?I[I.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function ZA(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 eR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function w1(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 tR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return w1(e,t);const i={src:Ii(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 nR(e,t){const n={src:Ii(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 rR(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 iR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return w1(e,t);const i={href:Ii(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 oR(e,t){const n={href:Ii(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 lR(e,t,n){const r=e.all(t),i=n?sR(n):S1(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 aR(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=df(t.children[1]),a=t1(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 pR(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Qm(t.slice(i),i>0,!1)),o.join("")}function Qm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Km||o===Gm;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Km||o===Gm;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gR(e,t){const n={type:"text",value:hR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vR={blockquote:GA,break:QA,code:YA,delete:qA,emphasis:XA,footnoteReference:JA,heading:ZA,html:eR,imageReference:tR,image:nR,inlineCode:rR,linkReference:iR,link:oR,listItem:lR,list:aR,paragraph:uR,root:cR,strong:dR,table:fR,tableCell:mR,tableRow:pR,text:gR,thematicBreak:yR,toml:gl,yaml:gl,definition:gl,footnoteDefinition:gl};function gl(){}const k1=-1,da=0,co=1,Ps=2,vf=3,xf=4,wf=5,Sf=6,C1=7,b1=8,Ym=typeof self=="object"?self:globalThis,xR=(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 da:case k1:return n(l,i);case co:{const s=n([],i);for(const a of l)s.push(r(a));return s}case Ps:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case vf:return n(new Date(l),i);case xf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case wf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case Sf:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case C1:{const{name:s,message:a}=l;return n(new Ym[s](a),i)}case b1: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 Ym[o](l),i)};return r},qm=e=>xR(new Map,e)(0),zr="",{toString:wR}={},{keys:SR}=Object,Gi=e=>{const t=typeof e;if(t!=="object"||!e)return[da,t];const n=wR.call(e).slice(8,-1);switch(n){case"Array":return[co,zr];case"Object":return[Ps,zr];case"Date":return[vf,zr];case"RegExp":return[xf,zr];case"Map":return[wf,zr];case"Set":return[Sf,zr];case"DataView":return[co,n]}return n.includes("Array")?[co,n]:n.includes("Error")?[C1,n]:[Ps,n]},yl=([e,t])=>e===da&&(t==="function"||t==="symbol"),kR=(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 da:{let f=l;switch(a){case"bigint":s=b1,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([k1],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 Ps:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],d=i([s,f],l);for(const p of SR(l))(e||!yl(Gi(l[p])))&&f.push([o(p),o(l[p])]);return d}case vf:return i([s,l.toISOString()],l);case xf:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case wf:{const f=[],d=i([s,f],l);for(const[p,m]of l)(e||!(yl(Gi(p))||yl(Gi(m))))&&f.push([o(p),o(m)]);return d}case Sf:{const f=[],d=i([s,f],l);for(const p of l)(e||!yl(Gi(p)))&&f.push(o(p));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Xm=(e,{json:t,lossy:n}={})=>{const r=[];return kR(!(t||n),!!t,new Map,r)(e),r},Ts=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?qm(Xm(e,t)):structuredClone(e):(e,t)=>qm(Xm(e,t));function CR(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 bR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function NR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||CR,r=e.options.footnoteBackLabel||bR,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 v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ts(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 N1=function(e){if(e==null)return TR;if(typeof e=="function")return fa(e);if(typeof e=="object")return Array.isArray(e)?ER(e):jR(e);if(typeof e=="string")return PR(e);throw new Error("Expected function, string, or object as test")};function ER(e){const t=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let m=E1,w,g,S;if((!t||o(a,u,f[f.length-1]||void 0))&&(m=MR(n(a,f)),m[0]===Jm))return m;if("children"in a&&a.children){const v=a;if(v.children&&m[0]!==RR)for(g=(r?v.children.length:-1)+l,S=f.concat(v);g>-1&&g0&&n.push({type:"text",value:` +`}),n}function Zm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eh(e,t){const n=LR(e,t),r=n.one(e,void 0),i=NR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function $R(e,t){return e&&"run"in e?async function(n,r){const i=eh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return eh(n,{file:r,...e||t})}}function th(e){if(e)throw e}var Hl=Object.prototype.hasOwnProperty,P1=Object.prototype.toString,nh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,ih=function(t){return typeof Array.isArray=="function"?Array.isArray(t):P1.call(t)==="[object Array]"},oh=function(t){if(!t||P1.call(t)!=="[object Object]")return!1;var n=Hl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Hl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Hl.call(t,i)},lh=function(t,n){nh&&n.name==="__proto__"?nh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},sh=function(t,n){if(n==="__proto__")if(Hl.call(t,n)){if(rh)return rh(t,n).value}else return;return t[n]},UR=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=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(u){const f=u;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 Jt={basename:WR,dirname:KR,extname:GR,join:QR,sep:"/"};function WR(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 KR(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 GR(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 QR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qR(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 XR={cwd:JR};function JR(){return"/"}function zc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZR(e){if(typeof e=="string")e=new URL(e);else if(!zc(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 eI(e)}function eI(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 g=r[p][1];Dc(g)&&Dc(m)&&(m=su(!0,g,m)),r[p]=[u,m,...w]}}}}const iI=new kf().freeze();function du(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pu(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 uh(e){if(!Dc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ch(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vl(e){return oI(e)?e:new T1(e)}function oI(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lI(e){return typeof e=="string"||sI(e)}function sI(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aI="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dh=[],fh={allowDangerousHtml:!0},uI=/^(https?|ircs?|mailto|xmpp)$/i,cI=[{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 dI(e){const t=fI(e),n=pI(e);return mI(t.runSync(t.parse(n),n),e)}function fI(e){const t=e.rehypePlugins||dh,n=e.remarkPlugins||dh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fh}:fh;return iI().use(KA).use(n).use($R,r).use(t)}function pI(e){const t=e.children||"",n=new T1;return typeof t=="string"&&(n.value=t),n}function mI(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||hI;for(const f of cI)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+aI+f.id,void 0);return j1(e,u),NT(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(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 iu)if(Object.hasOwn(iu,m)&&Object.hasOwn(f.properties,m)){const w=f.properties[m],g=iu[m];(g===null||g.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 hI(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||uI.test(e.slice(0,t))?e:""}const _1=y.forwardRef(({className:e,messages:t,input:n,handleInputChange:r,handleSubmit:i,isGenerating:o,stop:l,...s},a)=>{const u=y.useRef(null),f=()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})};return y.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]),c.jsxs("div",{className:ae("flex h-full flex-col",e),ref:a,...s,children:[c.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[t.length===0?c.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:c.jsx("p",{children:"No messages yet. Start a conversation!"})}):t.map((d,p)=>c.jsxs("div",{className:ae("flex gap-3 w-full",d.role==="user"?"justify-end":"justify-start"),children:[d.role!=="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-primary flex items-center justify-center flex-shrink-0",children:c.jsx(Jr,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:ae("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:[c.jsxs("div",{className:"text-xs opacity-70 flex items-center gap-2",children:[c.jsx("span",{children:d.role==="user"?"You":d.assistantInfo?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-medium",children:d.assistantInfo.name}),d.assistantInfo.type!=="default"&&c.jsx("span",{className:ae("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&&c.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["(from ",d.assistantInfo.originalTemplate,")"]})]}):"Assistant"}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["#",p+1]})]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(dI,{components:{p:({children:m})=>c.jsx("p",{className:"mb-2 last:mb-0",children:m}),ul:({children:m})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:m}),ol:({children:m})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:m}),li:({children:m})=>c.jsx("li",{className:"mb-1",children:m}),code:({children:m,className:w})=>!w?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:m}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:m}),pre:({children:m})=>c.jsx("div",{className:"mb-2 last:mb-0",children:m}),strong:({children:m})=>c.jsx("strong",{className:"font-semibold",children:m}),em:({children:m})=>c.jsx("em",{className:"italic",children:m}),blockquote:({children:m})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:m}),h1:({children:m})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:m}),h2:({children:m})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:m}),h3:({children:m})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:m})},children:d.content})})]}),d.role==="user"&&c.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0",children:c.jsx(Jy,{className:"h-4 w-4"})})]},`${d.id}-${p}`)),c.jsx("div",{ref:u})]}),c.jsx("div",{className:"border-t p-4",children:c.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[c.jsx(G0,{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?c.jsx(Ae,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(Mb,{className:"h-4 w-4"})}):c.jsx(Ae,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(Eb,{className:"h-4 w-4"})})]})})]})});_1.displayName="Chat";const qt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function A1(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function gI(){return A1()}class yI{getAllSessions(){const t=localStorage.getItem(qt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:A1(),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(qt.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(qt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(qt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(qt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:gI(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(qt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(qt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(qt.currentSession,t)}clear(){localStorage.removeItem(qt.sessions),localStorage.removeItem(qt.currentSession)}}const _e=new yI;function vI(e={}){const{api_endpoint:t=`${window.location.origin}/generate`,defaultModel:n="Qwen/Qwen3-30B-A3B",defaultSystemPrompt:r=""}=e,[i,o]=y.useState([]),[l,s]=y.useState(null),[a,u]=y.useState(""),[f,d]=y.useState({isLoading:!1,error:null}),[p,m]=y.useState(n),[w,g]=y.useState(r),[S,v]=y.useState(.7),[h,x]=y.useState(1024),C=zt.useMemo(()=>{var O;const L=i.find(D=>D.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!L,messageCount:((O=L==null?void 0:L.messages)==null?void 0:O.length)||0,sessionTitle:(L==null?void 0:L.title)||"No session"}),L},[i,l]),E=zt.useMemo(()=>{const L=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",L.length,L.map(O=>({id:O.id,role:O.role}))),L},[C==null?void 0:C.messages]);y.useEffect(()=>{const L=_e.getAllSessions();o(L);const O=_e.getCurrentSession();O&&s(O.id)},[]);const N=y.useCallback(()=>{const L=_e.createSession(void 0,p,w),O=_e.getAllSessions();return o([...O]),s(L.id),_e.setCurrentSession(L.id),L.id},[p,w]),j=y.useCallback(L=>{console.log("selectSession called with:",L),s(L),_e.setCurrentSession(L),console.log("currentSessionId updated to:",L)},[]),_=y.useCallback(L=>{_e.deleteSession(L);const O=_e.getAllSessions();o([...O]),l===L&&(O.length>0?(s(O[0].id),_e.setCurrentSession(O[0].id)):s(null))},[l]),F=y.useCallback((L,O)=>{_e.updateSession(L,{title:O});const D=_e.getAllSessions();o([...D])},[]),M=y.useCallback(L=>{if(!l)return;_e.addMessageToSession(l,L);const O=_e.getAllSessions();o([...O])},[l]),A=y.useCallback(async L=>{var T,B;if(!a.trim()||f.isLoading)return;let O=l;O||(O=N());const D=a.trim();if(u(""),d({isLoading:!0,error:null}),O){_e.addMessageToSession(O,{role:"user",content:D});const k=_e.getAllSessions();o([...k])}try{const k=_e.getSession(O),G=((B=(T=k==null?void 0:k.messages)==null?void 0:T.filter(X=>X.role!=="system"))==null?void 0:B.map(X=>({role:X.role,content:X.content})))||[],Y=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:D,messages:G,system_prompt:w||null,model_name:p,temperature:S,max_new_tokens:h})});if(!Y.ok){const X=await Y.json();throw new Error(X.detail||`HTTP error! status: ${Y.status}`)}const b=await Y.json();if(O){_e.addMessageToSession(O,{role:"assistant",content:b.content,thinking_content:b.thinking_content,model_used:b.model_used,supports_thinking:b.supports_thinking,assistantInfo:L});const X=_e.getAllSessions();o([...X])}d({isLoading:!1,error:null})}catch(k){const G=k instanceof Error?k.message:"An error occurred";if(d({isLoading:!1,error:G}),O){_e.addMessageToSession(O,{role:"assistant",content:`Sorry, I encountered an error: ${G}`,assistantInfo:L});const Y=_e.getAllSessions();o([...Y])}}},[a,f.isLoading,l,N,M,w,E.length,t,p,S,h]),R=y.useCallback(()=>{d({isLoading:!1,error:null})},[]),U=y.useCallback(()=>{_e.clear(),o([]),s(null)},[]),H=y.useCallback(()=>{s(null),localStorage.removeItem("edge-llm-current-session")},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:N,selectSession:j,deleteSession:_,renameSession:F,clearAllSessions:U,clearCurrentSession:H,messages:E,input:a,setInput:u,sendMessage:A,stopGeneration:R,isLoading:f.isLoading,error:f.error,selectedModel:p,setSelectedModel:m,systemPrompt:w,setSystemPrompt:g,temperature:S,setTemperature:v,maxTokens:h,setMaxTokens:x}}function xI(){const{sessions:e,currentSessionId:t,selectSession:n,deleteSession:r,clearCurrentSession:i,messages:o,input:l,setInput:s,sendMessage:a,stopGeneration:u,isLoading:f,selectedModel:d,setSelectedModel:p,systemPrompt:m,setSystemPrompt:w,temperature:g,setTemperature:S,maxTokens:v,setMaxTokens:h}=vI(),[x,C]=y.useState(!1),[E,N]=y.useState(!1),[j,_]=y.useState(null),[F,M]=y.useState(!1),[A,R]=y.useState(null),[U,H]=y.useState([]),[L,O]=y.useState([]),[D,T]=y.useState(null),[B,k]=y.useState(!1),[G,Y]=y.useState(""),[b,X]=y.useState(!1),[ge,ne]=y.useState(""),Q=()=>{try{const P=JSON.parse(localStorage.getItem("savedAssistants")||"[]");O(P)}catch(P){console.error("Failed to load saved assistants:",P)}},oe=()=>{if(!m.trim())return;let P="My Assistant";D&&(D.type==="new"?P=D.name:D.type==="template"?P=`My ${D.name}`:P=D.name+" Copy"),Y(P),k(!0)},ye=()=>{if(!G.trim()||!m.trim())return;const P={id:Date.now().toString(),name:G.trim(),systemPrompt:m,temperature:g,maxTokens:v,model:d,createdAt:new Date().toISOString()},V=[...L,P];O(V),localStorage.setItem("savedAssistants",JSON.stringify(V)),T({id:P.id,name:P.name,type:"user"}),k(!1),Y("")},le=()=>{k(!1),Y("")},ue=P=>{const V=L.find(K=>K.id===P);V&&(w(V.systemPrompt),S(V.temperature),h(V.maxTokens),V.model&&p(V.model),T({id:V.id,name:V.name,type:"user"}))},ce=[{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."}],$e=P=>{const V=ce.find(K=>K.name===P);V&&(w(V.prompt),T({id:P,name:V.name,type:"template"}))},rt=()=>{w(""),S(.7),h(1024),T({id:"new_assistant",name:"New Assistant",type:"new"})},Gt=()=>{T(null)},Qt=()=>{D&&(ne(D.name),X(!0))},It=()=>{if(!D||!ge.trim())return;const P={...D,name:ge.trim()};if(T(P),D.type==="user"){const V=L.map(K=>K.id===D.id?{...K,name:ge.trim()}:K);O(V),localStorage.setItem("savedAssistants",JSON.stringify(V))}X(!1),ne("")},Ar=()=>{X(!1),ne("")},cn=()=>({name:(D==null?void 0:D.name)||"Default Assistant",type:(D==null?void 0:D.type)||"default",systemPrompt:m,temperature:g,maxTokens:v,originalTemplate:D==null?void 0:D.originalTemplate}),Rr=()=>{D&&D.type==="template"&&T({id:"new_assistant",name:`Custom ${D.name}`,type:"new",originalTemplate:D.name})},pa=P=>{w(P),Rr()},ma=P=>{S(P),Rr()},ha=P=>{h(P),Rr()};y.useEffect(()=>{I(),Q()},[]),y.useEffect(()=>{console.log("Sidebar states:",{sessionsCollapsed:x,configCollapsed:E,sessionsCount:e.length,currentSessionId:t})},[x,E,e.length,t]),y.useEffect(()=>{console.log("Rendering sessions:",e.length,e.map(P=>({id:P.id,title:P.title})))},[e]),y.useEffect(()=>{if(d&&!U.find(P=>P.model_name===d)){const P=U[0];P&&p(P.model_name)}},[U,d,p]),y.useEffect(()=>{(async()=>{if(!d||!U.length)return;const V=U.find(Se=>Se.model_name===d);if(!V)return;const K=`${window.location.protocol}//${window.location.host}`;if(V.type==="local"&&!V.is_loaded){R(V),M(!0);return}const ee=U.filter(Se=>Se.type==="local"&&Se.is_loaded&&Se.model_name!==d);for(const Se of ee)try{(await fetch(`${K}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:Se.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${Se.model_name}`)}catch(Nt){console.error(`Error auto-unloading model ${Se.model_name}:`,Nt)}ee.length>0&&I()})()},[d,U]);const ga=async()=>{if(A){M(!1),_(A.model_name);try{const P=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${P}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:A.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${A.model_name}`),I();else{console.error(`❌ Failed to load model: ${A.model_name}`);const K=U.find(ee=>ee.type==="api");K&&p(K.model_name)}}catch(P){console.error("Error loading model:",P);const V=U.find(K=>K.type==="api");V&&p(V.model_name)}finally{_(null),R(null)}}},ya=()=>{M(!1),R(null);const P=U.find(V=>V.type==="api");P&&p(P.model_name)};y.useEffect(()=>{const P=async()=>{const V=`${window.location.protocol}//${window.location.host}`,K=U.filter(ee=>ee.type==="local"&&ee.is_loaded);for(const ee of K)try{await fetch(`${V}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ee.model_name})}),console.log(`✅ Cleanup: unloaded ${ee.model_name}`)}catch(Se){console.error(`Error cleaning up model ${ee.model_name}:`,Se)}};return()=>{P()}},[U]);const I=async()=>{try{const P=`${window.location.protocol}//${window.location.host}`,V=await fetch(`${P}/models`);if(V.ok){const K=await V.json();if(H(K.models),K.current_model&&d!==K.current_model)p(K.current_model);else if(!d&&K.models.length>0){const Se=K.models.find(Nt=>Nt.type==="api")||K.models[0];p(Se.model_name)}}}catch(P){console.error("Failed to fetch models:",P)}};return c.jsxs("div",{className:"h-screen bg-background flex",children:[c.jsx("div",{className:` + bg-background border-r flex-shrink-0 transition-all duration-300 ease-in-out + ${x?"w-12":"w-80"} + `,children:c.jsxs("div",{className:"p-4 space-y-4 h-full",children:[c.jsxs("div",{className:`flex items-center ${x?"justify-center":"justify-between"}`,children:[!x&&c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs("div",{className:"flex gap-1",children:[!x&&c.jsxs(Ae,{onClick:i,size:"sm",children:[c.jsx(xs,{className:"h-4 w-4 mr-1"}),"New"]}),c.jsx(Ae,{onClick:()=>C(!x),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:x?"Expand Sessions":"Collapse Sessions",children:x?c.jsx(Kp,{className:"h-4 w-4"}):c.jsx(Wp,{className:"h-4 w-4"})})]})]}),x&&c.jsx(Ae,{onClick:i,size:"sm",variant:"ghost",className:"w-full p-2",children:c.jsx(xs,{className:"h-4 w-4"})}),c.jsxs("div",{className:"space-y-2",children:[!x&&e.map(P=>c.jsxs(Fe,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${t===P.id?"bg-accent border-primary":""}`,onClick:()=>{console.log("Session card clicked:",P.id,P.title),n(P.id)},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:P.title}),c.jsx(Ae,{size:"sm",variant:"ghost",onClick:V=>{V.stopPropagation(),r(P.id)},className:"h-6 w-6 p-0",children:c.jsx(qy,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[P.messages.length," messages"]})]},P.id)),x&&e.map(P=>c.jsxs(Ae,{variant:t===P.id?"default":"ghost",size:"sm",className:"w-full p-1 h-8 relative",title:P.title,onClick:()=>{console.log("Session icon clicked:",P.id,P.title),n(P.id)},children:[c.jsx(Qs,{className:"h-4 w-4"}),P.messages&&P.messages.length>0&&c.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(P.messages.length,9)})]},P.id))]})]})}),c.jsx("div",{className:"flex-1 flex flex-col h-full",children:c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsx("div",{className:"flex-1 flex flex-col",children:c.jsx(_1,{messages:o.map(P=>({id:P.id,role:P.role,content:P.content,createdAt:new Date(P.timestamp),assistantInfo:P.assistantInfo})),input:l,handleInputChange:P=>s(P.target.value),handleSubmit:async P=>{if(P.preventDefault(),!d||!U.find(K=>K.model_name===d))return;const V=cn();await a(V)},isGenerating:f,stop:u,className:"flex-1"})}),c.jsx("div",{className:` + border-l bg-background flex-shrink-0 transition-all duration-300 ease-in-out + ${E?"w-12":"w-[480px] xl:w-[520px]"} + `,children:c.jsxs("div",{className:"p-4 space-y-4 h-full",children:[c.jsxs("div",{className:`flex items-center ${E?"justify-center":"justify-between"}`,children:[!E&&c.jsx("h2",{className:"font-semibold",children:"Configuration"}),c.jsx("div",{className:"flex gap-1",children:c.jsx(Ae,{onClick:()=>N(!E),size:"sm",variant:"ghost",className:"h-8 w-8 p-0 hover:bg-gray-100",title:E?"Expand Configuration":"Collapse Configuration",children:E?c.jsx(Wp,{className:"h-4 w-4"}):c.jsx(Kp,{className:"h-4 w-4"})})})]}),E&&c.jsx(Ae,{size:"sm",variant:"ghost",className:"w-full p-2 invisible",children:c.jsx(oi,{className:"h-4 w-4"})}),c.jsx("div",{className:"space-y-2",children:!E&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-b bg-white p-4 -mx-4",children:c.jsx(SI,{savedAssistants:L,loadSavedAssistant:ue,openSaveDialog:oe,presets:ce,onPresetSelect:$e,isLoading:f,selectedAssistant:D,createNewAssistant:rt,clearCurrentAssistant:Gt,openRenameDialog:Qt,systemPrompt:m})}),c.jsxs(IN,{defaultValue:"parameters",className:"flex-1 flex flex-col -mx-4",children:[c.jsxs(kv,{className:"grid w-full grid-cols-3 m-4 mb-0",children:[c.jsxs(Al,{value:"parameters",className:"flex items-center gap-2",children:[c.jsx(Rb,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Parameters"})]}),c.jsxs(Al,{value:"instructions",className:"flex items-center gap-2",children:[c.jsx(oi,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Instructions"})]}),c.jsxs(Al,{value:"documents",className:"flex items-center gap-2",children:[c.jsx(zd,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Documents"})]})]}),c.jsxs("div",{className:"flex-1 overflow-hidden",children:[c.jsx(Rl,{value:"parameters",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(wI,{models:U,selectedModel:d,setSelectedModel:p,autoLoadingModel:j,temperature:g,setTemperature:ma,maxTokens:v,setMaxTokens:ha})}),c.jsx(Rl,{value:"instructions",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(kI,{systemPrompt:m,setSystemPrompt:pa,isLoading:f})}),c.jsx(Rl,{value:"documents",className:"p-6 space-y-6 m-0 h-full overflow-y-auto",children:c.jsx(CI,{isLoading:f})})]})]})]})})]})})]})}),c.jsx(nu,{open:F,onOpenChange:M,children:c.jsxs(Ll,{children:[c.jsxs(Dl,{children:[c.jsx(Fl,{children:"Load Local Model"}),c.jsxs(Bl,{children:["Loading ",c.jsx("strong",{children:A==null?void 0:A.name})," will use approximately ",c.jsx("strong",{children:A==null?void 0:A.size_gb})," of RAM and storage. First-time loading may require downloading the model."]})]}),c.jsxs(zl,{children:[c.jsx(Ul,{onClick:ya,children:"Cancel"}),c.jsx($l,{onClick:ga,children:"Load Model"})]})]})}),c.jsx(nu,{open:B,onOpenChange:k,children:c.jsxs(Ll,{children:[c.jsxs(Dl,{children:[c.jsx(Fl,{children:"Save Assistant"}),c.jsx(Bl,{children:"Give your assistant a custom name. This will be displayed in your assistant list."})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(Ye,{htmlFor:"assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),c.jsx("input",{id:"assistant-name",type:"text",value:G,onChange:P=>Y(P.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:P=>{P.key==="Enter"&&G.trim()&&ye(),P.key==="Escape"&&le()}}),c.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[G.length,"/100 characters"]})]}),c.jsxs(zl,{children:[c.jsx(Ul,{onClick:le,children:"Cancel"}),c.jsxs($l,{onClick:ye,disabled:!G.trim(),children:[c.jsx(Yy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})]})}),c.jsx(nu,{open:b,onOpenChange:X,children:c.jsxs(Ll,{children:[c.jsxs(Dl,{children:[c.jsx(Fl,{children:"Rename Assistant"}),c.jsxs(Bl,{children:['Enter a new name for "',D==null?void 0:D.name,'".']})]}),c.jsxs("div",{className:"py-4",children:[c.jsx(Ye,{htmlFor:"rename-assistant-name",className:"text-sm font-medium",children:"Assistant Name"}),c.jsx("input",{id:"rename-assistant-name",type:"text",value:ge,onChange:P=>ne(P.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:P=>{P.key==="Enter"&&ge.trim()&&It(),P.key==="Escape"&&Ar()}}),c.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[ge.length,"/100 characters"]})]}),c.jsxs(zl,{children:[c.jsx(Ul,{onClick:Ar,children:"Cancel"}),c.jsxs($l,{onClick:It,disabled:!ge.trim(),children:[c.jsx(oi,{className:"h-4 w-4 mr-2"}),"Rename"]})]})]})})]})}function wI({models:e,selectedModel:t,setSelectedModel:n,autoLoadingModel:r,temperature:i,setTemperature:o,maxTokens:l,setMaxTokens:s}){return c.jsxs(c.Fragment,{children:[c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsx(dt,{className:"text-base",children:"Model"})}),c.jsx(Qe,{className:"space-y-4",children:c.jsx("div",{children:c.jsxs(nf,{value:t||"",onValueChange:n,children:[c.jsx(la,{className:"w-full",children:c.jsx(rf,{placeholder:"Select a model...",children:t&&(()=>{const a=e.find(f=>f.model_name===t);if(!a)return t;const u=a.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[u?c.jsx(vs,{className:"h-4 w-4 text-blue-500"}):a.supports_thinking?c.jsx(xi,{className:"h-4 w-4 text-purple-500"}):c.jsx(pc,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:a.name}),r===t?c.jsx(me,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(me,{variant:"outline",className:"text-xs",children:u?"API":a.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(sa,{children:[c.jsxs(ai,{children:[c.jsx(gr,{children:"🌐 API Models"}),e.filter(a=>a.type==="api").map(a=>c.jsx(Dn,{value:a.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vs,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:a.name}),c.jsx(me,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},a.model_name))]}),c.jsxs(ai,{children:[c.jsx(gr,{children:"💻 Local Models"}),e.filter(a=>a.type==="local").map(a=>c.jsx(Dn,{value:a.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[a.supports_thinking?c.jsx(xi,{className:"h-4 w-4 text-purple-500"}):c.jsx(pc,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:a.name}),r===a.model_name?c.jsx(me,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):a.is_loaded?c.jsx(me,{variant:"outline",className:"text-xs bg-green-50",children:"Loaded"}):c.jsx(me,{variant:"outline",className:"text-xs bg-gray-50",children:"Available"})]})},a.model_name))]})]})]})})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsx(dt,{className:"text-base",children:"Parameters"})}),c.jsxs(Qe,{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Temperature"}),c.jsx(me,{variant:"outline",className:"text-xs",children:i})]}),c.jsx(Ss,{value:[i],onValueChange:a=>o(a[0]),max:2,min:0,step:.1,className:"w-full mb-3"}),c.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[c.jsx("span",{children:"0.0 (Focused)"}),c.jsx("span",{children:"1.0 (Balanced)"}),c.jsx("span",{children:"2.0 (Creative)"})]}),c.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"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Max Tokens"}),c.jsx(me,{variant:"outline",className:"text-xs",children:l})]}),c.jsx(Ss,{value:[l],onValueChange:a=>s(a[0]),max:4e3,min:50,step:50,className:"w-full mb-3"}),c.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-2",children:[c.jsx("span",{children:"50 (Short)"}),c.jsx("span",{children:"1024 (Medium)"}),c.jsx("span",{children:"4000 (Long)"})]}),c.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 SI({savedAssistants:e,loadSavedAssistant:t,openSaveDialog:n,presets:r,onPresetSelect:i,isLoading:o,selectedAssistant:l,createNewAssistant:s,clearCurrentAssistant:a,openRenameDialog:u,systemPrompt:f}){const d=g=>{if(g==="create_new")s();else if(g==="clear_current")a();else if(g.startsWith("user_")){const S=g.replace("user_","");t(S)}else i(g)},p=()=>l?l.type==="user"?`user_${l.id}`:l.type==="new"?"new_assistant":l.id:"",m=g=>{switch(g){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 c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Ye,{className:"text-sm font-medium mb-2 block",children:"Load Assistant"}),c.jsxs(nf,{value:p(),onValueChange:d,children:[c.jsx(la,{className:"w-full",children:c.jsx(rf,{placeholder:`Choose assistant (${w} available)`,children:l?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Jr,{className:"h-4 w-4"}),c.jsx("span",{children:l.name}),l.originalTemplate&&c.jsxs("span",{className:"text-xs text-muted-foreground",children:["(from ",l.originalTemplate,")"]}),c.jsx(me,{variant:m(l.type).variant,className:`text-xs ml-auto ${m(l.type).className||""}`,children:m(l.type).text})]}):c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Jr,{className:"h-4 w-4"}),c.jsx("span",{children:"Choose assistant"}),c.jsx(me,{variant:"outline",className:"text-xs ml-auto",children:w})]})})}),c.jsxs(sa,{children:[c.jsxs(ai,{children:[c.jsxs(gr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(xs,{className:"h-4 w-4"}),"Actions"]}),c.jsx(Dn,{value:"create_new",children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(xs,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"truncate flex-1",children:"Create New Assistant"}),c.jsx(me,{variant:"default",className:"text-xs bg-green-100 text-green-700",children:"New"})]})}),l&&c.jsx(Dn,{value:"clear_current",children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Zy,{className:"h-4 w-4 text-gray-600"}),c.jsx("span",{className:"truncate flex-1",children:"Clear Current"}),c.jsx(me,{variant:"outline",className:"text-xs",children:"Clear"})]})})]}),e.length>0&&c.jsxs(ai,{children:[c.jsxs(gr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(Jy,{className:"h-4 w-4"}),"My Assistants (",e.length,")"]}),e.map(g=>c.jsx(Dn,{value:`user_${g.id}`,children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Jr,{className:"h-4 w-4 text-blue-600"}),c.jsx("span",{className:"truncate flex-1",children:g.name}),c.jsx(me,{variant:"secondary",className:"text-xs",children:"Mine"})]})},`user_${g.id}`))]}),r.length>0&&c.jsxs(ai,{children:[c.jsxs(gr,{className:"flex items-center gap-2 text-sm font-medium",children:[c.jsx(KC,{className:"h-4 w-4"}),"Templates (",r.length,")"]}),r.map(g=>c.jsx(Dn,{value:g.name,children:c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx(Jr,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"truncate flex-1",children:g.name}),c.jsx(me,{variant:"outline",className:"text-xs",children:"Template"})]})},g.name))]}),w===0&&c.jsx("div",{className:"p-2 text-sm text-muted-foreground text-center",children:"No assistants available"})]})]})]}),l&&l.type!=="template"&&c.jsxs(Ae,{onClick:u,size:"sm",variant:"ghost",className:"w-full justify-start",disabled:o,children:[c.jsx(oi,{className:"h-4 w-4 mr-2"}),"Rename"]}),c.jsxs(Ae,{onClick:n,size:"sm",variant:"outline",className:"w-full",disabled:o||!f.trim(),children:[c.jsx(Yy,{className:"h-4 w-4 mr-2"}),"Save Assistant"]})]})}function kI({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 c.jsxs("div",{className:"space-y-4 pb-6",children:[c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsx(dt,{className:"text-base",children:"System Instructions"})}),c.jsx(Qe,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Ye,{className:"text-base font-medium text-blue-700",children:"System Prompt"}),c.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}),c.jsxs("div",{className:"text-xs text-muted-foreground text-right",children:[e.length," characters"]})]})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"text-sm flex items-center",children:[c.jsx(xi,{className:"h-4 w-4 mr-2"}),"Quick Examples"]})}),c.jsx(Qe,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsx(Ye,{className:"text-xs font-medium text-muted-foreground",children:"Choose a template to get started:"}),c.jsxs(nf,{value:"",onValueChange:o=>{const l=r[parseInt(o)];l&&t(l.prompt)},disabled:n,children:[c.jsx(la,{className:"w-full h-10",children:c.jsx(rf,{placeholder:"Select example prompt..."})}),c.jsx(sa,{children:c.jsxs(ai,{children:[c.jsx(gr,{children:"Example Prompts"}),r.map((o,l)=>c.jsx(Dn,{value:l.toString(),children:c.jsxs("div",{className:"flex flex-col items-start",children:[c.jsx("span",{className:"font-medium text-sm",children:o.title}),c.jsxs("span",{className:"text-xs text-muted-foreground line-clamp-1 mt-1",children:[o.prompt.substring(0,60),"..."]})]})},l))]})})]})]})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"text-sm flex items-center",children:[c.jsx(Qs,{className:"h-4 w-4 mr-2"}),"Best Practices"]})}),c.jsx(Qe,{children:c.jsx("ul",{className:"text-xs space-y-2 text-muted-foreground",children:i.map((o,l)=>c.jsxs("li",{className:"flex items-start",children:[c.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 CI({isLoading:e}){const[t,n]=y.useState([]),[r,i]=y.useState(!1),[o,l]=y.useState(!1),[s,a]=y.useState(3);y.useEffect(()=>{(async()=>{try{const m=await fetch("/rag/documents");if(m.ok){const w=await m.json();if(w.documents){const g=Object.entries(w.documents).map(([S,v])=>({id:S,name:v.filename,size:0,type:v.file_type,uploadedAt:new Date().toISOString(),status:v.status,chunks:v.chunks}));n(g)}}}catch(m){console.error("Error loading documents:",m)}})()},[]);const u=async p=>{const m=p.target.files;if(m){i(!0);try{const w=new FormData;for(const S of Array.from(m))w.append("files",S);const g=await fetch("/rag/upload",{method:"POST",body:w});if(g.ok){const S=await g.json(),v=S.results.filter(x=>x.success).map(x=>({id:x.doc_id,name:x.filename,size:0,type:"processed",uploadedAt:new Date().toISOString(),status:"processed",chunks:x.chunks}));n(x=>[...x,...v]);const h=S.results.filter(x=>!x.success);h.length>0&&console.error("Some files failed to upload:",h)}else console.error("Upload failed:",g.statusText);p.target.value=""}catch(w){console.error("File upload error:",w)}finally{i(!1)}}},f=async p=>{try{const m=await fetch(`/rag/documents/${p}`,{method:"DELETE"});m.ok?n(w=>w.filter(g=>g.id!==p)):console.error("Failed to delete document:",m.statusText)}catch(m){console.error("Error deleting document:",m),n(w=>w.filter(g=>g.id!==p))}},d=p=>{if(p===0)return"0 Bytes";const m=1024,w=["Bytes","KB","MB","GB"],g=Math.floor(Math.log(p)/Math.log(m));return parseFloat((p/Math.pow(m,g)).toFixed(2))+" "+w[g]};return c.jsxs("div",{className:"space-y-4 pb-6",children:[c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsx(dt,{className:"text-base",children:"RAG Configuration"})}),c.jsx(Qe,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Enable RAG"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Use uploaded documents to enhance responses"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:"rag-enabled",checked:o,onChange:p=>l(p.target.checked),className:"rounded",disabled:e||t.length===0}),c.jsx(Ye,{htmlFor:"rag-enabled",className:"text-sm",children:o?"On":"Off"})]})]}),o&&c.jsx("div",{className:"space-y-3 border-t pt-4",children:c.jsxs("div",{children:[c.jsxs(Ye,{className:"text-sm font-medium mb-2 block",children:["Retrieval Count: ",s]}),c.jsx(Ss,{value:[s],onValueChange:p=>a(p[0]),max:10,min:1,step:1,className:"w-full"}),c.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground mt-1",children:[c.jsx("span",{children:"1 (Focused)"}),c.jsx("span",{children:"5 (Balanced)"}),c.jsx("span",{children:"10 (Comprehensive)"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Number of relevant document chunks to retrieve for context"})]})})]})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"text-base flex items-center",children:[c.jsx(Yp,{className:"h-4 w-4 mr-2"}),"Upload Documents"]})}),c.jsx(Qe,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-6 text-center hover:border-gray-400 transition-colors",children:[c.jsx("input",{type:"file",id:"file-upload",multiple:!0,accept:".pdf,.txt,.docx,.md",onChange:u,className:"hidden",disabled:r||e}),c.jsxs(Ye,{htmlFor:"file-upload",className:"cursor-pointer flex flex-col items-center space-y-2",children:[c.jsx(Yp,{className:"h-8 w-8 text-gray-400"}),c.jsx("span",{className:"text-sm font-medium",children:r?"Uploading...":"Click to upload documents"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"PDF, TXT, DOCX, MD files supported"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground bg-blue-50 p-3 rounded",children:[c.jsx("strong",{children:"💡 How it works:"}),c.jsx("br",{}),"• Upload your documents to create a knowledge base • Enable RAG to use these documents as context • The AI will search relevant information to answer questions"]})]})})]}),t.length>0&&c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"text-base flex items-center",children:[c.jsx(db,{className:"h-4 w-4 mr-2"}),"Uploaded Documents (",t.length,")"]})}),c.jsx(Qe,{children:c.jsx("div",{className:"space-y-2",children:t.map(p=>c.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg bg-gray-50",children:[c.jsxs("div",{className:"flex items-center space-x-3",children:[c.jsx(pb,{className:"h-4 w-4 text-blue-600"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-sm font-medium truncate max-w-[200px]",children:p.name}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:[d(p.size)," • ",p.status]})]})]}),c.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>f(p.id),disabled:e,className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:c.jsx(Zy,{className:"h-4 w-4"})})]},p.id))})})]}),o&&t.length>0&&c.jsx(Fe,{children:c.jsxs(Qe,{className:"pt-6",children:[c.jsxs("div",{className:"flex items-center space-x-2 text-green-600",children:[c.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),c.jsxs("span",{className:"text-sm font-medium",children:["RAG Active - Using ",t.length," document(s)"]})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Your questions will be answered using context from uploaded documents"})]})})]})}function bI(){const e=Ld(),[t,n]=y.useState([]),[r,i]=y.useState(!0),[o,l]=y.useState(null);y.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)}},u=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?c.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:c.jsx(fc,{className:"h-8 w-8 animate-spin"})}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:c.jsx(zd,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Model Catalog"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse and manage AI models for your conversations"})]})]}),c.jsxs(Ae,{onClick:()=>e("/playground"),className:"flex items-center gap-2",children:[c.jsx(pc,{className:"h-4 w-4"}),"Go to Playground"]})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsx(Fe,{className:"bg-blue-50 border-blue-200",children:c.jsx(Qe,{className:"pt-6",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Qy,{className:"h-5 w-5 text-blue-600 mt-0.5"}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-medium text-blue-900",children:"Model Management"}),c.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."})]})]})})}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(vs,{className:"h-5 w-5"}),"API Models",c.jsx(me,{variant:"outline",className:"text-xs",children:"Cloud-Powered"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:t.filter(f=>f.type==="api").map(f=>c.jsx(ph,{model:f,modelLoading:o,onLoad:a,onUnload:u},f.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(Gy,{className:"h-5 w-5"}),"Local Models",c.jsx(me,{variant:"outline",className:"text-xs",children:"Self-Hosted"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.filter(f=>f.type==="local").map(f=>c.jsx(ph,{model:f,modelLoading:o,onLoad:a,onUnload:u},f.model_name))})]})]})})]})}function ph({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api",o=t===e.model_name,l=e.is_loaded;return c.jsxs(Fe,{className:"hover:shadow-md transition-shadow",children:[c.jsx(ct,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsxs(dt,{className:"text-base flex items-center gap-2",children:[i?c.jsx(vs,{className:"h-4 w-4 text-blue-600"}):c.jsx(Gy,{className:"h-4 w-4 text-green-600"}),e.name]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:e.model_name})]}),l&&c.jsx(rb,{className:"h-5 w-5 text-green-600"})]})}),c.jsxs(Qe,{className:"space-y-3",children:[c.jsxs("div",{className:"space-y-2 text-sm",children:[!i&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Size:"}),c.jsx(me,{variant:"outline",className:"text-xs",children:e.size_gb})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"RAM Required:"}),c.jsx(me,{variant:"outline",className:"text-xs",children:e.ram_required_gb})]})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Type:"}),c.jsx(me,{variant:i?"default":"secondary",className:"text-xs",children:i?"API":"Local"})]}),e.supports_thinking&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:"Features:"}),c.jsxs(me,{variant:"outline",className:"text-xs",children:[c.jsx(xi,{className:"h-3 w-3 mr-1"}),"Thinking"]})]})]}),c.jsx("div",{className:"pt-2",children:l?c.jsxs(Ae,{size:"sm",variant:"outline",onClick:()=>r(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(fc,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(qy,{className:"h-4 w-4 mr-2"}),o?"Unloading...":"Unload Model"]}):c.jsxs(Ae,{size:"sm",onClick:()=>n(e.model_name),disabled:o,className:"w-full",children:[o?c.jsx(fc,{className:"h-4 w-4 mr-2 animate-spin"}):c.jsx(sb,{className:"h-4 w-4 mr-2"}),o?"Loading...":"Load Model"]})})]})]})}function NI(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsx("div",{className:"max-w-6xl mx-auto p-6",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-8 h-8 bg-gray-600 rounded-lg flex items-center justify-center",children:c.jsx(oi,{className:"h-5 w-5 text-white"})}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold",children:"Settings"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure your application preferences and system settings"})]})]})})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"flex items-center gap-2",children:[c.jsx(Pb,{className:"h-5 w-5"}),"Server Configuration"]})}),c.jsx(Qe,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Backend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]}),c.jsxs("div",{children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Frontend URL"}),c.jsx("div",{className:"mt-1 p-2 bg-muted rounded-md text-sm font-mono",children:window.location.origin})]})]})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"flex items-center gap-2",children:[c.jsx(Qp,{className:"h-5 w-5"}),"Privacy & Security"]})}),c.jsx(Qe,{className:"space-y-4",children:c.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-md",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Qp,{className:"h-4 w-4 text-green-600"}),c.jsx("span",{className:"text-sm font-medium text-green-800",children:"Local Processing"})]}),c.jsx("p",{className:"text-xs text-green-700",children:"All AI processing happens locally on your machine. No data is sent to external servers."})]})})]}),c.jsxs(Fe,{children:[c.jsx(ct,{children:c.jsxs(dt,{className:"flex items-center gap-2",children:[c.jsx(Qy,{className:"h-5 w-5"}),"System Information"]})}),c.jsx(Qe,{className:"space-y-4",children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Platform"}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx(me,{variant:"outline",children:"Local"}),c.jsx("span",{className:"text-sm text-muted-foreground",children:"Privacy-focused AI"})]})]}),c.jsxs("div",{children:[c.jsx(Ye,{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"mt-1",children:c.jsx(me,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function EI(){return c.jsx(iC,{children:c.jsx(Xk,{children:c.jsxs(Fr,{path:"/",element:c.jsx(Gb,{}),children:[c.jsx(Fr,{index:!0,element:c.jsx(iN,{})}),c.jsx(Fr,{path:"playground",element:c.jsx(xI,{})}),c.jsx(Fr,{path:"models",element:c.jsx(bI,{})}),c.jsx(Fr,{path:"settings",element:c.jsx(NI,{})})]})})})}mu.createRoot(document.getElementById("root")).render(c.jsx(zt.StrictMode,{children:c.jsx(EI,{})})); +//# sourceMappingURL=index-ea1ae8fd.js.map