diff --git "a/static/assets/index-bbadde27.js" "b/static/assets/index-bbadde27.js" new file mode 100644--- /dev/null +++ "b/static/assets/index-bbadde27.js" @@ -0,0 +1,325 @@ +function n1(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 Tl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xh={exports:{}},gs={},qh={exports:{}},ne={};/** + * @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 Ao=Symbol.for("react.element"),r1=Symbol.for("react.portal"),i1=Symbol.for("react.fragment"),o1=Symbol.for("react.strict_mode"),l1=Symbol.for("react.profiler"),s1=Symbol.for("react.provider"),a1=Symbol.for("react.context"),u1=Symbol.for("react.forward_ref"),c1=Symbol.for("react.suspense"),d1=Symbol.for("react.memo"),f1=Symbol.for("react.lazy"),af=Symbol.iterator;function p1(e){return e===null||typeof e!="object"?null:(e=af&&e[af]||e["@@iterator"],typeof e=="function"?e:null)}var Jh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zh=Object.assign,em={};function xi(e,t,n){this.props=e,this.context=t,this.refs=em,this.updater=n||Jh}xi.prototype.isReactComponent={};xi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};xi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tm(){}tm.prototype=xi.prototype;function Sc(e,t,n){this.props=e,this.context=t,this.refs=em,this.updater=n||Jh}var kc=Sc.prototype=new tm;kc.constructor=Sc;Zh(kc,xi.prototype);kc.isPureReactComponent=!0;var uf=Array.isArray,nm=Object.prototype.hasOwnProperty,Cc={current:null},rm={key:!0,ref:!0,__self:!0,__source:!0};function im(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)nm.call(t,r)&&!rm.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,X=_[Y];if(0>>1;Yi(Te,k))iei(G,Te)?(_[Y]=G,_[ie]=k,Y=ie):(_[Y]=Te,_[ee]=k,Y=ee);else if(iei(G,k))_[Y]=G,_[ie]=k,Y=ie;else break e}}return z}function i(_,z){var k=_.sortIndex-z.sortIndex;return k!==0?k:_.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],f=1,d=null,h=3,p=!1,x=!1,m=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=_)r(u),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(u)}}function C(_){if(m=!1,w(_),!x)if(n(a)!==null)x=!0,$(b);else{var z=n(u);z!==null&&H(C,z.startTime-_)}}function b(_,z){x=!1,m&&(m=!1,g(R),R=-1),p=!0;var k=h;try{for(w(z),d=n(a);d!==null&&(!(d.expirationTime>z)||_&&!I());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,h=d.priorityLevel;var X=Y(d.expirationTime<=z);z=e.unstable_now(),typeof X=="function"?d.callback=X:d===n(a)&&r(a),w(z)}else r(a);d=n(a)}if(d!==null)var E=!0;else{var ee=n(u);ee!==null&&H(C,ee.startTime-z),E=!1}return E}finally{d=null,h=k,p=!1}}var N=!1,P=null,R=-1,B=5,O=-1;function I(){return!(e.unstable_now()-O_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(_){switch(h){case 1:case 2:case 3:var z=3;break;default:z=h}var k=h;h=z;try{return _()}finally{h=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,z){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var k=h;h=_;try{return z()}finally{h=k}},e.unstable_scheduleCallback=function(_,z,k){var Y=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0Y?(_.sortIndex=k,t(u,_),n(a)===null&&_===n(u)&&(m?(g(R),R=-1):m=!0,H(C,k-Y))):(_.sortIndex=X,t(a,_),x||p||(x=!0,$(b))),_},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(_){var z=h;return function(){var k=h;h=z;try{return _.apply(this,arguments)}finally{h=k}}}})(um);am.exports=um;var E1=am.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 N1=y,wt=E1;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Va=Object.prototype.hasOwnProperty,b1=/^[: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]*$/,df={},ff={};function P1(e){return Va.call(ff,e)?!0:Va.call(df,e)?!1:b1.test(e)?ff[e]=!0:(df[e]=!0,!1)}function j1(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 _1(e,t,n,r){if(t===null||typeof t>"u"||j1(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 tt(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 tt(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 tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new tt(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 tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var bc=/[\-:]([a-z])/g;function Pc(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(bc,Pc);He[t]=new tt(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(bc,Pc);He[t]=new tt(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(bc,Pc);He[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function jc(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{qs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hi(e):""}function R1(e){switch(e.tag){case 5:return Hi(e.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("SuspenseList");case 0:case 2:case 15:return e=Js(e.type,!1),e;case 11:return e=Js(e.type.render,!1),e;case 1:return e=Js(e.type,!0),e;default:return""}}function Ga(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Fr:return"Portal";case Ha:return"Profiler";case _c:return"StrictMode";case Wa:return"Suspense";case Ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fm:return(e.displayName||"Context")+".Consumer";case dm:return(e._context.displayName||"Context")+".Provider";case Rc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ac:return t=e.displayName||null,t!==null?t:Ga(e.type)||"Memo";case jn:t=e._payload,e=e._init;try{return Ga(e(t))}catch{}}return null}function A1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ga(t);case 8:return t===_c?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Hn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function hm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function T1(e){var t=hm(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ho(e){e._valueTracker||(e._valueTracker=T1(e))}function mm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=hm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Il(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ya(e,t){var n=t.checked;return _e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Hn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gm(e,t){t=t.checked,t!=null&&jc(e,"checked",t,!1)}function Qa(e,t){gm(e,t);var n=Hn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xa(e,t.type,Hn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function mf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xa(e,t,n){(t!=="number"||Il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wi=Array.isArray;function qr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ao(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},I1=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(e){I1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qi[t]=Qi[e]})});function wm(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qi.hasOwnProperty(e)&&Qi[e]?(""+t).trim():t+"px"}function Sm(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wm(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var M1=_e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Za(e,t){if(t){if(M1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tu=null;function Tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,Jr=null,Zr=null;function vf(e){if(e=Mo(e)){if(typeof nu!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Ss(t),nu(e.stateNode,e.type,t))}}function km(e){Jr?Zr?Zr.push(e):Zr=[e]:Jr=e}function Cm(){if(Jr){var e=Jr,t=Zr;if(Zr=Jr=null,vf(e),t)for(e=0;e>>=0,e===0?32:31-(W1(e)/K1|0)|0}var Ko=64,Go=4194304;function Ki(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Ki(s):(o&=l,o!==0&&(r=Ki(o)))}else l=n&~i,l!==0?r=Ki(l):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function To(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bt(t),e[t]=n}function X1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=qi),Pf=String.fromCharCode(32),jf=!1;function Vm(e,t){switch(e){case"keyup":return Ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $r=!1;function bw(e,t){switch(e){case"compositionend":return Hm(t);case"keypress":return t.which!==32?null:(jf=!0,Pf);case"textInput":return e=t.data,e===Pf&&jf?null:e;default:return null}}function Pw(e,t){if($r)return e==="compositionend"||!Bc&&Vm(e,t)?(e=$m(),vl=Dc=Tn=null,$r=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tf(n)}}function Ym(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ym(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qm(){for(var e=window,t=Il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Il(e.document)}return t}function $c(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 Lw(e){var t=Qm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ym(n.ownerDocument.documentElement,n)){if(r!==null&&$c(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=If(n,o);var l=If(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ur=null,au=null,Zi=null,uu=!1;function Mf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||Ur==null||Ur!==Il(r)||(r=Ur,"selectionStart"in r&&$c(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zi&&mo(Zi,r)||(Zi=r,r=Bl(au,"onSelect"),0Wr||(e.current=mu[Wr],mu[Wr]=null,Wr--)}function xe(e,t){Wr++,mu[Wr]=e.current,e.current=t}var Wn={},Xe=Xn(Wn),ot=Xn(!1),mr=Wn;function ci(e,t){var n=e.type.contextTypes;if(!n)return Wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function lt(e){return e=e.childContextTypes,e!=null}function Ul(){Ne(ot),Ne(Xe)}function $f(e,t,n){if(Xe.current!==Wn)throw Error(D(168));xe(Xe,t),xe(ot,n)}function ig(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(D(108,A1(e)||"Unknown",i));return _e({},n,r)}function Vl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,mr=Xe.current,xe(Xe,e),xe(ot,ot.current),!0}function Uf(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=ig(e,t,mr),r.__reactInternalMemoizedMergedChildContext=e,Ne(ot),Ne(Xe),xe(Xe,e)):Ne(ot),xe(ot,n)}var cn=null,ks=!1,fa=!1;function og(e){cn===null?cn=[e]:cn.push(e)}function Yw(e){ks=!0,og(e)}function qn(){if(!fa&&cn!==null){fa=!0;var e=0,t=pe;try{var n=cn;for(pe=1;e>=l,i-=l,dn=1<<32-Bt(t)+i|n<R?(B=P,P=null):B=P.sibling;var O=h(g,P,w[R],C);if(O===null){P===null&&(P=B);break}e&&P&&O.alternate===null&&t(g,P),v=o(O,v,R),N===null?b=O:N.sibling=O,N=O,P=B}if(R===w.length)return n(g,P),be&&ir(g,R),b;if(P===null){for(;RR?(B=P,P=null):B=P.sibling;var I=h(g,P,O.value,C);if(I===null){P===null&&(P=B);break}e&&P&&I.alternate===null&&t(g,P),v=o(I,v,R),N===null?b=I:N.sibling=I,N=I,P=B}if(O.done)return n(g,P),be&&ir(g,R),b;if(P===null){for(;!O.done;R++,O=w.next())O=d(g,O.value,C),O!==null&&(v=o(O,v,R),N===null?b=O:N.sibling=O,N=O);return be&&ir(g,R),b}for(P=r(g,P);!O.done;R++,O=w.next())O=p(P,g,R,O.value,C),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?R:O.key),v=o(O,v,R),N===null?b=O:N.sibling=O,N=O);return e&&P.forEach(function(j){return t(g,j)}),be&&ir(g,R),b}function S(g,v,w,C){if(typeof w=="object"&&w!==null&&w.type===Br&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Vo:e:{for(var b=w.key,N=v;N!==null;){if(N.key===b){if(b=w.type,b===Br){if(N.tag===7){n(g,N.sibling),v=i(N,w.props.children),v.return=g,g=v;break e}}else if(N.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===jn&&Wf(b)===N.type){n(g,N.sibling),v=i(N,w.props),v.ref=Di(g,N,w),v.return=g,g=v;break e}n(g,N);break}else t(g,N);N=N.sibling}w.type===Br?(v=fr(w.props.children,g.mode,C,w.key),v.return=g,g=v):(C=bl(w.type,w.key,w.props,null,g.mode,C),C.ref=Di(g,v,w),C.return=g,g=C)}return l(g);case Fr:e:{for(N=w.key;v!==null;){if(v.key===N)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),v=i(v,w.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=wa(w,g.mode,C),v.return=g,g=v}return l(g);case jn:return N=w._init,S(g,v,N(w._payload),C)}if(Wi(w))return x(g,v,w,C);if(Ti(w))return m(g,v,w,C);el(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),v=i(v,w),v.return=g,g=v):(n(g,v),v=xa(w,g.mode,C),v.return=g,g=v),l(g)):n(g,v)}return S}var fi=ug(!0),cg=ug(!1),Kl=Xn(null),Gl=null,Yr=null,Wc=null;function Kc(){Wc=Yr=Gl=null}function Gc(e){var t=Kl.current;Ne(Kl),e._currentValue=t}function vu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ti(e,t){Gl=e,Wc=Yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(it=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Wc!==e)if(e={context:e,memoizedValue:t,next:null},Yr===null){if(Gl===null)throw Error(D(308));Yr=e,Gl.dependencies={lanes:0,firstContext:e}}else Yr=Yr.next=e;return t}var ar=null;function Yc(e){ar===null?ar=[e]:ar.push(e)}function dg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yc(t)):(n.next=i.next,i.next=n),t.interleaved=n,gn(e,r)}function gn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function Qc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fg(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 pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ue&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,gn(e,n)}return i=r.interleaved,i===null?(t.next=t,Yc(r)):(t.next=i.next,i.next=t),r.interleaved=t,gn(e,n)}function wl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}function Kf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Yl(e,t,n,r){var i=e.updateQueue;_n=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var 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 h=s.lane,p=s.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,m=s;switch(h=t,p=n,m.tag){case 1:if(x=m.payload,typeof x=="function"){d=x.call(p,d,h);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=m.payload,h=typeof x=="function"?x.call(p,d,h):x,h==null)break e;d=_e({},d,h);break e;case 2:_n=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,a=d):f=f.next=p,l|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(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);vr|=l,e.lanes=l,e.memoizedState=d}}function Gf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ha.transition;ha.transition={};try{e(!1),t()}finally{pe=n,ha.transition=r}}function _g(){return At().memoizedState}function Jw(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rg(e))Ag(t,n);else if(n=dg(e,t,n,r),n!==null){var i=Ze();$t(n,e,r,i),Tg(n,t,r)}}function Zw(e,t,n){var r=$n(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rg(e))Ag(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,Ut(s,l)){var a=t.interleaved;a===null?(i.next=i,Yc(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=dg(e,t,i,r),n!==null&&(i=Ze(),$t(n,e,r,i),Tg(n,t,r))}}function Rg(e){var t=e.alternate;return e===je||t!==null&&t===je}function Ag(e,t){eo=Xl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var ql={readContext:Rt,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},eS={readContext:Rt,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,kl(4194308,4,Eg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();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=Jw.bind(null,je,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:Yf,useDebugValue:rd,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=Yf(!1),t=e[0];return e=qw.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=je,i=Yt();if(be){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),Be===null)throw Error(D(349));yr&30||gg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Qf(vg.bind(null,r,o,e),[e]),r.flags|=2048,Co(9,yg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Yt(),t=Be.identifierPrefix;if(be){var n=fn,r=dn;n=(r&~(1<<32-Bt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=So++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Xt]=t,e[vo]=r,Ug(e,t,!1,!1),t.stateNode=e;e:{switch(l=eu(n,r),n){case"dialog":Ee("cancel",e),Ee("close",e),i=r;break;case"iframe":case"object":case"embed":Ee("load",e),i=r;break;case"video":case"audio":for(i=0;imi&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ql(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!be)return Ge(t),null}else 2*Ae()-o.renderingStartTime>mi&&n!==1073741824&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ae(),t.sibling=null,n=Pe.current,xe(Pe,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return ud(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function aS(e,t){switch(Vc(t),t.tag){case 1:return lt(t.type)&&Ul(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),Ne(ot),Ne(Xe),Jc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(Ne(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(Pe),null;case 4:return pi(),null;case 10:return Gc(t.type._context),null;case 22:case 23:return ud(),null;case 24:return null;default:return null}}var nl=!1,Ye=!1,uS=typeof WeakSet=="function"?WeakSet:Set,K=null;function Qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Re(e,t,r)}else n.current=null}function Pu(e,t,n){try{n()}catch(r){Re(e,t,r)}}var lp=!1;function cS(e,t){if(cu=zl,e=Qm(),$c(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,h=null;t:for(;;){for(var p;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),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===i&&(s=l),h===o&&++f===r&&(a=l),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},zl=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var m=x.memoizedProps,S=x.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:Lt(t.type,m),S);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(C){Re(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return x=lp,lp=!1,x}function to(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Pu(t,n,o)}i=i.next}while(i!==r)}}function Ns(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ju(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Wg(e){var t=e.alternate;t!==null&&(e.alternate=null,Wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[vo],delete t[hu],delete t[Kw],delete t[Gw])),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 Kg(e){return e.tag===5||e.tag===3||e.tag===4}function sp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _u(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$l));else if(r!==4&&(e=e.child,e!==null))for(_u(e,t,n),e=e.sibling;e!==null;)_u(e,t,n),e=e.sibling}function Ru(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ru(e,t,n),e=e.sibling;e!==null;)Ru(e,t,n),e=e.sibling}var $e=null,zt=!1;function En(e,t,n){for(n=n.child;n!==null;)Gg(e,t,n),n=n.sibling}function Gg(e,t,n){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(ys,n)}catch{}switch(n.tag){case 5:Ye||Qr(n,t);case 6:var r=$e,i=zt;$e=null,En(e,t,n),$e=r,zt=i,$e!==null&&(zt?(e=$e,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$e.removeChild(n.stateNode));break;case 18:$e!==null&&(zt?(e=$e,n=n.stateNode,e.nodeType===8?da(e.parentNode,n):e.nodeType===1&&da(e,n),po(e)):da($e,n.stateNode));break;case 4:r=$e,i=zt,$e=n.stateNode.containerInfo,zt=!0,En(e,t,n),$e=r,zt=i;break;case 0:case 11:case 14:case 15:if(!Ye&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Pu(n,t,l),i=i.next}while(i!==r)}En(e,t,n);break;case 1:if(!Ye&&(Qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Re(n,t,s)}En(e,t,n);break;case 21:En(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,En(e,t,n),Ye=r):En(e,t,n);break;default:En(e,t,n)}}function ap(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uS),t.forEach(function(r){var i=xS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function It(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=l),r&=~o}if(r=i,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fS(r/1960))-r,10e?16:e,In===null)var r=!1;else{if(e=In,In=null,es=0,ue&6)throw Error(D(331));var i=ue;for(ue|=4,K=e.current;K!==null;){var o=K,l=o.child;if(K.flags&16){var s=o.deletions;if(s!==null){for(var a=0;aAe()-sd?dr(e,0):ld|=n),st(e,t)}function ty(e,t){t===0&&(e.mode&1?(t=Go,Go<<=1,!(Go&130023424)&&(Go=4194304)):t=1);var n=Ze();e=gn(e,t),e!==null&&(To(e,t,n),st(e,n))}function vS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ty(e,n)}function xS(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(D(314))}r!==null&&r.delete(t),ty(e,n)}var ny;ny=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,lS(e,t,n);it=!!(e.flags&131072)}else it=!1,be&&t.flags&1048576&&lg(t,Wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cl(e,t),e=t.pendingProps;var i=ci(t,Xe.current);ti(t,n),i=ed(null,t,r,e,i,n);var o=td();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,lt(r)?(o=!0,Vl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qc(t),i.updater=Es,t.stateNode=i,i._reactInternals=t,wu(t,r,e,n),t=Cu(null,t,r,!0,o,n)):(t.tag=0,be&&o&&Uc(t),Je(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=SS(r),e=Lt(r,e),i){case 0:t=ku(null,t,r,e,n);break e;case 1:t=rp(null,t,r,e,n);break e;case 11:t=tp(null,t,r,e,n);break e;case 14:t=np(null,t,r,Lt(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),ku(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),rp(e,t,r,i,n);case 3:e:{if(Fg(t),e===null)throw Error(D(387));r=t.pendingProps,o=t.memoizedState,i=o.element,fg(e,t),Yl(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=hi(Error(D(423)),t),t=ip(e,t,r,n,i);break e}else if(r!==i){i=hi(Error(D(424)),t),t=ip(e,t,r,n,i);break e}else for(mt=zn(t.stateNode.containerInfo.firstChild),vt=t,be=!0,Ft=null,n=cg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=yn(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return pg(t),e===null&&yu(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,fu(r,i)?l=null:o!==null&&fu(r,o)&&(t.flags|=32),zg(e,t),Je(e,t,l,n),t.child;case 6:return e===null&&yu(t),null;case 13:return Bg(e,t,n);case 4:return Xc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fi(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),tp(e,t,r,i,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(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(Kl,r._currentValue),r._currentValue=l,o!==null)if(Ut(o.value,l)){if(o.children===i.children&&!ot.current){t=yn(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=pn(-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),vu(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(D(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),vu(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}Je(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ti(t,n),i=Rt(i),r=r(i),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,i=Lt(r,t.pendingProps),i=Lt(r.type,i),np(e,t,r,i,n);case 15:return Lg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Lt(r,i),Cl(e,t),t.tag=1,lt(r)?(e=!0,Vl(t)):e=!1,ti(t,n),Ig(t,r,i),wu(t,r,i,n),Cu(null,t,r,!0,e,n);case 19:return $g(e,t,n);case 22:return Dg(e,t,n)}throw Error(D(156,t.tag))};function ry(e,t){return Rm(e,t)}function wS(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 Pt(e,t,n,r){return new wS(e,t,n,r)}function dd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function SS(e){if(typeof e=="function")return dd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rc)return 11;if(e===Ac)return 14}return 2}function Un(e,t){var n=e.alternate;return n===null?(n=Pt(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 bl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")dd(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Br:return fr(n.children,i,o,t);case _c:l=8,i|=8;break;case Ha:return e=Pt(12,n,t,i|2),e.elementType=Ha,e.lanes=o,e;case Wa:return e=Pt(13,n,t,i),e.elementType=Wa,e.lanes=o,e;case Ka:return e=Pt(19,n,t,i),e.elementType=Ka,e.lanes=o,e;case pm:return Ps(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dm:l=10;break e;case fm:l=9;break e;case Rc:l=11;break e;case Ac:l=14;break e;case jn:l=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=Pt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fr(e,t,n,r){return e=Pt(7,e,r,t),e.lanes=n,e}function Ps(e,t,n,r){return e=Pt(22,e,r,t),e.elementType=pm,e.lanes=n,e.stateNode={isHidden:!1},e}function xa(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function wa(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ea(0),this.expirationTimes=ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fd(e,t,n,r,i,o,l,s,a){return e=new kS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qc(o),e}function CS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(sy)}catch(e){console.error(e)}}sy(),sm.exports=St;var ki=sm.exports;const jS=ms(ki);var gp=ki;Ua.createRoot=gp.createRoot,Ua.hydrateRoot=gp.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 No(){return No=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ay(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function RS(){return Math.random().toString(36).substr(2,8)}function vp(e,t){return{usr:e.state,key:e.key,idx:t}}function Ou(e,t,n,r){return n===void 0&&(n=null),No({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ci(t):t,{state:n,key:t&&t.key||r||RS()})}function rs(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ci(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function AS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=Mn.Pop,a=null,u=f();u==null&&(u=0,l.replaceState(No({},l.state,{idx:u}),""));function f(){return(l.state||{idx:null}).idx}function d(){s=Mn.Pop;let S=f(),g=S==null?null:S-u;u=S,a&&a({action:s,location:m.location,delta:g})}function h(S,g){s=Mn.Push;let v=Ou(m.location,S,g);n&&n(v,S),u=f()+1;let w=vp(v,u),C=m.createHref(v);try{l.pushState(w,"",C)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(C)}o&&a&&a({action:s,location:m.location,delta:1})}function p(S,g){s=Mn.Replace;let v=Ou(m.location,S,g);n&&n(v,S),u=f();let w=vp(v,u),C=m.createHref(v);l.replaceState(w,"",C),o&&a&&a({action:s,location:m.location,delta:0})}function x(S){let g=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof S=="string"?S:rs(S);return v=v.replace(/ $/,"%20"),Le(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let m={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(yp,d),a=S,()=>{i.removeEventListener(yp,d),a=null}},createHref(S){return t(i,S)},createURL:x,encodeLocation(S){let g=x(S);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:p,go(S){return l.go(S)}};return m}var xp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xp||(xp={}));function TS(e,t,n){return n===void 0&&(n="/"),IS(e,t,n,!1)}function IS(e,t,n,r){let i=typeof t=="string"?Ci(t):t,o=gd(i.pathname||"/",n);if(o==null)return null;let l=uy(e);MS(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("/")&&(Le(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Vn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Le(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),uy(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:$S(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 cy(o.path))i(o,l,a)}),t}function cy(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=cy(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 MS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:US(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const OS=/^:[\w-]+$/,LS=3,DS=2,zS=1,FS=10,BS=-2,wp=e=>e==="*";function $S(e,t){let n=e.split("/"),r=n.length;return n.some(wp)&&(r+=BS),t&&(r+=DS),n.filter(i=>!wp(i)).reduce((i,o)=>i+(OS.test(o)?LS:o===""?zS:FS),r)}function US(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 VS(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",l=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=s[d]||"";l=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const x=s[d];return p&&!x?u[h]=void 0:u[h]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function HS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ay(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 WS(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ay(!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 gd(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 KS(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ci(e):e;return{pathname:n?n.startsWith("/")?n:GS(n,t):t,search:XS(r),hash:qS(i)}}function GS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Sa(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function YS(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function dy(e,t){let n=YS(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function fy(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ci(e):(i=No({},e),Le(!i.pathname||!i.pathname.includes("?"),Sa("?","pathname","search",i)),Le(!i.pathname||!i.pathname.includes("#"),Sa("#","pathname","hash",i)),Le(!i.search||!i.search.includes("#"),Sa("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else{let d=t.length-1;if(!r&&l.startsWith("..")){let h=l.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let a=KS(i,s),u=l&&l!=="/"&&l.endsWith("/"),f=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Vn=e=>e.join("/").replace(/\/\/+/g,"/"),QS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),XS=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qS=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function JS(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const py=["post","put","patch","delete"];new Set(py);const ZS=["get",...py];new Set(ZS);/** + * 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 bo(){return bo=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=fy(u,JSON.parse(l),o,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Vn([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,l,o,e])}const ik=y.createContext(null);function ok(e){let t=y.useContext(Jn).outlet;return t&&y.createElement(ik.Provider,{value:e},t)}function gy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Pr),{matches:i}=y.useContext(Jn),{pathname:o}=Do(),l=JSON.stringify(dy(i,r.v7_relativeSplatPath));return y.useMemo(()=>fy(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function lk(e,t){return sk(e,t)}function sk(e,t,n,r){Lo()||Le(!1);let{navigator:i}=y.useContext(Pr),{matches:o}=y.useContext(Jn),l=o[o.length-1],s=l?l.params:{};l&&l.pathname;let a=l?l.pathnameBase:"/";l&&l.route;let u=Do(),f;if(t){var d;let S=typeof t=="string"?Ci(t):t;a==="/"||(d=S.pathname)!=null&&d.startsWith(a)||Le(!1),f=S}else f=u;let h=f.pathname||"/",p=h;if(a!=="/"){let S=a.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=TS(e,{pathname:p}),m=fk(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Vn([a,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?a:Vn([a,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&m?y.createElement(Ts.Provider,{value:{location:bo({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Mn.Pop}},m):m}function ak(){let e=gk(),t=JS(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 uk=y.createElement(ak,null);class ck 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(Jn.Provider,{value:this.props.routeContext},y.createElement(hy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dk(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(yd);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Jn.Provider,{value:t},r)}function fk(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||Le(!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,h)=>{let p,x=!1,m=null,S=null;n&&(p=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||uk,a&&(u<0&&h===0?(vk("route-fallback",!1),x=!0,S=null):u===h&&(x=!0,S=d.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,h+1)),v=()=>{let w;return p?w=m:x?w=S:d.route.Component?w=y.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=f,y.createElement(dk,{match:d,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?y.createElement(ck,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var yy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(yy||{}),is=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(is||{});function pk(e){let t=y.useContext(yd);return t||Le(!1),t}function hk(e){let t=y.useContext(ek);return t||Le(!1),t}function mk(e){let t=y.useContext(Jn);return t||Le(!1),t}function vy(e){let t=mk(),n=t.matches[t.matches.length-1];return n.route.id||Le(!1),n.route.id}function gk(){var e;let t=y.useContext(hy),n=hk(is.UseRouteError),r=vy(is.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function yk(){let{router:e}=pk(yy.UseNavigateStable),t=vy(is.UseNavigateStable),n=y.useRef(!1);return my(()=>{n.current=!0}),y.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,bo({fromRouteId:t},o)))},[e,t])}const kp={};function vk(e,t,n){!t&&!kp[e]&&(kp[e]=!0)}function xk(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 wk(e){return ok(e.context)}function Dr(e){Le(!1)}function Sk(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Mn.Pop,navigator:o,static:l=!1,future:s}=e;Lo()&&Le(!1);let a=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:a,navigator:o,static:l,future:bo({v7_relativeSplatPath:!1},s)}),[a,s,o,l]);typeof r=="string"&&(r=Ci(r));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:x="default"}=r,m=y.useMemo(()=>{let S=gd(f,a);return S==null?null:{location:{pathname:S,search:d,hash:h,state:p,key:x},navigationType:i}},[a,f,d,h,p,x,i]);return m==null?null:y.createElement(Pr.Provider,{value:u},y.createElement(Ts.Provider,{children:n,value:m}))}function kk(e){let{children:t,location:n}=e;return lk(Lu(t),n)}new Promise(()=>{});function Lu(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,Lu(r.props.children,o));return}r.type!==Dr&&Le(!1),!r.props.index||!r.props.children||Le(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Lu(r.props.children,o)),n.push(l)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Du(){return Du=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Ek(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Nk(e,t){return e.button===0&&(!t||t==="_self")&&!Ek(e)}const bk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Pk="6";try{window.__reactRouterVersion=Pk}catch{}const jk="startTransition",Cp=Nc[jk];function _k(e){let{basename:t,children:n,future:r,window:i}=e,o=y.useRef();o.current==null&&(o.current=_S({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&&Cp?Cp(()=>a(d)):a(d)},[a,u]);return y.useLayoutEffect(()=>l.listen(f),[l,f]),y.useEffect(()=>xk(r),[r]),y.createElement(Sk,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l,future:r})}const Rk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zr=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,h=Ck(t,bk),{basename:p}=y.useContext(Pr),x,m=!1;if(typeof u=="string"&&Ak.test(u)&&(x=u,Rk))try{let w=new URL(window.location.href),C=u.startsWith("//")?new URL(w.protocol+u):new URL(u),b=gd(C.pathname,p);C.origin===w.origin&&b!=null?u=b+C.search+C.hash:m=!0}catch{}let S=tk(u,{relative:i}),g=Tk(u,{replace:l,state:s,target:a,preventScrollReset:f,relative:i,viewTransition:d});function v(w){r&&r(w),w.defaultPrevented||g(w)}return y.createElement("a",Du({},h,{href:x||S,onClick:m||o?r:v,ref:n,target:a}))});var Ep;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ep||(Ep={}));var Np;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Np||(Np={}));function Tk(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,viewTransition:s}=t===void 0?{}:t,a=nk(),u=Do(),f=gy(e,{relative:l});return y.useCallback(d=>{if(Nk(d,n)){d.preventDefault();let h=r!==void 0?r:rs(u)===rs(f);a(e,{replace:h,state:i,preventScrollReset:o,relative:l,viewTransition:s})}},[u,a,f,r,i,n,e,o,l,s])}function xy(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 Cy="!";function Bk(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:x,baseClassName:m,maybePostfixModifierPosition:S}}}function $k(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 Uk(e){return{cache:Fk(e.cacheSize),splitModifiers:Bk(e),...Mk(e)}}var Vk=/\s+/;function Hk(e,t){var n=t.splitModifiers,r=t.getClassGroupId,i=t.getConflictingClassGroupIds,o=new Set;return e.trim().split(Vk).map(function(l){var s=n(l),a=s.modifiers,u=s.hasImportantModifier,f=s.baseClassName,d=s.maybePostfixModifierPosition,h=r(d?f.substring(0,d):f),p=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:l};if(h=r(f),!h)return{isTailwindClass:!1,originalClassName:l};p=!1}var x=$k(a).join(":"),m=u?x+Cy:x;return{isTailwindClass:!0,modifierId:m,classGroupId:h,originalClassName:l,hasPostfixModifier:p}}).reverse().filter(function(l){if(!l.isTailwindClass)return!0;var s=l.modifierId,a=l.classGroupId,u=l.hasPostfixModifier,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 Wk(){for(var e=arguments.length,t=new Array(e),n=0;ne.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),_p=e=>{const t=aC(e);return t.charAt(0).toUpperCase()+t.slice(1)},by=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),uC=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 cC={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 dC=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,...cC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:by("lucide",i),...!o&&!uC(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 se=(e,t)=>{const n=y.forwardRef(({className:r,...i},o)=>y.createElement(dC,{ref:o,iconNode:t,className:by(`lucide-${sC(_p(e))}`,`lucide-${e}`,r),...i}));return n.displayName=_p(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 fC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],pC=se("arrow-right",fC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hC=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],gi=se("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 mC=[["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"}]],xd=se("bot",mC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gC=[["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"}]],pr=se("brain",gC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vC=se("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"}]],wd=se("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 wC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],SC=se("chevron-up",wC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],CC=se("circle-check-big",kC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],ri=se("cloud",EC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NC=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],bC=se("code",NC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PC=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Py=se("cpu",PC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jC=[["path",{d:"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"}]],jy=se("download",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 _C=[["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"}]],_y=se("hard-drive",_C);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],AC=se("history",RC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TC=[["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"}]],IC=se("house",TC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ry=se("info",MC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ay=se("loader-circle",OC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LC=[["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"}]],Kn=se("message-square",LC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],zC=se("panel-left-close",DC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],BC=se("panel-left-open",FC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $C=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UC=se("plus",$C);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],HC=se("rotate-ccw",VC);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WC=[["path",{d:"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"}]],KC=se("save",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:"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"}]],YC=se("send",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=[["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"}]],XC=se("server",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 qC=[["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"}]],Sd=se("settings",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 JC=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],ZC=se("share",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 eE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Bu=se("shield",eE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],nE=se("square",tE);/** + * @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 rE=[["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"}]],kd=se("trash-2",rE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iE=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],oE=se("triangle-alert",iE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lE=[["path",{d:"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"}]],sE=se("upload",lE);/** + * @license lucide-react v0.542.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aE=[["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"}]],uE=se("user",aE);/** + * @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 cE=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],os=se("zap",cE),dE=[{name:"Home",href:"/",icon:IC,description:"Overview and getting started"},{name:"Chat Playground",href:"/playground",icon:Kn,description:"AI chatbot with conversation history"},{name:"Model Catalog",href:"/models",icon:gi,description:"Browse and manage models"},{name:"Settings",href:"/settings",icon:Sd,description:"Application settings"}];function fE(){const e=Do();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(pr,{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:dE.map(t=>{const n=e.pathname===t.href;return c.jsxs(zr,{to:t.href,className:ce("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 pE(){return c.jsxs("div",{className:"flex h-screen bg-background",children:[c.jsx("div",{className:"w-64 border-r",children:c.jsx(fE,{})}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(wk,{})})]})}const Ue=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ue.displayName="Card";const gt=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",e),...t}));gt.displayName="CardHeader";const _t=y.forwardRef(({className:e,...t},n)=>c.jsx("h3",{ref:n,className:ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));_t.displayName="CardTitle";const hE=y.forwardRef(({className:e,...t},n)=>c.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));hE.displayName="CardDescription";const Qe=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("p-6 pt-0",e),...t}));Qe.displayName="CardContent";const mE=y.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",e),...t}));mE.displayName="CardFooter";function Rp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ty(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Rp(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(xE);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 gE=yi("Slot");function yE(e){const t=y.forwardRef((n,r)=>{const{children:i,...o}=n;if(y.isValidElement(i)){const l=SE(i),s=wE(o,i.props);return i.type!==y.Fragment&&(s.ref=r?Ty(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 Iy=Symbol("radix.slottable");function vE(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Iy,t}function xE(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iy}function wE(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 SE(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 Ap=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tp=wy,Cd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Tp(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 h=Ap(f)||Ap(d);return i[u][h]}),s=n&&Object.entries(n).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(x=>{let[m,S]=x;return Array.isArray(S)?S.includes({...o,...s}[m]):{...o,...s}[m]===S})?[...u,d,h]:u},[]);return Tp(e,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},Ed=Cd("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"}}),ge=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const l=r?gE:"button";return c.jsx(l,{className:ce(Ed({variant:t,size:n,className:e})),ref:o,...i})});ge.displayName="Button";const kE=[{icon:pr,title:"Local AI Models",description:"Run powerful language models locally on your machine with full privacy control.",color:"text-blue-500"},{icon:Kn,title:"Interactive Chat",description:"Playground interface for testing prompts and exploring model capabilities.",color:"text-green-500"},{icon:Bu,title:"Privacy First",description:"Your data never leaves your machine. Complete privacy and security guaranteed.",color:"text-purple-500"},{icon:os,title:"High Performance",description:"Optimized for speed with model caching and efficient resource management.",color:"text-yellow-500"}],CE=[{title:"Start Chatting",description:"Jump into the playground and start experimenting",href:"/playground",icon:Kn,primary:!0},{title:"Browse Models",description:"Explore available models and their capabilities",href:"/models",icon:gi,primary:!1},{title:"View Settings",description:"Configure your application preferences",href:"/settings",icon:Py,primary:!1}];function EE(){return c.jsx("div",{className:"min-h-screen bg-background",children:c.jsxs("div",{className:"container mx-auto px-4 py-8",children:[c.jsxs("div",{className:"text-center mb-12",children:[c.jsx("div",{className:"flex items-center justify-center mb-4",children:c.jsx("div",{className:"w-16 h-16 bg-primary rounded-2xl flex items-center justify-center",children:c.jsx(pr,{className:"h-8 w-8 text-primary-foreground"})})}),c.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Edge LLM"}),c.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto mb-8",children:"Your local AI companion. Run powerful language models on your own hardware with complete privacy and control."}),c.jsxs("div",{className:"flex items-center justify-center gap-4",children:[c.jsx(zr,{to:"/playground",children:c.jsxs(ge,{size:"lg",children:[c.jsx(Kn,{className:"h-5 w-5 mr-2"}),"Start Chatting"]})}),c.jsx(zr,{to:"/models",children:c.jsxs(ge,{variant:"outline",size:"lg",children:[c.jsx(gi,{className:"h-5 w-5 mr-2"}),"Browse Models"]})})]})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:kE.map((e,t)=>c.jsx(Ue,{className:"text-center",children:c.jsxs(Qe,{className:"pt-6",children:[c.jsx(e.icon,{className:`h-12 w-12 mx-auto mb-4 ${e.color}`}),c.jsx("h3",{className:"font-semibold mb-2",children:e.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e.description})]})},t))}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:CE.map((e,t)=>c.jsx(Ue,{className:"hover:shadow-lg transition-shadow",children:c.jsxs(Qe,{className:"pt-6",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsx(e.icon,{className:"h-6 w-6 text-primary"}),c.jsx("h3",{className:"font-semibold",children:e.title})]}),c.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e.description}),c.jsx(zr,{to:e.href,children:c.jsxs(ge,{variant:e.primary?"default":"outline",className:"w-full",children:["Get Started",c.jsx(pC,{className:"h-4 w-4 ml-2"})]})})]})},t))}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{children:"Getting Started"})}),c.jsxs(Qe,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"1"}),c.jsx("h4",{className:"font-medium",children:"Browse Available Models"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Check out our model catalog to see what's available for your use case."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"2"}),c.jsx("h4",{className:"font-medium",children:"Load a Model"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Select and load a model that fits your hardware and requirements."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-6 h-6 bg-primary text-white rounded-full flex items-center justify-center text-sm font-medium",children:"3"}),c.jsx("h4",{className:"font-medium",children:"Start Chatting"})]}),c.jsx("p",{className:"text-sm text-muted-foreground pl-8",children:"Go to the playground and start experimenting with prompts."})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(zr,{to:"/playground",children:c.jsxs(ge,{className:"w-full md:w-auto",children:[c.jsx(Kn,{className:"h-4 w-4 mr-2"}),"Open Playground"]})})})]})]}),c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{children:"System Status"})}),c.jsxs(Qe,{children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Backend Status"}),c.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-green-600",children:[c.jsx("div",{className:"w-2 h-2 bg-green-600 rounded-full"}),"Online"]})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Models Loaded"}),c.jsx("span",{className:"text-sm font-medium",children:"Ready"})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Memory Usage"}),c.jsx("span",{className:"text-sm font-medium",children:"Optimized"})]})]}),c.jsx("div",{className:"pt-4 border-t",children:c.jsx(zr,{to:"/settings",children:c.jsxs(ge,{variant:"outline",className:"w-full md:w-auto",children:[c.jsx(Py,{className:"h-4 w-4 mr-2"}),"View Settings"]})})})]})]})]})]})})}function ls(e,[t,n]){return Math.min(n,Math.max(t,e))}function ae(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 NE(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 _r(e,t=[]){let n=[];function r(o,l){const s=y.createContext(l),a=n.length;n=[...n,l];const u=d=>{var g;const{scope:h,children:p,...x}=d,m=((g=h==null?void 0:h[e])==null?void 0:g[a])||s,S=y.useMemo(()=>x,Object.values(x));return c.jsx(m.Provider,{value:S,children:p})};u.displayName=o+"Provider";function f(d,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[a])||s,x=y.useContext(p);if(x)return x;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,bE(i,...t)]}function bE(...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}var We=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},PE=Nc[" useInsertionEffect ".trim().toString()]||We;function Po({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=jE({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 h=_E(f)?f(e):f;h!==e&&((d=l.current)==null||d.call(l,h))}else o(f)},[s,e,o,l]);return[a,u]}function jE({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),o=y.useRef(t);return PE(()=>{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 _E(e){return typeof e=="function"}var RE=y.createContext(void 0);function My(e){const t=y.useContext(RE);return e||t||"ltr"}function Oy(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 Ly(e){const[t,n]=y.useState(void 0);return We(()=>{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 AE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],le=AE.reduce((e,t)=>{const n=yi(`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 TE(e,t){e&&ki.flushSync(()=>e.dispatchEvent(t))}function Dy(e){const t=e+"CollectionProvider",[n,r]=_r(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:S,children:g}=m,v=Dt.useRef(null),w=Dt.useRef(new Map).current;return c.jsx(i,{scope:S,itemMap:w,collectionRef:v,children:g})};l.displayName=t;const s=e+"CollectionSlot",a=yi(s),u=Dt.forwardRef((m,S)=>{const{scope:g,children:v}=m,w=o(s,g),C=fe(S,w.collectionRef);return c.jsx(a,{ref:C,children:v})});u.displayName=s;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=yi(f),p=Dt.forwardRef((m,S)=>{const{scope:g,children:v,...w}=m,C=Dt.useRef(null),b=fe(S,C),N=o(f,g);return Dt.useEffect(()=>(N.itemMap.set(C,{ref:C,...w}),()=>void N.itemMap.delete(C))),c.jsx(h,{[d]:"",ref:b,children:v})});p.displayName=f;function x(m){const S=o(e+"CollectionConsumer",m);return Dt.useCallback(()=>{const v=S.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((N,P)=>w.indexOf(N.ref.current)-w.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:u,ItemSlot:p},x,r]}var zy=["PageUp","PageDown"],Fy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],By={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ei="Slider",[$u,IE,ME]=Dy(Ei),[$y,DT]=_r(Ei,[ME]),[OE,Is]=$y(Ei),Uy=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:h=()=>{},inverted:p=!1,form:x,...m}=e,S=y.useRef(new Set),g=y.useRef(0),w=l==="horizontal"?LE:DE,[C=[],b]=Po({prop:f,defaultProp:u,onChange:I=>{var V;(V=[...S.current][g.current])==null||V.focus(),d(I)}}),N=y.useRef(C);function P(I){const j=UE(C,I);O(I,j)}function R(I){O(I,g.current)}function B(){const I=N.current[g.current];C[g.current]!==I&&h(C)}function O(I,j,{commit:V}={commit:!1}){const M=KE(o),L=GE(Math.round((I-r)/o)*o+r,M),$=ls(L,[r,i]);b((H=[])=>{const _=BE(H,$,j);if(WE(_,a*o)){g.current=_.indexOf($);const z=String(_)!==String(H);return z&&V&&h(_),z?_:H}else return H})}return c.jsx(OE,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:g,thumbs:S.current,values:C,orientation:l,form:x,children:c.jsx($u.Provider,{scope:e.__scopeSlider,children:c.jsx($u.Slot,{scope:e.__scopeSlider,children:c.jsx(w,{"aria-disabled":s,"data-disabled":s?"":void 0,...m,ref:t,onPointerDown:ae(m.onPointerDown,()=>{s||(N.current=C)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:P,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:B,onHomeKeyDown:()=>!s&&O(r,0,{commit:!0}),onEndKeyDown:()=>!s&&O(i,C.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:j})=>{if(!s){const L=zy.includes(I.key)||I.shiftKey&&Fy.includes(I.key)?10:1,$=g.current,H=C[$],_=o*L*j;O(H+_,$,{commit:!0})}}})})})})});Uy.displayName=Ei;var[Vy,Hy]=$y(Ei,{startEdge:"left",endEdge:"right",size:"width",direction:1}),LE=y.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:s,onSlideEnd:a,onStepKeyDown:u,...f}=e,[d,h]=y.useState(null),p=fe(t,w=>h(w)),x=y.useRef(void 0),m=My(i),S=m==="ltr",g=S&&!o||!S&&o;function v(w){const C=x.current||d.getBoundingClientRect(),b=[0,C.width],P=Nd(b,g?[n,r]:[r,n]);return x.current=C,P(w-C.left)}return c.jsx(Vy,{scope:e.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:c.jsx(Wy,{dir:m,"data-orientation":"horizontal",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const C=v(w.clientX);l==null||l(C)},onSlideMove:w=>{const C=v(w.clientX);s==null||s(C)},onSlideEnd:()=>{x.current=void 0,a==null||a()},onStepKeyDown:w=>{const b=By[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:b?-1:1})}})})}),DE=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=fe(t,f),h=y.useRef(void 0),p=!i;function x(m){const S=h.current||f.current.getBoundingClientRect(),g=[0,S.height],w=Nd(g,p?[r,n]:[n,r]);return h.current=S,w(m-S.top)}return c.jsx(Vy,{scope:e.__scopeSlider,startEdge:p?"bottom":"top",endEdge:p?"top":"bottom",size:"height",direction:p?1:-1,children:c.jsx(Wy,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const S=x(m.clientY);o==null||o(S)},onSlideMove:m=>{const S=x(m.clientY);l==null||l(S)},onSlideEnd:()=>{h.current=void 0,s==null||s()},onStepKeyDown:m=>{const g=By[p?"from-bottom":"from-top"].includes(m.key);a==null||a({event:m,direction:g?-1:1})}})})}),Wy=y.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:s,onStepKeyDown:a,...u}=e,f=Is(Ei,n);return c.jsx(le.span,{...u,ref:t,onKeyDown:ae(e.onKeyDown,d=>{d.key==="Home"?(l(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):zy.concat(Fy).includes(d.key)&&(a(d),d.preventDefault())}),onPointerDown:ae(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(h)?h.focus():r(d)}),onPointerMove:ae(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&i(d)}),onPointerUp:ae(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),o(d))})})}),Ky="SliderTrack",Gy=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Is(Ky,n);return c.jsx(le.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Gy.displayName=Ky;var Uu="SliderRange",Yy=y.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Is(Uu,n),o=Hy(Uu,n),l=y.useRef(null),s=fe(t,l),a=i.values.length,u=i.values.map(h=>qy(h,i.min,i.max)),f=a>1?Math.min(...u):0,d=100-Math.max(...u);return c.jsx(le.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[o.startEdge]:f+"%",[o.endEdge]:d+"%"}})});Yy.displayName=Uu;var Vu="SliderThumb",Qy=y.forwardRef((e,t)=>{const n=IE(e.__scopeSlider),[r,i]=y.useState(null),o=fe(t,s=>i(s)),l=y.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return c.jsx(zE,{...e,ref:o,index:l})}),zE=y.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=Is(Vu,n),s=Hy(Vu,n),[a,u]=y.useState(null),f=fe(t,v=>u(v)),d=a?l.form||!!a.closest("form"):!0,h=Ly(a),p=l.values[r],x=p===void 0?0:qy(p,l.min,l.max),m=$E(r,l.values.length),S=h==null?void 0:h[s.size],g=S?VE(S,x,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(${x}% + ${g}px)`},children:[c.jsx($u.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(le.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":l.min,"aria-valuenow":p,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:f,style:p===void 0?{display:"none"}:e.style,onFocus:ae(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),d&&c.jsx(Xy,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:p},r)]})});Qy.displayName=Vu;var FE="RadioBubbleInput",Xy=y.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=y.useRef(null),o=fe(i,r),l=Oy(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(le.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Xy.displayName=FE;function BE(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function qy(e,t,n){const o=100/(n-t)*(e-t);return ls(o,[0,100])}function $E(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function UE(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 VE(e,t,n){const r=e/2,o=Nd([0,50],[0,r]);return(r-o(t)*n)*n}function HE(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function WE(e,t){if(t>0){const n=HE(e);return Math.min(...n)>=t}return!0}function Nd(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 KE(e){return(String(e).split(".")[1]||"").length}function GE(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Jy=Uy,YE=Gy,QE=Yy,XE=Qy;const Hu=y.forwardRef(({className:e,...t},n)=>c.jsxs(Jy,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(YE,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:c.jsx(QE,{className:"absolute h-full bg-primary"})}),c.jsx(XE,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Hu.displayName=Jy.displayName;var qE="Label",Zy=y.forwardRef((e,t)=>c.jsx(le.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())}}));Zy.displayName=qE;var ev=Zy;const JE=Cd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ct=y.forwardRef(({className:e,...t},n)=>c.jsx(ev,{ref:n,className:ce(JE(),e),...t}));Ct.displayName=ev.displayName;const ZE=Cd("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:ce(ZE({variant:t}),e),...n})}const tv=y.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:ce("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}));tv.displayName="Input";const bd=y.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:ce("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}));bd.displayName="Textarea";function wr(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function eN(e,t=globalThis==null?void 0:globalThis.document){const n=wr(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 tN="DismissableLayer",Wu="dismissableLayer.update",nN="dismissableLayer.pointerDownOutside",rN="dismissableLayer.focusOutside",Ip,nv=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pd=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:s,...a}=e,u=y.useContext(nv),[f,d]=y.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=y.useState({}),x=fe(t,P=>d(P)),m=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(S),v=f?m.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=g,b=lN(P=>{const R=P.target,B=[...u.branches].some(O=>O.contains(R));!C||B||(i==null||i(P),l==null||l(P),P.defaultPrevented||s==null||s())},h),N=sN(P=>{const R=P.target;[...u.branches].some(O=>O.contains(R))||(o==null||o(P),l==null||l(P),P.defaultPrevented||s==null||s())},h);return eN(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},h),y.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ip=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Mp(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ip)}},[f,h,n,u]),y.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Mp())},[f,u]),y.useEffect(()=>{const P=()=>p({});return document.addEventListener(Wu,P),()=>document.removeEventListener(Wu,P)},[]),c.jsx(le.div,{...a,ref:x,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,b.onPointerDownCapture)})});Pd.displayName=tN;var iN="DismissableLayerBranch",oN=y.forwardRef((e,t)=>{const n=y.useContext(nv),r=y.useRef(null),i=fe(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(le.div,{...e,ref:i})});oN.displayName=iN;function lN(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let a=function(){rv(nN,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 sN(e,t=globalThis==null?void 0:globalThis.document){const n=wr(e),r=y.useRef(!1);return y.useEffect(()=>{const i=o=>{o.target&&!r.current&&rv(rN,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 Mp(){const e=new CustomEvent(Wu);document.dispatchEvent(e)}function rv(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?TE(i,o):i.dispatchEvent(o)}var ka=0;function iv(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Op()),document.body.insertAdjacentElement("beforeend",e[1]??Op()),ka++,()=>{ka===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ka--}},[])}function Op(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ca="focusScope.autoFocusOnMount",Ea="focusScope.autoFocusOnUnmount",Lp={bubbles:!1,cancelable:!0},aN="FocusScope",jd=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[s,a]=y.useState(null),u=wr(i),f=wr(o),d=y.useRef(null),h=fe(t,m=>a(m)),p=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let m=function(w){if(p.paused||!s)return;const C=w.target;s.contains(C)?d.current=C:Pn(d.current,{select:!0})},S=function(w){if(p.paused||!s)return;const C=w.relatedTarget;C!==null&&(s.contains(C)||Pn(d.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const b of w)b.removedNodes.length>0&&Pn(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",S);const v=new MutationObserver(g);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",S),v.disconnect()}}},[r,s,p.paused]),y.useEffect(()=>{if(s){zp.add(p);const m=document.activeElement;if(!s.contains(m)){const g=new CustomEvent(Ca,Lp);s.addEventListener(Ca,u),s.dispatchEvent(g),g.defaultPrevented||(uN(hN(ov(s)),{select:!0}),document.activeElement===m&&Pn(s))}return()=>{s.removeEventListener(Ca,u),setTimeout(()=>{const g=new CustomEvent(Ea,Lp);s.addEventListener(Ea,f),s.dispatchEvent(g),g.defaultPrevented||Pn(m??document.body,{select:!0}),s.removeEventListener(Ea,f),zp.remove(p)},0)}}},[s,u,f,p]);const x=y.useCallback(m=>{if(!n&&!r||p.paused)return;const S=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(S&&g){const v=m.currentTarget,[w,C]=cN(v);w&&C?!m.shiftKey&&g===C?(m.preventDefault(),n&&Pn(w,{select:!0})):m.shiftKey&&g===w&&(m.preventDefault(),n&&Pn(C,{select:!0})):g===v&&m.preventDefault()}},[n,r,p.paused]);return c.jsx(le.div,{tabIndex:-1,...l,ref:h,onKeyDown:x})});jd.displayName=aN;function uN(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pn(r,{select:t}),document.activeElement!==n)return}function cN(e){const t=ov(e),n=Dp(t,e),r=Dp(t.reverse(),e);return[n,r]}function ov(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 Dp(e,t){for(const n of e)if(!dN(n,{upTo:t}))return n}function dN(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 fN(e){return e instanceof HTMLInputElement&&"select"in e}function Pn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&fN(e)&&t&&e.select()}}var zp=pN();function pN(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Fp(e,t),e.unshift(t)},remove(t){var n;e=Fp(e,t),(n=e[0])==null||n.resume()}}}function Fp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hN(e){return e.filter(t=>t.tagName!=="A")}var mN=Nc[" useId ".trim().toString()]||(()=>{}),gN=0;function hr(e){const[t,n]=y.useState(mN());return We(()=>{e||n(r=>r??String(gN++))},[e]),e||(t?`radix-${t}`:"")}const yN=["top","right","bottom","left"],Gn=Math.min,ht=Math.max,ss=Math.round,ll=Math.floor,nn=e=>({x:e,y:e}),vN={left:"right",right:"left",bottom:"top",top:"bottom"},xN={start:"end",end:"start"};function Ku(e,t,n){return ht(e,Gn(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function xn(e){return e.split("-")[0]}function Ni(e){return e.split("-")[1]}function _d(e){return e==="x"?"y":"x"}function Rd(e){return e==="y"?"height":"width"}const wN=new Set(["top","bottom"]);function Zt(e){return wN.has(xn(e))?"y":"x"}function Ad(e){return _d(Zt(e))}function SN(e,t,n){n===void 0&&(n=!1);const r=Ni(e),i=Ad(e),o=Rd(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=as(l)),[l,as(l)]}function kN(e){const t=as(e);return[Gu(e),t,Gu(t)]}function Gu(e){return e.replace(/start|end/g,t=>xN[t])}const Bp=["left","right"],$p=["right","left"],CN=["top","bottom"],EN=["bottom","top"];function NN(e,t,n){switch(e){case"top":case"bottom":return n?t?$p:Bp:t?Bp:$p;case"left":case"right":return t?CN:EN;default:return[]}}function bN(e,t,n,r){const i=Ni(e);let o=NN(xn(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Gu)))),o}function as(e){return e.replace(/left|right|bottom|top/g,t=>vN[t])}function PN(e){return{top:0,right:0,bottom:0,left:0,...e}}function lv(e){return typeof e!="number"?PN(e):{top:e,right:e,bottom:e,left:e}}function us(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Up(e,t,n){let{reference:r,floating:i}=e;const o=Zt(t),l=Ad(t),s=Rd(l),a=xn(t),u=o==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let p;switch(a){case"top":p={x:f,y:r.y-i.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ni(t)){case"start":p[l]-=h*(n&&u?-1:1);break;case"end":p[l]+=h*(n&&u?-1:1);break}return p}const jN=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}=Up(u,r,a),h=r,p={},x=0;for(let m=0;m({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}=vn(e,t)||{};if(u==null)return{};const d=lv(f),h={x:n,y:r},p=Ad(i),x=Rd(p),m=await l.getDimensions(u),S=p==="y",g=S?"top":"left",v=S?"bottom":"right",w=S?"clientHeight":"clientWidth",C=o.reference[x]+o.reference[p]-h[p]-o.floating[x],b=h[p]-o.reference[p],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let P=N?N[w]:0;(!P||!await(l.isElement==null?void 0:l.isElement(N)))&&(P=s.floating[w]||o.floating[x]);const R=C/2-b/2,B=P/2-m[x]/2-1,O=Gn(d[g],B),I=Gn(d[v],B),j=O,V=P-m[x]-I,M=P/2-m[x]/2+R,L=Ku(j,M,V),$=!a.arrow&&Ni(i)!=null&&M!==L&&o.reference[x]/2-(MM<=0)){var I,j;const M=(((I=o.flip)==null?void 0:I.index)||0)+1,L=P[M];if(L&&(!(d==="alignment"?v!==Zt(L):!1)||O.every(_=>Zt(_.placement)===v?_.overflows[0]>0:!0)))return{data:{index:M,overflows:O},reset:{placement:L}};let $=(j=O.filter(H=>H.overflows[0]<=0).sort((H,_)=>H.overflows[1]-_.overflows[1])[0])==null?void 0:j.placement;if(!$)switch(p){case"bestFit":{var V;const H=(V=O.filter(_=>{if(N){const z=Zt(_.placement);return z===v||z==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(z=>z>0).reduce((z,k)=>z+k,0)]).sort((_,z)=>_[1]-z[1])[0])==null?void 0:V[0];H&&($=H);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function Vp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hp(e){return yN.some(t=>e[t]>=0)}const AN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=vn(e,t);switch(r){case"referenceHidden":{const o=await jo(t,{...i,elementContext:"reference"}),l=Vp(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Hp(l)}}}case"escaped":{const o=await jo(t,{...i,altBoundary:!0}),l=Vp(o,n.floating);return{data:{escapedOffsets:l,escaped:Hp(l)}}}default:return{}}}}},sv=new Set(["left","top"]);async function TN(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=xn(n),s=Ni(n),a=Zt(n)==="y",u=sv.has(l)?-1:1,f=o&&a?-1:1,d=vn(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof x=="number"&&(p=s==="end"?x*-1:x),a?{x:p*f,y:h*u}:{x:h*u,y:p*f}}const IN=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 TN(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}}}}},MN=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:g,y:v}=S;return{x:g,y:v}}},...a}=vn(e,t),u={x:n,y:r},f=await jo(t,a),d=Zt(xn(i)),h=_d(d);let p=u[h],x=u[d];if(o){const S=h==="y"?"top":"left",g=h==="y"?"bottom":"right",v=p+f[S],w=p-f[g];p=Ku(v,p,w)}if(l){const S=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=x+f[S],w=x-f[g];x=Ku(v,x,w)}const m=s.fn({...t,[h]:p,[d]:x});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:o,[d]:l}}}}}},ON=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}=vn(e,t),f={x:n,y:r},d=Zt(i),h=_d(d);let p=f[h],x=f[d];const m=vn(s,t),S=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const w=h==="y"?"height":"width",C=o.reference[h]-o.floating[w]+S.mainAxis,b=o.reference[h]+o.reference[w]-S.mainAxis;pb&&(p=b)}if(u){var g,v;const w=h==="y"?"width":"height",C=sv.has(xn(i)),b=o.reference[d]-o.floating[w]+(C&&((g=l.offset)==null?void 0:g[d])||0)+(C?0:S.crossAxis),N=o.reference[d]+o.reference[w]+(C?0:((v=l.offset)==null?void 0:v[d])||0)-(C?S.crossAxis:0);xN&&(x=N)}return{[h]:p,[d]:x}}}},LN=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}=vn(e,t),f=await jo(t,u),d=xn(i),h=Ni(i),p=Zt(i)==="y",{width:x,height:m}=o.floating;let S,g;d==="top"||d==="bottom"?(S=d,g=h===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,S=h==="end"?"top":"bottom");const v=m-f.top-f.bottom,w=x-f.left-f.right,C=Gn(m-f[S],v),b=Gn(x-f[g],w),N=!t.middlewareData.shift;let P=C,R=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),N&&!h){const O=ht(f.left,0),I=ht(f.right,0),j=ht(f.top,0),V=ht(f.bottom,0);p?R=x-2*(O!==0||I!==0?O+I:ht(f.left,f.right)):P=m-2*(j!==0||V!==0?j+V:ht(f.top,f.bottom))}await a({...t,availableWidth:R,availableHeight:P});const B=await l.getDimensions(s.floating);return x!==B.width||m!==B.height?{reset:{rects:!0}}:{}}}};function Ms(){return typeof window<"u"}function bi(e){return av(e)?(e.nodeName||"").toLowerCase():"#document"}function xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){var t;return(t=(av(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function av(e){return Ms()?e instanceof Node||e instanceof xt(e).Node:!1}function Vt(e){return Ms()?e instanceof Element||e instanceof xt(e).Element:!1}function rn(e){return Ms()?e instanceof HTMLElement||e instanceof xt(e).HTMLElement:!1}function Wp(e){return!Ms()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xt(e).ShadowRoot}const DN=new Set(["inline","contents"]);function zo(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!DN.has(i)}const zN=new Set(["table","td","th"]);function FN(e){return zN.has(bi(e))}const BN=[":popover-open",":modal"];function Os(e){return BN.some(t=>{try{return e.matches(t)}catch{return!1}})}const $N=["transform","translate","scale","rotate","perspective"],UN=["transform","translate","scale","rotate","perspective","filter"],VN=["paint","layout","strict","content"];function Td(e){const t=Id(),n=Vt(e)?Ht(e):e;return $N.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)||UN.some(r=>(n.willChange||"").includes(r))||VN.some(r=>(n.contain||"").includes(r))}function HN(e){let t=Yn(e);for(;rn(t)&&!vi(t);){if(Td(t))return t;if(Os(t))return null;t=Yn(t)}return null}function Id(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const WN=new Set(["html","body","#document"]);function vi(e){return WN.has(bi(e))}function Ht(e){return xt(e).getComputedStyle(e)}function Ls(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yn(e){if(bi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wp(e)&&e.host||ln(e);return Wp(t)?t.host:t}function uv(e){const t=Yn(e);return vi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rn(t)&&zo(t)?t:uv(t)}function _o(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=uv(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=xt(i);if(o){const s=Yu(l);return t.concat(l,l.visualViewport||[],zo(i)?i:[],s&&n?_o(s):[])}return t.concat(i,_o(i,[],n))}function Yu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function cv(e){const t=Ht(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=rn(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=ss(n)!==o||ss(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Md(e){return Vt(e)?e:e.contextElement}function ii(e){const t=Md(e);if(!rn(t))return nn(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=cv(t);let l=(o?ss(n.width):n.width)/r,s=(o?ss(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const KN=nn(0);function dv(e){const t=xt(e);return!Id()||!t.visualViewport?KN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xt(e)?!1:t}function Sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Md(e);let l=nn(1);t&&(r?Vt(r)&&(l=ii(r)):l=ii(e));const s=GN(o,n,r)?dv(o):nn(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 h=xt(o),p=r&&Vt(r)?xt(r):r;let x=h,m=Yu(x);for(;m&&r&&p!==x;){const S=ii(m),g=m.getBoundingClientRect(),v=Ht(m),w=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*S.x,C=g.top+(m.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,f*=S.x,d*=S.y,a+=w,u+=C,x=xt(m),m=Yu(x)}}return us({width:f,height:d,x:a,y:u})}function Ds(e,t){const n=Ls(e).scrollLeft;return t?t.left+n:Sr(ln(e)).left+n}function fv(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ds(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function YN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ln(r),s=t?Os(t.floating):!1;if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},u=nn(1);const f=nn(0),d=rn(r);if((d||!d&&!o)&&((bi(r)!=="body"||zo(l))&&(a=Ls(r)),rn(r))){const p=Sr(r);u=ii(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const h=l&&!d&&!o?fv(l,a):nn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-a.scrollTop*u.y+f.y+h.y}}function QN(e){return Array.from(e.getClientRects())}function XN(e){const t=ln(e),n=Ls(e),r=e.ownerDocument.body,i=ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Ds(e);const s=-n.scrollTop;return Ht(r).direction==="rtl"&&(l+=ht(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}const Kp=25;function qN(e,t){const n=xt(e),r=ln(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=Id();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}const u=Ds(r);if(u<=0){const f=r.ownerDocument,d=f.body,h=getComputedStyle(d),p=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(r.clientWidth-d.clientWidth-p);x<=Kp&&(o-=x)}else u<=Kp&&(o+=u);return{width:o,height:l,x:s,y:a}}const JN=new Set(["absolute","fixed"]);function ZN(e,t){const n=Sr(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=rn(e)?ii(e):nn(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 Gp(e,t,n){let r;if(t==="viewport")r=qN(e,n);else if(t==="document")r=XN(ln(e));else if(Vt(t))r=ZN(t,n);else{const i=dv(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return us(r)}function pv(e,t){const n=Yn(e);return n===t||!Vt(n)||vi(n)?!1:Ht(n).position==="fixed"||pv(n,t)}function eb(e,t){const n=t.get(e);if(n)return n;let r=_o(e,[],!1).filter(s=>Vt(s)&&bi(s)!=="body"),i=null;const o=Ht(e).position==="fixed";let l=o?Yn(e):e;for(;Vt(l)&&!vi(l);){const s=Ht(l),a=Td(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&JN.has(i.position)||zo(l)&&!a&&pv(e,l))?r=r.filter(f=>f!==l):i=s,l=Yn(l)}return t.set(e,r),r}function tb(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Os(t)?[]:eb(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,f)=>{const d=Gp(t,f,i);return u.top=ht(d.top,u.top),u.right=Gn(d.right,u.right),u.bottom=Gn(d.bottom,u.bottom),u.left=ht(d.left,u.left),u},Gp(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function nb(e){const{width:t,height:n}=cv(e);return{width:t,height:n}}function rb(e,t,n){const r=rn(t),i=ln(t),o=n==="fixed",l=Sr(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const a=nn(0);function u(){a.x=Ds(i)}if(r||!r&&!o)if((bi(t)!=="body"||zo(i))&&(s=Ls(t)),r){const p=Sr(t,!0,o,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?fv(i,s):nn(0),d=l.left+s.scrollLeft-a.x-f.x,h=l.top+s.scrollTop-a.y-f.y;return{x:d,y:h,width:l.width,height:l.height}}function Na(e){return Ht(e).position==="static"}function Yp(e,t){if(!rn(e)||Ht(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ln(e)===n&&(n=n.ownerDocument.body),n}function hv(e,t){const n=xt(e);if(Os(e))return n;if(!rn(e)){let i=Yn(e);for(;i&&!vi(i);){if(Vt(i)&&!Na(i))return i;i=Yn(i)}return n}let r=Yp(e,t);for(;r&&FN(r)&&Na(r);)r=Yp(r,t);return r&&vi(r)&&Na(r)&&!Td(r)?n:r||HN(e)||n}const ib=async function(e){const t=this.getOffsetParent||hv,n=this.getDimensions,r=await n(e.floating);return{reference:rb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ob(e){return Ht(e).direction==="rtl"}const lb={convertOffsetParentRelativeRectToViewportRelativeRect:YN,getDocumentElement:ln,getClippingRect:tb,getOffsetParent:hv,getElementRects:ib,getClientRects:QN,getDimensions:nb,getScale:ii,isElement:Vt,isRTL:ob};function mv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sb(e,t){let n=null,r;const i=ln(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:h,height:p}=u;if(s||t(),!h||!p)return;const x=ll(d),m=ll(i.clientWidth-(f+h)),S=ll(i.clientHeight-(d+p)),g=ll(f),w={rootMargin:-x+"px "+-m+"px "+-S+"px "+-g+"px",threshold:ht(0,Gn(1,a))||1};let C=!0;function b(N){const P=N[0].intersectionRatio;if(P!==a){if(!C)return l();P?l(!1,P):r=setTimeout(()=>{l(!1,1e-7)},1e3)}P===1&&!mv(u,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(b,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(e)}return l(!0),o}function ab(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=Md(e),f=i||o?[...u?_o(u):[],..._o(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),o&&g.addEventListener("resize",n)});const d=u&&s?sb(u,n):null;let h=-1,p=null;l&&(p=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!a&&p.observe(u),p.observe(t));let x,m=a?Sr(e):null;a&&S();function S(){const g=Sr(e);m&&!mv(m,g)&&n(),m=g,x=requestAnimationFrame(S)}return n(),()=>{var g;f.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(g=p)==null||g.disconnect(),p=null,a&&cancelAnimationFrame(x)}}const ub=IN,cb=MN,db=RN,fb=LN,pb=AN,Qp=_N,hb=ON,mb=(e,t,n)=>{const r=new Map,i={platform:lb,...n},o={...i.platform,_c:r};return jN(e,t,{...i,platform:o})};var gb=typeof document<"u",yb=function(){},Pl=gb?y.useLayoutEffect:yb;function cs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!cs(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function gv(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xp(e,t){const n=gv(e);return Math.round(t*n)/n}function ba(e){const t=y.useRef(e);return Pl(()=>{t.current=e}),t}function vb(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}),[h,p]=y.useState(r);cs(h,r)||p(r);const[x,m]=y.useState(null),[S,g]=y.useState(null),v=y.useCallback(_=>{_!==N.current&&(N.current=_,m(_))},[]),w=y.useCallback(_=>{_!==P.current&&(P.current=_,g(_))},[]),C=o||x,b=l||S,N=y.useRef(null),P=y.useRef(null),R=y.useRef(f),B=a!=null,O=ba(a),I=ba(i),j=ba(u),V=y.useCallback(()=>{if(!N.current||!P.current)return;const _={placement:t,strategy:n,middleware:h};I.current&&(_.platform=I.current),mb(N.current,P.current,_).then(z=>{const k={...z,isPositioned:j.current!==!1};M.current&&!cs(R.current,k)&&(R.current=k,ki.flushSync(()=>{d(k)}))})},[h,t,n,I,j]);Pl(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[u]);const M=y.useRef(!1);Pl(()=>(M.current=!0,()=>{M.current=!1}),[]),Pl(()=>{if(C&&(N.current=C),b&&(P.current=b),C&&b){if(O.current)return O.current(C,b,V);V()}},[C,b,V,O,B]);const L=y.useMemo(()=>({reference:N,floating:P,setReference:v,setFloating:w}),[v,w]),$=y.useMemo(()=>({reference:C,floating:b}),[C,b]),H=y.useMemo(()=>{const _={position:n,left:0,top:0};if(!$.floating)return _;const z=Xp($.floating,f.x),k=Xp($.floating,f.y);return s?{..._,transform:"translate("+z+"px, "+k+"px)",...gv($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:k}},[n,s,$.floating,f.x,f.y]);return y.useMemo(()=>({...f,update:V,refs:L,elements:$,floatingStyles:H}),[f,V,L,$,H])}const xb=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?Qp({element:r.current,padding:i}).fn(n):{}:r?Qp({element:r,padding:i}).fn(n):{}}}},wb=(e,t)=>({...ub(e),options:[e,t]}),Sb=(e,t)=>({...cb(e),options:[e,t]}),kb=(e,t)=>({...hb(e),options:[e,t]}),Cb=(e,t)=>({...db(e),options:[e,t]}),Eb=(e,t)=>({...fb(e),options:[e,t]}),Nb=(e,t)=>({...pb(e),options:[e,t]}),bb=(e,t)=>({...xb(e),options:[e,t]});var Pb="Arrow",yv=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(le.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"})})});yv.displayName=Pb;var jb=yv,Od="Popper",[vv,xv]=_r(Od),[_b,wv]=vv(Od),Sv=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return c.jsx(_b,{scope:t,anchor:r,onAnchorChange:i,children:n})};Sv.displayName=Od;var kv="PopperAnchor",Cv=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=wv(kv,n),l=y.useRef(null),s=fe(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(le.div,{...i,ref:s})});Cv.displayName=kv;var Ld="PopperContent",[Rb,Ab]=vv(Ld),Ev=y.forwardRef((e,t)=>{var G,te,Se,T,W,Q;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:h=!1,updatePositionStrategy:p="optimized",onPlaced:x,...m}=e,S=wv(Ld,n),[g,v]=y.useState(null),w=fe(t,he=>v(he)),[C,b]=y.useState(null),N=Ly(C),P=(N==null?void 0:N.width)??0,R=(N==null?void 0:N.height)??0,B=r+(o!=="center"?"-"+o:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(u)?u:[u],j=I.length>0,V={padding:O,boundary:I.filter(Ib),altBoundary:j},{refs:M,floatingStyles:L,placement:$,isPositioned:H,middlewareData:_}=vb({strategy:"fixed",placement:B,whileElementsMounted:(...he)=>ab(...he,{animationFrame:p==="always"}),elements:{reference:S.anchor},middleware:[wb({mainAxis:i+R,alignmentAxis:l}),a&&Sb({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?kb():void 0,...V}),a&&Cb({...V}),Eb({...V,apply:({elements:he,rects:ye,availableWidth:ct,availableHeight:kn})=>{const{width:Cn,height:Ys}=ye.reference,nr=he.floating.style;nr.setProperty("--radix-popper-available-width",`${ct}px`),nr.setProperty("--radix-popper-available-height",`${kn}px`),nr.setProperty("--radix-popper-anchor-width",`${Cn}px`),nr.setProperty("--radix-popper-anchor-height",`${Ys}px`)}}),C&&bb({element:C,padding:s}),Mb({arrowWidth:P,arrowHeight:R}),h&&Nb({strategy:"referenceHidden",...V})]}),[z,k]=Pv($),Y=wr(x);We(()=>{H&&(Y==null||Y())},[H,Y]);const X=(G=_.arrow)==null?void 0:G.x,E=(te=_.arrow)==null?void 0:te.y,ee=((Se=_.arrow)==null?void 0:Se.centerOffset)!==0,[Te,ie]=y.useState();return We(()=>{g&&ie(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:H?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(T=_.transformOrigin)==null?void 0:T.x,(W=_.transformOrigin)==null?void 0:W.y].join(" "),...((Q=_.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Rb,{scope:n,placedSide:z,onArrowChange:b,arrowX:X,arrowY:E,shouldHideArrow:ee,children:c.jsx(le.div,{"data-side":z,"data-align":k,...m,ref:w,style:{...m.style,animation:H?void 0:"none"}})})})});Ev.displayName=Ld;var Nv="PopperArrow",Tb={top:"bottom",right:"left",bottom:"top",left:"right"},bv=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Ab(Nv,r),l=Tb[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(jb,{...i,ref:n,style:{...i.style,display:"block"}})})});bv.displayName=Nv;function Ib(e){return e!==null}var Mb=e=>({name:"transformOrigin",options:e,fn(t){var S,g,v;const{placement:n,rects:r,middlewareData:i}=t,l=((S=i.arrow)==null?void 0:S.centerOffset)!==0,s=l?0:e.arrowWidth,a=l?0:e.arrowHeight,[u,f]=Pv(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,p=(((v=i.arrow)==null?void 0:v.y)??0)+a/2;let x="",m="";return u==="bottom"?(x=l?d:`${h}px`,m=`${-a}px`):u==="top"?(x=l?d:`${h}px`,m=`${r.floating.height+a}px`):u==="right"?(x=`${-a}px`,m=l?d:`${p}px`):u==="left"&&(x=`${r.floating.width+a}px`,m=l?d:`${p}px`),{data:{x,y:m}}}});function Pv(e){const[t,n="center"]=e.split("-");return[t,n]}var Ob=Sv,Lb=Cv,Db=Ev,zb=bv,Fb="Portal",Dd=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,o]=y.useState(!1);We(()=>o(!0),[]);const l=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return l?jS.createPortal(c.jsx(le.div,{...r,ref:t}),l):null});Dd.displayName=Fb;var jv=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"}),Bb="VisuallyHidden",$b=y.forwardRef((e,t)=>c.jsx(le.span,{...e,ref:t,style:{...jv,...e.style}}));$b.displayName=Bb;var Ub=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ir=new WeakMap,sl=new WeakMap,al={},Pa=0,_v=function(e){return e&&(e.host||_v(e.parentNode))},Vb=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=_v(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})},Hb=function(e,t,n,r){var i=Vb(t,Array.isArray(e)?e:[e]);al[n]||(al[n]=new WeakMap);var o=al[n],l=[],s=new Set,a=new Set(i),u=function(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(h){if(s.has(h))f(h);else try{var p=h.getAttribute(r),x=p!==null&&p!=="false",m=(Ir.get(h)||0)+1,S=(o.get(h)||0)+1;Ir.set(h,m),o.set(h,S),l.push(h),m===1&&x&&sl.set(h,!0),S===1&&h.setAttribute(n,"true"),x||h.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return f(t),s.clear(),Pa++,function(){l.forEach(function(d){var h=Ir.get(d)-1,p=o.get(d)-1;Ir.set(d,h),o.set(d,p),h||(sl.has(d)||d.removeAttribute(r),sl.delete(d)),p||d.removeAttribute(n)}),Pa--,Pa||(Ir=new WeakMap,Ir=new WeakMap,sl=new WeakMap,al={})}},Rv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ub(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Hb(r,i,n,"aria-hidden")):function(){return null}},qt=function(){return qt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return s2;var t=a2(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])}},c2=Mv(),oi="data-scroll-locked",d2=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(Kb,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(oi,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(jl,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(_l,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(jl," .").concat(jl,` { + right: 0 `).concat(r,`; + } + + .`).concat(_l," .").concat(_l,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(oi,`] { + `).concat(Gb,": ").concat(s,`px; + } +`)},Zp=function(){var e=parseInt(document.body.getAttribute(oi)||"0",10);return isFinite(e)?e:0},f2=function(){y.useEffect(function(){return document.body.setAttribute(oi,(Zp()+1).toString()),function(){var e=Zp()-1;e<=0?document.body.removeAttribute(oi):document.body.setAttribute(oi,e.toString())}},[])},p2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;f2();var o=y.useMemo(function(){return u2(i)},[i]);return y.createElement(c2,{styles:d2(o,!t,i,n?"":"!important")})},Qu=!1;if(typeof window<"u")try{var ul=Object.defineProperty({},"passive",{get:function(){return Qu=!0,!0}});window.addEventListener("test",ul,ul),window.removeEventListener("test",ul,ul)}catch{Qu=!1}var Mr=Qu?{passive:!1}:!1,h2=function(e){return e.tagName==="TEXTAREA"},Ov=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!h2(e)&&n[t]==="visible")},m2=function(e){return Ov(e,"overflowY")},g2=function(e){return Ov(e,"overflowX")},eh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Lv(e,r);if(i){var o=Dv(e,r),l=o[1],s=o[2];if(l>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},y2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},v2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Lv=function(e,t){return e==="v"?m2(t):g2(t)},Dv=function(e,t){return e==="v"?y2(t):v2(t)},x2=function(e,t){return e==="h"&&t==="rtl"?-1:1},w2=function(e,t,n,r,i){var o=x2(e,window.getComputedStyle(t).direction),l=o*r,s=n.target,a=t.contains(s),u=!1,f=l>0,d=0,h=0;do{if(!s)break;var p=Dv(e,s),x=p[0],m=p[1],S=p[2],g=m-S-o*x;(x||g)&&Lv(e,s)&&(d+=g,h+=x);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(f&&(i&&Math.abs(d)<1||!i&&l>d)||!f&&(i&&Math.abs(h)<1||!i&&-l>h))&&(u=!0),u},cl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},th=function(e){return[e.deltaX,e.deltaY]},nh=function(e){return e&&"current"in e?e.current:e},S2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k2=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},C2=0,Or=[];function E2(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(C2++)[0],o=y.useState(Mv)[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 m=Wb([e.lockRef.current],(e.shards||[]).map(nh),!0).filter(Boolean);return m.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(m,S){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!l.current.allowPinchZoom;var g=cl(m),v=n.current,w="deltaX"in m?m.deltaX:v[0]-g[0],C="deltaY"in m?m.deltaY:v[1]-g[1],b,N=m.target,P=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in m&&P==="h"&&N.type==="range")return!1;var R=eh(P,N);if(!R)return!0;if(R?b=P:(b=P==="v"?"h":"v",R=eh(P,N)),!R)return!1;if(!r.current&&"changedTouches"in m&&(w||C)&&(r.current=b),!b)return!0;var B=r.current||b;return w2(B,S,m,B==="h"?w:C,!0)},[]),a=y.useCallback(function(m){var S=m;if(!(!Or.length||Or[Or.length-1]!==o)){var g="deltaY"in S?th(S):cl(S),v=t.current.filter(function(b){return b.name===S.type&&(b.target===S.target||S.target===b.shadowParent)&&S2(b.delta,g)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var w=(l.current.shards||[]).map(nh).filter(Boolean).filter(function(b){return b.contains(S.target)}),C=w.length>0?s(S,w[0]):!l.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=y.useCallback(function(m,S,g,v){var w={name:m,delta:S,target:g,should:v,shadowParent:N2(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),f=y.useCallback(function(m){n.current=cl(m),r.current=void 0},[]),d=y.useCallback(function(m){u(m.type,th(m),m.target,s(m,e.lockRef.current))},[]),h=y.useCallback(function(m){u(m.type,cl(m),m.target,s(m,e.lockRef.current))},[]);y.useEffect(function(){return Or.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",a,Mr),document.addEventListener("touchmove",a,Mr),document.addEventListener("touchstart",f,Mr),function(){Or=Or.filter(function(m){return m!==o}),document.removeEventListener("wheel",a,Mr),document.removeEventListener("touchmove",a,Mr),document.removeEventListener("touchstart",f,Mr)}},[]);var p=e.removeScrollBar,x=e.inert;return y.createElement(y.Fragment,null,x?y.createElement(o,{styles:k2(i)}):null,p?y.createElement(p2,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function N2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const b2=e2(Iv,E2);var zv=y.forwardRef(function(e,t){return y.createElement(zs,qt({},e,{ref:t,sideCar:b2}))});zv.classNames=zs.classNames;const Fv=zv;var P2=[" ","Enter","ArrowUp","ArrowDown"],j2=[" ","Enter"],kr="Select",[Fs,Bs,_2]=Dy(kr),[Pi,zT]=_r(kr,[_2,xv]),$s=xv(),[R2,Zn]=Pi(kr),[A2,T2]=Pi(kr),Bv=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:h,required:p,form:x}=e,m=$s(t),[S,g]=y.useState(null),[v,w]=y.useState(null),[C,b]=y.useState(!1),N=My(u),[P,R]=Po({prop:r,defaultProp:i??!1,onChange:o,caller:kr}),[B,O]=Po({prop:l,defaultProp:s,onChange:a,caller:kr}),I=y.useRef(null),j=S?x||!!S.closest("form"):!0,[V,M]=y.useState(new Set),L=Array.from(V).map($=>$.props.value).join(";");return c.jsx(Ob,{...m,children:c.jsxs(R2,{required:p,scope:t,trigger:S,onTriggerChange:g,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:b,contentId:hr(),value:B,onValueChange:O,open:P,onOpenChange:R,dir:N,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Fs.Provider,{scope:t,children:c.jsx(A2,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback($=>{M(H=>new Set(H).add($))},[]),onNativeOptionRemove:y.useCallback($=>{M(H=>{const _=new Set(H);return _.delete($),_})},[]),children:n})}),j?c.jsxs(dx,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:d,value:B,onChange:$=>O($.target.value),disabled:h,form:x,children:[B===void 0?c.jsx("option",{value:""}):null,Array.from(V)]},L):null]})})};Bv.displayName=kr;var $v="SelectTrigger",Uv=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=$s(n),l=Zn($v,n),s=l.disabled||r,a=fe(t,l.onTriggerChange),u=Bs(n),f=y.useRef("touch"),[d,h,p]=px(m=>{const S=u().filter(w=>!w.disabled),g=S.find(w=>w.value===l.value),v=hx(S,m,g);v!==void 0&&l.onValueChange(v.value)}),x=m=>{s||(l.onOpenChange(!0),p()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(Lb,{asChild:!0,...o,children:c.jsx(le.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":fx(l.value)?"":void 0,...i,ref:a,onClick:ae(i.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&x(m)}),onPointerDown:ae(i.onPointerDown,m=>{f.current=m.pointerType;const S=m.target;S.hasPointerCapture(m.pointerId)&&S.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:ae(i.onKeyDown,m=>{const S=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(S&&m.key===" ")&&P2.includes(m.key)&&(x(),m.preventDefault())})})})});Uv.displayName=$v;var Vv="SelectValue",Hv=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=e,a=Zn(Vv,n),{onValueNodeHasChildrenChange:u}=a,f=o!==void 0,d=fe(t,a.onValueNodeChange);return We(()=>{u(f)},[u,f]),c.jsx(le.span,{...s,ref:d,style:{pointerEvents:"none"},children:fx(a.value)?c.jsx(c.Fragment,{children:l}):o})});Hv.displayName=Vv;var I2="SelectIcon",Wv=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(le.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});Wv.displayName=I2;var M2="SelectPortal",Kv=e=>c.jsx(Dd,{asChild:!0,...e});Kv.displayName=M2;var Cr="SelectContent",Gv=y.forwardRef((e,t)=>{const n=Zn(Cr,e.__scopeSelect),[r,i]=y.useState();if(We(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ki.createPortal(c.jsx(Yv,{scope:e.__scopeSelect,children:c.jsx(Fs.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(Qv,{...e,ref:t})});Gv.displayName=Cr;var Ot=10,[Yv,er]=Pi(Cr),O2="SelectContentImpl",L2=yi("SelectContent.RemoveScroll"),Qv=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:h,collisionPadding:p,sticky:x,hideWhenDetached:m,avoidCollisions:S,...g}=e,v=Zn(Cr,n),[w,C]=y.useState(null),[b,N]=y.useState(null),P=fe(t,G=>C(G)),[R,B]=y.useState(null),[O,I]=y.useState(null),j=Bs(n),[V,M]=y.useState(!1),L=y.useRef(!1);y.useEffect(()=>{if(w)return Rv(w)},[w]),iv();const $=y.useCallback(G=>{const[te,...Se]=j().map(Q=>Q.ref.current),[T]=Se.slice(-1),W=document.activeElement;for(const Q of G)if(Q===W||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===te&&b&&(b.scrollTop=0),Q===T&&b&&(b.scrollTop=b.scrollHeight),Q==null||Q.focus(),document.activeElement!==W))return},[j,b]),H=y.useCallback(()=>$([R,w]),[$,R,w]);y.useEffect(()=>{V&&H()},[V,H]);const{onOpenChange:_,triggerPointerDownPosRef:z}=v;y.useEffect(()=>{if(w){let G={x:0,y:0};const te=T=>{var W,Q;G={x:Math.abs(Math.round(T.pageX)-(((W=z.current)==null?void 0:W.x)??0)),y:Math.abs(Math.round(T.pageY)-(((Q=z.current)==null?void 0:Q.y)??0))}},Se=T=>{G.x<=10&&G.y<=10?T.preventDefault():w.contains(T.target)||_(!1),document.removeEventListener("pointermove",te),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",Se,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",Se,{capture:!0})}}},[w,_,z]),y.useEffect(()=>{const G=()=>_(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[_]);const[k,Y]=px(G=>{const te=j().filter(W=>!W.disabled),Se=te.find(W=>W.ref.current===document.activeElement),T=hx(te,G,Se);T&&setTimeout(()=>T.ref.current.focus())}),X=y.useCallback((G,te,Se)=>{const T=!L.current&&!Se;(v.value!==void 0&&v.value===te||T)&&(B(G),T&&(L.current=!0))},[v.value]),E=y.useCallback(()=>w==null?void 0:w.focus(),[w]),ee=y.useCallback((G,te,Se)=>{const T=!L.current&&!Se;(v.value!==void 0&&v.value===te||T)&&I(G)},[v.value]),Te=r==="popper"?Xu:Xv,ie=Te===Xu?{side:s,sideOffset:a,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:p,sticky:x,hideWhenDetached:m,avoidCollisions:S}:{};return c.jsx(Yv,{scope:n,content:w,viewport:b,onViewportChange:N,itemRefCallback:X,selectedItem:R,onItemLeave:E,itemTextRefCallback:ee,focusSelectedItem:H,selectedItemText:O,position:r,isPositioned:V,searchRef:k,children:c.jsx(Fv,{as:L2,allowPinchZoom:!0,children:c.jsx(jd,{asChild:!0,trapped:v.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ae(i,G=>{var te;(te=v.trigger)==null||te.focus({preventScroll:!0}),G.preventDefault()}),children:c.jsx(Pd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(Te,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:G=>G.preventDefault(),...g,...ie,onPlaced:()=>M(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ae(g.onKeyDown,G=>{const te=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!te&&G.key.length===1&&Y(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let T=j().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(G.key)&&(T=T.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const W=G.target,Q=T.indexOf(W);T=T.slice(Q+1)}setTimeout(()=>$(T)),G.preventDefault()}})})})})})})});Qv.displayName=O2;var D2="SelectItemAlignedPosition",Xv=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Zn(Cr,n),l=er(Cr,n),[s,a]=y.useState(null),[u,f]=y.useState(null),d=fe(t,P=>f(P)),h=Bs(n),p=y.useRef(!1),x=y.useRef(!0),{viewport:m,selectedItem:S,selectedItemText:g,focusSelectedItem:v}=l,w=y.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&m&&S&&g){const P=o.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),B=o.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(o.dir!=="rtl"){const W=O.left-R.left,Q=B.left-W,he=P.left-Q,ye=P.width+he,ct=Math.max(ye,R.width),kn=window.innerWidth-Ot,Cn=ls(Q,[Ot,Math.max(Ot,kn-ct)]);s.style.minWidth=ye+"px",s.style.left=Cn+"px"}else{const W=R.right-O.right,Q=window.innerWidth-B.right-W,he=window.innerWidth-P.right-Q,ye=P.width+he,ct=Math.max(ye,R.width),kn=window.innerWidth-Ot,Cn=ls(Q,[Ot,Math.max(Ot,kn-ct)]);s.style.minWidth=ye+"px",s.style.right=Cn+"px"}const I=h(),j=window.innerHeight-Ot*2,V=m.scrollHeight,M=window.getComputedStyle(u),L=parseInt(M.borderTopWidth,10),$=parseInt(M.paddingTop,10),H=parseInt(M.borderBottomWidth,10),_=parseInt(M.paddingBottom,10),z=L+$+V+_+H,k=Math.min(S.offsetHeight*5,z),Y=window.getComputedStyle(m),X=parseInt(Y.paddingTop,10),E=parseInt(Y.paddingBottom,10),ee=P.top+P.height/2-Ot,Te=j-ee,ie=S.offsetHeight/2,G=S.offsetTop+ie,te=L+$+G,Se=z-te;if(te<=ee){const W=I.length>0&&S===I[I.length-1].ref.current;s.style.bottom="0px";const Q=u.clientHeight-m.offsetTop-m.offsetHeight,he=Math.max(Te,ie+(W?E:0)+Q+H),ye=te+he;s.style.height=ye+"px"}else{const W=I.length>0&&S===I[0].ref.current;s.style.top="0px";const he=Math.max(ee,L+m.offsetTop+(W?X:0)+ie)+Se;s.style.height=he+"px",m.scrollTop=te-ee+m.offsetTop}s.style.margin=`${Ot}px 0`,s.style.minHeight=k+"px",s.style.maxHeight=j+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,o.trigger,o.valueNode,s,u,m,S,g,o.dir,r]);We(()=>w(),[w]);const[C,b]=y.useState();We(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const N=y.useCallback(P=>{P&&x.current===!0&&(w(),v==null||v(),x.current=!1)},[w,v]);return c.jsx(F2,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:N,children:c.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(le.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Xv.displayName=D2;var z2="SelectPopperPosition",Xu=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ot,...o}=e,l=$s(n);return c.jsx(Db,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xu.displayName=z2;var[F2,zd]=Pi(Cr,{}),qu="SelectViewport",qv=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=er(qu,n),l=zd(qu,n),s=fe(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(Fs.Slot,{scope:n,children:c.jsx(le.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ae(i.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=l;if(h!=null&&h.current&&d){const p=Math.abs(a.current-f.scrollTop);if(p>0){const x=window.innerHeight-Ot*2,m=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),g=Math.max(m,S);if(g0?C:0,d.style.justifyContent="flex-end")}}}a.current=f.scrollTop})})})]})});qv.displayName=qu;var Jv="SelectGroup",[B2,$2]=Pi(Jv),Zv=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hr();return c.jsx(B2,{scope:n,id:i,children:c.jsx(le.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Zv.displayName=Jv;var ex="SelectLabel",tx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$2(ex,n);return c.jsx(le.div,{id:i.id,...r,ref:t})});tx.displayName=ex;var ds="SelectItem",[U2,nx]=Pi(ds),rx=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,s=Zn(ds,n),a=er(ds,n),u=s.value===r,[f,d]=y.useState(o??""),[h,p]=y.useState(!1),x=fe(t,v=>{var w;return(w=a.itemRefCallback)==null?void 0:w.call(a,v,r,i)}),m=hr(),S=y.useRef("touch"),g=()=>{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(U2,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:y.useCallback(v=>{d(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Fs.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:c.jsx(le.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:x,onFocus:ae(l.onFocus,()=>p(!0)),onBlur:ae(l.onBlur,()=>p(!1)),onClick:ae(l.onClick,()=>{S.current!=="mouse"&&g()}),onPointerUp:ae(l.onPointerUp,()=>{S.current==="mouse"&&g()}),onPointerDown:ae(l.onPointerDown,v=>{S.current=v.pointerType}),onPointerMove:ae(l.onPointerMove,v=>{var w;S.current=v.pointerType,i?(w=a.onItemLeave)==null||w.call(a):S.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(l.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=a.onItemLeave)==null||w.call(a))}),onKeyDown:ae(l.onKeyDown,v=>{var C;((C=a.searchRef)==null?void 0:C.current)!==""&&v.key===" "||(j2.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});rx.displayName=ds;var Yi="SelectItemText",ix=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=Zn(Yi,n),s=er(Yi,n),a=nx(Yi,n),u=T2(Yi,n),[f,d]=y.useState(null),h=fe(t,g=>d(g),a.onItemTextChange,g=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,g,a.value,a.disabled)}),p=f==null?void 0:f.textContent,x=y.useMemo(()=>c.jsx("option",{value:a.value,disabled:a.disabled,children:p},a.value),[a.disabled,a.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:S}=u;return We(()=>(m(x),()=>S(x)),[m,S,x]),c.jsxs(c.Fragment,{children:[c.jsx(le.span,{id:a.textId,...o,ref:h}),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ki.createPortal(o.children,l.valueNode):null]})});ix.displayName=Yi;var ox="SelectItemIndicator",lx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return nx(ox,n).isSelected?c.jsx(le.span,{"aria-hidden":!0,...r,ref:t}):null});lx.displayName=ox;var Ju="SelectScrollUpButton",sx=y.forwardRef((e,t)=>{const n=er(Ju,e.__scopeSelect),r=zd(Ju,e.__scopeSelect),[i,o]=y.useState(!1),l=fe(t,r.onScrollButtonChange);return We(()=>{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(ux,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop-a.offsetHeight)}}):null});sx.displayName=Ju;var Zu="SelectScrollDownButton",ax=y.forwardRef((e,t)=>{const n=er(Zu,e.__scopeSelect),r=zd(Zu,e.__scopeSelect),[i,o]=y.useState(!1),l=fe(t,r.onScrollButtonChange);return We(()=>{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(ux,{...e,ref:l,onAutoScroll:()=>{const{viewport:s,selectedItem:a}=n;s&&a&&(s.scrollTop=s.scrollTop+a.offsetHeight)}}):null});ax.displayName=Zu;var ux=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=er("SelectScrollButton",n),l=y.useRef(null),s=Bs(n),a=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>a(),[a]),We(()=>{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(le.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ae(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ae(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ae(i.onPointerLeave,()=>{a()})})}),V2="SelectSeparator",cx=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(le.div,{"aria-hidden":!0,...r,ref:t})});cx.displayName=V2;var ec="SelectArrow",H2=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=$s(n),o=Zn(ec,n),l=er(ec,n);return o.open&&l.position==="popper"?c.jsx(zb,{...i,...r,ref:t}):null});H2.displayName=ec;var W2="SelectBubbleInput",dx=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),o=fe(r,i),l=Oy(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(le.select,{...n,style:{...jv,...n.style},ref:o,defaultValue:t})});dx.displayName=W2;function fx(e){return e===""||e===void 0}function px(e){const t=wr(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 hx(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=K2(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 K2(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var G2=Bv,mx=Uv,Y2=Hv,Q2=Wv,X2=Kv,gx=Gv,q2=qv,J2=Zv,yx=tx,vx=rx,Z2=ix,eP=lx,xx=sx,wx=ax,Sx=cx;const tP=G2,rh=J2,nP=Y2,kx=y.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(mx,{ref:r,className:ce("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(Q2,{asChild:!0,children:c.jsx(wd,{className:"h-4 w-4 opacity-50"})})]}));kx.displayName=mx.displayName;const Cx=y.forwardRef(({className:e,...t},n)=>c.jsx(xx,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(SC,{className:"h-4 w-4"})}));Cx.displayName=xx.displayName;const Ex=y.forwardRef(({className:e,...t},n)=>c.jsx(wx,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(wd,{className:"h-4 w-4"})}));Ex.displayName=wx.displayName;const Nx=y.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>c.jsx(X2,{children:c.jsxs(gx,{ref:i,className:ce("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(Cx,{}),c.jsx(q2,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(Ex,{})]})}));Nx.displayName=gx.displayName;const tc=y.forwardRef(({className:e,...t},n)=>c.jsx(yx,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));tc.displayName=yx.displayName;const nc=y.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(vx,{ref:r,className:ce("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(eP,{children:c.jsx(vC,{className:"h-4 w-4"})})}),c.jsx(Z2,{children:t})]}));nc.displayName=vx.displayName;const rP=y.forwardRef(({className:e,...t},n)=>c.jsx(Sx,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",e),...t}));rP.displayName=Sx.displayName;function iP(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Fo=e=>{const{present:t,children:n}=e,r=oP(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=fe(r.ref,lP(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:o}):null};Fo.displayName="Presence";function oP(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[s,a]=iP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=dl(r.current);o.current=s==="mounted"?u:"none"},[s]),We(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,p=dl(u);e?a("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),We(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=p=>{const m=dl(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(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)})}},h=p=>{p.target===t&&(o.current=dl(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),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 dl(e){return(e==null?void 0:e.animationName)||"none"}function lP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Us="Collapsible",[sP,FT]=_r(Us),[aP,Fd]=sP(Us),bx=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=e,[a,u]=Po({prop:r,defaultProp:i??!1,onChange:l,caller:Us});return c.jsx(aP,{scope:n,disabled:o,contentId:hr(),open:a,onOpenToggle:y.useCallback(()=>u(f=>!f),[u]),children:c.jsx(le.div,{"data-state":$d(a),"data-disabled":o?"":void 0,...s,ref:t})})});bx.displayName=Us;var Px="CollapsibleTrigger",jx=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Fd(Px,n);return c.jsx(le.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":$d(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ae(e.onClick,i.onOpenToggle)})});jx.displayName=Px;var Bd="CollapsibleContent",_x=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Fd(Bd,e.__scopeCollapsible);return c.jsx(Fo,{present:n||i.open,children:({present:o})=>c.jsx(uP,{...r,ref:t,present:o})})});_x.displayName=Bd;var uP=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=Fd(Bd,n),[s,a]=y.useState(r),u=y.useRef(null),f=fe(t,u),d=y.useRef(0),h=d.current,p=y.useRef(0),x=p.current,m=l.open||s,S=y.useRef(m),g=y.useRef(void 0);return y.useEffect(()=>{const v=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(v)},[]),We(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();d.current=w.height,p.current=w.width,S.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),a(r)}},[l.open,r]),c.jsx(le.div,{"data-state":$d(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&i})});function $d(e){return e?"open":"closed"}var cP=bx;const dP=cP,fP=jx,pP=_x;var Vs="Dialog",[Rx,Ax]=_r(Vs),[hP,Wt]=Rx(Vs),Tx=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]=Po({prop:r,defaultProp:i??!1,onChange:o,caller:Vs});return c.jsx(hP,{scope:t,triggerRef:s,contentRef:a,contentId:hr(),titleId:hr(),descriptionId:hr(),open:u,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(d=>!d),[f]),modal:l,children:n})};Tx.displayName=Vs;var Ix="DialogTrigger",Mx=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Ix,n),o=fe(t,i.triggerRef);return c.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Hd(i.open),...r,ref:o,onClick:ae(e.onClick,i.onOpenToggle)})});Mx.displayName=Ix;var Ud="DialogPortal",[mP,Ox]=Rx(Ud,{forceMount:void 0}),Lx=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Wt(Ud,t);return c.jsx(mP,{scope:t,forceMount:n,children:y.Children.map(r,l=>c.jsx(Fo,{present:n||o.open,children:c.jsx(Dd,{asChild:!0,container:i,children:l})}))})};Lx.displayName=Ud;var fs="DialogOverlay",Dx=y.forwardRef((e,t)=>{const n=Ox(fs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(fs,e.__scopeDialog);return o.modal?c.jsx(Fo,{present:r||o.open,children:c.jsx(yP,{...i,ref:t})}):null});Dx.displayName=fs;var gP=yi("DialogOverlay.RemoveScroll"),yP=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(fs,n);return c.jsx(Fv,{as:gP,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(le.div,{"data-state":Hd(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Er="DialogContent",zx=y.forwardRef((e,t)=>{const n=Ox(Er,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Er,e.__scopeDialog);return c.jsx(Fo,{present:r||o.open,children:o.modal?c.jsx(vP,{...i,ref:t}):c.jsx(xP,{...i,ref:t})})});zx.displayName=Er;var vP=y.forwardRef((e,t)=>{const n=Wt(Er,e.__scopeDialog),r=y.useRef(null),i=fe(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return Rv(o)},[]),c.jsx(Fx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,s=l.button===0&&l.ctrlKey===!0;(l.button===2||s)&&o.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,o=>o.preventDefault())})}),xP=y.forwardRef((e,t)=>{const n=Wt(Er,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return c.jsx(Fx,{...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()}})}),Fx=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,s=Wt(Er,n),a=y.useRef(null),u=fe(t,a);return iv(),c.jsxs(c.Fragment,{children:[c.jsx(jd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(Pd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Hd(s.open),...l,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(SP,{titleId:s.titleId}),c.jsx(CP,{contentRef:a,descriptionId:s.descriptionId})]})]})}),Vd="DialogTitle",Bx=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Vd,n);return c.jsx(le.h2,{id:i.titleId,...r,ref:t})});Bx.displayName=Vd;var $x="DialogDescription",Ux=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt($x,n);return c.jsx(le.p,{id:i.descriptionId,...r,ref:t})});Ux.displayName=$x;var Vx="DialogClose",Hx=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Vx,n);return c.jsx(le.button,{type:"button",...r,ref:t,onClick:ae(e.onClick,()=>i.onOpenChange(!1))})});Hx.displayName=Vx;function Hd(e){return e?"open":"closed"}var Wx="DialogTitleWarning",[wP,Kx]=NE(Wx,{contentName:Er,titleName:Vd,docsSlug:"dialog"}),SP=({titleId:e})=>{const t=Kx(Wx),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},kP="DialogDescriptionWarning",CP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Kx(kP).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},EP=Tx,NP=Mx,bP=Lx,PP=Dx,jP=zx,_P=Bx,RP=Ux,Gx=Hx,Yx="AlertDialog",[AP,BT]=_r(Yx,[Ax]),Sn=Ax(),Qx=e=>{const{__scopeAlertDialog:t,...n}=e,r=Sn(t);return c.jsx(EP,{...r,...n,modal:!0})};Qx.displayName=Yx;var TP="AlertDialogTrigger",IP=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Sn(n);return c.jsx(NP,{...i,...r,ref:t})});IP.displayName=TP;var MP="AlertDialogPortal",Xx=e=>{const{__scopeAlertDialog:t,...n}=e,r=Sn(t);return c.jsx(bP,{...r,...n})};Xx.displayName=MP;var OP="AlertDialogOverlay",qx=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Sn(n);return c.jsx(PP,{...i,...r,ref:t})});qx.displayName=OP;var li="AlertDialogContent",[LP,DP]=AP(li),zP=vE("AlertDialogContent"),Jx=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Sn(n),l=y.useRef(null),s=fe(t,l),a=y.useRef(null);return c.jsx(wP,{contentName:li,titleName:Zx,docsSlug:"alert-dialog",children:c.jsx(LP,{scope:n,cancelRef:a,children:c.jsxs(jP,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:ae(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(zP,{children:r}),c.jsx(BP,{contentRef:l})]})})})});Jx.displayName=li;var Zx="AlertDialogTitle",e0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Sn(n);return c.jsx(_P,{...i,...r,ref:t})});e0.displayName=Zx;var t0="AlertDialogDescription",n0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Sn(n);return c.jsx(RP,{...i,...r,ref:t})});n0.displayName=t0;var FP="AlertDialogAction",r0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Sn(n);return c.jsx(Gx,{...i,...r,ref:t})});r0.displayName=FP;var i0="AlertDialogCancel",o0=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=DP(i0,n),o=Sn(n),l=fe(t,i);return c.jsx(Gx,{...o,...r,ref:l})});o0.displayName=i0;var BP=({contentRef:e})=>{const t=`\`${li}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${li}\` by passing a \`${t0}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${li}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},$P=Qx,UP=Xx,l0=qx,s0=Jx,a0=r0,u0=o0,c0=e0,d0=n0;const ih=$P,VP=UP,f0=y.forwardRef(({className:e,...t},n)=>c.jsx(l0,{className:ce("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}));f0.displayName=l0.displayName;const rc=y.forwardRef(({className:e,...t},n)=>c.jsxs(VP,{children:[c.jsx(f0,{}),c.jsx(s0,{ref:n,className:ce("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})]}));rc.displayName=s0.displayName;const ic=({className:e,...t})=>c.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});ic.displayName="AlertDialogHeader";const oc=({className:e,...t})=>c.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});oc.displayName="AlertDialogFooter";const lc=y.forwardRef(({className:e,...t},n)=>c.jsx(c0,{ref:n,className:ce("text-lg font-semibold",e),...t}));lc.displayName=c0.displayName;const sc=y.forwardRef(({className:e,...t},n)=>c.jsx(d0,{ref:n,className:ce("text-sm text-muted-foreground",e),...t}));sc.displayName=d0.displayName;const ac=y.forwardRef(({className:e,...t},n)=>c.jsx(a0,{ref:n,className:ce(Ed(),e),...t}));ac.displayName=a0.displayName;const uc=y.forwardRef(({className:e,...t},n)=>c.jsx(u0,{ref:n,className:ce(Ed({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));uc.displayName=u0.displayName;function HP(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const WP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GP={};function oh(e,t){return((t||GP).jsx?KP:WP).test(e)}const YP=/[ \t\n\f\r]/g;function QP(e){return typeof e=="object"?e.type==="text"?lh(e.value):!1:lh(e)}function lh(e){return e.replace(YP,"")===""}class Bo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Bo.prototype.normal={};Bo.prototype.property={};Bo.prototype.space=void 0;function p0(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Bo(n,r,t)}function cc(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="";ut.prototype.booleanish=!1;ut.prototype.boolean=!1;ut.prototype.commaOrSpaceSeparated=!1;ut.prototype.commaSeparated=!1;ut.prototype.defined=!1;ut.prototype.mustUseProperty=!1;ut.prototype.number=!1;ut.prototype.overloadedBoolean=!1;ut.prototype.property="";ut.prototype.spaceSeparated=!1;ut.prototype.space=void 0;let XP=0;const Z=Rr(),Ie=Rr(),dc=Rr(),F=Rr(),ve=Rr(),si=Rr(),ft=Rr();function Rr(){return 2**++XP}const fc=Object.freeze(Object.defineProperty({__proto__:null,boolean:Z,booleanish:Ie,commaOrSpaceSeparated:ft,commaSeparated:si,number:F,overloadedBoolean:dc,spaceSeparated:ve},Symbol.toStringTag,{value:"Module"})),Aa=Object.keys(fc);class Wd extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),sh(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&tj.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ah,ij);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ah.test(o)){let l=o.replace(ej,rj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Wd}return new i(r,t)}function rj(e){return"-"+e.toLowerCase()}function ij(e){return e.charAt(1).toUpperCase()}const oj=p0([h0,qP,y0,v0,x0],"html"),Kd=p0([h0,JP,y0,v0,x0],"svg");function lj(e){return e.join(" ").trim()}var Gd={},uh=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,sj=/\n/g,aj=/^\s*/,uj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,cj=/^:\s*/,dj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fj=/^[;\s]*/,pj=/^\s+|\s+$/g,hj=` +`,ch="/",dh="*",lr="",mj="comment",gj="declaration",yj=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(x){var m=x.match(sj);m&&(n+=m.length);var S=x.lastIndexOf(hj);r=~S?x.length-S:r+x.length}function o(){var x={line:n,column:r};return function(m){return m.position=new l(x),u(),m}}function l(x){this.start=x,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(x){var m=new Error(t.source+":"+n+":"+r+": "+x);if(m.reason=x,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function a(x){var m=x.exec(e);if(m){var S=m[0];return i(S),e=e.slice(S.length),m}}function u(){a(aj)}function f(x){var m;for(x=x||[];m=d();)m!==!1&&x.push(m);return x}function d(){var x=o();if(!(ch!=e.charAt(0)||dh!=e.charAt(1))){for(var m=2;lr!=e.charAt(m)&&(dh!=e.charAt(m)||ch!=e.charAt(m+1));)++m;if(m+=2,lr===e.charAt(m-1))return s("End of comment missing");var S=e.slice(2,m-2);return r+=2,i(S),e=e.slice(m),r+=2,x({type:mj,comment:S})}}function h(){var x=o(),m=a(uj);if(m){if(d(),!a(cj))return s("property missing ':'");var S=a(dj),g=x({type:gj,property:fh(m[0].replace(uh,lr)),value:S?fh(S[0].replace(uh,lr)):lr});return a(fj),g}}function p(){var x=[];f(x);for(var m;m=h();)m!==!1&&(x.push(m),f(x));return x}return u(),p()};function fh(e){return e?e.replace(pj,lr):lr}var vj=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=wj;var xj=vj(yj);function wj(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,xj.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var l=o.property,s=o.value;i?t(l,s,o):s&&(n=n||{},n[l]=s)}}),n}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.camelCase=void 0;var Sj=/^--[a-zA-Z0-9_-]+$/,kj=/-([a-z])/g,Cj=/^[^-]+$/,Ej=/^-(webkit|moz|ms|o|khtml)-/,Nj=/^-(ms)-/,bj=function(e){return!e||Cj.test(e)||Sj.test(e)},Pj=function(e,t){return t.toUpperCase()},ph=function(e,t){return"".concat(t,"-")},jj=function(e,t){return t===void 0&&(t={}),bj(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Nj,ph):e=e.replace(Ej,ph),e.replace(kj,Pj))};Hs.camelCase=jj;var _j=Tl&&Tl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Rj=_j(Gd),Aj=Hs;function pc(e,t){var n={};return!e||typeof e!="string"||(0,Rj.default)(e,function(r,i){r&&i&&(n[(0,Aj.camelCase)(r,t)]=i)}),n}pc.default=pc;var Tj=pc;const Ij=ms(Tj),w0=S0("end"),Yd=S0("start");function S0(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 Mj(e){const t=Yd(e),n=w0(e);if(t&&n)return{start:t,end:n}}function io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hh(e.position):"start"in e||"end"in e?hh(e):"line"in e||"column"in e?hc(e):""}function hc(e){return mh(e&&e.line)+":"+mh(e&&e.column)}function hh(e){return hc(e&&e.start)+"-"+hc(e&&e.end)}function mh(e){return e&&typeof e=="number"?e:1}class qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=io(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Qd={}.hasOwnProperty,Oj=new Map,Lj=/[A-Z]/g,Dj=new Set(["table","tbody","thead","tfoot","tr"]),zj=new Set(["td","th"]),k0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Fj(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=Gj(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=Kj(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"?Kd:oj,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=C0(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function C0(e,t,n){if(t.type==="element")return Bj(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $j(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Vj(e,t,n);if(t.type==="mdxjsEsm")return Uj(e,t);if(t.type==="root")return Hj(e,t,n);if(t.type==="text")return Wj(e,t)}function Bj(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Kd,e.schema=i),e.ancestors.push(t);const o=N0(e,t.tagName,!1),l=Yj(e,t);let s=qd(e,t);return Dj.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!QP(a):!0})),E0(e,l,o,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function $j(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Ro(e,t.position)}function Uj(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ro(e,t.position)}function Vj(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Kd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:N0(e,t.name,!0),l=Qj(e,t),s=qd(e,t);return E0(e,l,o,t),Xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Hj(e,t,n){const r={};return Xd(r,qd(e,t)),e.create(t,e.Fragment,r,n)}function Wj(e,t){return t.value}function E0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Kj(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 Gj(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=Yd(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 Yj(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qd.call(t.properties,i)){const o=Xj(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&zj.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 Qj(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Ro(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else Ro(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function qd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Oj;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?(on(e,e.length,0,t),e):t}const vh={}.hasOwnProperty;function i_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ai(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jt=tr(/[A-Za-z]/),yt=tr(/[\dA-Za-z]/),s_=tr(/[#-'*+\--9=?A-Z^-~]/);function mc(e){return e!==null&&(e<32||e===127)}const gc=tr(/\d/),a_=tr(/[\dA-Fa-f]/),u_=tr(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const c_=tr(/\p{P}|\p{S}/u),d_=tr(/\s/);function tr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _i(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function we(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return de(a)?(e.enter(n),s(a)):t(a)}function s(a){return de(a)&&o++l))return;const P=t.events.length;let R=P,B,O;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(B){O=t.events[R][1].end;break}B=!0}for(g(r),N=P;Nw;){const b=n[C];t.containerState=b[1],b[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function g_(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 wh(e){if(e===null||at(e)||d_(e))return 1;if(c_(e))return 2}function Zd(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},h={...e[n][1].start};Sh(d,-a),Sh(h,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:h},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=bt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=bt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=bt(u,Zd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=bt(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=bt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,on(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n0&&de(N)?we(e,v,"linePrefix",o+1)(N):v(N)}function v(N){return N===null||q(N)?e.check(kh,m,C)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||q(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),w)}function C(N){return e.exit("codeFenced"),t(N)}function b(N,P,R){let B=0;return O;function O(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),I}function I(L){return N.enter("codeFencedFence"),de(L)?we(N,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):j(L)}function j(L){return L===s?(N.enter("codeFencedFenceSequence"),V(L)):R(L)}function V(L){return L===s?(B++,N.consume(L),V):B>=l?(N.exit("codeFencedFenceSequence"),de(L)?we(N,M,"whitespace")(L):M(L)):R(L)}function M(L){return L===null||q(L)?(N.exit("codeFencedFence"),P(L)):R(L)}}}function j_(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Ia={name:"codeIndented",tokenize:R_},__={partial:!0,tokenize:A_};function R_(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(__,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 A_(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 T_={name:"codeText",previous:M_,resolve:I_,tokenize:O_};function I_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ui(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ui(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ui(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function T0(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),h):g===null||g===32||g===41||mc(g)?n(g):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(g))}function h(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(s),h(g)):g===null||g===60||q(g)?n(g):(e.consume(g),g===92?x:p)}function x(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function m(g){return!f&&(g===null||g===41||at(g))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(g)):f999||p===null||p===91||p===93&&!a||p===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):q(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||q(p)||s++>999?(e.exit("chunkString"),f(p)):(e.consume(p),a||(a=!de(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function M0(e,t,n,r,i,o){let l;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),l=h===40?41:h,a):n(h)}function a(h){return h===l?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===l?(e.exit(o),a(l)):h===null?n(h):q(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),we(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===l||h===null||q(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:f)}function d(h){return h===l||h===92?(e.consume(h),f):f(h)}}function oo(e,t){let n;return r;function r(i){return q(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):de(i)?we(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const V_={name:"definition",tokenize:W_},H_={partial:!0,tokenize:K_};function W_(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return I0.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return at(p)?oo(e,u)(p):u(p)}function u(p){return T0(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(H_,d,d)(p)}function d(p){return de(p)?we(e,h,"whitespace")(p):h(p)}function h(p){return p===null||q(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function K_(e,t,n){return r;function r(s){return at(s)?oo(e,i)(s):n(s)}function i(s){return M0(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return de(s)?we(e,l,"whitespace")(s):l(s)}function l(s){return s===null||q(s)?t(s):n(s)}}const G_={name:"hardBreakEscape",tokenize:Y_};function Y_(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 Q_={name:"headingAtx",resolve:X_,tokenize:q_};function X_(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"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function q_(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||at(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)):de(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||at(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const J_=["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"],Eh=["pre","script","style","textarea"],Z_={concrete:!0,name:"htmlFlow",resolveTo:nR,tokenize:rR},eR={partial:!0,tokenize:oR},tR={partial:!0,tokenize:iR};function nR(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 rR(e,t,n){const r=this;let i,o,l,s,a;return u;function u(E){return f(E)}function f(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),h):E===47?(e.consume(E),o=!0,m):E===63?(e.consume(E),i=3,r.interrupt?t:k):Jt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function h(E){return E===45?(e.consume(E),i=2,p):E===91?(e.consume(E),i=5,s=0,x):Jt(E)?(e.consume(E),i=4,r.interrupt?t:k):n(E)}function p(E){return E===45?(e.consume(E),r.interrupt?t:k):n(E)}function x(E){const ee="CDATA[";return E===ee.charCodeAt(s++)?(e.consume(E),s===ee.length?r.interrupt?t:j:x):n(E)}function m(E){return Jt(E)?(e.consume(E),l=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||at(E)){const ee=E===47,Te=l.toLowerCase();return!ee&&!o&&Eh.includes(Te)?(i=1,r.interrupt?t(E):j(E)):J_.includes(l.toLowerCase())?(i=6,ee?(e.consume(E),g):r.interrupt?t(E):j(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?v(E):w(E))}return E===45||yt(E)?(e.consume(E),l+=String.fromCharCode(E),S):n(E)}function g(E){return E===62?(e.consume(E),r.interrupt?t:j):n(E)}function v(E){return de(E)?(e.consume(E),v):O(E)}function w(E){return E===47?(e.consume(E),O):E===58||E===95||Jt(E)?(e.consume(E),C):de(E)?(e.consume(E),w):O(E)}function C(E){return E===45||E===46||E===58||E===95||yt(E)?(e.consume(E),C):b(E)}function b(E){return E===61?(e.consume(E),N):de(E)?(e.consume(E),b):w(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),a=E,P):de(E)?(e.consume(E),N):R(E)}function P(E){return E===a?(e.consume(E),a=null,B):E===null||q(E)?n(E):(e.consume(E),P)}function R(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||at(E)?b(E):(e.consume(E),R)}function B(E){return E===47||E===62||de(E)?w(E):n(E)}function O(E){return E===62?(e.consume(E),I):n(E)}function I(E){return E===null||q(E)?j(E):de(E)?(e.consume(E),I):n(E)}function j(E){return E===45&&i===2?(e.consume(E),$):E===60&&i===1?(e.consume(E),H):E===62&&i===4?(e.consume(E),Y):E===63&&i===3?(e.consume(E),k):E===93&&i===5?(e.consume(E),z):q(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(eR,X,V)(E)):E===null||q(E)?(e.exit("htmlFlowData"),V(E)):(e.consume(E),j)}function V(E){return e.check(tR,M,X)(E)}function M(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),L}function L(E){return E===null||q(E)?V(E):(e.enter("htmlFlowData"),j(E))}function $(E){return E===45?(e.consume(E),k):j(E)}function H(E){return E===47?(e.consume(E),l="",_):j(E)}function _(E){if(E===62){const ee=l.toLowerCase();return Eh.includes(ee)?(e.consume(E),Y):j(E)}return Jt(E)&&l.length<8?(e.consume(E),l+=String.fromCharCode(E),_):j(E)}function z(E){return E===93?(e.consume(E),k):j(E)}function k(E){return E===62?(e.consume(E),Y):E===45&&i===2?(e.consume(E),k):j(E)}function Y(E){return E===null||q(E)?(e.exit("htmlFlowData"),X(E)):(e.consume(E),Y)}function X(E){return e.exit("htmlFlow"),t(E)}}function iR(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 oR(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ws,t,n)}}const lR={name:"htmlText",tokenize:sR};function sR(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),b):k===63?(e.consume(k),w):Jt(k)?(e.consume(k),R):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,x):Jt(k)?(e.consume(k),v):n(k)}function f(k){return k===45?(e.consume(k),p):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):q(k)?(l=d,H(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),p):d(k)}function p(k){return k===62?$(k):k===45?h(k):d(k)}function x(k){const Y="CDATA[";return k===Y.charCodeAt(o++)?(e.consume(k),o===Y.length?m:x):n(k)}function m(k){return k===null?n(k):k===93?(e.consume(k),S):q(k)?(l=m,H(k)):(e.consume(k),m)}function S(k){return k===93?(e.consume(k),g):m(k)}function g(k){return k===62?$(k):k===93?(e.consume(k),g):m(k)}function v(k){return k===null||k===62?$(k):q(k)?(l=v,H(k)):(e.consume(k),v)}function w(k){return k===null?n(k):k===63?(e.consume(k),C):q(k)?(l=w,H(k)):(e.consume(k),w)}function C(k){return k===62?$(k):w(k)}function b(k){return Jt(k)?(e.consume(k),N):n(k)}function N(k){return k===45||yt(k)?(e.consume(k),N):P(k)}function P(k){return q(k)?(l=P,H(k)):de(k)?(e.consume(k),P):$(k)}function R(k){return k===45||yt(k)?(e.consume(k),R):k===47||k===62||at(k)?B(k):n(k)}function B(k){return k===47?(e.consume(k),$):k===58||k===95||Jt(k)?(e.consume(k),O):q(k)?(l=B,H(k)):de(k)?(e.consume(k),B):$(k)}function O(k){return k===45||k===46||k===58||k===95||yt(k)?(e.consume(k),O):I(k)}function I(k){return k===61?(e.consume(k),j):q(k)?(l=I,H(k)):de(k)?(e.consume(k),I):B(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,V):q(k)?(l=j,H(k)):de(k)?(e.consume(k),j):(e.consume(k),M)}function V(k){return k===i?(e.consume(k),i=void 0,L):k===null?n(k):q(k)?(l=V,H(k)):(e.consume(k),V)}function M(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||at(k)?B(k):(e.consume(k),M)}function L(k){return k===47||k===62||at(k)?B(k):n(k)}function $(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function H(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),_}function _(k){return de(k)?we(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return e.enter("htmlTextData"),l(k)}}const ef={name:"labelEnd",resolveAll:dR,resolveTo:fR,tokenize:pR},aR={tokenize:hR},uR={tokenize:mR},cR={tokenize:gR};function dR(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"),de(u)?we(e,s,"whitespace")(u):s(u))}}const nt={continuation:{tokenize:bR},exit:jR,name:"list",tokenize:NR},CR={partial:!0,tokenize:_R},ER={partial:!0,tokenize:PR};function NR(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:gc(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Rl,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return gc(p)&&++l<10?(e.consume(p),a):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ws,r.interrupt?n:f,e.attempt(CR,h,d))}function f(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function d(p){return de(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function bR(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ws,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,we(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!de(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(ER,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,we(e,e.attempt(nt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function PR(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 jR(e){e.exit(this.containerState.type)}function _R(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!de(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Nh={name:"setextUnderline",resolveTo:RR,tokenize:AR};function RR(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 AR(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"),de(u)?we(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||q(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const TR={tokenize:IR};function IR(e){const t=this,n=e.attempt(Ws,r,e.attempt(this.parser.constructs.flowInitial,i,we(e,e.attempt(this.parser.constructs.flow,i,e.attempt(z_,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 MR={resolveAll:L0()},OR=O0("string"),LR=O0("text");function O0(e){return{resolveAll:L0(e==="text"?DR: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 h=-1;if(d)for(;++h-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function XR(e,t){let n=-1;const r=[];let i;for(;++n0){const Tt=J.tokenStack[J.tokenStack.length-1];(Tt[1]||Ph).call(J,void 0,Tt[0])}for(U.position={start:bn(A.length>0?A[0][1].start:{line:1,column:1,offset:0}),end:bn(A.length>0?A[A.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function pA(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 hA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function F0(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 mA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return F0(e,t);const i={src:_i(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function gA(e,t){const n={src:_i(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yA(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 vA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return F0(e,t);const i={href:_i(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function xA(e,t){const n={href:_i(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wA(e,t,n){const r=e.all(t),i=n?SA(n):B0(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 kA(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=Yd(t.children[1]),a=w0(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 PA(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(Rh(t.slice(i),i>0,!1)),o.join("")}function Rh(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===jh||o===_h;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===jh||o===_h;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function RA(e,t){const n={type:"text",value:_A(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function AA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const TA={blockquote:sA,break:aA,code:uA,delete:cA,emphasis:dA,footnoteReference:fA,heading:pA,html:hA,imageReference:mA,image:gA,inlineCode:yA,linkReference:vA,link:xA,listItem:wA,list:kA,paragraph:CA,root:EA,strong:NA,table:bA,tableCell:jA,tableRow:PA,text:RA,thematicBreak:AA,toml:fl,yaml:fl,definition:fl,footnoteDefinition:fl};function fl(){}const $0=-1,Ks=0,lo=1,ps=2,tf=3,nf=4,rf=5,of=6,U0=7,V0=8,Ah=typeof self=="object"?self:globalThis,IA=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Ks:case $0:return n(l,i);case lo:{const s=n([],i);for(const a of l)s.push(r(a));return s}case ps:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case tf:return n(new Date(l),i);case nf:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case rf:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case of:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case U0:{const{name:s,message:a}=l;return n(new Ah[s](a),i)}case V0: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 Ah[o](l),i)};return r},Th=e=>IA(new Map,e)(0),Lr="",{toString:MA}={},{keys:OA}=Object,Vi=e=>{const t=typeof e;if(t!=="object"||!e)return[Ks,t];const n=MA.call(e).slice(8,-1);switch(n){case"Array":return[lo,Lr];case"Object":return[ps,Lr];case"Date":return[tf,Lr];case"RegExp":return[nf,Lr];case"Map":return[rf,Lr];case"Set":return[of,Lr];case"DataView":return[lo,n]}return n.includes("Array")?[lo,n]:n.includes("Error")?[U0,n]:[ps,n]},pl=([e,t])=>e===Ks&&(t==="function"||t==="symbol"),LA=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=Vi(l);switch(s){case Ks:{let f=l;switch(a){case"bigint":s=V0,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([$0],l)}return i([s,f],l)}case lo:{if(a){let h=l;return a==="DataView"?h=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(h=new Uint8Array(l)),i([a,[...h]],l)}const f=[],d=i([s,f],l);for(const h of l)f.push(o(h));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 h of OA(l))(e||!pl(Vi(l[h])))&&f.push([o(h),o(l[h])]);return d}case tf:return i([s,l.toISOString()],l);case nf:{const{source:f,flags:d}=l;return i([s,{source:f,flags:d}],l)}case rf:{const f=[],d=i([s,f],l);for(const[h,p]of l)(e||!(pl(Vi(h))||pl(Vi(p))))&&f.push([o(h),o(p)]);return d}case of:{const f=[],d=i([s,f],l);for(const h of l)(e||!pl(Vi(h)))&&f.push(o(h));return d}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Ih=(e,{json:t,lossy:n}={})=>{const r=[];return LA(!(t||n),!!t,new Map,r)(e),r},hs=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Th(Ih(e,t)):structuredClone(e):(e,t)=>Th(Ih(e,t));function DA(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 zA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||DA,r=e.options.footnoteBackLabel||zA,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a0&&x.push({type:"text",value:" "});let v=typeof n=="string"?n:n(a,p);typeof v=="string"&&(v={type:"text",value:v}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const v=S.children[S.children.length-1];v&&v.type==="text"?v.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...x)}else f.push(...x);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...hs(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:` +`}]}}const H0=function(e){if(e==null)return VA;if(typeof e=="function")return Gs(e);if(typeof e=="object")return Array.isArray(e)?BA(e):$A(e);if(typeof e=="string")return UA(e);throw new Error("Expected function, string, or object as test")};function BA(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=W0,x,m,S;if((!t||o(a,u,f[f.length-1]||void 0))&&(p=YA(n(a,f)),p[0]===Mh))return p;if("children"in a&&a.children){const g=a;if(g.children&&p[0]!==KA)for(m=(r?g.children.length:-1)+l,S=f.concat(g);m>-1&&m0&&n.push({type:"text",value:` +`}),n}function Oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lh(e,t){const n=XA(e,t),r=n.one(e,void 0),i=FA(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function tT(e,t){return e&&"run"in e?async function(n,r){const i=Lh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Lh(n,{file:r,...e||t})}}function Dh(e){if(e)throw e}var Al=Object.prototype.hasOwnProperty,G0=Object.prototype.toString,zh=Object.defineProperty,Fh=Object.getOwnPropertyDescriptor,Bh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):G0.call(t)==="[object Array]"},$h=function(t){if(!t||G0.call(t)!=="[object Object]")return!1;var n=Al.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Al.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Al.call(t,i)},Uh=function(t,n){zh&&n.name==="__proto__"?zh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Vh=function(t,n){if(n==="__proto__")if(Al.call(t,n)){if(Fh)return Fh(t,n).value}else return;return t[n]},nT=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 Qt={basename:oT,dirname:lT,extname:sT,join:aT,sep:"/"};function oT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');$o(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function lT(e){if($o(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sT(e){$o(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function aT(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cT(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function $o(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dT={cwd:fT};function fT(){return"/"}function wc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pT(e){if(typeof e=="string")e=new URL(e);else if(!wc(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 hT(e)}function hT(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...x]=f;const m=r[h][1];xc(m)&&xc(p)&&(p=Oa(!0,m,p)),r[h]=[u,p,...x]}}}}const vT=new lf().freeze();function Fa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ba(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $a(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wh(e){if(!xc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Kh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function hl(e){return xT(e)?e:new Y0(e)}function xT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wT(e){return typeof e=="string"||ST(e)}function ST(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kT="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Gh=[],Yh={allowDangerousHtml:!0},CT=/^(https?|ircs?|mailto|xmpp)$/i,ET=[{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 NT(e){const t=bT(e),n=PT(e);return jT(t.runSync(t.parse(n),n),e)}function bT(e){const t=e.rehypePlugins||Gh,n=e.remarkPlugins||Gh,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Yh}:Yh;return vT().use(lA).use(n).use(tT,r).use(t)}function PT(e){const t=e.children||"",n=new Y0;return typeof t=="string"&&(n.value=t),n}function jT(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||_T;for(const f of ET)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+kT+f.id,void 0);return K0(e,u),Fj(e,{Fragment:c.Fragment,components:i,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(f,d,h){if(f.type==="raw"&&h&&typeof d=="number")return l?h.children.splice(d,1):h.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let p;for(p in Ta)if(Object.hasOwn(Ta,p)&&Object.hasOwn(f.properties,p)){const x=f.properties[p],m=Ta[p];(m===null||m.includes(f.tagName))&&(f.properties[p]=a(String(x||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(f,d,h)),p&&h&&typeof d=="number")return s&&f.children?h.children.splice(d,1,...f.children):h.children.splice(d,1),d}}}function _T(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||CT.test(e.slice(0,t))?e:""}const Q0=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:ce("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,h)=>c.jsxs("div",{className:ce("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(xd,{className:"h-4 w-4 text-primary-foreground"})}),c.jsxs("div",{className:ce("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",children:[d.role==="user"?"You":"Assistant"," • #",h+1]}),c.jsx("div",{className:"leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:c.jsx(NT,{components:{p:({children:p})=>c.jsx("p",{className:"mb-2 last:mb-0",children:p}),ul:({children:p})=>c.jsx("ul",{className:"mb-2 last:mb-0 list-disc pl-4",children:p}),ol:({children:p})=>c.jsx("ol",{className:"mb-2 last:mb-0 list-decimal pl-4",children:p}),li:({children:p})=>c.jsx("li",{className:"mb-1",children:p}),code:({children:p,className:x})=>!x?c.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-xs font-mono",children:p}):c.jsx("code",{className:"block bg-muted p-2 rounded text-xs font-mono overflow-x-auto whitespace-pre",children:p}),pre:({children:p})=>c.jsx("div",{className:"mb-2 last:mb-0",children:p}),strong:({children:p})=>c.jsx("strong",{className:"font-semibold",children:p}),em:({children:p})=>c.jsx("em",{className:"italic",children:p}),blockquote:({children:p})=>c.jsx("blockquote",{className:"border-l-4 border-muted pl-4 italic mb-2 last:mb-0",children:p}),h1:({children:p})=>c.jsx("h1",{className:"text-lg font-bold mb-2 last:mb-0",children:p}),h2:({children:p})=>c.jsx("h2",{className:"text-base font-bold mb-2 last:mb-0",children:p}),h3:({children:p})=>c.jsx("h3",{className:"text-sm font-bold mb-2 last:mb-0",children:p})},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(uE,{className:"h-4 w-4"})})]},`${d.id}-${h}`)),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(bd,{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(ge,{type:"button",onClick:l,variant:"outline",size:"icon",children:c.jsx(nE,{className:"h-4 w-4"})}):c.jsx(ge,{type:"submit",disabled:!n.trim(),size:"icon",children:c.jsx(YC,{className:"h-4 w-4"})})]})})]})});Q0.displayName="Chat";const Gt={sessions:"edge-llm-sessions",currentSession:"edge-llm-current-session"};function X0(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function RT(){return X0()}class AT{getAllSessions(){const t=localStorage.getItem(Gt.sessions);return t?JSON.parse(t):[]}getSession(t){return this.getAllSessions().find(r=>r.id===t)||null}createSession(t,n,r){const i={id:X0(),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(Gt.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(Gt.sessions,JSON.stringify(r)))}deleteSession(t){const r=this.getAllSessions().filter(i=>i.id!==t);localStorage.setItem(Gt.sessions,JSON.stringify(r)),this.getCurrentSessionId()===t&&localStorage.removeItem(Gt.currentSession)}addMessageToSession(t,n){const r=this.getAllSessions(),i=r.findIndex(o=>o.id===t);if(i!==-1){const o={...n,id:RT(),timestamp:Date.now()};r[i].messages.push(o),r[i].updatedAt=Date.now(),localStorage.setItem(Gt.sessions,JSON.stringify(r))}}getCurrentSessionId(){return localStorage.getItem(Gt.currentSession)}getCurrentSession(){const t=this.getCurrentSessionId();return t?this.getSession(t):null}setCurrentSession(t){localStorage.setItem(Gt.currentSession,t)}clear(){localStorage.removeItem(Gt.sessions),localStorage.removeItem(Gt.currentSession)}}const Ce=new AT;function TT(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}),[h,p]=y.useState(n),[x,m]=y.useState(r),[S,g]=y.useState(.7),[v,w]=y.useState(1024),C=Dt.useMemo(()=>{var L;const M=i.find($=>$.id===l)||null;return console.log("useChat - currentSession updated:",{sessionId:l,found:!!M,messageCount:((L=M==null?void 0:M.messages)==null?void 0:L.length)||0}),M},[i,l]),b=Dt.useMemo(()=>{const M=(C==null?void 0:C.messages)||[];return console.log("useChat - messages computed:",M.length,M.map(L=>({id:L.id,role:L.role}))),M},[C==null?void 0:C.messages]);y.useEffect(()=>{const M=Ce.getAllSessions();o(M);const L=Ce.getCurrentSession();L?s(L.id):M.length>0&&(s(M[0].id),Ce.setCurrentSession(M[0].id))},[]);const N=y.useCallback(()=>{const M=Ce.createSession(void 0,h,x),L=Ce.getAllSessions();return o([...L]),s(M.id),Ce.setCurrentSession(M.id),M.id},[h,x]),P=y.useCallback(M=>{s(M),Ce.setCurrentSession(M)},[]),R=y.useCallback(M=>{Ce.deleteSession(M);const L=Ce.getAllSessions();o([...L]),l===M&&(L.length>0?(s(L[0].id),Ce.setCurrentSession(L[0].id)):s(null))},[l]),B=y.useCallback((M,L)=>{Ce.updateSession(M,{title:L});const $=Ce.getAllSessions();o([...$])},[]),O=y.useCallback(M=>{if(!l)return;Ce.addMessageToSession(l,M);const L=Ce.getAllSessions();o([...L])},[l]),I=y.useCallback(async()=>{var _,z;if(!a.trim()||f.isLoading)return;let M=l;M||(M=N());const L=a.trim();if(u(""),d({isLoading:!0,error:null}),M){Ce.addMessageToSession(M,{role:"user",content:L});const k=Ce.getAllSessions();o([...k])}const $=Ce.getSession(M),H=($==null?void 0:$.messages)&&$.messages.length>1;if(x&&!H&&M){Ce.addMessageToSession(M,{role:"system",content:x});const k=Ce.getAllSessions();o([...k])}try{const k=Ce.getSession(M),Y=((z=(_=k==null?void 0:k.messages)==null?void 0:_.filter(ee=>ee.role!=="system"))==null?void 0:z.map(ee=>({role:ee.role,content:ee.content})))||[],X=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:L,messages:Y,system_prompt:x||null,model_name:h,temperature:S,max_new_tokens:v})});if(!X.ok){const ee=await X.json();throw new Error(ee.detail||`HTTP error! status: ${X.status}`)}const E=await X.json();if(M){Ce.addMessageToSession(M,{role:"assistant",content:E.content,thinking_content:E.thinking_content,model_used:E.model_used,supports_thinking:E.supports_thinking});const ee=Ce.getAllSessions();o([...ee])}d({isLoading:!1,error:null})}catch(k){const Y=k instanceof Error?k.message:"An error occurred";if(d({isLoading:!1,error:Y}),M){Ce.addMessageToSession(M,{role:"assistant",content:`Sorry, I encountered an error: ${Y}`});const X=Ce.getAllSessions();o([...X])}}},[a,f.isLoading,l,N,O,x,b.length,t,h,S,v]),j=y.useCallback(()=>{d({isLoading:!1,error:null})},[]),V=y.useCallback(()=>{Ce.clear(),o([]),s(null)},[]);return{sessions:i,currentSession:C,currentSessionId:l,createNewSession:N,selectSession:P,deleteSession:R,renameSession:B,clearAllSessions:V,messages:b,input:a,setInput:u,sendMessage:I,stopGeneration:j,isLoading:f.isLoading,error:f.error,selectedModel:h,setSelectedModel:p,systemPrompt:x,setSystemPrompt:m,temperature:S,setTemperature:g,maxTokens:v,setMaxTokens:w}}function IT(){const{sessions:e,currentSession:t,currentSessionId:n,createNewSession:r,selectSession:i,deleteSession:o,messages:l,input:s,setInput:a,sendMessage:u,stopGeneration:f,isLoading:d,selectedModel:h,setSelectedModel:p,systemPrompt:x,setSystemPrompt:m,temperature:S,setTemperature:g,maxTokens:v,setMaxTokens:w}=TT(),[C,b]=y.useState(!1),[N,P]=y.useState(!1),[R,B]=y.useState(null),[O,I]=y.useState(!1),[j,V]=y.useState(null),[M,L]=y.useState(!1),[$,H]=y.useState(""),[_,z]=y.useState(""),[k,Y]=y.useState([]),X=()=>{if(!$.trim())return;const T={id:Date.now().toString(),name:$,description:_,model:h,systemPrompt:x,temperature:S,maxTokens:v,createdAt:new Date().toISOString()},W=JSON.parse(localStorage.getItem("savedAssistants")||"[]");W.push(T),localStorage.setItem("savedAssistants",JSON.stringify(W)),H(""),z(""),L(!1),alert("助手保存成功!可在模型目录中查看。")},E=[{name:"Default Assistant",prompt:"You are a helpful, harmless, and honest AI assistant. Provide clear, accurate, and well-structured responses."},{name:"Code Expert",prompt:"You are an expert software developer. Provide clean, efficient code with clear explanations. Always follow best practices and include comments where helpful."},{name:"Technical Writer",prompt:"You are a technical writer. Create clear, comprehensive documentation and explanations. Use proper formatting and structure your responses logically."},{name:"Creative Writer",prompt:"You are a creative writer. Use vivid language, engaging storytelling, and imaginative descriptions. Be expressive and artistic in your responses."},{name:"Research Assistant",prompt:"You are a research assistant. Provide detailed, well-researched responses with clear reasoning. Cite sources when relevant and present information objectively."},{name:"Teacher",prompt:"You are an experienced teacher. Explain concepts clearly, use examples, and break down complex topics into understandable parts. Be encouraging and patient."}],ee=[{title:"Marketing Slogan",description:"Create a catchy marketing slogan for a new eco-friendly product.",prompt:"Create a catchy marketing slogan for a new eco-friendly water bottle that keeps drinks cold for 24 hours. The target audience is environmentally conscious millennials and Gen Z consumers."},{title:"Creative Storytelling",description:"Write a short story about a time traveler.",prompt:"Write a 300-word short story about a time traveler who accidentally changes a major historical event while trying to observe ancient Rome."},{title:"Technical Explanation",description:"Explain a complex technical concept simply.",prompt:"Explain how blockchain technology works in simple terms that a 12-year-old could understand, using analogies and examples."},{title:"Code Generation",description:"Generate code with explanations.",prompt:"Write a Python function that takes a list of numbers and returns the second largest number. Include error handling and detailed comments explaining each step."}];y.useEffect(()=>{te(),Te()},[]);const Te=()=>{try{const T=localStorage.getItem("loadAssistantConfig");if(T){const W=JSON.parse(T);p(W.model),m(W.systemPrompt||""),g(W.temperature||.7),w(W.maxTokens||1024),localStorage.removeItem("loadAssistantConfig"),setTimeout(()=>{alert(`Assistant "${W.name}" loaded successfully!`)},500)}}catch(T){console.error("Failed to load assistant configuration:",T)}};y.useEffect(()=>{if(h&&!k.find(T=>T.model_name===h)){const T=k[0];T&&p(T.model_name)}},[k,h,p]),y.useEffect(()=>{(async()=>{if(!h||!k.length)return;const W=k.find(ye=>ye.model_name===h);if(!W)return;const Q=`${window.location.protocol}//${window.location.host}`;if(W.type==="local"&&!W.is_loaded){V(W),I(!0);return}const he=k.filter(ye=>ye.type==="local"&&ye.is_loaded&&ye.model_name!==h);for(const ye of he)try{(await fetch(`${Q}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:ye.model_name})})).ok&&console.log(`✅ Auto-unloaded local model: ${ye.model_name}`)}catch(ct){console.error(`Error auto-unloading model ${ye.model_name}:`,ct)}he.length>0&&te()})()},[h,k]);const ie=async()=>{if(j){I(!1),B(j.model_name);try{const T=`${window.location.protocol}//${window.location.host}`;if((await fetch(`${T}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:j.model_name})})).ok)console.log(`✅ User confirmed and loaded: ${j.model_name}`),te();else{console.error(`❌ Failed to load model: ${j.model_name}`);const Q=k.find(he=>he.type==="api");Q&&p(Q.model_name)}}catch(T){console.error("Error loading model:",T);const W=k.find(Q=>Q.type==="api");W&&p(W.model_name)}finally{B(null),V(null)}}},G=()=>{I(!1),V(null);const T=k.find(W=>W.type==="api");T&&p(T.model_name)};y.useEffect(()=>{const T=async()=>{const W=`${window.location.protocol}//${window.location.host}`,Q=k.filter(he=>he.type==="local"&&he.is_loaded);for(const he of Q)try{await fetch(`${W}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:he.model_name})}),console.log(`✅ Cleanup: unloaded ${he.model_name}`)}catch(ye){console.error(`Error cleaning up model ${he.model_name}:`,ye)}};return()=>{T()}},[k]);const te=async()=>{try{const T=`${window.location.protocol}//${window.location.host}`,W=await fetch(`${T}/models`);if(W.ok){const Q=await W.json();if(Y(Q.models),Q.current_model&&h!==Q.current_model)p(Q.current_model);else if(!h&&Q.models.length>0){const ye=Q.models.find(ct=>ct.type==="api")||Q.models[0];p(ye.model_name)}}}catch(T){console.error("Failed to fetch models:",T)}},Se=T=>{a(T)};return c.jsxs("div",{className:"min-h-screen bg-background flex",children:[c.jsx("div",{className:` + ${C?"translate-x-0":"-translate-x-full"} + fixed inset-y-0 left-0 z-50 w-80 bg-background border-r transition-transform duration-300 ease-in-out + lg:translate-x-0 lg:static lg:inset-0 + `,children:c.jsxs("div",{className:"p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-semibold",children:"Chat Sessions"}),c.jsxs(ge,{onClick:r,size:"sm",children:[c.jsx(UC,{className:"h-4 w-4 mr-1"}),"New"]})]}),c.jsx("div",{className:"space-y-2",children:e.map(T=>c.jsxs(Ue,{className:`p-3 cursor-pointer transition-colors hover:bg-accent ${n===T.id?"bg-accent border-primary":""}`,onClick:()=>i(T.id),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:T.title}),c.jsx(ge,{size:"sm",variant:"ghost",onClick:W=>{W.stopPropagation(),o(T.id)},className:"h-6 w-6 p-0",children:c.jsx(kd,{className:"h-3 w-3"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground",children:[T.messages.length," messages"]})]},T.id))})]})}),C&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>b(!1)}),c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>b(!C),className:"lg:hidden",children:C?c.jsx(zC,{className:"h-4 w-4"}):c.jsx(BC,{className:"h-4 w-4"})}),c.jsx(Kn,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Chat Playground"}),t&&c.jsxs(Me,{variant:"outline",className:"text-xs",children:[t.title.slice(0,20),"..."]})]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2 overflow-x-auto",children:[c.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>b(!C),className:"hidden lg:flex flex-shrink-0",children:[c.jsx(AC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Sessions"})]}),c.jsxs(ge,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(bC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"View code"}),c.jsx("span",{className:"sm:hidden",children:"Code"})]}),c.jsxs(ge,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(sE,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Import"})]}),c.jsxs(ge,{variant:"outline",size:"sm",className:"flex-shrink-0",onClick:()=>L(!0),children:[c.jsx(KC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Save Assistant"})]}),c.jsxs(ge,{variant:"outline",size:"sm",className:"flex-shrink-0",children:[c.jsx(ZC,{className:"h-4 w-4 mr-2"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"})]})]})]})}),c.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[c.jsxs("div",{className:"flex-1 flex flex-col",children:[l.length===0&&c.jsx("div",{className:"p-6 border-b",children:c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{className:"text-base",children:"Start with a sample prompt"})}),c.jsx(Qe,{children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:ee.map((T,W)=>c.jsx(ge,{variant:"outline",className:"h-auto p-4 text-left justify-start min-w-0",onClick:()=>Se(T.prompt),disabled:d,children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"font-medium text-sm mb-1 truncate",children:T.title}),c.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:T.description})]})},W))})})]})}),c.jsx(Q0,{messages:l.map(T=>({id:T.id,role:T.role,content:T.content,createdAt:new Date(T.timestamp)})),input:s,handleInputChange:T=>a(T.target.value),handleSubmit:async T=>{T.preventDefault(),!(!h||!k.find(W=>W.model_name===h))&&await u()},isGenerating:d,stop:f,className:"flex-1"})]}),c.jsx("div",{className:"w-80 border-l bg-muted/30 overflow-y-auto",children:c.jsxs("div",{className:"p-4 space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Sd,{className:"h-4 w-4"}),c.jsx("h2",{className:"font-semibold text-sm",children:"Configuration"})]}),c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{className:"text-sm",children:"Model Selection"})}),c.jsxs(Qe,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(Ct,{className:"text-xs font-medium mb-2",children:"Active Model"}),c.jsxs(tP,{value:h||"",onValueChange:p,children:[c.jsx(kx,{className:"w-full",children:c.jsx(nP,{placeholder:"Select a model...",children:h&&(()=>{const T=k.find(Q=>Q.model_name===h);if(!T)return h;const W=T.type==="api";return c.jsxs("div",{className:"flex items-center gap-2",children:[W?c.jsx(ri,{className:"h-4 w-4 text-blue-500"}):T.supports_thinking?c.jsx(pr,{className:"h-4 w-4 text-purple-500"}):c.jsx(os,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"truncate",children:T.name}),R===h?c.jsx(Me,{variant:"outline",className:"text-xs",children:"Loading..."}):c.jsx(Me,{variant:"outline",className:"text-xs",children:W?"API":T.is_loaded?"Loaded":"Available"})]})})()})}),c.jsxs(Nx,{children:[c.jsxs(rh,{children:[c.jsx(tc,{children:"🌐 API Models"}),k.filter(T=>T.type==="api").map(T=>c.jsx(nc,{value:T.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ri,{className:"h-4 w-4 text-blue-500"}),c.jsx("span",{children:T.name}),c.jsx(Me,{variant:"outline",className:"text-xs bg-blue-50",children:"API"})]})},T.model_name))]}),c.jsxs(rh,{children:[c.jsx(tc,{children:"💻 Local Models"}),k.filter(T=>T.type==="local").map(T=>c.jsx(nc,{value:T.model_name,children:c.jsxs("div",{className:"flex items-center gap-2",children:[T.supports_thinking?c.jsx(pr,{className:"h-4 w-4 text-purple-500"}):c.jsx(os,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{children:T.name}),R===T.model_name?c.jsx(Me,{variant:"outline",className:"text-xs bg-yellow-50",children:"Loading..."}):T.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"})]})},T.model_name))]})]})]})]}),c.jsx("div",{className:"pt-2 border-t",children:c.jsx(ge,{variant:"outline",size:"sm",className:"w-full",asChild:!0,children:c.jsxs("a",{href:"/models",className:"flex items-center gap-2",children:[c.jsx(gi,{className:"h-4 w-4"}),"View Model Catalog"]})})})]})]}),c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{className:"text-sm",children:"Parameters"})}),c.jsxs(Qe,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs(Ct,{className:"text-xs font-medium",children:["Temperature: ",S.toFixed(2)]}),c.jsx(Hu,{value:[S],onValueChange:T=>g(T[0]),min:0,max:2,step:.01,className:"mt-2",disabled:d}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Lower = more focused, Higher = more creative"})]}),c.jsxs("div",{children:[c.jsxs(Ct,{className:"text-xs font-medium",children:["Max Tokens: ",v]}),c.jsx(Hu,{value:[v],onValueChange:T=>w(T[0]),min:100,max:4096,step:100,className:"mt-2",disabled:d})]})]})]}),c.jsx(Ue,{children:c.jsxs(dP,{open:N,onOpenChange:P,children:[c.jsx(gt,{children:c.jsx(fP,{asChild:!0,children:c.jsxs(ge,{variant:"ghost",className:"w-full justify-between p-0",disabled:d,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Kn,{className:"h-4 w-4"}),c.jsx("span",{className:"text-sm font-medium",children:"System Prompt"}),x&&c.jsx(Me,{variant:"secondary",className:"text-xs",children:"Custom"})]}),c.jsx(wd,{className:`h-4 w-4 transition-transform ${N?"transform rotate-180":""}`})]})})}),c.jsx(pP,{children:c.jsxs(Qe,{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx(Ct,{className:"text-xs font-medium text-muted-foreground",children:"Quick Presets"}),c.jsx("div",{className:"grid grid-cols-1 gap-1 mt-1",children:E.map(T=>c.jsx(ge,{variant:"outline",size:"sm",className:"h-auto p-2 text-xs justify-start",onClick:()=>m(T.prompt),disabled:d,children:T.name},T.name))})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx(Ct,{htmlFor:"system-prompt",className:"text-xs font-medium",children:"Custom System Prompt"}),x&&c.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>m(""),className:"h-6 px-2 text-xs",disabled:d,children:[c.jsx(HC,{className:"h-3 w-3 mr-1"}),"Clear"]})]}),c.jsx("textarea",{id:"system-prompt",value:x,onChange:T=>m(T.target.value),placeholder:"Enter custom system prompt to define how the model should behave...",className:"w-full min-h-[80px] text-xs p-2 border rounded-md bg-background",disabled:d}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"System prompts define the model's role and behavior."})]})]})})]})})]})})]})]}),c.jsx(ih,{open:O,onOpenChange:I,children:c.jsxs(rc,{children:[c.jsxs(ic,{children:[c.jsxs(lc,{className:"flex items-center gap-2",children:[c.jsx(jy,{className:"h-5 w-5 text-blue-500"}),"Load Local Model"]}),c.jsx(sc,{asChild:!0,children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["You're about to load ",c.jsx("strong",{children:j==null?void 0:j.name})," locally."]}),c.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(oE,{className:"h-4 w-4 text-yellow-600 mt-0.5"}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-yellow-800",children:"Resource Requirements:"}),c.jsxs("ul",{className:"mt-1 text-yellow-700 space-y-1",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Storage:"})," ",j==null?void 0:j.size_gb]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"RAM:"})," ~",j==null?void 0:j.size_gb," (while running)"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Download:"})," First-time loading will download the model"]})]})]})]})}),c.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:c.jsxs("div",{className:"text-sm text-blue-700",children:[c.jsx("p",{className:"font-medium text-blue-800",children:"Model Features:"}),c.jsx("p",{className:"mt-1",children:j==null?void 0:j.description}),(j==null?void 0:j.supports_thinking)&&c.jsxs("p",{className:"mt-1 flex items-center gap-1",children:[c.jsx(pr,{className:"h-3 w-3"}),"Supports thinking process"]})]})}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"The model will be cached locally for faster future access. You can unload it anytime to free up memory."})]})})]}),c.jsxs(oc,{children:[c.jsx(uc,{onClick:G,children:"Cancel"}),c.jsx(ac,{onClick:ie,children:"Load Model"})]})]})}),c.jsx(ih,{open:M,onOpenChange:L,children:c.jsxs(rc,{children:[c.jsxs(ic,{children:[c.jsxs(lc,{className:"flex items-center gap-2",children:[c.jsx(xd,{className:"h-5 w-5 text-blue-500"}),"Save Current Configuration as Assistant"]}),c.jsx(sc,{children:"Save your current model settings and system prompt as a reusable assistant."})]}),c.jsxs("div",{className:"space-y-4 py-4",children:[c.jsxs("div",{children:[c.jsx(Ct,{htmlFor:"assistant-name",children:"Assistant Name"}),c.jsx(tv,{id:"assistant-name",value:$,onChange:T=>H(T.target.value),placeholder:"e.g., Code Review Expert",className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx(Ct,{htmlFor:"assistant-description",children:"Description"}),c.jsx(bd,{id:"assistant-description",value:_,onChange:T=>z(T.target.value),placeholder:"Describe what this assistant is good at...",rows:3,className:"mt-1"})]}),c.jsxs("div",{className:"bg-muted p-3 rounded-md text-sm",children:[c.jsx("div",{className:"font-medium mb-2",children:"Current Configuration:"}),c.jsxs("div",{className:"space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:["Model: ",h]}),c.jsxs("div",{children:["Temperature: ",S]}),c.jsxs("div",{children:["Max Tokens: ",v]}),c.jsxs("div",{children:["System Prompt: ",x?x.slice(0,50)+"...":"None"]})]})]})]}),c.jsxs(oc,{children:[c.jsx(uc,{onClick:()=>L(!1),children:"Cancel"}),c.jsx(ac,{onClick:X,disabled:!$.trim(),children:"Save Assistant"})]})]})})]})}function MT(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[i,o]=y.useState(null),[l,s]=y.useState([]);y.useEffect(()=>{d(),a()},[]);const a=()=>{try{const x=JSON.parse(localStorage.getItem("savedAssistants")||"[]");s(x)}catch(x){console.error("Failed to load saved assistants:",x),s([])}},u=x=>{localStorage.setItem("loadAssistantConfig",JSON.stringify(x)),window.location.href="/playground"},f=x=>{const m=l.filter(S=>S.id!==x);s(m),localStorage.setItem("savedAssistants",JSON.stringify(m))},d=async()=>{try{const x=`${window.location.protocol}//${window.location.host}`,m=await fetch(`${x}/models`);if(m.ok){const S=await m.json();t(S.models)}}catch(x){console.error("Failed to fetch models:",x)}finally{r(!1)}},h=async x=>{o(x);try{const m=`${window.location.protocol}//${window.location.host}`;(await fetch(`${m}/load-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:x})})).ok&&await d()}catch(m){console.error("Failed to load model:",m)}finally{o(null)}},p=async x=>{try{const m=`${window.location.protocol}//${window.location.host}`;(await fetch(`${m}/unload-model`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model_name:x})})).ok&&await d()}catch(m){console.error("Failed to unload model:",m)}};return n?c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]})})}),c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx(Ay,{className:"h-8 w-8 animate-spin"})})]}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsxs("div",{className:"flex h-14 items-center px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gi,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Model Catalog"})]}),c.jsx("div",{className:"ml-auto",children:c.jsx(ge,{variant:"outline",size:"sm",onClick:d,children:"Refresh"})})]})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsx(Ue,{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(Ry,{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."})]})]})})}),l.length>0&&c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(xd,{className:"h-5 w-5"}),"My Custom Assistants"]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:l.map(x=>c.jsxs(Ue,{className:"hover:shadow-md transition-shadow",children:[c.jsx(gt,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(_t,{className:"text-base",children:x.name}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:x.description||"No description"})]}),c.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>f(x.id),className:"text-destructive hover:text-destructive",children:c.jsx(kd,{className:"h-4 w-4"})})]})}),c.jsxs(Qe,{className:"space-y-3",children:[c.jsxs("div",{className:"text-xs space-y-1 text-muted-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Model:"})," ",x.model]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Temperature:"})," ",x.temperature]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Max Tokens:"})," ",x.maxTokens]}),c.jsxs("div",{children:[c.jsx("span",{className:"font-medium",children:"Created:"})," ",new Date(x.createdAt).toLocaleDateString()]})]}),c.jsx("div",{className:"flex gap-2",children:c.jsxs(ge,{size:"sm",onClick:()=>u(x),className:"flex-1",children:[c.jsx(Kn,{className:"h-4 w-4 mr-1"}),"Use"]})})]})]},x.id))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(ri,{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:e.filter(x=>x.type==="api").map(x=>c.jsx(Qh,{model:x,modelLoading:i,onLoad:h,onUnload:p},x.model_name))})]}),c.jsxs("div",{children:[c.jsxs("h2",{className:"text-xl font-semibold mb-4 flex items-center gap-2",children:[c.jsx(_y,{className:"h-5 w-5"}),"Local Models",c.jsx(Me,{variant:"outline",className:"text-xs",children:"Privacy-First"})]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.filter(x=>x.type==="local").map(x=>c.jsx(Qh,{model:x,modelLoading:i,onLoad:h,onUnload:p},x.model_name))})]}),c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsx(_t,{children:"Model Statistics"})}),c.jsx(Qe,{children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-blue-600",children:e.length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Available Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.filter(x=>x.is_loaded).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Loaded Models"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.filter(x=>x.supports_thinking).length}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Thinking Models"})]})]})})]})]})})]})}function Qh({model:e,modelLoading:t,onLoad:n,onUnload:r}){const i=e.type==="api";return c.jsxs(Ue,{className:"relative",children:[c.jsx(gt,{children:c.jsx("div",{className:"flex items-start justify-between",children:c.jsxs("div",{className:"flex items-center gap-3",children:[i?c.jsx(ri,{className:"h-6 w-6 text-blue-500"}):e.supports_thinking?c.jsx(pr,{className:"h-6 w-6 text-blue-500"}):c.jsx(os,{className:"h-6 w-6 text-green-500"}),c.jsxs("div",{children:[c.jsx(_t,{className:"text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[i?c.jsxs(Me,{variant:"default",className:"bg-blue-600",children:[c.jsx(ri,{className:"h-3 w-3 mr-1"}),"API Model"]}):c.jsxs(Me,{variant:e.supports_thinking?"default":"secondary",children:[c.jsx(_y,{className:"h-3 w-3 mr-1"}),e.supports_thinking?"Thinking Model":"Instruction Model"]}),e.is_loaded&&c.jsxs(Me,{variant:"outline",className:"text-green-600 border-green-600",children:[c.jsx(CC,{className:"h-3 w-3 mr-1"}),i?"Ready":"Loaded"]})]})]})]})})}),c.jsxs(Qe,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),c.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[c.jsxs("span",{children:["Size: ",e.size_gb]}),!i&&c.jsx("span",{children:"Format: Safetensors"}),i&&c.jsx("span",{children:"Type: Cloud API"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium",children:"Capabilities"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Me,{variant:"outline",className:"text-xs",children:"Text Generation"}),c.jsx(Me,{variant:"outline",className:"text-xs",children:"Conversation"}),c.jsx(Me,{variant:"outline",className:"text-xs",children:"Code"}),e.supports_thinking&&c.jsx(Me,{variant:"outline",className:"text-xs",children:"Reasoning"}),i&&e.model_name.includes("vl")&&c.jsx(Me,{variant:"outline",className:"text-xs",children:"Vision"})]})]}),c.jsx("div",{className:"pt-2 border-t",children:e.is_loaded?c.jsxs("div",{className:"flex gap-2",children:[!i&&c.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>r(e.model_name),className:"flex-1",children:[c.jsx(kd,{className:"h-4 w-4 mr-2"}),"Unload"]}),c.jsx(ge,{size:"sm",className:"flex-1",asChild:!0,children:c.jsx("a",{href:"/playground",children:"Use in Playground"})})]}):c.jsx(ge,{onClick:()=>n(e.model_name),disabled:t===e.model_name,className:"w-full",size:"sm",children:t===e.model_name?c.jsxs(c.Fragment,{children:[c.jsx(Ay,{className:"h-4 w-4 mr-2 animate-spin"}),i?"Connecting...":"Loading..."]}):c.jsxs(c.Fragment,{children:[i?c.jsx(ri,{className:"h-4 w-4 mr-2"}):c.jsx(jy,{className:"h-4 w-4 mr-2"}),i?"Connect":"Load Model"]})})})]})]})}function OT(){return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("div",{className:"border-b",children:c.jsx("div",{className:"flex h-14 items-center px-6",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Sd,{className:"h-5 w-5"}),c.jsx("h1",{className:"text-lg font-semibold",children:"Settings"})]})})}),c.jsx("div",{className:"flex-1 p-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[c.jsxs(Ue,{children:[c.jsx(gt,{children:c.jsxs(_t,{className:"flex items-center gap-2",children:[c.jsx(XC,{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(Ct,{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(Ct,{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(Ue,{children:[c.jsx(gt,{children:c.jsxs(_t,{className:"flex items-center gap-2",children:[c.jsx(Bu,{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(Bu,{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(Ue,{children:[c.jsx(gt,{children:c.jsxs(_t,{className:"flex items-center gap-2",children:[c.jsx(Ry,{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(Ct,{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(Ct,{className:"text-sm font-medium",children:"Status"}),c.jsx("div",{className:"mt-1",children:c.jsx(Me,{variant:"outline",children:"Running"})})]})]})})]})]})})]})}function LT(){return c.jsx(_k,{children:c.jsx(kk,{children:c.jsxs(Dr,{path:"/",element:c.jsx(pE,{}),children:[c.jsx(Dr,{index:!0,element:c.jsx(EE,{})}),c.jsx(Dr,{path:"playground",element:c.jsx(IT,{})}),c.jsx(Dr,{path:"models",element:c.jsx(MT,{})}),c.jsx(Dr,{path:"settings",element:c.jsx(OT,{})})]})})})}Ua.createRoot(document.getElementById("root")).render(c.jsx(Dt.StrictMode,{children:c.jsx(LT,{})})); +//# sourceMappingURL=index-bbadde27.js.map