@dsrcjs/ai-widget 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -31
- package/dist/ai-dana-chat.js +9 -9
- package/dist/{index-DizTRH1P.js → index-ve2JSWl1.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{markdown-impl-DUtQrIcL.js → markdown-impl-DeMW_FqG.js} +1 -1
- package/dist/{stream-entry-omwiGMtU.js → stream-entry-Cqex_Oyn.js} +1 -1
- package/package.json +1 -1
package/dist/ai-dana-chat.js
CHANGED
|
@@ -5,25 +5,25 @@ var AiDanaChat=(function(dn){"use strict";var yse=Object.defineProperty;var xse=
|
|
|
5
5
|
`+C[N].replace(" at new "," at ");return c.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",c.displayName)),X}while(1<=N&&0<=V);break}}}finally{F=!1,Error.prepareStackTrace=m}return(c=c?c.displayName||c.name:"")?W(c):""}function ae(c){switch(c.tag){case 5:return W(c.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return c=ee(c.type,!1),c;case 11:return c=ee(c.type.render,!1),c;case 1:return c=ee(c.type,!0),c;default:return""}}function ie(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case L:return"Fragment";case D:return"Portal";case O:return"Profiler";case R:return"StrictMode";case B:return"Suspense";case $:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case P:return(c.displayName||"Context")+".Consumer";case M:return(c._context.displayName||"Context")+".Provider";case j:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case K:return h=c.displayName||null,h!==null?h:ie(c.type)||"Memo";case Z:h=c._payload,c=c._init;try{return ie(c(h))}catch{}}return null}function _e(c){var h=c.type;switch(c.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=h.render,c=c.displayName||c.name||"",h.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(h);case 8:return h===R?"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 h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function be(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function xe(c){var h=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function Se(c){var h=xe(c)?"checked":"value",m=Object.getOwnPropertyDescriptor(c.constructor.prototype,h),w=""+c[h];if(!c.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,A=m.set;return Object.defineProperty(c,h,{configurable:!0,get:function(){return C.call(this)},set:function(N){w=""+N,A.call(this,N)}}),Object.defineProperty(c,h,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(N){w=""+N},stopTracking:function(){c._valueTracker=null,delete c[h]}}}}function Le(c){c._valueTracker||(c._valueTracker=Se(c))}function Xe(c){if(!c)return!1;var h=c._valueTracker;if(!h)return!0;var m=h.getValue(),w="";return c&&(w=xe(c)?c.checked?"true":"false":c.value),c=w,c!==m?(h.setValue(c),!0):!1}function nr(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function Tt(c,h){var m=h.checked;return I({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??c._wrapperState.initialChecked})}function nn(c,h){var m=h.defaultValue==null?"":h.defaultValue,w=h.checked!=null?h.checked:h.defaultChecked;m=be(h.value!=null?h.value:m),c._wrapperState={initialChecked:w,initialValue:m,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function Dr(c,h){h=h.checked,h!=null&&S(c,"checked",h,!1)}function Ur(c,h){Dr(c,h);var m=be(h.value),w=h.type;if(m!=null)w==="number"?(m===0&&c.value===""||c.value!=m)&&(c.value=""+m):c.value!==""+m&&(c.value=""+m);else if(w==="submit"||w==="reset"){c.removeAttribute("value");return}h.hasOwnProperty("value")?Nn(c,h.type,m):h.hasOwnProperty("defaultValue")&&Nn(c,h.type,be(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(c.defaultChecked=!!h.defaultChecked)}function xs(c,h,m){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var w=h.type;if(!(w!=="submit"&&w!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+c._wrapperState.initialValue,m||h===c.value||(c.value=h),c.defaultValue=h}m=c.name,m!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,m!==""&&(c.name=m)}function Nn(c,h,m){(h!=="number"||nr(c.ownerDocument)!==c)&&(m==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+m&&(c.defaultValue=""+m))}var Ei=Array.isArray;function an(c,h,m,w){if(c=c.options,h){h={};for(var C=0;C<m.length;C++)h["$"+m[C]]=!0;for(m=0;m<c.length;m++)C=h.hasOwnProperty("$"+c[m].value),c[m].selected!==C&&(c[m].selected=C),C&&w&&(c[m].defaultSelected=!0)}else{for(m=""+be(m),h=null,C=0;C<c.length;C++){if(c[C].value===m){c[C].selected=!0,w&&(c[C].defaultSelected=!0);return}h!==null||c[C].disabled||(h=c[C])}h!==null&&(h.selected=!0)}}function Ji(c,h){if(h.dangerouslySetInnerHTML!=null)throw Error(r(91));return I({},h,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function xv(c,h){var m=h.value;if(m==null){if(m=h.children,h=h.defaultValue,m!=null){if(h!=null)throw Error(r(92));if(Ei(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),m=h}c._wrapperState={initialValue:be(m)}}function bv(c,h){var m=be(h.value),w=be(h.defaultValue);m!=null&&(m=""+m,m!==c.value&&(c.value=m),h.defaultValue==null&&c.defaultValue!==m&&(c.defaultValue=m)),w!=null&&(c.defaultValue=""+w)}function wv(c){var h=c.textContent;h===c._wrapperState.initialValue&&h!==""&&h!==null&&(c.value=h)}function _v(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ne(c,h){return c==null||c==="http://www.w3.org/1999/xhtml"?_v(h):c==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var de,He=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,m,w,C){MSApp.execUnsafeLocalFunction(function(){return c(h,m,w,C)})}:c})(function(c,h){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=h;else{for(de=de||document.createElement("div"),de.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=de.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;h.firstChild;)c.appendChild(h.firstChild)}});function Ue(c,h){if(h){var m=c.firstChild;if(m&&m===c.lastChild&&m.nodeType===3){m.nodeValue=h;return}}c.textContent=h}var Vt={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},mt=["Webkit","ms","Moz","O"];Object.keys(Vt).forEach(function(c){mt.forEach(function(h){h=h+c.charAt(0).toUpperCase()+c.substring(1),Vt[h]=Vt[c]})});function ir(c,h,m){return h==null||typeof h=="boolean"||h===""?"":m||typeof h!="number"||h===0||Vt.hasOwnProperty(c)&&Vt[c]?(""+h).trim():h+"px"}function on(c,h){c=c.style;for(var m in h)if(h.hasOwnProperty(m)){var w=m.indexOf("--")===0,C=ir(m,h[m],w);m==="float"&&(m="cssFloat"),w?c.setProperty(m,C):c[m]=C}}var bs=I({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 ea(c,h){if(h){if(bs[c]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(r(137,c));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(r(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(r(61))}if(h.style!=null&&typeof h.style!="object")throw Error(r(62))}}function ta(c,h){if(c.indexOf("-")===-1)return typeof h.is=="string";switch(c){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 Yl=null;function ws(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var ar=null,sn=null,gr=null;function o5(c){if(c=Pf(c)){if(typeof ar!="function")throw Error(r(280));var h=c.stateNode;h&&(h=Gv(h),ar(c.stateNode,c.type,h))}}function s5(c){sn?gr?gr.push(c):gr=[c]:sn=c}function l5(){if(sn){var c=sn,h=gr;if(gr=sn=null,o5(c),h)for(c=0;c<h.length;c++)o5(h[c])}}function u5(c,h){return c(h)}function c5(){}var Ow=!1;function f5(c,h,m){if(Ow)return c(h,m);Ow=!0;try{return u5(c,h,m)}finally{Ow=!1,(sn!==null||gr!==null)&&(c5(),l5())}}function df(c,h){var m=c.stateNode;if(m===null)return null;var w=Gv(m);if(w===null)return null;m=w[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(w=!w.disabled)||(c=c.type,w=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!w;break e;default:c=!1}if(c)return null;if(m&&typeof m!="function")throw Error(r(231,h,typeof m));return m}var zw=!1;if(s)try{var hf={};Object.defineProperty(hf,"passive",{get:function(){zw=!0}}),window.addEventListener("test",hf,hf),window.removeEventListener("test",hf,hf)}catch{zw=!1}function Sae(c,h,m,w,C,A,N,V,X){var te=Array.prototype.slice.call(arguments,3);try{h.apply(m,te)}catch(se){this.onError(se)}}var pf=!1,kv=null,Sv=!1,Fw=null,Cae={onError:function(c){pf=!0,kv=c}};function Tae(c,h,m,w,C,A,N,V,X){pf=!1,kv=null,Sae.apply(Cae,arguments)}function Aae(c,h,m,w,C,A,N,V,X){if(Tae.apply(this,arguments),pf){if(pf){var te=kv;pf=!1,kv=null}else throw Error(r(198));Sv||(Sv=!0,Fw=te)}}function _s(c){var h=c,m=c;if(c.alternate)for(;h.return;)h=h.return;else{c=h;do h=c,(h.flags&4098)!==0&&(m=h.return),c=h.return;while(c)}return h.tag===3?m:null}function d5(c){if(c.tag===13){var h=c.memoizedState;if(h===null&&(c=c.alternate,c!==null&&(h=c.memoizedState)),h!==null)return h.dehydrated}return null}function h5(c){if(_s(c)!==c)throw Error(r(188))}function Eae(c){var h=c.alternate;if(!h){if(h=_s(c),h===null)throw Error(r(188));return h!==c?null:c}for(var m=c,w=h;;){var C=m.return;if(C===null)break;var A=C.alternate;if(A===null){if(w=C.return,w!==null){m=w;continue}break}if(C.child===A.child){for(A=C.child;A;){if(A===m)return h5(C),c;if(A===w)return h5(C),h;A=A.sibling}throw Error(r(188))}if(m.return!==w.return)m=C,w=A;else{for(var N=!1,V=C.child;V;){if(V===m){N=!0,m=C,w=A;break}if(V===w){N=!0,w=C,m=A;break}V=V.sibling}if(!N){for(V=A.child;V;){if(V===m){N=!0,m=A,w=C;break}if(V===w){N=!0,w=A,m=C;break}V=V.sibling}if(!N)throw Error(r(189))}}if(m.alternate!==w)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?c:h}function p5(c){return c=Eae(c),c!==null?v5(c):null}function v5(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var h=v5(c);if(h!==null)return h;c=c.sibling}return null}var g5=t.unstable_scheduleCallback,m5=t.unstable_cancelCallback,Dae=t.unstable_shouldYield,Mae=t.unstable_requestPaint,Ot=t.unstable_now,Lae=t.unstable_getCurrentPriorityLevel,Bw=t.unstable_ImmediatePriority,y5=t.unstable_UserBlockingPriority,Cv=t.unstable_NormalPriority,Iae=t.unstable_LowPriority,x5=t.unstable_IdlePriority,Tv=null,Di=null;function Pae(c){if(Di&&typeof Di.onCommitFiberRoot=="function")try{Di.onCommitFiberRoot(Tv,c,void 0,(c.current.flags&128)===128)}catch{}}var ri=Math.clz32?Math.clz32:Oae,Nae=Math.log,Rae=Math.LN2;function Oae(c){return c>>>=0,c===0?32:31-(Nae(c)/Rae|0)|0}var Av=64,Ev=4194304;function vf(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Dv(c,h){var m=c.pendingLanes;if(m===0)return 0;var w=0,C=c.suspendedLanes,A=c.pingedLanes,N=m&268435455;if(N!==0){var V=N&~C;V!==0?w=vf(V):(A&=N,A!==0&&(w=vf(A)))}else N=m&~C,N!==0?w=vf(N):A!==0&&(w=vf(A));if(w===0)return 0;if(h!==0&&h!==w&&(h&C)===0&&(C=w&-w,A=h&-h,C>=A||C===16&&(A&4194240)!==0))return h;if((w&4)!==0&&(w|=m&16),h=c.entangledLanes,h!==0)for(c=c.entanglements,h&=w;0<h;)m=31-ri(h),C=1<<m,w|=c[m],h&=~C;return w}function zae(c,h){switch(c){case 1:case 2:case 4:return h+250;case 8:case 16:case 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 h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fae(c,h){for(var m=c.suspendedLanes,w=c.pingedLanes,C=c.expirationTimes,A=c.pendingLanes;0<A;){var N=31-ri(A),V=1<<N,X=C[N];X===-1?((V&m)===0||(V&w)!==0)&&(C[N]=zae(V,h)):X<=h&&(c.expiredLanes|=V),A&=~V}}function jw(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function b5(){var c=Av;return Av<<=1,(Av&4194240)===0&&(Av=64),c}function Hw(c){for(var h=[],m=0;31>m;m++)h.push(c);return h}function gf(c,h,m){c.pendingLanes|=h,h!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,h=31-ri(h),c[h]=m}function Bae(c,h){var m=c.pendingLanes&~h;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=h,c.mutableReadLanes&=h,c.entangledLanes&=h,h=c.entanglements;var w=c.eventTimes;for(c=c.expirationTimes;0<m;){var C=31-ri(m),A=1<<C;h[C]=0,w[C]=-1,c[C]=-1,m&=~A}}function Vw(c,h){var m=c.entangledLanes|=h;for(c=c.entanglements;m;){var w=31-ri(m),C=1<<w;C&h|c[w]&h&&(c[w]|=h),m&=~C}}var ht=0;function w5(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var _5,Uw,k5,S5,C5,$w=!1,Mv=[],$a=null,Ga=null,Wa=null,mf=new Map,yf=new Map,Ya=[],jae="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function T5(c,h){switch(c){case"focusin":case"focusout":$a=null;break;case"dragenter":case"dragleave":Ga=null;break;case"mouseover":case"mouseout":Wa=null;break;case"pointerover":case"pointerout":mf.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":yf.delete(h.pointerId)}}function xf(c,h,m,w,C,A){return c===null||c.nativeEvent!==A?(c={blockedOn:h,domEventName:m,eventSystemFlags:w,nativeEvent:A,targetContainers:[C]},h!==null&&(h=Pf(h),h!==null&&Uw(h)),c):(c.eventSystemFlags|=w,h=c.targetContainers,C!==null&&h.indexOf(C)===-1&&h.push(C),c)}function Hae(c,h,m,w,C){switch(h){case"focusin":return $a=xf($a,c,h,m,w,C),!0;case"dragenter":return Ga=xf(Ga,c,h,m,w,C),!0;case"mouseover":return Wa=xf(Wa,c,h,m,w,C),!0;case"pointerover":var A=C.pointerId;return mf.set(A,xf(mf.get(A)||null,c,h,m,w,C)),!0;case"gotpointercapture":return A=C.pointerId,yf.set(A,xf(yf.get(A)||null,c,h,m,w,C)),!0}return!1}function A5(c){var h=ks(c.target);if(h!==null){var m=_s(h);if(m!==null){if(h=m.tag,h===13){if(h=d5(m),h!==null){c.blockedOn=h,C5(c.priority,function(){k5(m)});return}}else if(h===3&&m.stateNode.current.memoizedState.isDehydrated){c.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}c.blockedOn=null}function Lv(c){if(c.blockedOn!==null)return!1;for(var h=c.targetContainers;0<h.length;){var m=Ww(c.domEventName,c.eventSystemFlags,h[0],c.nativeEvent);if(m===null){m=c.nativeEvent;var w=new m.constructor(m.type,m);Yl=w,m.target.dispatchEvent(w),Yl=null}else return h=Pf(m),h!==null&&Uw(h),c.blockedOn=m,!1;h.shift()}return!0}function E5(c,h,m){Lv(c)&&m.delete(h)}function Vae(){$w=!1,$a!==null&&Lv($a)&&($a=null),Ga!==null&&Lv(Ga)&&(Ga=null),Wa!==null&&Lv(Wa)&&(Wa=null),mf.forEach(E5),yf.forEach(E5)}function bf(c,h){c.blockedOn===h&&(c.blockedOn=null,$w||($w=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vae)))}function wf(c){function h(C){return bf(C,c)}if(0<Mv.length){bf(Mv[0],c);for(var m=1;m<Mv.length;m++){var w=Mv[m];w.blockedOn===c&&(w.blockedOn=null)}}for($a!==null&&bf($a,c),Ga!==null&&bf(Ga,c),Wa!==null&&bf(Wa,c),mf.forEach(h),yf.forEach(h),m=0;m<Ya.length;m++)w=Ya[m],w.blockedOn===c&&(w.blockedOn=null);for(;0<Ya.length&&(m=Ya[0],m.blockedOn===null);)A5(m),m.blockedOn===null&&Ya.shift()}var Xl=T.ReactCurrentBatchConfig,Iv=!0;function Uae(c,h,m,w){var C=ht,A=Xl.transition;Xl.transition=null;try{ht=1,Gw(c,h,m,w)}finally{ht=C,Xl.transition=A}}function $ae(c,h,m,w){var C=ht,A=Xl.transition;Xl.transition=null;try{ht=4,Gw(c,h,m,w)}finally{ht=C,Xl.transition=A}}function Gw(c,h,m,w){if(Iv){var C=Ww(c,h,m,w);if(C===null)u_(c,h,w,Pv,m),T5(c,w);else if(Hae(C,c,h,m,w))w.stopPropagation();else if(T5(c,w),h&4&&-1<jae.indexOf(c)){for(;C!==null;){var A=Pf(C);if(A!==null&&_5(A),A=Ww(c,h,m,w),A===null&&u_(c,h,w,Pv,m),A===C)break;C=A}C!==null&&w.stopPropagation()}else u_(c,h,w,null,m)}}var Pv=null;function Ww(c,h,m,w){if(Pv=null,c=ws(w),c=ks(c),c!==null)if(h=_s(c),h===null)c=null;else if(m=h.tag,m===13){if(c=d5(h),c!==null)return c;c=null}else if(m===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;c=null}else h!==c&&(c=null);return Pv=c,null}function D5(c){switch(c){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Lae()){case Bw:return 1;case y5:return 4;case Cv:case Iae:return 16;case x5:return 536870912;default:return 16}default:return 16}}var Xa=null,Yw=null,Nv=null;function M5(){if(Nv)return Nv;var c,h=Yw,m=h.length,w,C="value"in Xa?Xa.value:Xa.textContent,A=C.length;for(c=0;c<m&&h[c]===C[c];c++);var N=m-c;for(w=1;w<=N&&h[m-w]===C[A-w];w++);return Nv=C.slice(c,1<w?1-w:void 0)}function Rv(c){var h=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&h===13&&(c=13)):c=h,c===10&&(c=13),32<=c||c===13?c:0}function Ov(){return!0}function L5(){return!1}function ln(c){function h(m,w,C,A,N){this._reactName=m,this._targetInst=C,this.type=w,this.nativeEvent=A,this.target=N,this.currentTarget=null;for(var V in c)c.hasOwnProperty(V)&&(m=c[V],this[V]=m?m(A):A[V]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?Ov:L5,this.isPropagationStopped=L5,this}return I(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Ov)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Ov)},persist:function(){},isPersistent:Ov}),h}var ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xw=ln(ql),_f=I({},ql,{view:0,detail:0}),Gae=ln(_f),qw,Kw,kf,zv=I({},_f,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qw,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==kf&&(kf&&c.type==="mousemove"?(qw=c.screenX-kf.screenX,Kw=c.screenY-kf.screenY):Kw=qw=0,kf=c),qw)},movementY:function(c){return"movementY"in c?c.movementY:Kw}}),I5=ln(zv),Wae=I({},zv,{dataTransfer:0}),Yae=ln(Wae),Xae=I({},_f,{relatedTarget:0}),Zw=ln(Xae),qae=I({},ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Kae=ln(qae),Zae=I({},ql,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Qae=ln(Zae),Jae=I({},ql,{data:0}),P5=ln(Jae),eoe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},toe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},roe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function noe(c){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(c):(c=roe[c])?!!h[c]:!1}function Qw(){return noe}var ioe=I({},_f,{key:function(c){if(c.key){var h=eoe[c.key]||c.key;if(h!=="Unidentified")return h}return c.type==="keypress"?(c=Rv(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?toe[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qw,charCode:function(c){return c.type==="keypress"?Rv(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Rv(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),aoe=ln(ioe),ooe=I({},zv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),N5=ln(ooe),soe=I({},_f,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qw}),loe=ln(soe),uoe=I({},ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),coe=ln(uoe),foe=I({},zv,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),doe=ln(foe),hoe=[9,13,27,32],Jw=s&&"CompositionEvent"in window,Sf=null;s&&"documentMode"in document&&(Sf=document.documentMode);var poe=s&&"TextEvent"in window&&!Sf,R5=s&&(!Jw||Sf&&8<Sf&&11>=Sf),O5=" ",z5=!1;function F5(c,h){switch(c){case"keyup":return hoe.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B5(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Kl=!1;function voe(c,h){switch(c){case"compositionend":return B5(h);case"keypress":return h.which!==32?null:(z5=!0,O5);case"textInput":return c=h.data,c===O5&&z5?null:c;default:return null}}function goe(c,h){if(Kl)return c==="compositionend"||!Jw&&F5(c,h)?(c=M5(),Nv=Yw=Xa=null,Kl=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return R5&&h.locale!=="ko"?null:h.data;default:return null}}var moe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function j5(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h==="input"?!!moe[c.type]:h==="textarea"}function H5(c,h,m,w){s5(w),h=Vv(h,"onChange"),0<h.length&&(m=new Xw("onChange","change",null,m,w),c.push({event:m,listeners:h}))}var Cf=null,Tf=null;function yoe(c){aO(c,0)}function Fv(c){var h=tu(c);if(Xe(h))return c}function xoe(c,h){if(c==="change")return h}var V5=!1;if(s){var e_;if(s){var t_="oninput"in document;if(!t_){var U5=document.createElement("div");U5.setAttribute("oninput","return;"),t_=typeof U5.oninput=="function"}e_=t_}else e_=!1;V5=e_&&(!document.documentMode||9<document.documentMode)}function $5(){Cf&&(Cf.detachEvent("onpropertychange",G5),Tf=Cf=null)}function G5(c){if(c.propertyName==="value"&&Fv(Tf)){var h=[];H5(h,Tf,c,ws(c)),f5(yoe,h)}}function boe(c,h,m){c==="focusin"?($5(),Cf=h,Tf=m,Cf.attachEvent("onpropertychange",G5)):c==="focusout"&&$5()}function woe(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Fv(Tf)}function _oe(c,h){if(c==="click")return Fv(h)}function koe(c,h){if(c==="input"||c==="change")return Fv(h)}function Soe(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var ni=typeof Object.is=="function"?Object.is:Soe;function Af(c,h){if(ni(c,h))return!0;if(typeof c!="object"||c===null||typeof h!="object"||h===null)return!1;var m=Object.keys(c),w=Object.keys(h);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var C=m[w];if(!l.call(h,C)||!ni(c[C],h[C]))return!1}return!0}function W5(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function Y5(c,h){var m=W5(c);c=0;for(var w;m;){if(m.nodeType===3){if(w=c+m.textContent.length,c<=h&&w>=h)return{node:m,offset:h-c};c=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=W5(m)}}function X5(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?X5(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function q5(){for(var c=window,h=nr();h instanceof c.HTMLIFrameElement;){try{var m=typeof h.contentWindow.location.href=="string"}catch{m=!1}if(m)c=h.contentWindow;else break;h=nr(c.document)}return h}function r_(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}function Coe(c){var h=q5(),m=c.focusedElem,w=c.selectionRange;if(h!==m&&m&&m.ownerDocument&&X5(m.ownerDocument.documentElement,m)){if(w!==null&&r_(m)){if(h=w.start,c=w.end,c===void 0&&(c=h),"selectionStart"in m)m.selectionStart=h,m.selectionEnd=Math.min(c,m.value.length);else if(c=(h=m.ownerDocument||document)&&h.defaultView||window,c.getSelection){c=c.getSelection();var C=m.textContent.length,A=Math.min(w.start,C);w=w.end===void 0?A:Math.min(w.end,C),!c.extend&&A>w&&(C=w,w=A,A=C),C=Y5(m,A);var N=Y5(m,w);C&&N&&(c.rangeCount!==1||c.anchorNode!==C.node||c.anchorOffset!==C.offset||c.focusNode!==N.node||c.focusOffset!==N.offset)&&(h=h.createRange(),h.setStart(C.node,C.offset),c.removeAllRanges(),A>w?(c.addRange(h),c.extend(N.node,N.offset)):(h.setEnd(N.node,N.offset),c.addRange(h)))}}for(h=[],c=m;c=c.parentNode;)c.nodeType===1&&h.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<h.length;m++)c=h[m],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var Toe=s&&"documentMode"in document&&11>=document.documentMode,Zl=null,n_=null,Ef=null,i_=!1;function K5(c,h,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;i_||Zl==null||Zl!==nr(w)||(w=Zl,"selectionStart"in w&&r_(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Ef&&Af(Ef,w)||(Ef=w,w=Vv(n_,"onSelect"),0<w.length&&(h=new Xw("onSelect","select",null,h,m),c.push({event:h,listeners:w}),h.target=Zl)))}function Bv(c,h){var m={};return m[c.toLowerCase()]=h.toLowerCase(),m["Webkit"+c]="webkit"+h,m["Moz"+c]="moz"+h,m}var Ql={animationend:Bv("Animation","AnimationEnd"),animationiteration:Bv("Animation","AnimationIteration"),animationstart:Bv("Animation","AnimationStart"),transitionend:Bv("Transition","TransitionEnd")},a_={},Z5={};s&&(Z5=document.createElement("div").style,"AnimationEvent"in window||(delete Ql.animationend.animation,delete Ql.animationiteration.animation,delete Ql.animationstart.animation),"TransitionEvent"in window||delete Ql.transitionend.transition);function jv(c){if(a_[c])return a_[c];if(!Ql[c])return c;var h=Ql[c],m;for(m in h)if(h.hasOwnProperty(m)&&m in Z5)return a_[c]=h[m];return c}var Q5=jv("animationend"),J5=jv("animationiteration"),eO=jv("animationstart"),tO=jv("transitionend"),rO=new Map,nO="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qa(c,h){rO.set(c,h),a(h,[c])}for(var o_=0;o_<nO.length;o_++){var s_=nO[o_],Aoe=s_.toLowerCase(),Eoe=s_[0].toUpperCase()+s_.slice(1);qa(Aoe,"on"+Eoe)}qa(Q5,"onAnimationEnd"),qa(J5,"onAnimationIteration"),qa(eO,"onAnimationStart"),qa("dblclick","onDoubleClick"),qa("focusin","onFocus"),qa("focusout","onBlur"),qa(tO,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Df="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Doe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Df));function iO(c,h,m){var w=c.type||"unknown-event";c.currentTarget=m,Aae(w,h,void 0,c),c.currentTarget=null}function aO(c,h){h=(h&4)!==0;for(var m=0;m<c.length;m++){var w=c[m],C=w.event;w=w.listeners;e:{var A=void 0;if(h)for(var N=w.length-1;0<=N;N--){var V=w[N],X=V.instance,te=V.currentTarget;if(V=V.listener,X!==A&&C.isPropagationStopped())break e;iO(C,V,te),A=X}else for(N=0;N<w.length;N++){if(V=w[N],X=V.instance,te=V.currentTarget,V=V.listener,X!==A&&C.isPropagationStopped())break e;iO(C,V,te),A=X}}}if(Sv)throw c=Fw,Sv=!1,Fw=null,c}function St(c,h){var m=h[v_];m===void 0&&(m=h[v_]=new Set);var w=c+"__bubble";m.has(w)||(oO(h,c,2,!1),m.add(w))}function l_(c,h,m){var w=0;h&&(w|=4),oO(m,c,w,h)}var Hv="_reactListening"+Math.random().toString(36).slice(2);function Mf(c){if(!c[Hv]){c[Hv]=!0,n.forEach(function(m){m!=="selectionchange"&&(Doe.has(m)||l_(m,!1,c),l_(m,!0,c))});var h=c.nodeType===9?c:c.ownerDocument;h===null||h[Hv]||(h[Hv]=!0,l_("selectionchange",!1,h))}}function oO(c,h,m,w){switch(D5(h)){case 1:var C=Uae;break;case 4:C=$ae;break;default:C=Gw}m=C.bind(null,h,m,c),C=void 0,!zw||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(C=!0),w?C!==void 0?c.addEventListener(h,m,{capture:!0,passive:C}):c.addEventListener(h,m,!0):C!==void 0?c.addEventListener(h,m,{passive:C}):c.addEventListener(h,m,!1)}function u_(c,h,m,w,C){var A=w;if((h&1)===0&&(h&2)===0&&w!==null)e:for(;;){if(w===null)return;var N=w.tag;if(N===3||N===4){var V=w.stateNode.containerInfo;if(V===C||V.nodeType===8&&V.parentNode===C)break;if(N===4)for(N=w.return;N!==null;){var X=N.tag;if((X===3||X===4)&&(X=N.stateNode.containerInfo,X===C||X.nodeType===8&&X.parentNode===C))return;N=N.return}for(;V!==null;){if(N=ks(V),N===null)return;if(X=N.tag,X===5||X===6){w=A=N;continue e}V=V.parentNode}}w=w.return}f5(function(){var te=A,se=ws(m),le=[];e:{var oe=rO.get(c);if(oe!==void 0){var me=Xw,ke=c;switch(c){case"keypress":if(Rv(m)===0)break e;case"keydown":case"keyup":me=aoe;break;case"focusin":ke="focus",me=Zw;break;case"focusout":ke="blur",me=Zw;break;case"beforeblur":case"afterblur":me=Zw;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=I5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Yae;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=loe;break;case Q5:case J5:case eO:me=Kae;break;case tO:me=coe;break;case"scroll":me=Gae;break;case"wheel":me=doe;break;case"copy":case"cut":case"paste":me=Qae;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=N5}var Ce=(h&4)!==0,zt=!Ce&&c==="scroll",Q=Ce?oe!==null?oe+"Capture":null:oe;Ce=[];for(var q=te,J;q!==null;){J=q;var fe=J.stateNode;if(J.tag===5&&fe!==null&&(J=fe,Q!==null&&(fe=df(q,Q),fe!=null&&Ce.push(Lf(q,fe,J)))),zt)break;q=q.return}0<Ce.length&&(oe=new me(oe,ke,null,m,se),le.push({event:oe,listeners:Ce}))}}if((h&7)===0){e:{if(oe=c==="mouseover"||c==="pointerover",me=c==="mouseout"||c==="pointerout",oe&&m!==Yl&&(ke=m.relatedTarget||m.fromElement)&&(ks(ke)||ke[ra]))break e;if((me||oe)&&(oe=se.window===se?se:(oe=se.ownerDocument)?oe.defaultView||oe.parentWindow:window,me?(ke=m.relatedTarget||m.toElement,me=te,ke=ke?ks(ke):null,ke!==null&&(zt=_s(ke),ke!==zt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(me=null,ke=te),me!==ke)){if(Ce=I5,fe="onMouseLeave",Q="onMouseEnter",q="mouse",(c==="pointerout"||c==="pointerover")&&(Ce=N5,fe="onPointerLeave",Q="onPointerEnter",q="pointer"),zt=me==null?oe:tu(me),J=ke==null?oe:tu(ke),oe=new Ce(fe,q+"leave",me,m,se),oe.target=zt,oe.relatedTarget=J,fe=null,ks(se)===te&&(Ce=new Ce(Q,q+"enter",ke,m,se),Ce.target=J,Ce.relatedTarget=zt,fe=Ce),zt=fe,me&&ke)t:{for(Ce=me,Q=ke,q=0,J=Ce;J;J=Jl(J))q++;for(J=0,fe=Q;fe;fe=Jl(fe))J++;for(;0<q-J;)Ce=Jl(Ce),q--;for(;0<J-q;)Q=Jl(Q),J--;for(;q--;){if(Ce===Q||Q!==null&&Ce===Q.alternate)break t;Ce=Jl(Ce),Q=Jl(Q)}Ce=null}else Ce=null;me!==null&&sO(le,oe,me,Ce,!1),ke!==null&&zt!==null&&sO(le,zt,ke,Ce,!0)}}e:{if(oe=te?tu(te):window,me=oe.nodeName&&oe.nodeName.toLowerCase(),me==="select"||me==="input"&&oe.type==="file")var Te=xoe;else if(j5(oe))if(V5)Te=koe;else{Te=woe;var Re=boe}else(me=oe.nodeName)&&me.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Te=_oe);if(Te&&(Te=Te(c,te))){H5(le,Te,m,se);break e}Re&&Re(c,oe,te),c==="focusout"&&(Re=oe._wrapperState)&&Re.controlled&&oe.type==="number"&&Nn(oe,"number",oe.value)}switch(Re=te?tu(te):window,c){case"focusin":(j5(Re)||Re.contentEditable==="true")&&(Zl=Re,n_=te,Ef=null);break;case"focusout":Ef=n_=Zl=null;break;case"mousedown":i_=!0;break;case"contextmenu":case"mouseup":case"dragend":i_=!1,K5(le,m,se);break;case"selectionchange":if(Toe)break;case"keydown":case"keyup":K5(le,m,se)}var Oe;if(Jw)e:{switch(c){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Kl?F5(c,m)&&(Ve="onCompositionEnd"):c==="keydown"&&m.keyCode===229&&(Ve="onCompositionStart");Ve&&(R5&&m.locale!=="ko"&&(Kl||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Kl&&(Oe=M5()):(Xa=se,Yw="value"in Xa?Xa.value:Xa.textContent,Kl=!0)),Re=Vv(te,Ve),0<Re.length&&(Ve=new P5(Ve,c,null,m,se),le.push({event:Ve,listeners:Re}),Oe?Ve.data=Oe:(Oe=B5(m),Oe!==null&&(Ve.data=Oe)))),(Oe=poe?voe(c,m):goe(c,m))&&(te=Vv(te,"onBeforeInput"),0<te.length&&(se=new P5("onBeforeInput","beforeinput",null,m,se),le.push({event:se,listeners:te}),se.data=Oe))}aO(le,h)})}function Lf(c,h,m){return{instance:c,listener:h,currentTarget:m}}function Vv(c,h){for(var m=h+"Capture",w=[];c!==null;){var C=c,A=C.stateNode;C.tag===5&&A!==null&&(C=A,A=df(c,m),A!=null&&w.unshift(Lf(c,A,C)),A=df(c,h),A!=null&&w.push(Lf(c,A,C))),c=c.return}return w}function Jl(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function sO(c,h,m,w,C){for(var A=h._reactName,N=[];m!==null&&m!==w;){var V=m,X=V.alternate,te=V.stateNode;if(X!==null&&X===w)break;V.tag===5&&te!==null&&(V=te,C?(X=df(m,A),X!=null&&N.unshift(Lf(m,X,V))):C||(X=df(m,A),X!=null&&N.push(Lf(m,X,V)))),m=m.return}N.length!==0&&c.push({event:h,listeners:N})}var Moe=/\r\n?/g,Loe=/\u0000|\uFFFD/g;function lO(c){return(typeof c=="string"?c:""+c).replace(Moe,`
|
|
6
6
|
`).replace(Loe,"")}function Uv(c,h,m){if(h=lO(h),lO(c)!==h&&m)throw Error(r(425))}function $v(){}var c_=null,f_=null;function d_(c,h){return c==="textarea"||c==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var h_=typeof setTimeout=="function"?setTimeout:void 0,Ioe=typeof clearTimeout=="function"?clearTimeout:void 0,uO=typeof Promise=="function"?Promise:void 0,Poe=typeof queueMicrotask=="function"?queueMicrotask:typeof uO<"u"?function(c){return uO.resolve(null).then(c).catch(Noe)}:h_;function Noe(c){setTimeout(function(){throw c})}function p_(c,h){var m=h,w=0;do{var C=m.nextSibling;if(c.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(w===0){c.removeChild(C),wf(h);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=C}while(m);wf(h)}function Ka(c){for(;c!=null;c=c.nextSibling){var h=c.nodeType;if(h===1||h===3)break;if(h===8){if(h=c.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return c}function cO(c){c=c.previousSibling;for(var h=0;c;){if(c.nodeType===8){var m=c.data;if(m==="$"||m==="$!"||m==="$?"){if(h===0)return c;h--}else m==="/$"&&h++}c=c.previousSibling}return null}var eu=Math.random().toString(36).slice(2),Mi="__reactFiber$"+eu,If="__reactProps$"+eu,ra="__reactContainer$"+eu,v_="__reactEvents$"+eu,Roe="__reactListeners$"+eu,Ooe="__reactHandles$"+eu;function ks(c){var h=c[Mi];if(h)return h;for(var m=c.parentNode;m;){if(h=m[ra]||m[Mi]){if(m=h.alternate,h.child!==null||m!==null&&m.child!==null)for(c=cO(c);c!==null;){if(m=c[Mi])return m;c=cO(c)}return h}c=m,m=c.parentNode}return null}function Pf(c){return c=c[Mi]||c[ra],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function tu(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(r(33))}function Gv(c){return c[If]||null}var g_=[],ru=-1;function Za(c){return{current:c}}function Ct(c){0>ru||(c.current=g_[ru],g_[ru]=null,ru--)}function wt(c,h){ru++,g_[ru]=c.current,c.current=h}var Qa={},mr=Za(Qa),$r=Za(!1),Ss=Qa;function nu(c,h){var m=c.type.contextTypes;if(!m)return Qa;var w=c.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===h)return w.__reactInternalMemoizedMaskedChildContext;var C={},A;for(A in m)C[A]=h[A];return w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=h,c.__reactInternalMemoizedMaskedChildContext=C),C}function Gr(c){return c=c.childContextTypes,c!=null}function Wv(){Ct($r),Ct(mr)}function fO(c,h,m){if(mr.current!==Qa)throw Error(r(168));wt(mr,h),wt($r,m)}function dO(c,h,m){var w=c.stateNode;if(h=h.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var C in w)if(!(C in h))throw Error(r(108,_e(c)||"Unknown",C));return I({},m,w)}function Yv(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Qa,Ss=mr.current,wt(mr,c),wt($r,$r.current),!0}function hO(c,h,m){var w=c.stateNode;if(!w)throw Error(r(169));m?(c=dO(c,h,Ss),w.__reactInternalMemoizedMergedChildContext=c,Ct($r),Ct(mr),wt(mr,c)):Ct($r),wt($r,m)}var na=null,Xv=!1,m_=!1;function pO(c){na===null?na=[c]:na.push(c)}function zoe(c){Xv=!0,pO(c)}function Ja(){if(!m_&&na!==null){m_=!0;var c=0,h=ht;try{var m=na;for(ht=1;c<m.length;c++){var w=m[c];do w=w(!0);while(w!==null)}na=null,Xv=!1}catch(C){throw na!==null&&(na=na.slice(c+1)),g5(Bw,Ja),C}finally{ht=h,m_=!1}}return null}var iu=[],au=0,qv=null,Kv=0,Rn=[],On=0,Cs=null,ia=1,aa="";function Ts(c,h){iu[au++]=Kv,iu[au++]=qv,qv=c,Kv=h}function vO(c,h,m){Rn[On++]=ia,Rn[On++]=aa,Rn[On++]=Cs,Cs=c;var w=ia;c=aa;var C=32-ri(w)-1;w&=~(1<<C),m+=1;var A=32-ri(h)+C;if(30<A){var N=C-C%5;A=(w&(1<<N)-1).toString(32),w>>=N,C-=N,ia=1<<32-ri(h)+C|m<<C|w,aa=A+c}else ia=1<<A|m<<C|w,aa=c}function y_(c){c.return!==null&&(Ts(c,1),vO(c,1,0))}function x_(c){for(;c===qv;)qv=iu[--au],iu[au]=null,Kv=iu[--au],iu[au]=null;for(;c===Cs;)Cs=Rn[--On],Rn[On]=null,aa=Rn[--On],Rn[On]=null,ia=Rn[--On],Rn[On]=null}var un=null,cn=null,At=!1,ii=null;function gO(c,h){var m=jn(5,null,null,0);m.elementType="DELETED",m.stateNode=h,m.return=c,h=c.deletions,h===null?(c.deletions=[m],c.flags|=16):h.push(m)}function mO(c,h){switch(c.tag){case 5:var m=c.type;return h=h.nodeType!==1||m.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(c.stateNode=h,un=c,cn=Ka(h.firstChild),!0):!1;case 6:return h=c.pendingProps===""||h.nodeType!==3?null:h,h!==null?(c.stateNode=h,un=c,cn=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(m=Cs!==null?{id:ia,overflow:aa}:null,c.memoizedState={dehydrated:h,treeContext:m,retryLane:1073741824},m=jn(18,null,null,0),m.stateNode=h,m.return=c,c.child=m,un=c,cn=null,!0):!1;default:return!1}}function b_(c){return(c.mode&1)!==0&&(c.flags&128)===0}function w_(c){if(At){var h=cn;if(h){var m=h;if(!mO(c,h)){if(b_(c))throw Error(r(418));h=Ka(m.nextSibling);var w=un;h&&mO(c,h)?gO(w,m):(c.flags=c.flags&-4097|2,At=!1,un=c)}}else{if(b_(c))throw Error(r(418));c.flags=c.flags&-4097|2,At=!1,un=c}}}function yO(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;un=c}function Zv(c){if(c!==un)return!1;if(!At)return yO(c),At=!0,!1;var h;if((h=c.tag!==3)&&!(h=c.tag!==5)&&(h=c.type,h=h!=="head"&&h!=="body"&&!d_(c.type,c.memoizedProps)),h&&(h=cn)){if(b_(c))throw xO(),Error(r(418));for(;h;)gO(c,h),h=Ka(h.nextSibling)}if(yO(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));e:{for(c=c.nextSibling,h=0;c;){if(c.nodeType===8){var m=c.data;if(m==="/$"){if(h===0){cn=Ka(c.nextSibling);break e}h--}else m!=="$"&&m!=="$!"&&m!=="$?"||h++}c=c.nextSibling}cn=null}}else cn=un?Ka(c.stateNode.nextSibling):null;return!0}function xO(){for(var c=cn;c;)c=Ka(c.nextSibling)}function ou(){cn=un=null,At=!1}function __(c){ii===null?ii=[c]:ii.push(c)}var Foe=T.ReactCurrentBatchConfig;function Nf(c,h,m){if(c=m.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(r(309));var w=m.stateNode}if(!w)throw Error(r(147,c));var C=w,A=""+c;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===A?h.ref:(h=function(N){var V=C.refs;N===null?delete V[A]:V[A]=N},h._stringRef=A,h)}if(typeof c!="string")throw Error(r(284));if(!m._owner)throw Error(r(290,c))}return c}function Qv(c,h){throw c=Object.prototype.toString.call(h),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":c))}function bO(c){var h=c._init;return h(c._payload)}function wO(c){function h(Q,q){if(c){var J=Q.deletions;J===null?(Q.deletions=[q],Q.flags|=16):J.push(q)}}function m(Q,q){if(!c)return null;for(;q!==null;)h(Q,q),q=q.sibling;return null}function w(Q,q){for(Q=new Map;q!==null;)q.key!==null?Q.set(q.key,q):Q.set(q.index,q),q=q.sibling;return Q}function C(Q,q){return Q=so(Q,q),Q.index=0,Q.sibling=null,Q}function A(Q,q,J){return Q.index=J,c?(J=Q.alternate,J!==null?(J=J.index,J<q?(Q.flags|=2,q):J):(Q.flags|=2,q)):(Q.flags|=1048576,q)}function N(Q){return c&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,q,J,fe){return q===null||q.tag!==6?(q=hk(J,Q.mode,fe),q.return=Q,q):(q=C(q,J),q.return=Q,q)}function X(Q,q,J,fe){var Te=J.type;return Te===L?se(Q,q,J.props.children,fe,J.key):q!==null&&(q.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===Z&&bO(Te)===q.type)?(fe=C(q,J.props),fe.ref=Nf(Q,q,J),fe.return=Q,fe):(fe=_g(J.type,J.key,J.props,null,Q.mode,fe),fe.ref=Nf(Q,q,J),fe.return=Q,fe)}function te(Q,q,J,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=pk(J,Q.mode,fe),q.return=Q,q):(q=C(q,J.children||[]),q.return=Q,q)}function se(Q,q,J,fe,Te){return q===null||q.tag!==7?(q=Ns(J,Q.mode,fe,Te),q.return=Q,q):(q=C(q,J),q.return=Q,q)}function le(Q,q,J){if(typeof q=="string"&&q!==""||typeof q=="number")return q=hk(""+q,Q.mode,J),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case E:return J=_g(q.type,q.key,q.props,null,Q.mode,J),J.ref=Nf(Q,null,q),J.return=Q,J;case D:return q=pk(q,Q.mode,J),q.return=Q,q;case Z:var fe=q._init;return le(Q,fe(q._payload),J)}if(Ei(q)||G(q))return q=Ns(q,Q.mode,J,null),q.return=Q,q;Qv(Q,q)}return null}function oe(Q,q,J,fe){var Te=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Te!==null?null:V(Q,q,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case E:return J.key===Te?X(Q,q,J,fe):null;case D:return J.key===Te?te(Q,q,J,fe):null;case Z:return Te=J._init,oe(Q,q,Te(J._payload),fe)}if(Ei(J)||G(J))return Te!==null?null:se(Q,q,J,fe,null);Qv(Q,J)}return null}function me(Q,q,J,fe,Te){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return Q=Q.get(J)||null,V(q,Q,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case E:return Q=Q.get(fe.key===null?J:fe.key)||null,X(q,Q,fe,Te);case D:return Q=Q.get(fe.key===null?J:fe.key)||null,te(q,Q,fe,Te);case Z:var Re=fe._init;return me(Q,q,J,Re(fe._payload),Te)}if(Ei(fe)||G(fe))return Q=Q.get(J)||null,se(q,Q,fe,Te,null);Qv(q,fe)}return null}function ke(Q,q,J,fe){for(var Te=null,Re=null,Oe=q,Ve=q=0,Kt=null;Oe!==null&&Ve<J.length;Ve++){Oe.index>Ve?(Kt=Oe,Oe=null):Kt=Oe.sibling;var ot=oe(Q,Oe,J[Ve],fe);if(ot===null){Oe===null&&(Oe=Kt);break}c&&Oe&&ot.alternate===null&&h(Q,Oe),q=A(ot,q,Ve),Re===null?Te=ot:Re.sibling=ot,Re=ot,Oe=Kt}if(Ve===J.length)return m(Q,Oe),At&&Ts(Q,Ve),Te;if(Oe===null){for(;Ve<J.length;Ve++)Oe=le(Q,J[Ve],fe),Oe!==null&&(q=A(Oe,q,Ve),Re===null?Te=Oe:Re.sibling=Oe,Re=Oe);return At&&Ts(Q,Ve),Te}for(Oe=w(Q,Oe);Ve<J.length;Ve++)Kt=me(Oe,Q,Ve,J[Ve],fe),Kt!==null&&(c&&Kt.alternate!==null&&Oe.delete(Kt.key===null?Ve:Kt.key),q=A(Kt,q,Ve),Re===null?Te=Kt:Re.sibling=Kt,Re=Kt);return c&&Oe.forEach(function(lo){return h(Q,lo)}),At&&Ts(Q,Ve),Te}function Ce(Q,q,J,fe){var Te=G(J);if(typeof Te!="function")throw Error(r(150));if(J=Te.call(J),J==null)throw Error(r(151));for(var Re=Te=null,Oe=q,Ve=q=0,Kt=null,ot=J.next();Oe!==null&&!ot.done;Ve++,ot=J.next()){Oe.index>Ve?(Kt=Oe,Oe=null):Kt=Oe.sibling;var lo=oe(Q,Oe,ot.value,fe);if(lo===null){Oe===null&&(Oe=Kt);break}c&&Oe&&lo.alternate===null&&h(Q,Oe),q=A(lo,q,Ve),Re===null?Te=lo:Re.sibling=lo,Re=lo,Oe=Kt}if(ot.done)return m(Q,Oe),At&&Ts(Q,Ve),Te;if(Oe===null){for(;!ot.done;Ve++,ot=J.next())ot=le(Q,ot.value,fe),ot!==null&&(q=A(ot,q,Ve),Re===null?Te=ot:Re.sibling=ot,Re=ot);return At&&Ts(Q,Ve),Te}for(Oe=w(Q,Oe);!ot.done;Ve++,ot=J.next())ot=me(Oe,Q,Ve,ot.value,fe),ot!==null&&(c&&ot.alternate!==null&&Oe.delete(ot.key===null?Ve:ot.key),q=A(ot,q,Ve),Re===null?Te=ot:Re.sibling=ot,Re=ot);return c&&Oe.forEach(function(mse){return h(Q,mse)}),At&&Ts(Q,Ve),Te}function zt(Q,q,J,fe){if(typeof J=="object"&&J!==null&&J.type===L&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case E:e:{for(var Te=J.key,Re=q;Re!==null;){if(Re.key===Te){if(Te=J.type,Te===L){if(Re.tag===7){m(Q,Re.sibling),q=C(Re,J.props.children),q.return=Q,Q=q;break e}}else if(Re.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===Z&&bO(Te)===Re.type){m(Q,Re.sibling),q=C(Re,J.props),q.ref=Nf(Q,Re,J),q.return=Q,Q=q;break e}m(Q,Re);break}else h(Q,Re);Re=Re.sibling}J.type===L?(q=Ns(J.props.children,Q.mode,fe,J.key),q.return=Q,Q=q):(fe=_g(J.type,J.key,J.props,null,Q.mode,fe),fe.ref=Nf(Q,q,J),fe.return=Q,Q=fe)}return N(Q);case D:e:{for(Re=J.key;q!==null;){if(q.key===Re)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){m(Q,q.sibling),q=C(q,J.children||[]),q.return=Q,Q=q;break e}else{m(Q,q);break}else h(Q,q);q=q.sibling}q=pk(J,Q.mode,fe),q.return=Q,Q=q}return N(Q);case Z:return Re=J._init,zt(Q,q,Re(J._payload),fe)}if(Ei(J))return ke(Q,q,J,fe);if(G(J))return Ce(Q,q,J,fe);Qv(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,q!==null&&q.tag===6?(m(Q,q.sibling),q=C(q,J),q.return=Q,Q=q):(m(Q,q),q=hk(J,Q.mode,fe),q.return=Q,Q=q),N(Q)):m(Q,q)}return zt}var su=wO(!0),_O=wO(!1),Jv=Za(null),eg=null,lu=null,k_=null;function S_(){k_=lu=eg=null}function C_(c){var h=Jv.current;Ct(Jv),c._currentValue=h}function T_(c,h,m){for(;c!==null;){var w=c.alternate;if((c.childLanes&h)!==h?(c.childLanes|=h,w!==null&&(w.childLanes|=h)):w!==null&&(w.childLanes&h)!==h&&(w.childLanes|=h),c===m)break;c=c.return}}function uu(c,h){eg=c,k_=lu=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&h)!==0&&(Wr=!0),c.firstContext=null)}function zn(c){var h=c._currentValue;if(k_!==c)if(c={context:c,memoizedValue:h,next:null},lu===null){if(eg===null)throw Error(r(308));lu=c,eg.dependencies={lanes:0,firstContext:c}}else lu=lu.next=c;return h}var As=null;function A_(c){As===null?As=[c]:As.push(c)}function kO(c,h,m,w){var C=h.interleaved;return C===null?(m.next=m,A_(h)):(m.next=C.next,C.next=m),h.interleaved=m,oa(c,w)}function oa(c,h){c.lanes|=h;var m=c.alternate;for(m!==null&&(m.lanes|=h),m=c,c=c.return;c!==null;)c.childLanes|=h,m=c.alternate,m!==null&&(m.childLanes|=h),m=c,c=c.return;return m.tag===3?m.stateNode:null}var eo=!1;function E_(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function SO(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function sa(c,h){return{eventTime:c,lane:h,tag:0,payload:null,callback:null,next:null}}function to(c,h,m){var w=c.updateQueue;if(w===null)return null;if(w=w.shared,(rt&2)!==0){var C=w.pending;return C===null?h.next=h:(h.next=C.next,C.next=h),w.pending=h,oa(c,m)}return C=w.interleaved,C===null?(h.next=h,A_(w)):(h.next=C.next,C.next=h),w.interleaved=h,oa(c,m)}function tg(c,h,m){if(h=h.updateQueue,h!==null&&(h=h.shared,(m&4194240)!==0)){var w=h.lanes;w&=c.pendingLanes,m|=w,h.lanes=m,Vw(c,m)}}function CO(c,h){var m=c.updateQueue,w=c.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var C=null,A=null;if(m=m.firstBaseUpdate,m!==null){do{var N={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};A===null?C=A=N:A=A.next=N,m=m.next}while(m!==null);A===null?C=A=h:A=A.next=h}else C=A=h;m={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:A,shared:w.shared,effects:w.effects},c.updateQueue=m;return}c=m.lastBaseUpdate,c===null?m.firstBaseUpdate=h:c.next=h,m.lastBaseUpdate=h}function rg(c,h,m,w){var C=c.updateQueue;eo=!1;var A=C.firstBaseUpdate,N=C.lastBaseUpdate,V=C.shared.pending;if(V!==null){C.shared.pending=null;var X=V,te=X.next;X.next=null,N===null?A=te:N.next=te,N=X;var se=c.alternate;se!==null&&(se=se.updateQueue,V=se.lastBaseUpdate,V!==N&&(V===null?se.firstBaseUpdate=te:V.next=te,se.lastBaseUpdate=X))}if(A!==null){var le=C.baseState;N=0,se=te=X=null,V=A;do{var oe=V.lane,me=V.eventTime;if((w&oe)===oe){se!==null&&(se=se.next={eventTime:me,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var ke=c,Ce=V;switch(oe=h,me=m,Ce.tag){case 1:if(ke=Ce.payload,typeof ke=="function"){le=ke.call(me,le,oe);break e}le=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ce.payload,oe=typeof ke=="function"?ke.call(me,le,oe):ke,oe==null)break e;le=I({},le,oe);break e;case 2:eo=!0}}V.callback!==null&&V.lane!==0&&(c.flags|=64,oe=C.effects,oe===null?C.effects=[V]:oe.push(V))}else me={eventTime:me,lane:oe,tag:V.tag,payload:V.payload,callback:V.callback,next:null},se===null?(te=se=me,X=le):se=se.next=me,N|=oe;if(V=V.next,V===null){if(V=C.shared.pending,V===null)break;oe=V,V=oe.next,oe.next=null,C.lastBaseUpdate=oe,C.shared.pending=null}}while(!0);if(se===null&&(X=le),C.baseState=X,C.firstBaseUpdate=te,C.lastBaseUpdate=se,h=C.shared.interleaved,h!==null){C=h;do N|=C.lane,C=C.next;while(C!==h)}else A===null&&(C.shared.lanes=0);Ms|=N,c.lanes=N,c.memoizedState=le}}function TO(c,h,m){if(c=h.effects,h.effects=null,c!==null)for(h=0;h<c.length;h++){var w=c[h],C=w.callback;if(C!==null){if(w.callback=null,w=m,typeof C!="function")throw Error(r(191,C));C.call(w)}}}var Rf={},Li=Za(Rf),Of=Za(Rf),zf=Za(Rf);function Es(c){if(c===Rf)throw Error(r(174));return c}function D_(c,h){switch(wt(zf,h),wt(Of,c),wt(Li,Rf),c=h.nodeType,c){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:ne(null,"");break;default:c=c===8?h.parentNode:h,h=c.namespaceURI||null,c=c.tagName,h=ne(h,c)}Ct(Li),wt(Li,h)}function cu(){Ct(Li),Ct(Of),Ct(zf)}function AO(c){Es(zf.current);var h=Es(Li.current),m=ne(h,c.type);h!==m&&(wt(Of,c),wt(Li,m))}function M_(c){Of.current===c&&(Ct(Li),Ct(Of))}var Dt=Za(0);function ng(c){for(var h=c;h!==null;){if(h.tag===13){var m=h.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var L_=[];function I_(){for(var c=0;c<L_.length;c++)L_[c]._workInProgressVersionPrimary=null;L_.length=0}var ig=T.ReactCurrentDispatcher,P_=T.ReactCurrentBatchConfig,Ds=0,Mt=null,$t=null,Xt=null,ag=!1,Ff=!1,Bf=0,Boe=0;function yr(){throw Error(r(321))}function N_(c,h){if(h===null)return!1;for(var m=0;m<h.length&&m<c.length;m++)if(!ni(c[m],h[m]))return!1;return!0}function R_(c,h,m,w,C,A){if(Ds=A,Mt=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,ig.current=c===null||c.memoizedState===null?Uoe:$oe,c=m(w,C),Ff){A=0;do{if(Ff=!1,Bf=0,25<=A)throw Error(r(301));A+=1,Xt=$t=null,h.updateQueue=null,ig.current=Goe,c=m(w,C)}while(Ff)}if(ig.current=lg,h=$t!==null&&$t.next!==null,Ds=0,Xt=$t=Mt=null,ag=!1,h)throw Error(r(300));return c}function O_(){var c=Bf!==0;return Bf=0,c}function Ii(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Mt.memoizedState=Xt=c:Xt=Xt.next=c,Xt}function Fn(){if($t===null){var c=Mt.alternate;c=c!==null?c.memoizedState:null}else c=$t.next;var h=Xt===null?Mt.memoizedState:Xt.next;if(h!==null)Xt=h,$t=c;else{if(c===null)throw Error(r(310));$t=c,c={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Xt===null?Mt.memoizedState=Xt=c:Xt=Xt.next=c}return Xt}function jf(c,h){return typeof h=="function"?h(c):h}function z_(c){var h=Fn(),m=h.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var w=$t,C=w.baseQueue,A=m.pending;if(A!==null){if(C!==null){var N=C.next;C.next=A.next,A.next=N}w.baseQueue=C=A,m.pending=null}if(C!==null){A=C.next,w=w.baseState;var V=N=null,X=null,te=A;do{var se=te.lane;if((Ds&se)===se)X!==null&&(X=X.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),w=te.hasEagerState?te.eagerState:c(w,te.action);else{var le={lane:se,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};X===null?(V=X=le,N=w):X=X.next=le,Mt.lanes|=se,Ms|=se}te=te.next}while(te!==null&&te!==A);X===null?N=w:X.next=V,ni(w,h.memoizedState)||(Wr=!0),h.memoizedState=w,h.baseState=N,h.baseQueue=X,m.lastRenderedState=w}if(c=m.interleaved,c!==null){C=c;do A=C.lane,Mt.lanes|=A,Ms|=A,C=C.next;while(C!==c)}else C===null&&(m.lanes=0);return[h.memoizedState,m.dispatch]}function F_(c){var h=Fn(),m=h.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var w=m.dispatch,C=m.pending,A=h.memoizedState;if(C!==null){m.pending=null;var N=C=C.next;do A=c(A,N.action),N=N.next;while(N!==C);ni(A,h.memoizedState)||(Wr=!0),h.memoizedState=A,h.baseQueue===null&&(h.baseState=A),m.lastRenderedState=A}return[A,w]}function EO(){}function DO(c,h){var m=Mt,w=Fn(),C=h(),A=!ni(w.memoizedState,C);if(A&&(w.memoizedState=C,Wr=!0),w=w.queue,B_(IO.bind(null,m,w,c),[c]),w.getSnapshot!==h||A||Xt!==null&&Xt.memoizedState.tag&1){if(m.flags|=2048,Hf(9,LO.bind(null,m,w,C,h),void 0,null),qt===null)throw Error(r(349));(Ds&30)!==0||MO(m,h,C)}return C}function MO(c,h,m){c.flags|=16384,c={getSnapshot:h,value:m},h=Mt.updateQueue,h===null?(h={lastEffect:null,stores:null},Mt.updateQueue=h,h.stores=[c]):(m=h.stores,m===null?h.stores=[c]:m.push(c))}function LO(c,h,m,w){h.value=m,h.getSnapshot=w,PO(h)&&NO(c)}function IO(c,h,m){return m(function(){PO(h)&&NO(c)})}function PO(c){var h=c.getSnapshot;c=c.value;try{var m=h();return!ni(c,m)}catch{return!0}}function NO(c){var h=oa(c,1);h!==null&&li(h,c,1,-1)}function RO(c){var h=Ii();return typeof c=="function"&&(c=c()),h.memoizedState=h.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jf,lastRenderedState:c},h.queue=c,c=c.dispatch=Voe.bind(null,Mt,c),[h.memoizedState,c]}function Hf(c,h,m,w){return c={tag:c,create:h,destroy:m,deps:w,next:null},h=Mt.updateQueue,h===null?(h={lastEffect:null,stores:null},Mt.updateQueue=h,h.lastEffect=c.next=c):(m=h.lastEffect,m===null?h.lastEffect=c.next=c:(w=m.next,m.next=c,c.next=w,h.lastEffect=c)),c}function OO(){return Fn().memoizedState}function og(c,h,m,w){var C=Ii();Mt.flags|=c,C.memoizedState=Hf(1|h,m,void 0,w===void 0?null:w)}function sg(c,h,m,w){var C=Fn();w=w===void 0?null:w;var A=void 0;if($t!==null){var N=$t.memoizedState;if(A=N.destroy,w!==null&&N_(w,N.deps)){C.memoizedState=Hf(h,m,A,w);return}}Mt.flags|=c,C.memoizedState=Hf(1|h,m,A,w)}function zO(c,h){return og(8390656,8,c,h)}function B_(c,h){return sg(2048,8,c,h)}function FO(c,h){return sg(4,2,c,h)}function BO(c,h){return sg(4,4,c,h)}function jO(c,h){if(typeof h=="function")return c=c(),h(c),function(){h(null)};if(h!=null)return c=c(),h.current=c,function(){h.current=null}}function HO(c,h,m){return m=m!=null?m.concat([c]):null,sg(4,4,jO.bind(null,h,c),m)}function j_(){}function VO(c,h){var m=Fn();h=h===void 0?null:h;var w=m.memoizedState;return w!==null&&h!==null&&N_(h,w[1])?w[0]:(m.memoizedState=[c,h],c)}function UO(c,h){var m=Fn();h=h===void 0?null:h;var w=m.memoizedState;return w!==null&&h!==null&&N_(h,w[1])?w[0]:(c=c(),m.memoizedState=[c,h],c)}function $O(c,h,m){return(Ds&21)===0?(c.baseState&&(c.baseState=!1,Wr=!0),c.memoizedState=m):(ni(m,h)||(m=b5(),Mt.lanes|=m,Ms|=m,c.baseState=!0),h)}function joe(c,h){var m=ht;ht=m!==0&&4>m?m:4,c(!0);var w=P_.transition;P_.transition={};try{c(!1),h()}finally{ht=m,P_.transition=w}}function GO(){return Fn().memoizedState}function Hoe(c,h,m){var w=ao(c);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},WO(c))YO(h,m);else if(m=kO(c,h,m,w),m!==null){var C=Lr();li(m,c,w,C),XO(m,h,w)}}function Voe(c,h,m){var w=ao(c),C={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(WO(c))YO(h,C);else{var A=c.alternate;if(c.lanes===0&&(A===null||A.lanes===0)&&(A=h.lastRenderedReducer,A!==null))try{var N=h.lastRenderedState,V=A(N,m);if(C.hasEagerState=!0,C.eagerState=V,ni(V,N)){var X=h.interleaved;X===null?(C.next=C,A_(h)):(C.next=X.next,X.next=C),h.interleaved=C;return}}catch{}m=kO(c,h,C,w),m!==null&&(C=Lr(),li(m,c,w,C),XO(m,h,w))}}function WO(c){var h=c.alternate;return c===Mt||h!==null&&h===Mt}function YO(c,h){Ff=ag=!0;var m=c.pending;m===null?h.next=h:(h.next=m.next,m.next=h),c.pending=h}function XO(c,h,m){if((m&4194240)!==0){var w=h.lanes;w&=c.pendingLanes,m|=w,h.lanes=m,Vw(c,m)}}var lg={readContext:zn,useCallback:yr,useContext:yr,useEffect:yr,useImperativeHandle:yr,useInsertionEffect:yr,useLayoutEffect:yr,useMemo:yr,useReducer:yr,useRef:yr,useState:yr,useDebugValue:yr,useDeferredValue:yr,useTransition:yr,useMutableSource:yr,useSyncExternalStore:yr,useId:yr,unstable_isNewReconciler:!1},Uoe={readContext:zn,useCallback:function(c,h){return Ii().memoizedState=[c,h===void 0?null:h],c},useContext:zn,useEffect:zO,useImperativeHandle:function(c,h,m){return m=m!=null?m.concat([c]):null,og(4194308,4,jO.bind(null,h,c),m)},useLayoutEffect:function(c,h){return og(4194308,4,c,h)},useInsertionEffect:function(c,h){return og(4,2,c,h)},useMemo:function(c,h){var m=Ii();return h=h===void 0?null:h,c=c(),m.memoizedState=[c,h],c},useReducer:function(c,h,m){var w=Ii();return h=m!==void 0?m(h):h,w.memoizedState=w.baseState=h,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:h},w.queue=c,c=c.dispatch=Hoe.bind(null,Mt,c),[w.memoizedState,c]},useRef:function(c){var h=Ii();return c={current:c},h.memoizedState=c},useState:RO,useDebugValue:j_,useDeferredValue:function(c){return Ii().memoizedState=c},useTransition:function(){var c=RO(!1),h=c[0];return c=joe.bind(null,c[1]),Ii().memoizedState=c,[h,c]},useMutableSource:function(){},useSyncExternalStore:function(c,h,m){var w=Mt,C=Ii();if(At){if(m===void 0)throw Error(r(407));m=m()}else{if(m=h(),qt===null)throw Error(r(349));(Ds&30)!==0||MO(w,h,m)}C.memoizedState=m;var A={value:m,getSnapshot:h};return C.queue=A,zO(IO.bind(null,w,A,c),[c]),w.flags|=2048,Hf(9,LO.bind(null,w,A,m,h),void 0,null),m},useId:function(){var c=Ii(),h=qt.identifierPrefix;if(At){var m=aa,w=ia;m=(w&~(1<<32-ri(w)-1)).toString(32)+m,h=":"+h+"R"+m,m=Bf++,0<m&&(h+="H"+m.toString(32)),h+=":"}else m=Boe++,h=":"+h+"r"+m.toString(32)+":";return c.memoizedState=h},unstable_isNewReconciler:!1},$oe={readContext:zn,useCallback:VO,useContext:zn,useEffect:B_,useImperativeHandle:HO,useInsertionEffect:FO,useLayoutEffect:BO,useMemo:UO,useReducer:z_,useRef:OO,useState:function(){return z_(jf)},useDebugValue:j_,useDeferredValue:function(c){var h=Fn();return $O(h,$t.memoizedState,c)},useTransition:function(){var c=z_(jf)[0],h=Fn().memoizedState;return[c,h]},useMutableSource:EO,useSyncExternalStore:DO,useId:GO,unstable_isNewReconciler:!1},Goe={readContext:zn,useCallback:VO,useContext:zn,useEffect:B_,useImperativeHandle:HO,useInsertionEffect:FO,useLayoutEffect:BO,useMemo:UO,useReducer:F_,useRef:OO,useState:function(){return F_(jf)},useDebugValue:j_,useDeferredValue:function(c){var h=Fn();return $t===null?h.memoizedState=c:$O(h,$t.memoizedState,c)},useTransition:function(){var c=F_(jf)[0],h=Fn().memoizedState;return[c,h]},useMutableSource:EO,useSyncExternalStore:DO,useId:GO,unstable_isNewReconciler:!1};function ai(c,h){if(c&&c.defaultProps){h=I({},h),c=c.defaultProps;for(var m in c)h[m]===void 0&&(h[m]=c[m]);return h}return h}function H_(c,h,m,w){h=c.memoizedState,m=m(w,h),m=m==null?h:I({},h,m),c.memoizedState=m,c.lanes===0&&(c.updateQueue.baseState=m)}var ug={isMounted:function(c){return(c=c._reactInternals)?_s(c)===c:!1},enqueueSetState:function(c,h,m){c=c._reactInternals;var w=Lr(),C=ao(c),A=sa(w,C);A.payload=h,m!=null&&(A.callback=m),h=to(c,A,C),h!==null&&(li(h,c,C,w),tg(h,c,C))},enqueueReplaceState:function(c,h,m){c=c._reactInternals;var w=Lr(),C=ao(c),A=sa(w,C);A.tag=1,A.payload=h,m!=null&&(A.callback=m),h=to(c,A,C),h!==null&&(li(h,c,C,w),tg(h,c,C))},enqueueForceUpdate:function(c,h){c=c._reactInternals;var m=Lr(),w=ao(c),C=sa(m,w);C.tag=2,h!=null&&(C.callback=h),h=to(c,C,w),h!==null&&(li(h,c,w,m),tg(h,c,w))}};function qO(c,h,m,w,C,A,N){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(w,A,N):h.prototype&&h.prototype.isPureReactComponent?!Af(m,w)||!Af(C,A):!0}function KO(c,h,m){var w=!1,C=Qa,A=h.contextType;return typeof A=="object"&&A!==null?A=zn(A):(C=Gr(h)?Ss:mr.current,w=h.contextTypes,A=(w=w!=null)?nu(c,C):Qa),h=new h(m,A),c.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=ug,c.stateNode=h,h._reactInternals=c,w&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=C,c.__reactInternalMemoizedMaskedChildContext=A),h}function ZO(c,h,m,w){c=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(m,w),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(m,w),h.state!==c&&ug.enqueueReplaceState(h,h.state,null)}function V_(c,h,m,w){var C=c.stateNode;C.props=m,C.state=c.memoizedState,C.refs={},E_(c);var A=h.contextType;typeof A=="object"&&A!==null?C.context=zn(A):(A=Gr(h)?Ss:mr.current,C.context=nu(c,A)),C.state=c.memoizedState,A=h.getDerivedStateFromProps,typeof A=="function"&&(H_(c,h,A,m),C.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(h=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),h!==C.state&&ug.enqueueReplaceState(C,C.state,null),rg(c,m,C,w),C.state=c.memoizedState),typeof C.componentDidMount=="function"&&(c.flags|=4194308)}function fu(c,h){try{var m="",w=h;do m+=ae(w),w=w.return;while(w);var C=m}catch(A){C=`
|
|
7
7
|
Error generating stack: `+A.message+`
|
|
8
|
-
`+A.stack}return{value:c,source:h,stack:C,digest:null}}function U_(c,h,m){return{value:c,source:null,stack:m??null,digest:h??null}}function $_(c,h){try{console.error(h.value)}catch(m){setTimeout(function(){throw m})}}var Woe=typeof WeakMap=="function"?WeakMap:Map;function QO(c,h,m){m=sa(-1,m),m.tag=3,m.payload={element:null};var w=h.value;return m.callback=function(){gg||(gg=!0,ak=w),$_(c,h)},m}function JO(c,h,m){m=sa(-1,m),m.tag=3;var w=c.type.getDerivedStateFromError;if(typeof w=="function"){var C=h.value;m.payload=function(){return w(C)},m.callback=function(){$_(c,h)}}var A=c.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(m.callback=function(){$_(c,h),typeof w!="function"&&(no===null?no=new Set([this]):no.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})}),m}function e3(c,h,m){var w=c.pingCache;if(w===null){w=c.pingCache=new Woe;var C=new Set;w.set(h,C)}else C=w.get(h),C===void 0&&(C=new Set,w.set(h,C));C.has(m)||(C.add(m),c=ose.bind(null,c,h,m),h.then(c,c))}function t3(c){do{var h;if((h=c.tag===13)&&(h=c.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return c;c=c.return}while(c!==null);return null}function r3(c,h,m,w,C){return(c.mode&1)===0?(c===h?c.flags|=65536:(c.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(h=sa(-1,1),h.tag=2,to(m,h,1))),m.lanes|=1),c):(c.flags|=65536,c.lanes=C,c)}var Yoe=T.ReactCurrentOwner,Wr=!1;function Mr(c,h,m,w){h.child=c===null?_O(h,null,m,w):su(h,c.child,m,w)}function n3(c,h,m,w,C){m=m.render;var A=h.ref;return uu(h,C),w=R_(c,h,m,w,A,C),m=O_(),c!==null&&!Wr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,la(c,h,C)):(At&&m&&y_(h),h.flags|=1,Mr(c,h,w,C),h.child)}function i3(c,h,m,w,C){if(c===null){var A=m.type;return typeof A=="function"&&!dk(A)&&A.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(h.tag=15,h.type=A,a3(c,h,A,w,C)):(c=_g(m.type,null,w,h,h.mode,C),c.ref=h.ref,c.return=h,h.child=c)}if(A=c.child,(c.lanes&C)===0){var N=A.memoizedProps;if(m=m.compare,m=m!==null?m:Af,m(N,w)&&c.ref===h.ref)return la(c,h,C)}return h.flags|=1,c=so(A,w),c.ref=h.ref,c.return=h,h.child=c}function a3(c,h,m,w,C){if(c!==null){var A=c.memoizedProps;if(Af(A,w)&&c.ref===h.ref)if(Wr=!1,h.pendingProps=w=A,(c.lanes&C)!==0)(c.flags&131072)!==0&&(Wr=!0);else return h.lanes=c.lanes,la(c,h,C)}return G_(c,h,m,w,C)}function o3(c,h,m){var w=h.pendingProps,C=w.children,A=c!==null?c.memoizedState:null;if(w.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(hu,fn),fn|=m;else{if((m&1073741824)===0)return c=A!==null?A.baseLanes|m:m,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null,transitions:null},h.updateQueue=null,wt(hu,fn),fn|=c,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=A!==null?A.baseLanes:m,wt(hu,fn),fn|=w}else A!==null?(w=A.baseLanes|m,h.memoizedState=null):w=m,wt(hu,fn),fn|=w;return Mr(c,h,C,m),h.child}function s3(c,h){var m=h.ref;(c===null&&m!==null||c!==null&&c.ref!==m)&&(h.flags|=512,h.flags|=2097152)}function G_(c,h,m,w,C){var A=Gr(m)?Ss:mr.current;return A=nu(h,A),uu(h,C),m=R_(c,h,m,w,A,C),w=O_(),c!==null&&!Wr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,la(c,h,C)):(At&&w&&y_(h),h.flags|=1,Mr(c,h,m,C),h.child)}function l3(c,h,m,w,C){if(Gr(m)){var A=!0;Yv(h)}else A=!1;if(uu(h,C),h.stateNode===null)fg(c,h),KO(h,m,w),V_(h,m,w,C),w=!0;else if(c===null){var N=h.stateNode,V=h.memoizedProps;N.props=V;var X=N.context,te=m.contextType;typeof te=="object"&&te!==null?te=zn(te):(te=Gr(m)?Ss:mr.current,te=nu(h,te));var se=m.getDerivedStateFromProps,le=typeof se=="function"||typeof N.getSnapshotBeforeUpdate=="function";le||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(V!==w||X!==te)&&ZO(h,N,w,te),eo=!1;var oe=h.memoizedState;N.state=oe,rg(h,w,N,C),X=h.memoizedState,V!==w||oe!==X||$r.current||eo?(typeof se=="function"&&(H_(h,m,se,w),X=h.memoizedState),(V=eo||qO(h,m,V,w,oe,X,te))?(le||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(h.flags|=4194308)):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=w,h.memoizedState=X),N.props=w,N.state=X,N.context=te,w=V):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),w=!1)}else{N=h.stateNode,SO(c,h),V=h.memoizedProps,te=h.type===h.elementType?V:ai(h.type,V),N.props=te,le=h.pendingProps,oe=N.context,X=m.contextType,typeof X=="object"&&X!==null?X=zn(X):(X=Gr(m)?Ss:mr.current,X=nu(h,X));var me=m.getDerivedStateFromProps;(se=typeof me=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(V!==le||oe!==X)&&ZO(h,N,w,X),eo=!1,oe=h.memoizedState,N.state=oe,rg(h,w,N,C);var ke=h.memoizedState;V!==le||oe!==ke||$r.current||eo?(typeof me=="function"&&(H_(h,m,me,w),ke=h.memoizedState),(te=eo||qO(h,m,te,w,oe,ke,X)||!1)?(se||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,ke,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,ke,X)),typeof N.componentDidUpdate=="function"&&(h.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof N.componentDidUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=1024),h.memoizedProps=w,h.memoizedState=ke),N.props=w,N.state=ke,N.context=X,w=te):(typeof N.componentDidUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=1024),w=!1)}return W_(c,h,m,w,A,C)}function W_(c,h,m,w,C,A){s3(c,h);var N=(h.flags&128)!==0;if(!w&&!N)return C&&hO(h,m,!1),la(c,h,A);w=h.stateNode,Yoe.current=h;var V=N&&typeof m.getDerivedStateFromError!="function"?null:w.render();return h.flags|=1,c!==null&&N?(h.child=su(h,c.child,null,A),h.child=su(h,null,V,A)):Mr(c,h,V,A),h.memoizedState=w.state,C&&hO(h,m,!0),h.child}function u3(c){var h=c.stateNode;h.pendingContext?fO(c,h.pendingContext,h.pendingContext!==h.context):h.context&&fO(c,h.context,!1),D_(c,h.containerInfo)}function c3(c,h,m,w,C){return ou(),__(C),h.flags|=256,Mr(c,h,m,w),h.child}var Y_={dehydrated:null,treeContext:null,retryLane:0};function X_(c){return{baseLanes:c,cachePool:null,transitions:null}}function f3(c,h,m){var w=h.pendingProps,C=Dt.current,A=!1,N=(h.flags&128)!==0,V;if((V=N)||(V=c!==null&&c.memoizedState===null?!1:(C&2)!==0),V?(A=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(C|=1),wt(Dt,C&1),c===null)return w_(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((h.mode&1)===0?h.lanes=1:c.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(N=w.children,c=w.fallback,A?(w=h.mode,A=h.child,N={mode:"hidden",children:N},(w&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=N):A=kg(N,w,0,null),c=Ns(c,w,m,null),A.return=h,c.return=h,A.sibling=c,h.child=A,h.child.memoizedState=X_(m),h.memoizedState=Y_,c):q_(h,N));if(C=c.memoizedState,C!==null&&(V=C.dehydrated,V!==null))return Xoe(c,h,N,w,V,C,m);if(A){A=w.fallback,N=h.mode,C=c.child,V=C.sibling;var X={mode:"hidden",children:w.children};return(N&1)===0&&h.child!==C?(w=h.child,w.childLanes=0,w.pendingProps=X,h.deletions=null):(w=so(C,X),w.subtreeFlags=C.subtreeFlags&14680064),V!==null?A=so(V,A):(A=Ns(A,N,m,null),A.flags|=2),A.return=h,w.return=h,w.sibling=A,h.child=w,w=A,A=h.child,N=c.child.memoizedState,N=N===null?X_(m):{baseLanes:N.baseLanes|m,cachePool:null,transitions:N.transitions},A.memoizedState=N,A.childLanes=c.childLanes&~m,h.memoizedState=Y_,w}return A=c.child,c=A.sibling,w=so(A,{mode:"visible",children:w.children}),(h.mode&1)===0&&(w.lanes=m),w.return=h,w.sibling=null,c!==null&&(m=h.deletions,m===null?(h.deletions=[c],h.flags|=16):m.push(c)),h.child=w,h.memoizedState=null,w}function q_(c,h){return h=kg({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function cg(c,h,m,w){return w!==null&&__(w),su(h,c.child,null,m),c=q_(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function Xoe(c,h,m,w,C,A,N){if(m)return h.flags&256?(h.flags&=-257,w=U_(Error(r(422))),cg(c,h,N,w)):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(A=w.fallback,C=h.mode,w=kg({mode:"visible",children:w.children},C,0,null),A=Ns(A,C,N,null),A.flags|=2,w.return=h,A.return=h,w.sibling=A,h.child=w,(h.mode&1)!==0&&su(h,c.child,null,N),h.child.memoizedState=X_(N),h.memoizedState=Y_,A);if((h.mode&1)===0)return cg(c,h,N,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var V=w.dgst;return w=V,A=Error(r(419)),w=U_(A,w,void 0),cg(c,h,N,w)}if(V=(N&c.childLanes)!==0,Wr||V){if(w=qt,w!==null){switch(N&-N){case 4:C=2;break;case 16:C=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(w.suspendedLanes|N))!==0?0:C,C!==0&&C!==A.retryLane&&(A.retryLane=C,oa(c,C),li(w,c,C,-1))}return fk(),w=U_(Error(r(421))),cg(c,h,N,w)}return C.data==="$?"?(h.flags|=128,h.child=c.child,h=sse.bind(null,c),C._reactRetry=h,null):(c=A.treeContext,cn=Ka(C.nextSibling),un=h,At=!0,ii=null,c!==null&&(Rn[On++]=ia,Rn[On++]=aa,Rn[On++]=Cs,ia=c.id,aa=c.overflow,Cs=h),h=q_(h,w.children),h.flags|=4096,h)}function d3(c,h,m){c.lanes|=h;var w=c.alternate;w!==null&&(w.lanes|=h),T_(c.return,h,m)}function K_(c,h,m,w,C){var A=c.memoizedState;A===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:C}:(A.isBackwards=h,A.rendering=null,A.renderingStartTime=0,A.last=w,A.tail=m,A.tailMode=C)}function h3(c,h,m){var w=h.pendingProps,C=w.revealOrder,A=w.tail;if(Mr(c,h,w.children,m),w=Dt.current,(w&2)!==0)w=w&1|2,h.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&d3(c,m,h);else if(c.tag===19)d3(c,m,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}w&=1}if(wt(Dt,w),(h.mode&1)===0)h.memoizedState=null;else switch(C){case"forwards":for(m=h.child,C=null;m!==null;)c=m.alternate,c!==null&&ng(c)===null&&(C=m),m=m.sibling;m=C,m===null?(C=h.child,h.child=null):(C=m.sibling,m.sibling=null),K_(h,!1,C,m,A);break;case"backwards":for(m=null,C=h.child,h.child=null;C!==null;){if(c=C.alternate,c!==null&&ng(c)===null){h.child=C;break}c=C.sibling,C.sibling=m,m=C,C=c}K_(h,!0,m,null,A);break;case"together":K_(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function fg(c,h){(h.mode&1)===0&&c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2)}function la(c,h,m){if(c!==null&&(h.dependencies=c.dependencies),Ms|=h.lanes,(m&h.childLanes)===0)return null;if(c!==null&&h.child!==c.child)throw Error(r(153));if(h.child!==null){for(c=h.child,m=so(c,c.pendingProps),h.child=m,m.return=h;c.sibling!==null;)c=c.sibling,m=m.sibling=so(c,c.pendingProps),m.return=h;m.sibling=null}return h.child}function qoe(c,h,m){switch(h.tag){case 3:u3(h),ou();break;case 5:AO(h);break;case 1:Gr(h.type)&&Yv(h);break;case 4:D_(h,h.stateNode.containerInfo);break;case 10:var w=h.type._context,C=h.memoizedProps.value;wt(Jv,w._currentValue),w._currentValue=C;break;case 13:if(w=h.memoizedState,w!==null)return w.dehydrated!==null?(wt(Dt,Dt.current&1),h.flags|=128,null):(m&h.child.childLanes)!==0?f3(c,h,m):(wt(Dt,Dt.current&1),c=la(c,h,m),c!==null?c.sibling:null);wt(Dt,Dt.current&1);break;case 19:if(w=(m&h.childLanes)!==0,(c.flags&128)!==0){if(w)return h3(c,h,m);h.flags|=128}if(C=h.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),wt(Dt,Dt.current),w)break;return null;case 22:case 23:return h.lanes=0,o3(c,h,m)}return la(c,h,m)}var p3,Z_,v3,g3;p3=function(c,h){for(var m=h.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===h)break;for(;m.sibling===null;){if(m.return===null||m.return===h)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Z_=function(){},v3=function(c,h,m,w){var C=c.memoizedProps;if(C!==w){c=h.stateNode,Es(Li.current);var A=null;switch(m){case"input":C=Tt(c,C),w=Tt(c,w),A=[];break;case"select":C=I({},C,{value:void 0}),w=I({},w,{value:void 0}),A=[];break;case"textarea":C=Ji(c,C),w=Ji(c,w),A=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(c.onclick=$v)}ea(m,w);var N;m=null;for(te in C)if(!w.hasOwnProperty(te)&&C.hasOwnProperty(te)&&C[te]!=null)if(te==="style"){var V=C[te];for(N in V)V.hasOwnProperty(N)&&(m||(m={}),m[N]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(i.hasOwnProperty(te)?A||(A=[]):(A=A||[]).push(te,null));for(te in w){var X=w[te];if(V=C?.[te],w.hasOwnProperty(te)&&X!==V&&(X!=null||V!=null))if(te==="style")if(V){for(N in V)!V.hasOwnProperty(N)||X&&X.hasOwnProperty(N)||(m||(m={}),m[N]="");for(N in X)X.hasOwnProperty(N)&&V[N]!==X[N]&&(m||(m={}),m[N]=X[N])}else m||(A||(A=[]),A.push(te,m)),m=X;else te==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,V=V?V.__html:void 0,X!=null&&V!==X&&(A=A||[]).push(te,X)):te==="children"?typeof X!="string"&&typeof X!="number"||(A=A||[]).push(te,""+X):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(i.hasOwnProperty(te)?(X!=null&&te==="onScroll"&&St("scroll",c),A||V===X||(A=[])):(A=A||[]).push(te,X))}m&&(A=A||[]).push("style",m);var te=A;(h.updateQueue=te)&&(h.flags|=4)}},g3=function(c,h,m,w){m!==w&&(h.flags|=4)};function Vf(c,h){if(!At)switch(c.tailMode){case"hidden":h=c.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?h||c.tail===null?c.tail=null:c.tail.sibling=null:w.sibling=null}}function xr(c){var h=c.alternate!==null&&c.alternate.child===c.child,m=0,w=0;if(h)for(var C=c.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=w,c.childLanes=m,h}function Koe(c,h,m){var w=h.pendingProps;switch(x_(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(h),null;case 1:return Gr(h.type)&&Wv(),xr(h),null;case 3:return w=h.stateNode,cu(),Ct($r),Ct(mr),I_(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(c===null||c.child===null)&&(Zv(h)?h.flags|=4:c===null||c.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,ii!==null&&(lk(ii),ii=null))),Z_(c,h),xr(h),null;case 5:M_(h);var C=Es(zf.current);if(m=h.type,c!==null&&h.stateNode!=null)v3(c,h,m,w,C),c.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!w){if(h.stateNode===null)throw Error(r(166));return xr(h),null}if(c=Es(Li.current),Zv(h)){w=h.stateNode,m=h.type;var A=h.memoizedProps;switch(w[Mi]=h,w[If]=A,c=(h.mode&1)!==0,m){case"dialog":St("cancel",w),St("close",w);break;case"iframe":case"object":case"embed":St("load",w);break;case"video":case"audio":for(C=0;C<Df.length;C++)St(Df[C],w);break;case"source":St("error",w);break;case"img":case"image":case"link":St("error",w),St("load",w);break;case"details":St("toggle",w);break;case"input":nn(w,A),St("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!A.multiple},St("invalid",w);break;case"textarea":xv(w,A),St("invalid",w)}ea(m,A),C=null;for(var N in A)if(A.hasOwnProperty(N)){var V=A[N];N==="children"?typeof V=="string"?w.textContent!==V&&(A.suppressHydrationWarning!==!0&&Uv(w.textContent,V,c),C=["children",V]):typeof V=="number"&&w.textContent!==""+V&&(A.suppressHydrationWarning!==!0&&Uv(w.textContent,V,c),C=["children",""+V]):i.hasOwnProperty(N)&&V!=null&&N==="onScroll"&&St("scroll",w)}switch(m){case"input":Le(w),xs(w,A,!0);break;case"textarea":Le(w),wv(w);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(w.onclick=$v)}w=C,h.updateQueue=w,w!==null&&(h.flags|=4)}else{N=C.nodeType===9?C:C.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=_v(m)),c==="http://www.w3.org/1999/xhtml"?m==="script"?(c=N.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof w.is=="string"?c=N.createElement(m,{is:w.is}):(c=N.createElement(m),m==="select"&&(N=c,w.multiple?N.multiple=!0:w.size&&(N.size=w.size))):c=N.createElementNS(c,m),c[Mi]=h,c[If]=w,p3(c,h,!1,!1),h.stateNode=c;e:{switch(N=ta(m,w),m){case"dialog":St("cancel",c),St("close",c),C=w;break;case"iframe":case"object":case"embed":St("load",c),C=w;break;case"video":case"audio":for(C=0;C<Df.length;C++)St(Df[C],c);C=w;break;case"source":St("error",c),C=w;break;case"img":case"image":case"link":St("error",c),St("load",c),C=w;break;case"details":St("toggle",c),C=w;break;case"input":nn(c,w),C=Tt(c,w),St("invalid",c);break;case"option":C=w;break;case"select":c._wrapperState={wasMultiple:!!w.multiple},C=I({},w,{value:void 0}),St("invalid",c);break;case"textarea":xv(c,w),C=Ji(c,w),St("invalid",c);break;default:C=w}ea(m,C),V=C;for(A in V)if(V.hasOwnProperty(A)){var X=V[A];A==="style"?on(c,X):A==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&He(c,X)):A==="children"?typeof X=="string"?(m!=="textarea"||X!=="")&&Ue(c,X):typeof X=="number"&&Ue(c,""+X):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(i.hasOwnProperty(A)?X!=null&&A==="onScroll"&&St("scroll",c):X!=null&&S(c,A,X,N))}switch(m){case"input":Le(c),xs(c,w,!1);break;case"textarea":Le(c),wv(c);break;case"option":w.value!=null&&c.setAttribute("value",""+be(w.value));break;case"select":c.multiple=!!w.multiple,A=w.value,A!=null?an(c,!!w.multiple,A,!1):w.defaultValue!=null&&an(c,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(c.onclick=$v)}switch(m){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return xr(h),null;case 6:if(c&&h.stateNode!=null)g3(c,h,c.memoizedProps,w);else{if(typeof w!="string"&&h.stateNode===null)throw Error(r(166));if(m=Es(zf.current),Es(Li.current),Zv(h)){if(w=h.stateNode,m=h.memoizedProps,w[Mi]=h,(A=w.nodeValue!==m)&&(c=un,c!==null))switch(c.tag){case 3:Uv(w.nodeValue,m,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Uv(w.nodeValue,m,(c.mode&1)!==0)}A&&(h.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[Mi]=h,h.stateNode=w}return xr(h),null;case 13:if(Ct(Dt),w=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(At&&cn!==null&&(h.mode&1)!==0&&(h.flags&128)===0)xO(),ou(),h.flags|=98560,A=!1;else if(A=Zv(h),w!==null&&w.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[Mi]=h}else ou(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;xr(h),A=!1}else ii!==null&&(lk(ii),ii=null),A=!0;if(!A)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=m,h):(w=w!==null,w!==(c!==null&&c.memoizedState!==null)&&w&&(h.child.flags|=8192,(h.mode&1)!==0&&(c===null||(Dt.current&1)!==0?Gt===0&&(Gt=3):fk())),h.updateQueue!==null&&(h.flags|=4),xr(h),null);case 4:return cu(),Z_(c,h),c===null&&Mf(h.stateNode.containerInfo),xr(h),null;case 10:return C_(h.type._context),xr(h),null;case 17:return Gr(h.type)&&Wv(),xr(h),null;case 19:if(Ct(Dt),A=h.memoizedState,A===null)return xr(h),null;if(w=(h.flags&128)!==0,N=A.rendering,N===null)if(w)Vf(A,!1);else{if(Gt!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(N=ng(c),N!==null){for(h.flags|=128,Vf(A,!1),w=N.updateQueue,w!==null&&(h.updateQueue=w,h.flags|=4),h.subtreeFlags=0,w=m,m=h.child;m!==null;)A=m,c=w,A.flags&=14680066,N=A.alternate,N===null?(A.childLanes=0,A.lanes=c,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=N.childLanes,A.lanes=N.lanes,A.child=N.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=N.memoizedProps,A.memoizedState=N.memoizedState,A.updateQueue=N.updateQueue,A.type=N.type,c=N.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),m=m.sibling;return wt(Dt,Dt.current&1|2),h.child}c=c.sibling}A.tail!==null&&Ot()>pu&&(h.flags|=128,w=!0,Vf(A,!1),h.lanes=4194304)}else{if(!w)if(c=ng(N),c!==null){if(h.flags|=128,w=!0,m=c.updateQueue,m!==null&&(h.updateQueue=m,h.flags|=4),Vf(A,!0),A.tail===null&&A.tailMode==="hidden"&&!N.alternate&&!At)return xr(h),null}else 2*Ot()-A.renderingStartTime>pu&&m!==1073741824&&(h.flags|=128,w=!0,Vf(A,!1),h.lanes=4194304);A.isBackwards?(N.sibling=h.child,h.child=N):(m=A.last,m!==null?m.sibling=N:h.child=N,A.last=N)}return A.tail!==null?(h=A.tail,A.rendering=h,A.tail=h.sibling,A.renderingStartTime=Ot(),h.sibling=null,m=Dt.current,wt(Dt,w?m&1|2:m&1),h):(xr(h),null);case 22:case 23:return ck(),w=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==w&&(h.flags|=8192),w&&(h.mode&1)!==0?(fn&1073741824)!==0&&(xr(h),h.subtreeFlags&6&&(h.flags|=8192)):xr(h),null;case 24:return null;case 25:return null}throw Error(r(156,h.tag))}function Zoe(c,h){switch(x_(h),h.tag){case 1:return Gr(h.type)&&Wv(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return cu(),Ct($r),Ct(mr),I_(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 5:return M_(h),null;case 13:if(Ct(Dt),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));ou()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return Ct(Dt),null;case 4:return cu(),null;case 10:return C_(h.type._context),null;case 22:case 23:return ck(),null;case 24:return null;default:return null}}var dg=!1,br=!1,Qoe=typeof WeakSet=="function"?WeakSet:Set,we=null;function du(c,h){var m=c.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Pt(c,h,w)}else m.current=null}function Q_(c,h,m){try{m()}catch(w){Pt(c,h,w)}}var m3=!1;function Joe(c,h){if(c_=Iv,c=q5(),r_(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var C=w.anchorOffset,A=w.focusNode;w=w.focusOffset;try{m.nodeType,A.nodeType}catch{m=null;break e}var N=0,V=-1,X=-1,te=0,se=0,le=c,oe=null;t:for(;;){for(var me;le!==m||C!==0&&le.nodeType!==3||(V=N+C),le!==A||w!==0&&le.nodeType!==3||(X=N+w),le.nodeType===3&&(N+=le.nodeValue.length),(me=le.firstChild)!==null;)oe=le,le=me;for(;;){if(le===c)break t;if(oe===m&&++te===C&&(V=N),oe===A&&++se===w&&(X=N),(me=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=me}m=V===-1||X===-1?null:{start:V,end:X}}else m=null}m=m||{start:0,end:0}}else m=null;for(f_={focusedElem:c,selectionRange:m},Iv=!1,we=h;we!==null;)if(h=we,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,we=c;else for(;we!==null;){h=we;try{var ke=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var Ce=ke.memoizedProps,zt=ke.memoizedState,Q=h.stateNode,q=Q.getSnapshotBeforeUpdate(h.elementType===h.type?Ce:ai(h.type,Ce),zt);Q.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var J=h.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(fe){Pt(h,h.return,fe)}if(c=h.sibling,c!==null){c.return=h.return,we=c;break}we=h.return}return ke=m3,m3=!1,ke}function Uf(c,h,m){var w=h.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&c)===c){var A=C.destroy;C.destroy=void 0,A!==void 0&&Q_(h,m,A)}C=C.next}while(C!==w)}}function hg(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&c)===c){var w=m.create;m.destroy=w()}m=m.next}while(m!==h)}}function J_(c){var h=c.ref;if(h!==null){var m=c.stateNode;c.tag,c=m,typeof h=="function"?h(c):h.current=c}}function y3(c){var h=c.alternate;h!==null&&(c.alternate=null,y3(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&(delete h[Mi],delete h[If],delete h[v_],delete h[Roe],delete h[Ooe])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function x3(c){return c.tag===5||c.tag===3||c.tag===4}function b3(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||x3(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function ek(c,h,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,h?m.nodeType===8?m.parentNode.insertBefore(c,h):m.insertBefore(c,h):(m.nodeType===8?(h=m.parentNode,h.insertBefore(c,m)):(h=m,h.appendChild(c)),m=m._reactRootContainer,m!=null||h.onclick!==null||(h.onclick=$v));else if(w!==4&&(c=c.child,c!==null))for(ek(c,h,m),c=c.sibling;c!==null;)ek(c,h,m),c=c.sibling}function tk(c,h,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,h?m.insertBefore(c,h):m.appendChild(c);else if(w!==4&&(c=c.child,c!==null))for(tk(c,h,m),c=c.sibling;c!==null;)tk(c,h,m),c=c.sibling}var or=null,oi=!1;function ro(c,h,m){for(m=m.child;m!==null;)w3(c,h,m),m=m.sibling}function w3(c,h,m){if(Di&&typeof Di.onCommitFiberUnmount=="function")try{Di.onCommitFiberUnmount(Tv,m)}catch{}switch(m.tag){case 5:br||du(m,h);case 6:var w=or,C=oi;or=null,ro(c,h,m),or=w,oi=C,or!==null&&(oi?(c=or,m=m.stateNode,c.nodeType===8?c.parentNode.removeChild(m):c.removeChild(m)):or.removeChild(m.stateNode));break;case 18:or!==null&&(oi?(c=or,m=m.stateNode,c.nodeType===8?p_(c.parentNode,m):c.nodeType===1&&p_(c,m),wf(c)):p_(or,m.stateNode));break;case 4:w=or,C=oi,or=m.stateNode.containerInfo,oi=!0,ro(c,h,m),or=w,oi=C;break;case 0:case 11:case 14:case 15:if(!br&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var A=C,N=A.destroy;A=A.tag,N!==void 0&&((A&2)!==0||(A&4)!==0)&&Q_(m,h,N),C=C.next}while(C!==w)}ro(c,h,m);break;case 1:if(!br&&(du(m,h),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(V){Pt(m,h,V)}ro(c,h,m);break;case 21:ro(c,h,m);break;case 22:m.mode&1?(br=(w=br)||m.memoizedState!==null,ro(c,h,m),br=w):ro(c,h,m);break;default:ro(c,h,m)}}function _3(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var m=c.stateNode;m===null&&(m=c.stateNode=new Qoe),h.forEach(function(w){var C=lse.bind(null,c,w);m.has(w)||(m.add(w),w.then(C,C))})}}function si(c,h){var m=h.deletions;if(m!==null)for(var w=0;w<m.length;w++){var C=m[w];try{var A=c,N=h,V=N;e:for(;V!==null;){switch(V.tag){case 5:or=V.stateNode,oi=!1;break e;case 3:or=V.stateNode.containerInfo,oi=!0;break e;case 4:or=V.stateNode.containerInfo,oi=!0;break e}V=V.return}if(or===null)throw Error(r(160));w3(A,N,C),or=null,oi=!1;var X=C.alternate;X!==null&&(X.return=null),C.return=null}catch(te){Pt(C,h,te)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)k3(h,c),h=h.sibling}function k3(c,h){var m=c.alternate,w=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(si(h,c),Pi(c),w&4){try{Uf(3,c,c.return),hg(3,c)}catch(Ce){Pt(c,c.return,Ce)}try{Uf(5,c,c.return)}catch(Ce){Pt(c,c.return,Ce)}}break;case 1:si(h,c),Pi(c),w&512&&m!==null&&du(m,m.return);break;case 5:if(si(h,c),Pi(c),w&512&&m!==null&&du(m,m.return),c.flags&32){var C=c.stateNode;try{Ue(C,"")}catch(Ce){Pt(c,c.return,Ce)}}if(w&4&&(C=c.stateNode,C!=null)){var A=c.memoizedProps,N=m!==null?m.memoizedProps:A,V=c.type,X=c.updateQueue;if(c.updateQueue=null,X!==null)try{V==="input"&&A.type==="radio"&&A.name!=null&&Dr(C,A),ta(V,N);var te=ta(V,A);for(N=0;N<X.length;N+=2){var se=X[N],le=X[N+1];se==="style"?on(C,le):se==="dangerouslySetInnerHTML"?He(C,le):se==="children"?Ue(C,le):S(C,se,le,te)}switch(V){case"input":Ur(C,A);break;case"textarea":bv(C,A);break;case"select":var oe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!A.multiple;var me=A.value;me!=null?an(C,!!A.multiple,me,!1):oe!==!!A.multiple&&(A.defaultValue!=null?an(C,!!A.multiple,A.defaultValue,!0):an(C,!!A.multiple,A.multiple?[]:"",!1))}C[If]=A}catch(Ce){Pt(c,c.return,Ce)}}break;case 6:if(si(h,c),Pi(c),w&4){if(c.stateNode===null)throw Error(r(162));C=c.stateNode,A=c.memoizedProps;try{C.nodeValue=A}catch(Ce){Pt(c,c.return,Ce)}}break;case 3:if(si(h,c),Pi(c),w&4&&m!==null&&m.memoizedState.isDehydrated)try{wf(h.containerInfo)}catch(Ce){Pt(c,c.return,Ce)}break;case 4:si(h,c),Pi(c);break;case 13:si(h,c),Pi(c),C=c.child,C.flags&8192&&(A=C.memoizedState!==null,C.stateNode.isHidden=A,!A||C.alternate!==null&&C.alternate.memoizedState!==null||(ik=Ot())),w&4&&_3(c);break;case 22:if(se=m!==null&&m.memoizedState!==null,c.mode&1?(br=(te=br)||se,si(h,c),br=te):si(h,c),Pi(c),w&8192){if(te=c.memoizedState!==null,(c.stateNode.isHidden=te)&&!se&&(c.mode&1)!==0)for(we=c,se=c.child;se!==null;){for(le=we=se;we!==null;){switch(oe=we,me=oe.child,oe.tag){case 0:case 11:case 14:case 15:Uf(4,oe,oe.return);break;case 1:du(oe,oe.return);var ke=oe.stateNode;if(typeof ke.componentWillUnmount=="function"){w=oe,m=oe.return;try{h=w,ke.props=h.memoizedProps,ke.state=h.memoizedState,ke.componentWillUnmount()}catch(Ce){Pt(w,m,Ce)}}break;case 5:du(oe,oe.return);break;case 22:if(oe.memoizedState!==null){T3(le);continue}}me!==null?(me.return=oe,we=me):T3(le)}se=se.sibling}e:for(se=null,le=c;;){if(le.tag===5){if(se===null){se=le;try{C=le.stateNode,te?(A=C.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(V=le.stateNode,X=le.memoizedProps.style,N=X!=null&&X.hasOwnProperty("display")?X.display:null,V.style.display=ir("display",N))}catch(Ce){Pt(c,c.return,Ce)}}}else if(le.tag===6){if(se===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(Ce){Pt(c,c.return,Ce)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===c)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===c)break e;for(;le.sibling===null;){if(le.return===null||le.return===c)break e;se===le&&(se=null),le=le.return}se===le&&(se=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:si(h,c),Pi(c),w&4&&_3(c);break;case 21:break;default:si(h,c),Pi(c)}}function Pi(c){var h=c.flags;if(h&2){try{e:{for(var m=c.return;m!==null;){if(x3(m)){var w=m;break e}m=m.return}throw Error(r(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(Ue(C,""),w.flags&=-33);var A=b3(c);tk(c,A,C);break;case 3:case 4:var N=w.stateNode.containerInfo,V=b3(c);ek(c,V,N);break;default:throw Error(r(161))}}catch(X){Pt(c,c.return,X)}c.flags&=-3}h&4096&&(c.flags&=-4097)}function ese(c,h,m){we=c,S3(c)}function S3(c,h,m){for(var w=(c.mode&1)!==0;we!==null;){var C=we,A=C.child;if(C.tag===22&&w){var N=C.memoizedState!==null||dg;if(!N){var V=C.alternate,X=V!==null&&V.memoizedState!==null||br;V=dg;var te=br;if(dg=N,(br=X)&&!te)for(we=C;we!==null;)N=we,X=N.child,N.tag===22&&N.memoizedState!==null?A3(C):X!==null?(X.return=N,we=X):A3(C);for(;A!==null;)we=A,S3(A),A=A.sibling;we=C,dg=V,br=te}C3(c)}else(C.subtreeFlags&8772)!==0&&A!==null?(A.return=C,we=A):C3(c)}}function C3(c){for(;we!==null;){var h=we;if((h.flags&8772)!==0){var m=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:br||hg(5,h);break;case 1:var w=h.stateNode;if(h.flags&4&&!br)if(m===null)w.componentDidMount();else{var C=h.elementType===h.type?m.memoizedProps:ai(h.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var A=h.updateQueue;A!==null&&TO(h,A,w);break;case 3:var N=h.updateQueue;if(N!==null){if(m=null,h.child!==null)switch(h.child.tag){case 5:m=h.child.stateNode;break;case 1:m=h.child.stateNode}TO(h,N,m)}break;case 5:var V=h.stateNode;if(m===null&&h.flags&4){m=V;var X=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&m.focus();break;case"img":X.src&&(m.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var te=h.alternate;if(te!==null){var se=te.memoizedState;if(se!==null){var le=se.dehydrated;le!==null&&wf(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}br||h.flags&512&&J_(h)}catch(oe){Pt(h,h.return,oe)}}if(h===c){we=null;break}if(m=h.sibling,m!==null){m.return=h.return,we=m;break}we=h.return}}function T3(c){for(;we!==null;){var h=we;if(h===c){we=null;break}var m=h.sibling;if(m!==null){m.return=h.return,we=m;break}we=h.return}}function A3(c){for(;we!==null;){var h=we;try{switch(h.tag){case 0:case 11:case 15:var m=h.return;try{hg(4,h)}catch(X){Pt(h,m,X)}break;case 1:var w=h.stateNode;if(typeof w.componentDidMount=="function"){var C=h.return;try{w.componentDidMount()}catch(X){Pt(h,C,X)}}var A=h.return;try{J_(h)}catch(X){Pt(h,A,X)}break;case 5:var N=h.return;try{J_(h)}catch(X){Pt(h,N,X)}}}catch(X){Pt(h,h.return,X)}if(h===c){we=null;break}var V=h.sibling;if(V!==null){V.return=h.return,we=V;break}we=h.return}}var tse=Math.ceil,pg=T.ReactCurrentDispatcher,rk=T.ReactCurrentOwner,Bn=T.ReactCurrentBatchConfig,rt=0,qt=null,Ut=null,sr=0,fn=0,hu=Za(0),Gt=0,$f=null,Ms=0,vg=0,nk=0,Gf=null,Yr=null,ik=0,pu=1/0,ua=null,gg=!1,ak=null,no=null,mg=!1,io=null,yg=0,Wf=0,ok=null,xg=-1,bg=0;function Lr(){return(rt&6)!==0?Ot():xg!==-1?xg:xg=Ot()}function ao(c){return(c.mode&1)===0?1:(rt&2)!==0&&sr!==0?sr&-sr:Foe.transition!==null?(bg===0&&(bg=b5()),bg):(c=ht,c!==0||(c=window.event,c=c===void 0?16:D5(c.type)),c)}function li(c,h,m,w){if(50<Wf)throw Wf=0,ok=null,Error(r(185));gf(c,m,w),((rt&2)===0||c!==qt)&&(c===qt&&((rt&2)===0&&(vg|=m),Gt===4&&oo(c,sr)),Xr(c,w),m===1&&rt===0&&(h.mode&1)===0&&(pu=Ot()+500,Xv&&Ja()))}function Xr(c,h){var m=c.callbackNode;Fae(c,h);var w=Dv(c,c===qt?sr:0);if(w===0)m!==null&&m5(m),c.callbackNode=null,c.callbackPriority=0;else if(h=w&-w,c.callbackPriority!==h){if(m!=null&&m5(m),h===1)c.tag===0?zoe(D3.bind(null,c)):pO(D3.bind(null,c)),Poe(function(){(rt&6)===0&&Ja()}),m=null;else{switch(w5(w)){case 1:m=Bw;break;case 4:m=y5;break;case 16:m=Cv;break;case 536870912:m=x5;break;default:m=Cv}m=z3(m,E3.bind(null,c))}c.callbackPriority=h,c.callbackNode=m}}function E3(c,h){if(xg=-1,bg=0,(rt&6)!==0)throw Error(r(327));var m=c.callbackNode;if(vu()&&c.callbackNode!==m)return null;var w=Dv(c,c===qt?sr:0);if(w===0)return null;if((w&30)!==0||(w&c.expiredLanes)!==0||h)h=wg(c,w);else{h=w;var C=rt;rt|=2;var A=L3();(qt!==c||sr!==h)&&(ua=null,pu=Ot()+500,Is(c,h));do try{ise();break}catch(V){M3(c,V)}while(!0);S_(),pg.current=A,rt=C,Ut!==null?h=0:(qt=null,sr=0,h=Gt)}if(h!==0){if(h===2&&(C=jw(c),C!==0&&(w=C,h=sk(c,C))),h===1)throw m=$f,Is(c,0),oo(c,w),Xr(c,Ot()),m;if(h===6)oo(c,w);else{if(C=c.current.alternate,(w&30)===0&&!rse(C)&&(h=wg(c,w),h===2&&(A=jw(c),A!==0&&(w=A,h=sk(c,A))),h===1))throw m=$f,Is(c,0),oo(c,w),Xr(c,Ot()),m;switch(c.finishedWork=C,c.finishedLanes=w,h){case 0:case 1:throw Error(r(345));case 2:Ps(c,Yr,ua);break;case 3:if(oo(c,w),(w&130023424)===w&&(h=ik+500-Ot(),10<h)){if(Dv(c,0)!==0)break;if(C=c.suspendedLanes,(C&w)!==w){Lr(),c.pingedLanes|=c.suspendedLanes&C;break}c.timeoutHandle=h_(Ps.bind(null,c,Yr,ua),h);break}Ps(c,Yr,ua);break;case 4:if(oo(c,w),(w&4194240)===w)break;for(h=c.eventTimes,C=-1;0<w;){var N=31-ri(w);A=1<<N,N=h[N],N>C&&(C=N),w&=~A}if(w=C,w=Ot()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*tse(w/1960))-w,10<w){c.timeoutHandle=h_(Ps.bind(null,c,Yr,ua),w);break}Ps(c,Yr,ua);break;case 5:Ps(c,Yr,ua);break;default:throw Error(r(329))}}}return Xr(c,Ot()),c.callbackNode===m?E3.bind(null,c):null}function sk(c,h){var m=Gf;return c.current.memoizedState.isDehydrated&&(Is(c,h).flags|=256),c=wg(c,h),c!==2&&(h=Yr,Yr=m,h!==null&&lk(h)),c}function lk(c){Yr===null?Yr=c:Yr.push.apply(Yr,c)}function rse(c){for(var h=c;;){if(h.flags&16384){var m=h.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var C=m[w],A=C.getSnapshot;C=C.value;try{if(!ni(A(),C))return!1}catch{return!1}}}if(m=h.child,h.subtreeFlags&16384&&m!==null)m.return=h,h=m;else{if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function oo(c,h){for(h&=~nk,h&=~vg,c.suspendedLanes|=h,c.pingedLanes&=~h,c=c.expirationTimes;0<h;){var m=31-ri(h),w=1<<m;c[m]=-1,h&=~w}}function D3(c){if((rt&6)!==0)throw Error(r(327));vu();var h=Dv(c,0);if((h&1)===0)return Xr(c,Ot()),null;var m=wg(c,h);if(c.tag!==0&&m===2){var w=jw(c);w!==0&&(h=w,m=sk(c,w))}if(m===1)throw m=$f,Is(c,0),oo(c,h),Xr(c,Ot()),m;if(m===6)throw Error(r(345));return c.finishedWork=c.current.alternate,c.finishedLanes=h,Ps(c,Yr,ua),Xr(c,Ot()),null}function uk(c,h){var m=rt;rt|=1;try{return c(h)}finally{rt=m,rt===0&&(pu=Ot()+500,Xv&&Ja())}}function Ls(c){io!==null&&io.tag===0&&(rt&6)===0&&vu();var h=rt;rt|=1;var m=Bn.transition,w=ht;try{if(Bn.transition=null,ht=1,c)return c()}finally{ht=w,Bn.transition=m,rt=h,(rt&6)===0&&Ja()}}function ck(){fn=hu.current,Ct(hu)}function Is(c,h){c.finishedWork=null,c.finishedLanes=0;var m=c.timeoutHandle;if(m!==-1&&(c.timeoutHandle=-1,Ioe(m)),Ut!==null)for(m=Ut.return;m!==null;){var w=m;switch(x_(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Wv();break;case 3:cu(),Ct($r),Ct(mr),I_();break;case 5:M_(w);break;case 4:cu();break;case 13:Ct(Dt);break;case 19:Ct(Dt);break;case 10:C_(w.type._context);break;case 22:case 23:ck()}m=m.return}if(qt=c,Ut=c=so(c.current,null),sr=fn=h,Gt=0,$f=null,nk=vg=Ms=0,Yr=Gf=null,As!==null){for(h=0;h<As.length;h++)if(m=As[h],w=m.interleaved,w!==null){m.interleaved=null;var C=w.next,A=m.pending;if(A!==null){var N=A.next;A.next=C,w.next=N}m.pending=w}As=null}return c}function M3(c,h){do{var m=Ut;try{if(S_(),ig.current=lg,ag){for(var w=Mt.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}ag=!1}if(Ds=0,Xt=$t=Mt=null,Ff=!1,Bf=0,rk.current=null,m===null||m.return===null){Gt=1,$f=h,Ut=null;break}e:{var A=c,N=m.return,V=m,X=h;if(h=sr,V.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var te=X,se=V,le=se.tag;if((se.mode&1)===0&&(le===0||le===11||le===15)){var oe=se.alternate;oe?(se.updateQueue=oe.updateQueue,se.memoizedState=oe.memoizedState,se.lanes=oe.lanes):(se.updateQueue=null,se.memoizedState=null)}var me=t3(N);if(me!==null){me.flags&=-257,r3(me,N,V,A,h),me.mode&1&&e3(A,te,h),h=me,X=te;var ke=h.updateQueue;if(ke===null){var Ce=new Set;Ce.add(X),h.updateQueue=Ce}else ke.add(X);break e}else{if((h&1)===0){e3(A,te,h),fk();break e}X=Error(r(426))}}else if(At&&V.mode&1){var zt=t3(N);if(zt!==null){(zt.flags&65536)===0&&(zt.flags|=256),r3(zt,N,V,A,h),__(fu(X,V));break e}}A=X=fu(X,V),Gt!==4&&(Gt=2),Gf===null?Gf=[A]:Gf.push(A),A=N;do{switch(A.tag){case 3:A.flags|=65536,h&=-h,A.lanes|=h;var Q=QO(A,X,h);CO(A,Q);break e;case 1:V=X;var q=A.type,J=A.stateNode;if((A.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(no===null||!no.has(J)))){A.flags|=65536,h&=-h,A.lanes|=h;var fe=JO(A,V,h);CO(A,fe);break e}}A=A.return}while(A!==null)}P3(m)}catch(Te){h=Te,Ut===m&&m!==null&&(Ut=m=m.return);continue}break}while(!0)}function L3(){var c=pg.current;return pg.current=lg,c===null?lg:c}function fk(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),qt===null||(Ms&268435455)===0&&(vg&268435455)===0||oo(qt,sr)}function wg(c,h){var m=rt;rt|=2;var w=L3();(qt!==c||sr!==h)&&(ua=null,Is(c,h));do try{nse();break}catch(C){M3(c,C)}while(!0);if(S_(),rt=m,pg.current=w,Ut!==null)throw Error(r(261));return qt=null,sr=0,Gt}function nse(){for(;Ut!==null;)I3(Ut)}function ise(){for(;Ut!==null&&!Dae();)I3(Ut)}function I3(c){var h=O3(c.alternate,c,fn);c.memoizedProps=c.pendingProps,h===null?P3(c):Ut=h,rk.current=null}function P3(c){var h=c;do{var m=h.alternate;if(c=h.return,(h.flags&32768)===0){if(m=Koe(m,h,fn),m!==null){Ut=m;return}}else{if(m=Zoe(m,h),m!==null){m.flags&=32767,Ut=m;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Gt=6,Ut=null;return}}if(h=h.sibling,h!==null){Ut=h;return}Ut=h=c}while(h!==null);Gt===0&&(Gt=5)}function Ps(c,h,m){var w=ht,C=Bn.transition;try{Bn.transition=null,ht=1,ase(c,h,m,w)}finally{Bn.transition=C,ht=w}return null}function ase(c,h,m,w){do vu();while(io!==null);if((rt&6)!==0)throw Error(r(327));m=c.finishedWork;var C=c.finishedLanes;if(m===null)return null;if(c.finishedWork=null,c.finishedLanes=0,m===c.current)throw Error(r(177));c.callbackNode=null,c.callbackPriority=0;var A=m.lanes|m.childLanes;if(Bae(c,A),c===qt&&(Ut=qt=null,sr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||mg||(mg=!0,z3(Cv,function(){return vu(),null})),A=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||A){A=Bn.transition,Bn.transition=null;var N=ht;ht=1;var V=rt;rt|=4,rk.current=null,Joe(c,m),k3(m,c),Coe(f_),Iv=!!c_,f_=c_=null,c.current=m,ese(m),Mae(),rt=V,ht=N,Bn.transition=A}else c.current=m;if(mg&&(mg=!1,io=c,yg=C),A=c.pendingLanes,A===0&&(no=null),Pae(m.stateNode),Xr(c,Ot()),h!==null)for(w=c.onRecoverableError,m=0;m<h.length;m++)C=h[m],w(C.value,{componentStack:C.stack,digest:C.digest});if(gg)throw gg=!1,c=ak,ak=null,c;return(yg&1)!==0&&c.tag!==0&&vu(),A=c.pendingLanes,(A&1)!==0?c===ok?Wf++:(Wf=0,ok=c):Wf=0,Ja(),null}function vu(){if(io!==null){var c=w5(yg),h=Bn.transition,m=ht;try{if(Bn.transition=null,ht=16>c?16:c,io===null)var w=!1;else{if(c=io,io=null,yg=0,(rt&6)!==0)throw Error(r(331));var C=rt;for(rt|=4,we=c.current;we!==null;){var A=we,N=A.child;if((we.flags&16)!==0){var V=A.deletions;if(V!==null){for(var X=0;X<V.length;X++){var te=V[X];for(we=te;we!==null;){var se=we;switch(se.tag){case 0:case 11:case 15:Uf(8,se,A)}var le=se.child;if(le!==null)le.return=se,we=le;else for(;we!==null;){se=we;var oe=se.sibling,me=se.return;if(y3(se),se===te){we=null;break}if(oe!==null){oe.return=me,we=oe;break}we=me}}}var ke=A.alternate;if(ke!==null){var Ce=ke.child;if(Ce!==null){ke.child=null;do{var zt=Ce.sibling;Ce.sibling=null,Ce=zt}while(Ce!==null)}}we=A}}if((A.subtreeFlags&2064)!==0&&N!==null)N.return=A,we=N;else e:for(;we!==null;){if(A=we,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Uf(9,A,A.return)}var Q=A.sibling;if(Q!==null){Q.return=A.return,we=Q;break e}we=A.return}}var q=c.current;for(we=q;we!==null;){N=we;var J=N.child;if((N.subtreeFlags&2064)!==0&&J!==null)J.return=N,we=J;else e:for(N=q;we!==null;){if(V=we,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:hg(9,V)}}catch(Te){Pt(V,V.return,Te)}if(V===N){we=null;break e}var fe=V.sibling;if(fe!==null){fe.return=V.return,we=fe;break e}we=V.return}}if(rt=C,Ja(),Di&&typeof Di.onPostCommitFiberRoot=="function")try{Di.onPostCommitFiberRoot(Tv,c)}catch{}w=!0}return w}finally{ht=m,Bn.transition=h}}return!1}function N3(c,h,m){h=fu(m,h),h=QO(c,h,1),c=to(c,h,1),h=Lr(),c!==null&&(gf(c,1,h),Xr(c,h))}function Pt(c,h,m){if(c.tag===3)N3(c,c,m);else for(;h!==null;){if(h.tag===3){N3(h,c,m);break}else if(h.tag===1){var w=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(no===null||!no.has(w))){c=fu(m,c),c=JO(h,c,1),h=to(h,c,1),c=Lr(),h!==null&&(gf(h,1,c),Xr(h,c));break}}h=h.return}}function ose(c,h,m){var w=c.pingCache;w!==null&&w.delete(h),h=Lr(),c.pingedLanes|=c.suspendedLanes&m,qt===c&&(sr&m)===m&&(Gt===4||Gt===3&&(sr&130023424)===sr&&500>Ot()-ik?Is(c,0):nk|=m),Xr(c,h)}function R3(c,h){h===0&&((c.mode&1)===0?h=1:(h=Ev,Ev<<=1,(Ev&130023424)===0&&(Ev=4194304)));var m=Lr();c=oa(c,h),c!==null&&(gf(c,h,m),Xr(c,m))}function sse(c){var h=c.memoizedState,m=0;h!==null&&(m=h.retryLane),R3(c,m)}function lse(c,h){var m=0;switch(c.tag){case 13:var w=c.stateNode,C=c.memoizedState;C!==null&&(m=C.retryLane);break;case 19:w=c.stateNode;break;default:throw Error(r(314))}w!==null&&w.delete(h),R3(c,m)}var O3;O3=function(c,h,m){if(c!==null)if(c.memoizedProps!==h.pendingProps||$r.current)Wr=!0;else{if((c.lanes&m)===0&&(h.flags&128)===0)return Wr=!1,qoe(c,h,m);Wr=(c.flags&131072)!==0}else Wr=!1,At&&(h.flags&1048576)!==0&&vO(h,Kv,h.index);switch(h.lanes=0,h.tag){case 2:var w=h.type;fg(c,h),c=h.pendingProps;var C=nu(h,mr.current);uu(h,m),C=R_(null,h,w,c,C,m);var A=O_();return h.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,Gr(w)?(A=!0,Yv(h)):A=!1,h.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,E_(h),C.updater=ug,h.stateNode=C,C._reactInternals=h,V_(h,w,c,m),h=W_(null,h,w,!0,A,m)):(h.tag=0,At&&A&&y_(h),Mr(null,h,C,m),h=h.child),h;case 16:w=h.elementType;e:{switch(fg(c,h),c=h.pendingProps,C=w._init,w=C(w._payload),h.type=w,C=h.tag=cse(w),c=ai(w,c),C){case 0:h=G_(null,h,w,c,m);break e;case 1:h=l3(null,h,w,c,m);break e;case 11:h=n3(null,h,w,c,m);break e;case 14:h=i3(null,h,w,ai(w.type,c),m);break e}throw Error(r(306,w,""))}return h;case 0:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),G_(c,h,w,C,m);case 1:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),l3(c,h,w,C,m);case 3:e:{if(u3(h),c===null)throw Error(r(387));w=h.pendingProps,A=h.memoizedState,C=A.element,SO(c,h),rg(h,w,null,m);var N=h.memoizedState;if(w=N.element,A.isDehydrated)if(A={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},h.updateQueue.baseState=A,h.memoizedState=A,h.flags&256){C=fu(Error(r(423)),h),h=c3(c,h,w,m,C);break e}else if(w!==C){C=fu(Error(r(424)),h),h=c3(c,h,w,m,C);break e}else for(cn=Ka(h.stateNode.containerInfo.firstChild),un=h,At=!0,ii=null,m=_O(h,null,w,m),h.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ou(),w===C){h=la(c,h,m);break e}Mr(c,h,w,m)}h=h.child}return h;case 5:return AO(h),c===null&&w_(h),w=h.type,C=h.pendingProps,A=c!==null?c.memoizedProps:null,N=C.children,d_(w,C)?N=null:A!==null&&d_(w,A)&&(h.flags|=32),s3(c,h),Mr(c,h,N,m),h.child;case 6:return c===null&&w_(h),null;case 13:return f3(c,h,m);case 4:return D_(h,h.stateNode.containerInfo),w=h.pendingProps,c===null?h.child=su(h,null,w,m):Mr(c,h,w,m),h.child;case 11:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),n3(c,h,w,C,m);case 7:return Mr(c,h,h.pendingProps,m),h.child;case 8:return Mr(c,h,h.pendingProps.children,m),h.child;case 12:return Mr(c,h,h.pendingProps.children,m),h.child;case 10:e:{if(w=h.type._context,C=h.pendingProps,A=h.memoizedProps,N=C.value,wt(Jv,w._currentValue),w._currentValue=N,A!==null)if(ni(A.value,N)){if(A.children===C.children&&!$r.current){h=la(c,h,m);break e}}else for(A=h.child,A!==null&&(A.return=h);A!==null;){var V=A.dependencies;if(V!==null){N=A.child;for(var X=V.firstContext;X!==null;){if(X.context===w){if(A.tag===1){X=sa(-1,m&-m),X.tag=2;var te=A.updateQueue;if(te!==null){te=te.shared;var se=te.pending;se===null?X.next=X:(X.next=se.next,se.next=X),te.pending=X}}A.lanes|=m,X=A.alternate,X!==null&&(X.lanes|=m),T_(A.return,m,h),V.lanes|=m;break}X=X.next}}else if(A.tag===10)N=A.type===h.type?null:A.child;else if(A.tag===18){if(N=A.return,N===null)throw Error(r(341));N.lanes|=m,V=N.alternate,V!==null&&(V.lanes|=m),T_(N,m,h),N=A.sibling}else N=A.child;if(N!==null)N.return=A;else for(N=A;N!==null;){if(N===h){N=null;break}if(A=N.sibling,A!==null){A.return=N.return,N=A;break}N=N.return}A=N}Mr(c,h,C.children,m),h=h.child}return h;case 9:return C=h.type,w=h.pendingProps.children,uu(h,m),C=zn(C),w=w(C),h.flags|=1,Mr(c,h,w,m),h.child;case 14:return w=h.type,C=ai(w,h.pendingProps),C=ai(w.type,C),i3(c,h,w,C,m);case 15:return a3(c,h,h.type,h.pendingProps,m);case 17:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),fg(c,h),h.tag=1,Gr(w)?(c=!0,Yv(h)):c=!1,uu(h,m),KO(h,w,C),V_(h,w,C,m),W_(null,h,w,!0,c,m);case 19:return h3(c,h,m);case 22:return o3(c,h,m)}throw Error(r(156,h.tag))};function z3(c,h){return g5(c,h)}function use(c,h,m,w){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(c,h,m,w){return new use(c,h,m,w)}function dk(c){return c=c.prototype,!(!c||!c.isReactComponent)}function cse(c){if(typeof c=="function")return dk(c)?1:0;if(c!=null){if(c=c.$$typeof,c===j)return 11;if(c===K)return 14}return 2}function so(c,h){var m=c.alternate;return m===null?(m=jn(c.tag,h,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=h,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&14680064,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,h=c.dependencies,m.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m}function _g(c,h,m,w,C,A){var N=2;if(w=c,typeof c=="function")dk(c)&&(N=1);else if(typeof c=="string")N=5;else e:switch(c){case L:return Ns(m.children,C,A,h);case R:N=8,C|=8;break;case O:return c=jn(12,m,h,C|2),c.elementType=O,c.lanes=A,c;case B:return c=jn(13,m,h,C),c.elementType=B,c.lanes=A,c;case $:return c=jn(19,m,h,C),c.elementType=$,c.lanes=A,c;case re:return kg(m,C,A,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case M:N=10;break e;case P:N=9;break e;case j:N=11;break e;case K:N=14;break e;case Z:N=16,w=null;break e}throw Error(r(130,c==null?c:typeof c,""))}return h=jn(N,m,h,C),h.elementType=c,h.type=w,h.lanes=A,h}function Ns(c,h,m,w){return c=jn(7,c,w,h),c.lanes=m,c}function kg(c,h,m,w){return c=jn(22,c,w,h),c.elementType=re,c.lanes=m,c.stateNode={isHidden:!1},c}function hk(c,h,m){return c=jn(6,c,null,h),c.lanes=m,c}function pk(c,h,m){return h=jn(4,c.children!==null?c.children:[],c.key,h),h.lanes=m,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function fse(c,h,m,w,C){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hw(0),this.expirationTimes=Hw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hw(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function vk(c,h,m,w,C,A,N,V,X){return c=new fse(c,h,m,V,X),h===1?(h=1,A===!0&&(h|=8)):h=0,A=jn(3,null,null,h),c.current=A,A.stateNode=c,A.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},E_(A),c}function dse(c,h,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:w==null?null:""+w,children:c,containerInfo:h,implementation:m}}function F3(c){if(!c)return Qa;c=c._reactInternals;e:{if(_s(c)!==c||c.tag!==1)throw Error(r(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(Gr(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(r(171))}if(c.tag===1){var m=c.type;if(Gr(m))return dO(c,m,h)}return h}function B3(c,h,m,w,C,A,N,V,X){return c=vk(m,w,!0,c,C,A,N,V,X),c.context=F3(null),m=c.current,w=Lr(),C=ao(m),A=sa(w,C),A.callback=h??null,to(m,A,C),c.current.lanes=C,gf(c,C,w),Xr(c,w),c}function Sg(c,h,m,w){var C=h.current,A=Lr(),N=ao(C);return m=F3(m),h.context===null?h.context=m:h.pendingContext=m,h=sa(A,N),h.payload={element:c},w=w===void 0?null:w,w!==null&&(h.callback=w),c=to(C,h,N),c!==null&&(li(c,C,N,A),tg(c,C,N)),N}function Cg(c){return c=c.current,c.child?(c.child.tag===5,c.child.stateNode):null}function j3(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<h?m:h}}function gk(c,h){j3(c,h),(c=c.alternate)&&j3(c,h)}function hse(){return null}var H3=typeof reportError=="function"?reportError:function(c){console.error(c)};function mk(c){this._internalRoot=c}Tg.prototype.render=mk.prototype.render=function(c){var h=this._internalRoot;if(h===null)throw Error(r(409));Sg(c,h,null,null)},Tg.prototype.unmount=mk.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var h=c.containerInfo;Ls(function(){Sg(null,c,null,null)}),h[ra]=null}};function Tg(c){this._internalRoot=c}Tg.prototype.unstable_scheduleHydration=function(c){if(c){var h=S5();c={blockedOn:null,target:c,priority:h};for(var m=0;m<Ya.length&&h!==0&&h<Ya[m].priority;m++);Ya.splice(m,0,c),m===0&&A5(c)}};function yk(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function Ag(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function V3(){}function pse(c,h,m,w,C){if(C){if(typeof w=="function"){var A=w;w=function(){var te=Cg(N);A.call(te)}}var N=B3(h,w,c,0,null,!1,!1,"",V3);return c._reactRootContainer=N,c[ra]=N.current,Mf(c.nodeType===8?c.parentNode:c),Ls(),N}for(;C=c.lastChild;)c.removeChild(C);if(typeof w=="function"){var V=w;w=function(){var te=Cg(X);V.call(te)}}var X=vk(c,0,!1,null,null,!1,!1,"",V3);return c._reactRootContainer=X,c[ra]=X.current,Mf(c.nodeType===8?c.parentNode:c),Ls(function(){Sg(h,X,m,w)}),X}function Eg(c,h,m,w,C){var A=m._reactRootContainer;if(A){var N=A;if(typeof C=="function"){var V=C;C=function(){var X=Cg(N);V.call(X)}}Sg(h,N,c,C)}else N=pse(m,h,c,C,w);return Cg(N)}_5=function(c){switch(c.tag){case 3:var h=c.stateNode;if(h.current.memoizedState.isDehydrated){var m=vf(h.pendingLanes);m!==0&&(Vw(h,m|1),Xr(h,Ot()),(rt&6)===0&&(pu=Ot()+500,Ja()))}break;case 13:Ls(function(){var w=oa(c,1);if(w!==null){var C=Lr();li(w,c,1,C)}}),gk(c,1)}},Uw=function(c){if(c.tag===13){var h=oa(c,134217728);if(h!==null){var m=Lr();li(h,c,134217728,m)}gk(c,134217728)}},k5=function(c){if(c.tag===13){var h=ao(c),m=oa(c,h);if(m!==null){var w=Lr();li(m,c,h,w)}gk(c,h)}},S5=function(){return ht},C5=function(c,h){var m=ht;try{return ht=c,h()}finally{ht=m}},ar=function(c,h,m){switch(h){case"input":if(Ur(c,m),h=m.name,m.type==="radio"&&h!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<m.length;h++){var w=m[h];if(w!==c&&w.form===c.form){var C=Gv(w);if(!C)throw Error(r(90));Xe(w),Ur(w,C)}}}break;case"textarea":bv(c,m);break;case"select":h=m.value,h!=null&&an(c,!!m.multiple,h,!1)}},u5=uk,c5=Ls;var vse={usingClientEntryPoint:!1,Events:[Pf,tu,Gv,s5,l5,uk]},Yf={findFiberByHostInstance:ks,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gse={bundleType:Yf.bundleType,version:Yf.version,rendererPackageName:Yf.rendererPackageName,rendererConfig:Yf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=p5(c),c===null?null:c.stateNode},findFiberByHostInstance:Yf.findFiberByHostInstance||hse,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dg.isDisabled&&Dg.supportsFiber)try{Tv=Dg.inject(gse),Di=Dg}catch{}}return Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vse,Ir.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yk(h))throw Error(r(200));return dse(c,h,null,m)},Ir.createRoot=function(c,h){if(!yk(c))throw Error(r(299));var m=!1,w="",C=H3;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=vk(c,1,!1,null,null,m,!1,w,C),c[ra]=h.current,Mf(c.nodeType===8?c.parentNode:c),new mk(h)},Ir.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=p5(h),c=c===null?null:c.stateNode,c},Ir.flushSync=function(c){return Ls(c)},Ir.hydrate=function(c,h,m){if(!Ag(h))throw Error(r(200));return Eg(null,c,h,!0,m)},Ir.hydrateRoot=function(c,h,m){if(!yk(c))throw Error(r(405));var w=m!=null&&m.hydratedSources||null,C=!1,A="",N=H3;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(A=m.identifierPrefix),m.onRecoverableError!==void 0&&(N=m.onRecoverableError)),h=B3(h,null,c,1,m??null,C,!1,A,N),c[ra]=h.current,Mf(c),w)for(c=0;c<w.length;c++)m=w[c],C=m._getVersion,C=C(m._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[m,C]:h.mutableSourceEagerHydrationData.push(m,C);return new Tg(h)},Ir.render=function(c,h,m){if(!Ag(h))throw Error(r(200));return Eg(null,c,h,!1,m)},Ir.unmountComponentAtNode=function(c){if(!Ag(c))throw Error(r(40));return c._reactRootContainer?(Ls(function(){Eg(null,null,c,!1,function(){c._reactRootContainer=null,c[ra]=null})}),!0):!1},Ir.unstable_batchedUpdates=uk,Ir.unstable_renderSubtreeIntoContainer=function(c,h,m,w){if(!Ag(m))throw Error(r(200));if(c==null||c._reactInternals===void 0)throw Error(r(38));return Eg(c,h,m,!1,w)},Ir.version="18.3.1-next-f1338f8080-20240426",Ir}var Tk;function K3(){if(Tk)return Pg.exports;Tk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Pg.exports=q3(),Pg.exports}var Ak;function Z3(){if(Ak)return Xf;Ak=1;var e=K3();return Xf.createRoot=e.createRoot,Xf.hydrateRoot=e.hydrateRoot,Xf}var Q3=Z3();const J3=".aid-root{color-scheme:light;--background: 0 0% 100%;--background-secondary: 210, 40%, 96%;--foreground: 222.2 47.4% 11.2%;--foreground-secondary: 253, 40%, 16%;--scroll: 0, 0%, 78%;--sidebar-menu-background: 202, 100%, 18%;--sidebar: 210, 40%, 96%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 42%;--popover: 0 0% 100%;--popover-foreground: 222.2 47.4% 11.2%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--card: 0 0% 100%;--card-foreground: 222.2 47.4% 11.2%;--primary: 201, 100%, 29%;--primary-text: 201, 100%, 29%;--primary-foreground: 210, 40%, 96%;--primary-hovered: 202, 54%, 67%;--primary-pressed: 202, 100%, 18%;--disabled: 223, 8%, 18%, .15;--disabled-foreground: 223, 8%, 18%, .65;--main: 252, 39%, 16%;--main-foreground: 210, 40%, 96%;--secondary: 201, 95%, 36%, .1;--secondary-foreground: 201, 100%, 29%, 1;--secondary-hovered: 202, 54%, 67%;--secondary-pressed: 202, 100%, 18%;--accent: 223, 8%, 18%, .06;--accent-foreground: 223, 8%, 18%, 1;--destructive: 359, 84%, 50%, 1;--destructive-foreground: 0, 0%, 100%, 1;--destructive-background: 359, 84%, 50%, .1;--destructive-hovered: 359, 84%, 58%, 1;--destructive-pressed: 359, 84%, 44%, 1;--ring: 215 20.2% 65.1%;--radius: 12px;--header-height: 64px;--table-radius: 10px;--table-background: 202, 100%, 18%;--table-header-background: 223, 8%, 18%;--table-header-opacity: .02;--table-background-hover: 223, 8%, 18%;--chart-card: 210, 27%, 95%;--filled-filter: 343, 79%, 45%;--success: 100.24, 76.58%, 43.53%;--warning: 39.91, 95.83%, 52.94%;--error: 359, 84%, 50%;--processing: 201.2, 100%, 29.41%;--success-background: 90, 100%, 96%;--warning-background: 50, 100%, 95%, 1;--error-background: 8, 100%, 97%, 1;--processing-background: 204, 42%, 95%, 1;--default-background: 223, 8%, 18%, .02;--transfer-hovered: 223, 8%, 18%, .04;--transfer-selected: 204, 42%, 95%;--transfer-selected-hovered: 203, 55%, 91%;--toast-background: 204, 42%, 95%;--toast-border: 202, 55%, 85%;--toast-success-background: 90, 100%, 96%;--toast-success-border: 94, 70%, 74%;--toast-error-background: 8, 100%, 97%;--toast-error-border: 5, 100%, 89%, 1;--toast-warning-background: 50, 100%, 95%;--toast-warning-border: 46, 100%, 78%;--toast-info-background: 204, 42%, 95%;--toast-info-border: 202, 55%, 85%;--custom-magenta: 330 84% 33%;--custom-peach: 36 100% 94%;--custom-orange-soft: 18 100% 63%;--custom-orange-strong: 27, 95%, 55%;--chart-stroke: 0, 0%, 0%;--gray-soft: 220, 27%, 92%;--gray-softer: 0 0% 95%}.aid-root.dark{color-scheme:dark;--background: 222 47% 11%;--background-secondary: 217, 33%, 17%;--foreground: 210 40% 98%;--foreground-secondary: 210, 40%, 90%;--scroll: 215, 14%, 34%;--sidebar-menu-background: 222, 47%, 11%;--sidebar: 217, 33%, 17%;--muted: 217 33% 17%;--muted-foreground: 215 20.2% 65.1%;--popover: 222 47% 11%;--popover-foreground: 210 40% 98%;--border: 217 33% 25%;--input: 217 33% 25%;--card: 222 47% 11%;--card-foreground: 210 40% 98%;--primary: 201, 100%, 35%;--primary-text: 201, 90%, 60%;--primary-foreground: 210, 40%, 98%;--primary-hovered: 201, 100%, 39%;--primary-pressed: 201, 100%, 29%;--disabled: 215, 14%, 34%, .2;--disabled-foreground: 210, 40%, 90%, .5;--main: 210, 40%, 90%;--main-foreground: 222, 47%, 11%;--secondary: 201, 95%, 40%, .2;--secondary-foreground: 201, 100%, 70%, 1;--secondary-hovered: 201, 90%, 75%;--secondary-pressed: 201, 100%, 60%;--accent: 210, 40%, 90%, .1;--accent-foreground: 210, 40%, 90%, 1;--destructive: 0, 100%, 65%, 1;--destructive-foreground: 210, 40%, 98%, 1;--destructive-background: 359, 100%, 65%, .1;--destructive-hovered: 0, 100%, 70%, 1;--destructive-pressed: 0, 100%, 60%, 1;--ring: 215 20.2% 50%;--radius: 12px;--header-height: 64px;--table-radius: 10px;--table-background: 222, 47%, 15%;--table-header-background: 0, 0%, 100%;--table-header-opacity: .04;--table-background-hover: 0, 0%, 100%;--chart-card: 210, 25%, 18%;--filled-filter: 343, 79%, 55%;--success: 100.24, 76.58%, 43.53%;--warning: 39.91, 95.83%, 52.94%;--error: 359.33, 100%, 65.1%;--processing: 201, 90%, 60%;--success-background: 100, 77%, 44%, .12;--warning-background: 40, 96%, 53%, .12;--error-background: 359, 100%, 65%, .12;--processing-background: 201, 90%, 60%, .12;--default-background: 0, 0%, 100%, .04;--transfer-hovered: 0, 0%, 100%, .06;--transfer-selected: 201, 95%, 40%, .2;--transfer-selected-hovered: 201, 95%, 40%, .3;--toast-background: 222, 47%, 15%;--toast-border: 217, 33%, 25%;--toast-success-background: 142, 70%, 15%;--toast-success-border: 142, 70%, 25%;--toast-error-background: 0, 70%, 15%;--toast-error-border: 0, 70%, 25%;--toast-warning-background: 48, 70%, 15%;--toast-warning-border: 48, 70%, 25%;--toast-info-background: 201, 70%, 15%;--toast-info-border: 201, 70%, 25%;--custom-magenta: 330 84% 33%;--custom-peach: 36 100% 94%;--custom-orange-soft: 18 100% 63%;--custom-orange-strong: 27, 95%, 55%;--chart-stroke: 0, 0%, 100%;--gray-soft: 217, 33%, 22%;--gray-softer: 217 33% 17%}.aid-root{--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}",Og=25,e4={ru:"ru-RU",kk:"kk-KZ",en:"en-US"};function Hn(e,t,r){return e===null?"—":new Intl.NumberFormat(e4[t],{minimumFractionDigits:r,maximumFractionDigits:r}).format(e).replace(new RegExp("\\u202F","g")," ")}const zg=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function t4(e,t,r){const n=r==="asc"?1:-1,i=t.type==="number"||t.type==="integer",a=[],o=[];for(const s of e){const l=s[t.key];((i?zg(l)===null:l==null)?o:a).push(s)}return a.sort((s,l)=>i?n*((zg(s[t.key])??0)-(zg(l[t.key])??0)):n*String(s[t.key]).localeCompare(String(l[t.key]))),[...a,...o]}function r4(e,t){let r=e.data;const n=t.query?.trim().toLowerCase();if(n){const f=e.columns.filter(d=>d.type==="string").map(d=>d.key);r=r.filter(d=>f.some(p=>String(d[p]??"").toLowerCase().includes(n)))}const i=e.columns.find(f=>f.key===t.sortKey);i&&(r=t4(r,i,t.dir??"asc"));const a=r.length,o=Math.max(1,Math.ceil(a/Og)),s=Math.min(Math.max(1,Math.trunc(t.page)||1),o),l=(s-1)*Og,u=r.slice(l,l+Og);return{rows:u,page:s,pages:o,from:a===0?0:l+1,to:l+u.length,total:a}}function n4(e){return e.split(`
|
|
8
|
+
`+A.stack}return{value:c,source:h,stack:C,digest:null}}function U_(c,h,m){return{value:c,source:null,stack:m??null,digest:h??null}}function $_(c,h){try{console.error(h.value)}catch(m){setTimeout(function(){throw m})}}var Woe=typeof WeakMap=="function"?WeakMap:Map;function QO(c,h,m){m=sa(-1,m),m.tag=3,m.payload={element:null};var w=h.value;return m.callback=function(){gg||(gg=!0,ak=w),$_(c,h)},m}function JO(c,h,m){m=sa(-1,m),m.tag=3;var w=c.type.getDerivedStateFromError;if(typeof w=="function"){var C=h.value;m.payload=function(){return w(C)},m.callback=function(){$_(c,h)}}var A=c.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(m.callback=function(){$_(c,h),typeof w!="function"&&(no===null?no=new Set([this]):no.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})}),m}function e3(c,h,m){var w=c.pingCache;if(w===null){w=c.pingCache=new Woe;var C=new Set;w.set(h,C)}else C=w.get(h),C===void 0&&(C=new Set,w.set(h,C));C.has(m)||(C.add(m),c=ose.bind(null,c,h,m),h.then(c,c))}function t3(c){do{var h;if((h=c.tag===13)&&(h=c.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return c;c=c.return}while(c!==null);return null}function r3(c,h,m,w,C){return(c.mode&1)===0?(c===h?c.flags|=65536:(c.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(h=sa(-1,1),h.tag=2,to(m,h,1))),m.lanes|=1),c):(c.flags|=65536,c.lanes=C,c)}var Yoe=T.ReactCurrentOwner,Wr=!1;function Mr(c,h,m,w){h.child=c===null?_O(h,null,m,w):su(h,c.child,m,w)}function n3(c,h,m,w,C){m=m.render;var A=h.ref;return uu(h,C),w=R_(c,h,m,w,A,C),m=O_(),c!==null&&!Wr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,la(c,h,C)):(At&&m&&y_(h),h.flags|=1,Mr(c,h,w,C),h.child)}function i3(c,h,m,w,C){if(c===null){var A=m.type;return typeof A=="function"&&!dk(A)&&A.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(h.tag=15,h.type=A,a3(c,h,A,w,C)):(c=_g(m.type,null,w,h,h.mode,C),c.ref=h.ref,c.return=h,h.child=c)}if(A=c.child,(c.lanes&C)===0){var N=A.memoizedProps;if(m=m.compare,m=m!==null?m:Af,m(N,w)&&c.ref===h.ref)return la(c,h,C)}return h.flags|=1,c=so(A,w),c.ref=h.ref,c.return=h,h.child=c}function a3(c,h,m,w,C){if(c!==null){var A=c.memoizedProps;if(Af(A,w)&&c.ref===h.ref)if(Wr=!1,h.pendingProps=w=A,(c.lanes&C)!==0)(c.flags&131072)!==0&&(Wr=!0);else return h.lanes=c.lanes,la(c,h,C)}return G_(c,h,m,w,C)}function o3(c,h,m){var w=h.pendingProps,C=w.children,A=c!==null?c.memoizedState:null;if(w.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},wt(hu,fn),fn|=m;else{if((m&1073741824)===0)return c=A!==null?A.baseLanes|m:m,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null,transitions:null},h.updateQueue=null,wt(hu,fn),fn|=c,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=A!==null?A.baseLanes:m,wt(hu,fn),fn|=w}else A!==null?(w=A.baseLanes|m,h.memoizedState=null):w=m,wt(hu,fn),fn|=w;return Mr(c,h,C,m),h.child}function s3(c,h){var m=h.ref;(c===null&&m!==null||c!==null&&c.ref!==m)&&(h.flags|=512,h.flags|=2097152)}function G_(c,h,m,w,C){var A=Gr(m)?Ss:mr.current;return A=nu(h,A),uu(h,C),m=R_(c,h,m,w,A,C),w=O_(),c!==null&&!Wr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~C,la(c,h,C)):(At&&w&&y_(h),h.flags|=1,Mr(c,h,m,C),h.child)}function l3(c,h,m,w,C){if(Gr(m)){var A=!0;Yv(h)}else A=!1;if(uu(h,C),h.stateNode===null)fg(c,h),KO(h,m,w),V_(h,m,w,C),w=!0;else if(c===null){var N=h.stateNode,V=h.memoizedProps;N.props=V;var X=N.context,te=m.contextType;typeof te=="object"&&te!==null?te=zn(te):(te=Gr(m)?Ss:mr.current,te=nu(h,te));var se=m.getDerivedStateFromProps,le=typeof se=="function"||typeof N.getSnapshotBeforeUpdate=="function";le||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(V!==w||X!==te)&&ZO(h,N,w,te),eo=!1;var oe=h.memoizedState;N.state=oe,rg(h,w,N,C),X=h.memoizedState,V!==w||oe!==X||$r.current||eo?(typeof se=="function"&&(H_(h,m,se,w),X=h.memoizedState),(V=eo||qO(h,m,V,w,oe,X,te))?(le||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(h.flags|=4194308)):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=w,h.memoizedState=X),N.props=w,N.state=X,N.context=te,w=V):(typeof N.componentDidMount=="function"&&(h.flags|=4194308),w=!1)}else{N=h.stateNode,SO(c,h),V=h.memoizedProps,te=h.type===h.elementType?V:ai(h.type,V),N.props=te,le=h.pendingProps,oe=N.context,X=m.contextType,typeof X=="object"&&X!==null?X=zn(X):(X=Gr(m)?Ss:mr.current,X=nu(h,X));var me=m.getDerivedStateFromProps;(se=typeof me=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(V!==le||oe!==X)&&ZO(h,N,w,X),eo=!1,oe=h.memoizedState,N.state=oe,rg(h,w,N,C);var ke=h.memoizedState;V!==le||oe!==ke||$r.current||eo?(typeof me=="function"&&(H_(h,m,me,w),ke=h.memoizedState),(te=eo||qO(h,m,te,w,oe,ke,X)||!1)?(se||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,ke,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,ke,X)),typeof N.componentDidUpdate=="function"&&(h.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof N.componentDidUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=1024),h.memoizedProps=w,h.memoizedState=ke),N.props=w,N.state=ke,N.context=X,w=te):(typeof N.componentDidUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&oe===c.memoizedState||(h.flags|=1024),w=!1)}return W_(c,h,m,w,A,C)}function W_(c,h,m,w,C,A){s3(c,h);var N=(h.flags&128)!==0;if(!w&&!N)return C&&hO(h,m,!1),la(c,h,A);w=h.stateNode,Yoe.current=h;var V=N&&typeof m.getDerivedStateFromError!="function"?null:w.render();return h.flags|=1,c!==null&&N?(h.child=su(h,c.child,null,A),h.child=su(h,null,V,A)):Mr(c,h,V,A),h.memoizedState=w.state,C&&hO(h,m,!0),h.child}function u3(c){var h=c.stateNode;h.pendingContext?fO(c,h.pendingContext,h.pendingContext!==h.context):h.context&&fO(c,h.context,!1),D_(c,h.containerInfo)}function c3(c,h,m,w,C){return ou(),__(C),h.flags|=256,Mr(c,h,m,w),h.child}var Y_={dehydrated:null,treeContext:null,retryLane:0};function X_(c){return{baseLanes:c,cachePool:null,transitions:null}}function f3(c,h,m){var w=h.pendingProps,C=Dt.current,A=!1,N=(h.flags&128)!==0,V;if((V=N)||(V=c!==null&&c.memoizedState===null?!1:(C&2)!==0),V?(A=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(C|=1),wt(Dt,C&1),c===null)return w_(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((h.mode&1)===0?h.lanes=1:c.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(N=w.children,c=w.fallback,A?(w=h.mode,A=h.child,N={mode:"hidden",children:N},(w&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=N):A=kg(N,w,0,null),c=Ns(c,w,m,null),A.return=h,c.return=h,A.sibling=c,h.child=A,h.child.memoizedState=X_(m),h.memoizedState=Y_,c):q_(h,N));if(C=c.memoizedState,C!==null&&(V=C.dehydrated,V!==null))return Xoe(c,h,N,w,V,C,m);if(A){A=w.fallback,N=h.mode,C=c.child,V=C.sibling;var X={mode:"hidden",children:w.children};return(N&1)===0&&h.child!==C?(w=h.child,w.childLanes=0,w.pendingProps=X,h.deletions=null):(w=so(C,X),w.subtreeFlags=C.subtreeFlags&14680064),V!==null?A=so(V,A):(A=Ns(A,N,m,null),A.flags|=2),A.return=h,w.return=h,w.sibling=A,h.child=w,w=A,A=h.child,N=c.child.memoizedState,N=N===null?X_(m):{baseLanes:N.baseLanes|m,cachePool:null,transitions:N.transitions},A.memoizedState=N,A.childLanes=c.childLanes&~m,h.memoizedState=Y_,w}return A=c.child,c=A.sibling,w=so(A,{mode:"visible",children:w.children}),(h.mode&1)===0&&(w.lanes=m),w.return=h,w.sibling=null,c!==null&&(m=h.deletions,m===null?(h.deletions=[c],h.flags|=16):m.push(c)),h.child=w,h.memoizedState=null,w}function q_(c,h){return h=kg({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function cg(c,h,m,w){return w!==null&&__(w),su(h,c.child,null,m),c=q_(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function Xoe(c,h,m,w,C,A,N){if(m)return h.flags&256?(h.flags&=-257,w=U_(Error(r(422))),cg(c,h,N,w)):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(A=w.fallback,C=h.mode,w=kg({mode:"visible",children:w.children},C,0,null),A=Ns(A,C,N,null),A.flags|=2,w.return=h,A.return=h,w.sibling=A,h.child=w,(h.mode&1)!==0&&su(h,c.child,null,N),h.child.memoizedState=X_(N),h.memoizedState=Y_,A);if((h.mode&1)===0)return cg(c,h,N,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var V=w.dgst;return w=V,A=Error(r(419)),w=U_(A,w,void 0),cg(c,h,N,w)}if(V=(N&c.childLanes)!==0,Wr||V){if(w=qt,w!==null){switch(N&-N){case 4:C=2;break;case 16:C=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(w.suspendedLanes|N))!==0?0:C,C!==0&&C!==A.retryLane&&(A.retryLane=C,oa(c,C),li(w,c,C,-1))}return fk(),w=U_(Error(r(421))),cg(c,h,N,w)}return C.data==="$?"?(h.flags|=128,h.child=c.child,h=sse.bind(null,c),C._reactRetry=h,null):(c=A.treeContext,cn=Ka(C.nextSibling),un=h,At=!0,ii=null,c!==null&&(Rn[On++]=ia,Rn[On++]=aa,Rn[On++]=Cs,ia=c.id,aa=c.overflow,Cs=h),h=q_(h,w.children),h.flags|=4096,h)}function d3(c,h,m){c.lanes|=h;var w=c.alternate;w!==null&&(w.lanes|=h),T_(c.return,h,m)}function K_(c,h,m,w,C){var A=c.memoizedState;A===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:C}:(A.isBackwards=h,A.rendering=null,A.renderingStartTime=0,A.last=w,A.tail=m,A.tailMode=C)}function h3(c,h,m){var w=h.pendingProps,C=w.revealOrder,A=w.tail;if(Mr(c,h,w.children,m),w=Dt.current,(w&2)!==0)w=w&1|2,h.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&d3(c,m,h);else if(c.tag===19)d3(c,m,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}w&=1}if(wt(Dt,w),(h.mode&1)===0)h.memoizedState=null;else switch(C){case"forwards":for(m=h.child,C=null;m!==null;)c=m.alternate,c!==null&&ng(c)===null&&(C=m),m=m.sibling;m=C,m===null?(C=h.child,h.child=null):(C=m.sibling,m.sibling=null),K_(h,!1,C,m,A);break;case"backwards":for(m=null,C=h.child,h.child=null;C!==null;){if(c=C.alternate,c!==null&&ng(c)===null){h.child=C;break}c=C.sibling,C.sibling=m,m=C,C=c}K_(h,!0,m,null,A);break;case"together":K_(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function fg(c,h){(h.mode&1)===0&&c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2)}function la(c,h,m){if(c!==null&&(h.dependencies=c.dependencies),Ms|=h.lanes,(m&h.childLanes)===0)return null;if(c!==null&&h.child!==c.child)throw Error(r(153));if(h.child!==null){for(c=h.child,m=so(c,c.pendingProps),h.child=m,m.return=h;c.sibling!==null;)c=c.sibling,m=m.sibling=so(c,c.pendingProps),m.return=h;m.sibling=null}return h.child}function qoe(c,h,m){switch(h.tag){case 3:u3(h),ou();break;case 5:AO(h);break;case 1:Gr(h.type)&&Yv(h);break;case 4:D_(h,h.stateNode.containerInfo);break;case 10:var w=h.type._context,C=h.memoizedProps.value;wt(Jv,w._currentValue),w._currentValue=C;break;case 13:if(w=h.memoizedState,w!==null)return w.dehydrated!==null?(wt(Dt,Dt.current&1),h.flags|=128,null):(m&h.child.childLanes)!==0?f3(c,h,m):(wt(Dt,Dt.current&1),c=la(c,h,m),c!==null?c.sibling:null);wt(Dt,Dt.current&1);break;case 19:if(w=(m&h.childLanes)!==0,(c.flags&128)!==0){if(w)return h3(c,h,m);h.flags|=128}if(C=h.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),wt(Dt,Dt.current),w)break;return null;case 22:case 23:return h.lanes=0,o3(c,h,m)}return la(c,h,m)}var p3,Z_,v3,g3;p3=function(c,h){for(var m=h.child;m!==null;){if(m.tag===5||m.tag===6)c.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===h)break;for(;m.sibling===null;){if(m.return===null||m.return===h)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Z_=function(){},v3=function(c,h,m,w){var C=c.memoizedProps;if(C!==w){c=h.stateNode,Es(Li.current);var A=null;switch(m){case"input":C=Tt(c,C),w=Tt(c,w),A=[];break;case"select":C=I({},C,{value:void 0}),w=I({},w,{value:void 0}),A=[];break;case"textarea":C=Ji(c,C),w=Ji(c,w),A=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(c.onclick=$v)}ea(m,w);var N;m=null;for(te in C)if(!w.hasOwnProperty(te)&&C.hasOwnProperty(te)&&C[te]!=null)if(te==="style"){var V=C[te];for(N in V)V.hasOwnProperty(N)&&(m||(m={}),m[N]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(i.hasOwnProperty(te)?A||(A=[]):(A=A||[]).push(te,null));for(te in w){var X=w[te];if(V=C?.[te],w.hasOwnProperty(te)&&X!==V&&(X!=null||V!=null))if(te==="style")if(V){for(N in V)!V.hasOwnProperty(N)||X&&X.hasOwnProperty(N)||(m||(m={}),m[N]="");for(N in X)X.hasOwnProperty(N)&&V[N]!==X[N]&&(m||(m={}),m[N]=X[N])}else m||(A||(A=[]),A.push(te,m)),m=X;else te==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,V=V?V.__html:void 0,X!=null&&V!==X&&(A=A||[]).push(te,X)):te==="children"?typeof X!="string"&&typeof X!="number"||(A=A||[]).push(te,""+X):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(i.hasOwnProperty(te)?(X!=null&&te==="onScroll"&&St("scroll",c),A||V===X||(A=[])):(A=A||[]).push(te,X))}m&&(A=A||[]).push("style",m);var te=A;(h.updateQueue=te)&&(h.flags|=4)}},g3=function(c,h,m,w){m!==w&&(h.flags|=4)};function Vf(c,h){if(!At)switch(c.tailMode){case"hidden":h=c.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?c.tail=null:m.sibling=null;break;case"collapsed":m=c.tail;for(var w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?h||c.tail===null?c.tail=null:c.tail.sibling=null:w.sibling=null}}function xr(c){var h=c.alternate!==null&&c.alternate.child===c.child,m=0,w=0;if(h)for(var C=c.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=w,c.childLanes=m,h}function Koe(c,h,m){var w=h.pendingProps;switch(x_(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(h),null;case 1:return Gr(h.type)&&Wv(),xr(h),null;case 3:return w=h.stateNode,cu(),Ct($r),Ct(mr),I_(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(c===null||c.child===null)&&(Zv(h)?h.flags|=4:c===null||c.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,ii!==null&&(lk(ii),ii=null))),Z_(c,h),xr(h),null;case 5:M_(h);var C=Es(zf.current);if(m=h.type,c!==null&&h.stateNode!=null)v3(c,h,m,w,C),c.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!w){if(h.stateNode===null)throw Error(r(166));return xr(h),null}if(c=Es(Li.current),Zv(h)){w=h.stateNode,m=h.type;var A=h.memoizedProps;switch(w[Mi]=h,w[If]=A,c=(h.mode&1)!==0,m){case"dialog":St("cancel",w),St("close",w);break;case"iframe":case"object":case"embed":St("load",w);break;case"video":case"audio":for(C=0;C<Df.length;C++)St(Df[C],w);break;case"source":St("error",w);break;case"img":case"image":case"link":St("error",w),St("load",w);break;case"details":St("toggle",w);break;case"input":nn(w,A),St("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!A.multiple},St("invalid",w);break;case"textarea":xv(w,A),St("invalid",w)}ea(m,A),C=null;for(var N in A)if(A.hasOwnProperty(N)){var V=A[N];N==="children"?typeof V=="string"?w.textContent!==V&&(A.suppressHydrationWarning!==!0&&Uv(w.textContent,V,c),C=["children",V]):typeof V=="number"&&w.textContent!==""+V&&(A.suppressHydrationWarning!==!0&&Uv(w.textContent,V,c),C=["children",""+V]):i.hasOwnProperty(N)&&V!=null&&N==="onScroll"&&St("scroll",w)}switch(m){case"input":Le(w),xs(w,A,!0);break;case"textarea":Le(w),wv(w);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(w.onclick=$v)}w=C,h.updateQueue=w,w!==null&&(h.flags|=4)}else{N=C.nodeType===9?C:C.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=_v(m)),c==="http://www.w3.org/1999/xhtml"?m==="script"?(c=N.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof w.is=="string"?c=N.createElement(m,{is:w.is}):(c=N.createElement(m),m==="select"&&(N=c,w.multiple?N.multiple=!0:w.size&&(N.size=w.size))):c=N.createElementNS(c,m),c[Mi]=h,c[If]=w,p3(c,h,!1,!1),h.stateNode=c;e:{switch(N=ta(m,w),m){case"dialog":St("cancel",c),St("close",c),C=w;break;case"iframe":case"object":case"embed":St("load",c),C=w;break;case"video":case"audio":for(C=0;C<Df.length;C++)St(Df[C],c);C=w;break;case"source":St("error",c),C=w;break;case"img":case"image":case"link":St("error",c),St("load",c),C=w;break;case"details":St("toggle",c),C=w;break;case"input":nn(c,w),C=Tt(c,w),St("invalid",c);break;case"option":C=w;break;case"select":c._wrapperState={wasMultiple:!!w.multiple},C=I({},w,{value:void 0}),St("invalid",c);break;case"textarea":xv(c,w),C=Ji(c,w),St("invalid",c);break;default:C=w}ea(m,C),V=C;for(A in V)if(V.hasOwnProperty(A)){var X=V[A];A==="style"?on(c,X):A==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&He(c,X)):A==="children"?typeof X=="string"?(m!=="textarea"||X!=="")&&Ue(c,X):typeof X=="number"&&Ue(c,""+X):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(i.hasOwnProperty(A)?X!=null&&A==="onScroll"&&St("scroll",c):X!=null&&S(c,A,X,N))}switch(m){case"input":Le(c),xs(c,w,!1);break;case"textarea":Le(c),wv(c);break;case"option":w.value!=null&&c.setAttribute("value",""+be(w.value));break;case"select":c.multiple=!!w.multiple,A=w.value,A!=null?an(c,!!w.multiple,A,!1):w.defaultValue!=null&&an(c,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(c.onclick=$v)}switch(m){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return xr(h),null;case 6:if(c&&h.stateNode!=null)g3(c,h,c.memoizedProps,w);else{if(typeof w!="string"&&h.stateNode===null)throw Error(r(166));if(m=Es(zf.current),Es(Li.current),Zv(h)){if(w=h.stateNode,m=h.memoizedProps,w[Mi]=h,(A=w.nodeValue!==m)&&(c=un,c!==null))switch(c.tag){case 3:Uv(w.nodeValue,m,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Uv(w.nodeValue,m,(c.mode&1)!==0)}A&&(h.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[Mi]=h,h.stateNode=w}return xr(h),null;case 13:if(Ct(Dt),w=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(At&&cn!==null&&(h.mode&1)!==0&&(h.flags&128)===0)xO(),ou(),h.flags|=98560,A=!1;else if(A=Zv(h),w!==null&&w.dehydrated!==null){if(c===null){if(!A)throw Error(r(318));if(A=h.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[Mi]=h}else ou(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;xr(h),A=!1}else ii!==null&&(lk(ii),ii=null),A=!0;if(!A)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=m,h):(w=w!==null,w!==(c!==null&&c.memoizedState!==null)&&w&&(h.child.flags|=8192,(h.mode&1)!==0&&(c===null||(Dt.current&1)!==0?Gt===0&&(Gt=3):fk())),h.updateQueue!==null&&(h.flags|=4),xr(h),null);case 4:return cu(),Z_(c,h),c===null&&Mf(h.stateNode.containerInfo),xr(h),null;case 10:return C_(h.type._context),xr(h),null;case 17:return Gr(h.type)&&Wv(),xr(h),null;case 19:if(Ct(Dt),A=h.memoizedState,A===null)return xr(h),null;if(w=(h.flags&128)!==0,N=A.rendering,N===null)if(w)Vf(A,!1);else{if(Gt!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(N=ng(c),N!==null){for(h.flags|=128,Vf(A,!1),w=N.updateQueue,w!==null&&(h.updateQueue=w,h.flags|=4),h.subtreeFlags=0,w=m,m=h.child;m!==null;)A=m,c=w,A.flags&=14680066,N=A.alternate,N===null?(A.childLanes=0,A.lanes=c,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=N.childLanes,A.lanes=N.lanes,A.child=N.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=N.memoizedProps,A.memoizedState=N.memoizedState,A.updateQueue=N.updateQueue,A.type=N.type,c=N.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),m=m.sibling;return wt(Dt,Dt.current&1|2),h.child}c=c.sibling}A.tail!==null&&Ot()>pu&&(h.flags|=128,w=!0,Vf(A,!1),h.lanes=4194304)}else{if(!w)if(c=ng(N),c!==null){if(h.flags|=128,w=!0,m=c.updateQueue,m!==null&&(h.updateQueue=m,h.flags|=4),Vf(A,!0),A.tail===null&&A.tailMode==="hidden"&&!N.alternate&&!At)return xr(h),null}else 2*Ot()-A.renderingStartTime>pu&&m!==1073741824&&(h.flags|=128,w=!0,Vf(A,!1),h.lanes=4194304);A.isBackwards?(N.sibling=h.child,h.child=N):(m=A.last,m!==null?m.sibling=N:h.child=N,A.last=N)}return A.tail!==null?(h=A.tail,A.rendering=h,A.tail=h.sibling,A.renderingStartTime=Ot(),h.sibling=null,m=Dt.current,wt(Dt,w?m&1|2:m&1),h):(xr(h),null);case 22:case 23:return ck(),w=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==w&&(h.flags|=8192),w&&(h.mode&1)!==0?(fn&1073741824)!==0&&(xr(h),h.subtreeFlags&6&&(h.flags|=8192)):xr(h),null;case 24:return null;case 25:return null}throw Error(r(156,h.tag))}function Zoe(c,h){switch(x_(h),h.tag){case 1:return Gr(h.type)&&Wv(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return cu(),Ct($r),Ct(mr),I_(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 5:return M_(h),null;case 13:if(Ct(Dt),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(r(340));ou()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return Ct(Dt),null;case 4:return cu(),null;case 10:return C_(h.type._context),null;case 22:case 23:return ck(),null;case 24:return null;default:return null}}var dg=!1,br=!1,Qoe=typeof WeakSet=="function"?WeakSet:Set,we=null;function du(c,h){var m=c.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Pt(c,h,w)}else m.current=null}function Q_(c,h,m){try{m()}catch(w){Pt(c,h,w)}}var m3=!1;function Joe(c,h){if(c_=Iv,c=q5(),r_(c)){if("selectionStart"in c)var m={start:c.selectionStart,end:c.selectionEnd};else e:{m=(m=c.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var C=w.anchorOffset,A=w.focusNode;w=w.focusOffset;try{m.nodeType,A.nodeType}catch{m=null;break e}var N=0,V=-1,X=-1,te=0,se=0,le=c,oe=null;t:for(;;){for(var me;le!==m||C!==0&&le.nodeType!==3||(V=N+C),le!==A||w!==0&&le.nodeType!==3||(X=N+w),le.nodeType===3&&(N+=le.nodeValue.length),(me=le.firstChild)!==null;)oe=le,le=me;for(;;){if(le===c)break t;if(oe===m&&++te===C&&(V=N),oe===A&&++se===w&&(X=N),(me=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=me}m=V===-1||X===-1?null:{start:V,end:X}}else m=null}m=m||{start:0,end:0}}else m=null;for(f_={focusedElem:c,selectionRange:m},Iv=!1,we=h;we!==null;)if(h=we,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,we=c;else for(;we!==null;){h=we;try{var ke=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var Ce=ke.memoizedProps,zt=ke.memoizedState,Q=h.stateNode,q=Q.getSnapshotBeforeUpdate(h.elementType===h.type?Ce:ai(h.type,Ce),zt);Q.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var J=h.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(fe){Pt(h,h.return,fe)}if(c=h.sibling,c!==null){c.return=h.return,we=c;break}we=h.return}return ke=m3,m3=!1,ke}function Uf(c,h,m){var w=h.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&c)===c){var A=C.destroy;C.destroy=void 0,A!==void 0&&Q_(h,m,A)}C=C.next}while(C!==w)}}function hg(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var m=h=h.next;do{if((m.tag&c)===c){var w=m.create;m.destroy=w()}m=m.next}while(m!==h)}}function J_(c){var h=c.ref;if(h!==null){var m=c.stateNode;c.tag,c=m,typeof h=="function"?h(c):h.current=c}}function y3(c){var h=c.alternate;h!==null&&(c.alternate=null,y3(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&(delete h[Mi],delete h[If],delete h[v_],delete h[Roe],delete h[Ooe])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function x3(c){return c.tag===5||c.tag===3||c.tag===4}function b3(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||x3(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function ek(c,h,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,h?m.nodeType===8?m.parentNode.insertBefore(c,h):m.insertBefore(c,h):(m.nodeType===8?(h=m.parentNode,h.insertBefore(c,m)):(h=m,h.appendChild(c)),m=m._reactRootContainer,m!=null||h.onclick!==null||(h.onclick=$v));else if(w!==4&&(c=c.child,c!==null))for(ek(c,h,m),c=c.sibling;c!==null;)ek(c,h,m),c=c.sibling}function tk(c,h,m){var w=c.tag;if(w===5||w===6)c=c.stateNode,h?m.insertBefore(c,h):m.appendChild(c);else if(w!==4&&(c=c.child,c!==null))for(tk(c,h,m),c=c.sibling;c!==null;)tk(c,h,m),c=c.sibling}var or=null,oi=!1;function ro(c,h,m){for(m=m.child;m!==null;)w3(c,h,m),m=m.sibling}function w3(c,h,m){if(Di&&typeof Di.onCommitFiberUnmount=="function")try{Di.onCommitFiberUnmount(Tv,m)}catch{}switch(m.tag){case 5:br||du(m,h);case 6:var w=or,C=oi;or=null,ro(c,h,m),or=w,oi=C,or!==null&&(oi?(c=or,m=m.stateNode,c.nodeType===8?c.parentNode.removeChild(m):c.removeChild(m)):or.removeChild(m.stateNode));break;case 18:or!==null&&(oi?(c=or,m=m.stateNode,c.nodeType===8?p_(c.parentNode,m):c.nodeType===1&&p_(c,m),wf(c)):p_(or,m.stateNode));break;case 4:w=or,C=oi,or=m.stateNode.containerInfo,oi=!0,ro(c,h,m),or=w,oi=C;break;case 0:case 11:case 14:case 15:if(!br&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var A=C,N=A.destroy;A=A.tag,N!==void 0&&((A&2)!==0||(A&4)!==0)&&Q_(m,h,N),C=C.next}while(C!==w)}ro(c,h,m);break;case 1:if(!br&&(du(m,h),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(V){Pt(m,h,V)}ro(c,h,m);break;case 21:ro(c,h,m);break;case 22:m.mode&1?(br=(w=br)||m.memoizedState!==null,ro(c,h,m),br=w):ro(c,h,m);break;default:ro(c,h,m)}}function _3(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var m=c.stateNode;m===null&&(m=c.stateNode=new Qoe),h.forEach(function(w){var C=lse.bind(null,c,w);m.has(w)||(m.add(w),w.then(C,C))})}}function si(c,h){var m=h.deletions;if(m!==null)for(var w=0;w<m.length;w++){var C=m[w];try{var A=c,N=h,V=N;e:for(;V!==null;){switch(V.tag){case 5:or=V.stateNode,oi=!1;break e;case 3:or=V.stateNode.containerInfo,oi=!0;break e;case 4:or=V.stateNode.containerInfo,oi=!0;break e}V=V.return}if(or===null)throw Error(r(160));w3(A,N,C),or=null,oi=!1;var X=C.alternate;X!==null&&(X.return=null),C.return=null}catch(te){Pt(C,h,te)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)k3(h,c),h=h.sibling}function k3(c,h){var m=c.alternate,w=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(si(h,c),Pi(c),w&4){try{Uf(3,c,c.return),hg(3,c)}catch(Ce){Pt(c,c.return,Ce)}try{Uf(5,c,c.return)}catch(Ce){Pt(c,c.return,Ce)}}break;case 1:si(h,c),Pi(c),w&512&&m!==null&&du(m,m.return);break;case 5:if(si(h,c),Pi(c),w&512&&m!==null&&du(m,m.return),c.flags&32){var C=c.stateNode;try{Ue(C,"")}catch(Ce){Pt(c,c.return,Ce)}}if(w&4&&(C=c.stateNode,C!=null)){var A=c.memoizedProps,N=m!==null?m.memoizedProps:A,V=c.type,X=c.updateQueue;if(c.updateQueue=null,X!==null)try{V==="input"&&A.type==="radio"&&A.name!=null&&Dr(C,A),ta(V,N);var te=ta(V,A);for(N=0;N<X.length;N+=2){var se=X[N],le=X[N+1];se==="style"?on(C,le):se==="dangerouslySetInnerHTML"?He(C,le):se==="children"?Ue(C,le):S(C,se,le,te)}switch(V){case"input":Ur(C,A);break;case"textarea":bv(C,A);break;case"select":var oe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!A.multiple;var me=A.value;me!=null?an(C,!!A.multiple,me,!1):oe!==!!A.multiple&&(A.defaultValue!=null?an(C,!!A.multiple,A.defaultValue,!0):an(C,!!A.multiple,A.multiple?[]:"",!1))}C[If]=A}catch(Ce){Pt(c,c.return,Ce)}}break;case 6:if(si(h,c),Pi(c),w&4){if(c.stateNode===null)throw Error(r(162));C=c.stateNode,A=c.memoizedProps;try{C.nodeValue=A}catch(Ce){Pt(c,c.return,Ce)}}break;case 3:if(si(h,c),Pi(c),w&4&&m!==null&&m.memoizedState.isDehydrated)try{wf(h.containerInfo)}catch(Ce){Pt(c,c.return,Ce)}break;case 4:si(h,c),Pi(c);break;case 13:si(h,c),Pi(c),C=c.child,C.flags&8192&&(A=C.memoizedState!==null,C.stateNode.isHidden=A,!A||C.alternate!==null&&C.alternate.memoizedState!==null||(ik=Ot())),w&4&&_3(c);break;case 22:if(se=m!==null&&m.memoizedState!==null,c.mode&1?(br=(te=br)||se,si(h,c),br=te):si(h,c),Pi(c),w&8192){if(te=c.memoizedState!==null,(c.stateNode.isHidden=te)&&!se&&(c.mode&1)!==0)for(we=c,se=c.child;se!==null;){for(le=we=se;we!==null;){switch(oe=we,me=oe.child,oe.tag){case 0:case 11:case 14:case 15:Uf(4,oe,oe.return);break;case 1:du(oe,oe.return);var ke=oe.stateNode;if(typeof ke.componentWillUnmount=="function"){w=oe,m=oe.return;try{h=w,ke.props=h.memoizedProps,ke.state=h.memoizedState,ke.componentWillUnmount()}catch(Ce){Pt(w,m,Ce)}}break;case 5:du(oe,oe.return);break;case 22:if(oe.memoizedState!==null){T3(le);continue}}me!==null?(me.return=oe,we=me):T3(le)}se=se.sibling}e:for(se=null,le=c;;){if(le.tag===5){if(se===null){se=le;try{C=le.stateNode,te?(A=C.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(V=le.stateNode,X=le.memoizedProps.style,N=X!=null&&X.hasOwnProperty("display")?X.display:null,V.style.display=ir("display",N))}catch(Ce){Pt(c,c.return,Ce)}}}else if(le.tag===6){if(se===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(Ce){Pt(c,c.return,Ce)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===c)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===c)break e;for(;le.sibling===null;){if(le.return===null||le.return===c)break e;se===le&&(se=null),le=le.return}se===le&&(se=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:si(h,c),Pi(c),w&4&&_3(c);break;case 21:break;default:si(h,c),Pi(c)}}function Pi(c){var h=c.flags;if(h&2){try{e:{for(var m=c.return;m!==null;){if(x3(m)){var w=m;break e}m=m.return}throw Error(r(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(Ue(C,""),w.flags&=-33);var A=b3(c);tk(c,A,C);break;case 3:case 4:var N=w.stateNode.containerInfo,V=b3(c);ek(c,V,N);break;default:throw Error(r(161))}}catch(X){Pt(c,c.return,X)}c.flags&=-3}h&4096&&(c.flags&=-4097)}function ese(c,h,m){we=c,S3(c)}function S3(c,h,m){for(var w=(c.mode&1)!==0;we!==null;){var C=we,A=C.child;if(C.tag===22&&w){var N=C.memoizedState!==null||dg;if(!N){var V=C.alternate,X=V!==null&&V.memoizedState!==null||br;V=dg;var te=br;if(dg=N,(br=X)&&!te)for(we=C;we!==null;)N=we,X=N.child,N.tag===22&&N.memoizedState!==null?A3(C):X!==null?(X.return=N,we=X):A3(C);for(;A!==null;)we=A,S3(A),A=A.sibling;we=C,dg=V,br=te}C3(c)}else(C.subtreeFlags&8772)!==0&&A!==null?(A.return=C,we=A):C3(c)}}function C3(c){for(;we!==null;){var h=we;if((h.flags&8772)!==0){var m=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:br||hg(5,h);break;case 1:var w=h.stateNode;if(h.flags&4&&!br)if(m===null)w.componentDidMount();else{var C=h.elementType===h.type?m.memoizedProps:ai(h.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var A=h.updateQueue;A!==null&&TO(h,A,w);break;case 3:var N=h.updateQueue;if(N!==null){if(m=null,h.child!==null)switch(h.child.tag){case 5:m=h.child.stateNode;break;case 1:m=h.child.stateNode}TO(h,N,m)}break;case 5:var V=h.stateNode;if(m===null&&h.flags&4){m=V;var X=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&m.focus();break;case"img":X.src&&(m.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var te=h.alternate;if(te!==null){var se=te.memoizedState;if(se!==null){var le=se.dehydrated;le!==null&&wf(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}br||h.flags&512&&J_(h)}catch(oe){Pt(h,h.return,oe)}}if(h===c){we=null;break}if(m=h.sibling,m!==null){m.return=h.return,we=m;break}we=h.return}}function T3(c){for(;we!==null;){var h=we;if(h===c){we=null;break}var m=h.sibling;if(m!==null){m.return=h.return,we=m;break}we=h.return}}function A3(c){for(;we!==null;){var h=we;try{switch(h.tag){case 0:case 11:case 15:var m=h.return;try{hg(4,h)}catch(X){Pt(h,m,X)}break;case 1:var w=h.stateNode;if(typeof w.componentDidMount=="function"){var C=h.return;try{w.componentDidMount()}catch(X){Pt(h,C,X)}}var A=h.return;try{J_(h)}catch(X){Pt(h,A,X)}break;case 5:var N=h.return;try{J_(h)}catch(X){Pt(h,N,X)}}}catch(X){Pt(h,h.return,X)}if(h===c){we=null;break}var V=h.sibling;if(V!==null){V.return=h.return,we=V;break}we=h.return}}var tse=Math.ceil,pg=T.ReactCurrentDispatcher,rk=T.ReactCurrentOwner,Bn=T.ReactCurrentBatchConfig,rt=0,qt=null,Ut=null,sr=0,fn=0,hu=Za(0),Gt=0,$f=null,Ms=0,vg=0,nk=0,Gf=null,Yr=null,ik=0,pu=1/0,ua=null,gg=!1,ak=null,no=null,mg=!1,io=null,yg=0,Wf=0,ok=null,xg=-1,bg=0;function Lr(){return(rt&6)!==0?Ot():xg!==-1?xg:xg=Ot()}function ao(c){return(c.mode&1)===0?1:(rt&2)!==0&&sr!==0?sr&-sr:Foe.transition!==null?(bg===0&&(bg=b5()),bg):(c=ht,c!==0||(c=window.event,c=c===void 0?16:D5(c.type)),c)}function li(c,h,m,w){if(50<Wf)throw Wf=0,ok=null,Error(r(185));gf(c,m,w),((rt&2)===0||c!==qt)&&(c===qt&&((rt&2)===0&&(vg|=m),Gt===4&&oo(c,sr)),Xr(c,w),m===1&&rt===0&&(h.mode&1)===0&&(pu=Ot()+500,Xv&&Ja()))}function Xr(c,h){var m=c.callbackNode;Fae(c,h);var w=Dv(c,c===qt?sr:0);if(w===0)m!==null&&m5(m),c.callbackNode=null,c.callbackPriority=0;else if(h=w&-w,c.callbackPriority!==h){if(m!=null&&m5(m),h===1)c.tag===0?zoe(D3.bind(null,c)):pO(D3.bind(null,c)),Poe(function(){(rt&6)===0&&Ja()}),m=null;else{switch(w5(w)){case 1:m=Bw;break;case 4:m=y5;break;case 16:m=Cv;break;case 536870912:m=x5;break;default:m=Cv}m=z3(m,E3.bind(null,c))}c.callbackPriority=h,c.callbackNode=m}}function E3(c,h){if(xg=-1,bg=0,(rt&6)!==0)throw Error(r(327));var m=c.callbackNode;if(vu()&&c.callbackNode!==m)return null;var w=Dv(c,c===qt?sr:0);if(w===0)return null;if((w&30)!==0||(w&c.expiredLanes)!==0||h)h=wg(c,w);else{h=w;var C=rt;rt|=2;var A=L3();(qt!==c||sr!==h)&&(ua=null,pu=Ot()+500,Is(c,h));do try{ise();break}catch(V){M3(c,V)}while(!0);S_(),pg.current=A,rt=C,Ut!==null?h=0:(qt=null,sr=0,h=Gt)}if(h!==0){if(h===2&&(C=jw(c),C!==0&&(w=C,h=sk(c,C))),h===1)throw m=$f,Is(c,0),oo(c,w),Xr(c,Ot()),m;if(h===6)oo(c,w);else{if(C=c.current.alternate,(w&30)===0&&!rse(C)&&(h=wg(c,w),h===2&&(A=jw(c),A!==0&&(w=A,h=sk(c,A))),h===1))throw m=$f,Is(c,0),oo(c,w),Xr(c,Ot()),m;switch(c.finishedWork=C,c.finishedLanes=w,h){case 0:case 1:throw Error(r(345));case 2:Ps(c,Yr,ua);break;case 3:if(oo(c,w),(w&130023424)===w&&(h=ik+500-Ot(),10<h)){if(Dv(c,0)!==0)break;if(C=c.suspendedLanes,(C&w)!==w){Lr(),c.pingedLanes|=c.suspendedLanes&C;break}c.timeoutHandle=h_(Ps.bind(null,c,Yr,ua),h);break}Ps(c,Yr,ua);break;case 4:if(oo(c,w),(w&4194240)===w)break;for(h=c.eventTimes,C=-1;0<w;){var N=31-ri(w);A=1<<N,N=h[N],N>C&&(C=N),w&=~A}if(w=C,w=Ot()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*tse(w/1960))-w,10<w){c.timeoutHandle=h_(Ps.bind(null,c,Yr,ua),w);break}Ps(c,Yr,ua);break;case 5:Ps(c,Yr,ua);break;default:throw Error(r(329))}}}return Xr(c,Ot()),c.callbackNode===m?E3.bind(null,c):null}function sk(c,h){var m=Gf;return c.current.memoizedState.isDehydrated&&(Is(c,h).flags|=256),c=wg(c,h),c!==2&&(h=Yr,Yr=m,h!==null&&lk(h)),c}function lk(c){Yr===null?Yr=c:Yr.push.apply(Yr,c)}function rse(c){for(var h=c;;){if(h.flags&16384){var m=h.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var C=m[w],A=C.getSnapshot;C=C.value;try{if(!ni(A(),C))return!1}catch{return!1}}}if(m=h.child,h.subtreeFlags&16384&&m!==null)m.return=h,h=m;else{if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function oo(c,h){for(h&=~nk,h&=~vg,c.suspendedLanes|=h,c.pingedLanes&=~h,c=c.expirationTimes;0<h;){var m=31-ri(h),w=1<<m;c[m]=-1,h&=~w}}function D3(c){if((rt&6)!==0)throw Error(r(327));vu();var h=Dv(c,0);if((h&1)===0)return Xr(c,Ot()),null;var m=wg(c,h);if(c.tag!==0&&m===2){var w=jw(c);w!==0&&(h=w,m=sk(c,w))}if(m===1)throw m=$f,Is(c,0),oo(c,h),Xr(c,Ot()),m;if(m===6)throw Error(r(345));return c.finishedWork=c.current.alternate,c.finishedLanes=h,Ps(c,Yr,ua),Xr(c,Ot()),null}function uk(c,h){var m=rt;rt|=1;try{return c(h)}finally{rt=m,rt===0&&(pu=Ot()+500,Xv&&Ja())}}function Ls(c){io!==null&&io.tag===0&&(rt&6)===0&&vu();var h=rt;rt|=1;var m=Bn.transition,w=ht;try{if(Bn.transition=null,ht=1,c)return c()}finally{ht=w,Bn.transition=m,rt=h,(rt&6)===0&&Ja()}}function ck(){fn=hu.current,Ct(hu)}function Is(c,h){c.finishedWork=null,c.finishedLanes=0;var m=c.timeoutHandle;if(m!==-1&&(c.timeoutHandle=-1,Ioe(m)),Ut!==null)for(m=Ut.return;m!==null;){var w=m;switch(x_(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Wv();break;case 3:cu(),Ct($r),Ct(mr),I_();break;case 5:M_(w);break;case 4:cu();break;case 13:Ct(Dt);break;case 19:Ct(Dt);break;case 10:C_(w.type._context);break;case 22:case 23:ck()}m=m.return}if(qt=c,Ut=c=so(c.current,null),sr=fn=h,Gt=0,$f=null,nk=vg=Ms=0,Yr=Gf=null,As!==null){for(h=0;h<As.length;h++)if(m=As[h],w=m.interleaved,w!==null){m.interleaved=null;var C=w.next,A=m.pending;if(A!==null){var N=A.next;A.next=C,w.next=N}m.pending=w}As=null}return c}function M3(c,h){do{var m=Ut;try{if(S_(),ig.current=lg,ag){for(var w=Mt.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}ag=!1}if(Ds=0,Xt=$t=Mt=null,Ff=!1,Bf=0,rk.current=null,m===null||m.return===null){Gt=1,$f=h,Ut=null;break}e:{var A=c,N=m.return,V=m,X=h;if(h=sr,V.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var te=X,se=V,le=se.tag;if((se.mode&1)===0&&(le===0||le===11||le===15)){var oe=se.alternate;oe?(se.updateQueue=oe.updateQueue,se.memoizedState=oe.memoizedState,se.lanes=oe.lanes):(se.updateQueue=null,se.memoizedState=null)}var me=t3(N);if(me!==null){me.flags&=-257,r3(me,N,V,A,h),me.mode&1&&e3(A,te,h),h=me,X=te;var ke=h.updateQueue;if(ke===null){var Ce=new Set;Ce.add(X),h.updateQueue=Ce}else ke.add(X);break e}else{if((h&1)===0){e3(A,te,h),fk();break e}X=Error(r(426))}}else if(At&&V.mode&1){var zt=t3(N);if(zt!==null){(zt.flags&65536)===0&&(zt.flags|=256),r3(zt,N,V,A,h),__(fu(X,V));break e}}A=X=fu(X,V),Gt!==4&&(Gt=2),Gf===null?Gf=[A]:Gf.push(A),A=N;do{switch(A.tag){case 3:A.flags|=65536,h&=-h,A.lanes|=h;var Q=QO(A,X,h);CO(A,Q);break e;case 1:V=X;var q=A.type,J=A.stateNode;if((A.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(no===null||!no.has(J)))){A.flags|=65536,h&=-h,A.lanes|=h;var fe=JO(A,V,h);CO(A,fe);break e}}A=A.return}while(A!==null)}P3(m)}catch(Te){h=Te,Ut===m&&m!==null&&(Ut=m=m.return);continue}break}while(!0)}function L3(){var c=pg.current;return pg.current=lg,c===null?lg:c}function fk(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),qt===null||(Ms&268435455)===0&&(vg&268435455)===0||oo(qt,sr)}function wg(c,h){var m=rt;rt|=2;var w=L3();(qt!==c||sr!==h)&&(ua=null,Is(c,h));do try{nse();break}catch(C){M3(c,C)}while(!0);if(S_(),rt=m,pg.current=w,Ut!==null)throw Error(r(261));return qt=null,sr=0,Gt}function nse(){for(;Ut!==null;)I3(Ut)}function ise(){for(;Ut!==null&&!Dae();)I3(Ut)}function I3(c){var h=O3(c.alternate,c,fn);c.memoizedProps=c.pendingProps,h===null?P3(c):Ut=h,rk.current=null}function P3(c){var h=c;do{var m=h.alternate;if(c=h.return,(h.flags&32768)===0){if(m=Koe(m,h,fn),m!==null){Ut=m;return}}else{if(m=Zoe(m,h),m!==null){m.flags&=32767,Ut=m;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Gt=6,Ut=null;return}}if(h=h.sibling,h!==null){Ut=h;return}Ut=h=c}while(h!==null);Gt===0&&(Gt=5)}function Ps(c,h,m){var w=ht,C=Bn.transition;try{Bn.transition=null,ht=1,ase(c,h,m,w)}finally{Bn.transition=C,ht=w}return null}function ase(c,h,m,w){do vu();while(io!==null);if((rt&6)!==0)throw Error(r(327));m=c.finishedWork;var C=c.finishedLanes;if(m===null)return null;if(c.finishedWork=null,c.finishedLanes=0,m===c.current)throw Error(r(177));c.callbackNode=null,c.callbackPriority=0;var A=m.lanes|m.childLanes;if(Bae(c,A),c===qt&&(Ut=qt=null,sr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||mg||(mg=!0,z3(Cv,function(){return vu(),null})),A=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||A){A=Bn.transition,Bn.transition=null;var N=ht;ht=1;var V=rt;rt|=4,rk.current=null,Joe(c,m),k3(m,c),Coe(f_),Iv=!!c_,f_=c_=null,c.current=m,ese(m),Mae(),rt=V,ht=N,Bn.transition=A}else c.current=m;if(mg&&(mg=!1,io=c,yg=C),A=c.pendingLanes,A===0&&(no=null),Pae(m.stateNode),Xr(c,Ot()),h!==null)for(w=c.onRecoverableError,m=0;m<h.length;m++)C=h[m],w(C.value,{componentStack:C.stack,digest:C.digest});if(gg)throw gg=!1,c=ak,ak=null,c;return(yg&1)!==0&&c.tag!==0&&vu(),A=c.pendingLanes,(A&1)!==0?c===ok?Wf++:(Wf=0,ok=c):Wf=0,Ja(),null}function vu(){if(io!==null){var c=w5(yg),h=Bn.transition,m=ht;try{if(Bn.transition=null,ht=16>c?16:c,io===null)var w=!1;else{if(c=io,io=null,yg=0,(rt&6)!==0)throw Error(r(331));var C=rt;for(rt|=4,we=c.current;we!==null;){var A=we,N=A.child;if((we.flags&16)!==0){var V=A.deletions;if(V!==null){for(var X=0;X<V.length;X++){var te=V[X];for(we=te;we!==null;){var se=we;switch(se.tag){case 0:case 11:case 15:Uf(8,se,A)}var le=se.child;if(le!==null)le.return=se,we=le;else for(;we!==null;){se=we;var oe=se.sibling,me=se.return;if(y3(se),se===te){we=null;break}if(oe!==null){oe.return=me,we=oe;break}we=me}}}var ke=A.alternate;if(ke!==null){var Ce=ke.child;if(Ce!==null){ke.child=null;do{var zt=Ce.sibling;Ce.sibling=null,Ce=zt}while(Ce!==null)}}we=A}}if((A.subtreeFlags&2064)!==0&&N!==null)N.return=A,we=N;else e:for(;we!==null;){if(A=we,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:Uf(9,A,A.return)}var Q=A.sibling;if(Q!==null){Q.return=A.return,we=Q;break e}we=A.return}}var q=c.current;for(we=q;we!==null;){N=we;var J=N.child;if((N.subtreeFlags&2064)!==0&&J!==null)J.return=N,we=J;else e:for(N=q;we!==null;){if(V=we,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:hg(9,V)}}catch(Te){Pt(V,V.return,Te)}if(V===N){we=null;break e}var fe=V.sibling;if(fe!==null){fe.return=V.return,we=fe;break e}we=V.return}}if(rt=C,Ja(),Di&&typeof Di.onPostCommitFiberRoot=="function")try{Di.onPostCommitFiberRoot(Tv,c)}catch{}w=!0}return w}finally{ht=m,Bn.transition=h}}return!1}function N3(c,h,m){h=fu(m,h),h=QO(c,h,1),c=to(c,h,1),h=Lr(),c!==null&&(gf(c,1,h),Xr(c,h))}function Pt(c,h,m){if(c.tag===3)N3(c,c,m);else for(;h!==null;){if(h.tag===3){N3(h,c,m);break}else if(h.tag===1){var w=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(no===null||!no.has(w))){c=fu(m,c),c=JO(h,c,1),h=to(h,c,1),c=Lr(),h!==null&&(gf(h,1,c),Xr(h,c));break}}h=h.return}}function ose(c,h,m){var w=c.pingCache;w!==null&&w.delete(h),h=Lr(),c.pingedLanes|=c.suspendedLanes&m,qt===c&&(sr&m)===m&&(Gt===4||Gt===3&&(sr&130023424)===sr&&500>Ot()-ik?Is(c,0):nk|=m),Xr(c,h)}function R3(c,h){h===0&&((c.mode&1)===0?h=1:(h=Ev,Ev<<=1,(Ev&130023424)===0&&(Ev=4194304)));var m=Lr();c=oa(c,h),c!==null&&(gf(c,h,m),Xr(c,m))}function sse(c){var h=c.memoizedState,m=0;h!==null&&(m=h.retryLane),R3(c,m)}function lse(c,h){var m=0;switch(c.tag){case 13:var w=c.stateNode,C=c.memoizedState;C!==null&&(m=C.retryLane);break;case 19:w=c.stateNode;break;default:throw Error(r(314))}w!==null&&w.delete(h),R3(c,m)}var O3;O3=function(c,h,m){if(c!==null)if(c.memoizedProps!==h.pendingProps||$r.current)Wr=!0;else{if((c.lanes&m)===0&&(h.flags&128)===0)return Wr=!1,qoe(c,h,m);Wr=(c.flags&131072)!==0}else Wr=!1,At&&(h.flags&1048576)!==0&&vO(h,Kv,h.index);switch(h.lanes=0,h.tag){case 2:var w=h.type;fg(c,h),c=h.pendingProps;var C=nu(h,mr.current);uu(h,m),C=R_(null,h,w,c,C,m);var A=O_();return h.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,Gr(w)?(A=!0,Yv(h)):A=!1,h.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,E_(h),C.updater=ug,h.stateNode=C,C._reactInternals=h,V_(h,w,c,m),h=W_(null,h,w,!0,A,m)):(h.tag=0,At&&A&&y_(h),Mr(null,h,C,m),h=h.child),h;case 16:w=h.elementType;e:{switch(fg(c,h),c=h.pendingProps,C=w._init,w=C(w._payload),h.type=w,C=h.tag=cse(w),c=ai(w,c),C){case 0:h=G_(null,h,w,c,m);break e;case 1:h=l3(null,h,w,c,m);break e;case 11:h=n3(null,h,w,c,m);break e;case 14:h=i3(null,h,w,ai(w.type,c),m);break e}throw Error(r(306,w,""))}return h;case 0:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),G_(c,h,w,C,m);case 1:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),l3(c,h,w,C,m);case 3:e:{if(u3(h),c===null)throw Error(r(387));w=h.pendingProps,A=h.memoizedState,C=A.element,SO(c,h),rg(h,w,null,m);var N=h.memoizedState;if(w=N.element,A.isDehydrated)if(A={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},h.updateQueue.baseState=A,h.memoizedState=A,h.flags&256){C=fu(Error(r(423)),h),h=c3(c,h,w,m,C);break e}else if(w!==C){C=fu(Error(r(424)),h),h=c3(c,h,w,m,C);break e}else for(cn=Ka(h.stateNode.containerInfo.firstChild),un=h,At=!0,ii=null,m=_O(h,null,w,m),h.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ou(),w===C){h=la(c,h,m);break e}Mr(c,h,w,m)}h=h.child}return h;case 5:return AO(h),c===null&&w_(h),w=h.type,C=h.pendingProps,A=c!==null?c.memoizedProps:null,N=C.children,d_(w,C)?N=null:A!==null&&d_(w,A)&&(h.flags|=32),s3(c,h),Mr(c,h,N,m),h.child;case 6:return c===null&&w_(h),null;case 13:return f3(c,h,m);case 4:return D_(h,h.stateNode.containerInfo),w=h.pendingProps,c===null?h.child=su(h,null,w,m):Mr(c,h,w,m),h.child;case 11:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),n3(c,h,w,C,m);case 7:return Mr(c,h,h.pendingProps,m),h.child;case 8:return Mr(c,h,h.pendingProps.children,m),h.child;case 12:return Mr(c,h,h.pendingProps.children,m),h.child;case 10:e:{if(w=h.type._context,C=h.pendingProps,A=h.memoizedProps,N=C.value,wt(Jv,w._currentValue),w._currentValue=N,A!==null)if(ni(A.value,N)){if(A.children===C.children&&!$r.current){h=la(c,h,m);break e}}else for(A=h.child,A!==null&&(A.return=h);A!==null;){var V=A.dependencies;if(V!==null){N=A.child;for(var X=V.firstContext;X!==null;){if(X.context===w){if(A.tag===1){X=sa(-1,m&-m),X.tag=2;var te=A.updateQueue;if(te!==null){te=te.shared;var se=te.pending;se===null?X.next=X:(X.next=se.next,se.next=X),te.pending=X}}A.lanes|=m,X=A.alternate,X!==null&&(X.lanes|=m),T_(A.return,m,h),V.lanes|=m;break}X=X.next}}else if(A.tag===10)N=A.type===h.type?null:A.child;else if(A.tag===18){if(N=A.return,N===null)throw Error(r(341));N.lanes|=m,V=N.alternate,V!==null&&(V.lanes|=m),T_(N,m,h),N=A.sibling}else N=A.child;if(N!==null)N.return=A;else for(N=A;N!==null;){if(N===h){N=null;break}if(A=N.sibling,A!==null){A.return=N.return,N=A;break}N=N.return}A=N}Mr(c,h,C.children,m),h=h.child}return h;case 9:return C=h.type,w=h.pendingProps.children,uu(h,m),C=zn(C),w=w(C),h.flags|=1,Mr(c,h,w,m),h.child;case 14:return w=h.type,C=ai(w,h.pendingProps),C=ai(w.type,C),i3(c,h,w,C,m);case 15:return a3(c,h,h.type,h.pendingProps,m);case 17:return w=h.type,C=h.pendingProps,C=h.elementType===w?C:ai(w,C),fg(c,h),h.tag=1,Gr(w)?(c=!0,Yv(h)):c=!1,uu(h,m),KO(h,w,C),V_(h,w,C,m),W_(null,h,w,!0,c,m);case 19:return h3(c,h,m);case 22:return o3(c,h,m)}throw Error(r(156,h.tag))};function z3(c,h){return g5(c,h)}function use(c,h,m,w){this.tag=c,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(c,h,m,w){return new use(c,h,m,w)}function dk(c){return c=c.prototype,!(!c||!c.isReactComponent)}function cse(c){if(typeof c=="function")return dk(c)?1:0;if(c!=null){if(c=c.$$typeof,c===j)return 11;if(c===K)return 14}return 2}function so(c,h){var m=c.alternate;return m===null?(m=jn(c.tag,h,c.key,c.mode),m.elementType=c.elementType,m.type=c.type,m.stateNode=c.stateNode,m.alternate=c,c.alternate=m):(m.pendingProps=h,m.type=c.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=c.flags&14680064,m.childLanes=c.childLanes,m.lanes=c.lanes,m.child=c.child,m.memoizedProps=c.memoizedProps,m.memoizedState=c.memoizedState,m.updateQueue=c.updateQueue,h=c.dependencies,m.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},m.sibling=c.sibling,m.index=c.index,m.ref=c.ref,m}function _g(c,h,m,w,C,A){var N=2;if(w=c,typeof c=="function")dk(c)&&(N=1);else if(typeof c=="string")N=5;else e:switch(c){case L:return Ns(m.children,C,A,h);case R:N=8,C|=8;break;case O:return c=jn(12,m,h,C|2),c.elementType=O,c.lanes=A,c;case B:return c=jn(13,m,h,C),c.elementType=B,c.lanes=A,c;case $:return c=jn(19,m,h,C),c.elementType=$,c.lanes=A,c;case re:return kg(m,C,A,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case M:N=10;break e;case P:N=9;break e;case j:N=11;break e;case K:N=14;break e;case Z:N=16,w=null;break e}throw Error(r(130,c==null?c:typeof c,""))}return h=jn(N,m,h,C),h.elementType=c,h.type=w,h.lanes=A,h}function Ns(c,h,m,w){return c=jn(7,c,w,h),c.lanes=m,c}function kg(c,h,m,w){return c=jn(22,c,w,h),c.elementType=re,c.lanes=m,c.stateNode={isHidden:!1},c}function hk(c,h,m){return c=jn(6,c,null,h),c.lanes=m,c}function pk(c,h,m){return h=jn(4,c.children!==null?c.children:[],c.key,h),h.lanes=m,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function fse(c,h,m,w,C){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hw(0),this.expirationTimes=Hw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hw(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function vk(c,h,m,w,C,A,N,V,X){return c=new fse(c,h,m,V,X),h===1?(h=1,A===!0&&(h|=8)):h=0,A=jn(3,null,null,h),c.current=A,A.stateNode=c,A.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},E_(A),c}function dse(c,h,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:w==null?null:""+w,children:c,containerInfo:h,implementation:m}}function F3(c){if(!c)return Qa;c=c._reactInternals;e:{if(_s(c)!==c||c.tag!==1)throw Error(r(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(Gr(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(r(171))}if(c.tag===1){var m=c.type;if(Gr(m))return dO(c,m,h)}return h}function B3(c,h,m,w,C,A,N,V,X){return c=vk(m,w,!0,c,C,A,N,V,X),c.context=F3(null),m=c.current,w=Lr(),C=ao(m),A=sa(w,C),A.callback=h??null,to(m,A,C),c.current.lanes=C,gf(c,C,w),Xr(c,w),c}function Sg(c,h,m,w){var C=h.current,A=Lr(),N=ao(C);return m=F3(m),h.context===null?h.context=m:h.pendingContext=m,h=sa(A,N),h.payload={element:c},w=w===void 0?null:w,w!==null&&(h.callback=w),c=to(C,h,N),c!==null&&(li(c,C,N,A),tg(c,C,N)),N}function Cg(c){return c=c.current,c.child?(c.child.tag===5,c.child.stateNode):null}function j3(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var m=c.retryLane;c.retryLane=m!==0&&m<h?m:h}}function gk(c,h){j3(c,h),(c=c.alternate)&&j3(c,h)}function hse(){return null}var H3=typeof reportError=="function"?reportError:function(c){console.error(c)};function mk(c){this._internalRoot=c}Tg.prototype.render=mk.prototype.render=function(c){var h=this._internalRoot;if(h===null)throw Error(r(409));Sg(c,h,null,null)},Tg.prototype.unmount=mk.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var h=c.containerInfo;Ls(function(){Sg(null,c,null,null)}),h[ra]=null}};function Tg(c){this._internalRoot=c}Tg.prototype.unstable_scheduleHydration=function(c){if(c){var h=S5();c={blockedOn:null,target:c,priority:h};for(var m=0;m<Ya.length&&h!==0&&h<Ya[m].priority;m++);Ya.splice(m,0,c),m===0&&A5(c)}};function yk(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function Ag(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function V3(){}function pse(c,h,m,w,C){if(C){if(typeof w=="function"){var A=w;w=function(){var te=Cg(N);A.call(te)}}var N=B3(h,w,c,0,null,!1,!1,"",V3);return c._reactRootContainer=N,c[ra]=N.current,Mf(c.nodeType===8?c.parentNode:c),Ls(),N}for(;C=c.lastChild;)c.removeChild(C);if(typeof w=="function"){var V=w;w=function(){var te=Cg(X);V.call(te)}}var X=vk(c,0,!1,null,null,!1,!1,"",V3);return c._reactRootContainer=X,c[ra]=X.current,Mf(c.nodeType===8?c.parentNode:c),Ls(function(){Sg(h,X,m,w)}),X}function Eg(c,h,m,w,C){var A=m._reactRootContainer;if(A){var N=A;if(typeof C=="function"){var V=C;C=function(){var X=Cg(N);V.call(X)}}Sg(h,N,c,C)}else N=pse(m,h,c,C,w);return Cg(N)}_5=function(c){switch(c.tag){case 3:var h=c.stateNode;if(h.current.memoizedState.isDehydrated){var m=vf(h.pendingLanes);m!==0&&(Vw(h,m|1),Xr(h,Ot()),(rt&6)===0&&(pu=Ot()+500,Ja()))}break;case 13:Ls(function(){var w=oa(c,1);if(w!==null){var C=Lr();li(w,c,1,C)}}),gk(c,1)}},Uw=function(c){if(c.tag===13){var h=oa(c,134217728);if(h!==null){var m=Lr();li(h,c,134217728,m)}gk(c,134217728)}},k5=function(c){if(c.tag===13){var h=ao(c),m=oa(c,h);if(m!==null){var w=Lr();li(m,c,h,w)}gk(c,h)}},S5=function(){return ht},C5=function(c,h){var m=ht;try{return ht=c,h()}finally{ht=m}},ar=function(c,h,m){switch(h){case"input":if(Ur(c,m),h=m.name,m.type==="radio"&&h!=null){for(m=c;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<m.length;h++){var w=m[h];if(w!==c&&w.form===c.form){var C=Gv(w);if(!C)throw Error(r(90));Xe(w),Ur(w,C)}}}break;case"textarea":bv(c,m);break;case"select":h=m.value,h!=null&&an(c,!!m.multiple,h,!1)}},u5=uk,c5=Ls;var vse={usingClientEntryPoint:!1,Events:[Pf,tu,Gv,s5,l5,uk]},Yf={findFiberByHostInstance:ks,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gse={bundleType:Yf.bundleType,version:Yf.version,rendererPackageName:Yf.rendererPackageName,rendererConfig:Yf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=p5(c),c===null?null:c.stateNode},findFiberByHostInstance:Yf.findFiberByHostInstance||hse,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dg.isDisabled&&Dg.supportsFiber)try{Tv=Dg.inject(gse),Di=Dg}catch{}}return Ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vse,Ir.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yk(h))throw Error(r(200));return dse(c,h,null,m)},Ir.createRoot=function(c,h){if(!yk(c))throw Error(r(299));var m=!1,w="",C=H3;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=vk(c,1,!1,null,null,m,!1,w,C),c[ra]=h.current,Mf(c.nodeType===8?c.parentNode:c),new mk(h)},Ir.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=p5(h),c=c===null?null:c.stateNode,c},Ir.flushSync=function(c){return Ls(c)},Ir.hydrate=function(c,h,m){if(!Ag(h))throw Error(r(200));return Eg(null,c,h,!0,m)},Ir.hydrateRoot=function(c,h,m){if(!yk(c))throw Error(r(405));var w=m!=null&&m.hydratedSources||null,C=!1,A="",N=H3;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(A=m.identifierPrefix),m.onRecoverableError!==void 0&&(N=m.onRecoverableError)),h=B3(h,null,c,1,m??null,C,!1,A,N),c[ra]=h.current,Mf(c),w)for(c=0;c<w.length;c++)m=w[c],C=m._getVersion,C=C(m._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[m,C]:h.mutableSourceEagerHydrationData.push(m,C);return new Tg(h)},Ir.render=function(c,h,m){if(!Ag(h))throw Error(r(200));return Eg(null,c,h,!1,m)},Ir.unmountComponentAtNode=function(c){if(!Ag(c))throw Error(r(40));return c._reactRootContainer?(Ls(function(){Eg(null,null,c,!1,function(){c._reactRootContainer=null,c[ra]=null})}),!0):!1},Ir.unstable_batchedUpdates=uk,Ir.unstable_renderSubtreeIntoContainer=function(c,h,m,w){if(!Ag(m))throw Error(r(200));if(c==null||c._reactInternals===void 0)throw Error(r(38));return Eg(c,h,m,!1,w)},Ir.version="18.3.1-next-f1338f8080-20240426",Ir}var Tk;function K3(){if(Tk)return Pg.exports;Tk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Pg.exports=q3(),Pg.exports}var Ak;function Z3(){if(Ak)return Xf;Ak=1;var e=K3();return Xf.createRoot=e.createRoot,Xf.hydrateRoot=e.hydrateRoot,Xf}var Q3=Z3();const J3=".aid-root{color-scheme:light;--background: 0 0% 100%;--background-secondary: 210, 40%, 96%;--foreground: 222.2 47.4% 11.2%;--foreground-secondary: 253, 40%, 16%;--scroll: 0, 0%, 78%;--sidebar-menu-background: 202, 100%, 18%;--sidebar: 210, 40%, 96%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 42%;--popover: 0 0% 100%;--popover-foreground: 222.2 47.4% 11.2%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--card: 0 0% 100%;--card-foreground: 222.2 47.4% 11.2%;--primary: 201, 100%, 29%;--primary-text: 201, 100%, 29%;--primary-foreground: 210, 40%, 96%;--primary-hovered: 202, 54%, 67%;--primary-pressed: 202, 100%, 18%;--disabled: 223, 8%, 18%, .15;--disabled-foreground: 223, 8%, 18%, .65;--main: 252, 39%, 16%;--main-foreground: 210, 40%, 96%;--secondary: 201, 95%, 36%, .1;--secondary-foreground: 201, 100%, 29%, 1;--secondary-hovered: 202, 54%, 67%;--secondary-pressed: 202, 100%, 18%;--accent: 223, 8%, 18%, .06;--accent-foreground: 223, 8%, 18%, 1;--destructive: 359, 84%, 50%, 1;--destructive-foreground: 0, 0%, 100%, 1;--destructive-background: 359, 84%, 50%, .1;--destructive-hovered: 359, 84%, 58%, 1;--destructive-pressed: 359, 84%, 44%, 1;--ring: 215 20.2% 65.1%;--radius: 12px;--header-height: 64px;--table-radius: 10px;--table-background: 202, 100%, 18%;--table-header-background: 223, 8%, 18%;--table-header-opacity: .02;--table-background-hover: 223, 8%, 18%;--chart-card: 210, 27%, 95%;--filled-filter: 343, 79%, 45%;--success: 100.24, 76.58%, 43.53%;--warning: 39.91, 95.83%, 52.94%;--error: 359, 84%, 50%;--processing: 201.2, 100%, 29.41%;--success-background: 90, 100%, 96%;--warning-background: 50, 100%, 95%, 1;--error-background: 8, 100%, 97%, 1;--processing-background: 204, 42%, 95%, 1;--default-background: 223, 8%, 18%, .02;--transfer-hovered: 223, 8%, 18%, .04;--transfer-selected: 204, 42%, 95%;--transfer-selected-hovered: 203, 55%, 91%;--toast-background: 204, 42%, 95%;--toast-border: 202, 55%, 85%;--toast-success-background: 90, 100%, 96%;--toast-success-border: 94, 70%, 74%;--toast-error-background: 8, 100%, 97%;--toast-error-border: 5, 100%, 89%, 1;--toast-warning-background: 50, 100%, 95%;--toast-warning-border: 46, 100%, 78%;--toast-info-background: 204, 42%, 95%;--toast-info-border: 202, 55%, 85%;--custom-magenta: 330 84% 33%;--custom-peach: 36 100% 94%;--custom-orange-soft: 18 100% 63%;--custom-orange-strong: 27, 95%, 55%;--chart-stroke: 0, 0%, 0%;--gray-soft: 220, 27%, 92%;--gray-softer: 0 0% 95%}.aid-root.dark{color-scheme:dark;--background: 222 47% 11%;--background-secondary: 217, 33%, 17%;--foreground: 210 40% 98%;--foreground-secondary: 210, 40%, 90%;--scroll: 215, 14%, 34%;--sidebar-menu-background: 222, 47%, 11%;--sidebar: 217, 33%, 17%;--muted: 217 33% 17%;--muted-foreground: 215 20.2% 65.1%;--popover: 222 47% 11%;--popover-foreground: 210 40% 98%;--border: 217 33% 25%;--input: 217 33% 25%;--card: 222 47% 11%;--card-foreground: 210 40% 98%;--primary: 201, 100%, 35%;--primary-text: 201, 90%, 60%;--primary-foreground: 210, 40%, 98%;--primary-hovered: 201, 100%, 39%;--primary-pressed: 201, 100%, 29%;--disabled: 215, 14%, 34%, .2;--disabled-foreground: 210, 40%, 90%, .5;--main: 210, 40%, 90%;--main-foreground: 222, 47%, 11%;--secondary: 201, 95%, 40%, .2;--secondary-foreground: 201, 100%, 70%, 1;--secondary-hovered: 201, 90%, 75%;--secondary-pressed: 201, 100%, 60%;--accent: 210, 40%, 90%, .1;--accent-foreground: 210, 40%, 90%, 1;--destructive: 0, 100%, 65%, 1;--destructive-foreground: 210, 40%, 98%, 1;--destructive-background: 359, 100%, 65%, .1;--destructive-hovered: 0, 100%, 70%, 1;--destructive-pressed: 0, 100%, 60%, 1;--ring: 215 20.2% 50%;--radius: 12px;--header-height: 64px;--table-radius: 10px;--table-background: 222, 47%, 15%;--table-header-background: 0, 0%, 100%;--table-header-opacity: .04;--table-background-hover: 0, 0%, 100%;--chart-card: 210, 25%, 18%;--filled-filter: 343, 79%, 55%;--success: 100.24, 76.58%, 43.53%;--warning: 39.91, 95.83%, 52.94%;--error: 359.33, 100%, 65.1%;--processing: 201, 90%, 60%;--success-background: 100, 77%, 44%, .12;--warning-background: 40, 96%, 53%, .12;--error-background: 359, 100%, 65%, .12;--processing-background: 201, 90%, 60%, .12;--default-background: 0, 0%, 100%, .04;--transfer-hovered: 0, 0%, 100%, .06;--transfer-selected: 201, 95%, 40%, .2;--transfer-selected-hovered: 201, 95%, 40%, .3;--toast-background: 222, 47%, 15%;--toast-border: 217, 33%, 25%;--toast-success-background: 142, 70%, 15%;--toast-success-border: 142, 70%, 25%;--toast-error-background: 0, 70%, 15%;--toast-error-border: 0, 70%, 25%;--toast-warning-background: 48, 70%, 15%;--toast-warning-border: 48, 70%, 25%;--toast-info-background: 201, 70%, 15%;--toast-info-border: 201, 70%, 25%;--custom-magenta: 330 84% 33%;--custom-peach: 36 100% 94%;--custom-orange-soft: 18 100% 63%;--custom-orange-strong: 27, 95%, 55%;--chart-stroke: 0, 0%, 100%;--gray-soft: 217, 33%, 22%;--gray-softer: 217 33% 17%}.aid-root{--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}",Og=25,ez={ru:"ru-RU",kk:"kk-KZ",en:"en-US"};function Hn(e,t,r){return e===null?"—":new Intl.NumberFormat(ez[t],{minimumFractionDigits:r,maximumFractionDigits:r}).format(e).replace(new RegExp("\\u202F","g")," ")}const zg=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function tz(e,t,r){const n=r==="asc"?1:-1,i=t.type==="number"||t.type==="integer",a=[],o=[];for(const s of e){const l=s[t.key];((i?zg(l)===null:l==null)?o:a).push(s)}return a.sort((s,l)=>i?n*((zg(s[t.key])??0)-(zg(l[t.key])??0)):n*String(s[t.key]).localeCompare(String(l[t.key]))),[...a,...o]}function rz(e,t){let r=e.data;const n=t.query?.trim().toLowerCase();if(n){const f=e.columns.filter(d=>d.type==="string").map(d=>d.key);r=r.filter(d=>f.some(p=>String(d[p]??"").toLowerCase().includes(n)))}const i=e.columns.find(f=>f.key===t.sortKey);i&&(r=tz(r,i,t.dir??"asc"));const a=r.length,o=Math.max(1,Math.ceil(a/Og)),s=Math.min(Math.max(1,Math.trunc(t.page)||1),o),l=(s-1)*Og,u=r.slice(l,l+Og);return{rows:u,page:s,pages:o,from:a===0?0:l+1,to:l+u.length,total:a}}function nz(e){return e.split(`
|
|
9
9
|
`).map(t=>{const r=t.trim();return r.startsWith("|")?/^\|[\s:|-]+\|?$/.test(r)?null:r.replace(/^\||\|$/g,"").split("|").map(n=>n.trim()).join(" — "):t}).filter(t=>t!==null).join(`
|
|
10
|
-
`).replace(/^\s{0,3}#+\s*/gm,"").replace(/[*_`]/g,"").trim()}function
|
|
11
|
-
`)),r.push(
|
|
10
|
+
`).replace(/^\s{0,3}#+\s*/gm,"").replace(/[*_`]/g,"").trim()}function iz(e){const t=e.blocks.find(n=>n.kind==="plan"),r=[];return t&&t.passport.length>0&&r.push(t.passport.join(`
|
|
11
|
+
`)),r.push(nz(e.content)),t?.source&&r.push(`Источник: ${t.source.name}`),r.join(`
|
|
12
12
|
|
|
13
|
-
`)}function Ek(e,t){return t.isLastInBranch?t.now.getTime()>Date.parse(e.expires_at)?"expired":"open":"answered"}function
|
|
14
|
-
Новый вопрос: `;function
|
|
13
|
+
`)}function Ek(e,t){return t.isLastInBranch?t.now.getTime()>Date.parse(e.expires_at)?"expired":"open":"answered"}function az(e,t){const r=t.trim().toLowerCase();return r?e.filter(n=>n.label.toLowerCase().includes(r)):e}function mu(e){return[...new Set(e.data.map(t=>t.period))].sort((t,r)=>t.localeCompare(r,void 0,{numeric:!0}))}const Dk=e=>e.value_kind!=="level",Mk=(e,t)=>{const r=mu(e),n=r.indexOf(t);return n>0?r[n-1]:void 0},Lk=(e,t)=>e.national?.period===t?e.national.value:null,oz=e=>{if(e.length===0)return null;const t=[...e].sort((n,i)=>n-i),r=Math.floor(t.length/2);return t.length%2?t[r]:(t[r-1]+t[r])/2},sz=e=>[e.territory_code??e.territory_name,e.item].filter(t=>!!t).join("|"),lz=e=>[e.territory_name??e.territory_code,e.item].filter(t=>!!t).join(", ");function Fg(e,t){const r=new Map;for(const n of e.data)n.period===t&&r.set(sz(n),{name:lz(n),value:n.value});return r}function uz(e,t,r){return t===null||r===null||r===void 0?null:Dk(e)?t-r:r<=0?null:(t/r-1)*100}const Ik=e=>e!==null&&Number.isFinite(e)?e:null;function cz(e,t){const r=Fg(e,t.period),n=Mk(e,t.period),i=n?Fg(e,n):void 0,a=[...r.values()].map(u=>u.value).filter(u=>u!==null),o=a.reduce((u,f)=>u+f,0),s=t.base==="national"?Lk(e,t.period):oz(a);return[...r].map(([u,{name:f,value:d}])=>{const p=Ik(i?uz(e,d,i.get(u)?.value):null);let v=d;t.mode==="deviation"?v=d===null||s===null?null:d-s:t.mode==="change"&&(v=p);const g=e.value_kind==="level"&&d!==null&&o!==0?d/o*100:null;return{key:u,name:f,value:d,display:Ik(v),share:g,delta:p}}).sort((u,f)=>u.display===null||f.display===null?+(u.display===null)-+(f.display===null):f.display-u.display)}function fz(e,t){return{deviation:[...Fg(e,t).values()].filter(n=>n.value!==null).length>=2,national:Lk(e,t)!==null,change:Mk(e,t)!==void 0}}function dz(e,t){return t==="value"?e.unit.label:Dk(e)?"п.п.":t==="deviation"?e.unit.label:"%"}function hz(e){const t=e.filter(Number.isFinite);if(t.length<2)return!0;const r=Math.max(...t),n=Math.min(...t);return r<=0||r===n?!0:(r-n)/r>=.2}function Pk(e){switch(e){case"pdf":return"report";case"docx":return"document";case"pptx":return"presentation";case"xlsx":return"excel";case"csv":return"csv"}}const hn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ee=e=>typeof e=="string",Ri=e=>typeof e=="number"&&Number.isFinite(e),Bg=e=>e===null||Ee(e),pn=(e,t)=>Array.isArray(e)&&e.every(r=>hn(r)&&t(r)),qf=e=>Array.isArray(e)&&e.every(Ee),pz=["self","regions","districts"],vz=["string","number","integer","period"],gz=["indicator","territory","topic","period","scope","plan_confirm"];function mz(e){const{period:t}=e;return pn(e.indicators,r=>Ee(r.id)&&Ee(r.name)&&Ee(r.unit))&&pn(e.alternatives,r=>Ee(r.id)&&Ee(r.name))&&pn(e.territories,r=>Ee(r.code)&&Ee(r.name))&&Ee(e.scope)&&pz.includes(e.scope)&&hn(t)&&Ee(t.label)&&typeof t.substituted=="boolean"&&Bg(t.reason)&&Ee(e.breakdown)&&qf(e.passport)&&(e.source===void 0||hn(e.source)&&Ee(e.source.name))&&(e.methodology===void 0||hn(e.methodology)&&Ee(e.methodology.title)&&Ee(e.methodology.url))}function yz(e){return Ee(e.section_id)&&pn(e.columns,t=>Ee(t.key)&&Ee(t.title)&&Ee(t.type)&&vz.includes(t.type))&&pn(e.data,()=>!0)&&typeof e.truncated=="boolean"&&Ri(e.total_rows)}function xz(e){return Ee(e.topic)&&pn(e.sections,t=>Ee(t.id)&&qf(t.path)&&Ri(t.count))&&pn(e.indicators,t=>Ee(t.entity_id)&&Ee(t.name)&&Ee(t.unit)&&Ee(t.years)&&Ee(t.section))&&Ri(e.total)&&qf(e.examples)}function bz(e){return Ee(e.id)&&Ee(e.type)&&gz.includes(e.type)&&Ee(e.slot)&&Ee(e.question)&&pn(e.options,t=>Ee(t.value)&&Ee(t.label)&&Bg(t.hint))&&Bg(e.default)&&typeof e.allow_free_text=="boolean"&&Ri(e.round)&&Ee(e.expires_at)}const wz=["regional","trend","breakdown","multi"],_z=["level","percent","index","rate"],kz=["pdf","docx","pptx","xlsx","csv"],Sz=["queued","running","done","failed","expired"],Nk=["territory_code","territory_name","item"],yu=e=>e==null,Os=e=>yu(e)||Ee(e),Cz=e=>Ee(e.period)&&(e.value===null||Ri(e.value))&&Nk.every(t=>Os(e[t])),Tz=e=>hn(e)&&Ee(e.title)&&Ee(e.url);function Az(e){return yu(e)?!0:!hn(e)||!Os(e.label)?!1:yu(e.editions)?!0:hn(e.editions)&&Object.values(e.editions).every(Tz)}function Ez(e){const{unit:t,national:r}=e;return Ee(e.id)&&Ee(e.title)&&Ee(e.shape)&&wz.includes(e.shape)&&hn(t)&&Ee(t.code)&&Ee(t.label)&&Ee(e.value_kind)&&_z.includes(e.value_kind)&&Ri(e.decimals)&&Ee(e.freq)&&Ee(e.period)&&Ee(e.latest_period)&&pn(e.data,Cz)&&(yu(r)||hn(r)&&Ee(r.period)&&Ri(r.value))&&pn(e.kpis,n=>Ee(n.label)&&Ee(n.value)&&Os(n.sub)&&Os(n.tone))&&qf(e.findings)&&typeof e.truncated=="boolean"&&Ri(e.total_rows)&&Az(e.methodology)&&Os(e.source_url)&&Os(e.source_name)}function Dz(e){const t={...e};for(const r of Nk)t[r]===null&&delete t[r];return t}function Mz(e){if(!Ee(e.title)||!Array.isArray(e.sections))return;const t=e.sections.filter(r=>hn(r)&&Ez(r)).map(r=>({...r,national:r.national??null,data:r.data.map(Dz)}));if(t.length!==0)return{kind:"dashboard",title:e.title,auto_open:e.auto_open===!0,sections:t}}const Rk=e=>Ee(e.format)&&kz.includes(e.format)&&Ee(e.filename)&&Ee(e.title)&&Ee(e.download_url)&&Ri(e.size_bytes);function Lz(e){const{error:t}=e;return Ee(e.job_id)&&Ee(e.status)&&Sz.includes(e.status)&&pn(e.files,Rk)&&(yu(t)||hn(t)&&Ee(t.code)&&Ee(t.message))}function Ok(e){if(hn(e))switch(e.kind){case"plan":return mz(e)?e:void 0;case"table":return yz(e)?e:void 0;case"catalog":return xz(e)?e:void 0;case"clarification":return bz(e)?e:void 0;case"dashboard":return Mz(e);case"export":return pn(e.files,Rk)?e:void 0;case"report":return Lz(e)?e:void 0;default:return}}const jg="/chat/stream",Iz=100;class wr extends Error{constructor(r,n,i=null){super(n);Rs(this,"status");Rs(this,"code");Rs(this,"body");this.name="ApiError",this.status=r,this.code=n,this.body=i}get resetAt(){const r=this.body;if(r&&typeof r=="object"&&"reset_at"in r&&typeof r.reset_at=="string")return r.reset_at}}function Pz(e,t){if(e&&typeof e=="object"){if("detail"in e&&typeof e.detail=="string"&&e.detail)return e.detail;if("errors"in e&&Array.isArray(e.errors)){const r=e.errors[0];if(r&&typeof r=="object"&&"code"in r&&typeof r.code=="string"&&r.code)return r.code}}return`http_${t}`}async function Nz(e){const t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return null}}async function Hg(e){const t=await Nz(e);return new wr(e.status,Pz(t,e.status),t)}const Rz=["О пользователе: ","Как отвечать: "],Oz="Предыдущий диалог:",zk=`
|
|
14
|
+
Новый вопрос: `;function zz(e){let t=e;if(Rz.some(r=>t.startsWith(r))){const r=t.indexOf(`
|
|
15
15
|
|
|
16
|
-
`);r!==-1&&(t=t.slice(r+2))}if(t.startsWith(O4)){const r=t.lastIndexOf(zk);r!==-1&&(t=t.slice(r+zk.length))}return t}const F4=["streaming","done","stopped","error"];function B4(e){return{...typeof e.id=="string"?{id:e.id}:{},node:typeof e.node=="string"?e.node:"",status:e.status==="running"?"running":"done",attempt:typeof e.attempt=="number"?e.attempt:1,...typeof e.durationMs=="number"?{durationMs:e.durationMs}:{},...typeof e.label=="string"?{label:e.label}:{},...typeof e.total=="number"||e.total===null?{total:e.total}:{},...typeof e.startedAt=="number"?{startedAt:e.startedAt}:{}}}function Fk(e){return{id:e.id,parentId:e.parent_id,role:e.role==="user"?"user":"assistant",content:e.role==="user"?z4(e.content):e.content,mode:e.mode,status:F4.find(t=>t===e.status)??"done",steps:e.steps.map(B4),durationMs:e.duration_ms,rating:e.rating,feedback:e.feedback,feedbackReason:e.feedback_reason??"",attachments:e.attachments??[],blocks:(e.blocks??[]).flatMap(t=>{const r=Ok(t);return r!=null?[r]:[]}),createdAt:e.created_at}}const j4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kf=e=>j4.test(e);class zs extends Error{constructor(t){super(t),this.name="StreamFailure"}}const H4=(e,t)=>Date.parse(e.createdAt)-Date.parse(t.createdAt)||(e.id<t.id?-1:e.id>t.id?1:0);function Bk(e){const t=new Map,r=new Map;for(const n of e){t.set(n.id,n);const i=r.get(n.parentId);i?i.push(n):r.set(n.parentId,[n])}for(const n of r.values())n.sort(H4);return{byId:t,children:r}}function V4(e,t){const r=[],n=new Set;let i=e.byId.get(t);for(;i&&!n.has(i.id);)n.add(i.id),r.push(i),i=i.parentId===null?void 0:e.byId.get(i.parentId);return r.reverse()}function jk(e,t){if(!e.byId.has(t))return null;let r=t;for(;;){const n=e.children.get(r),i=n?.[n.length-1];if(!i)return r;r=i.id}}function U4(e,t){const r=e.byId.get(t);if(!r)return{list:[],position:-1};const n=e.children.get(r.parentId)??[];return{list:n,position:n.findIndex(i=>i.id===t)}}function Hk(e,t){if(t&&e.byId.has(t))return t;const r=e.children.get(null),n=r?.[r.length-1];return n?jk(e,n.id):null}let $4=0;const G4=e=>`temp-${e}-${Date.now().toString(36)}-${($4++).toString(36)}`;function Vg(e,t,r){return{id:G4(e==="user"?"user":"stream"),parent_id:r,role:e,content:"",mode:t,status:e==="user"?"done":"streaming",steps:[],duration_ms:null,rating:null,feedback:"",created_at:new Date().toISOString()}}function W4(e){return!e||e.messages.length===0?null:Hk(Bk(e.messages.map(Fk)),e.current_leaf_id)}function Y4(e,t){if(e.regenerateOf!=null){const i=t?.messages.find(a=>a.id===e.regenerateOf);return{assistant:Vg("assistant",e.mode,i?.parent_id??null)}}const r=e.parentId===void 0?W4(t):e.parentId||null,n={...Vg("user",e.mode,r),content:e.query,...e.file?{attachments:[{name:e.file.name,url:""}]}:{}};return{user:n,assistant:Vg("assistant",e.mode,n.id)}}function X4(e,t,r){const n=new Map([[t.assistantId,r.assistantMessageId]]);t.userId!=null&&n.set(t.userId,r.userMessageId);const i=a=>a!=null?n.get(a)??a:a;return{...e,id:r.threadId,current_leaf_id:i(e.current_leaf_id),messages:e.messages.map(a=>n.has(a.id)||a.parent_id!=null&&n.has(a.parent_id)?{...a,id:i(a.id)??a.id,parent_id:i(a.parent_id)}:a)}}function q4(e,t){return{...e,content:t.text,steps:t.steps.map(r=>({...r})),...t.attachments.length>0?{attachments:t.attachments}:{},...t.blocks.length>0?{blocks:t.blocks.map(r=>({...r}))}:{}}}function K4(e,t,r,n){const i={...e,status:t,duration_ms:Date.now()-n};return t==="error"&&!e.content?{...i,content:r}:i}const Z4=["thread_busy","mode_overloaded","daily_limit","rate_limit","concurrency_limit","file_too_large","file_not_allowed","invalid_query","invalid_parent","mode_not_found","thread_not_found","interrupted"],Q4=e=>Z4.includes(e);function J4(e){if(e instanceof wr)return e.code;if(e instanceof zs)return e.message}function Zf(e){const t=J4(e);return t!=null&&Q4(t)?{kind:"code",code:t}:e instanceof wr?{kind:"status",status:e.status}:{kind:"generic"}}async function Qf(e,t,r={}){const n=r.method??"GET",i=new Headers(r.headers),a=await e.headers?.({method:n})??{};for(const[s,l]of Object.entries(a))i.set(s,l);return(e.fetch??fetch)(`${e.baseUrl}${t}`,{...r,method:n,headers:i,...e.credentials?{credentials:e.credentials}:{}})}const Vk="text/event-stream";function ez({query:e,mode:t,file:r,parentId:n,regenerateOf:i,clarification:a},o){const s=new FormData;return s.set("mode",t),i==null&&s.set("query",e),o!=null&&s.set("thread_id",o),n!==void 0&&s.set("parent_id",n),i!=null&&s.set("regenerate_of",i),r&&s.set("file",r),a&&s.set("clarification",JSON.stringify(a)),s}function tz(e,t,r){return Qf(e,jg,{method:"POST",body:t,headers:{Accept:Vk},signal:r})}function rz(e,t,r){return Qf(e,`${jg}/${t}`,{headers:{Accept:Vk},signal:r})}async function nz(e,t){const r=await Qf(e,`${jg}/${t}/stop`,{method:"POST"});if(!r.ok)throw await Hg(r)}async function iz(e){if(!e.ok)throw await Hg(e);if(e.body==null)throw new Error("empty_stream");return e.body}const az=45,oz=7,sz=.1,lz=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function uz(e,t){const r=e.charCodeAt(t-1);return r>=55296&&r<=56319?t+1:t}function cz(e,t){const[r,n]=H.useState(()=>e.length),i=H.useRef(r),a=H.useRef(e),o=H.useRef(null),s=H.useRef(null),[l]=H.useState(lz),u=t&&!l;return H.useLayoutEffect(()=>{a.current=e},[e]),H.useEffect(()=>{if(!u){i.current=a.current.length;return}if(i.current>e.length&&(i.current=e.length,n(e.length)),o.current!=null||i.current>=e.length)return;const f=d=>{const p=a.current,v=s.current;s.current=d;const g=v==null?1/60:Math.min((d-v)/1e3,sz),y=p.length-i.current;if(y<=0){o.current=null,s.current=null;return}const x=Math.max(1,Math.round(Math.max(az*g,y*Math.min(1,oz*g)))),b=Math.min(p.length,uz(p,i.current+x));i.current=b,n(b),o.current=requestAnimationFrame(f)};o.current=requestAnimationFrame(f)},[e,u]),H.useEffect(()=>()=>{o.current!=null&&cancelAnimationFrame(o.current),o.current=null},[]),H.useEffect(()=>{u||o.current==null||(cancelAnimationFrame(o.current),o.current=null,s.current=null)},[u]),u?r>=e.length?e:e.slice(0,r):e}const Ug="/api/v1/widget",$g="aid_visitor",Uk=4e3,Gg=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$k=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:[\w-]{10,100}$/i,fz=()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;const t=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`},dz=(e,t)=>{if(e&&Gg.test(e))return e;try{const n=t?.getItem($g);if(n&&(Gg.test(n)||$k.test(n)))return n}catch{}const r=fz();try{t?.setItem($g,r)}catch{}return r},hz=/\/api\/v1\/attachments\/([0-9a-f-]{36})\/?(?:[?#].*)?$/i,xu=(e,t)=>{const r=hz.exec(e);if(!r?.[1]){const n=/\/api\/v1\/widget\/attachments\/([0-9a-f-]{36})\/?$/i.exec(e);return n?.[1]?`${Wg(t)}/attachments/${n[1]}`:null}return`${Wg(t)}/attachments/${r[1]}`},Wg=e=>`${e.replace(/\/+$/,"")}${Ug}`,pz=e=>{if(e==="")return e;let t;try{t=new URL(e)}catch{throw new TypeError(`AiDanaChat: api-url must be an absolute http(s) URL, got "${e}"`)}if(t.protocol!=="https:"&&t.protocol!=="http:")throw new TypeError(`AiDanaChat: api-url must be an http(s) URL, got "${e}"`);return e},Yg=e=>e&&(/^https:\/\//i.test(e)||/^\/(?!\/)/.test(e)||/^data:image\/(?:png|jpeg|webp|gif);/i.test(e))?e:void 0,Jf=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),vz=e=>{if(!Jf(e)||!Jf(e.site)||!Array.isArray(e.modes)||!e.modes.every(t=>Jf(t)&&typeof t.slug=="string")||!Jf(e.visitor))throw new Error("bad config");return e},gz=e=>{const t={};if(!e||typeof e!="object")return t;const r=v=>{const g=e[v];return typeof g=="string"&&g?g:void 0},n=r("primary"),i=r("font"),a=Yg(r("logoUrl")),o=r("title"),s=r("scheme");n&&(t.primary=n),i&&(t.font=i),a&&(t.logoUrl=a),o&&(t.title=o),(s==="light"||s==="dark"||s==="auto")&&(t.scheme=s);const l=r("launcher");(l==="icon"||l==="label")&&(t.launcher=l);const u=r("launcherLabel");u&&(t.launcherLabel=u);const f=r("launcherShape");(f==="circle"||f==="rounded"||f==="square")&&(t.launcherShape=f),(typeof e.radius=="number"||typeof e.radius=="string"&&e.radius)&&(t.radius=e.radius);for(const v of["background","foreground","bubble","border"]){const g=r(v);g&&(t[v]=g)}const d=v=>{const g=e[v],y=typeof g=="number"?g:typeof g=="string"&&g?Number(g):NaN;return Number.isFinite(y)?y:void 0};for(const v of["windowWidth","windowHeight","offsetX","offsetY"]){const g=d(v);g!==void 0&&(t[v]=g)}const p=r("position");return(p==="bottom-right"||p==="bottom-left")&&(t.position=p),t},Gk=e=>{throw e instanceof wr||e instanceof Error&&e.name==="AbortError"?e:new wr(0,"network",null)},mz=({apiUrl:e,siteKey:t,visitorId:r,rememberVisitor:n,fetch:i})=>{let a=r;const o=pz(e),s=encodeURIComponent,l={baseUrl:Wg(o),headers:()=>({"X-Visitor-Id":a,...t?{"X-Widget-Key":t}:{}}),credentials:"omit",...i?{fetch:i}:{}},u=async(p,v={})=>{const g=await Qf(l,p,v).catch(Gk);if(!g.ok)throw await Hg(g);return g},f=async(p,v)=>(await u(p,v)).json(),d=(p,v)=>({method:p,headers:{"Content-Type":"application/json"},body:JSON.stringify(v)});return{transport:l,apiUrl:o,config:async()=>vz(await f("/config")),health:()=>f("/modes/health"),threads:()=>f("/threads?limit=50"),thread:p=>f(`/threads/${s(p)}`),setLeaf:async(p,v)=>{await u(`/threads/${s(p)}`,d("PATCH",{current_leaf_id:v}))},deleteThread:async p=>{await u(`/threads/${s(p)}`,{method:"DELETE"})},rate:async(p,v)=>{await u(`/messages/${s(p)}/rating`,d("POST",{rating:v}))},feedback:async(p,v,g)=>{await u(`/messages/${s(p)}/feedback`,d("POST",g?{feedback:v,reason:g}:{feedback:v}))},stop:p=>nz(l,s(p)).catch(Gk),createReport:(p,v)=>f(`/messages/${s(p)}/report`,d("POST",{language:v})),reportStatus:p=>Gg.test(p)?f(`/report-jobs/${p}`):Promise.reject(new wr(0,"bad_job_id",null)),request:p=>u(p),attachment:async p=>{const v=xu(p,o);if(!v)throw new wr(0,"not_attachment",null);const g=v.slice(l.baseUrl.length),y=await(await u(g)).blob();return URL.createObjectURL(y)},adoptVisitor:p=>!p||!$k.test(p)||p===a?!1:(a=p,n?.(p),!0)}},Xg=["kk","ru","en"],yz=e=>Xg.includes(e),Wk=e=>{const t=[e,typeof document<"u"?document.documentElement.lang:void 0,typeof navigator<"u"?navigator.language:void 0];for(const r of t){const n=r?.toLowerCase().split("-")[0];if(yz(n))return n}return"ru"},Yk={title:"AI-Dana",open:"Открыть чат",unreadAnswers:"новых ответов: {count}",ask:"Задать вопрос",close:"Закрыть",history:"История",closeHistory:"Скрыть историю",newChat:"Новый чат",untitled:"Новый чат",historyEmpty:"Пока нет чатов",historyError:"Не удалось загрузить историю",delete:"Удалить",deleteConfirm:"Удалить чат?",deleteYes:"Удалить",deleteNo:"Отмена",deleteError:"Не удалось удалить чат",modeLabel:"Режим ответа","health.idle":"Свободен","health.busy":"Занят","health.unavailable":"Недоступен",placeholder:"Спросите что угодно",inputLabel:"Сообщение",send:"Отправить",stop:"Остановить",attach:"Прикрепить файл",attachOne:"Можно прикрепить только один файл",attachHint:"Можно прикрепить один файл: XLS, XLSX, CSV, TXT или MD до {size} МБ",disclaimer:"ИИ может ошибаться — проверяйте важную информацию",removeFile:"Удалить файл",counter:"{count} / {max}",counterLimit:"Достигнут предел знаков",counterOver:"Превышен предел знаков",fileTooLarge:"Файл «{name}» больше {size} МБ",fileType:"Файл «{name}» не подходит. Можно прикрепить XLS, XLSX, CSV, TXT или MD",modeUnavailable:"Режим сейчас недоступен, выберите другой",greeting:"Чем могу помочь?",loading:"Загрузка…",configError:"Чат временно недоступен",overloaded:"Сервис сейчас перегружен. Попробуйте позже.",retry:"Повторить",dismiss:"Скрыть",scrollDown:"Прокрутить вниз",settings:"Настройки","settings.language":"Язык","settings.theme":"Тема","settings.themeLight":"Светлая","settings.themeDark":"Тёмная","settings.themeAuto":"Как в системе","settings.model":"Модель по умолчанию","settings.modelHint":"С неё начинается каждый новый чат","settings.shortcuts":"Горячие клавиши","shortcut.search":"Поиск по чатам","shortcut.newChat":"Новый чат","shortcut.sidebar":"Показать или скрыть панель","shortcut.close":"Закрыть окно",search:"Поиск по чатам",searchEmpty:"Ничего не найдено",collapseSidebar:"Скрыть панель",expandSidebar:"Показать панель",expand:"Развернуть на всю страницу",shrink:"Свернуть",examples:"Примеры запросов","examples.whatCanDo":"Что можно сделать","group.pinned":"Закреплённые","group.today":"Сегодня","group.yesterday":"Вчера","group.week":"Последние 7 дней","group.earlier":"Ранее","errors.thread_busy":"AI-Dana ещё отвечает в этом чате. Дождитесь ответа или остановите его.","errors.mode_overloaded":"AI-Dana сейчас перегружена, попробуйте чуть позже","errors.daily_limit":"Лимит сообщений на сегодня исчерпан","errors.rate_limit":"Слишком много сообщений подряд. Подождите минуту.","errors.ip_limit":"Слишком много сообщений из вашей сети сегодня. Попробуйте завтра.","errors.concurrency_limit":"Дождитесь окончания предыдущего ответа","errors.file_too_large":"Файл слишком большой","errors.file_not_allowed":"Этот файл нельзя прикрепить. Подходят XLS, XLSX, CSV, TXT и MD","errors.invalid_query":"Сообщение пустое или слишком длинное","errors.invalid_parent":"Это сообщение больше нельзя изменить","errors.mode_not_found":"Выбранный режим сейчас недоступен. Выберите другой режим.","errors.thread_not_found":"Чат не найден","errors.interrupted":"Ответ прерван","errors.code":"Не удалось получить ответ (код {code}).","errors.generic":"Произошла ошибка при отправке сообщения.","errors.network":"Нет связи с сервером. Проверьте подключение.","errors.render":"Не удалось показать это сообщение.","agent.thinking":"Думаю…","agent.done":"Готово","agent.stopped":"Остановлено","agent.stopping":"Останавливаю…","agent.failed":"не смогла","agent.interrupted":"Ответ прерван","agent.answerStopped":"Ответ остановлен. Задайте вопрос заново, если нужно","agent.seconds":"{value} с","agent.attempt":"попытка {count}","agent.showSteps":"Показать шаги","agent.hideSteps":"Скрыть шаги","steps.router":"Разбираю вопрос","steps.context_builder":"Ищу нужные данные","steps.sql_architect":"Готовлю расчёт","steps.executor":"Считаю показатели","steps.responder":"Готовлю ответ","steps.rag":"Ищу в справочных материалах","steps.sql":"Ищу данные в открытых источниках","steps.document":"Читаю документ","steps.understand":"Разбираю вопрос","steps.search_law":"Ищу в законах","steps.run_sql":"Считаю показатели","steps.run_query":"Получаю данные","steps.data":"Получаю данные","steps.lookup_taxpayer":"Ищу налогоплательщика","steps.find_taxpayer":"Ищу компанию по названию","steps.ask_clarification":"Уточняю вопрос","steps.answer":"Готовлю ответ","steps.unknown":"Работаю над ответом",copy:"Копировать",copied:"Скопировано",download:"Скачать",regenerate:"Ответить заново",edit:"Изменить сообщение",editLabel:"Текст сообщения",cancel:"Отмена",actionsLabel:"Действия с сообщением",rate:"Оценить на {count} из 5",ratingError:"Не удалось сохранить оценку",feedbackOpen:"Оставить отзыв",feedbackEdit:"Изменить отзыв",feedbackLabel:"Отзыв об ответе",feedbackPlaceholder:"Что было не так с ответом?",save:"Сохранить","branch.label":"Варианты","branch.prev":"Предыдущий вариант","branch.next":"Следующий вариант","branch.error":"Не удалось переключить вариант","limit.remaining":"Сегодня осталось {count} из {limit} сообщений","limit.exhausted":"Лимит сообщений на сегодня исчерпан","limit.until":"Лимит сообщений исчерпан. Новые сообщения — после {time}.","blocks.data":"Данные","blocks.hideData":"Скрыть данные","blocks.methodology":"Методология","blocks.passport":"Что посчитано","blocks.indicator":"Показатель","blocks.territory":"Территория","blocks.period":"Период","blocks.breakdown":"Разрез","blocks.breakdown.sex":"по полу","blocks.breakdown.age":"по возрасту","blocks.breakdown.urban_rural":"город и село","blocks.breakdown.activity":"по видам деятельности","blocks.breakdown.item":"по товарам","blocks.substituted":"подстановка","blocks.alternatives":"Похожие показатели","blocks.table":"Таблица данных","blocks.tableSearch":"Поиск по таблице…","blocks.tableEmpty":"Нет данных","blocks.page":"{a} из {b}","blocks.prevPage":"Предыдущая страница","blocks.nextPage":"Следующая страница","blocks.truncated":"Показаны первые {n} строк — полные данные в Excel","blocks.catalogMore":"…и ещё {count} в каталоге","blocks.catalogExamples":"Можно спросить","blocks.options":"Варианты ответа","blocks.default":"по умолчанию","blocks.freeTextHint":"Выберите вариант или напишите свой в поле ниже","blocks.findOption":"Найти в списке…","blocks.chosen":"Выбрано: {label}","blocks.continue":"Продолжить","blocks.cancelPlan":"Отменить","blocks.expired":"Уточнение устарело","blocks.askAgain":"Задать вопрос заново","blocks.dashboard":"Дашборд","blocks.hideDashboard":"Скрыть дашборд","chart.kinds":"Вид диаграммы","chart.kind.bar":"Полосы","chart.kind.column":"Столбцы","chart.kind.pie":"Круговая","chart.kind.line":"Линии","chart.kind.area":"Области","chart.national":"РК {value}","chart.top":"Топ-{n} из {total} — всё в дашборде","chart.label":"{title}, {period}","files.list":"Файлы","files.report":"Готовый отчёт","files.document":"Редактируемый документ","files.presentation":"Презентация","files.excel":"Данные Excel","files.csv":"Данные CSV","files.failed":"Не удалось скачать файл","report.create":"Сформировать отчёт","report.pending":"Файлы отчёта формируются…","report.failed":"Не удалось сформировать файлы отчёта","report.retry":"Повторить","report.expired":"Срок файлов истёк","dashboard.eyebrow":"Аналитика","dashboard.label":"Дашборд","dashboard.sections":"Разделы дашборда","dashboard.regions":"регионов: {n}","dashboard.items":"позиций: {n}","dashboard.openSource":"Открыть в источнике","dashboard.methodology":"Методология","dashboard.fullscreen":"На весь экран","dashboard.collapse":"Свернуть","dashboard.close":"Закрыть","dashboard.chatTab":"Чат","dashboard.dashboardTab":"Дашборд","dashboard.view":"Чат или дашборд","dashboard.region":"Регион","dashboard.allRegions":"Все регионы","dashboard.period":"Период","dashboard.mode.label":"Режим","dashboard.mode.value":"Значение","dashboard.mode.deviation":"Отклонение","dashboard.mode.change":"Изменение","dashboard.base.label":"База отклонения","dashboard.base.median":"от медианы","dashboard.base.national":"от РК","dashboard.noPrevious":"Нет предыдущего периода","dashboard.noNational":"Нет значения по стране за этот период","dashboard.fewRegions":"Нужно хотя бы два значения","dashboard.ranking":"Рейтинг","dashboard.trend":"Динамика","dashboard.findings":"Выводы","dashboard.data":"Данные","dashboard.kpis":"Ключевые показатели","dashboard.table.rank":"№","dashboard.table.position":"Позиция","dashboard.table.value":"Значение, {unit}","dashboard.table.share":"Доля, %","dashboard.table.deviation":"Отклонение, {unit}","dashboard.table.change":"Изменение, {unit}","dashboard.source":"Источник: {name}","dashboard.points":"п.п.","dashboard.kpi.national":"Республика Казахстан","dashboard.kpi.max":"Максимум","dashboard.kpi.min":"Минимум","dashboard.kpi.median":"Медиана по регионам","dashboard.kpi.spread":"Размах","dashboard.kpi.gap":"Разрыв","dashboard.kpi.last":"Последнее значение","dashboard.kpi.first":"Начало периода","dashboard.kpi.change":"Изменение","dashboard.kpi.place":"Место","dashboard.kpi.placeOf":"{n} из {m}","dashboard.kpi.deviation":"Откл. от медианы","dashboard.kpi.previous":"К прошлому периоду","steps.counter":"{done} из {total}","feedback.reasonsLabel":"Что не так?","feedback.reason.wrong_number":"Неверная цифра","feedback.reason.wrong_indicator":"Не тот показатель","feedback.reason.wrong_territory":"Не та территория","feedback.reason.wrong_period":"Не тот период","feedback.reason.not_answered":"Нет ответа на вопрос","feedback.reason.language":"Язык ответа","feedback.reason.slow":"Слишком долго","feedback.reason.other":"Другое","intro.title":"Перед началом","intro.continue":"Продолжить",source:"Источник: {name}","shell.siteBlocked":"Чат недоступен на этом сайте","shell.siteBlockedHint":"Владелец сайта ещё не подключил AI-Dana или доступ приостановлен.","modes.none":"Режимы ответа сейчас недоступны. Попробуйте позже.","attachment.sending":"отправляется","agent.steps":"Шаги","agent.unfinished":"не завершён",rateGroup:"Оценка ответа","blocks.catalogTitle":"Каталог: {topic}","blocks.catalogSections":"Разделы","blocks.catalogIndicators":"Показатели","blocks.catalogSendHint":"Вопрос отправится сразу после выбора","blocks.clarification":"Уточнение","files.expired":"Срок файла истёк","files.notFound":"Файл не найден","files.unavailable":"Файл недоступен"},xz={kk:{title:"AI-Dana",open:"Чатты ашу",unreadAnswers:"жаңа жауаптар: {count}",ask:"Сұрақ қою",close:"Жабу",history:"Тарих",closeHistory:"Тарихты жасыру",newChat:"Жаңа чат",untitled:"Жаңа чат",historyEmpty:"Әзірге чаттар жоқ",historyError:"Тарихты жүктеу мүмкін болмады",delete:"Жою",deleteConfirm:"Чатты жою керек пе?",deleteYes:"Жою",deleteNo:"Бас тарту",deleteError:"Чатты жою мүмкін болмады",modeLabel:"Жауап режимі","health.idle":"Бос","health.busy":"Бос емес","health.unavailable":"Қолжетімсіз",placeholder:"Кез келген нәрсені сұраңыз",inputLabel:"Хабарлама",send:"Жіберу",stop:"Тоқтату",attach:"Файл тіркеу",attachOne:"Тек бір файл тіркеуге болады",attachHint:"Бір файл тіркеуге болады: XLS, XLSX, CSV, TXT немесе MD, {size} МБ-қа дейін",disclaimer:"ЖИ қателесуі мүмкін — маңызды ақпаратты тексеріңіз",removeFile:"Файлды жою",counter:"{count} / {max}",counterLimit:"Таңба шегіне жеттіңіз",counterOver:"Таңба шегінен асып кеттіңіз",fileTooLarge:"«{name}» файлы {size} МБ-тан үлкен",fileType:"«{name}» файлы жарамайды. XLS, XLSX, CSV, TXT немесе MD тіркеуге болады",modeUnavailable:"Режим қазір қолжетімсіз, басқасын таңдаңыз",greeting:"Қалай көмектесе аламын?",loading:"Жүктелуде…",configError:"Чат уақытша қолжетімсіз",overloaded:"Қызмет қазір шамадан тыс жүктелген. Кейінірек қайталап көріңіз.",retry:"Қайталау",dismiss:"Жасыру",scrollDown:"Төменге айналдыру",settings:"Баптаулар","settings.language":"Тіл","settings.theme":"Тақырып","settings.themeLight":"Ашық","settings.themeDark":"Қараңғы","settings.themeAuto":"Жүйедегідей","settings.model":"Әдепкі модель","settings.modelHint":"Әр жаңа чат осыдан басталады","settings.shortcuts":"Жылдам пернелер","shortcut.search":"Чаттардан іздеу","shortcut.newChat":"Жаңа чат","shortcut.sidebar":"Панельді көрсету не жасыру","shortcut.close":"Терезені жабу",search:"Чаттардан іздеу",searchEmpty:"Ештеңе табылмады",collapseSidebar:"Панельді жасыру",expandSidebar:"Панельді көрсету",expand:"Бүкіл бетке жаю",shrink:"Кішірейту",examples:"Сұрау мысалдары","examples.whatCanDo":"Не істей аласыз","group.pinned":"Бекітілгендер","group.today":"Бүгін","group.yesterday":"Кеше","group.week":"Соңғы 7 күн","group.earlier":"Бұрынырақ","errors.thread_busy":"AI-Dana бұл чатта әлі жауап беріп жатыр. Жауапты күтіңіз немесе тоқтатыңыз.","errors.mode_overloaded":"AI-Dana қазір шамадан тыс жүктелген, сәл кейінірек қайталап көріңіз","errors.daily_limit":"Бүгінгі хабарлама лимиті таусылды","errors.rate_limit":"Хабарламалар тым жиі жіберілді. Бір минут күтіңіз.","errors.ip_limit":"Бүгін сіздің желіңізден хабарламалар тым көп жіберілді. Ертең қайталап көріңіз.","errors.concurrency_limit":"Алдыңғы жауаптың аяқталуын күтіңіз","errors.file_too_large":"Файл тым үлкен","errors.file_not_allowed":"Бұл файлды тіркеуге болмайды. XLS, XLSX, CSV, TXT және MD жарайды","errors.invalid_query":"Хабарлама бос немесе тым ұзын","errors.invalid_parent":"Бұл хабарламаны енді өзгертуге болмайды","errors.mode_not_found":"Таңдалған режим қазір қолжетімсіз. Басқа режимді таңдаңыз.","errors.thread_not_found":"Чат табылмады","errors.interrupted":"Жауап үзілді","errors.code":"Жауап алу мүмкін болмады (код {code}).","errors.generic":"Хабарлама жіберу кезінде қате орын алды.","errors.network":"Сервермен байланыс жоқ. Қосылымды тексеріңіз.","errors.render":"Бұл хабарламаны көрсету мүмкін болмады.","agent.thinking":"Ойланып жатырмын…","agent.done":"Дайын","agent.stopped":"Тоқтатылды","agent.stopping":"Тоқтатып жатырмын…","agent.failed":"алмады","agent.interrupted":"Жауап үзілді","agent.answerStopped":"Жауап тоқтатылды. Қажет болса, сұрақты қайта қойыңыз","agent.seconds":"{value} с","agent.attempt":"{count}-әрекет","agent.showSteps":"Қадамдарды көрсету","agent.hideSteps":"Қадамдарды жасыру","steps.router":"Сұрақты талдап жатырмын","steps.context_builder":"Қажет деректерді іздеп жатырмын","steps.sql_architect":"Есептеуді дайындап жатырмын","steps.executor":"Көрсеткіштерді есептеп жатырмын","steps.responder":"Жауап дайындап жатырмын","steps.rag":"Анықтамалық материалдардан іздеп жатырмын","steps.sql":"Ашық дереккөздерден деректер іздеп жатырмын","steps.document":"Құжатты оқып жатырмын","steps.understand":"Сұрақты талдап жатырмын","steps.search_law":"Заңнамадан іздеп жатырмын","steps.run_sql":"Көрсеткіштерді есептеп жатырмын","steps.run_query":"Деректерді алып жатырмын","steps.data":"Деректерді алып жатырмын","steps.lookup_taxpayer":"Салық төлеушіні іздеп жатырмын","steps.find_taxpayer":"Компанияны атауы бойынша іздеп жатырмын","steps.ask_clarification":"Сұрақты нақтылап жатырмын","steps.answer":"Жауап дайындап жатырмын","steps.unknown":"Жауап үстінде жұмыс істеп жатырмын",copy:"Көшіру",copied:"Көшірілді",download:"Жүктеу",regenerate:"Қайта жауап беру",edit:"Хабарламаны өзгерту",editLabel:"Хабарлама мәтіні",cancel:"Болдырмау",actionsLabel:"Хабарлама әрекеттері",rate:"5-тен {count} деп бағалау",ratingError:"Бағаны сақтау мүмкін болмады",feedbackOpen:"Пікір қалдыру",feedbackEdit:"Пікірді өзгерту",feedbackLabel:"Жауап туралы пікір",feedbackPlaceholder:"Жауаптың қай жері дұрыс емес?",save:"Сақтау","branch.label":"Нұсқалар","branch.prev":"Алдыңғы нұсқа","branch.next":"Келесі нұсқа","branch.error":"Нұсқаны ауыстыру мүмкін болмады","limit.remaining":"Бүгін {limit} хабарламаның {count} қалды","limit.exhausted":"Бүгінгі хабарлама лимиті таусылды","limit.until":"Хабарлама лимиті таусылды. Жаңа хабарламаларды {time} кейін жіберуге болады.","blocks.data":"Деректер","blocks.hideData":"Деректерді жасыру","blocks.methodology":"Әдістеме","blocks.passport":"Не есептелді","blocks.indicator":"Көрсеткіш","blocks.territory":"Аумақ","blocks.period":"Кезең","blocks.breakdown":"Қима","blocks.breakdown.sex":"жынысы бойынша","blocks.breakdown.age":"жасы бойынша","blocks.breakdown.urban_rural":"қала және ауыл","blocks.breakdown.activity":"қызмет түрлері бойынша","blocks.breakdown.item":"тауарлар бойынша","blocks.substituted":"алмастырылды","blocks.alternatives":"Ұқсас көрсеткіштер","blocks.table":"Деректер кестесі","blocks.tableSearch":"Кестеден іздеу…","blocks.tableEmpty":"Деректер жоқ","blocks.page":"{b} ішінен {a}","blocks.prevPage":"Алдыңғы бет","blocks.nextPage":"Келесі бет","blocks.truncated":"Алғашқы {n} жол көрсетілді — толық деректер Excel-де","blocks.catalogMore":"…және каталогта тағы {count}","blocks.catalogExamples":"Сұрауға болады","blocks.options":"Жауап нұсқалары","blocks.default":"әдепкі","blocks.freeTextHint":"Нұсқаны таңдаңыз немесе төмендегі өріске өзіңіздікін жазыңыз","blocks.findOption":"Тізімнен іздеу…","blocks.chosen":"Таңдалды: {label}","blocks.continue":"Жалғастыру","blocks.cancelPlan":"Бас тарту","blocks.expired":"Нақтылаудың мерзімі өтті","blocks.askAgain":"Сұрақты қайта қою","blocks.dashboard":"Дашбордты ашу","blocks.hideDashboard":"Дашбордты жасыру","chart.kinds":"Диаграмма түрі","chart.kind.bar":"Жолақтар","chart.kind.column":"Бағандар","chart.kind.pie":"Дөңгелек","chart.kind.line":"Сызықтар","chart.kind.area":"Аймақтар","chart.national":"ҚР {value}","chart.top":"Үздік {n}, барлығы {total} — толығы дашбордта","chart.label":"{title}, {period}","files.list":"Файлдар","files.report":"Дайын есеп","files.document":"Өңделетін құжат","files.presentation":"Таныстырылым","files.excel":"Excel деректері","files.csv":"CSV деректері","files.failed":"Файлды жүктеу мүмкін болмады","report.create":"Есеп құру","report.pending":"Есеп файлдары дайындалуда…","report.failed":"Есеп файлдарын құру мүмкін болмады","report.retry":"Қайталау","report.expired":"Файлдардың мерзімі өтті","dashboard.eyebrow":"Талдау","dashboard.label":"Дашборд тақтасы","dashboard.sections":"Дашборд бөлімдері","dashboard.regions":"өңірлер: {n}","dashboard.items":"позициялар: {n}","dashboard.openSource":"Дереккөзде ашу","dashboard.methodology":"Әдістеме","dashboard.fullscreen":"Толық экран","dashboard.collapse":"Кішірейту","dashboard.close":"Жабу","dashboard.chatTab":"Сұхбат","dashboard.dashboardTab":"Дашборд тақтасы","dashboard.view":"Сұхбат немесе дашборд","dashboard.region":"Өңір","dashboard.allRegions":"Барлық өңірлер","dashboard.period":"Кезең","dashboard.mode.label":"Көрініс","dashboard.mode.value":"Мән","dashboard.mode.deviation":"Ауытқу","dashboard.mode.change":"Өзгеріс","dashboard.base.label":"Ауытқу базасы","dashboard.base.median":"медианадан","dashboard.base.national":"ҚР-дан","dashboard.noPrevious":"Алдыңғы кезең жоқ","dashboard.noNational":"Бұл кезеңге ел бойынша мән жоқ","dashboard.fewRegions":"Кемінде екі мән қажет","dashboard.ranking":"Орындар рейтингі","dashboard.trend":"Серпін","dashboard.findings":"Қорытындылар","dashboard.data":"Деректер","dashboard.kpis":"Негізгі көрсеткіштер","dashboard.table.rank":"№","dashboard.table.position":"Атауы","dashboard.table.value":"Мәні, {unit}","dashboard.table.share":"Үлесі, %","dashboard.table.deviation":"Ауытқу, {unit}","dashboard.table.change":"Өзгеріс, {unit}","dashboard.source":"Дереккөз: {name}","dashboard.points":"п.т.","dashboard.kpi.national":"Қазақстан Республикасы","dashboard.kpi.max":"Ең жоғары","dashboard.kpi.min":"Ең төмен","dashboard.kpi.median":"Өңірлер медианасы","dashboard.kpi.spread":"Құлаш","dashboard.kpi.gap":"Алшақтық","dashboard.kpi.last":"Соңғы мән","dashboard.kpi.first":"Кезең басы","dashboard.kpi.change":"Өзгеріс","dashboard.kpi.place":"Орын","dashboard.kpi.placeOf":"{m} ішінен {n}","dashboard.kpi.deviation":"Медианадан ауытқу","dashboard.kpi.previous":"Алдыңғы кезеңге","steps.counter":"{total} ішінен {done}","feedback.reasonsLabel":"Не қате болды?","feedback.reason.wrong_number":"Сан қате","feedback.reason.wrong_indicator":"Көрсеткіш басқа","feedback.reason.wrong_territory":"Аумақ басқа","feedback.reason.wrong_period":"Кезең басқа","feedback.reason.not_answered":"Сұраққа жауап жоқ","feedback.reason.language":"Жауап тілі","feedback.reason.slow":"Тым ұзақ","feedback.reason.other":"Басқа","intro.title":"Бастамас бұрын","intro.continue":"Жалғастыру",source:"Дереккөз: {name}","shell.siteBlocked":"Бұл сайтта чат қолжетімсіз","shell.siteBlockedHint":"Сайт иесі AI-Dana-ны әлі қоспаған немесе қолжетімділік тоқтатылған.","modes.none":"Жауап режимдері қазір қолжетімсіз. Кейінірек қайталап көріңіз.","attachment.sending":"жіберілуде","agent.steps":"Қадамдар","agent.unfinished":"аяқталмады",rateGroup:"Жауапты бағалау","blocks.catalogTitle":"Каталог: {topic}","blocks.catalogSections":"Бөлімдер","blocks.catalogIndicators":"Көрсеткіштер","blocks.catalogSendHint":"Сұрақ таңдалған бойда жіберіледі","blocks.clarification":"Нақтылау","files.expired":"Файл мерзімі өтті","files.notFound":"Файл табылмады","files.unavailable":"Файл қолжетімсіз"},ru:Yk,en:{title:"AI-Dana",open:"Open chat",unreadAnswers:"new answers: {count}",ask:"Ask a question",close:"Close",history:"History",closeHistory:"Hide history",newChat:"New chat",untitled:"New chat",historyEmpty:"No chats yet",historyError:"Could not load the history",delete:"Delete",deleteConfirm:"Delete this chat?",deleteYes:"Delete",deleteNo:"Cancel",deleteError:"Could not delete the chat",modeLabel:"Answer mode","health.idle":"Available","health.busy":"Busy","health.unavailable":"Unavailable",placeholder:"Ask anything",inputLabel:"Message",send:"Send",stop:"Stop",attach:"Attach file",attachOne:"Only one file can be attached",attachHint:"You can attach one file: XLS, XLSX, CSV, TXT or MD, up to {size} MB",disclaimer:"AI can make mistakes — check important information",removeFile:"Remove file",counter:"{count} / {max}",counterLimit:"Character limit reached",counterOver:"Character limit exceeded",fileTooLarge:"File “{name}” is larger than {size} MB",fileType:"File “{name}” is not supported. You can attach XLS, XLSX, CSV, TXT or MD",modeUnavailable:"This mode is unavailable right now, choose another one",greeting:"How can I help?",loading:"Loading…",configError:"The chat is temporarily unavailable",overloaded:"The service is overloaded right now. Please try again later.",retry:"Retry",dismiss:"Dismiss",scrollDown:"Scroll to bottom",settings:"Settings","settings.language":"Language","settings.theme":"Theme","settings.themeLight":"Light","settings.themeDark":"Dark","settings.themeAuto":"System","settings.model":"Default model","settings.modelHint":"Every new chat starts with it","settings.shortcuts":"Keyboard shortcuts","shortcut.search":"Search chats","shortcut.newChat":"New chat","shortcut.sidebar":"Show or hide the sidebar","shortcut.close":"Close the window",search:"Search chats",searchEmpty:"Nothing found",collapseSidebar:"Hide sidebar",expandSidebar:"Show sidebar",expand:"Expand to the whole page",shrink:"Shrink",examples:"Example queries","examples.whatCanDo":"What you can do","group.pinned":"Pinned","group.today":"Today","group.yesterday":"Yesterday","group.week":"Previous 7 days","group.earlier":"Earlier","errors.thread_busy":"AI-Dana is still answering in this chat. Wait for the answer or stop it.","errors.mode_overloaded":"AI-Dana is overloaded right now, please try again a bit later","errors.daily_limit":"You have used up today's message limit","errors.rate_limit":"Too many messages in a row. Please wait a minute.","errors.ip_limit":"Too many messages from your network today. Please try again tomorrow.","errors.concurrency_limit":"Wait for the previous answer to finish","errors.file_too_large":"The file is too large","errors.file_not_allowed":"This file cannot be attached. XLS, XLSX, CSV, TXT and MD are allowed","errors.invalid_query":"The message is empty or too long","errors.invalid_parent":"This message can no longer be changed","errors.mode_not_found":"The selected mode is unavailable right now. Choose another mode.","errors.thread_not_found":"Chat not found","errors.interrupted":"The answer was interrupted","errors.code":"Could not get an answer (code {code}).","errors.generic":"Something went wrong while sending the message.","errors.network":"No connection to the server. Check your network.","errors.render":"This message could not be shown.","agent.thinking":"Thinking…","agent.done":"Done","agent.stopped":"Stopped","agent.stopping":"Stopping…","agent.failed":"couldn’t","agent.interrupted":"Answer interrupted","agent.answerStopped":"Answer stopped. Ask again if needed","agent.seconds":"{value} s","agent.attempt":"attempt {count}","agent.showSteps":"Show steps","agent.hideSteps":"Hide steps","steps.router":"Understanding the question","steps.context_builder":"Looking for the data","steps.sql_architect":"Preparing the calculation","steps.executor":"Calculating the figures","steps.responder":"Preparing the answer","steps.rag":"Looking in reference materials","steps.sql":"Looking for data in open sources","steps.document":"Reading the document","steps.understand":"Understanding the question","steps.search_law":"Searching the law","steps.run_sql":"Calculating the figures","steps.run_query":"Getting the data","steps.data":"Getting the data","steps.lookup_taxpayer":"Looking up the taxpayer","steps.find_taxpayer":"Finding the company by name","steps.ask_clarification":"Clarifying the question","steps.answer":"Preparing the answer","steps.unknown":"Working on the answer",copy:"Copy",copied:"Copied",download:"Download",regenerate:"Regenerate",edit:"Edit message",editLabel:"Message text",cancel:"Cancel",actionsLabel:"Message actions",rate:"Rate {count} out of 5",ratingError:"Could not save the rating",feedbackOpen:"Leave feedback",feedbackEdit:"Edit feedback",feedbackLabel:"Feedback on the answer",feedbackPlaceholder:"What was wrong with the answer?",save:"Save","branch.label":"Versions","branch.prev":"Previous version","branch.next":"Next version","branch.error":"Could not switch the version","limit.remaining":"{count} of {limit} messages left today","limit.exhausted":"You have used up today's message limit","limit.until":"Message limit reached. You can write again after {time}.","blocks.data":"Data","blocks.hideData":"Hide data","blocks.methodology":"Methodology","blocks.passport":"What was calculated","blocks.indicator":"Indicator","blocks.territory":"Territory","blocks.period":"Period","blocks.breakdown":"Breakdown","blocks.breakdown.sex":"by sex","blocks.breakdown.age":"by age","blocks.breakdown.urban_rural":"urban and rural","blocks.breakdown.activity":"by economic activity","blocks.breakdown.item":"by item","blocks.substituted":"substituted","blocks.alternatives":"Similar indicators","blocks.table":"Data table","blocks.tableSearch":"Search the table…","blocks.tableEmpty":"No data","blocks.page":"{a} of {b}","blocks.prevPage":"Previous page","blocks.nextPage":"Next page","blocks.truncated":"Showing the first {n} rows — full data in Excel","blocks.catalogMore":"…and {count} more in the catalog","blocks.catalogExamples":"You can ask","blocks.options":"Answer options","blocks.default":"default","blocks.freeTextHint":"Choose an option or type your own below","blocks.findOption":"Find in the list…","blocks.chosen":"Selected: {label}","blocks.continue":"Continue","blocks.cancelPlan":"Cancel","blocks.expired":"This clarification has expired","blocks.askAgain":"Ask the question again","blocks.dashboard":"Dashboard","blocks.hideDashboard":"Hide dashboard","chart.kinds":"Chart type","chart.kind.bar":"Bars","chart.kind.column":"Columns","chart.kind.pie":"Pie","chart.kind.line":"Lines","chart.kind.area":"Areas","chart.national":"KZ {value}","chart.top":"Top {n} of {total} — all in the dashboard","chart.label":"{title}, {period}","files.list":"Files","files.report":"Final report","files.document":"Editable document","files.presentation":"Presentation","files.excel":"Excel data","files.csv":"CSV data","files.failed":"Could not download the file","report.create":"Generate report","report.pending":"Report files are being prepared…","report.failed":"Could not generate the report files","report.retry":"Retry","report.expired":"The files have expired","dashboard.eyebrow":"Analytics","dashboard.label":"Dashboard","dashboard.sections":"Dashboard sections","dashboard.regions":"regions: {n}","dashboard.items":"items: {n}","dashboard.openSource":"Open in source","dashboard.methodology":"Methodology","dashboard.fullscreen":"Full screen","dashboard.collapse":"Collapse","dashboard.close":"Close","dashboard.chatTab":"Chat","dashboard.dashboardTab":"Dashboard","dashboard.view":"Chat or dashboard","dashboard.region":"Region","dashboard.allRegions":"All regions","dashboard.period":"Period","dashboard.mode.label":"Mode","dashboard.mode.value":"Value","dashboard.mode.deviation":"Deviation","dashboard.mode.change":"Change","dashboard.base.label":"Deviation base","dashboard.base.median":"from median","dashboard.base.national":"from KZ","dashboard.noPrevious":"No previous period","dashboard.noNational":"No national value for this period","dashboard.fewRegions":"At least two values are needed","dashboard.ranking":"Ranking","dashboard.trend":"Trend","dashboard.findings":"Findings","dashboard.data":"Data","dashboard.kpis":"Key figures","dashboard.table.rank":"#","dashboard.table.position":"Item","dashboard.table.value":"Value, {unit}","dashboard.table.share":"Share, %","dashboard.table.deviation":"Deviation, {unit}","dashboard.table.change":"Change, {unit}","dashboard.source":"Source: {name}","dashboard.points":"p.p.","dashboard.kpi.national":"Republic of Kazakhstan","dashboard.kpi.max":"Maximum","dashboard.kpi.min":"Minimum","dashboard.kpi.median":"Regional median","dashboard.kpi.spread":"Range","dashboard.kpi.gap":"Gap","dashboard.kpi.last":"Latest value","dashboard.kpi.first":"Start of period","dashboard.kpi.change":"Change","dashboard.kpi.place":"Rank","dashboard.kpi.placeOf":"{n} of {m}","dashboard.kpi.deviation":"Deviation from median","dashboard.kpi.previous":"vs previous period","steps.counter":"{done} of {total}","feedback.reasonsLabel":"What went wrong?","feedback.reason.wrong_number":"Wrong number","feedback.reason.wrong_indicator":"Wrong indicator","feedback.reason.wrong_territory":"Wrong territory","feedback.reason.wrong_period":"Wrong period","feedback.reason.not_answered":"Question not answered","feedback.reason.language":"Answer language","feedback.reason.slow":"Too slow","feedback.reason.other":"Other","intro.title":"Before you start","intro.continue":"Continue",source:"Source: {name}","shell.siteBlocked":"The chat is not available on this site","shell.siteBlockedHint":"The site owner has not connected AI-Dana yet or access is suspended.","modes.none":"Answer modes are unavailable right now. Please try again later.","attachment.sending":"sending","agent.steps":"Steps","agent.unfinished":"not finished",rateGroup:"Rate the answer","blocks.catalogTitle":"Catalog: {topic}","blocks.catalogSections":"Sections","blocks.catalogIndicators":"Indicators","blocks.catalogSendHint":"The question is sent as soon as you pick it","blocks.clarification":"Clarification","files.expired":"The file has expired","files.notFound":"File not found","files.unavailable":"File unavailable"}},Vn=(e,t,r)=>{const n=xz[e][t];return r?n.replace(/\{(\w+)\}/g,(i,a)=>String(r[a]??i)):n},bz=e=>e in Yk,bu=(e,t)=>{if(!e)return"";for(const r of[e[t],e.ru,...Object.values(e)])if(r)return r;return""},Xk="aid_prefs",wz=["light","dark","auto"],qk=e=>{try{const t=JSON.parse(e?.getItem(Xk)??"{}"),r={};return Xg.includes(t.lang)&&(r.lang=t.lang),wz.includes(t.scheme)&&(r.scheme=t.scheme),r}catch{return{}}},_z=(e,t)=>{try{e?.setItem(Xk,JSON.stringify(t))}catch{}},Kk=({scheme:e})=>e?{scheme:e}:{},kz=(e,t,r)=>t?!r||e.expanded?e:{expanded:!0,byDashboard:!0}:e.byDashboard?{expanded:!1,byDashboard:!1}:e,qg=H.createContext(null),Kg=()=>{const e=H.useContext(qg);if(!e)throw new Error("usePrefs outside PrefsContext");return e},Sz=e=>{let t=e;const r=new Set;return{get:()=>t,set:n=>{t={...t,...n};for(const i of r)i()},subscribe:n=>(r.add(n),()=>r.delete(n))}};class Zg extends H.Component{constructor(){super(...arguments);Rs(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}}const Cz='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--aid-c-border)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--aid-c-font);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:32px!important;padding-left:32px!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:32px;padding-left:32px}@media(min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-\\[3px\\]{inset:3px}.inset-y-0{top:0;bottom:0}.bottom-3{bottom:12px}.bottom-\\[3\\.2rem\\]{bottom:51.2px}.bottom-\\[calc\\(100\\%\\+6px\\)\\]{bottom:calc(100% + 6px)}.left-0{left:0}.left-1\\/2{left:50%}.left-4{left:16px}.left-\\[11px\\]{left:11px}.right-1{right:4px}.right-2{right:8px}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+6px\\)\\]{top:calc(100% + 6px)}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.mx-1\\.5{margin-left:6px;margin-right:6px}.mx-auto{margin-left:auto;margin-right:auto}.my-0\\.5{margin-top:2px;margin-bottom:2px}.my-4{margin-top:16px;margin-bottom:16px}.-ml-2{margin-left:-8px}.mb-2{margin-bottom:8px}.ml-0\\.5{margin-left:2px}.ml-1\\.5{margin-left:6px}.mr-1{margin-right:4px}.mr-auto{margin-right:auto}.mt-0\\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mt-\\[18px\\]{margin-top:18px}.mt-px{margin-top:1px}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-2{width:8px;height:8px}.size-3{width:12px;height:12px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-6{width:24px;height:24px}.size-7{width:28px;height:28px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-\\[26px\\]{width:26px;height:26px}.size-\\[30px\\]{width:30px;height:30px}.size-\\[34px\\]{width:34px;height:34px}.size-\\[52px\\]{width:52px;height:52px}.h-10{height:40px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[11px\\]{height:11px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-\\[22px\\]{height:22px}.h-\\[30px\\]{height:30px}.h-\\[38px\\]{height:38px}.h-full{height:100%}.h-side-head{height:var(--aid-c-side-head-height)}.h-toolbar{height:var(--aid-c-toolbar-height)}.max-h-56{max-height:224px}.max-h-\\[28rem\\]{max-height:448px}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-10{min-height:40px}.min-h-11{min-height:44px}.min-h-6{min-height:24px}.min-h-7{min-height:28px}.min-h-8{min-height:32px}.min-h-9{min-height:36px}.min-h-\\[30px\\]{min-height:30px}.min-h-\\[34px\\]{min-height:34px}.min-h-\\[76px\\]{min-height:76px}.w-1\\/2{width:50%}.w-10{width:40px}.w-8{width:32px}.w-\\[18px\\]{width:18px}.w-\\[340px\\]{width:340px}.w-\\[62\\%\\]{width:62%}.w-\\[7px\\]{width:7px}.w-\\[max-content\\]{width:-moz-max-content;width:max-content}.w-\\[min\\(400px\\,100\\%\\)\\]{width:min(400px,100%)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-side{width:var(--aid-c-side-width)}.w-side-over{width:var(--aid-c-side-over-width)}.min-w-0{min-width:0px}.min-w-16{min-width:64px}.min-w-24{min-width:96px}.min-w-32{min-width:128px}.min-w-4{min-width:16px}.min-w-40{min-width:160px}.min-w-5{min-width:20px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[22px\\]{min-width:22px}.min-w-\\[30px\\]{min-width:30px}.min-w-\\[480px\\]{min-width:480px}.min-w-full{min-width:100%}.max-w-60{max-width:240px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[340px\\]{max-width:340px}.max-w-\\[420px\\]{max-width:420px}.max-w-\\[440px\\]{max-width:440px}.max-w-\\[520px\\]{max-width:520px}.max-w-\\[640px\\]{max-width:640px}.max-w-\\[78\\%\\]{max-width:78%}.max-w-\\[820px\\]{max-width:820px}.max-w-\\[844px\\]{max-width:844px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 32px)}.max-w-\\[min\\(360px\\,100\\%\\)\\]{max-width:min(360px,100%)}.max-w-\\[min\\(360px\\,80vw\\)\\]{max-width:min(360px,80vw)}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: 8px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[3px\\]{--tw-translate-y: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(9\\.5rem\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(152px,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1{gap:4px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-2\\.5{gap:10px}.gap-3{gap:12px}.gap-3\\.5{gap:14px}.gap-4{gap:16px}.gap-5{gap:20px}.gap-\\[22px\\]{gap:22px}.gap-\\[3px\\]{gap:3px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}.gap-x-3\\.5{-moz-column-gap:14px;column-gap:14px}.gap-y-1{row-gap:4px}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:var(--aid-c-radius)}.rounded-2xl{border-radius:16px}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[22\\.5\\%\\]{border-radius:22.5%}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[7px\\]{border-radius:7px}.rounded-\\[calc\\(var\\(--aid-c-radius\\)\\+6px\\)\\]{border-radius:calc(var(--aid-c-radius) + 6px)}.rounded-aid-field{border-radius:var(--aid-c-radius-field)}.rounded-aid-window{border-radius:var(--aid-c-radius-window)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--aid-c-radius)}.rounded-md{border-radius:calc(var(--aid-c-radius) - 2px)}.rounded-sm{border-radius:calc(var(--aid-c-radius) - 4px)}.rounded-xl{border-radius:12px}.rounded-br-\\[6px\\]{border-bottom-right-radius:6px}.border{border-width:1px}.border-0{border-width:0px}.border-\\[1\\.5px\\]{border-width:1.5px}.border-\\[3px\\]{border-width:3px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-\\[3px\\]{border-left-width:3px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-border{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-border) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-current{border-color:currentColor}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\\/30{border-color:hsl(var(--destructive) / .3)}.border-error\\/30{border-color:hsl(var(--error),.3)}.border-error\\/35{border-color:hsl(var(--error),.35)}.border-input{border-color:hsl(var(--input))}.border-muted-foreground{border-color:hsl(var(--muted-foreground))}.border-primary{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-primary-30{border-color:color-mix(in srgb,var(--aid-c-primary) 30%,transparent)}.border-primary-35{border-color:color-mix(in srgb,var(--aid-c-primary) 35%,transparent)}.border-primary-50{border-color:color-mix(in srgb,var(--aid-c-primary) 50%,transparent)}.border-primary-pressed{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-processing\\/25{border-color:hsl(var(--processing),.25)}.border-warning\\/40{border-color:hsl(var(--warning),.4)}.border-r-transparent{border-right-color:transparent}.bg-\\[\\#F3F5FA\\]{--tw-bg-opacity: 1;background-color:rgb(243 245 250 / var(--tw-bg-opacity, 1))}.bg-\\[hsl\\(var\\(--chart-card\\)\\)\\]{background-color:hsl(var(--chart-card))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-border{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-border) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-card{background-color:hsl(var(--card))}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive-background{background-color:hsla(var(--destructive-background))}.bg-destructive-pressed{background-color:hsl(var(--destructive-pressed))}.bg-error-background{background-color:hsla(var(--error-background))}.bg-file-csv{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-csv)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-doc{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-doc)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-other{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-other)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-pdf{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-pdf)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-ppt{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-ppt)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-xls{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-xls)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-foreground{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-hl{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--hl)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-busy{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-busy)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-down{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-down)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-idle{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-idle)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-muted{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-muted-foreground\\/40{background-color:hsl(var(--muted-foreground) / .4)}.bg-muted\\/60{background-color:color-mix(in srgb,var(--aid-c-muted) 60%,transparent)}.bg-primary{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-primary-pressed{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-processing-background{background-color:hsla(var(--processing-background))}.bg-scrim{background-color:var(--scrim)}.bg-secondary{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-secondary) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-transparent{background-color:transparent}.bg-warning-background{background-color:hsla(var(--warning-background))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-1\\.5{padding:6px}.p-2{padding:8px}.p-2\\.5{padding:10px}.p-3{padding:12px}.p-3\\.5{padding:14px}.p-4{padding:16px}.p-6{padding:24px}.p-8{padding:32px}.px-0{padding-left:0;padding-right:0}.px-0\\.5{padding-left:2px;padding-right:2px}.px-1{padding-left:4px;padding-right:4px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-3\\.5{padding-left:14px;padding-right:14px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[5px\\]{padding-left:5px;padding-right:5px}.px-px{padding-left:1px;padding-right:1px}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-2\\.5{padding-top:10px;padding-bottom:10px}.py-3{padding-top:12px;padding-bottom:12px}.py-3\\.5{padding-top:14px;padding-bottom:14px}.py-6{padding-top:24px;padding-bottom:24px}.py-\\[7px\\]{padding-top:7px;padding-bottom:7px}.py-\\[9px\\]{padding-top:9px;padding-bottom:9px}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:4px}.pb-1\\.5{padding-bottom:6px}.pb-2{padding-bottom:8px}.pb-2\\.5{padding-bottom:10px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.pb-\\[18px\\]{padding-bottom:18px}.pl-0\\.5{padding-left:2px}.pl-2{padding-left:8px}.pl-2\\.5{padding-left:10px}.pl-3{padding-left:12px}.pl-3\\.5{padding-left:14px}.pl-4{padding-left:16px}.pl-5{padding-left:20px}.pl-\\[18px\\]{padding-left:18px}.pl-\\[22px\\]{padding-left:22px}.pl-\\[34px\\]{padding-left:34px}.pr-1\\.5{padding-right:6px}.pr-2{padding-right:8px}.pr-2\\.5{padding-right:10px}.pr-3{padding-right:12px}.pr-3\\.5{padding-right:14px}.pr-4{padding-right:16px}.pr-7{padding-right:28px}.pr-9{padding-right:36px}.pt-0\\.5{padding-top:2px}.pt-1{padding-top:4px}.pt-1\\.5{padding-top:6px}.pt-14{padding-top:56px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-3\\.5{padding-top:14px}.pt-7{padding-top:28px}.pt-\\[18px\\]{padding-top:18px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--aid-c-font)}.text-2xl{font-size:20px}.text-2xs{font-size:12px}.text-3xl{font-size:24px}.text-\\[11px\\]{font-size:11px}.text-\\[13\\.5px\\]{font-size:13.5px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[17px\\]{font-size:17px}.text-\\[9\\.5px\\]{font-size:9.5px}.text-base{font-size:15px}.text-lg{font-size:16px}.text-sm{font-size:14px}.text-xl{font-size:18px}.text-xs{font-size:13px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:24px}.leading-\\[1\\.35\\]{line-height:1.35}.leading-\\[1\\.3\\]{line-height:1.3}.leading-\\[1\\.55\\]{line-height:1.55}.leading-\\[1\\.65\\]{line-height:1.65}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\\[0\\.02em\\]{letter-spacing:.02em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-\\[hsl\\(var\\(--foreground\\)\\)\\]{color:hsl(var(--foreground))}.text-background{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-inherit{color:inherit}.text-mode-busy{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-busy)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-mode-down{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-down)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-mode-idle{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-idle)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--muted-foreground) / .7)}.text-primary{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-primary-foreground{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-warn-text{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--warn-text)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-warning{--tw-text-opacity: 1;color:hsl(var(--warning),var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_0_0_3px_var\\(--aid-c-secondary\\)\\]{--tw-shadow: 0 0 0 3px var(--aid-c-secondary);--tw-shadow-colored: 0 0 0 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_var\\(--aid-c-border\\)\\]{--tw-shadow: inset 0 0 0 1px var(--aid-c-border);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-panel{--tw-shadow: var(--aid-c-shadow-panel);--tw-shadow-colored: var(--aid-c-shadow-panel);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-pop{--tw-shadow: var(--shadow-pop);--tw-shadow-colored: var(--shadow-pop);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-side{--tw-shadow: var(--aid-c-shadow-side);--tw-shadow-colored: var(--aid-c-shadow-side);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-window{--tw-shadow: var(--aid-c-shadow-window);--tw-shadow-colored: var(--aid-c-shadow-window);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-\\[3px\\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-border{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-border) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.ring-secondary{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.ring-offset-background{--tw-ring-offset-color: color-mix(in srgb, var(--aid-c-background) 100% , transparent)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in{--tw-enter-opacity: 0}.slide-in-from-left-2{--tw-enter-translate-x: -8px}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.running{animation-play-state:running}.paused{animation-play-state:paused}:host{display:block}:host([hidden]){display:none!important}.aid-root{all:initial;display:block;width:100%;height:100%;box-sizing:border-box;--aid-d-primary-hovered: color-mix(in oklch, var(--aid-primary) 84%, white);--aid-d-primary-pressed: color-mix(in oklch, var(--aid-primary) 80%, black);--aid-d-primary-foreground: oklch(from var(--aid-primary) clamp(0, (.62 - l) * 1000, 1) 0 0);--aid-d-secondary: color-mix(in srgb, var(--aid-primary) 10%, transparent);--aid-d-ring: color-mix(in srgb, var(--aid-primary) 50%, transparent);--aid-c-primary: var(--aid-primary, hsl(var(--primary)));--aid-c-primary-hovered: var(--aid-primary-hovered, var(--aid-d-primary-hovered, hsl(var(--primary-hovered))));--aid-c-primary-pressed: var(--aid-primary-pressed, var(--aid-d-primary-pressed, hsl(var(--primary-pressed))));--aid-c-primary-foreground: var( --aid-primary-foreground, var(--aid-d-primary-foreground, hsl(var(--primary-foreground))) );--aid-c-secondary: var(--aid-secondary, var(--aid-d-secondary, hsl(var(--secondary))));--aid-c-ring: var(--aid-ring, var(--aid-d-ring, hsl(var(--ring))));--aid-c-background: var(--aid-background, hsl(var(--background)));--aid-c-foreground: var(--aid-foreground, hsl(var(--foreground)));--aid-c-muted: var(--aid-muted, hsl(var(--muted)));--aid-c-border: var(--aid-border, hsl(var(--border)));--aid-c-radius: var(--aid-radius, var(--radius));--aid-c-font: var( --aid-font, var( --aid-theme-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif ) );--aid-c-z: var(--aid-z-index, 2147483000);font-family:var(--aid-c-font);font-size:15px;line-height:1.5;color:var(--aid-c-foreground);-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-align:left}.aid-root{--warning: 21, 90%, 48%;--warning-background: 27, 96%, 61%, .2;--ring: 201 100% 35%;--chart-1: 201 100% 35%;--chart-2: 174 72% 30%;--chart-3: 27 95% 46%;--chart-4: 330 70% 42%;--chart-5: 252 45% 52%;--chart-ref: 222 47% 11%;--chart-neg: 359 72% 48%;--chart-dim: 201 45% 80%;--chart-grid: 214 32% 88%;--mode-idle: 142 72% 29%;--mode-busy: 32 95% 36%;--mode-down: 359 78% 44%;--file-pdf: 0 72% 45%;--file-doc: 214 80% 44%;--file-ppt: 18 88% 44%;--file-xls: 145 63% 30%;--file-csv: 174 70% 28%;--file-other: 215 16% 42%;--warn-text: 24 90% 30%;--hl: 45 100% 55% / .45;--scrim: rgb(2 6 23 / .48);--persona-ring: 214 32% 88%;--shadow-pop: 0 10px 28px -10px rgb(15 23 42 / .28);--aid-c-radius-window: calc(var(--aid-c-radius) + 6px);--aid-c-radius-field: calc(var(--aid-c-radius) + 4px);--aid-c-radius-bubble-corner: 6px;--aid-c-side-width: 248px;--aid-c-side-over-width: 290px;--aid-c-toolbar-height: 52px;--aid-c-side-head-height: 56px;--aid-c-shadow-launcher: 0 10px 30px -8px rgb(2 6 23 / .45), 0 2px 6px rgb(2 6 23 / .2);--aid-c-shadow-launcher-drag: 0 22px 44px -10px rgb(2 6 23 / .55);--aid-c-shadow-window: 0 30px 70px -20px rgb(2 6 23 / .55);--aid-c-shadow-panel: 0 20px 50px -16px rgb(2 6 23 / .5);--aid-c-shadow-side: 12px 0 30px -12px rgb(2 6 23 / .45)}.aid-root.dark{--ring: 201 90% 60%;--chart-1: 201 90% 60%;--chart-2: 170 60% 52%;--chart-3: 30 95% 62%;--chart-4: 330 75% 70%;--chart-5: 252 75% 76%;--chart-ref: 210 40% 98%;--chart-neg: 359 92% 70%;--chart-dim: 201 30% 32%;--chart-grid: 217 33% 25%;--mode-idle: 142 60% 55%;--mode-busy: 35 95% 62%;--mode-down: 359 95% 72%;--file-pdf: 0 80% 62%;--file-doc: 214 85% 62%;--file-ppt: 20 92% 60%;--file-xls: 145 55% 48%;--file-csv: 172 55% 46%;--file-other: 215 20% 60%;--warn-text: 32 95% 66%;--hl: 45 100% 55% / .35;--scrim: rgb(0 0 0 / .6);--persona-ring: 217 33% 30%;--shadow-pop: 0 12px 32px -10px rgb(0 0 0 / .6)}:where(.aid-root svg.lucide){width:16px;height:16px;flex-shrink:0}:where(.aid-root *),:where(.aid-root *):before,:where(.aid-root *):after{border-color:var(--aid-c-border)}.aid-root[data-mode=launcher]{width:0;height:0}.aid-root{--aid-c-launcher-size: 60px}@media(max-width:639px){.aid-root{--aid-c-launcher-size: 56px}}.aid-launcher{position:fixed;z-index:var(--aid-c-z);display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;min-width:var(--aid-c-launcher-size);height:var(--aid-c-launcher-size);padding:0;border:0;border-radius:9999px;background:var(--aid-c-primary);color:var(--aid-c-primary-foreground);box-shadow:var(--aid-c-shadow-launcher);font:600 15px/1 var(--aid-c-font);cursor:pointer;outline:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease-out,transform .12s ease-out,box-shadow .12s ease-out}.aid-launcher[data-variant=label]{max-width:300px;padding:0 20px 0 8px}.aid-launcher[data-shape=rounded]{border-radius:16px}.aid-launcher[data-shape=square]{border-radius:4px}@media(hover:hover){.aid-launcher:hover{background:var(--aid-c-primary-hovered);transform:translateY(-2px)}}.aid-launcher:active{transform:scale(.96)}.aid-launcher:focus-visible{outline:3px solid var(--aid-c-ring);outline-offset:3px}.aid-launcher[data-dragging=true]{transform:scale(1.06);box-shadow:var(--aid-c-shadow-launcher-drag)}@media(prefers-reduced-motion:reduce){.aid-launcher,.aid-launcher:hover,.aid-launcher:active,.aid-launcher[data-dragging=true]{transition:none;transform:none}}.aid-launcher[data-dragging=true],.aid-window-header[data-dragging=true]{cursor:grabbing}.aid-launcher-origin{position:fixed;z-index:calc(var(--aid-c-z) - 1);box-sizing:border-box;border:1.5px dashed hsl(var(--muted-foreground) / .55);border-radius:9999px;pointer-events:none}.aid-launcher-origin[data-shape=rounded]{border-radius:16px}.aid-launcher-origin[data-shape=square]{border-radius:4px}.aid-root{--aid-c-window-gap: 24px;--aid-c-overlay: var(--aid-overlay, rgb(2 6 23 / .35))}.aid-window{position:fixed;z-index:var(--aid-c-z);display:flex;flex-direction:column;overflow:hidden;transition:opacity .2s ease-out,transform .26s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.dana-av{position:relative;display:inline-block;flex-shrink:0;overflow:hidden}.dana-av>*{position:absolute;inset:0;width:100%;height:100%;display:block}.dana-av-body{transform-origin:50% 100%}.dana-av-dot{transform-box:fill-box;transform-origin:50% 50%}.dana-av[data-animated][data-mood=calm] .dana-av-body,.dana-av[data-animated][data-mood=listen] .dana-av-body{animation:dana-breathe 3.6s ease-in-out infinite alternate}.dana-av[data-animated][data-mood=typing] .dana-av-body{animation:dana-bob .34s ease-in-out infinite}.dana-av[data-animated][data-mood=think] .dana-av-body{animation:dana-sway 3.4s ease-in-out infinite alternate}.dana-av[data-animated][data-mood=eureka] .dana-av-body{animation:dana-lift 1.3s cubic-bezier(.3,0,.4,1) infinite}.dana-av[data-animated][data-mood=sorry] .dana-av-body{animation:dana-slump 2.8s ease-in-out infinite}.dana-av[data-animated] .dana-av-bubble,.dana-av[data-animated] .dana-av-dots{animation:dana-float 2.2s ease-in-out infinite alternate}.dana-av[data-animated] .dana-av-dot{animation:dana-dot 1.1s ease-in-out infinite}.dana-av[data-animated] .dana-av-dot:nth-child(3n+2){animation-delay:.18s}.dana-av[data-animated] .dana-av-dot:nth-child(3n){animation-delay:.36s}.dana-av[data-animated] .dana-av-spark{transform-origin:13% 30%;animation:dana-twinkle 1.3s ease-in-out infinite}.dana-av[data-animated] .dana-av-drop{animation:dana-drip 1.8s ease-in infinite}@keyframes dana-breathe{to{transform:translateY(-.5%) scale(1.004,1.01)}}@keyframes dana-bob{50%{transform:translateY(.5%)}}@keyframes dana-sway{0%{transform:rotate(-1.2deg)}to{transform:rotate(1.2deg)}}@keyframes dana-lift{15%{transform:scale(1.02,.98)}42%{transform:translateY(-2.5%) scale(.99,1.015)}65%{transform:scale(1.01,.99)}80%{transform:none}}@keyframes dana-slump{8%{transform:translate(-.7%) rotate(-.6deg)}16%{transform:translate(.7%) rotate(.6deg)}24%{transform:none}60%{transform:translateY(1%) rotate(-.8deg)}}@keyframes dana-float{to{transform:translateY(-1.5%)}}@keyframes dana-dot{0%,60%,to{transform:translateY(0);opacity:.45}30%{transform:translateY(-40%);opacity:1}}@keyframes dana-twinkle{0%,to{transform:scale(.75);opacity:.6}45%{transform:scale(1.08) rotate(12deg);opacity:1}}@keyframes dana-drip{0%{transform:translateY(-1.5%);opacity:0}15%{opacity:1}70%{transform:translateY(3.5%);opacity:1}to{transform:translateY(5.5%);opacity:0}}@media(prefers-reduced-motion:reduce){.dana-av *{animation:none!important}}.aid-overlay{position:fixed;inset:0;z-index:var(--aid-c-z);background:var(--aid-c-overlay);transition:opacity .2s ease-out,visibility 0s linear 0s}.aid-overlay[data-state=closed]{opacity:0;visibility:hidden;transition:opacity .2s ease-in,visibility 0s linear .2s}.aid-root[data-mode=launcher] .aid-window{top:var(--aid-c-window-gap);right:var(--aid-c-window-gap);bottom:var(--aid-c-window-gap);width:min(calc(100vw - 2 * var(--aid-c-window-gap)),max(720px,var(--aid-window-width, 60vw)));transition:opacity .2s ease-out,transform .26s cubic-bezier(.32,.72,0,1),width .26s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.aid-root[data-mode=launcher] .aid-window[data-expanded=true]{width:calc(100vw - 2 * var(--aid-c-window-gap))}.aid-root .aid-window[data-state=closed]{opacity:0;transform:translateY(8px);visibility:hidden;pointer-events:none;transition:opacity .16s ease-in,transform .2s ease-in,visibility 0s linear .2s}.aid-root[data-mode=launcher] .aid-window[data-fullscreen=true]{inset:0;width:100%;border-width:0;border-radius:0;box-shadow:none}.aid-root[data-mode=window] .aid-window{position:relative;width:100%;height:100%;box-shadow:none}@media(prefers-reduced-motion:reduce){.aid-root .aid-window,.aid-root .aid-window[data-state=closed],.aid-overlay,.aid-overlay[data-state=closed]{transition:none}}.aid-launcher-badge{position:absolute;top:-4px;right:-4px;box-sizing:content-box;display:flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border:2px solid var(--aid-c-background);border-radius:9999px;background:hsl(var(--destructive));color:hsl(var(--destructive-foreground));font:700 11px/1 var(--aid-c-font)}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\\:mt-0:first-child{margin-top:0}.last\\:border-b-0:last-child{border-bottom-width:0px}.empty\\:hidden:empty{display:none}.focus-within\\:border-destructive:focus-within{border-color:hsl(var(--destructive))}.focus-within\\:border-primary:focus-within{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus-within\\:ring-\\[3px\\]:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\\:ring-secondary:focus-within{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.hover\\:border-primary:hover{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.hover\\:border-primary\\/50:hover{border-color:color-mix(in srgb,var(--aid-c-primary) 50%,transparent)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-background:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-background\\/60:hover{background-color:color-mix(in srgb,var(--aid-c-background) 60%,transparent)}.hover\\:bg-destructive-hovered:hover{background-color:hsl(var(--destructive-hovered))}.hover\\:bg-muted:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-primary-hovered:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-hovered) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-secondary-hovered:hover{--tw-bg-opacity: 1;background-color:hsl(var(--secondary-hovered),var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-foreground:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary-foreground:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary-hovered:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-hovered) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary\\/80:hover{color:color-mix(in srgb,var(--aid-c-primary) 80%,transparent)}.hover\\:underline:hover{text-decoration-line:underline}.focus\\:border-primary:focus{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus\\:ring-\\[3px\\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-secondary:focus{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:border-primary:focus-visible{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus-visible\\:bg-accent:focus-visible{background-color:hsl(var(--accent))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset: inset}.focus-visible\\:ring-destructive:focus-visible{--tw-ring-color: hsl(var(--destructive))}.focus-visible\\:ring-primary:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-primary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-ring) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-secondary:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\\:border-primary-pressed:active{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.active\\:bg-destructive-pressed:active{background-color:hsl(var(--destructive-pressed))}.active\\:bg-primary-pressed:active{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.active\\:bg-secondary-pressed:active{--tw-bg-opacity: 1;background-color:hsl(var(--secondary-pressed),var(--tw-bg-opacity, 1))}.active\\:text-primary-foreground:active{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.active\\:text-primary-pressed:active{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-disabled:disabled{background-color:hsl(var(--disabled))}.disabled\\:bg-muted:disabled{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.disabled\\:bg-transparent:disabled{background-color:transparent}.disabled\\:text-disabled-foreground:disabled{color:hsl(var(--disabled-foreground))}.disabled\\:text-muted-foreground:disabled{color:hsl(var(--muted-foreground))}.disabled\\:opacity-100:disabled{opacity:1}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}.group\\/attach:focus-within .group-focus-within\\/attach\\:block{display:block}.group:focus-within .group-focus-within\\:opacity-100{opacity:1}.group\\/attach:hover .group-hover\\/attach\\:block{display:block}.group:hover .group-hover\\:opacity-100{opacity:1}.aria-disabled\\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}@media(prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:transition-none{transition-property:none}}.\\[\\&\\:\\:-webkit-search-cancel-button\\]\\:hidden::-webkit-search-cancel-button{display:none}.\\[\\&_a\\]\\:no-underline a{text-decoration-line:none}.\\[\\&_li\\+li\\]\\:mt-1 li+li{margin-top:4px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_ul\\]\\:mt-1 ul{margin-top:4px}@media(hover:none){.\\[\\@media\\(hover\\:none\\)\\]\\:opacity-100{opacity:1}}',Zk=3e3,Qg=6*6e4,Qk={phase:"idle"},Jk={phase:"pending"},wu={phase:"failed"},eS={phase:"expired"},Tz=new Set(["pdf","docx","pptx","xlsx","csv"]),Jg=e=>{switch(e.status){case"queued":case"running":return Jk;case"done":{const t=e.files.filter(r=>Tz.has(r.format));return t.length>0?{phase:"done",files:t}:wu}case"expired":return eS;default:return wu}},qr=new Map,ed=new Set,Az=new Set(["done","failed","expired"]),td=new Set;let co=0;const ca=(e,t)=>{const r=qr.get(e)??{view:Qk};qr.set(e,{...r,...t});for(const n of td)n()},Ez=e=>{const t=qr.get(e);if(t?.jobId===void 0||t.deadline===void 0||t.api===void 0)return;if(clearTimeout(t.timer),Date.now()+Zk>t.deadline){ca(e,{view:wu,timer:void 0});return}const{jobId:r,api:n}=t,i=co,a=setTimeout(()=>{n.reportStatus(r).then(o=>{i===co&&qr.get(e)?.jobId===r&&em(e,o)},()=>{i===co&&qr.get(e)?.jobId===r&&ca(e,{view:wu,timer:void 0})})},Zk);ca(e,{timer:a})},em=(e,t)=>{const r=Jg(t),n=qr.get(e)?.jobId;n!==void 0&&n!==t.job_id&&ed.add(n);const i=qr.get(e)?.deadline??Date.now()+Qg;ca(e,{view:r,jobId:t.job_id,deadline:i,timer:void 0}),r.phase==="pending"&&Ez(e)},_u={subscribe:e=>(td.add(e),()=>{td.delete(e)}),view:e=>qr.get(e)?.view,adopt:(e,t,r)=>{if(ed.has(t.job_id))return;const n=qr.get(e);if(n!==void 0&&(n.jobId!==void 0||n.view.phase!=="idle")){if(n.view.phase==="pending")return;const i=t.job_id===n.jobId;if(i&&(!Az.has(t.status)||Jg(t).phase===n.view.phase)||i&&n.view.phase==="expired")return}clearTimeout(n?.timer),ca(e,{deadline:Date.now()+Qg,timer:void 0,api:r}),em(e,t)},start:(e,t,r)=>{const n=qr.get(e);if(n?.view.phase==="pending")return;clearTimeout(n?.timer),n?.jobId!==void 0&&ed.add(n.jobId),ca(e,{view:Jk,jobId:void 0,deadline:Date.now()+Qg,timer:void 0,api:t});const i=co;t.createReport(e,r).then(a=>{i===co&&em(e,a)},()=>{i===co&&ca(e,{view:wu})})},expire:e=>{qr.get(e)?.view.phase==="done"&&ca(e,{view:eS})}},Dz=()=>{co+=1;for(const e of qr.values())clearTimeout(e.timer);qr.clear(),ed.clear();for(const e of td)e()},Mz={calm:"idle",listen:"idle",think:"thinking",typing:"typing",eureka:"success",sorry:"fail"},Lz={think:"bubble",eureka:"spark",sorry:"drop"},Iz=(e,t)=>e==="error"?"sorry":e==="streaming"?t?"typing":"think":"calm",tS=e=>`${e.replace(/\/+$/,"")}/static/avatars/dana`,Pz={animated:!0,assetsBase:tS("")},tm=H.createContext(Pz),Nz=()=>H.useContext(tm),rd=({mood:e="calm",size:t=40,animated:r=!0,label:n,className:i,bare:a})=>{const{animated:o,assetsBase:s}=Nz(),l=Lz[e],u=f=>`${s}/${f}.webp`;return k.jsxs("span",{className:`dana-av ${a?"":"rounded-[22.5%] bg-[#F3F5FA] ring-1 ring-border"} ${i??""}`.trim(),style:{width:t,height:t},"data-mood":e,"data-animated":r&&o?"":void 0,role:n?"img":void 0,"aria-label":n,"aria-hidden":n?void 0:!0,children:[k.jsx("img",{className:"dana-av-body",src:u(Mz[e]),alt:"",decoding:"async",draggable:!1}),l&&k.jsx("img",{className:`dana-av-${l}`,src:u(l),alt:"",decoding:"async",draggable:!1}),e==="typing"&&k.jsxs("svg",{className:"dana-av-dots",viewBox:"0 0 240 240","aria-hidden":"true",focusable:"false",children:[k.jsx("rect",{x:"189",y:"32",width:"38.4",height:"18.6",rx:"9.3",fill:"#fff",stroke:"#1F3F75",strokeWidth:"1.3"}),[199.9,208.3,216.6].map(f=>k.jsx("circle",{className:"dana-av-dot",cx:f,cy:"41.3",r:"2.6",fill:"#1F3F75"},f))]}),e==="think"&&k.jsx("svg",{className:"dana-av-dots",viewBox:"0 0 240 240","aria-hidden":"true",focusable:"false",children:[26.1,34.4,43.4].map(f=>k.jsx("circle",{className:"dana-av-dot",cx:f,cy:"31.7",r:"1.8",fill:"#1C2B4A"},f))})]})},Rz=2500,Oz=(e,t)=>{const[r,n]=H.useState(!1),[i,a]=H.useState(e);return i!==e&&(a(e),i&&!e&&t==="done"&&n(!0)),H.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>{n(!1)},Rz);return()=>{window.clearTimeout(o)}},[r]),r},zz=12e3,Fz=5e3,rS="aid_mode",nS=H.createContext(null),ye=()=>{const e=H.useContext(nS);if(!e)throw new Error("useChat outside ChatProvider");return e},rm=(e,t)=>t.kind==="code"?Vn(e,`errors.${t.code}`):t.kind==="status"?t.status===0?Vn(e,"errors.network"):Vn(e,"errors.code",{code:t.status}):Vn(e,"errors.generic"),Fs="temp-thread",Bz=(e=null)=>({config:null,configError:!1,configErrorCode:null,health:{},mode:e,threads:[],threadsError:!1,threadsLoaded:!1,thread:null,loadingThread:null,turn:null,limit:{remaining:null,daily:null,blocked:!1,overloaded:!1},notice:null}),nm=(e,t,r)=>e&&{...e,messages:e.messages.map(n=>n.id===t?r(n):n)},jz=(e,t,r)=>{const n=new Map;for(const i of e?.steps??[])typeof i.id=="string"&&typeof i.startedAt=="number"&&n.set(i.id,i.startedAt);return{...t,steps:t.steps.map(i=>({...i,startedAt:n.get(i.id)??r}))}},Hz=(e,t)=>{const r=new Date(t).toISOString();return{id:Fs,title:e.query.slice(0,80),mode:e.mode,pinned:!1,created_at:r,updated_at:r,current_leaf_id:null,messages:[]}},Vz=e=>({id:e.id,title:e.title,mode:e.mode,pinned:e.pinned,created_at:e.created_at,updated_at:e.updated_at}),Uz=["widget_unauthorized","origin_not_allowed","origin_blocked"],$z=e=>e.configError?e.limit.overloaded?"overloaded":e.configErrorCode!==null&&Uz.includes(e.configErrorCode)?"siteBlocked":"unavailable":e.config?null:"loading",Gz=(e,t)=>{switch(t.type){case"config":{const{config:r}=t,n=r.modes.map(o=>o.slug),i=e.mode&&n.includes(e.mode)?e.mode:n[0]??null,a=r.visitor.remaining_today;return{...e,config:r,configError:!1,configErrorCode:null,mode:i,limit:{remaining:a,daily:r.visitor.daily_limit,blocked:a<=0,overloaded:!1,...a<=0&&(r.visitor.resets_at??e.limit.resetAt)?{resetAt:r.visitor.resets_at??e.limit.resetAt}:{}}}}case"configError":return{...e,configError:!0,configErrorCode:t.code??null,...t.overloaded?{limit:{...e.limit,blocked:!0,overloaded:!0}}:{}};case"health":return{...e,health:t.health};case"mode":return{...e,mode:t.mode};case"threads":return{...e,threads:t.threads,threadsError:!1,threadsLoaded:!0};case"threadsError":return{...e,threadsError:!0,threadsLoaded:!0};case"threadLoading":return{...e,loadingThread:t.id};case"thread":{if(e.turn&&e.thread?.id===t.thread.id||e.loadingThread!==t.thread.id&&e.thread?.id!==t.thread.id)return e;const r=e.config?.modes.map(n=>n.slug)??[];return{...e,thread:t.thread,loadingThread:null,mode:r.includes(t.thread.mode)?t.thread.mode:e.mode}}case"threadFailed":return e.loadingThread===t.id?{...e,loadingThread:null,notice:{kind:"error",reason:t.reason}}:e;case"newChat":return{...e,thread:null,loadingThread:null,turn:null,notice:null};case"threadDeleted":{const r=e.thread?.id===t.id;return{...e,threads:e.threads.filter(n=>n.id!==t.id),...r?{thread:null,turn:null}:{}}}case"turnStart":{const{request:r,token:n,at:i}=t,a=e.thread??Hz(r,i),{user:o,assistant:s}=Y4(r,a);return{...e,notice:null,thread:{...a,current_leaf_id:s.id,messages:[...a.messages,...o?[o]:[],s]},turn:{token:n,assistantId:s.id,...o?{userId:o.id}:{},startedAt:i,adopted:!1,previousLeaf:a.current_leaf_id,optimisticIds:[s.id,...o?[o.id]:[]]}}}case"resumeStart":return{...e,turn:{token:t.token,assistantId:t.messageId,startedAt:t.at,adopted:!0,previousLeaf:e.thread?.current_leaf_id??null,optimisticIds:[]}};case"adopt":{const{turn:r,thread:n}=e;if(r?.token!==t.token||r.adopted||!n)return e;const{metadata:i}=t,a=n.id===Fs,o=X4(n,{...r.userId?{userId:r.userId}:{},assistantId:r.assistantId},i),s=e.limit.remaining===null?null:Math.max(0,e.limit.remaining-1);return{...e,thread:o,threads:a?[Vz(o),...e.threads.filter(l=>l.id!==o.id)]:e.threads,turn:{...r,adopted:!0,assistantId:i.assistantMessageId,...r.userId?{userId:i.userMessageId}:{}},limit:{...e.limit,remaining:s}}}case"snapshot":{const{turn:r}=e;if(r?.token!==t.token)return e;const n=e.thread?.messages.find(a=>a.id===r.assistantId),i=jz(n,t.snapshot,t.at);return{...e,thread:nm(e.thread,r.assistantId,a=>q4(a,i))}}case"turnEnd":{const{turn:r}=e;if(r?.token!==t.token)return e;const n=t.status==="detached"?e.thread:nm(e.thread,r.assistantId,i=>K4(i,t.status,t.errorText,r.startedAt));return{...e,thread:n,turn:null,limit:{...e.limit,blocked:e.limit.blocked||e.limit.remaining===0}}}case"turnStopping":return e.turn?.token===t.token?{...e,turn:{...e.turn,stopping:!0}}:e;case"turnRejected":{const{turn:r,thread:n}=e;if(r?.token!==t.token)return e;const i=new Set(r.optimisticIds),a=n?.messages.filter(d=>!i.has(d.id))??[],o=n&&(n.id!==Fs||a.length>0)?{...n,current_leaf_id:r.previousLeaf,messages:a}:null,{error:s}=t,l=s.status===429&&s.code==="daily_limit",u=s.status===503&&s.code==="anon_budget";let f=e.limit;return l?f={...f,remaining:0,blocked:!0,...s.resetAt?{resetAt:s.resetAt}:{}}:u&&(f={...f,blocked:!0,overloaded:!0}),{...e,thread:o,turn:null,notice:l||u?null:{kind:"error",reason:s.reason},limit:f}}case"leaf":return e.thread?{...e,thread:{...e.thread,current_leaf_id:t.leafId}}:e;case"rating":return{...e,thread:nm(e.thread,t.messageId,r=>({...r,rating:t.rating,...t.feedback!==void 0?{feedback:t.feedback}:{},...t.feedbackReason!==void 0?{feedback_reason:t.feedbackReason}:{}}))};case"notice":return{...e,notice:t.notice}}},im=e=>{const t=e?e.messages.map(Fk):[],r=Bk(t),n=Hk(r,e?.current_leaf_id??null);return{index:r,path:n?V4(r,n):[]}},nd={text:2e5,steps:500,blocks:100,attachments:50},iS=e=>e.text.length>nd.text||e.steps.length>nd.steps||e.blocks.length>nd.blocks||e.attachments.length>nd.attachments,Wz=e=>e.code==="ip_limit"?{kind:"code",code:"ip_limit"}:Zf(e),aS=()=>{try{return window.localStorage}catch{return null}},Yz=()=>{try{return aS()?.getItem(rS)??null}catch{return null}},Xz=e=>e instanceof TypeError,qz=({api:e,lang:t,open:r,onAdminTheme:n,children:i})=>{const[a,o]=H.useReducer(Gz,null,()=>Bz(Yz())),s=H.useRef(a),l=H.useRef(null),u=H.useRef(0),f=H.useRef(t),d=H.useRef(n);H.useLayoutEffect(()=>{s.current=a,f.current=t,d.current=n});const p=H.useCallback(()=>{e.threads().then(G=>{o({type:"threads",threads:G})},()=>{o({type:"threadsError"})})},[e]),v=H.useCallback(()=>{e.config().then(G=>{o({type:"config",config:G}),d.current(gz(G.site.theme)),e.adoptVisitor(G.visitor.token)&&p()},G=>{const I=G instanceof wr&&G.status===503,z=G instanceof wr?G.code:null;o({type:"configError",...I?{overloaded:I}:{},...z?{code:z}:{}})})},[e,p]),g=H.useCallback(G=>{e.thread(G).then(I=>{o({type:"thread",thread:I})},()=>{})},[e]);H.useEffect(()=>{v(),p()},[v,p]);const y=a.config!==null;H.useEffect(()=>{if(!r||!y)return;const G=()=>{typeof document<"u"&&document.visibilityState==="hidden"||e.health().then(z=>{o({type:"health",health:z})},()=>{})};G();const I=window.setInterval(G,zz);return window.addEventListener("focus",G),()=>{window.clearInterval(I),window.removeEventListener("focus",G)}},[e,r,y]);const x=H.useCallback(()=>{l.current?.controller.abort(),l.current=null},[]);H.useEffect(()=>x,[x]);const b=G=>{const I={token:++u.current,controller:new AbortController,stopRequested:!1,...G?{assistantId:G}:{}};return l.current=I,I},_=(G,I)=>G.stopRequested?"stopped":G.tooBig?"error":G.controller.signal.aborted?"detached":I?"error":"done",S=G=>{l.current===G&&(l.current=null)},T=(G,I,z)=>{S(G),p(),z&&I&&I!==Fs&&g(I)},E=H.useCallback(async G=>{const I=s.current;if(I.turn||l.current||I.limit.blocked)return"busy";const z=I.thread&&I.thread.id!==Fs?I.thread.id:void 0,W=b(),{token:F}=W;o({type:"turnStart",token:F,request:G,at:Date.now()});let ee=z;const ae=Se=>{if(iS(Se)){W.tooBig=!0,W.controller.abort();return}Se.metadata&&W.assistantId===void 0&&(W.assistantId=Se.metadata.assistantMessageId,ee=Se.metadata.threadId,o({type:"adopt",token:F,metadata:Se.metadata})),o({type:"snapshot",token:F,snapshot:Se,at:Date.now()})};let ie,_e=!1;try{const{streamChatAnswer:Se}=await Promise.resolve().then(()=>pC);await Se({transport:e.transport,request:G,...z?{threadId:z}:{},signal:W.controller.signal,onSnapshot:ae})}catch(Se){_e=!0,ie=Se}if(!(W.assistantId!==void 0)&&(ie instanceof wr||Xz(ie))){const Se=ie instanceof wr?ie:new wr(0,"network",null);return o({type:"turnRejected",token:F,error:{status:Se.status,code:Se.code,resetAt:Se.resetAt,reason:Wz(Se)}}),S(W),Se.status===429&&v(),"rejected"}const xe=_(W,_e);return o({type:"turnEnd",token:F,status:xe,errorText:xe==="error"?rm(f.current,Zf(ie)):""}),T(W,ee,xe==="done"||xe==="stopped"),"sent"},[e,v,p,g]),D=H.useCallback(async(G,I)=>{if(l.current)return;const z=b(I),{token:W}=z;o({type:"resumeStart",token:W,messageId:I,at:Date.now()});let F,ee=!1;try{const{resumeChatAnswer:ie}=await Promise.resolve().then(()=>pC);await ie(e.transport,I,z.controller.signal,_e=>{if(iS(_e)){z.tooBig=!0,z.controller.abort();return}o({type:"snapshot",token:W,snapshot:_e,at:Date.now()})})}catch(ie){ee=!0,F=ie}if(F instanceof wr){o({type:"turnEnd",token:W,status:"detached",errorText:""}),T(z,G.id,!0);return}const ae=_(z,ee);o({type:"turnEnd",token:W,status:ae,errorText:ae==="error"?rm(f.current,Zf(F)):""}),T(z,G.id,ae==="done"||ae==="stopped")},[e,p,g]),L=H.useCallback(()=>{const G=l.current;if(!G)return;if(G.stopRequested=!0,o({type:"turnStopping",token:G.token}),G.assistantId===void 0){G.controller.abort();return}const I=window.setTimeout(()=>{G.controller.abort()},Fz);G.controller.signal.addEventListener("abort",()=>{window.clearTimeout(I)},{once:!0}),e.stop(G.assistantId).catch(()=>{G.controller.abort()})},[e]),R=H.useCallback(G=>{s.current.thread?.id!==G&&(x(),o({type:"newChat"}),o({type:"threadLoading",id:G}),e.thread(G).then(I=>{o({type:"thread",thread:I});const{path:z}=im(I),W=z[z.length-1];W?.role==="assistant"&&W.status==="streaming"&&D(I,W.id)},I=>{o({type:"threadFailed",id:G,reason:Zf(I)})}))},[e,x,D]),O=H.useCallback(()=>{x(),o({type:"newChat"})},[x]),M=H.useCallback(async G=>{try{await e.deleteThread(G),s.current.thread?.id===G&&x(),o({type:"threadDeleted",id:G})}catch{o({type:"notice",notice:{kind:"text",key:"deleteError"}})}},[e,x]),P=H.useMemo(()=>im(a.thread),[a.thread]),j=H.useCallback(G=>{const{thread:I}=s.current;if(!I||s.current.turn)return;const z=jk(im(I).index,G),W=I.current_leaf_id;!z||z===W||(o({type:"leaf",leafId:z}),e.setLeaf(I.id,z).catch(()=>{o({type:"leaf",leafId:W}),o({type:"notice",notice:{kind:"text",key:"branch.error"}})}))},[e]),B=H.useCallback((G,I)=>{const z=s.current.thread?.messages.find(ee=>ee.id===G);if(!z)return;const W=z.rating,F=I===W?null:I;o({type:"rating",messageId:G,rating:F}),e.rate(G,F).catch(()=>{o({type:"rating",messageId:G,rating:W}),o({type:"notice",notice:{kind:"text",key:"ratingError"}})})},[e]),$=H.useCallback(async(G,I,z)=>{const W=s.current.thread?.messages.find(F=>F.id===G);try{return await e.feedback(G,I,z),o({type:"rating",messageId:G,rating:W?.rating??null,feedback:I,feedbackReason:z??""}),!0}catch{return!1}},[e]),K=H.useCallback(G=>{o({type:"mode",mode:G});try{aS()?.setItem(rS,G)}catch{}},[]),Z=H.useCallback(()=>{o({type:"notice",notice:null})},[]),re=H.useCallback((G,I)=>Vn(t,G,I),[t]),Y=H.useMemo(()=>({state:a,lang:t,api:e,t:re,path:P.path,index:P.index,send:E,stop:L,openThread:R,newChat:O,deleteThread:M,refreshThreads:p,switchBranch:j,rate:B,saveFeedback:$,selectMode:K,reload:()=>{v(),p()},dismissNotice:Z}),[a,t,e,re,P,E,L,R,O,M,p,j,B,$,K,v,Z]);return k.jsx(nS.Provider,{value:Y,children:i})},oS=e=>H.useSyncExternalStore(t=>{if(typeof matchMedia>"u")return()=>{};const r=matchMedia(e);return r.addEventListener("change",t),()=>{r.removeEventListener("change",t)}},()=>typeof matchMedia<"u"&&matchMedia(e).matches,()=>!1),Kz=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Zz=(e,t)=>{if(e.getAttribute("tabindex")==="-1"||e.getAttribute("aria-hidden")==="true"||getComputedStyle(e).visibility==="hidden")return!1;for(let r=e;r;r=r.parentElement){if(r.hasAttribute("inert")||r.hasAttribute("hidden")||getComputedStyle(r).display==="none")return!1;if(r===t)break}return!t.closest("[inert]")},sS=e=>Array.from(e.querySelectorAll(Kz)).filter(t=>Zz(t,e)),fo=(e,t)=>{H.useLayoutEffect(()=>{e.current?.toggleAttribute("inert",t)},[e,t])},lS=e=>{const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t.activeElement:null},id=(e,t,r)=>{const n=H.useRef(r);H.useEffect(()=>{n.current=r}),H.useEffect(()=>{const i=e.current;if(!t||!i)return;const a=lS(i);(i.querySelector("[data-autofocus]")??sS(i)[0])?.focus({preventScroll:!0});const s=l=>{if(l.key!=="Tab")return;const u=sS(i),f=u[0],d=u[u.length-1];if(!f||!d){l.preventDefault();return}const p=lS(i);l.shiftKey&&(p===f||!i.contains(p))?(l.preventDefault(),d.focus()):!l.shiftKey&&(p===d||!i.contains(p))&&(l.preventDefault(),f.focus())};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s),((a instanceof HTMLElement&&a.tagName!=="BODY"&&a.isConnected&&!i.contains(a)?a:null)??n.current?.())?.focus({preventScroll:!0})}},[e,t])},Qz=8,Jz=9,Oi=(e,t)=>e.find(r=>r.kind===t),uS=e=>e.filter(t=>t.kind==="report").at(-1),eF=e=>e.filter(t=>t.kind==="export").flatMap(t=>t.files),tF=(e,t)=>{const r=e.findIndex(a=>a.id===t),n=r>0?e[r-1]:void 0,i=r>=0?e[r+1]:void 0;return{question:n?.role==="user"?n.content:"",reply:i?.role==="user"?i.content:""}},rF=500,nF=(e,t,r)=>{const n=t.trim();if(n.length<1||n.length>rF)return;const i=e[e.length-1];if(i?.role!=="assistant")return;const a=Oi(i.blocks,"clarification");if(a?.allow_free_text&&Ek(a,{isLastInBranch:!0,now:r})==="open")return{clarification_id:a.id,slot:a.slot,value:null,free_text:n}},iF=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="TEXTAREA"||t==="SELECT"||t==="INPUT"&&!["button","checkbox","radio"].includes(e.type)},aF=e=>typeof e=="number"&&Number.isFinite(e)?e:null,am=e=>typeof e=="string"?e:typeof e=="number"&&Number.isFinite(e)?String(e):"",ku={messageId:null,sectionId:null,fullscreen:!1,view:"chat"},om=(e,t=null)=>({messageId:e,sectionId:t,fullscreen:!1,view:"dashboard"}),cS=H.createContext(null),ho=()=>{},oF={state:ku,open:ho,toggle:ho,autoOpen:ho,close:ho,setSection:ho,setFullscreen:ho,setView:ho},fa=()=>H.useContext(cS)??oF,sF=1200;function lF(e){const{state:t,setFullscreen:r,close:n}=fa(),i=H.useRef({fullscreen:t.fullscreen,setFullscreen:r,close:n});H.useEffect(()=>{i.current={fullscreen:t.fullscreen,setFullscreen:r,close:n}}),H.useEffect(()=>{if(!e)return;const a=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;o.preventDefault();const s=i.current;s.fullscreen?s.setFullscreen(!1):s.close()};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[e])}const uF=(e,t,r)=>e&&!t&&!r;const cF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),fS=e=>{const t=fF(e);return t.charAt(0).toUpperCase()+t.slice(1)},dS=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),dF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var hF={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"};const pF=H.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>H.createElement("svg",{ref:l,...hF,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:dS("lucide",i),...!a&&!dF(s)&&{"aria-hidden":"true"},...s},[...o.map(([u,f])=>H.createElement(u,f)),...Array.isArray(a)?a:[a]]));const Pe=(e,t)=>{const r=H.forwardRef(({className:n,...i},a)=>H.createElement(pF,{ref:a,iconNode:t,className:dS(`lucide-${cF(fS(e))}`,`lucide-${e}`,n),...i}));return r.displayName=fS(e),r};const hS=Pe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const vF=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const gF=Pe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);const pS=Pe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const ad=Pe("book-open",[["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"}]]);const mF=Pe("bot",[["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"}]]);const yF=Pe("chart-column-big",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["rect",{x:"15",y:"5",width:"4",height:"12",rx:"1",key:"q8uenq"}],["rect",{x:"7",y:"8",width:"4",height:"9",rx:"1",key:"sr5ea"}]]);const da=Pe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Bs=Pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const vS=Pe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const od=Pe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const po=Pe("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const gS=Pe("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);const sm=Pe("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const lm=Pe("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const xF=Pe("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const mS=Pe("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const um=Pe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const bF=Pe("file-chart-column-increasing",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M12 18v-4",key:"q1q25u"}],["path",{d:"M16 18v-6",key:"15y0np"}]]);const wF=Pe("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);const _F=Pe("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const kF=Pe("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const yS=Pe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const SF=Pe("landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);const vo=Pe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const xS=Pe("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const CF=Pe("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);const bS=Pe("maximize-2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const TF=Pe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const AF=Pe("message-circle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);const wS=Pe("message-square-text",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);const _S=Pe("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const kS=Pe("minimize-2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const EF=Pe("panel-left-close",[["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"}]]);const DF=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const MF=Pe("paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);const SS=Pe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);const LF=Pe("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const IF=Pe("receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);const CS=Pe("rotate-ccw",[["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"}]]);const TS=Pe("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);const PF=Pe("scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);const Su=Pe("search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const NF=Pe("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const cm=Pe("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const AS=Pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const RF=Pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);const OF=Pe("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);const zF=Pe("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const sd=Pe("triangle-alert",[["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"}]]);const FF=Pe("trending-up",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);const BF=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const Cu=Pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ES(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ES(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function jF(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ES(e))&&(n&&(n+=" "),n+=t);return n}const fm="-",HF=e=>{const t=UF(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const s=o.split(fm);return s[0]===""&&s.length!==1&&s.shift(),DS(s,t)||VF(o)},getConflictingClassGroupIds:(o,s)=>{const l=r[o]||[];return s&&n[o]?[...l,...n[o]]:l}}},DS=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?DS(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(fm);return t.validators.find(({validator:o})=>o(a))?.classGroupId},MS=/^\[(.+)\]$/,VF=e=>{if(MS.test(e)){const t=MS.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},UF=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return GF(Object.entries(e.classGroups),r).forEach(([a,o])=>{dm(o,n,a,t)}),n},dm=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:LS(t,i);a.classGroupId=r;return}if(typeof i=="function"){if($F(i)){dm(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{dm(o,LS(t,a),r,n)})})},LS=(e,t)=>{let r=e;return t.split(fm).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},$F=e=>e.isThemeGetter,GF=(e,t)=>t?e.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[r,i]}):e,WF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},IS="!",YF=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,f=0,d;for(let x=0;x<s.length;x++){let b=s[x];if(u===0){if(b===i&&(n||s.slice(x,x+a)===t)){l.push(s.slice(f,x)),f=x+a;continue}if(b==="/"){d=x;continue}}b==="["?u++:b==="]"&&u--}const p=l.length===0?s:s.substring(f),v=p.startsWith(IS),g=v?p.substring(1):p,y=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:g,maybePostfixModifierPosition:y}};return r?s=>r({className:s,parseClassName:o}):o},XF=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},qF=e=>({cache:WF(e.cacheSize),parseClassName:YF(e),...HF(e)}),KF=/\s+/,ZF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(KF);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:f,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:v}=r(u);let g=!!v,y=n(g?p.substring(0,v):p);if(!y){if(!g){s=u+(s.length>0?" "+s:s);continue}if(y=n(p),!y){s=u+(s.length>0?" "+s:s);continue}g=!1}const x=XF(f).join(":"),b=d?x+IS:x,_=b+y;if(a.includes(_))continue;a.push(_);const S=i(y,g);for(let T=0;T<S.length;++T){const E=S[T];a.push(b+E)}s=u+(s.length>0?" "+s:s)}return s};function QF(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=PS(t))&&(n&&(n+=" "),n+=r);return n}const PS=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=PS(e[n]))&&(r&&(r+=" "),r+=t);return r};function JF(e,...t){let r,n,i,a=o;function o(l){const u=t.reduce((f,d)=>d(f),e());return r=qF(u),n=r.cache.get,i=r.cache.set,a=s,s(l)}function s(l){const u=n(l);if(u)return u;const f=ZF(l,r);return i(l,f),f}return function(){return a(QF.apply(null,arguments))}}const _t=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},NS=/^\[(?:([a-z-]+):)?(.+)\]$/i,eB=/^\d+\/\d+$/,tB=new Set(["px","full","screen"]),rB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,iB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=e=>js(e)||tB.has(e)||eB.test(e),ha=e=>Hs(e,"length",pB),js=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>Hs(e,"number",js),Tu=e=>!!e&&Number.isInteger(Number(e)),sB=e=>e.endsWith("%")&&js(e.slice(0,-1)),qe=e=>NS.test(e),pa=e=>rB.test(e),lB=new Set(["length","size","percentage"]),uB=e=>Hs(e,lB,RS),cB=e=>Hs(e,"position",RS),fB=new Set(["image","url"]),dB=e=>Hs(e,fB,gB),hB=e=>Hs(e,"",vB),Au=()=>!0,Hs=(e,t,r)=>{const n=NS.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},pB=e=>nB.test(e)&&!iB.test(e),RS=()=>!1,vB=e=>aB.test(e),gB=e=>oB.test(e),mB=JF(()=>{const e=_t("colors"),t=_t("spacing"),r=_t("blur"),n=_t("brightness"),i=_t("borderColor"),a=_t("borderRadius"),o=_t("borderSpacing"),s=_t("borderWidth"),l=_t("contrast"),u=_t("grayscale"),f=_t("hueRotate"),d=_t("invert"),p=_t("gap"),v=_t("gradientColorStops"),g=_t("gradientColorStopPositions"),y=_t("inset"),x=_t("margin"),b=_t("opacity"),_=_t("padding"),S=_t("saturate"),T=_t("scale"),E=_t("sepia"),D=_t("skew"),L=_t("space"),R=_t("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",qe,t],j=()=>[qe,t],B=()=>["",zi,ha],$=()=>["auto",js,qe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",qe],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[js,qe];return{cacheSize:500,separator:":",theme:{colors:[Au],spacing:[zi,ha],blur:["none","",pa,qe],brightness:z(),borderColor:[e],borderRadius:["none","","full",pa,qe],borderSpacing:j(),borderWidth:B(),contrast:z(),grayscale:G(),hueRotate:z(),invert:G(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[sB,ha],inset:P(),margin:P(),opacity:z(),padding:j(),saturate:z(),scale:z(),sepia:G(),skew:z(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[pa]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),qe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tu,qe]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",Tu,qe]}],"grid-cols":[{"grid-cols":[Au]}],"col-start-end":[{col:["auto",{span:["full",Tu,qe]},qe]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Au]}],"row-start-end":[{row:["auto",{span:[Tu,qe]},qe]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[pa]},pa]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pa,ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[Au]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",js,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zi,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zi,ha]}],"underline-offset":[{"underline-offset":["auto",zi,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),cB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[zi,qe]}],"outline-w":[{outline:[zi,ha]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[zi,ha]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pa,hB]}],"shadow-color":[{shadow:[Au]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pa,qe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Tu,qe]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zi,ha,hm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),he=(...e)=>mB(jF(e));H.createContext(!0),H.createContext(!1);const pm="opacity-0 transition-opacity motion-reduce:transition-none group-focus-within:opacity-100 group-hover:opacity-100 [@media(hover:none)]:opacity-100",OS=120,yB=200,zS=".xls,.xlsx,.csv,.txt,.md",vm=2e3,xB=4,Eu=["wrong_number","wrong_indicator","wrong_territory","wrong_period","not_answered","language","slow","other"],bB=[1,2,3,4,5],go=e=>{const t=e?.trim();if(!t)return null;if(t.startsWith("#"))return t;if(!/^https?:\/\//i.test(t))return null;try{return new URL(t),t}catch{return null}},FS=e=>e.replace(/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),gm=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return wB(e)}},wB=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch{return!1}finally{t.remove()}},_B=(e,t)=>{const r=document.createElement("a");r.href=e,r.download=t,r.rel="noopener",r.style.display="none",document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>{URL.revokeObjectURL(e)},6e4)},kB=["group.pinned","group.today","group.yesterday","group.week","group.earlier"],BS=864e5,SB=(e,t=new Date)=>{const r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),n=new Map;for(const i of e){const a=new Date(i.updated_at).getTime();let o;i.pinned?o="group.pinned":a>=r?o="group.today":a>=r-BS?o="group.yesterday":a>=r-7*BS?o="group.week":o="group.earlier",n.set(o,[...n.get(o)??[],i])}return kB.flatMap(i=>{const a=n.get(i);return a?[[i,a]]:[]})},CB=()=>{const{t:e}=ye(),{state:t,setView:r}=fa(),n=(i,a)=>k.jsx("button",{type:"button",role:"tab","aria-selected":t.view===i,onClick:()=>{r(i)},className:he("inline-flex h-7 items-center whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",t.view===i?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:text-foreground"),children:a});return k.jsxs("div",{part:"dashboard-tabs",role:"tablist","aria-label":e("dashboard.view"),className:"inline-flex shrink-0 gap-0.5 rounded-md border bg-background p-0.5",children:[n("chat",e("dashboard.chatTab")),n("dashboard",e("dashboard.dashboardTab"))]})},TB=({wide:e,chat:t,panel:r,onPanelFocusChange:n})=>{const{state:i}=fa(),{view:a,fullscreen:o}=i,s=r!=null,l=s&&!e&&a==="dashboard",u=s&&!e&&a==="chat"&&!o,f=H.useRef(null);return fo(f,s&&o),k.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1",children:[k.jsx("div",{ref:f,hidden:l,className:he("relative min-h-0 min-w-0 flex-1 flex-col",l?"hidden":"flex"),children:t}),s?k.jsx("aside",{part:"dashboard","data-fullscreen":o,hidden:u,onFocus:()=>{n?.(!0)},onBlur:d=>{d.currentTarget.contains(d.relatedTarget)||n?.(!1)},className:he("min-h-0 min-w-0 flex-col bg-background",u?"hidden":"flex",o&&"absolute inset-0 z-30",!o&&e&&"w-1/2 min-w-[480px] shrink-0 border-l",!o&&!e&&"flex-1 border-t"),children:r}):null]})};var AB=Object.defineProperty,mm=(e,t)=>AB(e,"name",{value:t,configurable:!0});function ym(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}mm(ym,"setRef");function jS(...e){return t=>{let r=!1;const n=e.map(i=>{const a=ym(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():ym(e[i],null)}}}}mm(jS,"composeRefs");function HS(...e){return H.useCallback(jS(...e),e)}mm(HS,"useComposedRefs");var EB=Object.defineProperty,Kr=(e,t)=>EB(e,"name",{value:t,configurable:!0});function VS(e){const t=H.forwardRef((r,n)=>{let{children:i,...a}=r,o=null,s=!1;const l=[];i=XS(i),H.Children.forEach(i,p=>{if(WS(p)){s=!0;const v=p;let g="child"in v.props?v.props.child:v.props.children;for(;xm(g)&&typeof ld=="function";)g=ld(g._payload);o=LB(v,g),l.push(o?.props?.children)}else l.push(p)}),o?o=H.cloneElement(o,void 0,l):!s&&H.Children.count(i)===1&&H.isValidElement(i)&&(o=i);const u=o?GS(o):void 0,f=HS(n,u);if(!o){if(i||i===0)throw new Error(s?NB(e):PB(e));return i}const d=$S(a,o.props??{});return o.type!==H.Fragment&&(d.ref=n?f:u),H.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Kr(VS,"createSlot");var DB=VS("Slot"),US=Symbol.for("radix.slottable");function MB(e){const t=Kr(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=US,t}Kr(MB,"createSlottable");var LB=Kr((e,t)=>"child"in e.props?H.isValidElement(t)?H.cloneElement(t,void 0,e.props.children(t.props.children)):null:H.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function $S(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"?r[n]=[i,a].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=qS(a,i))}return{...e,...r}}Kr($S,"mergeProps");function GS(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Kr(GS,"getElementRef");function WS(e){return H.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===US}Kr(WS,"isSlottable");var IB=Symbol.for("react.lazy");function xm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IB&&"_payload"in e&&YS(e._payload)}Kr(xm,"isLazyComponent");function YS(e){return typeof e=="object"&&e!==null&&"then"in e}Kr(YS,"isPromiseLike");function XS(e){let t=e;for(;xm(t)&&typeof ld=="function";)t=ld(t._payload);return t}Kr(XS,"useUnwrappedLazy");function qS(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Kr(qS,"concatAriaDescribedby");var PB=Kr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),NB=Kr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ld=W3[" use ".trim().toString()];function KS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=KS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function RB(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=KS(e))&&(n&&(n+=" "),n+=t);return n}const ZS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,QS=RB,JS=((e,t)=>r=>{var n;if(t?.variants==null)return QS(e,r?.class,r?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const p=ZS(f)||ZS(d);return i[u][p]}),s=r&&Object.entries(r).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:p,...v}=f;return Object.entries(v).every(g=>{let[y,x]=g;return Array.isArray(x)?x.includes({...a,...s}[y]):{...a,...s}[y]===x})?[...u,d,p]:u},[]);return QS(e,o,l,r?.class,r?.className)})("inline-flex items-center justify-center gap-2 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 w-[max-content] disabled:bg-disabled disabled:text-disabled-foreground overflow-hidden shrink-0 whitespace-nowrap [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hovered focus-visible:ring-primary active:bg-primary-pressed",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hovered focus-visible:ring-destructive active:bg-destructive-pressed",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hovered focus-visible:ring-primary active:bg-secondary-pressed hover:text-primary-foreground active:text-primary-foreground",ghost:"hover:bg-accent hover:text-accent-foreground focus-visible:ring-primary disabled:bg-transparent",link:"overflow-visible text-primary underline-offset-4 hover:text-primary-hovered focus-visible:ring-primary active:text-primary-pressed disabled:bg-transparent",outline:"bg-secondary text-secondary-foreground hover:bg-secondary-hovered focus-visible:ring-primary active:bg-secondary-pressed hover:text-primary-foreground active:text-primary-foreground",input:"bg-background border border-input focus-visible:ring-primary hover:border-primary active:border-primary-pressed"},size:{default:"h-10 px-4 text-base",xsm:"h-5 px-1 text-xs",xs:"h-6 px-3",sm:"h-8 px-3",md:"h-9 px-4",icon:"size-8 text-base",smIcon:"size-6 rounded-full text-base",lgIcon:"size-10 text-base"},isMenu:{true:"w-full justify-start"}},defaultVariants:{variant:"default",size:"default",isMenu:!1}}),Be=H.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,loading:i=!1,isMenu:a=!1,type:o,...s},l)=>{const u=n?{}:{type:o??"button"};return k.jsx(n?DB:"button",i?{className:he(JS({variant:t,size:r,className:e,isMenu:a})),ref:l,...u,...s,disabled:!0,children:k.jsx(vo,{className:"size-4 animate-spin min-w-16"})}:{className:he(JS({variant:t,size:r,className:e,isMenu:a})),ref:l,...u,...s})});Be.displayName="Button";function bm(e,t,r){if(e===null)return Hn(null,t);const n=Hn(e,t,r);return e>0?`+${n}`:n}function e2(e){return[e.territory_code??e.territory_name,e.item].filter(Boolean).join("|")}function t2(e,t){return e.national?.period===t?e.national.value:null}function OB(e,t,r){const n=mu(e);return Du(e,{period:t,mode:"value",base:"median"}).filter(a=>a.value!==null).slice(0,r).map(a=>{const o=new Map(e.data.filter(s=>e2(s)===a.key).map(s=>[s.period,s.value]));return{key:a.key,name:a.name,points:n.map(s=>({period:s,value:o.get(s)??null}))}})}function zB(e,t){if(new Set(e.data.map(i=>i.territory_code??i.territory_name??"")).size!==1||!e.data.every(i=>i.item!=null&&i.item!==""))return t;const n=new Map(e.data.map(i=>[e2(i),i.item??""]));return t.map(i=>({...i,name:n.get(i.key)??i.name}))}function Du(e,t){return zB(e,c4(e,t))}function r2(e,t,r){const n=t2(e,t);if(n===null||e.value_kind!=="level")return n;const i=r.filter(a=>a!==null&&Number.isFinite(a));return i.length===0?null:n<=Math.max(...i)*1.05?n:null}const FB=["12 76% 61%","173 58% 39%","197 37% 24%","43 74% 66%","27 87% 67%"],wm=e=>e.clientWidth>0&&e.clientWidth<BB,BB=360;function _m(e){const t=document.createElement("span");e.appendChild(t);const r=i=>(t.style.color=i,getComputedStyle(t).color),n={series:FB.map((i,a)=>r(`hsl(var(--chart-${a+1}, ${i}))`)),text:r("hsl(var(--foreground))"),muted:r("hsl(var(--muted-foreground))"),border:r("hsl(var(--chart-grid, var(--border)))"),negative:r("hsl(var(--chart-neg, var(--destructive)))"),reference:r("hsl(var(--chart-ref, var(--foreground)))"),font:getComputedStyle(e).fontFamily,narrow:wm(e)};return t.remove(),n}function jB({option:e,signature:t,label:r,height:n}){const i=H.useRef(null),a=H.useRef(null),o=H.useRef(e);return H.useEffect(()=>{o.current=e}),H.useEffect(()=>{const s=i.current;if(!s)return;let l=!0,u;return Promise.resolve().then(()=>FQ).then(({init:f})=>{if(!l)return;a.current=f(s),a.current.setOption(o.current(_m(s)));let d=wm(s);u=new ResizeObserver(()=>{wm(s)!==d&&(d=!d,a.current?.setOption(o.current(_m(s)),!0)),a.current?.resize()}),u.observe(s)}).catch(()=>{}),()=>{l=!1,u?.disconnect(),a.current?.dispose(),a.current=null}},[]),H.useEffect(()=>{const s=i.current;s&&a.current&&a.current.setOption(o.current(_m(s)),!0)},[t]),k.jsx("div",{ref:i,role:"img","aria-label":r,style:{height:n},className:"w-full min-w-0"})}const HB=[[/товариществ[оа] с ограниченной ответственностью/giu,"ТОО"],[/республиканско(е|го) государственно(е|го) учреждени[ея]/giu,"РГУ"],[/республиканско(е|го) государственно(е|го) предприяти[ея]/giu,"РГП"],[/государственно(е|го) учреждени[ея]/giu,"ГУ"],[/акционерно(е|го) обществ[оа]/giu,"АО"],[/индивидуальный предприниматель/giu,"ИП"]],VB=e=>HB.reduce((t,[r,n])=>t.replace(r,n),e).replace(/\s+/g," ").trim();function UB(e){if(e.trend)return["line","area","column"];const t=["bar","column"],r=e.rows.map(n=>n.value).filter(n=>n!==null);return!e.signed&&r.length>1&&r.every(n=>n>0)&&t.push("pie"),!e.signed&&e.periods.length>1&&e.series.length>0&&t.push("line"),t}const $B=.3;function GB(e,t,r,n){const{lang:i,decimals:a}=n,o=E=>typeof E=="number"?t.signed?bm(E,i,a):Hn(E,i,a):"—",s=new Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:1}),l={color:r.muted,formatter:E=>s.format(E)},u={lineStyle:{color:r.border}},f=E=>D=>{const L=VB(D);return L.length>E?`${L.slice(0,E-1)}…`:L},d={color:r.muted,formatter:f(r.narrow?12:22)},p={animationDuration:400,color:r.series,textStyle:{fontFamily:r.font,color:r.text},tooltip:{trigger:e==="pie"?"item":"axis",confine:!0,valueFormatter:o}},v=t.rows.map(E=>E.value).filter(E=>E!==null),g=!t.signed&&v.every(E=>E>0)&&!h4(v);if(e==="pie")return{...p,legend:{type:"scroll",bottom:0,textStyle:{color:r.muted}},series:[{type:"pie",radius:["40%","68%"],center:["50%","44%"],itemStyle:{borderColor:"transparent",borderRadius:4},label:{show:!1},data:t.rows.filter(E=>E.value!==null).map(E=>({name:E.name,value:E.value}))}]};if(t.trend||e==="line"||e==="area")return{...p,legend:{type:"scroll",bottom:0,textStyle:{color:r.muted}},grid:{left:8,right:16,top:12,bottom:32,containLabel:!0},xAxis:{type:"category",data:t.periods,axisLabel:{color:r.muted},boundaryGap:e==="column"},yAxis:{type:"value",scale:e!=="column",axisLabel:l,splitLine:u},series:t.series.map(E=>({type:e==="column"?"bar":"line",name:E.name,data:t.periods.map(D=>E.points.find(L=>L.period===D)?.value??null),symbolSize:6,...e==="area"?{areaStyle:{opacity:.15}}:{}}))};const y=e==="bar",x=y?[...t.rows].reverse():t.rows,b=x.map(E=>E.name),_=t.national??null,S={type:"value",scale:g,axisLabel:l,splitLine:u,...r.narrow?{splitNumber:2}:{}},T={type:"category",data:b,axisTick:{show:!1},axisLabel:y?d:{...d,formatter:f(14),rotate:30,interval:0}};return{...p,tooltip:{...p.tooltip,axisPointer:{type:"shadow"}},grid:{left:8,right:y?56:16,top:_===null?12:24,bottom:8,containLabel:!0},xAxis:y?S:T,yAxis:y?T:S,series:[{type:"bar",barMaxWidth:28,data:x.map(E=>({value:E.value,itemStyle:{color:E.value!==null&&E.value<0?r.negative:r.series[0],opacity:t.highlightKey!==void 0&&E.key!==t.highlightKey?$B:1,borderRadius:y?[0,4,4,0]:[4,4,0,0]}})),label:{show:y,position:"right",color:r.text,formatter:E=>o(E.value)},..._===null?{}:{markLine:{symbol:"none",silent:!0,lineStyle:{type:"dashed",color:r.reference},label:{formatter:n.nationalLabel(o(_)),color:r.reference,position:y?"end":"insideEndTop"},data:[y?{xAxis:_}:{yAxis:_}]}}}]}}const WB=5,n2=({section:e,period:t,rows:r,national:n=null,signed:i=!1,highlightKey:a,compact:o=!1,label:s})=>{const{lang:l,t:u}=ye(),f={rows:r,series:OB(e,t,WB),periods:mu(e),trend:e.shape==="trend",national:n,signed:i,highlightKey:a},d=UB(f),[p,v]=H.useState(d[0]),g=d.includes(p)?p:d[0],x=g==="bar"&&!f.trend?Math.max(o?180:240,r.length*24+40):o?240:320;return k.jsxs("div",{part:"section-chart",className:"flex min-w-0 flex-col gap-2",children:[d.length>1?k.jsx("div",{role:"group","aria-label":u("chart.kinds"),className:"inline-flex flex-wrap gap-0.5 self-start rounded-md border bg-background p-0.5",children:d.map(b=>k.jsx("button",{type:"button","aria-pressed":b===g,onClick:()=>{v(b)},className:he("inline-flex h-7 items-center whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",b===g?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:text-foreground"),children:u(`chart.kind.${b}`)},b))}):null,k.jsx(jB,{label:s,height:x,signature:JSON.stringify([g,l,f]),option:b=>GB(g,f,b,{lang:l,decimals:e.decimals,nationalLabel:_=>u("chart.national",{value:_})})})]})},i2=(e,t)=>{const{api:r,lang:n}=ye(),a=H.useSyncExternalStore(_u.subscribe,()=>_u.view(e))??(t?Jg(t):Qk);H.useEffect(()=>{t&&_u.adopt(e,t,r)},[e,t,r]);const o=H.useCallback(()=>{_u.start(e,r,n)},[e,r,n]),s=H.useCallback(()=>{_u.expire(e)},[e]);return{view:a,start:o,expire:s}},a2=({messageId:e,block:t,disabled:r=!1,className:n})=>{const{t:i}=ye(),{view:a,start:o}=i2(e,t);return a.phase!=="idle"?null:k.jsxs(Be,{part:"report",variant:"input",size:"sm",className:he("gap-1.5 text-[13px]",n),disabled:r,onClick:o,children:[k.jsx(wF,{"aria-hidden":"true"}),i("report.create")]})},o2={pdf:"pdf",doc:"doc",docx:"doc",ppt:"ppt",pptx:"ppt",xls:"xls",xlsx:"xls",csv:"csv"},km=e=>{const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLowerCase()},s2=e=>Object.hasOwn(o2,e)?o2[e]??"other":"other",YB={pdf:"bg-file-pdf",doc:"bg-file-doc",ppt:"bg-file-ppt",xls:"bg-file-xls",csv:"bg-file-csv",other:"bg-file-other"},Sm=({ext:e,className:t})=>k.jsx("span",{part:"file-type","data-kind":s2(e),"aria-hidden":"true",className:he("flex size-[34px] shrink-0 items-center justify-center rounded-lg text-[9.5px] font-bold leading-none tracking-[0.02em] text-background",YB[s2(e)],t),children:e?e.slice(0,4).toUpperCase():"FILE"}),l2=["byte","kilobyte","megabyte","gigabyte"];function Cm(e,t){let r=e,n=0;for(;r>=1024&&n<l2.length-1;)r/=1024,n+=1;return new Intl.NumberFormat(t,{style:"unit",unit:l2[n]??"byte",unitDisplay:"short",maximumFractionDigits:n===0?0:1}).format(r)}const XB=/^\/api\/v1\/((?:report-jobs|messages)\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/files\/\d{1,4})$/i,u2=e=>{const t=XB.exec(e);return t?.[1]?`${Ug}/${t[1]}`:null},qB=1e3,KB=async(e,t,r,n)=>{const i=u2(t);if(!i)return"unavailable";let a;try{a=await(await e.request(i.slice(Ug.length))).blob()}catch(l){return l instanceof wr&&l.status===410?"expired":l instanceof wr&&l.status===404?"notFound":"unavailable"}const o=URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=FS(r),s.hidden=!0,n.appendChild(s);try{s.click()}finally{s.remove(),window.setTimeout(()=>{URL.revokeObjectURL(o)},qB)}return"ok"},ZB=["pdf","docx","pptx","xlsx","csv"],QB=e=>{const t=e.getRootNode();return t instanceof ShadowRoot?t:e.parentElement??e},c2=({files:e,onExpired:t,className:r})=>{const{api:n,lang:i,t:a}=ye(),[o,s]=H.useState(null),[l,u]=H.useState({}),f=H.useRef(l);H.useEffect(()=>{f.current=l});const d=e.filter(v=>ZB.includes(v.format)&&u2(v.download_url)!==null);if(d.length===0)return null;const p=(v,g)=>{o===null&&(s(v.download_url),u(y=>Object.fromEntries(Object.entries(y).filter(([x])=>x!==v.download_url))),KB(n,v.download_url,v.filename,QB(g.currentTarget)).then(y=>{if(s(null),y==="ok")return;const x={...f.current,[v.download_url]:y};u(x),d.every(b=>x[b.download_url]==="expired")&&t?.()}))};return k.jsxs("div",{part:"files",role:"group","aria-label":a("files.list"),className:he("flex flex-col gap-1.5",r),children:[k.jsx("div",{className:"text-2xs text-muted-foreground",children:a("files.list")}),k.jsx("ul",{"aria-label":a("files.list"),className:"m-0 flex list-none flex-col gap-1.5 p-0",children:d.map(v=>{const g=o===v.download_url,y=l[v.download_url];return k.jsxs("li",{"data-state":l[v.download_url]??void 0,className:he("flex min-w-0 items-center gap-3 rounded-xl border bg-card p-2",l[v.download_url]&&"border-error/35 bg-error-background"),children:[k.jsx(Sm,{ext:v.format}),k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[k.jsx("span",{className:"truncate text-sm font-medium leading-tight",title:v.filename,children:a(`files.${Pk(v.format)}`)}),k.jsxs("span",{className:"text-2xs leading-tight text-muted-foreground",children:[v.format.toUpperCase(),v.size_bytes>0?` · ${Cm(v.size_bytes,i)}`:null]})]}),y?k.jsxs("span",{role:"alert",className:"flex shrink-0 items-center gap-1.5 text-[13px]",children:[k.jsx(po,{className:"text-destructive","aria-hidden":"true"}),a(`files.${y}`)]}):k.jsxs(Be,{variant:"ghost",size:"sm",className:"gap-1.5",title:v.filename,"aria-busy":g,disabled:o!==null,"aria-label":`${a("download")}: ${a(`files.${Pk(v.format)}`)}`,onClick:x=>{p(v,x)},children:[g?k.jsx(vo,{className:"animate-spin motion-reduce:animate-none","aria-hidden":"true"}):k.jsx(mS,{"aria-hidden":"true"}),a("download")]})]},`${v.format}-${v.download_url}`)})})]})},Tm="flex items-center gap-2.5 rounded-xl border px-3 py-2.5 text-sm",f2=({messageId:e,block:t,className:r})=>{const{t:n}=ye(),{view:i,start:a,expire:o}=i2(e,t);switch(i.phase){case"idle":return null;case"pending":return k.jsxs("div",{part:"report",role:"status","data-state":"pending",className:he(Tm,"border-processing/25 bg-processing-background",r),children:[k.jsx(vo,{className:"shrink-0 animate-spin text-primary-text motion-reduce:animate-none","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.pending")})]});case"done":return k.jsx(c2,{files:i.files,onExpired:o,className:r});case"expired":return k.jsxs("div",{part:"report",role:"status","data-state":"expired",className:he(Tm,"bg-card",r),children:[k.jsx(sm,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.expired")}),k.jsx(Be,{variant:"input",size:"sm",className:"gap-1.5 text-[13px]",onClick:a,children:n("report.create")})]});case"failed":return k.jsxs("div",{part:"report",role:"alert","data-state":"failed",className:he(Tm,"border-error/30 bg-error-background",r),children:[k.jsx(po,{className:"shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.failed")}),k.jsx(Be,{variant:"input",size:"sm",className:"gap-1.5 text-[13px]",onClick:a,children:n("report.retry")})]})}},JB=4;function ud(e,t,r){const n=d4(e,t);return n==="п.п."?r("dashboard.points"):n}function d2(e){if(e.length===0)return null;const t=[...e].sort((n,i)=>n-i),r=Math.floor(t.length/2);return t.length%2?t[r]??null:((t[r-1]??0)+(t[r]??0))/2}function Vs(e){const t=new Set;return e.filter(r=>!t.has(r.label)&&t.add(r.label)).slice(0,JB)}function ej(e,{period:t,region:r,lang:n,t:i}){if(r===void 0&&t===e.latest_period&&e.kpis.length>0)return Vs(e.kpis.map(g=>({label:g.label,value:g.value,sub:g.sub??null})));const a=g=>`${Hn(g,n,e.decimals)} ${e.unit.label}`,o=(g,y)=>g===null?Hn(null,n):`${bm(g,n,e.decimals)} ${y}`,s=Du(e,{period:t,mode:"value",base:"median"}).filter(g=>g.value!==null),l=s.map(g=>g.value??0),u=s[0],f=s[s.length-1];if(u===void 0||f===void 0)return[];if(r!==void 0){const g=s.findIndex(b=>b.key===r),y=s[g];if(y===void 0)return[];const x=d2(l);return Vs([{label:y.name,value:a(y.value),sub:t},{label:i("dashboard.kpi.place"),value:i("dashboard.kpi.placeOf",{n:g+1,m:s.length})},{label:i("dashboard.kpi.deviation"),value:o(x===null||y.value===null?null:y.value-x,ud(e,"deviation",i))},{label:i("dashboard.kpi.previous"),value:o(y.delta,ud(e,"change",i))}])}if(e.shape==="trend"){const g=mu(e).filter(T=>T<=t),y=T=>e.data.find(E=>E.period===T&&E.value!==null)?.value??null,x=g[0],b=y(t),_=x===void 0?null:y(x);let S=null;return b!==null&&_!==null&&x!==t&&(S=e.value_kind==="level"?_>0?(b/_-1)*100:null:b-_),Vs([{label:i("dashboard.kpi.last"),value:a(b),sub:t},...x!==void 0&&x!==t?[{label:i("dashboard.kpi.first"),value:a(_),sub:x},{label:i("dashboard.kpi.change"),value:o(S,ud(e,"change",i))}]:[]])}if(e.shape==="breakdown")return Vs([...s.slice(0,3).map(g=>({label:g.name,value:a(g.value),sub:g.share===null?t:`${Hn(g.share,n,1)} %`})),...s.length>1?[{label:i("dashboard.kpi.gap"),value:a((u.value??0)-(f.value??0)),sub:`${u.name} − ${f.name}`}]:[]]);const d=t2(e,t),p=d2(l),v=[{label:i("dashboard.kpi.max"),value:a(u.value),sub:u.name},{label:i("dashboard.kpi.min"),value:a(f.value),sub:f.name},{label:i("dashboard.kpi.median"),value:a(p),sub:t}];return Vs(d!==null?[{label:i("dashboard.kpi.national"),value:a(d),sub:t},...v]:[...v,{label:i("dashboard.kpi.spread"),value:a((u.value??0)-(f.value??0)),sub:`${u.name} − ${f.name}`}])}const tj=({kpis:e})=>{const{t}=ye();return e.length===0?null:k.jsx("ul",{"aria-label":t("dashboard.kpis"),className:"m-0 grid list-none grid-cols-[repeat(auto-fit,minmax(9.5rem,1fr))] gap-2.5 p-0",children:e.map((r,n)=>k.jsxs("li",{className:"flex min-w-0 flex-col gap-0.5 rounded-xl border bg-card px-3.5 py-3",children:[k.jsx("span",{"data-kpi-label":"",className:"truncate text-2xs text-muted-foreground",title:r.label,children:r.label}),k.jsx("span",{className:"text-xl font-semibold tabular-nums leading-snug",children:r.value}),r.sub!=null&&r.sub!==""?k.jsx("span",{className:"truncate text-2xs text-muted-foreground",title:r.sub,children:r.sub}):null]},n))})};function h2({label:e,value:t,options:r,onChange:n}){return k.jsx("div",{role:"group","aria-label":e,className:"inline-flex gap-0.5 rounded-md border bg-background p-0.5",children:r.map(i=>{const a=i.value===t,o=i.disabledHint!==void 0;return k.jsx("button",{type:"button","aria-pressed":a,"aria-disabled":o||void 0,title:i.disabledHint,onClick:()=>{o||n(i.value)},className:he("h-7 whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",a?"bg-secondary text-secondary-foreground":"text-muted-foreground",o?"cursor-not-allowed opacity-50":!a&&"hover:text-foreground"),children:i.label},i.value)})})}const Mu="whitespace-nowrap px-3 py-[7px] text-[13px] font-semibold text-foreground",Us="whitespace-nowrap text-right tabular-nums",rj=({section:e,rows:t,mode:r,lang:n,highlightKey:i})=>{const{t:a}=ye(),o=e.value_kind==="level",s=r==="value"?null:a(r==="change"?"dashboard.table.change":"dashboard.table.deviation",{unit:ud(e,r,a)});return k.jsx("div",{className:"max-h-[28rem] overflow-auto overscroll-contain rounded-[10px] border bg-card",children:k.jsxs("table",{className:"w-full border-collapse text-[13.5px]",children:[k.jsx("thead",{className:"sticky top-0 bg-muted",children:k.jsxs("tr",{className:"border-b",children:[k.jsx("th",{scope:"col",className:he(Mu,"w-10 text-right"),children:a("dashboard.table.rank")}),k.jsx("th",{scope:"col",className:he(Mu,"text-left"),children:a("dashboard.table.position")}),k.jsx("th",{scope:"col",className:he(Mu,Us),children:a("dashboard.table.value",{unit:e.unit.label})}),s!==null?k.jsx("th",{scope:"col",className:he(Mu,Us),children:s}):null,o?k.jsx("th",{scope:"col",className:he(Mu,Us),children:a("dashboard.table.share")}):null]})}),k.jsx("tbody",{children:t.map((l,u)=>k.jsxs("tr",{className:he("h-9 border-b last:border-b-0",l.key===i&&"bg-accent"),children:[k.jsx("td",{className:"px-3 text-right tabular-nums text-muted-foreground",children:u+1}),k.jsx("td",{className:"px-3",children:l.name}),k.jsx("td",{className:he("px-3",Us),children:Hn(l.value,n,e.decimals)}),s!==null?k.jsx("td",{className:he("px-3",Us),children:bm(l.display,n,e.decimals)}):null,o?k.jsx("td",{className:he("px-3",Us),children:Hn(l.share,n,1)}):null]},l.key))})]})})},Am="__all__",Em="size-8 text-muted-foreground hover:text-foreground",nj=({message:e})=>{const{t}=ye(),{state:r,setSection:n}=fa(),i=Oi(e.blocks,"dashboard")?.sections??[],a=i.find(s=>s.id===r.sectionId)??i[0];if(a===void 0)return null;const o=i.length>1?k.jsx("div",{role:"tablist","aria-label":t("dashboard.sections"),className:"flex gap-1 self-start overflow-x-auto rounded-md bg-secondary p-1",children:i.map(s=>{const l=s.id===a.id;return k.jsx("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>{n(s.id)},className:he("min-h-8 shrink-0 rounded-lg px-3 py-1.5 text-left text-sm font-medium leading-snug transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"bg-background text-foreground shadow-sm":"text-secondary-foreground hover:text-foreground"),children:s.title},s.id)})}):null;return k.jsx("section",{"aria-label":t("dashboard.label"),className:"flex h-full min-h-0 min-w-0 flex-1 flex-col bg-background",children:k.jsx(ij,{section:a,message:e,tabs:o},a.id)})},p2=({label:e,value:t,onChange:r,children:n,className:i})=>k.jsxs("div",{className:he("flex flex-col gap-1",i),children:[k.jsx("span",{className:"text-2xs text-muted-foreground","aria-hidden":"true",children:e}),k.jsxs("span",{className:"relative inline-flex",children:[k.jsx("select",{"aria-label":e,value:t,onChange:a=>{r(a.target.value)},className:"h-8 w-full min-w-0 appearance-none truncate rounded-md border border-input bg-background py-0 pl-2.5 pr-7 text-sm text-foreground transition-colors hover:bg-muted focus-visible:border-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-secondary motion-reduce:transition-none",children:n}),k.jsx(Bs,{className:"pointer-events-none absolute right-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"})]})]}),v2=({label:e,children:t})=>k.jsxs("div",{className:"flex flex-col gap-1",children:[k.jsx("span",{className:"text-2xs text-muted-foreground","aria-hidden":"true",children:e}),t]}),ij=({section:e,message:t,tabs:r})=>{const{lang:n,t:i}=ye(),{state:a,setFullscreen:o,close:s}=fa(),{fullscreen:l}=a,u=mu(e),[f,d]=H.useState(()=>u.includes(e.latest_period)?e.latest_period:u.at(-1)??e.latest_period),[p,v]=H.useState(),[g,y]=H.useState("value"),[x,b]=H.useState("median"),_=f4(e,f),S=e.shape==="trend",T=S||g==="change"&&!_.change||g==="deviation"&&!_.deviation?"value":g,E=x==="national"&&_.national?"national":"median",D=Du(e,{period:f,mode:T,base:E}),L=T==="value"?D:Du(e,{period:f,mode:"value",base:E}),R=[...L].sort((z,W)=>z.name.localeCompare(W.name,n)),O=p!==void 0&&R.some(z=>z.key===p)?p:void 0,M=ej(e,{period:f,region:O,lang:n,t:i}),P=f===e.latest_period&&O===void 0?e.findings:[],j=e.shape==="regional",B=L.filter(z=>z.value!==null).length,$=[f,e.unit.label,i(j?"dashboard.regions":"dashboard.items",{n:B})].join(" · "),K=go(e.source_url),Z=e.methodology?.editions,re=Z?.[n]??Z?.ru,Y=go(re?.url),G=`${i(S?"dashboard.trend":"dashboard.ranking")}: ${e.title}, ${f}`,I=uS(t.blocks);return k.jsxs(k.Fragment,{children:[k.jsxs("header",{className:"flex shrink-0 flex-col gap-2 border-b py-3.5 pl-5 pr-4",children:[k.jsxs("div",{className:"flex items-center gap-1",children:[k.jsx("span",{className:"min-w-0 flex-1 text-2xs font-semibold uppercase tracking-wide text-primary-text",children:i("dashboard.eyebrow")}),Y!==null?k.jsx(Be,{variant:"ghost",size:"icon",className:Em,asChild:!0,children:k.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer","aria-label":i("dashboard.methodology"),title:re?.title??i("dashboard.methodology"),children:k.jsx(ad,{"aria-hidden":"true"})})}):null,K!==null?k.jsx(Be,{variant:"ghost",size:"icon",className:Em,asChild:!0,children:k.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer","aria-label":i("dashboard.openSource"),title:i("dashboard.openSource"),children:k.jsx(um,{"aria-hidden":"true"})})}):null,k.jsxs(Be,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground hover:text-foreground","aria-pressed":l,onClick:()=>{o(!l)},children:[l?k.jsx(kS,{"aria-hidden":"true"}):k.jsx(bS,{"aria-hidden":"true"}),i(l?"dashboard.collapse":"dashboard.fullscreen")]}),k.jsx(Be,{variant:"ghost",size:"icon",className:Em,"aria-label":i("dashboard.close"),title:i("dashboard.close"),onClick:s,children:k.jsx(Cu,{"aria-hidden":"true"})})]}),k.jsx("h2",{className:"m-0 text-xl font-semibold leading-snug",children:e.title}),k.jsx("span",{className:"text-xs text-muted-foreground",children:$})]}),k.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3.5 overflow-y-auto overscroll-contain px-5 pb-5 pt-3.5",children:[r,k.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[j&&R.length>1?k.jsxs(p2,{label:i("dashboard.region"),value:O??Am,onChange:z=>{v(z===Am?void 0:z)},className:"min-w-40 max-w-60",children:[k.jsx("option",{value:Am,children:i("dashboard.allRegions")}),R.map(z=>k.jsx("option",{value:z.key,children:z.name},z.key))]}):null,u.length>1?k.jsx(p2,{label:i("dashboard.period"),value:f,onChange:d,className:"min-w-24",children:[...u].reverse().map(z=>k.jsx("option",{value:z,children:z},z))}):null,S?null:k.jsx(v2,{label:i("dashboard.mode.label"),children:k.jsx(h2,{label:i("dashboard.mode.label"),value:T,onChange:y,options:[{value:"value",label:i("dashboard.mode.value")},{value:"deviation",label:i("dashboard.mode.deviation"),disabledHint:_.deviation?void 0:i("dashboard.fewRegions")},{value:"change",label:i("dashboard.mode.change"),disabledHint:_.change?void 0:i("dashboard.noPrevious")}]})}),T==="deviation"?k.jsx(v2,{label:i("dashboard.base.label"),children:k.jsx(h2,{label:i("dashboard.base.label"),value:E,onChange:b,options:[{value:"median",label:i("dashboard.base.median")},{value:"national",label:i("dashboard.base.national"),disabledHint:_.national?void 0:i("dashboard.noNational")}]})}):null]}),k.jsx(tj,{kpis:M}),k.jsx(Dm,{title:i(S?"dashboard.trend":"dashboard.ranking"),card:!0,children:k.jsx(n2,{section:e,period:f,label:G,rows:D.map(z=>({key:z.key,name:z.name,value:z.display})),national:T==="value"?r2(e,f,D.map(z=>z.value)):null,signed:T!=="value",highlightKey:O})}),P.length>0?k.jsx(Dm,{title:i("dashboard.findings"),children:k.jsx("ul",{className:"flex list-disc flex-col gap-1 pl-5 text-sm",children:P.map((z,W)=>k.jsx("li",{children:z},W))})}):null,k.jsx(Dm,{title:i("dashboard.data"),children:k.jsx(rj,{section:e,rows:D,mode:T,lang:n,highlightKey:O})}),k.jsxs("footer",{className:"flex flex-col gap-3 border-t pt-3.5",children:[e.source_name!=null&&e.source_name!==""?k.jsx("p",{className:"text-xs text-muted-foreground",children:i("dashboard.source",{name:e.source_name})}):null,k.jsx("div",{className:"-ml-2 empty:hidden",children:k.jsx(a2,{messageId:t.id,block:I})}),k.jsx(f2,{messageId:t.id,block:I})]})]})]})},Dm=({title:e,children:t,card:r=!1})=>k.jsxs("section",{className:"flex flex-col gap-2",children:[k.jsx("h3",{className:"m-0 text-sm font-semibold",children:e}),r?k.jsx("div",{className:"rounded-xl bg-[hsl(var(--chart-card))] px-4 py-3.5",children:t}):t]}),aj=({threadId:e,children:t})=>{const[r,n]=H.useState(ku),[i,a]=H.useState(e);i!==e&&(a(e),i!==void 0&&n(ku));const o=H.useRef(new Set),s=H.useCallback((y,x)=>{n(om(y,x??null))},[]),l=H.useCallback(y=>{n(x=>x.messageId===y?ku:om(y))},[]),u=H.useCallback(y=>{o.current.has(y)||(o.current.add(y),n(om(y)))},[]),f=H.useCallback(()=>{n(ku)},[]),d=H.useCallback(y=>{n(x=>({...x,sectionId:y}))},[]),p=H.useCallback(y=>{n(x=>({...x,fullscreen:y}))},[]),v=H.useCallback(y=>{n(x=>({...x,view:y}))},[]),g=H.useMemo(()=>({state:r,open:s,toggle:l,autoOpen:u,close:f,setSection:d,setFullscreen:p,setView:v}),[r,s,l,u,f,d,p,v]);return k.jsx(cS.Provider,{value:g,children:t})};function oj(e,t,r){const{autoOpen:n}=fa(),[i,a]=H.useState(null);i?.threadId===void 0&&i!==null&&t===void 0?i.active!==r.streaming&&a({...i,active:r.streaming}):i?.threadId===void 0&&i!==null?i.active||r.streaming||e.some(f=>!Kf(f.id))?a({threadId:t,ids:i.ids,active:!0}):r.loaded&&a({threadId:t,ids:new Set(e.map(f=>f.id)),active:!1}):r.loaded&&(i===null||i.threadId!==t)&&a({threadId:t,ids:new Set(e.map(u=>u.id)),active:!1});const o=e.at(-1),s=o?.id,l=i!==null&&i.threadId===t&&o?.role==="assistant"&&!i.ids.has(o.id)&&o.status!=="streaming"&&Kf(o.id)&&Oi(o.blocks,"dashboard")?.auto_open===!0;H.useEffect(()=>{l&&s!=null&&n(s)},[l,s,n])}const g2="aid_intro_ack",sj=()=>{try{return window.localStorage.getItem(g2)!==null}catch{return!1}},lj=({active:e=!0})=>{const{state:t,lang:r,t:n}=ye(),i=bu(t.config?.intro_notice??void 0,r).trim(),[a,o]=H.useState(sj),s=e&&i!==""&&!a,l=H.useId(),u=i.split(`
|
|
16
|
+
`);r!==-1&&(t=t.slice(r+2))}if(t.startsWith(Oz)){const r=t.lastIndexOf(zk);r!==-1&&(t=t.slice(r+zk.length))}return t}const Fz=["streaming","done","stopped","error"];function Bz(e){return{...typeof e.id=="string"?{id:e.id}:{},node:typeof e.node=="string"?e.node:"",status:e.status==="running"?"running":"done",attempt:typeof e.attempt=="number"?e.attempt:1,...typeof e.durationMs=="number"?{durationMs:e.durationMs}:{},...typeof e.label=="string"?{label:e.label}:{},...typeof e.total=="number"||e.total===null?{total:e.total}:{},...typeof e.startedAt=="number"?{startedAt:e.startedAt}:{}}}function Fk(e){return{id:e.id,parentId:e.parent_id,role:e.role==="user"?"user":"assistant",content:e.role==="user"?zz(e.content):e.content,mode:e.mode,status:Fz.find(t=>t===e.status)??"done",steps:e.steps.map(Bz),durationMs:e.duration_ms,rating:e.rating,feedback:e.feedback,feedbackReason:e.feedback_reason??"",attachments:e.attachments??[],blocks:(e.blocks??[]).flatMap(t=>{const r=Ok(t);return r!=null?[r]:[]}),createdAt:e.created_at}}const jz=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kf=e=>jz.test(e);class zs extends Error{constructor(t){super(t),this.name="StreamFailure"}}const Hz=(e,t)=>Date.parse(e.createdAt)-Date.parse(t.createdAt)||(e.id<t.id?-1:e.id>t.id?1:0);function Bk(e){const t=new Map,r=new Map;for(const n of e){t.set(n.id,n);const i=r.get(n.parentId);i?i.push(n):r.set(n.parentId,[n])}for(const n of r.values())n.sort(Hz);return{byId:t,children:r}}function Vz(e,t){const r=[],n=new Set;let i=e.byId.get(t);for(;i&&!n.has(i.id);)n.add(i.id),r.push(i),i=i.parentId===null?void 0:e.byId.get(i.parentId);return r.reverse()}function jk(e,t){if(!e.byId.has(t))return null;let r=t;for(;;){const n=e.children.get(r),i=n?.[n.length-1];if(!i)return r;r=i.id}}function Uz(e,t){const r=e.byId.get(t);if(!r)return{list:[],position:-1};const n=e.children.get(r.parentId)??[];return{list:n,position:n.findIndex(i=>i.id===t)}}function Hk(e,t){if(t&&e.byId.has(t))return t;const r=e.children.get(null),n=r?.[r.length-1];return n?jk(e,n.id):null}let $z=0;const Gz=e=>`temp-${e}-${Date.now().toString(36)}-${($z++).toString(36)}`;function Vg(e,t,r){return{id:Gz(e==="user"?"user":"stream"),parent_id:r,role:e,content:"",mode:t,status:e==="user"?"done":"streaming",steps:[],duration_ms:null,rating:null,feedback:"",created_at:new Date().toISOString()}}function Wz(e){return!e||e.messages.length===0?null:Hk(Bk(e.messages.map(Fk)),e.current_leaf_id)}function Yz(e,t){if(e.regenerateOf!=null){const i=t?.messages.find(a=>a.id===e.regenerateOf);return{assistant:Vg("assistant",e.mode,i?.parent_id??null)}}const r=e.parentId===void 0?Wz(t):e.parentId||null,n={...Vg("user",e.mode,r),content:e.query,...e.file?{attachments:[{name:e.file.name,url:""}]}:{}};return{user:n,assistant:Vg("assistant",e.mode,n.id)}}function Xz(e,t,r){const n=new Map([[t.assistantId,r.assistantMessageId]]);t.userId!=null&&n.set(t.userId,r.userMessageId);const i=a=>a!=null?n.get(a)??a:a;return{...e,id:r.threadId,current_leaf_id:i(e.current_leaf_id),messages:e.messages.map(a=>n.has(a.id)||a.parent_id!=null&&n.has(a.parent_id)?{...a,id:i(a.id)??a.id,parent_id:i(a.parent_id)}:a)}}function qz(e,t){return{...e,content:t.text,steps:t.steps.map(r=>({...r})),...t.attachments.length>0?{attachments:t.attachments}:{},...t.blocks.length>0?{blocks:t.blocks.map(r=>({...r}))}:{}}}function Kz(e,t,r,n){const i={...e,status:t,duration_ms:Date.now()-n};return t==="error"&&!e.content?{...i,content:r}:i}const Zz=["thread_busy","mode_overloaded","daily_limit","rate_limit","concurrency_limit","file_too_large","file_not_allowed","invalid_query","invalid_parent","mode_not_found","thread_not_found","interrupted"],Qz=e=>Zz.includes(e);function Jz(e){if(e instanceof wr)return e.code;if(e instanceof zs)return e.message}function Zf(e){const t=Jz(e);return t!=null&&Qz(t)?{kind:"code",code:t}:e instanceof wr?{kind:"status",status:e.status}:{kind:"generic"}}async function Qf(e,t,r={}){const n=r.method??"GET",i=new Headers(r.headers),a=await e.headers?.({method:n})??{};for(const[s,l]of Object.entries(a))i.set(s,l);return(e.fetch??fetch)(`${e.baseUrl}${t}`,{...r,method:n,headers:i,...e.credentials?{credentials:e.credentials}:{}})}const Vk="text/event-stream";function e4({query:e,mode:t,file:r,parentId:n,regenerateOf:i,clarification:a},o){const s=new FormData;return s.set("mode",t),i==null&&s.set("query",e),o!=null&&s.set("thread_id",o),n!==void 0&&s.set("parent_id",n),i!=null&&s.set("regenerate_of",i),r&&s.set("file",r),a&&s.set("clarification",JSON.stringify(a)),s}function t4(e,t,r){return Qf(e,jg,{method:"POST",body:t,headers:{Accept:Vk},signal:r})}function r4(e,t,r){return Qf(e,`${jg}/${t}`,{headers:{Accept:Vk},signal:r})}async function n4(e,t){const r=await Qf(e,`${jg}/${t}/stop`,{method:"POST"});if(!r.ok)throw await Hg(r)}async function i4(e){if(!e.ok)throw await Hg(e);if(e.body==null)throw new Error("empty_stream");return e.body}const a4=45,o4=7,s4=.1,l4=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function u4(e,t){const r=e.charCodeAt(t-1);return r>=55296&&r<=56319?t+1:t}function c4(e,t){const[r,n]=H.useState(()=>e.length),i=H.useRef(r),a=H.useRef(e),o=H.useRef(null),s=H.useRef(null),[l]=H.useState(l4),u=t&&!l;return H.useLayoutEffect(()=>{a.current=e},[e]),H.useEffect(()=>{if(!u){i.current=a.current.length;return}if(i.current>e.length&&(i.current=e.length,n(e.length)),o.current!=null||i.current>=e.length)return;const f=d=>{const p=a.current,v=s.current;s.current=d;const g=v==null?1/60:Math.min((d-v)/1e3,s4),y=p.length-i.current;if(y<=0){o.current=null,s.current=null;return}const x=Math.max(1,Math.round(Math.max(a4*g,y*Math.min(1,o4*g)))),b=Math.min(p.length,u4(p,i.current+x));i.current=b,n(b),o.current=requestAnimationFrame(f)};o.current=requestAnimationFrame(f)},[e,u]),H.useEffect(()=>()=>{o.current!=null&&cancelAnimationFrame(o.current),o.current=null},[]),H.useEffect(()=>{u||o.current==null||(cancelAnimationFrame(o.current),o.current=null,s.current=null)},[u]),u?r>=e.length?e:e.slice(0,r):e}const Ug="/api/v1/widget",$g="aid_visitor",Uk=4e3,Gg=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$k=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:[\w-]{10,100}$/i,f4=()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;const t=Array.from(e,r=>r.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`},d4=(e,t)=>{if(e&&Gg.test(e))return e;try{const n=t?.getItem($g);if(n&&(Gg.test(n)||$k.test(n)))return n}catch{}const r=f4();try{t?.setItem($g,r)}catch{}return r},h4=/\/api\/v1\/attachments\/([0-9a-f-]{36})\/?(?:[?#].*)?$/i,xu=(e,t)=>{const r=h4.exec(e);if(!r?.[1]){const n=/\/api\/v1\/widget\/attachments\/([0-9a-f-]{36})\/?$/i.exec(e);return n?.[1]?`${Wg(t)}/attachments/${n[1]}`:null}return`${Wg(t)}/attachments/${r[1]}`},Wg=e=>`${e.replace(/\/+$/,"")}${Ug}`,p4=e=>{if(e==="")return e;let t;try{t=new URL(e)}catch{throw new TypeError(`AiDanaChat: api-url must be an absolute http(s) URL, got "${e}"`)}if(t.protocol!=="https:"&&t.protocol!=="http:")throw new TypeError(`AiDanaChat: api-url must be an http(s) URL, got "${e}"`);return e},Yg=e=>e&&(/^https:\/\//i.test(e)||/^\/(?!\/)/.test(e)||/^data:image\/(?:png|jpeg|webp|gif);/i.test(e))?e:void 0,Jf=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),v4=e=>{if(!Jf(e)||!Jf(e.site)||!Array.isArray(e.modes)||!e.modes.every(t=>Jf(t)&&typeof t.slug=="string")||!Jf(e.visitor))throw new Error("bad config");return e},g4=e=>{const t={};if(!e||typeof e!="object")return t;const r=v=>{const g=e[v];return typeof g=="string"&&g?g:void 0},n=r("primary"),i=r("font"),a=Yg(r("logoUrl")),o=r("title"),s=r("scheme");n&&(t.primary=n),i&&(t.font=i),a&&(t.logoUrl=a),o&&(t.title=o),(s==="light"||s==="dark"||s==="auto")&&(t.scheme=s);const l=r("launcher");(l==="icon"||l==="label")&&(t.launcher=l);const u=r("launcherLabel");u&&(t.launcherLabel=u);const f=r("launcherShape");(f==="circle"||f==="rounded"||f==="square")&&(t.launcherShape=f),(typeof e.radius=="number"||typeof e.radius=="string"&&e.radius)&&(t.radius=e.radius);for(const v of["background","foreground","bubble","border"]){const g=r(v);g&&(t[v]=g)}const d=v=>{const g=e[v],y=typeof g=="number"?g:typeof g=="string"&&g?Number(g):NaN;return Number.isFinite(y)?y:void 0};for(const v of["windowWidth","windowHeight","offsetX","offsetY"]){const g=d(v);g!==void 0&&(t[v]=g)}const p=r("position");return(p==="bottom-right"||p==="bottom-left")&&(t.position=p),t},Gk=e=>{throw e instanceof wr||e instanceof Error&&e.name==="AbortError"?e:new wr(0,"network",null)},m4=({apiUrl:e,siteKey:t,visitorId:r,rememberVisitor:n,fetch:i})=>{let a=r;const o=p4(e),s=encodeURIComponent,l={baseUrl:Wg(o),headers:()=>({"X-Visitor-Id":a,...t?{"X-Widget-Key":t}:{}}),credentials:"omit",...i?{fetch:i}:{}},u=async(p,v={})=>{const g=await Qf(l,p,v).catch(Gk);if(!g.ok)throw await Hg(g);return g},f=async(p,v)=>(await u(p,v)).json(),d=(p,v)=>({method:p,headers:{"Content-Type":"application/json"},body:JSON.stringify(v)});return{transport:l,apiUrl:o,config:async()=>v4(await f("/config")),health:()=>f("/modes/health"),threads:()=>f("/threads?limit=50"),thread:p=>f(`/threads/${s(p)}`),setLeaf:async(p,v)=>{await u(`/threads/${s(p)}`,d("PATCH",{current_leaf_id:v}))},deleteThread:async p=>{await u(`/threads/${s(p)}`,{method:"DELETE"})},rate:async(p,v)=>{await u(`/messages/${s(p)}/rating`,d("POST",{rating:v}))},feedback:async(p,v,g)=>{await u(`/messages/${s(p)}/feedback`,d("POST",g?{feedback:v,reason:g}:{feedback:v}))},stop:p=>n4(l,s(p)).catch(Gk),createReport:(p,v)=>f(`/messages/${s(p)}/report`,d("POST",{language:v})),reportStatus:p=>Gg.test(p)?f(`/report-jobs/${p}`):Promise.reject(new wr(0,"bad_job_id",null)),request:p=>u(p),attachment:async p=>{const v=xu(p,o);if(!v)throw new wr(0,"not_attachment",null);const g=v.slice(l.baseUrl.length),y=await(await u(g)).blob();return URL.createObjectURL(y)},adoptVisitor:p=>!p||!$k.test(p)||p===a?!1:(a=p,n?.(p),!0)}},Xg=["kk","ru","en"],y4=e=>Xg.includes(e),Wk=e=>{const t=[e,typeof document<"u"?document.documentElement.lang:void 0,typeof navigator<"u"?navigator.language:void 0];for(const r of t){const n=r?.toLowerCase().split("-")[0];if(y4(n))return n}return"ru"},Yk={title:"AI-Dana",open:"Открыть чат",unreadAnswers:"новых ответов: {count}",ask:"Задать вопрос",close:"Закрыть",history:"История",closeHistory:"Скрыть историю",newChat:"Новый чат",untitled:"Новый чат",historyEmpty:"Пока нет чатов",historyError:"Не удалось загрузить историю",delete:"Удалить",deleteConfirm:"Удалить чат?",deleteYes:"Удалить",deleteNo:"Отмена",deleteError:"Не удалось удалить чат",modeLabel:"Режим ответа","health.idle":"Свободен","health.busy":"Занят","health.unavailable":"Недоступен",placeholder:"Спросите что угодно",inputLabel:"Сообщение",send:"Отправить",stop:"Остановить",attach:"Прикрепить файл",attachOne:"Можно прикрепить только один файл",attachHint:"Можно прикрепить один файл: XLS, XLSX, CSV, TXT или MD до {size} МБ",disclaimer:"ИИ может ошибаться — проверяйте важную информацию",removeFile:"Удалить файл",counter:"{count} / {max}",counterLimit:"Достигнут предел знаков",counterOver:"Превышен предел знаков",fileTooLarge:"Файл «{name}» больше {size} МБ",fileType:"Файл «{name}» не подходит. Можно прикрепить XLS, XLSX, CSV, TXT или MD",modeUnavailable:"Режим сейчас недоступен, выберите другой",greeting:"Чем могу помочь?",loading:"Загрузка…",configError:"Чат временно недоступен",overloaded:"Сервис сейчас перегружен. Попробуйте позже.",retry:"Повторить",dismiss:"Скрыть",scrollDown:"Прокрутить вниз",settings:"Настройки","settings.language":"Язык","settings.theme":"Тема","settings.themeLight":"Светлая","settings.themeDark":"Тёмная","settings.themeAuto":"Как в системе","settings.model":"Модель по умолчанию","settings.modelHint":"С неё начинается каждый новый чат","settings.shortcuts":"Горячие клавиши","shortcut.search":"Поиск по чатам","shortcut.newChat":"Новый чат","shortcut.sidebar":"Показать или скрыть панель","shortcut.close":"Закрыть окно",search:"Поиск по чатам",searchEmpty:"Ничего не найдено",collapseSidebar:"Скрыть панель",expandSidebar:"Показать панель",expand:"Развернуть на всю страницу",shrink:"Свернуть",examples:"Примеры запросов","examples.whatCanDo":"Что можно сделать","group.pinned":"Закреплённые","group.today":"Сегодня","group.yesterday":"Вчера","group.week":"Последние 7 дней","group.earlier":"Ранее","errors.thread_busy":"AI-Dana ещё отвечает в этом чате. Дождитесь ответа или остановите его.","errors.mode_overloaded":"AI-Dana сейчас перегружена, попробуйте чуть позже","errors.daily_limit":"Лимит сообщений на сегодня исчерпан","errors.rate_limit":"Слишком много сообщений подряд. Подождите минуту.","errors.ip_limit":"Слишком много сообщений из вашей сети сегодня. Попробуйте завтра.","errors.concurrency_limit":"Дождитесь окончания предыдущего ответа","errors.file_too_large":"Файл слишком большой","errors.file_not_allowed":"Этот файл нельзя прикрепить. Подходят XLS, XLSX, CSV, TXT и MD","errors.invalid_query":"Сообщение пустое или слишком длинное","errors.invalid_parent":"Это сообщение больше нельзя изменить","errors.mode_not_found":"Выбранный режим сейчас недоступен. Выберите другой режим.","errors.thread_not_found":"Чат не найден","errors.interrupted":"Ответ прерван","errors.code":"Не удалось получить ответ (код {code}).","errors.generic":"Произошла ошибка при отправке сообщения.","errors.network":"Нет связи с сервером. Проверьте подключение.","errors.render":"Не удалось показать это сообщение.","agent.thinking":"Думаю…","agent.done":"Готово","agent.stopped":"Остановлено","agent.stopping":"Останавливаю…","agent.failed":"не смогла","agent.interrupted":"Ответ прерван","agent.answerStopped":"Ответ остановлен. Задайте вопрос заново, если нужно","agent.seconds":"{value} с","agent.attempt":"попытка {count}","agent.showSteps":"Показать шаги","agent.hideSteps":"Скрыть шаги","steps.router":"Разбираю вопрос","steps.context_builder":"Ищу нужные данные","steps.sql_architect":"Готовлю расчёт","steps.executor":"Считаю показатели","steps.responder":"Готовлю ответ","steps.rag":"Ищу в справочных материалах","steps.sql":"Ищу данные в открытых источниках","steps.document":"Читаю документ","steps.understand":"Разбираю вопрос","steps.search_law":"Ищу в законах","steps.run_sql":"Считаю показатели","steps.run_query":"Получаю данные","steps.data":"Получаю данные","steps.lookup_taxpayer":"Ищу налогоплательщика","steps.find_taxpayer":"Ищу компанию по названию","steps.ask_clarification":"Уточняю вопрос","steps.answer":"Готовлю ответ","steps.unknown":"Работаю над ответом",copy:"Копировать",copied:"Скопировано",download:"Скачать",regenerate:"Ответить заново",edit:"Изменить сообщение",editLabel:"Текст сообщения",cancel:"Отмена",actionsLabel:"Действия с сообщением",rate:"Оценить на {count} из 5",ratingError:"Не удалось сохранить оценку",feedbackOpen:"Оставить отзыв",feedbackEdit:"Изменить отзыв",feedbackLabel:"Отзыв об ответе",feedbackPlaceholder:"Что было не так с ответом?",save:"Сохранить","branch.label":"Варианты","branch.prev":"Предыдущий вариант","branch.next":"Следующий вариант","branch.error":"Не удалось переключить вариант","limit.remaining":"Сегодня осталось {count} из {limit} сообщений","limit.exhausted":"Лимит сообщений на сегодня исчерпан","limit.until":"Лимит сообщений исчерпан. Новые сообщения — после {time}.","blocks.data":"Данные","blocks.hideData":"Скрыть данные","blocks.methodology":"Методология","blocks.passport":"Что посчитано","blocks.indicator":"Показатель","blocks.territory":"Территория","blocks.period":"Период","blocks.breakdown":"Разрез","blocks.breakdown.sex":"по полу","blocks.breakdown.age":"по возрасту","blocks.breakdown.urban_rural":"город и село","blocks.breakdown.activity":"по видам деятельности","blocks.breakdown.item":"по товарам","blocks.substituted":"подстановка","blocks.alternatives":"Похожие показатели","blocks.table":"Таблица данных","blocks.tableSearch":"Поиск по таблице…","blocks.tableEmpty":"Нет данных","blocks.page":"{a} из {b}","blocks.prevPage":"Предыдущая страница","blocks.nextPage":"Следующая страница","blocks.truncated":"Показаны первые {n} строк — полные данные в Excel","blocks.catalogMore":"…и ещё {count} в каталоге","blocks.catalogExamples":"Можно спросить","blocks.options":"Варианты ответа","blocks.default":"по умолчанию","blocks.freeTextHint":"Выберите вариант или напишите свой в поле ниже","blocks.findOption":"Найти в списке…","blocks.chosen":"Выбрано: {label}","blocks.continue":"Продолжить","blocks.cancelPlan":"Отменить","blocks.expired":"Уточнение устарело","blocks.askAgain":"Задать вопрос заново","blocks.dashboard":"Дашборд","blocks.hideDashboard":"Скрыть дашборд","chart.kinds":"Вид диаграммы","chart.kind.bar":"Полосы","chart.kind.column":"Столбцы","chart.kind.pie":"Круговая","chart.kind.line":"Линии","chart.kind.area":"Области","chart.national":"РК {value}","chart.top":"Топ-{n} из {total} — всё в дашборде","chart.label":"{title}, {period}","files.list":"Файлы","files.report":"Готовый отчёт","files.document":"Редактируемый документ","files.presentation":"Презентация","files.excel":"Данные Excel","files.csv":"Данные CSV","files.failed":"Не удалось скачать файл","report.create":"Сформировать отчёт","report.pending":"Файлы отчёта формируются…","report.failed":"Не удалось сформировать файлы отчёта","report.retry":"Повторить","report.expired":"Срок файлов истёк","dashboard.eyebrow":"Аналитика","dashboard.label":"Дашборд","dashboard.sections":"Разделы дашборда","dashboard.regions":"регионов: {n}","dashboard.items":"позиций: {n}","dashboard.openSource":"Открыть в источнике","dashboard.methodology":"Методология","dashboard.fullscreen":"На весь экран","dashboard.collapse":"Свернуть","dashboard.close":"Закрыть","dashboard.chatTab":"Чат","dashboard.dashboardTab":"Дашборд","dashboard.view":"Чат или дашборд","dashboard.region":"Регион","dashboard.allRegions":"Все регионы","dashboard.period":"Период","dashboard.mode.label":"Режим","dashboard.mode.value":"Значение","dashboard.mode.deviation":"Отклонение","dashboard.mode.change":"Изменение","dashboard.base.label":"База отклонения","dashboard.base.median":"от медианы","dashboard.base.national":"от РК","dashboard.noPrevious":"Нет предыдущего периода","dashboard.noNational":"Нет значения по стране за этот период","dashboard.fewRegions":"Нужно хотя бы два значения","dashboard.ranking":"Рейтинг","dashboard.trend":"Динамика","dashboard.findings":"Выводы","dashboard.data":"Данные","dashboard.kpis":"Ключевые показатели","dashboard.table.rank":"№","dashboard.table.position":"Позиция","dashboard.table.value":"Значение, {unit}","dashboard.table.share":"Доля, %","dashboard.table.deviation":"Отклонение, {unit}","dashboard.table.change":"Изменение, {unit}","dashboard.source":"Источник: {name}","dashboard.points":"п.п.","dashboard.kpi.national":"Республика Казахстан","dashboard.kpi.max":"Максимум","dashboard.kpi.min":"Минимум","dashboard.kpi.median":"Медиана по регионам","dashboard.kpi.spread":"Размах","dashboard.kpi.gap":"Разрыв","dashboard.kpi.last":"Последнее значение","dashboard.kpi.first":"Начало периода","dashboard.kpi.change":"Изменение","dashboard.kpi.place":"Место","dashboard.kpi.placeOf":"{n} из {m}","dashboard.kpi.deviation":"Откл. от медианы","dashboard.kpi.previous":"К прошлому периоду","steps.counter":"{done} из {total}","feedback.reasonsLabel":"Что не так?","feedback.reason.wrong_number":"Неверная цифра","feedback.reason.wrong_indicator":"Не тот показатель","feedback.reason.wrong_territory":"Не та территория","feedback.reason.wrong_period":"Не тот период","feedback.reason.not_answered":"Нет ответа на вопрос","feedback.reason.language":"Язык ответа","feedback.reason.slow":"Слишком долго","feedback.reason.other":"Другое","intro.title":"Перед началом","intro.continue":"Продолжить",source:"Источник: {name}","shell.siteBlocked":"Чат недоступен на этом сайте","shell.siteBlockedHint":"Владелец сайта ещё не подключил AI-Dana или доступ приостановлен.","modes.none":"Режимы ответа сейчас недоступны. Попробуйте позже.","attachment.sending":"отправляется","agent.steps":"Шаги","agent.unfinished":"не завершён",rateGroup:"Оценка ответа","blocks.catalogTitle":"Каталог: {topic}","blocks.catalogSections":"Разделы","blocks.catalogIndicators":"Показатели","blocks.catalogSendHint":"Вопрос отправится сразу после выбора","blocks.clarification":"Уточнение","files.expired":"Срок файла истёк","files.notFound":"Файл не найден","files.unavailable":"Файл недоступен"},x4={kk:{title:"AI-Dana",open:"Чатты ашу",unreadAnswers:"жаңа жауаптар: {count}",ask:"Сұрақ қою",close:"Жабу",history:"Тарих",closeHistory:"Тарихты жасыру",newChat:"Жаңа чат",untitled:"Жаңа чат",historyEmpty:"Әзірге чаттар жоқ",historyError:"Тарихты жүктеу мүмкін болмады",delete:"Жою",deleteConfirm:"Чатты жою керек пе?",deleteYes:"Жою",deleteNo:"Бас тарту",deleteError:"Чатты жою мүмкін болмады",modeLabel:"Жауап режимі","health.idle":"Бос","health.busy":"Бос емес","health.unavailable":"Қолжетімсіз",placeholder:"Кез келген нәрсені сұраңыз",inputLabel:"Хабарлама",send:"Жіберу",stop:"Тоқтату",attach:"Файл тіркеу",attachOne:"Тек бір файл тіркеуге болады",attachHint:"Бір файл тіркеуге болады: XLS, XLSX, CSV, TXT немесе MD, {size} МБ-қа дейін",disclaimer:"ЖИ қателесуі мүмкін — маңызды ақпаратты тексеріңіз",removeFile:"Файлды жою",counter:"{count} / {max}",counterLimit:"Таңба шегіне жеттіңіз",counterOver:"Таңба шегінен асып кеттіңіз",fileTooLarge:"«{name}» файлы {size} МБ-тан үлкен",fileType:"«{name}» файлы жарамайды. XLS, XLSX, CSV, TXT немесе MD тіркеуге болады",modeUnavailable:"Режим қазір қолжетімсіз, басқасын таңдаңыз",greeting:"Қалай көмектесе аламын?",loading:"Жүктелуде…",configError:"Чат уақытша қолжетімсіз",overloaded:"Қызмет қазір шамадан тыс жүктелген. Кейінірек қайталап көріңіз.",retry:"Қайталау",dismiss:"Жасыру",scrollDown:"Төменге айналдыру",settings:"Баптаулар","settings.language":"Тіл","settings.theme":"Тақырып","settings.themeLight":"Ашық","settings.themeDark":"Қараңғы","settings.themeAuto":"Жүйедегідей","settings.model":"Әдепкі модель","settings.modelHint":"Әр жаңа чат осыдан басталады","settings.shortcuts":"Жылдам пернелер","shortcut.search":"Чаттардан іздеу","shortcut.newChat":"Жаңа чат","shortcut.sidebar":"Панельді көрсету не жасыру","shortcut.close":"Терезені жабу",search:"Чаттардан іздеу",searchEmpty:"Ештеңе табылмады",collapseSidebar:"Панельді жасыру",expandSidebar:"Панельді көрсету",expand:"Бүкіл бетке жаю",shrink:"Кішірейту",examples:"Сұрау мысалдары","examples.whatCanDo":"Не істей аласыз","group.pinned":"Бекітілгендер","group.today":"Бүгін","group.yesterday":"Кеше","group.week":"Соңғы 7 күн","group.earlier":"Бұрынырақ","errors.thread_busy":"AI-Dana бұл чатта әлі жауап беріп жатыр. Жауапты күтіңіз немесе тоқтатыңыз.","errors.mode_overloaded":"AI-Dana қазір шамадан тыс жүктелген, сәл кейінірек қайталап көріңіз","errors.daily_limit":"Бүгінгі хабарлама лимиті таусылды","errors.rate_limit":"Хабарламалар тым жиі жіберілді. Бір минут күтіңіз.","errors.ip_limit":"Бүгін сіздің желіңізден хабарламалар тым көп жіберілді. Ертең қайталап көріңіз.","errors.concurrency_limit":"Алдыңғы жауаптың аяқталуын күтіңіз","errors.file_too_large":"Файл тым үлкен","errors.file_not_allowed":"Бұл файлды тіркеуге болмайды. XLS, XLSX, CSV, TXT және MD жарайды","errors.invalid_query":"Хабарлама бос немесе тым ұзын","errors.invalid_parent":"Бұл хабарламаны енді өзгертуге болмайды","errors.mode_not_found":"Таңдалған режим қазір қолжетімсіз. Басқа режимді таңдаңыз.","errors.thread_not_found":"Чат табылмады","errors.interrupted":"Жауап үзілді","errors.code":"Жауап алу мүмкін болмады (код {code}).","errors.generic":"Хабарлама жіберу кезінде қате орын алды.","errors.network":"Сервермен байланыс жоқ. Қосылымды тексеріңіз.","errors.render":"Бұл хабарламаны көрсету мүмкін болмады.","agent.thinking":"Ойланып жатырмын…","agent.done":"Дайын","agent.stopped":"Тоқтатылды","agent.stopping":"Тоқтатып жатырмын…","agent.failed":"алмады","agent.interrupted":"Жауап үзілді","agent.answerStopped":"Жауап тоқтатылды. Қажет болса, сұрақты қайта қойыңыз","agent.seconds":"{value} с","agent.attempt":"{count}-әрекет","agent.showSteps":"Қадамдарды көрсету","agent.hideSteps":"Қадамдарды жасыру","steps.router":"Сұрақты талдап жатырмын","steps.context_builder":"Қажет деректерді іздеп жатырмын","steps.sql_architect":"Есептеуді дайындап жатырмын","steps.executor":"Көрсеткіштерді есептеп жатырмын","steps.responder":"Жауап дайындап жатырмын","steps.rag":"Анықтамалық материалдардан іздеп жатырмын","steps.sql":"Ашық дереккөздерден деректер іздеп жатырмын","steps.document":"Құжатты оқып жатырмын","steps.understand":"Сұрақты талдап жатырмын","steps.search_law":"Заңнамадан іздеп жатырмын","steps.run_sql":"Көрсеткіштерді есептеп жатырмын","steps.run_query":"Деректерді алып жатырмын","steps.data":"Деректерді алып жатырмын","steps.lookup_taxpayer":"Салық төлеушіні іздеп жатырмын","steps.find_taxpayer":"Компанияны атауы бойынша іздеп жатырмын","steps.ask_clarification":"Сұрақты нақтылап жатырмын","steps.answer":"Жауап дайындап жатырмын","steps.unknown":"Жауап үстінде жұмыс істеп жатырмын",copy:"Көшіру",copied:"Көшірілді",download:"Жүктеу",regenerate:"Қайта жауап беру",edit:"Хабарламаны өзгерту",editLabel:"Хабарлама мәтіні",cancel:"Болдырмау",actionsLabel:"Хабарлама әрекеттері",rate:"5-тен {count} деп бағалау",ratingError:"Бағаны сақтау мүмкін болмады",feedbackOpen:"Пікір қалдыру",feedbackEdit:"Пікірді өзгерту",feedbackLabel:"Жауап туралы пікір",feedbackPlaceholder:"Жауаптың қай жері дұрыс емес?",save:"Сақтау","branch.label":"Нұсқалар","branch.prev":"Алдыңғы нұсқа","branch.next":"Келесі нұсқа","branch.error":"Нұсқаны ауыстыру мүмкін болмады","limit.remaining":"Бүгін {limit} хабарламаның {count} қалды","limit.exhausted":"Бүгінгі хабарлама лимиті таусылды","limit.until":"Хабарлама лимиті таусылды. Жаңа хабарламаларды {time} кейін жіберуге болады.","blocks.data":"Деректер","blocks.hideData":"Деректерді жасыру","blocks.methodology":"Әдістеме","blocks.passport":"Не есептелді","blocks.indicator":"Көрсеткіш","blocks.territory":"Аумақ","blocks.period":"Кезең","blocks.breakdown":"Қима","blocks.breakdown.sex":"жынысы бойынша","blocks.breakdown.age":"жасы бойынша","blocks.breakdown.urban_rural":"қала және ауыл","blocks.breakdown.activity":"қызмет түрлері бойынша","blocks.breakdown.item":"тауарлар бойынша","blocks.substituted":"алмастырылды","blocks.alternatives":"Ұқсас көрсеткіштер","blocks.table":"Деректер кестесі","blocks.tableSearch":"Кестеден іздеу…","blocks.tableEmpty":"Деректер жоқ","blocks.page":"{b} ішінен {a}","blocks.prevPage":"Алдыңғы бет","blocks.nextPage":"Келесі бет","blocks.truncated":"Алғашқы {n} жол көрсетілді — толық деректер Excel-де","blocks.catalogMore":"…және каталогта тағы {count}","blocks.catalogExamples":"Сұрауға болады","blocks.options":"Жауап нұсқалары","blocks.default":"әдепкі","blocks.freeTextHint":"Нұсқаны таңдаңыз немесе төмендегі өріске өзіңіздікін жазыңыз","blocks.findOption":"Тізімнен іздеу…","blocks.chosen":"Таңдалды: {label}","blocks.continue":"Жалғастыру","blocks.cancelPlan":"Бас тарту","blocks.expired":"Нақтылаудың мерзімі өтті","blocks.askAgain":"Сұрақты қайта қою","blocks.dashboard":"Дашбордты ашу","blocks.hideDashboard":"Дашбордты жасыру","chart.kinds":"Диаграмма түрі","chart.kind.bar":"Жолақтар","chart.kind.column":"Бағандар","chart.kind.pie":"Дөңгелек","chart.kind.line":"Сызықтар","chart.kind.area":"Аймақтар","chart.national":"ҚР {value}","chart.top":"Үздік {n}, барлығы {total} — толығы дашбордта","chart.label":"{title}, {period}","files.list":"Файлдар","files.report":"Дайын есеп","files.document":"Өңделетін құжат","files.presentation":"Таныстырылым","files.excel":"Excel деректері","files.csv":"CSV деректері","files.failed":"Файлды жүктеу мүмкін болмады","report.create":"Есеп құру","report.pending":"Есеп файлдары дайындалуда…","report.failed":"Есеп файлдарын құру мүмкін болмады","report.retry":"Қайталау","report.expired":"Файлдардың мерзімі өтті","dashboard.eyebrow":"Талдау","dashboard.label":"Дашборд тақтасы","dashboard.sections":"Дашборд бөлімдері","dashboard.regions":"өңірлер: {n}","dashboard.items":"позициялар: {n}","dashboard.openSource":"Дереккөзде ашу","dashboard.methodology":"Әдістеме","dashboard.fullscreen":"Толық экран","dashboard.collapse":"Кішірейту","dashboard.close":"Жабу","dashboard.chatTab":"Сұхбат","dashboard.dashboardTab":"Дашборд тақтасы","dashboard.view":"Сұхбат немесе дашборд","dashboard.region":"Өңір","dashboard.allRegions":"Барлық өңірлер","dashboard.period":"Кезең","dashboard.mode.label":"Көрініс","dashboard.mode.value":"Мән","dashboard.mode.deviation":"Ауытқу","dashboard.mode.change":"Өзгеріс","dashboard.base.label":"Ауытқу базасы","dashboard.base.median":"медианадан","dashboard.base.national":"ҚР-дан","dashboard.noPrevious":"Алдыңғы кезең жоқ","dashboard.noNational":"Бұл кезеңге ел бойынша мән жоқ","dashboard.fewRegions":"Кемінде екі мән қажет","dashboard.ranking":"Орындар рейтингі","dashboard.trend":"Серпін","dashboard.findings":"Қорытындылар","dashboard.data":"Деректер","dashboard.kpis":"Негізгі көрсеткіштер","dashboard.table.rank":"№","dashboard.table.position":"Атауы","dashboard.table.value":"Мәні, {unit}","dashboard.table.share":"Үлесі, %","dashboard.table.deviation":"Ауытқу, {unit}","dashboard.table.change":"Өзгеріс, {unit}","dashboard.source":"Дереккөз: {name}","dashboard.points":"п.т.","dashboard.kpi.national":"Қазақстан Республикасы","dashboard.kpi.max":"Ең жоғары","dashboard.kpi.min":"Ең төмен","dashboard.kpi.median":"Өңірлер медианасы","dashboard.kpi.spread":"Құлаш","dashboard.kpi.gap":"Алшақтық","dashboard.kpi.last":"Соңғы мән","dashboard.kpi.first":"Кезең басы","dashboard.kpi.change":"Өзгеріс","dashboard.kpi.place":"Орын","dashboard.kpi.placeOf":"{m} ішінен {n}","dashboard.kpi.deviation":"Медианадан ауытқу","dashboard.kpi.previous":"Алдыңғы кезеңге","steps.counter":"{total} ішінен {done}","feedback.reasonsLabel":"Не қате болды?","feedback.reason.wrong_number":"Сан қате","feedback.reason.wrong_indicator":"Көрсеткіш басқа","feedback.reason.wrong_territory":"Аумақ басқа","feedback.reason.wrong_period":"Кезең басқа","feedback.reason.not_answered":"Сұраққа жауап жоқ","feedback.reason.language":"Жауап тілі","feedback.reason.slow":"Тым ұзақ","feedback.reason.other":"Басқа","intro.title":"Бастамас бұрын","intro.continue":"Жалғастыру",source:"Дереккөз: {name}","shell.siteBlocked":"Бұл сайтта чат қолжетімсіз","shell.siteBlockedHint":"Сайт иесі AI-Dana-ны әлі қоспаған немесе қолжетімділік тоқтатылған.","modes.none":"Жауап режимдері қазір қолжетімсіз. Кейінірек қайталап көріңіз.","attachment.sending":"жіберілуде","agent.steps":"Қадамдар","agent.unfinished":"аяқталмады",rateGroup:"Жауапты бағалау","blocks.catalogTitle":"Каталог: {topic}","blocks.catalogSections":"Бөлімдер","blocks.catalogIndicators":"Көрсеткіштер","blocks.catalogSendHint":"Сұрақ таңдалған бойда жіберіледі","blocks.clarification":"Нақтылау","files.expired":"Файл мерзімі өтті","files.notFound":"Файл табылмады","files.unavailable":"Файл қолжетімсіз"},ru:Yk,en:{title:"AI-Dana",open:"Open chat",unreadAnswers:"new answers: {count}",ask:"Ask a question",close:"Close",history:"History",closeHistory:"Hide history",newChat:"New chat",untitled:"New chat",historyEmpty:"No chats yet",historyError:"Could not load the history",delete:"Delete",deleteConfirm:"Delete this chat?",deleteYes:"Delete",deleteNo:"Cancel",deleteError:"Could not delete the chat",modeLabel:"Answer mode","health.idle":"Available","health.busy":"Busy","health.unavailable":"Unavailable",placeholder:"Ask anything",inputLabel:"Message",send:"Send",stop:"Stop",attach:"Attach file",attachOne:"Only one file can be attached",attachHint:"You can attach one file: XLS, XLSX, CSV, TXT or MD, up to {size} MB",disclaimer:"AI can make mistakes — check important information",removeFile:"Remove file",counter:"{count} / {max}",counterLimit:"Character limit reached",counterOver:"Character limit exceeded",fileTooLarge:"File “{name}” is larger than {size} MB",fileType:"File “{name}” is not supported. You can attach XLS, XLSX, CSV, TXT or MD",modeUnavailable:"This mode is unavailable right now, choose another one",greeting:"How can I help?",loading:"Loading…",configError:"The chat is temporarily unavailable",overloaded:"The service is overloaded right now. Please try again later.",retry:"Retry",dismiss:"Dismiss",scrollDown:"Scroll to bottom",settings:"Settings","settings.language":"Language","settings.theme":"Theme","settings.themeLight":"Light","settings.themeDark":"Dark","settings.themeAuto":"System","settings.model":"Default model","settings.modelHint":"Every new chat starts with it","settings.shortcuts":"Keyboard shortcuts","shortcut.search":"Search chats","shortcut.newChat":"New chat","shortcut.sidebar":"Show or hide the sidebar","shortcut.close":"Close the window",search:"Search chats",searchEmpty:"Nothing found",collapseSidebar:"Hide sidebar",expandSidebar:"Show sidebar",expand:"Expand to the whole page",shrink:"Shrink",examples:"Example queries","examples.whatCanDo":"What you can do","group.pinned":"Pinned","group.today":"Today","group.yesterday":"Yesterday","group.week":"Previous 7 days","group.earlier":"Earlier","errors.thread_busy":"AI-Dana is still answering in this chat. Wait for the answer or stop it.","errors.mode_overloaded":"AI-Dana is overloaded right now, please try again a bit later","errors.daily_limit":"You have used up today's message limit","errors.rate_limit":"Too many messages in a row. Please wait a minute.","errors.ip_limit":"Too many messages from your network today. Please try again tomorrow.","errors.concurrency_limit":"Wait for the previous answer to finish","errors.file_too_large":"The file is too large","errors.file_not_allowed":"This file cannot be attached. XLS, XLSX, CSV, TXT and MD are allowed","errors.invalid_query":"The message is empty or too long","errors.invalid_parent":"This message can no longer be changed","errors.mode_not_found":"The selected mode is unavailable right now. Choose another mode.","errors.thread_not_found":"Chat not found","errors.interrupted":"The answer was interrupted","errors.code":"Could not get an answer (code {code}).","errors.generic":"Something went wrong while sending the message.","errors.network":"No connection to the server. Check your network.","errors.render":"This message could not be shown.","agent.thinking":"Thinking…","agent.done":"Done","agent.stopped":"Stopped","agent.stopping":"Stopping…","agent.failed":"couldn’t","agent.interrupted":"Answer interrupted","agent.answerStopped":"Answer stopped. Ask again if needed","agent.seconds":"{value} s","agent.attempt":"attempt {count}","agent.showSteps":"Show steps","agent.hideSteps":"Hide steps","steps.router":"Understanding the question","steps.context_builder":"Looking for the data","steps.sql_architect":"Preparing the calculation","steps.executor":"Calculating the figures","steps.responder":"Preparing the answer","steps.rag":"Looking in reference materials","steps.sql":"Looking for data in open sources","steps.document":"Reading the document","steps.understand":"Understanding the question","steps.search_law":"Searching the law","steps.run_sql":"Calculating the figures","steps.run_query":"Getting the data","steps.data":"Getting the data","steps.lookup_taxpayer":"Looking up the taxpayer","steps.find_taxpayer":"Finding the company by name","steps.ask_clarification":"Clarifying the question","steps.answer":"Preparing the answer","steps.unknown":"Working on the answer",copy:"Copy",copied:"Copied",download:"Download",regenerate:"Regenerate",edit:"Edit message",editLabel:"Message text",cancel:"Cancel",actionsLabel:"Message actions",rate:"Rate {count} out of 5",ratingError:"Could not save the rating",feedbackOpen:"Leave feedback",feedbackEdit:"Edit feedback",feedbackLabel:"Feedback on the answer",feedbackPlaceholder:"What was wrong with the answer?",save:"Save","branch.label":"Versions","branch.prev":"Previous version","branch.next":"Next version","branch.error":"Could not switch the version","limit.remaining":"{count} of {limit} messages left today","limit.exhausted":"You have used up today's message limit","limit.until":"Message limit reached. You can write again after {time}.","blocks.data":"Data","blocks.hideData":"Hide data","blocks.methodology":"Methodology","blocks.passport":"What was calculated","blocks.indicator":"Indicator","blocks.territory":"Territory","blocks.period":"Period","blocks.breakdown":"Breakdown","blocks.breakdown.sex":"by sex","blocks.breakdown.age":"by age","blocks.breakdown.urban_rural":"urban and rural","blocks.breakdown.activity":"by economic activity","blocks.breakdown.item":"by item","blocks.substituted":"substituted","blocks.alternatives":"Similar indicators","blocks.table":"Data table","blocks.tableSearch":"Search the table…","blocks.tableEmpty":"No data","blocks.page":"{a} of {b}","blocks.prevPage":"Previous page","blocks.nextPage":"Next page","blocks.truncated":"Showing the first {n} rows — full data in Excel","blocks.catalogMore":"…and {count} more in the catalog","blocks.catalogExamples":"You can ask","blocks.options":"Answer options","blocks.default":"default","blocks.freeTextHint":"Choose an option or type your own below","blocks.findOption":"Find in the list…","blocks.chosen":"Selected: {label}","blocks.continue":"Continue","blocks.cancelPlan":"Cancel","blocks.expired":"This clarification has expired","blocks.askAgain":"Ask the question again","blocks.dashboard":"Dashboard","blocks.hideDashboard":"Hide dashboard","chart.kinds":"Chart type","chart.kind.bar":"Bars","chart.kind.column":"Columns","chart.kind.pie":"Pie","chart.kind.line":"Lines","chart.kind.area":"Areas","chart.national":"KZ {value}","chart.top":"Top {n} of {total} — all in the dashboard","chart.label":"{title}, {period}","files.list":"Files","files.report":"Final report","files.document":"Editable document","files.presentation":"Presentation","files.excel":"Excel data","files.csv":"CSV data","files.failed":"Could not download the file","report.create":"Generate report","report.pending":"Report files are being prepared…","report.failed":"Could not generate the report files","report.retry":"Retry","report.expired":"The files have expired","dashboard.eyebrow":"Analytics","dashboard.label":"Dashboard","dashboard.sections":"Dashboard sections","dashboard.regions":"regions: {n}","dashboard.items":"items: {n}","dashboard.openSource":"Open in source","dashboard.methodology":"Methodology","dashboard.fullscreen":"Full screen","dashboard.collapse":"Collapse","dashboard.close":"Close","dashboard.chatTab":"Chat","dashboard.dashboardTab":"Dashboard","dashboard.view":"Chat or dashboard","dashboard.region":"Region","dashboard.allRegions":"All regions","dashboard.period":"Period","dashboard.mode.label":"Mode","dashboard.mode.value":"Value","dashboard.mode.deviation":"Deviation","dashboard.mode.change":"Change","dashboard.base.label":"Deviation base","dashboard.base.median":"from median","dashboard.base.national":"from KZ","dashboard.noPrevious":"No previous period","dashboard.noNational":"No national value for this period","dashboard.fewRegions":"At least two values are needed","dashboard.ranking":"Ranking","dashboard.trend":"Trend","dashboard.findings":"Findings","dashboard.data":"Data","dashboard.kpis":"Key figures","dashboard.table.rank":"#","dashboard.table.position":"Item","dashboard.table.value":"Value, {unit}","dashboard.table.share":"Share, %","dashboard.table.deviation":"Deviation, {unit}","dashboard.table.change":"Change, {unit}","dashboard.source":"Source: {name}","dashboard.points":"p.p.","dashboard.kpi.national":"Republic of Kazakhstan","dashboard.kpi.max":"Maximum","dashboard.kpi.min":"Minimum","dashboard.kpi.median":"Regional median","dashboard.kpi.spread":"Range","dashboard.kpi.gap":"Gap","dashboard.kpi.last":"Latest value","dashboard.kpi.first":"Start of period","dashboard.kpi.change":"Change","dashboard.kpi.place":"Rank","dashboard.kpi.placeOf":"{n} of {m}","dashboard.kpi.deviation":"Deviation from median","dashboard.kpi.previous":"vs previous period","steps.counter":"{done} of {total}","feedback.reasonsLabel":"What went wrong?","feedback.reason.wrong_number":"Wrong number","feedback.reason.wrong_indicator":"Wrong indicator","feedback.reason.wrong_territory":"Wrong territory","feedback.reason.wrong_period":"Wrong period","feedback.reason.not_answered":"Question not answered","feedback.reason.language":"Answer language","feedback.reason.slow":"Too slow","feedback.reason.other":"Other","intro.title":"Before you start","intro.continue":"Continue",source:"Source: {name}","shell.siteBlocked":"The chat is not available on this site","shell.siteBlockedHint":"The site owner has not connected AI-Dana yet or access is suspended.","modes.none":"Answer modes are unavailable right now. Please try again later.","attachment.sending":"sending","agent.steps":"Steps","agent.unfinished":"not finished",rateGroup:"Rate the answer","blocks.catalogTitle":"Catalog: {topic}","blocks.catalogSections":"Sections","blocks.catalogIndicators":"Indicators","blocks.catalogSendHint":"The question is sent as soon as you pick it","blocks.clarification":"Clarification","files.expired":"The file has expired","files.notFound":"File not found","files.unavailable":"File unavailable"}},Vn=(e,t,r)=>{const n=x4[e][t];return r?n.replace(/\{(\w+)\}/g,(i,a)=>String(r[a]??i)):n},b4=e=>e in Yk,bu=(e,t)=>{if(!e)return"";for(const r of[e[t],e.ru,...Object.values(e)])if(r)return r;return""},Xk="aid_prefs",w4=["light","dark","auto"],qk=e=>{try{const t=JSON.parse(e?.getItem(Xk)??"{}"),r={};return Xg.includes(t.lang)&&(r.lang=t.lang),w4.includes(t.scheme)&&(r.scheme=t.scheme),r}catch{return{}}},_4=(e,t)=>{try{e?.setItem(Xk,JSON.stringify(t))}catch{}},Kk=({scheme:e})=>e?{scheme:e}:{},k4=(e,t,r)=>t?!r||e.expanded?e:{expanded:!0,byDashboard:!0}:e.byDashboard?{expanded:!1,byDashboard:!1}:e,qg=H.createContext(null),Kg=()=>{const e=H.useContext(qg);if(!e)throw new Error("usePrefs outside PrefsContext");return e},S4=e=>{let t=e;const r=new Set;return{get:()=>t,set:n=>{t={...t,...n};for(const i of r)i()},subscribe:n=>(r.add(n),()=>r.delete(n))}};class Zg extends H.Component{constructor(){super(...arguments);Rs(this,"state",{failed:!1})}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}}const C4='*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--aid-c-border)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--aid-c-font);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\\!container{width:100%!important;margin-right:auto!important;margin-left:auto!important;padding-right:32px!important;padding-left:32px!important}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:32px;padding-left:32px}@media(min-width:1400px){.\\!container{max-width:1400px!important}.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-\\[3px\\]{inset:3px}.inset-y-0{top:0;bottom:0}.bottom-3{bottom:12px}.bottom-\\[3\\.2rem\\]{bottom:51.2px}.bottom-\\[calc\\(100\\%\\+6px\\)\\]{bottom:calc(100% + 6px)}.left-0{left:0}.left-1\\/2{left:50%}.left-4{left:16px}.left-\\[11px\\]{left:11px}.right-1{right:4px}.right-2{right:8px}.top-0{top:0}.top-1\\/2{top:50%}.top-\\[calc\\(100\\%\\+6px\\)\\]{top:calc(100% + 6px)}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.m-0{margin:0}.mx-1\\.5{margin-left:6px;margin-right:6px}.mx-auto{margin-left:auto;margin-right:auto}.my-0\\.5{margin-top:2px;margin-bottom:2px}.my-4{margin-top:16px;margin-bottom:16px}.-ml-2{margin-left:-8px}.mb-2{margin-bottom:8px}.ml-0\\.5{margin-left:2px}.ml-1\\.5{margin-left:6px}.mr-1{margin-right:4px}.mr-auto{margin-right:auto}.mt-0\\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mt-\\[18px\\]{margin-top:18px}.mt-px{margin-top:1px}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.\\!block{display:block!important}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.size-10{width:40px;height:40px}.size-2{width:8px;height:8px}.size-3{width:12px;height:12px}.size-3\\.5{width:14px;height:14px}.size-4{width:16px;height:16px}.size-6{width:24px;height:24px}.size-7{width:28px;height:28px}.size-8{width:32px;height:32px}.size-9{width:36px;height:36px}.size-\\[26px\\]{width:26px;height:26px}.size-\\[30px\\]{width:30px;height:30px}.size-\\[34px\\]{width:34px;height:34px}.size-\\[52px\\]{width:52px;height:52px}.h-10{height:40px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\\[11px\\]{height:11px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-\\[22px\\]{height:22px}.h-\\[30px\\]{height:30px}.h-\\[38px\\]{height:38px}.h-full{height:100%}.h-side-head{height:var(--aid-c-side-head-height)}.h-toolbar{height:var(--aid-c-toolbar-height)}.max-h-56{max-height:224px}.max-h-\\[28rem\\]{max-height:448px}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-10{min-height:40px}.min-h-11{min-height:44px}.min-h-6{min-height:24px}.min-h-7{min-height:28px}.min-h-8{min-height:32px}.min-h-9{min-height:36px}.min-h-\\[30px\\]{min-height:30px}.min-h-\\[34px\\]{min-height:34px}.min-h-\\[76px\\]{min-height:76px}.w-1\\/2{width:50%}.w-10{width:40px}.w-8{width:32px}.w-\\[18px\\]{width:18px}.w-\\[340px\\]{width:340px}.w-\\[62\\%\\]{width:62%}.w-\\[7px\\]{width:7px}.w-\\[max-content\\]{width:-moz-max-content;width:max-content}.w-\\[min\\(400px\\,100\\%\\)\\]{width:min(400px,100%)}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.w-side{width:var(--aid-c-side-width)}.w-side-over{width:var(--aid-c-side-over-width)}.min-w-0{min-width:0px}.min-w-16{min-width:64px}.min-w-24{min-width:96px}.min-w-32{min-width:128px}.min-w-4{min-width:16px}.min-w-40{min-width:160px}.min-w-5{min-width:20px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[22px\\]{min-width:22px}.min-w-\\[30px\\]{min-width:30px}.min-w-\\[480px\\]{min-width:480px}.min-w-full{min-width:100%}.max-w-60{max-width:240px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[340px\\]{max-width:340px}.max-w-\\[420px\\]{max-width:420px}.max-w-\\[440px\\]{max-width:440px}.max-w-\\[520px\\]{max-width:520px}.max-w-\\[640px\\]{max-width:640px}.max-w-\\[78\\%\\]{max-width:78%}.max-w-\\[820px\\]{max-width:820px}.max-w-\\[844px\\]{max-width:844px}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 32px)}.max-w-\\[min\\(360px\\,100\\%\\)\\]{max-width:min(360px,100%)}.max-w-\\[min\\(360px\\,80vw\\)\\]{max-width:min(360px,80vw)}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-2{--tw-translate-y: 8px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[3px\\]{--tw-translate-y: 3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(9\\.5rem\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(152px,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\\.5{gap:2px}.gap-1{gap:4px}.gap-1\\.5{gap:6px}.gap-2{gap:8px}.gap-2\\.5{gap:10px}.gap-3{gap:12px}.gap-3\\.5{gap:14px}.gap-4{gap:16px}.gap-5{gap:20px}.gap-\\[22px\\]{gap:22px}.gap-\\[3px\\]{gap:3px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}.gap-x-3\\.5{-moz-column-gap:14px;column-gap:14px}.gap-y-1{row-gap:4px}.self-start{align-self:flex-start}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.overscroll-x-contain{overscroll-behavior-x:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:var(--aid-c-radius)}.rounded-2xl{border-radius:16px}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[22\\.5\\%\\]{border-radius:22.5%}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[5px\\]{border-radius:5px}.rounded-\\[7px\\]{border-radius:7px}.rounded-\\[calc\\(var\\(--aid-c-radius\\)\\+6px\\)\\]{border-radius:calc(var(--aid-c-radius) + 6px)}.rounded-aid-field{border-radius:var(--aid-c-radius-field)}.rounded-aid-window{border-radius:var(--aid-c-radius-window)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--aid-c-radius)}.rounded-md{border-radius:calc(var(--aid-c-radius) - 2px)}.rounded-sm{border-radius:calc(var(--aid-c-radius) - 4px)}.rounded-xl{border-radius:12px}.rounded-br-\\[6px\\]{border-bottom-right-radius:6px}.border{border-width:1px}.border-0{border-width:0px}.border-\\[1\\.5px\\]{border-width:1.5px}.border-\\[3px\\]{border-width:3px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-\\[3px\\]{border-left-width:3px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-border{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-border) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-current{border-color:currentColor}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\\/30{border-color:hsl(var(--destructive) / .3)}.border-error\\/30{border-color:hsl(var(--error),.3)}.border-error\\/35{border-color:hsl(var(--error),.35)}.border-input{border-color:hsl(var(--input))}.border-muted-foreground{border-color:hsl(var(--muted-foreground))}.border-primary{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-primary-30{border-color:color-mix(in srgb,var(--aid-c-primary) 30%,transparent)}.border-primary-35{border-color:color-mix(in srgb,var(--aid-c-primary) 35%,transparent)}.border-primary-50{border-color:color-mix(in srgb,var(--aid-c-primary) 50%,transparent)}.border-primary-pressed{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.border-processing\\/25{border-color:hsl(var(--processing),.25)}.border-warning\\/40{border-color:hsl(var(--warning),.4)}.border-r-transparent{border-right-color:transparent}.bg-\\[\\#F3F5FA\\]{--tw-bg-opacity: 1;background-color:rgb(243 245 250 / var(--tw-bg-opacity, 1))}.bg-\\[hsl\\(var\\(--chart-card\\)\\)\\]{background-color:hsl(var(--chart-card))}.bg-accent{background-color:hsl(var(--accent))}.bg-background{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-border{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-border) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-card{background-color:hsl(var(--card))}.bg-current{background-color:currentColor}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive-background{background-color:hsla(var(--destructive-background))}.bg-destructive-pressed{background-color:hsl(var(--destructive-pressed))}.bg-error-background{background-color:hsla(var(--error-background))}.bg-file-csv{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-csv)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-doc{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-doc)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-other{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-other)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-pdf{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-pdf)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-ppt{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-ppt)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-file-xls{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--file-xls)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-foreground{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-hl{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--hl)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-busy{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-busy)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-down{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-down)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-mode-idle{--tw-bg-opacity: 1;background-color:color-mix(in srgb,hsl(var(--mode-idle)) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-muted{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-muted-foreground\\/40{background-color:hsl(var(--muted-foreground) / .4)}.bg-muted\\/60{background-color:color-mix(in srgb,var(--aid-c-muted) 60%,transparent)}.bg-primary{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-primary-pressed{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-processing-background{background-color:hsla(var(--processing-background))}.bg-scrim{background-color:var(--scrim)}.bg-secondary{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-secondary) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.bg-transparent{background-color:transparent}.bg-warning-background{background-color:hsla(var(--warning-background))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-1\\.5{padding:6px}.p-2{padding:8px}.p-2\\.5{padding:10px}.p-3{padding:12px}.p-3\\.5{padding:14px}.p-4{padding:16px}.p-6{padding:24px}.p-8{padding:32px}.px-0{padding-left:0;padding-right:0}.px-0\\.5{padding-left:2px;padding-right:2px}.px-1{padding-left:4px;padding-right:4px}.px-1\\.5{padding-left:6px;padding-right:6px}.px-2{padding-left:8px;padding-right:8px}.px-2\\.5{padding-left:10px;padding-right:10px}.px-3{padding-left:12px;padding-right:12px}.px-3\\.5{padding-left:14px;padding-right:14px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-\\[18px\\]{padding-left:18px;padding-right:18px}.px-\\[5px\\]{padding-left:5px;padding-right:5px}.px-px{padding-left:1px;padding-right:1px}.py-0{padding-top:0;padding-bottom:0}.py-0\\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.py-1\\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-2\\.5{padding-top:10px;padding-bottom:10px}.py-3{padding-top:12px;padding-bottom:12px}.py-3\\.5{padding-top:14px;padding-bottom:14px}.py-6{padding-top:24px;padding-bottom:24px}.py-\\[7px\\]{padding-top:7px;padding-bottom:7px}.py-\\[9px\\]{padding-top:9px;padding-bottom:9px}.py-px{padding-top:1px;padding-bottom:1px}.pb-1{padding-bottom:4px}.pb-1\\.5{padding-bottom:6px}.pb-2{padding-bottom:8px}.pb-2\\.5{padding-bottom:10px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.pb-\\[18px\\]{padding-bottom:18px}.pl-0\\.5{padding-left:2px}.pl-2{padding-left:8px}.pl-2\\.5{padding-left:10px}.pl-3{padding-left:12px}.pl-3\\.5{padding-left:14px}.pl-4{padding-left:16px}.pl-5{padding-left:20px}.pl-\\[18px\\]{padding-left:18px}.pl-\\[22px\\]{padding-left:22px}.pl-\\[34px\\]{padding-left:34px}.pr-1\\.5{padding-right:6px}.pr-2{padding-right:8px}.pr-2\\.5{padding-right:10px}.pr-3{padding-right:12px}.pr-3\\.5{padding-right:14px}.pr-4{padding-right:16px}.pr-7{padding-right:28px}.pr-9{padding-right:36px}.pt-0\\.5{padding-top:2px}.pt-1{padding-top:4px}.pt-1\\.5{padding-top:6px}.pt-14{padding-top:56px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-3\\.5{padding-top:14px}.pt-7{padding-top:28px}.pt-\\[18px\\]{padding-top:18px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--aid-c-font)}.text-2xl{font-size:20px}.text-2xs{font-size:12px}.text-3xl{font-size:24px}.text-\\[11px\\]{font-size:11px}.text-\\[13\\.5px\\]{font-size:13.5px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[17px\\]{font-size:17px}.text-\\[9\\.5px\\]{font-size:9.5px}.text-base{font-size:15px}.text-lg{font-size:16px}.text-sm{font-size:14px}.text-xl{font-size:18px}.text-xs{font-size:13px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-6{line-height:24px}.leading-\\[1\\.35\\]{line-height:1.35}.leading-\\[1\\.3\\]{line-height:1.3}.leading-\\[1\\.55\\]{line-height:1.55}.leading-\\[1\\.65\\]{line-height:1.65}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\\[0\\.02em\\]{letter-spacing:.02em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.text-\\[hsl\\(var\\(--foreground\\)\\)\\]{color:hsl(var(--foreground))}.text-background{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-inherit{color:inherit}.text-mode-busy{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-busy)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-mode-down{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-down)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-mode-idle{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--mode-idle)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\\/70{color:hsl(var(--muted-foreground) / .7)}.text-primary{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-primary-foreground{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-warn-text{--tw-text-opacity: 1;color:color-mix(in srgb,hsl(var(--warn-text)) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.text-warning{--tw-text-opacity: 1;color:hsl(var(--warning),var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_0_0_3px_var\\(--aid-c-secondary\\)\\]{--tw-shadow: 0 0 0 3px var(--aid-c-secondary);--tw-shadow-colored: 0 0 0 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_var\\(--aid-c-border\\)\\]{--tw-shadow: inset 0 0 0 1px var(--aid-c-border);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-panel{--tw-shadow: var(--aid-c-shadow-panel);--tw-shadow-colored: var(--aid-c-shadow-panel);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-pop{--tw-shadow: var(--shadow-pop);--tw-shadow-colored: var(--shadow-pop);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-side{--tw-shadow: var(--aid-c-shadow-side);--tw-shadow-colored: var(--aid-c-shadow-side);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-window{--tw-shadow: var(--aid-c-shadow-window);--tw-shadow-colored: var(--aid-c-shadow-window);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-\\[3px\\]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-border{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-border) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.ring-secondary{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.ring-offset-background{--tw-ring-offset-color: color-mix(in srgb, var(--aid-c-background) 100% , transparent)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in{--tw-enter-opacity: 0}.slide-in-from-left-2{--tw-enter-translate-x: -8px}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.running{animation-play-state:running}.paused{animation-play-state:paused}:host{display:block}:host([hidden]){display:none!important}.aid-root{all:initial;display:block;width:100%;height:100%;box-sizing:border-box;--aid-d-primary-hovered: color-mix(in oklch, var(--aid-primary) 84%, white);--aid-d-primary-pressed: color-mix(in oklch, var(--aid-primary) 80%, black);--aid-d-primary-foreground: oklch(from var(--aid-primary) clamp(0, (.62 - l) * 1000, 1) 0 0);--aid-d-secondary: color-mix(in srgb, var(--aid-primary) 10%, transparent);--aid-d-ring: color-mix(in srgb, var(--aid-primary) 50%, transparent);--aid-c-primary: var(--aid-primary, hsl(var(--primary)));--aid-c-primary-hovered: var(--aid-primary-hovered, var(--aid-d-primary-hovered, hsl(var(--primary-hovered))));--aid-c-primary-pressed: var(--aid-primary-pressed, var(--aid-d-primary-pressed, hsl(var(--primary-pressed))));--aid-c-primary-foreground: var( --aid-primary-foreground, var(--aid-d-primary-foreground, hsl(var(--primary-foreground))) );--aid-c-secondary: var(--aid-secondary, var(--aid-d-secondary, hsl(var(--secondary))));--aid-c-ring: var(--aid-ring, var(--aid-d-ring, hsl(var(--ring))));--aid-c-background: var(--aid-background, hsl(var(--background)));--aid-c-foreground: var(--aid-foreground, hsl(var(--foreground)));--aid-c-muted: var(--aid-muted, hsl(var(--muted)));--aid-c-border: var(--aid-border, hsl(var(--border)));--aid-c-radius: var(--aid-radius, var(--radius));--aid-c-font: var( --aid-font, var( --aid-theme-font, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif ) );--aid-c-z: var(--aid-z-index, 2147483000);font-family:var(--aid-c-font);font-size:15px;line-height:1.5;color:var(--aid-c-foreground);-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-align:left}.aid-root{--warning: 21, 90%, 48%;--warning-background: 27, 96%, 61%, .2;--ring: 201 100% 35%;--chart-1: 201 100% 35%;--chart-2: 174 72% 30%;--chart-3: 27 95% 46%;--chart-4: 330 70% 42%;--chart-5: 252 45% 52%;--chart-ref: 222 47% 11%;--chart-neg: 359 72% 48%;--chart-dim: 201 45% 80%;--chart-grid: 214 32% 88%;--mode-idle: 142 72% 29%;--mode-busy: 32 95% 36%;--mode-down: 359 78% 44%;--file-pdf: 0 72% 45%;--file-doc: 214 80% 44%;--file-ppt: 18 88% 44%;--file-xls: 145 63% 30%;--file-csv: 174 70% 28%;--file-other: 215 16% 42%;--warn-text: 24 90% 30%;--hl: 45 100% 55% / .45;--scrim: rgb(2 6 23 / .48);--persona-ring: 214 32% 88%;--shadow-pop: 0 10px 28px -10px rgb(15 23 42 / .28);--aid-c-radius-window: calc(var(--aid-c-radius) + 6px);--aid-c-radius-field: calc(var(--aid-c-radius) + 4px);--aid-c-radius-bubble-corner: 6px;--aid-c-side-width: 248px;--aid-c-side-over-width: 290px;--aid-c-toolbar-height: 52px;--aid-c-side-head-height: 56px;--aid-c-shadow-launcher: 0 10px 30px -8px rgb(2 6 23 / .45), 0 2px 6px rgb(2 6 23 / .2);--aid-c-shadow-launcher-drag: 0 22px 44px -10px rgb(2 6 23 / .55);--aid-c-shadow-window: 0 30px 70px -20px rgb(2 6 23 / .55);--aid-c-shadow-panel: 0 20px 50px -16px rgb(2 6 23 / .5);--aid-c-shadow-side: 12px 0 30px -12px rgb(2 6 23 / .45)}.aid-root.dark{--ring: 201 90% 60%;--chart-1: 201 90% 60%;--chart-2: 170 60% 52%;--chart-3: 30 95% 62%;--chart-4: 330 75% 70%;--chart-5: 252 75% 76%;--chart-ref: 210 40% 98%;--chart-neg: 359 92% 70%;--chart-dim: 201 30% 32%;--chart-grid: 217 33% 25%;--mode-idle: 142 60% 55%;--mode-busy: 35 95% 62%;--mode-down: 359 95% 72%;--file-pdf: 0 80% 62%;--file-doc: 214 85% 62%;--file-ppt: 20 92% 60%;--file-xls: 145 55% 48%;--file-csv: 172 55% 46%;--file-other: 215 20% 60%;--warn-text: 32 95% 66%;--hl: 45 100% 55% / .35;--scrim: rgb(0 0 0 / .6);--persona-ring: 217 33% 30%;--shadow-pop: 0 12px 32px -10px rgb(0 0 0 / .6)}:where(.aid-root svg.lucide){width:16px;height:16px;flex-shrink:0}:where(.aid-root *),:where(.aid-root *):before,:where(.aid-root *):after{border-color:var(--aid-c-border)}.aid-root[data-mode=launcher]{width:0;height:0}.aid-root{--aid-c-launcher-size: 60px}@media(max-width:639px){.aid-root{--aid-c-launcher-size: 56px}}.aid-launcher{position:fixed;z-index:var(--aid-c-z);display:inline-flex;align-items:center;justify-content:center;gap:10px;box-sizing:border-box;min-width:var(--aid-c-launcher-size);height:var(--aid-c-launcher-size);padding:0;border:0;border-radius:9999px;background:var(--aid-c-primary);color:var(--aid-c-primary-foreground);box-shadow:var(--aid-c-shadow-launcher);font:600 15px/1 var(--aid-c-font);cursor:pointer;outline:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease-out,transform .12s ease-out,box-shadow .12s ease-out}.aid-launcher[data-variant=label]{max-width:300px;padding:0 20px 0 8px}.aid-launcher[data-shape=rounded]{border-radius:16px}.aid-launcher[data-shape=square]{border-radius:4px}@media(hover:hover){.aid-launcher:hover{background:var(--aid-c-primary-hovered);transform:translateY(-2px)}}.aid-launcher:active{transform:scale(.96)}.aid-launcher:focus-visible{outline:3px solid var(--aid-c-ring);outline-offset:3px}.aid-launcher[data-dragging=true]{transform:scale(1.06);box-shadow:var(--aid-c-shadow-launcher-drag)}@media(prefers-reduced-motion:reduce){.aid-launcher,.aid-launcher:hover,.aid-launcher:active,.aid-launcher[data-dragging=true]{transition:none;transform:none}}.aid-launcher[data-dragging=true],.aid-window-header[data-dragging=true]{cursor:grabbing}.aid-launcher-origin{position:fixed;z-index:calc(var(--aid-c-z) - 1);box-sizing:border-box;border:1.5px dashed hsl(var(--muted-foreground) / .55);border-radius:9999px;pointer-events:none}.aid-launcher-origin[data-shape=rounded]{border-radius:16px}.aid-launcher-origin[data-shape=square]{border-radius:4px}.aid-root{--aid-c-window-gap: 24px;--aid-c-overlay: var(--aid-overlay, rgb(2 6 23 / .35))}.aid-window{position:fixed;z-index:var(--aid-c-z);display:flex;flex-direction:column;overflow:hidden;transition:opacity .2s ease-out,transform .26s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.dana-av{position:relative;display:inline-block;flex-shrink:0;overflow:hidden}.dana-av>*{position:absolute;inset:0;width:100%;height:100%;display:block}.dana-av-body{transform-origin:50% 100%}.dana-av-dot{transform-box:fill-box;transform-origin:50% 50%}.dana-av[data-animated][data-mood=calm] .dana-av-body,.dana-av[data-animated][data-mood=listen] .dana-av-body{animation:dana-breathe 3.6s ease-in-out infinite alternate}.dana-av[data-animated][data-mood=typing] .dana-av-body{animation:dana-bob .34s ease-in-out infinite}.dana-av[data-animated][data-mood=think] .dana-av-body{animation:dana-sway 3.4s ease-in-out infinite alternate}.dana-av[data-animated][data-mood=eureka] .dana-av-body{animation:dana-lift 1.3s cubic-bezier(.3,0,.4,1) infinite}.dana-av[data-animated][data-mood=sorry] .dana-av-body{animation:dana-slump 2.8s ease-in-out infinite}.dana-av[data-animated] .dana-av-bubble,.dana-av[data-animated] .dana-av-dots{animation:dana-float 2.2s ease-in-out infinite alternate}.dana-av[data-animated] .dana-av-dot{animation:dana-dot 1.1s ease-in-out infinite}.dana-av[data-animated] .dana-av-dot:nth-child(3n+2){animation-delay:.18s}.dana-av[data-animated] .dana-av-dot:nth-child(3n){animation-delay:.36s}.dana-av[data-animated] .dana-av-spark{transform-origin:13% 30%;animation:dana-twinkle 1.3s ease-in-out infinite}.dana-av[data-animated] .dana-av-drop{animation:dana-drip 1.8s ease-in infinite}@keyframes dana-breathe{to{transform:translateY(-.5%) scale(1.004,1.01)}}@keyframes dana-bob{50%{transform:translateY(.5%)}}@keyframes dana-sway{0%{transform:rotate(-1.2deg)}to{transform:rotate(1.2deg)}}@keyframes dana-lift{15%{transform:scale(1.02,.98)}42%{transform:translateY(-2.5%) scale(.99,1.015)}65%{transform:scale(1.01,.99)}80%{transform:none}}@keyframes dana-slump{8%{transform:translate(-.7%) rotate(-.6deg)}16%{transform:translate(.7%) rotate(.6deg)}24%{transform:none}60%{transform:translateY(1%) rotate(-.8deg)}}@keyframes dana-float{to{transform:translateY(-1.5%)}}@keyframes dana-dot{0%,60%,to{transform:translateY(0);opacity:.45}30%{transform:translateY(-40%);opacity:1}}@keyframes dana-twinkle{0%,to{transform:scale(.75);opacity:.6}45%{transform:scale(1.08) rotate(12deg);opacity:1}}@keyframes dana-drip{0%{transform:translateY(-1.5%);opacity:0}15%{opacity:1}70%{transform:translateY(3.5%);opacity:1}to{transform:translateY(5.5%);opacity:0}}@media(prefers-reduced-motion:reduce){.dana-av *{animation:none!important}}.aid-overlay{position:fixed;inset:0;z-index:var(--aid-c-z);background:var(--aid-c-overlay);transition:opacity .2s ease-out,visibility 0s linear 0s}.aid-overlay[data-state=closed]{opacity:0;visibility:hidden;transition:opacity .2s ease-in,visibility 0s linear .2s}.aid-root[data-mode=launcher] .aid-window{top:var(--aid-c-window-gap);right:var(--aid-c-window-gap);bottom:var(--aid-c-window-gap);width:min(calc(100vw - 2 * var(--aid-c-window-gap)),max(720px,var(--aid-window-width, 60vw)));transition:opacity .2s ease-out,transform .26s cubic-bezier(.32,.72,0,1),width .26s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.aid-root[data-mode=launcher] .aid-window[data-expanded=true]{width:calc(100vw - 2 * var(--aid-c-window-gap))}.aid-root .aid-window[data-state=closed]{opacity:0;transform:translateY(8px);visibility:hidden;pointer-events:none;transition:opacity .16s ease-in,transform .2s ease-in,visibility 0s linear .2s}.aid-root[data-mode=launcher] .aid-window[data-fullscreen=true]{inset:0;width:100%;border-width:0;border-radius:0;box-shadow:none}.aid-root[data-mode=window] .aid-window{position:relative;width:100%;height:100%;box-shadow:none}@media(prefers-reduced-motion:reduce){.aid-root .aid-window,.aid-root .aid-window[data-state=closed],.aid-overlay,.aid-overlay[data-state=closed]{transition:none}}.aid-launcher-badge{position:absolute;top:-4px;right:-4px;box-sizing:content-box;display:flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border:2px solid var(--aid-c-background);border-radius:9999px;background:hsl(var(--destructive));color:hsl(var(--destructive-foreground));font:700 11px/1 var(--aid-c-font)}.placeholder\\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.first\\:mt-0:first-child{margin-top:0}.last\\:border-b-0:last-child{border-bottom-width:0px}.empty\\:hidden:empty{display:none}.focus-within\\:border-destructive:focus-within{border-color:hsl(var(--destructive))}.focus-within\\:border-primary:focus-within{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus-within\\:ring-\\[3px\\]:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\\:ring-secondary:focus-within{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.hover\\:border-primary:hover{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.hover\\:border-primary\\/50:hover{border-color:color-mix(in srgb,var(--aid-c-primary) 50%,transparent)}.hover\\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\\:bg-background:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-background) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-background\\/60:hover{background-color:color-mix(in srgb,var(--aid-c-background) 60%,transparent)}.hover\\:bg-destructive-hovered:hover{background-color:hsl(var(--destructive-hovered))}.hover\\:bg-muted:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-primary-hovered:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-hovered) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.hover\\:bg-secondary-hovered:hover{--tw-bg-opacity: 1;background-color:hsl(var(--secondary-hovered),var(--tw-bg-opacity, 1))}.hover\\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\\:text-foreground:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary-foreground:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary-hovered:hover{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-hovered) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.hover\\:text-primary\\/80:hover{color:color-mix(in srgb,var(--aid-c-primary) 80%,transparent)}.hover\\:underline:hover{text-decoration-line:underline}.focus\\:border-primary:focus{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus\\:ring-\\[3px\\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-secondary:focus{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:border-primary:focus-visible{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.focus-visible\\:bg-accent:focus-visible{background-color:hsl(var(--accent))}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset: inset}.focus-visible\\:ring-destructive:focus-visible{--tw-ring-color: hsl(var(--destructive))}.focus-visible\\:ring-primary:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-primary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-ring) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-secondary:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: color-mix(in srgb, var(--aid-c-secondary) calc(var(--tw-ring-opacity, 1) * 100%), transparent)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\\:border-primary-pressed:active{--tw-border-opacity: 1;border-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-border-opacity, 1) * 100%),transparent)}.active\\:bg-destructive-pressed:active{background-color:hsl(var(--destructive-pressed))}.active\\:bg-primary-pressed:active{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.active\\:bg-secondary-pressed:active{--tw-bg-opacity: 1;background-color:hsl(var(--secondary-pressed),var(--tw-bg-opacity, 1))}.active\\:text-primary-foreground:active{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-foreground) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.active\\:text-primary-pressed:active{--tw-text-opacity: 1;color:color-mix(in srgb,var(--aid-c-primary-pressed) calc(var(--tw-text-opacity, 1) * 100%),transparent)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-disabled:disabled{background-color:hsl(var(--disabled))}.disabled\\:bg-muted:disabled{--tw-bg-opacity: 1;background-color:color-mix(in srgb,var(--aid-c-muted) calc(var(--tw-bg-opacity, 1) * 100%),transparent)}.disabled\\:bg-transparent:disabled{background-color:transparent}.disabled\\:text-disabled-foreground:disabled{color:hsl(var(--disabled-foreground))}.disabled\\:text-muted-foreground:disabled{color:hsl(var(--muted-foreground))}.disabled\\:opacity-100:disabled{opacity:1}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:opacity-60:disabled{opacity:.6}.group\\/attach:focus-within .group-focus-within\\/attach\\:block{display:block}.group:focus-within .group-focus-within\\:opacity-100{opacity:1}.group\\/attach:hover .group-hover\\/attach\\:block{display:block}.group:hover .group-hover\\:opacity-100{opacity:1}.aria-disabled\\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}@media(prefers-reduced-motion:reduce){.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:transition-none{transition-property:none}}.\\[\\&\\:\\:-webkit-search-cancel-button\\]\\:hidden::-webkit-search-cancel-button{display:none}.\\[\\&_a\\]\\:no-underline a{text-decoration-line:none}.\\[\\&_li\\+li\\]\\:mt-1 li+li{margin-top:4px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_ul\\]\\:mt-1 ul{margin-top:4px}@media(hover:none){.\\[\\@media\\(hover\\:none\\)\\]\\:opacity-100{opacity:1}}',Zk=3e3,Qg=6*6e4,Qk={phase:"idle"},Jk={phase:"pending"},wu={phase:"failed"},eS={phase:"expired"},T4=new Set(["pdf","docx","pptx","xlsx","csv"]),Jg=e=>{switch(e.status){case"queued":case"running":return Jk;case"done":{const t=e.files.filter(r=>T4.has(r.format));return t.length>0?{phase:"done",files:t}:wu}case"expired":return eS;default:return wu}},qr=new Map,ed=new Set,A4=new Set(["done","failed","expired"]),td=new Set;let co=0;const ca=(e,t)=>{const r=qr.get(e)??{view:Qk};qr.set(e,{...r,...t});for(const n of td)n()},E4=e=>{const t=qr.get(e);if(t?.jobId===void 0||t.deadline===void 0||t.api===void 0)return;if(clearTimeout(t.timer),Date.now()+Zk>t.deadline){ca(e,{view:wu,timer:void 0});return}const{jobId:r,api:n}=t,i=co,a=setTimeout(()=>{n.reportStatus(r).then(o=>{i===co&&qr.get(e)?.jobId===r&&em(e,o)},()=>{i===co&&qr.get(e)?.jobId===r&&ca(e,{view:wu,timer:void 0})})},Zk);ca(e,{timer:a})},em=(e,t)=>{const r=Jg(t),n=qr.get(e)?.jobId;n!==void 0&&n!==t.job_id&&ed.add(n);const i=qr.get(e)?.deadline??Date.now()+Qg;ca(e,{view:r,jobId:t.job_id,deadline:i,timer:void 0}),r.phase==="pending"&&E4(e)},_u={subscribe:e=>(td.add(e),()=>{td.delete(e)}),view:e=>qr.get(e)?.view,adopt:(e,t,r)=>{if(ed.has(t.job_id))return;const n=qr.get(e);if(n!==void 0&&(n.jobId!==void 0||n.view.phase!=="idle")){if(n.view.phase==="pending")return;const i=t.job_id===n.jobId;if(i&&(!A4.has(t.status)||Jg(t).phase===n.view.phase)||i&&n.view.phase==="expired")return}clearTimeout(n?.timer),ca(e,{deadline:Date.now()+Qg,timer:void 0,api:r}),em(e,t)},start:(e,t,r)=>{const n=qr.get(e);if(n?.view.phase==="pending")return;clearTimeout(n?.timer),n?.jobId!==void 0&&ed.add(n.jobId),ca(e,{view:Jk,jobId:void 0,deadline:Date.now()+Qg,timer:void 0,api:t});const i=co;t.createReport(e,r).then(a=>{i===co&&em(e,a)},()=>{i===co&&ca(e,{view:wu})})},expire:e=>{qr.get(e)?.view.phase==="done"&&ca(e,{view:eS})}},D4=()=>{co+=1;for(const e of qr.values())clearTimeout(e.timer);qr.clear(),ed.clear();for(const e of td)e()},M4={calm:"idle",listen:"idle",think:"thinking",typing:"typing",eureka:"success",sorry:"fail"},L4={think:"bubble",eureka:"spark",sorry:"drop"},I4=(e,t)=>e==="error"?"sorry":e==="streaming"?t?"typing":"think":"calm",tS=e=>`${e.replace(/\/+$/,"")}/static/avatars/dana`,P4={animated:!0,assetsBase:tS("")},tm=H.createContext(P4),N4=()=>H.useContext(tm),rd=({mood:e="calm",size:t=40,animated:r=!0,label:n,className:i,bare:a})=>{const{animated:o,assetsBase:s}=N4(),l=L4[e],u=f=>`${s}/${f}.webp`;return k.jsxs("span",{className:`dana-av ${a?"":"rounded-[22.5%] bg-[#F3F5FA] ring-1 ring-border"} ${i??""}`.trim(),style:{width:t,height:t},"data-mood":e,"data-animated":r&&o?"":void 0,role:n?"img":void 0,"aria-label":n,"aria-hidden":n?void 0:!0,children:[k.jsx("img",{className:"dana-av-body",src:u(M4[e]),alt:"",decoding:"async",draggable:!1}),l&&k.jsx("img",{className:`dana-av-${l}`,src:u(l),alt:"",decoding:"async",draggable:!1}),e==="typing"&&k.jsxs("svg",{className:"dana-av-dots",viewBox:"0 0 240 240","aria-hidden":"true",focusable:"false",children:[k.jsx("rect",{x:"189",y:"32",width:"38.4",height:"18.6",rx:"9.3",fill:"#fff",stroke:"#1F3F75",strokeWidth:"1.3"}),[199.9,208.3,216.6].map(f=>k.jsx("circle",{className:"dana-av-dot",cx:f,cy:"41.3",r:"2.6",fill:"#1F3F75"},f))]}),e==="think"&&k.jsx("svg",{className:"dana-av-dots",viewBox:"0 0 240 240","aria-hidden":"true",focusable:"false",children:[26.1,34.4,43.4].map(f=>k.jsx("circle",{className:"dana-av-dot",cx:f,cy:"31.7",r:"1.8",fill:"#1C2B4A"},f))})]})},R4=2500,O4=(e,t)=>{const[r,n]=H.useState(!1),[i,a]=H.useState(e);return i!==e&&(a(e),i&&!e&&t==="done"&&n(!0)),H.useEffect(()=>{if(!r)return;const o=window.setTimeout(()=>{n(!1)},R4);return()=>{window.clearTimeout(o)}},[r]),r},z4=12e3,F4=5e3,rS="aid_mode",nS=H.createContext(null),ye=()=>{const e=H.useContext(nS);if(!e)throw new Error("useChat outside ChatProvider");return e},rm=(e,t)=>t.kind==="code"?Vn(e,`errors.${t.code}`):t.kind==="status"?t.status===0?Vn(e,"errors.network"):Vn(e,"errors.code",{code:t.status}):Vn(e,"errors.generic"),Fs="temp-thread",B4=(e=null)=>({config:null,configError:!1,configErrorCode:null,health:{},mode:e,threads:[],threadsError:!1,threadsLoaded:!1,thread:null,loadingThread:null,turn:null,limit:{remaining:null,daily:null,blocked:!1,overloaded:!1},notice:null}),nm=(e,t,r)=>e&&{...e,messages:e.messages.map(n=>n.id===t?r(n):n)},j4=(e,t,r)=>{const n=new Map;for(const i of e?.steps??[])typeof i.id=="string"&&typeof i.startedAt=="number"&&n.set(i.id,i.startedAt);return{...t,steps:t.steps.map(i=>({...i,startedAt:n.get(i.id)??r}))}},H4=(e,t)=>{const r=new Date(t).toISOString();return{id:Fs,title:e.query.slice(0,80),mode:e.mode,pinned:!1,created_at:r,updated_at:r,current_leaf_id:null,messages:[]}},V4=e=>({id:e.id,title:e.title,mode:e.mode,pinned:e.pinned,created_at:e.created_at,updated_at:e.updated_at}),U4=["widget_unauthorized","origin_not_allowed","origin_blocked"],$4=e=>e.configError?e.limit.overloaded?"overloaded":e.configErrorCode!==null&&U4.includes(e.configErrorCode)?"siteBlocked":"unavailable":e.config?null:"loading",G4=(e,t)=>{switch(t.type){case"config":{const{config:r}=t,n=r.modes.map(o=>o.slug),i=e.mode&&n.includes(e.mode)?e.mode:n[0]??null,a=r.visitor.remaining_today;return{...e,config:r,configError:!1,configErrorCode:null,mode:i,limit:{remaining:a,daily:r.visitor.daily_limit,blocked:a<=0,overloaded:!1,...a<=0&&(r.visitor.resets_at??e.limit.resetAt)?{resetAt:r.visitor.resets_at??e.limit.resetAt}:{}}}}case"configError":return{...e,configError:!0,configErrorCode:t.code??null,...t.overloaded?{limit:{...e.limit,blocked:!0,overloaded:!0}}:{}};case"health":return{...e,health:t.health};case"mode":return{...e,mode:t.mode};case"threads":return{...e,threads:t.threads,threadsError:!1,threadsLoaded:!0};case"threadsError":return{...e,threadsError:!0,threadsLoaded:!0};case"threadLoading":return{...e,loadingThread:t.id};case"thread":{if(e.turn&&e.thread?.id===t.thread.id||e.loadingThread!==t.thread.id&&e.thread?.id!==t.thread.id)return e;const r=e.config?.modes.map(n=>n.slug)??[];return{...e,thread:t.thread,loadingThread:null,mode:r.includes(t.thread.mode)?t.thread.mode:e.mode}}case"threadFailed":return e.loadingThread===t.id?{...e,loadingThread:null,notice:{kind:"error",reason:t.reason}}:e;case"newChat":return{...e,thread:null,loadingThread:null,turn:null,notice:null};case"threadDeleted":{const r=e.thread?.id===t.id;return{...e,threads:e.threads.filter(n=>n.id!==t.id),...r?{thread:null,turn:null}:{}}}case"turnStart":{const{request:r,token:n,at:i}=t,a=e.thread??H4(r,i),{user:o,assistant:s}=Yz(r,a);return{...e,notice:null,thread:{...a,current_leaf_id:s.id,messages:[...a.messages,...o?[o]:[],s]},turn:{token:n,assistantId:s.id,...o?{userId:o.id}:{},startedAt:i,adopted:!1,previousLeaf:a.current_leaf_id,optimisticIds:[s.id,...o?[o.id]:[]]}}}case"resumeStart":return{...e,turn:{token:t.token,assistantId:t.messageId,startedAt:t.at,adopted:!0,previousLeaf:e.thread?.current_leaf_id??null,optimisticIds:[]}};case"adopt":{const{turn:r,thread:n}=e;if(r?.token!==t.token||r.adopted||!n)return e;const{metadata:i}=t,a=n.id===Fs,o=Xz(n,{...r.userId?{userId:r.userId}:{},assistantId:r.assistantId},i),s=e.limit.remaining===null?null:Math.max(0,e.limit.remaining-1);return{...e,thread:o,threads:a?[V4(o),...e.threads.filter(l=>l.id!==o.id)]:e.threads,turn:{...r,adopted:!0,assistantId:i.assistantMessageId,...r.userId?{userId:i.userMessageId}:{}},limit:{...e.limit,remaining:s}}}case"snapshot":{const{turn:r}=e;if(r?.token!==t.token)return e;const n=e.thread?.messages.find(a=>a.id===r.assistantId),i=j4(n,t.snapshot,t.at);return{...e,thread:nm(e.thread,r.assistantId,a=>qz(a,i))}}case"turnEnd":{const{turn:r}=e;if(r?.token!==t.token)return e;const n=t.status==="detached"?e.thread:nm(e.thread,r.assistantId,i=>Kz(i,t.status,t.errorText,r.startedAt));return{...e,thread:n,turn:null,limit:{...e.limit,blocked:e.limit.blocked||e.limit.remaining===0}}}case"turnStopping":return e.turn?.token===t.token?{...e,turn:{...e.turn,stopping:!0}}:e;case"turnRejected":{const{turn:r,thread:n}=e;if(r?.token!==t.token)return e;const i=new Set(r.optimisticIds),a=n?.messages.filter(d=>!i.has(d.id))??[],o=n&&(n.id!==Fs||a.length>0)?{...n,current_leaf_id:r.previousLeaf,messages:a}:null,{error:s}=t,l=s.status===429&&s.code==="daily_limit",u=s.status===503&&s.code==="anon_budget";let f=e.limit;return l?f={...f,remaining:0,blocked:!0,...s.resetAt?{resetAt:s.resetAt}:{}}:u&&(f={...f,blocked:!0,overloaded:!0}),{...e,thread:o,turn:null,notice:l||u?null:{kind:"error",reason:s.reason},limit:f}}case"leaf":return e.thread?{...e,thread:{...e.thread,current_leaf_id:t.leafId}}:e;case"rating":return{...e,thread:nm(e.thread,t.messageId,r=>({...r,rating:t.rating,...t.feedback!==void 0?{feedback:t.feedback}:{},...t.feedbackReason!==void 0?{feedback_reason:t.feedbackReason}:{}}))};case"notice":return{...e,notice:t.notice}}},im=e=>{const t=e?e.messages.map(Fk):[],r=Bk(t),n=Hk(r,e?.current_leaf_id??null);return{index:r,path:n?Vz(r,n):[]}},nd={text:2e5,steps:500,blocks:100,attachments:50},iS=e=>e.text.length>nd.text||e.steps.length>nd.steps||e.blocks.length>nd.blocks||e.attachments.length>nd.attachments,W4=e=>e.code==="ip_limit"?{kind:"code",code:"ip_limit"}:Zf(e),aS=()=>{try{return window.localStorage}catch{return null}},Y4=()=>{try{return aS()?.getItem(rS)??null}catch{return null}},X4=e=>e instanceof TypeError,q4=({api:e,lang:t,open:r,onAdminTheme:n,children:i})=>{const[a,o]=H.useReducer(G4,null,()=>B4(Y4())),s=H.useRef(a),l=H.useRef(null),u=H.useRef(0),f=H.useRef(t),d=H.useRef(n);H.useLayoutEffect(()=>{s.current=a,f.current=t,d.current=n});const p=H.useCallback(()=>{e.threads().then(G=>{o({type:"threads",threads:G})},()=>{o({type:"threadsError"})})},[e]),v=H.useCallback(()=>{e.config().then(G=>{o({type:"config",config:G}),d.current(g4(G.site.theme)),e.adoptVisitor(G.visitor.token)&&p()},G=>{const I=G instanceof wr&&G.status===503,z=G instanceof wr?G.code:null;o({type:"configError",...I?{overloaded:I}:{},...z?{code:z}:{}})})},[e,p]),g=H.useCallback(G=>{e.thread(G).then(I=>{o({type:"thread",thread:I})},()=>{})},[e]);H.useEffect(()=>{v(),p()},[v,p]);const y=a.config!==null;H.useEffect(()=>{if(!r||!y)return;const G=()=>{typeof document<"u"&&document.visibilityState==="hidden"||e.health().then(z=>{o({type:"health",health:z})},()=>{})};G();const I=window.setInterval(G,z4);return window.addEventListener("focus",G),()=>{window.clearInterval(I),window.removeEventListener("focus",G)}},[e,r,y]);const x=H.useCallback(()=>{l.current?.controller.abort(),l.current=null},[]);H.useEffect(()=>x,[x]);const b=G=>{const I={token:++u.current,controller:new AbortController,stopRequested:!1,...G?{assistantId:G}:{}};return l.current=I,I},_=(G,I)=>G.stopRequested?"stopped":G.tooBig?"error":G.controller.signal.aborted?"detached":I?"error":"done",S=G=>{l.current===G&&(l.current=null)},T=(G,I,z)=>{S(G),p(),z&&I&&I!==Fs&&g(I)},E=H.useCallback(async G=>{const I=s.current;if(I.turn||l.current||I.limit.blocked)return"busy";const z=I.thread&&I.thread.id!==Fs?I.thread.id:void 0,W=b(),{token:F}=W;o({type:"turnStart",token:F,request:G,at:Date.now()});let ee=z;const ae=Se=>{if(iS(Se)){W.tooBig=!0,W.controller.abort();return}Se.metadata&&W.assistantId===void 0&&(W.assistantId=Se.metadata.assistantMessageId,ee=Se.metadata.threadId,o({type:"adopt",token:F,metadata:Se.metadata})),o({type:"snapshot",token:F,snapshot:Se,at:Date.now()})};let ie,_e=!1;try{const{streamChatAnswer:Se}=await Promise.resolve().then(()=>pC);await Se({transport:e.transport,request:G,...z?{threadId:z}:{},signal:W.controller.signal,onSnapshot:ae})}catch(Se){_e=!0,ie=Se}if(!(W.assistantId!==void 0)&&(ie instanceof wr||X4(ie))){const Se=ie instanceof wr?ie:new wr(0,"network",null);return o({type:"turnRejected",token:F,error:{status:Se.status,code:Se.code,resetAt:Se.resetAt,reason:W4(Se)}}),S(W),Se.status===429&&v(),"rejected"}const xe=_(W,_e);return o({type:"turnEnd",token:F,status:xe,errorText:xe==="error"?rm(f.current,Zf(ie)):""}),T(W,ee,xe==="done"||xe==="stopped"),"sent"},[e,v,p,g]),D=H.useCallback(async(G,I)=>{if(l.current)return;const z=b(I),{token:W}=z;o({type:"resumeStart",token:W,messageId:I,at:Date.now()});let F,ee=!1;try{const{resumeChatAnswer:ie}=await Promise.resolve().then(()=>pC);await ie(e.transport,I,z.controller.signal,_e=>{if(iS(_e)){z.tooBig=!0,z.controller.abort();return}o({type:"snapshot",token:W,snapshot:_e,at:Date.now()})})}catch(ie){ee=!0,F=ie}if(F instanceof wr){o({type:"turnEnd",token:W,status:"detached",errorText:""}),T(z,G.id,!0);return}const ae=_(z,ee);o({type:"turnEnd",token:W,status:ae,errorText:ae==="error"?rm(f.current,Zf(F)):""}),T(z,G.id,ae==="done"||ae==="stopped")},[e,p,g]),L=H.useCallback(()=>{const G=l.current;if(!G)return;if(G.stopRequested=!0,o({type:"turnStopping",token:G.token}),G.assistantId===void 0){G.controller.abort();return}const I=window.setTimeout(()=>{G.controller.abort()},F4);G.controller.signal.addEventListener("abort",()=>{window.clearTimeout(I)},{once:!0}),e.stop(G.assistantId).catch(()=>{G.controller.abort()})},[e]),R=H.useCallback(G=>{s.current.thread?.id!==G&&(x(),o({type:"newChat"}),o({type:"threadLoading",id:G}),e.thread(G).then(I=>{o({type:"thread",thread:I});const{path:z}=im(I),W=z[z.length-1];W?.role==="assistant"&&W.status==="streaming"&&D(I,W.id)},I=>{o({type:"threadFailed",id:G,reason:Zf(I)})}))},[e,x,D]),O=H.useCallback(()=>{x(),o({type:"newChat"})},[x]),M=H.useCallback(async G=>{try{await e.deleteThread(G),s.current.thread?.id===G&&x(),o({type:"threadDeleted",id:G})}catch{o({type:"notice",notice:{kind:"text",key:"deleteError"}})}},[e,x]),P=H.useMemo(()=>im(a.thread),[a.thread]),j=H.useCallback(G=>{const{thread:I}=s.current;if(!I||s.current.turn)return;const z=jk(im(I).index,G),W=I.current_leaf_id;!z||z===W||(o({type:"leaf",leafId:z}),e.setLeaf(I.id,z).catch(()=>{o({type:"leaf",leafId:W}),o({type:"notice",notice:{kind:"text",key:"branch.error"}})}))},[e]),B=H.useCallback((G,I)=>{const z=s.current.thread?.messages.find(ee=>ee.id===G);if(!z)return;const W=z.rating,F=I===W?null:I;o({type:"rating",messageId:G,rating:F}),e.rate(G,F).catch(()=>{o({type:"rating",messageId:G,rating:W}),o({type:"notice",notice:{kind:"text",key:"ratingError"}})})},[e]),$=H.useCallback(async(G,I,z)=>{const W=s.current.thread?.messages.find(F=>F.id===G);try{return await e.feedback(G,I,z),o({type:"rating",messageId:G,rating:W?.rating??null,feedback:I,feedbackReason:z??""}),!0}catch{return!1}},[e]),K=H.useCallback(G=>{o({type:"mode",mode:G});try{aS()?.setItem(rS,G)}catch{}},[]),Z=H.useCallback(()=>{o({type:"notice",notice:null})},[]),re=H.useCallback((G,I)=>Vn(t,G,I),[t]),Y=H.useMemo(()=>({state:a,lang:t,api:e,t:re,path:P.path,index:P.index,send:E,stop:L,openThread:R,newChat:O,deleteThread:M,refreshThreads:p,switchBranch:j,rate:B,saveFeedback:$,selectMode:K,reload:()=>{v(),p()},dismissNotice:Z}),[a,t,e,re,P,E,L,R,O,M,p,j,B,$,K,v,Z]);return k.jsx(nS.Provider,{value:Y,children:i})},oS=e=>H.useSyncExternalStore(t=>{if(typeof matchMedia>"u")return()=>{};const r=matchMedia(e);return r.addEventListener("change",t),()=>{r.removeEventListener("change",t)}},()=>typeof matchMedia<"u"&&matchMedia(e).matches,()=>!1),K4=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Z4=(e,t)=>{if(e.getAttribute("tabindex")==="-1"||e.getAttribute("aria-hidden")==="true"||getComputedStyle(e).visibility==="hidden")return!1;for(let r=e;r;r=r.parentElement){if(r.hasAttribute("inert")||r.hasAttribute("hidden")||getComputedStyle(r).display==="none")return!1;if(r===t)break}return!t.closest("[inert]")},sS=e=>Array.from(e.querySelectorAll(K4)).filter(t=>Z4(t,e)),fo=(e,t)=>{H.useLayoutEffect(()=>{e.current?.toggleAttribute("inert",t)},[e,t])},lS=e=>{const t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t.activeElement:null},id=(e,t,r)=>{const n=H.useRef(r);H.useEffect(()=>{n.current=r}),H.useEffect(()=>{const i=e.current;if(!t||!i)return;const a=lS(i);(i.querySelector("[data-autofocus]")??sS(i)[0])?.focus({preventScroll:!0});const s=l=>{if(l.key!=="Tab")return;const u=sS(i),f=u[0],d=u[u.length-1];if(!f||!d){l.preventDefault();return}const p=lS(i);l.shiftKey&&(p===f||!i.contains(p))?(l.preventDefault(),d.focus()):!l.shiftKey&&(p===d||!i.contains(p))&&(l.preventDefault(),f.focus())};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s),((a instanceof HTMLElement&&a.tagName!=="BODY"&&a.isConnected&&!i.contains(a)?a:null)??n.current?.())?.focus({preventScroll:!0})}},[e,t])},Q4=8,J4=9,Oi=(e,t)=>e.find(r=>r.kind===t),uS=e=>e.filter(t=>t.kind==="report").at(-1),eF=e=>e.filter(t=>t.kind==="export").flatMap(t=>t.files),tF=(e,t)=>{const r=e.findIndex(a=>a.id===t),n=r>0?e[r-1]:void 0,i=r>=0?e[r+1]:void 0;return{question:n?.role==="user"?n.content:"",reply:i?.role==="user"?i.content:""}},rF=500,nF=(e,t,r)=>{const n=t.trim();if(n.length<1||n.length>rF)return;const i=e[e.length-1];if(i?.role!=="assistant")return;const a=Oi(i.blocks,"clarification");if(a?.allow_free_text&&Ek(a,{isLastInBranch:!0,now:r})==="open")return{clarification_id:a.id,slot:a.slot,value:null,free_text:n}},iF=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const t=e.tagName;return t==="TEXTAREA"||t==="SELECT"||t==="INPUT"&&!["button","checkbox","radio"].includes(e.type)},aF=e=>typeof e=="number"&&Number.isFinite(e)?e:null,am=e=>typeof e=="string"?e:typeof e=="number"&&Number.isFinite(e)?String(e):"",ku={messageId:null,sectionId:null,fullscreen:!1,view:"chat"},om=(e,t=null)=>({messageId:e,sectionId:t,fullscreen:!1,view:"dashboard"}),cS=H.createContext(null),ho=()=>{},oF={state:ku,open:ho,toggle:ho,autoOpen:ho,close:ho,setSection:ho,setFullscreen:ho,setView:ho},fa=()=>H.useContext(cS)??oF,sF=1200;function lF(e){const{state:t,setFullscreen:r,close:n}=fa(),i=H.useRef({fullscreen:t.fullscreen,setFullscreen:r,close:n});H.useEffect(()=>{i.current={fullscreen:t.fullscreen,setFullscreen:r,close:n}}),H.useEffect(()=>{if(!e)return;const a=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;o.preventDefault();const s=i.current;s.fullscreen?s.setFullscreen(!1):s.close()};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[e])}const uF=(e,t,r)=>e&&!t&&!r;const cF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),fS=e=>{const t=fF(e);return t.charAt(0).toUpperCase()+t.slice(1)},dS=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),dF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var hF={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"};const pF=H.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>H.createElement("svg",{ref:l,...hF,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:dS("lucide",i),...!a&&!dF(s)&&{"aria-hidden":"true"},...s},[...o.map(([u,f])=>H.createElement(u,f)),...Array.isArray(a)?a:[a]]));const Pe=(e,t)=>{const r=H.forwardRef(({className:n,...i},a)=>H.createElement(pF,{ref:a,iconNode:t,className:dS(`lucide-${cF(fS(e))}`,`lucide-${e}`,n),...i}));return r.displayName=fS(e),r};const hS=Pe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const vF=Pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const gF=Pe("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);const pS=Pe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const ad=Pe("book-open",[["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"}]]);const mF=Pe("bot",[["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"}]]);const yF=Pe("chart-column-big",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["rect",{x:"15",y:"5",width:"4",height:"12",rx:"1",key:"q8uenq"}],["rect",{x:"7",y:"8",width:"4",height:"9",rx:"1",key:"sr5ea"}]]);const da=Pe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Bs=Pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const vS=Pe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const od=Pe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const po=Pe("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const gS=Pe("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);const sm=Pe("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const lm=Pe("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const xF=Pe("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const mS=Pe("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const um=Pe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const bF=Pe("file-chart-column-increasing",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M12 18v-4",key:"q1q25u"}],["path",{d:"M16 18v-6",key:"15y0np"}]]);const wF=Pe("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);const _F=Pe("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const kF=Pe("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const yS=Pe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const SF=Pe("landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);const vo=Pe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const xS=Pe("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const CF=Pe("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);const bS=Pe("maximize-2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const TF=Pe("message-circle-question",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const AF=Pe("message-circle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);const wS=Pe("message-square-text",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);const _S=Pe("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const kS=Pe("minimize-2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const EF=Pe("panel-left-close",[["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"}]]);const DF=Pe("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const MF=Pe("paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);const SS=Pe("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);const LF=Pe("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const IF=Pe("receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);const CS=Pe("rotate-ccw",[["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"}]]);const TS=Pe("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);const PF=Pe("scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);const Su=Pe("search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const NF=Pe("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const cm=Pe("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const AS=Pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const RF=Pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);const OF=Pe("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);const zF=Pe("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const sd=Pe("triangle-alert",[["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"}]]);const FF=Pe("trending-up",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);const BF=Pe("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);const Cu=Pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ES(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ES(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function jF(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ES(e))&&(n&&(n+=" "),n+=t);return n}const fm="-",HF=e=>{const t=UF(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const s=o.split(fm);return s[0]===""&&s.length!==1&&s.shift(),DS(s,t)||VF(o)},getConflictingClassGroupIds:(o,s)=>{const l=r[o]||[];return s&&n[o]?[...l,...n[o]]:l}}},DS=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?DS(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(fm);return t.validators.find(({validator:o})=>o(a))?.classGroupId},MS=/^\[(.+)\]$/,VF=e=>{if(MS.test(e)){const t=MS.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},UF=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return GF(Object.entries(e.classGroups),r).forEach(([a,o])=>{dm(o,n,a,t)}),n},dm=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:LS(t,i);a.classGroupId=r;return}if(typeof i=="function"){if($F(i)){dm(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{dm(o,LS(t,a),r,n)})})},LS=(e,t)=>{let r=e;return t.split(fm).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},$F=e=>e.isThemeGetter,GF=(e,t)=>t?e.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[t+o,s])):a);return[r,i]}):e,WF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},IS="!",YF=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],a=t.length,o=s=>{const l=[];let u=0,f=0,d;for(let x=0;x<s.length;x++){let b=s[x];if(u===0){if(b===i&&(n||s.slice(x,x+a)===t)){l.push(s.slice(f,x)),f=x+a;continue}if(b==="/"){d=x;continue}}b==="["?u++:b==="]"&&u--}const p=l.length===0?s:s.substring(f),v=p.startsWith(IS),g=v?p.substring(1):p,y=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:g,maybePostfixModifierPosition:y}};return r?s=>r({className:s,parseClassName:o}):o},XF=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},qF=e=>({cache:WF(e.cacheSize),parseClassName:YF(e),...HF(e)}),KF=/\s+/,ZF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(KF);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:f,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:v}=r(u);let g=!!v,y=n(g?p.substring(0,v):p);if(!y){if(!g){s=u+(s.length>0?" "+s:s);continue}if(y=n(p),!y){s=u+(s.length>0?" "+s:s);continue}g=!1}const x=XF(f).join(":"),b=d?x+IS:x,_=b+y;if(a.includes(_))continue;a.push(_);const S=i(y,g);for(let T=0;T<S.length;++T){const E=S[T];a.push(b+E)}s=u+(s.length>0?" "+s:s)}return s};function QF(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=PS(t))&&(n&&(n+=" "),n+=r);return n}const PS=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=PS(e[n]))&&(r&&(r+=" "),r+=t);return r};function JF(e,...t){let r,n,i,a=o;function o(l){const u=t.reduce((f,d)=>d(f),e());return r=qF(u),n=r.cache.get,i=r.cache.set,a=s,s(l)}function s(l){const u=n(l);if(u)return u;const f=ZF(l,r);return i(l,f),f}return function(){return a(QF.apply(null,arguments))}}const _t=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},NS=/^\[(?:([a-z-]+):)?(.+)\]$/i,eB=/^\d+\/\d+$/,tB=new Set(["px","full","screen"]),rB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,iB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=e=>js(e)||tB.has(e)||eB.test(e),ha=e=>Hs(e,"length",pB),js=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>Hs(e,"number",js),Tu=e=>!!e&&Number.isInteger(Number(e)),sB=e=>e.endsWith("%")&&js(e.slice(0,-1)),qe=e=>NS.test(e),pa=e=>rB.test(e),lB=new Set(["length","size","percentage"]),uB=e=>Hs(e,lB,RS),cB=e=>Hs(e,"position",RS),fB=new Set(["image","url"]),dB=e=>Hs(e,fB,gB),hB=e=>Hs(e,"",vB),Au=()=>!0,Hs=(e,t,r)=>{const n=NS.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},pB=e=>nB.test(e)&&!iB.test(e),RS=()=>!1,vB=e=>aB.test(e),gB=e=>oB.test(e),mB=JF(()=>{const e=_t("colors"),t=_t("spacing"),r=_t("blur"),n=_t("brightness"),i=_t("borderColor"),a=_t("borderRadius"),o=_t("borderSpacing"),s=_t("borderWidth"),l=_t("contrast"),u=_t("grayscale"),f=_t("hueRotate"),d=_t("invert"),p=_t("gap"),v=_t("gradientColorStops"),g=_t("gradientColorStopPositions"),y=_t("inset"),x=_t("margin"),b=_t("opacity"),_=_t("padding"),S=_t("saturate"),T=_t("scale"),E=_t("sepia"),D=_t("skew"),L=_t("space"),R=_t("translate"),O=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",qe,t],j=()=>[qe,t],B=()=>["",zi,ha],$=()=>["auto",js,qe],K=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",qe],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[js,qe];return{cacheSize:500,separator:":",theme:{colors:[Au],spacing:[zi,ha],blur:["none","",pa,qe],brightness:z(),borderColor:[e],borderRadius:["none","","full",pa,qe],borderSpacing:j(),borderWidth:B(),contrast:z(),grayscale:G(),hueRotate:z(),invert:G(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[sB,ha],inset:P(),margin:P(),opacity:z(),padding:j(),saturate:z(),scale:z(),sepia:G(),skew:z(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",qe]}],container:["container"],columns:[{columns:[pa]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...K(),qe]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tu,qe]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",qe]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",Tu,qe]}],"grid-cols":[{"grid-cols":[Au]}],"col-start-end":[{col:["auto",{span:["full",Tu,qe]},qe]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Au]}],"row-start-end":[{row:["auto",{span:[Tu,qe]},qe]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",qe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",qe,t]}],"min-w":[{"min-w":[qe,t,"min","max","fit"]}],"max-w":[{"max-w":[qe,t,"none","full","min","max","fit","prose",{screen:[pa]},pa]}],h:[{h:[qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pa,ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[Au]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",qe]}],"line-clamp":[{"line-clamp":["none",js,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zi,qe]}],"list-image":[{"list-image":["none",qe]}],"list-style-type":[{list:["none","disc","decimal",qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zi,ha]}],"underline-offset":[{"underline-offset":["auto",zi,qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...K(),cB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},dB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:Z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[zi,qe]}],"outline-w":[{outline:[zi,ha]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[zi,ha]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pa,hB]}],"shadow-color":[{shadow:[Au]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pa,qe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",qe]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",qe]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Tu,qe]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zi,ha,hm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),he=(...e)=>mB(jF(e));H.createContext(!0),H.createContext(!1);const pm="opacity-0 transition-opacity motion-reduce:transition-none group-focus-within:opacity-100 group-hover:opacity-100 [@media(hover:none)]:opacity-100",OS=120,yB=200,zS=".xls,.xlsx,.csv,.txt,.md",vm=2e3,xB=4,Eu=["wrong_number","wrong_indicator","wrong_territory","wrong_period","not_answered","language","slow","other"],bB=[1,2,3,4,5],go=e=>{const t=e?.trim();if(!t)return null;if(t.startsWith("#"))return t;if(!/^https?:\/\//i.test(t))return null;try{return new URL(t),t}catch{return null}},FS=e=>e.replace(/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),gm=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return wB(e)}},wB=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch{return!1}finally{t.remove()}},_B=(e,t)=>{const r=document.createElement("a");r.href=e,r.download=t,r.rel="noopener",r.style.display="none",document.body.append(r),r.click(),r.remove(),window.setTimeout(()=>{URL.revokeObjectURL(e)},6e4)},kB=["group.pinned","group.today","group.yesterday","group.week","group.earlier"],BS=864e5,SB=(e,t=new Date)=>{const r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),n=new Map;for(const i of e){const a=new Date(i.updated_at).getTime();let o;i.pinned?o="group.pinned":a>=r?o="group.today":a>=r-BS?o="group.yesterday":a>=r-7*BS?o="group.week":o="group.earlier",n.set(o,[...n.get(o)??[],i])}return kB.flatMap(i=>{const a=n.get(i);return a?[[i,a]]:[]})},CB=()=>{const{t:e}=ye(),{state:t,setView:r}=fa(),n=(i,a)=>k.jsx("button",{type:"button",role:"tab","aria-selected":t.view===i,onClick:()=>{r(i)},className:he("inline-flex h-7 items-center whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",t.view===i?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:text-foreground"),children:a});return k.jsxs("div",{part:"dashboard-tabs",role:"tablist","aria-label":e("dashboard.view"),className:"inline-flex shrink-0 gap-0.5 rounded-md border bg-background p-0.5",children:[n("chat",e("dashboard.chatTab")),n("dashboard",e("dashboard.dashboardTab"))]})},TB=({wide:e,chat:t,panel:r,onPanelFocusChange:n})=>{const{state:i}=fa(),{view:a,fullscreen:o}=i,s=r!=null,l=s&&!e&&a==="dashboard",u=s&&!e&&a==="chat"&&!o,f=H.useRef(null);return fo(f,s&&o),k.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1",children:[k.jsx("div",{ref:f,hidden:l,className:he("relative min-h-0 min-w-0 flex-1 flex-col",l?"hidden":"flex"),children:t}),s?k.jsx("aside",{part:"dashboard","data-fullscreen":o,hidden:u,onFocus:()=>{n?.(!0)},onBlur:d=>{d.currentTarget.contains(d.relatedTarget)||n?.(!1)},className:he("min-h-0 min-w-0 flex-col bg-background",u?"hidden":"flex",o&&"absolute inset-0 z-30",!o&&e&&"w-1/2 min-w-[480px] shrink-0 border-l",!o&&!e&&"flex-1 border-t"),children:r}):null]})};var AB=Object.defineProperty,mm=(e,t)=>AB(e,"name",{value:t,configurable:!0});function ym(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}mm(ym,"setRef");function jS(...e){return t=>{let r=!1;const n=e.map(i=>{const a=ym(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():ym(e[i],null)}}}}mm(jS,"composeRefs");function HS(...e){return H.useCallback(jS(...e),e)}mm(HS,"useComposedRefs");var EB=Object.defineProperty,Kr=(e,t)=>EB(e,"name",{value:t,configurable:!0});function VS(e){const t=H.forwardRef((r,n)=>{let{children:i,...a}=r,o=null,s=!1;const l=[];i=XS(i),H.Children.forEach(i,p=>{if(WS(p)){s=!0;const v=p;let g="child"in v.props?v.props.child:v.props.children;for(;xm(g)&&typeof ld=="function";)g=ld(g._payload);o=LB(v,g),l.push(o?.props?.children)}else l.push(p)}),o?o=H.cloneElement(o,void 0,l):!s&&H.Children.count(i)===1&&H.isValidElement(i)&&(o=i);const u=o?GS(o):void 0,f=HS(n,u);if(!o){if(i||i===0)throw new Error(s?NB(e):PB(e));return i}const d=$S(a,o.props??{});return o.type!==H.Fragment&&(d.ref=n?f:u),H.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}Kr(VS,"createSlot");var DB=VS("Slot"),US=Symbol.for("radix.slottable");function MB(e){const t=Kr(r=>"child"in r?r.children(r.child):r.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=US,t}Kr(MB,"createSlottable");var LB=Kr((e,t)=>"child"in e.props?H.isValidElement(t)?H.cloneElement(t,void 0,e.props.children(t.props.children)):null:H.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function $S(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"?r[n]=[i,a].filter(Boolean).join(" "):n==="aria-describedby"&&(r[n]=qS(a,i))}return{...e,...r}}Kr($S,"mergeProps");function GS(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}Kr(GS,"getElementRef");function WS(e){return H.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===US}Kr(WS,"isSlottable");var IB=Symbol.for("react.lazy");function xm(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===IB&&"_payload"in e&&YS(e._payload)}Kr(xm,"isLazyComponent");function YS(e){return typeof e=="object"&&e!==null&&"then"in e}Kr(YS,"isPromiseLike");function XS(e){let t=e;for(;xm(t)&&typeof ld=="function";)t=ld(t._payload);return t}Kr(XS,"useUnwrappedLazy");function qS(...e){const t=new Set;for(const r of e)if(typeof r=="string")for(const n of String(r).trim().split(/\s+/))n&&t.add(n);return t.size>0?Array.from(t).join(" "):void 0}Kr(qS,"concatAriaDescribedby");var PB=Kr(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),NB=Kr(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ld=W3[" use ".trim().toString()];function KS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=KS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function RB(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=KS(e))&&(n&&(n+=" "),n+=t);return n}const ZS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,QS=RB,JS=((e,t)=>r=>{var n;if(t?.variants==null)return QS(e,r?.class,r?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(u=>{const f=r?.[u],d=a?.[u];if(f===null)return null;const p=ZS(f)||ZS(d);return i[u][p]}),s=r&&Object.entries(r).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:p,...v}=f;return Object.entries(v).every(g=>{let[y,x]=g;return Array.isArray(x)?x.includes({...a,...s}[y]):{...a,...s}[y]===x})?[...u,d,p]:u},[]);return QS(e,o,l,r?.class,r?.className)})("inline-flex items-center justify-center gap-2 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 w-[max-content] disabled:bg-disabled disabled:text-disabled-foreground overflow-hidden shrink-0 whitespace-nowrap [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-hovered focus-visible:ring-primary active:bg-primary-pressed",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive-hovered focus-visible:ring-destructive active:bg-destructive-pressed",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary-hovered focus-visible:ring-primary active:bg-secondary-pressed hover:text-primary-foreground active:text-primary-foreground",ghost:"hover:bg-accent hover:text-accent-foreground focus-visible:ring-primary disabled:bg-transparent",link:"overflow-visible text-primary underline-offset-4 hover:text-primary-hovered focus-visible:ring-primary active:text-primary-pressed disabled:bg-transparent",outline:"bg-secondary text-secondary-foreground hover:bg-secondary-hovered focus-visible:ring-primary active:bg-secondary-pressed hover:text-primary-foreground active:text-primary-foreground",input:"bg-background border border-input focus-visible:ring-primary hover:border-primary active:border-primary-pressed"},size:{default:"h-10 px-4 text-base",xsm:"h-5 px-1 text-xs",xs:"h-6 px-3",sm:"h-8 px-3",md:"h-9 px-4",icon:"size-8 text-base",smIcon:"size-6 rounded-full text-base",lgIcon:"size-10 text-base"},isMenu:{true:"w-full justify-start"}},defaultVariants:{variant:"default",size:"default",isMenu:!1}}),Be=H.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,loading:i=!1,isMenu:a=!1,type:o,...s},l)=>{const u=n?{}:{type:o??"button"};return k.jsx(n?DB:"button",i?{className:he(JS({variant:t,size:r,className:e,isMenu:a})),ref:l,...u,...s,disabled:!0,children:k.jsx(vo,{className:"size-4 animate-spin min-w-16"})}:{className:he(JS({variant:t,size:r,className:e,isMenu:a})),ref:l,...u,...s})});Be.displayName="Button";function bm(e,t,r){if(e===null)return Hn(null,t);const n=Hn(e,t,r);return e>0?`+${n}`:n}function e2(e){return[e.territory_code??e.territory_name,e.item].filter(Boolean).join("|")}function t2(e,t){return e.national?.period===t?e.national.value:null}function OB(e,t,r){const n=mu(e);return Du(e,{period:t,mode:"value",base:"median"}).filter(a=>a.value!==null).slice(0,r).map(a=>{const o=new Map(e.data.filter(s=>e2(s)===a.key).map(s=>[s.period,s.value]));return{key:a.key,name:a.name,points:n.map(s=>({period:s,value:o.get(s)??null}))}})}function zB(e,t){if(new Set(e.data.map(i=>i.territory_code??i.territory_name??"")).size!==1||!e.data.every(i=>i.item!=null&&i.item!==""))return t;const n=new Map(e.data.map(i=>[e2(i),i.item??""]));return t.map(i=>({...i,name:n.get(i.key)??i.name}))}function Du(e,t){return zB(e,cz(e,t))}function r2(e,t,r){const n=t2(e,t);if(n===null||e.value_kind!=="level")return n;const i=r.filter(a=>a!==null&&Number.isFinite(a));return i.length===0?null:n<=Math.max(...i)*1.05?n:null}const FB=["12 76% 61%","173 58% 39%","197 37% 24%","43 74% 66%","27 87% 67%"],wm=e=>e.clientWidth>0&&e.clientWidth<BB,BB=360;function _m(e){const t=document.createElement("span");e.appendChild(t);const r=i=>(t.style.color=i,getComputedStyle(t).color),n={series:FB.map((i,a)=>r(`hsl(var(--chart-${a+1}, ${i}))`)),text:r("hsl(var(--foreground))"),muted:r("hsl(var(--muted-foreground))"),border:r("hsl(var(--chart-grid, var(--border)))"),negative:r("hsl(var(--chart-neg, var(--destructive)))"),reference:r("hsl(var(--chart-ref, var(--foreground)))"),font:getComputedStyle(e).fontFamily,narrow:wm(e)};return t.remove(),n}function jB({option:e,signature:t,label:r,height:n}){const i=H.useRef(null),a=H.useRef(null),o=H.useRef(e);return H.useEffect(()=>{o.current=e}),H.useEffect(()=>{const s=i.current;if(!s)return;let l=!0,u;return Promise.resolve().then(()=>FQ).then(({init:f})=>{if(!l)return;a.current=f(s),a.current.setOption(o.current(_m(s)));let d=wm(s);u=new ResizeObserver(()=>{wm(s)!==d&&(d=!d,a.current?.setOption(o.current(_m(s)),!0)),a.current?.resize()}),u.observe(s)}).catch(()=>{}),()=>{l=!1,u?.disconnect(),a.current?.dispose(),a.current=null}},[]),H.useEffect(()=>{const s=i.current;s&&a.current&&a.current.setOption(o.current(_m(s)),!0)},[t]),k.jsx("div",{ref:i,role:"img","aria-label":r,style:{height:n},className:"w-full min-w-0"})}const HB=[[/товариществ[оа] с ограниченной ответственностью/giu,"ТОО"],[/республиканско(е|го) государственно(е|го) учреждени[ея]/giu,"РГУ"],[/республиканско(е|го) государственно(е|го) предприяти[ея]/giu,"РГП"],[/государственно(е|го) учреждени[ея]/giu,"ГУ"],[/акционерно(е|го) обществ[оа]/giu,"АО"],[/индивидуальный предприниматель/giu,"ИП"]],VB=e=>HB.reduce((t,[r,n])=>t.replace(r,n),e).replace(/\s+/g," ").trim();function UB(e){if(e.trend)return["line","area","column"];const t=["bar","column"],r=e.rows.map(n=>n.value).filter(n=>n!==null);return!e.signed&&r.length>1&&r.every(n=>n>0)&&t.push("pie"),!e.signed&&e.periods.length>1&&e.series.length>0&&t.push("line"),t}const $B=.3;function GB(e,t,r,n){const{lang:i,decimals:a}=n,o=E=>typeof E=="number"?t.signed?bm(E,i,a):Hn(E,i,a):"—",s=new Intl.NumberFormat(i,{notation:"compact",maximumFractionDigits:1}),l={color:r.muted,formatter:E=>s.format(E)},u={lineStyle:{color:r.border}},f=E=>D=>{const L=VB(D);return L.length>E?`${L.slice(0,E-1)}…`:L},d={color:r.muted,formatter:f(r.narrow?12:22)},p={animationDuration:400,color:r.series,textStyle:{fontFamily:r.font,color:r.text},tooltip:{trigger:e==="pie"?"item":"axis",confine:!0,valueFormatter:o}},v=t.rows.map(E=>E.value).filter(E=>E!==null),g=!t.signed&&v.every(E=>E>0)&&!hz(v);if(e==="pie")return{...p,legend:{type:"scroll",bottom:0,textStyle:{color:r.muted}},series:[{type:"pie",radius:["40%","68%"],center:["50%","44%"],itemStyle:{borderColor:"transparent",borderRadius:4},label:{show:!1},data:t.rows.filter(E=>E.value!==null).map(E=>({name:E.name,value:E.value}))}]};if(t.trend||e==="line"||e==="area")return{...p,legend:{type:"scroll",bottom:0,textStyle:{color:r.muted}},grid:{left:8,right:16,top:12,bottom:32,containLabel:!0},xAxis:{type:"category",data:t.periods,axisLabel:{color:r.muted},boundaryGap:e==="column"},yAxis:{type:"value",scale:e!=="column",axisLabel:l,splitLine:u},series:t.series.map(E=>({type:e==="column"?"bar":"line",name:E.name,data:t.periods.map(D=>E.points.find(L=>L.period===D)?.value??null),symbolSize:6,...e==="area"?{areaStyle:{opacity:.15}}:{}}))};const y=e==="bar",x=y?[...t.rows].reverse():t.rows,b=x.map(E=>E.name),_=t.national??null,S={type:"value",scale:g,axisLabel:l,splitLine:u,...r.narrow?{splitNumber:2}:{}},T={type:"category",data:b,axisTick:{show:!1},axisLabel:y?d:{...d,formatter:f(14),rotate:30,interval:0}};return{...p,tooltip:{...p.tooltip,axisPointer:{type:"shadow"}},grid:{left:8,right:y?56:16,top:_===null?12:24,bottom:8,containLabel:!0},xAxis:y?S:T,yAxis:y?T:S,series:[{type:"bar",barMaxWidth:28,data:x.map(E=>({value:E.value,itemStyle:{color:E.value!==null&&E.value<0?r.negative:r.series[0],opacity:t.highlightKey!==void 0&&E.key!==t.highlightKey?$B:1,borderRadius:y?[0,4,4,0]:[4,4,0,0]}})),label:{show:y,position:"right",color:r.text,formatter:E=>o(E.value)},..._===null?{}:{markLine:{symbol:"none",silent:!0,lineStyle:{type:"dashed",color:r.reference},label:{formatter:n.nationalLabel(o(_)),color:r.reference,position:y?"end":"insideEndTop"},data:[y?{xAxis:_}:{yAxis:_}]}}}]}}const WB=5,n2=({section:e,period:t,rows:r,national:n=null,signed:i=!1,highlightKey:a,compact:o=!1,label:s})=>{const{lang:l,t:u}=ye(),f={rows:r,series:OB(e,t,WB),periods:mu(e),trend:e.shape==="trend",national:n,signed:i,highlightKey:a},d=UB(f),[p,v]=H.useState(d[0]),g=d.includes(p)?p:d[0],x=g==="bar"&&!f.trend?Math.max(o?180:240,r.length*24+40):o?240:320;return k.jsxs("div",{part:"section-chart",className:"flex min-w-0 flex-col gap-2",children:[d.length>1?k.jsx("div",{role:"group","aria-label":u("chart.kinds"),className:"inline-flex flex-wrap gap-0.5 self-start rounded-md border bg-background p-0.5",children:d.map(b=>k.jsx("button",{type:"button","aria-pressed":b===g,onClick:()=>{v(b)},className:he("inline-flex h-7 items-center whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",b===g?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:text-foreground"),children:u(`chart.kind.${b}`)},b))}):null,k.jsx(jB,{label:s,height:x,signature:JSON.stringify([g,l,f]),option:b=>GB(g,f,b,{lang:l,decimals:e.decimals,nationalLabel:_=>u("chart.national",{value:_})})})]})},i2=(e,t)=>{const{api:r,lang:n}=ye(),a=H.useSyncExternalStore(_u.subscribe,()=>_u.view(e))??(t?Jg(t):Qk);H.useEffect(()=>{t&&_u.adopt(e,t,r)},[e,t,r]);const o=H.useCallback(()=>{_u.start(e,r,n)},[e,r,n]),s=H.useCallback(()=>{_u.expire(e)},[e]);return{view:a,start:o,expire:s}},a2=({messageId:e,block:t,disabled:r=!1,className:n})=>{const{t:i}=ye(),{view:a,start:o}=i2(e,t);return a.phase!=="idle"?null:k.jsxs(Be,{part:"report",variant:"input",size:"sm",className:he("gap-1.5 text-[13px]",n),disabled:r,onClick:o,children:[k.jsx(wF,{"aria-hidden":"true"}),i("report.create")]})},o2={pdf:"pdf",doc:"doc",docx:"doc",ppt:"ppt",pptx:"ppt",xls:"xls",xlsx:"xls",csv:"csv"},km=e=>{const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLowerCase()},s2=e=>Object.hasOwn(o2,e)?o2[e]??"other":"other",YB={pdf:"bg-file-pdf",doc:"bg-file-doc",ppt:"bg-file-ppt",xls:"bg-file-xls",csv:"bg-file-csv",other:"bg-file-other"},Sm=({ext:e,className:t})=>k.jsx("span",{part:"file-type","data-kind":s2(e),"aria-hidden":"true",className:he("flex size-[34px] shrink-0 items-center justify-center rounded-lg text-[9.5px] font-bold leading-none tracking-[0.02em] text-background",YB[s2(e)],t),children:e?e.slice(0,4).toUpperCase():"FILE"}),l2=["byte","kilobyte","megabyte","gigabyte"];function Cm(e,t){let r=e,n=0;for(;r>=1024&&n<l2.length-1;)r/=1024,n+=1;return new Intl.NumberFormat(t,{style:"unit",unit:l2[n]??"byte",unitDisplay:"short",maximumFractionDigits:n===0?0:1}).format(r)}const XB=/^\/api\/v1\/((?:report-jobs|messages)\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/files\/\d{1,4})$/i,u2=e=>{const t=XB.exec(e);return t?.[1]?`${Ug}/${t[1]}`:null},qB=1e3,KB=async(e,t,r,n)=>{const i=u2(t);if(!i)return"unavailable";let a;try{a=await(await e.request(i.slice(Ug.length))).blob()}catch(l){return l instanceof wr&&l.status===410?"expired":l instanceof wr&&l.status===404?"notFound":"unavailable"}const o=URL.createObjectURL(a),s=document.createElement("a");s.href=o,s.download=FS(r),s.hidden=!0,n.appendChild(s);try{s.click()}finally{s.remove(),window.setTimeout(()=>{URL.revokeObjectURL(o)},qB)}return"ok"},ZB=["pdf","docx","pptx","xlsx","csv"],QB=e=>{const t=e.getRootNode();return t instanceof ShadowRoot?t:e.parentElement??e},c2=({files:e,onExpired:t,className:r})=>{const{api:n,lang:i,t:a}=ye(),[o,s]=H.useState(null),[l,u]=H.useState({}),f=H.useRef(l);H.useEffect(()=>{f.current=l});const d=e.filter(v=>ZB.includes(v.format)&&u2(v.download_url)!==null);if(d.length===0)return null;const p=(v,g)=>{o===null&&(s(v.download_url),u(y=>Object.fromEntries(Object.entries(y).filter(([x])=>x!==v.download_url))),KB(n,v.download_url,v.filename,QB(g.currentTarget)).then(y=>{if(s(null),y==="ok")return;const x={...f.current,[v.download_url]:y};u(x),d.every(b=>x[b.download_url]==="expired")&&t?.()}))};return k.jsxs("div",{part:"files",role:"group","aria-label":a("files.list"),className:he("flex flex-col gap-1.5",r),children:[k.jsx("div",{className:"text-2xs text-muted-foreground",children:a("files.list")}),k.jsx("ul",{"aria-label":a("files.list"),className:"m-0 flex list-none flex-col gap-1.5 p-0",children:d.map(v=>{const g=o===v.download_url,y=l[v.download_url];return k.jsxs("li",{"data-state":l[v.download_url]??void 0,className:he("flex min-w-0 items-center gap-3 rounded-xl border bg-card p-2",l[v.download_url]&&"border-error/35 bg-error-background"),children:[k.jsx(Sm,{ext:v.format}),k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[k.jsx("span",{className:"truncate text-sm font-medium leading-tight",title:v.filename,children:a(`files.${Pk(v.format)}`)}),k.jsxs("span",{className:"text-2xs leading-tight text-muted-foreground",children:[v.format.toUpperCase(),v.size_bytes>0?` · ${Cm(v.size_bytes,i)}`:null]})]}),y?k.jsxs("span",{role:"alert",className:"flex shrink-0 items-center gap-1.5 text-[13px]",children:[k.jsx(po,{className:"text-destructive","aria-hidden":"true"}),a(`files.${y}`)]}):k.jsxs(Be,{variant:"ghost",size:"sm",className:"gap-1.5",title:v.filename,"aria-busy":g,disabled:o!==null,"aria-label":`${a("download")}: ${a(`files.${Pk(v.format)}`)}`,onClick:x=>{p(v,x)},children:[g?k.jsx(vo,{className:"animate-spin motion-reduce:animate-none","aria-hidden":"true"}):k.jsx(mS,{"aria-hidden":"true"}),a("download")]})]},`${v.format}-${v.download_url}`)})})]})},Tm="flex items-center gap-2.5 rounded-xl border px-3 py-2.5 text-sm",f2=({messageId:e,block:t,className:r})=>{const{t:n}=ye(),{view:i,start:a,expire:o}=i2(e,t);switch(i.phase){case"idle":return null;case"pending":return k.jsxs("div",{part:"report",role:"status","data-state":"pending",className:he(Tm,"border-processing/25 bg-processing-background",r),children:[k.jsx(vo,{className:"shrink-0 animate-spin text-primary-text motion-reduce:animate-none","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.pending")})]});case"done":return k.jsx(c2,{files:i.files,onExpired:o,className:r});case"expired":return k.jsxs("div",{part:"report",role:"status","data-state":"expired",className:he(Tm,"bg-card",r),children:[k.jsx(sm,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.expired")}),k.jsx(Be,{variant:"input",size:"sm",className:"gap-1.5 text-[13px]",onClick:a,children:n("report.create")})]});case"failed":return k.jsxs("div",{part:"report",role:"alert","data-state":"failed",className:he(Tm,"border-error/30 bg-error-background",r),children:[k.jsx(po,{className:"shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:n("report.failed")}),k.jsx(Be,{variant:"input",size:"sm",className:"gap-1.5 text-[13px]",onClick:a,children:n("report.retry")})]})}},JB=4;function ud(e,t,r){const n=dz(e,t);return n==="п.п."?r("dashboard.points"):n}function d2(e){if(e.length===0)return null;const t=[...e].sort((n,i)=>n-i),r=Math.floor(t.length/2);return t.length%2?t[r]??null:((t[r-1]??0)+(t[r]??0))/2}function Vs(e){const t=new Set;return e.filter(r=>!t.has(r.label)&&t.add(r.label)).slice(0,JB)}function ej(e,{period:t,region:r,lang:n,t:i}){if(r===void 0&&t===e.latest_period&&e.kpis.length>0)return Vs(e.kpis.map(g=>({label:g.label,value:g.value,sub:g.sub??null})));const a=g=>`${Hn(g,n,e.decimals)} ${e.unit.label}`,o=(g,y)=>g===null?Hn(null,n):`${bm(g,n,e.decimals)} ${y}`,s=Du(e,{period:t,mode:"value",base:"median"}).filter(g=>g.value!==null),l=s.map(g=>g.value??0),u=s[0],f=s[s.length-1];if(u===void 0||f===void 0)return[];if(r!==void 0){const g=s.findIndex(b=>b.key===r),y=s[g];if(y===void 0)return[];const x=d2(l);return Vs([{label:y.name,value:a(y.value),sub:t},{label:i("dashboard.kpi.place"),value:i("dashboard.kpi.placeOf",{n:g+1,m:s.length})},{label:i("dashboard.kpi.deviation"),value:o(x===null||y.value===null?null:y.value-x,ud(e,"deviation",i))},{label:i("dashboard.kpi.previous"),value:o(y.delta,ud(e,"change",i))}])}if(e.shape==="trend"){const g=mu(e).filter(T=>T<=t),y=T=>e.data.find(E=>E.period===T&&E.value!==null)?.value??null,x=g[0],b=y(t),_=x===void 0?null:y(x);let S=null;return b!==null&&_!==null&&x!==t&&(S=e.value_kind==="level"?_>0?(b/_-1)*100:null:b-_),Vs([{label:i("dashboard.kpi.last"),value:a(b),sub:t},...x!==void 0&&x!==t?[{label:i("dashboard.kpi.first"),value:a(_),sub:x},{label:i("dashboard.kpi.change"),value:o(S,ud(e,"change",i))}]:[]])}if(e.shape==="breakdown")return Vs([...s.slice(0,3).map(g=>({label:g.name,value:a(g.value),sub:g.share===null?t:`${Hn(g.share,n,1)} %`})),...s.length>1?[{label:i("dashboard.kpi.gap"),value:a((u.value??0)-(f.value??0)),sub:`${u.name} − ${f.name}`}]:[]]);const d=t2(e,t),p=d2(l),v=[{label:i("dashboard.kpi.max"),value:a(u.value),sub:u.name},{label:i("dashboard.kpi.min"),value:a(f.value),sub:f.name},{label:i("dashboard.kpi.median"),value:a(p),sub:t}];return Vs(d!==null?[{label:i("dashboard.kpi.national"),value:a(d),sub:t},...v]:[...v,{label:i("dashboard.kpi.spread"),value:a((u.value??0)-(f.value??0)),sub:`${u.name} − ${f.name}`}])}const tj=({kpis:e})=>{const{t}=ye();return e.length===0?null:k.jsx("ul",{"aria-label":t("dashboard.kpis"),className:"m-0 grid list-none grid-cols-[repeat(auto-fit,minmax(9.5rem,1fr))] gap-2.5 p-0",children:e.map((r,n)=>k.jsxs("li",{className:"flex min-w-0 flex-col gap-0.5 rounded-xl border bg-card px-3.5 py-3",children:[k.jsx("span",{"data-kpi-label":"",className:"truncate text-2xs text-muted-foreground",title:r.label,children:r.label}),k.jsx("span",{className:"text-xl font-semibold tabular-nums leading-snug",children:r.value}),r.sub!=null&&r.sub!==""?k.jsx("span",{className:"truncate text-2xs text-muted-foreground",title:r.sub,children:r.sub}):null]},n))})};function h2({label:e,value:t,options:r,onChange:n}){return k.jsx("div",{role:"group","aria-label":e,className:"inline-flex gap-0.5 rounded-md border bg-background p-0.5",children:r.map(i=>{const a=i.value===t,o=i.disabledHint!==void 0;return k.jsx("button",{type:"button","aria-pressed":a,"aria-disabled":o||void 0,title:i.disabledHint,onClick:()=>{o||n(i.value)},className:he("h-7 whitespace-nowrap rounded-[7px] px-2.5 text-[13px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",a?"bg-secondary text-secondary-foreground":"text-muted-foreground",o?"cursor-not-allowed opacity-50":!a&&"hover:text-foreground"),children:i.label},i.value)})})}const Mu="whitespace-nowrap px-3 py-[7px] text-[13px] font-semibold text-foreground",Us="whitespace-nowrap text-right tabular-nums",rj=({section:e,rows:t,mode:r,lang:n,highlightKey:i})=>{const{t:a}=ye(),o=e.value_kind==="level",s=r==="value"?null:a(r==="change"?"dashboard.table.change":"dashboard.table.deviation",{unit:ud(e,r,a)});return k.jsx("div",{className:"max-h-[28rem] overflow-auto overscroll-contain rounded-[10px] border bg-card",children:k.jsxs("table",{className:"w-full border-collapse text-[13.5px]",children:[k.jsx("thead",{className:"sticky top-0 bg-muted",children:k.jsxs("tr",{className:"border-b",children:[k.jsx("th",{scope:"col",className:he(Mu,"w-10 text-right"),children:a("dashboard.table.rank")}),k.jsx("th",{scope:"col",className:he(Mu,"text-left"),children:a("dashboard.table.position")}),k.jsx("th",{scope:"col",className:he(Mu,Us),children:a("dashboard.table.value",{unit:e.unit.label})}),s!==null?k.jsx("th",{scope:"col",className:he(Mu,Us),children:s}):null,o?k.jsx("th",{scope:"col",className:he(Mu,Us),children:a("dashboard.table.share")}):null]})}),k.jsx("tbody",{children:t.map((l,u)=>k.jsxs("tr",{className:he("h-9 border-b last:border-b-0",l.key===i&&"bg-accent"),children:[k.jsx("td",{className:"px-3 text-right tabular-nums text-muted-foreground",children:u+1}),k.jsx("td",{className:"px-3",children:l.name}),k.jsx("td",{className:he("px-3",Us),children:Hn(l.value,n,e.decimals)}),s!==null?k.jsx("td",{className:he("px-3",Us),children:bm(l.display,n,e.decimals)}):null,o?k.jsx("td",{className:he("px-3",Us),children:Hn(l.share,n,1)}):null]},l.key))})]})})},Am="__all__",Em="size-8 text-muted-foreground hover:text-foreground",nj=({message:e})=>{const{t}=ye(),{state:r,setSection:n}=fa(),i=Oi(e.blocks,"dashboard")?.sections??[],a=i.find(s=>s.id===r.sectionId)??i[0];if(a===void 0)return null;const o=i.length>1?k.jsx("div",{role:"tablist","aria-label":t("dashboard.sections"),className:"flex gap-1 self-start overflow-x-auto rounded-md bg-secondary p-1",children:i.map(s=>{const l=s.id===a.id;return k.jsx("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>{n(s.id)},className:he("min-h-8 shrink-0 rounded-lg px-3 py-1.5 text-left text-sm font-medium leading-snug transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",l?"bg-background text-foreground shadow-sm":"text-secondary-foreground hover:text-foreground"),children:s.title},s.id)})}):null;return k.jsx("section",{"aria-label":t("dashboard.label"),className:"flex h-full min-h-0 min-w-0 flex-1 flex-col bg-background",children:k.jsx(ij,{section:a,message:e,tabs:o},a.id)})},p2=({label:e,value:t,onChange:r,children:n,className:i})=>k.jsxs("div",{className:he("flex flex-col gap-1",i),children:[k.jsx("span",{className:"text-2xs text-muted-foreground","aria-hidden":"true",children:e}),k.jsxs("span",{className:"relative inline-flex",children:[k.jsx("select",{"aria-label":e,value:t,onChange:a=>{r(a.target.value)},className:"h-8 w-full min-w-0 appearance-none truncate rounded-md border border-input bg-background py-0 pl-2.5 pr-7 text-sm text-foreground transition-colors hover:bg-muted focus-visible:border-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-secondary motion-reduce:transition-none",children:n}),k.jsx(Bs,{className:"pointer-events-none absolute right-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"})]})]}),v2=({label:e,children:t})=>k.jsxs("div",{className:"flex flex-col gap-1",children:[k.jsx("span",{className:"text-2xs text-muted-foreground","aria-hidden":"true",children:e}),t]}),ij=({section:e,message:t,tabs:r})=>{const{lang:n,t:i}=ye(),{state:a,setFullscreen:o,close:s}=fa(),{fullscreen:l}=a,u=mu(e),[f,d]=H.useState(()=>u.includes(e.latest_period)?e.latest_period:u.at(-1)??e.latest_period),[p,v]=H.useState(),[g,y]=H.useState("value"),[x,b]=H.useState("median"),_=fz(e,f),S=e.shape==="trend",T=S||g==="change"&&!_.change||g==="deviation"&&!_.deviation?"value":g,E=x==="national"&&_.national?"national":"median",D=Du(e,{period:f,mode:T,base:E}),L=T==="value"?D:Du(e,{period:f,mode:"value",base:E}),R=[...L].sort((z,W)=>z.name.localeCompare(W.name,n)),O=p!==void 0&&R.some(z=>z.key===p)?p:void 0,M=ej(e,{period:f,region:O,lang:n,t:i}),P=f===e.latest_period&&O===void 0?e.findings:[],j=e.shape==="regional",B=L.filter(z=>z.value!==null).length,$=[f,e.unit.label,i(j?"dashboard.regions":"dashboard.items",{n:B})].join(" · "),K=go(e.source_url),Z=e.methodology?.editions,re=Z?.[n]??Z?.ru,Y=go(re?.url),G=`${i(S?"dashboard.trend":"dashboard.ranking")}: ${e.title}, ${f}`,I=uS(t.blocks);return k.jsxs(k.Fragment,{children:[k.jsxs("header",{className:"flex shrink-0 flex-col gap-2 border-b py-3.5 pl-5 pr-4",children:[k.jsxs("div",{className:"flex items-center gap-1",children:[k.jsx("span",{className:"min-w-0 flex-1 text-2xs font-semibold uppercase tracking-wide text-primary-text",children:i("dashboard.eyebrow")}),Y!==null?k.jsx(Be,{variant:"ghost",size:"icon",className:Em,asChild:!0,children:k.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer","aria-label":i("dashboard.methodology"),title:re?.title??i("dashboard.methodology"),children:k.jsx(ad,{"aria-hidden":"true"})})}):null,K!==null?k.jsx(Be,{variant:"ghost",size:"icon",className:Em,asChild:!0,children:k.jsx("a",{href:K,target:"_blank",rel:"noopener noreferrer","aria-label":i("dashboard.openSource"),title:i("dashboard.openSource"),children:k.jsx(um,{"aria-hidden":"true"})})}):null,k.jsxs(Be,{variant:"ghost",size:"sm",className:"gap-1.5 text-muted-foreground hover:text-foreground","aria-pressed":l,onClick:()=>{o(!l)},children:[l?k.jsx(kS,{"aria-hidden":"true"}):k.jsx(bS,{"aria-hidden":"true"}),i(l?"dashboard.collapse":"dashboard.fullscreen")]}),k.jsx(Be,{variant:"ghost",size:"icon",className:Em,"aria-label":i("dashboard.close"),title:i("dashboard.close"),onClick:s,children:k.jsx(Cu,{"aria-hidden":"true"})})]}),k.jsx("h2",{className:"m-0 text-xl font-semibold leading-snug",children:e.title}),k.jsx("span",{className:"text-xs text-muted-foreground",children:$})]}),k.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-3.5 overflow-y-auto overscroll-contain px-5 pb-5 pt-3.5",children:[r,k.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[j&&R.length>1?k.jsxs(p2,{label:i("dashboard.region"),value:O??Am,onChange:z=>{v(z===Am?void 0:z)},className:"min-w-40 max-w-60",children:[k.jsx("option",{value:Am,children:i("dashboard.allRegions")}),R.map(z=>k.jsx("option",{value:z.key,children:z.name},z.key))]}):null,u.length>1?k.jsx(p2,{label:i("dashboard.period"),value:f,onChange:d,className:"min-w-24",children:[...u].reverse().map(z=>k.jsx("option",{value:z,children:z},z))}):null,S?null:k.jsx(v2,{label:i("dashboard.mode.label"),children:k.jsx(h2,{label:i("dashboard.mode.label"),value:T,onChange:y,options:[{value:"value",label:i("dashboard.mode.value")},{value:"deviation",label:i("dashboard.mode.deviation"),disabledHint:_.deviation?void 0:i("dashboard.fewRegions")},{value:"change",label:i("dashboard.mode.change"),disabledHint:_.change?void 0:i("dashboard.noPrevious")}]})}),T==="deviation"?k.jsx(v2,{label:i("dashboard.base.label"),children:k.jsx(h2,{label:i("dashboard.base.label"),value:E,onChange:b,options:[{value:"median",label:i("dashboard.base.median")},{value:"national",label:i("dashboard.base.national"),disabledHint:_.national?void 0:i("dashboard.noNational")}]})}):null]}),k.jsx(tj,{kpis:M}),k.jsx(Dm,{title:i(S?"dashboard.trend":"dashboard.ranking"),card:!0,children:k.jsx(n2,{section:e,period:f,label:G,rows:D.map(z=>({key:z.key,name:z.name,value:z.display})),national:T==="value"?r2(e,f,D.map(z=>z.value)):null,signed:T!=="value",highlightKey:O})}),P.length>0?k.jsx(Dm,{title:i("dashboard.findings"),children:k.jsx("ul",{className:"flex list-disc flex-col gap-1 pl-5 text-sm",children:P.map((z,W)=>k.jsx("li",{children:z},W))})}):null,k.jsx(Dm,{title:i("dashboard.data"),children:k.jsx(rj,{section:e,rows:D,mode:T,lang:n,highlightKey:O})}),k.jsxs("footer",{className:"flex flex-col gap-3 border-t pt-3.5",children:[e.source_name!=null&&e.source_name!==""?k.jsx("p",{className:"text-xs text-muted-foreground",children:i("dashboard.source",{name:e.source_name})}):null,k.jsx("div",{className:"-ml-2 empty:hidden",children:k.jsx(a2,{messageId:t.id,block:I})}),k.jsx(f2,{messageId:t.id,block:I})]})]})]})},Dm=({title:e,children:t,card:r=!1})=>k.jsxs("section",{className:"flex flex-col gap-2",children:[k.jsx("h3",{className:"m-0 text-sm font-semibold",children:e}),r?k.jsx("div",{className:"rounded-xl bg-[hsl(var(--chart-card))] px-4 py-3.5",children:t}):t]}),aj=({threadId:e,children:t})=>{const[r,n]=H.useState(ku),[i,a]=H.useState(e);i!==e&&(a(e),i!==void 0&&n(ku));const o=H.useRef(new Set),s=H.useCallback((y,x)=>{n(om(y,x??null))},[]),l=H.useCallback(y=>{n(x=>x.messageId===y?ku:om(y))},[]),u=H.useCallback(y=>{o.current.has(y)||(o.current.add(y),n(om(y)))},[]),f=H.useCallback(()=>{n(ku)},[]),d=H.useCallback(y=>{n(x=>({...x,sectionId:y}))},[]),p=H.useCallback(y=>{n(x=>({...x,fullscreen:y}))},[]),v=H.useCallback(y=>{n(x=>({...x,view:y}))},[]),g=H.useMemo(()=>({state:r,open:s,toggle:l,autoOpen:u,close:f,setSection:d,setFullscreen:p,setView:v}),[r,s,l,u,f,d,p,v]);return k.jsx(cS.Provider,{value:g,children:t})};function oj(e,t,r){const{autoOpen:n}=fa(),[i,a]=H.useState(null);i?.threadId===void 0&&i!==null&&t===void 0?i.active!==r.streaming&&a({...i,active:r.streaming}):i?.threadId===void 0&&i!==null?i.active||r.streaming||e.some(f=>!Kf(f.id))?a({threadId:t,ids:i.ids,active:!0}):r.loaded&&a({threadId:t,ids:new Set(e.map(f=>f.id)),active:!1}):r.loaded&&(i===null||i.threadId!==t)&&a({threadId:t,ids:new Set(e.map(u=>u.id)),active:!1});const o=e.at(-1),s=o?.id,l=i!==null&&i.threadId===t&&o?.role==="assistant"&&!i.ids.has(o.id)&&o.status!=="streaming"&&Kf(o.id)&&Oi(o.blocks,"dashboard")?.auto_open===!0;H.useEffect(()=>{l&&s!=null&&n(s)},[l,s,n])}const g2="aid_intro_ack",sj=()=>{try{return window.localStorage.getItem(g2)!==null}catch{return!1}},lj=({active:e=!0})=>{const{state:t,lang:r,t:n}=ye(),i=bu(t.config?.intro_notice??void 0,r).trim(),[a,o]=H.useState(sj),s=e&&i!==""&&!a,l=H.useId(),u=i.split(`
|
|
17
17
|
`).filter(p=>p.trim()!==""),f=H.useRef(null);fo(f,!s),id(f,s,()=>{const p=f.current?.getRootNode();return p instanceof ShadowRoot||p instanceof Document?p.querySelector('[part="input"]'):null});const d=H.useCallback(()=>{o(!0);try{window.localStorage.setItem(g2,"1")}catch{}},[]);return H.useEffect(()=>{if(!s)return;const p=v=>{v.key==="Escape"&&(v.preventDefault(),d())};return window.addEventListener("keydown",p,!0),()=>{window.removeEventListener("keydown",p,!0)}},[s,d]),i===""?null:k.jsxs("div",{ref:f,className:he("absolute inset-0 z-50 flex items-center justify-center p-4 transition-opacity duration-150 motion-reduce:transition-none",s?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!s,children:[k.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 bg-scrim"}),k.jsxs("div",{part:"intro",role:"dialog","aria-modal":"true","aria-labelledby":l,className:he("relative flex max-h-full w-[min(400px,100%)] flex-col overflow-hidden rounded-aid-field border bg-background shadow-panel transition-transform duration-200 motion-reduce:transition-none",s?"translate-y-0":"translate-y-2"),children:[k.jsx("h2",{id:l,className:"m-0 py-3.5 pl-[18px] pr-3 pb-2.5 text-lg font-semibold",children:n("intro.title")}),k.jsx("div",{className:"flex min-h-0 flex-col gap-2.5 overflow-y-auto px-[18px] pt-1",children:u.map((p,v)=>k.jsx("p",{className:"text-[13px] leading-[1.55]",children:p},`${v}-${p}`))}),k.jsx("footer",{className:"flex shrink-0 justify-end px-[18px] pb-[18px] pt-3.5",children:k.jsx(Be,{"data-autofocus":!0,size:"md",onClick:d,children:n("intro.continue")})})]})]})},Lu=e=>e?!e.available||e.status==="down"||e.status==="overloaded"?"unavailable":e.status==="idle"?"idle":e.status==="busy"||e.status==="degraded"?"busy":"unknown":"unknown",uj={idle:"text-mode-idle",busy:"text-mode-busy",unavailable:"text-mode-down",unknown:"text-muted-foreground"},cj={idle:"health.idle",busy:"health.busy",unavailable:"health.unavailable"},m2=e=>cj[e],fj={bot:mF,"book-open":ad,database:xF,"file-text":_F,globe:kF,lock:xS,"message-circle":AF,"message-square":_S,search:Su,sparkles:cm},Mm=({name:e,className:t})=>{const r=fj[e]??cm;return k.jsx(r,{className:he("size-4 shrink-0",t),"aria-hidden":"true"})},Lm=({level:e,lang:t})=>e==="unknown"?null:k.jsxs("span",{part:"mode-health","data-level":e,className:he("inline-flex shrink-0 items-center gap-1.5 text-2xs font-semibold",uj[e]),children:[k.jsx("span",{"aria-hidden":"true",className:"size-2 shrink-0 rounded-full bg-current"}),Vn(t,m2(e))]}),y2="inline-flex h-8 min-w-0 max-w-[min(360px,100%)] items-center gap-[7px] rounded-full border bg-background pl-2.5 pr-2 text-[13px] font-medium text-foreground",x2=(e,t)=>bu(e.title,t)||e.slug,b2=({modes:e,health:t,value:r,onChange:n,lang:i,label:a,variant:o="field",placement:s="top"})=>{const l=o==="pill",[u,f]=H.useState(!1),d=Math.max(0,e.findIndex(M=>M.slug===r)),[p,v]=H.useState(d),g=H.useId(),y=H.useRef(null),x=H.useRef(null),b=e[d],_=Lu(b?t[b.slug]:void 0),S=H.useRef(null);H.useEffect(()=>{u&&x.current?.focus()},[u]),H.useEffect(()=>{if(!u)return;const M=j=>{j.key==="Escape"&&(j.preventDefault(),j.stopPropagation(),f(!1),y.current?.focus())},P=j=>{S.current&&!j.composedPath().includes(S.current)&&f(!1)};return window.addEventListener("keydown",M,!0),window.addEventListener("pointerdown",P,!0),()=>{window.removeEventListener("keydown",M,!0),window.removeEventListener("pointerdown",P,!0)}},[u]);const T=M=>{f(!1),M&&y.current?.focus()},E=()=>{v(d),f(!0)},D=M=>{const P=e[M];P&&n(P.slug),T(!0)},L=M=>{switch(M.key){case"ArrowDown":M.preventDefault(),v(P=>Math.min(e.length-1,P+1));break;case"ArrowUp":M.preventDefault(),v(P=>Math.max(0,P-1));break;case"Home":M.preventDefault(),v(0);break;case"End":M.preventDefault(),v(e.length-1);break;case"Enter":case" ":M.preventDefault(),D(p);break;case"Tab":T(!1);break}},R=b?x2(b,i):"",O=_==="unknown"?"":Vn(i,m2(_));return k.jsxs("div",{ref:S,className:he(l?"min-w-0":"flex flex-col gap-1.5"),onBlur:M=>{u&&M.relatedTarget instanceof Node&&!M.currentTarget.contains(M.relatedTarget)&&f(!1)},children:[k.jsxs("button",{ref:y,part:l?"mode-select":void 0,type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":u?`${g}-list`:void 0,"aria-label":`${a}: ${R}${l&&O?`, ${O}`:""}`,onClick:()=>{u?T(!1):E()},onKeyDown:M=>{M.key==="ArrowDown"&&!u&&(M.preventDefault(),E())},className:he(l?he(y2,"transition-colors hover:bg-muted motion-reduce:transition-none"):"inline-flex h-8 w-full items-center justify-between gap-2 rounded-md border bg-background pl-2.5 pr-2 text-xs","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",u&&"border-primary shadow-[0_0_0_3px_var(--aid-c-secondary)]"),children:[l&&b?k.jsx(Mm,{name:b.icon}):null,k.jsx("span",{className:he("truncate",l&&"min-w-0"),children:R}),l?k.jsx(Lm,{level:_,lang:i}):null,k.jsx(Bs,{className:he("size-3.5 shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",(l?s==="top"!==u:u)&&"rotate-180"),"aria-hidden":"true"})]}),u?k.jsxs("ul",{ref:x,id:`${g}-list`,part:l?"mode-list":void 0,role:"listbox",tabIndex:-1,"aria-label":a,"aria-activedescendant":`${g}-${p}`,onKeyDown:L,className:he("flex max-h-56 flex-col overflow-y-auto rounded-md border bg-background p-1 shadow-pop focus-visible:outline-none",l&&he("absolute left-0 z-20 w-[340px] max-w-full duration-150 animate-in fade-in motion-reduce:animate-none",s==="top"?"bottom-[calc(100%+6px)]":"top-[calc(100%+6px)]")),children:[l?k.jsx("li",{role:"presentation",className:"px-2.5 pb-1 pt-1.5 text-2xs text-muted-foreground",children:a}):null,e.map((M,P)=>{const j=Lu(t[M.slug]),B=bu(M.description,i);return k.jsxs("li",{id:`${g}-${P}`,part:l?"mode-option":void 0,role:"option","aria-selected":P===d,onMouseDown:$=>{$.preventDefault()},onMouseEnter:()=>{v(P)},onClick:()=>{D(P)},className:he("flex cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2",P===p&&"bg-accent",P===d&&"bg-secondary"),children:[k.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-muted",children:k.jsx(Mm,{name:M.icon})}),k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[k.jsx("span",{className:"truncate text-sm font-medium leading-[1.35]",children:x2(M,i)}),B?k.jsx("span",{className:"line-clamp-2 text-2xs leading-[1.35] text-muted-foreground",children:B}):null,k.jsx(Lm,{level:j,lang:i})]}),k.jsx(da,{className:he("mt-1 size-4 shrink-0 text-primary",P!==d&&"invisible"),"aria-hidden":"true"})]},M.slug)})]}):null]})},Im=(e,t)=>e===(t>=0?t:0)?0:-1,dj={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"start",End:"end"},Pm=(e,t=!1)=>{const r=dj[e.key];if(r===void 0)return;const n=Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not(:disabled)')),i=e.currentTarget.getRootNode(),a=n.findIndex(s=>s===i.activeElement);if(n.length===0)return;e.preventDefault();const o=r==="start"?0:r==="end"?n.length-1:(Math.max(a,0)+r+n.length)%n.length;n[o]?.focus(),t&&n[o]?.click()},hj=({label:e,className:t,children:r})=>k.jsx("div",{role:"radiogroup","aria-label":e,className:t,onKeyDown:n=>{Pm(n,!0)},children:r}),pj=()=>typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),vj=["search","newChat","sidebar","close"],gj=e=>{const t=e?"⌘":"Ctrl",r=e?"⇧":"Shift",n=i=>e?[r,t,i]:[t,r,i];return{search:[t,"K"],newChat:n("O"),sidebar:n("S"),close:["Esc"]}},mj={kk:"Қазақша",ru:"Русский",en:"English"},cd=({title:e,hint:t,children:r})=>k.jsxs("section",{className:"flex flex-col gap-2",children:[k.jsx("h3",{className:"text-xs font-semibold text-muted-foreground",children:e}),r,t?k.jsx("p",{className:"text-xs text-muted-foreground",children:t}):null]}),w2=({value:e,options:t,onChange:r,label:n})=>{const i=t.findIndex(a=>a.value===e);return k.jsx(hj,{label:n,className:"grid grid-cols-3 gap-2",children:t.map((a,o)=>{const s=a.value===e;return k.jsxs("button",{type:"button",role:"radio","aria-checked":s,tabIndex:Im(o,i),lang:a.lang,onClick:()=>{r(a.value)},className:he("flex min-w-0 items-center gap-2.5 rounded-md border px-3 py-2.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",s?"border-primary bg-secondary":"bg-background hover:border-primary/50"),children:[k.jsx("span",{"aria-hidden":"true",className:he("relative size-4 shrink-0 rounded-full border-[1.5px] bg-background",s?"border-primary":"border-muted-foreground"),children:s?k.jsx("span",{className:"absolute inset-[3px] rounded-full bg-primary"}):null}),k.jsx("span",{className:"truncate",children:a.label})]},a.value)})})},yj=({children:e})=>k.jsx("kbd",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded border bg-background px-[5px] font-sans text-[11px] font-medium leading-none text-muted-foreground",children:e}),xj=({open:e,onClose:t})=>{const{state:r,lang:n,t:i,selectMode:a}=ye(),o=Kg(),s=H.useRef(null);fo(s,!e),id(s,e),H.useEffect(()=>{if(!e)return;const p=v=>{v.key==="Escape"&&(s.current?.querySelector('[aria-haspopup="listbox"][aria-expanded="true"]')||(v.preventDefault(),t()))};return window.addEventListener("keydown",p,!0),()=>{window.removeEventListener("keydown",p,!0)}},[e,t]);const l=r.config?.modes??[],u=[{value:"light",label:i("settings.themeLight")},{value:"dark",label:i("settings.themeDark")},{value:"auto",label:i("settings.themeAuto")}],f=gj(pj()),d={search:i("shortcut.search"),newChat:i("shortcut.newChat"),sidebar:i("shortcut.sidebar"),close:i("shortcut.close")};return k.jsxs("div",{ref:s,className:he("absolute inset-0 z-40 flex items-start justify-center p-6 transition-opacity duration-150 motion-reduce:transition-none",e?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!e,children:[k.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"absolute inset-0 bg-scrim",onClick:t}),k.jsxs("div",{part:"settings",role:"dialog","aria-modal":"true","aria-label":i("settings"),className:he("relative flex max-h-full w-full max-w-[520px] flex-col overflow-hidden rounded-aid-field border bg-background shadow-panel transition-transform duration-200 motion-reduce:transition-none",e?"translate-y-0":"translate-y-2"),children:[k.jsxs("header",{className:"flex shrink-0 items-center justify-between pb-2.5 pl-[18px] pr-3 pt-3.5",children:[k.jsx("h2",{className:"text-lg font-semibold",children:i("settings")}),k.jsx(Be,{"data-autofocus":!0,variant:"ghost",size:"icon","aria-label":i("close"),onClick:t,children:k.jsx(Cu,{"aria-hidden":"true"})})]}),k.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-[18px] pb-[18px] pt-1",children:[k.jsx(cd,{title:i("settings.language"),children:k.jsx(w2,{label:i("settings.language"),value:n,options:Xg.map(p=>({value:p,label:mj[p],lang:p})),onChange:p=>{o.update({lang:p})}})}),k.jsx(cd,{title:i("settings.theme"),children:k.jsx(w2,{label:i("settings.theme"),value:o.scheme,options:u,onChange:p=>{o.update({scheme:p})}})}),l.length>0?k.jsx(cd,{title:i("settings.model"),hint:i("settings.modelHint"),children:k.jsx(b2,{modes:l,health:r.health,value:r.mode,onChange:a,lang:n,label:i("settings.model")})}):null,k.jsx(cd,{title:i("settings.shortcuts"),children:k.jsx("div",{className:"flex flex-col",children:vj.map(p=>k.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[k.jsx("span",{children:d[p]}),k.jsx("span",{className:"flex gap-[3px]",children:f[p].map(v=>k.jsx(yj,{children:v},v))})]},p))})})]})]})]})},bj={muted:"rounded-[10px] border bg-muted px-3 py-2",blocked:"rounded-[10px] border border-processing/25 bg-processing-background px-3 py-2",overloaded:"rounded-[10px] border border-warning/40 bg-warning-background px-3 py-2",hint:"px-1 pb-2 text-warn-text"},fd=({tone:e,icon:t,children:r,role:n="status",part:i,state:a})=>k.jsxs("div",{part:i,role:n,"data-tone":e,"data-state":a,className:he("mb-2 flex items-center gap-2.5 text-xs leading-snug",bj[e]),children:[k.jsx("span",{className:"flex shrink-0",children:t}),k.jsx("span",{className:"min-w-0 flex-1",children:r})]}),_2=({children:e,onDismiss:t,dismissLabel:r,part:n})=>k.jsxs("div",{part:n,role:"alert",className:"mb-2 flex items-center gap-2.5 rounded-[10px] border border-error/30 bg-error-background py-2 pl-3 pr-2 text-xs leading-snug text-[hsl(var(--foreground))]",children:[k.jsx(po,{className:"shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:e}),k.jsx(Be,{variant:"ghost",size:"xs",onClick:t,children:r})]}),wj=e=>new Intl.DateTimeFormat(e,{hour:"2-digit",minute:"2-digit"}),_j=()=>{const{state:e,lang:t,t:r}=ye(),{remaining:n,daily:i,blocked:a,resetAt:o,overloaded:s}=e.limit;if(s&&e.config)return k.jsx(fd,{tone:"overloaded",part:"limit-banner",state:"overloaded",icon:k.jsx(sd,{"aria-hidden":"true"}),children:r("overloaded")});if(a){const l=o?new Date(o):null,u=l&&!Number.isNaN(l.getTime())?r("limit.until",{time:wj(t).format(l)}):r("limit.exhausted");return k.jsx(fd,{tone:"blocked",part:"limit-banner",state:"blocked",icon:k.jsx(sm,{"aria-hidden":"true"}),children:u})}return n===null||i===null||n>3?null:k.jsx(fd,{tone:"muted",part:"limit-banner",state:"low",icon:k.jsx(yS,{"aria-hidden":"true"}),children:r("limit.remaining",{count:n,limit:i})})},kj=()=>{const{state:e,lang:t,t:r,dismissNotice:n}=ye(),{notice:i}=e;if(!i)return null;const a=i.kind==="error"?rm(t,i.reason):r(i.key);return k.jsx(_2,{part:"notice",onDismiss:n,dismissLabel:r("dismiss"),children:a})},Nm=({value:e,onChange:t,onSubmit:r,maxHeight:n=yB,className:i,onKeyDown:a,...o})=>{const s=H.useRef(null),l=H.useCallback(()=>{const f=s.current;f&&(f.style.height="auto",f.style.height=`${Math.min(f.scrollHeight,n)}px`,f.style.overflowY=f.scrollHeight>n?"auto":"hidden")},[n]);H.useLayoutEffect(l,[e,l]),H.useEffect(()=>{const f=s.current;if(!f||typeof ResizeObserver>"u")return;let d=f.clientWidth;const p=new ResizeObserver(()=>{f.clientWidth!==d&&(d=f.clientWidth,l())});return p.observe(f),()=>{p.disconnect()}},[l]);const u=f=>{a?.(f),!(f.defaultPrevented||!r)&&f.key==="Enter"&&!f.shiftKey&&!f.nativeEvent.isComposing&&(f.preventDefault(),r())};return k.jsx("textarea",{ref:s,rows:1,value:e,onChange:f=>{t(f.target.value)},onKeyDown:u,className:he("block w-full resize-none bg-transparent text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-60",i),...o})},Sj=({file:e,onRemove:t})=>{const{lang:r,t:n}=ye();return k.jsxs("div",{part:"composer-file",className:"flex w-fit max-w-full items-center gap-2.5 self-start rounded-xl border bg-muted p-1.5",children:[k.jsx(Sm,{ext:km(e.name)}),k.jsxs("span",{className:"flex min-w-0 flex-col",children:[k.jsx("span",{className:"max-w-[420px] truncate text-[13px] font-medium leading-tight max-sm:max-w-[190px]",title:e.name,children:e.name}),k.jsx("span",{className:"text-2xs leading-tight text-muted-foreground",children:Cm(e.size,r)})]}),k.jsx(Be,{variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":n("removeFile"),onClick:t,children:k.jsx(Cu,{"aria-hidden":"true"})})]})},Cj=({children:e,text:t,id:r})=>k.jsxs("span",{className:"group/attach inline-flex",children:[e,k.jsx("span",{id:r,role:"tooltip",className:"pointer-events-none absolute bottom-[3.2rem] left-4 z-10 hidden w-max max-w-[calc(100%-2rem)] rounded-md bg-foreground px-2 py-1 text-2xs font-medium leading-snug text-background shadow-pop group-focus-within/attach:block group-hover/attach:block",children:t})]}),Tj=({message:e,onDismiss:t})=>{const{t:r}=ye();return e===null?null:k.jsx(_2,{part:"notice",dismissLabel:r("dismiss"),onDismiss:t,children:e})},Aj=.9,Ej=(e,t)=>e>t?"over":e===t?"limit":e>=t*Aj?"near":"hidden",k2=({count:e,max:t,id:r,part:n,className:i})=>{const{t:a}=ye(),o=Ej(e,t);return k.jsxs(k.Fragment,{children:[k.jsx("span",{id:r,part:n,className:he("shrink-0 whitespace-nowrap px-1 text-2xs tabular-nums text-muted-foreground",o==="hidden"&&"hidden",o==="limit"&&"font-semibold text-warn-text",o==="over"&&"font-semibold text-destructive",i),children:a("counter",{count:e,max:t})}),k.jsx("span",{"aria-live":"polite",className:"sr-only",children:o==="limit"?a("counterLimit"):o==="over"?a("counterOver"):""})]})},Dj=()=>{const{state:e,t}=ye(),{config:r}=e;if(!r)return null;const n=r.modes.find(a=>a.slug===e.mode),i=r.modes.length===0?t("modes.none"):n&&Lu(e.health[n.slug])==="unavailable"?t("modeUnavailable"):null;return i===null?null:k.jsx(fd,{tone:"hint",part:"composer-hint",icon:k.jsx(sd,{"aria-hidden":"true"}),children:i})},Mj=()=>ye().t("placeholder"),Lj=({placement:e="top"})=>{const{state:t,lang:r,t:n,selectMode:i}=ye(),a=t.config?.modes??[],o=a.find(s=>s.slug===t.mode);if(!o)return null;if(a.length<2){const s=Lu(t.health[o.slug]),l=bu(o.title,r)||o.slug,u=s==="unknown"?"":n(`health.${s}`),f=`${n("modeLabel")}: ${l}${u?`, ${u}`:""}`;return k.jsxs("div",{part:"mode-select",role:"group","aria-label":f,className:y2,children:[k.jsx(Mm,{name:o.icon}),k.jsx("span",{className:"min-w-0 truncate",children:l}),k.jsx(Lm,{level:s,lang:r})]})}return k.jsx(b2,{variant:"pill",placement:e,modes:a,health:t.health,value:t.mode,onChange:i,lang:r,label:n("modeLabel")})},S2="{name}",Ij=(e,t)=>{const[r="",n=""]=e.split(S2);return k.jsxs(k.Fragment,{children:[r,t,n]})},C2=H.forwardRef(({onDraftChange:e},t)=>{const{state:r,lang:n,path:i,t:a,send:o,stop:s}=ye(),l=Mj(),[u,f]=H.useState(""),d=H.useRef(null),p=H.useId(),v=H.useRef(!1),g=H.useId();H.useImperativeHandle(t,()=>({setText:ee=>{f(ee),setTimeout(()=>d.current?.querySelector("textarea")?.focus(),0)}}));const y=u.trim()!=="";H.useEffect(()=>{e?.(y)},[y,e]);const[x,b]=H.useState(null),[_,S]=H.useState(null),T=H.useRef(null),{config:E,turn:D,limit:L}=r,R=E?.modes.find(ee=>ee.slug===r.mode),O=E?.max_query_chars??Uk,M=R?Lu(r.health[R.slug])==="unavailable":!1,P=!!(E?.site.allow_files&&R?.allow_files),j=D!==null,B=D?.stopping===!0,$=!E||L.blocked||r.loadingThread!==null,K=u.trim(),Z=u.length>O,re=!$&&!j&&!M&&!!R&&K.length>0&&!Z;H.useEffect(()=>{if(j)return;const ee=d.current?.getRootNode(),ae=ee instanceof ShadowRoot||ee instanceof Document?ee.activeElement:null,ie=ae===null||ae===document.body;(v.current||ie)&&d.current?.querySelector("textarea")?.focus({preventScroll:!0}),v.current=!1},[j]);const Y=()=>{if(!re||!R)return;const ee=K,ae=x,ie=nF(i,ee,new Date);f(""),b(null),o({query:ee,mode:R.slug,...ae?{file:ae}:{},...ie?{clarification:ie}:{}}).then(_e=>{_e==="rejected"&&(f(be=>be||ee),b(be=>be??ae))})},G=ee=>{if(S(null),!(!ee||!R)){if(!zS.split(",").includes(`.${km(ee.name)}`)){S(a("fileType",{name:ee.name}));return}if(ee.size>R.max_file_mb*1024*1024){S(a("fileTooLarge",{name:ee.name,size:R.max_file_mb}));return}b(ee)}},I=E?.answer_source,z=I?.[n]??I?.ru??Object.values(I??{})[0],W=go(z?.url),F=W?k.jsxs("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-primary-text hover:underline",children:[z?.name,k.jsx(um,{className:"size-3","aria-hidden":"true"})]}):z?.name;return k.jsxs("div",{part:"composer",className:"flex w-full shrink-0 flex-col",children:[k.jsx(Dj,{}),k.jsx(Tj,{message:_,onDismiss:()=>{S(null)}}),k.jsxs("div",{ref:d,className:he("relative flex flex-col gap-2.5 rounded-aid-field border border-input bg-background py-3 pl-4 pr-2.5 shadow-sm transition-colors motion-reduce:transition-none","focus-within:border-primary focus-within:ring-[3px] focus-within:ring-secondary",Z&&"border-destructive focus-within:border-destructive",$&&"bg-muted"),children:[x?k.jsx(Sj,{file:x,onRemove:()=>{b(null)}}):null,k.jsx(Nm,{part:"input","data-autofocus":!0,value:u,onChange:f,onSubmit:Y,disabled:$,placeholder:l,"aria-label":a("inputLabel"),"aria-invalid":Z||void 0,"aria-describedby":p,className:"block min-h-6 w-full pr-1.5 text-lg leading-6 disabled:text-muted-foreground disabled:opacity-100"}),k.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[k.jsx(Lj,{placement:"top"}),P?k.jsxs(k.Fragment,{children:[k.jsx(Cj,{id:g,text:x?a("attachOne"):a("attachHint",{size:R?.max_file_mb??0}),children:k.jsx(Be,{part:"attach",variant:"ghost",size:"icon",className:"size-8 rounded-full text-muted-foreground","aria-label":a(x?"attachOne":"attach"),"aria-describedby":g,disabled:$||j||x!==null,onClick:()=>T.current?.click(),children:k.jsx(MF,{"aria-hidden":"true"})})}),k.jsx("input",{ref:T,type:"file",hidden:!0,accept:zS,onChange:ee=>{G(ee.target.files?.[0]),ee.target.value=""}})]}):null,k.jsx("span",{className:"flex-1"}),k.jsx(k2,{id:p,part:"counter",count:u.length,max:O}),j?k.jsx(Be,{part:"stop",size:"icon",className:"size-9 rounded-full aria-disabled:pointer-events-none aria-disabled:opacity-50","aria-label":a(B?"agent.stopping":"stop"),title:a(B?"agent.stopping":"stop"),"aria-disabled":B||void 0,onFocus:()=>{v.current=!0},onBlur:ee=>{ee.relatedTarget&&(v.current=!1)},onClick:()=>{B||s()},children:k.jsx(AS,{className:"size-3.5 fill-current","aria-hidden":"true"})}):k.jsx(Be,{part:"send",size:"icon",className:"size-9 rounded-full","aria-label":a("send"),title:a("send"),disabled:!re,onClick:Y,children:k.jsx(pS,{"aria-hidden":"true"})})]})]}),k.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-3.5 gap-y-1 pt-2 text-center text-2xs leading-snug text-muted-foreground",children:[k.jsx("p",{part:"disclaimer",className:"text-2xs",children:a("disclaimer")}),z?.name?k.jsx("p",{part:"source",className:"text-2xs",children:Ij(a("source",{name:S2}),F)}):null]})]})});C2.displayName="Composer";const Pj=({composerRef:e,onDraftChange:t})=>{const{state:r}=ye();return k.jsxs("div",{className:"mx-auto w-full max-w-[844px] shrink-0 px-3 pb-2.5",children:[k.jsx(_j,{}),k.jsx(kj,{}),r.config&&!r.configError?k.jsx(C2,{ref:e,onDraftChange:t}):null]})},T2={receipt:IF,landmark:SF,map:CF,"trending-up":FF,scale:PF,users:BF,"file-chart":bF,"alert-triangle":sd},Nj=({name:e})=>{const t=(Object.hasOwn(T2,e)?T2[e]:void 0)??cm;return k.jsx(t,{className:"size-4 shrink-0 text-primary","aria-hidden":"true"})},Rj=4,Oj=6,zj=10,A2=(e,t)=>e?.[t]??e?.ru??Object.values(e??{})[0],Rm=({children:e,id:t})=>k.jsx("h2",{id:t,className:"m-0 px-0.5 text-2xs font-semibold text-muted-foreground",children:e}),Om=({example:e,onPick:t,sub:r})=>k.jsx("li",{className:"min-w-0",children:k.jsxs("button",{part:"example",type:"button",title:e.title,onClick:()=>{t(e.prompt)},className:he("flex w-full items-center gap-2.5 rounded-lg border bg-background px-3 py-2 text-left leading-snug text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",r?"min-h-9 border-dashed text-[13px]":"min-h-10 text-sm"),children:[k.jsx("span",{className:"min-w-0 flex-1",children:e.prompt}),k.jsx(vF,{className:"text-muted-foreground","aria-hidden":"true"})]})}),zm=e=>`${e.title}-${e.prompt}`,Fj=({onPick:e})=>{const{state:t,lang:r,t:n}=ye(),i=H.useId(),[a,o]=H.useState(null),s=A2(t.config?.prompt_examples,r)??[],l=(A2(t.config?.prompt_categories,r)??[]).filter(d=>s.some(p=>p.category===d.key));if(s.length===0)return null;if(l.length===0)return k.jsxs("section",{className:"flex flex-col gap-1.5",children:[k.jsx(Rm,{children:n("examples")}),k.jsx("ul",{"aria-label":n("examples"),className:"m-0 flex w-full list-none flex-col gap-1.5 p-0",children:s.slice(0,Rj).map(d=>k.jsx(Om,{example:d,onPick:e,sub:!1},zm(d)))})]});const u=l.find(d=>d.key===a),f=u?s.filter(d=>d.category===u.key).slice(0,zj):[];return k.jsxs("div",{className:"flex flex-col gap-5",children:[k.jsxs("section",{className:"flex flex-col gap-1.5",children:[k.jsx(Rm,{id:i,children:n("examples.whatCanDo")}),k.jsx("div",{role:"group","aria-labelledby":i,className:"flex flex-col gap-1.5",children:l.map(d=>{const p=d.key===u?.key,v=p?Bs:od;return k.jsxs(H.Fragment,{children:[k.jsxs("button",{part:"category",type:"button","aria-expanded":p,onClick:()=>{o(p?null:d.key)},className:he("flex min-h-11 w-full items-center gap-2.5 rounded-lg border bg-background px-2.5 py-1.5 text-left text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",p&&"border-primary"),children:[k.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-lg bg-secondary",children:k.jsx(Nj,{name:d.icon})}),k.jsx("span",{className:"min-w-0 flex-1 truncate",children:d.title}),k.jsx(v,{className:"text-muted-foreground","aria-hidden":"true"})]}),p&&f.length>0?k.jsx("ul",{"aria-label":d.title,className:"m-0 flex w-full list-none flex-col gap-1.5 pb-1.5 pl-[18px] pt-0.5",children:f.map(g=>k.jsx(Om,{example:g,onPick:e,sub:!0},zm(g)))}):null]},d.key)})})]}),u?null:k.jsxs("section",{className:"flex flex-col gap-1.5",children:[k.jsx(Rm,{children:n("examples")}),k.jsx("ul",{"aria-label":n("examples"),className:"m-0 flex w-full list-none flex-col gap-1.5 p-0",children:s.slice(0,Oj).map(d=>k.jsx(Om,{example:d,onPick:e,sub:!1},zm(d)))})]})]})},Bj=({listening:e,wide:t,onPick:r})=>{const{state:n,lang:i,t:a}=ye(),o=bu(n.config?.site.welcome,i),s=o?o.split(`
|
|
18
|
-
`).filter(l=>l.trim()!==""):[];return k.jsxs("div",{part:"empty",className:he("mx-auto flex w-full max-w-[640px] flex-col gap-5 px-4 pb-3",t?"pt-14":"pt-7"),children:[k.jsxs("div",{className:"flex flex-col items-center gap-2.5 text-center",children:[k.jsx("div",{part:"avatar",children:k.jsx(rd,{size:56,mood:e?"listen":"calm"})}),s.length>0?k.jsx("div",{part:"welcome",className:"flex max-w-[340px] flex-col gap-1 text-[15px] leading-normal",children:s.map((l,u)=>k.jsx("p",{className:he(u===0&&"text-xl font-semibold"),children:l},`${u}-${l}`))}):k.jsx("h2",{className:"m-0 text-2xl font-semibold tracking-tight",children:a("greeting")})]}),k.jsx(Fj,{onPick:r})]})},E2=()=>{const{t:e}=ye();return t=>{const r=`steps.${t.node}`;return e(bz(r)?r:"steps.unknown")}},D2=({step:e,position:t})=>{const{t:r}=ye(),n=E2();return k.jsxs(k.Fragment,{children:[n(e),t!=null&&e.total!=null?k.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",r("steps.counter",{done:t,total:e.total})]}):null,e.attempt>1?k.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",r("agent.attempt",{count:e.attempt})]}):null]})},M2=()=>k.jsx(vo,{className:"size-3 shrink-0 animate-spin text-primary motion-reduce:animate-none","aria-hidden":"true","data-testid":"step-spinner"}),jj=({steps:e,status:t,stopping:r})=>{const{t:n}=ye(),i=e.find(a=>a.status==="running");return t==="streaming"?k.jsxs(k.Fragment,{children:[k.jsx(M2,{}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:r?n("agent.stopping"):i?k.jsx(D2,{step:i,position:e.indexOf(i)+1}):n("agent.thinking")})]}):t==="stopped"?k.jsxs(k.Fragment,{children:[k.jsx(AS,{className:"size-3.5 shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.stopped")})]}):t==="error"?k.jsxs(k.Fragment,{children:[k.jsx(gS,{className:"size-3.5 shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.interrupted")})]}):k.jsxs(k.Fragment,{children:[k.jsx(da,{className:"size-3.5 shrink-0 text-mode-idle","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.done")})]})},Hj=({steps:e,status:t,stopping:r})=>{const{t:n}=ye(),i=E2();if(t==="streaming"){if(r)return n("agent.stopping");const a=e.find(o=>o.status==="running");return a?i(a):n("agent.thinking")}return n(t==="stopped"?"agent.stopped":t==="error"?"agent.interrupted":"agent.done")},L2="inline-flex min-h-[30px] max-w-full items-center gap-2 self-start rounded-full border bg-background py-1 pl-2 pr-2.5 text-left text-[13px] text-muted-foreground",Vj=H.memo(function(t){const{t:r}=ye(),[n,i]=H.useState(!1),{steps:a,status:o}=t,s=o==="streaming",l=Hj(t),u=k.jsx(k.Fragment,{children:k.jsx(jj,{...t})});return k.jsxs("div",{part:"steps",className:"flex flex-col gap-2 text-[13px] text-muted-foreground",children:[a.length>0?k.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${r(n?"agent.hideSteps":"agent.showSteps")}: ${l}`,onClick:()=>{i(!n)},className:he(L2,"hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",s&&"border-primary-35"),children:[u,n?k.jsx(Bs,{className:"size-3.5 shrink-0 rotate-180","aria-hidden":"true"}):k.jsx(Bs,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}):k.jsx("div",{className:he(L2,s&&"border-primary-35"),role:"status",children:u}),n&&a.length>0?k.jsx("ol",{"aria-label":r("agent.steps"),className:"m-0 flex list-none flex-col self-stretch rounded-xl border bg-background px-3.5 py-1.5",children:a.map((f,d)=>{const p=f.status==="running",v=p&&!s;return k.jsxs("li",{className:"flex min-h-[34px] items-center gap-2.5 border-b border-dashed last:border-b-0",children:[k.jsx("span",{className:"flex w-[18px] shrink-0 justify-center",children:p&&s?k.jsx(M2,{}):v?k.jsx(gS,{className:"size-3.5","aria-hidden":"true"}):k.jsx(da,{className:"size-3.5 text-mode-idle","aria-hidden":"true"})}),k.jsx("span",{className:he("min-w-0 flex-1 truncate",v?"text-muted-foreground":"text-foreground"),children:k.jsx(D2,{step:f})}),v?k.jsx("span",{className:"shrink-0 whitespace-nowrap",children:r("agent.unfinished")}):null]},f.id??`${f.node}-${d}`)})}):null]})}),Uj=(e,t)=>{const r=(e.split(/[?#]/)[0]??"").split("/").filter(Boolean).pop();if(!r||/^[0-9a-f-]{36}$/i.test(r))return t;try{return decodeURIComponent(r)}catch{return r}},$j=e=>{try{return new URL(e,window.location.href).host}catch{return null}},I2=({url:e,name:t,className:r,children:n})=>{const{api:i}=ye(),[a,o]=H.useState(!1);if(!(xu(e,i.apiUrl)!==null)){const l=go(e);return l?k.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:r,children:n}):k.jsx("span",{className:r,children:n})}return k.jsx("button",{type:"button",part:"attachment",className:he(r,a&&"opacity-70"),disabled:a,onClick:()=>{o(!0),i.attachment(e).then(l=>{_B(l,t)}).catch(()=>{}).finally(()=>{o(!1)})},children:n})},P2=({attachment:e})=>{const{api:t,lang:r,t:n}=ye(),i=FS(e.name||Uj(e.url,"file")),a=e.url&&xu(e.url,t.apiUrl)===null?$j(e.url):null,o="inline-flex max-w-full items-center gap-2.5 rounded-xl border bg-muted p-1.5 text-left text-foreground",s=k.jsxs(k.Fragment,{children:[k.jsx(Sm,{ext:km(i)}),k.jsxs("span",{className:"flex min-w-0 flex-col",children:[k.jsx("span",{className:"truncate text-[13px] font-medium leading-tight",children:i}),k.jsxs("span",{className:"flex items-center gap-1.5 text-2xs leading-tight text-muted-foreground",children:[a??(e.size?Cm(e.size,r):null),e.url?null:k.jsxs(k.Fragment,{children:[e.size?k.jsx("span",{"aria-hidden":"true",children:"·"}):null,k.jsx("span",{children:n("attachment.sending")}),k.jsx(vo,{className:"size-3 animate-spin motion-reduce:animate-none","aria-hidden":"true"})]})]})]}),e.url&&a?k.jsx(um,{className:"mr-1 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}):e.url?k.jsx(mS,{className:"mr-1 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}):null]});return e.url?k.jsxs(I2,{url:e.url,name:i,className:he(o,"transition-colors hover:bg-accent"),children:[a?null:k.jsxs("span",{className:"sr-only",children:[n("download"),": "]}),s]}):k.jsx("span",{className:o,children:s})},Gj=({url:e,alt:t})=>{const{api:r}=ye(),[n,i]=H.useState(null),[a,o]=H.useState(!1);return H.useEffect(()=>{let s=null,l=!1;return r.attachment(e).then(u=>{l?URL.revokeObjectURL(u):(s=u,i(u))},()=>{l||o(!0)}),()=>{l=!0,s&&URL.revokeObjectURL(s)}},[r,e]),a?k.jsx("span",{className:"text-muted-foreground",children:t||e}):n?k.jsx("img",{src:n,alt:t,className:"max-w-full rounded-lg"}):k.jsx(vo,{className:"size-4 animate-spin text-muted-foreground","aria-label":t})},Wj=8,Fm=({children:e})=>k.jsx("div",{className:"text-2xs text-muted-foreground",children:e}),Yj=({block:e,onAsk:t})=>{const{lang:r,t:n}=ye(),i=Array.isArray(e.sections)?e.sections:[],o=(Array.isArray(e.indicators)?e.indicators:[]).slice(0,Wj),s=Math.max(0,e.total-o.length),l=Array.isArray(e.examples)?e.examples.filter(u=>typeof u=="string"&&u):[];return k.jsxs("section",{part:"catalog",className:"flex min-w-0 flex-col rounded-xl border bg-card",children:[e.topic?k.jsxs("h3",{className:"m-0 flex items-center gap-2 border-b px-3.5 py-2.5 text-sm font-semibold",children:[k.jsx(ad,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),n("blocks.catalogTitle",{topic:e.topic})]}):null,k.jsxs("div",{className:"flex flex-col gap-2.5 px-3.5 py-3",children:[i.length>0?k.jsxs("div",{children:[k.jsx(Fm,{children:n("blocks.catalogSections")}),k.jsx("ul",{className:"m-0 list-none p-0",children:i.map(u=>k.jsxs("li",{className:"flex items-center gap-2 border-b py-[7px] text-[13px] last:border-b-0",children:[k.jsx(od,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:u.path.join(" › ")}),k.jsx("span",{className:"whitespace-nowrap tabular-nums text-muted-foreground",children:Hn(u.count,r)})]},u.id))})]}):null,o.length>0?k.jsxs("div",{children:[k.jsx(Fm,{children:n("blocks.catalogIndicators")}),k.jsx("ul",{className:"m-0 list-none p-0",children:o.map(u=>k.jsxs("li",{className:"flex flex-col border-b py-1.5 last:border-b-0",children:[k.jsx("span",{className:"text-[13px] font-medium leading-snug",children:u.name}),u.unit||u.years?k.jsx("span",{className:"text-2xs text-muted-foreground",children:[am(u.unit),am(u.years)].filter(Boolean).join(" · ")}):null]},u.entity_id))}),s>0?k.jsx("p",{className:"m-0 pt-1 text-[13px] text-muted-foreground",children:n("blocks.catalogMore",{count:Hn(s,r)})}):null]}):null,l.length>0?k.jsxs("div",{className:"flex flex-col gap-1.5",children:[k.jsx(Fm,{children:n("blocks.catalogExamples")}),l.map(u=>k.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-[10px] border bg-background px-2.5 py-2 text-left text-[13px] leading-snug transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",onClick:()=>{t(u)},children:[k.jsx(TF,{className:"shrink-0 text-primary","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:u})]},u)),k.jsx("div",{className:"text-2xs text-muted-foreground",children:n("blocks.catalogSendHint")})]}):null]})]})},dd=({rootRef:e,question:t,tone:r,children:n})=>{const{t:i}=ye();return k.jsxs("section",{part:"clarification",ref:e,role:"group","aria-label":i("blocks.clarification"),"data-state":r,className:he("overflow-hidden rounded-[14px] border",r==="open"&&"border-primary-30 bg-card",r==="done"&&"bg-card",r==="expired"&&"bg-muted"),children:[k.jsx("div",{className:"flex items-center gap-2 px-3.5 pb-1 pt-3",children:k.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground",children:[k.jsx(wS,{className:"size-3","aria-hidden":"true"}),i("blocks.clarification")]})}),k.jsx("p",{className:"m-0 px-3.5 pb-2.5 text-[15px] font-medium leading-snug",children:t}),n]})},N2=({children:e})=>k.jsx("kbd",{className:"inline-flex h-4 min-w-4 items-center justify-center rounded border border-current/40 px-1 font-sans text-2xs leading-none opacity-80",children:e}),Bm=({children:e})=>k.jsx("div",{className:"flex items-center gap-2 border-t px-3.5 py-2.5 text-[13px] text-muted-foreground",children:e}),Xj=2**31-1,qj=(e,t)=>{const[r,n]=H.useState(()=>new Date);return H.useEffect(()=>{if(!t)return;const i=Date.parse(e)-Date.now();if(!(i>0))return;const a=window.setTimeout(()=>{n(new Date)},Math.min(i+50,Xj));return()=>{window.clearTimeout(a)}},[e,t]),r},Kj=({block:e,isLastInBranch:t,question:r,reply:n,disabled:i,onAsk:a})=>{const{t:o}=ye(),s=H.useRef(null),l=qj(e.expires_at,t),u=Ek(e,{isLastInBranch:t,now:l}),[f,d]=H.useState(""),p=H.useRef(!1),[v,g]=H.useState(!1),y=e.options,x=i||v,b=(B,$=B.label)=>{if(p.current||i)return;p.current=!0,g(!0);const K=a($,{clarification_id:e.id,slot:e.slot,value:B.value,free_text:null});Promise.resolve(K).then(Z=>{Z===!1&&(p.current=!1,g(!1))})},_=H.useRef(b);H.useEffect(()=>{_.current=b});const S=e.type==="plan_confirm",T=y.find(B=>B.value===e.default)??y[0],E=y.find(B=>B!==T),D=S?[...T?[{option:T,text:o("blocks.continue")}]:[],...E?[{option:E,text:o("blocks.cancelPlan")}]:[]]:y.slice(0,Jz).map(B=>({option:B,text:B.label})),L=H.useRef(D);H.useEffect(()=>{L.current=D});const R=u==="open"&&!x,O=D.length;H.useEffect(()=>{if(!R||O===0)return;const B=s.current?.getRootNode();if(!B)return;const $=K=>{const Z=K;if(Z.defaultPrevented||Z.ctrlKey||Z.metaKey||Z.altKey||Z.repeat||iF(Z.composedPath()[0]))return;const re=Number(Z.key),Y=Number.isInteger(re)&&re>=1?L.current[re-1]:void 0;Y&&(Z.preventDefault(),_.current(Y.option,Y.text))};return B.addEventListener("keydown",$),()=>{B.removeEventListener("keydown",$)}},[R,O]);const M=u==="answered"&&r!==""&&n===r;if(u==="answered"&&!M)return k.jsx(dd,{rootRef:s,question:e.question,tone:"done",children:n?k.jsxs(Bm,{children:[k.jsx(da,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.chosen",{label:n})})]}):null});if(u==="expired"||M)return k.jsx(dd,{rootRef:s,question:e.question,tone:"expired",children:k.jsxs(Bm,{children:[k.jsx(sm,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.expired")}),r&&!M?k.jsxs(Be,{variant:"input",size:"sm",className:"gap-1.5",disabled:i,onClick:()=>{a(r)},children:[k.jsx(TS,{"aria-hidden":"true"}),o("blocks.askAgain")]}):null]})});if(S){const[B,$]=D;return k.jsx(dd,{rootRef:s,question:e.question,tone:"open",children:k.jsxs("div",{className:"flex flex-wrap gap-2 px-2.5 pb-2.5",children:[B?k.jsxs(Be,{size:"sm",disabled:x,onClick:()=>{b(B.option,B.text)},children:[k.jsx(N2,{children:"1"}),B.text]}):null,$?k.jsxs(Be,{variant:"input",size:"sm",disabled:x,onClick:()=>{b($.option,$.text)},children:[k.jsx(N2,{children:"2"}),$.text]}):null]})})}const P=y.length>=Qz,j=P?a4(y,f):y;return k.jsxs(dd,{rootRef:s,question:e.question,tone:"open",children:[k.jsxs("div",{className:"flex flex-col gap-1.5 px-2.5 pb-2.5",children:[P?k.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2.5 text-sm focus-within:border-primary focus-within:ring-[3px] focus-within:ring-secondary",children:[k.jsx(Su,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{type:"search",value:f,placeholder:o("blocks.findOption"),"aria-label":o("blocks.findOption"),className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",onChange:B=>{d(B.target.value)}})]}):null,j.length>0?k.jsx("ul",{"aria-label":o("blocks.options"),className:"m-0 flex list-none flex-col gap-1.5 p-0",children:j.map(B=>{const $=y.indexOf(B)+1;return k.jsx("li",{children:k.jsxs("button",{type:"button",disabled:x,className:he("flex w-full items-start gap-3 rounded-[10px] border bg-background px-3 py-[9px] text-left transition-colors motion-reduce:transition-none","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:bg-muted disabled:text-disabled-foreground"),onClick:()=>{b(B)},children:[k.jsx("span",{className:"mt-px flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-md border text-2xs font-semibold tabular-nums text-muted-foreground",children:$}),k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[k.jsxs("span",{className:"text-sm font-medium leading-snug",children:[B.label,B.value===e.default?k.jsx("span",{className:"ml-1.5 whitespace-nowrap rounded-full bg-muted px-1.5 py-px text-2xs font-normal text-muted-foreground",children:o("blocks.default")}):null]}),B.hint?k.jsx("span",{className:"text-[13px] leading-snug text-muted-foreground",children:B.hint}):null]})]})},B.value)})}):k.jsx("p",{className:"px-1 py-2 text-sm text-muted-foreground",children:o("searchEmpty")})]}),e.allow_free_text?k.jsxs(Bm,{children:[k.jsx(wS,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.freeTextHint")})]}):null]})},Zj=10,Qj=({section:e})=>{const{t}=ye(),r=e.latest_period,n=e.shape==="trend",i=n?[]:Du(e,{period:r,mode:"value",base:"median"}),a=i.slice(0,Zj);return k.jsxs("div",{part:"dashboard-preview",className:"flex min-w-0 flex-col gap-3 rounded-xl bg-[hsl(var(--chart-card))] px-4 py-3.5",children:[k.jsxs("div",{className:"min-w-0",children:[k.jsx("p",{className:"text-sm font-semibold leading-snug",children:e.title}),n?null:k.jsxs("p",{className:"text-2xs text-muted-foreground",children:[r,", ",e.unit.label]})]}),k.jsx(n2,{compact:!0,section:e,period:r,label:t("chart.label",{title:e.title,period:r}),rows:a,national:r2(e,r,a.map(o=>o.value))}),i.length>a.length?k.jsx("p",{className:"text-2xs text-muted-foreground",children:t("chart.top",{n:a.length,total:i.length})}):null]})},hd=e=>e.type==="number"||e.type==="integer",Jj=(e,t,r)=>hd(e)?Hn(aF(t),r,e.type==="integer"?0:void 0):am(t)||"—",e6={asc:pS,desc:hS},t6=({block:e})=>{const{lang:t,t:r}=ye(),[n,i]=H.useState(),[a,o]=H.useState("asc"),[s,l]=H.useState(1),[u,f]=H.useState(""),d=Array.isArray(e.columns)?e.columns:[],p=r4({...e,columns:d,data:Array.isArray(e.data)?e.data:[]},{...n?{sortKey:n,dir:a}:{},page:s,query:u}),v=d.some(y=>y.type==="string"),g=y=>{y===n?o(x=>x==="asc"?"desc":"asc"):(i(y),o("asc")),l(1)};return k.jsxs("div",{part:"data-table",className:"flex min-w-0 flex-col gap-2",children:[v?k.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2.5 text-sm focus-within:border-primary focus-within:ring-[3px] focus-within:ring-secondary",children:[k.jsx(Su,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{type:"search",value:u,placeholder:r("blocks.tableSearch"),"aria-label":r("blocks.tableSearch"),className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",onChange:y=>{f(y.target.value),l(1)}})]}):null,k.jsxs("div",{className:"max-w-full overflow-x-auto overscroll-x-contain rounded-[10px] border bg-background",children:[k.jsxs("table",{className:"w-full border-collapse text-[13.5px]","aria-label":r("blocks.table"),children:[k.jsx("thead",{children:k.jsx("tr",{className:"border-b bg-muted",children:d.map(y=>{const x=y.key===n,b=x?e6[a]:gF;return k.jsx("th",{scope:"col","aria-sort":x?a==="asc"?"ascending":"descending":"none",className:he("p-0 font-semibold",hd(y)?"text-right":"text-left"),children:k.jsxs("button",{type:"button",className:he("inline-flex w-full items-center gap-1 whitespace-nowrap px-3 py-[7px] text-[13.5px] font-semibold text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",hd(y)&&"flex-row-reverse"),onClick:()=>{g(y.key)},children:[k.jsx("span",{children:y.title}),y.unit?k.jsxs("span",{className:"font-normal",children:[", ",y.unit]}):null,k.jsx(b,{className:he("shrink-0 text-muted-foreground",!x&&"opacity-50"),"aria-hidden":"true"})]})},y.key)})})}),k.jsx("tbody",{children:p.rows.map((y,x)=>k.jsx("tr",{className:"border-b last:border-b-0",children:d.map(b=>k.jsx("td",{className:he("px-3 py-[7px] align-top",hd(b)?"whitespace-nowrap text-right tabular-nums":"min-w-32"),children:Jj(b,y[b.key],t)},b.key))},p.from+x))})]}),p.total===0?k.jsx("p",{className:"px-3 py-3 text-center text-sm text-muted-foreground",children:r(u?"searchEmpty":"blocks.tableEmpty")}):null]}),p.pages>1?k.jsxs("div",{className:"flex items-center justify-end gap-1 text-2xs tabular-nums text-muted-foreground",children:[k.jsx(Be,{variant:"ghost",size:"icon",className:"size-7",disabled:p.page<=1,"aria-label":r("blocks.prevPage"),onClick:()=>{l(p.page-1)},children:k.jsx(vS,{"aria-hidden":"true"})}),k.jsx("span",{"aria-live":"polite",children:r("blocks.page",{a:p.page,b:p.pages})}),k.jsx(Be,{variant:"ghost",size:"icon",className:"size-7",disabled:p.page>=p.pages,"aria-label":r("blocks.nextPage"),onClick:()=>{l(p.page+1)},children:k.jsx(od,{"aria-hidden":"true"})})]}):null,e.truncated?k.jsx("p",{className:"text-2xs text-muted-foreground",children:r("blocks.truncated",{n:Array.isArray(e.data)?e.data.length:0})}):null]})},jm="inline-flex min-h-[30px] max-w-full items-center gap-1.5 rounded-lg bg-muted px-2.5 py-1 text-[13px]",r6=["sex","age","urban_rural","activity","item"],n6=e=>r6.includes(e),Hm=({label:e,children:t,title:r})=>k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"shrink-0 whitespace-nowrap text-muted-foreground",children:e}),k.jsx("span",{className:"min-w-0 truncate font-medium",title:r,children:t})]}),Vm=({label:e,children:t,className:r})=>k.jsx("li",{className:he(jm,r),title:e,children:k.jsx(Hm,{label:e,children:t})}),i6=({block:e,question:t,onAsk:r})=>{const{t:n}=ye(),[i,a]=H.useState(!1),o=H.useId(),s=e.indicators.map(d=>d.name).join(", "),l=e.territories.map(d=>d.name).join(", "),u=e.breakdown&&n6(e.breakdown)?n(`blocks.breakdown.${e.breakdown}`):"",f=e.alternatives.length>0&&t!=="";return k.jsxs("div",{part:"plan",role:"group","aria-label":n("blocks.passport"),className:"flex flex-col gap-1.5",children:[k.jsx("div",{className:"text-2xs text-muted-foreground",children:n("blocks.passport")}),k.jsxs("ul",{"aria-label":n("blocks.passport"),className:"m-0 flex list-none flex-wrap items-center gap-1.5 p-0",children:[s?f?k.jsxs("li",{className:"relative max-w-full",children:[k.jsxs("button",{type:"button",className:he(jm,"border border-border bg-background transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i&&"border-primary ring-[3px] ring-secondary"),title:s,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":o,onClick:()=>{a(d=>!d)},children:[k.jsx(Hm,{label:n("blocks.indicator"),children:s}),k.jsx(Bs,{className:he("shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",i&&"rotate-180"),"aria-hidden":"true"})]}),i?k.jsxs("div",{id:o,role:"menu","aria-label":n("blocks.alternatives"),className:"absolute left-0 top-full z-20 mt-1 flex min-w-[220px] max-w-[min(360px,80vw)] flex-col rounded-md border bg-background p-1 shadow-pop",children:[k.jsx("div",{className:"px-2.5 pb-1 pt-1.5 text-2xs text-muted-foreground",children:n("blocks.alternatives")}),e.alternatives.map(d=>k.jsx("button",{type:"button",role:"menuitem",className:"flex min-h-9 w-full items-center rounded-md px-2.5 py-1.5 text-left text-sm transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none motion-reduce:transition-none",onClick:()=>{a(!1),r(`${t} — ${d.name}`)},children:d.name},d.id))]}):null]}):k.jsx(Vm,{label:n("blocks.indicator"),children:s}):null,l?k.jsx(Vm,{label:n("blocks.territory"),children:l}):null,e.period.label?k.jsxs("li",{className:he(jm,e.period.substituted&&"border border-warning/40"),title:e.period.reason??n("blocks.period"),children:[k.jsx(Hm,{label:n("blocks.period"),children:e.period.label}),e.period.substituted?k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"·"}),k.jsx("span",{className:"text-warn-text",children:n("blocks.substituted")})]}):null]}):null,u?k.jsx(Vm,{label:n("blocks.breakdown"),children:u}):null]})]})},R2="gap-1.5 text-[13px]",O2="gap-1.5 text-[13px] text-muted-foreground hover:text-foreground",a6=({text:e})=>{const{t}=ye(),[r,n]=H.useState(!1),i=H.useRef(void 0);return H.useEffect(()=>()=>{window.clearTimeout(i.current)},[]),k.jsxs(Be,{part:"copy",variant:"ghost",size:"sm",className:O2,onClick:()=>{gm(e).then(a=>{a&&(n(!0),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{n(!1)},2e3))})},children:[r?k.jsx(da,{"aria-hidden":"true"}):k.jsx(lm,{"aria-hidden":"true"}),t(r?"copied":"copy")]})},o6=({message:e,isLastInBranch:t,onAsk:r,children:n,dashboardOpen:i=!1,onToggleDashboard:a})=>{const{path:o,t:s}=ye(),[l,u]=H.useState(!1),{blocks:f}=e,d=Oi(f,"plan"),p=Oi(f,"table"),v=Oi(f,"catalog"),g=Oi(f,"clarification"),{question:y,reply:x}=tF(o,e.id),b=e.status==="streaming",_=d?.methodology?go(d.methodology.url):null,S=f.length>0&&!b?i4(e):"",T=!b&&e.status!=="error"&&Kf(e.id),E=Oi(f,"dashboard"),D=E?.sections[0],L=T&&E!==void 0,R=L?a:void 0,O=uS(f),M=b?[]:eF(f);return k.jsxs(k.Fragment,{children:[d?k.jsx(i6,{block:d,question:y,onAsk:r}):null,n,v?k.jsx(Yj,{block:v,onAsk:r}):null,g?k.jsx(Kj,{block:g,isLastInBranch:t,question:y,reply:x,disabled:b,onAsk:r}):null,D?k.jsx(Qj,{section:D}):null,p&&l?k.jsx(t6,{block:p}):null,M.length>0?k.jsx(c2,{files:M}):null,T?k.jsx(f2,{messageId:e.id,block:O}):null,f.length>0&&!b?k.jsxs("div",{part:"answer-actions",role:"group",className:"flex flex-wrap items-center gap-1.5",children:[p?k.jsxs(Be,{part:"data-toggle",variant:"input",size:"sm",className:R2,"aria-expanded":l,onClick:()=>{u(P=>!P)},children:[k.jsx(OF,{"aria-hidden":"true"}),s(l?"blocks.hideData":"blocks.data")]}):null,R?k.jsxs(Be,{part:"dashboard-toggle","data-message-id":e.id,variant:"input",size:"sm",className:he(R2,i&&"border-primary bg-secondary text-secondary-foreground"),"aria-expanded":i,onClick:()=>{R(e.id)},children:[k.jsx(yF,{"aria-hidden":"true"}),s(i?"blocks.hideDashboard":"blocks.dashboard")]}):null,L?k.jsx(a2,{messageId:e.id,block:O}):null,d?.methodology&&_?k.jsx(Be,{part:"methodology",variant:"ghost",size:"sm",className:O2,asChild:!0,children:k.jsxs("a",{href:_,target:"_blank",rel:"noopener noreferrer",title:d.methodology.title,children:[k.jsx(ad,{"aria-hidden":"true"}),s("blocks.methodology")]})}):null,S?k.jsx(a6,{text:S}):null]}):null]})},s6=5e4,z2=2e5,l6=H.lazy(()=>Promise.resolve().then(()=>kae).then(e=>({default:e.MarkdownImpl}))),u6=H.memo(function({children:t,streaming:r=!1,className:n}){const i=k.jsx("span",{className:"whitespace-pre-wrap",children:t.length>z2?`${t.slice(0,z2)}…`:t});return k.jsxs("div",{part:"markdown",className:he("min-w-0 break-words text-[15px] leading-[1.65] text-foreground",n),children:[t.length>s6?i:k.jsx(Zg,{fallback:i,children:k.jsx(H.Suspense,{fallback:i,children:k.jsx(l6,{children:t})})}),r?k.jsx("span",{"aria-hidden":"true",className:"ml-0.5 inline-block h-[17px] w-[7px] translate-y-[3px] rounded-sm bg-primary animate-pulse motion-reduce:animate-none"}):null]})}),Iu="size-7 shrink-0 text-muted-foreground hover:text-foreground",F2=({messageId:e,disabled:t})=>{const{index:r,switchBranch:n,t:i}=ye(),{list:a,position:o}=U4(r,e);if(a.length<2||o<0)return null;const s=a[o-1],l=a[o+1];return k.jsxs("div",{part:"branch",className:"flex items-center text-[13px] tabular-nums text-muted-foreground",role:"group","aria-label":i("branch.label"),children:[k.jsx(Be,{variant:"ghost",size:"icon",className:Iu,disabled:t||!s,"aria-label":i("branch.prev"),onClick:()=>{s&&n(s.id)},children:k.jsx(vS,{"aria-hidden":"true"})}),k.jsxs("span",{"aria-live":"polite",className:"min-w-[30px] text-center",children:[o+1,"/",a.length]}),k.jsx(Be,{variant:"ghost",size:"icon",className:Iu,disabled:t||!l,"aria-label":i("branch.next"),onClick:()=>{l&&n(l.id)},children:k.jsx(od,{"aria-hidden":"true"})})]})},c6=({text:e})=>{const{t}=ye(),[r,n]=H.useState(!1),i=H.useRef(void 0);H.useEffect(()=>()=>{window.clearTimeout(i.current)},[]);const a=t(r?"copied":"copy");return k.jsx(Be,{part:"copy",variant:"ghost",size:"icon",className:Iu,"aria-label":a,title:a,onClick:()=>{gm(e).then(o=>{o&&(n(!0),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{n(!1)},2e3))})},children:r?k.jsx(da,{"aria-hidden":"true"}):k.jsx(lm,{"aria-hidden":"true"})})},f6=({message:e})=>{const{rate:t,t:r}=ye(),[n,i]=H.useState(),a=e.rating??0;return k.jsx("span",{part:"rating",role:"radiogroup","aria-label":r("rateGroup"),className:"inline-flex items-center",onKeyDown:Pm,onMouseLeave:()=>{i(void 0)},children:bB.map((o,s)=>{const l=o<=a,u=!l&&a===0&&n!==void 0&&o<=n;return k.jsx("button",{type:"button",role:"radio",tabIndex:Im(s,a-1),"aria-checked":a===o,"aria-label":r("rate",{count:o}),className:he("inline-flex size-[30px] items-center justify-center rounded-md text-muted-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",(l||u)&&"text-warning"),onMouseEnter:()=>{i(o)},onClick:()=>{t(e.id,o)},children:k.jsx(RF,{className:he("size-4",l&&"fill-current"),"aria-hidden":"true"})},o)})})},d6=({message:e,isLast:t,busy:r,ready:n,persisted:i,canFeedback:a,feedbackOpen:o,onOpenFeedback:s})=>{const{send:l,state:u,t:f}=ye(),d=e.status==="error",p=t&&n&&!r&&!u.limit.blocked;if(d&&!p)return null;const v=Eu.find(x=>x===e.feedbackReason),g=e.blocks.length>0,y=()=>{l({query:"",mode:u.mode??e.mode,regenerateOf:e.id})};return k.jsxs("div",{part:"actions",role:"toolbar","aria-label":f("actionsLabel"),className:he("flex min-h-8 flex-wrap items-center gap-0.5",!d&&e.rating==null&&pm),children:[n&&!d&&e.content&&!g?k.jsx(c6,{text:e.content}):null,p?d?k.jsxs(Be,{part:"regenerate",variant:"input",size:"sm",className:"gap-1.5",onClick:y,children:[k.jsx(CS,{"aria-hidden":"true"}),f("regenerate")]}):k.jsxs(Be,{part:"regenerate",variant:"ghost",size:"icon",className:he(Iu,"max-sm:h-8 max-sm:w-auto max-sm:gap-1.5 max-sm:px-2.5 max-sm:text-[13px]"),"aria-label":f("regenerate"),title:f("regenerate"),onClick:y,children:[k.jsx(CS,{"aria-hidden":"true"}),k.jsx("span",{className:"hidden max-sm:inline",children:f("regenerate")})]}):null,n&&!d?k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"mx-1.5 h-[18px] w-px bg-border","aria-hidden":"true"}),k.jsx(f6,{message:e})]}):null,k.jsx(F2,{messageId:e.id,disabled:r||!i}),a&&!o?k.jsx(Be,{variant:"link",size:"sm",onClick:s,children:e.feedback||v?f("feedbackEdit"):f("feedbackOpen")}):null]})},h6=({message:e,onClose:t})=>{const{saveFeedback:r,t:n}=ye(),[i,a]=H.useState(e.feedback),[o,s]=H.useState(!1),[l,u]=H.useState(!1),[f,d]=H.useState(()=>Eu.find(v=>v===e.feedbackReason)),p=()=>{s(!0),u(!1),r(e.id,i.trim(),f).then(v=>{s(!1),v?t():u(!0)})};return k.jsxs("form",{part:"feedback","aria-label":n("feedbackLabel"),onSubmit:v=>{v.preventDefault()},className:"flex flex-col gap-3 rounded-[14px] border bg-background p-3.5",children:[k.jsx("div",{className:"text-sm font-medium",children:n("feedback.reasonsLabel")}),k.jsx("div",{role:"radiogroup","aria-label":n("feedback.reasonsLabel"),className:"flex flex-wrap gap-1.5",onKeyDown:Pm,children:Eu.map((v,g)=>{const y=v===f;return k.jsx("button",{type:"button",role:"radio",tabIndex:Im(g,f?Eu.indexOf(f):-1),"aria-checked":y,disabled:o,onClick:()=>{d(y?void 0:v)},className:he("inline-flex h-[30px] items-center whitespace-nowrap rounded-full border px-3 text-[13px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60 motion-reduce:transition-none",y?"border-primary-50 bg-secondary font-medium text-secondary-foreground":"bg-background text-foreground hover:bg-muted"),children:n(`feedback.reason.${v}`)},v)})}),k.jsx(Nm,{autoFocus:!0,value:i,onChange:a,placeholder:n("feedbackPlaceholder"),"aria-label":n("feedbackLabel"),maxLength:vm,disabled:o,className:"min-h-[76px] rounded-md border border-input bg-background px-3 py-2.5 text-[15px] leading-normal focus:border-primary focus:ring-[3px] focus:ring-secondary"}),l?k.jsxs("div",{role:"alert",className:"flex items-start gap-1.5 text-[13px] text-destructive",children:[k.jsx(po,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),k.jsx("span",{children:n("ratingError")})]}):null,k.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k.jsxs("span",{className:he("mr-auto text-2xs tabular-nums text-muted-foreground",i.length>=vm&&"font-semibold text-warn-text"),children:[i.length,"/",vm]}),k.jsx(Be,{variant:"ghost",size:"sm",onClick:t,disabled:o,children:n("cancel")}),k.jsxs(Be,{size:"sm",disabled:o,onClick:p,children:[o?k.jsx(vo,{className:"size-3 animate-spin motion-reduce:animate-none","aria-hidden":"true"}):null,n("save")]})]})]})},p6=({message:e})=>{const{t}=ye(),r=Eu.find(n=>n===e.feedbackReason);return!r&&!e.feedback?null:k.jsxs("div",{part:"feedback-saved",className:"flex flex-col gap-1 rounded-xl bg-muted px-3 py-2.5 text-sm",children:[r?k.jsx("span",{className:"font-semibold",children:t(`feedback.reason.${r}`)}):null,e.feedback?k.jsx("span",{className:"whitespace-pre-line break-words",children:e.feedback}):null]})},v6=({message:e,isLast:t,busy:r,persisted:n,dashboardOpen:i,onToggleDashboard:a})=>{const{send:o,state:s,t:l}=ye(),[u,f]=H.useState(!1),d=e.status==="streaming",p=e.status==="error",v=cz(e.content,d),g=Oz(d,e.status),y=!d&&n,x=y&&!p&&e.rating!=null&&e.rating<xB,b=!p&&(d||e.steps.length>0),_=Date.parse(e.createdAt)||0,S=g?"eureka":Iz(e.status,e.content.length>0),T=(E,D)=>o({query:E,mode:s.mode??e.mode,...D?{clarification:D}:{}}).then(L=>L==="sent");return k.jsxs("article",{part:"message","data-role":"assistant","data-status":e.status,"aria-busy":d,className:"group flex items-start gap-3",children:[k.jsxs("div",{part:"avatar",className:"relative w-8 shrink-0 max-sm:hidden",children:[k.jsx(rd,{mood:S,size:32,animated:d||g}),p?k.jsx("span",{"data-testid":"avatar-caption",className:"absolute left-0 top-full mt-1 whitespace-nowrap text-2xs leading-none text-muted-foreground",children:l("agent.failed")}):null]}),k.jsxs("div",{part:p?"bubble assistant-bubble error-bubble":"bubble assistant-bubble",className:"flex min-w-0 flex-1 flex-col gap-3",children:[b?k.jsx(Vj,{steps:e.steps,status:e.status,startedAt:_,durationMs:e.durationMs,stopping:s.turn?.stopping===!0&&s.turn.assistantId===e.id}):null,p?k.jsxs("div",{role:"alert",className:"flex items-start gap-2.5 rounded-xl border border-error/30 bg-destructive-background px-3.5 py-3 text-sm",children:[k.jsx(po,{className:"mt-0.5 size-4 shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{children:e.content||l("errors.generic")})]}):null,k.jsx(o6,{message:e,isLastInBranch:t,onAsk:T,dashboardOpen:i,onToggleDashboard:a,children:e.content&&!p?k.jsx(u6,{streaming:d,children:v}):null}),e.attachments.length>0?k.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.attachments.map((E,D)=>k.jsx(P2,{attachment:E},E.id??`${E.name}-${D}`))}):null,e.status==="stopped"?k.jsxs("div",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:[k.jsx(yS,{className:"size-4 shrink-0","aria-hidden":"true"}),k.jsx("span",{children:l("agent.answerStopped")})]}):null,d?null:k.jsx(d6,{message:e,isLast:t,busy:r,ready:y,persisted:n,canFeedback:x,feedbackOpen:u,onOpenFeedback:()=>{f(!0)}}),x&&u?k.jsx(h6,{message:e,onClose:()=>{f(!1)}}):null,x&&!u?k.jsx(p6,{message:e}):null]})]})},g6=({message:e,onClose:t})=>{const{send:r,state:n,t:i}=ye(),a=H.useId(),[o,s]=H.useState(e.content),l=n.mode??e.mode,u=n.config?.max_query_chars??Uk,f=o.trim(),d=f!==e.content.trim(),p=o.length>u,v=f.length>0&&d&&!p&&!n.turn&&!n.limit.blocked,g=()=>{v&&(t(),r({query:f,mode:l,parentId:e.parentId??""}))};return k.jsxs("div",{part:"edit",onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),t())},className:"flex w-full max-w-[640px] flex-col gap-2 rounded-2xl border border-primary bg-background px-3 py-2.5 ring-[3px] ring-secondary",children:[k.jsx(Nm,{autoFocus:!0,value:o,onChange:s,"aria-label":i("editLabel"),"aria-invalid":p||void 0,"aria-describedby":a,className:"py-0.5 text-lg",onSubmit:g}),k.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k.jsx(k2,{id:a,count:o.length,max:u,className:"mr-auto px-0"}),k.jsx(Be,{variant:"ghost",size:"sm",onClick:t,children:i("cancel")}),k.jsx(Be,{size:"sm",disabled:!v,onClick:g,children:i("send")})]})]})},m6=({message:e,busy:t,persisted:r})=>{const{t:n}=ye(),[i,a]=H.useState(!1);return k.jsx("div",{part:"message","data-role":"user",className:"group flex flex-col items-end gap-1.5",children:i?k.jsx(g6,{message:e,onClose:()=>{a(!1)}}):k.jsxs(k.Fragment,{children:[e.attachments.length>0?k.jsx("div",{className:"flex max-w-[78%] flex-wrap justify-end gap-1.5 max-sm:max-w-[88%]",children:e.attachments.map((o,s)=>k.jsx(P2,{attachment:o},o.id??`${o.name}-${s}`))}):null,k.jsx("div",{part:"bubble user-bubble",className:"max-w-[78%] whitespace-pre-wrap break-words rounded-[calc(var(--aid-c-radius)+6px)] rounded-br-[6px] bg-primary px-3.5 py-2.5 text-[15px] leading-normal text-primary-foreground max-sm:max-w-[88%]",children:e.content}),k.jsxs("div",{className:"flex min-h-7 items-center gap-0.5",children:[r?k.jsx(Be,{part:"edit-button",variant:"ghost",size:"icon",className:he(Iu,pm),disabled:t,"aria-label":n("edit"),title:n("edit"),onClick:()=>{a(!0)},children:k.jsx(LF,{"aria-hidden":"true"})}):null,k.jsx(F2,{messageId:e.id,disabled:t||!r})]})]})})},y6=H.memo(function({message:t,isLast:r,busy:n,dashboardOpen:i,onToggleDashboard:a}){const{t:o}=ye(),s=Kf(t.id),l=k.jsx("p",{part:"message-error",className:"text-sm text-muted-foreground",children:o("errors.render")});return k.jsx(Zg,{fallback:l,children:t.role==="user"?k.jsx(m6,{message:t,busy:n,persisted:s}):k.jsx(v6,{message:t,isLast:r,busy:n,persisted:s,dashboardOpen:i,onToggleDashboard:a})})}),B2=e=>e.scrollHeight-e.scrollTop-e.clientHeight,x6=({resetKey:e,followKey:t})=>{const r=H.useRef(null),n=H.useRef(null),i=H.useRef(!0),a=H.useRef(0),[o,s]=H.useState(!0),l=H.useCallback(()=>{const d=r.current;d&&(d.scrollTop=d.scrollHeight)},[]),u=H.useCallback(()=>{const d=r.current;if(!d)return;i.current=!0;const p=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;d.scrollTo({top:d.scrollHeight,behavior:p?"auto":"smooth"})},[]),f=H.useCallback(()=>{const d=r.current;if(!d)return;const p=B2(d)<OS;p?i.current=!0:d.scrollTop<a.current-1&&(i.current=!1),a.current=d.scrollTop,s(p)},[]);return H.useLayoutEffect(()=>{i.current=!0,l()},[e,t,l]),H.useEffect(()=>{const d=n.current,p=r.current;if(!d||!p||typeof ResizeObserver>"u")return;const v=new ResizeObserver(()=>{i.current&&l(),s(B2(p)<OS)});return v.observe(d),()=>{v.disconnect()}},[l]),{scrollRef:r,contentRef:n,onScroll:f,atBottom:o,scrollToBottom:u}},b6=()=>{const{state:e,path:t,t:r}=ye(),{state:n,toggle:i}=fa(),a=t.filter(v=>v.role==="user").length,{scrollRef:o,contentRef:s,onScroll:l,atBottom:u,scrollToBottom:f}=x6({resetKey:e.thread?.id??null,followKey:a}),d=e.turn!==null,p=t[t.length-1];return k.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[k.jsx("div",{ref:o,part:"messages",onScroll:l,"aria-live":"polite","aria-busy":d,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:k.jsx("div",{ref:s,className:"mx-auto flex w-full max-w-[820px] flex-col gap-[22px] px-4 pb-4 pt-[18px]",children:t.map(v=>k.jsx(y6,{message:v,isLast:v===p,busy:d,dashboardOpen:v.id===n.messageId,onToggleDashboard:i},v.id))})}),u?null:k.jsxs("button",{part:"scroll-down",type:"button",className:"absolute bottom-3 left-1/2 inline-flex h-9 -translate-x-1/2 items-center gap-1.5 whitespace-nowrap rounded-full border bg-background pl-3 pr-3.5 text-[13px] font-medium text-foreground shadow-pop transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",onClick:f,children:[k.jsx(hS,{"aria-hidden":"true"}),r("scrollDown")]})]})},w6={error:"bg-error-background text-destructive",warning:"bg-warning-background text-warn-text",lock:"bg-muted text-muted-foreground"},j2=({tone:e,children:t})=>k.jsx("span",{className:he("flex size-[52px] items-center justify-center rounded-full",w6[e]),children:t}),_6=({kind:e,onRetry:t})=>{const{t:r}=ye();if(e==="loading")return k.jsxs("div",{part:"shell-status","data-state":"loading","aria-busy":"true",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx("span",{"aria-hidden":"true",className:"size-[26px] animate-spin rounded-full border-[3px] border-current border-r-transparent text-primary motion-reduce:animate-none"}),k.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:r("loading")})]});if(e==="siteBlocked")return k.jsxs("div",{part:"shell-status","data-state":"siteBlocked",role:"alert",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx(j2,{tone:"lock",children:k.jsx(xS,{className:"size-6","aria-hidden":"true"})}),k.jsx("p",{className:"max-w-[300px] text-lg font-semibold",children:r("shell.siteBlocked")}),k.jsx("p",{className:"max-w-[440px] text-xs text-muted-foreground",children:r("shell.siteBlockedHint")})]});const n=e==="overloaded";return k.jsxs("div",{part:"shell-status","data-state":n?"overloaded":"unavailable",role:"alert",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx(j2,{tone:n?"warning":"error",children:n?k.jsx(sd,{className:"size-6","aria-hidden":"true"}):k.jsx(po,{className:"size-6","aria-hidden":"true"})}),k.jsx("p",{className:"max-w-[300px] text-lg font-semibold",children:r(n?"overloaded":"configError")}),t?k.jsxs(Be,{variant:"input",size:"sm",onClick:t,children:[k.jsx(TS,{"aria-hidden":"true"}),r("retry")]}):null]})},k6=()=>{const{state:e,reload:t}=ye(),r=$z(e);return r===null?null:k.jsx(_6,{kind:r,onRetry:r==="siteBlocked"?void 0:t})},S6="h-3 rounded-md bg-muted animate-pulse motion-reduce:animate-none",C6=()=>{const{t:e}=ye();return k.jsxs("div",{"aria-busy":"true",className:"min-h-0 flex-1 overflow-hidden",children:[k.jsxs("div",{className:"mx-auto flex w-full max-w-[820px] flex-col gap-[22px] px-4 pb-4 pt-[18px]",children:[k.jsx("div",{className:"flex justify-end",children:k.jsx("div",{className:"h-[38px] w-[62%] rounded-[18px] rounded-br-[6px] bg-muted animate-pulse motion-reduce:animate-none"})}),k.jsx("div",{className:"flex flex-col gap-2.5",children:[90,76,84,40].map(t=>k.jsx("div",{className:S6,style:{width:`${t}%`}},t))})]}),k.jsx("span",{role:"status",className:"sr-only",children:e("loading")})]})},T6=({composerRef:e,wide:t})=>{const{state:r,path:n}=ye(),[i,a]=H.useState(!1),o=!!r.config&&!r.loadingThread&&!r.configError,s=o&&n.length===0,l=f=>{e&&"current"in e&&e.current?.setText(f)};let u;return o?s?u=k.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:k.jsx(Bj,{listening:i,wide:t,onPick:l})}):u=k.jsx(b6,{}):u=r.loadingThread&&r.config&&!r.configError?k.jsx(C6,{}):k.jsx(k6,{}),k.jsxs(k.Fragment,{children:[u,k.jsx(Pj,{composerRef:e,onDraftChange:a})]})},Pu="size-8 shrink-0 text-muted-foreground hover:text-foreground",A6=({historyHidden:e,onShowHistory:t,onOpenSettings:r,title:n,logoUrl:i,threadTitle:a,tabs:o,inert:s=!1})=>{const{t:l,newChat:u}=ye(),f=Kg(),d=H.useRef(null);fo(d,s);const p=a!==void 0&&a!==""?a:e?n:"";return k.jsxs("div",{ref:d,part:"toolbar",className:"flex h-toolbar shrink-0 items-center gap-1 border-b py-0 pl-2.5 pr-2",children:[e?k.jsx(Be,{part:"history-toggle",variant:"ghost",size:"icon",className:Pu,"aria-expanded":!1,"aria-label":l("history"),title:l("history"),onClick:t,children:k.jsx(DF,{"aria-hidden":"true"})}):null,e&&i?k.jsx("img",{part:"logo",src:i,alt:"",referrerPolicy:"no-referrer",className:"size-6 shrink-0 rounded-md object-contain"}):null,k.jsx("span",{className:"min-w-0 flex-1 truncate px-1.5 text-sm font-semibold",children:p}),o,k.jsx(Be,{variant:"ghost",size:"icon",className:Pu,"aria-label":l("newChat"),title:l("newChat"),onClick:u,children:k.jsx(SS,{"aria-hidden":"true"})}),f.canExpand?k.jsx(Be,{part:"expand",variant:"ghost",size:"icon",className:Pu,"aria-label":f.expanded?l("shrink"):l("expand"),title:f.expanded?l("shrink"):l("expand"),onClick:()=>{f.setExpanded(!f.expanded)},children:f.expanded?k.jsx(kS,{"aria-hidden":"true"}):k.jsx(bS,{"aria-hidden":"true"})}):null,k.jsx(Be,{part:"settings-button",variant:"ghost",size:"icon",className:Pu,"aria-label":l("settings"),title:l("settings"),onClick:r,children:k.jsx(NF,{"aria-hidden":"true"})}),f.close?k.jsx(Be,{part:"close",variant:"ghost",size:"icon",className:Pu,"aria-label":l("close"),title:l("close"),onClick:f.close,children:k.jsx(Cu,{"aria-hidden":"true"})}):null]})},E6="flex shrink-0 flex-col border-r duration-200 animate-in fade-in slide-in-from-left-2 motion-reduce:animate-none",D6="w-side bg-muted",M6="absolute inset-y-0 left-0 z-30 w-side-over max-w-full bg-muted shadow-side",L6=({title:e,logoUrl:t,onHide:r})=>{const{t:n}=ye();return k.jsxs("div",{part:"header",className:"flex h-side-head shrink-0 items-center gap-2.5 pl-3.5 pr-2",children:[t?k.jsx("img",{part:"logo",src:t,alt:"",referrerPolicy:"no-referrer",className:"size-7 shrink-0 rounded-lg object-cover"}):k.jsx(rd,{size:28,animated:!1}),k.jsx("span",{part:"title",className:"min-w-0 flex-1 truncate text-[15px] font-bold",children:e}),k.jsx(Be,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":n("closeHistory"),title:n("closeHistory"),onClick:r,children:k.jsx(EF,{"aria-hidden":"true"})})]})},I6=({onClick:e})=>{const{t}=ye();return k.jsxs("button",{part:"new-chat",type:"button",onClick:e,className:"flex h-9 w-full items-center gap-2.5 rounded-md border bg-background pl-3 pr-2.5 text-left text-sm font-medium transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",children:[k.jsx(SS,{className:"size-4","aria-hidden":"true"}),t("newChat")]})},P6=({name:e,onConfirm:t,onCancel:r})=>{const{t:n}=ye(),i=H.useRef(null);return H.useEffect(()=>{i.current?.querySelector("[data-cancel]")?.focus()},[]),k.jsxs("div",{ref:i,role:"alertdialog","aria-label":n("deleteConfirm"),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),r())},className:"my-0.5 flex flex-col gap-2 rounded-[10px] border border-error/35 bg-destructive-background p-2.5",children:[k.jsx("div",{className:"text-[13px] font-semibold",children:n("deleteConfirm")}),k.jsx("div",{className:"truncate text-2xs text-muted-foreground",children:e}),k.jsxs("div",{className:"flex gap-2",children:[k.jsx(Be,{variant:"destructive",size:"xs",onClick:t,children:n("deleteYes")}),k.jsx(Be,{variant:"ghost",size:"xs","data-cancel":!0,onClick:r,children:n("deleteNo")})]})]})},N6=(e,t)=>{let r="";const n=[];let i=0;for(const s of e){const l=s.toLowerCase();n.push(...Array.from({length:l.length},()=>i)),r+=l,i+=s.length}n.push(i);const a=r.indexOf(t);if(a<0)return null;let o=a+t.length;for(;o<n.length&&n[o]===n[o-1];)o+=1;return[n[a]??0,n[o]??e.length]},R6=({text:e,query:t})=>{const r=t.trim().toLowerCase(),n=r?N6(e,r):null;if(!n)return k.jsx(k.Fragment,{children:e});const[i,a]=n;return k.jsxs(H.Fragment,{children:[e.slice(0,i),k.jsx("mark",{className:"rounded-[3px] bg-hl px-px text-inherit",children:e.slice(i,a)}),e.slice(a)]})},O6=({groups:e,query:t,activeId:r,confirmId:n,onOpen:i,onAskDelete:a,onCancelDelete:o,onDelete:s})=>{const{t:l}=ye();return k.jsx(k.Fragment,{children:e.map(([u,f])=>k.jsxs("section",{className:"pb-1","aria-label":l(u),children:[k.jsx("h3",{className:"px-2 pb-1 pt-3.5 text-2xs font-medium text-muted-foreground",children:l(u)}),k.jsx("ul",{className:"flex flex-col gap-px",children:f.map(d=>{const p=d.id===r,v=d.title||l("untitled");return n===d.id?k.jsx("li",{children:k.jsx(P6,{name:v,onConfirm:()=>{s(d.id)},onCancel:o})},d.id):k.jsxs("li",{className:"group relative",children:[k.jsx("button",{part:"thread-item",type:"button","aria-current":p?"page":void 0,title:v,onClick:()=>{i(d.id)},className:he("flex min-h-9 w-full items-center rounded-lg py-1 pl-2.5 pr-9 text-left text-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",p&&"bg-background font-medium shadow-[inset_0_0_0_1px_var(--aid-c-border)] hover:bg-background"),children:k.jsx("span",{className:"min-w-0 truncate",children:k.jsx(R6,{text:v,query:t})})}),k.jsx(Be,{variant:"ghost",size:"icon",className:he("absolute right-1 top-1/2 size-7 -translate-y-1/2 text-muted-foreground",!p&&pm),"aria-label":`${l("delete")}: ${v}`,onClick:()=>{a(d.id)},children:k.jsx(zF,{"aria-hidden":"true"})})]},d.id)})})]},u))})},Um=({icon:e,children:t})=>k.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-3 py-6 text-center text-sm text-muted-foreground",children:[e,t]}),z6=[82,64,90,58,76,70],F6=({query:e})=>{const{state:t,t:r,refreshThreads:n}=ye();return t.threadsLoaded?e.trim()!==""?k.jsx(Um,{icon:k.jsx(Su,{"aria-hidden":"true"}),children:k.jsx("span",{children:r("searchEmpty")})}):t.threadsError?k.jsxs(Um,{icon:k.jsx(po,{"aria-hidden":"true"}),children:[k.jsx("span",{children:r("historyError")}),k.jsx(Be,{variant:"input",size:"xs",onClick:n,children:r("retry")})]}):k.jsx(Um,{icon:k.jsx(_S,{"aria-hidden":"true"}),children:k.jsx("span",{children:r("historyEmpty")})}):k.jsxs("div",{"aria-busy":"true",className:"flex flex-col",children:[z6.map(i=>k.jsx("div",{className:"flex min-h-9 items-center px-2.5",children:k.jsx("span",{className:"h-[11px] animate-pulse rounded-md bg-border motion-reduce:animate-none",style:{width:`${i}%`}})},i)),k.jsx("span",{role:"status",className:"sr-only",children:r("loading")})]})},B6=(e,t,r)=>{id(e,t);const n=H.useRef(r);H.useEffect(()=>{n.current=r}),H.useEffect(()=>{if(!t)return;const a=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;const s=o.composedPath(),l=s[0];l instanceof HTMLInputElement&&l.type==="search"&&l.value!==""||s.some(u=>u instanceof HTMLElement&&u.getAttribute("role")==="alertdialog")||(o.preventDefault(),o.stopPropagation(),n.current())};return window.addEventListener("keydown",a,!0),()=>{window.removeEventListener("keydown",a,!0)}},[t]);const i=H.useRef(!1);H.useEffect(()=>{const a=e.current?.getRootNode();if(i.current&&!t){const o=window.setTimeout(()=>{a?.querySelector('[part~="history-toggle"]')?.focus()},0);return i.current=!1,()=>{window.clearTimeout(o)}}i.current=t},[t,e])},j6=({query:e,onQuery:t,inputRef:r,autoFocus:n})=>{const{t:i}=ye();return k.jsxs("label",{className:"relative flex items-center",children:[k.jsx(Su,{className:"pointer-events-none absolute left-[11px] size-4 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{ref:r,part:"search",type:"search",value:e,"data-autofocus":n?"":void 0,onChange:a=>{t(a.target.value)},onKeyDown:a=>{a.key==="Escape"&&e&&(a.preventDefault(),t(""))},placeholder:i("search"),"aria-label":i("search"),className:"h-8 w-full rounded-md border border-input bg-background pl-[34px] pr-9 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-secondary [&::-webkit-search-cancel-button]:hidden"}),e?k.jsx("button",{type:"button","aria-label":i("dismiss"),className:"absolute right-2 rounded p-0.5 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{t(""),r.current?.focus()},children:k.jsx(Cu,{className:"size-3.5","aria-hidden":"true"})}):null]})},H6=({collapsed:e,onCollapsedChange:t,searchRef:r,searchSignal:n,overlay:i=!1,title:a,logoUrl:o,inert:s=!1})=>{const l=H.useRef(null);fo(l,s);const{state:u,t:f,openThread:d,newChat:p,deleteThread:v}=ye(),[g,y]=H.useState(""),[x,b]=H.useState(null),_=i&&!e;B6(l,_,()=>{t(!0)});const S=H.useMemo(()=>{const E=g.trim().toLowerCase(),D=E?u.threads.filter(L=>(L.title||f("untitled")).toLowerCase().includes(E)):u.threads;return SB(D)},[u.threads,g,f]);H.useEffect(()=>{n>0&&!e&&r.current?.focus()},[n,e,r]);const T=E=>()=>{E(),i&&t(!0)};return e?k.jsx("nav",{ref:l,part:"sidebar","data-state":"collapsed","aria-label":f("history"),hidden:!0}):k.jsxs("nav",{ref:l,part:"sidebar","data-state":"expanded","aria-label":f("history"),className:he(E6,i?M6:D6),children:[k.jsx(L6,{title:a,logoUrl:o,onHide:()=>{t(!0)}}),k.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-2.5 pb-2",children:[k.jsx(I6,{onClick:T(p)}),k.jsx(j6,{query:g,onQuery:y,inputRef:r,autoFocus:_})]}),k.jsxs("div",{part:"history",className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-2",children:[S.length===0?k.jsx(F6,{query:g}):null,k.jsx(O6,{groups:S,query:g,activeId:u.thread?.id,confirmId:x,onOpen:E=>{T(()=>{d(E)})()},onAskDelete:b,onCancelDelete:()=>{b(null)},onDelete:E=>{b(null),v(E)}})]})]})};function V6(e){const t=H.useRef(null),[r,n]=H.useState(e);return H.useLayoutEffect(()=>{const i=t.current;if(!i)return;const a=Math.round(i.getBoundingClientRect().width);if(a>0&&n(a),typeof ResizeObserver>"u")return;const o=new ResizeObserver(([s])=>{const l=Math.round(s?.contentRect.width??0);l>0&&n(l)});return o.observe(i),()=>{o.disconnect()}},[]),[t,r]}const H2="aid_sidebar",U6=720,$6=e=>{try{const t=window.localStorage.getItem(H2);return t===null?e:t==="collapsed"}catch{return e}},G6=e=>{const{state:t}=ye(),r=t.thread?.id,n=r!==void 0&&r!==Fs?r:void 0;return k.jsx(aj,{threadId:n,children:k.jsx(W6,{...e,threadId:n})})},W6=({open:e,title:t,logoUrl:r,compact:n,threadId:i})=>{const{state:a,path:o,newChat:s}=ye(),l=Kg(),{expandForDashboard:u}=l,[f,d]=V6(0),v=(l.canExpand&&l.expanded?Math.max(d,window.innerWidth):d)>=sF,g=fa(),y=n||d>0&&d<U6,[x,b]=H.useState(()=>y||$6(!1)),[_,S]=H.useState(y);y!==_&&(S(y),y&&b(!0));const[T,E]=H.useState(!1),D=H.useRef(null),[L,R]=H.useState(0),O=()=>{P(!1),R(ae=>ae+1)},M=H.useRef(null),P=ae=>{if(b(ae),!y)try{window.localStorage.setItem(H2,ae?"collapsed":"expanded")}catch{}},j=H.useRef({collapsed:x,newChat:s,setCollapsed:P,focusSearch:O});H.useEffect(()=>{j.current={collapsed:x,newChat:s,setCollapsed:P,focusSearch:O}}),H.useEffect(()=>{if(!e)return;const ae=ie=>{if(!(ie.metaKey||ie.ctrlKey)||ie.altKey)return;const{collapsed:_e,newChat:be,setCollapsed:xe,focusSearch:Se}=j.current,Le=ie.key.toLowerCase();if(Le==="k"&&!ie.shiftKey)Se();else if(Le==="o"&&ie.shiftKey)be(),setTimeout(()=>M.current?.setText(""),0);else if(Le==="s"&&ie.shiftKey)xe(!_e);else return;ie.preventDefault()};return window.addEventListener("keydown",ae),()=>{window.removeEventListener("keydown",ae)}},[e]),oj(o,i,{loaded:i===void 0||a.thread!==null&&a.loadingThread===null,streaming:(a.turn?.optimisticIds.length??0)>0});const B=o.find(ae=>ae.id===g.state.messageId&&Oi(ae.blocks,"dashboard")!==void 0),$=B!==void 0;H.useEffect(()=>{if($)return u(!0),()=>{u(!1)}},[$,u]);const K=H.useRef(null),Z=H.useRef(!1),re=B?.id??null,Y=H.useRef(null);H.useEffect(()=>{const ae=Y.current;if(Y.current=re,ae===null||re!==null||!Z.current)return;Z.current=!1;const ie=K.current;(Array.from(ie?.querySelectorAll('[part="dashboard-toggle"]')??[]).find(be=>be.dataset.messageId===ae)??ie?.querySelector('[part="composer"] textarea'))?.focus()},[re]);const G=$&&g.state.fullscreen;fo(K,y&&!x);const[I,z]=H.useState(e);e!==I&&(z(e),!e&&y&&b(!0));const W=uF($,v,g.state.fullscreen);lF(e&&$&&(!W||g.state.view==="dashboard"));const F=a.thread?a.threads.find(ae=>ae.id===a.thread?.id)?.title:void 0,ee=a.config&&!a.loadingThread&&!a.configError;return k.jsxs("div",{ref:f,className:"relative flex min-h-0 flex-1",children:[k.jsx(H6,{collapsed:x,onCollapsedChange:P,overlay:y,searchRef:D,searchSignal:L,title:t,logoUrl:r,inert:G}),k.jsxs("div",{ref:K,className:"flex min-w-0 flex-1 flex-col",children:[k.jsx(A6,{historyHidden:x,onShowHistory:()=>{P(!1)},onOpenSettings:()=>{E(!0)},title:t,logoUrl:r,threadTitle:F,tabs:W?k.jsx(CB,{}):null,inert:G}),k.jsx(TB,{wide:v,onPanelFocusChange:ae=>{Z.current=ae},panel:B?k.jsx(nj,{message:B}):null,chat:k.jsx(T6,{composerRef:M,wide:d>=720})})]}),y&&!x?k.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"absolute inset-0 z-20 bg-scrim",onClick:()=>{P(!0)}}):null,k.jsx(lj,{active:e&&!!ee}),k.jsx(xj,{open:T,onClose:()=>{E(!1)}})]})},V2=({open:e,title:t,logoUrl:r,fullscreen:n,expanded:i=!1,style:a,onClose:o})=>{const s=H.useRef(null);return fo(s,!e),id(s,e),H.useEffect(()=>{if(!e)return;const l=u=>{u.key==="Escape"&&!u.defaultPrevented&&o()};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[e,o]),k.jsx("div",{ref:s,part:"window",role:"dialog","aria-modal":n,"aria-label":t,"aria-hidden":!e,"data-state":e?"open":"closed","data-fullscreen":n,"data-expanded":i,className:"aid-window rounded-aid-window border bg-background text-foreground shadow-window",style:a,children:k.jsx(G6,{open:e,title:t,logoUrl:r,compact:n})})},$m=60,Y6=6,X6=8,U2={x:20,y:20},q6=639,$2="aid_pos",K6=(e,t,r=Y6)=>e*e+t*t>=r*r,pd=(e,t,r=$m,n=X6)=>{const i=typeof r=="number"?{width:r,height:r}:r,a=(o,s)=>Math.round(Math.min(Math.max(o,n),Math.max(n,s)));return{x:a(e.x,t.width-i.width-n),y:a(e.y,t.height-i.height-n)}},G2=(e,t,r,n)=>({x:n==="bottom-right"?e.x-t:e.x+t,y:e.y-r}),Z6=e=>{try{const t=e?.getItem($2);if(!t)return null;const r=JSON.parse(t);if(typeof r=="object"&&r!==null&&typeof r.x=="number"&&typeof r.y=="number"&&Number.isFinite(r.x)&&Number.isFinite(r.y))return{x:r.x,y:r.y}}catch{}return null},Q6=(e,t)=>{try{e?.setItem($2,JSON.stringify(t))}catch{}},J6={width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e8=({size:e=24})=>k.jsx("svg",{...J6,width:e,height:e,children:k.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),W2=()=>({width:window.innerWidth,height:window.innerHeight}),Gm=e=>({width:e.offsetWidth,height:e.offsetHeight}),t8=()=>{try{return window.localStorage}catch{return null}},Y2=H.forwardRef(({open:e,lang:t,corner:r,offset:n,draggable:i,unread:a=0,variant:o,label:s,shape:l,onOffsetChange:u,onToggle:f},d)=>{const p=H.useRef(null),v=H.useRef(!1),[g,y]=H.useState(null),x=g!==null,b=L=>{!i||L.button!==0||(p.current={pointerX:L.clientX,pointerY:L.clientY,offset:n,moved:!1},L.currentTarget.setPointerCapture(L.pointerId))},_=L=>{const R=p.current;if(!R)return;const O=L.clientX-R.pointerX,M=L.clientY-R.pointerY;!R.moved&&!K6(O,M)||(R.moved||(R.moved=!0,y({offset:R.offset,...Gm(L.currentTarget)})),u(pd(G2(R.offset,O,M,r),W2(),Gm(L.currentTarget))))},S=L=>{const R=p.current;if(p.current=null,L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId),!R?.moved)return;y(null),v.current=!0;const O=L.clientX-R.pointerX,M=L.clientY-R.pointerY;Q6(t8(),pd(G2(R.offset,O,M,r),W2(),Gm(L.currentTarget)))},T=()=>{if(v.current){v.current=!1;return}f()},E=r==="bottom-right"?"right":"left",D=o==="label"&&!e?s??Vn(t,"ask"):null;return k.jsxs(k.Fragment,{children:[g?k.jsx("span",{"data-testid":"launcher-origin","aria-hidden":"true","data-shape":l??"circle",className:"aid-launcher-origin",style:{[E]:g.offset.x,bottom:g.offset.y,width:g.width,height:g.height}}):null,k.jsxs("button",{ref:d,part:"launcher",type:"button","aria-label":`${D??Vn(t,e?"close":"open")}${a>0&&!e?`, ${Vn(t,"unreadAnswers",{count:a})}`:""}`,"aria-expanded":e,"data-dragging":x,"data-variant":D?"label":"icon","data-shape":l??"circle",className:"aid-launcher",style:{[E]:n.x,bottom:n.y},onPointerDown:b,onPointerMove:_,onPointerUp:S,onPointerCancel:S,onClick:T,children:[e?k.jsx(e8,{}):k.jsx(rd,{size:D?44:40,animated:!1,bare:!0}),D?k.jsx("span",{part:"launcher-label",className:"truncate",children:D}):null,a>0&&!e?k.jsx("span",{part:"badge",className:"aid-launcher-badge",children:a>9?"9+":a}):null]})]})});Y2.displayName="Launcher";const r8=e=>{const{state:t}=ye(),{turn:r,thread:n}=t,[i,a]=H.useState({turn:r,open:e}),[o,s]=H.useState(0);return(i.turn!==r||i.open!==e)&&(a({turn:r,open:e}),e?o!==0&&s(0):i.turn&&!r&&n?.messages.find(l=>l.id===i.turn?.assistantId)?.status==="done"&&s(o+1)),o},X2=H.forwardRef((e,t)=>{const r=r8(e.open);return k.jsx(Y2,{ref:t,...e,unread:r})});X2.displayName="UnreadLauncher";const Nu=(e,t,r)=>Math.min(r,Math.max(t,e)),n8={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",orange:"#ffa500",purple:"#800080",teal:"#008080",navy:"#000080",gray:"#808080",grey:"#808080"},q2=e=>{if(!/^[0-9a-f]+$/i.test(e)||![3,4,6,8].includes(e.length))return null;const t=e.length<=4?e.replace(/./g,n=>n+n):e,r=n=>parseInt(t.slice(n,n+2),16);return{r:r(0),g:r(2),b:r(4),a:t.length===8?r(6)/255:1}},K2=e=>{const t=e.replace(/\//g," ").replace(/,/g," ").trim().split(/\s+/).filter(Boolean);return t.length===3||t.length===4?t:null},vd=e=>{const t=Number(e);return e!==""&&Number.isFinite(t)?t:null},i8=e=>{if(e===void 0)return 1;const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(e.endsWith("%")?t/100:t,0,1)},Wm=e=>{const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(e.endsWith("%")?t/100*255:t,0,255)},Z2=e=>{const t=/^(-?[\d.]+)(deg|turn|rad|grad)?$/.exec(e);if(!t?.[1])return null;const r=vd(t[1]);if(r===null)return null;const n=t[2]??"deg";return((n==="turn"?r*360:n==="rad"?r*180/Math.PI:n==="grad"?r*.9:r)%360+360)%360},gd=e=>{const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(t,0,100)},md=({h:e,s:t,l:r,a:n})=>{const i=t/100,a=r/100,o=l=>(l+e/30)%12,s=l=>a-i*Math.min(a,1-a)*Math.max(-1,Math.min(o(l)-3,9-o(l),1));return{r:Math.round(s(0)*255),g:Math.round(s(8)*255),b:Math.round(s(4)*255),a:n}},a8=({r:e,g:t,b:r,a:n})=>{const i=e/255,a=t/255,o=r/255,s=Math.max(i,a,o),l=Math.min(i,a,o),u=(s+l)/2,f=s-l;if(f===0)return{h:0,s:0,l:u*100,a:n};const d=f/(1-Math.abs(2*u-1));let p;return s===i?p=(a-o)/f%6:s===a?p=(o-i)/f+2:p=(i-a)/f+4,{h:(p*60+360)%360,s:d*100,l:u*100,a:n}},Q2=e=>{const t=o8(e);if(!t)return null;const r=/^hsla?\((.*)\)$/.exec(e.trim().toLowerCase()),n=r?.[1]!==void 0?K2(r[1]):null;if(n){const[i,a,o]=[Z2(n[0]??""),gd(n[1]??""),gd(n[2]??"")];if(i!==null&&a!==null&&o!==null)return{h:i,s:a,l:o,a:t.a}}return a8(t)},o8=e=>{const t=e.trim().toLowerCase(),r=n8[t];if(r)return q2(r.slice(1));if(t.startsWith("#"))return q2(t.slice(1));const n=/^(rgba?|hsla?)\((.*)\)$/.exec(t);if(!n?.[1]||n[2]===void 0)return null;const i=K2(n[2]);if(!i)return null;const[a="",o="",s="",l]=i,u=i8(l);if(u===null)return null;if(n[1].startsWith("rgb")){const[v,g,y]=[Wm(a),Wm(o),Wm(s)];return v===null||g===null||y===null?null:{r:Math.round(v),g:Math.round(g),b:Math.round(y),a:u}}const[f,d,p]=[Z2(a),gd(o),gd(s)];return f===null||d===null||p===null?null:md({h:f,s:d,l:p,a:u})},J2=({r:e,g:t,b:r})=>{const n=i=>{const a=i/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*n(e)+.7152*n(t)+.0722*n(r)},eC=(e,t)=>{const[r,n]=[J2(e),J2(t)].sort((i,a)=>a-i);return(r+.05)/(n+.05)},yd=e=>Math.round(e*10)/10,mo=({h:e,s:t,l:r,a:n})=>`${yd(e)}, ${yd(t)}%, ${yd(r)}%${n<1?`, ${yd(n*100)/100}`:""}`,tC={h:210,s:40,l:98,a:1},rC={h:222.2,s:47.4,l:11.2,a:1},s8=e=>{const t=Q2(e);if(!t)return null;const r={...t,a:1},n={...r,l:Nu(r.l>70?r.l-6:r.l+8,0,100)},i={...r,l:Nu(r.l-10,0,100)},a=md(r),o=eC(a,md(tC)),s=o>=4.5||o>=eC(a,md(rC))?tC:rC;return{primary:mo(r),primaryHovered:mo(n),primaryPressed:mo(i),primaryForeground:mo(s),secondary:mo({...r,a:.1}),ring:mo({...r,a:.5})}},l8=(...e)=>{const t={};for(const r of e)if(r)for(const[n,i]of Object.entries(r))i===void 0||i===""||(t[n]=i);return t},u8=e=>{const t={},r=e.primary?s8(e.primary):null;r&&(t["--primary"]=r.primary,t["--primary-text"]=r.primary,t["--primary-hovered"]=r.primaryHovered,t["--primary-pressed"]=r.primaryPressed,t["--primary-foreground"]=r.primaryForeground,t["--secondary"]=r.secondary,t["--secondary-foreground"]=r.primary,t["--ring"]=r.ring),e.radius!==void 0&&e.radius!==""&&(t["--radius"]=typeof e.radius=="number"?`${e.radius}px`:e.radius),e.font&&(t["--aid-theme-font"]=e.font);const n=u=>{const f=u?Q2(u):null;return f?mo(f):null},i=n(e.background);if(i)for(const u of["--background","--card","--popover"])t[u]=i;const a=n(e.foreground);if(a)for(const u of["--foreground","--card-foreground","--popover-foreground","--secondary-foreground"])t[u]=a;const o=n(e.bubble);if(o)for(const u of["--secondary","--muted","--accent"])t[u]=o;const s=n(e.border);if(s)for(const u of["--border","--input"])t[u]=s;const l=(u,f)=>{typeof f=="number"&&Number.isFinite(f)&&(t[u]=`${f}px`)};return l("--aid-t-window-width",e.windowWidth),l("--aid-t-window-height",e.windowHeight),l("--aid-t-offset-x",e.offsetX),l("--aid-t-offset-y",e.offsetY),t},c8=(e,t)=>e==="dark"||e==="auto"&&t?"dark":"light",f8=(e,t,r={})=>{for(const n of Object.keys(r))n in t||e.style.removeProperty(n);for(const[n,i]of Object.entries(t))e.style.setProperty(n,i)},d8=(e,t)=>{e.classList.toggle("dark",t==="dark"),e.dataset.scheme=t},nC=(e,t)=>{const r=parseFloat(e);return Number.isFinite(r)?r:t},Ym=()=>{try{return window.localStorage}catch{return null}},iC=(e,t,r)=>nC(e.getPropertyValue(`--aid-${t}`),nC(e.getPropertyValue(`--aid-t-${t}`),r)),h8=e=>{const t=getComputedStyle(e);return{x:iC(t,"offset-x",U2.x),y:iC(t,"offset-y",U2.y)}},aC=()=>({width:window.innerWidth,height:window.innerHeight}),p8={scheme:"auto"},v8=(e,t)=>{const r=H.useSyncExternalStore(e.subscribe,()=>e.get().theme),n=H.useSyncExternalStore(e.subscribe,()=>e.get().adminTheme),i=oS("(prefers-color-scheme: dark)"),a=l8(p8,n,r),o=c8(a.scheme,i),s=H.useRef({}),l=JSON.stringify(u8(a));return H.useLayoutEffect(()=>{const u=JSON.parse(l);f8(t,u,s.current),s.current=u},[t,l]),H.useLayoutEffect(()=>{d8(t,o)},[t,o]),a},g8=e=>{const{store:t,api:r}=e,n=H.useSyncExternalStore(t.subscribe,()=>t.get().open),i=H.useSyncExternalStore(t.subscribe,()=>t.get().lang),a=H.useCallback(o=>{t.set({adminTheme:o})},[t]);return k.jsx(qz,{api:r,lang:i,open:n,onAdminTheme:a,children:k.jsx(m8,{...e})})},m8=({store:e,root:t,mode:r,corner:n,draggable:i,api:a})=>{const o=H.useSyncExternalStore(e.subscribe,()=>e.get().open),s=H.useSyncExternalStore(e.subscribe,()=>e.get().lang),l=v8(e,t),u=n??l.position??"bottom-right",f=oS(`(max-width: ${q6}px)`),d=H.useRef(null),[p,v]=H.useState(()=>pd(Z6(Ym())??h8(t),aC(),$m));H.useEffect(()=>{if(r!=="launcher")return;const j=()=>{const B=d.current,$=B?{width:B.offsetWidth,height:B.offsetHeight}:$m;v(K=>pd(K,aC(),$))};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[r]);const g=H.useCallback(()=>{e.set({open:!1})},[e]),y=H.useCallback(()=>{e.set({open:!e.get().open})},[e]),x=H.useRef(o);H.useEffect(()=>{x.current&&!o&&d.current?.focus({preventScroll:!0}),x.current=o},[o]);const b=l.title??Vn(s,"title"),_=tS(a.apiUrl),S=H.useMemo(()=>({animated:o,assetsBase:_}),[o,_]),[T,E]=H.useState({expanded:!1,byDashboard:!1}),{expanded:D}=T,L=r==="launcher"&&!f,R=H.useCallback(j=>{E({expanded:j,byDashboard:!1})},[]),O=H.useCallback(j=>{E(B=>kz(B,j,L))},[L]),M=l.scheme??"auto",P=H.useMemo(()=>({lang:s,scheme:M,expanded:D,canExpand:L,setExpanded:R,expandForDashboard:O,close:r==="launcher"?g:void 0,update:j=>{const B={...qk(Ym()),...j};_z(Ym(),B),e.set({...j.lang?{lang:j.lang}:{},theme:{...e.get().theme,...Kk(j)}})}}),[s,M,D,L,R,O,r,g,e]);return r==="window"?k.jsx(qg.Provider,{value:P,children:k.jsx(tm.Provider,{value:S,children:k.jsx(V2,{open:o,title:b,logoUrl:Yg(l.logoUrl),fullscreen:!1,onClose:g})})}):k.jsx(qg.Provider,{value:P,children:k.jsxs(tm.Provider,{value:S,children:[k.jsx("div",{part:"overlay",className:"aid-overlay","data-state":o?"open":"closed","aria-hidden":!0,onClick:g}),k.jsx(V2,{open:o,title:b,logoUrl:Yg(l.logoUrl),fullscreen:f,expanded:D&&!f,onClose:g}),o?null:k.jsx(X2,{ref:d,open:o,lang:s,corner:u,offset:p,draggable:i&&!f,variant:l.launcher,label:l.launcherLabel,shape:l.launcherShape,onOffsetChange:v,onToggle:y})]})})},oC="",y8=`${J3}
|
|
19
|
-
${
|
|
18
|
+
`).filter(l=>l.trim()!==""):[];return k.jsxs("div",{part:"empty",className:he("mx-auto flex w-full max-w-[640px] flex-col gap-5 px-4 pb-3",t?"pt-14":"pt-7"),children:[k.jsxs("div",{className:"flex flex-col items-center gap-2.5 text-center",children:[k.jsx("div",{part:"avatar",children:k.jsx(rd,{size:56,mood:e?"listen":"calm"})}),s.length>0?k.jsx("div",{part:"welcome",className:"flex max-w-[340px] flex-col gap-1 text-[15px] leading-normal",children:s.map((l,u)=>k.jsx("p",{className:he(u===0&&"text-xl font-semibold"),children:l},`${u}-${l}`))}):k.jsx("h2",{className:"m-0 text-2xl font-semibold tracking-tight",children:a("greeting")})]}),k.jsx(Fj,{onPick:r})]})},E2=()=>{const{t:e}=ye();return t=>{const r=`steps.${t.node}`;return e(b4(r)?r:"steps.unknown")}},D2=({step:e,position:t})=>{const{t:r}=ye(),n=E2();return k.jsxs(k.Fragment,{children:[n(e),t!=null&&e.total!=null?k.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",r("steps.counter",{done:t,total:e.total})]}):null,e.attempt>1?k.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",r("agent.attempt",{count:e.attempt})]}):null]})},M2=()=>k.jsx(vo,{className:"size-3 shrink-0 animate-spin text-primary motion-reduce:animate-none","aria-hidden":"true","data-testid":"step-spinner"}),jj=({steps:e,status:t,stopping:r})=>{const{t:n}=ye(),i=e.find(a=>a.status==="running");return t==="streaming"?k.jsxs(k.Fragment,{children:[k.jsx(M2,{}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:r?n("agent.stopping"):i?k.jsx(D2,{step:i,position:e.indexOf(i)+1}):n("agent.thinking")})]}):t==="stopped"?k.jsxs(k.Fragment,{children:[k.jsx(AS,{className:"size-3.5 shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.stopped")})]}):t==="error"?k.jsxs(k.Fragment,{children:[k.jsx(gS,{className:"size-3.5 shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.interrupted")})]}):k.jsxs(k.Fragment,{children:[k.jsx(da,{className:"size-3.5 shrink-0 text-mode-idle","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 truncate font-medium text-foreground",children:n("agent.done")})]})},Hj=({steps:e,status:t,stopping:r})=>{const{t:n}=ye(),i=E2();if(t==="streaming"){if(r)return n("agent.stopping");const a=e.find(o=>o.status==="running");return a?i(a):n("agent.thinking")}return n(t==="stopped"?"agent.stopped":t==="error"?"agent.interrupted":"agent.done")},L2="inline-flex min-h-[30px] max-w-full items-center gap-2 self-start rounded-full border bg-background py-1 pl-2 pr-2.5 text-left text-[13px] text-muted-foreground",Vj=H.memo(function(t){const{t:r}=ye(),[n,i]=H.useState(!1),{steps:a,status:o}=t,s=o==="streaming",l=Hj(t),u=k.jsx(k.Fragment,{children:k.jsx(jj,{...t})});return k.jsxs("div",{part:"steps",className:"flex flex-col gap-2 text-[13px] text-muted-foreground",children:[a.length>0?k.jsxs("button",{type:"button","aria-expanded":n,"aria-label":`${r(n?"agent.hideSteps":"agent.showSteps")}: ${l}`,onClick:()=>{i(!n)},className:he(L2,"hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",s&&"border-primary-35"),children:[u,n?k.jsx(Bs,{className:"size-3.5 shrink-0 rotate-180","aria-hidden":"true"}):k.jsx(Bs,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}):k.jsx("div",{className:he(L2,s&&"border-primary-35"),role:"status",children:u}),n&&a.length>0?k.jsx("ol",{"aria-label":r("agent.steps"),className:"m-0 flex list-none flex-col self-stretch rounded-xl border bg-background px-3.5 py-1.5",children:a.map((f,d)=>{const p=f.status==="running",v=p&&!s;return k.jsxs("li",{className:"flex min-h-[34px] items-center gap-2.5 border-b border-dashed last:border-b-0",children:[k.jsx("span",{className:"flex w-[18px] shrink-0 justify-center",children:p&&s?k.jsx(M2,{}):v?k.jsx(gS,{className:"size-3.5","aria-hidden":"true"}):k.jsx(da,{className:"size-3.5 text-mode-idle","aria-hidden":"true"})}),k.jsx("span",{className:he("min-w-0 flex-1 truncate",v?"text-muted-foreground":"text-foreground"),children:k.jsx(D2,{step:f})}),v?k.jsx("span",{className:"shrink-0 whitespace-nowrap",children:r("agent.unfinished")}):null]},f.id??`${f.node}-${d}`)})}):null]})}),Uj=(e,t)=>{const r=(e.split(/[?#]/)[0]??"").split("/").filter(Boolean).pop();if(!r||/^[0-9a-f-]{36}$/i.test(r))return t;try{return decodeURIComponent(r)}catch{return r}},$j=e=>{try{return new URL(e,window.location.href).host}catch{return null}},I2=({url:e,name:t,className:r,children:n})=>{const{api:i}=ye(),[a,o]=H.useState(!1);if(!(xu(e,i.apiUrl)!==null)){const l=go(e);return l?k.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:r,children:n}):k.jsx("span",{className:r,children:n})}return k.jsx("button",{type:"button",part:"attachment",className:he(r,a&&"opacity-70"),disabled:a,onClick:()=>{o(!0),i.attachment(e).then(l=>{_B(l,t)}).catch(()=>{}).finally(()=>{o(!1)})},children:n})},P2=({attachment:e})=>{const{api:t,lang:r,t:n}=ye(),i=FS(e.name||Uj(e.url,"file")),a=e.url&&xu(e.url,t.apiUrl)===null?$j(e.url):null,o="inline-flex max-w-full items-center gap-2.5 rounded-xl border bg-muted p-1.5 text-left text-foreground",s=k.jsxs(k.Fragment,{children:[k.jsx(Sm,{ext:km(i)}),k.jsxs("span",{className:"flex min-w-0 flex-col",children:[k.jsx("span",{className:"truncate text-[13px] font-medium leading-tight",children:i}),k.jsxs("span",{className:"flex items-center gap-1.5 text-2xs leading-tight text-muted-foreground",children:[a??(e.size?Cm(e.size,r):null),e.url?null:k.jsxs(k.Fragment,{children:[e.size?k.jsx("span",{"aria-hidden":"true",children:"·"}):null,k.jsx("span",{children:n("attachment.sending")}),k.jsx(vo,{className:"size-3 animate-spin motion-reduce:animate-none","aria-hidden":"true"})]})]})]}),e.url&&a?k.jsx(um,{className:"mr-1 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}):e.url?k.jsx(mS,{className:"mr-1 size-4 shrink-0 text-muted-foreground","aria-hidden":"true"}):null]});return e.url?k.jsxs(I2,{url:e.url,name:i,className:he(o,"transition-colors hover:bg-accent"),children:[a?null:k.jsxs("span",{className:"sr-only",children:[n("download"),": "]}),s]}):k.jsx("span",{className:o,children:s})},Gj=({url:e,alt:t})=>{const{api:r}=ye(),[n,i]=H.useState(null),[a,o]=H.useState(!1);return H.useEffect(()=>{let s=null,l=!1;return r.attachment(e).then(u=>{l?URL.revokeObjectURL(u):(s=u,i(u))},()=>{l||o(!0)}),()=>{l=!0,s&&URL.revokeObjectURL(s)}},[r,e]),a?k.jsx("span",{className:"text-muted-foreground",children:t||e}):n?k.jsx("img",{src:n,alt:t,className:"max-w-full rounded-lg"}):k.jsx(vo,{className:"size-4 animate-spin text-muted-foreground","aria-label":t})},Wj=8,Fm=({children:e})=>k.jsx("div",{className:"text-2xs text-muted-foreground",children:e}),Yj=({block:e,onAsk:t})=>{const{lang:r,t:n}=ye(),i=Array.isArray(e.sections)?e.sections:[],o=(Array.isArray(e.indicators)?e.indicators:[]).slice(0,Wj),s=Math.max(0,e.total-o.length),l=Array.isArray(e.examples)?e.examples.filter(u=>typeof u=="string"&&u):[];return k.jsxs("section",{part:"catalog",className:"flex min-w-0 flex-col rounded-xl border bg-card",children:[e.topic?k.jsxs("h3",{className:"m-0 flex items-center gap-2 border-b px-3.5 py-2.5 text-sm font-semibold",children:[k.jsx(ad,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),n("blocks.catalogTitle",{topic:e.topic})]}):null,k.jsxs("div",{className:"flex flex-col gap-2.5 px-3.5 py-3",children:[i.length>0?k.jsxs("div",{children:[k.jsx(Fm,{children:n("blocks.catalogSections")}),k.jsx("ul",{className:"m-0 list-none p-0",children:i.map(u=>k.jsxs("li",{className:"flex items-center gap-2 border-b py-[7px] text-[13px] last:border-b-0",children:[k.jsx(od,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1 leading-snug",children:u.path.join(" › ")}),k.jsx("span",{className:"whitespace-nowrap tabular-nums text-muted-foreground",children:Hn(u.count,r)})]},u.id))})]}):null,o.length>0?k.jsxs("div",{children:[k.jsx(Fm,{children:n("blocks.catalogIndicators")}),k.jsx("ul",{className:"m-0 list-none p-0",children:o.map(u=>k.jsxs("li",{className:"flex flex-col border-b py-1.5 last:border-b-0",children:[k.jsx("span",{className:"text-[13px] font-medium leading-snug",children:u.name}),u.unit||u.years?k.jsx("span",{className:"text-2xs text-muted-foreground",children:[am(u.unit),am(u.years)].filter(Boolean).join(" · ")}):null]},u.entity_id))}),s>0?k.jsx("p",{className:"m-0 pt-1 text-[13px] text-muted-foreground",children:n("blocks.catalogMore",{count:Hn(s,r)})}):null]}):null,l.length>0?k.jsxs("div",{className:"flex flex-col gap-1.5",children:[k.jsx(Fm,{children:n("blocks.catalogExamples")}),l.map(u=>k.jsxs("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-[10px] border bg-background px-2.5 py-2 text-left text-[13px] leading-snug transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",onClick:()=>{t(u)},children:[k.jsx(TF,{className:"shrink-0 text-primary","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:u})]},u)),k.jsx("div",{className:"text-2xs text-muted-foreground",children:n("blocks.catalogSendHint")})]}):null]})]})},dd=({rootRef:e,question:t,tone:r,children:n})=>{const{t:i}=ye();return k.jsxs("section",{part:"clarification",ref:e,role:"group","aria-label":i("blocks.clarification"),"data-state":r,className:he("overflow-hidden rounded-[14px] border",r==="open"&&"border-primary-30 bg-card",r==="done"&&"bg-card",r==="expired"&&"bg-muted"),children:[k.jsx("div",{className:"flex items-center gap-2 px-3.5 pb-1 pt-3",children:k.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground",children:[k.jsx(wS,{className:"size-3","aria-hidden":"true"}),i("blocks.clarification")]})}),k.jsx("p",{className:"m-0 px-3.5 pb-2.5 text-[15px] font-medium leading-snug",children:t}),n]})},N2=({children:e})=>k.jsx("kbd",{className:"inline-flex h-4 min-w-4 items-center justify-center rounded border border-current/40 px-1 font-sans text-2xs leading-none opacity-80",children:e}),Bm=({children:e})=>k.jsx("div",{className:"flex items-center gap-2 border-t px-3.5 py-2.5 text-[13px] text-muted-foreground",children:e}),Xj=2**31-1,qj=(e,t)=>{const[r,n]=H.useState(()=>new Date);return H.useEffect(()=>{if(!t)return;const i=Date.parse(e)-Date.now();if(!(i>0))return;const a=window.setTimeout(()=>{n(new Date)},Math.min(i+50,Xj));return()=>{window.clearTimeout(a)}},[e,t]),r},Kj=({block:e,isLastInBranch:t,question:r,reply:n,disabled:i,onAsk:a})=>{const{t:o}=ye(),s=H.useRef(null),l=qj(e.expires_at,t),u=Ek(e,{isLastInBranch:t,now:l}),[f,d]=H.useState(""),p=H.useRef(!1),[v,g]=H.useState(!1),y=e.options,x=i||v,b=(B,$=B.label)=>{if(p.current||i)return;p.current=!0,g(!0);const K=a($,{clarification_id:e.id,slot:e.slot,value:B.value,free_text:null});Promise.resolve(K).then(Z=>{Z===!1&&(p.current=!1,g(!1))})},_=H.useRef(b);H.useEffect(()=>{_.current=b});const S=e.type==="plan_confirm",T=y.find(B=>B.value===e.default)??y[0],E=y.find(B=>B!==T),D=S?[...T?[{option:T,text:o("blocks.continue")}]:[],...E?[{option:E,text:o("blocks.cancelPlan")}]:[]]:y.slice(0,J4).map(B=>({option:B,text:B.label})),L=H.useRef(D);H.useEffect(()=>{L.current=D});const R=u==="open"&&!x,O=D.length;H.useEffect(()=>{if(!R||O===0)return;const B=s.current?.getRootNode();if(!B)return;const $=K=>{const Z=K;if(Z.defaultPrevented||Z.ctrlKey||Z.metaKey||Z.altKey||Z.repeat||iF(Z.composedPath()[0]))return;const re=Number(Z.key),Y=Number.isInteger(re)&&re>=1?L.current[re-1]:void 0;Y&&(Z.preventDefault(),_.current(Y.option,Y.text))};return B.addEventListener("keydown",$),()=>{B.removeEventListener("keydown",$)}},[R,O]);const M=u==="answered"&&r!==""&&n===r;if(u==="answered"&&!M)return k.jsx(dd,{rootRef:s,question:e.question,tone:"done",children:n?k.jsxs(Bm,{children:[k.jsx(da,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.chosen",{label:n})})]}):null});if(u==="expired"||M)return k.jsx(dd,{rootRef:s,question:e.question,tone:"expired",children:k.jsxs(Bm,{children:[k.jsx(sm,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.expired")}),r&&!M?k.jsxs(Be,{variant:"input",size:"sm",className:"gap-1.5",disabled:i,onClick:()=>{a(r)},children:[k.jsx(TS,{"aria-hidden":"true"}),o("blocks.askAgain")]}):null]})});if(S){const[B,$]=D;return k.jsx(dd,{rootRef:s,question:e.question,tone:"open",children:k.jsxs("div",{className:"flex flex-wrap gap-2 px-2.5 pb-2.5",children:[B?k.jsxs(Be,{size:"sm",disabled:x,onClick:()=>{b(B.option,B.text)},children:[k.jsx(N2,{children:"1"}),B.text]}):null,$?k.jsxs(Be,{variant:"input",size:"sm",disabled:x,onClick:()=>{b($.option,$.text)},children:[k.jsx(N2,{children:"2"}),$.text]}):null]})})}const P=y.length>=Q4,j=P?az(y,f):y;return k.jsxs(dd,{rootRef:s,question:e.question,tone:"open",children:[k.jsxs("div",{className:"flex flex-col gap-1.5 px-2.5 pb-2.5",children:[P?k.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2.5 text-sm focus-within:border-primary focus-within:ring-[3px] focus-within:ring-secondary",children:[k.jsx(Su,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{type:"search",value:f,placeholder:o("blocks.findOption"),"aria-label":o("blocks.findOption"),className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",onChange:B=>{d(B.target.value)}})]}):null,j.length>0?k.jsx("ul",{"aria-label":o("blocks.options"),className:"m-0 flex list-none flex-col gap-1.5 p-0",children:j.map(B=>{const $=y.indexOf(B)+1;return k.jsx("li",{children:k.jsxs("button",{type:"button",disabled:x,className:he("flex w-full items-start gap-3 rounded-[10px] border bg-background px-3 py-[9px] text-left transition-colors motion-reduce:transition-none","hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:bg-muted disabled:text-disabled-foreground"),onClick:()=>{b(B)},children:[k.jsx("span",{className:"mt-px flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-md border text-2xs font-semibold tabular-nums text-muted-foreground",children:$}),k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[k.jsxs("span",{className:"text-sm font-medium leading-snug",children:[B.label,B.value===e.default?k.jsx("span",{className:"ml-1.5 whitespace-nowrap rounded-full bg-muted px-1.5 py-px text-2xs font-normal text-muted-foreground",children:o("blocks.default")}):null]}),B.hint?k.jsx("span",{className:"text-[13px] leading-snug text-muted-foreground",children:B.hint}):null]})]})},B.value)})}):k.jsx("p",{className:"px-1 py-2 text-sm text-muted-foreground",children:o("searchEmpty")})]}),e.allow_free_text?k.jsxs(Bm,{children:[k.jsx(wS,{className:"shrink-0","aria-hidden":"true"}),k.jsx("span",{className:"min-w-0 flex-1",children:o("blocks.freeTextHint")})]}):null]})},Zj=10,Qj=({section:e})=>{const{t}=ye(),r=e.latest_period,n=e.shape==="trend",i=n?[]:Du(e,{period:r,mode:"value",base:"median"}),a=i.slice(0,Zj);return k.jsxs("div",{part:"dashboard-preview",className:"flex min-w-0 flex-col gap-3 rounded-xl bg-[hsl(var(--chart-card))] px-4 py-3.5",children:[k.jsxs("div",{className:"min-w-0",children:[k.jsx("p",{className:"text-sm font-semibold leading-snug",children:e.title}),n?null:k.jsxs("p",{className:"text-2xs text-muted-foreground",children:[r,", ",e.unit.label]})]}),k.jsx(n2,{compact:!0,section:e,period:r,label:t("chart.label",{title:e.title,period:r}),rows:a,national:r2(e,r,a.map(o=>o.value))}),i.length>a.length?k.jsx("p",{className:"text-2xs text-muted-foreground",children:t("chart.top",{n:a.length,total:i.length})}):null]})},hd=e=>e.type==="number"||e.type==="integer",Jj=(e,t,r)=>hd(e)?Hn(aF(t),r,e.type==="integer"?0:void 0):am(t)||"—",e6={asc:pS,desc:hS},t6=({block:e})=>{const{lang:t,t:r}=ye(),[n,i]=H.useState(),[a,o]=H.useState("asc"),[s,l]=H.useState(1),[u,f]=H.useState(""),d=Array.isArray(e.columns)?e.columns:[],p=rz({...e,columns:d,data:Array.isArray(e.data)?e.data:[]},{...n?{sortKey:n,dir:a}:{},page:s,query:u}),v=d.some(y=>y.type==="string"),g=y=>{y===n?o(x=>x==="asc"?"desc":"asc"):(i(y),o("asc")),l(1)};return k.jsxs("div",{part:"data-table",className:"flex min-w-0 flex-col gap-2",children:[v?k.jsxs("label",{className:"flex h-8 items-center gap-2 rounded-md border border-input bg-background px-2.5 text-sm focus-within:border-primary focus-within:ring-[3px] focus-within:ring-secondary",children:[k.jsx(Su,{className:"shrink-0 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{type:"search",value:u,placeholder:r("blocks.tableSearch"),"aria-label":r("blocks.tableSearch"),className:"min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground",onChange:y=>{f(y.target.value),l(1)}})]}):null,k.jsxs("div",{className:"max-w-full overflow-x-auto overscroll-x-contain rounded-[10px] border bg-background",children:[k.jsxs("table",{className:"w-full border-collapse text-[13.5px]","aria-label":r("blocks.table"),children:[k.jsx("thead",{children:k.jsx("tr",{className:"border-b bg-muted",children:d.map(y=>{const x=y.key===n,b=x?e6[a]:gF;return k.jsx("th",{scope:"col","aria-sort":x?a==="asc"?"ascending":"descending":"none",className:he("p-0 font-semibold",hd(y)?"text-right":"text-left"),children:k.jsxs("button",{type:"button",className:he("inline-flex w-full items-center gap-1 whitespace-nowrap px-3 py-[7px] text-[13.5px] font-semibold text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",hd(y)&&"flex-row-reverse"),onClick:()=>{g(y.key)},children:[k.jsx("span",{children:y.title}),y.unit?k.jsxs("span",{className:"font-normal",children:[", ",y.unit]}):null,k.jsx(b,{className:he("shrink-0 text-muted-foreground",!x&&"opacity-50"),"aria-hidden":"true"})]})},y.key)})})}),k.jsx("tbody",{children:p.rows.map((y,x)=>k.jsx("tr",{className:"border-b last:border-b-0",children:d.map(b=>k.jsx("td",{className:he("px-3 py-[7px] align-top",hd(b)?"whitespace-nowrap text-right tabular-nums":"min-w-32"),children:Jj(b,y[b.key],t)},b.key))},p.from+x))})]}),p.total===0?k.jsx("p",{className:"px-3 py-3 text-center text-sm text-muted-foreground",children:r(u?"searchEmpty":"blocks.tableEmpty")}):null]}),p.pages>1?k.jsxs("div",{className:"flex items-center justify-end gap-1 text-2xs tabular-nums text-muted-foreground",children:[k.jsx(Be,{variant:"ghost",size:"icon",className:"size-7",disabled:p.page<=1,"aria-label":r("blocks.prevPage"),onClick:()=>{l(p.page-1)},children:k.jsx(vS,{"aria-hidden":"true"})}),k.jsx("span",{"aria-live":"polite",children:r("blocks.page",{a:p.page,b:p.pages})}),k.jsx(Be,{variant:"ghost",size:"icon",className:"size-7",disabled:p.page>=p.pages,"aria-label":r("blocks.nextPage"),onClick:()=>{l(p.page+1)},children:k.jsx(od,{"aria-hidden":"true"})})]}):null,e.truncated?k.jsx("p",{className:"text-2xs text-muted-foreground",children:r("blocks.truncated",{n:Array.isArray(e.data)?e.data.length:0})}):null]})},jm="inline-flex min-h-[30px] max-w-full items-center gap-1.5 rounded-lg bg-muted px-2.5 py-1 text-[13px]",r6=["sex","age","urban_rural","activity","item"],n6=e=>r6.includes(e),Hm=({label:e,children:t,title:r})=>k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"shrink-0 whitespace-nowrap text-muted-foreground",children:e}),k.jsx("span",{className:"min-w-0 truncate font-medium",title:r,children:t})]}),Vm=({label:e,children:t,className:r})=>k.jsx("li",{className:he(jm,r),title:e,children:k.jsx(Hm,{label:e,children:t})}),i6=({block:e,question:t,onAsk:r})=>{const{t:n}=ye(),[i,a]=H.useState(!1),o=H.useId(),s=e.indicators.map(d=>d.name).join(", "),l=e.territories.map(d=>d.name).join(", "),u=e.breakdown&&n6(e.breakdown)?n(`blocks.breakdown.${e.breakdown}`):"",f=e.alternatives.length>0&&t!=="";return k.jsxs("div",{part:"plan",role:"group","aria-label":n("blocks.passport"),className:"flex flex-col gap-1.5",children:[k.jsx("div",{className:"text-2xs text-muted-foreground",children:n("blocks.passport")}),k.jsxs("ul",{"aria-label":n("blocks.passport"),className:"m-0 flex list-none flex-wrap items-center gap-1.5 p-0",children:[s?f?k.jsxs("li",{className:"relative max-w-full",children:[k.jsxs("button",{type:"button",className:he(jm,"border border-border bg-background transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",i&&"border-primary ring-[3px] ring-secondary"),title:s,"aria-haspopup":"menu","aria-expanded":i,"aria-controls":o,onClick:()=>{a(d=>!d)},children:[k.jsx(Hm,{label:n("blocks.indicator"),children:s}),k.jsx(Bs,{className:he("shrink-0 text-muted-foreground transition-transform motion-reduce:transition-none",i&&"rotate-180"),"aria-hidden":"true"})]}),i?k.jsxs("div",{id:o,role:"menu","aria-label":n("blocks.alternatives"),className:"absolute left-0 top-full z-20 mt-1 flex min-w-[220px] max-w-[min(360px,80vw)] flex-col rounded-md border bg-background p-1 shadow-pop",children:[k.jsx("div",{className:"px-2.5 pb-1 pt-1.5 text-2xs text-muted-foreground",children:n("blocks.alternatives")}),e.alternatives.map(d=>k.jsx("button",{type:"button",role:"menuitem",className:"flex min-h-9 w-full items-center rounded-md px-2.5 py-1.5 text-left text-sm transition-colors hover:bg-accent focus-visible:bg-accent focus-visible:outline-none motion-reduce:transition-none",onClick:()=>{a(!1),r(`${t} — ${d.name}`)},children:d.name},d.id))]}):null]}):k.jsx(Vm,{label:n("blocks.indicator"),children:s}):null,l?k.jsx(Vm,{label:n("blocks.territory"),children:l}):null,e.period.label?k.jsxs("li",{className:he(jm,e.period.substituted&&"border border-warning/40"),title:e.period.reason??n("blocks.period"),children:[k.jsx(Hm,{label:n("blocks.period"),children:e.period.label}),e.period.substituted?k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-muted-foreground","aria-hidden":"true",children:"·"}),k.jsx("span",{className:"text-warn-text",children:n("blocks.substituted")})]}):null]}):null,u?k.jsx(Vm,{label:n("blocks.breakdown"),children:u}):null]})]})},R2="gap-1.5 text-[13px]",O2="gap-1.5 text-[13px] text-muted-foreground hover:text-foreground",a6=({text:e})=>{const{t}=ye(),[r,n]=H.useState(!1),i=H.useRef(void 0);return H.useEffect(()=>()=>{window.clearTimeout(i.current)},[]),k.jsxs(Be,{part:"copy",variant:"ghost",size:"sm",className:O2,onClick:()=>{gm(e).then(a=>{a&&(n(!0),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{n(!1)},2e3))})},children:[r?k.jsx(da,{"aria-hidden":"true"}):k.jsx(lm,{"aria-hidden":"true"}),t(r?"copied":"copy")]})},o6=({message:e,isLastInBranch:t,onAsk:r,children:n,dashboardOpen:i=!1,onToggleDashboard:a})=>{const{path:o,t:s}=ye(),[l,u]=H.useState(!1),{blocks:f}=e,d=Oi(f,"plan"),p=Oi(f,"table"),v=Oi(f,"catalog"),g=Oi(f,"clarification"),{question:y,reply:x}=tF(o,e.id),b=e.status==="streaming",_=d?.methodology?go(d.methodology.url):null,S=f.length>0&&!b?iz(e):"",T=!b&&e.status!=="error"&&Kf(e.id),E=Oi(f,"dashboard"),D=E?.sections[0],L=T&&E!==void 0,R=L?a:void 0,O=uS(f),M=b?[]:eF(f);return k.jsxs(k.Fragment,{children:[d?k.jsx(i6,{block:d,question:y,onAsk:r}):null,n,v?k.jsx(Yj,{block:v,onAsk:r}):null,g?k.jsx(Kj,{block:g,isLastInBranch:t,question:y,reply:x,disabled:b,onAsk:r}):null,D?k.jsx(Qj,{section:D}):null,p&&l?k.jsx(t6,{block:p}):null,M.length>0?k.jsx(c2,{files:M}):null,T?k.jsx(f2,{messageId:e.id,block:O}):null,f.length>0&&!b?k.jsxs("div",{part:"answer-actions",role:"group",className:"flex flex-wrap items-center gap-1.5",children:[p?k.jsxs(Be,{part:"data-toggle",variant:"input",size:"sm",className:R2,"aria-expanded":l,onClick:()=>{u(P=>!P)},children:[k.jsx(OF,{"aria-hidden":"true"}),s(l?"blocks.hideData":"blocks.data")]}):null,R?k.jsxs(Be,{part:"dashboard-toggle","data-message-id":e.id,variant:"input",size:"sm",className:he(R2,i&&"border-primary bg-secondary text-secondary-foreground"),"aria-expanded":i,onClick:()=>{R(e.id)},children:[k.jsx(yF,{"aria-hidden":"true"}),s(i?"blocks.hideDashboard":"blocks.dashboard")]}):null,L?k.jsx(a2,{messageId:e.id,block:O}):null,d?.methodology&&_?k.jsx(Be,{part:"methodology",variant:"ghost",size:"sm",className:O2,asChild:!0,children:k.jsxs("a",{href:_,target:"_blank",rel:"noopener noreferrer",title:d.methodology.title,children:[k.jsx(ad,{"aria-hidden":"true"}),s("blocks.methodology")]})}):null,S?k.jsx(a6,{text:S}):null]}):null]})},s6=5e4,z2=2e5,l6=H.lazy(()=>Promise.resolve().then(()=>kae).then(e=>({default:e.MarkdownImpl}))),u6=H.memo(function({children:t,streaming:r=!1,className:n}){const i=k.jsx("span",{className:"whitespace-pre-wrap",children:t.length>z2?`${t.slice(0,z2)}…`:t});return k.jsxs("div",{part:"markdown",className:he("min-w-0 break-words text-[15px] leading-[1.65] text-foreground",n),children:[t.length>s6?i:k.jsx(Zg,{fallback:i,children:k.jsx(H.Suspense,{fallback:i,children:k.jsx(l6,{children:t})})}),r?k.jsx("span",{"aria-hidden":"true",className:"ml-0.5 inline-block h-[17px] w-[7px] translate-y-[3px] rounded-sm bg-primary animate-pulse motion-reduce:animate-none"}):null]})}),Iu="size-7 shrink-0 text-muted-foreground hover:text-foreground",F2=({messageId:e,disabled:t})=>{const{index:r,switchBranch:n,t:i}=ye(),{list:a,position:o}=Uz(r,e);if(a.length<2||o<0)return null;const s=a[o-1],l=a[o+1];return k.jsxs("div",{part:"branch",className:"flex items-center text-[13px] tabular-nums text-muted-foreground",role:"group","aria-label":i("branch.label"),children:[k.jsx(Be,{variant:"ghost",size:"icon",className:Iu,disabled:t||!s,"aria-label":i("branch.prev"),onClick:()=>{s&&n(s.id)},children:k.jsx(vS,{"aria-hidden":"true"})}),k.jsxs("span",{"aria-live":"polite",className:"min-w-[30px] text-center",children:[o+1,"/",a.length]}),k.jsx(Be,{variant:"ghost",size:"icon",className:Iu,disabled:t||!l,"aria-label":i("branch.next"),onClick:()=>{l&&n(l.id)},children:k.jsx(od,{"aria-hidden":"true"})})]})},c6=({text:e})=>{const{t}=ye(),[r,n]=H.useState(!1),i=H.useRef(void 0);H.useEffect(()=>()=>{window.clearTimeout(i.current)},[]);const a=t(r?"copied":"copy");return k.jsx(Be,{part:"copy",variant:"ghost",size:"icon",className:Iu,"aria-label":a,title:a,onClick:()=>{gm(e).then(o=>{o&&(n(!0),window.clearTimeout(i.current),i.current=window.setTimeout(()=>{n(!1)},2e3))})},children:r?k.jsx(da,{"aria-hidden":"true"}):k.jsx(lm,{"aria-hidden":"true"})})},f6=({message:e})=>{const{rate:t,t:r}=ye(),[n,i]=H.useState(),a=e.rating??0;return k.jsx("span",{part:"rating",role:"radiogroup","aria-label":r("rateGroup"),className:"inline-flex items-center",onKeyDown:Pm,onMouseLeave:()=>{i(void 0)},children:bB.map((o,s)=>{const l=o<=a,u=!l&&a===0&&n!==void 0&&o<=n;return k.jsx("button",{type:"button",role:"radio",tabIndex:Im(s,a-1),"aria-checked":a===o,"aria-label":r("rate",{count:o}),className:he("inline-flex size-[30px] items-center justify-center rounded-md text-muted-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",(l||u)&&"text-warning"),onMouseEnter:()=>{i(o)},onClick:()=>{t(e.id,o)},children:k.jsx(RF,{className:he("size-4",l&&"fill-current"),"aria-hidden":"true"})},o)})})},d6=({message:e,isLast:t,busy:r,ready:n,persisted:i,canFeedback:a,feedbackOpen:o,onOpenFeedback:s})=>{const{send:l,state:u,t:f}=ye(),d=e.status==="error",p=t&&n&&!r&&!u.limit.blocked;if(d&&!p)return null;const v=Eu.find(x=>x===e.feedbackReason),g=e.blocks.length>0,y=()=>{l({query:"",mode:u.mode??e.mode,regenerateOf:e.id})};return k.jsxs("div",{part:"actions",role:"toolbar","aria-label":f("actionsLabel"),className:he("flex min-h-8 flex-wrap items-center gap-0.5",!d&&e.rating==null&&pm),children:[n&&!d&&e.content&&!g?k.jsx(c6,{text:e.content}):null,p?d?k.jsxs(Be,{part:"regenerate",variant:"input",size:"sm",className:"gap-1.5",onClick:y,children:[k.jsx(CS,{"aria-hidden":"true"}),f("regenerate")]}):k.jsxs(Be,{part:"regenerate",variant:"ghost",size:"icon",className:he(Iu,"max-sm:h-8 max-sm:w-auto max-sm:gap-1.5 max-sm:px-2.5 max-sm:text-[13px]"),"aria-label":f("regenerate"),title:f("regenerate"),onClick:y,children:[k.jsx(CS,{"aria-hidden":"true"}),k.jsx("span",{className:"hidden max-sm:inline",children:f("regenerate")})]}):null,n&&!d?k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"mx-1.5 h-[18px] w-px bg-border","aria-hidden":"true"}),k.jsx(f6,{message:e})]}):null,k.jsx(F2,{messageId:e.id,disabled:r||!i}),a&&!o?k.jsx(Be,{variant:"link",size:"sm",onClick:s,children:e.feedback||v?f("feedbackEdit"):f("feedbackOpen")}):null]})},h6=({message:e,onClose:t})=>{const{saveFeedback:r,t:n}=ye(),[i,a]=H.useState(e.feedback),[o,s]=H.useState(!1),[l,u]=H.useState(!1),[f,d]=H.useState(()=>Eu.find(v=>v===e.feedbackReason)),p=()=>{s(!0),u(!1),r(e.id,i.trim(),f).then(v=>{s(!1),v?t():u(!0)})};return k.jsxs("form",{part:"feedback","aria-label":n("feedbackLabel"),onSubmit:v=>{v.preventDefault()},className:"flex flex-col gap-3 rounded-[14px] border bg-background p-3.5",children:[k.jsx("div",{className:"text-sm font-medium",children:n("feedback.reasonsLabel")}),k.jsx("div",{role:"radiogroup","aria-label":n("feedback.reasonsLabel"),className:"flex flex-wrap gap-1.5",onKeyDown:Pm,children:Eu.map((v,g)=>{const y=v===f;return k.jsx("button",{type:"button",role:"radio",tabIndex:Im(g,f?Eu.indexOf(f):-1),"aria-checked":y,disabled:o,onClick:()=>{d(y?void 0:v)},className:he("inline-flex h-[30px] items-center whitespace-nowrap rounded-full border px-3 text-[13px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60 motion-reduce:transition-none",y?"border-primary-50 bg-secondary font-medium text-secondary-foreground":"bg-background text-foreground hover:bg-muted"),children:n(`feedback.reason.${v}`)},v)})}),k.jsx(Nm,{autoFocus:!0,value:i,onChange:a,placeholder:n("feedbackPlaceholder"),"aria-label":n("feedbackLabel"),maxLength:vm,disabled:o,className:"min-h-[76px] rounded-md border border-input bg-background px-3 py-2.5 text-[15px] leading-normal focus:border-primary focus:ring-[3px] focus:ring-secondary"}),l?k.jsxs("div",{role:"alert",className:"flex items-start gap-1.5 text-[13px] text-destructive",children:[k.jsx(po,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),k.jsx("span",{children:n("ratingError")})]}):null,k.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k.jsxs("span",{className:he("mr-auto text-2xs tabular-nums text-muted-foreground",i.length>=vm&&"font-semibold text-warn-text"),children:[i.length,"/",vm]}),k.jsx(Be,{variant:"ghost",size:"sm",onClick:t,disabled:o,children:n("cancel")}),k.jsxs(Be,{size:"sm",disabled:o,onClick:p,children:[o?k.jsx(vo,{className:"size-3 animate-spin motion-reduce:animate-none","aria-hidden":"true"}):null,n("save")]})]})]})},p6=({message:e})=>{const{t}=ye(),r=Eu.find(n=>n===e.feedbackReason);return!r&&!e.feedback?null:k.jsxs("div",{part:"feedback-saved",className:"flex flex-col gap-1 rounded-xl bg-muted px-3 py-2.5 text-sm",children:[r?k.jsx("span",{className:"font-semibold",children:t(`feedback.reason.${r}`)}):null,e.feedback?k.jsx("span",{className:"whitespace-pre-line break-words",children:e.feedback}):null]})},v6=({message:e,isLast:t,busy:r,persisted:n,dashboardOpen:i,onToggleDashboard:a})=>{const{send:o,state:s,t:l}=ye(),[u,f]=H.useState(!1),d=e.status==="streaming",p=e.status==="error",v=c4(e.content,d),g=O4(d,e.status),y=!d&&n,x=y&&!p&&e.rating!=null&&e.rating<xB,b=!p&&(d||e.steps.length>0),_=Date.parse(e.createdAt)||0,S=g?"eureka":I4(e.status,e.content.length>0),T=(E,D)=>o({query:E,mode:s.mode??e.mode,...D?{clarification:D}:{}}).then(L=>L==="sent");return k.jsxs("article",{part:"message","data-role":"assistant","data-status":e.status,"aria-busy":d,className:"group flex items-start gap-3",children:[k.jsxs("div",{part:"avatar",className:"relative w-8 shrink-0 max-sm:hidden",children:[k.jsx(rd,{mood:S,size:32,animated:d||g}),p?k.jsx("span",{"data-testid":"avatar-caption",className:"absolute left-0 top-full mt-1 whitespace-nowrap text-2xs leading-none text-muted-foreground",children:l("agent.failed")}):null]}),k.jsxs("div",{part:p?"bubble assistant-bubble error-bubble":"bubble assistant-bubble",className:"flex min-w-0 flex-1 flex-col gap-3",children:[b?k.jsx(Vj,{steps:e.steps,status:e.status,startedAt:_,durationMs:e.durationMs,stopping:s.turn?.stopping===!0&&s.turn.assistantId===e.id}):null,p?k.jsxs("div",{role:"alert",className:"flex items-start gap-2.5 rounded-xl border border-error/30 bg-destructive-background px-3.5 py-3 text-sm",children:[k.jsx(po,{className:"mt-0.5 size-4 shrink-0 text-destructive","aria-hidden":"true"}),k.jsx("span",{children:e.content||l("errors.generic")})]}):null,k.jsx(o6,{message:e,isLastInBranch:t,onAsk:T,dashboardOpen:i,onToggleDashboard:a,children:e.content&&!p?k.jsx(u6,{streaming:d,children:v}):null}),e.attachments.length>0?k.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.attachments.map((E,D)=>k.jsx(P2,{attachment:E},E.id??`${E.name}-${D}`))}):null,e.status==="stopped"?k.jsxs("div",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:[k.jsx(yS,{className:"size-4 shrink-0","aria-hidden":"true"}),k.jsx("span",{children:l("agent.answerStopped")})]}):null,d?null:k.jsx(d6,{message:e,isLast:t,busy:r,ready:y,persisted:n,canFeedback:x,feedbackOpen:u,onOpenFeedback:()=>{f(!0)}}),x&&u?k.jsx(h6,{message:e,onClose:()=>{f(!1)}}):null,x&&!u?k.jsx(p6,{message:e}):null]})]})},g6=({message:e,onClose:t})=>{const{send:r,state:n,t:i}=ye(),a=H.useId(),[o,s]=H.useState(e.content),l=n.mode??e.mode,u=n.config?.max_query_chars??Uk,f=o.trim(),d=f!==e.content.trim(),p=o.length>u,v=f.length>0&&d&&!p&&!n.turn&&!n.limit.blocked,g=()=>{v&&(t(),r({query:f,mode:l,parentId:e.parentId??""}))};return k.jsxs("div",{part:"edit",onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),t())},className:"flex w-full max-w-[640px] flex-col gap-2 rounded-2xl border border-primary bg-background px-3 py-2.5 ring-[3px] ring-secondary",children:[k.jsx(Nm,{autoFocus:!0,value:o,onChange:s,"aria-label":i("editLabel"),"aria-invalid":p||void 0,"aria-describedby":a,className:"py-0.5 text-lg",onSubmit:g}),k.jsxs("div",{className:"flex items-center justify-end gap-2",children:[k.jsx(k2,{id:a,count:o.length,max:u,className:"mr-auto px-0"}),k.jsx(Be,{variant:"ghost",size:"sm",onClick:t,children:i("cancel")}),k.jsx(Be,{size:"sm",disabled:!v,onClick:g,children:i("send")})]})]})},m6=({message:e,busy:t,persisted:r})=>{const{t:n}=ye(),[i,a]=H.useState(!1);return k.jsx("div",{part:"message","data-role":"user",className:"group flex flex-col items-end gap-1.5",children:i?k.jsx(g6,{message:e,onClose:()=>{a(!1)}}):k.jsxs(k.Fragment,{children:[e.attachments.length>0?k.jsx("div",{className:"flex max-w-[78%] flex-wrap justify-end gap-1.5 max-sm:max-w-[88%]",children:e.attachments.map((o,s)=>k.jsx(P2,{attachment:o},o.id??`${o.name}-${s}`))}):null,k.jsx("div",{part:"bubble user-bubble",className:"max-w-[78%] whitespace-pre-wrap break-words rounded-[calc(var(--aid-c-radius)+6px)] rounded-br-[6px] bg-primary px-3.5 py-2.5 text-[15px] leading-normal text-primary-foreground max-sm:max-w-[88%]",children:e.content}),k.jsxs("div",{className:"flex min-h-7 items-center gap-0.5",children:[r?k.jsx(Be,{part:"edit-button",variant:"ghost",size:"icon",className:he(Iu,pm),disabled:t,"aria-label":n("edit"),title:n("edit"),onClick:()=>{a(!0)},children:k.jsx(LF,{"aria-hidden":"true"})}):null,k.jsx(F2,{messageId:e.id,disabled:t||!r})]})]})})},y6=H.memo(function({message:t,isLast:r,busy:n,dashboardOpen:i,onToggleDashboard:a}){const{t:o}=ye(),s=Kf(t.id),l=k.jsx("p",{part:"message-error",className:"text-sm text-muted-foreground",children:o("errors.render")});return k.jsx(Zg,{fallback:l,children:t.role==="user"?k.jsx(m6,{message:t,busy:n,persisted:s}):k.jsx(v6,{message:t,isLast:r,busy:n,persisted:s,dashboardOpen:i,onToggleDashboard:a})})}),B2=e=>e.scrollHeight-e.scrollTop-e.clientHeight,x6=({resetKey:e,followKey:t})=>{const r=H.useRef(null),n=H.useRef(null),i=H.useRef(!0),a=H.useRef(0),[o,s]=H.useState(!0),l=H.useCallback(()=>{const d=r.current;d&&(d.scrollTop=d.scrollHeight)},[]),u=H.useCallback(()=>{const d=r.current;if(!d)return;i.current=!0;const p=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;d.scrollTo({top:d.scrollHeight,behavior:p?"auto":"smooth"})},[]),f=H.useCallback(()=>{const d=r.current;if(!d)return;const p=B2(d)<OS;p?i.current=!0:d.scrollTop<a.current-1&&(i.current=!1),a.current=d.scrollTop,s(p)},[]);return H.useLayoutEffect(()=>{i.current=!0,l()},[e,t,l]),H.useEffect(()=>{const d=n.current,p=r.current;if(!d||!p||typeof ResizeObserver>"u")return;const v=new ResizeObserver(()=>{i.current&&l(),s(B2(p)<OS)});return v.observe(d),()=>{v.disconnect()}},[l]),{scrollRef:r,contentRef:n,onScroll:f,atBottom:o,scrollToBottom:u}},b6=()=>{const{state:e,path:t,t:r}=ye(),{state:n,toggle:i}=fa(),a=t.filter(v=>v.role==="user").length,{scrollRef:o,contentRef:s,onScroll:l,atBottom:u,scrollToBottom:f}=x6({resetKey:e.thread?.id??null,followKey:a}),d=e.turn!==null,p=t[t.length-1];return k.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[k.jsx("div",{ref:o,part:"messages",onScroll:l,"aria-live":"polite","aria-busy":d,className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:k.jsx("div",{ref:s,className:"mx-auto flex w-full max-w-[820px] flex-col gap-[22px] px-4 pb-4 pt-[18px]",children:t.map(v=>k.jsx(y6,{message:v,isLast:v===p,busy:d,dashboardOpen:v.id===n.messageId,onToggleDashboard:i},v.id))})}),u?null:k.jsxs("button",{part:"scroll-down",type:"button",className:"absolute bottom-3 left-1/2 inline-flex h-9 -translate-x-1/2 items-center gap-1.5 whitespace-nowrap rounded-full border bg-background pl-3 pr-3.5 text-[13px] font-medium text-foreground shadow-pop transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",onClick:f,children:[k.jsx(hS,{"aria-hidden":"true"}),r("scrollDown")]})]})},w6={error:"bg-error-background text-destructive",warning:"bg-warning-background text-warn-text",lock:"bg-muted text-muted-foreground"},j2=({tone:e,children:t})=>k.jsx("span",{className:he("flex size-[52px] items-center justify-center rounded-full",w6[e]),children:t}),_6=({kind:e,onRetry:t})=>{const{t:r}=ye();if(e==="loading")return k.jsxs("div",{part:"shell-status","data-state":"loading","aria-busy":"true",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx("span",{"aria-hidden":"true",className:"size-[26px] animate-spin rounded-full border-[3px] border-current border-r-transparent text-primary motion-reduce:animate-none"}),k.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:r("loading")})]});if(e==="siteBlocked")return k.jsxs("div",{part:"shell-status","data-state":"siteBlocked",role:"alert",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx(j2,{tone:"lock",children:k.jsx(xS,{className:"size-6","aria-hidden":"true"})}),k.jsx("p",{className:"max-w-[300px] text-lg font-semibold",children:r("shell.siteBlocked")}),k.jsx("p",{className:"max-w-[440px] text-xs text-muted-foreground",children:r("shell.siteBlockedHint")})]});const n=e==="overloaded";return k.jsxs("div",{part:"shell-status","data-state":n?"overloaded":"unavailable",role:"alert",className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-8 text-center",children:[k.jsx(j2,{tone:n?"warning":"error",children:n?k.jsx(sd,{className:"size-6","aria-hidden":"true"}):k.jsx(po,{className:"size-6","aria-hidden":"true"})}),k.jsx("p",{className:"max-w-[300px] text-lg font-semibold",children:r(n?"overloaded":"configError")}),t?k.jsxs(Be,{variant:"input",size:"sm",onClick:t,children:[k.jsx(TS,{"aria-hidden":"true"}),r("retry")]}):null]})},k6=()=>{const{state:e,reload:t}=ye(),r=$4(e);return r===null?null:k.jsx(_6,{kind:r,onRetry:r==="siteBlocked"?void 0:t})},S6="h-3 rounded-md bg-muted animate-pulse motion-reduce:animate-none",C6=()=>{const{t:e}=ye();return k.jsxs("div",{"aria-busy":"true",className:"min-h-0 flex-1 overflow-hidden",children:[k.jsxs("div",{className:"mx-auto flex w-full max-w-[820px] flex-col gap-[22px] px-4 pb-4 pt-[18px]",children:[k.jsx("div",{className:"flex justify-end",children:k.jsx("div",{className:"h-[38px] w-[62%] rounded-[18px] rounded-br-[6px] bg-muted animate-pulse motion-reduce:animate-none"})}),k.jsx("div",{className:"flex flex-col gap-2.5",children:[90,76,84,40].map(t=>k.jsx("div",{className:S6,style:{width:`${t}%`}},t))})]}),k.jsx("span",{role:"status",className:"sr-only",children:e("loading")})]})},T6=({composerRef:e,wide:t})=>{const{state:r,path:n}=ye(),[i,a]=H.useState(!1),o=!!r.config&&!r.loadingThread&&!r.configError,s=o&&n.length===0,l=f=>{e&&"current"in e&&e.current?.setText(f)};let u;return o?s?u=k.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain",children:k.jsx(Bj,{listening:i,wide:t,onPick:l})}):u=k.jsx(b6,{}):u=r.loadingThread&&r.config&&!r.configError?k.jsx(C6,{}):k.jsx(k6,{}),k.jsxs(k.Fragment,{children:[u,k.jsx(Pj,{composerRef:e,onDraftChange:a})]})},Pu="size-8 shrink-0 text-muted-foreground hover:text-foreground",A6=({historyHidden:e,onShowHistory:t,onOpenSettings:r,title:n,logoUrl:i,threadTitle:a,tabs:o,inert:s=!1})=>{const{t:l,newChat:u}=ye(),f=Kg(),d=H.useRef(null);fo(d,s);const p=a!==void 0&&a!==""?a:e?n:"";return k.jsxs("div",{ref:d,part:"toolbar",className:"flex h-toolbar shrink-0 items-center gap-1 border-b py-0 pl-2.5 pr-2",children:[e?k.jsx(Be,{part:"history-toggle",variant:"ghost",size:"icon",className:Pu,"aria-expanded":!1,"aria-label":l("history"),title:l("history"),onClick:t,children:k.jsx(DF,{"aria-hidden":"true"})}):null,e&&i?k.jsx("img",{part:"logo",src:i,alt:"",referrerPolicy:"no-referrer",className:"size-6 shrink-0 rounded-md object-contain"}):null,k.jsx("span",{className:"min-w-0 flex-1 truncate px-1.5 text-sm font-semibold",children:p}),o,k.jsx(Be,{variant:"ghost",size:"icon",className:Pu,"aria-label":l("newChat"),title:l("newChat"),onClick:u,children:k.jsx(SS,{"aria-hidden":"true"})}),f.canExpand?k.jsx(Be,{part:"expand",variant:"ghost",size:"icon",className:Pu,"aria-label":f.expanded?l("shrink"):l("expand"),title:f.expanded?l("shrink"):l("expand"),onClick:()=>{f.setExpanded(!f.expanded)},children:f.expanded?k.jsx(kS,{"aria-hidden":"true"}):k.jsx(bS,{"aria-hidden":"true"})}):null,k.jsx(Be,{part:"settings-button",variant:"ghost",size:"icon",className:Pu,"aria-label":l("settings"),title:l("settings"),onClick:r,children:k.jsx(NF,{"aria-hidden":"true"})}),f.close?k.jsx(Be,{part:"close",variant:"ghost",size:"icon",className:Pu,"aria-label":l("close"),title:l("close"),onClick:f.close,children:k.jsx(Cu,{"aria-hidden":"true"})}):null]})},E6="flex shrink-0 flex-col border-r duration-200 animate-in fade-in slide-in-from-left-2 motion-reduce:animate-none",D6="w-side bg-muted",M6="absolute inset-y-0 left-0 z-30 w-side-over max-w-full bg-muted shadow-side",L6=({title:e,logoUrl:t,onHide:r})=>{const{t:n}=ye();return k.jsxs("div",{part:"header",className:"flex h-side-head shrink-0 items-center gap-2.5 pl-3.5 pr-2",children:[t?k.jsx("img",{part:"logo",src:t,alt:"",referrerPolicy:"no-referrer",className:"size-7 shrink-0 rounded-lg object-cover"}):k.jsx(rd,{size:28,animated:!1}),k.jsx("span",{part:"title",className:"min-w-0 flex-1 truncate text-[15px] font-bold",children:e}),k.jsx(Be,{variant:"ghost",size:"icon",className:"size-8 text-muted-foreground hover:text-foreground","aria-label":n("closeHistory"),title:n("closeHistory"),onClick:r,children:k.jsx(EF,{"aria-hidden":"true"})})]})},I6=({onClick:e})=>{const{t}=ye();return k.jsxs("button",{part:"new-chat",type:"button",onClick:e,className:"flex h-9 w-full items-center gap-2.5 rounded-md border bg-background pl-3 pr-2.5 text-left text-sm font-medium transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",children:[k.jsx(SS,{className:"size-4","aria-hidden":"true"}),t("newChat")]})},P6=({name:e,onConfirm:t,onCancel:r})=>{const{t:n}=ye(),i=H.useRef(null);return H.useEffect(()=>{i.current?.querySelector("[data-cancel]")?.focus()},[]),k.jsxs("div",{ref:i,role:"alertdialog","aria-label":n("deleteConfirm"),onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),r())},className:"my-0.5 flex flex-col gap-2 rounded-[10px] border border-error/35 bg-destructive-background p-2.5",children:[k.jsx("div",{className:"text-[13px] font-semibold",children:n("deleteConfirm")}),k.jsx("div",{className:"truncate text-2xs text-muted-foreground",children:e}),k.jsxs("div",{className:"flex gap-2",children:[k.jsx(Be,{variant:"destructive",size:"xs",onClick:t,children:n("deleteYes")}),k.jsx(Be,{variant:"ghost",size:"xs","data-cancel":!0,onClick:r,children:n("deleteNo")})]})]})},N6=(e,t)=>{let r="";const n=[];let i=0;for(const s of e){const l=s.toLowerCase();n.push(...Array.from({length:l.length},()=>i)),r+=l,i+=s.length}n.push(i);const a=r.indexOf(t);if(a<0)return null;let o=a+t.length;for(;o<n.length&&n[o]===n[o-1];)o+=1;return[n[a]??0,n[o]??e.length]},R6=({text:e,query:t})=>{const r=t.trim().toLowerCase(),n=r?N6(e,r):null;if(!n)return k.jsx(k.Fragment,{children:e});const[i,a]=n;return k.jsxs(H.Fragment,{children:[e.slice(0,i),k.jsx("mark",{className:"rounded-[3px] bg-hl px-px text-inherit",children:e.slice(i,a)}),e.slice(a)]})},O6=({groups:e,query:t,activeId:r,confirmId:n,onOpen:i,onAskDelete:a,onCancelDelete:o,onDelete:s})=>{const{t:l}=ye();return k.jsx(k.Fragment,{children:e.map(([u,f])=>k.jsxs("section",{className:"pb-1","aria-label":l(u),children:[k.jsx("h3",{className:"px-2 pb-1 pt-3.5 text-2xs font-medium text-muted-foreground",children:l(u)}),k.jsx("ul",{className:"flex flex-col gap-px",children:f.map(d=>{const p=d.id===r,v=d.title||l("untitled");return n===d.id?k.jsx("li",{children:k.jsx(P6,{name:v,onConfirm:()=>{s(d.id)},onCancel:o})},d.id):k.jsxs("li",{className:"group relative",children:[k.jsx("button",{part:"thread-item",type:"button","aria-current":p?"page":void 0,title:v,onClick:()=>{i(d.id)},className:he("flex min-h-9 w-full items-center rounded-lg py-1 pl-2.5 pr-9 text-left text-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none",p&&"bg-background font-medium shadow-[inset_0_0_0_1px_var(--aid-c-border)] hover:bg-background"),children:k.jsx("span",{className:"min-w-0 truncate",children:k.jsx(R6,{text:v,query:t})})}),k.jsx(Be,{variant:"ghost",size:"icon",className:he("absolute right-1 top-1/2 size-7 -translate-y-1/2 text-muted-foreground",!p&&pm),"aria-label":`${l("delete")}: ${v}`,onClick:()=>{a(d.id)},children:k.jsx(zF,{"aria-hidden":"true"})})]},d.id)})})]},u))})},Um=({icon:e,children:t})=>k.jsxs("div",{className:"flex flex-col items-center gap-1.5 px-3 py-6 text-center text-sm text-muted-foreground",children:[e,t]}),z6=[82,64,90,58,76,70],F6=({query:e})=>{const{state:t,t:r,refreshThreads:n}=ye();return t.threadsLoaded?e.trim()!==""?k.jsx(Um,{icon:k.jsx(Su,{"aria-hidden":"true"}),children:k.jsx("span",{children:r("searchEmpty")})}):t.threadsError?k.jsxs(Um,{icon:k.jsx(po,{"aria-hidden":"true"}),children:[k.jsx("span",{children:r("historyError")}),k.jsx(Be,{variant:"input",size:"xs",onClick:n,children:r("retry")})]}):k.jsx(Um,{icon:k.jsx(_S,{"aria-hidden":"true"}),children:k.jsx("span",{children:r("historyEmpty")})}):k.jsxs("div",{"aria-busy":"true",className:"flex flex-col",children:[z6.map(i=>k.jsx("div",{className:"flex min-h-9 items-center px-2.5",children:k.jsx("span",{className:"h-[11px] animate-pulse rounded-md bg-border motion-reduce:animate-none",style:{width:`${i}%`}})},i)),k.jsx("span",{role:"status",className:"sr-only",children:r("loading")})]})},B6=(e,t,r)=>{id(e,t);const n=H.useRef(r);H.useEffect(()=>{n.current=r}),H.useEffect(()=>{if(!t)return;const a=o=>{if(o.key!=="Escape"||o.defaultPrevented)return;const s=o.composedPath(),l=s[0];l instanceof HTMLInputElement&&l.type==="search"&&l.value!==""||s.some(u=>u instanceof HTMLElement&&u.getAttribute("role")==="alertdialog")||(o.preventDefault(),o.stopPropagation(),n.current())};return window.addEventListener("keydown",a,!0),()=>{window.removeEventListener("keydown",a,!0)}},[t]);const i=H.useRef(!1);H.useEffect(()=>{const a=e.current?.getRootNode();if(i.current&&!t){const o=window.setTimeout(()=>{a?.querySelector('[part~="history-toggle"]')?.focus()},0);return i.current=!1,()=>{window.clearTimeout(o)}}i.current=t},[t,e])},j6=({query:e,onQuery:t,inputRef:r,autoFocus:n})=>{const{t:i}=ye();return k.jsxs("label",{className:"relative flex items-center",children:[k.jsx(Su,{className:"pointer-events-none absolute left-[11px] size-4 text-muted-foreground","aria-hidden":"true"}),k.jsx("input",{ref:r,part:"search",type:"search",value:e,"data-autofocus":n?"":void 0,onChange:a=>{t(a.target.value)},onKeyDown:a=>{a.key==="Escape"&&e&&(a.preventDefault(),t(""))},placeholder:i("search"),"aria-label":i("search"),className:"h-8 w-full rounded-md border border-input bg-background pl-[34px] pr-9 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-secondary [&::-webkit-search-cancel-button]:hidden"}),e?k.jsx("button",{type:"button","aria-label":i("dismiss"),className:"absolute right-2 rounded p-0.5 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:()=>{t(""),r.current?.focus()},children:k.jsx(Cu,{className:"size-3.5","aria-hidden":"true"})}):null]})},H6=({collapsed:e,onCollapsedChange:t,searchRef:r,searchSignal:n,overlay:i=!1,title:a,logoUrl:o,inert:s=!1})=>{const l=H.useRef(null);fo(l,s);const{state:u,t:f,openThread:d,newChat:p,deleteThread:v}=ye(),[g,y]=H.useState(""),[x,b]=H.useState(null),_=i&&!e;B6(l,_,()=>{t(!0)});const S=H.useMemo(()=>{const E=g.trim().toLowerCase(),D=E?u.threads.filter(L=>(L.title||f("untitled")).toLowerCase().includes(E)):u.threads;return SB(D)},[u.threads,g,f]);H.useEffect(()=>{n>0&&!e&&r.current?.focus()},[n,e,r]);const T=E=>()=>{E(),i&&t(!0)};return e?k.jsx("nav",{ref:l,part:"sidebar","data-state":"collapsed","aria-label":f("history"),hidden:!0}):k.jsxs("nav",{ref:l,part:"sidebar","data-state":"expanded","aria-label":f("history"),className:he(E6,i?M6:D6),children:[k.jsx(L6,{title:a,logoUrl:o,onHide:()=>{t(!0)}}),k.jsxs("div",{className:"flex shrink-0 flex-col gap-2 px-2.5 pb-2",children:[k.jsx(I6,{onClick:T(p)}),k.jsx(j6,{query:g,onQuery:y,inputRef:r,autoFocus:_})]}),k.jsxs("div",{part:"history",className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-2",children:[S.length===0?k.jsx(F6,{query:g}):null,k.jsx(O6,{groups:S,query:g,activeId:u.thread?.id,confirmId:x,onOpen:E=>{T(()=>{d(E)})()},onAskDelete:b,onCancelDelete:()=>{b(null)},onDelete:E=>{b(null),v(E)}})]})]})};function V6(e){const t=H.useRef(null),[r,n]=H.useState(e);return H.useLayoutEffect(()=>{const i=t.current;if(!i)return;const a=Math.round(i.getBoundingClientRect().width);if(a>0&&n(a),typeof ResizeObserver>"u")return;const o=new ResizeObserver(([s])=>{const l=Math.round(s?.contentRect.width??0);l>0&&n(l)});return o.observe(i),()=>{o.disconnect()}},[]),[t,r]}const H2="aid_sidebar",U6=720,$6=e=>{try{const t=window.localStorage.getItem(H2);return t===null?e:t==="collapsed"}catch{return e}},G6=e=>{const{state:t}=ye(),r=t.thread?.id,n=r!==void 0&&r!==Fs?r:void 0;return k.jsx(aj,{threadId:n,children:k.jsx(W6,{...e,threadId:n})})},W6=({open:e,title:t,logoUrl:r,compact:n,threadId:i})=>{const{state:a,path:o,newChat:s}=ye(),l=Kg(),{expandForDashboard:u}=l,[f,d]=V6(0),v=(l.canExpand&&l.expanded?Math.max(d,window.innerWidth):d)>=sF,g=fa(),y=n||d>0&&d<U6,[x,b]=H.useState(()=>y||$6(!1)),[_,S]=H.useState(y);y!==_&&(S(y),y&&b(!0));const[T,E]=H.useState(!1),D=H.useRef(null),[L,R]=H.useState(0),O=()=>{P(!1),R(ae=>ae+1)},M=H.useRef(null),P=ae=>{if(b(ae),!y)try{window.localStorage.setItem(H2,ae?"collapsed":"expanded")}catch{}},j=H.useRef({collapsed:x,newChat:s,setCollapsed:P,focusSearch:O});H.useEffect(()=>{j.current={collapsed:x,newChat:s,setCollapsed:P,focusSearch:O}}),H.useEffect(()=>{if(!e)return;const ae=ie=>{if(!(ie.metaKey||ie.ctrlKey)||ie.altKey)return;const{collapsed:_e,newChat:be,setCollapsed:xe,focusSearch:Se}=j.current,Le=ie.key.toLowerCase();if(Le==="k"&&!ie.shiftKey)Se();else if(Le==="o"&&ie.shiftKey)be(),setTimeout(()=>M.current?.setText(""),0);else if(Le==="s"&&ie.shiftKey)xe(!_e);else return;ie.preventDefault()};return window.addEventListener("keydown",ae),()=>{window.removeEventListener("keydown",ae)}},[e]),oj(o,i,{loaded:i===void 0||a.thread!==null&&a.loadingThread===null,streaming:(a.turn?.optimisticIds.length??0)>0});const B=o.find(ae=>ae.id===g.state.messageId&&Oi(ae.blocks,"dashboard")!==void 0),$=B!==void 0;H.useEffect(()=>{if($)return u(!0),()=>{u(!1)}},[$,u]);const K=H.useRef(null),Z=H.useRef(!1),re=B?.id??null,Y=H.useRef(null);H.useEffect(()=>{const ae=Y.current;if(Y.current=re,ae===null||re!==null||!Z.current)return;Z.current=!1;const ie=K.current;(Array.from(ie?.querySelectorAll('[part="dashboard-toggle"]')??[]).find(be=>be.dataset.messageId===ae)??ie?.querySelector('[part="composer"] textarea'))?.focus()},[re]);const G=$&&g.state.fullscreen;fo(K,y&&!x);const[I,z]=H.useState(e);e!==I&&(z(e),!e&&y&&b(!0));const W=uF($,v,g.state.fullscreen);lF(e&&$&&(!W||g.state.view==="dashboard"));const F=a.thread?a.threads.find(ae=>ae.id===a.thread?.id)?.title:void 0,ee=a.config&&!a.loadingThread&&!a.configError;return k.jsxs("div",{ref:f,className:"relative flex min-h-0 flex-1",children:[k.jsx(H6,{collapsed:x,onCollapsedChange:P,overlay:y,searchRef:D,searchSignal:L,title:t,logoUrl:r,inert:G}),k.jsxs("div",{ref:K,className:"flex min-w-0 flex-1 flex-col",children:[k.jsx(A6,{historyHidden:x,onShowHistory:()=>{P(!1)},onOpenSettings:()=>{E(!0)},title:t,logoUrl:r,threadTitle:F,tabs:W?k.jsx(CB,{}):null,inert:G}),k.jsx(TB,{wide:v,onPanelFocusChange:ae=>{Z.current=ae},panel:B?k.jsx(nj,{message:B}):null,chat:k.jsx(T6,{composerRef:M,wide:d>=720})})]}),y&&!x?k.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"absolute inset-0 z-20 bg-scrim",onClick:()=>{P(!0)}}):null,k.jsx(lj,{active:e&&!!ee}),k.jsx(xj,{open:T,onClose:()=>{E(!1)}})]})},V2=({open:e,title:t,logoUrl:r,fullscreen:n,expanded:i=!1,style:a,onClose:o})=>{const s=H.useRef(null);return fo(s,!e),id(s,e),H.useEffect(()=>{if(!e)return;const l=u=>{u.key==="Escape"&&!u.defaultPrevented&&o()};return window.addEventListener("keydown",l),()=>{window.removeEventListener("keydown",l)}},[e,o]),k.jsx("div",{ref:s,part:"window",role:"dialog","aria-modal":n,"aria-label":t,"aria-hidden":!e,"data-state":e?"open":"closed","data-fullscreen":n,"data-expanded":i,className:"aid-window rounded-aid-window border bg-background text-foreground shadow-window",style:a,children:k.jsx(G6,{open:e,title:t,logoUrl:r,compact:n})})},$m=60,Y6=6,X6=8,U2={x:20,y:20},q6=639,$2="aid_pos",K6=(e,t,r=Y6)=>e*e+t*t>=r*r,pd=(e,t,r=$m,n=X6)=>{const i=typeof r=="number"?{width:r,height:r}:r,a=(o,s)=>Math.round(Math.min(Math.max(o,n),Math.max(n,s)));return{x:a(e.x,t.width-i.width-n),y:a(e.y,t.height-i.height-n)}},G2=(e,t,r,n)=>({x:n==="bottom-right"?e.x-t:e.x+t,y:e.y-r}),Z6=e=>{try{const t=e?.getItem($2);if(!t)return null;const r=JSON.parse(t);if(typeof r=="object"&&r!==null&&typeof r.x=="number"&&typeof r.y=="number"&&Number.isFinite(r.x)&&Number.isFinite(r.y))return{x:r.x,y:r.y}}catch{}return null},Q6=(e,t)=>{try{e?.setItem($2,JSON.stringify(t))}catch{}},J6={width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e8=({size:e=24})=>k.jsx("svg",{...J6,width:e,height:e,children:k.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),W2=()=>({width:window.innerWidth,height:window.innerHeight}),Gm=e=>({width:e.offsetWidth,height:e.offsetHeight}),t8=()=>{try{return window.localStorage}catch{return null}},Y2=H.forwardRef(({open:e,lang:t,corner:r,offset:n,draggable:i,unread:a=0,variant:o,label:s,shape:l,onOffsetChange:u,onToggle:f},d)=>{const p=H.useRef(null),v=H.useRef(!1),[g,y]=H.useState(null),x=g!==null,b=L=>{!i||L.button!==0||(p.current={pointerX:L.clientX,pointerY:L.clientY,offset:n,moved:!1},L.currentTarget.setPointerCapture(L.pointerId))},_=L=>{const R=p.current;if(!R)return;const O=L.clientX-R.pointerX,M=L.clientY-R.pointerY;!R.moved&&!K6(O,M)||(R.moved||(R.moved=!0,y({offset:R.offset,...Gm(L.currentTarget)})),u(pd(G2(R.offset,O,M,r),W2(),Gm(L.currentTarget))))},S=L=>{const R=p.current;if(p.current=null,L.currentTarget.hasPointerCapture(L.pointerId)&&L.currentTarget.releasePointerCapture(L.pointerId),!R?.moved)return;y(null),v.current=!0;const O=L.clientX-R.pointerX,M=L.clientY-R.pointerY;Q6(t8(),pd(G2(R.offset,O,M,r),W2(),Gm(L.currentTarget)))},T=()=>{if(v.current){v.current=!1;return}f()},E=r==="bottom-right"?"right":"left",D=o==="label"&&!e?s??Vn(t,"ask"):null;return k.jsxs(k.Fragment,{children:[g?k.jsx("span",{"data-testid":"launcher-origin","aria-hidden":"true","data-shape":l??"circle",className:"aid-launcher-origin",style:{[E]:g.offset.x,bottom:g.offset.y,width:g.width,height:g.height}}):null,k.jsxs("button",{ref:d,part:"launcher",type:"button","aria-label":`${D??Vn(t,e?"close":"open")}${a>0&&!e?`, ${Vn(t,"unreadAnswers",{count:a})}`:""}`,"aria-expanded":e,"data-dragging":x,"data-variant":D?"label":"icon","data-shape":l??"circle",className:"aid-launcher",style:{[E]:n.x,bottom:n.y},onPointerDown:b,onPointerMove:_,onPointerUp:S,onPointerCancel:S,onClick:T,children:[e?k.jsx(e8,{}):k.jsx(rd,{size:D?44:40,animated:!1,bare:!0}),D?k.jsx("span",{part:"launcher-label",className:"truncate",children:D}):null,a>0&&!e?k.jsx("span",{part:"badge",className:"aid-launcher-badge",children:a>9?"9+":a}):null]})]})});Y2.displayName="Launcher";const r8=e=>{const{state:t}=ye(),{turn:r,thread:n}=t,[i,a]=H.useState({turn:r,open:e}),[o,s]=H.useState(0);return(i.turn!==r||i.open!==e)&&(a({turn:r,open:e}),e?o!==0&&s(0):i.turn&&!r&&n?.messages.find(l=>l.id===i.turn?.assistantId)?.status==="done"&&s(o+1)),o},X2=H.forwardRef((e,t)=>{const r=r8(e.open);return k.jsx(Y2,{ref:t,...e,unread:r})});X2.displayName="UnreadLauncher";const Nu=(e,t,r)=>Math.min(r,Math.max(t,e)),n8={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",orange:"#ffa500",purple:"#800080",teal:"#008080",navy:"#000080",gray:"#808080",grey:"#808080"},q2=e=>{if(!/^[0-9a-f]+$/i.test(e)||![3,4,6,8].includes(e.length))return null;const t=e.length<=4?e.replace(/./g,n=>n+n):e,r=n=>parseInt(t.slice(n,n+2),16);return{r:r(0),g:r(2),b:r(4),a:t.length===8?r(6)/255:1}},K2=e=>{const t=e.replace(/\//g," ").replace(/,/g," ").trim().split(/\s+/).filter(Boolean);return t.length===3||t.length===4?t:null},vd=e=>{const t=Number(e);return e!==""&&Number.isFinite(t)?t:null},i8=e=>{if(e===void 0)return 1;const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(e.endsWith("%")?t/100:t,0,1)},Wm=e=>{const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(e.endsWith("%")?t/100*255:t,0,255)},Z2=e=>{const t=/^(-?[\d.]+)(deg|turn|rad|grad)?$/.exec(e);if(!t?.[1])return null;const r=vd(t[1]);if(r===null)return null;const n=t[2]??"deg";return((n==="turn"?r*360:n==="rad"?r*180/Math.PI:n==="grad"?r*.9:r)%360+360)%360},gd=e=>{const t=vd(e.endsWith("%")?e.slice(0,-1):e);return t===null?null:Nu(t,0,100)},md=({h:e,s:t,l:r,a:n})=>{const i=t/100,a=r/100,o=l=>(l+e/30)%12,s=l=>a-i*Math.min(a,1-a)*Math.max(-1,Math.min(o(l)-3,9-o(l),1));return{r:Math.round(s(0)*255),g:Math.round(s(8)*255),b:Math.round(s(4)*255),a:n}},a8=({r:e,g:t,b:r,a:n})=>{const i=e/255,a=t/255,o=r/255,s=Math.max(i,a,o),l=Math.min(i,a,o),u=(s+l)/2,f=s-l;if(f===0)return{h:0,s:0,l:u*100,a:n};const d=f/(1-Math.abs(2*u-1));let p;return s===i?p=(a-o)/f%6:s===a?p=(o-i)/f+2:p=(i-a)/f+4,{h:(p*60+360)%360,s:d*100,l:u*100,a:n}},Q2=e=>{const t=o8(e);if(!t)return null;const r=/^hsla?\((.*)\)$/.exec(e.trim().toLowerCase()),n=r?.[1]!==void 0?K2(r[1]):null;if(n){const[i,a,o]=[Z2(n[0]??""),gd(n[1]??""),gd(n[2]??"")];if(i!==null&&a!==null&&o!==null)return{h:i,s:a,l:o,a:t.a}}return a8(t)},o8=e=>{const t=e.trim().toLowerCase(),r=n8[t];if(r)return q2(r.slice(1));if(t.startsWith("#"))return q2(t.slice(1));const n=/^(rgba?|hsla?)\((.*)\)$/.exec(t);if(!n?.[1]||n[2]===void 0)return null;const i=K2(n[2]);if(!i)return null;const[a="",o="",s="",l]=i,u=i8(l);if(u===null)return null;if(n[1].startsWith("rgb")){const[v,g,y]=[Wm(a),Wm(o),Wm(s)];return v===null||g===null||y===null?null:{r:Math.round(v),g:Math.round(g),b:Math.round(y),a:u}}const[f,d,p]=[Z2(a),gd(o),gd(s)];return f===null||d===null||p===null?null:md({h:f,s:d,l:p,a:u})},J2=({r:e,g:t,b:r})=>{const n=i=>{const a=i/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*n(e)+.7152*n(t)+.0722*n(r)},eC=(e,t)=>{const[r,n]=[J2(e),J2(t)].sort((i,a)=>a-i);return(r+.05)/(n+.05)},yd=e=>Math.round(e*10)/10,mo=({h:e,s:t,l:r,a:n})=>`${yd(e)}, ${yd(t)}%, ${yd(r)}%${n<1?`, ${yd(n*100)/100}`:""}`,tC={h:210,s:40,l:98,a:1},rC={h:222.2,s:47.4,l:11.2,a:1},s8=e=>{const t=Q2(e);if(!t)return null;const r={...t,a:1},n={...r,l:Nu(r.l>70?r.l-6:r.l+8,0,100)},i={...r,l:Nu(r.l-10,0,100)},a=md(r),o=eC(a,md(tC)),s=o>=4.5||o>=eC(a,md(rC))?tC:rC;return{primary:mo(r),primaryHovered:mo(n),primaryPressed:mo(i),primaryForeground:mo(s),secondary:mo({...r,a:.1}),ring:mo({...r,a:.5})}},l8=(...e)=>{const t={};for(const r of e)if(r)for(const[n,i]of Object.entries(r))i===void 0||i===""||(t[n]=i);return t},u8=e=>{const t={},r=e.primary?s8(e.primary):null;r&&(t["--primary"]=r.primary,t["--primary-text"]=r.primary,t["--primary-hovered"]=r.primaryHovered,t["--primary-pressed"]=r.primaryPressed,t["--primary-foreground"]=r.primaryForeground,t["--secondary"]=r.secondary,t["--secondary-foreground"]=r.primary,t["--ring"]=r.ring),e.radius!==void 0&&e.radius!==""&&(t["--radius"]=typeof e.radius=="number"?`${e.radius}px`:e.radius),e.font&&(t["--aid-theme-font"]=e.font);const n=u=>{const f=u?Q2(u):null;return f?mo(f):null},i=n(e.background);if(i)for(const u of["--background","--card","--popover"])t[u]=i;const a=n(e.foreground);if(a)for(const u of["--foreground","--card-foreground","--popover-foreground","--secondary-foreground"])t[u]=a;const o=n(e.bubble);if(o)for(const u of["--secondary","--muted","--accent"])t[u]=o;const s=n(e.border);if(s)for(const u of["--border","--input"])t[u]=s;const l=(u,f)=>{typeof f=="number"&&Number.isFinite(f)&&(t[u]=`${f}px`)};return l("--aid-t-window-width",e.windowWidth),l("--aid-t-window-height",e.windowHeight),l("--aid-t-offset-x",e.offsetX),l("--aid-t-offset-y",e.offsetY),t},c8=(e,t)=>e==="dark"||e==="auto"&&t?"dark":"light",f8=(e,t,r={})=>{for(const n of Object.keys(r))n in t||e.style.removeProperty(n);for(const[n,i]of Object.entries(t))e.style.setProperty(n,i)},d8=(e,t)=>{e.classList.toggle("dark",t==="dark"),e.dataset.scheme=t},nC=(e,t)=>{const r=parseFloat(e);return Number.isFinite(r)?r:t},Ym=()=>{try{return window.localStorage}catch{return null}},iC=(e,t,r)=>nC(e.getPropertyValue(`--aid-${t}`),nC(e.getPropertyValue(`--aid-t-${t}`),r)),h8=e=>{const t=getComputedStyle(e);return{x:iC(t,"offset-x",U2.x),y:iC(t,"offset-y",U2.y)}},aC=()=>({width:window.innerWidth,height:window.innerHeight}),p8={scheme:"auto"},v8=(e,t)=>{const r=H.useSyncExternalStore(e.subscribe,()=>e.get().theme),n=H.useSyncExternalStore(e.subscribe,()=>e.get().adminTheme),i=oS("(prefers-color-scheme: dark)"),a=l8(p8,n,r),o=c8(a.scheme,i),s=H.useRef({}),l=JSON.stringify(u8(a));return H.useLayoutEffect(()=>{const u=JSON.parse(l);f8(t,u,s.current),s.current=u},[t,l]),H.useLayoutEffect(()=>{d8(t,o)},[t,o]),a},g8=e=>{const{store:t,api:r}=e,n=H.useSyncExternalStore(t.subscribe,()=>t.get().open),i=H.useSyncExternalStore(t.subscribe,()=>t.get().lang),a=H.useCallback(o=>{t.set({adminTheme:o})},[t]);return k.jsx(q4,{api:r,lang:i,open:n,onAdminTheme:a,children:k.jsx(m8,{...e})})},m8=({store:e,root:t,mode:r,corner:n,draggable:i,api:a})=>{const o=H.useSyncExternalStore(e.subscribe,()=>e.get().open),s=H.useSyncExternalStore(e.subscribe,()=>e.get().lang),l=v8(e,t),u=n??l.position??"bottom-right",f=oS(`(max-width: ${q6}px)`),d=H.useRef(null),[p,v]=H.useState(()=>pd(Z6(Ym())??h8(t),aC(),$m));H.useEffect(()=>{if(r!=="launcher")return;const j=()=>{const B=d.current,$=B?{width:B.offsetWidth,height:B.offsetHeight}:$m;v(K=>pd(K,aC(),$))};return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[r]);const g=H.useCallback(()=>{e.set({open:!1})},[e]),y=H.useCallback(()=>{e.set({open:!e.get().open})},[e]),x=H.useRef(o);H.useEffect(()=>{x.current&&!o&&d.current?.focus({preventScroll:!0}),x.current=o},[o]);const b=l.title??Vn(s,"title"),_=tS(a.apiUrl),S=H.useMemo(()=>({animated:o,assetsBase:_}),[o,_]),[T,E]=H.useState({expanded:!1,byDashboard:!1}),{expanded:D}=T,L=r==="launcher"&&!f,R=H.useCallback(j=>{E({expanded:j,byDashboard:!1})},[]),O=H.useCallback(j=>{E(B=>k4(B,j,L))},[L]),M=l.scheme??"auto",P=H.useMemo(()=>({lang:s,scheme:M,expanded:D,canExpand:L,setExpanded:R,expandForDashboard:O,close:r==="launcher"?g:void 0,update:j=>{const B={...qk(Ym()),...j};_4(Ym(),B),e.set({...j.lang?{lang:j.lang}:{},theme:{...e.get().theme,...Kk(j)}})}}),[s,M,D,L,R,O,r,g,e]);return r==="window"?k.jsx(qg.Provider,{value:P,children:k.jsx(tm.Provider,{value:S,children:k.jsx(V2,{open:o,title:b,logoUrl:Yg(l.logoUrl),fullscreen:!1,onClose:g})})}):k.jsx(qg.Provider,{value:P,children:k.jsxs(tm.Provider,{value:S,children:[k.jsx("div",{part:"overlay",className:"aid-overlay","data-state":o?"open":"closed","aria-hidden":!0,onClick:g}),k.jsx(V2,{open:o,title:b,logoUrl:Yg(l.logoUrl),fullscreen:f,expanded:D&&!f,onClose:g}),o?null:k.jsx(X2,{ref:d,open:o,lang:s,corner:u,offset:p,draggable:i&&!f,variant:l.launcher,label:l.launcherLabel,shape:l.launcherShape,onOffsetChange:v,onToggle:y})]})})},oC="https://dev-ai.kgd.gov.kz",y8=`${J3}
|
|
19
|
+
${C4}`,Xm=(e,t,r,n)=>{const i=e.shadowRoot??e.attachShadow({mode:"open"});i.replaceChildren();const a=document.createElement("style");a.textContent=y8;const o=document.createElement("div");o.className="aid-root",o.dataset.mode=r,i.append(a,o);let s=null;try{s=window.localStorage}catch{}const l=qk(s),u=S4({open:t.defaultOpen??r==="window",lang:l.lang??Wk(t.lang),theme:{...t.theme,...Kk(l)},adminTheme:null});let f=u.get().open;const d=u.subscribe(()=>{const{open:x}=u.get();x!==f&&(f=x,t.onOpenChange?.(x))}),p=m4({apiUrl:t.apiUrl??oC,siteKey:t.siteKey,visitorId:d4(t.visitorId,s),rememberVisitor:x=>{try{s?.setItem($g,x)}catch{}}}),v=Q3.createRoot(o);v.render(k.jsx(H.StrictMode,{children:k.jsx(Zg,{fallback:null,children:k.jsx(g8,{store:u,root:o,mode:r,corner:t.position,draggable:t.draggable??!0,api:p})})}));let g=!0;return{open:()=>{u.set({open:!0})},close:()=>{u.set({open:!1})},setTheme:x=>{u.set({theme:{...u.get().theme,...x}})},setLang:x=>{u.set({lang:Wk(x)})},unmount:()=>{g&&(g=!1,d(),v.unmount(),D4(),i.replaceChildren(),n?.())}}};function sC(e,t){const r=e instanceof HTMLElement?t:t??e;if(!r)throw new TypeError("AiDanaChat.mountLauncher: options are required");if(e instanceof HTMLElement)return Xm(e,r,"launcher");const n=document.createElement("div");return n.setAttribute("data-ai-dana-chat",""),n.style.setProperty("all","initial"),document.body.append(n),Xm(n,r,"launcher",()=>{n.remove()})}const lC=(e,t)=>Xm(e,t,"window"),uC=["light","dark","auto"];class qm extends HTMLElement{constructor(){super(...arguments);Rs(this,"handle")}connectedCallback(){const r=this.getAttribute("theme"),n=this.getAttribute("position"),i=this.getAttribute("site-key"),a=this.getAttribute("api-url"),o={...i?{siteKey:i}:{},...a===null?{}:{apiUrl:a},...this.getAttribute("lang")?{lang:this.getAttribute("lang")}:{},...r&&uC.includes(r)?{theme:{scheme:r}}:{},...n==="bottom-left"||n==="bottom-right"?{position:n}:{},draggable:this.getAttribute("draggable")!=="false",defaultOpen:this.hasAttribute("open"),onOpenChange:s=>this.dispatchEvent(new CustomEvent("openchange",{detail:{open:s}}))};this.handle=this.hasAttribute("launcher")?sC(this,o):lC(this,o)}disconnectedCallback(){this.handle?.unmount(),this.handle=void 0}attributeChangedCallback(r,n,i){!this.handle||n===i||(r==="lang"&&i&&this.handle.setLang(i),r==="theme"&&i&&uC.includes(i)&&this.handle.setTheme({scheme:i}))}open(){this.handle?.open()}close(){this.handle?.close()}setTheme(r){this.handle?.setTheme(r)}setLang(r){this.handle?.setLang(r)}}Rs(qm,"observedAttributes",["lang","theme"]),typeof customElements<"u"&&!customElements.get("ai-dana-chat")&&customElements.define("ai-dana-chat",qm);const x8=()=>({parts:[]}),cC=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$s=e=>typeof e=="string";function b8(e,t){cC(t)&&(e.metadata={...e.metadata,...t})}function fC(e,t){for(const n of e.parts)if(n.type==="text"&&n.id===t)return n;const r={type:"text",id:t,text:""};return e.parts.push(r),r}function w8(e,t,r){if(r.transient===!0)return;const n=$s(r.id)?r.id:void 0,i=n==null?void 0:e.parts.find(a=>a.type===t&&a.id===n);i!=null&&i.type!=="text"?i.data=r.data:e.parts.push({type:t,...n!=null?{id:n}:{},data:r.data})}function _8(e,t){if(!cC(t)||!$s(t.type))throw new zs("stream_error");switch(t.type){case"start":case"finish":case"message-metadata":b8(e,t.messageMetadata);return;case"text-start":$s(t.id)&&fC(e,t.id);return;case"text-delta":$s(t.id)&&$s(t.delta)&&(fC(e,t.id).text+=t.delta);return;case"data-step":case"data-attachment":case"data-block":w8(e,t.type,t);return;case"error":throw new zs($s(t.errorText)&&t.errorText!==""?t.errorText:"stream_error");default:return}}const k8="[DONE]";function dC(){const e=new Error("The operation was aborted.");return e.name="AbortError",e}function S8(e){let t;for(const r of e.split(`
|
|
20
20
|
`)){if(r.startsWith(":"))continue;const n=r.indexOf(":");if((n===-1?r:r.slice(0,n))!=="data")continue;let a=n===-1?"":r.slice(n+1);a.startsWith(" ")&&(a=a.slice(1)),(t??(t=[])).push(a)}return t?.join(`
|
|
21
21
|
`)}async function*C8(e,t){const r=e.getReader(),n=()=>{r.cancel().catch(()=>{})};t?.addEventListener("abort",n,{once:!0});const i=new TextDecoder;let a="";try{if(t?.aborted)throw dC();for(;;){const{done:o,value:s}=await r.read();if(t?.aborted)throw dC();if(o)return;a+=i.decode(s,{stream:!0});const l=a.endsWith("\r")?"\r":"";a=a.slice(0,a.length-l.length).replace(/\r\n?/g,`
|
|
22
22
|
`);for(let u=a.indexOf(`
|
|
23
23
|
|
|
24
24
|
`);u!==-1;u=a.indexOf(`
|
|
25
25
|
|
|
26
|
-
`)){const f=S8(a.slice(0,u));if(a=a.slice(u+2),f===k8)return;f!==void 0&&(yield f)}a+=l}}finally{t?.removeEventListener("abort",n),n()}}const Km=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Zm=e=>typeof e=="string"&&e!=="";function Qm(e){return Zm(e)?e:typeof e=="number"&&Number.isInteger(e)?String(e):void 0}function T8(e){if(!Km(e))return;const t=Qm(e.threadId),r=Qm(e.userMessageId),n=Qm(e.assistantMessageId);if(!(t==null||r==null||n==null||typeof e.mode!="string"))return{threadId:t,userMessageId:r,assistantMessageId:n,mode:e.mode}}function A8(e,t){if(!Km(t)||!Zm(t.node)||t.status!=="running"&&t.status!=="done"||typeof t.attempt!="number"||!Number.isInteger(t.attempt)||t.attempt<=0)return;const r={id:e,node:t.node,status:t.status,attempt:t.attempt},{durationMs:n}=t;if(n!==void 0){if(typeof n!="number"||n<0)return;r.durationMs=n}const{label:i,total:a}=t;return typeof i=="string"&&(r.label=i),(a===null||typeof a=="number"&&Number.isFinite(a))&&(r.total=a),r}function E8(e){if(!Km(e)||!Zm(e.url))return;const{name:t}=e;if(!(t!=null&&typeof t!="string"))return{name:t?.trim()?t:D8(e.url),url:e.url}}function D8(e){const t=e.split("?")[0]??e,r=t.slice(t.lastIndexOf("/")+1);try{return decodeURIComponent(r)}catch{return r}}function hC(e){const t={text:"",steps:[],attachments:[],blocks:[],metadata:T8(e.metadata)};for(const r of e.parts)if(r.type==="text")t.text+=r.text;else if(r.type==="data-step"){const n=r.id!=null?A8(r.id,r.data):void 0;n!=null&&t.steps.push(n)}else if(r.type==="data-block"){const n=Ok(r.data);n!=null&&t.blocks.push(n)}else{const n=E8(r.data);n!=null&&t.attachments.push(n)}return t}async function Jm(e,t,r){const n=await iz(e),i=x8();let a=!1,o=0;const s=()=>{o=Date.now(),a=!1,t(hC(i))};try{for await(const l of C8(n,r))_8(i,M8(l)),a=!0,Date.now()-o>=I4&&s()}catch(l){throw a&&s(),l instanceof Error&&l.name==="AbortError"||l instanceof zs?l:new zs(l instanceof Error?l.message:"stream_error")}a&&s()}function M8(e){try{return JSON.parse(e)}catch{throw new zs("stream_error")}}async function L8({transport:e,request:t,threadId:r,signal:n,onSnapshot:i}){const a=await tz(e,ez(t,r),n);await Jm(a,i,n)}async function I8(e,t,r,n){const i=await rz(e,t,r);await Jm(i,n,r)}const pC=Object.freeze(Object.defineProperty({__proto__:null,readUiMessageStream:Jm,resumeChatAnswer:I8,streamChatAnswer:L8,toSnapshot:hC},Symbol.toStringTag,{value:"Module"}));var ey=function(e,t){return ey=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ey(e,t)};function ve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ey(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ty=12,P8="sans-serif",va=ty+"px "+P8,N8=20,R8=100,O8="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function z8(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r<e.length;r++){var n=String.fromCharCode(r+32),i=(e.charCodeAt(r)-N8)/R8;t[n]=i}return t}var F8=z8(O8),Zr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var e,t;return function(r,n){if(!e){var i=Zr.createCanvas();e=i&&i.getContext("2d")}if(e)return t!==n&&(t=e.font=n||va),e.measureText(r);r=r||"",n=n||va;var a=/((?:\d+)?\.?\d*)px/.exec(n),o=a&&+a[1]||ty,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var u=F8[r[l]];s+=u==null?o:u*o}return{width:s}}})(),loadImage:function(e,t,r){var n=new Image;return n.onload=t,n.onerror=r,n.src=e,n},getTime:function(){return Date.now?Date.now():+new Date}},vC=ga(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),gC=ga(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),Ru=Object.prototype.toString,xd=Array.prototype,B8=xd.forEach,j8=xd.filter,ry=xd.slice,H8=xd.map,mC=function(){}.constructor,bd=mC?mC.prototype:null,ny="__proto__",iy=2311,V8=Math.pow(2,53)-1;function yC(){return iy>=V8&&(iy=0),iy++}function ay(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];typeof console<"u"&&console.error.apply(console,e)}function Ke(e){if(e==null||typeof e!="object")return e;var t=e,r=Ru.call(e);if(r==="[object Array]"){if(!Bu(e)){t=[];for(var n=0,i=e.length;n<i;n++)t[n]=Ke(e[n])}}else if(gC[r]){if(!Bu(e)){var a=e.constructor;if(a.from)t=a.from(e);else{t=new a(e.length);for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}}}else if(!vC[r]&&!Bu(e)&&!Ou(e)){t={};for(var o in e)e.hasOwnProperty(o)&&o!==ny&&(t[o]=Ke(e[o]))}return t}function st(e,t,r){if(!Ie(t)||!Ie(e))return r?Ke(t):e;for(var n in t)if(t.hasOwnProperty(n)&&n!==ny){var i=e[n],a=t[n];Ie(a)&&Ie(i)&&!pe(a)&&!pe(i)&&!Ou(a)&&!Ou(i)&&!xC(a)&&!xC(i)&&!Bu(a)&&!Bu(i)?st(i,a,r):(r||!(n in e))&&(e[n]=Ke(t[n]))}return e}function ce(e,t){if(Object.assign)Object.assign(e,t);else for(var r in t)t.hasOwnProperty(r)&&r!==ny&&(e[r]=t[r]);return e}function U8(e,t,r){e=e||{};for(var n=0;n<r.length;n++){var i=r[n];e[i]=t[i]}return e}function ct(e,t,r){for(var n=kt(t),i=0,a=n.length;i<a;i++){var o=n[i];e[o]==null&&(e[o]=t[o])}return e}function Je(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r}return-1}function $8(e,t){var r=e.prototype;function n(){}n.prototype=t.prototype,e.prototype=new n;for(var i in r)r.hasOwnProperty(i)&&(e.prototype[i]=r[i]);e.prototype.constructor=e,e.superClass=t}function Un(e,t,r){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var a=n[i];a!=="constructor"&&e[a]==null&&(e[a]=t[a])}else ct(e,t)}function Pr(e){return!e||typeof e=="string"?!1:typeof e.length=="number"}function U(e,t,r){if(e&&t)if(e.forEach&&e.forEach===B8)e.forEach(t,r);else if(e.length===+e.length)for(var n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(r,e[a],a,e)}function De(e,t,r){if(!e)return[];if(!t)return sy(e);if(e.map&&e.map===H8)return e.map(t,r);for(var n=[],i=0,a=e.length;i<a;i++)n.push(t.call(r,e[i],i,e));return n}function ga(e,t,r,n){if(e&&t){for(var i=0,a=e.length;i<a;i++)r=t.call(n,r,e[i],i,e);return r}}function Zt(e,t,r){if(!e)return[];if(!t)return sy(e);if(e.filter&&e.filter===j8)return e.filter(t,r);for(var n=[],i=0,a=e.length;i<a;i++)t.call(r,e[i],i,e)&&n.push(e[i]);return n}function G8(e,t,r){if(e&&t){for(var n=0,i=e.length;n<i;n++)if(t.call(r,e[n],n,e))return e[n]}}function kt(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}function W8(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return e.apply(t,r.concat(ry.call(arguments)))}}var pt=bd&&$e(bd.bind)?bd.call.bind(bd.bind):W8;function yt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(){return e.apply(this,t.concat(ry.call(arguments)))}}function pe(e){return Array.isArray?Array.isArray(e):Ru.call(e)==="[object Array]"}function $e(e){return typeof e=="function"}function Me(e){return typeof e=="string"}function oy(e){return Ru.call(e)==="[object String]"}function ft(e){return typeof e=="number"}function Ie(e){var t=typeof e;return t==="function"||!!e&&t==="object"}function xC(e){return!!vC[Ru.call(e)]}function Nr(e){return!!gC[Ru.call(e)]}function Ou(e){return typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.ownerDocument=="object"}function wd(e){return e.colorStops!=null}function Y8(e){return e.image!=null}function zu(e){return e!==e}function Fu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e.length;r<n;r++)if(e[r]!=null)return e[r]}function Ae(e,t){return e??t}function yo(e,t,r){return e??t??r}function sy(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ry.apply(e,t)}function ly(e){if(typeof e=="number")return[e,e,e,e];var t=e.length;return t===2?[e[0],e[1],e[0],e[1]]:t===3?[e[0],e[1],e[2],e[1]]:e}function Fi(e,t){if(!e)throw new Error(t)}function ui(e){return e==null?null:typeof e.trim=="function"?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var bC="__ec_primitive__";function uy(e){e[bC]=!0}function Bu(e){return e[bC]}var X8=(function(){function e(){this.data={}}return e.prototype.delete=function(t){var r=this.has(t);return r&&delete this.data[t],r},e.prototype.has=function(t){return this.data.hasOwnProperty(t)},e.prototype.get=function(t){return this.data[t]},e.prototype.set=function(t,r){return this.data[t]=r,this},e.prototype.keys=function(){return kt(this.data)},e.prototype.forEach=function(t){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&t(r[n],n)},e})(),wC=typeof Map=="function";function q8(){return wC?new Map:new X8}var K8=(function(){function e(t){var r=pe(t);this.data=q8();var n=this;t instanceof e?t.each(i):t&&U(t,i);function i(a,o){r?n.set(a,o):n.set(o,a)}}return e.prototype.hasKey=function(t){return this.data.has(t)},e.prototype.get=function(t){return this.data.get(t)},e.prototype.set=function(t,r){return this.data.set(t,r),r},e.prototype.each=function(t,r){this.data.forEach(function(n,i){t.call(r,n,i)})},e.prototype.keys=function(){var t=this.data.keys();return wC?Array.from(t):t},e.prototype.removeKey=function(t){this.data.delete(t)},e})();function Fe(e){return new K8(e)}function Z8(e,t){for(var r=new e.constructor(e.length+t.length),n=0;n<e.length;n++)r[n]=e[n];for(var i=e.length,n=0;n<t.length;n++)r[n+i]=t[n];return r}function _d(e,t){var r;if(Object.create)r=Object.create(e);else{var n=function(){};n.prototype=e,r=new n}return t&&ce(r,t),r}function _C(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function _r(e,t){return e.hasOwnProperty(t)}function lr(){}var Q8=180/Math.PI,J8=(function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e})(),eH=(function(){function e(){this.browser=new J8,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return e})(),We=new eH;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(We.wxa=!0,We.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?We.worker=!0:!We.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(We.node=!0,We.svgSupported=!0):tH(navigator.userAgent,We);function tH(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var rH=".",xo="___EC__COMPONENT__CONTAINER___",kC="___EC__EXTENDED_CLASS___";function ci(e){var t={main:"",sub:""};if(e){var r=e.split(rH);t.main=r[0]||"",t.sub=r[1]||""}return t}function nH(e){Fi(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function iH(e){return!!(e&&e[kC])}function cy(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return aH(n)?i=(function(a){ve(o,a);function o(){return a.apply(this,arguments)||this}return o})(n):(i=function(){(r.$constructor||n).apply(this,arguments)},$8(i,this)),ce(i.prototype,r),i[kC]=!0,i.extend=this.extend,i.superCall=lH,i.superApply=uH,i.superClass=n,i}}function aH(e){return $e(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function SC(e,t){e.extend=t.extend}var oH=Math.round(Math.random()*10);function sH(e){var t=["__\0is_clz",oH++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function lH(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[t].apply(e,r)}function uH(e,t,r){return this.superClass.prototype[t].apply(e,r)}function kd(e){var t={};e.registerClass=function(n){var i=n.type||n.prototype.type;if(i){nH(i),n.prototype.type=i;var a=ci(i);if(!a.sub)t[a.main]=n;else if(a.sub!==xo){var o=r(a);o[a.sub]=n}}return n},e.getClass=function(n,i,a){var o=t[n];if(o&&o[xo]&&(o=i?o[i]:null),a&&!o)throw new Error(i?"Component "+n+"."+(i||"")+" is used but not imported.":n+".type should be specified.");return o},e.getClassesByMainType=function(n){var i=ci(n),a=[],o=t[i.main];return o&&o[xo]?U(o,function(s,l){l!==xo&&a.push(s)}):a.push(o),a},e.hasClass=function(n){var i=ci(n);return!!t[i.main]},e.getAllClassMainTypes=function(){var n=[];return U(t,function(i,a){n.push(a)}),n},e.hasSubTypes=function(n){var i=ci(n),a=t[i.main];return a&&a[xo]};function r(n){var i=t[n.main];return(!i||!i[xo])&&(i=t[n.main]={},i[xo]=!0),i}}function ju(e,t){for(var r=0;r<e.length;r++)e[r][1]||(e[r][1]=e[r][0]);return t=t||!1,function(n,i,a){for(var o={},s=0;s<e.length;s++){var l=e[s][1];if(!(i&&Je(i,l)>=0||a&&Je(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var cH=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],fH=ju(cH),dH=(function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return fH(this,t,r)},e})(),CC=(function(){function e(t){this.value=t}return e})(),hH=(function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new CC(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e})(),Gs=(function(){function e(t){this._list=new hH,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new CC(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e})(),fy=new Gs(50);function pH(e){if(typeof e=="string"){var t=fy.get(e);return t&&t.image}else return e}function TC(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=fy.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!Sd(t)&&a.pending.push(o)):(t=Zr.loadImage(e,AC,AC),t.__zrImageSrc=e,fy.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function AC(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var r=e.pending[t],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}e.pending.length=0}function Sd(e){return e&&e.width&&e.height}function fi(){return[1,0,0,1,0,0]}function Hu(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function dy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Vu(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function hy(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function py(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(r),d=Math.cos(r);return e[0]=i*d+s*f,e[1]=-i*f+s*d,e[2]=a*d+l*f,e[3]=-a*f+d*l,e[4]=d*(o-n[0])+f*(u-n[1])+n[0],e[5]=d*(u-n[1])-f*(o-n[0])+n[1],e}function vH(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function Uu(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function Ws(e,t){return e==null&&(e=0),t==null&&(t=0),[e,t]}function gH(e){return[e[0],e[1]]}function vy(e,t,r){return e[0]=t,e[1]=r,e}function EC(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function DC(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mH(e){return Math.sqrt(yH(e))}function yH(e){return e[0]*e[0]+e[1]*e[1]}function gy(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function my(e,t){var r=mH(t);return r===0?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),e}function yy(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var xy=yy;function xH(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Ys=xH;function by(e,t,r,n){return e[0]=t[0]+n*(r[0]-t[0]),e[1]=t[1]+n*(r[1]-t[1]),e}function vn(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function Xs(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}function qs(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}var Ye=(function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e})(),bo=Math.min,Ks=Math.max,wy=Math.abs,MC=["x","y"],bH=["width","height"],wo=new Ye,_o=new Ye,ko=new Ye,So=new Ye,Qr=PC(),$u=Qr.minTv,_y=Qr.maxTv,Gu=[0,0],je=(function(){function e(t,r,n,i){ky(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=bo(t.x,this.x),n=bo(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ks(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ks(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){return wH(fi(),this,t)},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Ye.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=ky(_H,t.x,t.y,t.width,t.height)),r instanceof e||(r=ky(kH,r.x,r.y,r.width,r.height));var s=!!n;Qr.reset(i,s);var l=Qr.touchThreshold,u=t.x+l,f=t.x+t.width-l,d=t.y+l,p=t.y+t.height-l,v=r.x+l,g=r.x+r.width-l,y=r.y+l,x=r.y+r.height-l;if(u>f||d>p||v>g||y>x)return!1;var b=!(f<v||g<u||p<y||x<d);return(s||a)&&(Gu[0]=1/0,Gu[1]=0,IC(u,f,v,g,0,s,a,o),IC(d,p,y,x,1,s,a,o),s&&Ye.copy(n,b?Qr.useDir?Qr.dirMinTv:$u:_y)),b},e.contain=function(t,r,n){return r>=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){LC(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&LC(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}wo.x=ko.x=r.x,wo.y=So.y=r.y,_o.x=So.x=r.x+r.width,_o.y=ko.y=r.y+r.height,wo.transform(n),So.transform(n),_o.transform(n),ko.transform(n),t.x=bo(wo.x,_o.x,ko.x,So.x),t.y=bo(wo.y,_o.y,ko.y,So.y);var l=Ks(wo.x,_o.x,ko.x,So.x),u=Ks(wo.y,_o.y,ko.y,So.y);t.width=l-t.x,t.height=u-t.y},e.calculateTransform=function(t,r,n){var i=n.width/r.width,a=n.height/r.height;return t=Hu(t||[]),hy(t,t,vy(Sy,-r.x,-r.y)),vH(t,t,vy(Sy,i,a)),hy(t,t,vy(Sy,n.x,n.y)),t},e})();je.create;var ky=je.set,LC=je.copy,wH=je.calculateTransform;je.applyTransform,je.contain;var _H=new je(0,0,0,0),kH=new je(0,0,0,0),Sy=[];function IC(e,t,r,n,i,a,o,s){var l=wy(t-r),u=wy(n-e),f=bo(l,u),d=MC[i],p=MC[1-i],v=bH[i];t<r||n<e?l<u?(a&&(_y[d]=-l),s&&(o[d]=t,o[v]=0)):(a&&(_y[d]=u),s&&(o[d]=e,o[v]=0)):(o&&(o[d]=Ks(e,r),o[v]=bo(t,n)-o[d]),a&&(f<Gu[0]||Qr.useDir)&&(Gu[0]=bo(f,Gu[0]),(l<u||!Qr.bidirectional)&&($u[d]=l,$u[p]=0,Qr.useDir&&Qr.calcDirMTV()),(l>=u||!Qr.bidirectional)&&($u[d]=-u,$u[p]=0,Qr.useDir&&Qr.calcDirMTV())))}function PC(){var e=0,t=new Ye,r=new Ye,n={minTv:new Ye,maxTv:new Ye,useDir:!1,dirMinTv:new Ye,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Ks(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),f=l*a.y+u*a.x;if(i(f)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/f,r.y=s*l/f,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()<o.len()&&o.copy(r)}};function i(a){return wy(a)<1e-10}return n}function di(e){Cd||(Cd=new Gs(100)),e=e||va;var t=Cd.get(e);return t||(t={font:e,strWidthCache:new Gs(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Zr.measureText("国",e).width,asciiCharWidth:Zr.measureText("a",e).width},Cd.put(e,t)),t}var Cd;function SH(e){if(!(Cy>=NC)){e=e||va;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Zr.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?Cy=NC:i>2&&Cy++,t}}var Cy=0,NC=5;function RC(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=SH(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function hi(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Zr.measureText(t,e.font).width,r.put(t,n)),n}function OC(e,t,r,n){var i=hi(di(t),e),a=Td(t),o=Zs(0,i,r),s=Co(0,a,n),l=new je(o,s,i,a);return l}function zC(e,t,r,n){var i=((e||"")+"").split(`
|
|
26
|
+
`)){const f=S8(a.slice(0,u));if(a=a.slice(u+2),f===k8)return;f!==void 0&&(yield f)}a+=l}}finally{t?.removeEventListener("abort",n),n()}}const Km=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Zm=e=>typeof e=="string"&&e!=="";function Qm(e){return Zm(e)?e:typeof e=="number"&&Number.isInteger(e)?String(e):void 0}function T8(e){if(!Km(e))return;const t=Qm(e.threadId),r=Qm(e.userMessageId),n=Qm(e.assistantMessageId);if(!(t==null||r==null||n==null||typeof e.mode!="string"))return{threadId:t,userMessageId:r,assistantMessageId:n,mode:e.mode}}function A8(e,t){if(!Km(t)||!Zm(t.node)||t.status!=="running"&&t.status!=="done"||typeof t.attempt!="number"||!Number.isInteger(t.attempt)||t.attempt<=0)return;const r={id:e,node:t.node,status:t.status,attempt:t.attempt},{durationMs:n}=t;if(n!==void 0){if(typeof n!="number"||n<0)return;r.durationMs=n}const{label:i,total:a}=t;return typeof i=="string"&&(r.label=i),(a===null||typeof a=="number"&&Number.isFinite(a))&&(r.total=a),r}function E8(e){if(!Km(e)||!Zm(e.url))return;const{name:t}=e;if(!(t!=null&&typeof t!="string"))return{name:t?.trim()?t:D8(e.url),url:e.url}}function D8(e){const t=e.split("?")[0]??e,r=t.slice(t.lastIndexOf("/")+1);try{return decodeURIComponent(r)}catch{return r}}function hC(e){const t={text:"",steps:[],attachments:[],blocks:[],metadata:T8(e.metadata)};for(const r of e.parts)if(r.type==="text")t.text+=r.text;else if(r.type==="data-step"){const n=r.id!=null?A8(r.id,r.data):void 0;n!=null&&t.steps.push(n)}else if(r.type==="data-block"){const n=Ok(r.data);n!=null&&t.blocks.push(n)}else{const n=E8(r.data);n!=null&&t.attachments.push(n)}return t}async function Jm(e,t,r){const n=await i4(e),i=x8();let a=!1,o=0;const s=()=>{o=Date.now(),a=!1,t(hC(i))};try{for await(const l of C8(n,r))_8(i,M8(l)),a=!0,Date.now()-o>=Iz&&s()}catch(l){throw a&&s(),l instanceof Error&&l.name==="AbortError"||l instanceof zs?l:new zs(l instanceof Error?l.message:"stream_error")}a&&s()}function M8(e){try{return JSON.parse(e)}catch{throw new zs("stream_error")}}async function L8({transport:e,request:t,threadId:r,signal:n,onSnapshot:i}){const a=await t4(e,e4(t,r),n);await Jm(a,i,n)}async function I8(e,t,r,n){const i=await r4(e,t,r);await Jm(i,n,r)}const pC=Object.freeze(Object.defineProperty({__proto__:null,readUiMessageStream:Jm,resumeChatAnswer:I8,streamChatAnswer:L8,toSnapshot:hC},Symbol.toStringTag,{value:"Module"}));var ey=function(e,t){return ey=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ey(e,t)};function ve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ey(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ty=12,P8="sans-serif",va=ty+"px "+P8,N8=20,R8=100,O8="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function z8(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r<e.length;r++){var n=String.fromCharCode(r+32),i=(e.charCodeAt(r)-N8)/R8;t[n]=i}return t}var F8=z8(O8),Zr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var e,t;return function(r,n){if(!e){var i=Zr.createCanvas();e=i&&i.getContext("2d")}if(e)return t!==n&&(t=e.font=n||va),e.measureText(r);r=r||"",n=n||va;var a=/((?:\d+)?\.?\d*)px/.exec(n),o=a&&+a[1]||ty,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var u=F8[r[l]];s+=u==null?o:u*o}return{width:s}}})(),loadImage:function(e,t,r){var n=new Image;return n.onload=t,n.onerror=r,n.src=e,n},getTime:function(){return Date.now?Date.now():+new Date}},vC=ga(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(e,t){return e["[object "+t+"]"]=!0,e},{}),gC=ga(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(e,t){return e["[object "+t+"Array]"]=!0,e},{}),Ru=Object.prototype.toString,xd=Array.prototype,B8=xd.forEach,j8=xd.filter,ry=xd.slice,H8=xd.map,mC=function(){}.constructor,bd=mC?mC.prototype:null,ny="__proto__",iy=2311,V8=Math.pow(2,53)-1;function yC(){return iy>=V8&&(iy=0),iy++}function ay(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];typeof console<"u"&&console.error.apply(console,e)}function Ke(e){if(e==null||typeof e!="object")return e;var t=e,r=Ru.call(e);if(r==="[object Array]"){if(!Bu(e)){t=[];for(var n=0,i=e.length;n<i;n++)t[n]=Ke(e[n])}}else if(gC[r]){if(!Bu(e)){var a=e.constructor;if(a.from)t=a.from(e);else{t=new a(e.length);for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}}}else if(!vC[r]&&!Bu(e)&&!Ou(e)){t={};for(var o in e)e.hasOwnProperty(o)&&o!==ny&&(t[o]=Ke(e[o]))}return t}function st(e,t,r){if(!Ie(t)||!Ie(e))return r?Ke(t):e;for(var n in t)if(t.hasOwnProperty(n)&&n!==ny){var i=e[n],a=t[n];Ie(a)&&Ie(i)&&!pe(a)&&!pe(i)&&!Ou(a)&&!Ou(i)&&!xC(a)&&!xC(i)&&!Bu(a)&&!Bu(i)?st(i,a,r):(r||!(n in e))&&(e[n]=Ke(t[n]))}return e}function ce(e,t){if(Object.assign)Object.assign(e,t);else for(var r in t)t.hasOwnProperty(r)&&r!==ny&&(e[r]=t[r]);return e}function U8(e,t,r){e=e||{};for(var n=0;n<r.length;n++){var i=r[n];e[i]=t[i]}return e}function ct(e,t,r){for(var n=kt(t),i=0,a=n.length;i<a;i++){var o=n[i];e[o]==null&&(e[o]=t[o])}return e}function Je(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r}return-1}function $8(e,t){var r=e.prototype;function n(){}n.prototype=t.prototype,e.prototype=new n;for(var i in r)r.hasOwnProperty(i)&&(e.prototype[i]=r[i]);e.prototype.constructor=e,e.superClass=t}function Un(e,t,r){if(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var a=n[i];a!=="constructor"&&e[a]==null&&(e[a]=t[a])}else ct(e,t)}function Pr(e){return!e||typeof e=="string"?!1:typeof e.length=="number"}function U(e,t,r){if(e&&t)if(e.forEach&&e.forEach===B8)e.forEach(t,r);else if(e.length===+e.length)for(var n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(r,e[a],a,e)}function De(e,t,r){if(!e)return[];if(!t)return sy(e);if(e.map&&e.map===H8)return e.map(t,r);for(var n=[],i=0,a=e.length;i<a;i++)n.push(t.call(r,e[i],i,e));return n}function ga(e,t,r,n){if(e&&t){for(var i=0,a=e.length;i<a;i++)r=t.call(n,r,e[i],i,e);return r}}function Zt(e,t,r){if(!e)return[];if(!t)return sy(e);if(e.filter&&e.filter===j8)return e.filter(t,r);for(var n=[],i=0,a=e.length;i<a;i++)t.call(r,e[i],i,e)&&n.push(e[i]);return n}function G8(e,t,r){if(e&&t){for(var n=0,i=e.length;n<i;n++)if(t.call(r,e[n],n,e))return e[n]}}function kt(e){if(!e)return[];if(Object.keys)return Object.keys(e);var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t}function W8(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return e.apply(t,r.concat(ry.call(arguments)))}}var pt=bd&&$e(bd.bind)?bd.call.bind(bd.bind):W8;function yt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(){return e.apply(this,t.concat(ry.call(arguments)))}}function pe(e){return Array.isArray?Array.isArray(e):Ru.call(e)==="[object Array]"}function $e(e){return typeof e=="function"}function Me(e){return typeof e=="string"}function oy(e){return Ru.call(e)==="[object String]"}function ft(e){return typeof e=="number"}function Ie(e){var t=typeof e;return t==="function"||!!e&&t==="object"}function xC(e){return!!vC[Ru.call(e)]}function Nr(e){return!!gC[Ru.call(e)]}function Ou(e){return typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.ownerDocument=="object"}function wd(e){return e.colorStops!=null}function Y8(e){return e.image!=null}function zu(e){return e!==e}function Fu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0,n=e.length;r<n;r++)if(e[r]!=null)return e[r]}function Ae(e,t){return e??t}function yo(e,t,r){return e??t??r}function sy(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ry.apply(e,t)}function ly(e){if(typeof e=="number")return[e,e,e,e];var t=e.length;return t===2?[e[0],e[1],e[0],e[1]]:t===3?[e[0],e[1],e[2],e[1]]:e}function Fi(e,t){if(!e)throw new Error(t)}function ui(e){return e==null?null:typeof e.trim=="function"?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var bC="__ec_primitive__";function uy(e){e[bC]=!0}function Bu(e){return e[bC]}var X8=(function(){function e(){this.data={}}return e.prototype.delete=function(t){var r=this.has(t);return r&&delete this.data[t],r},e.prototype.has=function(t){return this.data.hasOwnProperty(t)},e.prototype.get=function(t){return this.data[t]},e.prototype.set=function(t,r){return this.data[t]=r,this},e.prototype.keys=function(){return kt(this.data)},e.prototype.forEach=function(t){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&t(r[n],n)},e})(),wC=typeof Map=="function";function q8(){return wC?new Map:new X8}var K8=(function(){function e(t){var r=pe(t);this.data=q8();var n=this;t instanceof e?t.each(i):t&&U(t,i);function i(a,o){r?n.set(a,o):n.set(o,a)}}return e.prototype.hasKey=function(t){return this.data.has(t)},e.prototype.get=function(t){return this.data.get(t)},e.prototype.set=function(t,r){return this.data.set(t,r),r},e.prototype.each=function(t,r){this.data.forEach(function(n,i){t.call(r,n,i)})},e.prototype.keys=function(){var t=this.data.keys();return wC?Array.from(t):t},e.prototype.removeKey=function(t){this.data.delete(t)},e})();function Fe(e){return new K8(e)}function Z8(e,t){for(var r=new e.constructor(e.length+t.length),n=0;n<e.length;n++)r[n]=e[n];for(var i=e.length,n=0;n<t.length;n++)r[n+i]=t[n];return r}function _d(e,t){var r;if(Object.create)r=Object.create(e);else{var n=function(){};n.prototype=e,r=new n}return t&&ce(r,t),r}function _C(e){var t=e.style;t.webkitUserSelect="none",t.userSelect="none",t.webkitTapHighlightColor="rgba(0,0,0,0)",t["-webkit-touch-callout"]="none"}function _r(e,t){return e.hasOwnProperty(t)}function lr(){}var Q8=180/Math.PI,J8=(function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e})(),eH=(function(){function e(){this.browser=new J8,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return e})(),We=new eH;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(We.wxa=!0,We.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?We.worker=!0:!We.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(We.node=!0,We.svgSupported=!0):tH(navigator.userAgent,We);function tH(e,t){var r=t.browser,n=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(r.firefox=!0,r.version=n[1]),i&&(r.ie=!0,r.version=i[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11);var s=t.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in l||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}}var rH=".",xo="___EC__COMPONENT__CONTAINER___",kC="___EC__EXTENDED_CLASS___";function ci(e){var t={main:"",sub:""};if(e){var r=e.split(rH);t.main=r[0]||"",t.sub=r[1]||""}return t}function nH(e){Fi(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function iH(e){return!!(e&&e[kC])}function cy(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return aH(n)?i=(function(a){ve(o,a);function o(){return a.apply(this,arguments)||this}return o})(n):(i=function(){(r.$constructor||n).apply(this,arguments)},$8(i,this)),ce(i.prototype,r),i[kC]=!0,i.extend=this.extend,i.superCall=lH,i.superApply=uH,i.superClass=n,i}}function aH(e){return $e(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function SC(e,t){e.extend=t.extend}var oH=Math.round(Math.random()*10);function sH(e){var t=["__\0is_clz",oH++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function lH(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[t].apply(e,r)}function uH(e,t,r){return this.superClass.prototype[t].apply(e,r)}function kd(e){var t={};e.registerClass=function(n){var i=n.type||n.prototype.type;if(i){nH(i),n.prototype.type=i;var a=ci(i);if(!a.sub)t[a.main]=n;else if(a.sub!==xo){var o=r(a);o[a.sub]=n}}return n},e.getClass=function(n,i,a){var o=t[n];if(o&&o[xo]&&(o=i?o[i]:null),a&&!o)throw new Error(i?"Component "+n+"."+(i||"")+" is used but not imported.":n+".type should be specified.");return o},e.getClassesByMainType=function(n){var i=ci(n),a=[],o=t[i.main];return o&&o[xo]?U(o,function(s,l){l!==xo&&a.push(s)}):a.push(o),a},e.hasClass=function(n){var i=ci(n);return!!t[i.main]},e.getAllClassMainTypes=function(){var n=[];return U(t,function(i,a){n.push(a)}),n},e.hasSubTypes=function(n){var i=ci(n),a=t[i.main];return a&&a[xo]};function r(n){var i=t[n.main];return(!i||!i[xo])&&(i=t[n.main]={},i[xo]=!0),i}}function ju(e,t){for(var r=0;r<e.length;r++)e[r][1]||(e[r][1]=e[r][0]);return t=t||!1,function(n,i,a){for(var o={},s=0;s<e.length;s++){var l=e[s][1];if(!(i&&Je(i,l)>=0||a&&Je(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var cH=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],fH=ju(cH),dH=(function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return fH(this,t,r)},e})(),CC=(function(){function e(t){this.value=t}return e})(),hH=(function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new CC(t);return this.insertEntry(r),r},e.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},e.prototype.remove=function(t){var r=t.prev,n=t.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e})(),Gs=(function(){function e(t){this._list=new hH,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var n=this._list,i=this._map,a=null;if(i[t]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new CC(r),s.key=t,n.insertEntry(s),i[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e})(),fy=new Gs(50);function pH(e){if(typeof e=="string"){var t=fy.get(e);return t&&t.image}else return e}function TC(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=fy.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!Sd(t)&&a.pending.push(o)):(t=Zr.loadImage(e,AC,AC),t.__zrImageSrc=e,fy.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function AC(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var r=e.pending[t],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}e.pending.length=0}function Sd(e){return e&&e.width&&e.height}function fi(){return[1,0,0,1,0,0]}function Hu(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function dy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Vu(e,t,r){var n=t[0]*r[0]+t[2]*r[1],i=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],l=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e}function hy(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function py(e,t,r,n){n===void 0&&(n=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],l=t[3],u=t[5],f=Math.sin(r),d=Math.cos(r);return e[0]=i*d+s*f,e[1]=-i*f+s*d,e[2]=a*d+l*f,e[3]=-a*f+d*l,e[4]=d*(o-n[0])+f*(u-n[1])+n[0],e[5]=d*(u-n[1])-f*(o-n[0])+n[1],e}function vH(e,t,r){var n=r[0],i=r[1];return e[0]=t[0]*n,e[1]=t[1]*i,e[2]=t[2]*n,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*i,e}function Uu(e,t){var r=t[0],n=t[2],i=t[4],a=t[1],o=t[3],s=t[5],l=r*o-a*n;return l?(l=1/l,e[0]=o*l,e[1]=-a*l,e[2]=-n*l,e[3]=r*l,e[4]=(n*s-o*i)*l,e[5]=(a*i-r*s)*l,e):null}function Ws(e,t){return e==null&&(e=0),t==null&&(t=0),[e,t]}function gH(e){return[e[0],e[1]]}function vy(e,t,r){return e[0]=t,e[1]=r,e}function EC(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e}function DC(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e}function mH(e){return Math.sqrt(yH(e))}function yH(e){return e[0]*e[0]+e[1]*e[1]}function gy(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function my(e,t){var r=mH(t);return r===0?(e[0]=0,e[1]=0):(e[0]=t[0]/r,e[1]=t[1]/r),e}function yy(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}var xy=yy;function xH(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Ys=xH;function by(e,t,r,n){return e[0]=t[0]+n*(r[0]-t[0]),e[1]=t[1]+n*(r[1]-t[1]),e}function vn(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function Xs(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e}function qs(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e}var Ye=(function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,n=this.y-t.y;return Math.sqrt(r*r+n*n)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,n=this.y-t.y;return r*r+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,n=this.y;return this.x=t[0]*r+t[2]*n+t[4],this.y=t[1]*r+t[3]*n+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,n){t.x=r,t.y=n},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,n){t.x=r.x+n.x,t.y=r.y+n.y},e.sub=function(t,r,n){t.x=r.x-n.x,t.y=r.y-n.y},e.scale=function(t,r,n){t.x=r.x*n,t.y=r.y*n},e.scaleAndAdd=function(t,r,n,i){t.x=r.x+n.x*i,t.y=r.y+n.y*i},e.lerp=function(t,r,n,i){var a=1-i;t.x=a*r.x+i*n.x,t.y=a*r.y+i*n.y},e})(),bo=Math.min,Ks=Math.max,wy=Math.abs,MC=["x","y"],bH=["width","height"],wo=new Ye,_o=new Ye,ko=new Ye,So=new Ye,Qr=PC(),$u=Qr.minTv,_y=Qr.maxTv,Gu=[0,0],je=(function(){function e(t,r,n,i){ky(this,t,r,n,i)}return e.set=function(t,r,n,i,a){return i<0&&(r=r+i,i=-i),a<0&&(n=n+a,a=-a),t.x=r,t.y=n,t.width=i,t.height=a,t},e.prototype.union=function(t){var r=bo(t.x,this.x),n=bo(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Ks(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Ks(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=r,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){return wH(fi(),this,t)},e.prototype.intersect=function(t,r,n){return e.intersect(this,t,r,n)},e.intersect=function(t,r,n,i){n&&Ye.set(n,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!r)return!1;t instanceof e||(t=ky(_H,t.x,t.y,t.width,t.height)),r instanceof e||(r=ky(kH,r.x,r.y,r.width,r.height));var s=!!n;Qr.reset(i,s);var l=Qr.touchThreshold,u=t.x+l,f=t.x+t.width-l,d=t.y+l,p=t.y+t.height-l,v=r.x+l,g=r.x+r.width-l,y=r.y+l,x=r.y+r.height-l;if(u>f||d>p||v>g||y>x)return!1;var b=!(f<v||g<u||p<y||x<d);return(s||a)&&(Gu[0]=1/0,Gu[1]=0,IC(u,f,v,g,0,s,a,o),IC(d,p,y,x,1,s,a,o),s&&Ye.copy(n,b?Qr.useDir?Qr.dirMinTv:$u:_y)),b},e.contain=function(t,r,n){return r>=t.x&&r<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},e.prototype.contain=function(t,r){return e.contain(this,t,r)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){LC(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(t,r){return t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height,t},e.applyTransform=function(t,r,n){if(!n){t!==r&&LC(t,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];t.x=r.x*i+o,t.y=r.y*a+s,t.width=r.width*i,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}wo.x=ko.x=r.x,wo.y=So.y=r.y,_o.x=So.x=r.x+r.width,_o.y=ko.y=r.y+r.height,wo.transform(n),So.transform(n),_o.transform(n),ko.transform(n),t.x=bo(wo.x,_o.x,ko.x,So.x),t.y=bo(wo.y,_o.y,ko.y,So.y);var l=Ks(wo.x,_o.x,ko.x,So.x),u=Ks(wo.y,_o.y,ko.y,So.y);t.width=l-t.x,t.height=u-t.y},e.calculateTransform=function(t,r,n){var i=n.width/r.width,a=n.height/r.height;return t=Hu(t||[]),hy(t,t,vy(Sy,-r.x,-r.y)),vH(t,t,vy(Sy,i,a)),hy(t,t,vy(Sy,n.x,n.y)),t},e})();je.create;var ky=je.set,LC=je.copy,wH=je.calculateTransform;je.applyTransform,je.contain;var _H=new je(0,0,0,0),kH=new je(0,0,0,0),Sy=[];function IC(e,t,r,n,i,a,o,s){var l=wy(t-r),u=wy(n-e),f=bo(l,u),d=MC[i],p=MC[1-i],v=bH[i];t<r||n<e?l<u?(a&&(_y[d]=-l),s&&(o[d]=t,o[v]=0)):(a&&(_y[d]=u),s&&(o[d]=e,o[v]=0)):(o&&(o[d]=Ks(e,r),o[v]=bo(t,n)-o[d]),a&&(f<Gu[0]||Qr.useDir)&&(Gu[0]=bo(f,Gu[0]),(l<u||!Qr.bidirectional)&&($u[d]=l,$u[p]=0,Qr.useDir&&Qr.calcDirMTV()),(l>=u||!Qr.bidirectional)&&($u[d]=-u,$u[p]=0,Qr.useDir&&Qr.calcDirMTV())))}function PC(){var e=0,t=new Ye,r=new Ye,n={minTv:new Ye,maxTv:new Ye,useDir:!1,dirMinTv:new Ye,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=Ks(0,a.touchThreshold)),n.negativeSize=!1,o&&(n.minTv.set(1/0,1/0),n.maxTv.set(0,0),n.useDir=!1,a&&a.direction!=null&&(n.useDir=!0,n.dirMinTv.copy(n.minTv),r.copy(n.minTv),e=a.direction,n.bidirectional=a.bidirectional==null||!!a.bidirectional,n.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=n.minTv,o=n.dirMinTv,s=a.y*a.y+a.x*a.x,l=Math.sin(e),u=Math.cos(e),f=l*a.y+u*a.x;if(i(f)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(r.x=s*u/f,r.y=s*l/f,i(r.x)&&i(r.y)){o.set(0,0);return}(n.bidirectional||t.dot(r)>0)&&r.len()<o.len()&&o.copy(r)}};function i(a){return wy(a)<1e-10}return n}function di(e){Cd||(Cd=new Gs(100)),e=e||va;var t=Cd.get(e);return t||(t={font:e,strWidthCache:new Gs(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:Zr.measureText("国",e).width,asciiCharWidth:Zr.measureText("a",e).width},Cd.put(e,t)),t}var Cd;function SH(e){if(!(Cy>=NC)){e=e||va;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Zr.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?Cy=NC:i>2&&Cy++,t}}var Cy=0,NC=5;function RC(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=SH(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function hi(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Zr.measureText(t,e.font).width,r.put(t,n)),n}function OC(e,t,r,n){var i=hi(di(t),e),a=Td(t),o=Zs(0,i,r),s=Co(0,a,n),l=new je(o,s,i,a);return l}function zC(e,t,r,n){var i=((e||"")+"").split(`
|
|
27
27
|
`),a=i.length;if(a===1)return OC(i[0],t,r,n);for(var o=new je(0,0,0,0),s=0;s<i.length;s++){var l=OC(i[s],t,r,n);s===0?o.copy(l):o.union(l)}return o}function Zs(e,t,r,n){return r==="right"?n?e+=t:e-=t:r==="center"&&(n?e+=t/2:e-=t/2),e}function Co(e,t,r,n){return r==="middle"?n?e+=t/2:e-=t/2:r==="bottom"&&(n?e+=t:e-=t),e}function Td(e){return di(e).stWideCharWidth}function To(e,t){return typeof e=="string"?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function Ad(e,t,r){var n=t.position||"inside",i=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",d="top";if(n instanceof Array)l+=To(n[0],r.width),u+=To(n[1],r.height),f=null,d=null;else switch(n){case"left":l-=i,u+=s,f="right",d="middle";break;case"right":l+=i+o,u+=s,d="middle";break;case"top":l+=o/2,u-=i,f="center",d="bottom";break;case"bottom":l+=o/2,u+=a+i,f="center";break;case"inside":l+=o/2,u+=s,f="center",d="middle";break;case"insideLeft":l+=i,u+=s,d="middle";break;case"insideRight":l+=o-i,u+=s,f="right",d="middle";break;case"insideTop":l+=o/2,u+=i,f="center";break;case"insideBottom":l+=o/2,u+=a-i,f="center",d="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,f="right";break;case"insideBottomLeft":l+=i,u+=a-i,d="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,f="right",d="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=f,e.verticalAlign=d,e}var Ty=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function CH(e,t,r,n,i,a){if(!r){e.text="",e.isTruncated=!1;return}var o=(t+"").split(`
|
|
28
28
|
`);a=FC(r,n,i,a);for(var s=!1,l={},u=0,f=o.length;u<f;u++)BC(l,o[u],a),o[u]=l.textLine,s=s||l.isTruncated;e.text=o.join(`
|
|
29
29
|
`),e.isTruncated=s}function FC(e,t,r,n){n=n||{};var i=ce({},n);r=Ae(r,"..."),i.maxIterations=Ae(n.maxIterations,2);var a=i.minChar=Ae(n.minChar,0),o=i.fontMeasureInfo=di(t),s=o.asciiCharWidth;i.placeholder=Ae(n.placeholder,"");for(var l=e=Math.max(0,e-1),u=0;u<a&&l>=s;u++)l-=s;var f=hi(o,r);return f>l&&(r="",f=0),l=e-f,i.ellipsis=r,i.ellipsisWidth=f,i.contentWidth=l,i.containerWidth=e,i}function BC(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=hi(a,t);if(o<=n){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){t+=r.ellipsis;break}var l=s===0?TH(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=hi(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function TH(e,t,r){for(var n=0,i=0,a=e.length;i<a&&n<t;i++)n+=RC(r,e.charCodeAt(i));return i}function AH(e,t,r,n){var i=Ey(e),a=t.overflow,o=t.padding,s=o?o[1]+o[3]:0,l=o?o[0]+o[2]:0,u=t.font,f=a==="truncate",d=Td(u),p=Ae(t.lineHeight,d),v=t.lineOverflow==="truncate",g=!1,y=t.width;y==null&&r!=null&&(y=r-s);var x=t.height;x==null&&n!=null&&(x=n-l);var b;y!=null&&(a==="break"||a==="breakAll")?b=i?HC(i,t.font,y,a==="breakAll",0).lines:[]:b=i?i.split(`
|