@plannotator/opencode 0.19.23 → 0.19.24
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/dist/index.js +150 -117
- package/package.json +2 -2
- package/plannotator.html +6 -6
- package/review-editor.html +5 -5
package/plannotator.html
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
`+Ve[M].replace(" at new "," at ");return f.displayName&&Ot.includes("<anonymous>")&&(Ot=Ot.replace("<anonymous>",f.displayName)),Ot}while(1<=M&&0<=j);break}}}finally{De=!1,Error.prepareStackTrace=w}return(w=f?f.displayName||f.name:"")?le(w):""}function qe(f,E){switch(f.tag){case 26:case 27:case 5:return le(f.type);case 16:return le("Lazy");case 13:return f.child!==E&&E!==null?le("Suspense Fallback"):le("Suspense");case 19:return le("SuspenseList");case 0:case 15:return he(f.type,!1);case 11:return he(f.type.render,!1);case 1:return he(f.type,!0);case 31:return le("Activity");default:return""}}function ce(f){try{var E="",w=null;do E+=qe(f,w),w=f,f=f.return;while(f);return E}catch(M){return`
|
|
60
60
|
Error generating stack: `+M.message+`
|
|
61
61
|
`+M.stack}}var et=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,rt=t.unstable_cancelCallback,tt=t.unstable_shouldYield,gt=t.unstable_requestPaint,Ge=t.unstable_now,ot=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,ut=t.unstable_NormalPriority,Se=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,be=t.log,ve=t.unstable_setDisableYieldValue,X=null,we=null;function Be(f){if(typeof be=="function"&&ve(f),we&&typeof we.setStrictMode=="function")try{we.setStrictMode(X,f)}catch{}}var Ne=Math.clz32?Math.clz32:Ee,Me=Math.log,Ke=Math.LN2;function Ee(f){return f>>>=0,f===0?32:31-(Me(f)/Ke|0)|0}var _e=256,We=262144,it=4194304;function ht(f){var E=f&42;if(E!==0)return E;switch(f&-f){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return f&261888;case 262144:case 524288:case 1048576:case 2097152:return f&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return f&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return f}}function Ie(f,E,w){var M=f.pendingLanes;if(M===0)return 0;var j=0,W=f.suspendedLanes,ge=f.pingedLanes;f=f.warmLanes;var xe=M&134217727;return xe!==0?(M=xe&~W,M!==0?j=ht(M):(ge&=xe,ge!==0?j=ht(ge):w||(w=xe&~f,w!==0&&(j=ht(w))))):(xe=M&~W,xe!==0?j=ht(xe):ge!==0?j=ht(ge):w||(w=M&~f,w!==0&&(j=ht(w)))),j===0?0:E!==0&&E!==j&&(E&W)===0&&(W=j&-j,w=E&-E,W>=w||W===32&&(w&4194048)!==0)?E:j}function Pe(f,E){return(f.pendingLanes&~(f.suspendedLanes&~f.pingedLanes)&E)===0}function Oe(f,E){switch(f){case 1:case 2:case 4:case 8:case 64:return E+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return E+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var f=it;return it<<=1,(it&62914560)===0&&(it=4194304),f}function Rt(f){for(var E=[],w=0;31>w;w++)E.push(f);return E}function ft(f,E){f.pendingLanes|=E,E!==268435456&&(f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0)}function ie(f,E,w,M,j,W){var ge=f.pendingLanes;f.pendingLanes=w,f.suspendedLanes=0,f.pingedLanes=0,f.warmLanes=0,f.expiredLanes&=w,f.entangledLanes&=w,f.errorRecoveryDisabledLanes&=w,f.shellSuspendCounter=0;var xe=f.entanglements,Ve=f.expirationTimes,wt=f.hiddenUpdates;for(w=ge&~w;0<w;){var Ot=31-Ne(w),jt=1<<Ot;xe[Ot]=0,Ve[Ot]=-1;var St=wt[Ot];if(St!==null)for(wt[Ot]=null,Ot=0;Ot<St.length;Ot++){var Nt=St[Ot];Nt!==null&&(Nt.lane&=-536870913)}w&=~jt}M!==0&<(f,M,0),W!==0&&j===0&&f.tag!==0&&(f.suspendedLanes|=W&~(ge&~E))}function lt(f,E,w){f.pendingLanes|=E,f.suspendedLanes&=~E;var M=31-Ne(E);f.entangledLanes|=E,f.entanglements[M]=f.entanglements[M]|1073741824|w&261930}function At(f,E){var w=f.entangledLanes|=E;for(f=f.entanglements;w;){var M=31-Ne(w),j=1<<M;j&E|f[M]&E&&(f[M]|=E),w&=~j}}function vt(f,E){var w=E&-E;return w=(w&42)!==0?1:_t(w),(w&(f.suspendedLanes|E))!==0?0:w}function _t(f){switch(f){case 2:f=1;break;case 8:f=4;break;case 32:f=16;break;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:f=128;break;case 268435456:f=134217728;break;default:f=0}return f}function Tt(f){return f&=-f,2<f?8<f?(f&134217727)!==0?32:268435456:8:2}function Kt(){var f=T.p;return f!==0?f:(f=window.event,f===void 0?32:v$(f.type))}function $t(f,E){var w=T.p;try{return T.p=f,E()}finally{T.p=w}}var Ft=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Ft,Wt="__reactProps$"+Ft,vn="__reactContainer$"+Ft,Qn="__reactEvents$"+Ft,mn="__reactListeners$"+Ft,Tn="__reactHandles$"+Ft,fa="__reactResources$"+Ft,Et="__reactMarker$"+Ft;function fe(f){delete f[Mt],delete f[Wt],delete f[Qn],delete f[mn],delete f[Tn]}function $e(f){var E=f[Mt];if(E)return E;for(var w=f.parentNode;w;){if(E=w[vn]||w[Mt]){if(w=E.alternate,E.child!==null||w!==null&&w.child!==null)for(f=d$(f);f!==null;){if(w=f[Mt])return w;f=d$(f)}return E}f=w,w=f.parentNode}return null}function Dt(f){if(f=f[Mt]||f[vn]){var E=f.tag;if(E===5||E===6||E===13||E===31||E===26||E===27||E===3)return f}return null}function hn(f){var E=f.tag;if(E===5||E===26||E===27||E===6)return f.stateNode;throw Error(a(33))}function dn(f){var E=f[fa];return E||(E=f[fa]={hoistableStyles:new Map,hoistableScripts:new Map}),E}function on(f){f[Et]=!0}var zn=new Set,Hn={};function ga(f,E){Ut(f,E),Ut(f+"Capture",E)}function Ut(f,E){for(Hn[f]=E,f=0;f<E.length;f++)zn.add(E[f])}var Ct=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Gt={},Lt={};function It(f){return et.call(Lt,f)?!0:et.call(Gt,f)?!1:Ct.test(f)?Lt[f]=!0:(Gt[f]=!0,!1)}function Bn(f,E,w){if(It(E))if(w===null)f.removeAttribute(E);else{switch(typeof w){case"undefined":case"function":case"symbol":f.removeAttribute(E);return;case"boolean":var M=E.toLowerCase().slice(0,5);if(M!=="data-"&&M!=="aria-"){f.removeAttribute(E);return}}f.setAttribute(E,""+w)}}function Le(f,E,w){if(w===null)f.removeAttribute(E);else{switch(typeof w){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(E);return}f.setAttribute(E,""+w)}}function ur(f,E,w,M){if(M===null)f.removeAttribute(w);else{switch(typeof M){case"undefined":case"function":case"symbol":case"boolean":f.removeAttribute(w);return}f.setAttributeNS(E,w,""+M)}}function Ue(f){switch(typeof f){case"bigint":case"boolean":case"number":case"string":case"undefined":return f;case"object":return f;default:return""}}function Yn(f){var E=f.type;return(f=f.nodeName)&&f.toLowerCase()==="input"&&(E==="checkbox"||E==="radio")}function To(f,E,w){var M=Object.getOwnPropertyDescriptor(f.constructor.prototype,E);if(!f.hasOwnProperty(E)&&typeof M<"u"&&typeof M.get=="function"&&typeof M.set=="function"){var j=M.get,W=M.set;return Object.defineProperty(f,E,{configurable:!0,get:function(){return j.call(this)},set:function(ge){w=""+ge,W.call(this,ge)}}),Object.defineProperty(f,E,{enumerable:M.enumerable}),{getValue:function(){return w},setValue:function(ge){w=""+ge},stopTracking:function(){f._valueTracker=null,delete f[E]}}}}function Go(f){if(!f._valueTracker){var E=Yn(f)?"checked":"value";f._valueTracker=To(f,E,""+f[E])}}function Xi(f){if(!f)return!1;var E=f._valueTracker;if(!E)return!0;var w=E.getValue(),M="";return f&&(M=Yn(f)?f.checked?"true":"false":f.value),f=M,f!==w?(E.setValue(f),!0):!1}function os(f){if(f=f||(typeof document<"u"?document:void 0),typeof f>"u")return null;try{return f.activeElement||f.body}catch{return f.body}}var kr=/[\n"\\]/g;function vr(f){return f.replace(kr,function(E){return"\\"+E.charCodeAt(0).toString(16)+" "})}function $i(f,E,w,M,j,W,ge,xe){f.name="",ge!=null&&typeof ge!="function"&&typeof ge!="symbol"&&typeof ge!="boolean"?f.type=ge:f.removeAttribute("type"),E!=null?ge==="number"?(E===0&&f.value===""||f.value!=E)&&(f.value=""+Ue(E)):f.value!==""+Ue(E)&&(f.value=""+Ue(E)):ge!=="submit"&&ge!=="reset"||f.removeAttribute("value"),E!=null?As(f,ge,Ue(E)):w!=null?As(f,ge,Ue(w)):M!=null&&f.removeAttribute("value"),j==null&&W!=null&&(f.defaultChecked=!!W),j!=null&&(f.checked=j&&typeof j!="function"&&typeof j!="symbol"),xe!=null&&typeof xe!="function"&&typeof xe!="symbol"&&typeof xe!="boolean"?f.name=""+Ue(xe):f.removeAttribute("name")}function Zr(f,E,w,M,j,W,ge,xe){if(W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"&&(f.type=W),E!=null||w!=null){if(!(W!=="submit"&&W!=="reset"||E!=null)){Go(f);return}w=w!=null?""+Ue(w):"",E=E!=null?""+Ue(E):w,xe||E===f.value||(f.value=E),f.defaultValue=E}M=M??j,M=typeof M!="function"&&typeof M!="symbol"&&!!M,f.checked=xe?f.checked:!!M,f.defaultChecked=!!M,ge!=null&&typeof ge!="function"&&typeof ge!="symbol"&&typeof ge!="boolean"&&(f.name=ge),Go(f)}function As(f,E,w){E==="number"&&os(f.ownerDocument)===f||f.defaultValue===""+w||(f.defaultValue=""+w)}function Dr(f,E,w,M){if(f=f.options,E){E={};for(var j=0;j<w.length;j++)E["$"+w[j]]=!0;for(w=0;w<f.length;w++)j=E.hasOwnProperty("$"+f[w].value),f[w].selected!==j&&(f[w].selected=j),j&&M&&(f[w].defaultSelected=!0)}else{for(w=""+Ue(w),E=null,j=0;j<f.length;j++){if(f[j].value===w){f[j].selected=!0,M&&(f[j].defaultSelected=!0);return}E!==null||f[j].disabled||(E=f[j])}E!==null&&(E.selected=!0)}}function Ks(f,E,w){if(E!=null&&(E=""+Ue(E),E!==f.value&&(f.value=E),w==null)){f.defaultValue!==E&&(f.defaultValue=E);return}f.defaultValue=w!=null?""+Ue(w):""}function ar(f,E,w,M){if(E==null){if(M!=null){if(w!=null)throw Error(a(92));if(O(M)){if(1<M.length)throw Error(a(93));M=M[0]}w=M}w==null&&(w=""),E=w}w=Ue(E),f.defaultValue=w,M=f.textContent,M===w&&M!==""&&M!==null&&(f.value=M),Go(f)}function wn(f,E){if(E){var w=f.firstChild;if(w&&w===f.lastChild&&w.nodeType===3){w.nodeValue=E;return}}f.textContent=E}var Un=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function bn(f,E,w){var M=E.indexOf("--")===0;w==null||typeof w=="boolean"||w===""?M?f.setProperty(E,""):E==="float"?f.cssFloat="":f[E]="":M?f.setProperty(E,w):typeof w!="number"||w===0||Un.has(E)?E==="float"?f.cssFloat=w:f[E]=(""+w).trim():f[E]=w+"px"}function pa(f,E,w){if(E!=null&&typeof E!="object")throw Error(a(62));if(f=f.style,w!=null){for(var M in w)!w.hasOwnProperty(M)||E!=null&&E.hasOwnProperty(M)||(M.indexOf("--")===0?f.setProperty(M,""):M==="float"?f.cssFloat="":f[M]="");for(var j in E)M=E[j],E.hasOwnProperty(j)&&w[j]!==M&&bn(f,j,M)}else for(var W in E)E.hasOwnProperty(W)&&bn(f,W,E[W])}function Ua(f){if(f.indexOf("-")===-1)return!1;switch(f){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 rr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ni=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Mi(f){return Ni.test(""+f)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":f}function Xt(){}var J=null;function ee(f){return f=f.target||f.srcElement||window,f.correspondingUseElement&&(f=f.correspondingUseElement),f.nodeType===3?f.parentNode:f}var me=null,Ce=null;function Ye(f){var E=Dt(f);if(E&&(f=E.stateNode)){var w=f[Wt]||null;e:switch(f=E.stateNode,E.type){case"input":if($i(f,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name),E=w.name,w.type==="radio"&&E!=null){for(w=f;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll('input[name="'+vr(""+E)+'"][type="radio"]'),E=0;E<w.length;E++){var M=w[E];if(M!==f&&M.form===f.form){var j=M[Wt]||null;if(!j)throw Error(a(90));$i(M,j.value,j.defaultValue,j.defaultValue,j.checked,j.defaultChecked,j.type,j.name)}}for(E=0;E<w.length;E++)M=w[E],M.form===f.form&&Xi(M)}break e;case"textarea":Ks(f,w.value,w.defaultValue);break e;case"select":E=w.value,E!=null&&Dr(f,!!w.multiple,E,!1)}}}var nt=!1;function ct(f,E,w){if(nt)return f(E,w);nt=!0;try{var M=f(E);return M}finally{if(nt=!1,(me!==null||Ce!==null)&&(DD(),me&&(E=me,f=Ce,Ce=me=null,Ye(E),f)))for(E=0;E<f.length;E++)Ye(f[E])}}function Bt(f,E){var w=f.stateNode;if(w===null)return null;var M=w[Wt]||null;if(M===null)return null;w=M[E];e:switch(E){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(M=!M.disabled)||(f=f.type,M=!(f==="button"||f==="input"||f==="select"||f==="textarea")),f=!M;break e;default:f=!1}if(f)return null;if(w&&typeof w!="function")throw Error(a(231,E,typeof w));return w}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ta=!1;if(An)try{var un={};Object.defineProperty(un,"passive",{get:function(){ta=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{ta=!1}var sa=null,na=null,xn=null;function qn(){if(xn)return xn;var f,E=na,w=E.length,M,j="value"in sa?sa.value:sa.textContent,W=j.length;for(f=0;f<w&&E[f]===j[f];f++);var ge=w-f;for(M=1;M<=ge&&E[w-M]===j[W-M];M++);return xn=j.slice(f,1<M?1-M:void 0)}function Cr(f){var E=f.keyCode;return"charCode"in f?(f=f.charCode,f===0&&E===13&&(f=13)):f=E,f===10&&(f=13),32<=f||f===13?f:0}function eo(){return!0}function Vr(){return!1}function gr(f){function E(w,M,j,W,ge){this._reactName=w,this._targetInst=j,this.type=M,this.nativeEvent=W,this.target=ge,this.currentTarget=null;for(var xe in f)f.hasOwnProperty(xe)&&(w=f[xe],this[xe]=w?w(W):W[xe]);return this.isDefaultPrevented=(W.defaultPrevented!=null?W.defaultPrevented:W.returnValue===!1)?eo:Vr,this.isPropagationStopped=Vr,this}return u(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=eo)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=eo)},persist:function(){},isPersistent:eo}),E}var ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(f){return f.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kc=gr(ii),Qo=u({},ii,{view:0,detail:0}),vc=gr(Qo),Pr,FB,sp,Zb=u({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fl,button:0,buttons:0,relatedTarget:function(f){return f.relatedTarget===void 0?f.fromElement===f.srcElement?f.toElement:f.fromElement:f.relatedTarget},movementX:function(f){return"movementX"in f?f.movementX:(f!==sp&&(sp&&f.type==="mousemove"?(Pr=f.screenX-sp.screenX,FB=f.screenY-sp.screenY):FB=Pr=0,sp=f),Pr)},movementY:function(f){return"movementY"in f?f.movementY:FB}}),Ov=gr(Zb),Hs=u({},Zb,{dataTransfer:0}),CL=gr(Hs),pd=u({},Qo,{relatedTarget:0}),LB=gr(pd),EL=u({},ii,{animationName:0,elapsedTime:0,pseudoElement:0}),Uv=gr(EL),Er=u({},ii,{clipboardData:function(f){return"clipboardData"in f?f.clipboardData:window.clipboardData}}),IL=gr(Er),Pv=u({},ii,{data:0}),Dc=gr(Pv),Kv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vb={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"},vA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TB(f){var E=this.nativeEvent;return E.getModifierState?E.getModifierState(f):(f=vA[f])?!!E[f]:!1}function fl(){return TB}var BL=u({},Qo,{key:function(f){if(f.key){var E=Kv[f.key]||f.key;if(E!=="Unidentified")return E}return f.type==="keypress"?(f=Cr(f),f===13?"Enter":String.fromCharCode(f)):f.type==="keydown"||f.type==="keyup"?Vb[f.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fl,charCode:function(f){return f.type==="keypress"?Cr(f):0},keyCode:function(f){return f.type==="keydown"||f.type==="keyup"?f.keyCode:0},which:function(f){return f.type==="keypress"?Cr(f):f.type==="keydown"||f.type==="keyup"?f.keyCode:0}}),Su=gr(BL),yL=u({},Zb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hv=gr(yL),Xb=u({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fl}),Yv=gr(Xb),QL=u({},ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),wL=gr(QL),qv=u({},Zb,{deltaX:function(f){return"deltaX"in f?f.deltaX:"wheelDeltaX"in f?-f.wheelDeltaX:0},deltaY:function(f){return"deltaY"in f?f.deltaY:"wheelDeltaY"in f?-f.wheelDeltaY:"wheelDelta"in f?-f.wheelDelta:0},deltaZ:0,deltaMode:0}),kL=gr(qv),fh=u({},ii,{newState:0,oldState:0}),jv=gr(fh),vL=[9,13,27,32],GB=An&&"CompositionEvent"in window,bh=null;An&&"documentMode"in document&&(bh=document.documentMode);var $b=An&&"TextEvent"in window&&!bh,zv=An&&(!GB||bh&&8<bh&&11>=bh),OB=" ",eC=!1;function tC(f,E){switch(f){case"keyup":return vL.indexOf(E.keyCode)!==-1;case"keydown":return E.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ch(f){return f=f.detail,typeof f=="object"&&"data"in f?f.data:null}var bl=!1;function DL(f,E){switch(f){case"compositionend":return Ch(E);case"keypress":return E.which!==32?null:(eC=!0,OB);case"textInput":return f=E.data,f===OB&&eC?null:f;default:return null}}function xL(f,E){if(bl)return f==="compositionend"||!GB&&tC(f,E)?(f=qn(),xn=na=sa=null,bl=!1,f):null;switch(f){case"paste":return null;case"keypress":if(!(E.ctrlKey||E.altKey||E.metaKey)||E.ctrlKey&&E.altKey){if(E.char&&1<E.char.length)return E.char;if(E.which)return String.fromCharCode(E.which)}return null;case"compositionend":return zv&&E.locale!=="ko"?null:E.data;default:return null}}var Eh={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 nC(f){var E=f&&f.nodeName&&f.nodeName.toLowerCase();return E==="input"?!!Eh[f.type]:E==="textarea"}function aC(f,E,w,M){me?Ce?Ce.push(M):Ce=[M]:me=M,E=FD(E,"onChange"),0<E.length&&(w=new kc("onChange","change",null,w,M),f.push({event:w,listeners:E}))}var md=null,_u=null;function SL(f){VX(f,0)}function rC(f){var E=hn(f);if(Xi(E))return f}function Ih(f,E){if(f==="change")return E}var Bh=!1;if(An){var UB;if(An){var PB="oninput"in document;if(!PB){var KB=document.createElement("div");KB.setAttribute("oninput","return;"),PB=typeof KB.oninput=="function"}UB=PB}else UB=!1;Bh=UB&&(!document.documentMode||9<document.documentMode)}function HB(){md&&(md.detachEvent("onpropertychange",YB),_u=md=null)}function YB(f){if(f.propertyName==="value"&&rC(_u)){var E=[];aC(E,_u,f,ee(f)),ct(SL,E)}}function qB(f,E,w){f==="focusin"?(HB(),md=E,_u=w,md.attachEvent("onpropertychange",YB)):f==="focusout"&&HB()}function _L(f){if(f==="selectionchange"||f==="keyup"||f==="keydown")return rC(_u)}function RL(f,E){if(f==="click")return rC(E)}function NL(f,E){if(f==="input"||f==="change")return rC(E)}function Jv(f,E){return f===E&&(f!==0||1/f===1/E)||f!==f&&E!==E}var oA=typeof Object.is=="function"?Object.is:Jv;function yh(f,E){if(oA(f,E))return!0;if(typeof f!="object"||f===null||typeof E!="object"||E===null)return!1;var w=Object.keys(f),M=Object.keys(E);if(w.length!==M.length)return!1;for(M=0;M<w.length;M++){var j=w[M];if(!et.call(E,j)||!oA(f[j],E[j]))return!1}return!0}function xc(f){for(;f&&f.firstChild;)f=f.firstChild;return f}function cp(f,E){var w=xc(f);f=0;for(var M;w;){if(w.nodeType===3){if(M=f+w.textContent.length,f<=E&&M>=E)return{node:w,offset:E-f};f=M}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=xc(w)}}function hd(f,E){return f&&E?f===E?!0:f&&f.nodeType===3?!1:E&&E.nodeType===3?hd(f,E.parentNode):"contains"in f?f.contains(E):f.compareDocumentPosition?!!(f.compareDocumentPosition(E)&16):!1:!1}function jB(f){f=f!=null&&f.ownerDocument!=null&&f.ownerDocument.defaultView!=null?f.ownerDocument.defaultView:window;for(var E=os(f.document);E instanceof f.HTMLIFrameElement;){try{var w=typeof E.contentWindow.location.href=="string"}catch{w=!1}if(w)f=E.contentWindow;else break;E=os(f.document)}return E}function iC(f){var E=f&&f.nodeName&&f.nodeName.toLowerCase();return E&&(E==="input"&&(f.type==="text"||f.type==="search"||f.type==="tel"||f.type==="url"||f.type==="password")||E==="textarea"||f.contentEditable==="true")}var oC=An&&"documentMode"in document&&11>=document.documentMode,DA=null,AC=null,Ru=null,zB=!1;function Qh(f,E,w){var M=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;zB||DA==null||DA!==os(M)||(M=DA,"selectionStart"in M&&iC(M)?M={start:M.selectionStart,end:M.selectionEnd}:(M=(M.ownerDocument&&M.ownerDocument.defaultView||window).getSelection(),M={anchorNode:M.anchorNode,anchorOffset:M.anchorOffset,focusNode:M.focusNode,focusOffset:M.focusOffset}),Ru&&yh(Ru,M)||(Ru=M,M=FD(AC,"onSelect"),0<M.length&&(E=new kc("onSelect","select",null,E,w),f.push({event:E,listeners:M}),E.target=DA)))}function Nu(f,E){var w={};return w[f.toLowerCase()]=E.toLowerCase(),w["Webkit"+f]="webkit"+E,w["Moz"+f]="moz"+E,w}var lp={animationend:Nu("Animation","AnimationEnd"),animationiteration:Nu("Animation","AnimationIteration"),animationstart:Nu("Animation","AnimationStart"),transitionrun:Nu("Transition","TransitionRun"),transitionstart:Nu("Transition","TransitionStart"),transitioncancel:Nu("Transition","TransitionCancel"),transitionend:Nu("Transition","TransitionEnd")},JB={},Wv={};An&&(Wv=document.createElement("div").style,"AnimationEvent"in window||(delete lp.animationend.animation,delete lp.animationiteration.animation,delete lp.animationstart.animation),"TransitionEvent"in window||delete lp.transitionend.transition);function fd(f){if(JB[f])return JB[f];if(!lp[f])return f;var E=lp[f],w;for(w in E)if(E.hasOwnProperty(w)&&w in Wv)return JB[f]=E[w];return f}var WB=fd("animationend"),ZB=fd("animationiteration"),VB=fd("animationstart"),bd=fd("transitionrun"),XB=fd("transitionstart"),$B=fd("transitioncancel"),Zv=fd("transitionend"),wh=new Map,ey="abort auxClick beforeToggle 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(" ");ey.push("scrollEnd");function AA(f,E){wh.set(f,E),ga(E,[f])}var sC=typeof reportError=="function"?reportError:function(f){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof f=="object"&&f!==null&&typeof f.message=="string"?String(f.message):String(f),error:f});if(!window.dispatchEvent(E))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",f);return}console.error(f)},wo=[],Cl=0,ty=0;function cC(){for(var f=Cl,E=ty=Cl=0;E<f;){var w=wo[E];wo[E++]=null;var M=wo[E];wo[E++]=null;var j=wo[E];wo[E++]=null;var W=wo[E];if(wo[E++]=null,M!==null&&j!==null){var ge=M.pending;ge===null?j.next=j:(j.next=ge.next,ge.next=j),M.pending=j}W!==0&&ny(w,j,W)}}function dp(f,E,w,M){wo[Cl++]=f,wo[Cl++]=E,wo[Cl++]=w,wo[Cl++]=M,ty|=M,f.lanes|=M,f=f.alternate,f!==null&&(f.lanes|=M)}function Mu(f,E,w,M){return dp(f,E,w,M),ss(f)}function Cd(f,E){return dp(f,null,null,E),ss(f)}function ny(f,E,w){f.lanes|=w;var M=f.alternate;M!==null&&(M.lanes|=w);for(var j=!1,W=f.return;W!==null;)W.childLanes|=w,M=W.alternate,M!==null&&(M.childLanes|=w),W.tag===22&&(f=W.stateNode,f===null||f._visibility&1||(j=!0)),f=W,W=W.return;return f.tag===3?(W=f.stateNode,j&&E!==null&&(j=31-Ne(w),f=W.hiddenUpdates,M=f[j],M===null?f[j]=[E]:M.push(E),E.lane=w|536870912),W):null}function ss(f){if(50<ky)throw ky=0,GT=null,Error(a(185));for(var E=f.return;E!==null;)f=E,E=f.return;return f.tag===3?f.stateNode:null}var to={};function ML(f,E,w,M){this.tag=f,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=E,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xA(f,E,w,M){return new ML(f,E,w,M)}function ay(f){return f=f.prototype,!(!f||!f.isReactComponent)}function El(f,E){var w=f.alternate;return w===null?(w=xA(f.tag,E,f.key,f.mode),w.elementType=f.elementType,w.type=f.type,w.stateNode=f.stateNode,w.alternate=f,f.alternate=w):(w.pendingProps=E,w.type=f.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=f.flags&65011712,w.childLanes=f.childLanes,w.lanes=f.lanes,w.child=f.child,w.memoizedProps=f.memoizedProps,w.memoizedState=f.memoizedState,w.updateQueue=f.updateQueue,E=f.dependencies,w.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext},w.sibling=f.sibling,w.index=f.index,w.ref=f.ref,w.refCleanup=f.refCleanup,w}function Vv(f,E){f.flags&=65011714;var w=f.alternate;return w===null?(f.childLanes=0,f.lanes=E,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=w.childLanes,f.lanes=w.lanes,f.child=w.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=w.memoizedProps,f.memoizedState=w.memoizedState,f.updateQueue=w.updateQueue,f.type=w.type,E=w.dependencies,f.dependencies=E===null?null:{lanes:E.lanes,firstContext:E.firstContext}),f}function lC(f,E,w,M,j,W){var ge=0;if(M=f,typeof f=="function")ay(f)&&(ge=1);else if(typeof f=="string")ge=p4e(f,w,$.current)?26:f==="html"||f==="head"||f==="body"?27:5;else e:switch(f){case S:return f=xA(31,w,E,j),f.elementType=S,f.lanes=W,f;case h:return Fu(w.children,j,W,E);case b:ge=8,j|=24;break;case C:return f=xA(12,w,E,j|2),f.elementType=C,f.lanes=W,f;case k:return f=xA(13,w,E,j),f.elementType=k,f.lanes=W,f;case _:return f=xA(19,w,E,j),f.elementType=_,f.lanes=W,f;default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:ge=10;break e;case B:ge=9;break e;case Q:ge=11;break e;case v:ge=14;break e;case x:ge=16,M=null;break e}ge=29,w=Error(a(130,f===null?"null":typeof f,"")),M=null}return E=xA(ge,w,E,j),E.elementType=f,E.type=M,E.lanes=W,E}function Fu(f,E,w,M){return f=xA(7,f,M,E),f.lanes=w,f}function ry(f,E,w){return f=xA(6,f,null,E),f.lanes=w,f}function Xv(f){var E=xA(18,null,null,0);return E.stateNode=f,E}function iy(f,E,w){return E=xA(4,f.children!==null?f.children:[],f.key,E),E.lanes=w,E.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},E}var $v=new WeakMap;function cs(f,E){if(typeof f=="object"&&f!==null){var w=$v.get(f);return w!==void 0?w:(E={value:f,source:E,stack:ce(E)},$v.set(f,E),E)}return{value:f,source:E,stack:ce(E)}}var up=[],gp=0,dC=null,kh=0,sA=[],Fi=0,Ed=null,Sc=1,Te="";function xt(f,E){up[gp++]=kh,up[gp++]=dC,dC=f,kh=E}function zt(f,E,w){sA[Fi++]=Sc,sA[Fi++]=Te,sA[Fi++]=Ed,Ed=f;var M=Sc;f=Te;var j=32-Ne(M)-1;M&=~(1<<j),w+=1;var W=32-Ne(E)+j;if(30<W){var ge=j-j%5;W=(M&(1<<ge)-1).toString(32),M>>=ge,j-=ge,Sc=1<<32-Ne(E)+j|w<<j|M,Te=W+f}else Sc=1<<W|w<<j|M,Te=f}function an(f){f.return!==null&&(xt(f,1),zt(f,1,0))}function aa(f){for(;f===dC;)dC=up[--gp],up[gp]=null,kh=up[--gp],up[gp]=null;for(;f===Ed;)Ed=sA[--Fi],sA[Fi]=null,Te=sA[--Fi],sA[Fi]=null,Sc=sA[--Fi],sA[Fi]=null}function Sa(f,E){sA[Fi++]=Sc,sA[Fi++]=Te,sA[Fi++]=Ed,Sc=E.id,Te=E.overflow,Ed=f}var ba=null,Jn=null,Ca=!1,Oo=null,_c=!1,FL=Error(a(519));function pp(f){var E=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oy(cs(E,f)),FL}function GZ(f){var E=f.stateNode,w=f.type,M=f.memoizedProps;switch(E[Mt]=f,E[Wt]=M,w){case"dialog":Ra("cancel",E),Ra("close",E);break;case"iframe":case"object":case"embed":Ra("load",E);break;case"video":case"audio":for(w=0;w<Dy.length;w++)Ra(Dy[w],E);break;case"source":Ra("error",E);break;case"img":case"image":case"link":Ra("error",E),Ra("load",E);break;case"details":Ra("toggle",E);break;case"input":Ra("invalid",E),Zr(E,M.value,M.defaultValue,M.checked,M.defaultChecked,M.type,M.name,!0);break;case"select":Ra("invalid",E);break;case"textarea":Ra("invalid",E),ar(E,M.value,M.defaultValue,M.children)}w=M.children,typeof w!="string"&&typeof w!="number"&&typeof w!="bigint"||E.textContent===""+w||M.suppressHydrationWarning===!0||t$(E.textContent,w)?(M.popover!=null&&(Ra("beforetoggle",E),Ra("toggle",E)),M.onScroll!=null&&Ra("scroll",E),M.onScrollEnd!=null&&Ra("scrollend",E),M.onClick!=null&&(E.onclick=Xt),E=!0):E=!1,E||pp(f,!0)}function OZ(f){for(ba=f.return;ba;)switch(ba.tag){case 5:case 31:case 13:_c=!1;return;case 27:case 3:_c=!0;return;default:ba=ba.return}}function uC(f){if(f!==ba)return!1;if(!Ca)return OZ(f),Ca=!0,!1;var E=f.tag,w;if((w=E!==3&&E!==27)&&((w=E===5)&&(w=f.type,w=!(w!=="form"&&w!=="button")||$T(f.type,f.memoizedProps)),w=!w),w&&Jn&&pp(f),OZ(f),E===13){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));Jn=l$(f)}else if(E===31){if(f=f.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));Jn=l$(f)}else E===27?(E=Jn,Dp(f.type)?(f=r3,r3=null,Jn=f):Jn=E):Jn=ba?Nc(f.stateNode.nextSibling):null;return!0}function vh(){Jn=ba=null,Ca=!1}function LL(){var f=Oo;return f!==null&&(gs===null?gs=f:gs.push.apply(gs,f),Oo=null),f}function oy(f){Oo===null?Oo=[f]:Oo.push(f)}var TL=P(null),Dh=null,Lu=null;function mp(f,E,w){Z(TL,E._currentValue),E._currentValue=w}function Tu(f){f._currentValue=TL.current,z(TL)}function GL(f,E,w){for(;f!==null;){var M=f.alternate;if((f.childLanes&E)!==E?(f.childLanes|=E,M!==null&&(M.childLanes|=E)):M!==null&&(M.childLanes&E)!==E&&(M.childLanes|=E),f===w)break;f=f.return}}function OL(f,E,w,M){var j=f.child;for(j!==null&&(j.return=f);j!==null;){var W=j.dependencies;if(W!==null){var ge=j.child;W=W.firstContext;e:for(;W!==null;){var xe=W;W=j;for(var Ve=0;Ve<E.length;Ve++)if(xe.context===E[Ve]){W.lanes|=w,xe=W.alternate,xe!==null&&(xe.lanes|=w),GL(W.return,w,f),M||(ge=null);break e}W=xe.next}}else if(j.tag===18){if(ge=j.return,ge===null)throw Error(a(341));ge.lanes|=w,W=ge.alternate,W!==null&&(W.lanes|=w),GL(ge,w,f),ge=null}else ge=j.child;if(ge!==null)ge.return=j;else for(ge=j;ge!==null;){if(ge===f){ge=null;break}if(j=ge.sibling,j!==null){j.return=ge.return,ge=j;break}ge=ge.return}j=ge}}function gC(f,E,w,M){f=null;for(var j=E,W=!1;j!==null;){if(!W){if((j.flags&524288)!==0)W=!0;else if((j.flags&262144)!==0)break}if(j.tag===10){var ge=j.alternate;if(ge===null)throw Error(a(387));if(ge=ge.memoizedProps,ge!==null){var xe=j.type;oA(j.pendingProps.value,ge.value)||(f!==null?f.push(xe):f=[xe])}}else if(j===ne.current){if(ge=j.alternate,ge===null)throw Error(a(387));ge.memoizedState.memoizedState!==j.memoizedState.memoizedState&&(f!==null?f.push(Ny):f=[Ny])}j=j.return}f!==null&&OL(E,f,w,M),E.flags|=262144}function eD(f){for(f=f.firstContext;f!==null;){if(!oA(f.context._currentValue,f.memoizedValue))return!0;f=f.next}return!1}function xh(f){Dh=f,Lu=null,f=f.dependencies,f!==null&&(f.firstContext=null)}function Uo(f){return UZ(Dh,f)}function tD(f,E){return Dh===null&&xh(f),UZ(f,E)}function UZ(f,E){var w=E._currentValue;if(E={context:E,memoizedValue:w,next:null},Lu===null){if(f===null)throw Error(a(308));Lu=E,f.dependencies={lanes:0,firstContext:E},f.flags|=524288}else Lu=Lu.next=E;return w}var lGe=typeof AbortController<"u"?AbortController:function(){var f=[],E=this.signal={aborted:!1,addEventListener:function(w,M){f.push(M)}};this.abort=function(){E.aborted=!0,f.forEach(function(w){return w()})}},dGe=t.unstable_scheduleCallback,uGe=t.unstable_NormalPriority,Li={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function UL(){return{controller:new lGe,data:new Map,refCount:0}}function Ay(f){f.refCount--,f.refCount===0&&dGe(uGe,function(){f.controller.abort()})}var sy=null,PL=0,pC=0,mC=null;function gGe(f,E){if(sy===null){var w=sy=[];PL=0,pC=YT(),mC={status:"pending",value:void 0,then:function(M){w.push(M)}}}return PL++,E.then(PZ,PZ),E}function PZ(){if(--PL===0&&sy!==null){mC!==null&&(mC.status="fulfilled");var f=sy;sy=null,pC=0,mC=null;for(var E=0;E<f.length;E++)(0,f[E])()}}function pGe(f,E){var w=[],M={status:"pending",value:null,reason:null,then:function(j){w.push(j)}};return f.then(function(){M.status="fulfilled",M.value=E;for(var j=0;j<w.length;j++)(0,w[j])(E)},function(j){for(M.status="rejected",M.reason=j,j=0;j<w.length;j++)(0,w[j])(void 0)}),M}var KZ=F.S;F.S=function(f,E){wX=Ge(),typeof E=="object"&&E!==null&&typeof E.then=="function"&&gGe(f,E),KZ!==null&&KZ(f,E)};var Sh=P(null);function KL(){var f=Sh.current;return f!==null?f:xr.pooledCache}function nD(f,E){E===null?Z(Sh,Sh.current):Z(Sh,E.pool)}function HZ(){var f=KL();return f===null?null:{parent:Li._currentValue,pool:f}}var hC=Error(a(460)),HL=Error(a(474)),aD=Error(a(542)),rD={then:function(){}};function YZ(f){return f=f.status,f==="fulfilled"||f==="rejected"}function qZ(f,E,w){switch(w=f[w],w===void 0?f.push(E):w!==E&&(E.then(Xt,Xt),E=w),E.status){case"fulfilled":return E.value;case"rejected":throw f=E.reason,zZ(f),f;default:if(typeof E.status=="string")E.then(Xt,Xt);else{if(f=xr,f!==null&&100<f.shellSuspendCounter)throw Error(a(482));f=E,f.status="pending",f.then(function(M){if(E.status==="pending"){var j=E;j.status="fulfilled",j.value=M}},function(M){if(E.status==="pending"){var j=E;j.status="rejected",j.reason=M}})}switch(E.status){case"fulfilled":return E.value;case"rejected":throw f=E.reason,zZ(f),f}throw Rh=E,hC}}function _h(f){try{var E=f._init;return E(f._payload)}catch(w){throw w!==null&&typeof w=="object"&&typeof w.then=="function"?(Rh=w,hC):w}}var Rh=null;function jZ(){if(Rh===null)throw Error(a(459));var f=Rh;return Rh=null,f}function zZ(f){if(f===hC||f===aD)throw Error(a(483))}var fC=null,cy=0;function iD(f){var E=cy;return cy+=1,fC===null&&(fC=[]),qZ(fC,f,E)}function ly(f,E){E=E.props.ref,f.ref=E!==void 0?E:null}function oD(f,E){throw E.$$typeof===g?Error(a(525)):(f=Object.prototype.toString.call(E),Error(a(31,f==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":f)))}function JZ(f){function E(mt,st){if(f){var yt=mt.deletions;yt===null?(mt.deletions=[st],mt.flags|=16):yt.push(st)}}function w(mt,st){if(!f)return null;for(;st!==null;)E(mt,st),st=st.sibling;return null}function M(mt){for(var st=new Map;mt!==null;)mt.key!==null?st.set(mt.key,mt):st.set(mt.index,mt),mt=mt.sibling;return st}function j(mt,st){return mt=El(mt,st),mt.index=0,mt.sibling=null,mt}function W(mt,st,yt){return mt.index=yt,f?(yt=mt.alternate,yt!==null?(yt=yt.index,yt<st?(mt.flags|=67108866,st):yt):(mt.flags|=67108866,st)):(mt.flags|=1048576,st)}function ge(mt){return f&&mt.alternate===null&&(mt.flags|=67108866),mt}function xe(mt,st,yt,Ht){return st===null||st.tag!==6?(st=ry(yt,mt.mode,Ht),st.return=mt,st):(st=j(st,yt),st.return=mt,st)}function Ve(mt,st,yt,Ht){var Kn=yt.type;return Kn===h?Ot(mt,st,yt.props.children,Ht,yt.key):st!==null&&(st.elementType===Kn||typeof Kn=="object"&&Kn!==null&&Kn.$$typeof===x&&_h(Kn)===st.type)?(st=j(st,yt.props),ly(st,yt),st.return=mt,st):(st=lC(yt.type,yt.key,yt.props,null,mt.mode,Ht),ly(st,yt),st.return=mt,st)}function wt(mt,st,yt,Ht){return st===null||st.tag!==4||st.stateNode.containerInfo!==yt.containerInfo||st.stateNode.implementation!==yt.implementation?(st=iy(yt,mt.mode,Ht),st.return=mt,st):(st=j(st,yt.children||[]),st.return=mt,st)}function Ot(mt,st,yt,Ht,Kn){return st===null||st.tag!==7?(st=Fu(yt,mt.mode,Ht,Kn),st.return=mt,st):(st=j(st,yt),st.return=mt,st)}function jt(mt,st,yt){if(typeof st=="string"&&st!==""||typeof st=="number"||typeof st=="bigint")return st=ry(""+st,mt.mode,yt),st.return=mt,st;if(typeof st=="object"&&st!==null){switch(st.$$typeof){case p:return yt=lC(st.type,st.key,st.props,null,mt.mode,yt),ly(yt,st),yt.return=mt,yt;case m:return st=iy(st,mt.mode,yt),st.return=mt,st;case x:return st=_h(st),jt(mt,st,yt)}if(O(st)||U(st))return st=Fu(st,mt.mode,yt,null),st.return=mt,st;if(typeof st.then=="function")return jt(mt,iD(st),yt);if(st.$$typeof===y)return jt(mt,tD(mt,st),yt);oD(mt,st)}return null}function St(mt,st,yt,Ht){var Kn=st!==null?st.key:null;if(typeof yt=="string"&&yt!==""||typeof yt=="number"||typeof yt=="bigint")return Kn!==null?null:xe(mt,st,""+yt,Ht);if(typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case p:return yt.key===Kn?Ve(mt,st,yt,Ht):null;case m:return yt.key===Kn?wt(mt,st,yt,Ht):null;case x:return yt=_h(yt),St(mt,st,yt,Ht)}if(O(yt)||U(yt))return Kn!==null?null:Ot(mt,st,yt,Ht,null);if(typeof yt.then=="function")return St(mt,st,iD(yt),Ht);if(yt.$$typeof===y)return St(mt,st,tD(mt,yt),Ht);oD(mt,yt)}return null}function Nt(mt,st,yt,Ht,Kn){if(typeof Ht=="string"&&Ht!==""||typeof Ht=="number"||typeof Ht=="bigint")return mt=mt.get(yt)||null,xe(st,mt,""+Ht,Kn);if(typeof Ht=="object"&&Ht!==null){switch(Ht.$$typeof){case p:return mt=mt.get(Ht.key===null?yt:Ht.key)||null,Ve(st,mt,Ht,Kn);case m:return mt=mt.get(Ht.key===null?yt:Ht.key)||null,wt(st,mt,Ht,Kn);case x:return Ht=_h(Ht),Nt(mt,st,yt,Ht,Kn)}if(O(Ht)||U(Ht))return mt=mt.get(yt)||null,Ot(st,mt,Ht,Kn,null);if(typeof Ht.then=="function")return Nt(mt,st,yt,iD(Ht),Kn);if(Ht.$$typeof===y)return Nt(mt,st,yt,tD(st,Ht),Kn);oD(st,Ht)}return null}function Dn(mt,st,yt,Ht){for(var Kn=null,Ja=null,Mn=st,ya=st=0,Fa=null;Mn!==null&&ya<yt.length;ya++){Mn.index>ya?(Fa=Mn,Mn=null):Fa=Mn.sibling;var Wa=St(mt,Mn,yt[ya],Ht);if(Wa===null){Mn===null&&(Mn=Fa);break}f&&Mn&&Wa.alternate===null&&E(mt,Mn),st=W(Wa,st,ya),Ja===null?Kn=Wa:Ja.sibling=Wa,Ja=Wa,Mn=Fa}if(ya===yt.length)return w(mt,Mn),Ca&&xt(mt,ya),Kn;if(Mn===null){for(;ya<yt.length;ya++)Mn=jt(mt,yt[ya],Ht),Mn!==null&&(st=W(Mn,st,ya),Ja===null?Kn=Mn:Ja.sibling=Mn,Ja=Mn);return Ca&&xt(mt,ya),Kn}for(Mn=M(Mn);ya<yt.length;ya++)Fa=Nt(Mn,mt,ya,yt[ya],Ht),Fa!==null&&(f&&Fa.alternate!==null&&Mn.delete(Fa.key===null?ya:Fa.key),st=W(Fa,st,ya),Ja===null?Kn=Fa:Ja.sibling=Fa,Ja=Fa);return f&&Mn.forEach(function(Np){return E(mt,Np)}),Ca&&xt(mt,ya),Kn}function Xn(mt,st,yt,Ht){if(yt==null)throw Error(a(151));for(var Kn=null,Ja=null,Mn=st,ya=st=0,Fa=null,Wa=yt.next();Mn!==null&&!Wa.done;ya++,Wa=yt.next()){Mn.index>ya?(Fa=Mn,Mn=null):Fa=Mn.sibling;var Np=St(mt,Mn,Wa.value,Ht);if(Np===null){Mn===null&&(Mn=Fa);break}f&&Mn&&Np.alternate===null&&E(mt,Mn),st=W(Np,st,ya),Ja===null?Kn=Np:Ja.sibling=Np,Ja=Np,Mn=Fa}if(Wa.done)return w(mt,Mn),Ca&&xt(mt,ya),Kn;if(Mn===null){for(;!Wa.done;ya++,Wa=yt.next())Wa=jt(mt,Wa.value,Ht),Wa!==null&&(st=W(Wa,st,ya),Ja===null?Kn=Wa:Ja.sibling=Wa,Ja=Wa);return Ca&&xt(mt,ya),Kn}for(Mn=M(Mn);!Wa.done;ya++,Wa=yt.next())Wa=Nt(Mn,mt,ya,Wa.value,Ht),Wa!==null&&(f&&Wa.alternate!==null&&Mn.delete(Wa.key===null?ya:Wa.key),st=W(Wa,st,ya),Ja===null?Kn=Wa:Ja.sibling=Wa,Ja=Wa);return f&&Mn.forEach(function(w4e){return E(mt,w4e)}),Ca&&xt(mt,ya),Kn}function yr(mt,st,yt,Ht){if(typeof yt=="object"&&yt!==null&&yt.type===h&&yt.key===null&&(yt=yt.props.children),typeof yt=="object"&&yt!==null){switch(yt.$$typeof){case p:e:{for(var Kn=yt.key;st!==null;){if(st.key===Kn){if(Kn=yt.type,Kn===h){if(st.tag===7){w(mt,st.sibling),Ht=j(st,yt.props.children),Ht.return=mt,mt=Ht;break e}}else if(st.elementType===Kn||typeof Kn=="object"&&Kn!==null&&Kn.$$typeof===x&&_h(Kn)===st.type){w(mt,st.sibling),Ht=j(st,yt.props),ly(Ht,yt),Ht.return=mt,mt=Ht;break e}w(mt,st);break}else E(mt,st);st=st.sibling}yt.type===h?(Ht=Fu(yt.props.children,mt.mode,Ht,yt.key),Ht.return=mt,mt=Ht):(Ht=lC(yt.type,yt.key,yt.props,null,mt.mode,Ht),ly(Ht,yt),Ht.return=mt,mt=Ht)}return ge(mt);case m:e:{for(Kn=yt.key;st!==null;){if(st.key===Kn)if(st.tag===4&&st.stateNode.containerInfo===yt.containerInfo&&st.stateNode.implementation===yt.implementation){w(mt,st.sibling),Ht=j(st,yt.children||[]),Ht.return=mt,mt=Ht;break e}else{w(mt,st);break}else E(mt,st);st=st.sibling}Ht=iy(yt,mt.mode,Ht),Ht.return=mt,mt=Ht}return ge(mt);case x:return yt=_h(yt),yr(mt,st,yt,Ht)}if(O(yt))return Dn(mt,st,yt,Ht);if(U(yt)){if(Kn=U(yt),typeof Kn!="function")throw Error(a(150));return yt=Kn.call(yt),Xn(mt,st,yt,Ht)}if(typeof yt.then=="function")return yr(mt,st,iD(yt),Ht);if(yt.$$typeof===y)return yr(mt,st,tD(mt,yt),Ht);oD(mt,yt)}return typeof yt=="string"&&yt!==""||typeof yt=="number"||typeof yt=="bigint"?(yt=""+yt,st!==null&&st.tag===6?(w(mt,st.sibling),Ht=j(st,yt),Ht.return=mt,mt=Ht):(w(mt,st),Ht=ry(yt,mt.mode,Ht),Ht.return=mt,mt=Ht),ge(mt)):w(mt,st)}return function(mt,st,yt,Ht){try{cy=0;var Kn=yr(mt,st,yt,Ht);return fC=null,Kn}catch(Mn){if(Mn===hC||Mn===aD)throw Mn;var Ja=xA(29,Mn,null,mt.mode);return Ja.lanes=Ht,Ja.return=mt,Ja}finally{}}}var Nh=JZ(!0),WZ=JZ(!1),hp=!1;function YL(f){f.updateQueue={baseState:f.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qL(f,E){f=f.updateQueue,E.updateQueue===f&&(E.updateQueue={baseState:f.baseState,firstBaseUpdate:f.firstBaseUpdate,lastBaseUpdate:f.lastBaseUpdate,shared:f.shared,callbacks:null})}function fp(f){return{lane:f,tag:0,payload:null,callback:null,next:null}}function bp(f,E,w){var M=f.updateQueue;if(M===null)return null;if(M=M.shared,(nr&2)!==0){var j=M.pending;return j===null?E.next=E:(E.next=j.next,j.next=E),M.pending=E,E=ss(f),ny(f,null,w),E}return dp(f,M,E,w),ss(f)}function dy(f,E,w){if(E=E.updateQueue,E!==null&&(E=E.shared,(w&4194048)!==0)){var M=E.lanes;M&=f.pendingLanes,w|=M,E.lanes=w,At(f,w)}}function jL(f,E){var w=f.updateQueue,M=f.alternate;if(M!==null&&(M=M.updateQueue,w===M)){var j=null,W=null;if(w=w.firstBaseUpdate,w!==null){do{var ge={lane:w.lane,tag:w.tag,payload:w.payload,callback:null,next:null};W===null?j=W=ge:W=W.next=ge,w=w.next}while(w!==null);W===null?j=W=E:W=W.next=E}else j=W=E;w={baseState:M.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:M.shared,callbacks:M.callbacks},f.updateQueue=w;return}f=w.lastBaseUpdate,f===null?w.firstBaseUpdate=E:f.next=E,w.lastBaseUpdate=E}var zL=!1;function uy(){if(zL){var f=mC;if(f!==null)throw f}}function gy(f,E,w,M){zL=!1;var j=f.updateQueue;hp=!1;var W=j.firstBaseUpdate,ge=j.lastBaseUpdate,xe=j.shared.pending;if(xe!==null){j.shared.pending=null;var Ve=xe,wt=Ve.next;Ve.next=null,ge===null?W=wt:ge.next=wt,ge=Ve;var Ot=f.alternate;Ot!==null&&(Ot=Ot.updateQueue,xe=Ot.lastBaseUpdate,xe!==ge&&(xe===null?Ot.firstBaseUpdate=wt:xe.next=wt,Ot.lastBaseUpdate=Ve))}if(W!==null){var jt=j.baseState;ge=0,Ot=wt=Ve=null,xe=W;do{var St=xe.lane&-536870913,Nt=St!==xe.lane;if(Nt?(Ma&St)===St:(M&St)===St){St!==0&&St===pC&&(zL=!0),Ot!==null&&(Ot=Ot.next={lane:0,tag:xe.tag,payload:xe.payload,callback:null,next:null});e:{var Dn=f,Xn=xe;St=E;var yr=w;switch(Xn.tag){case 1:if(Dn=Xn.payload,typeof Dn=="function"){jt=Dn.call(yr,jt,St);break e}jt=Dn;break e;case 3:Dn.flags=Dn.flags&-65537|128;case 0:if(Dn=Xn.payload,St=typeof Dn=="function"?Dn.call(yr,jt,St):Dn,St==null)break e;jt=u({},jt,St);break e;case 2:hp=!0}}St=xe.callback,St!==null&&(f.flags|=64,Nt&&(f.flags|=8192),Nt=j.callbacks,Nt===null?j.callbacks=[St]:Nt.push(St))}else Nt={lane:St,tag:xe.tag,payload:xe.payload,callback:xe.callback,next:null},Ot===null?(wt=Ot=Nt,Ve=jt):Ot=Ot.next=Nt,ge|=St;if(xe=xe.next,xe===null){if(xe=j.shared.pending,xe===null)break;Nt=xe,xe=Nt.next,Nt.next=null,j.lastBaseUpdate=Nt,j.shared.pending=null}}while(!0);Ot===null&&(Ve=jt),j.baseState=Ve,j.firstBaseUpdate=wt,j.lastBaseUpdate=Ot,W===null&&(j.shared.lanes=0),yp|=ge,f.lanes=ge,f.memoizedState=jt}}function ZZ(f,E){if(typeof f!="function")throw Error(a(191,f));f.call(E)}function VZ(f,E){var w=f.callbacks;if(w!==null)for(f.callbacks=null,f=0;f<w.length;f++)ZZ(w[f],E)}var bC=P(null),AD=P(0);function XZ(f,E){f=ju,Z(AD,f),Z(bC,E),ju=f|E.baseLanes}function JL(){Z(AD,ju),Z(bC,bC.current)}function WL(){ju=AD.current,z(bC),z(AD)}var Ys=P(null),Rc=null;function Cp(f){var E=f.alternate;Z(yi,yi.current&1),Z(Ys,f),Rc===null&&(E===null||bC.current!==null||E.memoizedState!==null)&&(Rc=f)}function ZL(f){Z(yi,yi.current),Z(Ys,f),Rc===null&&(Rc=f)}function $Z(f){f.tag===22?(Z(yi,yi.current),Z(Ys,f),Rc===null&&(Rc=f)):Ep()}function Ep(){Z(yi,yi.current),Z(Ys,Ys.current)}function qs(f){z(Ys),Rc===f&&(Rc=null),z(yi)}var yi=P(0);function sD(f){for(var E=f;E!==null;){if(E.tag===13){var w=E.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||n3(w)||a3(w)))return E}else if(E.tag===19&&(E.memoizedProps.revealOrder==="forwards"||E.memoizedProps.revealOrder==="backwards"||E.memoizedProps.revealOrder==="unstable_legacy-backwards"||E.memoizedProps.revealOrder==="together")){if((E.flags&128)!==0)return E}else if(E.child!==null){E.child.return=E,E=E.child;continue}if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return null;E=E.return}E.sibling.return=E.return,E=E.sibling}return null}var Gu=0,Ba=null,Ir=null,Ti=null,cD=!1,CC=!1,Mh=!1,lD=0,py=0,EC=null,mGe=0;function pi(){throw Error(a(321))}function VL(f,E){if(E===null)return!1;for(var w=0;w<E.length&&w<f.length;w++)if(!oA(f[w],E[w]))return!1;return!0}function XL(f,E,w,M,j,W){return Gu=W,Ba=E,E.memoizedState=null,E.updateQueue=null,E.lanes=0,F.H=f===null||f.memoizedState===null?LV:gT,Mh=!1,W=w(M,j),Mh=!1,CC&&(W=tV(E,w,M,j)),eV(f),W}function eV(f){F.H=fy;var E=Ir!==null&&Ir.next!==null;if(Gu=0,Ti=Ir=Ba=null,cD=!1,py=0,EC=null,E)throw Error(a(300));f===null||Gi||(f=f.dependencies,f!==null&&eD(f)&&(Gi=!0))}function tV(f,E,w,M){Ba=f;var j=0;do{if(CC&&(EC=null),py=0,CC=!1,25<=j)throw Error(a(301));if(j+=1,Ti=Ir=null,f.updateQueue!=null){var W=f.updateQueue;W.lastEffect=null,W.events=null,W.stores=null,W.memoCache!=null&&(W.memoCache.index=0)}F.H=TV,W=E(w,M)}while(CC);return W}function hGe(){var f=F.H,E=f.useState()[0];return E=typeof E.then=="function"?my(E):E,f=f.useState()[0],(Ir!==null?Ir.memoizedState:null)!==f&&(Ba.flags|=1024),E}function $L(){var f=lD!==0;return lD=0,f}function eT(f,E,w){E.updateQueue=f.updateQueue,E.flags&=-2053,f.lanes&=~w}function tT(f){if(cD){for(f=f.memoizedState;f!==null;){var E=f.queue;E!==null&&(E.pending=null),f=f.next}cD=!1}Gu=0,Ti=Ir=Ba=null,CC=!1,py=lD=0,EC=null}function SA(){var f={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ti===null?Ba.memoizedState=Ti=f:Ti=Ti.next=f,Ti}function Qi(){if(Ir===null){var f=Ba.alternate;f=f!==null?f.memoizedState:null}else f=Ir.next;var E=Ti===null?Ba.memoizedState:Ti.next;if(E!==null)Ti=E,Ir=f;else{if(f===null)throw Ba.alternate===null?Error(a(467)):Error(a(310));Ir=f,f={memoizedState:Ir.memoizedState,baseState:Ir.baseState,baseQueue:Ir.baseQueue,queue:Ir.queue,next:null},Ti===null?Ba.memoizedState=Ti=f:Ti=Ti.next=f}return Ti}function dD(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function my(f){var E=py;return py+=1,EC===null&&(EC=[]),f=qZ(EC,f,E),E=Ba,(Ti===null?E.memoizedState:Ti.next)===null&&(E=E.alternate,F.H=E===null||E.memoizedState===null?LV:gT),f}function uD(f){if(f!==null&&typeof f=="object"){if(typeof f.then=="function")return my(f);if(f.$$typeof===y)return Uo(f)}throw Error(a(438,String(f)))}function nT(f){var E=null,w=Ba.updateQueue;if(w!==null&&(E=w.memoCache),E==null){var M=Ba.alternate;M!==null&&(M=M.updateQueue,M!==null&&(M=M.memoCache,M!=null&&(E={data:M.data.map(function(j){return j.slice()}),index:0})))}if(E==null&&(E={data:[],index:0}),w===null&&(w=dD(),Ba.updateQueue=w),w.memoCache=E,w=E.data[E.index],w===void 0)for(w=E.data[E.index]=Array(f),M=0;M<f;M++)w[M]=L;return E.index++,w}function Ou(f,E){return typeof E=="function"?E(f):E}function gD(f){var E=Qi();return aT(E,Ir,f)}function aT(f,E,w){var M=f.queue;if(M===null)throw Error(a(311));M.lastRenderedReducer=w;var j=f.baseQueue,W=M.pending;if(W!==null){if(j!==null){var ge=j.next;j.next=W.next,W.next=ge}E.baseQueue=j=W,M.pending=null}if(W=f.baseState,j===null)f.memoizedState=W;else{E=j.next;var xe=ge=null,Ve=null,wt=E,Ot=!1;do{var jt=wt.lane&-536870913;if(jt!==wt.lane?(Ma&jt)===jt:(Gu&jt)===jt){var St=wt.revertLane;if(St===0)Ve!==null&&(Ve=Ve.next={lane:0,revertLane:0,gesture:null,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null}),jt===pC&&(Ot=!0);else if((Gu&St)===St){wt=wt.next,St===pC&&(Ot=!0);continue}else jt={lane:0,revertLane:wt.revertLane,gesture:null,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null},Ve===null?(xe=Ve=jt,ge=W):Ve=Ve.next=jt,Ba.lanes|=St,yp|=St;jt=wt.action,Mh&&w(W,jt),W=wt.hasEagerState?wt.eagerState:w(W,jt)}else St={lane:jt,revertLane:wt.revertLane,gesture:wt.gesture,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null},Ve===null?(xe=Ve=St,ge=W):Ve=Ve.next=St,Ba.lanes|=jt,yp|=jt;wt=wt.next}while(wt!==null&&wt!==E);if(Ve===null?ge=W:Ve.next=xe,!oA(W,f.memoizedState)&&(Gi=!0,Ot&&(w=mC,w!==null)))throw w;f.memoizedState=W,f.baseState=ge,f.baseQueue=Ve,M.lastRenderedState=W}return j===null&&(M.lanes=0),[f.memoizedState,M.dispatch]}function rT(f){var E=Qi(),w=E.queue;if(w===null)throw Error(a(311));w.lastRenderedReducer=f;var M=w.dispatch,j=w.pending,W=E.memoizedState;if(j!==null){w.pending=null;var ge=j=j.next;do W=f(W,ge.action),ge=ge.next;while(ge!==j);oA(W,E.memoizedState)||(Gi=!0),E.memoizedState=W,E.baseQueue===null&&(E.baseState=W),w.lastRenderedState=W}return[W,M]}function nV(f,E,w){var M=Ba,j=Qi(),W=Ca;if(W){if(w===void 0)throw Error(a(407));w=w()}else w=E();var ge=!oA((Ir||j).memoizedState,w);if(ge&&(j.memoizedState=w,Gi=!0),j=j.queue,AT(iV.bind(null,M,j,f),[f]),j.getSnapshot!==E||ge||Ti!==null&&Ti.memoizedState.tag&1){if(M.flags|=2048,IC(9,{destroy:void 0},rV.bind(null,M,j,w,E),null),xr===null)throw Error(a(349));W||(Gu&127)!==0||aV(M,E,w)}return w}function aV(f,E,w){f.flags|=16384,f={getSnapshot:E,value:w},E=Ba.updateQueue,E===null?(E=dD(),Ba.updateQueue=E,E.stores=[f]):(w=E.stores,w===null?E.stores=[f]:w.push(f))}function rV(f,E,w,M){E.value=w,E.getSnapshot=M,oV(E)&&AV(f)}function iV(f,E,w){return w(function(){oV(E)&&AV(f)})}function oV(f){var E=f.getSnapshot;f=f.value;try{var w=E();return!oA(f,w)}catch{return!0}}function AV(f){var E=Cd(f,2);E!==null&&ps(E,f,2)}function iT(f){var E=SA();if(typeof f=="function"){var w=f;if(f=w(),Mh){Be(!0);try{w()}finally{Be(!1)}}}return E.memoizedState=E.baseState=f,E.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:f},E}function sV(f,E,w,M){return f.baseState=w,aT(f,Ir,typeof M=="function"?M:Ou)}function fGe(f,E,w,M,j){if(hD(f))throw Error(a(485));if(f=E.action,f!==null){var W={payload:j,action:f,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(ge){W.listeners.push(ge)}};F.T!==null?w(!0):W.isTransition=!1,M(W),w=E.pending,w===null?(W.next=E.pending=W,cV(E,W)):(W.next=w.next,E.pending=w.next=W)}}function cV(f,E){var w=E.action,M=E.payload,j=f.state;if(E.isTransition){var W=F.T,ge={};F.T=ge;try{var xe=w(j,M),Ve=F.S;Ve!==null&&Ve(ge,xe),lV(f,E,xe)}catch(wt){oT(f,E,wt)}finally{W!==null&&ge.types!==null&&(W.types=ge.types),F.T=W}}else try{W=w(j,M),lV(f,E,W)}catch(wt){oT(f,E,wt)}}function lV(f,E,w){w!==null&&typeof w=="object"&&typeof w.then=="function"?w.then(function(M){dV(f,E,M)},function(M){return oT(f,E,M)}):dV(f,E,w)}function dV(f,E,w){E.status="fulfilled",E.value=w,uV(E),f.state=w,E=f.pending,E!==null&&(w=E.next,w===E?f.pending=null:(w=w.next,E.next=w,cV(f,w)))}function oT(f,E,w){var M=f.pending;if(f.pending=null,M!==null){M=M.next;do E.status="rejected",E.reason=w,uV(E),E=E.next;while(E!==M)}f.action=null}function uV(f){f=f.listeners;for(var E=0;E<f.length;E++)(0,f[E])()}function gV(f,E){return E}function pV(f,E){if(Ca){var w=xr.formState;if(w!==null){e:{var M=Ba;if(Ca){if(Jn){t:{for(var j=Jn,W=_c;j.nodeType!==8;){if(!W){j=null;break t}if(j=Nc(j.nextSibling),j===null){j=null;break t}}W=j.data,j=W==="F!"||W==="F"?j:null}if(j){Jn=Nc(j.nextSibling),M=j.data==="F!";break e}}pp(M)}M=!1}M&&(E=w[0])}}return w=SA(),w.memoizedState=w.baseState=E,M={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gV,lastRenderedState:E},w.queue=M,w=NV.bind(null,Ba,M),M.dispatch=w,M=iT(!1),W=uT.bind(null,Ba,!1,M.queue),M=SA(),j={state:E,dispatch:null,action:f,pending:null},M.queue=j,w=fGe.bind(null,Ba,j,W,w),j.dispatch=w,M.memoizedState=f,[E,w,!1]}function mV(f){var E=Qi();return hV(E,Ir,f)}function hV(f,E,w){if(E=aT(f,E,gV)[0],f=gD(Ou)[0],typeof E=="object"&&E!==null&&typeof E.then=="function")try{var M=my(E)}catch(ge){throw ge===hC?aD:ge}else M=E;E=Qi();var j=E.queue,W=j.dispatch;return w!==E.memoizedState&&(Ba.flags|=2048,IC(9,{destroy:void 0},bGe.bind(null,j,w),null)),[M,W,f]}function bGe(f,E){f.action=E}function fV(f){var E=Qi(),w=Ir;if(w!==null)return hV(E,w,f);Qi(),E=E.memoizedState,w=Qi();var M=w.queue.dispatch;return w.memoizedState=f,[E,M,!1]}function IC(f,E,w,M){return f={tag:f,create:w,deps:M,inst:E,next:null},E=Ba.updateQueue,E===null&&(E=dD(),Ba.updateQueue=E),w=E.lastEffect,w===null?E.lastEffect=f.next=f:(M=w.next,w.next=f,f.next=M,E.lastEffect=f),f}function bV(){return Qi().memoizedState}function pD(f,E,w,M){var j=SA();Ba.flags|=f,j.memoizedState=IC(1|E,{destroy:void 0},w,M===void 0?null:M)}function mD(f,E,w,M){var j=Qi();M=M===void 0?null:M;var W=j.memoizedState.inst;Ir!==null&&M!==null&&VL(M,Ir.memoizedState.deps)?j.memoizedState=IC(E,W,w,M):(Ba.flags|=f,j.memoizedState=IC(1|E,W,w,M))}function CV(f,E){pD(8390656,8,f,E)}function AT(f,E){mD(2048,8,f,E)}function CGe(f){Ba.flags|=4;var E=Ba.updateQueue;if(E===null)E=dD(),Ba.updateQueue=E,E.events=[f];else{var w=E.events;w===null?E.events=[f]:w.push(f)}}function EV(f){var E=Qi().memoizedState;return CGe({ref:E,nextImpl:f}),function(){if((nr&2)!==0)throw Error(a(440));return E.impl.apply(void 0,arguments)}}function IV(f,E){return mD(4,2,f,E)}function BV(f,E){return mD(4,4,f,E)}function yV(f,E){if(typeof E=="function"){f=f();var w=E(f);return function(){typeof w=="function"?w():E(null)}}if(E!=null)return f=f(),E.current=f,function(){E.current=null}}function QV(f,E,w){w=w!=null?w.concat([f]):null,mD(4,4,yV.bind(null,E,f),w)}function sT(){}function wV(f,E){var w=Qi();E=E===void 0?null:E;var M=w.memoizedState;return E!==null&&VL(E,M[1])?M[0]:(w.memoizedState=[f,E],f)}function kV(f,E){var w=Qi();E=E===void 0?null:E;var M=w.memoizedState;if(E!==null&&VL(E,M[1]))return M[0];if(M=f(),Mh){Be(!0);try{f()}finally{Be(!1)}}return w.memoizedState=[M,E],M}function cT(f,E,w){return w===void 0||(Gu&1073741824)!==0&&(Ma&261930)===0?f.memoizedState=E:(f.memoizedState=w,f=vX(),Ba.lanes|=f,yp|=f,w)}function vV(f,E,w,M){return oA(w,E)?w:bC.current!==null?(f=cT(f,w,M),oA(f,E)||(Gi=!0),f):(Gu&42)===0||(Gu&1073741824)!==0&&(Ma&261930)===0?(Gi=!0,f.memoizedState=w):(f=vX(),Ba.lanes|=f,yp|=f,E)}function DV(f,E,w,M,j){var W=T.p;T.p=W!==0&&8>W?W:8;var ge=F.T,xe={};F.T=xe,uT(f,!1,E,w);try{var Ve=j(),wt=F.S;if(wt!==null&&wt(xe,Ve),Ve!==null&&typeof Ve=="object"&&typeof Ve.then=="function"){var Ot=pGe(Ve,M);hy(f,E,Ot,Js(f))}else hy(f,E,M,Js(f))}catch(jt){hy(f,E,{then:function(){},status:"rejected",reason:jt},Js())}finally{T.p=W,ge!==null&&xe.types!==null&&(ge.types=xe.types),F.T=ge}}function EGe(){}function lT(f,E,w,M){if(f.tag!==5)throw Error(a(476));var j=xV(f).queue;DV(f,j,E,G,w===null?EGe:function(){return SV(f),w(M)})}function xV(f){var E=f.memoizedState;if(E!==null)return E;E={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:G},next:null};var w={};return E.next={memoizedState:w,baseState:w,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ou,lastRenderedState:w},next:null},f.memoizedState=E,f=f.alternate,f!==null&&(f.memoizedState=E),E}function SV(f){var E=xV(f);E.next===null&&(E=f.alternate.memoizedState),hy(f,E.next.queue,{},Js())}function dT(){return Uo(Ny)}function _V(){return Qi().memoizedState}function RV(){return Qi().memoizedState}function IGe(f){for(var E=f.return;E!==null;){switch(E.tag){case 24:case 3:var w=Js();f=fp(w);var M=bp(E,f,w);M!==null&&(ps(M,E,w),dy(M,E,w)),E={cache:UL()},f.payload=E;return}E=E.return}}function BGe(f,E,w){var M=Js();w={lane:M,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null},hD(f)?MV(E,w):(w=Mu(f,E,w,M),w!==null&&(ps(w,f,M),FV(w,E,M)))}function NV(f,E,w){var M=Js();hy(f,E,w,M)}function hy(f,E,w,M){var j={lane:M,revertLane:0,gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null};if(hD(f))MV(E,j);else{var W=f.alternate;if(f.lanes===0&&(W===null||W.lanes===0)&&(W=E.lastRenderedReducer,W!==null))try{var ge=E.lastRenderedState,xe=W(ge,w);if(j.hasEagerState=!0,j.eagerState=xe,oA(xe,ge))return dp(f,E,j,0),xr===null&&cC(),!1}catch{}finally{}if(w=Mu(f,E,j,M),w!==null)return ps(w,f,M),FV(w,E,M),!0}return!1}function uT(f,E,w,M){if(M={lane:2,revertLane:YT(),gesture:null,action:M,hasEagerState:!1,eagerState:null,next:null},hD(f)){if(E)throw Error(a(479))}else E=Mu(f,w,M,2),E!==null&&ps(E,f,2)}function hD(f){var E=f.alternate;return f===Ba||E!==null&&E===Ba}function MV(f,E){CC=cD=!0;var w=f.pending;w===null?E.next=E:(E.next=w.next,w.next=E),f.pending=E}function FV(f,E,w){if((w&4194048)!==0){var M=E.lanes;M&=f.pendingLanes,w|=M,E.lanes=w,At(f,w)}}var fy={readContext:Uo,use:uD,useCallback:pi,useContext:pi,useEffect:pi,useImperativeHandle:pi,useLayoutEffect:pi,useInsertionEffect:pi,useMemo:pi,useReducer:pi,useRef:pi,useState:pi,useDebugValue:pi,useDeferredValue:pi,useTransition:pi,useSyncExternalStore:pi,useId:pi,useHostTransitionStatus:pi,useFormState:pi,useActionState:pi,useOptimistic:pi,useMemoCache:pi,useCacheRefresh:pi};fy.useEffectEvent=pi;var LV={readContext:Uo,use:uD,useCallback:function(f,E){return SA().memoizedState=[f,E===void 0?null:E],f},useContext:Uo,useEffect:CV,useImperativeHandle:function(f,E,w){w=w!=null?w.concat([f]):null,pD(4194308,4,yV.bind(null,E,f),w)},useLayoutEffect:function(f,E){return pD(4194308,4,f,E)},useInsertionEffect:function(f,E){pD(4,2,f,E)},useMemo:function(f,E){var w=SA();E=E===void 0?null:E;var M=f();if(Mh){Be(!0);try{f()}finally{Be(!1)}}return w.memoizedState=[M,E],M},useReducer:function(f,E,w){var M=SA();if(w!==void 0){var j=w(E);if(Mh){Be(!0);try{w(E)}finally{Be(!1)}}}else j=E;return M.memoizedState=M.baseState=j,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:j},M.queue=f,f=f.dispatch=BGe.bind(null,Ba,f),[M.memoizedState,f]},useRef:function(f){var E=SA();return f={current:f},E.memoizedState=f},useState:function(f){f=iT(f);var E=f.queue,w=NV.bind(null,Ba,E);return E.dispatch=w,[f.memoizedState,w]},useDebugValue:sT,useDeferredValue:function(f,E){var w=SA();return cT(w,f,E)},useTransition:function(){var f=iT(!1);return f=DV.bind(null,Ba,f.queue,!0,!1),SA().memoizedState=f,[!1,f]},useSyncExternalStore:function(f,E,w){var M=Ba,j=SA();if(Ca){if(w===void 0)throw Error(a(407));w=w()}else{if(w=E(),xr===null)throw Error(a(349));(Ma&127)!==0||aV(M,E,w)}j.memoizedState=w;var W={value:w,getSnapshot:E};return j.queue=W,CV(iV.bind(null,M,W,f),[f]),M.flags|=2048,IC(9,{destroy:void 0},rV.bind(null,M,W,w,E),null),w},useId:function(){var f=SA(),E=xr.identifierPrefix;if(Ca){var w=Te,M=Sc;w=(M&~(1<<32-Ne(M)-1)).toString(32)+w,E="_"+E+"R_"+w,w=lD++,0<w&&(E+="H"+w.toString(32)),E+="_"}else w=mGe++,E="_"+E+"r_"+w.toString(32)+"_";return f.memoizedState=E},useHostTransitionStatus:dT,useFormState:pV,useActionState:pV,useOptimistic:function(f){var E=SA();E.memoizedState=E.baseState=f;var w={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return E.queue=w,E=uT.bind(null,Ba,!0,w),w.dispatch=E,[f,E]},useMemoCache:nT,useCacheRefresh:function(){return SA().memoizedState=IGe.bind(null,Ba)},useEffectEvent:function(f){var E=SA(),w={impl:f};return E.memoizedState=w,function(){if((nr&2)!==0)throw Error(a(440));return w.impl.apply(void 0,arguments)}}},gT={readContext:Uo,use:uD,useCallback:wV,useContext:Uo,useEffect:AT,useImperativeHandle:QV,useInsertionEffect:IV,useLayoutEffect:BV,useMemo:kV,useReducer:gD,useRef:bV,useState:function(){return gD(Ou)},useDebugValue:sT,useDeferredValue:function(f,E){var w=Qi();return vV(w,Ir.memoizedState,f,E)},useTransition:function(){var f=gD(Ou)[0],E=Qi().memoizedState;return[typeof f=="boolean"?f:my(f),E]},useSyncExternalStore:nV,useId:_V,useHostTransitionStatus:dT,useFormState:mV,useActionState:mV,useOptimistic:function(f,E){var w=Qi();return sV(w,Ir,f,E)},useMemoCache:nT,useCacheRefresh:RV};gT.useEffectEvent=EV;var TV={readContext:Uo,use:uD,useCallback:wV,useContext:Uo,useEffect:AT,useImperativeHandle:QV,useInsertionEffect:IV,useLayoutEffect:BV,useMemo:kV,useReducer:rT,useRef:bV,useState:function(){return rT(Ou)},useDebugValue:sT,useDeferredValue:function(f,E){var w=Qi();return Ir===null?cT(w,f,E):vV(w,Ir.memoizedState,f,E)},useTransition:function(){var f=rT(Ou)[0],E=Qi().memoizedState;return[typeof f=="boolean"?f:my(f),E]},useSyncExternalStore:nV,useId:_V,useHostTransitionStatus:dT,useFormState:fV,useActionState:fV,useOptimistic:function(f,E){var w=Qi();return Ir!==null?sV(w,Ir,f,E):(w.baseState=f,[f,w.queue.dispatch])},useMemoCache:nT,useCacheRefresh:RV};TV.useEffectEvent=EV;function pT(f,E,w,M){E=f.memoizedState,w=w(M,E),w=w==null?E:u({},E,w),f.memoizedState=w,f.lanes===0&&(f.updateQueue.baseState=w)}var mT={enqueueSetState:function(f,E,w){f=f._reactInternals;var M=Js(),j=fp(M);j.payload=E,w!=null&&(j.callback=w),E=bp(f,j,M),E!==null&&(ps(E,f,M),dy(E,f,M))},enqueueReplaceState:function(f,E,w){f=f._reactInternals;var M=Js(),j=fp(M);j.tag=1,j.payload=E,w!=null&&(j.callback=w),E=bp(f,j,M),E!==null&&(ps(E,f,M),dy(E,f,M))},enqueueForceUpdate:function(f,E){f=f._reactInternals;var w=Js(),M=fp(w);M.tag=2,E!=null&&(M.callback=E),E=bp(f,M,w),E!==null&&(ps(E,f,w),dy(E,f,w))}};function GV(f,E,w,M,j,W,ge){return f=f.stateNode,typeof f.shouldComponentUpdate=="function"?f.shouldComponentUpdate(M,W,ge):E.prototype&&E.prototype.isPureReactComponent?!yh(w,M)||!yh(j,W):!0}function OV(f,E,w,M){f=E.state,typeof E.componentWillReceiveProps=="function"&&E.componentWillReceiveProps(w,M),typeof E.UNSAFE_componentWillReceiveProps=="function"&&E.UNSAFE_componentWillReceiveProps(w,M),E.state!==f&&mT.enqueueReplaceState(E,E.state,null)}function Fh(f,E){var w=E;if("ref"in E){w={};for(var M in E)M!=="ref"&&(w[M]=E[M])}if(f=f.defaultProps){w===E&&(w=u({},w));for(var j in f)w[j]===void 0&&(w[j]=f[j])}return w}function UV(f){sC(f)}function PV(f){console.error(f)}function KV(f){sC(f)}function fD(f,E){try{var w=f.onUncaughtError;w(E.value,{componentStack:E.stack})}catch(M){setTimeout(function(){throw M})}}function HV(f,E,w){try{var M=f.onCaughtError;M(w.value,{componentStack:w.stack,errorBoundary:E.tag===1?E.stateNode:null})}catch(j){setTimeout(function(){throw j})}}function hT(f,E,w){return w=fp(w),w.tag=3,w.payload={element:null},w.callback=function(){fD(f,E)},w}function YV(f){return f=fp(f),f.tag=3,f}function qV(f,E,w,M){var j=w.type.getDerivedStateFromError;if(typeof j=="function"){var W=M.value;f.payload=function(){return j(W)},f.callback=function(){HV(E,w,M)}}var ge=w.stateNode;ge!==null&&typeof ge.componentDidCatch=="function"&&(f.callback=function(){HV(E,w,M),typeof j!="function"&&(Qp===null?Qp=new Set([this]):Qp.add(this));var xe=M.stack;this.componentDidCatch(M.value,{componentStack:xe!==null?xe:""})})}function yGe(f,E,w,M,j){if(w.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){if(E=w.alternate,E!==null&&gC(E,w,j,!0),w=Ys.current,w!==null){switch(w.tag){case 31:case 13:return Rc===null?xD():w.alternate===null&&mi===0&&(mi=3),w.flags&=-257,w.flags|=65536,w.lanes=j,M===rD?w.flags|=16384:(E=w.updateQueue,E===null?w.updateQueue=new Set([M]):E.add(M),PT(f,M,j)),!1;case 22:return w.flags|=65536,M===rD?w.flags|=16384:(E=w.updateQueue,E===null?(E={transitions:null,markerInstances:null,retryQueue:new Set([M])},w.updateQueue=E):(w=E.retryQueue,w===null?E.retryQueue=new Set([M]):w.add(M)),PT(f,M,j)),!1}throw Error(a(435,w.tag))}return PT(f,M,j),xD(),!1}if(Ca)return E=Ys.current,E!==null?((E.flags&65536)===0&&(E.flags|=256),E.flags|=65536,E.lanes=j,M!==FL&&(f=Error(a(422),{cause:M}),oy(cs(f,w)))):(M!==FL&&(E=Error(a(423),{cause:M}),oy(cs(E,w))),f=f.current.alternate,f.flags|=65536,j&=-j,f.lanes|=j,M=cs(M,w),j=hT(f.stateNode,M,j),jL(f,j),mi!==4&&(mi=2)),!1;var W=Error(a(520),{cause:M});if(W=cs(W,w),wy===null?wy=[W]:wy.push(W),mi!==4&&(mi=2),E===null)return!0;M=cs(M,w),w=E;do{switch(w.tag){case 3:return w.flags|=65536,f=j&-j,w.lanes|=f,f=hT(w.stateNode,M,f),jL(w,f),!1;case 1:if(E=w.type,W=w.stateNode,(w.flags&128)===0&&(typeof E.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(Qp===null||!Qp.has(W))))return w.flags|=65536,j&=-j,w.lanes|=j,j=YV(j),qV(j,f,w,M),jL(w,j),!1}w=w.return}while(w!==null);return!1}var fT=Error(a(461)),Gi=!1;function Po(f,E,w,M){E.child=f===null?WZ(E,null,w,M):Nh(E,f.child,w,M)}function jV(f,E,w,M,j){w=w.render;var W=E.ref;if("ref"in M){var ge={};for(var xe in M)xe!=="ref"&&(ge[xe]=M[xe])}else ge=M;return xh(E),M=XL(f,E,w,ge,W,j),xe=$L(),f!==null&&!Gi?(eT(f,E,j),Uu(f,E,j)):(Ca&&xe&&an(E),E.flags|=1,Po(f,E,M,j),E.child)}function zV(f,E,w,M,j){if(f===null){var W=w.type;return typeof W=="function"&&!ay(W)&&W.defaultProps===void 0&&w.compare===null?(E.tag=15,E.type=W,JV(f,E,W,M,j)):(f=lC(w.type,null,M,E,E.mode,j),f.ref=E.ref,f.return=E,E.child=f)}if(W=f.child,!wT(f,j)){var ge=W.memoizedProps;if(w=w.compare,w=w!==null?w:yh,w(ge,M)&&f.ref===E.ref)return Uu(f,E,j)}return E.flags|=1,f=El(W,M),f.ref=E.ref,f.return=E,E.child=f}function JV(f,E,w,M,j){if(f!==null){var W=f.memoizedProps;if(yh(W,M)&&f.ref===E.ref)if(Gi=!1,E.pendingProps=M=W,wT(f,j))(f.flags&131072)!==0&&(Gi=!0);else return E.lanes=f.lanes,Uu(f,E,j)}return bT(f,E,w,M,j)}function WV(f,E,w,M){var j=M.children,W=f!==null?f.memoizedState:null;if(f===null&&E.stateNode===null&&(E.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),M.mode==="hidden"){if((E.flags&128)!==0){if(W=W!==null?W.baseLanes|w:w,f!==null){for(M=E.child=f.child,j=0;M!==null;)j=j|M.lanes|M.childLanes,M=M.sibling;M=j&~W}else M=0,E.child=null;return ZV(f,E,W,w,M)}if((w&536870912)!==0)E.memoizedState={baseLanes:0,cachePool:null},f!==null&&nD(E,W!==null?W.cachePool:null),W!==null?XZ(E,W):JL(),$Z(E);else return M=E.lanes=536870912,ZV(f,E,W!==null?W.baseLanes|w:w,w,M)}else W!==null?(nD(E,W.cachePool),XZ(E,W),Ep(),E.memoizedState=null):(f!==null&&nD(E,null),JL(),Ep());return Po(f,E,j,w),E.child}function by(f,E){return f!==null&&f.tag===22||E.stateNode!==null||(E.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),E.sibling}function ZV(f,E,w,M,j){var W=KL();return W=W===null?null:{parent:Li._currentValue,pool:W},E.memoizedState={baseLanes:w,cachePool:W},f!==null&&nD(E,null),JL(),$Z(E),f!==null&&gC(f,E,M,!0),E.childLanes=j,null}function bD(f,E){return E=ED({mode:E.mode,children:E.children},f.mode),E.ref=f.ref,f.child=E,E.return=f,E}function VV(f,E,w){return Nh(E,f.child,null,w),f=bD(E,E.pendingProps),f.flags|=2,qs(E),E.memoizedState=null,f}function QGe(f,E,w){var M=E.pendingProps,j=(E.flags&128)!==0;if(E.flags&=-129,f===null){if(Ca){if(M.mode==="hidden")return f=bD(E,M),E.lanes=536870912,by(null,f);if(ZL(E),(f=Jn)?(f=c$(f,_c),f=f!==null&&f.data==="&"?f:null,f!==null&&(E.memoizedState={dehydrated:f,treeContext:Ed!==null?{id:Sc,overflow:Te}:null,retryLane:536870912,hydrationErrors:null},w=Xv(f),w.return=E,E.child=w,ba=E,Jn=null)):f=null,f===null)throw pp(E);return E.lanes=536870912,null}return bD(E,M)}var W=f.memoizedState;if(W!==null){var ge=W.dehydrated;if(ZL(E),j)if(E.flags&256)E.flags&=-257,E=VV(f,E,w);else if(E.memoizedState!==null)E.child=f.child,E.flags|=128,E=null;else throw Error(a(558));else if(Gi||gC(f,E,w,!1),j=(w&f.childLanes)!==0,Gi||j){if(M=xr,M!==null&&(ge=vt(M,w),ge!==0&&ge!==W.retryLane))throw W.retryLane=ge,Cd(f,ge),ps(M,f,ge),fT;xD(),E=VV(f,E,w)}else f=W.treeContext,Jn=Nc(ge.nextSibling),ba=E,Ca=!0,Oo=null,_c=!1,f!==null&&Sa(E,f),E=bD(E,M),E.flags|=4096;return E}return f=El(f.child,{mode:M.mode,children:M.children}),f.ref=E.ref,E.child=f,f.return=E,f}function CD(f,E){var w=E.ref;if(w===null)f!==null&&f.ref!==null&&(E.flags|=4194816);else{if(typeof w!="function"&&typeof w!="object")throw Error(a(284));(f===null||f.ref!==w)&&(E.flags|=4194816)}}function bT(f,E,w,M,j){return xh(E),w=XL(f,E,w,M,void 0,j),M=$L(),f!==null&&!Gi?(eT(f,E,j),Uu(f,E,j)):(Ca&&M&&an(E),E.flags|=1,Po(f,E,w,j),E.child)}function XV(f,E,w,M,j,W){return xh(E),E.updateQueue=null,w=tV(E,M,w,j),eV(f),M=$L(),f!==null&&!Gi?(eT(f,E,W),Uu(f,E,W)):(Ca&&M&&an(E),E.flags|=1,Po(f,E,w,W),E.child)}function $V(f,E,w,M,j){if(xh(E),E.stateNode===null){var W=to,ge=w.contextType;typeof ge=="object"&&ge!==null&&(W=Uo(ge)),W=new w(M,W),E.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,W.updater=mT,E.stateNode=W,W._reactInternals=E,W=E.stateNode,W.props=M,W.state=E.memoizedState,W.refs={},YL(E),ge=w.contextType,W.context=typeof ge=="object"&&ge!==null?Uo(ge):to,W.state=E.memoizedState,ge=w.getDerivedStateFromProps,typeof ge=="function"&&(pT(E,w,ge,M),W.state=E.memoizedState),typeof w.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(ge=W.state,typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount(),ge!==W.state&&mT.enqueueReplaceState(W,W.state,null),gy(E,M,W,j),uy(),W.state=E.memoizedState),typeof W.componentDidMount=="function"&&(E.flags|=4194308),M=!0}else if(f===null){W=E.stateNode;var xe=E.memoizedProps,Ve=Fh(w,xe);W.props=Ve;var wt=W.context,Ot=w.contextType;ge=to,typeof Ot=="object"&&Ot!==null&&(ge=Uo(Ot));var jt=w.getDerivedStateFromProps;Ot=typeof jt=="function"||typeof W.getSnapshotBeforeUpdate=="function",xe=E.pendingProps!==xe,Ot||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(xe||wt!==ge)&&OV(E,W,M,ge),hp=!1;var St=E.memoizedState;W.state=St,gy(E,M,W,j),uy(),wt=E.memoizedState,xe||St!==wt||hp?(typeof jt=="function"&&(pT(E,w,jt,M),wt=E.memoizedState),(Ve=hp||GV(E,w,Ve,M,St,wt,ge))?(Ot||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount()),typeof W.componentDidMount=="function"&&(E.flags|=4194308)):(typeof W.componentDidMount=="function"&&(E.flags|=4194308),E.memoizedProps=M,E.memoizedState=wt),W.props=M,W.state=wt,W.context=ge,M=Ve):(typeof W.componentDidMount=="function"&&(E.flags|=4194308),M=!1)}else{W=E.stateNode,qL(f,E),ge=E.memoizedProps,Ot=Fh(w,ge),W.props=Ot,jt=E.pendingProps,St=W.context,wt=w.contextType,Ve=to,typeof wt=="object"&&wt!==null&&(Ve=Uo(wt)),xe=w.getDerivedStateFromProps,(wt=typeof xe=="function"||typeof W.getSnapshotBeforeUpdate=="function")||typeof W.UNSAFE_componentWillReceiveProps!="function"&&typeof W.componentWillReceiveProps!="function"||(ge!==jt||St!==Ve)&&OV(E,W,M,Ve),hp=!1,St=E.memoizedState,W.state=St,gy(E,M,W,j),uy();var Nt=E.memoizedState;ge!==jt||St!==Nt||hp||f!==null&&f.dependencies!==null&&eD(f.dependencies)?(typeof xe=="function"&&(pT(E,w,xe,M),Nt=E.memoizedState),(Ot=hp||GV(E,w,Ot,M,St,Nt,Ve)||f!==null&&f.dependencies!==null&&eD(f.dependencies))?(wt||typeof W.UNSAFE_componentWillUpdate!="function"&&typeof W.componentWillUpdate!="function"||(typeof W.componentWillUpdate=="function"&&W.componentWillUpdate(M,Nt,Ve),typeof W.UNSAFE_componentWillUpdate=="function"&&W.UNSAFE_componentWillUpdate(M,Nt,Ve)),typeof W.componentDidUpdate=="function"&&(E.flags|=4),typeof W.getSnapshotBeforeUpdate=="function"&&(E.flags|=1024)):(typeof W.componentDidUpdate!="function"||ge===f.memoizedProps&&St===f.memoizedState||(E.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||ge===f.memoizedProps&&St===f.memoizedState||(E.flags|=1024),E.memoizedProps=M,E.memoizedState=Nt),W.props=M,W.state=Nt,W.context=Ve,M=Ot):(typeof W.componentDidUpdate!="function"||ge===f.memoizedProps&&St===f.memoizedState||(E.flags|=4),typeof W.getSnapshotBeforeUpdate!="function"||ge===f.memoizedProps&&St===f.memoizedState||(E.flags|=1024),M=!1)}return W=M,CD(f,E),M=(E.flags&128)!==0,W||M?(W=E.stateNode,w=M&&typeof w.getDerivedStateFromError!="function"?null:W.render(),E.flags|=1,f!==null&&M?(E.child=Nh(E,f.child,null,j),E.child=Nh(E,null,w,j)):Po(f,E,w,j),E.memoizedState=W.state,f=E.child):f=Uu(f,E,j),f}function eX(f,E,w,M){return vh(),E.flags|=256,Po(f,E,w,M),E.child}var CT={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ET(f){return{baseLanes:f,cachePool:HZ()}}function IT(f,E,w){return f=f!==null?f.childLanes&~w:0,E&&(f|=zs),f}function tX(f,E,w){var M=E.pendingProps,j=!1,W=(E.flags&128)!==0,ge;if((ge=W)||(ge=f!==null&&f.memoizedState===null?!1:(yi.current&2)!==0),ge&&(j=!0,E.flags&=-129),ge=(E.flags&32)!==0,E.flags&=-33,f===null){if(Ca){if(j?Cp(E):Ep(),(f=Jn)?(f=c$(f,_c),f=f!==null&&f.data!=="&"?f:null,f!==null&&(E.memoizedState={dehydrated:f,treeContext:Ed!==null?{id:Sc,overflow:Te}:null,retryLane:536870912,hydrationErrors:null},w=Xv(f),w.return=E,E.child=w,ba=E,Jn=null)):f=null,f===null)throw pp(E);return a3(f)?E.lanes=32:E.lanes=536870912,null}var xe=M.children;return M=M.fallback,j?(Ep(),j=E.mode,xe=ED({mode:"hidden",children:xe},j),M=Fu(M,j,w,null),xe.return=E,M.return=E,xe.sibling=M,E.child=xe,M=E.child,M.memoizedState=ET(w),M.childLanes=IT(f,ge,w),E.memoizedState=CT,by(null,M)):(Cp(E),BT(E,xe))}var Ve=f.memoizedState;if(Ve!==null&&(xe=Ve.dehydrated,xe!==null)){if(W)E.flags&256?(Cp(E),E.flags&=-257,E=yT(f,E,w)):E.memoizedState!==null?(Ep(),E.child=f.child,E.flags|=128,E=null):(Ep(),xe=M.fallback,j=E.mode,M=ED({mode:"visible",children:M.children},j),xe=Fu(xe,j,w,null),xe.flags|=2,M.return=E,xe.return=E,M.sibling=xe,E.child=M,Nh(E,f.child,null,w),M=E.child,M.memoizedState=ET(w),M.childLanes=IT(f,ge,w),E.memoizedState=CT,E=by(null,M));else if(Cp(E),a3(xe)){if(ge=xe.nextSibling&&xe.nextSibling.dataset,ge)var wt=ge.dgst;ge=wt,M=Error(a(419)),M.stack="",M.digest=ge,oy({value:M,source:null,stack:null}),E=yT(f,E,w)}else if(Gi||gC(f,E,w,!1),ge=(w&f.childLanes)!==0,Gi||ge){if(ge=xr,ge!==null&&(M=vt(ge,w),M!==0&&M!==Ve.retryLane))throw Ve.retryLane=M,Cd(f,M),ps(ge,f,M),fT;n3(xe)||xD(),E=yT(f,E,w)}else n3(xe)?(E.flags|=192,E.child=f.child,E=null):(f=Ve.treeContext,Jn=Nc(xe.nextSibling),ba=E,Ca=!0,Oo=null,_c=!1,f!==null&&Sa(E,f),E=BT(E,M.children),E.flags|=4096);return E}return j?(Ep(),xe=M.fallback,j=E.mode,Ve=f.child,wt=Ve.sibling,M=El(Ve,{mode:"hidden",children:M.children}),M.subtreeFlags=Ve.subtreeFlags&65011712,wt!==null?xe=El(wt,xe):(xe=Fu(xe,j,w,null),xe.flags|=2),xe.return=E,M.return=E,M.sibling=xe,E.child=M,by(null,M),M=E.child,xe=f.child.memoizedState,xe===null?xe=ET(w):(j=xe.cachePool,j!==null?(Ve=Li._currentValue,j=j.parent!==Ve?{parent:Ve,pool:Ve}:j):j=HZ(),xe={baseLanes:xe.baseLanes|w,cachePool:j}),M.memoizedState=xe,M.childLanes=IT(f,ge,w),E.memoizedState=CT,by(f.child,M)):(Cp(E),w=f.child,f=w.sibling,w=El(w,{mode:"visible",children:M.children}),w.return=E,w.sibling=null,f!==null&&(ge=E.deletions,ge===null?(E.deletions=[f],E.flags|=16):ge.push(f)),E.child=w,E.memoizedState=null,w)}function BT(f,E){return E=ED({mode:"visible",children:E},f.mode),E.return=f,f.child=E}function ED(f,E){return f=xA(22,f,null,E),f.lanes=0,f}function yT(f,E,w){return Nh(E,f.child,null,w),f=BT(E,E.pendingProps.children),f.flags|=2,E.memoizedState=null,f}function nX(f,E,w){f.lanes|=E;var M=f.alternate;M!==null&&(M.lanes|=E),GL(f.return,E,w)}function QT(f,E,w,M,j,W){var ge=f.memoizedState;ge===null?f.memoizedState={isBackwards:E,rendering:null,renderingStartTime:0,last:M,tail:w,tailMode:j,treeForkCount:W}:(ge.isBackwards=E,ge.rendering=null,ge.renderingStartTime=0,ge.last=M,ge.tail=w,ge.tailMode=j,ge.treeForkCount=W)}function aX(f,E,w){var M=E.pendingProps,j=M.revealOrder,W=M.tail;M=M.children;var ge=yi.current,xe=(ge&2)!==0;if(xe?(ge=ge&1|2,E.flags|=128):ge&=1,Z(yi,ge),Po(f,E,M,w),M=Ca?kh:0,!xe&&f!==null&&(f.flags&128)!==0)e:for(f=E.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&nX(f,w,E);else if(f.tag===19)nX(f,w,E);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===E)break e;for(;f.sibling===null;){if(f.return===null||f.return===E)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}switch(j){case"forwards":for(w=E.child,j=null;w!==null;)f=w.alternate,f!==null&&sD(f)===null&&(j=w),w=w.sibling;w=j,w===null?(j=E.child,E.child=null):(j=w.sibling,w.sibling=null),QT(E,!1,j,w,W,M);break;case"backwards":case"unstable_legacy-backwards":for(w=null,j=E.child,E.child=null;j!==null;){if(f=j.alternate,f!==null&&sD(f)===null){E.child=j;break}f=j.sibling,j.sibling=w,w=j,j=f}QT(E,!0,w,null,W,M);break;case"together":QT(E,!1,null,null,void 0,M);break;default:E.memoizedState=null}return E.child}function Uu(f,E,w){if(f!==null&&(E.dependencies=f.dependencies),yp|=E.lanes,(w&E.childLanes)===0)if(f!==null){if(gC(f,E,w,!1),(w&E.childLanes)===0)return null}else return null;if(f!==null&&E.child!==f.child)throw Error(a(153));if(E.child!==null){for(f=E.child,w=El(f,f.pendingProps),E.child=w,w.return=E;f.sibling!==null;)f=f.sibling,w=w.sibling=El(f,f.pendingProps),w.return=E;w.sibling=null}return E.child}function wT(f,E){return(f.lanes&E)!==0?!0:(f=f.dependencies,!!(f!==null&&eD(f)))}function wGe(f,E,w){switch(E.tag){case 3:pe(E,E.stateNode.containerInfo),mp(E,Li,f.memoizedState.cache),vh();break;case 27:case 5:re(E);break;case 4:pe(E,E.stateNode.containerInfo);break;case 10:mp(E,E.type,E.memoizedProps.value);break;case 31:if(E.memoizedState!==null)return E.flags|=128,ZL(E),null;break;case 13:var M=E.memoizedState;if(M!==null)return M.dehydrated!==null?(Cp(E),E.flags|=128,null):(w&E.child.childLanes)!==0?tX(f,E,w):(Cp(E),f=Uu(f,E,w),f!==null?f.sibling:null);Cp(E);break;case 19:var j=(f.flags&128)!==0;if(M=(w&E.childLanes)!==0,M||(gC(f,E,w,!1),M=(w&E.childLanes)!==0),j){if(M)return aX(f,E,w);E.flags|=128}if(j=E.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),Z(yi,yi.current),M)break;return null;case 22:return E.lanes=0,WV(f,E,w,E.pendingProps);case 24:mp(E,Li,f.memoizedState.cache)}return Uu(f,E,w)}function rX(f,E,w){if(f!==null)if(f.memoizedProps!==E.pendingProps)Gi=!0;else{if(!wT(f,w)&&(E.flags&128)===0)return Gi=!1,wGe(f,E,w);Gi=(f.flags&131072)!==0}else Gi=!1,Ca&&(E.flags&1048576)!==0&&zt(E,kh,E.index);switch(E.lanes=0,E.tag){case 16:e:{var M=E.pendingProps;if(f=_h(E.elementType),E.type=f,typeof f=="function")ay(f)?(M=Fh(f,M),E.tag=1,E=$V(null,E,f,M,w)):(E.tag=0,E=bT(null,E,f,M,w));else{if(f!=null){var j=f.$$typeof;if(j===Q){E.tag=11,E=jV(null,E,f,M,w);break e}else if(j===v){E.tag=14,E=zV(null,E,f,M,w);break e}}throw E=R(f)||f,Error(a(306,E,""))}}return E;case 0:return bT(f,E,E.type,E.pendingProps,w);case 1:return M=E.type,j=Fh(M,E.pendingProps),$V(f,E,M,j,w);case 3:e:{if(pe(E,E.stateNode.containerInfo),f===null)throw Error(a(387));M=E.pendingProps;var W=E.memoizedState;j=W.element,qL(f,E),gy(E,M,null,w);var ge=E.memoizedState;if(M=ge.cache,mp(E,Li,M),M!==W.cache&&OL(E,[Li],w,!0),uy(),M=ge.element,W.isDehydrated)if(W={element:M,isDehydrated:!1,cache:ge.cache},E.updateQueue.baseState=W,E.memoizedState=W,E.flags&256){E=eX(f,E,M,w);break e}else if(M!==j){j=cs(Error(a(424)),E),oy(j),E=eX(f,E,M,w);break e}else{switch(f=E.stateNode.containerInfo,f.nodeType){case 9:f=f.body;break;default:f=f.nodeName==="HTML"?f.ownerDocument.body:f}for(Jn=Nc(f.firstChild),ba=E,Ca=!0,Oo=null,_c=!0,w=WZ(E,null,M,w),E.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling}else{if(vh(),M===j){E=Uu(f,E,w);break e}Po(f,E,M,w)}E=E.child}return E;case 26:return CD(f,E),f===null?(w=m$(E.type,null,E.pendingProps,null))?E.memoizedState=w:Ca||(w=E.type,f=E.pendingProps,M=LD(Ae.current).createElement(w),M[Mt]=E,M[Wt]=f,Ko(M,w,f),on(M),E.stateNode=M):E.memoizedState=m$(E.type,f.memoizedProps,E.pendingProps,f.memoizedState),null;case 27:return re(E),f===null&&Ca&&(M=E.stateNode=u$(E.type,E.pendingProps,Ae.current),ba=E,_c=!0,j=Jn,Dp(E.type)?(r3=j,Jn=Nc(M.firstChild)):Jn=j),Po(f,E,E.pendingProps.children,w),CD(f,E),f===null&&(E.flags|=4194304),E.child;case 5:return f===null&&Ca&&((j=M=Jn)&&(M=t4e(M,E.type,E.pendingProps,_c),M!==null?(E.stateNode=M,ba=E,Jn=Nc(M.firstChild),_c=!1,j=!0):j=!1),j||pp(E)),re(E),j=E.type,W=E.pendingProps,ge=f!==null?f.memoizedProps:null,M=W.children,$T(j,W)?M=null:ge!==null&&$T(j,ge)&&(E.flags|=32),E.memoizedState!==null&&(j=XL(f,E,hGe,null,null,w),Ny._currentValue=j),CD(f,E),Po(f,E,M,w),E.child;case 6:return f===null&&Ca&&((f=w=Jn)&&(w=n4e(w,E.pendingProps,_c),w!==null?(E.stateNode=w,ba=E,Jn=null,f=!0):f=!1),f||pp(E)),null;case 13:return tX(f,E,w);case 4:return pe(E,E.stateNode.containerInfo),M=E.pendingProps,f===null?E.child=Nh(E,null,M,w):Po(f,E,M,w),E.child;case 11:return jV(f,E,E.type,E.pendingProps,w);case 7:return Po(f,E,E.pendingProps,w),E.child;case 8:return Po(f,E,E.pendingProps.children,w),E.child;case 12:return Po(f,E,E.pendingProps.children,w),E.child;case 10:return M=E.pendingProps,mp(E,E.type,M.value),Po(f,E,M.children,w),E.child;case 9:return j=E.type._context,M=E.pendingProps.children,xh(E),j=Uo(j),M=M(j),E.flags|=1,Po(f,E,M,w),E.child;case 14:return zV(f,E,E.type,E.pendingProps,w);case 15:return JV(f,E,E.type,E.pendingProps,w);case 19:return aX(f,E,w);case 31:return QGe(f,E,w);case 22:return WV(f,E,w,E.pendingProps);case 24:return xh(E),M=Uo(Li),f===null?(j=KL(),j===null&&(j=xr,W=UL(),j.pooledCache=W,W.refCount++,W!==null&&(j.pooledCacheLanes|=w),j=W),E.memoizedState={parent:M,cache:j},YL(E),mp(E,Li,j)):((f.lanes&w)!==0&&(qL(f,E),gy(E,null,null,w),uy()),j=f.memoizedState,W=E.memoizedState,j.parent!==M?(j={parent:M,cache:M},E.memoizedState=j,E.lanes===0&&(E.memoizedState=E.updateQueue.baseState=j),mp(E,Li,M)):(M=W.cache,mp(E,Li,M),M!==j.cache&&OL(E,[Li],w,!0))),Po(f,E,E.pendingProps.children,w),E.child;case 29:throw E.pendingProps}throw Error(a(156,E.tag))}function Pu(f){f.flags|=4}function kT(f,E,w,M,j){if((E=(f.mode&32)!==0)&&(E=!1),E){if(f.flags|=16777216,(j&335544128)===j)if(f.stateNode.complete)f.flags|=8192;else if(_X())f.flags|=8192;else throw Rh=rD,HL}else f.flags&=-16777217}function iX(f,E){if(E.type!=="stylesheet"||(E.state.loading&4)!==0)f.flags&=-16777217;else if(f.flags|=16777216,!E$(E))if(_X())f.flags|=8192;else throw Rh=rD,HL}function ID(f,E){E!==null&&(f.flags|=4),f.flags&16384&&(E=f.tag!==22?at():536870912,f.lanes|=E,wC|=E)}function Cy(f,E){if(!Ca)switch(f.tailMode){case"hidden":E=f.tail;for(var w=null;E!==null;)E.alternate!==null&&(w=E),E=E.sibling;w===null?f.tail=null:w.sibling=null;break;case"collapsed":w=f.tail;for(var M=null;w!==null;)w.alternate!==null&&(M=w),w=w.sibling;M===null?E||f.tail===null?f.tail=null:f.tail.sibling=null:M.sibling=null}}function Kr(f){var E=f.alternate!==null&&f.alternate.child===f.child,w=0,M=0;if(E)for(var j=f.child;j!==null;)w|=j.lanes|j.childLanes,M|=j.subtreeFlags&65011712,M|=j.flags&65011712,j.return=f,j=j.sibling;else for(j=f.child;j!==null;)w|=j.lanes|j.childLanes,M|=j.subtreeFlags,M|=j.flags,j.return=f,j=j.sibling;return f.subtreeFlags|=M,f.childLanes=w,E}function kGe(f,E,w){var M=E.pendingProps;switch(aa(E),E.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kr(E),null;case 1:return Kr(E),null;case 3:return w=E.stateNode,M=null,f!==null&&(M=f.memoizedState.cache),E.memoizedState.cache!==M&&(E.flags|=2048),Tu(Li),te(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(f===null||f.child===null)&&(uC(E)?Pu(E):f===null||f.memoizedState.isDehydrated&&(E.flags&256)===0||(E.flags|=1024,LL())),Kr(E),null;case 26:var j=E.type,W=E.memoizedState;return f===null?(Pu(E),W!==null?(Kr(E),iX(E,W)):(Kr(E),kT(E,j,null,M,w))):W?W!==f.memoizedState?(Pu(E),Kr(E),iX(E,W)):(Kr(E),E.flags&=-16777217):(f=f.memoizedProps,f!==M&&Pu(E),Kr(E),kT(E,j,f,M,w)),null;case 27:if(se(E),w=Ae.current,j=E.type,f!==null&&E.stateNode!=null)f.memoizedProps!==M&&Pu(E);else{if(!M){if(E.stateNode===null)throw Error(a(166));return Kr(E),null}f=$.current,uC(E)?GZ(E):(f=u$(j,M,w),E.stateNode=f,Pu(E))}return Kr(E),null;case 5:if(se(E),j=E.type,f!==null&&E.stateNode!=null)f.memoizedProps!==M&&Pu(E);else{if(!M){if(E.stateNode===null)throw Error(a(166));return Kr(E),null}if(W=$.current,uC(E))GZ(E);else{var ge=LD(Ae.current);switch(W){case 1:W=ge.createElementNS("http://www.w3.org/2000/svg",j);break;case 2:W=ge.createElementNS("http://www.w3.org/1998/Math/MathML",j);break;default:switch(j){case"svg":W=ge.createElementNS("http://www.w3.org/2000/svg",j);break;case"math":W=ge.createElementNS("http://www.w3.org/1998/Math/MathML",j);break;case"script":W=ge.createElement("div"),W.innerHTML="<script><\/script>",W=W.removeChild(W.firstChild);break;case"select":W=typeof M.is=="string"?ge.createElement("select",{is:M.is}):ge.createElement("select"),M.multiple?W.multiple=!0:M.size&&(W.size=M.size);break;default:W=typeof M.is=="string"?ge.createElement(j,{is:M.is}):ge.createElement(j)}}W[Mt]=E,W[Wt]=M;e:for(ge=E.child;ge!==null;){if(ge.tag===5||ge.tag===6)W.appendChild(ge.stateNode);else if(ge.tag!==4&&ge.tag!==27&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===E)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===E)break e;ge=ge.return}ge.sibling.return=ge.return,ge=ge.sibling}E.stateNode=W;e:switch(Ko(W,j,M),j){case"button":case"input":case"select":case"textarea":M=!!M.autoFocus;break e;case"img":M=!0;break e;default:M=!1}M&&Pu(E)}}return Kr(E),kT(E,E.type,f===null?null:f.memoizedProps,E.pendingProps,w),null;case 6:if(f&&E.stateNode!=null)f.memoizedProps!==M&&Pu(E);else{if(typeof M!="string"&&E.stateNode===null)throw Error(a(166));if(f=Ae.current,uC(E)){if(f=E.stateNode,w=E.memoizedProps,M=null,j=ba,j!==null)switch(j.tag){case 27:case 5:M=j.memoizedProps}f[Mt]=E,f=!!(f.nodeValue===w||M!==null&&M.suppressHydrationWarning===!0||t$(f.nodeValue,w)),f||pp(E,!0)}else f=LD(f).createTextNode(M),f[Mt]=E,E.stateNode=f}return Kr(E),null;case 31:if(w=E.memoizedState,f===null||f.memoizedState!==null){if(M=uC(E),w!==null){if(f===null){if(!M)throw Error(a(318));if(f=E.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(557));f[Mt]=E}else vh(),(E.flags&128)===0&&(E.memoizedState=null),E.flags|=4;Kr(E),f=!1}else w=LL(),f!==null&&f.memoizedState!==null&&(f.memoizedState.hydrationErrors=w),f=!0;if(!f)return E.flags&256?(qs(E),E):(qs(E),null);if((E.flags&128)!==0)throw Error(a(558))}return Kr(E),null;case 13:if(M=E.memoizedState,f===null||f.memoizedState!==null&&f.memoizedState.dehydrated!==null){if(j=uC(E),M!==null&&M.dehydrated!==null){if(f===null){if(!j)throw Error(a(318));if(j=E.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(a(317));j[Mt]=E}else vh(),(E.flags&128)===0&&(E.memoizedState=null),E.flags|=4;Kr(E),j=!1}else j=LL(),f!==null&&f.memoizedState!==null&&(f.memoizedState.hydrationErrors=j),j=!0;if(!j)return E.flags&256?(qs(E),E):(qs(E),null)}return qs(E),(E.flags&128)!==0?(E.lanes=w,E):(w=M!==null,f=f!==null&&f.memoizedState!==null,w&&(M=E.child,j=null,M.alternate!==null&&M.alternate.memoizedState!==null&&M.alternate.memoizedState.cachePool!==null&&(j=M.alternate.memoizedState.cachePool.pool),W=null,M.memoizedState!==null&&M.memoizedState.cachePool!==null&&(W=M.memoizedState.cachePool.pool),W!==j&&(M.flags|=2048)),w!==f&&w&&(E.child.flags|=8192),ID(E,E.updateQueue),Kr(E),null);case 4:return te(),f===null&&JT(E.stateNode.containerInfo),Kr(E),null;case 10:return Tu(E.type),Kr(E),null;case 19:if(z(yi),M=E.memoizedState,M===null)return Kr(E),null;if(j=(E.flags&128)!==0,W=M.rendering,W===null)if(j)Cy(M,!1);else{if(mi!==0||f!==null&&(f.flags&128)!==0)for(f=E.child;f!==null;){if(W=sD(f),W!==null){for(E.flags|=128,Cy(M,!1),f=W.updateQueue,E.updateQueue=f,ID(E,f),E.subtreeFlags=0,f=w,w=E.child;w!==null;)Vv(w,f),w=w.sibling;return Z(yi,yi.current&1|2),Ca&&xt(E,M.treeForkCount),E.child}f=f.sibling}M.tail!==null&&Ge()>kD&&(E.flags|=128,j=!0,Cy(M,!1),E.lanes=4194304)}else{if(!j)if(f=sD(W),f!==null){if(E.flags|=128,j=!0,f=f.updateQueue,E.updateQueue=f,ID(E,f),Cy(M,!0),M.tail===null&&M.tailMode==="hidden"&&!W.alternate&&!Ca)return Kr(E),null}else 2*Ge()-M.renderingStartTime>kD&&w!==536870912&&(E.flags|=128,j=!0,Cy(M,!1),E.lanes=4194304);M.isBackwards?(W.sibling=E.child,E.child=W):(f=M.last,f!==null?f.sibling=W:E.child=W,M.last=W)}return M.tail!==null?(f=M.tail,M.rendering=f,M.tail=f.sibling,M.renderingStartTime=Ge(),f.sibling=null,w=yi.current,Z(yi,j?w&1|2:w&1),Ca&&xt(E,M.treeForkCount),f):(Kr(E),null);case 22:case 23:return qs(E),WL(),M=E.memoizedState!==null,f!==null?f.memoizedState!==null!==M&&(E.flags|=8192):M&&(E.flags|=8192),M?(w&536870912)!==0&&(E.flags&128)===0&&(Kr(E),E.subtreeFlags&6&&(E.flags|=8192)):Kr(E),w=E.updateQueue,w!==null&&ID(E,w.retryQueue),w=null,f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(w=f.memoizedState.cachePool.pool),M=null,E.memoizedState!==null&&E.memoizedState.cachePool!==null&&(M=E.memoizedState.cachePool.pool),M!==w&&(E.flags|=2048),f!==null&&z(Sh),null;case 24:return w=null,f!==null&&(w=f.memoizedState.cache),E.memoizedState.cache!==w&&(E.flags|=2048),Tu(Li),Kr(E),null;case 25:return null;case 30:return null}throw Error(a(156,E.tag))}function vGe(f,E){switch(aa(E),E.tag){case 1:return f=E.flags,f&65536?(E.flags=f&-65537|128,E):null;case 3:return Tu(Li),te(),f=E.flags,(f&65536)!==0&&(f&128)===0?(E.flags=f&-65537|128,E):null;case 26:case 27:case 5:return se(E),null;case 31:if(E.memoizedState!==null){if(qs(E),E.alternate===null)throw Error(a(340));vh()}return f=E.flags,f&65536?(E.flags=f&-65537|128,E):null;case 13:if(qs(E),f=E.memoizedState,f!==null&&f.dehydrated!==null){if(E.alternate===null)throw Error(a(340));vh()}return f=E.flags,f&65536?(E.flags=f&-65537|128,E):null;case 19:return z(yi),null;case 4:return te(),null;case 10:return Tu(E.type),null;case 22:case 23:return qs(E),WL(),f!==null&&z(Sh),f=E.flags,f&65536?(E.flags=f&-65537|128,E):null;case 24:return Tu(Li),null;case 25:return null;default:return null}}function oX(f,E){switch(aa(E),E.tag){case 3:Tu(Li),te();break;case 26:case 27:case 5:se(E);break;case 4:te();break;case 31:E.memoizedState!==null&&qs(E);break;case 13:qs(E);break;case 19:z(yi);break;case 10:Tu(E.type);break;case 22:case 23:qs(E),WL(),f!==null&&z(Sh);break;case 24:Tu(Li)}}function Ey(f,E){try{var w=E.updateQueue,M=w!==null?w.lastEffect:null;if(M!==null){var j=M.next;w=j;do{if((w.tag&f)===f){M=void 0;var W=w.create,ge=w.inst;M=W(),ge.destroy=M}w=w.next}while(w!==j)}}catch(xe){mr(E,E.return,xe)}}function Ip(f,E,w){try{var M=E.updateQueue,j=M!==null?M.lastEffect:null;if(j!==null){var W=j.next;M=W;do{if((M.tag&f)===f){var ge=M.inst,xe=ge.destroy;if(xe!==void 0){ge.destroy=void 0,j=E;var Ve=w,wt=xe;try{wt()}catch(Ot){mr(j,Ve,Ot)}}}M=M.next}while(M!==W)}}catch(Ot){mr(E,E.return,Ot)}}function AX(f){var E=f.updateQueue;if(E!==null){var w=f.stateNode;try{VZ(E,w)}catch(M){mr(f,f.return,M)}}}function sX(f,E,w){w.props=Fh(f.type,f.memoizedProps),w.state=f.memoizedState;try{w.componentWillUnmount()}catch(M){mr(f,E,M)}}function Iy(f,E){try{var w=f.ref;if(w!==null){switch(f.tag){case 26:case 27:case 5:var M=f.stateNode;break;case 30:M=f.stateNode;break;default:M=f.stateNode}typeof w=="function"?f.refCleanup=w(M):w.current=M}}catch(j){mr(f,E,j)}}function Id(f,E){var w=f.ref,M=f.refCleanup;if(w!==null)if(typeof M=="function")try{M()}catch(j){mr(f,E,j)}finally{f.refCleanup=null,f=f.alternate,f!=null&&(f.refCleanup=null)}else if(typeof w=="function")try{w(null)}catch(j){mr(f,E,j)}else w.current=null}function cX(f){var E=f.type,w=f.memoizedProps,M=f.stateNode;try{e:switch(E){case"button":case"input":case"select":case"textarea":w.autoFocus&&M.focus();break e;case"img":w.src?M.src=w.src:w.srcSet&&(M.srcset=w.srcSet)}}catch(j){mr(f,f.return,j)}}function vT(f,E,w){try{var M=f.stateNode;WGe(M,f.type,w,E),M[Wt]=E}catch(j){mr(f,f.return,j)}}function lX(f){return f.tag===5||f.tag===3||f.tag===26||f.tag===27&&Dp(f.type)||f.tag===4}function DT(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||lX(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.tag===27&&Dp(f.type)||f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function xT(f,E,w){var M=f.tag;if(M===5||M===6)f=f.stateNode,E?(w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w).insertBefore(f,E):(E=w.nodeType===9?w.body:w.nodeName==="HTML"?w.ownerDocument.body:w,E.appendChild(f),w=w._reactRootContainer,w!=null||E.onclick!==null||(E.onclick=Xt));else if(M!==4&&(M===27&&Dp(f.type)&&(w=f.stateNode,E=null),f=f.child,f!==null))for(xT(f,E,w),f=f.sibling;f!==null;)xT(f,E,w),f=f.sibling}function BD(f,E,w){var M=f.tag;if(M===5||M===6)f=f.stateNode,E?w.insertBefore(f,E):w.appendChild(f);else if(M!==4&&(M===27&&Dp(f.type)&&(w=f.stateNode),f=f.child,f!==null))for(BD(f,E,w),f=f.sibling;f!==null;)BD(f,E,w),f=f.sibling}function dX(f){var E=f.stateNode,w=f.memoizedProps;try{for(var M=f.type,j=E.attributes;j.length;)E.removeAttributeNode(j[0]);Ko(E,M,w),E[Mt]=f,E[Wt]=w}catch(W){mr(f,f.return,W)}}var Ku=!1,Oi=!1,ST=!1,uX=typeof WeakSet=="function"?WeakSet:Set,ko=null;function DGe(f,E){if(f=f.containerInfo,VT=HD,f=jB(f),iC(f)){if("selectionStart"in f)var w={start:f.selectionStart,end:f.selectionEnd};else e:{w=(w=f.ownerDocument)&&w.defaultView||window;var M=w.getSelection&&w.getSelection();if(M&&M.rangeCount!==0){w=M.anchorNode;var j=M.anchorOffset,W=M.focusNode;M=M.focusOffset;try{w.nodeType,W.nodeType}catch{w=null;break e}var ge=0,xe=-1,Ve=-1,wt=0,Ot=0,jt=f,St=null;t:for(;;){for(var Nt;jt!==w||j!==0&&jt.nodeType!==3||(xe=ge+j),jt!==W||M!==0&&jt.nodeType!==3||(Ve=ge+M),jt.nodeType===3&&(ge+=jt.nodeValue.length),(Nt=jt.firstChild)!==null;)St=jt,jt=Nt;for(;;){if(jt===f)break t;if(St===w&&++wt===j&&(xe=ge),St===W&&++Ot===M&&(Ve=ge),(Nt=jt.nextSibling)!==null)break;jt=St,St=jt.parentNode}jt=Nt}w=xe===-1||Ve===-1?null:{start:xe,end:Ve}}else w=null}w=w||{start:0,end:0}}else w=null;for(XT={focusedElem:f,selectionRange:w},HD=!1,ko=E;ko!==null;)if(E=ko,f=E.child,(E.subtreeFlags&1028)!==0&&f!==null)f.return=E,ko=f;else for(;ko!==null;){switch(E=ko,W=E.alternate,f=E.flags,E.tag){case 0:if((f&4)!==0&&(f=E.updateQueue,f=f!==null?f.events:null,f!==null))for(w=0;w<f.length;w++)j=f[w],j.ref.impl=j.nextImpl;break;case 11:case 15:break;case 1:if((f&1024)!==0&&W!==null){f=void 0,w=E,j=W.memoizedProps,W=W.memoizedState,M=w.stateNode;try{var Dn=Fh(w.type,j);f=M.getSnapshotBeforeUpdate(Dn,W),M.__reactInternalSnapshotBeforeUpdate=f}catch(Xn){mr(w,w.return,Xn)}}break;case 3:if((f&1024)!==0){if(f=E.stateNode.containerInfo,w=f.nodeType,w===9)t3(f);else if(w===1)switch(f.nodeName){case"HEAD":case"HTML":case"BODY":t3(f);break;default:f.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(a(163))}if(f=E.sibling,f!==null){f.return=E.return,ko=f;break}ko=E.return}}function gX(f,E,w){var M=w.flags;switch(w.tag){case 0:case 11:case 15:Yu(f,w),M&4&&Ey(5,w);break;case 1:if(Yu(f,w),M&4)if(f=w.stateNode,E===null)try{f.componentDidMount()}catch(ge){mr(w,w.return,ge)}else{var j=Fh(w.type,E.memoizedProps);E=E.memoizedState;try{f.componentDidUpdate(j,E,f.__reactInternalSnapshotBeforeUpdate)}catch(ge){mr(w,w.return,ge)}}M&64&&AX(w),M&512&&Iy(w,w.return);break;case 3:if(Yu(f,w),M&64&&(f=w.updateQueue,f!==null)){if(E=null,w.child!==null)switch(w.child.tag){case 27:case 5:E=w.child.stateNode;break;case 1:E=w.child.stateNode}try{VZ(f,E)}catch(ge){mr(w,w.return,ge)}}break;case 27:E===null&&M&4&&dX(w);case 26:case 5:Yu(f,w),E===null&&M&4&&cX(w),M&512&&Iy(w,w.return);break;case 12:Yu(f,w);break;case 31:Yu(f,w),M&4&&hX(f,w);break;case 13:Yu(f,w),M&4&&fX(f,w),M&64&&(f=w.memoizedState,f!==null&&(f=f.dehydrated,f!==null&&(w=TGe.bind(null,w),a4e(f,w))));break;case 22:if(M=w.memoizedState!==null||Ku,!M){E=E!==null&&E.memoizedState!==null||Oi,j=Ku;var W=Oi;Ku=M,(Oi=E)&&!W?qu(f,w,(w.subtreeFlags&8772)!==0):Yu(f,w),Ku=j,Oi=W}break;case 30:break;default:Yu(f,w)}}function pX(f){var E=f.alternate;E!==null&&(f.alternate=null,pX(E)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(E=f.stateNode,E!==null&&fe(E)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}var Xr=null,ls=!1;function Hu(f,E,w){for(w=w.child;w!==null;)mX(f,E,w),w=w.sibling}function mX(f,E,w){if(we&&typeof we.onCommitFiberUnmount=="function")try{we.onCommitFiberUnmount(X,w)}catch{}switch(w.tag){case 26:Oi||Id(w,E),Hu(f,E,w),w.memoizedState?w.memoizedState.count--:w.stateNode&&(w=w.stateNode,w.parentNode.removeChild(w));break;case 27:Oi||Id(w,E);var M=Xr,j=ls;Dp(w.type)&&(Xr=w.stateNode,ls=!1),Hu(f,E,w),Sy(w.stateNode),Xr=M,ls=j;break;case 5:Oi||Id(w,E);case 6:if(M=Xr,j=ls,Xr=null,Hu(f,E,w),Xr=M,ls=j,Xr!==null)if(ls)try{(Xr.nodeType===9?Xr.body:Xr.nodeName==="HTML"?Xr.ownerDocument.body:Xr).removeChild(w.stateNode)}catch(W){mr(w,E,W)}else try{Xr.removeChild(w.stateNode)}catch(W){mr(w,E,W)}break;case 18:Xr!==null&&(ls?(f=Xr,A$(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,w.stateNode),NC(f)):A$(Xr,w.stateNode));break;case 4:M=Xr,j=ls,Xr=w.stateNode.containerInfo,ls=!0,Hu(f,E,w),Xr=M,ls=j;break;case 0:case 11:case 14:case 15:Ip(2,w,E),Oi||Ip(4,w,E),Hu(f,E,w);break;case 1:Oi||(Id(w,E),M=w.stateNode,typeof M.componentWillUnmount=="function"&&sX(w,E,M)),Hu(f,E,w);break;case 21:Hu(f,E,w);break;case 22:Oi=(M=Oi)||w.memoizedState!==null,Hu(f,E,w),Oi=M;break;default:Hu(f,E,w)}}function hX(f,E){if(E.memoizedState===null&&(f=E.alternate,f!==null&&(f=f.memoizedState,f!==null))){f=f.dehydrated;try{NC(f)}catch(w){mr(E,E.return,w)}}}function fX(f,E){if(E.memoizedState===null&&(f=E.alternate,f!==null&&(f=f.memoizedState,f!==null&&(f=f.dehydrated,f!==null))))try{NC(f)}catch(w){mr(E,E.return,w)}}function xGe(f){switch(f.tag){case 31:case 13:case 19:var E=f.stateNode;return E===null&&(E=f.stateNode=new uX),E;case 22:return f=f.stateNode,E=f._retryCache,E===null&&(E=f._retryCache=new uX),E;default:throw Error(a(435,f.tag))}}function yD(f,E){var w=xGe(f);E.forEach(function(M){if(!w.has(M)){w.add(M);var j=GGe.bind(null,f,M);M.then(j,j)}})}function ds(f,E){var w=E.deletions;if(w!==null)for(var M=0;M<w.length;M++){var j=w[M],W=f,ge=E,xe=ge;e:for(;xe!==null;){switch(xe.tag){case 27:if(Dp(xe.type)){Xr=xe.stateNode,ls=!1;break e}break;case 5:Xr=xe.stateNode,ls=!1;break e;case 3:case 4:Xr=xe.stateNode.containerInfo,ls=!0;break e}xe=xe.return}if(Xr===null)throw Error(a(160));mX(W,ge,j),Xr=null,ls=!1,W=j.alternate,W!==null&&(W.return=null),j.return=null}if(E.subtreeFlags&13886)for(E=E.child;E!==null;)bX(E,f),E=E.sibling}var Il=null;function bX(f,E){var w=f.alternate,M=f.flags;switch(f.tag){case 0:case 11:case 14:case 15:ds(E,f),us(f),M&4&&(Ip(3,f,f.return),Ey(3,f),Ip(5,f,f.return));break;case 1:ds(E,f),us(f),M&512&&(Oi||w===null||Id(w,w.return)),M&64&&Ku&&(f=f.updateQueue,f!==null&&(M=f.callbacks,M!==null&&(w=f.shared.hiddenCallbacks,f.shared.hiddenCallbacks=w===null?M:w.concat(M))));break;case 26:var j=Il;if(ds(E,f),us(f),M&512&&(Oi||w===null||Id(w,w.return)),M&4){var W=w!==null?w.memoizedState:null;if(M=f.memoizedState,w===null)if(M===null)if(f.stateNode===null){e:{M=f.type,w=f.memoizedProps,j=j.ownerDocument||j;t:switch(M){case"title":W=j.getElementsByTagName("title")[0],(!W||W[Et]||W[Mt]||W.namespaceURI==="http://www.w3.org/2000/svg"||W.hasAttribute("itemprop"))&&(W=j.createElement(M),j.head.insertBefore(W,j.querySelector("head > title"))),Ko(W,M,w),W[Mt]=f,on(W),M=W;break e;case"link":var ge=b$("link","href",j).get(M+(w.href||""));if(ge){for(var xe=0;xe<ge.length;xe++)if(W=ge[xe],W.getAttribute("href")===(w.href==null||w.href===""?null:w.href)&&W.getAttribute("rel")===(w.rel==null?null:w.rel)&&W.getAttribute("title")===(w.title==null?null:w.title)&&W.getAttribute("crossorigin")===(w.crossOrigin==null?null:w.crossOrigin)){ge.splice(xe,1);break t}}W=j.createElement(M),Ko(W,M,w),j.head.appendChild(W);break;case"meta":if(ge=b$("meta","content",j).get(M+(w.content||""))){for(xe=0;xe<ge.length;xe++)if(W=ge[xe],W.getAttribute("content")===(w.content==null?null:""+w.content)&&W.getAttribute("name")===(w.name==null?null:w.name)&&W.getAttribute("property")===(w.property==null?null:w.property)&&W.getAttribute("http-equiv")===(w.httpEquiv==null?null:w.httpEquiv)&&W.getAttribute("charset")===(w.charSet==null?null:w.charSet)){ge.splice(xe,1);break t}}W=j.createElement(M),Ko(W,M,w),j.head.appendChild(W);break;default:throw Error(a(468,M))}W[Mt]=f,on(W),M=W}f.stateNode=M}else C$(j,f.type,f.stateNode);else f.stateNode=f$(j,M,f.memoizedProps);else W!==M?(W===null?w.stateNode!==null&&(w=w.stateNode,w.parentNode.removeChild(w)):W.count--,M===null?C$(j,f.type,f.stateNode):f$(j,M,f.memoizedProps)):M===null&&f.stateNode!==null&&vT(f,f.memoizedProps,w.memoizedProps)}break;case 27:ds(E,f),us(f),M&512&&(Oi||w===null||Id(w,w.return)),w!==null&&M&4&&vT(f,f.memoizedProps,w.memoizedProps);break;case 5:if(ds(E,f),us(f),M&512&&(Oi||w===null||Id(w,w.return)),f.flags&32){j=f.stateNode;try{wn(j,"")}catch(Dn){mr(f,f.return,Dn)}}M&4&&f.stateNode!=null&&(j=f.memoizedProps,vT(f,j,w!==null?w.memoizedProps:j)),M&1024&&(ST=!0);break;case 6:if(ds(E,f),us(f),M&4){if(f.stateNode===null)throw Error(a(162));M=f.memoizedProps,w=f.stateNode;try{w.nodeValue=M}catch(Dn){mr(f,f.return,Dn)}}break;case 3:if(OD=null,j=Il,Il=TD(E.containerInfo),ds(E,f),Il=j,us(f),M&4&&w!==null&&w.memoizedState.isDehydrated)try{NC(E.containerInfo)}catch(Dn){mr(f,f.return,Dn)}ST&&(ST=!1,CX(f));break;case 4:M=Il,Il=TD(f.stateNode.containerInfo),ds(E,f),us(f),Il=M;break;case 12:ds(E,f),us(f);break;case 31:ds(E,f),us(f),M&4&&(M=f.updateQueue,M!==null&&(f.updateQueue=null,yD(f,M)));break;case 13:ds(E,f),us(f),f.child.flags&8192&&f.memoizedState!==null!=(w!==null&&w.memoizedState!==null)&&(wD=Ge()),M&4&&(M=f.updateQueue,M!==null&&(f.updateQueue=null,yD(f,M)));break;case 22:j=f.memoizedState!==null;var Ve=w!==null&&w.memoizedState!==null,wt=Ku,Ot=Oi;if(Ku=wt||j,Oi=Ot||Ve,ds(E,f),Oi=Ot,Ku=wt,us(f),M&8192)e:for(E=f.stateNode,E._visibility=j?E._visibility&-2:E._visibility|1,j&&(w===null||Ve||Ku||Oi||Lh(f)),w=null,E=f;;){if(E.tag===5||E.tag===26){if(w===null){Ve=w=E;try{if(W=Ve.stateNode,j)ge=W.style,typeof ge.setProperty=="function"?ge.setProperty("display","none","important"):ge.display="none";else{xe=Ve.stateNode;var jt=Ve.memoizedProps.style,St=jt!=null&&jt.hasOwnProperty("display")?jt.display:null;xe.style.display=St==null||typeof St=="boolean"?"":(""+St).trim()}}catch(Dn){mr(Ve,Ve.return,Dn)}}}else if(E.tag===6){if(w===null){Ve=E;try{Ve.stateNode.nodeValue=j?"":Ve.memoizedProps}catch(Dn){mr(Ve,Ve.return,Dn)}}}else if(E.tag===18){if(w===null){Ve=E;try{var Nt=Ve.stateNode;j?s$(Nt,!0):s$(Ve.stateNode,!1)}catch(Dn){mr(Ve,Ve.return,Dn)}}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===f)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===f)break e;for(;E.sibling===null;){if(E.return===null||E.return===f)break e;w===E&&(w=null),E=E.return}w===E&&(w=null),E.sibling.return=E.return,E=E.sibling}M&4&&(M=f.updateQueue,M!==null&&(w=M.retryQueue,w!==null&&(M.retryQueue=null,yD(f,w))));break;case 19:ds(E,f),us(f),M&4&&(M=f.updateQueue,M!==null&&(f.updateQueue=null,yD(f,M)));break;case 30:break;case 21:break;default:ds(E,f),us(f)}}function us(f){var E=f.flags;if(E&2){try{for(var w,M=f.return;M!==null;){if(lX(M)){w=M;break}M=M.return}if(w==null)throw Error(a(160));switch(w.tag){case 27:var j=w.stateNode,W=DT(f);BD(f,W,j);break;case 5:var ge=w.stateNode;w.flags&32&&(wn(ge,""),w.flags&=-33);var xe=DT(f);BD(f,xe,ge);break;case 3:case 4:var Ve=w.stateNode.containerInfo,wt=DT(f);xT(f,wt,Ve);break;default:throw Error(a(161))}}catch(Ot){mr(f,f.return,Ot)}f.flags&=-3}E&4096&&(f.flags&=-4097)}function CX(f){if(f.subtreeFlags&1024)for(f=f.child;f!==null;){var E=f;CX(E),E.tag===5&&E.flags&1024&&E.stateNode.reset(),f=f.sibling}}function Yu(f,E){if(E.subtreeFlags&8772)for(E=E.child;E!==null;)gX(f,E.alternate,E),E=E.sibling}function Lh(f){for(f=f.child;f!==null;){var E=f;switch(E.tag){case 0:case 11:case 14:case 15:Ip(4,E,E.return),Lh(E);break;case 1:Id(E,E.return);var w=E.stateNode;typeof w.componentWillUnmount=="function"&&sX(E,E.return,w),Lh(E);break;case 27:Sy(E.stateNode);case 26:case 5:Id(E,E.return),Lh(E);break;case 22:E.memoizedState===null&&Lh(E);break;case 30:Lh(E);break;default:Lh(E)}f=f.sibling}}function qu(f,E,w){for(w=w&&(E.subtreeFlags&8772)!==0,E=E.child;E!==null;){var M=E.alternate,j=f,W=E,ge=W.flags;switch(W.tag){case 0:case 11:case 15:qu(j,W,w),Ey(4,W);break;case 1:if(qu(j,W,w),M=W,j=M.stateNode,typeof j.componentDidMount=="function")try{j.componentDidMount()}catch(wt){mr(M,M.return,wt)}if(M=W,j=M.updateQueue,j!==null){var xe=M.stateNode;try{var Ve=j.shared.hiddenCallbacks;if(Ve!==null)for(j.shared.hiddenCallbacks=null,j=0;j<Ve.length;j++)ZZ(Ve[j],xe)}catch(wt){mr(M,M.return,wt)}}w&&ge&64&&AX(W),Iy(W,W.return);break;case 27:dX(W);case 26:case 5:qu(j,W,w),w&&M===null&&ge&4&&cX(W),Iy(W,W.return);break;case 12:qu(j,W,w);break;case 31:qu(j,W,w),w&&ge&4&&hX(j,W);break;case 13:qu(j,W,w),w&&ge&4&&fX(j,W);break;case 22:W.memoizedState===null&&qu(j,W,w),Iy(W,W.return);break;case 30:break;default:qu(j,W,w)}E=E.sibling}}function _T(f,E){var w=null;f!==null&&f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(w=f.memoizedState.cachePool.pool),f=null,E.memoizedState!==null&&E.memoizedState.cachePool!==null&&(f=E.memoizedState.cachePool.pool),f!==w&&(f!=null&&f.refCount++,w!=null&&Ay(w))}function RT(f,E){f=null,E.alternate!==null&&(f=E.alternate.memoizedState.cache),E=E.memoizedState.cache,E!==f&&(E.refCount++,f!=null&&Ay(f))}function Bl(f,E,w,M){if(E.subtreeFlags&10256)for(E=E.child;E!==null;)EX(f,E,w,M),E=E.sibling}function EX(f,E,w,M){var j=E.flags;switch(E.tag){case 0:case 11:case 15:Bl(f,E,w,M),j&2048&&Ey(9,E);break;case 1:Bl(f,E,w,M);break;case 3:Bl(f,E,w,M),j&2048&&(f=null,E.alternate!==null&&(f=E.alternate.memoizedState.cache),E=E.memoizedState.cache,E!==f&&(E.refCount++,f!=null&&Ay(f)));break;case 12:if(j&2048){Bl(f,E,w,M),f=E.stateNode;try{var W=E.memoizedProps,ge=W.id,xe=W.onPostCommit;typeof xe=="function"&&xe(ge,E.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch(Ve){mr(E,E.return,Ve)}}else Bl(f,E,w,M);break;case 31:Bl(f,E,w,M);break;case 13:Bl(f,E,w,M);break;case 23:break;case 22:W=E.stateNode,ge=E.alternate,E.memoizedState!==null?W._visibility&2?Bl(f,E,w,M):By(f,E):W._visibility&2?Bl(f,E,w,M):(W._visibility|=2,BC(f,E,w,M,(E.subtreeFlags&10256)!==0||!1)),j&2048&&_T(ge,E);break;case 24:Bl(f,E,w,M),j&2048&&RT(E.alternate,E);break;default:Bl(f,E,w,M)}}function BC(f,E,w,M,j){for(j=j&&((E.subtreeFlags&10256)!==0||!1),E=E.child;E!==null;){var W=f,ge=E,xe=w,Ve=M,wt=ge.flags;switch(ge.tag){case 0:case 11:case 15:BC(W,ge,xe,Ve,j),Ey(8,ge);break;case 23:break;case 22:var Ot=ge.stateNode;ge.memoizedState!==null?Ot._visibility&2?BC(W,ge,xe,Ve,j):By(W,ge):(Ot._visibility|=2,BC(W,ge,xe,Ve,j)),j&&wt&2048&&_T(ge.alternate,ge);break;case 24:BC(W,ge,xe,Ve,j),j&&wt&2048&&RT(ge.alternate,ge);break;default:BC(W,ge,xe,Ve,j)}E=E.sibling}}function By(f,E){if(E.subtreeFlags&10256)for(E=E.child;E!==null;){var w=f,M=E,j=M.flags;switch(M.tag){case 22:By(w,M),j&2048&&_T(M.alternate,M);break;case 24:By(w,M),j&2048&&RT(M.alternate,M);break;default:By(w,M)}E=E.sibling}}var yy=8192;function yC(f,E,w){if(f.subtreeFlags&yy)for(f=f.child;f!==null;)IX(f,E,w),f=f.sibling}function IX(f,E,w){switch(f.tag){case 26:yC(f,E,w),f.flags&yy&&f.memoizedState!==null&&m4e(w,Il,f.memoizedState,f.memoizedProps);break;case 5:yC(f,E,w);break;case 3:case 4:var M=Il;Il=TD(f.stateNode.containerInfo),yC(f,E,w),Il=M;break;case 22:f.memoizedState===null&&(M=f.alternate,M!==null&&M.memoizedState!==null?(M=yy,yy=16777216,yC(f,E,w),yy=M):yC(f,E,w));break;default:yC(f,E,w)}}function BX(f){var E=f.alternate;if(E!==null&&(f=E.child,f!==null)){E.child=null;do E=f.sibling,f.sibling=null,f=E;while(f!==null)}}function Qy(f){var E=f.deletions;if((f.flags&16)!==0){if(E!==null)for(var w=0;w<E.length;w++){var M=E[w];ko=M,QX(M,f)}BX(f)}if(f.subtreeFlags&10256)for(f=f.child;f!==null;)yX(f),f=f.sibling}function yX(f){switch(f.tag){case 0:case 11:case 15:Qy(f),f.flags&2048&&Ip(9,f,f.return);break;case 3:Qy(f);break;case 12:Qy(f);break;case 22:var E=f.stateNode;f.memoizedState!==null&&E._visibility&2&&(f.return===null||f.return.tag!==13)?(E._visibility&=-3,QD(f)):Qy(f);break;default:Qy(f)}}function QD(f){var E=f.deletions;if((f.flags&16)!==0){if(E!==null)for(var w=0;w<E.length;w++){var M=E[w];ko=M,QX(M,f)}BX(f)}for(f=f.child;f!==null;){switch(E=f,E.tag){case 0:case 11:case 15:Ip(8,E,E.return),QD(E);break;case 22:w=E.stateNode,w._visibility&2&&(w._visibility&=-3,QD(E));break;default:QD(E)}f=f.sibling}}function QX(f,E){for(;ko!==null;){var w=ko;switch(w.tag){case 0:case 11:case 15:Ip(8,w,E);break;case 23:case 22:if(w.memoizedState!==null&&w.memoizedState.cachePool!==null){var M=w.memoizedState.cachePool.pool;M!=null&&M.refCount++}break;case 24:Ay(w.memoizedState.cache)}if(M=w.child,M!==null)M.return=w,ko=M;else e:for(w=f;ko!==null;){M=ko;var j=M.sibling,W=M.return;if(pX(M),M===w){ko=null;break e}if(j!==null){j.return=W,ko=j;break e}ko=W}}}var SGe={getCacheForType:function(f){var E=Uo(Li),w=E.data.get(f);return w===void 0&&(w=f(),E.data.set(f,w)),w},cacheSignal:function(){return Uo(Li).controller.signal}},_Ge=typeof WeakMap=="function"?WeakMap:Map,nr=0,xr=null,_a=null,Ma=0,pr=0,js=null,Bp=!1,QC=!1,NT=!1,ju=0,mi=0,yp=0,Th=0,MT=0,zs=0,wC=0,wy=null,gs=null,FT=!1,wD=0,wX=0,kD=1/0,vD=null,Qp=null,no=0,wp=null,kC=null,zu=0,LT=0,TT=null,kX=null,ky=0,GT=null;function Js(){return(nr&2)!==0&&Ma!==0?Ma&-Ma:F.T!==null?YT():Kt()}function vX(){if(zs===0)if((Ma&536870912)===0||Ca){var f=We;We<<=1,(We&3932160)===0&&(We=262144),zs=f}else zs=536870912;return f=Ys.current,f!==null&&(f.flags|=32),zs}function ps(f,E,w){(f===xr&&(pr===2||pr===9)||f.cancelPendingCommit!==null)&&(vC(f,0),kp(f,Ma,zs,!1)),ft(f,w),((nr&2)===0||f!==xr)&&(f===xr&&((nr&2)===0&&(Th|=w),mi===4&&kp(f,Ma,zs,!1)),Bd(f))}function DX(f,E,w){if((nr&6)!==0)throw Error(a(327));var M=!w&&(E&127)===0&&(E&f.expiredLanes)===0||Pe(f,E),j=M?MGe(f,E):UT(f,E,!0),W=M;do{if(j===0){QC&&!M&&kp(f,E,0,!1);break}else{if(w=f.current.alternate,W&&!RGe(w)){j=UT(f,E,!1),W=!1;continue}if(j===2){if(W=E,f.errorRecoveryDisabledLanes&W)var ge=0;else ge=f.pendingLanes&-536870913,ge=ge!==0?ge:ge&536870912?536870912:0;if(ge!==0){E=ge;e:{var xe=f;j=wy;var Ve=xe.current.memoizedState.isDehydrated;if(Ve&&(vC(xe,ge).flags|=256),ge=UT(xe,ge,!1),ge!==2){if(NT&&!Ve){xe.errorRecoveryDisabledLanes|=W,Th|=W,j=4;break e}W=gs,gs=j,W!==null&&(gs===null?gs=W:gs.push.apply(gs,W))}j=ge}if(W=!1,j!==2)continue}}if(j===1){vC(f,0),kp(f,E,0,!0);break}e:{switch(M=f,W=j,W){case 0:case 1:throw Error(a(345));case 4:if((E&4194048)!==E)break;case 6:kp(M,E,zs,!Bp);break e;case 2:gs=null;break;case 3:case 5:break;default:throw Error(a(329))}if((E&62914560)===E&&(j=wD+300-Ge(),10<j)){if(kp(M,E,zs,!Bp),Ie(M,0,!0)!==0)break e;zu=E,M.timeoutHandle=i$(xX.bind(null,M,w,gs,vD,FT,E,zs,Th,wC,Bp,W,"Throttled",-0,0),j);break e}xX(M,w,gs,vD,FT,E,zs,Th,wC,Bp,W,null,-0,0)}}break}while(!0);Bd(f)}function xX(f,E,w,M,j,W,ge,xe,Ve,wt,Ot,jt,St,Nt){if(f.timeoutHandle=-1,jt=E.subtreeFlags,jt&8192||(jt&16785408)===16785408){jt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},IX(E,W,jt);var Dn=(W&62914560)===W?wD-Ge():(W&4194048)===W?wX-Ge():0;if(Dn=h4e(jt,Dn),Dn!==null){zu=W,f.cancelPendingCommit=Dn(TX.bind(null,f,E,W,w,M,j,ge,xe,Ve,Ot,jt,null,St,Nt)),kp(f,W,ge,!wt);return}}TX(f,E,W,w,M,j,ge,xe,Ve)}function RGe(f){for(var E=f;;){var w=E.tag;if((w===0||w===11||w===15)&&E.flags&16384&&(w=E.updateQueue,w!==null&&(w=w.stores,w!==null)))for(var M=0;M<w.length;M++){var j=w[M],W=j.getSnapshot;j=j.value;try{if(!oA(W(),j))return!1}catch{return!1}}if(w=E.child,E.subtreeFlags&16384&&w!==null)w.return=E,E=w;else{if(E===f)break;for(;E.sibling===null;){if(E.return===null||E.return===f)return!0;E=E.return}E.sibling.return=E.return,E=E.sibling}}return!0}function kp(f,E,w,M){E&=~MT,E&=~Th,f.suspendedLanes|=E,f.pingedLanes&=~E,M&&(f.warmLanes|=E),M=f.expirationTimes;for(var j=E;0<j;){var W=31-Ne(j),ge=1<<W;M[W]=-1,j&=~ge}w!==0&<(f,w,E)}function DD(){return(nr&6)===0?(vy(0),!1):!0}function OT(){if(_a!==null){if(pr===0)var f=_a.return;else f=_a,Lu=Dh=null,tT(f),fC=null,cy=0,f=_a;for(;f!==null;)oX(f.alternate,f),f=f.return;_a=null}}function vC(f,E){var w=f.timeoutHandle;w!==-1&&(f.timeoutHandle=-1,XGe(w)),w=f.cancelPendingCommit,w!==null&&(f.cancelPendingCommit=null,w()),zu=0,OT(),xr=f,_a=w=El(f.current,null),Ma=E,pr=0,js=null,Bp=!1,QC=Pe(f,E),NT=!1,wC=zs=MT=Th=yp=mi=0,gs=wy=null,FT=!1,(E&8)!==0&&(E|=E&32);var M=f.entangledLanes;if(M!==0)for(f=f.entanglements,M&=E;0<M;){var j=31-Ne(M),W=1<<j;E|=f[j],M&=~W}return ju=E,cC(),w}function SX(f,E){Ba=null,F.H=fy,E===hC||E===aD?(E=jZ(),pr=3):E===HL?(E=jZ(),pr=4):pr=E===fT?8:E!==null&&typeof E=="object"&&typeof E.then=="function"?6:1,js=E,_a===null&&(mi=1,fD(f,cs(E,f.current)))}function _X(){var f=Ys.current;return f===null?!0:(Ma&4194048)===Ma?Rc===null:(Ma&62914560)===Ma||(Ma&536870912)!==0?f===Rc:!1}function RX(){var f=F.H;return F.H=fy,f===null?fy:f}function NX(){var f=F.A;return F.A=SGe,f}function xD(){mi=4,Bp||(Ma&4194048)!==Ma&&Ys.current!==null||(QC=!0),(yp&134217727)===0&&(Th&134217727)===0||xr===null||kp(xr,Ma,zs,!1)}function UT(f,E,w){var M=nr;nr|=2;var j=RX(),W=NX();(xr!==f||Ma!==E)&&(vD=null,vC(f,E)),E=!1;var ge=mi;e:do try{if(pr!==0&&_a!==null){var xe=_a,Ve=js;switch(pr){case 8:OT(),ge=6;break e;case 3:case 2:case 9:case 6:Ys.current===null&&(E=!0);var wt=pr;if(pr=0,js=null,DC(f,xe,Ve,wt),w&&QC){ge=0;break e}break;default:wt=pr,pr=0,js=null,DC(f,xe,Ve,wt)}}NGe(),ge=mi;break}catch(Ot){SX(f,Ot)}while(!0);return E&&f.shellSuspendCounter++,Lu=Dh=null,nr=M,F.H=j,F.A=W,_a===null&&(xr=null,Ma=0,cC()),ge}function NGe(){for(;_a!==null;)MX(_a)}function MGe(f,E){var w=nr;nr|=2;var M=RX(),j=NX();xr!==f||Ma!==E?(vD=null,kD=Ge()+500,vC(f,E)):QC=Pe(f,E);e:do try{if(pr!==0&&_a!==null){E=_a;var W=js;t:switch(pr){case 1:pr=0,js=null,DC(f,E,W,1);break;case 2:case 9:if(YZ(W)){pr=0,js=null,FX(E);break}E=function(){pr!==2&&pr!==9||xr!==f||(pr=7),Bd(f)},W.then(E,E);break e;case 3:pr=7;break e;case 4:pr=5;break e;case 7:YZ(W)?(pr=0,js=null,FX(E)):(pr=0,js=null,DC(f,E,W,7));break;case 5:var ge=null;switch(_a.tag){case 26:ge=_a.memoizedState;case 5:case 27:var xe=_a;if(ge?E$(ge):xe.stateNode.complete){pr=0,js=null;var Ve=xe.sibling;if(Ve!==null)_a=Ve;else{var wt=xe.return;wt!==null?(_a=wt,SD(wt)):_a=null}break t}}pr=0,js=null,DC(f,E,W,5);break;case 6:pr=0,js=null,DC(f,E,W,6);break;case 8:OT(),mi=6;break e;default:throw Error(a(462))}}FGe();break}catch(Ot){SX(f,Ot)}while(!0);return Lu=Dh=null,F.H=M,F.A=j,nr=w,_a!==null?0:(xr=null,Ma=0,cC(),mi)}function FGe(){for(;_a!==null&&!tt();)MX(_a)}function MX(f){var E=rX(f.alternate,f,ju);f.memoizedProps=f.pendingProps,E===null?SD(f):_a=E}function FX(f){var E=f,w=E.alternate;switch(E.tag){case 15:case 0:E=XV(w,E,E.pendingProps,E.type,void 0,Ma);break;case 11:E=XV(w,E,E.pendingProps,E.type.render,E.ref,Ma);break;case 5:tT(E);default:oX(w,E),E=_a=Vv(E,ju),E=rX(w,E,ju)}f.memoizedProps=f.pendingProps,E===null?SD(f):_a=E}function DC(f,E,w,M){Lu=Dh=null,tT(E),fC=null,cy=0;var j=E.return;try{if(yGe(f,j,E,w,Ma)){mi=1,fD(f,cs(w,f.current)),_a=null;return}}catch(W){if(j!==null)throw _a=j,W;mi=1,fD(f,cs(w,f.current)),_a=null;return}E.flags&32768?(Ca||M===1?f=!0:QC||(Ma&536870912)!==0?f=!1:(Bp=f=!0,(M===2||M===9||M===3||M===6)&&(M=Ys.current,M!==null&&M.tag===13&&(M.flags|=16384))),LX(E,f)):SD(E)}function SD(f){var E=f;do{if((E.flags&32768)!==0){LX(E,Bp);return}f=E.return;var w=kGe(E.alternate,E,ju);if(w!==null){_a=w;return}if(E=E.sibling,E!==null){_a=E;return}_a=E=f}while(E!==null);mi===0&&(mi=5)}function LX(f,E){do{var w=vGe(f.alternate,f);if(w!==null){w.flags&=32767,_a=w;return}if(w=f.return,w!==null&&(w.flags|=32768,w.subtreeFlags=0,w.deletions=null),!E&&(f=f.sibling,f!==null)){_a=f;return}_a=f=w}while(f!==null);mi=6,_a=null}function TX(f,E,w,M,j,W,ge,xe,Ve){f.cancelPendingCommit=null;do _D();while(no!==0);if((nr&6)!==0)throw Error(a(327));if(E!==null){if(E===f.current)throw Error(a(177));if(W=E.lanes|E.childLanes,W|=ty,ie(f,w,W,ge,xe,Ve),f===xr&&(_a=xr=null,Ma=0),kC=E,wp=f,zu=w,LT=W,TT=j,kX=M,(E.subtreeFlags&10256)!==0||(E.flags&10256)!==0?(f.callbackNode=null,f.callbackPriority=0,OGe(ut,function(){return KX(),null})):(f.callbackNode=null,f.callbackPriority=0),M=(E.flags&13878)!==0,(E.subtreeFlags&13878)!==0||M){M=F.T,F.T=null,j=T.p,T.p=2,ge=nr,nr|=4;try{DGe(f,E,w)}finally{nr=ge,T.p=j,F.T=M}}no=1,GX(),OX(),UX()}}function GX(){if(no===1){no=0;var f=wp,E=kC,w=(E.flags&13878)!==0;if((E.subtreeFlags&13878)!==0||w){w=F.T,F.T=null;var M=T.p;T.p=2;var j=nr;nr|=4;try{bX(E,f);var W=XT,ge=jB(f.containerInfo),xe=W.focusedElem,Ve=W.selectionRange;if(ge!==xe&&xe&&xe.ownerDocument&&hd(xe.ownerDocument.documentElement,xe)){if(Ve!==null&&iC(xe)){var wt=Ve.start,Ot=Ve.end;if(Ot===void 0&&(Ot=wt),"selectionStart"in xe)xe.selectionStart=wt,xe.selectionEnd=Math.min(Ot,xe.value.length);else{var jt=xe.ownerDocument||document,St=jt&&jt.defaultView||window;if(St.getSelection){var Nt=St.getSelection(),Dn=xe.textContent.length,Xn=Math.min(Ve.start,Dn),yr=Ve.end===void 0?Xn:Math.min(Ve.end,Dn);!Nt.extend&&Xn>yr&&(ge=yr,yr=Xn,Xn=ge);var mt=cp(xe,Xn),st=cp(xe,yr);if(mt&&st&&(Nt.rangeCount!==1||Nt.anchorNode!==mt.node||Nt.anchorOffset!==mt.offset||Nt.focusNode!==st.node||Nt.focusOffset!==st.offset)){var yt=jt.createRange();yt.setStart(mt.node,mt.offset),Nt.removeAllRanges(),Xn>yr?(Nt.addRange(yt),Nt.extend(st.node,st.offset)):(yt.setEnd(st.node,st.offset),Nt.addRange(yt))}}}}for(jt=[],Nt=xe;Nt=Nt.parentNode;)Nt.nodeType===1&&jt.push({element:Nt,left:Nt.scrollLeft,top:Nt.scrollTop});for(typeof xe.focus=="function"&&xe.focus(),xe=0;xe<jt.length;xe++){var Ht=jt[xe];Ht.element.scrollLeft=Ht.left,Ht.element.scrollTop=Ht.top}}HD=!!VT,XT=VT=null}finally{nr=j,T.p=M,F.T=w}}f.current=E,no=2}}function OX(){if(no===2){no=0;var f=wp,E=kC,w=(E.flags&8772)!==0;if((E.subtreeFlags&8772)!==0||w){w=F.T,F.T=null;var M=T.p;T.p=2;var j=nr;nr|=4;try{gX(f,E.alternate,E)}finally{nr=j,T.p=M,F.T=w}}no=3}}function UX(){if(no===4||no===3){no=0,gt();var f=wp,E=kC,w=zu,M=kX;(E.subtreeFlags&10256)!==0||(E.flags&10256)!==0?no=5:(no=0,kC=wp=null,PX(f,f.pendingLanes));var j=f.pendingLanes;if(j===0&&(Qp=null),Tt(w),E=E.stateNode,we&&typeof we.onCommitFiberRoot=="function")try{we.onCommitFiberRoot(X,E,void 0,(E.current.flags&128)===128)}catch{}if(M!==null){E=F.T,j=T.p,T.p=2,F.T=null;try{for(var W=f.onRecoverableError,ge=0;ge<M.length;ge++){var xe=M[ge];W(xe.value,{componentStack:xe.stack})}}finally{F.T=E,T.p=j}}(zu&3)!==0&&_D(),Bd(f),j=f.pendingLanes,(w&261930)!==0&&(j&42)!==0?f===GT?ky++:(ky=0,GT=f):ky=0,vy(0)}}function PX(f,E){(f.pooledCacheLanes&=E)===0&&(E=f.pooledCache,E!=null&&(f.pooledCache=null,Ay(E)))}function _D(){return GX(),OX(),UX(),KX()}function KX(){if(no!==5)return!1;var f=wp,E=LT;LT=0;var w=Tt(zu),M=F.T,j=T.p;try{T.p=32>w?32:w,F.T=null,w=TT,TT=null;var W=wp,ge=zu;if(no=0,kC=wp=null,zu=0,(nr&6)!==0)throw Error(a(331));var xe=nr;if(nr|=4,yX(W.current),EX(W,W.current,ge,w),nr=xe,vy(0,!1),we&&typeof we.onPostCommitFiberRoot=="function")try{we.onPostCommitFiberRoot(X,W)}catch{}return!0}finally{T.p=j,F.T=M,PX(f,E)}}function HX(f,E,w){E=cs(w,E),E=hT(f.stateNode,E,2),f=bp(f,E,2),f!==null&&(ft(f,2),Bd(f))}function mr(f,E,w){if(f.tag===3)HX(f,f,w);else for(;E!==null;){if(E.tag===3){HX(E,f,w);break}else if(E.tag===1){var M=E.stateNode;if(typeof E.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Qp===null||!Qp.has(M))){f=cs(w,f),w=YV(2),M=bp(E,w,2),M!==null&&(qV(w,M,E,f),ft(M,2),Bd(M));break}}E=E.return}}function PT(f,E,w){var M=f.pingCache;if(M===null){M=f.pingCache=new _Ge;var j=new Set;M.set(E,j)}else j=M.get(E),j===void 0&&(j=new Set,M.set(E,j));j.has(w)||(NT=!0,j.add(w),f=LGe.bind(null,f,E,w),E.then(f,f))}function LGe(f,E,w){var M=f.pingCache;M!==null&&M.delete(E),f.pingedLanes|=f.suspendedLanes&w,f.warmLanes&=~w,xr===f&&(Ma&w)===w&&(mi===4||mi===3&&(Ma&62914560)===Ma&&300>Ge()-wD?(nr&2)===0&&vC(f,0):MT|=w,wC===Ma&&(wC=0)),Bd(f)}function YX(f,E){E===0&&(E=at()),f=Cd(f,E),f!==null&&(ft(f,E),Bd(f))}function TGe(f){var E=f.memoizedState,w=0;E!==null&&(w=E.retryLane),YX(f,w)}function GGe(f,E){var w=0;switch(f.tag){case 31:case 13:var M=f.stateNode,j=f.memoizedState;j!==null&&(w=j.retryLane);break;case 19:M=f.stateNode;break;case 22:M=f.stateNode._retryCache;break;default:throw Error(a(314))}M!==null&&M.delete(E),YX(f,w)}function OGe(f,E){return ke(f,E)}var RD=null,xC=null,KT=!1,ND=!1,HT=!1,vp=0;function Bd(f){f!==xC&&f.next===null&&(xC===null?RD=xC=f:xC=xC.next=f),ND=!0,KT||(KT=!0,PGe())}function vy(f,E){if(!HT&&ND){HT=!0;do for(var w=!1,M=RD;M!==null;){if(f!==0){var j=M.pendingLanes;if(j===0)var W=0;else{var ge=M.suspendedLanes,xe=M.pingedLanes;W=(1<<31-Ne(42|f)+1)-1,W&=j&~(ge&~xe),W=W&201326741?W&201326741|1:W?W|2:0}W!==0&&(w=!0,JX(M,W))}else W=Ma,W=Ie(M,M===xr?W:0,M.cancelPendingCommit!==null||M.timeoutHandle!==-1),(W&3)===0||Pe(M,W)||(w=!0,JX(M,W));M=M.next}while(w);HT=!1}}function UGe(){qX()}function qX(){ND=KT=!1;var f=0;vp!==0&&VGe()&&(f=vp);for(var E=Ge(),w=null,M=RD;M!==null;){var j=M.next,W=jX(M,E);W===0?(M.next=null,w===null?RD=j:w.next=j,j===null&&(xC=w)):(w=M,(f!==0||(W&3)!==0)&&(ND=!0)),M=j}no!==0&&no!==5||vy(f),vp!==0&&(vp=0)}function jX(f,E){for(var w=f.suspendedLanes,M=f.pingedLanes,j=f.expirationTimes,W=f.pendingLanes&-62914561;0<W;){var ge=31-Ne(W),xe=1<<ge,Ve=j[ge];Ve===-1?((xe&w)===0||(xe&M)!==0)&&(j[ge]=Oe(xe,E)):Ve<=E&&(f.expiredLanes|=xe),W&=~xe}if(E=xr,w=Ma,w=Ie(f,f===E?w:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),M=f.callbackNode,w===0||f===E&&(pr===2||pr===9)||f.cancelPendingCommit!==null)return M!==null&&M!==null&&rt(M),f.callbackNode=null,f.callbackPriority=0;if((w&3)===0||Pe(f,w)){if(E=w&-w,E===f.callbackPriority)return E;switch(M!==null&&rt(M),Tt(w)){case 2:case 8:w=ze;break;case 32:w=ut;break;case 268435456:w=Ze;break;default:w=ut}return M=zX.bind(null,f),w=ke(w,M),f.callbackPriority=E,f.callbackNode=w,E}return M!==null&&M!==null&&rt(M),f.callbackPriority=2,f.callbackNode=null,2}function zX(f,E){if(no!==0&&no!==5)return f.callbackNode=null,f.callbackPriority=0,null;var w=f.callbackNode;if(_D()&&f.callbackNode!==w)return null;var M=Ma;return M=Ie(f,f===xr?M:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),M===0?null:(DX(f,M,E),jX(f,Ge()),f.callbackNode!=null&&f.callbackNode===w?zX.bind(null,f):null)}function JX(f,E){if(_D())return null;DX(f,E,!0)}function PGe(){$Ge(function(){(nr&6)!==0?ke(He,UGe):qX()})}function YT(){if(vp===0){var f=pC;f===0&&(f=_e,_e<<=1,(_e&261888)===0&&(_e=256)),vp=f}return vp}function WX(f){return f==null||typeof f=="symbol"||typeof f=="boolean"?null:typeof f=="function"?f:Mi(""+f)}function ZX(f,E){var w=E.ownerDocument.createElement("input");return w.name=E.name,w.value=E.value,f.id&&w.setAttribute("form",f.id),E.parentNode.insertBefore(w,E),f=new FormData(f),w.parentNode.removeChild(w),f}function KGe(f,E,w,M,j){if(E==="submit"&&w&&w.stateNode===j){var W=WX((j[Wt]||null).action),ge=M.submitter;ge&&(E=(E=ge[Wt]||null)?WX(E.formAction):ge.getAttribute("formAction"),E!==null&&(W=E,ge=null));var xe=new kc("action","action",null,M,j);f.push({event:xe,listeners:[{instance:null,listener:function(){if(M.defaultPrevented){if(vp!==0){var Ve=ge?ZX(j,ge):new FormData(j);lT(w,{pending:!0,data:Ve,method:j.method,action:W},null,Ve)}}else typeof W=="function"&&(xe.preventDefault(),Ve=ge?ZX(j,ge):new FormData(j),lT(w,{pending:!0,data:Ve,method:j.method,action:W},W,Ve))},currentTarget:j}]})}}for(var qT=0;qT<ey.length;qT++){var jT=ey[qT],HGe=jT.toLowerCase(),YGe=jT[0].toUpperCase()+jT.slice(1);AA(HGe,"on"+YGe)}AA(WB,"onAnimationEnd"),AA(ZB,"onAnimationIteration"),AA(VB,"onAnimationStart"),AA("dblclick","onDoubleClick"),AA("focusin","onFocus"),AA("focusout","onBlur"),AA(bd,"onTransitionRun"),AA(XB,"onTransitionStart"),AA($B,"onTransitionCancel"),AA(Zv,"onTransitionEnd"),Ut("onMouseEnter",["mouseout","mouseover"]),Ut("onMouseLeave",["mouseout","mouseover"]),Ut("onPointerEnter",["pointerout","pointerover"]),Ut("onPointerLeave",["pointerout","pointerover"]),ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dy="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(" "),qGe=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dy));function VX(f,E){E=(E&4)!==0;for(var w=0;w<f.length;w++){var M=f[w],j=M.event;M=M.listeners;e:{var W=void 0;if(E)for(var ge=M.length-1;0<=ge;ge--){var xe=M[ge],Ve=xe.instance,wt=xe.currentTarget;if(xe=xe.listener,Ve!==W&&j.isPropagationStopped())break e;W=xe,j.currentTarget=wt;try{W(j)}catch(Ot){sC(Ot)}j.currentTarget=null,W=Ve}else for(ge=0;ge<M.length;ge++){if(xe=M[ge],Ve=xe.instance,wt=xe.currentTarget,xe=xe.listener,Ve!==W&&j.isPropagationStopped())break e;W=xe,j.currentTarget=wt;try{W(j)}catch(Ot){sC(Ot)}j.currentTarget=null,W=Ve}}}}function Ra(f,E){var w=E[Qn];w===void 0&&(w=E[Qn]=new Set);var M=f+"__bubble";w.has(M)||(XX(E,f,2,!1),w.add(M))}function zT(f,E,w){var M=0;E&&(M|=4),XX(w,f,M,E)}var MD="_reactListening"+Math.random().toString(36).slice(2);function JT(f){if(!f[MD]){f[MD]=!0,zn.forEach(function(w){w!=="selectionchange"&&(qGe.has(w)||zT(w,!1,f),zT(w,!0,f))});var E=f.nodeType===9?f:f.ownerDocument;E===null||E[MD]||(E[MD]=!0,zT("selectionchange",!1,E))}}function XX(f,E,w,M){switch(v$(E)){case 2:var j=C4e;break;case 8:j=E4e;break;default:j=c3}w=j.bind(null,E,w,f),j=void 0,!ta||E!=="touchstart"&&E!=="touchmove"&&E!=="wheel"||(j=!0),M?j!==void 0?f.addEventListener(E,w,{capture:!0,passive:j}):f.addEventListener(E,w,!0):j!==void 0?f.addEventListener(E,w,{passive:j}):f.addEventListener(E,w,!1)}function WT(f,E,w,M,j){var W=M;if((E&1)===0&&(E&2)===0&&M!==null)e:for(;;){if(M===null)return;var ge=M.tag;if(ge===3||ge===4){var xe=M.stateNode.containerInfo;if(xe===j)break;if(ge===4)for(ge=M.return;ge!==null;){var Ve=ge.tag;if((Ve===3||Ve===4)&&ge.stateNode.containerInfo===j)return;ge=ge.return}for(;xe!==null;){if(ge=$e(xe),ge===null)return;if(Ve=ge.tag,Ve===5||Ve===6||Ve===26||Ve===27){M=W=ge;continue e}xe=xe.parentNode}}M=M.return}ct(function(){var wt=W,Ot=ee(w),jt=[];e:{var St=wh.get(f);if(St!==void 0){var Nt=kc,Dn=f;switch(f){case"keypress":if(Cr(w)===0)break e;case"keydown":case"keyup":Nt=Su;break;case"focusin":Dn="focus",Nt=LB;break;case"focusout":Dn="blur",Nt=LB;break;case"beforeblur":case"afterblur":Nt=LB;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Nt=Ov;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Nt=CL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Nt=Yv;break;case WB:case ZB:case VB:Nt=Uv;break;case Zv:Nt=wL;break;case"scroll":case"scrollend":Nt=vc;break;case"wheel":Nt=kL;break;case"copy":case"cut":case"paste":Nt=IL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Nt=Hv;break;case"toggle":case"beforetoggle":Nt=jv}var Xn=(E&4)!==0,yr=!Xn&&(f==="scroll"||f==="scrollend"),mt=Xn?St!==null?St+"Capture":null:St;Xn=[];for(var st=wt,yt;st!==null;){var Ht=st;if(yt=Ht.stateNode,Ht=Ht.tag,Ht!==5&&Ht!==26&&Ht!==27||yt===null||mt===null||(Ht=Bt(st,mt),Ht!=null&&Xn.push(xy(st,Ht,yt))),yr)break;st=st.return}0<Xn.length&&(St=new Nt(St,Dn,null,w,Ot),jt.push({event:St,listeners:Xn}))}}if((E&7)===0){e:{if(St=f==="mouseover"||f==="pointerover",Nt=f==="mouseout"||f==="pointerout",St&&w!==J&&(Dn=w.relatedTarget||w.fromElement)&&($e(Dn)||Dn[vn]))break e;if((Nt||St)&&(St=Ot.window===Ot?Ot:(St=Ot.ownerDocument)?St.defaultView||St.parentWindow:window,Nt?(Dn=w.relatedTarget||w.toElement,Nt=wt,Dn=Dn?$e(Dn):null,Dn!==null&&(yr=i(Dn),Xn=Dn.tag,Dn!==yr||Xn!==5&&Xn!==27&&Xn!==6)&&(Dn=null)):(Nt=null,Dn=wt),Nt!==Dn)){if(Xn=Ov,Ht="onMouseLeave",mt="onMouseEnter",st="mouse",(f==="pointerout"||f==="pointerover")&&(Xn=Hv,Ht="onPointerLeave",mt="onPointerEnter",st="pointer"),yr=Nt==null?St:hn(Nt),yt=Dn==null?St:hn(Dn),St=new Xn(Ht,st+"leave",Nt,w,Ot),St.target=yr,St.relatedTarget=yt,Ht=null,$e(Ot)===wt&&(Xn=new Xn(mt,st+"enter",Dn,w,Ot),Xn.target=yt,Xn.relatedTarget=yr,Ht=Xn),yr=Ht,Nt&&Dn)t:{for(Xn=jGe,mt=Nt,st=Dn,yt=0,Ht=mt;Ht;Ht=Xn(Ht))yt++;Ht=0;for(var Kn=st;Kn;Kn=Xn(Kn))Ht++;for(;0<yt-Ht;)mt=Xn(mt),yt--;for(;0<Ht-yt;)st=Xn(st),Ht--;for(;yt--;){if(mt===st||st!==null&&mt===st.alternate){Xn=mt;break t}mt=Xn(mt),st=Xn(st)}Xn=null}else Xn=null;Nt!==null&&$X(jt,St,Nt,Xn,!1),Dn!==null&&yr!==null&&$X(jt,yr,Dn,Xn,!0)}}e:{if(St=wt?hn(wt):window,Nt=St.nodeName&&St.nodeName.toLowerCase(),Nt==="select"||Nt==="input"&&St.type==="file")var Ja=Ih;else if(nC(St))if(Bh)Ja=NL;else{Ja=_L;var Mn=qB}else Nt=St.nodeName,!Nt||Nt.toLowerCase()!=="input"||St.type!=="checkbox"&&St.type!=="radio"?wt&&Ua(wt.elementType)&&(Ja=Ih):Ja=RL;if(Ja&&(Ja=Ja(f,wt))){aC(jt,Ja,w,Ot);break e}Mn&&Mn(f,St,wt),f==="focusout"&&wt&&St.type==="number"&&wt.memoizedProps.value!=null&&As(St,"number",St.value)}switch(Mn=wt?hn(wt):window,f){case"focusin":(nC(Mn)||Mn.contentEditable==="true")&&(DA=Mn,AC=wt,Ru=null);break;case"focusout":Ru=AC=DA=null;break;case"mousedown":zB=!0;break;case"contextmenu":case"mouseup":case"dragend":zB=!1,Qh(jt,w,Ot);break;case"selectionchange":if(oC)break;case"keydown":case"keyup":Qh(jt,w,Ot)}var ya;if(GB)e:{switch(f){case"compositionstart":var Fa="onCompositionStart";break e;case"compositionend":Fa="onCompositionEnd";break e;case"compositionupdate":Fa="onCompositionUpdate";break e}Fa=void 0}else bl?tC(f,w)&&(Fa="onCompositionEnd"):f==="keydown"&&w.keyCode===229&&(Fa="onCompositionStart");Fa&&(zv&&w.locale!=="ko"&&(bl||Fa!=="onCompositionStart"?Fa==="onCompositionEnd"&&bl&&(ya=qn()):(sa=Ot,na="value"in sa?sa.value:sa.textContent,bl=!0)),Mn=FD(wt,Fa),0<Mn.length&&(Fa=new Dc(Fa,f,null,w,Ot),jt.push({event:Fa,listeners:Mn}),ya?Fa.data=ya:(ya=Ch(w),ya!==null&&(Fa.data=ya)))),(ya=$b?DL(f,w):xL(f,w))&&(Fa=FD(wt,"onBeforeInput"),0<Fa.length&&(Mn=new Dc("onBeforeInput","beforeinput",null,w,Ot),jt.push({event:Mn,listeners:Fa}),Mn.data=ya)),KGe(jt,f,wt,w,Ot)}VX(jt,E)})}function xy(f,E,w){return{instance:f,listener:E,currentTarget:w}}function FD(f,E){for(var w=E+"Capture",M=[];f!==null;){var j=f,W=j.stateNode;if(j=j.tag,j!==5&&j!==26&&j!==27||W===null||(j=Bt(f,w),j!=null&&M.unshift(xy(f,j,W)),j=Bt(f,E),j!=null&&M.push(xy(f,j,W))),f.tag===3)return M;f=f.return}return[]}function jGe(f){if(f===null)return null;do f=f.return;while(f&&f.tag!==5&&f.tag!==27);return f||null}function $X(f,E,w,M,j){for(var W=E._reactName,ge=[];w!==null&&w!==M;){var xe=w,Ve=xe.alternate,wt=xe.stateNode;if(xe=xe.tag,Ve!==null&&Ve===M)break;xe!==5&&xe!==26&&xe!==27||wt===null||(Ve=wt,j?(wt=Bt(w,W),wt!=null&&ge.unshift(xy(w,wt,Ve))):j||(wt=Bt(w,W),wt!=null&&ge.push(xy(w,wt,Ve)))),w=w.return}ge.length!==0&&f.push({event:E,listeners:ge})}var zGe=/\r\n?/g,JGe=/\u0000|\uFFFD/g;function e$(f){return(typeof f=="string"?f:""+f).replace(zGe,`
|
|
62
|
-
`).replace(JGe,"")}function t$(f,E){return E=e$(E),e$(f)===E}function Br(f,E,w,M,j,W){switch(w){case"children":typeof M=="string"?E==="body"||E==="textarea"&&M===""||wn(f,M):(typeof M=="number"||typeof M=="bigint")&&E!=="body"&&wn(f,""+M);break;case"className":Le(f,"class",M);break;case"tabIndex":Le(f,"tabindex",M);break;case"dir":case"role":case"viewBox":case"width":case"height":Le(f,w,M);break;case"style":pa(f,M,W);break;case"data":if(E!=="object"){Le(f,"data",M);break}case"src":case"href":if(M===""&&(E!=="a"||w!=="href")){f.removeAttribute(w);break}if(M==null||typeof M=="function"||typeof M=="symbol"||typeof M=="boolean"){f.removeAttribute(w);break}M=Mi(""+M),f.setAttribute(w,M);break;case"action":case"formAction":if(typeof M=="function"){f.setAttribute(w,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof W=="function"&&(w==="formAction"?(E!=="input"&&Br(f,E,"name",j.name,j,null),Br(f,E,"formEncType",j.formEncType,j,null),Br(f,E,"formMethod",j.formMethod,j,null),Br(f,E,"formTarget",j.formTarget,j,null)):(Br(f,E,"encType",j.encType,j,null),Br(f,E,"method",j.method,j,null),Br(f,E,"target",j.target,j,null)));if(M==null||typeof M=="symbol"||typeof M=="boolean"){f.removeAttribute(w);break}M=Mi(""+M),f.setAttribute(w,M);break;case"onClick":M!=null&&(f.onclick=Xt);break;case"onScroll":M!=null&&Ra("scroll",f);break;case"onScrollEnd":M!=null&&Ra("scrollend",f);break;case"dangerouslySetInnerHTML":if(M!=null){if(typeof M!="object"||!("__html"in M))throw Error(a(61));if(w=M.__html,w!=null){if(j.children!=null)throw Error(a(60));f.innerHTML=w}}break;case"multiple":f.multiple=M&&typeof M!="function"&&typeof M!="symbol";break;case"muted":f.muted=M&&typeof M!="function"&&typeof M!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(M==null||typeof M=="function"||typeof M=="boolean"||typeof M=="symbol"){f.removeAttribute("xlink:href");break}w=Mi(""+M),f.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":M!=null&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,""+M):f.removeAttribute(w);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":M&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,""):f.removeAttribute(w);break;case"capture":case"download":M===!0?f.setAttribute(w,""):M!==!1&&M!=null&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,M):f.removeAttribute(w);break;case"cols":case"rows":case"size":case"span":M!=null&&typeof M!="function"&&typeof M!="symbol"&&!isNaN(M)&&1<=M?f.setAttribute(w,M):f.removeAttribute(w);break;case"rowSpan":case"start":M==null||typeof M=="function"||typeof M=="symbol"||isNaN(M)?f.removeAttribute(w):f.setAttribute(w,M);break;case"popover":Ra("beforetoggle",f),Ra("toggle",f),Bn(f,"popover",M);break;case"xlinkActuate":ur(f,"http://www.w3.org/1999/xlink","xlink:actuate",M);break;case"xlinkArcrole":ur(f,"http://www.w3.org/1999/xlink","xlink:arcrole",M);break;case"xlinkRole":ur(f,"http://www.w3.org/1999/xlink","xlink:role",M);break;case"xlinkShow":ur(f,"http://www.w3.org/1999/xlink","xlink:show",M);break;case"xlinkTitle":ur(f,"http://www.w3.org/1999/xlink","xlink:title",M);break;case"xlinkType":ur(f,"http://www.w3.org/1999/xlink","xlink:type",M);break;case"xmlBase":ur(f,"http://www.w3.org/XML/1998/namespace","xml:base",M);break;case"xmlLang":ur(f,"http://www.w3.org/XML/1998/namespace","xml:lang",M);break;case"xmlSpace":ur(f,"http://www.w3.org/XML/1998/namespace","xml:space",M);break;case"is":Bn(f,"is",M);break;case"innerText":case"textContent":break;default:(!(2<w.length)||w[0]!=="o"&&w[0]!=="O"||w[1]!=="n"&&w[1]!=="N")&&(w=rr.get(w)||w,Bn(f,w,M))}}function ZT(f,E,w,M,j,W){switch(w){case"style":pa(f,M,W);break;case"dangerouslySetInnerHTML":if(M!=null){if(typeof M!="object"||!("__html"in M))throw Error(a(61));if(w=M.__html,w!=null){if(j.children!=null)throw Error(a(60));f.innerHTML=w}}break;case"children":typeof M=="string"?wn(f,M):(typeof M=="number"||typeof M=="bigint")&&wn(f,""+M);break;case"onScroll":M!=null&&Ra("scroll",f);break;case"onScrollEnd":M!=null&&Ra("scrollend",f);break;case"onClick":M!=null&&(f.onclick=Xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hn.hasOwnProperty(w))e:{if(w[0]==="o"&&w[1]==="n"&&(j=w.endsWith("Capture"),E=w.slice(2,j?w.length-7:void 0),W=f[Wt]||null,W=W!=null?W[w]:null,typeof W=="function"&&f.removeEventListener(E,W,j),typeof M=="function")){typeof W!="function"&&W!==null&&(w in f?f[w]=null:f.hasAttribute(w)&&f.removeAttribute(w)),f.addEventListener(E,M,j);break e}w in f?f[w]=M:M===!0?f.setAttribute(w,""):Bn(f,w,M)}}}function Ko(f,E,w){switch(E){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ra("error",f),Ra("load",f);var M=!1,j=!1,W;for(W in w)if(w.hasOwnProperty(W)){var ge=w[W];if(ge!=null)switch(W){case"src":M=!0;break;case"srcSet":j=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,E));default:Br(f,E,W,ge,w,null)}}j&&Br(f,E,"srcSet",w.srcSet,w,null),M&&Br(f,E,"src",w.src,w,null);return;case"input":Ra("invalid",f);var xe=W=ge=j=null,Ve=null,wt=null;for(M in w)if(w.hasOwnProperty(M)){var Ot=w[M];if(Ot!=null)switch(M){case"name":j=Ot;break;case"type":ge=Ot;break;case"checked":Ve=Ot;break;case"defaultChecked":wt=Ot;break;case"value":W=Ot;break;case"defaultValue":xe=Ot;break;case"children":case"dangerouslySetInnerHTML":if(Ot!=null)throw Error(a(137,E));break;default:Br(f,E,M,Ot,w,null)}}Zr(f,W,xe,Ve,wt,ge,j,!1);return;case"select":Ra("invalid",f),M=ge=W=null;for(j in w)if(w.hasOwnProperty(j)&&(xe=w[j],xe!=null))switch(j){case"value":W=xe;break;case"defaultValue":ge=xe;break;case"multiple":M=xe;default:Br(f,E,j,xe,w,null)}E=W,w=ge,f.multiple=!!M,E!=null?Dr(f,!!M,E,!1):w!=null&&Dr(f,!!M,w,!0);return;case"textarea":Ra("invalid",f),W=j=M=null;for(ge in w)if(w.hasOwnProperty(ge)&&(xe=w[ge],xe!=null))switch(ge){case"value":M=xe;break;case"defaultValue":j=xe;break;case"children":W=xe;break;case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(91));break;default:Br(f,E,ge,xe,w,null)}ar(f,M,j,W);return;case"option":for(Ve in w)if(w.hasOwnProperty(Ve)&&(M=w[Ve],M!=null))switch(Ve){case"selected":f.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Br(f,E,Ve,M,w,null)}return;case"dialog":Ra("beforetoggle",f),Ra("toggle",f),Ra("cancel",f),Ra("close",f);break;case"iframe":case"object":Ra("load",f);break;case"video":case"audio":for(M=0;M<Dy.length;M++)Ra(Dy[M],f);break;case"image":Ra("error",f),Ra("load",f);break;case"details":Ra("toggle",f);break;case"embed":case"source":case"link":Ra("error",f),Ra("load",f);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(wt in w)if(w.hasOwnProperty(wt)&&(M=w[wt],M!=null))switch(wt){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,E));default:Br(f,E,wt,M,w,null)}return;default:if(Ua(E)){for(Ot in w)w.hasOwnProperty(Ot)&&(M=w[Ot],M!==void 0&&ZT(f,E,Ot,M,w,void 0));return}}for(xe in w)w.hasOwnProperty(xe)&&(M=w[xe],M!=null&&Br(f,E,xe,M,w,null))}function WGe(f,E,w,M){switch(E){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var j=null,W=null,ge=null,xe=null,Ve=null,wt=null,Ot=null;for(Nt in w){var jt=w[Nt];if(w.hasOwnProperty(Nt)&&jt!=null)switch(Nt){case"checked":break;case"value":break;case"defaultValue":Ve=jt;default:M.hasOwnProperty(Nt)||Br(f,E,Nt,null,M,jt)}}for(var St in M){var Nt=M[St];if(jt=w[St],M.hasOwnProperty(St)&&(Nt!=null||jt!=null))switch(St){case"type":W=Nt;break;case"name":j=Nt;break;case"checked":wt=Nt;break;case"defaultChecked":Ot=Nt;break;case"value":ge=Nt;break;case"defaultValue":xe=Nt;break;case"children":case"dangerouslySetInnerHTML":if(Nt!=null)throw Error(a(137,E));break;default:Nt!==jt&&Br(f,E,St,Nt,M,jt)}}$i(f,ge,xe,Ve,wt,Ot,W,j);return;case"select":Nt=ge=xe=St=null;for(W in w)if(Ve=w[W],w.hasOwnProperty(W)&&Ve!=null)switch(W){case"value":break;case"multiple":Nt=Ve;default:M.hasOwnProperty(W)||Br(f,E,W,null,M,Ve)}for(j in M)if(W=M[j],Ve=w[j],M.hasOwnProperty(j)&&(W!=null||Ve!=null))switch(j){case"value":St=W;break;case"defaultValue":xe=W;break;case"multiple":ge=W;default:W!==Ve&&Br(f,E,j,W,M,Ve)}E=xe,w=ge,M=Nt,St!=null?Dr(f,!!w,St,!1):!!M!=!!w&&(E!=null?Dr(f,!!w,E,!0):Dr(f,!!w,w?[]:"",!1));return;case"textarea":Nt=St=null;for(xe in w)if(j=w[xe],w.hasOwnProperty(xe)&&j!=null&&!M.hasOwnProperty(xe))switch(xe){case"value":break;case"children":break;default:Br(f,E,xe,null,M,j)}for(ge in M)if(j=M[ge],W=w[ge],M.hasOwnProperty(ge)&&(j!=null||W!=null))switch(ge){case"value":St=j;break;case"defaultValue":Nt=j;break;case"children":break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:j!==W&&Br(f,E,ge,j,M,W)}Ks(f,St,Nt);return;case"option":for(var Dn in w)if(St=w[Dn],w.hasOwnProperty(Dn)&&St!=null&&!M.hasOwnProperty(Dn))switch(Dn){case"selected":f.selected=!1;break;default:Br(f,E,Dn,null,M,St)}for(Ve in M)if(St=M[Ve],Nt=w[Ve],M.hasOwnProperty(Ve)&&St!==Nt&&(St!=null||Nt!=null))switch(Ve){case"selected":f.selected=St&&typeof St!="function"&&typeof St!="symbol";break;default:Br(f,E,Ve,St,M,Nt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xn in w)St=w[Xn],w.hasOwnProperty(Xn)&&St!=null&&!M.hasOwnProperty(Xn)&&Br(f,E,Xn,null,M,St);for(wt in M)if(St=M[wt],Nt=w[wt],M.hasOwnProperty(wt)&&St!==Nt&&(St!=null||Nt!=null))switch(wt){case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(a(137,E));break;default:Br(f,E,wt,St,M,Nt)}return;default:if(Ua(E)){for(var yr in w)St=w[yr],w.hasOwnProperty(yr)&&St!==void 0&&!M.hasOwnProperty(yr)&&ZT(f,E,yr,void 0,M,St);for(Ot in M)St=M[Ot],Nt=w[Ot],!M.hasOwnProperty(Ot)||St===Nt||St===void 0&&Nt===void 0||ZT(f,E,Ot,St,M,Nt);return}}for(var mt in w)St=w[mt],w.hasOwnProperty(mt)&&St!=null&&!M.hasOwnProperty(mt)&&Br(f,E,mt,null,M,St);for(jt in M)St=M[jt],Nt=w[jt],!M.hasOwnProperty(jt)||St===Nt||St==null&&Nt==null||Br(f,E,jt,St,M,Nt)}function n$(f){switch(f){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ZGe(){if(typeof performance.getEntriesByType=="function"){for(var f=0,E=0,w=performance.getEntriesByType("resource"),M=0;M<w.length;M++){var j=w[M],W=j.transferSize,ge=j.initiatorType,xe=j.duration;if(W&&xe&&n$(ge)){for(ge=0,xe=j.responseEnd,M+=1;M<w.length;M++){var Ve=w[M],wt=Ve.startTime;if(wt>xe)break;var Ot=Ve.transferSize,jt=Ve.initiatorType;Ot&&n$(jt)&&(Ve=Ve.responseEnd,ge+=Ot*(Ve<xe?1:(xe-wt)/(Ve-wt)))}if(--M,E+=8*(W+ge)/(j.duration/1e3),f++,10<f)break}}if(0<f)return E/f/1e6}return navigator.connection&&(f=navigator.connection.downlink,typeof f=="number")?f:5}var VT=null,XT=null;function LD(f){return f.nodeType===9?f:f.ownerDocument}function a$(f){switch(f){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function r$(f,E){if(f===0)switch(E){case"svg":return 1;case"math":return 2;default:return 0}return f===1&&E==="foreignObject"?0:f}function $T(f,E){return f==="textarea"||f==="noscript"||typeof E.children=="string"||typeof E.children=="number"||typeof E.children=="bigint"||typeof E.dangerouslySetInnerHTML=="object"&&E.dangerouslySetInnerHTML!==null&&E.dangerouslySetInnerHTML.__html!=null}var e3=null;function VGe(){var f=window.event;return f&&f.type==="popstate"?f===e3?!1:(e3=f,!0):(e3=null,!1)}var i$=typeof setTimeout=="function"?setTimeout:void 0,XGe=typeof clearTimeout=="function"?clearTimeout:void 0,o$=typeof Promise=="function"?Promise:void 0,$Ge=typeof queueMicrotask=="function"?queueMicrotask:typeof o$<"u"?function(f){return o$.resolve(null).then(f).catch(e4e)}:i$;function e4e(f){setTimeout(function(){throw f})}function Dp(f){return f==="head"}function A$(f,E){var w=E,M=0;do{var j=w.nextSibling;if(f.removeChild(w),j&&j.nodeType===8)if(w=j.data,w==="/$"||w==="/&"){if(M===0){f.removeChild(j),NC(E);return}M--}else if(w==="$"||w==="$?"||w==="$~"||w==="$!"||w==="&")M++;else if(w==="html")Sy(f.ownerDocument.documentElement);else if(w==="head"){w=f.ownerDocument.head,Sy(w);for(var W=w.firstChild;W;){var ge=W.nextSibling,xe=W.nodeName;W[Et]||xe==="SCRIPT"||xe==="STYLE"||xe==="LINK"&&W.rel.toLowerCase()==="stylesheet"||w.removeChild(W),W=ge}}else w==="body"&&Sy(f.ownerDocument.body);w=j}while(w);NC(E)}function s$(f,E){var w=f;f=0;do{var M=w.nextSibling;if(w.nodeType===1?E?(w._stashedDisplay=w.style.display,w.style.display="none"):(w.style.display=w._stashedDisplay||"",w.getAttribute("style")===""&&w.removeAttribute("style")):w.nodeType===3&&(E?(w._stashedText=w.nodeValue,w.nodeValue=""):w.nodeValue=w._stashedText||""),M&&M.nodeType===8)if(w=M.data,w==="/$"){if(f===0)break;f--}else w!=="$"&&w!=="$?"&&w!=="$~"&&w!=="$!"||f++;w=M}while(w)}function t3(f){var E=f.firstChild;for(E&&E.nodeType===10&&(E=E.nextSibling);E;){var w=E;switch(E=E.nextSibling,w.nodeName){case"HTML":case"HEAD":case"BODY":t3(w),fe(w);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(w.rel.toLowerCase()==="stylesheet")continue}f.removeChild(w)}}function t4e(f,E,w,M){for(;f.nodeType===1;){var j=w;if(f.nodeName.toLowerCase()!==E.toLowerCase()){if(!M&&(f.nodeName!=="INPUT"||f.type!=="hidden"))break}else if(M){if(!f[Et])switch(E){case"meta":if(!f.hasAttribute("itemprop"))break;return f;case"link":if(W=f.getAttribute("rel"),W==="stylesheet"&&f.hasAttribute("data-precedence"))break;if(W!==j.rel||f.getAttribute("href")!==(j.href==null||j.href===""?null:j.href)||f.getAttribute("crossorigin")!==(j.crossOrigin==null?null:j.crossOrigin)||f.getAttribute("title")!==(j.title==null?null:j.title))break;return f;case"style":if(f.hasAttribute("data-precedence"))break;return f;case"script":if(W=f.getAttribute("src"),(W!==(j.src==null?null:j.src)||f.getAttribute("type")!==(j.type==null?null:j.type)||f.getAttribute("crossorigin")!==(j.crossOrigin==null?null:j.crossOrigin))&&W&&f.hasAttribute("async")&&!f.hasAttribute("itemprop"))break;return f;default:return f}}else if(E==="input"&&f.type==="hidden"){var W=j.name==null?null:""+j.name;if(j.type==="hidden"&&f.getAttribute("name")===W)return f}else return f;if(f=Nc(f.nextSibling),f===null)break}return null}function n4e(f,E,w){if(E==="")return null;for(;f.nodeType!==3;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!w||(f=Nc(f.nextSibling),f===null))return null;return f}function c$(f,E){for(;f.nodeType!==8;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!E||(f=Nc(f.nextSibling),f===null))return null;return f}function n3(f){return f.data==="$?"||f.data==="$~"}function a3(f){return f.data==="$!"||f.data==="$?"&&f.ownerDocument.readyState!=="loading"}function a4e(f,E){var w=f.ownerDocument;if(f.data==="$~")f._reactRetry=E;else if(f.data!=="$?"||w.readyState!=="loading")E();else{var M=function(){E(),w.removeEventListener("DOMContentLoaded",M)};w.addEventListener("DOMContentLoaded",M),f._reactRetry=M}}function Nc(f){for(;f!=null;f=f.nextSibling){var E=f.nodeType;if(E===1||E===3)break;if(E===8){if(E=f.data,E==="$"||E==="$!"||E==="$?"||E==="$~"||E==="&"||E==="F!"||E==="F")break;if(E==="/$"||E==="/&")return null}}return f}var r3=null;function l$(f){f=f.nextSibling;for(var E=0;f;){if(f.nodeType===8){var w=f.data;if(w==="/$"||w==="/&"){if(E===0)return Nc(f.nextSibling);E--}else w!=="$"&&w!=="$!"&&w!=="$?"&&w!=="$~"&&w!=="&"||E++}f=f.nextSibling}return null}function d$(f){f=f.previousSibling;for(var E=0;f;){if(f.nodeType===8){var w=f.data;if(w==="$"||w==="$!"||w==="$?"||w==="$~"||w==="&"){if(E===0)return f;E--}else w!=="/$"&&w!=="/&"||E++}f=f.previousSibling}return null}function u$(f,E,w){switch(E=LD(w),f){case"html":if(f=E.documentElement,!f)throw Error(a(452));return f;case"head":if(f=E.head,!f)throw Error(a(453));return f;case"body":if(f=E.body,!f)throw Error(a(454));return f;default:throw Error(a(451))}}function Sy(f){for(var E=f.attributes;E.length;)f.removeAttributeNode(E[0]);fe(f)}var Mc=new Map,g$=new Set;function TD(f){return typeof f.getRootNode=="function"?f.getRootNode():f.nodeType===9?f:f.ownerDocument}var Ju=T.d;T.d={f:r4e,r:i4e,D:o4e,C:A4e,L:s4e,m:c4e,X:d4e,S:l4e,M:u4e};function r4e(){var f=Ju.f(),E=DD();return f||E}function i4e(f){var E=Dt(f);E!==null&&E.tag===5&&E.type==="form"?SV(E):Ju.r(f)}var SC=typeof document>"u"?null:document;function p$(f,E,w){var M=SC;if(M&&typeof E=="string"&&E){var j=vr(E);j='link[rel="'+f+'"][href="'+j+'"]',typeof w=="string"&&(j+='[crossorigin="'+w+'"]'),g$.has(j)||(g$.add(j),f={rel:f,crossOrigin:w,href:E},M.querySelector(j)===null&&(E=M.createElement("link"),Ko(E,"link",f),on(E),M.head.appendChild(E)))}}function o4e(f){Ju.D(f),p$("dns-prefetch",f,null)}function A4e(f,E){Ju.C(f,E),p$("preconnect",f,E)}function s4e(f,E,w){Ju.L(f,E,w);var M=SC;if(M&&f&&E){var j='link[rel="preload"][as="'+vr(E)+'"]';E==="image"&&w&&w.imageSrcSet?(j+='[imagesrcset="'+vr(w.imageSrcSet)+'"]',typeof w.imageSizes=="string"&&(j+='[imagesizes="'+vr(w.imageSizes)+'"]')):j+='[href="'+vr(f)+'"]';var W=j;switch(E){case"style":W=_C(f);break;case"script":W=RC(f)}Mc.has(W)||(f=u({rel:"preload",href:E==="image"&&w&&w.imageSrcSet?void 0:f,as:E},w),Mc.set(W,f),M.querySelector(j)!==null||E==="style"&&M.querySelector(_y(W))||E==="script"&&M.querySelector(Ry(W))||(E=M.createElement("link"),Ko(E,"link",f),on(E),M.head.appendChild(E)))}}function c4e(f,E){Ju.m(f,E);var w=SC;if(w&&f){var M=E&&typeof E.as=="string"?E.as:"script",j='link[rel="modulepreload"][as="'+vr(M)+'"][href="'+vr(f)+'"]',W=j;switch(M){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":W=RC(f)}if(!Mc.has(W)&&(f=u({rel:"modulepreload",href:f},E),Mc.set(W,f),w.querySelector(j)===null)){switch(M){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(w.querySelector(Ry(W)))return}M=w.createElement("link"),Ko(M,"link",f),on(M),w.head.appendChild(M)}}}function l4e(f,E,w){Ju.S(f,E,w);var M=SC;if(M&&f){var j=dn(M).hoistableStyles,W=_C(f);E=E||"default";var ge=j.get(W);if(!ge){var xe={loading:0,preload:null};if(ge=M.querySelector(_y(W)))xe.loading=5;else{f=u({rel:"stylesheet",href:f,"data-precedence":E},w),(w=Mc.get(W))&&i3(f,w);var Ve=ge=M.createElement("link");on(Ve),Ko(Ve,"link",f),Ve._p=new Promise(function(wt,Ot){Ve.onload=wt,Ve.onerror=Ot}),Ve.addEventListener("load",function(){xe.loading|=1}),Ve.addEventListener("error",function(){xe.loading|=2}),xe.loading|=4,GD(ge,E,M)}ge={type:"stylesheet",instance:ge,count:1,state:xe},j.set(W,ge)}}}function d4e(f,E){Ju.X(f,E);var w=SC;if(w&&f){var M=dn(w).hoistableScripts,j=RC(f),W=M.get(j);W||(W=w.querySelector(Ry(j)),W||(f=u({src:f,async:!0},E),(E=Mc.get(j))&&o3(f,E),W=w.createElement("script"),on(W),Ko(W,"link",f),w.head.appendChild(W)),W={type:"script",instance:W,count:1,state:null},M.set(j,W))}}function u4e(f,E){Ju.M(f,E);var w=SC;if(w&&f){var M=dn(w).hoistableScripts,j=RC(f),W=M.get(j);W||(W=w.querySelector(Ry(j)),W||(f=u({src:f,async:!0,type:"module"},E),(E=Mc.get(j))&&o3(f,E),W=w.createElement("script"),on(W),Ko(W,"link",f),w.head.appendChild(W)),W={type:"script",instance:W,count:1,state:null},M.set(j,W))}}function m$(f,E,w,M){var j=(j=Ae.current)?TD(j):null;if(!j)throw Error(a(446));switch(f){case"meta":case"title":return null;case"style":return typeof w.precedence=="string"&&typeof w.href=="string"?(E=_C(w.href),w=dn(j).hoistableStyles,M=w.get(E),M||(M={type:"style",instance:null,count:0,state:null},w.set(E,M)),M):{type:"void",instance:null,count:0,state:null};case"link":if(w.rel==="stylesheet"&&typeof w.href=="string"&&typeof w.precedence=="string"){f=_C(w.href);var W=dn(j).hoistableStyles,ge=W.get(f);if(ge||(j=j.ownerDocument||j,ge={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},W.set(f,ge),(W=j.querySelector(_y(f)))&&!W._p&&(ge.instance=W,ge.state.loading=5),Mc.has(f)||(w={rel:"preload",as:"style",href:w.href,crossOrigin:w.crossOrigin,integrity:w.integrity,media:w.media,hrefLang:w.hrefLang,referrerPolicy:w.referrerPolicy},Mc.set(f,w),W||g4e(j,f,w,ge.state))),E&&M===null)throw Error(a(528,""));return ge}if(E&&M!==null)throw Error(a(529,""));return null;case"script":return E=w.async,w=w.src,typeof w=="string"&&E&&typeof E!="function"&&typeof E!="symbol"?(E=RC(w),w=dn(j).hoistableScripts,M=w.get(E),M||(M={type:"script",instance:null,count:0,state:null},w.set(E,M)),M):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,f))}}function _C(f){return'href="'+vr(f)+'"'}function _y(f){return'link[rel="stylesheet"]['+f+"]"}function h$(f){return u({},f,{"data-precedence":f.precedence,precedence:null})}function g4e(f,E,w,M){f.querySelector('link[rel="preload"][as="style"]['+E+"]")?M.loading=1:(E=f.createElement("link"),M.preload=E,E.addEventListener("load",function(){return M.loading|=1}),E.addEventListener("error",function(){return M.loading|=2}),Ko(E,"link",w),on(E),f.head.appendChild(E))}function RC(f){return'[src="'+vr(f)+'"]'}function Ry(f){return"script[async]"+f}function f$(f,E,w){if(E.count++,E.instance===null)switch(E.type){case"style":var M=f.querySelector('style[data-href~="'+vr(w.href)+'"]');if(M)return E.instance=M,on(M),M;var j=u({},w,{"data-href":w.href,"data-precedence":w.precedence,href:null,precedence:null});return M=(f.ownerDocument||f).createElement("style"),on(M),Ko(M,"style",j),GD(M,w.precedence,f),E.instance=M;case"stylesheet":j=_C(w.href);var W=f.querySelector(_y(j));if(W)return E.state.loading|=4,E.instance=W,on(W),W;M=h$(w),(j=Mc.get(j))&&i3(M,j),W=(f.ownerDocument||f).createElement("link"),on(W);var ge=W;return ge._p=new Promise(function(xe,Ve){ge.onload=xe,ge.onerror=Ve}),Ko(W,"link",M),E.state.loading|=4,GD(W,w.precedence,f),E.instance=W;case"script":return W=RC(w.src),(j=f.querySelector(Ry(W)))?(E.instance=j,on(j),j):(M=w,(j=Mc.get(W))&&(M=u({},w),o3(M,j)),f=f.ownerDocument||f,j=f.createElement("script"),on(j),Ko(j,"link",M),f.head.appendChild(j),E.instance=j);case"void":return null;default:throw Error(a(443,E.type))}else E.type==="stylesheet"&&(E.state.loading&4)===0&&(M=E.instance,E.state.loading|=4,GD(M,w.precedence,f));return E.instance}function GD(f,E,w){for(var M=w.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=M.length?M[M.length-1]:null,W=j,ge=0;ge<M.length;ge++){var xe=M[ge];if(xe.dataset.precedence===E)W=xe;else if(W!==j)break}W?W.parentNode.insertBefore(f,W.nextSibling):(E=w.nodeType===9?w.head:w,E.insertBefore(f,E.firstChild))}function i3(f,E){f.crossOrigin==null&&(f.crossOrigin=E.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=E.referrerPolicy),f.title==null&&(f.title=E.title)}function o3(f,E){f.crossOrigin==null&&(f.crossOrigin=E.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=E.referrerPolicy),f.integrity==null&&(f.integrity=E.integrity)}var OD=null;function b$(f,E,w){if(OD===null){var M=new Map,j=OD=new Map;j.set(w,M)}else j=OD,M=j.get(w),M||(M=new Map,j.set(w,M));if(M.has(f))return M;for(M.set(f,null),w=w.getElementsByTagName(f),j=0;j<w.length;j++){var W=w[j];if(!(W[Et]||W[Mt]||f==="link"&&W.getAttribute("rel")==="stylesheet")&&W.namespaceURI!=="http://www.w3.org/2000/svg"){var ge=W.getAttribute(E)||"";ge=f+ge;var xe=M.get(ge);xe?xe.push(W):M.set(ge,[W])}}return M}function C$(f,E,w){f=f.ownerDocument||f,f.head.insertBefore(w,E==="title"?f.querySelector("head > title"):null)}function p4e(f,E,w){if(w===1||E.itemProp!=null)return!1;switch(f){case"meta":case"title":return!0;case"style":if(typeof E.precedence!="string"||typeof E.href!="string"||E.href==="")break;return!0;case"link":if(typeof E.rel!="string"||typeof E.href!="string"||E.href===""||E.onLoad||E.onError)break;switch(E.rel){case"stylesheet":return f=E.disabled,typeof E.precedence=="string"&&f==null;default:return!0}case"script":if(E.async&&typeof E.async!="function"&&typeof E.async!="symbol"&&!E.onLoad&&!E.onError&&E.src&&typeof E.src=="string")return!0}return!1}function E$(f){return!(f.type==="stylesheet"&&(f.state.loading&3)===0)}function m4e(f,E,w,M){if(w.type==="stylesheet"&&(typeof M.media!="string"||matchMedia(M.media).matches!==!1)&&(w.state.loading&4)===0){if(w.instance===null){var j=_C(M.href),W=E.querySelector(_y(j));if(W){E=W._p,E!==null&&typeof E=="object"&&typeof E.then=="function"&&(f.count++,f=UD.bind(f),E.then(f,f)),w.state.loading|=4,w.instance=W,on(W);return}W=E.ownerDocument||E,M=h$(M),(j=Mc.get(j))&&i3(M,j),W=W.createElement("link"),on(W);var ge=W;ge._p=new Promise(function(xe,Ve){ge.onload=xe,ge.onerror=Ve}),Ko(W,"link",M),w.instance=W}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(w,E),(E=w.state.preload)&&(w.state.loading&3)===0&&(f.count++,w=UD.bind(f),E.addEventListener("load",w),E.addEventListener("error",w))}}var A3=0;function h4e(f,E){return f.stylesheets&&f.count===0&&KD(f,f.stylesheets),0<f.count||0<f.imgCount?function(w){var M=setTimeout(function(){if(f.stylesheets&&KD(f,f.stylesheets),f.unsuspend){var W=f.unsuspend;f.unsuspend=null,W()}},6e4+E);0<f.imgBytes&&A3===0&&(A3=62500*ZGe());var j=setTimeout(function(){if(f.waitingForImages=!1,f.count===0&&(f.stylesheets&&KD(f,f.stylesheets),f.unsuspend)){var W=f.unsuspend;f.unsuspend=null,W()}},(f.imgBytes>A3?50:800)+E);return f.unsuspend=w,function(){f.unsuspend=null,clearTimeout(M),clearTimeout(j)}}:null}function UD(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)KD(this,this.stylesheets);else if(this.unsuspend){var f=this.unsuspend;this.unsuspend=null,f()}}}var PD=null;function KD(f,E){f.stylesheets=null,f.unsuspend!==null&&(f.count++,PD=new Map,E.forEach(f4e,f),PD=null,UD.call(f))}function f4e(f,E){if(!(E.state.loading&4)){var w=PD.get(f);if(w)var M=w.get(null);else{w=new Map,PD.set(f,w);for(var j=f.querySelectorAll("link[data-precedence],style[data-precedence]"),W=0;W<j.length;W++){var ge=j[W];(ge.nodeName==="LINK"||ge.getAttribute("media")!=="not all")&&(w.set(ge.dataset.precedence,ge),M=ge)}M&&w.set(null,M)}j=E.instance,ge=j.getAttribute("data-precedence"),W=w.get(ge)||M,W===M&&w.set(null,j),w.set(ge,j),this.count++,M=UD.bind(this),j.addEventListener("load",M),j.addEventListener("error",M),W?W.parentNode.insertBefore(j,W.nextSibling):(f=f.nodeType===9?f.head:f,f.insertBefore(j,f.firstChild)),E.state.loading|=4}}var Ny={$$typeof:y,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function b4e(f,E,w,M,j,W,ge,xe,Ve){this.tag=1,this.containerInfo=f,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.hiddenUpdates=Rt(null),this.identifierPrefix=M,this.onUncaughtError=j,this.onCaughtError=W,this.onRecoverableError=ge,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ve,this.incompleteTransitions=new Map}function I$(f,E,w,M,j,W,ge,xe,Ve,wt,Ot,jt){return f=new b4e(f,E,w,ge,Ve,wt,Ot,jt,xe),E=1,W===!0&&(E|=24),W=xA(3,null,null,E),f.current=W,W.stateNode=f,E=UL(),E.refCount++,f.pooledCache=E,E.refCount++,W.memoizedState={element:M,isDehydrated:w,cache:E},YL(W),f}function B$(f){return f?(f=to,f):to}function y$(f,E,w,M,j,W){j=B$(j),M.context===null?M.context=j:M.pendingContext=j,M=fp(E),M.payload={element:w},W=W===void 0?null:W,W!==null&&(M.callback=W),w=bp(f,M,E),w!==null&&(ps(w,f,E),dy(w,f,E))}function Q$(f,E){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var w=f.retryLane;f.retryLane=w!==0&&w<E?w:E}}function s3(f,E){Q$(f,E),(f=f.alternate)&&Q$(f,E)}function w$(f){if(f.tag===13||f.tag===31){var E=Cd(f,67108864);E!==null&&ps(E,f,67108864),s3(f,67108864)}}function k$(f){if(f.tag===13||f.tag===31){var E=Js();E=_t(E);var w=Cd(f,E);w!==null&&ps(w,f,E),s3(f,E)}}var HD=!0;function C4e(f,E,w,M){var j=F.T;F.T=null;var W=T.p;try{T.p=2,c3(f,E,w,M)}finally{T.p=W,F.T=j}}function E4e(f,E,w,M){var j=F.T;F.T=null;var W=T.p;try{T.p=8,c3(f,E,w,M)}finally{T.p=W,F.T=j}}function c3(f,E,w,M){if(HD){var j=l3(M);if(j===null)WT(f,E,M,YD,w),D$(f,M);else if(B4e(j,f,E,w,M))M.stopPropagation();else if(D$(f,M),E&4&&-1<I4e.indexOf(f)){for(;j!==null;){var W=Dt(j);if(W!==null)switch(W.tag){case 3:if(W=W.stateNode,W.current.memoizedState.isDehydrated){var ge=ht(W.pendingLanes);if(ge!==0){var xe=W;for(xe.pendingLanes|=2,xe.entangledLanes|=2;ge;){var Ve=1<<31-Ne(ge);xe.entanglements[1]|=Ve,ge&=~Ve}Bd(W),(nr&6)===0&&(kD=Ge()+500,vy(0))}}break;case 31:case 13:xe=Cd(W,2),xe!==null&&ps(xe,W,2),DD(),s3(W,2)}if(W=l3(M),W===null&&WT(f,E,M,YD,w),W===j)break;j=W}j!==null&&M.stopPropagation()}else WT(f,E,M,null,w)}}function l3(f){return f=ee(f),d3(f)}var YD=null;function d3(f){if(YD=null,f=$e(f),f!==null){var E=i(f);if(E===null)f=null;else{var w=E.tag;if(w===13){if(f=o(E),f!==null)return f;f=null}else if(w===31){if(f=A(E),f!==null)return f;f=null}else if(w===3){if(E.stateNode.current.memoizedState.isDehydrated)return E.tag===3?E.stateNode.containerInfo:null;f=null}else E!==f&&(f=null)}}return YD=f,null}function v$(f){switch(f){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ot()){case He:return 2;case ze:return 8;case ut:case Se:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var u3=!1,xp=null,Sp=null,_p=null,My=new Map,Fy=new Map,Rp=[],I4e="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".split(" ");function D$(f,E){switch(f){case"focusin":case"focusout":xp=null;break;case"dragenter":case"dragleave":Sp=null;break;case"mouseover":case"mouseout":_p=null;break;case"pointerover":case"pointerout":My.delete(E.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fy.delete(E.pointerId)}}function Ly(f,E,w,M,j,W){return f===null||f.nativeEvent!==W?(f={blockedOn:E,domEventName:w,eventSystemFlags:M,nativeEvent:W,targetContainers:[j]},E!==null&&(E=Dt(E),E!==null&&w$(E)),f):(f.eventSystemFlags|=M,E=f.targetContainers,j!==null&&E.indexOf(j)===-1&&E.push(j),f)}function B4e(f,E,w,M,j){switch(E){case"focusin":return xp=Ly(xp,f,E,w,M,j),!0;case"dragenter":return Sp=Ly(Sp,f,E,w,M,j),!0;case"mouseover":return _p=Ly(_p,f,E,w,M,j),!0;case"pointerover":var W=j.pointerId;return My.set(W,Ly(My.get(W)||null,f,E,w,M,j)),!0;case"gotpointercapture":return W=j.pointerId,Fy.set(W,Ly(Fy.get(W)||null,f,E,w,M,j)),!0}return!1}function x$(f){var E=$e(f.target);if(E!==null){var w=i(E);if(w!==null){if(E=w.tag,E===13){if(E=o(w),E!==null){f.blockedOn=E,$t(f.priority,function(){k$(w)});return}}else if(E===31){if(E=A(w),E!==null){f.blockedOn=E,$t(f.priority,function(){k$(w)});return}}else if(E===3&&w.stateNode.current.memoizedState.isDehydrated){f.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}f.blockedOn=null}function qD(f){if(f.blockedOn!==null)return!1;for(var E=f.targetContainers;0<E.length;){var w=l3(f.nativeEvent);if(w===null){w=f.nativeEvent;var M=new w.constructor(w.type,w);J=M,w.target.dispatchEvent(M),J=null}else return E=Dt(w),E!==null&&w$(E),f.blockedOn=w,!1;E.shift()}return!0}function S$(f,E,w){qD(f)&&w.delete(E)}function y4e(){u3=!1,xp!==null&&qD(xp)&&(xp=null),Sp!==null&&qD(Sp)&&(Sp=null),_p!==null&&qD(_p)&&(_p=null),My.forEach(S$),Fy.forEach(S$)}function jD(f,E){f.blockedOn===E&&(f.blockedOn=null,u3||(u3=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,y4e)))}var zD=null;function _$(f){zD!==f&&(zD=f,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zD===f&&(zD=null);for(var E=0;E<f.length;E+=3){var w=f[E],M=f[E+1],j=f[E+2];if(typeof M!="function"){if(d3(M||w)===null)continue;break}var W=Dt(w);W!==null&&(f.splice(E,3),E-=3,lT(W,{pending:!0,data:j,method:w.method,action:M},M,j))}}))}function NC(f){function E(Ve){return jD(Ve,f)}xp!==null&&jD(xp,f),Sp!==null&&jD(Sp,f),_p!==null&&jD(_p,f),My.forEach(E),Fy.forEach(E);for(var w=0;w<Rp.length;w++){var M=Rp[w];M.blockedOn===f&&(M.blockedOn=null)}for(;0<Rp.length&&(w=Rp[0],w.blockedOn===null);)x$(w),w.blockedOn===null&&Rp.shift();if(w=(f.ownerDocument||f).$$reactFormReplay,w!=null)for(M=0;M<w.length;M+=3){var j=w[M],W=w[M+1],ge=j[Wt]||null;if(typeof W=="function")ge||_$(w);else if(ge){var xe=null;if(W&&W.hasAttribute("formAction")){if(j=W,ge=W[Wt]||null)xe=ge.formAction;else if(d3(j)!==null)continue}else xe=ge.action;typeof xe=="function"?w[M+1]=xe:(w.splice(M,3),M-=3),_$(w)}}}function R$(){function f(W){W.canIntercept&&W.info==="react-transition"&&W.intercept({handler:function(){return new Promise(function(ge){return j=ge})},focusReset:"manual",scroll:"manual"})}function E(){j!==null&&(j(),j=null),M||setTimeout(w,20)}function w(){if(!M&&!navigation.transition){var W=navigation.currentEntry;W&&W.url!=null&&navigation.navigate(W.url,{state:W.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var M=!1,j=null;return navigation.addEventListener("navigate",f),navigation.addEventListener("navigatesuccess",E),navigation.addEventListener("navigateerror",E),setTimeout(w,100),function(){M=!0,navigation.removeEventListener("navigate",f),navigation.removeEventListener("navigatesuccess",E),navigation.removeEventListener("navigateerror",E),j!==null&&(j(),j=null)}}}function g3(f){this._internalRoot=f}JD.prototype.render=g3.prototype.render=function(f){var E=this._internalRoot;if(E===null)throw Error(a(409));var w=E.current,M=Js();y$(w,M,f,E,null,null)},JD.prototype.unmount=g3.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var E=f.containerInfo;y$(f.current,2,null,f,null,null),DD(),E[vn]=null}};function JD(f){this._internalRoot=f}JD.prototype.unstable_scheduleHydration=function(f){if(f){var E=Kt();f={blockedOn:null,target:f,priority:E};for(var w=0;w<Rp.length&&E!==0&&E<Rp[w].priority;w++);Rp.splice(w,0,f),w===0&&x$(f)}};var N$=e.version;if(N$!=="19.2.3")throw Error(a(527,N$,"19.2.3"));T.findDOMNode=function(f){var E=f._reactInternals;if(E===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=l(E),f=f!==null?d(f):null,f=f===null?null:f.stateNode,f};var Q4e={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var WD=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!WD.isDisabled&&WD.supportsFiber)try{X=WD.inject(Q4e),we=WD}catch{}}return Gy.createRoot=function(f,E){if(!r(f))throw Error(a(299));var w=!1,M="",j=UV,W=PV,ge=KV;return E!=null&&(E.unstable_strictMode===!0&&(w=!0),E.identifierPrefix!==void 0&&(M=E.identifierPrefix),E.onUncaughtError!==void 0&&(j=E.onUncaughtError),E.onCaughtError!==void 0&&(W=E.onCaughtError),E.onRecoverableError!==void 0&&(ge=E.onRecoverableError)),E=I$(f,1,!1,null,null,w,M,null,j,W,ge,R$),f[vn]=E.current,JT(f),new g3(E)},Gy.hydrateRoot=function(f,E,w){if(!r(f))throw Error(a(299));var M=!1,j="",W=UV,ge=PV,xe=KV,Ve=null;return w!=null&&(w.unstable_strictMode===!0&&(M=!0),w.identifierPrefix!==void 0&&(j=w.identifierPrefix),w.onUncaughtError!==void 0&&(W=w.onUncaughtError),w.onCaughtError!==void 0&&(ge=w.onCaughtError),w.onRecoverableError!==void 0&&(xe=w.onRecoverableError),w.formState!==void 0&&(Ve=w.formState)),E=I$(f,1,!0,E,w??null,M,j,Ve,W,ge,xe,R$),E.context=B$(null),w=E.current,M=Js(),M=_t(M),j=fp(M),j.callback=null,bp(w,j,M),w=M,E.current.lanes=w,ft(E,w),Bd(E),f[vn]=E.current,JT(f),new JD(E)},Gy.version="19.2.3",Gy}var H$;function M4e(){if(H$)return h3.exports;H$=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),h3.exports=N4e(),h3.exports}var F4e=M4e();const L4e=pl(F4e);var ui=$fe();const ebe=pl(ui);function T4e(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const G4e=t=>{switch(t){case"success":return P4e;case"info":return H4e;case"warning":return K4e;case"error":return Y4e;default:return null}},O4e=Array(12).fill(0),U4e=({visible:t,className:e})=>Yt.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Yt.createElement("div",{className:"sonner-spinner"},O4e.map((n,a)=>Yt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),P4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),K4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),H4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Y4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),q4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Yt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Yt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),j4e=()=>{const[t,e]=Yt.useState(document.hidden);return Yt.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Y5=1;class z4e{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:a,...r}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Y5++,o=this.toasts.find(s=>s.id===i),A=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:a}),{...s,...e,id:i,dismissible:A,title:a}):s):this.addToast({title:a,...r,dismissible:A,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let i=a!==void 0,o;const A=r.then(async l=>{if(o=["resolve",l],Yt.isValidElement(l))i=!1,this.create({id:a,type:"default",message:l});else if(W4e(l)&&!l.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:g,...m})}else if(l instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(l):n.error,g=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:g,...m})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(l):n.success,g=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"success",description:g,...m})}}).catch(async l=>{if(o=["reject",l],n.error!==void 0){i=!1;const d=typeof n.error=="function"?await n.error(l):n.error,u=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!Yt.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:u,...p})}}).finally(()=>{i&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),s=()=>new Promise((l,d)=>A.then(()=>o[0]==="reject"?d(o[1]):l(o[1])).catch(d));return typeof a!="string"&&typeof a!="number"?{unwrap:s}:Object.assign(a,{unwrap:s})},this.custom=(e,n)=>{const a=n?.id||Y5++;return this.create({jsx:e(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const bs=new z4e,J4e=(t,e)=>{const n=e?.id||Y5++;return bs.addToast({title:t,...e,id:n}),n},W4e=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Z4e=J4e,V4e=()=>bs.toasts,X4e=()=>bs.getActiveToasts(),Ws=Object.assign(Z4e,{success:bs.success,info:bs.info,warning:bs.warning,error:bs.error,custom:bs.custom,message:bs.message,promise:bs.promise,dismiss:bs.dismiss,loading:bs.loading},{getHistory:V4e,getToasts:X4e});T4e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ZD(t){return t.label!==void 0}const $4e=3,e8e="24px",t8e="16px",Y$=4e3,n8e=356,a8e=14,r8e=45,i8e=200;function yd(...t){return t.filter(Boolean).join(" ")}function o8e(t){const[e,n]=t.split("-"),a=[];return e&&a.push(e),n&&a.push(n),a}const A8e=t=>{var e,n,a,r,i,o,A,s,l;const{invert:d,toast:u,unstyled:g,interacting:p,setHeights:m,visibleToasts:h,heights:b,index:C,toasts:B,expanded:y,removeToast:Q,defaultRichColors:k,closeButton:_,style:v,cancelButtonStyle:x,actionButtonStyle:S,className:L="",descriptionClassName:N="",duration:U,position:K,gap:R,expandByDefault:O,classNames:F,icons:T,closeButtonAriaLabel:G="Close toast"}=t,[H,q]=Yt.useState(null),[P,z]=Yt.useState(null),[Z,$]=Yt.useState(!1),[V,Ae]=Yt.useState(!1),[ne,pe]=Yt.useState(!1),[te,re]=Yt.useState(!1),[se,oe]=Yt.useState(!1),[ue,le]=Yt.useState(0),[De,he]=Yt.useState(0),qe=Yt.useRef(u.duration||U||Y$),ce=Yt.useRef(null),et=Yt.useRef(null),ke=C===0,rt=C+1<=h,tt=u.type,gt=u.dismissible!==!1,Ge=u.className||"",ot=u.descriptionClassName||"",He=Yt.useMemo(()=>b.findIndex(Ie=>Ie.toastId===u.id)||0,[b,u.id]),ze=Yt.useMemo(()=>{var Ie;return(Ie=u.closeButton)!=null?Ie:_},[u.closeButton,_]),ut=Yt.useMemo(()=>u.duration||U||Y$,[u.duration,U]),Se=Yt.useRef(0),Ze=Yt.useRef(0),be=Yt.useRef(0),ve=Yt.useRef(null),[X,we]=K.split("-"),Be=Yt.useMemo(()=>b.reduce((Ie,Pe,Oe)=>Oe>=He?Ie:Ie+Pe.height,0),[b,He]),Ne=j4e(),Me=u.invert||d,Ke=tt==="loading";Ze.current=Yt.useMemo(()=>He*R+Be,[He,Be]),Yt.useEffect(()=>{qe.current=ut},[ut]),Yt.useEffect(()=>{$(!0)},[]),Yt.useEffect(()=>{const Ie=et.current;if(Ie){const Pe=Ie.getBoundingClientRect().height;return he(Pe),m(Oe=>[{toastId:u.id,height:Pe,position:u.position},...Oe]),()=>m(Oe=>Oe.filter(at=>at.toastId!==u.id))}},[m,u.id]),Yt.useLayoutEffect(()=>{if(!Z)return;const Ie=et.current,Pe=Ie.style.height;Ie.style.height="auto";const Oe=Ie.getBoundingClientRect().height;Ie.style.height=Pe,he(Oe),m(at=>at.find(ft=>ft.toastId===u.id)?at.map(ft=>ft.toastId===u.id?{...ft,height:Oe}:ft):[{toastId:u.id,height:Oe,position:u.position},...at])},[Z,u.title,u.description,m,u.id,u.jsx,u.action,u.cancel]);const Ee=Yt.useCallback(()=>{Ae(!0),le(Ze.current),m(Ie=>Ie.filter(Pe=>Pe.toastId!==u.id)),setTimeout(()=>{Q(u)},i8e)},[u,Q,m,Ze]);Yt.useEffect(()=>{if(u.promise&&tt==="loading"||u.duration===1/0||u.type==="loading")return;let Ie;return y||p||Ne?(()=>{if(be.current<Se.current){const at=new Date().getTime()-Se.current;qe.current=qe.current-at}be.current=new Date().getTime()})():(()=>{qe.current!==1/0&&(Se.current=new Date().getTime(),Ie=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Ee()},qe.current))})(),()=>clearTimeout(Ie)},[y,p,u,tt,Ne,Ee]),Yt.useEffect(()=>{u.delete&&(Ee(),u.onDismiss==null||u.onDismiss.call(u,u))},[Ee,u.delete]);function _e(){var Ie;if(T?.loading){var Pe;return Yt.createElement("div",{className:yd(F?.loader,u==null||(Pe=u.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":tt==="loading"},T.loading)}return Yt.createElement(U4e,{className:yd(F?.loader,u==null||(Ie=u.classNames)==null?void 0:Ie.loader),visible:tt==="loading"})}const We=u.icon||T?.[tt]||G4e(tt);var it,ht;return Yt.createElement("li",{tabIndex:0,ref:et,className:yd(L,Ge,F?.toast,u==null||(e=u.classNames)==null?void 0:e.toast,F?.default,F?.[tt],u==null||(n=u.classNames)==null?void 0:n[tt]),"data-sonner-toast":"","data-rich-colors":(it=u.richColors)!=null?it:k,"data-styled":!(u.jsx||u.unstyled||g),"data-mounted":Z,"data-promise":!!u.promise,"data-swiped":se,"data-removed":V,"data-visible":rt,"data-y-position":X,"data-x-position":we,"data-index":C,"data-front":ke,"data-swiping":ne,"data-dismissible":gt,"data-type":tt,"data-invert":Me,"data-swipe-out":te,"data-swipe-direction":P,"data-expanded":!!(y||O&&Z),"data-testid":u.testId,style:{"--index":C,"--toasts-before":C,"--z-index":B.length-C,"--offset":`${V?ue:Ze.current}px`,"--initial-height":O?"auto":`${De}px`,...v,...u.style},onDragEnd:()=>{pe(!1),q(null),ve.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Ke||!gt||(ce.current=new Date,le(Ze.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),ve.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,Pe,Oe;if(te||!gt)return;ve.current=null;const at=Number(((Ie=et.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((Pe=et.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ft=new Date().getTime()-((Oe=ce.current)==null?void 0:Oe.getTime()),ie=H==="x"?at:Rt,lt=Math.abs(ie)/ft;if(Math.abs(ie)>=r8e||lt>.11){le(Ze.current),u.onDismiss==null||u.onDismiss.call(u,u),z(H==="x"?at>0?"right":"left":Rt>0?"down":"up"),Ee(),re(!0);return}else{var At,vt;(At=et.current)==null||At.style.setProperty("--swipe-amount-x","0px"),(vt=et.current)==null||vt.style.setProperty("--swipe-amount-y","0px")}oe(!1),pe(!1),q(null)},onPointerMove:Ie=>{var Pe,Oe,at;if(!ve.current||!gt||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;const ft=Ie.clientY-ve.current.y,ie=Ie.clientX-ve.current.x;var lt;const At=(lt=t.swipeDirections)!=null?lt:o8e(K);!H&&(Math.abs(ie)>1||Math.abs(ft)>1)&&q(Math.abs(ie)>Math.abs(ft)?"x":"y");let vt={x:0,y:0};const _t=Tt=>1/(1.5+Math.abs(Tt)/20);if(H==="y"){if(At.includes("top")||At.includes("bottom"))if(At.includes("top")&&ft<0||At.includes("bottom")&&ft>0)vt.y=ft;else{const Tt=ft*_t(ft);vt.y=Math.abs(Tt)<Math.abs(ft)?Tt:ft}}else if(H==="x"&&(At.includes("left")||At.includes("right")))if(At.includes("left")&&ie<0||At.includes("right")&&ie>0)vt.x=ie;else{const Tt=ie*_t(ie);vt.x=Math.abs(Tt)<Math.abs(ie)?Tt:ie}(Math.abs(vt.x)>0||Math.abs(vt.y)>0)&&oe(!0),(Oe=et.current)==null||Oe.style.setProperty("--swipe-amount-x",`${vt.x}px`),(at=et.current)==null||at.style.setProperty("--swipe-amount-y",`${vt.y}px`)}},ze&&!u.jsx&&tt!=="loading"?Yt.createElement("button",{"aria-label":G,"data-disabled":Ke,"data-close-button":!0,onClick:Ke||!gt?()=>{}:()=>{Ee(),u.onDismiss==null||u.onDismiss.call(u,u)},className:yd(F?.closeButton,u==null||(a=u.classNames)==null?void 0:a.closeButton)},(ht=T?.close)!=null?ht:q4e):null,(tt||u.icon||u.promise)&&u.icon!==null&&(T?.[tt]!==null||u.icon)?Yt.createElement("div",{"data-icon":"",className:yd(F?.icon,u==null||(r=u.classNames)==null?void 0:r.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||_e():null,u.type!=="loading"?We:null):null,Yt.createElement("div",{"data-content":"",className:yd(F?.content,u==null||(i=u.classNames)==null?void 0:i.content)},Yt.createElement("div",{"data-title":"",className:yd(F?.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?Yt.createElement("div",{"data-description":"",className:yd(N,ot,F?.description,u==null||(A=u.classNames)==null?void 0:A.description)},typeof u.description=="function"?u.description():u.description):null),Yt.isValidElement(u.cancel)?u.cancel:u.cancel&&ZD(u.cancel)?Yt.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||x,onClick:Ie=>{ZD(u.cancel)&>&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ie),Ee())},className:yd(F?.cancelButton,u==null||(s=u.classNames)==null?void 0:s.cancelButton)},u.cancel.label):null,Yt.isValidElement(u.action)?u.action:u.action&&ZD(u.action)?Yt.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||S,onClick:Ie=>{ZD(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ie),!Ie.defaultPrevented&&Ee())},className:yd(F?.actionButton,u==null||(l=u.classNames)==null?void 0:l.actionButton)},u.action.label):null)};function q$(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function s8e(t,e){const n={};return[t,e].forEach((a,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",A=i?t8e:e8e;function s(l){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof l=="number"?`${l}px`:l})}typeof a=="number"||typeof a=="string"?s(a):typeof a=="object"?["top","right","bottom","left"].forEach(l=>{a[l]===void 0?n[`${o}-${l}`]=A:n[`${o}-${l}`]=typeof a[l]=="number"?`${a[l]}px`:a[l]}):s(A)}),n}const c8e=Yt.forwardRef(function(e,n){const{id:a,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:A,closeButton:s,className:l,offset:d,mobileOffset:u,theme:g="light",richColors:p,duration:m,style:h,visibleToasts:b=$4e,toastOptions:C,dir:B=q$(),gap:y=a8e,icons:Q,containerAriaLabel:k="Notifications"}=e,[_,v]=Yt.useState([]),x=Yt.useMemo(()=>a?_.filter(Z=>Z.toasterId===a):_.filter(Z=>!Z.toasterId),[_,a]),S=Yt.useMemo(()=>Array.from(new Set([i].concat(x.filter(Z=>Z.position).map(Z=>Z.position)))),[x,i]),[L,N]=Yt.useState([]),[U,K]=Yt.useState(!1),[R,O]=Yt.useState(!1),[F,T]=Yt.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Yt.useRef(null),H=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=Yt.useRef(null),P=Yt.useRef(!1),z=Yt.useCallback(Z=>{v($=>{var V;return(V=$.find(Ae=>Ae.id===Z.id))!=null&&V.delete||bs.dismiss(Z.id),$.filter(({id:Ae})=>Ae!==Z.id)})},[]);return Yt.useEffect(()=>bs.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{v($=>$.map(V=>V.id===Z.id?{...V,delete:!0}:V))});return}setTimeout(()=>{ebe.flushSync(()=>{v($=>{const V=$.findIndex(Ae=>Ae.id===Z.id);return V!==-1?[...$.slice(0,V),{...$[V],...Z},...$.slice(V+1)]:[Z,...$]})})})}),[_]),Yt.useEffect(()=>{if(g!=="system"){T(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:$})=>{T($?"dark":"light")})}catch{Z.addListener(({matches:V})=>{try{T(V?"dark":"light")}catch(Ae){console.error(Ae)}})}},[g]),Yt.useEffect(()=>{_.length<=1&&K(!1)},[_]),Yt.useEffect(()=>{const Z=$=>{var V;if(o.every(pe=>$[pe]||$.code===pe)){var ne;K(!0),(ne=G.current)==null||ne.focus()}$.code==="Escape"&&(document.activeElement===G.current||(V=G.current)!=null&&V.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[o]),Yt.useEffect(()=>{if(G.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,P.current=!1)}},[G.current]),Yt.createElement("section",{ref:n,"aria-label":`${k} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((Z,$)=>{var V;const[Ae,ne]=Z.split("-");return x.length?Yt.createElement("ol",{key:Z,dir:B==="auto"?q$():B,tabIndex:-1,ref:G,className:l,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":Ae,"data-x-position":ne,style:{"--front-toast-height":`${((V=L[0])==null?void 0:V.height)||0}px`,"--width":`${n8e}px`,"--gap":`${y}px`,...h,...s8e(d,u)},onBlur:pe=>{P.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(P.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||P.current||(P.current=!0,q.current=pe.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{R||K(!1)},onDragEnd:()=>K(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},x.filter(pe=>!pe.position&&$===0||pe.position===Z).map((pe,te)=>{var re,se;return Yt.createElement(A8e,{key:pe.id,icons:Q,index:te,toast:pe,defaultRichColors:p,duration:(re=C?.duration)!=null?re:m,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:r,visibleToasts:b,closeButton:(se=C?.closeButton)!=null?se:s,interacting:R,position:Z,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:z,toasts:x.filter(oe=>oe.position==pe.position),heights:L.filter(oe=>oe.position==pe.position),setHeights:N,expandByDefault:A,gap:y,expanded:U,swipeDirections:e.swipeDirections})})):null}))}),Uf={"claude-code":{name:"Claude Code",badge:"bg-orange-500/15 text-orange-400",aiProviderTypes:["claude-agent-sdk"]},droid:{name:"Droid",badge:"bg-cyan-500/15 text-cyan-400"},opencode:{name:"OpenCode",badge:"bg-emerald-500/15 text-emerald-400",aiProviderTypes:["opencode-sdk"]},"copilot-cli":{name:"GitHub Copilot",badge:"bg-blue-500/15 text-blue-400"},pi:{name:"Pi",badge:"bg-violet-500/15 text-violet-400",aiProviderTypes:["pi-sdk"]},codex:{name:"Codex",badge:"bg-purple-500/15 text-purple-400",aiProviderTypes:["codex-sdk"]},"gemini-cli":{name:"Gemini CLI",badge:"bg-sky-500/15 text-sky-400"}};function q5(t){return t&&t in Uf?Uf[t].name:"Coding Agent"}function SN(t){if(t&&t in Uf){const e=Uf[t];return"aiProviderTypes"in e?e.aiProviderTypes:[]}return[]}const l8e=(t,e="ExitPlanMode",n)=>`YOUR PLAN WAS NOT APPROVED.
|
|
62
|
+
`).replace(JGe,"")}function t$(f,E){return E=e$(E),e$(f)===E}function Br(f,E,w,M,j,W){switch(w){case"children":typeof M=="string"?E==="body"||E==="textarea"&&M===""||wn(f,M):(typeof M=="number"||typeof M=="bigint")&&E!=="body"&&wn(f,""+M);break;case"className":Le(f,"class",M);break;case"tabIndex":Le(f,"tabindex",M);break;case"dir":case"role":case"viewBox":case"width":case"height":Le(f,w,M);break;case"style":pa(f,M,W);break;case"data":if(E!=="object"){Le(f,"data",M);break}case"src":case"href":if(M===""&&(E!=="a"||w!=="href")){f.removeAttribute(w);break}if(M==null||typeof M=="function"||typeof M=="symbol"||typeof M=="boolean"){f.removeAttribute(w);break}M=Mi(""+M),f.setAttribute(w,M);break;case"action":case"formAction":if(typeof M=="function"){f.setAttribute(w,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof W=="function"&&(w==="formAction"?(E!=="input"&&Br(f,E,"name",j.name,j,null),Br(f,E,"formEncType",j.formEncType,j,null),Br(f,E,"formMethod",j.formMethod,j,null),Br(f,E,"formTarget",j.formTarget,j,null)):(Br(f,E,"encType",j.encType,j,null),Br(f,E,"method",j.method,j,null),Br(f,E,"target",j.target,j,null)));if(M==null||typeof M=="symbol"||typeof M=="boolean"){f.removeAttribute(w);break}M=Mi(""+M),f.setAttribute(w,M);break;case"onClick":M!=null&&(f.onclick=Xt);break;case"onScroll":M!=null&&Ra("scroll",f);break;case"onScrollEnd":M!=null&&Ra("scrollend",f);break;case"dangerouslySetInnerHTML":if(M!=null){if(typeof M!="object"||!("__html"in M))throw Error(a(61));if(w=M.__html,w!=null){if(j.children!=null)throw Error(a(60));f.innerHTML=w}}break;case"multiple":f.multiple=M&&typeof M!="function"&&typeof M!="symbol";break;case"muted":f.muted=M&&typeof M!="function"&&typeof M!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(M==null||typeof M=="function"||typeof M=="boolean"||typeof M=="symbol"){f.removeAttribute("xlink:href");break}w=Mi(""+M),f.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",w);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":M!=null&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,""+M):f.removeAttribute(w);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":M&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,""):f.removeAttribute(w);break;case"capture":case"download":M===!0?f.setAttribute(w,""):M!==!1&&M!=null&&typeof M!="function"&&typeof M!="symbol"?f.setAttribute(w,M):f.removeAttribute(w);break;case"cols":case"rows":case"size":case"span":M!=null&&typeof M!="function"&&typeof M!="symbol"&&!isNaN(M)&&1<=M?f.setAttribute(w,M):f.removeAttribute(w);break;case"rowSpan":case"start":M==null||typeof M=="function"||typeof M=="symbol"||isNaN(M)?f.removeAttribute(w):f.setAttribute(w,M);break;case"popover":Ra("beforetoggle",f),Ra("toggle",f),Bn(f,"popover",M);break;case"xlinkActuate":ur(f,"http://www.w3.org/1999/xlink","xlink:actuate",M);break;case"xlinkArcrole":ur(f,"http://www.w3.org/1999/xlink","xlink:arcrole",M);break;case"xlinkRole":ur(f,"http://www.w3.org/1999/xlink","xlink:role",M);break;case"xlinkShow":ur(f,"http://www.w3.org/1999/xlink","xlink:show",M);break;case"xlinkTitle":ur(f,"http://www.w3.org/1999/xlink","xlink:title",M);break;case"xlinkType":ur(f,"http://www.w3.org/1999/xlink","xlink:type",M);break;case"xmlBase":ur(f,"http://www.w3.org/XML/1998/namespace","xml:base",M);break;case"xmlLang":ur(f,"http://www.w3.org/XML/1998/namespace","xml:lang",M);break;case"xmlSpace":ur(f,"http://www.w3.org/XML/1998/namespace","xml:space",M);break;case"is":Bn(f,"is",M);break;case"innerText":case"textContent":break;default:(!(2<w.length)||w[0]!=="o"&&w[0]!=="O"||w[1]!=="n"&&w[1]!=="N")&&(w=rr.get(w)||w,Bn(f,w,M))}}function ZT(f,E,w,M,j,W){switch(w){case"style":pa(f,M,W);break;case"dangerouslySetInnerHTML":if(M!=null){if(typeof M!="object"||!("__html"in M))throw Error(a(61));if(w=M.__html,w!=null){if(j.children!=null)throw Error(a(60));f.innerHTML=w}}break;case"children":typeof M=="string"?wn(f,M):(typeof M=="number"||typeof M=="bigint")&&wn(f,""+M);break;case"onScroll":M!=null&&Ra("scroll",f);break;case"onScrollEnd":M!=null&&Ra("scrollend",f);break;case"onClick":M!=null&&(f.onclick=Xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hn.hasOwnProperty(w))e:{if(w[0]==="o"&&w[1]==="n"&&(j=w.endsWith("Capture"),E=w.slice(2,j?w.length-7:void 0),W=f[Wt]||null,W=W!=null?W[w]:null,typeof W=="function"&&f.removeEventListener(E,W,j),typeof M=="function")){typeof W!="function"&&W!==null&&(w in f?f[w]=null:f.hasAttribute(w)&&f.removeAttribute(w)),f.addEventListener(E,M,j);break e}w in f?f[w]=M:M===!0?f.setAttribute(w,""):Bn(f,w,M)}}}function Ko(f,E,w){switch(E){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ra("error",f),Ra("load",f);var M=!1,j=!1,W;for(W in w)if(w.hasOwnProperty(W)){var ge=w[W];if(ge!=null)switch(W){case"src":M=!0;break;case"srcSet":j=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,E));default:Br(f,E,W,ge,w,null)}}j&&Br(f,E,"srcSet",w.srcSet,w,null),M&&Br(f,E,"src",w.src,w,null);return;case"input":Ra("invalid",f);var xe=W=ge=j=null,Ve=null,wt=null;for(M in w)if(w.hasOwnProperty(M)){var Ot=w[M];if(Ot!=null)switch(M){case"name":j=Ot;break;case"type":ge=Ot;break;case"checked":Ve=Ot;break;case"defaultChecked":wt=Ot;break;case"value":W=Ot;break;case"defaultValue":xe=Ot;break;case"children":case"dangerouslySetInnerHTML":if(Ot!=null)throw Error(a(137,E));break;default:Br(f,E,M,Ot,w,null)}}Zr(f,W,xe,Ve,wt,ge,j,!1);return;case"select":Ra("invalid",f),M=ge=W=null;for(j in w)if(w.hasOwnProperty(j)&&(xe=w[j],xe!=null))switch(j){case"value":W=xe;break;case"defaultValue":ge=xe;break;case"multiple":M=xe;default:Br(f,E,j,xe,w,null)}E=W,w=ge,f.multiple=!!M,E!=null?Dr(f,!!M,E,!1):w!=null&&Dr(f,!!M,w,!0);return;case"textarea":Ra("invalid",f),W=j=M=null;for(ge in w)if(w.hasOwnProperty(ge)&&(xe=w[ge],xe!=null))switch(ge){case"value":M=xe;break;case"defaultValue":j=xe;break;case"children":W=xe;break;case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(91));break;default:Br(f,E,ge,xe,w,null)}ar(f,M,j,W);return;case"option":for(Ve in w)if(w.hasOwnProperty(Ve)&&(M=w[Ve],M!=null))switch(Ve){case"selected":f.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Br(f,E,Ve,M,w,null)}return;case"dialog":Ra("beforetoggle",f),Ra("toggle",f),Ra("cancel",f),Ra("close",f);break;case"iframe":case"object":Ra("load",f);break;case"video":case"audio":for(M=0;M<Dy.length;M++)Ra(Dy[M],f);break;case"image":Ra("error",f),Ra("load",f);break;case"details":Ra("toggle",f);break;case"embed":case"source":case"link":Ra("error",f),Ra("load",f);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(wt in w)if(w.hasOwnProperty(wt)&&(M=w[wt],M!=null))switch(wt){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,E));default:Br(f,E,wt,M,w,null)}return;default:if(Ua(E)){for(Ot in w)w.hasOwnProperty(Ot)&&(M=w[Ot],M!==void 0&&ZT(f,E,Ot,M,w,void 0));return}}for(xe in w)w.hasOwnProperty(xe)&&(M=w[xe],M!=null&&Br(f,E,xe,M,w,null))}function WGe(f,E,w,M){switch(E){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var j=null,W=null,ge=null,xe=null,Ve=null,wt=null,Ot=null;for(Nt in w){var jt=w[Nt];if(w.hasOwnProperty(Nt)&&jt!=null)switch(Nt){case"checked":break;case"value":break;case"defaultValue":Ve=jt;default:M.hasOwnProperty(Nt)||Br(f,E,Nt,null,M,jt)}}for(var St in M){var Nt=M[St];if(jt=w[St],M.hasOwnProperty(St)&&(Nt!=null||jt!=null))switch(St){case"type":W=Nt;break;case"name":j=Nt;break;case"checked":wt=Nt;break;case"defaultChecked":Ot=Nt;break;case"value":ge=Nt;break;case"defaultValue":xe=Nt;break;case"children":case"dangerouslySetInnerHTML":if(Nt!=null)throw Error(a(137,E));break;default:Nt!==jt&&Br(f,E,St,Nt,M,jt)}}$i(f,ge,xe,Ve,wt,Ot,W,j);return;case"select":Nt=ge=xe=St=null;for(W in w)if(Ve=w[W],w.hasOwnProperty(W)&&Ve!=null)switch(W){case"value":break;case"multiple":Nt=Ve;default:M.hasOwnProperty(W)||Br(f,E,W,null,M,Ve)}for(j in M)if(W=M[j],Ve=w[j],M.hasOwnProperty(j)&&(W!=null||Ve!=null))switch(j){case"value":St=W;break;case"defaultValue":xe=W;break;case"multiple":ge=W;default:W!==Ve&&Br(f,E,j,W,M,Ve)}E=xe,w=ge,M=Nt,St!=null?Dr(f,!!w,St,!1):!!M!=!!w&&(E!=null?Dr(f,!!w,E,!0):Dr(f,!!w,w?[]:"",!1));return;case"textarea":Nt=St=null;for(xe in w)if(j=w[xe],w.hasOwnProperty(xe)&&j!=null&&!M.hasOwnProperty(xe))switch(xe){case"value":break;case"children":break;default:Br(f,E,xe,null,M,j)}for(ge in M)if(j=M[ge],W=w[ge],M.hasOwnProperty(ge)&&(j!=null||W!=null))switch(ge){case"value":St=j;break;case"defaultValue":Nt=j;break;case"children":break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:j!==W&&Br(f,E,ge,j,M,W)}Ks(f,St,Nt);return;case"option":for(var Dn in w)if(St=w[Dn],w.hasOwnProperty(Dn)&&St!=null&&!M.hasOwnProperty(Dn))switch(Dn){case"selected":f.selected=!1;break;default:Br(f,E,Dn,null,M,St)}for(Ve in M)if(St=M[Ve],Nt=w[Ve],M.hasOwnProperty(Ve)&&St!==Nt&&(St!=null||Nt!=null))switch(Ve){case"selected":f.selected=St&&typeof St!="function"&&typeof St!="symbol";break;default:Br(f,E,Ve,St,M,Nt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xn in w)St=w[Xn],w.hasOwnProperty(Xn)&&St!=null&&!M.hasOwnProperty(Xn)&&Br(f,E,Xn,null,M,St);for(wt in M)if(St=M[wt],Nt=w[wt],M.hasOwnProperty(wt)&&St!==Nt&&(St!=null||Nt!=null))switch(wt){case"children":case"dangerouslySetInnerHTML":if(St!=null)throw Error(a(137,E));break;default:Br(f,E,wt,St,M,Nt)}return;default:if(Ua(E)){for(var yr in w)St=w[yr],w.hasOwnProperty(yr)&&St!==void 0&&!M.hasOwnProperty(yr)&&ZT(f,E,yr,void 0,M,St);for(Ot in M)St=M[Ot],Nt=w[Ot],!M.hasOwnProperty(Ot)||St===Nt||St===void 0&&Nt===void 0||ZT(f,E,Ot,St,M,Nt);return}}for(var mt in w)St=w[mt],w.hasOwnProperty(mt)&&St!=null&&!M.hasOwnProperty(mt)&&Br(f,E,mt,null,M,St);for(jt in M)St=M[jt],Nt=w[jt],!M.hasOwnProperty(jt)||St===Nt||St==null&&Nt==null||Br(f,E,jt,St,M,Nt)}function n$(f){switch(f){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ZGe(){if(typeof performance.getEntriesByType=="function"){for(var f=0,E=0,w=performance.getEntriesByType("resource"),M=0;M<w.length;M++){var j=w[M],W=j.transferSize,ge=j.initiatorType,xe=j.duration;if(W&&xe&&n$(ge)){for(ge=0,xe=j.responseEnd,M+=1;M<w.length;M++){var Ve=w[M],wt=Ve.startTime;if(wt>xe)break;var Ot=Ve.transferSize,jt=Ve.initiatorType;Ot&&n$(jt)&&(Ve=Ve.responseEnd,ge+=Ot*(Ve<xe?1:(xe-wt)/(Ve-wt)))}if(--M,E+=8*(W+ge)/(j.duration/1e3),f++,10<f)break}}if(0<f)return E/f/1e6}return navigator.connection&&(f=navigator.connection.downlink,typeof f=="number")?f:5}var VT=null,XT=null;function LD(f){return f.nodeType===9?f:f.ownerDocument}function a$(f){switch(f){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function r$(f,E){if(f===0)switch(E){case"svg":return 1;case"math":return 2;default:return 0}return f===1&&E==="foreignObject"?0:f}function $T(f,E){return f==="textarea"||f==="noscript"||typeof E.children=="string"||typeof E.children=="number"||typeof E.children=="bigint"||typeof E.dangerouslySetInnerHTML=="object"&&E.dangerouslySetInnerHTML!==null&&E.dangerouslySetInnerHTML.__html!=null}var e3=null;function VGe(){var f=window.event;return f&&f.type==="popstate"?f===e3?!1:(e3=f,!0):(e3=null,!1)}var i$=typeof setTimeout=="function"?setTimeout:void 0,XGe=typeof clearTimeout=="function"?clearTimeout:void 0,o$=typeof Promise=="function"?Promise:void 0,$Ge=typeof queueMicrotask=="function"?queueMicrotask:typeof o$<"u"?function(f){return o$.resolve(null).then(f).catch(e4e)}:i$;function e4e(f){setTimeout(function(){throw f})}function Dp(f){return f==="head"}function A$(f,E){var w=E,M=0;do{var j=w.nextSibling;if(f.removeChild(w),j&&j.nodeType===8)if(w=j.data,w==="/$"||w==="/&"){if(M===0){f.removeChild(j),NC(E);return}M--}else if(w==="$"||w==="$?"||w==="$~"||w==="$!"||w==="&")M++;else if(w==="html")Sy(f.ownerDocument.documentElement);else if(w==="head"){w=f.ownerDocument.head,Sy(w);for(var W=w.firstChild;W;){var ge=W.nextSibling,xe=W.nodeName;W[Et]||xe==="SCRIPT"||xe==="STYLE"||xe==="LINK"&&W.rel.toLowerCase()==="stylesheet"||w.removeChild(W),W=ge}}else w==="body"&&Sy(f.ownerDocument.body);w=j}while(w);NC(E)}function s$(f,E){var w=f;f=0;do{var M=w.nextSibling;if(w.nodeType===1?E?(w._stashedDisplay=w.style.display,w.style.display="none"):(w.style.display=w._stashedDisplay||"",w.getAttribute("style")===""&&w.removeAttribute("style")):w.nodeType===3&&(E?(w._stashedText=w.nodeValue,w.nodeValue=""):w.nodeValue=w._stashedText||""),M&&M.nodeType===8)if(w=M.data,w==="/$"){if(f===0)break;f--}else w!=="$"&&w!=="$?"&&w!=="$~"&&w!=="$!"||f++;w=M}while(w)}function t3(f){var E=f.firstChild;for(E&&E.nodeType===10&&(E=E.nextSibling);E;){var w=E;switch(E=E.nextSibling,w.nodeName){case"HTML":case"HEAD":case"BODY":t3(w),fe(w);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(w.rel.toLowerCase()==="stylesheet")continue}f.removeChild(w)}}function t4e(f,E,w,M){for(;f.nodeType===1;){var j=w;if(f.nodeName.toLowerCase()!==E.toLowerCase()){if(!M&&(f.nodeName!=="INPUT"||f.type!=="hidden"))break}else if(M){if(!f[Et])switch(E){case"meta":if(!f.hasAttribute("itemprop"))break;return f;case"link":if(W=f.getAttribute("rel"),W==="stylesheet"&&f.hasAttribute("data-precedence"))break;if(W!==j.rel||f.getAttribute("href")!==(j.href==null||j.href===""?null:j.href)||f.getAttribute("crossorigin")!==(j.crossOrigin==null?null:j.crossOrigin)||f.getAttribute("title")!==(j.title==null?null:j.title))break;return f;case"style":if(f.hasAttribute("data-precedence"))break;return f;case"script":if(W=f.getAttribute("src"),(W!==(j.src==null?null:j.src)||f.getAttribute("type")!==(j.type==null?null:j.type)||f.getAttribute("crossorigin")!==(j.crossOrigin==null?null:j.crossOrigin))&&W&&f.hasAttribute("async")&&!f.hasAttribute("itemprop"))break;return f;default:return f}}else if(E==="input"&&f.type==="hidden"){var W=j.name==null?null:""+j.name;if(j.type==="hidden"&&f.getAttribute("name")===W)return f}else return f;if(f=Nc(f.nextSibling),f===null)break}return null}function n4e(f,E,w){if(E==="")return null;for(;f.nodeType!==3;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!w||(f=Nc(f.nextSibling),f===null))return null;return f}function c$(f,E){for(;f.nodeType!==8;)if((f.nodeType!==1||f.nodeName!=="INPUT"||f.type!=="hidden")&&!E||(f=Nc(f.nextSibling),f===null))return null;return f}function n3(f){return f.data==="$?"||f.data==="$~"}function a3(f){return f.data==="$!"||f.data==="$?"&&f.ownerDocument.readyState!=="loading"}function a4e(f,E){var w=f.ownerDocument;if(f.data==="$~")f._reactRetry=E;else if(f.data!=="$?"||w.readyState!=="loading")E();else{var M=function(){E(),w.removeEventListener("DOMContentLoaded",M)};w.addEventListener("DOMContentLoaded",M),f._reactRetry=M}}function Nc(f){for(;f!=null;f=f.nextSibling){var E=f.nodeType;if(E===1||E===3)break;if(E===8){if(E=f.data,E==="$"||E==="$!"||E==="$?"||E==="$~"||E==="&"||E==="F!"||E==="F")break;if(E==="/$"||E==="/&")return null}}return f}var r3=null;function l$(f){f=f.nextSibling;for(var E=0;f;){if(f.nodeType===8){var w=f.data;if(w==="/$"||w==="/&"){if(E===0)return Nc(f.nextSibling);E--}else w!=="$"&&w!=="$!"&&w!=="$?"&&w!=="$~"&&w!=="&"||E++}f=f.nextSibling}return null}function d$(f){f=f.previousSibling;for(var E=0;f;){if(f.nodeType===8){var w=f.data;if(w==="$"||w==="$!"||w==="$?"||w==="$~"||w==="&"){if(E===0)return f;E--}else w!=="/$"&&w!=="/&"||E++}f=f.previousSibling}return null}function u$(f,E,w){switch(E=LD(w),f){case"html":if(f=E.documentElement,!f)throw Error(a(452));return f;case"head":if(f=E.head,!f)throw Error(a(453));return f;case"body":if(f=E.body,!f)throw Error(a(454));return f;default:throw Error(a(451))}}function Sy(f){for(var E=f.attributes;E.length;)f.removeAttributeNode(E[0]);fe(f)}var Mc=new Map,g$=new Set;function TD(f){return typeof f.getRootNode=="function"?f.getRootNode():f.nodeType===9?f:f.ownerDocument}var Ju=T.d;T.d={f:r4e,r:i4e,D:o4e,C:A4e,L:s4e,m:c4e,X:d4e,S:l4e,M:u4e};function r4e(){var f=Ju.f(),E=DD();return f||E}function i4e(f){var E=Dt(f);E!==null&&E.tag===5&&E.type==="form"?SV(E):Ju.r(f)}var SC=typeof document>"u"?null:document;function p$(f,E,w){var M=SC;if(M&&typeof E=="string"&&E){var j=vr(E);j='link[rel="'+f+'"][href="'+j+'"]',typeof w=="string"&&(j+='[crossorigin="'+w+'"]'),g$.has(j)||(g$.add(j),f={rel:f,crossOrigin:w,href:E},M.querySelector(j)===null&&(E=M.createElement("link"),Ko(E,"link",f),on(E),M.head.appendChild(E)))}}function o4e(f){Ju.D(f),p$("dns-prefetch",f,null)}function A4e(f,E){Ju.C(f,E),p$("preconnect",f,E)}function s4e(f,E,w){Ju.L(f,E,w);var M=SC;if(M&&f&&E){var j='link[rel="preload"][as="'+vr(E)+'"]';E==="image"&&w&&w.imageSrcSet?(j+='[imagesrcset="'+vr(w.imageSrcSet)+'"]',typeof w.imageSizes=="string"&&(j+='[imagesizes="'+vr(w.imageSizes)+'"]')):j+='[href="'+vr(f)+'"]';var W=j;switch(E){case"style":W=_C(f);break;case"script":W=RC(f)}Mc.has(W)||(f=u({rel:"preload",href:E==="image"&&w&&w.imageSrcSet?void 0:f,as:E},w),Mc.set(W,f),M.querySelector(j)!==null||E==="style"&&M.querySelector(_y(W))||E==="script"&&M.querySelector(Ry(W))||(E=M.createElement("link"),Ko(E,"link",f),on(E),M.head.appendChild(E)))}}function c4e(f,E){Ju.m(f,E);var w=SC;if(w&&f){var M=E&&typeof E.as=="string"?E.as:"script",j='link[rel="modulepreload"][as="'+vr(M)+'"][href="'+vr(f)+'"]',W=j;switch(M){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":W=RC(f)}if(!Mc.has(W)&&(f=u({rel:"modulepreload",href:f},E),Mc.set(W,f),w.querySelector(j)===null)){switch(M){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(w.querySelector(Ry(W)))return}M=w.createElement("link"),Ko(M,"link",f),on(M),w.head.appendChild(M)}}}function l4e(f,E,w){Ju.S(f,E,w);var M=SC;if(M&&f){var j=dn(M).hoistableStyles,W=_C(f);E=E||"default";var ge=j.get(W);if(!ge){var xe={loading:0,preload:null};if(ge=M.querySelector(_y(W)))xe.loading=5;else{f=u({rel:"stylesheet",href:f,"data-precedence":E},w),(w=Mc.get(W))&&i3(f,w);var Ve=ge=M.createElement("link");on(Ve),Ko(Ve,"link",f),Ve._p=new Promise(function(wt,Ot){Ve.onload=wt,Ve.onerror=Ot}),Ve.addEventListener("load",function(){xe.loading|=1}),Ve.addEventListener("error",function(){xe.loading|=2}),xe.loading|=4,GD(ge,E,M)}ge={type:"stylesheet",instance:ge,count:1,state:xe},j.set(W,ge)}}}function d4e(f,E){Ju.X(f,E);var w=SC;if(w&&f){var M=dn(w).hoistableScripts,j=RC(f),W=M.get(j);W||(W=w.querySelector(Ry(j)),W||(f=u({src:f,async:!0},E),(E=Mc.get(j))&&o3(f,E),W=w.createElement("script"),on(W),Ko(W,"link",f),w.head.appendChild(W)),W={type:"script",instance:W,count:1,state:null},M.set(j,W))}}function u4e(f,E){Ju.M(f,E);var w=SC;if(w&&f){var M=dn(w).hoistableScripts,j=RC(f),W=M.get(j);W||(W=w.querySelector(Ry(j)),W||(f=u({src:f,async:!0,type:"module"},E),(E=Mc.get(j))&&o3(f,E),W=w.createElement("script"),on(W),Ko(W,"link",f),w.head.appendChild(W)),W={type:"script",instance:W,count:1,state:null},M.set(j,W))}}function m$(f,E,w,M){var j=(j=Ae.current)?TD(j):null;if(!j)throw Error(a(446));switch(f){case"meta":case"title":return null;case"style":return typeof w.precedence=="string"&&typeof w.href=="string"?(E=_C(w.href),w=dn(j).hoistableStyles,M=w.get(E),M||(M={type:"style",instance:null,count:0,state:null},w.set(E,M)),M):{type:"void",instance:null,count:0,state:null};case"link":if(w.rel==="stylesheet"&&typeof w.href=="string"&&typeof w.precedence=="string"){f=_C(w.href);var W=dn(j).hoistableStyles,ge=W.get(f);if(ge||(j=j.ownerDocument||j,ge={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},W.set(f,ge),(W=j.querySelector(_y(f)))&&!W._p&&(ge.instance=W,ge.state.loading=5),Mc.has(f)||(w={rel:"preload",as:"style",href:w.href,crossOrigin:w.crossOrigin,integrity:w.integrity,media:w.media,hrefLang:w.hrefLang,referrerPolicy:w.referrerPolicy},Mc.set(f,w),W||g4e(j,f,w,ge.state))),E&&M===null)throw Error(a(528,""));return ge}if(E&&M!==null)throw Error(a(529,""));return null;case"script":return E=w.async,w=w.src,typeof w=="string"&&E&&typeof E!="function"&&typeof E!="symbol"?(E=RC(w),w=dn(j).hoistableScripts,M=w.get(E),M||(M={type:"script",instance:null,count:0,state:null},w.set(E,M)),M):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,f))}}function _C(f){return'href="'+vr(f)+'"'}function _y(f){return'link[rel="stylesheet"]['+f+"]"}function h$(f){return u({},f,{"data-precedence":f.precedence,precedence:null})}function g4e(f,E,w,M){f.querySelector('link[rel="preload"][as="style"]['+E+"]")?M.loading=1:(E=f.createElement("link"),M.preload=E,E.addEventListener("load",function(){return M.loading|=1}),E.addEventListener("error",function(){return M.loading|=2}),Ko(E,"link",w),on(E),f.head.appendChild(E))}function RC(f){return'[src="'+vr(f)+'"]'}function Ry(f){return"script[async]"+f}function f$(f,E,w){if(E.count++,E.instance===null)switch(E.type){case"style":var M=f.querySelector('style[data-href~="'+vr(w.href)+'"]');if(M)return E.instance=M,on(M),M;var j=u({},w,{"data-href":w.href,"data-precedence":w.precedence,href:null,precedence:null});return M=(f.ownerDocument||f).createElement("style"),on(M),Ko(M,"style",j),GD(M,w.precedence,f),E.instance=M;case"stylesheet":j=_C(w.href);var W=f.querySelector(_y(j));if(W)return E.state.loading|=4,E.instance=W,on(W),W;M=h$(w),(j=Mc.get(j))&&i3(M,j),W=(f.ownerDocument||f).createElement("link"),on(W);var ge=W;return ge._p=new Promise(function(xe,Ve){ge.onload=xe,ge.onerror=Ve}),Ko(W,"link",M),E.state.loading|=4,GD(W,w.precedence,f),E.instance=W;case"script":return W=RC(w.src),(j=f.querySelector(Ry(W)))?(E.instance=j,on(j),j):(M=w,(j=Mc.get(W))&&(M=u({},w),o3(M,j)),f=f.ownerDocument||f,j=f.createElement("script"),on(j),Ko(j,"link",M),f.head.appendChild(j),E.instance=j);case"void":return null;default:throw Error(a(443,E.type))}else E.type==="stylesheet"&&(E.state.loading&4)===0&&(M=E.instance,E.state.loading|=4,GD(M,w.precedence,f));return E.instance}function GD(f,E,w){for(var M=w.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=M.length?M[M.length-1]:null,W=j,ge=0;ge<M.length;ge++){var xe=M[ge];if(xe.dataset.precedence===E)W=xe;else if(W!==j)break}W?W.parentNode.insertBefore(f,W.nextSibling):(E=w.nodeType===9?w.head:w,E.insertBefore(f,E.firstChild))}function i3(f,E){f.crossOrigin==null&&(f.crossOrigin=E.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=E.referrerPolicy),f.title==null&&(f.title=E.title)}function o3(f,E){f.crossOrigin==null&&(f.crossOrigin=E.crossOrigin),f.referrerPolicy==null&&(f.referrerPolicy=E.referrerPolicy),f.integrity==null&&(f.integrity=E.integrity)}var OD=null;function b$(f,E,w){if(OD===null){var M=new Map,j=OD=new Map;j.set(w,M)}else j=OD,M=j.get(w),M||(M=new Map,j.set(w,M));if(M.has(f))return M;for(M.set(f,null),w=w.getElementsByTagName(f),j=0;j<w.length;j++){var W=w[j];if(!(W[Et]||W[Mt]||f==="link"&&W.getAttribute("rel")==="stylesheet")&&W.namespaceURI!=="http://www.w3.org/2000/svg"){var ge=W.getAttribute(E)||"";ge=f+ge;var xe=M.get(ge);xe?xe.push(W):M.set(ge,[W])}}return M}function C$(f,E,w){f=f.ownerDocument||f,f.head.insertBefore(w,E==="title"?f.querySelector("head > title"):null)}function p4e(f,E,w){if(w===1||E.itemProp!=null)return!1;switch(f){case"meta":case"title":return!0;case"style":if(typeof E.precedence!="string"||typeof E.href!="string"||E.href==="")break;return!0;case"link":if(typeof E.rel!="string"||typeof E.href!="string"||E.href===""||E.onLoad||E.onError)break;switch(E.rel){case"stylesheet":return f=E.disabled,typeof E.precedence=="string"&&f==null;default:return!0}case"script":if(E.async&&typeof E.async!="function"&&typeof E.async!="symbol"&&!E.onLoad&&!E.onError&&E.src&&typeof E.src=="string")return!0}return!1}function E$(f){return!(f.type==="stylesheet"&&(f.state.loading&3)===0)}function m4e(f,E,w,M){if(w.type==="stylesheet"&&(typeof M.media!="string"||matchMedia(M.media).matches!==!1)&&(w.state.loading&4)===0){if(w.instance===null){var j=_C(M.href),W=E.querySelector(_y(j));if(W){E=W._p,E!==null&&typeof E=="object"&&typeof E.then=="function"&&(f.count++,f=UD.bind(f),E.then(f,f)),w.state.loading|=4,w.instance=W,on(W);return}W=E.ownerDocument||E,M=h$(M),(j=Mc.get(j))&&i3(M,j),W=W.createElement("link"),on(W);var ge=W;ge._p=new Promise(function(xe,Ve){ge.onload=xe,ge.onerror=Ve}),Ko(W,"link",M),w.instance=W}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(w,E),(E=w.state.preload)&&(w.state.loading&3)===0&&(f.count++,w=UD.bind(f),E.addEventListener("load",w),E.addEventListener("error",w))}}var A3=0;function h4e(f,E){return f.stylesheets&&f.count===0&&KD(f,f.stylesheets),0<f.count||0<f.imgCount?function(w){var M=setTimeout(function(){if(f.stylesheets&&KD(f,f.stylesheets),f.unsuspend){var W=f.unsuspend;f.unsuspend=null,W()}},6e4+E);0<f.imgBytes&&A3===0&&(A3=62500*ZGe());var j=setTimeout(function(){if(f.waitingForImages=!1,f.count===0&&(f.stylesheets&&KD(f,f.stylesheets),f.unsuspend)){var W=f.unsuspend;f.unsuspend=null,W()}},(f.imgBytes>A3?50:800)+E);return f.unsuspend=w,function(){f.unsuspend=null,clearTimeout(M),clearTimeout(j)}}:null}function UD(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)KD(this,this.stylesheets);else if(this.unsuspend){var f=this.unsuspend;this.unsuspend=null,f()}}}var PD=null;function KD(f,E){f.stylesheets=null,f.unsuspend!==null&&(f.count++,PD=new Map,E.forEach(f4e,f),PD=null,UD.call(f))}function f4e(f,E){if(!(E.state.loading&4)){var w=PD.get(f);if(w)var M=w.get(null);else{w=new Map,PD.set(f,w);for(var j=f.querySelectorAll("link[data-precedence],style[data-precedence]"),W=0;W<j.length;W++){var ge=j[W];(ge.nodeName==="LINK"||ge.getAttribute("media")!=="not all")&&(w.set(ge.dataset.precedence,ge),M=ge)}M&&w.set(null,M)}j=E.instance,ge=j.getAttribute("data-precedence"),W=w.get(ge)||M,W===M&&w.set(null,j),w.set(ge,j),this.count++,M=UD.bind(this),j.addEventListener("load",M),j.addEventListener("error",M),W?W.parentNode.insertBefore(j,W.nextSibling):(f=f.nodeType===9?f.head:f,f.insertBefore(j,f.firstChild)),E.state.loading|=4}}var Ny={$$typeof:y,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function b4e(f,E,w,M,j,W,ge,xe,Ve){this.tag=1,this.containerInfo=f,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.hiddenUpdates=Rt(null),this.identifierPrefix=M,this.onUncaughtError=j,this.onCaughtError=W,this.onRecoverableError=ge,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ve,this.incompleteTransitions=new Map}function I$(f,E,w,M,j,W,ge,xe,Ve,wt,Ot,jt){return f=new b4e(f,E,w,ge,Ve,wt,Ot,jt,xe),E=1,W===!0&&(E|=24),W=xA(3,null,null,E),f.current=W,W.stateNode=f,E=UL(),E.refCount++,f.pooledCache=E,E.refCount++,W.memoizedState={element:M,isDehydrated:w,cache:E},YL(W),f}function B$(f){return f?(f=to,f):to}function y$(f,E,w,M,j,W){j=B$(j),M.context===null?M.context=j:M.pendingContext=j,M=fp(E),M.payload={element:w},W=W===void 0?null:W,W!==null&&(M.callback=W),w=bp(f,M,E),w!==null&&(ps(w,f,E),dy(w,f,E))}function Q$(f,E){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var w=f.retryLane;f.retryLane=w!==0&&w<E?w:E}}function s3(f,E){Q$(f,E),(f=f.alternate)&&Q$(f,E)}function w$(f){if(f.tag===13||f.tag===31){var E=Cd(f,67108864);E!==null&&ps(E,f,67108864),s3(f,67108864)}}function k$(f){if(f.tag===13||f.tag===31){var E=Js();E=_t(E);var w=Cd(f,E);w!==null&&ps(w,f,E),s3(f,E)}}var HD=!0;function C4e(f,E,w,M){var j=F.T;F.T=null;var W=T.p;try{T.p=2,c3(f,E,w,M)}finally{T.p=W,F.T=j}}function E4e(f,E,w,M){var j=F.T;F.T=null;var W=T.p;try{T.p=8,c3(f,E,w,M)}finally{T.p=W,F.T=j}}function c3(f,E,w,M){if(HD){var j=l3(M);if(j===null)WT(f,E,M,YD,w),D$(f,M);else if(B4e(j,f,E,w,M))M.stopPropagation();else if(D$(f,M),E&4&&-1<I4e.indexOf(f)){for(;j!==null;){var W=Dt(j);if(W!==null)switch(W.tag){case 3:if(W=W.stateNode,W.current.memoizedState.isDehydrated){var ge=ht(W.pendingLanes);if(ge!==0){var xe=W;for(xe.pendingLanes|=2,xe.entangledLanes|=2;ge;){var Ve=1<<31-Ne(ge);xe.entanglements[1]|=Ve,ge&=~Ve}Bd(W),(nr&6)===0&&(kD=Ge()+500,vy(0))}}break;case 31:case 13:xe=Cd(W,2),xe!==null&&ps(xe,W,2),DD(),s3(W,2)}if(W=l3(M),W===null&&WT(f,E,M,YD,w),W===j)break;j=W}j!==null&&M.stopPropagation()}else WT(f,E,M,null,w)}}function l3(f){return f=ee(f),d3(f)}var YD=null;function d3(f){if(YD=null,f=$e(f),f!==null){var E=i(f);if(E===null)f=null;else{var w=E.tag;if(w===13){if(f=o(E),f!==null)return f;f=null}else if(w===31){if(f=A(E),f!==null)return f;f=null}else if(w===3){if(E.stateNode.current.memoizedState.isDehydrated)return E.tag===3?E.stateNode.containerInfo:null;f=null}else E!==f&&(f=null)}}return YD=f,null}function v$(f){switch(f){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ot()){case He:return 2;case ze:return 8;case ut:case Se:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var u3=!1,xp=null,Sp=null,_p=null,My=new Map,Fy=new Map,Rp=[],I4e="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".split(" ");function D$(f,E){switch(f){case"focusin":case"focusout":xp=null;break;case"dragenter":case"dragleave":Sp=null;break;case"mouseover":case"mouseout":_p=null;break;case"pointerover":case"pointerout":My.delete(E.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fy.delete(E.pointerId)}}function Ly(f,E,w,M,j,W){return f===null||f.nativeEvent!==W?(f={blockedOn:E,domEventName:w,eventSystemFlags:M,nativeEvent:W,targetContainers:[j]},E!==null&&(E=Dt(E),E!==null&&w$(E)),f):(f.eventSystemFlags|=M,E=f.targetContainers,j!==null&&E.indexOf(j)===-1&&E.push(j),f)}function B4e(f,E,w,M,j){switch(E){case"focusin":return xp=Ly(xp,f,E,w,M,j),!0;case"dragenter":return Sp=Ly(Sp,f,E,w,M,j),!0;case"mouseover":return _p=Ly(_p,f,E,w,M,j),!0;case"pointerover":var W=j.pointerId;return My.set(W,Ly(My.get(W)||null,f,E,w,M,j)),!0;case"gotpointercapture":return W=j.pointerId,Fy.set(W,Ly(Fy.get(W)||null,f,E,w,M,j)),!0}return!1}function x$(f){var E=$e(f.target);if(E!==null){var w=i(E);if(w!==null){if(E=w.tag,E===13){if(E=o(w),E!==null){f.blockedOn=E,$t(f.priority,function(){k$(w)});return}}else if(E===31){if(E=A(w),E!==null){f.blockedOn=E,$t(f.priority,function(){k$(w)});return}}else if(E===3&&w.stateNode.current.memoizedState.isDehydrated){f.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}f.blockedOn=null}function qD(f){if(f.blockedOn!==null)return!1;for(var E=f.targetContainers;0<E.length;){var w=l3(f.nativeEvent);if(w===null){w=f.nativeEvent;var M=new w.constructor(w.type,w);J=M,w.target.dispatchEvent(M),J=null}else return E=Dt(w),E!==null&&w$(E),f.blockedOn=w,!1;E.shift()}return!0}function S$(f,E,w){qD(f)&&w.delete(E)}function y4e(){u3=!1,xp!==null&&qD(xp)&&(xp=null),Sp!==null&&qD(Sp)&&(Sp=null),_p!==null&&qD(_p)&&(_p=null),My.forEach(S$),Fy.forEach(S$)}function jD(f,E){f.blockedOn===E&&(f.blockedOn=null,u3||(u3=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,y4e)))}var zD=null;function _$(f){zD!==f&&(zD=f,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zD===f&&(zD=null);for(var E=0;E<f.length;E+=3){var w=f[E],M=f[E+1],j=f[E+2];if(typeof M!="function"){if(d3(M||w)===null)continue;break}var W=Dt(w);W!==null&&(f.splice(E,3),E-=3,lT(W,{pending:!0,data:j,method:w.method,action:M},M,j))}}))}function NC(f){function E(Ve){return jD(Ve,f)}xp!==null&&jD(xp,f),Sp!==null&&jD(Sp,f),_p!==null&&jD(_p,f),My.forEach(E),Fy.forEach(E);for(var w=0;w<Rp.length;w++){var M=Rp[w];M.blockedOn===f&&(M.blockedOn=null)}for(;0<Rp.length&&(w=Rp[0],w.blockedOn===null);)x$(w),w.blockedOn===null&&Rp.shift();if(w=(f.ownerDocument||f).$$reactFormReplay,w!=null)for(M=0;M<w.length;M+=3){var j=w[M],W=w[M+1],ge=j[Wt]||null;if(typeof W=="function")ge||_$(w);else if(ge){var xe=null;if(W&&W.hasAttribute("formAction")){if(j=W,ge=W[Wt]||null)xe=ge.formAction;else if(d3(j)!==null)continue}else xe=ge.action;typeof xe=="function"?w[M+1]=xe:(w.splice(M,3),M-=3),_$(w)}}}function R$(){function f(W){W.canIntercept&&W.info==="react-transition"&&W.intercept({handler:function(){return new Promise(function(ge){return j=ge})},focusReset:"manual",scroll:"manual"})}function E(){j!==null&&(j(),j=null),M||setTimeout(w,20)}function w(){if(!M&&!navigation.transition){var W=navigation.currentEntry;W&&W.url!=null&&navigation.navigate(W.url,{state:W.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var M=!1,j=null;return navigation.addEventListener("navigate",f),navigation.addEventListener("navigatesuccess",E),navigation.addEventListener("navigateerror",E),setTimeout(w,100),function(){M=!0,navigation.removeEventListener("navigate",f),navigation.removeEventListener("navigatesuccess",E),navigation.removeEventListener("navigateerror",E),j!==null&&(j(),j=null)}}}function g3(f){this._internalRoot=f}JD.prototype.render=g3.prototype.render=function(f){var E=this._internalRoot;if(E===null)throw Error(a(409));var w=E.current,M=Js();y$(w,M,f,E,null,null)},JD.prototype.unmount=g3.prototype.unmount=function(){var f=this._internalRoot;if(f!==null){this._internalRoot=null;var E=f.containerInfo;y$(f.current,2,null,f,null,null),DD(),E[vn]=null}};function JD(f){this._internalRoot=f}JD.prototype.unstable_scheduleHydration=function(f){if(f){var E=Kt();f={blockedOn:null,target:f,priority:E};for(var w=0;w<Rp.length&&E!==0&&E<Rp[w].priority;w++);Rp.splice(w,0,f),w===0&&x$(f)}};var N$=e.version;if(N$!=="19.2.3")throw Error(a(527,N$,"19.2.3"));T.findDOMNode=function(f){var E=f._reactInternals;if(E===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=l(E),f=f!==null?d(f):null,f=f===null?null:f.stateNode,f};var Q4e={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var WD=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!WD.isDisabled&&WD.supportsFiber)try{X=WD.inject(Q4e),we=WD}catch{}}return Gy.createRoot=function(f,E){if(!r(f))throw Error(a(299));var w=!1,M="",j=UV,W=PV,ge=KV;return E!=null&&(E.unstable_strictMode===!0&&(w=!0),E.identifierPrefix!==void 0&&(M=E.identifierPrefix),E.onUncaughtError!==void 0&&(j=E.onUncaughtError),E.onCaughtError!==void 0&&(W=E.onCaughtError),E.onRecoverableError!==void 0&&(ge=E.onRecoverableError)),E=I$(f,1,!1,null,null,w,M,null,j,W,ge,R$),f[vn]=E.current,JT(f),new g3(E)},Gy.hydrateRoot=function(f,E,w){if(!r(f))throw Error(a(299));var M=!1,j="",W=UV,ge=PV,xe=KV,Ve=null;return w!=null&&(w.unstable_strictMode===!0&&(M=!0),w.identifierPrefix!==void 0&&(j=w.identifierPrefix),w.onUncaughtError!==void 0&&(W=w.onUncaughtError),w.onCaughtError!==void 0&&(ge=w.onCaughtError),w.onRecoverableError!==void 0&&(xe=w.onRecoverableError),w.formState!==void 0&&(Ve=w.formState)),E=I$(f,1,!0,E,w??null,M,j,Ve,W,ge,xe,R$),E.context=B$(null),w=E.current,M=Js(),M=_t(M),j=fp(M),j.callback=null,bp(w,j,M),w=M,E.current.lanes=w,ft(E,w),Bd(E),f[vn]=E.current,JT(f),new JD(E)},Gy.version="19.2.3",Gy}var H$;function M4e(){if(H$)return h3.exports;H$=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),h3.exports=N4e(),h3.exports}var F4e=M4e();const L4e=pl(F4e);var ui=$fe();const ebe=pl(ui);function T4e(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const G4e=t=>{switch(t){case"success":return P4e;case"info":return H4e;case"warning":return K4e;case"error":return Y4e;default:return null}},O4e=Array(12).fill(0),U4e=({visible:t,className:e})=>Yt.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Yt.createElement("div",{className:"sonner-spinner"},O4e.map((n,a)=>Yt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),P4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),K4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),H4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Y4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Yt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),q4e=Yt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Yt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Yt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),j4e=()=>{const[t,e]=Yt.useState(document.hidden);return Yt.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Y5=1;class z4e{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:a,...r}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Y5++,o=this.toasts.find(s=>s.id===i),A=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(s=>s.id===i?(this.publish({...s,...e,id:i,title:a}),{...s,...e,id:i,dismissible:A,title:a}):s):this.addToast({title:a,...r,dismissible:A,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let a;n.loading!==void 0&&(a=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let i=a!==void 0,o;const A=r.then(async l=>{if(o=["resolve",l],Yt.isValidElement(l))i=!1,this.create({id:a,type:"default",message:l});else if(W4e(l)&&!l.ok){i=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${l.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${l.status}`):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:g,...m})}else if(l instanceof Error){i=!1;const u=typeof n.error=="function"?await n.error(l):n.error,g=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"error",description:g,...m})}else if(n.success!==void 0){i=!1;const u=typeof n.success=="function"?await n.success(l):n.success,g=typeof n.description=="function"?await n.description(l):n.description,m=typeof u=="object"&&!Yt.isValidElement(u)?u:{message:u};this.create({id:a,type:"success",description:g,...m})}}).catch(async l=>{if(o=["reject",l],n.error!==void 0){i=!1;const d=typeof n.error=="function"?await n.error(l):n.error,u=typeof n.description=="function"?await n.description(l):n.description,p=typeof d=="object"&&!Yt.isValidElement(d)?d:{message:d};this.create({id:a,type:"error",description:u,...p})}}).finally(()=>{i&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),s=()=>new Promise((l,d)=>A.then(()=>o[0]==="reject"?d(o[1]):l(o[1])).catch(d));return typeof a!="string"&&typeof a!="number"?{unwrap:s}:Object.assign(a,{unwrap:s})},this.custom=(e,n)=>{const a=n?.id||Y5++;return this.create({jsx:e(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const bs=new z4e,J4e=(t,e)=>{const n=e?.id||Y5++;return bs.addToast({title:t,...e,id:n}),n},W4e=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Z4e=J4e,V4e=()=>bs.toasts,X4e=()=>bs.getActiveToasts(),Ws=Object.assign(Z4e,{success:bs.success,info:bs.info,warning:bs.warning,error:bs.error,custom:bs.custom,message:bs.message,promise:bs.promise,dismiss:bs.dismiss,loading:bs.loading},{getHistory:V4e,getToasts:X4e});T4e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ZD(t){return t.label!==void 0}const $4e=3,e8e="24px",t8e="16px",Y$=4e3,n8e=356,a8e=14,r8e=45,i8e=200;function yd(...t){return t.filter(Boolean).join(" ")}function o8e(t){const[e,n]=t.split("-"),a=[];return e&&a.push(e),n&&a.push(n),a}const A8e=t=>{var e,n,a,r,i,o,A,s,l;const{invert:d,toast:u,unstyled:g,interacting:p,setHeights:m,visibleToasts:h,heights:b,index:C,toasts:B,expanded:y,removeToast:Q,defaultRichColors:k,closeButton:_,style:v,cancelButtonStyle:x,actionButtonStyle:S,className:L="",descriptionClassName:N="",duration:U,position:K,gap:R,expandByDefault:O,classNames:F,icons:T,closeButtonAriaLabel:G="Close toast"}=t,[H,q]=Yt.useState(null),[P,z]=Yt.useState(null),[Z,$]=Yt.useState(!1),[V,Ae]=Yt.useState(!1),[ne,pe]=Yt.useState(!1),[te,re]=Yt.useState(!1),[se,oe]=Yt.useState(!1),[ue,le]=Yt.useState(0),[De,he]=Yt.useState(0),qe=Yt.useRef(u.duration||U||Y$),ce=Yt.useRef(null),et=Yt.useRef(null),ke=C===0,rt=C+1<=h,tt=u.type,gt=u.dismissible!==!1,Ge=u.className||"",ot=u.descriptionClassName||"",He=Yt.useMemo(()=>b.findIndex(Ie=>Ie.toastId===u.id)||0,[b,u.id]),ze=Yt.useMemo(()=>{var Ie;return(Ie=u.closeButton)!=null?Ie:_},[u.closeButton,_]),ut=Yt.useMemo(()=>u.duration||U||Y$,[u.duration,U]),Se=Yt.useRef(0),Ze=Yt.useRef(0),be=Yt.useRef(0),ve=Yt.useRef(null),[X,we]=K.split("-"),Be=Yt.useMemo(()=>b.reduce((Ie,Pe,Oe)=>Oe>=He?Ie:Ie+Pe.height,0),[b,He]),Ne=j4e(),Me=u.invert||d,Ke=tt==="loading";Ze.current=Yt.useMemo(()=>He*R+Be,[He,Be]),Yt.useEffect(()=>{qe.current=ut},[ut]),Yt.useEffect(()=>{$(!0)},[]),Yt.useEffect(()=>{const Ie=et.current;if(Ie){const Pe=Ie.getBoundingClientRect().height;return he(Pe),m(Oe=>[{toastId:u.id,height:Pe,position:u.position},...Oe]),()=>m(Oe=>Oe.filter(at=>at.toastId!==u.id))}},[m,u.id]),Yt.useLayoutEffect(()=>{if(!Z)return;const Ie=et.current,Pe=Ie.style.height;Ie.style.height="auto";const Oe=Ie.getBoundingClientRect().height;Ie.style.height=Pe,he(Oe),m(at=>at.find(ft=>ft.toastId===u.id)?at.map(ft=>ft.toastId===u.id?{...ft,height:Oe}:ft):[{toastId:u.id,height:Oe,position:u.position},...at])},[Z,u.title,u.description,m,u.id,u.jsx,u.action,u.cancel]);const Ee=Yt.useCallback(()=>{Ae(!0),le(Ze.current),m(Ie=>Ie.filter(Pe=>Pe.toastId!==u.id)),setTimeout(()=>{Q(u)},i8e)},[u,Q,m,Ze]);Yt.useEffect(()=>{if(u.promise&&tt==="loading"||u.duration===1/0||u.type==="loading")return;let Ie;return y||p||Ne?(()=>{if(be.current<Se.current){const at=new Date().getTime()-Se.current;qe.current=qe.current-at}be.current=new Date().getTime()})():(()=>{qe.current!==1/0&&(Se.current=new Date().getTime(),Ie=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Ee()},qe.current))})(),()=>clearTimeout(Ie)},[y,p,u,tt,Ne,Ee]),Yt.useEffect(()=>{u.delete&&(Ee(),u.onDismiss==null||u.onDismiss.call(u,u))},[Ee,u.delete]);function _e(){var Ie;if(T?.loading){var Pe;return Yt.createElement("div",{className:yd(F?.loader,u==null||(Pe=u.classNames)==null?void 0:Pe.loader,"sonner-loader"),"data-visible":tt==="loading"},T.loading)}return Yt.createElement(U4e,{className:yd(F?.loader,u==null||(Ie=u.classNames)==null?void 0:Ie.loader),visible:tt==="loading"})}const We=u.icon||T?.[tt]||G4e(tt);var it,ht;return Yt.createElement("li",{tabIndex:0,ref:et,className:yd(L,Ge,F?.toast,u==null||(e=u.classNames)==null?void 0:e.toast,F?.default,F?.[tt],u==null||(n=u.classNames)==null?void 0:n[tt]),"data-sonner-toast":"","data-rich-colors":(it=u.richColors)!=null?it:k,"data-styled":!(u.jsx||u.unstyled||g),"data-mounted":Z,"data-promise":!!u.promise,"data-swiped":se,"data-removed":V,"data-visible":rt,"data-y-position":X,"data-x-position":we,"data-index":C,"data-front":ke,"data-swiping":ne,"data-dismissible":gt,"data-type":tt,"data-invert":Me,"data-swipe-out":te,"data-swipe-direction":P,"data-expanded":!!(y||O&&Z),"data-testid":u.testId,style:{"--index":C,"--toasts-before":C,"--z-index":B.length-C,"--offset":`${V?ue:Ze.current}px`,"--initial-height":O?"auto":`${De}px`,...v,...u.style},onDragEnd:()=>{pe(!1),q(null),ve.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Ke||!gt||(ce.current=new Date,le(Ze.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),ve.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,Pe,Oe;if(te||!gt)return;ve.current=null;const at=Number(((Ie=et.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Rt=Number(((Pe=et.current)==null?void 0:Pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ft=new Date().getTime()-((Oe=ce.current)==null?void 0:Oe.getTime()),ie=H==="x"?at:Rt,lt=Math.abs(ie)/ft;if(Math.abs(ie)>=r8e||lt>.11){le(Ze.current),u.onDismiss==null||u.onDismiss.call(u,u),z(H==="x"?at>0?"right":"left":Rt>0?"down":"up"),Ee(),re(!0);return}else{var At,vt;(At=et.current)==null||At.style.setProperty("--swipe-amount-x","0px"),(vt=et.current)==null||vt.style.setProperty("--swipe-amount-y","0px")}oe(!1),pe(!1),q(null)},onPointerMove:Ie=>{var Pe,Oe,at;if(!ve.current||!gt||((Pe=window.getSelection())==null?void 0:Pe.toString().length)>0)return;const ft=Ie.clientY-ve.current.y,ie=Ie.clientX-ve.current.x;var lt;const At=(lt=t.swipeDirections)!=null?lt:o8e(K);!H&&(Math.abs(ie)>1||Math.abs(ft)>1)&&q(Math.abs(ie)>Math.abs(ft)?"x":"y");let vt={x:0,y:0};const _t=Tt=>1/(1.5+Math.abs(Tt)/20);if(H==="y"){if(At.includes("top")||At.includes("bottom"))if(At.includes("top")&&ft<0||At.includes("bottom")&&ft>0)vt.y=ft;else{const Tt=ft*_t(ft);vt.y=Math.abs(Tt)<Math.abs(ft)?Tt:ft}}else if(H==="x"&&(At.includes("left")||At.includes("right")))if(At.includes("left")&&ie<0||At.includes("right")&&ie>0)vt.x=ie;else{const Tt=ie*_t(ie);vt.x=Math.abs(Tt)<Math.abs(ie)?Tt:ie}(Math.abs(vt.x)>0||Math.abs(vt.y)>0)&&oe(!0),(Oe=et.current)==null||Oe.style.setProperty("--swipe-amount-x",`${vt.x}px`),(at=et.current)==null||at.style.setProperty("--swipe-amount-y",`${vt.y}px`)}},ze&&!u.jsx&&tt!=="loading"?Yt.createElement("button",{"aria-label":G,"data-disabled":Ke,"data-close-button":!0,onClick:Ke||!gt?()=>{}:()=>{Ee(),u.onDismiss==null||u.onDismiss.call(u,u)},className:yd(F?.closeButton,u==null||(a=u.classNames)==null?void 0:a.closeButton)},(ht=T?.close)!=null?ht:q4e):null,(tt||u.icon||u.promise)&&u.icon!==null&&(T?.[tt]!==null||u.icon)?Yt.createElement("div",{"data-icon":"",className:yd(F?.icon,u==null||(r=u.classNames)==null?void 0:r.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||_e():null,u.type!=="loading"?We:null):null,Yt.createElement("div",{"data-content":"",className:yd(F?.content,u==null||(i=u.classNames)==null?void 0:i.content)},Yt.createElement("div",{"data-title":"",className:yd(F?.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?Yt.createElement("div",{"data-description":"",className:yd(N,ot,F?.description,u==null||(A=u.classNames)==null?void 0:A.description)},typeof u.description=="function"?u.description():u.description):null),Yt.isValidElement(u.cancel)?u.cancel:u.cancel&&ZD(u.cancel)?Yt.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||x,onClick:Ie=>{ZD(u.cancel)&>&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ie),Ee())},className:yd(F?.cancelButton,u==null||(s=u.classNames)==null?void 0:s.cancelButton)},u.cancel.label):null,Yt.isValidElement(u.action)?u.action:u.action&&ZD(u.action)?Yt.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||S,onClick:Ie=>{ZD(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ie),!Ie.defaultPrevented&&Ee())},className:yd(F?.actionButton,u==null||(l=u.classNames)==null?void 0:l.actionButton)},u.action.label):null)};function q$(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function s8e(t,e){const n={};return[t,e].forEach((a,r)=>{const i=r===1,o=i?"--mobile-offset":"--offset",A=i?t8e:e8e;function s(l){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof l=="number"?`${l}px`:l})}typeof a=="number"||typeof a=="string"?s(a):typeof a=="object"?["top","right","bottom","left"].forEach(l=>{a[l]===void 0?n[`${o}-${l}`]=A:n[`${o}-${l}`]=typeof a[l]=="number"?`${a[l]}px`:a[l]}):s(A)}),n}const c8e=Yt.forwardRef(function(e,n){const{id:a,invert:r,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:A,closeButton:s,className:l,offset:d,mobileOffset:u,theme:g="light",richColors:p,duration:m,style:h,visibleToasts:b=$4e,toastOptions:C,dir:B=q$(),gap:y=a8e,icons:Q,containerAriaLabel:k="Notifications"}=e,[_,v]=Yt.useState([]),x=Yt.useMemo(()=>a?_.filter(Z=>Z.toasterId===a):_.filter(Z=>!Z.toasterId),[_,a]),S=Yt.useMemo(()=>Array.from(new Set([i].concat(x.filter(Z=>Z.position).map(Z=>Z.position)))),[x,i]),[L,N]=Yt.useState([]),[U,K]=Yt.useState(!1),[R,O]=Yt.useState(!1),[F,T]=Yt.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Yt.useRef(null),H=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=Yt.useRef(null),P=Yt.useRef(!1),z=Yt.useCallback(Z=>{v($=>{var V;return(V=$.find(Ae=>Ae.id===Z.id))!=null&&V.delete||bs.dismiss(Z.id),$.filter(({id:Ae})=>Ae!==Z.id)})},[]);return Yt.useEffect(()=>bs.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{v($=>$.map(V=>V.id===Z.id?{...V,delete:!0}:V))});return}setTimeout(()=>{ebe.flushSync(()=>{v($=>{const V=$.findIndex(Ae=>Ae.id===Z.id);return V!==-1?[...$.slice(0,V),{...$[V],...Z},...$.slice(V+1)]:[Z,...$]})})})}),[_]),Yt.useEffect(()=>{if(g!=="system"){T(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:$})=>{T($?"dark":"light")})}catch{Z.addListener(({matches:V})=>{try{T(V?"dark":"light")}catch(Ae){console.error(Ae)}})}},[g]),Yt.useEffect(()=>{_.length<=1&&K(!1)},[_]),Yt.useEffect(()=>{const Z=$=>{var V;if(o.every(pe=>$[pe]||$.code===pe)){var ne;K(!0),(ne=G.current)==null||ne.focus()}$.code==="Escape"&&(document.activeElement===G.current||(V=G.current)!=null&&V.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[o]),Yt.useEffect(()=>{if(G.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,P.current=!1)}},[G.current]),Yt.createElement("section",{ref:n,"aria-label":`${k} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((Z,$)=>{var V;const[Ae,ne]=Z.split("-");return x.length?Yt.createElement("ol",{key:Z,dir:B==="auto"?q$():B,tabIndex:-1,ref:G,className:l,"data-sonner-toaster":!0,"data-sonner-theme":F,"data-y-position":Ae,"data-x-position":ne,style:{"--front-toast-height":`${((V=L[0])==null?void 0:V.height)||0}px`,"--width":`${n8e}px`,"--gap":`${y}px`,...h,...s8e(d,u)},onBlur:pe=>{P.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(P.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||P.current||(P.current=!0,q.current=pe.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{R||K(!1)},onDragEnd:()=>K(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||O(!0)},onPointerUp:()=>O(!1)},x.filter(pe=>!pe.position&&$===0||pe.position===Z).map((pe,te)=>{var re,se;return Yt.createElement(A8e,{key:pe.id,icons:Q,index:te,toast:pe,defaultRichColors:p,duration:(re=C?.duration)!=null?re:m,className:C?.className,descriptionClassName:C?.descriptionClassName,invert:r,visibleToasts:b,closeButton:(se=C?.closeButton)!=null?se:s,interacting:R,position:Z,style:C?.style,unstyled:C?.unstyled,classNames:C?.classNames,cancelButtonStyle:C?.cancelButtonStyle,actionButtonStyle:C?.actionButtonStyle,closeButtonAriaLabel:C?.closeButtonAriaLabel,removeToast:z,toasts:x.filter(oe=>oe.position==pe.position),heights:L.filter(oe=>oe.position==pe.position),setHeights:N,expandByDefault:A,gap:y,expanded:U,swipeDirections:e.swipeDirections})})):null}))}),Uf={"claude-code":{name:"Claude Code",badge:"bg-orange-500/15 text-orange-400",aiProviderTypes:["claude-agent-sdk"]},amp:{name:"Amp",badge:"bg-lime-500/15 text-lime-400"},droid:{name:"Droid",badge:"bg-cyan-500/15 text-cyan-400"},opencode:{name:"OpenCode",badge:"bg-emerald-500/15 text-emerald-400",aiProviderTypes:["opencode-sdk"]},"copilot-cli":{name:"GitHub Copilot",badge:"bg-blue-500/15 text-blue-400"},pi:{name:"Pi",badge:"bg-violet-500/15 text-violet-400",aiProviderTypes:["pi-sdk"]},codex:{name:"Codex",badge:"bg-purple-500/15 text-purple-400",aiProviderTypes:["codex-sdk"]},"gemini-cli":{name:"Gemini CLI",badge:"bg-sky-500/15 text-sky-400"}};function q5(t){return t&&t in Uf?Uf[t].name:"Coding Agent"}function SN(t){if(t&&t in Uf){const e=Uf[t];return"aiProviderTypes"in e?e.aiProviderTypes:[]}return[]}const l8e=(t,e="ExitPlanMode",n)=>`YOUR PLAN WAS NOT APPROVED.
|
|
63
63
|
|
|
64
64
|
You MUST revise the plan to address ALL of the feedback below before calling ${e} again.
|
|
65
65
|
|
|
@@ -316,7 +316,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error
|
|
|
316
316
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
317
317
|
|
|
318
318
|
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return Y.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},c7e="DialogDescriptionWarning",l7e=({contentRef:t,descriptionId:e})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${bCe(c7e).contentName}}.`;return Y.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(a))},[a,t,e]),null},d7e=ACe,u7e=lCe,g7e=dCe,p7e=gCe,m7e=hCe;const are=[".annotation-toolbar",'[data-comment-popover="true"]','[data-floating-picker="true"]'],o6=({open:t,onClose:e,title:n,container:a,className:r,children:i,dataAttributes:o})=>{const A=Y.useCallback(l=>{const d=l.target;are.some(u=>d.closest(u))||e()},[e]),s=Y.useCallback(l=>{const d=l.target;d&&are.some(u=>d.closest(u))&&l.preventDefault()},[]);return I.jsx(d7e,{open:t,onOpenChange:l=>{l||e()},modal:!1,children:I.jsxs(u7e,{container:a??void 0,children:[I.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px]",onClick:A,"aria-hidden":"true"}),I.jsxs(g7e,{className:`fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 bg-background border border-border rounded-xl shadow-2xl flex flex-col overflow-hidden ${r??"w-[calc(100vw-4rem)] max-w-[min(calc(100vw-4rem),1500px)] max-h-[calc(100vh-4rem)]"}`,"data-popout":"true","aria-describedby":void 0,onOpenAutoFocus:l=>l.preventDefault(),onInteractOutside:s,...o,children:[I.jsx(p7e,{className:"sr-only",children:n}),I.jsx(m7e,{asChild:!0,children:I.jsx("button",{className:"absolute top-3 right-3 z-20 p-1.5 rounded-md text-muted-foreground/70 hover:bg-muted hover:text-foreground transition-colors","aria-label":"Close",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})}),i]})]})})},h7e=({block:t,open:e,onClose:n,container:a,onOpenLinkedDoc:r,onOpenCodeFile:i,onNavigateAnchor:o,imageBaseDir:A,onImageClick:s,githubRepo:l})=>{const{headers:d,rows:u}=Y.useMemo(()=>eq(t.content),[t.content]),g=Y.useMemo(()=>{const K=new Map;return d.map((R,O)=>{const F=R.trim()||`col-${O}`,T=(K.get(F)??0)+1;return K.set(F,T),T===1?F:`${F}-${T}`})},[d]),p=Y.useMemo(()=>u.map(K=>{const R={};return g.forEach((O,F)=>{R[O]=K[F]??""}),R}),[u,g]),m=Y.useMemo(()=>{const K=T5e();return g.map((R,O)=>K.accessor(F=>F[R],{id:R,header:d[O],cell:F=>I.jsx(GA,{imageBaseDir:A,onImageClick:s,text:F.getValue(),onOpenLinkedDoc:r,onOpenCodeFile:i,onNavigateAnchor:o,githubRepo:l})}))},[g,d,A,s,r,o,l]),[h,b]=Y.useState([]),[C,B]=Y.useState(""),[y,Q]=Y.useState(!1),[k,_]=Y.useState(!1),v=()=>L.getRowModel().rows.map(K=>g.map(R=>K.getValue(R)??"")),x=async()=>{try{await navigator.clipboard.writeText(_5e(d,v())),Q(!0),setTimeout(()=>Q(!1),1500)}catch(K){console.error("Failed to copy:",K)}},S=async()=>{try{await navigator.clipboard.writeText(Rbe(d,v())),_(!0),setTimeout(()=>_(!1),1500)}catch(K){console.error("Failed to copy:",K)}},L=R6e({data:p,columns:m,state:{sorting:h,globalFilter:C},onSortingChange:b,onGlobalFilterChange:B,getCoreRowModel:y6e(),getSortedRowModel:D6e(),getFilteredRowModel:v6e(),globalFilterFn:"includesString"}),N=L.getRowModel().rows,U=p.length;return I.jsxs(o6,{open:e,onClose:n,title:"Table",container:a,dataAttributes:{"data-block-id":t.id},children:[I.jsxs("div",{className:"flex items-center gap-3 px-5 pt-4 pb-3 pr-12",children:[I.jsxs("div",{className:"relative max-w-sm flex-1",children:[I.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35M10 18a8 8 0 100-16 8 8 0 000 16z"})}),I.jsx("input",{type:"text",value:C,onChange:K=>B(K.target.value),placeholder:"Filter rows…",className:"w-full pl-8 pr-3 py-1.5 text-sm bg-muted/40 border border-border/60 rounded-md focus:outline-none focus:ring-1 focus:ring-primary/50 focus:border-primary/50"})]}),I.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:N.length===U?`${U} row${U===1?"":"s"}`:`${N.length} of ${U}`}),I.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[I.jsx("button",{onClick:x,title:y?"Copied!":N.length===U?"Copy as markdown":`Copy ${N.length} row${N.length===1?"":"s"} as markdown`,className:`p-1.5 rounded-md transition-colors ${y?"text-success":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:y?I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}),I.jsx("button",{onClick:S,title:k?"Copied as CSV!":N.length===U?"Copy as CSV":`Copy ${N.length} row${N.length===1?"":"s"} as CSV`,className:`px-2 py-1 rounded-md text-[10px] font-bold tracking-tight uppercase leading-none transition-colors ${k?"text-success":"text-primary hover:bg-primary/10"}`,children:k?"✓":"CSV"})]})]}),I.jsx("div",{className:"overflow-auto flex-1 px-5 pb-5",children:I.jsxs("table",{className:"min-w-full border-collapse text-sm",children:[I.jsx("thead",{children:L.getHeaderGroups().map(K=>I.jsx("tr",{className:"border-b border-border",children:K.headers.map(R=>{const O=R.column.getIsSorted();return I.jsx("th",{onClick:R.column.getToggleSortingHandler(),className:"px-3 py-2 text-left font-semibold text-foreground/90 bg-muted/30 sticky top-0 z-10 select-none cursor-pointer hover:bg-muted/50 transition-colors",children:I.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[Hae(R.column.columnDef.header,R.getContext()),I.jsx(b7e,{dir:O})]})},R.id)})},K.id))}),I.jsx("tbody",{children:N.length===0?I.jsx("tr",{children:I.jsx("td",{colSpan:g.length,className:"px-3 py-8 text-center text-sm text-muted-foreground",children:"No rows match the filter."})}):N.map(K=>I.jsx("tr",{className:"border-b border-border/50 hover:bg-muted/20",children:K.getVisibleCells().map(R=>I.jsx("td",{className:"px-3 py-2 text-foreground/80",children:Hae(R.column.columnDef.cell,R.getContext())},R.id))},K.id))})]})})]})},f7e=Yt.memo(h7e,(t,e)=>t.block.id===e.block.id&&t.block.content===e.block.content&&t.open===e.open&&t.container===e.container&&t.imageBaseDir===e.imageBaseDir&&t.githubRepo===e.githubRepo),b7e=({dir:t})=>{const e=t==="asc",n=t==="desc";return I.jsxs("span",{className:"inline-flex flex-col leading-none text-[9px]",children:[I.jsx("span",{className:e?"text-foreground":"text-muted-foreground/40",children:"▲"}),I.jsx("span",{className:n?"text-foreground":"text-muted-foreground/40",children:"▼"})]})},C7e=/(^|\n)([ \t]*)(```|~~~)[\s\S]*?\n\2\3/g,E7e=/\x3C!--[\s\S]*?-->/g,I7e=/https?:\/\/[^\s<>"']+/g,B7e=/`([^`\n]+)`/g;function y7e(t){const e=t.replace(C7e,"").replace(E7e,""),n=new Set;let a;const r=new RegExp(B7e.source,"g");for(;(a=r.exec(e))!==null;){const i=a[1].trim();m0(i)&&n.add(i.replace(/#.*$/,""))}for(const i of e.split(`
|
|
319
|
-
`)){const o=[],A=new RegExp(I7e.source,"g");for(;(a=A.exec(i))!==null;)o.push([a.index,a.index+a[0].length]);const s=new RegExp(ibe.source,"g");for(;(a=s.exec(i))!==null;){const l=a.index,d=l+a[0].length,u=l===0?"":i[l-1];/\w/.test(u)||o.some(([p,m])=>l<m&&d>p)||Abe(a[0])&&n.add(a[0].replace(/#.*$/,""))}}return Array.from(n)}function Q7e(t,e){const[n,a]=Y.useState(new Map),[r,i]=Y.useState(!1);return Y.useEffect(()=>{a(new Map),i(!1);const o=y7e(t);if(o.length===0){i(!0);return}let A=!1;return(async()=>{try{const s=await fetch("/api/doc/exists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{paths:o,base:e}:{paths:o})});if(A)return;if(!s.ok){i(!0);return}const l=await s.json();if(A)return;const d=new Map;for(const[u,g]of Object.entries(l.results??{}))d.set(u,g);a(d),i(!0)}catch{A||i(!0)}})(),()=>{A=!0}},[t,e]),Y.useMemo(()=>({validated:n,ready:r}),[n,r])}const w7e=3600*24*365;function dq(t){try{const e=document.cookie.match(new RegExp(`(?:^|; )${v7e(t)}=([^;]*)`));return e?decodeURIComponent(e[1]):null}catch{return null}}function uq(t,e){try{const n=encodeURIComponent(e);document.cookie=`${t}=${n}; path=/; max-age=${w7e}; SameSite=Lax`}catch{}}function k7e(t){try{document.cookie=`${t}=; path=/; max-age=0`}catch{}}function v7e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const CCe="plannotator-auto-close",rre=[{value:"off",label:"Off",description:"Tab stays open after submitting"},{value:"0",label:"Immediately",description:"Tab closes immediately after submitting"},{value:"3",label:"After 3 seconds",description:"Tab closes 3 seconds after submitting"},{value:"5",label:"After 5 seconds",description:"Tab closes 5 seconds after submitting"}];function ECe(){const t=dq(CCe);return t==="0"||t==="3"||t==="5"?t:t==="true"?"0":"off"}function ICe(t){uq(CCe,t)}const qt={getItem:dq,setItem:uq,removeItem:k7e},gq="plannotator-quick-labels",BCe={blue:{bg:"rgba(59,130,246,0.15)",text:"#2563eb",darkText:"#60a5fa"},red:{bg:"rgba(239,68,68,0.15)",text:"#dc2626",darkText:"#f87171"},orange:{bg:"rgba(249,115,22,0.15)",text:"#ea580c",darkText:"#fb923c"},yellow:{bg:"rgba(234,179,8,0.15)",text:"#ca8a04",darkText:"#facc15"},purple:{bg:"rgba(147,51,234,0.15)",text:"#9333ea",darkText:"#a78bfa"},teal:{bg:"rgba(20,184,166,0.15)",text:"#0d9488",darkText:"#2dd4bf"},pink:{bg:"rgba(236,72,153,0.15)",text:"#db2777",darkText:"#f472b6"},green:{bg:"rgba(34,197,94,0.15)",text:"#16a34a",darkText:"#4ade80"},cyan:{bg:"rgba(8,145,178,0.15)",text:"#0891b2",darkText:"#22d3ee"},amber:{bg:"rgba(180,83,9,0.15)",text:"#b45309",darkText:"#fbbf24"}},$1=[{id:"clarify-this",emoji:"❓",text:"Clarify this",color:"yellow"},{id:"missing-overview",emoji:"🗺️",text:"Missing overview",color:"purple",tip:"Provide a narrative overview of what is being built, why it is being built, and how it will be built. Add this before the implementation details."},{id:"verify-this",emoji:"🔍",text:"Verify this",color:"orange",tip:"This seems like an assumption. Verify by reading the actual code before proceeding."},{id:"give-me-an-example",emoji:"🔬",text:"Give me an example",color:"cyan",tip:"This is too abstract. Show a before/after, a sample input/output, or a specific scenario so I can see how this actually works."},{id:"match-existing-patterns",emoji:"🧬",text:"Match existing patterns",color:"teal",tip:"Search the codebase for existing patterns, components, or utilities that already solve this. Reuse what exists rather than introducing a new approach."},{id:"consider-alternatives",emoji:"🔄",text:"Consider alternatives",color:"pink",tip:"Propose 2-3 alternative approaches with trade-offs based on the actual codebase. Also check ~/.plannotator/plans/ for prior plan versions that may have already explored or rejected similar approaches."},{id:"ensure-no-regression",emoji:"📉",text:"Ensure no regression",color:"amber",tip:"Verify that this change will not break existing behavior. Identify what could regress and how to protect against it."},{id:"out-of-scope",emoji:"🚫",text:"Out of scope",color:"red",tip:"This is not part of the current task. Remove it and stay focused on what was actually requested."},{id:"needs-tests",emoji:"🧪",text:"Needs tests",color:"blue"},{id:"nice-approach",emoji:"👍",text:"Nice approach",color:"green"}];function pq(){const t=qt.getItem(gq);if(!t)return $1;try{const e=JSON.parse(t);return e.length>0?e:$1}catch{return $1}}function TC(t){qt.setItem(gq,JSON.stringify(t))}function D7e(){qt.removeItem(gq)}function yCe(t){const e=BCe[t];if(!e)return{bg:"rgba(128,128,128,0.15)",text:"#666"};const n=document.documentElement.classList.contains("dark");return{bg:e.bg,text:n?e.darkText:e.text}}const x7e=({labels:t,onSelect:e,animate:n=!1})=>I.jsxs("div",{className:"py-1",onMouseDown:a=>a.stopPropagation(),children:[n&&I.jsx("style",{children:`
|
|
319
|
+
`)){const o=[],A=new RegExp(I7e.source,"g");for(;(a=A.exec(i))!==null;)o.push([a.index,a.index+a[0].length]);const s=new RegExp(ibe.source,"g");for(;(a=s.exec(i))!==null;){const l=a.index,d=l+a[0].length,u=l===0?"":i[l-1];/\w/.test(u)||o.some(([p,m])=>l<m&&d>p)||Abe(a[0])&&n.add(a[0].replace(/#.*$/,""))}}return Array.from(n)}function Q7e(t,e){const[n,a]=Y.useState(new Map),[r,i]=Y.useState(!1);return Y.useEffect(()=>{a(new Map),i(!1);const o=y7e(t);if(o.length===0){i(!0);return}let A=!1;return(async()=>{try{const s=await fetch("/api/doc/exists",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e?{paths:o,base:e}:{paths:o})});if(A)return;if(!s.ok){i(!0);return}const l=await s.json();if(A)return;const d=new Map;for(const[u,g]of Object.entries(l.results??{}))d.set(u,g);a(d),i(!0)}catch{A||i(!0)}})(),()=>{A=!0}},[t,e]),Y.useMemo(()=>({validated:n,ready:r}),[n,r])}const w7e=3600*24*365;function dq(t){try{const e=document.cookie.match(new RegExp(`(?:^|; )${v7e(t)}=([^;]*)`));return e?decodeURIComponent(e[1]):null}catch{return null}}function uq(t,e){try{const n=encodeURIComponent(e);document.cookie=`${t}=${n}; path=/; max-age=${w7e}; SameSite=Lax`}catch{}}function k7e(t){try{document.cookie=`${t}=; path=/; max-age=0`}catch{}}function v7e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const CCe="plannotator-auto-close",rre=[{value:"off",label:"Off",description:"Tab stays open after submitting"},{value:"0",label:"Immediately",description:"Tab closes immediately after submitting"},{value:"3",label:"After 3 seconds",description:"Tab closes 3 seconds after submitting"},{value:"5",label:"After 5 seconds",description:"Tab closes 5 seconds after submitting"}];function ECe(){const t=dq(CCe);return t==="0"||t==="3"||t==="5"?t:t==="true"?"0":"off"}function ICe(t){uq(CCe,t)}const qt={getItem:dq,setItem:uq,removeItem:k7e},gq="plannotator-quick-labels",BCe={blue:{bg:"rgba(59,130,246,0.15)",text:"#2563eb",darkText:"#60a5fa"},red:{bg:"rgba(239,68,68,0.15)",text:"#dc2626",darkText:"#f87171"},orange:{bg:"rgba(249,115,22,0.15)",text:"#ea580c",darkText:"#fb923c"},yellow:{bg:"rgba(234,179,8,0.15)",text:"#ca8a04",darkText:"#facc15"},purple:{bg:"rgba(147,51,234,0.15)",text:"#9333ea",darkText:"#a78bfa"},teal:{bg:"rgba(20,184,166,0.15)",text:"#0d9488",darkText:"#2dd4bf"},pink:{bg:"rgba(236,72,153,0.15)",text:"#db2777",darkText:"#f472b6"},green:{bg:"rgba(34,197,94,0.15)",text:"#16a34a",darkText:"#4ade80"},cyan:{bg:"rgba(8,145,178,0.15)",text:"#0891b2",darkText:"#22d3ee"},amber:{bg:"rgba(180,83,9,0.15)",text:"#b45309",darkText:"#fbbf24"}},$1=[{id:"clarify-this",emoji:"❓",text:"Clarify this",color:"yellow"},{id:"missing-overview",emoji:"🗺️",text:"Missing overview",color:"purple",tip:"Provide a narrative overview of what is being built, why it is being built, and how it will be built. Add this before the implementation details."},{id:"verify-this",emoji:"🔍",text:"Verify this",color:"orange",tip:"This seems like an assumption. Verify by reading the actual code before proceeding."},{id:"give-me-an-example",emoji:"🔬",text:"Give me an example",color:"cyan",tip:"This is too abstract. Show a before/after, a sample input/output, or a specific scenario so I can see how this actually works."},{id:"match-existing-patterns",emoji:"🧬",text:"Match existing patterns",color:"teal",tip:"Search the codebase for existing patterns, components, or utilities that already solve this. Reuse what exists rather than introducing a new approach."},{id:"consider-alternatives",emoji:"🔄",text:"Consider alternatives",color:"pink",tip:"Propose 2-3 alternative approaches with trade-offs based on the actual codebase. Also check the Plannotator plans directory (PLANNOTATOR_DATA_DIR or ~/.plannotator/plans/) for prior plan versions that may have already explored or rejected similar approaches."},{id:"ensure-no-regression",emoji:"📉",text:"Ensure no regression",color:"amber",tip:"Verify that this change will not break existing behavior. Identify what could regress and how to protect against it."},{id:"out-of-scope",emoji:"🚫",text:"Out of scope",color:"red",tip:"This is not part of the current task. Remove it and stay focused on what was actually requested."},{id:"needs-tests",emoji:"🧪",text:"Needs tests",color:"blue"},{id:"nice-approach",emoji:"👍",text:"Nice approach",color:"green"}];function pq(){const t=qt.getItem(gq);if(!t)return $1;try{const e=JSON.parse(t);return e.length>0?e:$1}catch{return $1}}function TC(t){qt.setItem(gq,JSON.stringify(t))}function D7e(){qt.removeItem(gq)}function yCe(t){const e=BCe[t];if(!e)return{bg:"rgba(128,128,128,0.15)",text:"#666"};const n=document.documentElement.classList.contains("dark");return{bg:e.bg,text:n?e.darkText:e.text}}const x7e=({labels:t,onSelect:e,animate:n=!1})=>I.jsxs("div",{className:"py-1",onMouseDown:a=>a.stopPropagation(),children:[n&&I.jsx("style",{children:`
|
|
320
320
|
@keyframes qld-row-in {
|
|
321
321
|
from { opacity: 0; transform: translateX(-3px); }
|
|
322
322
|
to { opacity: 1; transform: translateX(0); }
|
|
@@ -972,7 +972,7 @@ ${t.themeCSS}`),t.fontFamily!==void 0&&(n+=`
|
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
`})});async function _ve(t){const e=JSON.stringify(t),n=new TextEncoder().encode(e),a=new CompressionStream("deflate-raw"),r=a.writable.getWriter();r.write(n),r.close();const i=await new Response(a.readable).arrayBuffer(),o=new Uint8Array(i);let A="";for(let l=0;l<o.length;l++)A+=String.fromCharCode(o[l]);return btoa(A).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}async function j2(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=atob(e),a=Uint8Array.from(n,s=>s.charCodeAt(0)),r=new DecompressionStream("deflate-raw"),i=r.writable.getWriter();i.write(a),i.close();const o=await new Response(r.readable).arrayBuffer(),A=new TextDecoder().decode(o);return JSON.parse(A)}async function bdt(t){const e=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]),n=crypto.getRandomValues(new Uint8Array(12)),a=new TextEncoder().encode(t),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,a),i=new Uint8Array(n.length+r.byteLength);i.set(n,0),i.set(new Uint8Array(r),n.length);const o=await crypto.subtle.exportKey("raw",e);return{ciphertext:kAe(i),key:kAe(new Uint8Array(o))}}async function Cdt(t,e){const n=vAe(t),a=vAe(e),r=n.slice(0,12),i=n.slice(12),o=await crypto.subtle.importKey("raw",a.buffer,{name:"AES-GCM",length:256},!1,["decrypt"]),A=await crypto.subtle.decrypt({name:"AES-GCM",iv:r},o,i);return new TextDecoder().decode(A)}function kAe(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function vAe(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=atob(e);return Uint8Array.from(n,a=>a.charCodeAt(0))}function HE(t){if(t?.length)return t.map(e=>{if(typeof e=="string"){const n=e.split("/").pop()?.replace(/\.[^.]+$/,"")||"image";return{path:e,name:n}}return{path:e[0],name:e[1]}})}function tz(t){if(t?.length)return t.map(e=>[e.path,e.name])}function Rve(t){return t.map(e=>{const n=e.author||null,a=tz(e.images);return e.type===ua.GLOBAL_COMMENT?["G",e.text||"",n,a]:e.type===ua.DELETION?["D",e.originalText,n,a]:e.isQuickLabel?["C",e.originalText,e.text||"",n,a??void 0,1]:["C",e.originalText,e.text||"",n,a]})}function wS(t,e,n){const a={D:ua.DELETION,C:ua.COMMENT,G:ua.GLOBAL_COMMENT};return t.map((r,i)=>{const o=r[0];if(o==="G"){const g=r[1],p=r[2],m=r[3];return{id:`shared-${i}-${Date.now()}`,blockId:"",startOffset:0,endOffset:0,type:ua.GLOBAL_COMMENT,text:g||void 0,originalText:"",createdA:Date.now()+i,author:p||void 0,images:HE(m),...n?.[i]?{source:n[i]}:{}}}const A=r[1],s=o==="D"?void 0:r[2],l=o==="D"?r[2]:r[3],d=o==="D"?r[3]:r[4],u=o==="C"&&r.length>5&&r[5]===1?!0:void 0;return{id:`shared-${i}-${Date.now()}`,blockId:"",startOffset:0,endOffset:0,type:a[o],text:s||void 0,originalText:A,createdA:Date.now()+i,author:l||void 0,images:HE(d),...u?{isQuickLabel:u}:{},...e?.[i]?{diffContext:e[i]}:{},...n?.[i]?{source:n[i]}:{}}})}function Nve(t){const e=t.map(n=>n.diffContext||null);return e.some(n=>n!==null)?e:null}function Mve(t){const e=t.map(n=>n.source||void 0);return e.some(n=>n!==void 0)?e:null}async function Edt(t,e,n,a=Fve,r){if(r)return null;const i=Nve(e),o=Mve(e),A={p:t,a:Rve(e),g:n?.length?tz(n):void 0,...i?{d:i}:{},...o?{s:o}:{}},s=await _ve(A);return`${a}/#${s}`}async function Idt(){const e=window.location.hash.slice(1).split("?")[0];if(!e)return null;try{return await j2(e)}catch(n){return console.warn("Failed to parse share hash:",n),null}}function Bdt(t){const e=new Blob([t]).size;return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}const OK="https://plannotator-paste.plannotator.workers.dev",Fve="https://share.plannotator.ai";async function ydt(t,e,n,a,r){const i=a?.pasteApiUrl??OK,o=a?.shareBaseUrl??Fve;try{const A=Nve(e),s=Mve(e),l={p:t,a:Rve(e),g:n?.length?tz(n):void 0,...A?{d:A}:{},...s?{s}:{},...r?{h:r,r:"html"}:{}},d=await _ve(l),{ciphertext:u,key:g}=await bdt(d),p=await fetch(`${i}/api/paste`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({data:u}),signal:AbortSignal.timeout(5e3)});if(!p.ok)return console.warn(`[sharing] Paste service returned ${p.status}`),null;const m=await p.json(),h=i!==OK?`&paste=${btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}`:"";return{shortUrl:`${o}/p/${m.id}#key=${g}${h}`,id:m.id}}catch(A){return console.debug("[sharing] Short URL service unavailable, using hash-based sharing:",A),null}}async function DAe(t,e=OK,n){try{const a=await fetch(`${e}/api/paste/${t}`,{signal:AbortSignal.timeout(1e4)});if(!a.ok)return console.warn(`[sharing] Paste fetch returned ${a.status} for id ${t}`),null;const r=await a.json();if(n){const i=await Cdt(r.data,n);return await j2(i)}return await j2(r.data)}catch(a){return console.warn("[sharing] Failed to load from paste ID:",a),null}}function xAe(t){const e=t.replace(/^#/,"").split("?")[0];return e.length>=30&&/^[A-Za-z0-9_-]+$/.test(e)&&/[A-Z]/.test(e)}function Qdt(t,e,n,a,r,i,o,A,s,l,d,u){const[g,p]=Y.useState(!1),[m,h]=Y.useState(!0),[b,C]=Y.useState(""),[B,y]=Y.useState(""),[Q,k]=Y.useState(""),[_,v]=Y.useState(!1),[x,S]=Y.useState(""),[L,N]=Y.useState(null),[U,K]=Y.useState(null),[R,O]=Y.useState(""),F=Y.useCallback(()=>{N(null),K(null)},[]),T=Y.useCallback(()=>O(""),[]),G=Y.useCallback(async()=>{try{const Z=window.location.pathname.match(/^\/p\/([A-Za-z0-9]{6,16})$/);if(Z){const Ae=Z[1],ne=window.location.hash.slice(1),pe=new URLSearchParams(ne),te=pe.get("key")??void 0,re=pe.get("paste")?atob(pe.get("paste").replace(/-/g,"+").replace(/_/g,"/")):void 0,se=await DAe(Ae,re??s,te);if(se){se.h&&se.r==="html"?(d?.(se.h),u?.("html"),a("")):(a(se.p),u?.("markdown"),d?.(""));const oe=wS(se.a,se.d,se.s);if(r(oe),se.g?.length){const le=HE(se.g)??[];i(le),K(le)}N(oe),p(!0),k(window.location.href),o?.();const ue=window.location.pathname.replace(/\/p\/[A-Za-z0-9]+$/,"")||"/";return window.history.replaceState({},"",ue),!0}return O("Failed to load shared plan — the link may be expired or incomplete."),!1}const $=window.location.hash.slice(1);if(!xAe($))return!1;const V=await Idt();if(V){V.h&&V.r==="html"?(d?.(V.h),u?.("html"),a("")):(a(V.p),u?.("markdown"),d?.(""));const Ae=wS(V.a,V.d,V.s);if(r(Ae),V.g?.length){const ne=HE(V.g)??[];i(ne),K(ne)}return N(Ae),p(!0),o?.(),window.history.replaceState({},"",window.location.pathname),!0}return $&&O("Failed to load shared plan — the URL may have been truncated by your browser."),!1}catch(Z){return console.error("Failed to load from share hash:",Z),O("Failed to load shared plan — an unexpected error occurred."),!1}},[a,r,i,o,s,d,u]);Y.useEffect(()=>{G().finally(()=>h(!1))},[]),Y.useEffect(()=>{const Z=()=>{xAe(window.location.hash)&&G()};return window.addEventListener("hashchange",Z),()=>window.removeEventListener("hashchange",Z)},[G]);const H=Y.useCallback(async()=>{try{const Z=await Edt(t,e,n,A,l);C(Z??""),y(Z?Bdt(Z):"")}catch(Z){console.error("Failed to generate share URL:",Z),C(""),y("")}},[t,e,n,A,l]);Y.useEffect(()=>{H()},[H]);const q=Y.useRef(!1);Y.useEffect(()=>{if(g){q.current=!0;return}if(q.current){q.current=!1;return}k(""),S("")},[t,e,l,g]);const P=Y.useCallback(async()=>{if(!(!t&&!l)){v(!0),S("");try{const Z=await ydt(t,e,n,{pasteApiUrl:s,shareBaseUrl:A},l);Z?k(Z.shortUrl):(k(""),S("Short URL service unavailable"))}catch{k(""),S("Failed to generate short URL")}finally{v(!1)}}},[t,e,n,A,s,l]),z=Y.useCallback(async Z=>{try{let $;const V=Z.match(/\/p\/([A-Za-z0-9]{6,16})(?:#(.*))?(?:\?|$)/);if(V){const te=V[1],re=new URLSearchParams(V[2]??""),se=re.get("key")??void 0,oe=re.get("paste")?atob(re.get("paste").replace(/-/g,"+").replace(/_/g,"/")):void 0,ue=await DAe(te,oe??s,se);if(!ue)return{success:!1,count:0,planTitle:"",error:"Failed to load from short URL — paste may have expired"};$=ue}else{const te=Z.indexOf("#");if(te===-1)return{success:!1,count:0,planTitle:"",error:"Invalid share URL: no hash fragment or short link found"};const re=Z.slice(te+1);if(!re)return{success:!1,count:0,planTitle:"",error:"Invalid share URL: empty hash"};$=await j2(re)}let Ae="Unknown Plan";if($.p){const te=$.p.trim().split(`
|
|
975
|
-
`).find(re=>re.startsWith("#"));te&&(Ae=te.replace(/^#+\s*/,"").trim())}else if($.h){const te=$.h.match(/<title[^>]*>([^<]+)<\/title>/i);te&&(Ae=te[1].trim())}const ne=wS($.a,$.d,$.s);if(ne.length===0)return{success:!0,count:0,planTitle:Ae,error:"No annotations found in share link"};const pe=ne.filter(te=>!e.some(re=>re.originalText===te.originalText&&re.type===te.type&&re.text===te.text));if(pe.length>0&&(r(te=>{const re=ne.filter(oe=>!te.some(ue=>ue.originalText===oe.originalText&&ue.type===oe.type&&ue.text===oe.text));if(re.length===0)return te;const se=[...te,...re];return N(se),se}),$.g?.length)){const te=HE($.g)??[];i(re=>{const se=new Set(re.map(ue=>ue.path)),oe=te.filter(ue=>!se.has(ue.path));return oe.length>0?[...re,...oe]:re}),K(te)}return{success:!0,count:pe.length,planTitle:Ae}}catch($){return{success:!1,count:0,planTitle:"",error:$ instanceof Error?$.message:"Failed to decompress share URL"}}},[e,n,r,i,s]);return{isSharedSession:g,isLoadingShared:m,shareUrl:b,shareUrlSize:B,shortShareUrl:Q,isGeneratingShortUrl:_,shortUrlError:x,pendingSharedAnnotations:L,sharedGlobalAttachments:U,clearPendingSharedAnnotations:F,refreshShareUrl:H,generateShortUrl:P,importFromShareUrl:z,shareLoadError:R,clearShareLoadError:T}}var kS=(t=>(t.Approve="approve",t.Feedback="feedback",t))(kS||{});function wdt(t=window.location){const e=new URLSearchParams(t.search);let n=e.get("cb"),a=e.get("ct");if(!n||!a){const r=t.hash.indexOf("?");if(r!==-1){const i=new URLSearchParams(t.hash.slice(r+1));n=n??i.get("cb"),a=a??i.get("ct")}}if(!n||!a)return null;try{const{protocol:r}=new URL(n);if(r!=="https:"&&r!=="http:")return null}catch{return null}return{callbackUrl:n,token:a}}async function kdt(t,e,n){const a=t==="approve"?"Plan approved! The bot will proceed to implementation.":"Feedback sent! The bot will re-plan with your annotations.";try{const r=await fetch(e.callbackUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,token:e.token,annotated_url:n})});return r.ok?{type:"success",message:a}:{type:"error",message:r.status===401?"Plan link expired — request a new one from the bot.":"Callback failed."}}catch{return{type:"error",message:"Callback failed."}}}const Lve="plannotator-agent-switch",Tve="plannotator-agent-custom",vdt=[{value:"build",label:"Build",description:"Switch to build agent after approval"},{value:"custom",label:"Custom",description:"Switch to a custom agent after approval"},{value:"disabled",label:"Disabled",description:"Stay on current agent after approval"}],Ddt={switchTo:"build"};function OM(){const t=qt.getItem(Lve),e=qt.getItem(Tve)||void 0;return t?{switchTo:t,customName:e}:Ddt}function Gve(t){qt.setItem(Lve,t.switchTo),t.customName&&qt.setItem(Tve,t.customName)}function xdt(t){if(t.switchTo!=="disabled")return t.switchTo==="custom"&&t.customName?t.customName:t.switchTo}function Ove(t){const[e,n]=Y.useState([]),[a,r]=Y.useState(!1);Y.useEffect(()=>{t==="opencode"&&(r(!0),fetch("/api/agents").then(A=>A.json()).then(A=>{A.agents?.length&&n(A.agents)}).catch(()=>{n([])}).finally(()=>{r(!1)}))},[t]);const i=Y.useCallback(A=>e.length===0?!0:e.some(s=>s.id.toLowerCase()===A.toLowerCase()),[e]),o=Y.useCallback(()=>{if(e.length===0)return null;const A=OM();return A.switchTo==="disabled"?null:A.switchTo==="custom"?A.customName&&!i(A.customName)?`Agent "${A.customName}" not found in OpenCode. It may cause errors.`:null:i(A.switchTo)?null:`Agent "${A.switchTo}" not found in OpenCode. Select another or it may cause errors.`},[e,i]);return{agents:e,isLoading:a,validateAgent:i,getAgentWarning:o}}function Sdt(t,e,n){const[a,r]=Y.useState(null),i=Y.useRef(null);return Y.useEffect(()=>{const o=n??t.current;if(!o)return;const A=o.querySelectorAll('[data-block-type="heading"]');if(A.length===0)return;const s=new Map;return i.current=new IntersectionObserver(l=>{l.forEach(g=>{s.set(g.target,g.isIntersecting)});let d=null,u=1/0;for(const[g,p]of s)if(p){const m=g.getBoundingClientRect();m.top<u&&(u=m.top,d=g)}if(d){const g=d.getAttribute("data-block-id");g&&r(g)}},{root:o,rootMargin:"-80px 0px -80% 0px",threshold:[0,.1,.5,1]}),A.forEach(l=>{i.current?.observe(l)}),()=>{i.current?.disconnect()}},[t,e,n]),a}function SAe(t){window.close(),setTimeout(()=>{window.closed||t()},300)}function _dt(t){const[e,n]=Y.useState({phase:"idle"});Y.useEffect(()=>{if(!t)return;const r=ECe();r==="0"?(SAe(()=>n({phase:"closeFailed"})),n({phase:"closed"})):n(r!=="off"?{phase:"counting",remaining:Number(r)}:{phase:"prompt"})},[t]),Y.useEffect(()=>{if(e.phase!=="counting")return;if(e.remaining<=0){SAe(()=>n({phase:"closeFailed"}));return}const r=setTimeout(()=>n(i=>i.phase==="counting"?{phase:"counting",remaining:i.remaining-1}:i),1e3);return()=>clearTimeout(r)},[e]);const a=Y.useCallback(()=>{ICe("3"),n({phase:"counting",remaining:3})},[]);return{state:e,enableAndStart:a}}const Rdt=()=>I.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Ndt=()=>I.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})});function Mdt({submitted:t,title:e,subtitle:n,agentLabel:a}){const{state:r,enableAndStart:i}=_dt(!!t);if(!t)return null;const o=t==="approved";return I.jsx("div",{className:"fixed inset-0 z-[100] bg-background flex items-center justify-center",children:I.jsxs("div",{className:"text-center space-y-6 max-w-md px-8",children:[I.jsx("div",{className:`mx-auto w-16 h-16 rounded-full flex items-center justify-center ${o?"bg-success/20 text-success":"bg-accent/20 text-accent"}`,children:o?I.jsx(Rdt,{}):I.jsx(Ndt,{})}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e}),I.jsx("p",{className:"text-muted-foreground",children:n})]}),I.jsx("div",{className:"pt-4 border-t border-border space-y-2",children:r.phase==="counting"?I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-sm text-muted-foreground",children:["This tab will close in ",I.jsx("span",{className:"text-foreground font-medium",children:r.remaining})," second",r.remaining!==1?"s":"","..."]}),I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"You can change this in Settings."})]}):r.phase==="closeFailed"?I.jsxs(I.Fragment,{children:[I.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not close this tab automatically. Please close it manually."}),I.jsxs("p",{className:"text-xs text-muted-foreground/60",children:["Auto-close works when the tab is opened by ",a,"."]})]}):I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can close this tab and return to ",I.jsx("span",{className:"text-foreground font-medium",children:a}),"."]}),r.phase==="prompt"?I.jsxs(I.Fragment,{children:[I.jsxs("label",{className:"flex items-center justify-center gap-2 cursor-pointer group",children:[I.jsx("input",{type:"checkbox",checked:!1,onChange:i,className:"accent-primary"}),I.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:"Auto-close this tab after 3 seconds"})]}),I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"You can change the delay in Settings."})]}):I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Your response has been sent."})]})})]})})}const Fdt="https://api.github.com/repos/backnotprop/plannotator/releases/latest",Uve="update-dismissed-version",_Ae={"0.5.0":{title:"Code Review is here!",description:"Review git diffs with inline annotations. Run /plannotator-review to try it."}};function Ldt(t,e){const n=i=>i.replace(/^v/,""),a=n(t).split(".").map(Number),r=n(e).split(".").map(Number);for(let i=0;i<Math.max(a.length,r.length);i++){const o=a[i]||0,A=r[i]||0;if(A>o)return!0;if(A<o)return!1}return!1}function RAe(t){const e=dq(Uve);if(!e)return!1;const n=t.replace(/^v/,""),a=e.replace(/^v/,"");return n===a}function Tdt(){const[t,e]=Y.useState(null),[n,a]=Y.useState(!1),r=Y.useCallback(()=>{if(!t?.latestVersion)return;const i=t.latestVersion.replace(/^v/,"");uq(Uve,i),a(!0)},[t?.latestVersion]);return Y.useEffect(()=>{(async()=>{try{const o="0.19.23",s=new URLSearchParams(window.location.search).get("preview-update");if(s){const h=s.replace(/^v/,"");a(RAe(h)),e({currentVersion:o,latestVersion:s,updateAvailable:!0,releaseUrl:`https://github.com/backnotprop/plannotator/releases/tag/v${h}`,featureHighlight:_Ae[h]});return}const l=await fetch(Fdt);if(!l.ok)return;const d=await l.json(),u=d.tag_name,g=Ldt(o,u),p=u.replace(/^v/,""),m=_Ae[p];a(RAe(u)),e({currentVersion:o,latestVersion:u,updateAvailable:g,releaseUrl:d.html_url,featureHighlight:m})}catch(o){console.debug("Update check failed:",o)}})()},[]),t?{...t,dismissed:n,dismiss:r}:null}const NAe=Array.from(new Set(Object.keys(Uf).flatMap(t=>SN(t)))),Gdt=Object.keys(Uf).filter(t=>SN(t).length===0),Odt=({isOpen:t,origin:e,providerName:n,onOpenAI:a,onDismiss:r})=>{if(!t)return null;const i=q5(e??void 0),o=n?K0(n).label:null,A=Gdt.map(q5).join(", ");return ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/90 backdrop-blur-sm p-4",children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-xl shadow-2xl",children:[I.jsxs("div",{className:"p-5 border-b border-border",children:[I.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[I.jsx("div",{className:"p-1.5 rounded-lg bg-primary/15",children:I.jsx(cm,{className:"w-5 h-5 text-primary"})}),I.jsx("h3",{className:"font-semibold text-base",children:"New: Ask AI for annotated documents"})]}),I.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat with plans and annotated documents directly inside Plannotator."}),o&&I.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Plannotator selected ",o," for ",i,"."]})]}),I.jsxs("div",{className:"p-4 space-y-4",children:[NAe.length>0&&I.jsxs("div",{children:[I.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Supported providers"}),I.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:NAe.map(s=>{const l=K0(s),d=l.icon,u=s===n;return I.jsxs("div",{className:`flex min-h-16 items-center gap-2 rounded-lg border p-2.5 ${u?"border-primary bg-primary/5":"border-border bg-muted/35"}`,children:[I.jsx("div",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md bg-background/70 text-muted-foreground",children:I.jsx(d,{className:"h-[18px] w-[18px]"})}),I.jsxs("div",{className:"min-w-0",children:[I.jsx("div",{className:"truncate text-sm font-medium",children:l.label}),u&&I.jsx("div",{className:"text-[10px] uppercase tracking-wide text-primary",children:"selected"})]})]},s)})})]}),I.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[I.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-transparent bg-muted/50",children:[I.jsx(cm,{className:"w-4 h-4 mt-0.5 text-primary flex-shrink-0"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:"Ask from comments"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Use Ask AI from a comment popover to chat about selected text."})]})]}),I.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-transparent bg-muted/50",children:[I.jsx(cm,{className:"w-4 h-4 mt-0.5 text-primary flex-shrink-0"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:"Open the side chat"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Use the AI button in the header for broader document questions."})]})]})]}),A&&I.jsxs("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:["Not supported for Ask AI yet: ",A,"."]})]}),I.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center gap-3",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"This notice only appears once."}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("button",{onClick:r,className:"px-4 py-2 border border-border rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:"Dismiss"}),I.jsx("button",{onClick:a,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90 transition-opacity",children:"Open AI Chat"})]})]})]})}),document.body)},Pve="plannotator-default-notes-app";function Kve(){return qt.getItem(Pve)||"ask"}function MAe(t){qt.setItem(Pve,t)}const Hve="plannotator-save-enabled",UK="plannotator-save-path";function z2(){const t=qt.getItem(Hve),e=qt.getItem(UK);return{enabled:t!=="false",customPath:e||null}}function Udt(t){qt.setItem(Hve,String(t.enabled)),t.customPath?qt.setItem(UK,t.customPath):qt.removeItem(UK)}const Yve="plannotator-plan-ai-announcement-seen",qve="1";function Pdt(){return qt.getItem(Yve)!==qve}function Kdt(){qt.setItem(Yve,qve)}function nz(t){const e=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2);return t?`${t}-${e}`:e}function Hdt(t){if(t.filePath&&t.lineStart!=null&&t.lineEnd!=null){const e=t.lineStart===t.lineEnd?`line ${t.lineStart}`:`lines ${t.lineStart}-${t.lineEnd}`,n=t.side==="new"?"new (added)":"old (removed)",a=t.selectedCode?`
|
|
975
|
+
`).find(re=>re.startsWith("#"));te&&(Ae=te.replace(/^#+\s*/,"").trim())}else if($.h){const te=$.h.match(/<title[^>]*>([^<]+)<\/title>/i);te&&(Ae=te[1].trim())}const ne=wS($.a,$.d,$.s);if(ne.length===0)return{success:!0,count:0,planTitle:Ae,error:"No annotations found in share link"};const pe=ne.filter(te=>!e.some(re=>re.originalText===te.originalText&&re.type===te.type&&re.text===te.text));if(pe.length>0&&(r(te=>{const re=ne.filter(oe=>!te.some(ue=>ue.originalText===oe.originalText&&ue.type===oe.type&&ue.text===oe.text));if(re.length===0)return te;const se=[...te,...re];return N(se),se}),$.g?.length)){const te=HE($.g)??[];i(re=>{const se=new Set(re.map(ue=>ue.path)),oe=te.filter(ue=>!se.has(ue.path));return oe.length>0?[...re,...oe]:re}),K(te)}return{success:!0,count:pe.length,planTitle:Ae}}catch($){return{success:!1,count:0,planTitle:"",error:$ instanceof Error?$.message:"Failed to decompress share URL"}}},[e,n,r,i,s]);return{isSharedSession:g,isLoadingShared:m,shareUrl:b,shareUrlSize:B,shortShareUrl:Q,isGeneratingShortUrl:_,shortUrlError:x,pendingSharedAnnotations:L,sharedGlobalAttachments:U,clearPendingSharedAnnotations:F,refreshShareUrl:H,generateShortUrl:P,importFromShareUrl:z,shareLoadError:R,clearShareLoadError:T}}var kS=(t=>(t.Approve="approve",t.Feedback="feedback",t))(kS||{});function wdt(t=window.location){const e=new URLSearchParams(t.search);let n=e.get("cb"),a=e.get("ct");if(!n||!a){const r=t.hash.indexOf("?");if(r!==-1){const i=new URLSearchParams(t.hash.slice(r+1));n=n??i.get("cb"),a=a??i.get("ct")}}if(!n||!a)return null;try{const{protocol:r}=new URL(n);if(r!=="https:"&&r!=="http:")return null}catch{return null}return{callbackUrl:n,token:a}}async function kdt(t,e,n){const a=t==="approve"?"Plan approved! The bot will proceed to implementation.":"Feedback sent! The bot will re-plan with your annotations.";try{const r=await fetch(e.callbackUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,token:e.token,annotated_url:n})});return r.ok?{type:"success",message:a}:{type:"error",message:r.status===401?"Plan link expired — request a new one from the bot.":"Callback failed."}}catch{return{type:"error",message:"Callback failed."}}}const Lve="plannotator-agent-switch",Tve="plannotator-agent-custom",vdt=[{value:"build",label:"Build",description:"Switch to build agent after approval"},{value:"custom",label:"Custom",description:"Switch to a custom agent after approval"},{value:"disabled",label:"Disabled",description:"Stay on current agent after approval"}],Ddt={switchTo:"build"};function OM(){const t=qt.getItem(Lve),e=qt.getItem(Tve)||void 0;return t?{switchTo:t,customName:e}:Ddt}function Gve(t){qt.setItem(Lve,t.switchTo),t.customName&&qt.setItem(Tve,t.customName)}function xdt(t){if(t.switchTo!=="disabled")return t.switchTo==="custom"&&t.customName?t.customName:t.switchTo}function Ove(t){const[e,n]=Y.useState([]),[a,r]=Y.useState(!1);Y.useEffect(()=>{t==="opencode"&&(r(!0),fetch("/api/agents").then(A=>A.json()).then(A=>{A.agents?.length&&n(A.agents)}).catch(()=>{n([])}).finally(()=>{r(!1)}))},[t]);const i=Y.useCallback(A=>e.length===0?!0:e.some(s=>s.id.toLowerCase()===A.toLowerCase()),[e]),o=Y.useCallback(()=>{if(e.length===0)return null;const A=OM();return A.switchTo==="disabled"?null:A.switchTo==="custom"?A.customName&&!i(A.customName)?`Agent "${A.customName}" not found in OpenCode. It may cause errors.`:null:i(A.switchTo)?null:`Agent "${A.switchTo}" not found in OpenCode. Select another or it may cause errors.`},[e,i]);return{agents:e,isLoading:a,validateAgent:i,getAgentWarning:o}}function Sdt(t,e,n){const[a,r]=Y.useState(null),i=Y.useRef(null);return Y.useEffect(()=>{const o=n??t.current;if(!o)return;const A=o.querySelectorAll('[data-block-type="heading"]');if(A.length===0)return;const s=new Map;return i.current=new IntersectionObserver(l=>{l.forEach(g=>{s.set(g.target,g.isIntersecting)});let d=null,u=1/0;for(const[g,p]of s)if(p){const m=g.getBoundingClientRect();m.top<u&&(u=m.top,d=g)}if(d){const g=d.getAttribute("data-block-id");g&&r(g)}},{root:o,rootMargin:"-80px 0px -80% 0px",threshold:[0,.1,.5,1]}),A.forEach(l=>{i.current?.observe(l)}),()=>{i.current?.disconnect()}},[t,e,n]),a}function SAe(t){window.close(),setTimeout(()=>{window.closed||t()},300)}function _dt(t){const[e,n]=Y.useState({phase:"idle"});Y.useEffect(()=>{if(!t)return;const r=ECe();r==="0"?(SAe(()=>n({phase:"closeFailed"})),n({phase:"closed"})):n(r!=="off"?{phase:"counting",remaining:Number(r)}:{phase:"prompt"})},[t]),Y.useEffect(()=>{if(e.phase!=="counting")return;if(e.remaining<=0){SAe(()=>n({phase:"closeFailed"}));return}const r=setTimeout(()=>n(i=>i.phase==="counting"?{phase:"counting",remaining:i.remaining-1}:i),1e3);return()=>clearTimeout(r)},[e]);const a=Y.useCallback(()=>{ICe("3"),n({phase:"counting",remaining:3})},[]);return{state:e,enableAndStart:a}}const Rdt=()=>I.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),Ndt=()=>I.jsx("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})});function Mdt({submitted:t,title:e,subtitle:n,agentLabel:a}){const{state:r,enableAndStart:i}=_dt(!!t);if(!t)return null;const o=t==="approved";return I.jsx("div",{className:"fixed inset-0 z-[100] bg-background flex items-center justify-center",children:I.jsxs("div",{className:"text-center space-y-6 max-w-md px-8",children:[I.jsx("div",{className:`mx-auto w-16 h-16 rounded-full flex items-center justify-center ${o?"bg-success/20 text-success":"bg-accent/20 text-accent"}`,children:o?I.jsx(Rdt,{}):I.jsx(Ndt,{})}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("h2",{className:"text-xl font-semibold text-foreground",children:e}),I.jsx("p",{className:"text-muted-foreground",children:n})]}),I.jsx("div",{className:"pt-4 border-t border-border space-y-2",children:r.phase==="counting"?I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-sm text-muted-foreground",children:["This tab will close in ",I.jsx("span",{className:"text-foreground font-medium",children:r.remaining})," second",r.remaining!==1?"s":"","..."]}),I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"You can change this in Settings."})]}):r.phase==="closeFailed"?I.jsxs(I.Fragment,{children:[I.jsx("p",{className:"text-sm text-muted-foreground",children:"Could not close this tab automatically. Please close it manually."}),I.jsxs("p",{className:"text-xs text-muted-foreground/60",children:["Auto-close works when the tab is opened by ",a,"."]})]}):I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can close this tab and return to ",I.jsx("span",{className:"text-foreground font-medium",children:a}),"."]}),r.phase==="prompt"?I.jsxs(I.Fragment,{children:[I.jsxs("label",{className:"flex items-center justify-center gap-2 cursor-pointer group",children:[I.jsx("input",{type:"checkbox",checked:!1,onChange:i,className:"accent-primary"}),I.jsx("span",{className:"text-xs text-muted-foreground group-hover:text-foreground transition-colors",children:"Auto-close this tab after 3 seconds"})]}),I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"You can change the delay in Settings."})]}):I.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Your response has been sent."})]})})]})})}const Fdt="https://api.github.com/repos/backnotprop/plannotator/releases/latest",Uve="update-dismissed-version",_Ae={"0.5.0":{title:"Code Review is here!",description:"Review git diffs with inline annotations. Run /plannotator-review to try it."}};function Ldt(t,e){const n=i=>i.replace(/^v/,""),a=n(t).split(".").map(Number),r=n(e).split(".").map(Number);for(let i=0;i<Math.max(a.length,r.length);i++){const o=a[i]||0,A=r[i]||0;if(A>o)return!0;if(A<o)return!1}return!1}function RAe(t){const e=dq(Uve);if(!e)return!1;const n=t.replace(/^v/,""),a=e.replace(/^v/,"");return n===a}function Tdt(){const[t,e]=Y.useState(null),[n,a]=Y.useState(!1),r=Y.useCallback(()=>{if(!t?.latestVersion)return;const i=t.latestVersion.replace(/^v/,"");uq(Uve,i),a(!0)},[t?.latestVersion]);return Y.useEffect(()=>{(async()=>{try{const o="0.19.24",s=new URLSearchParams(window.location.search).get("preview-update");if(s){const h=s.replace(/^v/,"");a(RAe(h)),e({currentVersion:o,latestVersion:s,updateAvailable:!0,releaseUrl:`https://github.com/backnotprop/plannotator/releases/tag/v${h}`,featureHighlight:_Ae[h]});return}const l=await fetch(Fdt);if(!l.ok)return;const d=await l.json(),u=d.tag_name,g=Ldt(o,u),p=u.replace(/^v/,""),m=_Ae[p];a(RAe(u)),e({currentVersion:o,latestVersion:u,updateAvailable:g,releaseUrl:d.html_url,featureHighlight:m})}catch(o){console.debug("Update check failed:",o)}})()},[]),t?{...t,dismissed:n,dismiss:r}:null}const NAe=Array.from(new Set(Object.keys(Uf).flatMap(t=>SN(t)))),Gdt=Object.keys(Uf).filter(t=>SN(t).length===0),Odt=({isOpen:t,origin:e,providerName:n,onOpenAI:a,onDismiss:r})=>{if(!t)return null;const i=q5(e??void 0),o=n?K0(n).label:null,A=Gdt.map(q5).join(", ");return ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/90 backdrop-blur-sm p-4",children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-xl shadow-2xl",children:[I.jsxs("div",{className:"p-5 border-b border-border",children:[I.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[I.jsx("div",{className:"p-1.5 rounded-lg bg-primary/15",children:I.jsx(cm,{className:"w-5 h-5 text-primary"})}),I.jsx("h3",{className:"font-semibold text-base",children:"New: Ask AI for annotated documents"})]}),I.jsx("p",{className:"text-sm text-muted-foreground",children:"Chat with plans and annotated documents directly inside Plannotator."}),o&&I.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Plannotator selected ",o," for ",i,"."]})]}),I.jsxs("div",{className:"p-4 space-y-4",children:[NAe.length>0&&I.jsxs("div",{children:[I.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Supported providers"}),I.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:NAe.map(s=>{const l=K0(s),d=l.icon,u=s===n;return I.jsxs("div",{className:`flex min-h-16 items-center gap-2 rounded-lg border p-2.5 ${u?"border-primary bg-primary/5":"border-border bg-muted/35"}`,children:[I.jsx("div",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md bg-background/70 text-muted-foreground",children:I.jsx(d,{className:"h-[18px] w-[18px]"})}),I.jsxs("div",{className:"min-w-0",children:[I.jsx("div",{className:"truncate text-sm font-medium",children:l.label}),u&&I.jsx("div",{className:"text-[10px] uppercase tracking-wide text-primary",children:"selected"})]})]},s)})})]}),I.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[I.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-transparent bg-muted/50",children:[I.jsx(cm,{className:"w-4 h-4 mt-0.5 text-primary flex-shrink-0"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:"Ask from comments"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Use Ask AI from a comment popover to chat about selected text."})]})]}),I.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-transparent bg-muted/50",children:[I.jsx(cm,{className:"w-4 h-4 mt-0.5 text-primary flex-shrink-0"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:"Open the side chat"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Use the AI button in the header for broader document questions."})]})]})]}),A&&I.jsxs("p",{className:"text-[11px] leading-relaxed text-muted-foreground/70",children:["Not supported for Ask AI yet: ",A,"."]})]}),I.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center gap-3",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"This notice only appears once."}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("button",{onClick:r,className:"px-4 py-2 border border-border rounded-lg text-sm font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:"Dismiss"}),I.jsx("button",{onClick:a,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90 transition-opacity",children:"Open AI Chat"})]})]})]})}),document.body)},Pve="plannotator-default-notes-app";function Kve(){return qt.getItem(Pve)||"ask"}function MAe(t){qt.setItem(Pve,t)}const Hve="plannotator-save-enabled",UK="plannotator-save-path";function z2(){const t=qt.getItem(Hve),e=qt.getItem(UK);return{enabled:t!=="false",customPath:e||null}}function Udt(t){qt.setItem(Hve,String(t.enabled)),t.customPath?qt.setItem(UK,t.customPath):qt.removeItem(UK)}const Yve="plannotator-plan-ai-announcement-seen",qve="1";function Pdt(){return qt.getItem(Yve)!==qve}function Kdt(){qt.setItem(Yve,qve)}function nz(t){const e=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2);return t?`${t}-${e}`:e}function Hdt(t){if(t.filePath&&t.lineStart!=null&&t.lineEnd!=null){const e=t.lineStart===t.lineEnd?`line ${t.lineStart}`:`lines ${t.lineStart}-${t.lineEnd}`,n=t.side==="new"?"new (added)":"old (removed)",a=t.selectedCode?`
|
|
976
976
|
\`\`\`
|
|
977
977
|
${t.selectedCode}
|
|
978
978
|
\`\`\`
|
|
@@ -988,7 +988,7 @@ ${t.scope.text}
|
|
|
988
988
|
\`\`\``:"";return`${e}${n}${a}
|
|
989
989
|
|
|
990
990
|
${t.prompt}`}return t.prompt}function FAe(t="Chat"){return{id:nz("ai-thread"),title:t,sessionId:null,messages:[],permissionRequests:[]}}function LAe(t){if(typeof DOMException<"u")return new DOMException(t,"AbortError");const e=new Error(t);return e.name="AbortError",e}function Ydt({context:t,providerId:e,model:n,reasoningEffort:a,buildPrompt:r=Hdt,threadTitle:i="Chat"}){const[o,A]=Y.useState(()=>FAe(i)),[s,l]=Y.useState(!1),[d,u]=Y.useState(!1),[g,p]=Y.useState(null),m=Y.useRef(null),h=Y.useRef(0),b=Y.useRef(0),C=Y.useRef(null);C.current=o.sessionId;const B=Y.useCallback(N=>{A(U=>({...U,messages:N(U.messages)}))},[]),y=Y.useCallback(N=>{A(U=>({...U,permissionRequests:N(U.permissionRequests)}))},[]),Q=Y.useCallback(N=>{A(U=>({...U,sessionId:N}))},[]),k=Y.useCallback(async(N,U)=>{if(!t)throw new Error("AI context is unavailable");const K=++b.current;l(!0);try{const R=await fetch("/api/ai/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:t,...e&&{providerId:e},...n&&{model:n},...a&&{reasoningEffort:a}}),signal:N});if(!R.ok){const F=await R.json().catch(()=>({error:"Failed to create AI session"}));throw new Error(F.error||`HTTP ${R.status}`)}const O=await R.json();if(N.aborted||U!==h.current)throw fetch("/api/ai/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:O.sessionId})}).catch(()=>{}),LAe("AI session creation was superseded");return Q(O.sessionId),O.sessionId}finally{b.current===K&&l(!1)}},[t,n,e,a,Q]),_=Y.useCallback(async N=>{m.current&&m.current.abort();const U=new AbortController;m.current=U;const K=h.current;p(null);const R=nz("ai-question"),O={id:R,prompt:N.prompt,scope:N.scope,filePath:N.filePath,lineStart:N.lineStart,lineEnd:N.lineEnd,side:N.side,selectedCode:N.selectedCode,createdAt:Date.now()},F={questionId:R,text:"",isStreaming:!0,createdAt:Date.now()};B(T=>[...T,{question:O,response:F}]),u(!0);try{let T=C.current;if(T||(T=await k(U.signal,K)),U.signal.aborted||K!==h.current)throw LAe("AI question was superseded");const G=r(N),H=await fetch("/api/ai/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:T,prompt:G,...N.contextUpdate&&{contextUpdate:N.contextUpdate}}),signal:U.signal});if(!H.ok||!H.body){const Z=await H.json().catch(()=>({error:"Query failed"}));throw new Error(Z.error||`HTTP ${H.status}`)}const q=H.body.getReader(),P=new TextDecoder;let z="";for(;;){const{done:Z,value:$}=await q.read();if(Z)break;z+=P.decode($,{stream:!0});const V=z.split(`
|
|
991
|
-
`);z=V.pop();for(const Ae of V){if(!Ae.startsWith("data: "))continue;const ne=Ae.slice(6);if(ne!=="[DONE]")try{const pe=JSON.parse(ne);pe.type==="text_delta"?B(te=>te.map(re=>re.question.id===R?{...re,response:{...re.response,text:re.response.text+pe.delta}}:re)):pe.type==="text"?B(te=>te.map(re=>re.question.id===R&&!re.response.text?{...re,response:{...re.response,text:pe.text}}:re)):pe.type==="permission_request"?y(te=>[...te,{requestId:pe.requestId,toolName:pe.toolName,toolInput:pe.toolInput,title:pe.title,displayName:pe.displayName,description:pe.description,toolUseId:pe.toolUseId}]):pe.type==="error"?(B(te=>te.map(re=>re.question.id===R?{...re,response:{...re.response,error:pe.error,isStreaming:!1}}:re)),p(pe.error)):pe.type==="result"&&B(te=>te.map(re=>{if(re.question.id!==R)return re;const se=pe.result??"";return{...re,response:{...re.response,text:re.response.text||se,isStreaming:!1}}}))}catch{}}}B(Z=>Z.map($=>$.question.id===R&&$.response.isStreaming?{...$,response:{...$.response,isStreaming:!1}}:$))}catch(T){if(T instanceof Error&&T.name==="AbortError"){B(H=>H.map(q=>q.question.id===R?{...q,response:{...q.response,isStreaming:!1}}:q));return}const G=T instanceof Error?T.message:String(T);p(G),B(H=>H.map(q=>q.question.id===R?{...q,response:{...q.response,error:G,isStreaming:!1}}:q))}finally{m.current===U&&(u(!1),m.current=null)}},[r,k,B,y]),v=Y.useCallback(()=>{m.current&&(m.current.abort(),m.current=null,u(!1)),C.current&&fetch("/api/ai/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:C.current})}).catch(()=>{})},[]),x=Y.useCallback((N,U)=>{C.current&&(y(K=>K.map(R=>R.requestId===N?{...R,decided:U?"allow":"deny"}:R)),fetch("/api/ai/permission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:C.current,requestId:N,allow:U})}).catch(()=>{}))},[y]),S=Y.useCallback(()=>{h.current+=1,b.current+=1,m.current&&(m.current.abort(),m.current=null),Q(null),l(!1),u(!1)},[Q]),L=Y.useCallback(()=>{h.current+=1,b.current+=1,m.current&&(m.current.abort(),m.current=null),A(FAe(i)),l(!1),u(!1),p(null)},[i]);return Y.useEffect(()=>()=>{h.current+=1,b.current+=1,m.current&&m.current.abort()},[]),{thread:o,messages:o.messages,isCreatingSession:s,isStreaming:d,error:g,permissionRequests:o.permissionRequests,respondToPermission:x,ask:_,abort:v,resetSession:S,resetThread:L,sessionId:o.sessionId}}const jve="plannotator-toc-enabled",zve="plannotator-sticky-actions-enabled",Jve="plannotator-plan-width",f9=[{id:"compact",label:"Compact",px:832,hint:"Best for reading. Ideal line length for laptops and focused review."},{id:"default",label:"Default",px:1040,hint:"Balanced. More room for code blocks without sacrificing readability."},{id:"wide",label:"Wide",px:1280,hint:"For large monitors. Best with diagrams and wide code."}];function PK(){const t=qt.getItem(Jve);return{tocEnabled:qt.getItem(jve)!=="false",stickyActionsEnabled:qt.getItem(zve)!=="false",planWidth:t==="compact"||t==="default"||t==="wide"?t:"compact"}}function qdt(t){qt.setItem(jve,String(t.tocEnabled)),qt.setItem(zve,String(t.stickyActionsEnabled)),qt.setItem(Jve,t.planWidth)}const Wve="plannotator-editor-mode",jdt="selection";function zdt(){const t=qt.getItem(Wve);return t==="selection"||t==="comment"||t==="redline"||t==="quickLabel"?t:jdt}function Jdt(t){qt.setItem(Wve,t)}const Zve="plannotator-input-method",Wdt="drag";function Zdt(){const t=qt.getItem(Zve);return t==="drag"||t==="pinpoint"?t:Wdt}function Vdt(t){qt.setItem(Zve,t)}const Xdt=300,$dt=300;function eut(t,e){const n=Y.useRef("idle"),a=Y.useRef(0),r=Y.useRef(void 0),i=Y.useRef(t);Y.useEffect(()=>{n.current==="idle"&&(i.current=t)},[t]);const o=Y.useCallback(A=>A==="drag"?"pinpoint":"drag",[]);Y.useEffect(()=>{const A=l=>{if(l.key!=="Alt"||l.repeat)return;const d=l.target?.tagName;d==="INPUT"||d==="TEXTAREA"||l.target?.isContentEditable||document.querySelector("[data-quick-label-picker]")||(n.current==="idle"?(i.current=t,a.current=Date.now(),n.current="held",e(o(t))):n.current==="tapped"&&(clearTimeout(r.current),n.current="idle",i.current=o(i.current)))},s=l=>{l.key==="Alt"&&n.current==="held"&&(Date.now()-a.current>=$dt?(e(i.current),n.current="idle"):(n.current="tapped",r.current=setTimeout(()=>{n.current==="tapped"&&(e(i.current),n.current="idle")},Xdt)))};return window.addEventListener("keydown",A),window.addEventListener("keyup",s),()=>{clearTimeout(r.current),window.removeEventListener("keydown",A),window.removeEventListener("keyup",s)}},[t,e,o])}function tut(){Y.useEffect(()=>{const t=()=>document.documentElement.classList.add("plannotator-print"),e=()=>document.documentElement.classList.remove("plannotator-print"),n=()=>{!document.hidden&&document.documentElement.classList.contains("plannotator-print")&&document.documentElement.classList.remove("plannotator-print")};return window.addEventListener("beforeprint",t),window.addEventListener("afterprint",e),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("beforeprint",t),window.removeEventListener("afterprint",e),document.removeEventListener("visibilitychange",n),document.documentElement.classList.remove("plannotator-print")}},[])}function TAe({storageKey:t,defaultWidth:e=288,minWidth:n=200,maxWidth:a=600,side:r="right"}){const[i,o]=Y.useState(()=>{const b=qt.getItem(t);if(b){const C=Number(b);if(!Number.isNaN(C)&&C>=n&&C<=a)return C}return e}),[A,s]=Y.useState(!1),l=Y.useRef(0),d=Y.useRef(0),u=Y.useRef(i),g=Y.useCallback(b=>{u.current=b,o(b)},[]),p=Y.useCallback(b=>{b.preventDefault(),l.current=b.clientX,d.current=u.current,s(!0)},[]),m=Y.useCallback(b=>{b.preventDefault(),l.current=b.touches[0].clientX,d.current=u.current,s(!0)},[]);Y.useEffect(()=>{if(!A)return;const b=y=>"touches"in y?y.touches[0]?.clientX??y.changedTouches[0]?.clientX??0:y.clientX,C=y=>{const Q=b(y),k=r==="right"?l.current-Q:Q-l.current;g(Math.min(a,Math.max(n,d.current+k)))},B=()=>{s(!1),qt.setItem(t,String(u.current))};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",B),document.addEventListener("touchmove",C,{passive:!1}),document.addEventListener("touchend",B),document.addEventListener("touchcancel",B),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",B),document.removeEventListener("touchcancel",B)}},[A,n,a,t,r,g]);const h=Y.useCallback(()=>{g(e),qt.setItem(t,String(e))},[e,t,g]);return{width:i,isDragging:A,handleProps:{isDragging:A,onMouseDown:p,onTouchStart:m,onDoubleClick:h}}}const GAe=({isDragging:t,onMouseDown:e,onTouchStart:n,onDoubleClick:a,className:r,side:i})=>I.jsxs("div",{className:`relative w-0 cursor-col-resize flex-shrink-0 group z-10${r?` ${r}`:""}`,children:[I.jsx("div",{className:`absolute inset-y-0 -left-0.5 -right-0.5 transition-colors ${t?"bg-primary/50":"group-hover:bg-border"}`}),I.jsx("div",{className:`absolute inset-y-0 ${i==="left"?"-right-2 -left-1":i==="right"?"-right-3 left-0":"-inset-x-2"}`,onMouseDown:e,onTouchStart:n,onDoubleClick:a})]});function nut(){const t=Y.useRef(null),[e,n]=Y.useState(null),a=Y.useCallback(r=>{const i=r;t.current=i,n(i)},[]);return{ref:t,viewport:e,onViewportReady:a}}const Vve="plannotator-permission-mode",az="plannotator-permission-mode-configured",KK=[{value:"acceptEdits",label:"Auto-accept Edits",description:"Auto-approve file edits, ask for other tools"},{value:"bypassPermissions",label:"Bypass Permissions",description:"Auto-approve all tool calls (equivalent to --dangerously-skip-permissions)"},{value:"default",label:"Manual Approval",description:"Manually approve each tool call"}],aut="acceptEdits";function Xve(){const t=qt.getItem(Vve),e=qt.getItem(az)==="true";return{mode:t||aut,configured:e}}function $ve(t){qt.setItem(Vve,t),qt.setItem(az,"true")}function rut(){return qt.getItem(az)!=="true"}const iut=({isOpen:t,onComplete:e})=>{const[n,a]=Y.useState("acceptEdits");if(!t)return null;const r=()=>{$ve(n),e(n)};return ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/90 backdrop-blur-sm p-4",children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-lg shadow-2xl",children:[I.jsxs("div",{className:"p-5 border-b border-border",children:[I.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[I.jsx("div",{className:"p-1.5 rounded-lg bg-primary/15",children:I.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}),I.jsx("h3",{className:"font-semibold text-base",children:"New: Permission Mode Preservation"})]}),I.jsx("p",{className:"text-sm text-muted-foreground",children:"Claude Code 2.1.7+ supports preserving your permission mode after plan approval. Choose your preferred automation level."}),I.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Requires Claude Code 2.1.7 or later. Run ",I.jsx("code",{className:"bg-muted px-1 rounded",children:"claude update"})," to update."]})]}),I.jsx("div",{className:"p-4 space-y-2",children:KK.map(i=>I.jsxs("label",{className:`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all border ${n===i.value?"border-primary bg-primary/10":"border-transparent bg-muted/50 hover:bg-muted"}`,children:[I.jsx("input",{type:"radio",name:"permissionMode",value:i.value,checked:n===i.value,onChange:()=>a(i.value),className:"mt-0.5 accent-primary"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:i.label}),I.jsx("div",{className:"text-xs text-muted-foreground",children:i.description})]})]},i.value))}),I.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"You can change this later in Settings."}),I.jsx("button",{onClick:r,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90 transition-opacity",children:"Continue"})]})]})}),document.body)};function out(t,e){const[n,a]=Y.useState(t),[r,i]=Y.useState("toc"),o=Y.useCallback(l=>{a(!0),l&&i(l)},[]),A=Y.useCallback(()=>{a(!1)},[]),s=Y.useCallback(l=>{n?r===l?a(!1):i(l):(a(!0),i(l))},[n,r]);return{isOpen:n,activeTab:r,open:o,close:A,toggleTab:s}}class eDe{diff(e,n,a={}){let r;typeof a=="function"?(r=a,a={}):"callback"in a&&(r=a.callback);const i=this.castInput(e,a),o=this.castInput(n,a),A=this.removeEmpty(this.tokenize(i,a)),s=this.removeEmpty(this.tokenize(o,a));return this.diffWithOptionsObj(A,s,a,r)}diffWithOptionsObj(e,n,a,r){var i;const o=B=>{if(B=this.postProcess(B,a),r){setTimeout(function(){r(B)},0);return}else return B},A=n.length,s=e.length;let l=1,d=A+s;a.maxEditLength!=null&&(d=Math.min(d,a.maxEditLength));const u=(i=a.timeout)!==null&&i!==void 0?i:1/0,g=Date.now()+u,p=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(p[0],n,e,0,a);if(p[0].oldPos+1>=s&&m+1>=A)return o(this.buildValues(p[0].lastComponent,n,e));let h=-1/0,b=1/0;const C=()=>{for(let B=Math.max(h,-l);B<=Math.min(b,l);B+=2){let y;const Q=p[B-1],k=p[B+1];Q&&(p[B-1]=void 0);let _=!1;if(k){const x=k.oldPos-B;_=k&&0<=x&&x<A}const v=Q&&Q.oldPos+1<s;if(!_&&!v){p[B]=void 0;continue}if(!v||_&&Q.oldPos<k.oldPos?y=this.addToPath(k,!0,!1,0,a):y=this.addToPath(Q,!1,!0,1,a),m=this.extractCommon(y,n,e,B,a),y.oldPos+1>=s&&m+1>=A)return o(this.buildValues(y.lastComponent,n,e))||!0;p[B]=y,y.oldPos+1>=s&&(b=Math.min(b,B-1)),m+1>=A&&(h=Math.max(h,B+1))}l++};if(r)(function B(){setTimeout(function(){if(l>d||Date.now()>g)return r(void 0);C()||B()},0)})();else for(;l<=d&&Date.now()<=g;){const B=C();if(B)return B}}addToPath(e,n,a,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===a?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:n,removed:a,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:a,previousComponent:o}}}extractCommon(e,n,a,r,i){const o=n.length,A=a.length;let s=e.oldPos,l=s-r,d=0;for(;l+1<o&&s+1<A&&this.equals(a[s+1],n[l+1],i);)l++,s++,d++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!i.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,l}equals(e,n,a){return a.comparator?a.comparator(e,n):e===n||!!a.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let a=0;a<e.length;a++)e[a]&&n.push(e[a]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,a){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let A=0,s=0,l=0;for(;A<o;A++){const d=r[A];if(d.removed)d.value=this.join(a.slice(l,l+d.count)),l+=d.count;else{if(!d.added&&this.useLongestToken){let u=n.slice(s,s+d.count);u=u.map(function(g,p){const m=a[l+p];return m.length>g.length?m:g}),d.value=this.join(u)}else d.value=this.join(n.slice(s,s+d.count));s+=d.count,d.added||(l+=d.count)}}return r}}const OAe="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Aut extends eDe{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${OAe}]+|[^\\S\\n\\r]+|[^${OAe}]`,"ug");return e.match(n)||[]}}const sut=new Aut;function cut(t,e,n){return sut.diff(t,e,n)}class lut extends eDe{constructor(){super(...arguments),this.tokenize=gut}equals(e,n,a){return a.ignoreWhitespace?((!a.newlineIsToken||!e.includes(`
|
|
991
|
+
`);z=V.pop();for(const Ae of V){if(!Ae.startsWith("data: "))continue;const ne=Ae.slice(6);if(ne!=="[DONE]")try{const pe=JSON.parse(ne);pe.type==="text_delta"?B(te=>te.map(re=>re.question.id===R?{...re,response:{...re.response,text:re.response.text+pe.delta}}:re)):pe.type==="text"?B(te=>te.map(re=>re.question.id===R&&!re.response.text?{...re,response:{...re.response,text:pe.text}}:re)):pe.type==="permission_request"?y(te=>[...te,{requestId:pe.requestId,toolName:pe.toolName,toolInput:pe.toolInput,title:pe.title,displayName:pe.displayName,description:pe.description,toolUseId:pe.toolUseId}]):pe.type==="error"?(B(te=>te.map(re=>re.question.id===R?{...re,response:{...re.response,error:pe.error,isStreaming:!1}}:re)),p(pe.error)):pe.type==="result"&&B(te=>te.map(re=>{if(re.question.id!==R)return re;const se=pe.result??"";return{...re,response:{...re.response,text:re.response.text||se,isStreaming:!1}}}))}catch{}}}B(Z=>Z.map($=>$.question.id===R&&$.response.isStreaming?{...$,response:{...$.response,isStreaming:!1}}:$))}catch(T){if(T instanceof Error&&T.name==="AbortError"){B(H=>H.map(q=>q.question.id===R?{...q,response:{...q.response,isStreaming:!1}}:q));return}const G=T instanceof Error?T.message:String(T);p(G),B(H=>H.map(q=>q.question.id===R?{...q,response:{...q.response,error:G,isStreaming:!1}}:q))}finally{m.current===U&&(u(!1),m.current=null)}},[r,k,B,y]),v=Y.useCallback(()=>{m.current&&(m.current.abort(),m.current=null,u(!1)),C.current&&fetch("/api/ai/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:C.current})}).catch(()=>{})},[]),x=Y.useCallback((N,U)=>{C.current&&(y(K=>K.map(R=>R.requestId===N?{...R,decided:U?"allow":"deny"}:R)),fetch("/api/ai/permission",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:C.current,requestId:N,allow:U})}).catch(()=>{}))},[y]),S=Y.useCallback(()=>{h.current+=1,b.current+=1,m.current&&(m.current.abort(),m.current=null),Q(null),l(!1),u(!1)},[Q]),L=Y.useCallback(()=>{h.current+=1,b.current+=1,m.current&&(m.current.abort(),m.current=null),A(FAe(i)),l(!1),u(!1),p(null)},[i]);return Y.useEffect(()=>()=>{h.current+=1,b.current+=1,m.current&&m.current.abort()},[]),{thread:o,messages:o.messages,isCreatingSession:s,isStreaming:d,error:g,permissionRequests:o.permissionRequests,respondToPermission:x,ask:_,abort:v,resetSession:S,resetThread:L,sessionId:o.sessionId}}const jve="plannotator-toc-enabled",zve="plannotator-sticky-actions-enabled",Jve="plannotator-plan-width",f9=[{id:"compact",label:"Compact",px:832,hint:"Best for reading. Ideal line length for laptops and focused review."},{id:"default",label:"Default",px:1040,hint:"Balanced. More room for code blocks without sacrificing readability."},{id:"wide",label:"Wide",px:1280,hint:"For large monitors. Best with diagrams and wide code."}];function PK(){const t=qt.getItem(Jve);return{tocEnabled:qt.getItem(jve)!=="false",stickyActionsEnabled:qt.getItem(zve)!=="false",planWidth:t==="compact"||t==="default"||t==="wide"?t:"compact"}}function qdt(t){qt.setItem(jve,String(t.tocEnabled)),qt.setItem(zve,String(t.stickyActionsEnabled)),qt.setItem(Jve,t.planWidth)}const Wve="plannotator-editor-mode",jdt="selection";function zdt(){const t=qt.getItem(Wve);return t==="selection"||t==="comment"||t==="redline"||t==="quickLabel"?t:jdt}function Jdt(t){qt.setItem(Wve,t)}const Zve="plannotator-input-method",Wdt="drag";function Zdt(){const t=qt.getItem(Zve);return t==="drag"||t==="pinpoint"?t:Wdt}function Vdt(t){qt.setItem(Zve,t)}const Xdt=300,$dt=300;function eut(t,e){const n=Y.useRef("idle"),a=Y.useRef(0),r=Y.useRef(void 0),i=Y.useRef(t);Y.useEffect(()=>{n.current==="idle"&&(i.current=t)},[t]);const o=Y.useCallback(A=>A==="drag"?"pinpoint":"drag",[]);Y.useEffect(()=>{const A=l=>{if(l.key!=="Alt"||l.repeat)return;const d=l.target?.tagName;d==="INPUT"||d==="TEXTAREA"||l.target?.isContentEditable||document.querySelector("[data-quick-label-picker]")||(n.current==="idle"?(i.current=t,a.current=Date.now(),n.current="held",e(o(t))):n.current==="tapped"&&(clearTimeout(r.current),n.current="idle",i.current=o(i.current)))},s=l=>{l.key==="Alt"&&n.current==="held"&&(Date.now()-a.current>=$dt?(e(i.current),n.current="idle"):(n.current="tapped",r.current=setTimeout(()=>{n.current==="tapped"&&(e(i.current),n.current="idle")},Xdt)))};return window.addEventListener("keydown",A),window.addEventListener("keyup",s),()=>{clearTimeout(r.current),window.removeEventListener("keydown",A),window.removeEventListener("keyup",s)}},[t,e,o])}function tut(){Y.useEffect(()=>{const t=()=>document.documentElement.classList.add("plannotator-print"),e=()=>document.documentElement.classList.remove("plannotator-print"),n=()=>{!document.hidden&&document.documentElement.classList.contains("plannotator-print")&&document.documentElement.classList.remove("plannotator-print")};return window.addEventListener("beforeprint",t),window.addEventListener("afterprint",e),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("beforeprint",t),window.removeEventListener("afterprint",e),document.removeEventListener("visibilitychange",n),document.documentElement.classList.remove("plannotator-print")}},[])}function TAe({storageKey:t,defaultWidth:e=288,minWidth:n=200,maxWidth:a=600,side:r="right"}){const[i,o]=Y.useState(()=>{const b=qt.getItem(t);if(b){const C=Number(b);if(!Number.isNaN(C)&&C>=n&&C<=a)return C}return e}),[A,s]=Y.useState(!1),l=Y.useRef(0),d=Y.useRef(0),u=Y.useRef(i),g=Y.useCallback(b=>{u.current=b,o(b)},[]),p=Y.useCallback(b=>{b.preventDefault(),l.current=b.clientX,d.current=u.current,s(!0)},[]),m=Y.useCallback(b=>{b.preventDefault(),l.current=b.touches[0].clientX,d.current=u.current,s(!0)},[]);Y.useEffect(()=>{if(!A)return;const b=y=>"touches"in y?y.touches[0]?.clientX??y.changedTouches[0]?.clientX??0:y.clientX,C=y=>{const Q=b(y),k=r==="right"?l.current-Q:Q-l.current;g(Math.min(a,Math.max(n,d.current+k)))},B=()=>{s(!1),qt.setItem(t,String(u.current))};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",B),document.addEventListener("touchmove",C,{passive:!1}),document.addEventListener("touchend",B),document.addEventListener("touchcancel",B),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",B),document.removeEventListener("touchcancel",B)}},[A,n,a,t,r,g]);const h=Y.useCallback(()=>{g(e),qt.setItem(t,String(e))},[e,t,g]);return{width:i,isDragging:A,handleProps:{isDragging:A,onMouseDown:p,onTouchStart:m,onDoubleClick:h}}}const GAe=({isDragging:t,onMouseDown:e,onTouchStart:n,onDoubleClick:a,className:r,side:i})=>I.jsxs("div",{className:`relative w-0 cursor-col-resize flex-shrink-0 group z-10${r?` ${r}`:""}`,children:[I.jsx("div",{className:`absolute inset-y-0 -left-0.5 -right-0.5 transition-colors ${t?"bg-primary/50":"group-hover:bg-border"}`}),I.jsx("div",{className:`absolute inset-y-0 ${i==="left"?"-right-2 -left-1":i==="right"?"-right-3 left-0":"-inset-x-2"}`,onMouseDown:e,onTouchStart:n,onDoubleClick:a})]});function nut(){const t=Y.useRef(null),[e,n]=Y.useState(null),a=Y.useCallback(r=>{const i=r;t.current=i,n(i)},[]);return{ref:t,viewport:e,onViewportReady:a}}const Vve="plannotator-permission-mode",az="plannotator-permission-mode-configured",KK=[{value:"acceptEdits",label:"Auto-accept Edits",description:"Auto-approve file edits, ask for other tools"},{value:"auto",label:"Auto Mode",description:"Autonomous execution with a safety classifier (requires Claude Code 2026-03+ and Sonnet 4.6+)"},{value:"bypassPermissions",label:"Bypass Permissions",description:"Auto-approve all tool calls (equivalent to --dangerously-skip-permissions)"},{value:"default",label:"Manual Approval",description:"Manually approve each tool call"}],aut="acceptEdits";function Xve(){const t=qt.getItem(Vve),e=qt.getItem(az)==="true";return{mode:t||aut,configured:e}}function $ve(t){qt.setItem(Vve,t),qt.setItem(az,"true")}function rut(){return qt.getItem(az)!=="true"}const iut=({isOpen:t,onComplete:e})=>{const[n,a]=Y.useState("acceptEdits");if(!t)return null;const r=()=>{$ve(n),e(n)};return ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/90 backdrop-blur-sm p-4",children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-lg shadow-2xl",children:[I.jsxs("div",{className:"p-5 border-b border-border",children:[I.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[I.jsx("div",{className:"p-1.5 rounded-lg bg-primary/15",children:I.jsx("svg",{className:"w-5 h-5 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})})}),I.jsx("h3",{className:"font-semibold text-base",children:"New: Permission Mode Preservation"})]}),I.jsx("p",{className:"text-sm text-muted-foreground",children:"Claude Code 2.1.7+ supports preserving your permission mode after plan approval. Choose your preferred automation level."}),I.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Requires Claude Code 2.1.7 or later. Run ",I.jsx("code",{className:"bg-muted px-1 rounded",children:"claude update"})," to update."]})]}),I.jsx("div",{className:"p-4 space-y-2",children:KK.map(i=>I.jsxs("label",{className:`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all border ${n===i.value?"border-primary bg-primary/10":"border-transparent bg-muted/50 hover:bg-muted"}`,children:[I.jsx("input",{type:"radio",name:"permissionMode",value:i.value,checked:n===i.value,onChange:()=>a(i.value),className:"mt-0.5 accent-primary"}),I.jsxs("div",{className:"flex-1",children:[I.jsx("div",{className:"text-sm font-medium",children:i.label}),I.jsx("div",{className:"text-xs text-muted-foreground",children:i.description})]})]},i.value))}),I.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"You can change this later in Settings."}),I.jsx("button",{onClick:r,className:"px-4 py-2 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90 transition-opacity",children:"Continue"})]})]})}),document.body)};function out(t,e){const[n,a]=Y.useState(t),[r,i]=Y.useState("toc"),o=Y.useCallback(l=>{a(!0),l&&i(l)},[]),A=Y.useCallback(()=>{a(!1)},[]),s=Y.useCallback(l=>{n?r===l?a(!1):i(l):(a(!0),i(l))},[n,r]);return{isOpen:n,activeTab:r,open:o,close:A,toggleTab:s}}class eDe{diff(e,n,a={}){let r;typeof a=="function"?(r=a,a={}):"callback"in a&&(r=a.callback);const i=this.castInput(e,a),o=this.castInput(n,a),A=this.removeEmpty(this.tokenize(i,a)),s=this.removeEmpty(this.tokenize(o,a));return this.diffWithOptionsObj(A,s,a,r)}diffWithOptionsObj(e,n,a,r){var i;const o=B=>{if(B=this.postProcess(B,a),r){setTimeout(function(){r(B)},0);return}else return B},A=n.length,s=e.length;let l=1,d=A+s;a.maxEditLength!=null&&(d=Math.min(d,a.maxEditLength));const u=(i=a.timeout)!==null&&i!==void 0?i:1/0,g=Date.now()+u,p=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(p[0],n,e,0,a);if(p[0].oldPos+1>=s&&m+1>=A)return o(this.buildValues(p[0].lastComponent,n,e));let h=-1/0,b=1/0;const C=()=>{for(let B=Math.max(h,-l);B<=Math.min(b,l);B+=2){let y;const Q=p[B-1],k=p[B+1];Q&&(p[B-1]=void 0);let _=!1;if(k){const x=k.oldPos-B;_=k&&0<=x&&x<A}const v=Q&&Q.oldPos+1<s;if(!_&&!v){p[B]=void 0;continue}if(!v||_&&Q.oldPos<k.oldPos?y=this.addToPath(k,!0,!1,0,a):y=this.addToPath(Q,!1,!0,1,a),m=this.extractCommon(y,n,e,B,a),y.oldPos+1>=s&&m+1>=A)return o(this.buildValues(y.lastComponent,n,e))||!0;p[B]=y,y.oldPos+1>=s&&(b=Math.min(b,B-1)),m+1>=A&&(h=Math.max(h,B+1))}l++};if(r)(function B(){setTimeout(function(){if(l>d||Date.now()>g)return r(void 0);C()||B()},0)})();else for(;l<=d&&Date.now()<=g;){const B=C();if(B)return B}}addToPath(e,n,a,r,i){const o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===a?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:n,removed:a,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:a,previousComponent:o}}}extractCommon(e,n,a,r,i){const o=n.length,A=a.length;let s=e.oldPos,l=s-r,d=0;for(;l+1<o&&s+1<A&&this.equals(a[s+1],n[l+1],i);)l++,s++,d++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!i.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,l}equals(e,n,a){return a.comparator?a.comparator(e,n):e===n||!!a.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let a=0;a<e.length;a++)e[a]&&n.push(e[a]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,a){const r=[];let i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();const o=r.length;let A=0,s=0,l=0;for(;A<o;A++){const d=r[A];if(d.removed)d.value=this.join(a.slice(l,l+d.count)),l+=d.count;else{if(!d.added&&this.useLongestToken){let u=n.slice(s,s+d.count);u=u.map(function(g,p){const m=a[l+p];return m.length>g.length?m:g}),d.value=this.join(u)}else d.value=this.join(n.slice(s,s+d.count));s+=d.count,d.added||(l+=d.count)}}return r}}const OAe="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Aut extends eDe{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${OAe}]+|[^\\S\\n\\r]+|[^${OAe}]`,"ug");return e.match(n)||[]}}const sut=new Aut;function cut(t,e,n){return sut.diff(t,e,n)}class lut extends eDe{constructor(){super(...arguments),this.tokenize=gut}equals(e,n,a){return a.ignoreWhitespace?((!a.newlineIsToken||!e.includes(`
|
|
992
992
|
`))&&(e=e.trim()),(!a.newlineIsToken||!n.includes(`
|
|
993
993
|
`))&&(n=n.trim())):a.ignoreNewlineAtEof&&!a.newlineIsToken&&(e.endsWith(`
|
|
994
994
|
`)&&(e=e.slice(0,-1)),n.endsWith(`
|
|
@@ -1838,7 +1838,7 @@ On the server side, update packages/server/index.ts to register the new WebSocke
|
|
|
1838
1838
|
<rect width="64" height="64" rx="14" fill="#070b14"/>
|
|
1839
1839
|
<rect x="12" y="28" width="40" height="14" rx="3" fill="#E0BA55" opacity="0.35"/>
|
|
1840
1840
|
<text x="32" y="46" text-anchor="middle" font-family="Inter,system-ui,sans-serif" font-weight="800" font-size="42" fill="white">P</text>
|
|
1841
|
-
</svg>`;function aIt(t){const e=t.indexOf("/.plannotator/");return e>=0?"~"+t.slice(e):t}const gce=({filePath:t})=>{const[e,n]=Y.useState(!1),a=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return I.jsxs("button",{onClick:a,title:"Copy path",className:"inline-flex items-center gap-1.5 mt-1.5 px-2 py-1 rounded bg-muted/60 hover:bg-muted border border-border/50 transition-colors group max-w-full",children:[I.jsx("code",{className:"text-[10px] text-muted-foreground font-mono truncate",children:aIt(t)}),I.jsx("span",{className:"flex-shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors",children:e?I.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:I.jsx("path",{d:"M13.25 4.75 6 12 2.75 8.75"})}):I.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[I.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5"}),I.jsx("path",{d:"M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"})]})})]})},rIt=()=>{const[t,e]=Y.useState(null),[n,a]=Y.useState(!1),[r,i]=Y.useState(!1);Y.useEffect(()=>{fetch("/api/hooks/status").then(A=>A.json()).then(A=>{e(A),a(A.pfmReminder.enabled)}).catch(()=>{})},[]);const o=async()=>{const A=!n;a(A),await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pfmReminder:A})}).catch(()=>a(!A))};return t?I.jsxs("div",{className:"space-y-4",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"These hooks inject context into your planning agent before it writes a plan."}),I.jsx("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:I.jsxs("div",{className:"flex items-start gap-3",children:[I.jsx("div",{className:"w-8 h-8 flex-shrink-0 rounded-md overflow-hidden",dangerouslySetInnerHTML:{__html:uce}}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Plannotator Flavored Markdown"}),I.jsx("button",{onClick:o,className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${n?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition-transform ${n?"translate-x-4":"translate-x-0"}`})})]}),I.jsxs("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:["Inspired by GitHub Flavored Markdown, PFM extends it with interactive tables, SVG diagrams (custom, Mermaid & Graphviz), code-file links that open in your editor, callouts, task lists, and more. This reminder tells the planning agent what the renderer supports so it can use these features naturally. ",I.jsx("strong",{children:"No extra tokens"})," — the agent still writes markdown as it normally would, just with enhanced syntax that Plannotator renders richer."]}),I.jsx("div",{className:"mt-2",children:I.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${n?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:[I.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${n?"bg-primary":"bg-muted-foreground/50"}`}),n?"Enabled":"Disabled"]})})]})]})}),I.jsx("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:I.jsxs("div",{className:"flex items-start gap-3",children:[I.jsx("div",{className:"w-8 h-8 flex-shrink-0 rounded-md overflow-hidden",dangerouslySetInnerHTML:{__html:uce}}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Improvement Hook"}),I.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${t.improvementHook.present?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:[I.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.improvementHook.present?"bg-primary":"bg-muted-foreground/50"}`}),t.improvementHook.present?"Active":"Not found"]})]}),t.improvementHook.present?I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:["Corrective planning instructions generated from your plan denial history.",t.improvementHook.fileSize!=null&&I.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",(t.improvementHook.fileSize/1024).toFixed(1),"KB"]})]}),t.improvementHook.filePath&&I.jsx(gce,{filePath:t.improvementHook.filePath}),I.jsxs("p",{className:"text-[11px] text-muted-foreground/70 mt-2 leading-relaxed",children:["Edit this file directly to customize, or run ",I.jsx("code",{className:"text-[10px] bg-muted px-1 py-0.5 rounded",children:"/plannotator-compound"})," to regenerate from recent denial history."]}),I.jsx("button",{onClick:()=>i(!r),className:"text-xs text-primary hover:text-primary/80 mt-1.5 transition-colors",children:r?"▾ Hide content":"▸ Show content"}),r&&t.improvementHook.content&&I.jsx("pre",{className:"mt-2 p-3 rounded-md bg-muted/50 border border-border text-[11px] text-foreground/80 overflow-auto max-h-64 whitespace-pre-wrap font-mono leading-relaxed",children:t.improvementHook.content})]}):I.jsxs(I.Fragment,{children:[I.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:"No improvement hook found. This file injects corrective planning instructions before your agent writes a plan — the more you review, the better your agent plans."}),t.improvementHook.filePath&&I.jsx(gce,{filePath:t.improvementHook.filePath}),I.jsxs("p",{className:"text-[11px] text-muted-foreground/70 mt-2 leading-relaxed",children:["Run ",I.jsx("code",{className:"text-[10px] bg-muted px-1 py-0.5 rounded",children:"/plannotator-compound"})," to auto-generate from your denial history, or create a plain text file at the path above with your own instructions."," ",I.jsx("a",{href:"https://plannotator.ai/blog/continuously-improve-claude-code-plans/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline underline-offset-2",children:"Learn more"})]})]})]})]})})]}):I.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading hook status…"})},iIt=[{value:"",label:"Theme Default"},{value:"Fira Code",label:"Fira Code"},{value:"Hack",label:"Hack"},{value:"IBM Plex Mono",label:"IBM Plex Mono"},{value:"Inconsolata",label:"Inconsolata"},{value:"JetBrains Mono",label:"JetBrains Mono"},{value:"Red Hat Mono",label:"Red Hat Mono"},{value:"Roboto Mono",label:"Roboto Mono"},{value:"Source Code Pro",label:"Source Code Pro"},{value:"Atkinson Hyperlegible Mono",label:"Atkinson Hyperlegible"}],oIt=[{value:"split",label:"Split"},{value:"unified",label:"Unified"}],AIt=[{value:"scroll",label:"Scroll"},{value:"wrap",label:"Wrap"}],sIt=[{value:"bars",label:"Bars"},{value:"classic",label:"Classic"},{value:"none",label:"None"}],cIt=[{value:"word-alt",label:"Word-Alt"},{value:"word",label:"Word"},{value:"char",label:"Char"},{value:"none",label:"None"}],lIt=[{value:"subtle",label:"Subtle"},{value:"normal",label:"Normal"},{value:"strong",label:"Strong"}],dIt=[{value:"uncommitted",label:"All Changes",description:"Everything you've changed since your last commit"},{value:"unstaged",label:"Unstaged",description:"Only changes you haven't staged yet"},{value:"staged",label:"Staged",description:"Only changes you've staged for commit"},{value:"merge-base",label:"Committed",description:"Everything you've committed on this branch"},{value:"all",label:"All Files (HEAD)",description:"Every tracked file at HEAD, shown as additions"}];function bQ({options:t,value:e,onChange:n}){return I.jsx("div",{className:"flex items-center gap-1 bg-muted/50 rounded-lg p-0.5",children:t.map(a=>I.jsx("button",{onClick:()=>n(a.value),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${e===a.value?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:a.label},a.value))})}function MS({checked:t,onChange:e,label:n,description:a}){return I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:n}),a&&I.jsx("div",{className:"text-xs text-muted-foreground",children:a})]}),I.jsx("button",{role:"switch","aria-checked":t,onClick:()=>e(!t),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})}const uIt=()=>{const t=$s("defaultDiffType");return I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Default Diff View"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Which changes to show when you open a code review"})]}),I.jsx("div",{className:"space-y-2",children:dIt.map(e=>I.jsxs("button",{type:"button",onClick:()=>Ai.set("defaultDiffType",e.value),className:`w-full flex items-start gap-3 p-3 rounded-lg border transition-colors text-left ${t===e.value?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/30 hover:bg-muted/50"}`,children:[I.jsx("div",{className:`mt-0.5 w-4 h-4 rounded-full border-2 flex-shrink-0 flex items-center justify-center ${t===e.value?"border-primary":"border-muted-foreground/40"}`,children:t===e.value&&I.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"})}),I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:e.label}),I.jsx("div",{className:"text-xs text-muted-foreground",children:e.description})]})]},e.value))})]})},gIt=()=>{const t=$s("diffStyle"),e=$s("diffOverflow"),n=$s("diffIndicators"),a=$s("diffLineDiffType"),r=$s("diffShowLineNumbers"),i=$s("diffShowBackground"),o=$s("diffLineBgIntensity"),A=$s("diffHideWhitespace"),s=$s("diffFontFamily"),l=$s("diffFontSize");return Y.useEffect(()=>{s&&zEt(s)},[s]),I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Code Font"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Font family for diff code lines"})]}),I.jsx("select",{value:s,onChange:d=>Ai.set("diffFontFamily",d.target.value),className:"w-full px-3 py-1.5 text-sm rounded-md bg-muted/50 border border-border text-foreground",style:s?{fontFamily:`'${s}', monospace`}:void 0,children:iIt.map(d=>I.jsx("option",{value:d.value,children:d.label},d.value))}),s&&I.jsx("div",{className:"text-xs text-muted-foreground px-1 py-1 rounded bg-muted/30 font-mono",style:{fontFamily:`'${s}', monospace`},children:"Preview: const x = fn(42);"})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Code Font Size"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Font size for diff code lines"})]}),I.jsx("div",{className:"text-xs tabular-nums text-muted-foreground min-w-[4ch] text-right",children:l||"Auto"})]}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("input",{type:"range",min:8,max:24,step:1,value:l?parseInt(l):13,onChange:d=>Ai.set("diffFontSize",`${d.target.value}px`),className:"flex-1 h-1.5 accent-primary cursor-pointer"}),l&&I.jsx("button",{onClick:()=>Ai.set("diffFontSize",""),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Reset"})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Diff Style"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Side-by-side or inline diff view"})]}),I.jsx(bQ,{options:oIt,value:t,onChange:d=>Ai.set("diffStyle",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Line Overflow"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"How to handle long lines in diffs"})]}),I.jsx(bQ,{options:AIt,value:e,onChange:d=>Ai.set("diffOverflow",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Change Indicators"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Style of +/- markers in the gutter"})]}),I.jsx(bQ,{options:sIt,value:n,onChange:d=>Ai.set("diffIndicators",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Inline Diff Granularity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Highlight granularity for inline changes"})]}),I.jsx(bQ,{options:cIt,value:a,onChange:d=>Ai.set("diffLineDiffType",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:r,onChange:d=>Ai.set("diffShowLineNumbers",d),label:"Show Line Numbers"}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:i,onChange:d=>Ai.set("diffShowBackground",d),label:"Show Diff Background",description:"Colored backgrounds on added/deleted lines"}),i&&I.jsxs("div",{className:"space-y-2 pl-4",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Line Background Intensity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"How prominent the colored line backgrounds appear"})]}),I.jsx(bQ,{options:lIt,value:o,onChange:d=>Ai.set("diffLineBgIntensity",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:A,onChange:d=>Ai.set("diffHideWhitespace",d),label:"Hide Whitespace",description:"Ignore whitespace-only changes in diffs"})]})},FS=[{label:"suggestion",display:"suggestion",blocking:!0},{label:"nitpick",display:"nit",blocking:!1},{label:"question",display:"question",blocking:!0},{label:"issue",display:"issue",blocking:!0},{label:"praise",display:"praise",blocking:!1},{label:"thought",display:"thought",blocking:!1},{label:"note",display:"note",blocking:!1},{label:"todo",display:"todo",blocking:!0},{label:"chore",display:"chore",blocking:!0}];function pIt(t){if(!t)return FS;try{const e=JSON.parse(t);return Array.isArray(e)?e.map(n=>({label:n.label||"custom",display:n.display||n.label||"custom",blocking:n.blocking===!0||n.blocking==="true"})):FS}catch{return FS}}const mIt=()=>{const t=$s("conventionalComments"),e=$s("conventionalLabels"),[n,a]=Y.useState(()=>pIt(e)),r=e===null,i=d=>{a(d),Ai.set("conventionalLabels",JSON.stringify(d))},o=(d,u)=>{const g=[...n];g[d]={...g[d],...u},i(g)},A=d=>{i(n.filter((u,g)=>g!==d))},s=()=>{const d=new Set(n.map(p=>p.label));let u="custom",g=2;for(;d.has(u);)u=`custom-${g++}`;i([...n,{label:u,display:u,blocking:!1}])},l=()=>{a(FS),Ai.set("conventionalLabels",null)};return I.jsxs(I.Fragment,{children:[I.jsx(MS,{checked:t,onChange:d=>Ai.set("conventionalComments",d),label:"Conventional Comments",description:"Add structured labels to review comments"}),I.jsxs("div",{className:`space-y-4 transition-opacity ${t?"":"opacity-40 pointer-events-none"}`,children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"How it works"}),I.jsx("div",{className:"text-xs text-muted-foreground leading-relaxed mt-1",children:"When enabled, a label picker appears above the comment input when annotating code. Labels classify your feedback intent, making it clear whether a comment is a blocking issue, a trivial nitpick, or praise."})]}),I.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:["Based on the"," ",I.jsx("a",{href:"https://conventionalcomments.org",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Conventional Comments"})," ","spec. Comments are exported as plain text, readable on GitHub, and parseable by tooling."]}),I.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 space-y-1.5",children:[I.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Example output"}),I.jsxs("div",{className:"font-mono text-[11px] text-foreground/80 leading-relaxed",children:[I.jsx("span",{className:"font-bold",children:"issue"})," ",I.jsx("span",{className:"text-muted-foreground",children:"(blocking)"}),": This will throw if user is null — the guard was removed in the refactor."]})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Labels"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Customize labels and their default severity"})]}),!r&&I.jsx("button",{onClick:l,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:"Reset to defaults"})]}),I.jsxs("div",{className:"flex items-end gap-2 px-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60",children:[I.jsx("span",{className:"flex-1",children:"Label"}),I.jsx("span",{className:"w-20 text-center",children:"Blocking decorator"}),I.jsx("span",{className:"w-6"})]}),I.jsx("div",{className:"space-y-1.5",children:n.map((d,u)=>I.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/40",children:[I.jsx("input",{type:"text",value:d.display,onChange:g=>{const p=g.target.value;o(u,{display:p,label:p})},className:"flex-1 px-2 py-1 bg-background/80 rounded text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary/50 min-w-0"}),I.jsx("div",{className:"w-20 flex justify-center",children:I.jsx("button",{role:"switch","aria-checked":d.blocking,onClick:()=>o(u,{blocking:!d.blocking}),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${d.blocking?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow-sm transition-transform ${d.blocking?"translate-x-4.5":"translate-x-0.5"}`})})}),I.jsx("button",{onClick:()=>A(u),className:"p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors flex-shrink-0",title:"Remove label",children:I.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},u))}),n.length<12&&I.jsx("button",{onClick:s,className:"w-full py-1.5 text-xs text-muted-foreground hover:text-foreground border border-dashed border-border rounded-lg hover:border-foreground/30 transition-colors",children:"+ Add label"})]})]})},hIt=({taterMode:t,onTaterModeChange:e,onIdentityChange:n,origin:a,mode:r="plan",onUIPreferencesChange:i,externalOpen:o,onExternalClose:A,aiProviders:s=[],gitUser:l})=>{const[d,u]=Y.useState(!1),[g,p]=Y.useState(!1);Y.useEffect(()=>{if(!g)return;const Ee=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),p(!1),u(!0))};return document.addEventListener("keydown",Ee),()=>document.removeEventListener("keydown",Ee)},[g]);const[m,h]=Y.useState("general"),[b,C]=Y.useState(""),[B,y]=Y.useState({enabled:!1,vaultPath:"",folder:"plannotator",filenameSeparator:"space",autoSave:!1,vaultBrowserEnabled:!1}),[Q,k]=Y.useState([]),[_,v]=Y.useState(!1),[x,S]=Y.useState({enabled:!1,customTags:"",tagPosition:"append",autoSave:!1}),[L,N]=Y.useState({enabled:!1,workspace:"",folder:"plannotator",autoSave:!1}),[U,K]=Y.useState({switchTo:"build"}),[R,O]=Y.useState({enabled:!0,customPath:null}),[F,T]=Y.useState({tocEnabled:!0,stickyActionsEnabled:!0,planWidth:"compact"}),[G,H]=Y.useState("bypassPermissions"),[q,P]=Y.useState(null),[z,Z]=Y.useState("off"),[$,V]=Y.useState("ask"),[Ae,ne]=Y.useState([]),[pe,te]=Y.useState(null),[re,se]=Y.useState(""),[oe,ue]=Y.useState(null),[le,De]=Y.useState({enabled:!1,directories:[]}),[he,qe]=Y.useState(""),{agents:ce,validateAgent:et,getAgentWarning:ke}=Ove(a??null),rt=Y.useMemo(()=>{const Ee=[{id:"general",label:"General"}];return Ee.push({id:"theme",label:"Theme"}),r==="plan"&&(Ee.push({id:"display",label:"Display"}),Ee.push({id:"saving",label:"Saving"}),Ee.push({id:"labels",label:"Labels"})),r==="review"&&(Ee.push({id:"git",label:"Git"}),Ee.push({id:"display",label:"Display"}),Ee.push({id:"comments",label:"Comments"}),s.length>0&&Ee.push({id:"ai",label:"AI"})),Ee.push({id:"shortcuts",label:"Shortcuts"}),r==="plan"&&Ee.push({id:"hooks",label:"Hooks"}),Ee},[r,s.length]),tt=[{id:"files",label:"Files"},...r==="plan"?[{id:"obsidian",label:"Obsidian"},{id:"bear",label:"Bear"},{id:"octarine",label:"Octarine"}]:[]],gt=B.enabled&&tm(B).trim().length>0,Ge=x.enabled,ot=L.enabled&&L.workspace.trim().length>0;Y.useEffect(()=>{o&&(u(!0),A?.())},[o,A]),Y.useEffect(()=>{if(d){C(Kl()),y(em()),S(gf()),N(PE()),K(OM()),O(z2()),T(PK()),H(Xve().mode),Z(ECe()),V(Kve()),ne(pq());const Ee=ru();ue(Pj({providers:s,origin:a,settings:Ee}).providerId),De(rz()),a==="opencode"&&P(ke())}},[d,ce,a,ke,s.length]),Y.useEffect(()=>{if(!d)return;$==="ask"||$==="download"||$==="obsidian"&>||$==="bear"&&Ge||$==="octarine"&&ot||(V("ask"),MAe("ask"))},[d,$,gt,Ge,ot]),Y.useEffect(()=>{B.enabled&&Q.length===0&&!_&&(v(!0),fetch("/api/obsidian/vaults").then(Ee=>Ee.json()).then(Ee=>{k(Ee.vaults||[]),Ee.vaults?.length>0&&!B.vaultPath&&ut({vaultPath:Ee.vaults[0]})}).catch(()=>k([])).finally(()=>v(!1)))},[B.enabled]);const He=Ee=>{const _e={...le,...Ee};De(_e),Agt(_e),i&&i({...F})},ze=()=>{const Ee=he.trim();Ee&&!le.directories.includes(Ee)&&He({directories:[...le.directories,Ee]}),qe("")},ut=Ee=>{const _e={...B,...Ee};y(_e),sct(_e)},Se=Ee=>{const _e={...x,...Ee};S(_e),cct(_e)},Ze=Ee=>{const _e={...L,...Ee};N(_e),dct(_e)},be=(Ee,_e)=>{const We={switchTo:Ee,customName:_e??U.customName};K(We),Gve(We)},ve=Ee=>{const _e={...R,...Ee};O(_e),Udt(_e)},X=Ee=>{const _e={...F,...Ee};T(_e),qdt(_e),i?.(_e)},we=Ee=>{H(Ee),$ve(Ee)},Be=Ee=>{V(Ee),MAe(Ee)},Ne=()=>{const Ee=b,_e=aAt();C(_e),n?.(Ee,_e)},Me=Ee=>{const _e=Ee.trim();if(!_e||_e===b)return;const We=b,it=nAt(_e);C(it),n?.(We,it)},Ke=()=>{l&&Me(l)};return I.jsxs(I.Fragment,{children:[I.jsx("button",{onClick:()=>u(!0),className:"relative p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"Settings",children:I.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d&&!g&&ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm p-4",onClick:()=>u(!1),children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-2xl max-h-[85vh] flex flex-col shadow-2xl relative overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[t&&I.jsx(ez,{}),I.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[I.jsx("h3",{className:"font-semibold text-sm",children:"Settings"}),I.jsx("button",{onClick:()=>u(!1),className:"p-1.5 rounded-md bg-muted hover:bg-muted/80 text-foreground transition-colors",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),I.jsxs("div",{className:"flex flex-col md:flex-row md:min-h-[420px] flex-1 min-h-0 overflow-hidden",children:[I.jsx("nav",{className:"md:hidden flex overflow-x-auto border-b border-border px-2 py-1.5 gap-1 flex-shrink-0",children:[...rt,...tt].map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`px-3 py-1.5 rounded text-xs whitespace-nowrap transition-colors flex items-center gap-1.5 ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))}),I.jsxs("nav",{className:"hidden md:block w-40 border-r border-border p-2 flex-shrink-0",children:[I.jsx("div",{className:"space-y-0.5",children:rt.map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`w-full text-left px-3 py-1.5 rounded text-sm transition-colors flex items-center justify-between ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))}),tt.length>0&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),I.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"Integrations"}),I.jsx("div",{className:"space-y-0.5",children:tt.map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`w-full text-left px-3 py-1.5 rounded text-sm transition-colors ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))})]})]}),I.jsx(sB,{className:"flex-1 min-h-0",children:I.jsxs("div",{className:"p-4 space-y-4",children:[m==="general"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-sm font-medium",children:"Your Identity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Used when sharing annotations with others"}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("input",{type:"text",defaultValue:b,onBlur:Ee=>Me(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Me(Ee.target.value),Ee.target.blur())},className:"flex-1 px-3 py-2 bg-muted rounded-lg text-xs font-mono truncate border border-transparent focus:border-primary/50 focus:outline-none transition-colors",placeholder:"Enter your name..."},b),l&&I.jsx("button",{onClick:Ke,onMouseDown:Ee=>Ee.preventDefault(),className:"p-2 rounded-lg bg-muted hover:bg-muted/80 text-muted-foreground hover:text-foreground transition-colors",title:`Use git identity: ${l}`,children:I.jsx(JEt,{className:"w-5 h-5"})}),I.jsx("button",{onClick:Ne,onMouseDown:Ee=>Ee.preventDefault(),className:"p-2 rounded-lg bg-muted hover:bg-muted/80 text-muted-foreground hover:text-foreground transition-colors",title:"Regenerate random identity",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),a==="claude-code"&&r==="plan"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Permission Mode"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Automation level after plan approval"})]}),I.jsx("select",{value:G,onChange:Ee=>we(Ee.target.value),className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:KK.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:KK.find(Ee=>Ee.value===G)?.description})]})]}),a==="opencode"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Agent Switching"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Which agent to switch to after plan approval"})]}),q&&I.jsxs("div",{className:"flex items-start gap-2 p-2 bg-amber-500/10 border border-amber-500/30 rounded-lg text-xs text-amber-600 dark:text-amber-400",children:[I.jsx("svg",{className:"w-4 h-4 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),I.jsx("span",{children:q})]}),I.jsx("select",{value:U.switchTo,onChange:Ee=>{be(Ee.target.value),P(null)},className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:ce.length>0?I.jsxs(I.Fragment,{children:[U.switchTo!=="custom"&&U.switchTo!=="disabled"&&!ce.some(Ee=>Ee.id.toLowerCase()===U.switchTo.toLowerCase())&&I.jsxs("option",{value:U.switchTo,disabled:!0,children:[U.switchTo," (not found)"]}),ce.map(Ee=>I.jsx("option",{value:Ee.id,children:Ee.name},Ee.id)),I.jsx("option",{value:"custom",children:"Custom"}),I.jsx("option",{value:"disabled",children:"Disabled"})]}):vdt.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),U.switchTo==="custom"&&I.jsx("input",{type:"text",value:U.customName||"",onChange:Ee=>{const _e=Ee.target.value;be("custom",_e),_e&&ce.length>0?et(_e)?P(null):P(`Agent "${_e}" not found in OpenCode. It may cause errors.`):P(null)},placeholder:"Enter agent name...",className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 placeholder:text-muted-foreground/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:U.switchTo==="custom"&&U.customName?`Switch to "${U.customName}" agent after approval`:U.switchTo==="disabled"?"Stay on current agent after approval":`Switch to ${U.switchTo} agent after approval`})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-sm font-medium",children:"Auto-close Tab"}),I.jsx("select",{value:z,onChange:Ee=>{const _e=Ee.target.value;Z(_e),ICe(_e)},className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:rre.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:rre.find(Ee=>Ee.value===z)?.description})]})]}),m==="theme"&&I.jsx(dce,{onPreview:()=>{u(!1),p(!0)}}),m==="git"&&r==="review"&&I.jsx(uIt,{}),m==="display"&&r==="review"&&I.jsx(gIt,{}),m==="display"&&r!=="review"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Auto-open Sidebar"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Open sidebar with Table of Contents on load"})]}),I.jsx("button",{role:"switch","aria-checked":F.tocEnabled,onClick:()=>X({tocEnabled:!F.tocEnabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${F.tocEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${F.tocEnabled?"translate-x-6":"translate-x-1"}`})})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Sticky Actions"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Keep action buttons visible while scrolling"})]}),I.jsx("button",{role:"switch","aria-checked":F.stickyActionsEnabled,onClick:()=>X({stickyActionsEnabled:!F.stickyActionsEnabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${F.stickyActionsEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${F.stickyActionsEnabled?"translate-x-6":"translate-x-1"}`})})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium flex items-center gap-2",children:"Plan Width"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Maximum width of the plan card"})]}),I.jsx("div",{className:"flex items-center gap-1 bg-muted/50 rounded-lg p-0.5",children:f9.map(Ee=>I.jsx("button",{onClick:()=>X({planWidth:Ee.id}),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${F.planWidth===Ee.id?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:Ee.label},Ee.id))}),(()=>{const Ee=f9.find(Ie=>Ie.id===F.planWidth)??f9[0],_e=14,We=14,ht={compact:48,default:70,wide:94}[Ee.id];return I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-2 py-3 overflow-hidden",children:[I.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[I.jsx("div",{className:"h-0.5 w-8 rounded-full bg-foreground/15"}),I.jsxs("div",{className:"flex gap-1",children:[I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"}),I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"}),I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"})]})]}),I.jsx("div",{className:"border-t border-foreground/5 mb-2"}),I.jsxs("div",{className:"flex gap-1 items-stretch",style:{minHeight:64},children:[I.jsxs("div",{className:"flex-shrink-0 space-y-1 pt-0.5 opacity-30",style:{width:`${_e}%`},children:[I.jsx("div",{className:"h-0.5 w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-3/4 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-1/2 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-2/3 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-1/2 rounded-full bg-foreground"})]}),I.jsx("div",{className:"flex-1 flex justify-center min-w-0",children:I.jsxs("div",{className:"rounded border border-border/60 bg-card/50 p-1.5 space-y-1 transition-all duration-300 ease-out",style:{width:`${ht}%`,minWidth:0},children:[I.jsx("div",{className:"h-1 w-2/5 rounded-full bg-foreground/25"}),I.jsxs("div",{className:"space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-11/12 rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-4/5 rounded-full bg-foreground/10"})]}),I.jsxs("div",{className:"rounded bg-muted/60 p-1 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-primary/20"}),I.jsx("div",{className:"h-[2px] w-3/4 rounded-full bg-primary/20"}),I.jsx("div",{className:"h-[2px] w-5/6 rounded-full bg-primary/20"})]}),I.jsxs("div",{className:"space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-3/4 rounded-full bg-foreground/10"})]})]})}),I.jsxs("div",{className:"flex-shrink-0 space-y-1 pt-0.5 opacity-20",style:{width:`${We}%`},children:[I.jsxs("div",{className:"rounded border border-foreground/20 p-0.5 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-[2px] w-2/3 rounded-full bg-foreground"})]}),I.jsxs("div",{className:"rounded border border-foreground/20 p-0.5 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-[2px] w-1/2 rounded-full bg-foreground"})]})]})]})]}),I.jsxs("div",{className:"text-[10px] text-muted-foreground/70 leading-snug",children:[Ee.px,"px — ",Ee.hint]})]})})()]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsx("div",{className:"text-sm font-medium",children:"Tater Mode"}),I.jsx("button",{role:"switch","aria-checked":t,onClick:()=>e(!t),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})]}),m==="saving"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Save Plans"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save plans to ~/.plannotator/plans/"})]}),I.jsx("button",{role:"switch","aria-checked":R.enabled,onClick:()=>ve({enabled:!R.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${R.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${R.enabled?"translate-x-6":"translate-x-1"}`})})]}),R.enabled&&I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Custom Path (optional)"}),I.jsx("input",{type:"text",value:R.customPath||"",onChange:Ee=>ve({customPath:Ee.target.value||null}),placeholder:"~/.plannotator/plans/",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:"Leave empty to use default location"})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Default Save Action"}),I.jsxs("div",{className:"text-xs text-muted-foreground",children:["Used for keyboard shortcut (",Is,"+S)"]})]}),I.jsxs("select",{value:$,onChange:Ee=>Be(Ee.target.value),className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:[I.jsx("option",{value:"ask",children:"Ask each time"}),I.jsx("option",{value:"download",children:"Download Annotations"}),gt&&I.jsx("option",{value:"obsidian",children:"Obsidian"}),Ge&&I.jsx("option",{value:"bear",children:"Bear"}),ot&&I.jsx("option",{value:"octarine",children:"Octarine"})]}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:$==="ask"?"Opens Export dialog with Notes tab":$==="download"?`${Is}+S downloads the annotations file`:`${Is}+S saves directly to ${{obsidian:"Obsidian",bear:"Bear",octarine:"Octarine"}[$]??$}`})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"Integrations"}),I.jsxs("button",{onClick:()=>h("obsidian"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Obsidian"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${B.enabled?"text-primary":"text-muted-foreground/50"}`,children:B.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]}),I.jsxs("button",{onClick:()=>h("bear"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Bear Notes"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${x.enabled?"text-primary":"text-muted-foreground/50"}`,children:x.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]}),I.jsxs("button",{onClick:()=>h("octarine"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Octarine"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${L.enabled?"text-primary":"text-muted-foreground/50"}`,children:L.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})]}),m==="labels"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium flex items-center gap-2",children:"Quick Labels"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Preset annotations for one-click feedback"})]}),I.jsx("button",{onClick:()=>{D7e(),ne($1)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:"Reset to defaults"})]}),I.jsx("style",{children:`
|
|
1841
|
+
</svg>`;function aIt(t){const e=t.indexOf("/.plannotator/");return e>=0?"~"+t.slice(e):t}const gce=({filePath:t})=>{const[e,n]=Y.useState(!1),a=()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(()=>n(!1),1500)})};return I.jsxs("button",{onClick:a,title:"Copy path",className:"inline-flex items-center gap-1.5 mt-1.5 px-2 py-1 rounded bg-muted/60 hover:bg-muted border border-border/50 transition-colors group max-w-full",children:[I.jsx("code",{className:"text-[10px] text-muted-foreground font-mono truncate",children:aIt(t)}),I.jsx("span",{className:"flex-shrink-0 text-muted-foreground/60 group-hover:text-muted-foreground transition-colors",children:e?I.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:I.jsx("path",{d:"M13.25 4.75 6 12 2.75 8.75"})}):I.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[I.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5"}),I.jsx("path",{d:"M10.5 5.5V3a1.5 1.5 0 0 0-1.5-1.5H3A1.5 1.5 0 0 0 1.5 3v6A1.5 1.5 0 0 0 3 10.5h2.5"})]})})]})},rIt=()=>{const[t,e]=Y.useState(null),[n,a]=Y.useState(!1),[r,i]=Y.useState(!1);Y.useEffect(()=>{fetch("/api/hooks/status").then(A=>A.json()).then(A=>{e(A),a(A.pfmReminder.enabled)}).catch(()=>{})},[]);const o=async()=>{const A=!n;a(A),await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pfmReminder:A})}).catch(()=>a(!A))};return t?I.jsxs("div",{className:"space-y-4",children:[I.jsx("p",{className:"text-xs text-muted-foreground",children:"These hooks inject context into your planning agent before it writes a plan."}),I.jsx("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:I.jsxs("div",{className:"flex items-start gap-3",children:[I.jsx("div",{className:"w-8 h-8 flex-shrink-0 rounded-md overflow-hidden",dangerouslySetInnerHTML:{__html:uce}}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Plannotator Flavored Markdown"}),I.jsx("button",{onClick:o,className:`relative inline-flex h-5 w-9 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${n?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition-transform ${n?"translate-x-4":"translate-x-0"}`})})]}),I.jsxs("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:["Inspired by GitHub Flavored Markdown, PFM extends it with interactive tables, SVG diagrams (custom, Mermaid & Graphviz), code-file links that open in your editor, callouts, task lists, and more. This reminder tells the planning agent what the renderer supports so it can use these features naturally. ",I.jsx("strong",{children:"No extra tokens"})," — the agent still writes markdown as it normally would, just with enhanced syntax that Plannotator renders richer."]}),I.jsx("div",{className:"mt-2",children:I.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${n?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:[I.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${n?"bg-primary":"bg-muted-foreground/50"}`}),n?"Enabled":"Disabled"]})})]})]})}),I.jsx("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:I.jsxs("div",{className:"flex items-start gap-3",children:[I.jsx("div",{className:"w-8 h-8 flex-shrink-0 rounded-md overflow-hidden",dangerouslySetInnerHTML:{__html:uce}}),I.jsxs("div",{className:"flex-1 min-w-0",children:[I.jsxs("div",{className:"flex items-center justify-between gap-2",children:[I.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Improvement Hook"}),I.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${t.improvementHook.present?"bg-primary/15 text-primary":"bg-muted text-muted-foreground"}`,children:[I.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.improvementHook.present?"bg-primary":"bg-muted-foreground/50"}`}),t.improvementHook.present?"Active":"Not found"]})]}),t.improvementHook.present?I.jsxs(I.Fragment,{children:[I.jsxs("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:["Corrective planning instructions generated from your plan denial history.",t.improvementHook.fileSize!=null&&I.jsxs("span",{className:"text-muted-foreground/70",children:[" · ",(t.improvementHook.fileSize/1024).toFixed(1),"KB"]})]}),t.improvementHook.filePath&&I.jsx(gce,{filePath:t.improvementHook.filePath}),I.jsxs("p",{className:"text-[11px] text-muted-foreground/70 mt-2 leading-relaxed",children:["Edit this file directly to customize, or run ",I.jsx("code",{className:"text-[10px] bg-muted px-1 py-0.5 rounded",children:"/plannotator-compound"})," to regenerate from recent denial history."]}),I.jsx("button",{onClick:()=>i(!r),className:"text-xs text-primary hover:text-primary/80 mt-1.5 transition-colors",children:r?"▾ Hide content":"▸ Show content"}),r&&t.improvementHook.content&&I.jsx("pre",{className:"mt-2 p-3 rounded-md bg-muted/50 border border-border text-[11px] text-foreground/80 overflow-auto max-h-64 whitespace-pre-wrap font-mono leading-relaxed",children:t.improvementHook.content})]}):I.jsxs(I.Fragment,{children:[I.jsx("p",{className:"text-xs text-muted-foreground mt-1 leading-relaxed",children:"No improvement hook found. This file injects corrective planning instructions before your agent writes a plan — the more you review, the better your agent plans."}),t.improvementHook.filePath&&I.jsx(gce,{filePath:t.improvementHook.filePath}),I.jsxs("p",{className:"text-[11px] text-muted-foreground/70 mt-2 leading-relaxed",children:["Run ",I.jsx("code",{className:"text-[10px] bg-muted px-1 py-0.5 rounded",children:"/plannotator-compound"})," to auto-generate from your denial history, or create a plain text file at the path above with your own instructions."," ",I.jsx("a",{href:"https://plannotator.ai/blog/continuously-improve-claude-code-plans/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline underline-offset-2",children:"Learn more"})]})]})]})]})})]}):I.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading hook status…"})},iIt=[{value:"",label:"Theme Default"},{value:"Fira Code",label:"Fira Code"},{value:"Hack",label:"Hack"},{value:"IBM Plex Mono",label:"IBM Plex Mono"},{value:"Inconsolata",label:"Inconsolata"},{value:"JetBrains Mono",label:"JetBrains Mono"},{value:"Red Hat Mono",label:"Red Hat Mono"},{value:"Roboto Mono",label:"Roboto Mono"},{value:"Source Code Pro",label:"Source Code Pro"},{value:"Atkinson Hyperlegible Mono",label:"Atkinson Hyperlegible"}],oIt=[{value:"split",label:"Split"},{value:"unified",label:"Unified"}],AIt=[{value:"scroll",label:"Scroll"},{value:"wrap",label:"Wrap"}],sIt=[{value:"bars",label:"Bars"},{value:"classic",label:"Classic"},{value:"none",label:"None"}],cIt=[{value:"word-alt",label:"Word-Alt"},{value:"word",label:"Word"},{value:"char",label:"Char"},{value:"none",label:"None"}],lIt=[{value:"subtle",label:"Subtle"},{value:"normal",label:"Normal"},{value:"strong",label:"Strong"}],dIt=[{value:"uncommitted",label:"All Changes",description:"Everything you've changed since your last commit"},{value:"unstaged",label:"Unstaged",description:"Only changes you haven't staged yet"},{value:"staged",label:"Staged",description:"Only changes you've staged for commit"},{value:"merge-base",label:"Committed",description:"Everything you've committed on this branch"},{value:"all",label:"All Files (HEAD)",description:"Every tracked file at HEAD, shown as additions"}];function bQ({options:t,value:e,onChange:n}){return I.jsx("div",{className:"flex items-center gap-1 bg-muted/50 rounded-lg p-0.5",children:t.map(a=>I.jsx("button",{onClick:()=>n(a.value),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${e===a.value?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:a.label},a.value))})}function MS({checked:t,onChange:e,label:n,description:a}){return I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:n}),a&&I.jsx("div",{className:"text-xs text-muted-foreground",children:a})]}),I.jsx("button",{role:"switch","aria-checked":t,onClick:()=>e(!t),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})}const uIt=()=>{const t=$s("defaultDiffType");return I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Default Diff View"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Which changes to show when you open a code review"})]}),I.jsx("div",{className:"space-y-2",children:dIt.map(e=>I.jsxs("button",{type:"button",onClick:()=>Ai.set("defaultDiffType",e.value),className:`w-full flex items-start gap-3 p-3 rounded-lg border transition-colors text-left ${t===e.value?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/30 hover:bg-muted/50"}`,children:[I.jsx("div",{className:`mt-0.5 w-4 h-4 rounded-full border-2 flex-shrink-0 flex items-center justify-center ${t===e.value?"border-primary":"border-muted-foreground/40"}`,children:t===e.value&&I.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"})}),I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:e.label}),I.jsx("div",{className:"text-xs text-muted-foreground",children:e.description})]})]},e.value))})]})},gIt=()=>{const t=$s("diffStyle"),e=$s("diffOverflow"),n=$s("diffIndicators"),a=$s("diffLineDiffType"),r=$s("diffShowLineNumbers"),i=$s("diffShowBackground"),o=$s("diffLineBgIntensity"),A=$s("diffHideWhitespace"),s=$s("diffFontFamily"),l=$s("diffFontSize");return Y.useEffect(()=>{s&&zEt(s)},[s]),I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Code Font"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Font family for diff code lines"})]}),I.jsx("select",{value:s,onChange:d=>Ai.set("diffFontFamily",d.target.value),className:"w-full px-3 py-1.5 text-sm rounded-md bg-muted/50 border border-border text-foreground",style:s?{fontFamily:`'${s}', monospace`}:void 0,children:iIt.map(d=>I.jsx("option",{value:d.value,children:d.label},d.value))}),s&&I.jsx("div",{className:"text-xs text-muted-foreground px-1 py-1 rounded bg-muted/30 font-mono",style:{fontFamily:`'${s}', monospace`},children:"Preview: const x = fn(42);"})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Code Font Size"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Font size for diff code lines"})]}),I.jsx("div",{className:"text-xs tabular-nums text-muted-foreground min-w-[4ch] text-right",children:l||"Auto"})]}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("input",{type:"range",min:8,max:24,step:1,value:l?parseInt(l):13,onChange:d=>Ai.set("diffFontSize",`${d.target.value}px`),className:"flex-1 h-1.5 accent-primary cursor-pointer"}),l&&I.jsx("button",{onClick:()=>Ai.set("diffFontSize",""),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Reset"})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Diff Style"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Side-by-side or inline diff view"})]}),I.jsx(bQ,{options:oIt,value:t,onChange:d=>Ai.set("diffStyle",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Line Overflow"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"How to handle long lines in diffs"})]}),I.jsx(bQ,{options:AIt,value:e,onChange:d=>Ai.set("diffOverflow",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Change Indicators"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Style of +/- markers in the gutter"})]}),I.jsx(bQ,{options:sIt,value:n,onChange:d=>Ai.set("diffIndicators",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Inline Diff Granularity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Highlight granularity for inline changes"})]}),I.jsx(bQ,{options:cIt,value:a,onChange:d=>Ai.set("diffLineDiffType",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:r,onChange:d=>Ai.set("diffShowLineNumbers",d),label:"Show Line Numbers"}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:i,onChange:d=>Ai.set("diffShowBackground",d),label:"Show Diff Background",description:"Colored backgrounds on added/deleted lines"}),i&&I.jsxs("div",{className:"space-y-2 pl-4",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Line Background Intensity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"How prominent the colored line backgrounds appear"})]}),I.jsx(bQ,{options:lIt,value:o,onChange:d=>Ai.set("diffLineBgIntensity",d)})]}),I.jsx("div",{className:"border-t border-border"}),I.jsx(MS,{checked:A,onChange:d=>Ai.set("diffHideWhitespace",d),label:"Hide Whitespace",description:"Ignore whitespace-only changes in diffs"})]})},FS=[{label:"suggestion",display:"suggestion",blocking:!0},{label:"nitpick",display:"nit",blocking:!1},{label:"question",display:"question",blocking:!0},{label:"issue",display:"issue",blocking:!0},{label:"praise",display:"praise",blocking:!1},{label:"thought",display:"thought",blocking:!1},{label:"note",display:"note",blocking:!1},{label:"todo",display:"todo",blocking:!0},{label:"chore",display:"chore",blocking:!0}];function pIt(t){if(!t)return FS;try{const e=JSON.parse(t);return Array.isArray(e)?e.map(n=>({label:n.label||"custom",display:n.display||n.label||"custom",blocking:n.blocking===!0||n.blocking==="true"})):FS}catch{return FS}}const mIt=()=>{const t=$s("conventionalComments"),e=$s("conventionalLabels"),[n,a]=Y.useState(()=>pIt(e)),r=e===null,i=d=>{a(d),Ai.set("conventionalLabels",JSON.stringify(d))},o=(d,u)=>{const g=[...n];g[d]={...g[d],...u},i(g)},A=d=>{i(n.filter((u,g)=>g!==d))},s=()=>{const d=new Set(n.map(p=>p.label));let u="custom",g=2;for(;d.has(u);)u=`custom-${g++}`;i([...n,{label:u,display:u,blocking:!1}])},l=()=>{a(FS),Ai.set("conventionalLabels",null)};return I.jsxs(I.Fragment,{children:[I.jsx(MS,{checked:t,onChange:d=>Ai.set("conventionalComments",d),label:"Conventional Comments",description:"Add structured labels to review comments"}),I.jsxs("div",{className:`space-y-4 transition-opacity ${t?"":"opacity-40 pointer-events-none"}`,children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"How it works"}),I.jsx("div",{className:"text-xs text-muted-foreground leading-relaxed mt-1",children:"When enabled, a label picker appears above the comment input when annotating code. Labels classify your feedback intent, making it clear whether a comment is a blocking issue, a trivial nitpick, or praise."})]}),I.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:["Based on the"," ",I.jsx("a",{href:"https://conventionalcomments.org",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Conventional Comments"})," ","spec. Comments are exported as plain text, readable on GitHub, and parseable by tooling."]}),I.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 space-y-1.5",children:[I.jsx("div",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:"Example output"}),I.jsxs("div",{className:"font-mono text-[11px] text-foreground/80 leading-relaxed",children:[I.jsx("span",{className:"font-bold",children:"issue"})," ",I.jsx("span",{className:"text-muted-foreground",children:"(blocking)"}),": This will throw if user is null — the guard was removed in the refactor."]})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Labels"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Customize labels and their default severity"})]}),!r&&I.jsx("button",{onClick:l,className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:"Reset to defaults"})]}),I.jsxs("div",{className:"flex items-end gap-2 px-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/60",children:[I.jsx("span",{className:"flex-1",children:"Label"}),I.jsx("span",{className:"w-20 text-center",children:"Blocking decorator"}),I.jsx("span",{className:"w-6"})]}),I.jsx("div",{className:"space-y-1.5",children:n.map((d,u)=>I.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg bg-muted/40",children:[I.jsx("input",{type:"text",value:d.display,onChange:g=>{const p=g.target.value;o(u,{display:p,label:p})},className:"flex-1 px-2 py-1 bg-background/80 rounded text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary/50 min-w-0"}),I.jsx("div",{className:"w-20 flex justify-center",children:I.jsx("button",{role:"switch","aria-checked":d.blocking,onClick:()=>o(u,{blocking:!d.blocking}),className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${d.blocking?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow-sm transition-transform ${d.blocking?"translate-x-4.5":"translate-x-0.5"}`})})}),I.jsx("button",{onClick:()=>A(u),className:"p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors flex-shrink-0",title:"Remove label",children:I.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},u))}),n.length<12&&I.jsx("button",{onClick:s,className:"w-full py-1.5 text-xs text-muted-foreground hover:text-foreground border border-dashed border-border rounded-lg hover:border-foreground/30 transition-colors",children:"+ Add label"})]})]})},hIt=({taterMode:t,onTaterModeChange:e,onIdentityChange:n,origin:a,mode:r="plan",onUIPreferencesChange:i,externalOpen:o,onExternalClose:A,aiProviders:s=[],gitUser:l})=>{const[d,u]=Y.useState(!1),[g,p]=Y.useState(!1);Y.useEffect(()=>{if(!g)return;const Ee=_e=>{_e.key==="Escape"&&(_e.preventDefault(),_e.stopPropagation(),p(!1),u(!0))};return document.addEventListener("keydown",Ee),()=>document.removeEventListener("keydown",Ee)},[g]);const[m,h]=Y.useState("general"),[b,C]=Y.useState(""),[B,y]=Y.useState({enabled:!1,vaultPath:"",folder:"plannotator",filenameSeparator:"space",autoSave:!1,vaultBrowserEnabled:!1}),[Q,k]=Y.useState([]),[_,v]=Y.useState(!1),[x,S]=Y.useState({enabled:!1,customTags:"",tagPosition:"append",autoSave:!1}),[L,N]=Y.useState({enabled:!1,workspace:"",folder:"plannotator",autoSave:!1}),[U,K]=Y.useState({switchTo:"build"}),[R,O]=Y.useState({enabled:!0,customPath:null}),[F,T]=Y.useState({tocEnabled:!0,stickyActionsEnabled:!0,planWidth:"compact"}),[G,H]=Y.useState("bypassPermissions"),[q,P]=Y.useState(null),[z,Z]=Y.useState("off"),[$,V]=Y.useState("ask"),[Ae,ne]=Y.useState([]),[pe,te]=Y.useState(null),[re,se]=Y.useState(""),[oe,ue]=Y.useState(null),[le,De]=Y.useState({enabled:!1,directories:[]}),[he,qe]=Y.useState(""),{agents:ce,validateAgent:et,getAgentWarning:ke}=Ove(a??null),rt=Y.useMemo(()=>{const Ee=[{id:"general",label:"General"}];return Ee.push({id:"theme",label:"Theme"}),r==="plan"&&(Ee.push({id:"display",label:"Display"}),Ee.push({id:"saving",label:"Saving"}),Ee.push({id:"labels",label:"Labels"})),r==="review"&&(Ee.push({id:"git",label:"Git"}),Ee.push({id:"display",label:"Display"}),Ee.push({id:"comments",label:"Comments"}),s.length>0&&Ee.push({id:"ai",label:"AI"})),Ee.push({id:"shortcuts",label:"Shortcuts"}),r==="plan"&&Ee.push({id:"hooks",label:"Hooks"}),Ee},[r,s.length]),tt=[{id:"files",label:"Files"},...r==="plan"?[{id:"obsidian",label:"Obsidian"},{id:"bear",label:"Bear"},{id:"octarine",label:"Octarine"}]:[]],gt=B.enabled&&tm(B).trim().length>0,Ge=x.enabled,ot=L.enabled&&L.workspace.trim().length>0;Y.useEffect(()=>{o&&(u(!0),A?.())},[o,A]),Y.useEffect(()=>{if(d){C(Kl()),y(em()),S(gf()),N(PE()),K(OM()),O(z2()),T(PK()),H(Xve().mode),Z(ECe()),V(Kve()),ne(pq());const Ee=ru();ue(Pj({providers:s,origin:a,settings:Ee}).providerId),De(rz()),a==="opencode"&&P(ke())}},[d,ce,a,ke,s.length]),Y.useEffect(()=>{if(!d)return;$==="ask"||$==="download"||$==="obsidian"&>||$==="bear"&&Ge||$==="octarine"&&ot||(V("ask"),MAe("ask"))},[d,$,gt,Ge,ot]),Y.useEffect(()=>{B.enabled&&Q.length===0&&!_&&(v(!0),fetch("/api/obsidian/vaults").then(Ee=>Ee.json()).then(Ee=>{k(Ee.vaults||[]),Ee.vaults?.length>0&&!B.vaultPath&&ut({vaultPath:Ee.vaults[0]})}).catch(()=>k([])).finally(()=>v(!1)))},[B.enabled]);const He=Ee=>{const _e={...le,...Ee};De(_e),Agt(_e),i&&i({...F})},ze=()=>{const Ee=he.trim();Ee&&!le.directories.includes(Ee)&&He({directories:[...le.directories,Ee]}),qe("")},ut=Ee=>{const _e={...B,...Ee};y(_e),sct(_e)},Se=Ee=>{const _e={...x,...Ee};S(_e),cct(_e)},Ze=Ee=>{const _e={...L,...Ee};N(_e),dct(_e)},be=(Ee,_e)=>{const We={switchTo:Ee,customName:_e??U.customName};K(We),Gve(We)},ve=Ee=>{const _e={...R,...Ee};O(_e),Udt(_e)},X=Ee=>{const _e={...F,...Ee};T(_e),qdt(_e),i?.(_e)},we=Ee=>{H(Ee),$ve(Ee)},Be=Ee=>{V(Ee),MAe(Ee)},Ne=()=>{const Ee=b,_e=aAt();C(_e),n?.(Ee,_e)},Me=Ee=>{const _e=Ee.trim();if(!_e||_e===b)return;const We=b,it=nAt(_e);C(it),n?.(We,it)},Ke=()=>{l&&Me(l)};return I.jsxs(I.Fragment,{children:[I.jsx("button",{onClick:()=>u(!0),className:"relative p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"Settings",children:I.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d&&!g&&ui.createPortal(I.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-background/80 backdrop-blur-sm p-4",onClick:()=>u(!1),children:I.jsxs("div",{className:"bg-card border border-border rounded-xl w-full max-w-2xl max-h-[85vh] flex flex-col shadow-2xl relative overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[t&&I.jsx(ez,{}),I.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[I.jsx("h3",{className:"font-semibold text-sm",children:"Settings"}),I.jsx("button",{onClick:()=>u(!1),className:"p-1.5 rounded-md bg-muted hover:bg-muted/80 text-foreground transition-colors",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),I.jsxs("div",{className:"flex flex-col md:flex-row md:min-h-[420px] flex-1 min-h-0 overflow-hidden",children:[I.jsx("nav",{className:"md:hidden flex overflow-x-auto border-b border-border px-2 py-1.5 gap-1 flex-shrink-0",children:[...rt,...tt].map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`px-3 py-1.5 rounded text-xs whitespace-nowrap transition-colors flex items-center gap-1.5 ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))}),I.jsxs("nav",{className:"hidden md:block w-40 border-r border-border p-2 flex-shrink-0",children:[I.jsx("div",{className:"space-y-0.5",children:rt.map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`w-full text-left px-3 py-1.5 rounded text-sm transition-colors flex items-center justify-between ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))}),tt.length>0&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"mx-2 my-2 border-t border-border/50"}),I.jsx("div",{className:"px-3 py-1 text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"Integrations"}),I.jsx("div",{className:"space-y-0.5",children:tt.map(Ee=>I.jsx("button",{onClick:()=>h(Ee.id),className:`w-full text-left px-3 py-1.5 rounded text-sm transition-colors ${m===Ee.id?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:Ee.label},Ee.id))})]})]}),I.jsx(sB,{className:"flex-1 min-h-0",children:I.jsxs("div",{className:"p-4 space-y-4",children:[m==="general"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-sm font-medium",children:"Your Identity"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Used when sharing annotations with others"}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx("input",{type:"text",defaultValue:b,onBlur:Ee=>Me(Ee.target.value),onKeyDown:Ee=>{Ee.key==="Enter"&&(Me(Ee.target.value),Ee.target.blur())},className:"flex-1 px-3 py-2 bg-muted rounded-lg text-xs font-mono truncate border border-transparent focus:border-primary/50 focus:outline-none transition-colors",placeholder:"Enter your name..."},b),l&&I.jsx("button",{onClick:Ke,onMouseDown:Ee=>Ee.preventDefault(),className:"p-2 rounded-lg bg-muted hover:bg-muted/80 text-muted-foreground hover:text-foreground transition-colors",title:`Use git identity: ${l}`,children:I.jsx(JEt,{className:"w-5 h-5"})}),I.jsx("button",{onClick:Ne,onMouseDown:Ee=>Ee.preventDefault(),className:"p-2 rounded-lg bg-muted hover:bg-muted/80 text-muted-foreground hover:text-foreground transition-colors",title:"Regenerate random identity",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),a==="claude-code"&&r==="plan"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Permission Mode"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Automation level after plan approval"})]}),I.jsx("select",{value:G,onChange:Ee=>we(Ee.target.value),className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:KK.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:KK.find(Ee=>Ee.value===G)?.description})]})]}),a==="opencode"&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Agent Switching"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Which agent to switch to after plan approval"})]}),q&&I.jsxs("div",{className:"flex items-start gap-2 p-2 bg-amber-500/10 border border-amber-500/30 rounded-lg text-xs text-amber-600 dark:text-amber-400",children:[I.jsx("svg",{className:"w-4 h-4 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),I.jsx("span",{children:q})]}),I.jsx("select",{value:U.switchTo,onChange:Ee=>{be(Ee.target.value),P(null)},className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:ce.length>0?I.jsxs(I.Fragment,{children:[U.switchTo!=="custom"&&U.switchTo!=="disabled"&&!ce.some(Ee=>Ee.id.toLowerCase()===U.switchTo.toLowerCase())&&I.jsxs("option",{value:U.switchTo,disabled:!0,children:[U.switchTo," (not found)"]}),ce.map(Ee=>I.jsx("option",{value:Ee.id,children:Ee.name},Ee.id)),I.jsx("option",{value:"custom",children:"Custom"}),I.jsx("option",{value:"disabled",children:"Disabled"})]}):vdt.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),U.switchTo==="custom"&&I.jsx("input",{type:"text",value:U.customName||"",onChange:Ee=>{const _e=Ee.target.value;be("custom",_e),_e&&ce.length>0?et(_e)?P(null):P(`Agent "${_e}" not found in OpenCode. It may cause errors.`):P(null)},placeholder:"Enter agent name...",className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 placeholder:text-muted-foreground/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:U.switchTo==="custom"&&U.customName?`Switch to "${U.customName}" agent after approval`:U.switchTo==="disabled"?"Stay on current agent after approval":`Switch to ${U.switchTo} agent after approval`})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-sm font-medium",children:"Auto-close Tab"}),I.jsx("select",{value:z,onChange:Ee=>{const _e=Ee.target.value;Z(_e),ICe(_e)},className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:rre.map(Ee=>I.jsx("option",{value:Ee.value,children:Ee.label},Ee.value))}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:rre.find(Ee=>Ee.value===z)?.description})]})]}),m==="theme"&&I.jsx(dce,{onPreview:()=>{u(!1),p(!0)}}),m==="git"&&r==="review"&&I.jsx(uIt,{}),m==="display"&&r==="review"&&I.jsx(gIt,{}),m==="display"&&r!=="review"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Auto-open Sidebar"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Open sidebar with Table of Contents on load"})]}),I.jsx("button",{role:"switch","aria-checked":F.tocEnabled,onClick:()=>X({tocEnabled:!F.tocEnabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${F.tocEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${F.tocEnabled?"translate-x-6":"translate-x-1"}`})})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Sticky Actions"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Keep action buttons visible while scrolling"})]}),I.jsx("button",{role:"switch","aria-checked":F.stickyActionsEnabled,onClick:()=>X({stickyActionsEnabled:!F.stickyActionsEnabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${F.stickyActionsEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${F.stickyActionsEnabled?"translate-x-6":"translate-x-1"}`})})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium flex items-center gap-2",children:"Plan Width"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Maximum width of the plan card"})]}),I.jsx("div",{className:"flex items-center gap-1 bg-muted/50 rounded-lg p-0.5",children:f9.map(Ee=>I.jsx("button",{onClick:()=>X({planWidth:Ee.id}),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${F.planWidth===Ee.id?"bg-background text-foreground shadow-sm font-medium":"text-muted-foreground hover:text-foreground"}`,children:Ee.label},Ee.id))}),(()=>{const Ee=f9.find(Ie=>Ie.id===F.planWidth)??f9[0],_e=14,We=14,ht={compact:48,default:70,wide:94}[Ee.id];return I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{className:"rounded-lg border border-border/40 bg-muted/20 px-2 py-3 overflow-hidden",children:[I.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[I.jsx("div",{className:"h-0.5 w-8 rounded-full bg-foreground/15"}),I.jsxs("div",{className:"flex gap-1",children:[I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"}),I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"}),I.jsx("div",{className:"h-1 w-1 rounded-full bg-foreground/15"})]})]}),I.jsx("div",{className:"border-t border-foreground/5 mb-2"}),I.jsxs("div",{className:"flex gap-1 items-stretch",style:{minHeight:64},children:[I.jsxs("div",{className:"flex-shrink-0 space-y-1 pt-0.5 opacity-30",style:{width:`${_e}%`},children:[I.jsx("div",{className:"h-0.5 w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-3/4 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-1/2 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-2/3 rounded-full bg-foreground"}),I.jsx("div",{className:"h-0.5 w-1/2 rounded-full bg-foreground"})]}),I.jsx("div",{className:"flex-1 flex justify-center min-w-0",children:I.jsxs("div",{className:"rounded border border-border/60 bg-card/50 p-1.5 space-y-1 transition-all duration-300 ease-out",style:{width:`${ht}%`,minWidth:0},children:[I.jsx("div",{className:"h-1 w-2/5 rounded-full bg-foreground/25"}),I.jsxs("div",{className:"space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-11/12 rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-4/5 rounded-full bg-foreground/10"})]}),I.jsxs("div",{className:"rounded bg-muted/60 p-1 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-primary/20"}),I.jsx("div",{className:"h-[2px] w-3/4 rounded-full bg-primary/20"}),I.jsx("div",{className:"h-[2px] w-5/6 rounded-full bg-primary/20"})]}),I.jsxs("div",{className:"space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground/10"}),I.jsx("div",{className:"h-[2px] w-3/4 rounded-full bg-foreground/10"})]})]})}),I.jsxs("div",{className:"flex-shrink-0 space-y-1 pt-0.5 opacity-20",style:{width:`${We}%`},children:[I.jsxs("div",{className:"rounded border border-foreground/20 p-0.5 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-[2px] w-2/3 rounded-full bg-foreground"})]}),I.jsxs("div",{className:"rounded border border-foreground/20 p-0.5 space-y-[2px]",children:[I.jsx("div",{className:"h-[2px] w-full rounded-full bg-foreground"}),I.jsx("div",{className:"h-[2px] w-1/2 rounded-full bg-foreground"})]})]})]})]}),I.jsxs("div",{className:"text-[10px] text-muted-foreground/70 leading-snug",children:[Ee.px,"px — ",Ee.hint]})]})})()]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsx("div",{className:"text-sm font-medium",children:"Tater Mode"}),I.jsx("button",{role:"switch","aria-checked":t,onClick:()=>e(!t),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})]}),m==="saving"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"space-y-3",children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Save Plans"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save plans to the default data directory"})]}),I.jsx("button",{role:"switch","aria-checked":R.enabled,onClick:()=>ve({enabled:!R.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${R.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${R.enabled?"translate-x-6":"translate-x-1"}`})})]}),R.enabled&&I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Custom Path (optional)"}),I.jsx("input",{type:"text",value:R.customPath||"",onChange:Ee=>ve({customPath:Ee.target.value||null}),placeholder:"Leave empty for default",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:"Leave empty to use default location"})]})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Default Save Action"}),I.jsxs("div",{className:"text-xs text-muted-foreground",children:["Used for keyboard shortcut (",Is,"+S)"]})]}),I.jsxs("select",{value:$,onChange:Ee=>Be(Ee.target.value),className:"w-full px-3 py-2 bg-muted rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer",children:[I.jsx("option",{value:"ask",children:"Ask each time"}),I.jsx("option",{value:"download",children:"Download Annotations"}),gt&&I.jsx("option",{value:"obsidian",children:"Obsidian"}),Ge&&I.jsx("option",{value:"bear",children:"Bear"}),ot&&I.jsx("option",{value:"octarine",children:"Octarine"})]}),I.jsx("div",{className:"text-[10px] text-muted-foreground/70",children:$==="ask"?"Opens Export dialog with Notes tab":$==="download"?`${Is}+S downloads the annotations file`:`${Is}+S saves directly to ${{obsidian:"Obsidian",bear:"Bear",octarine:"Octarine"}[$]??$}`})]}),I.jsx("div",{className:"border-t border-border"}),I.jsxs("div",{className:"space-y-2",children:[I.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground/50",children:"Integrations"}),I.jsxs("button",{onClick:()=>h("obsidian"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Obsidian"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${B.enabled?"text-primary":"text-muted-foreground/50"}`,children:B.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]}),I.jsxs("button",{onClick:()=>h("bear"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Bear Notes"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${x.enabled?"text-primary":"text-muted-foreground/50"}`,children:x.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]}),I.jsxs("button",{onClick:()=>h("octarine"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-muted/50 hover:bg-muted rounded-lg text-sm transition-colors group",children:[I.jsx("span",{className:"text-foreground",children:"Octarine"}),I.jsxs("span",{className:"flex items-center gap-2",children:[I.jsx("span",{className:`text-[10px] font-medium ${L.enabled?"text-primary":"text-muted-foreground/50"}`,children:L.enabled?"Enabled":"Off"}),I.jsx("svg",{className:"w-3.5 h-3.5 text-muted-foreground/40 group-hover:text-muted-foreground transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})]}),m==="labels"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium flex items-center gap-2",children:"Quick Labels"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Preset annotations for one-click feedback"})]}),I.jsx("button",{onClick:()=>{D7e(),ne($1)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:"Reset to defaults"})]}),I.jsx("style",{children:`
|
|
1842
1842
|
@keyframes tip-slide-open {
|
|
1843
1843
|
from { max-height: 0; opacity: 0; }
|
|
1844
1844
|
to { max-height: 60px; opacity: 1; }
|
|
@@ -1847,7 +1847,7 @@ On the server side, update packages/server/index.ts to register the new WebSocke
|
|
|
1847
1847
|
created: ${new Date().toISOString().slice(0,19)}Z
|
|
1848
1848
|
source: plannotator
|
|
1849
1849
|
tags: [plan, ...]
|
|
1850
|
-
---`})]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Obsidian when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":B.autoSave,onClick:()=>ut({autoSave:!B.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${B.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${B.autoSave?"translate-x-6":"translate-x-1"}`})})]}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Vault Browser"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Browse and annotate vault files from the sidebar"})]}),I.jsx("button",{role:"switch","aria-checked":B.vaultBrowserEnabled,onClick:()=>ut({vaultBrowserEnabled:!B.vaultBrowserEnabled}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${B.vaultBrowserEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${B.vaultBrowserEnabled?"translate-x-6":"translate-x-1"}`})})]})]})]})]}),m==="bear"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Bear Notes"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save approved plans to Bear"})]}),I.jsx("button",{role:"switch","aria-checked":x.enabled,onClick:()=>Se({enabled:!x.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${x.enabled?"translate-x-6":"translate-x-1"}`})})]}),x.enabled&&I.jsxs("div",{className:"mt-3 space-y-3",children:[I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Custom Tags"}),I.jsx("input",{type:"text",value:x.customTags,onChange:Ee=>Se({customTags:Ee.target.value}),onBlur:Ee=>Se({customTags:lct(Ee.target.value)}),placeholder:"plan, work",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Comma-separated, kebab-case. Leave empty for auto-generated tags."})]}),I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Tag Position"}),I.jsxs("select",{value:x.tagPosition,onChange:Ee=>Se({tagPosition:Ee.target.value}),className:"w-full px-3 py-2 bg-muted rounded-lg text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",children:[I.jsx("option",{value:"append",children:"Append (end of note)"}),I.jsx("option",{value:"prepend",children:"Prepend (after title)"})]})]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Bear when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":x.autoSave,onClick:()=>Se({autoSave:!x.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${x.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${x.autoSave?"translate-x-6":"translate-x-1"}`})})]})]})]}),m==="octarine"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Octarine"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save approved plans to Octarine"})]}),I.jsx("button",{role:"switch","aria-checked":L.enabled,onClick:()=>Ze({enabled:!L.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${L.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${L.enabled?"translate-x-6":"translate-x-1"}`})})]}),L.enabled&&I.jsxs("div",{className:"mt-3 space-y-3",children:[I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Workspace Name"}),I.jsx("input",{type:"text",value:L.workspace,onChange:Ee=>Ze({workspace:Ee.target.value}),placeholder:"My Workspace",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"The Octarine workspace name to save plans into."})]}),I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Folder"}),I.jsx("input",{type:"text",value:L.folder,onChange:Ee=>Ze({folder:Ee.target.value}),placeholder:"plannotator",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Subfolder within the workspace for saved plans."})]}),I.jsxs("div",{className:"text-[10px] text-muted-foreground/70",children:["Plans saved to: ",L.workspace||"..."," / ",L.folder||"plannotator","/"]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Octarine when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":L.autoSave,onClick:()=>Ze({autoSave:!L.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${L.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${L.autoSave?"translate-x-6":"translate-x-1"}`})})]})]})]})]})})]})]})}),document.body),g&&ui.createPortal(I.jsxs("div",{className:"fixed inset-0 z-[100] flex flex-col pointer-events-none",children:[I.jsx("div",{className:"flex-1"}),I.jsxs("div",{className:"pointer-events-auto w-full bg-card border-t-2 border-primary/30 shadow-[0_-4px_20px_rgba(0,0,0,0.4)] flex flex-col max-h-[35vh] overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[I.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[I.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Theme Preview"}),I.jsx("button",{onClick:()=>{p(!1),u(!0)},className:"px-2.5 py-1 rounded-md text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]}),I.jsx("div",{className:"p-3 overflow-y-auto flex-1 min-h-0",children:I.jsx(dce,{compact:!0})})]})]}),document.body)]})},fIt=({className:t,panelClassName:e,renderTrigger:n,children:a})=>{const[r,i]=Y.useState(!1),o=Y.useRef(null);return Y.useEffect(()=>{if(!r)return;const A=l=>{o.current&&!o.current.contains(l.target)&&i(!1)},s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",A),document.addEventListener("keydown",s),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",s)}},[r]),I.jsxs("div",{ref:o,className:t?`relative ${t}`:"relative",children:[n({isOpen:r,toggleMenu:()=>i(A=>!A)}),r&&I.jsx("div",{className:e??"absolute top-full right-0 mt-1 w-56 rounded-lg border border-border bg-popover py-1 shadow-xl z-[70]",children:a({closeMenu:()=>i(!1)})})]})},kd=({onClick:t,icon:e,label:n,subtitle:a,badge:r})=>I.jsxs("button",{onClick:t,className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-muted",children:[I.jsx("span",{className:"text-muted-foreground",children:e}),a?I.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[I.jsx("span",{children:n}),I.jsx("span",{className:"text-[10px] text-muted-foreground",children:a})]}):I.jsx("span",{className:"flex-1",children:n}),r]}),Yx=()=>I.jsx("div",{className:"my-1 border-t border-border"}),bIt=({children:t})=>I.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),CIt=({className:t="w-3.5 h-3.5"})=>I.jsxs("svg",{className:`${t} flex-shrink-0`,viewBox:"0 0 64 64",fill:"none",stroke:"currentColor",children:[I.jsx("path",{d:"M40.5 40.5L55 55",strokeWidth:7,strokeLinecap:"round"}),I.jsx("circle",{cx:"27",cy:"27",r:"20",strokeWidth:4}),I.jsx("path",{d:"M27 14L29.2 14.3L30.2 17.2L32.6 18.6L35.5 17.5L37.2 19.2L36.1 22.1L37.5 24.5L40.4 25.5L40.7 27.7L40.4 29.9L37.5 30.9L36.1 33.3L37.2 36.2L35.5 37.9L32.6 36.8L30.2 38.2L29.2 41.1L27 41.4L24.8 41.1L23.8 38.2L21.4 36.8L18.5 37.9L16.8 36.2L17.9 33.3L16.5 30.9L13.6 29.9L13.3 27.7L13.6 25.5L16.5 24.5L17.9 22.1L16.8 19.2L18.5 17.5L21.4 18.6L23.8 17.2L24.8 14.3Z",strokeWidth:1.5,strokeLinejoin:"round"}),I.jsx("circle",{cx:"27",cy:"27.7",r:"7",strokeWidth:1.5})]}),zxe=Y.createContext({});function EIt(t){const e=Y.useRef(null);return e.current===null&&(e.current=t()),e.current}const IIt=typeof window<"u",BIt=IIt?Y.useLayoutEffect:Y.useEffect,Qz=Y.createContext(null);function wz(t,e){t.indexOf(e)===-1&&t.push(e)}function dR(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const uu=(t,e,n)=>n>e?e:n<t?t:n;let kz=()=>{};const Dm={},Jxe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Wxe(t){return typeof t=="object"&&t!==null}const Zxe=t=>/^0[^.\s]+$/u.test(t);function Vxe(t){let e;return()=>(e===void 0&&(e=t()),e)}const tl=t=>t,yIt=(t,e)=>n=>e(t(n)),Zk=(...t)=>t.reduce(yIt),V0=(t,e,n)=>{const a=e-t;return a===0?1:(n-t)/a};class vz{constructor(){this.subscriptions=[]}add(e){return wz(this.subscriptions,e),()=>dR(this.subscriptions,e)}notify(e,n,a){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,a);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(e,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lc=t=>t*1e3,Vc=t=>t/1e3;function Xxe(t,e){return e?t*(1e3/e):0}const $xe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,QIt=1e-7,wIt=12;function kIt(t,e,n,a,r){let i,o,A=0;do o=e+(n-e)/2,i=$xe(o,a,r)-t,i>0?n=o:e=o;while(Math.abs(i)>QIt&&++A<wIt);return o}function Vk(t,e,n,a){if(t===e&&n===a)return tl;const r=i=>kIt(i,0,1,t,n);return i=>i===0||i===1?i:$xe(r(i),e,a)}const e1e=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,t1e=t=>e=>1-t(1-e),n1e=Vk(.33,1.53,.69,.99),Dz=t1e(n1e),a1e=e1e(Dz),r1e=t=>t>=1?1:(t*=2)<1?.5*Dz(t):.5*(2-Math.pow(2,-10*(t-1))),xz=t=>1-Math.sin(Math.acos(t)),i1e=t1e(xz),o1e=e1e(xz),vIt=Vk(.42,0,1,1),DIt=Vk(0,0,.58,1),A1e=Vk(.42,0,.58,1),xIt=t=>Array.isArray(t)&&typeof t[0]!="number",s1e=t=>Array.isArray(t)&&typeof t[0]=="number",SIt={linear:tl,easeIn:vIt,easeInOut:A1e,easeOut:DIt,circIn:xz,circInOut:o1e,circOut:i1e,backIn:Dz,backInOut:a1e,backOut:n1e,anticipate:r1e},_It=t=>typeof t=="string",pce=t=>{if(s1e(t)){kz(t.length===4);const[e,n,a,r]=t;return Vk(e,n,a,r)}else if(_It(t))return SIt[t];return t},qx=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function RIt(t,e){let n=new Set,a=new Set,r=!1,i=!1;const o=new WeakSet;let A={delta:0,timestamp:0,isProcessing:!1};function s(d){o.has(d)&&(l.schedule(d),t()),d(A)}const l={schedule:(d,u=!1,g=!1)=>{const m=g&&r?n:a;return u&&o.add(d),m.add(d),d},cancel:d=>{a.delete(d),o.delete(d)},process:d=>{if(A=d,r){i=!0;return}r=!0;const u=n;n=a,a=u,n.forEach(s),n.clear(),r=!1,i&&(i=!1,l.process(d))}};return l}const NIt=40;function c1e(t,e){let n=!1,a=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=qx.reduce((y,Q)=>(y[Q]=RIt(i),y),{}),{setup:A,read:s,resolveKeyframes:l,preUpdate:d,update:u,preRender:g,render:p,postRender:m}=o,h=()=>{const y=Dm.useManualTiming,Q=y?r.timestamp:performance.now();n=!1,y||(r.delta=a?1e3/60:Math.max(Math.min(Q-r.timestamp,NIt),1)),r.timestamp=Q,r.isProcessing=!0,A.process(r),s.process(r),l.process(r),d.process(r),u.process(r),g.process(r),p.process(r),m.process(r),r.isProcessing=!1,n&&e&&(a=!1,t(h))},b=()=>{n=!0,a=!0,r.isProcessing||t(h)};return{schedule:qx.reduce((y,Q)=>{const k=o[Q];return y[Q]=(_,v=!1,x=!1)=>(n||b(),k.schedule(_,v,x)),y},{}),cancel:y=>{for(let Q=0;Q<qx.length;Q++)o[qx[Q]].cancel(y)},state:r,steps:o}}const{schedule:_r,cancel:xm,state:Jo,steps:Y9}=c1e(typeof requestAnimationFrame<"u"?requestAnimationFrame:tl,!0);let LS;function MIt(){LS=void 0}const HA={now:()=>(LS===void 0&&HA.set(Jo.isProcessing||Dm.useManualTiming?Jo.timestamp:performance.now()),LS),set:t=>{LS=t,queueMicrotask(MIt)}},l1e=t=>e=>typeof e=="string"&&e.startsWith(t),d1e=l1e("--"),FIt=l1e("var(--"),Sz=t=>FIt(t)?LIt.test(t.split("/*")[0].trim()):!1,LIt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mce(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const mB={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},X0={...mB,transform:t=>uu(0,1,t)},jx={...mB,default:1},$w=t=>Math.round(t*1e5)/1e5,_z=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function TIt(t){return t==null}const GIt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rz=(t,e)=>n=>!!(typeof n=="string"&&GIt.test(n)&&n.startsWith(t)||e&&!TIt(n)&&Object.prototype.hasOwnProperty.call(n,e)),u1e=(t,e,n)=>a=>{if(typeof a!="string")return a;const[r,i,o,A]=a.match(_z);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:A!==void 0?parseFloat(A):1}},OIt=t=>uu(0,255,t),q9={...mB,transform:t=>Math.round(OIt(t))},Df={test:Rz("rgb","red"),parse:u1e("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:a=1})=>"rgba("+q9.transform(t)+", "+q9.transform(e)+", "+q9.transform(n)+", "+$w(X0.transform(a))+")"};function UIt(t){let e="",n="",a="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),a=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),a=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,a+=a,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:r?parseInt(r,16)/255:1}}const f7={test:Rz("#"),parse:UIt,transform:Df.transform},Xk=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Hp=Xk("deg"),ou=Xk("%"),Sn=Xk("px"),PIt=Xk("vh"),KIt=Xk("vw"),hce={...ou,parse:t=>ou.parse(t)/100,transform:t=>ou.transform(t*100)},yE={test:Rz("hsl","hue"),parse:u1e("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:a=1})=>"hsla("+Math.round(t)+", "+ou.transform($w(e))+", "+ou.transform($w(n))+", "+$w(X0.transform(a))+")"},Ki={test:t=>Df.test(t)||f7.test(t)||yE.test(t),parse:t=>Df.test(t)?Df.parse(t):yE.test(t)?yE.parse(t):f7.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Df.transform(t):yE.transform(t),getAnimatableNone:t=>{const e=Ki.parse(t);return e.alpha=0,Ki.transform(e)}},HIt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function YIt(t){return isNaN(t)&&typeof t=="string"&&(t.match(_z)?.length||0)+(t.match(HIt)?.length||0)>0}const g1e="number",p1e="color",qIt="var",jIt="var(",fce="${}",zIt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function xI(t){const e=t.toString(),n=[],a={color:[],number:[],var:[]},r=[];let i=0;const A=e.replace(zIt,s=>(Ki.test(s)?(a.color.push(i),r.push(p1e),n.push(Ki.parse(s))):s.startsWith(jIt)?(a.var.push(i),r.push(qIt),n.push(s)):(a.number.push(i),r.push(g1e),n.push(parseFloat(s))),++i,fce)).split(fce);return{values:n,split:A,indexes:a,types:r}}function JIt(t){return xI(t).values}function m1e({split:t,types:e}){const n=t.length;return a=>{let r="";for(let i=0;i<n;i++)if(r+=t[i],a[i]!==void 0){const o=e[i];o===g1e?r+=$w(a[i]):o===p1e?r+=Ki.transform(a[i]):r+=a[i]}return r}}function WIt(t){return m1e(xI(t))}const ZIt=t=>typeof t=="number"?0:Ki.test(t)?Ki.getAnimatableNone(t):t,VIt=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:ZIt(t);function XIt(t){const e=xI(t);return m1e(e)(e.values.map((a,r)=>VIt(a,e.split[r])))}const Jl={test:YIt,parse:JIt,createTransformer:WIt,getAnimatableNone:XIt};function j9(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $It({hue:t,saturation:e,lightness:n,alpha:a}){t/=360,e/=100,n/=100;let r=0,i=0,o=0;if(!e)r=i=o=n;else{const A=n<.5?n*(1+e):n+e-n*e,s=2*n-A;r=j9(s,A,t+1/3),i=j9(s,A,t),o=j9(s,A,t-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:a}}function uR(t,e){return n=>n>0?e:t}const jr=(t,e,n)=>t+(e-t)*n,z9=(t,e,n)=>{const a=t*t,r=n*(e*e-a)+a;return r<0?0:Math.sqrt(r)},eBt=[f7,Df,yE],tBt=t=>eBt.find(e=>e.test(t));function bce(t){const e=tBt(t);if(!e)return!1;let n=e.parse(t);return e===yE&&(n=$It(n)),n}const Cce=(t,e)=>{const n=bce(t),a=bce(e);if(!n||!a)return uR(t,e);const r={...n};return i=>(r.red=z9(n.red,a.red,i),r.green=z9(n.green,a.green,i),r.blue=z9(n.blue,a.blue,i),r.alpha=jr(n.alpha,a.alpha,i),Df.transform(r))},b7=new Set(["none","hidden"]);function nBt(t,e){return b7.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function aBt(t,e){return n=>jr(t,e,n)}function Nz(t){return typeof t=="number"?aBt:typeof t=="string"?Sz(t)?uR:Ki.test(t)?Cce:oBt:Array.isArray(t)?h1e:typeof t=="object"?Ki.test(t)?Cce:rBt:uR}function h1e(t,e){const n=[...t],a=n.length,r=t.map((i,o)=>Nz(i)(i,e[o]));return i=>{for(let o=0;o<a;o++)n[o]=r[o](i);return n}}function rBt(t,e){const n={...t,...e},a={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(a[r]=Nz(t[r])(t[r],e[r]));return r=>{for(const i in a)n[i]=a[i](r);return n}}function iBt(t,e){const n=[],a={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],o=t.indexes[i][a[i]],A=t.values[o]??0;n[r]=A,a[i]++}return n}const oBt=(t,e)=>{const n=Jl.createTransformer(e),a=xI(t),r=xI(e);return a.indexes.var.length===r.indexes.var.length&&a.indexes.color.length===r.indexes.color.length&&a.indexes.number.length>=r.indexes.number.length?b7.has(t)&&!r.values.length||b7.has(e)&&!a.values.length?nBt(t,e):Zk(h1e(iBt(a,r),r.values),n):uR(t,e)};function f1e(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?jr(t,e,n):Nz(t)(t,e)}const ABt=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>_r.update(e,n),stop:()=>xm(e),now:()=>Jo.isProcessing?Jo.timestamp:HA.now()}},b1e=(t,e,n=10)=>{let a="";const r=Math.max(Math.round(e/n),2);for(let i=0;i<r;i++)a+=Math.round(t(i/(r-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},gR=2e4;function Mz(t){let e=0;const n=50;let a=t.next(e);for(;!a.done&&e<gR;)e+=n,a=t.next(e);return e>=gR?1/0:e}function sBt(t,e=100,n){const a=n({...t,keyframes:[0,e]}),r=Math.min(Mz(a),gR);return{type:"keyframes",ease:i=>a.next(r*i).value/e,duration:Vc(r)}}const fi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function C7(t,e){return t*Math.sqrt(1-e*e)}const cBt=12;function lBt(t,e,n){let a=n;for(let r=1;r<cBt;r++)a=a-t(a)/e(a);return a}const J9=.001;function dBt({duration:t=fi.duration,bounce:e=fi.bounce,velocity:n=fi.velocity,mass:a=fi.mass}){let r,i,o=1-e;o=uu(fi.minDamping,fi.maxDamping,o),t=uu(fi.minDuration,fi.maxDuration,Vc(t)),o<1?(r=l=>{const d=l*o,u=d*t,g=d-n,p=C7(l,o),m=Math.exp(-u);return J9-g/p*m},i=l=>{const u=l*o*t,g=u*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,m=Math.exp(-u),h=C7(Math.pow(l,2),o);return(-r(l)+J9>0?-1:1)*((g-p)*m)/h}):(r=l=>{const d=Math.exp(-l*t),u=(l-n)*t+1;return-J9+d*u},i=l=>{const d=Math.exp(-l*t),u=(n-l)*(t*t);return d*u});const A=5/t,s=lBt(r,i,A);if(t=lc(t),isNaN(s))return{stiffness:fi.stiffness,damping:fi.damping,duration:t};{const l=Math.pow(s,2)*a;return{stiffness:l,damping:o*2*Math.sqrt(a*l),duration:t}}}const uBt=["duration","bounce"],gBt=["stiffness","damping","mass"];function Ece(t,e){return e.some(n=>t[n]!==void 0)}function pBt(t){let e={velocity:fi.velocity,stiffness:fi.stiffness,damping:fi.damping,mass:fi.mass,isResolvedFromDuration:!1,...t};if(!Ece(t,gBt)&&Ece(t,uBt))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,a=2*Math.PI/(n*1.2),r=a*a,i=2*uu(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:fi.mass,stiffness:r,damping:i}}else{const n=dBt({...t,velocity:0});e={...e,...n,mass:fi.mass},e.isResolvedFromDuration=!0}return e}function pR(t=fi.visualDuration,e=fi.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],A={done:!1,value:i},{stiffness:s,damping:l,mass:d,duration:u,velocity:g,isResolvedFromDuration:p}=pBt({...n,velocity:-Vc(n.velocity||0)}),m=g||0,h=l/(2*Math.sqrt(s*d)),b=o-i,C=Vc(Math.sqrt(s/d)),B=Math.abs(b)<5;a||(a=B?fi.restSpeed.granular:fi.restSpeed.default),r||(r=B?fi.restDelta.granular:fi.restDelta.default);let y,Q,k,_,v,x;if(h<1)k=C7(C,h),_=(m+h*C*b)/k,y=L=>{const N=Math.exp(-h*C*L);return o-N*(_*Math.sin(k*L)+b*Math.cos(k*L))},v=h*C*_+b*k,x=h*C*b-_*k,Q=L=>Math.exp(-h*C*L)*(v*Math.sin(k*L)+x*Math.cos(k*L));else if(h===1){y=N=>o-Math.exp(-C*N)*(b+(m+C*b)*N);const L=m+C*b;Q=N=>Math.exp(-C*N)*(C*L*N-m)}else{const L=C*Math.sqrt(h*h-1);y=R=>{const O=Math.exp(-h*C*R),F=Math.min(L*R,300);return o-O*((m+h*C*b)*Math.sinh(F)+L*b*Math.cosh(F))/L};const N=(m+h*C*b)/L,U=h*C*N-b*L,K=h*C*b-N*L;Q=R=>{const O=Math.exp(-h*C*R),F=Math.min(L*R,300);return O*(U*Math.sinh(F)+K*Math.cosh(F))}}const S={calculatedDuration:p&&u||null,velocity:L=>lc(Q(L)),next:L=>{if(!p&&h<1){const U=Math.exp(-h*C*L),K=Math.sin(k*L),R=Math.cos(k*L),O=o-U*(_*K+b*R),F=lc(U*(v*K+x*R));return A.done=Math.abs(F)<=a&&Math.abs(o-O)<=r,A.value=A.done?o:O,A}const N=y(L);if(p)A.done=L>=u;else{const U=lc(Q(L));A.done=Math.abs(U)<=a&&Math.abs(o-N)<=r}return A.value=A.done?o:N,A},toString:()=>{const L=Math.min(Mz(S),gR),N=b1e(U=>S.next(L*U).value,L,30);return L+"ms "+N},toTransition:()=>{}};return S}pR.applyToOptions=t=>{const e=sBt(t,100,pR);return t.ease=e.ease,t.duration=lc(e.duration),t.type="keyframes",t};const mBt=5;function C1e(t,e,n){const a=Math.max(e-mBt,0);return Xxe(n-t(a),e-a)}function E7({keyframes:t,velocity:e=0,power:n=.8,timeConstant:a=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:A,max:s,restDelta:l=.5,restSpeed:d}){const u=t[0],g={done:!1,value:u},p=x=>A!==void 0&&x<A||s!==void 0&&x>s,m=x=>A===void 0?s:s===void 0||Math.abs(A-x)<Math.abs(s-x)?A:s;let h=n*e;const b=u+h,C=o===void 0?b:o(b);C!==b&&(h=C-u);const B=x=>-h*Math.exp(-x/a),y=x=>C+B(x),Q=x=>{const S=B(x),L=y(x);g.done=Math.abs(S)<=l,g.value=g.done?C:L};let k,_;const v=x=>{p(g.value)&&(k=x,_=pR({keyframes:[g.value,m(g.value)],velocity:C1e(y,x,g.value),damping:r,stiffness:i,restDelta:l,restSpeed:d}))};return v(0),{calculatedDuration:null,next:x=>{let S=!1;return!_&&k===void 0&&(S=!0,Q(x),v(x)),k!==void 0&&x>=k?_.next(x-k):(!S&&Q(x),g)}}}function hBt(t,e,n){const a=[],r=n||Dm.mix||f1e,i=t.length-1;for(let o=0;o<i;o++){let A=r(t[o],t[o+1]);if(e){const s=Array.isArray(e)?e[o]||tl:e;A=Zk(s,A)}a.push(A)}return a}function fBt(t,e,{clamp:n=!0,ease:a,mixer:r}={}){const i=t.length;if(kz(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const A=hBt(e,a,r),s=A.length,l=d=>{if(o&&d<t[0])return e[0];let u=0;if(s>1)for(;u<t.length-2&&!(d<t[u+1]);u++);const g=V0(t[u],t[u+1],d);return A[u](g)};return n?d=>l(uu(t[0],t[i-1],d)):l}function bBt(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const r=V0(0,e,a);t.push(jr(n,1,r))}}function CBt(t){const e=[0];return bBt(e,t.length-1),e}function EBt(t,e){return t.map(n=>n*e)}function IBt(t,e){return t.map(()=>e||A1e).splice(0,t.length-1)}function e0({duration:t=300,keyframes:e,times:n,ease:a="easeInOut"}){const r=xIt(a)?a.map(pce):pce(a),i={done:!1,value:e[0]},o=EBt(n&&n.length===e.length?n:CBt(e),t),A=fBt(o,e,{ease:Array.isArray(r)?r:IBt(e,r)});return{calculatedDuration:t,next:s=>(i.value=A(s),i.done=s>=t,i)}}const BBt=t=>t!==null;function JM(t,{repeat:e,repeatType:n="loop"},a,r=1){const i=t.filter(BBt),A=r<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!A||a===void 0?i[A]:a}const yBt={decay:E7,inertia:E7,tween:e0,keyframes:e0,spring:pR};function E1e(t){typeof t.type=="string"&&(t.type=yBt[t.type])}class Fz{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const QBt=t=>t/100;class mR extends Fz{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==HA.now()&&this.tick(HA.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;E1e(e);const{type:n=e0,repeat:a=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:A}=e;const s=n||e0;s!==e0&&typeof A[0]!="number"&&(this.mixKeyframes=Zk(QBt,f1e(A[0],A[1])),A=[0,100]);const l=s({...e,keyframes:A});i==="mirror"&&(this.mirroredGenerator=s({...e,keyframes:[...A].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Mz(l));const{calculatedDuration:d}=l;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(a+1)-r,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:a,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:A,calculatedDuration:s}=this;if(this.startTime===null)return a.next(0);const{delay:l=0,keyframes:d,repeat:u,repeatType:g,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-l*(this.playbackSpeed>=0?1:-1),B=this.playbackSpeed>=0?C<0:C>r;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,Q=a;if(u){const x=Math.min(this.currentTime,r)/A;let S=Math.floor(x),L=x%1;!L&&x>=1&&(L=1),L===1&&S--,S=Math.min(S,u+1),!!(S%2)&&(g==="reverse"?(L=1-L,p&&(L-=p/A)):g==="mirror"&&(Q=o)),y=uu(0,1,L)*A}let k;B?(this.delayState.value=d[0],k=this.delayState):k=Q.next(y),i&&!B&&(k.value=i(k.value));let{done:_}=k;!B&&s!==null&&(_=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const v=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return v&&m!==E7&&(k.value=JM(d,this.options,b,this.speed)),h&&h(k.value),v&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return Vc(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vc(e)}get time(){return Vc(this.currentTime)}set time(e){e=lc(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return C1e(a=>this.generator.next(a).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(HA.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Vc(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=ABt,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(HA.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function wBt(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const xf=t=>t*180/Math.PI,I7=t=>{const e=xf(Math.atan2(t[1],t[0]));return B7(e)},kBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:I7,rotateZ:I7,skewX:t=>xf(Math.atan(t[1])),skewY:t=>xf(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},B7=t=>(t=t%360,t<0&&(t+=360),t),Ice=I7,Bce=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),yce=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bce,scaleY:yce,scale:t=>(Bce(t)+yce(t))/2,rotateX:t=>B7(xf(Math.atan2(t[6],t[5]))),rotateY:t=>B7(xf(Math.atan2(-t[2],t[0]))),rotateZ:Ice,rotate:Ice,skewX:t=>xf(Math.atan(t[4])),skewY:t=>xf(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function y7(t){return t.includes("scale")?1:0}function Q7(t,e){if(!t||t==="none")return y7(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,r;if(n)a=vBt,r=n;else{const A=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=kBt,r=A}if(!r)return y7(e);const i=a[e],o=r[1].split(",").map(xBt);return typeof i=="function"?i(o):o[i]}const DBt=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Q7(n,e)};function xBt(t){return parseFloat(t.trim())}const hB=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fB=new Set(hB),Qce=t=>t===mB||t===Sn,SBt=new Set(["x","y","z"]),_Bt=hB.filter(t=>!SBt.has(t));function RBt(t){const e=[];return _Bt.forEach(n=>{const a=t.getValue(n);a!==void 0&&(e.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),e}const nm={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:a})=>{const r=t.max-t.min;return a==="border-box"?r:r-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:a})=>{const r=t.max-t.min;return a==="border-box"?r:r-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Q7(e,"x"),y:(t,{transform:e})=>Q7(e,"y")};nm.translateX=nm.x;nm.translateY=nm.y;const Gf=new Set;let w7=!1,k7=!1,v7=!1;function I1e(){if(k7){const t=Array.from(Gf).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),n=new Map;e.forEach(a=>{const r=RBt(a);r.length&&(n.set(a,r),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const r=n.get(a);r&&r.forEach(([i,o])=>{a.getValue(i)?.set(o)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}k7=!1,w7=!1,Gf.forEach(t=>t.complete(v7)),Gf.clear()}function B1e(){Gf.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(k7=!0)})}function NBt(){v7=!0,B1e(),I1e(),v7=!1}class Lz{constructor(e,n,a,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=a,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Gf.add(this),w7||(w7=!0,_r.read(B1e),_r.resolveKeyframes(I1e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:a,motionValue:r}=this;if(e[0]===null){const i=r?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(a&&n){const A=a.readValue(n,o);A!=null&&(e[0]=A)}e[0]===void 0&&(e[0]=o),r&&i===void 0&&r.set(e[0])}wBt(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Gf.delete(this)}cancel(){this.state==="scheduled"&&(Gf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const MBt=t=>t.startsWith("--");function y1e(t,e,n){MBt(e)?t.style.setProperty(e,n):t.style[e]=n}const FBt={};function Q1e(t,e){const n=Vxe(t);return()=>FBt[e]??n()}const LBt=Q1e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),w1e=Q1e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zQ=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,wce={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zQ([0,.65,.55,1]),circOut:zQ([.55,0,1,.45]),backIn:zQ([.31,.01,.66,-.59]),backOut:zQ([.33,1.53,.69,.99])};function k1e(t,e){if(t)return typeof t=="function"?w1e()?b1e(t,e):"ease-out":s1e(t)?zQ(t):Array.isArray(t)?t.map(n=>k1e(n,e)||wce.easeOut):wce[t]}function TBt(t,e,n,{delay:a=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:A="easeOut",times:s}={},l=void 0){const d={[e]:n};s&&(d.offset=s);const u=k1e(A,r);Array.isArray(u)&&(d.easing=u);const g={delay:a,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(g.pseudoElement=l),t.animate(d,g)}function v1e(t){return typeof t=="function"&&"applyToOptions"in t}function GBt({type:t,...e}){return v1e(t)&&w1e()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class D1e extends Fz{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:a,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:A,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,kz(typeof e.type!="string");const l=GBt(e);this.animation=TBt(n,a,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=JM(r,this.options,A,this.speed);this.updateMotionValue&&this.updateMotionValue(d),y1e(n,a,d),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Vc(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vc(e)}get time(){return Vc(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lc(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:a,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&LBt()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),tl):r(this)}}const x1e={anticipate:r1e,backInOut:a1e,circInOut:o1e};function OBt(t){return t in x1e}function UBt(t){typeof t.ease=="string"&&OBt(t.ease)&&(t.ease=x1e[t.ease])}const W9=10;class PBt extends D1e{constructor(e){UBt(e),E1e(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:a,onComplete:r,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const A=new mR({...o,autoplay:!1}),s=Math.max(W9,HA.now()-this.startTime),l=uu(0,W9,s-W9),d=A.sample(s).value,{name:u}=this.options;i&&u&&y1e(i,u,d),n.setWithVelocity(A.sample(Math.max(0,s-l)).value,d,l),A.stop()}}const kce=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Jl.test(t)||t==="0")&&!t.startsWith("url("));function KBt(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function HBt(t,e,n,a){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=kce(r,e),A=kce(i,e);return!o||!A?!1:KBt(t)||(n==="spring"||v1e(n))&&a}function D7(t){t.duration=0,t.type="keyframes"}const S1e=new Set(["opacity","clipPath","filter","transform"]),YBt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function qBt(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&YBt.test(t[e]))return!0;return!1}const jBt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),zBt=Vxe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function JBt(t){const{motionValue:e,name:n,repeatDelay:a,repeatType:r,damping:i,type:o,keyframes:A}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:d}=e.owner.getProps();return zBt()&&n&&(S1e.has(n)||jBt.has(n)&&qBt(A))&&(n!=="transform"||!d)&&!l&&!a&&r!=="mirror"&&i!==0&&o!=="inertia"}const WBt=40;class ZBt extends Fz{constructor({autoplay:e=!0,delay:n=0,type:a="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:A,name:s,motionValue:l,element:d,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=HA.now();const g={autoplay:e,delay:n,type:a,repeat:r,repeatDelay:i,repeatType:o,name:s,motionValue:l,element:d,...u},p=d?.KeyframeResolver||Lz;this.keyframeResolver=new p(A,(m,h,b)=>this.onKeyframesResolved(m,h,g,!b),s,l,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,a,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:A,delay:s,isHandoff:l,onUpdate:d}=a;this.resolvedAt=HA.now();let u=!0;HBt(e,i,o,A)||(u=!1,(Dm.instantAnimations||!s)&&d?.(JM(e,a,n)),e[0]=e[e.length-1],D7(a),a.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>WBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:e},m=u&&!l&&JBt(p),h=p.motionValue?.owner?.current;let b;if(m)try{b=new PBt({...p,element:h})}catch{b=new mR(p)}else b=new mR(p);b.finished.then(()=>{this.notifyFinished()}).catch(tl),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),NBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _1e(t,e,n,a=0,r=1){const i=Array.from(t).sort((l,d)=>l.sortNodePosition(d)).indexOf(e),o=t.size,A=(o-1)*a;return typeof n=="function"?n(i,o):r===1?i*a:A-i*a}const VBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XBt(t){const e=VBt.exec(t);if(!e)return[,];const[,n,a,r]=e;return[`--${n??a}`,r]}function R1e(t,e,n=1){const[a,r]=XBt(t);if(!a)return;const i=window.getComputedStyle(e).getPropertyValue(a);if(i){const o=i.trim();return Jxe(o)?parseFloat(o):o}return Sz(r)?R1e(r,e,n+1):r}const $Bt={type:"spring",stiffness:500,damping:25,restSpeed:10},eyt=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),tyt={type:"keyframes",duration:.8},nyt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ayt=(t,{keyframes:e})=>e.length>2?tyt:fB.has(t)?t.startsWith("scale")?eyt(e[1]):$Bt:nyt;function N1e(t,e){if(t?.inherit&&e){const{inherit:n,...a}=t;return{...e,...a}}return t}function Tz(t,e){const n=t?.[e]??t?.default??t;return n!==t?N1e(n,t):n}const ryt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function iyt(t){for(const e in t)if(!ryt.has(e))return!0;return!1}const Gz=(t,e,n,a={},r,i)=>o=>{const A=Tz(a,t)||{},s=A.delay||a.delay||0;let{elapsed:l=0}=a;l=l-lc(s);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...A,delay:-l,onUpdate:g=>{e.set(g),A.onUpdate&&A.onUpdate(g)},onComplete:()=>{o(),A.onComplete&&A.onComplete()},name:t,motionValue:e,element:i?void 0:r};iyt(A)||Object.assign(d,ayt(t,d)),d.duration&&(d.duration=lc(d.duration)),d.repeatDelay&&(d.repeatDelay=lc(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(D7(d),d.delay===0&&(u=!0)),(Dm.instantAnimations||Dm.skipAnimations||r?.shouldSkipAnimations)&&(u=!0,D7(d),d.delay=0),d.allowFlatten=!A.type&&!A.ease,u&&!i&&e.get()!==void 0){const g=JM(d.keyframes,A);if(g!==void 0){_r.update(()=>{d.onUpdate(g),d.onComplete()});return}}return A.isSync?new mR(d):new ZBt(d)};function vce(t){const e=[{},{}];return t?.values.forEach((n,a)=>{e[0][a]=n.get(),e[1][a]=n.getVelocity()}),e}function Oz(t,e,n,a){if(typeof e=="function"){const[r,i]=vce(a);e=e(n!==void 0?n:t.custom,r,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,i]=vce(a);e=e(n!==void 0?n:t.custom,r,i)}return e}function Of(t,e,n){const a=t.getProps();return Oz(a,e,n!==void 0?n:a.custom,t)}const M1e=new Set(["width","height","top","left","right","bottom",...hB]),Dce=30,oyt=t=>!isNaN(parseFloat(t));class Ayt{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const r=HA.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=HA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=oyt(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new vz);const a=this.events[e].add(n);return e==="change"?()=>{a(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=HA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Dce)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Dce);return Xxe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function SI(t,e){return new Ayt(t,e)}const x7=t=>Array.isArray(t);function syt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,SI(n))}function cyt(t){return x7(t)?t[t.length-1]||0:t}function lyt(t,e){const n=Of(t,e);let{transitionEnd:a={},transition:r={},...i}=n||{};i={...i,...a};for(const o in i){const A=cyt(i[o]);syt(t,o,A)}}const Xo=t=>!!(t&&t.getVelocity);function dyt(t){return!!(Xo(t)&&t.add)}function S7(t,e){const n=t.getValue("willChange");if(dyt(n))return n.add(e);if(!n&&Dm.WillChange){const a=new Dm.WillChange("auto");t.addValue("willChange",a),a.add(e)}}function Uz(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const uyt="framerAppearId",F1e="data-"+Uz(uyt);function L1e(t){return t.props[F1e]}function gyt({protectedKeys:t,needsAnimating:e},n){const a=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,a}function T1e(t,e,{delay:n=0,transitionOverride:a,type:r}={}){let{transition:i,transitionEnd:o,...A}=e;const s=t.getDefaultTransition();i=i?N1e(i,s):s;const l=i?.reduceMotion;a&&(i=a);const d=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const g in A){const p=t.getValue(g,t.latestValues[g]??null),m=A[g];if(m===void 0||u&&gyt(u,g))continue;const h={delay:n,...Tz(i||{},g)},b=p.get();if(b!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===b&&!h.velocity){_r.update(()=>p.set(m));continue}let C=!1;if(window.MotionHandoffAnimation){const Q=L1e(t);if(Q){const k=window.MotionHandoffAnimation(Q,g,_r);k!==null&&(h.startTime=k,C=!0)}}S7(t,g);const B=l??t.shouldReduceMotion;p.start(Gz(g,p,m,B&&M1e.has(g)?{type:!1}:h,t,C));const y=p.animation;y&&d.push(y)}if(o){const g=()=>_r.update(()=>{o&&lyt(t,o)});d.length?Promise.all(d).then(g):g()}return d}function _7(t,e,n={}){const a=Of(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(r=n.transitionOverride);const i=a?()=>Promise.all(T1e(t,a,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:u}=r;return pyt(t,e,s,l,d,u,n)}:()=>Promise.resolve(),{when:A}=r;if(A){const[s,l]=A==="beforeChildren"?[i,o]:[o,i];return s().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function pyt(t,e,n=0,a=0,r=0,i=1,o){const A=[];for(const s of t.variantChildren)s.notify("AnimationStart",e),A.push(_7(s,e,{...o,delay:n+(typeof a=="function"?0:a)+_1e(t.variantChildren,s,a,r,i)}).then(()=>s.notify("AnimationComplete",e)));return Promise.all(A)}function myt(t,e,n={}){t.notify("AnimationStart",e);let a;if(Array.isArray(e)){const r=e.map(i=>_7(t,i,n));a=Promise.all(r)}else if(typeof e=="string")a=_7(t,e,n);else{const r=typeof e=="function"?Of(t,e,n.custom):e;a=Promise.all(T1e(t,r,n))}return a.then(()=>{t.notify("AnimationComplete",e)})}const hyt={test:t=>t==="auto",parse:t=>t},G1e=t=>e=>e.test(t),O1e=[mB,Sn,ou,Hp,KIt,PIt,hyt],xce=t=>O1e.find(G1e(t));function fyt(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Zxe(t):!0}const byt=new Set(["brightness","contrast","saturate","opacity"]);function Cyt(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=n.match(_z)||[];if(!a)return t;const r=n.replace(a,"");let i=byt.has(e)?1:0;return a!==n&&(i*=100),e+"("+i+r+")"}const Eyt=/\b([a-z-]*)\(.*?\)/gu,R7={...Jl,getAnimatableNone:t=>{const e=t.match(Eyt);return e?e.map(Cyt).join(" "):t}},N7={...Jl,getAnimatableNone:t=>{const e=Jl.parse(t);return Jl.createTransformer(t)(e.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},Sce={...mB,transform:Math.round},Iyt={rotate:Hp,rotateX:Hp,rotateY:Hp,rotateZ:Hp,scale:jx,scaleX:jx,scaleY:jx,scaleZ:jx,skew:Hp,skewX:Hp,skewY:Hp,distance:Sn,translateX:Sn,translateY:Sn,translateZ:Sn,x:Sn,y:Sn,z:Sn,perspective:Sn,transformPerspective:Sn,opacity:X0,originX:hce,originY:hce,originZ:Sn},Pz={borderWidth:Sn,borderTopWidth:Sn,borderRightWidth:Sn,borderBottomWidth:Sn,borderLeftWidth:Sn,borderRadius:Sn,borderTopLeftRadius:Sn,borderTopRightRadius:Sn,borderBottomRightRadius:Sn,borderBottomLeftRadius:Sn,width:Sn,maxWidth:Sn,height:Sn,maxHeight:Sn,top:Sn,right:Sn,bottom:Sn,left:Sn,inset:Sn,insetBlock:Sn,insetBlockStart:Sn,insetBlockEnd:Sn,insetInline:Sn,insetInlineStart:Sn,insetInlineEnd:Sn,padding:Sn,paddingTop:Sn,paddingRight:Sn,paddingBottom:Sn,paddingLeft:Sn,paddingBlock:Sn,paddingBlockStart:Sn,paddingBlockEnd:Sn,paddingInline:Sn,paddingInlineStart:Sn,paddingInlineEnd:Sn,margin:Sn,marginTop:Sn,marginRight:Sn,marginBottom:Sn,marginLeft:Sn,marginBlock:Sn,marginBlockStart:Sn,marginBlockEnd:Sn,marginInline:Sn,marginInlineStart:Sn,marginInlineEnd:Sn,fontSize:Sn,backgroundPositionX:Sn,backgroundPositionY:Sn,...Iyt,zIndex:Sce,fillOpacity:X0,strokeOpacity:X0,numOctaves:Sce},Byt={...Pz,color:Ki,backgroundColor:Ki,outlineColor:Ki,fill:Ki,stroke:Ki,borderColor:Ki,borderTopColor:Ki,borderRightColor:Ki,borderBottomColor:Ki,borderLeftColor:Ki,filter:R7,WebkitFilter:R7,mask:N7,WebkitMask:N7},U1e=t=>Byt[t],yyt=new Set([R7,N7]);function P1e(t,e){let n=U1e(t);return yyt.has(n)||(n=Jl),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Qyt=new Set(["auto","none","0"]);function wyt(t,e,n){let a=0,r;for(;a<t.length&&!r;){const i=t[a];typeof i=="string"&&!Qyt.has(i)&&xI(i).values.length&&(r=t[a]),a++}if(r&&n)for(const i of e)t[i]=P1e(n,r)}class kyt extends Lz{constructor(e,n,a,r,i){super(e,n,a,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let u=e[d];if(typeof u=="string"&&(u=u.trim(),Sz(u))){const g=R1e(u,n.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!M1e.has(a)||e.length!==2)return;const[r,i]=e,o=xce(r),A=xce(i),s=mce(r),l=mce(i);if(s!==l&&nm[a]){this.needsMeasurement=!0;return}if(o!==A)if(Qce(o)&&Qce(A))for(let d=0;d<e.length;d++){const u=e[d];typeof u=="string"&&(e[d]=parseFloat(u))}else nm[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,a=[];for(let r=0;r<e.length;r++)(e[r]===null||fyt(e[r]))&&a.push(r);a.length&&wyt(e,a,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nm[a](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(a,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=a.length-1,o=a[i];a[i]=nm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([A,s])=>{e.getValue(A).set(s)}),this.resolveNoneKeyframes()}}function K1e(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let a=document;const r=n?.[t]??a.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(a=>a!=null)}const H1e=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function vyt(t){return Wxe(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Kz}=c1e(queueMicrotask,!1),vl={x:!1,y:!1};function Y1e(){return vl.x||vl.y}function Dyt(t){return t==="x"||t==="y"?vl[t]?null:(vl[t]=!0,()=>{vl[t]=!1}):vl.x||vl.y?null:(vl.x=vl.y=!0,()=>{vl.x=vl.y=!1})}function q1e(t,e){const n=K1e(t),a=new AbortController,r={passive:!0,...e,signal:a.signal};return[n,r,()=>a.abort()]}function xyt(t){return!(t.pointerType==="touch"||Y1e())}function Syt(t,e,n={}){const[a,r,i]=q1e(t,n);return a.forEach(o=>{let A=!1,s=!1,l;const d=()=>{o.removeEventListener("pointerleave",m)},u=b=>{l&&(l(b),l=void 0),d()},g=b=>{A=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),s&&(s=!1,u(b))},p=()=>{A=!0,window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",g,r)},m=b=>{if(b.pointerType!=="touch"){if(A){s=!0;return}u(b)}},h=b=>{if(!xyt(b))return;s=!1;const C=e(o,b);typeof C=="function"&&(l=C,o.addEventListener("pointerleave",m,r))};o.addEventListener("pointerenter",h,r),o.addEventListener("pointerdown",p,r)}),i}const j1e=(t,e)=>e?t===e?!0:j1e(t,e.parentElement):!1,Hz=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_yt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ryt(t){return _yt.has(t.tagName)||t.isContentEditable===!0}const Nyt=new Set(["INPUT","SELECT","TEXTAREA"]);function Myt(t){return Nyt.has(t.tagName)||t.isContentEditable===!0}const TS=new WeakSet;function _ce(t){return e=>{e.key==="Enter"&&t(e)}}function Z9(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Fyt=(t,e)=>{const n=t.currentTarget;if(!n)return;const a=_ce(()=>{if(TS.has(n))return;Z9(n,"down");const r=_ce(()=>{Z9(n,"up")}),i=()=>Z9(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",a,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),e)};function Rce(t){return Hz(t)&&!Y1e()}const Nce=new WeakSet;function Lyt(t,e,n={}){const[a,r,i]=q1e(t,n),o=A=>{const s=A.currentTarget;if(!Rce(A)||Nce.has(A))return;TS.add(s),n.stopPropagation&&Nce.add(A);const l=e(s,A),d=(p,m)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",g),TS.has(s)&&TS.delete(s),Rce(p)&&typeof l=="function"&&l(p,{success:m})},u=p=>{d(p,s===window||s===document||n.useGlobalTarget||j1e(s,p.target))},g=p=>{d(p,!1)};window.addEventListener("pointerup",u,r),window.addEventListener("pointercancel",g,r)};return a.forEach(A=>{(n.useGlobalTarget?window:A).addEventListener("pointerdown",o,r),vyt(A)&&(A.addEventListener("focus",l=>Fyt(l,r)),!Ryt(A)&&!A.hasAttribute("tabindex")&&(A.tabIndex=0))}),i}function Yz(t){return Wxe(t)&&"ownerSVGElement"in t}const GS=new WeakMap;let OS;const z1e=(t,e,n)=>(a,r)=>r&&r[0]?r[0][t+"Size"]:Yz(a)&&"getBBox"in a?a.getBBox()[e]:a[n],Tyt=z1e("inline","width","offsetWidth"),Gyt=z1e("block","height","offsetHeight");function Oyt({target:t,borderBoxSize:e}){GS.get(t)?.forEach(n=>{n(t,{get width(){return Tyt(t,e)},get height(){return Gyt(t,e)}})})}function Uyt(t){t.forEach(Oyt)}function Pyt(){typeof ResizeObserver>"u"||(OS=new ResizeObserver(Uyt))}function Kyt(t,e){OS||Pyt();const n=K1e(t);return n.forEach(a=>{let r=GS.get(a);r||(r=new Set,GS.set(a,r)),r.add(e),OS?.observe(a)}),()=>{n.forEach(a=>{const r=GS.get(a);r?.delete(e),r?.size||OS?.unobserve(a)})}}const US=new Set;let QE;function Hyt(){QE=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};US.forEach(e=>e(t))},window.addEventListener("resize",QE)}function Yyt(t){return US.add(t),QE||Hyt(),()=>{US.delete(t),!US.size&&typeof QE=="function"&&(window.removeEventListener("resize",QE),QE=void 0)}}function Mce(t,e){return typeof t=="function"?Yyt(t):Kyt(t,e)}function qyt(t){return Yz(t)&&t.tagName==="svg"}const jyt=[...O1e,Ki,Jl],zyt=t=>jyt.find(G1e(t)),Fce=()=>({translate:0,scale:1,origin:0,originPoint:0}),wE=()=>({x:Fce(),y:Fce()}),Lce=()=>({min:0,max:0}),oo=()=>({x:Lce(),y:Lce()}),Jyt=new WeakMap;function WM(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $0(t){return typeof t=="string"||Array.isArray(t)}const qz=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jz=["initial",...qz];function ZM(t){return WM(t.animate)||jz.some(e=>$0(t[e]))}function J1e(t){return!!(ZM(t)||t.variants)}function Wyt(t,e,n){for(const a in e){const r=e[a],i=n[a];if(Xo(r))t.addValue(a,r);else if(Xo(i))t.addValue(a,SI(r,{owner:t}));else if(i!==r)if(t.hasValue(a)){const o=t.getValue(a);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(a);t.addValue(a,SI(o!==void 0?o:r,{owner:t}))}}for(const a in n)e[a]===void 0&&t.removeValue(a);return e}const M7={current:null},W1e={current:!1},Zyt=typeof window<"u";function Vyt(){if(W1e.current=!0,!!Zyt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>M7.current=t.matches;t.addEventListener("change",e),e()}else M7.current=!1}const Tce=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hR={};function Z1e(t){hR=t}function Xyt(){return hR}class $yt{scrapeMotionValuesFromProps(e,n,a){return{}}constructor({parent:e,props:n,presenceContext:a,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,visualState:A},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Lz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=HA.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,_r.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=A;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=a,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!o,this.isControllingVariants=ZM(n),this.isVariantNode=J1e(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in g){const m=g[p];l[p]!==void 0&&Xo(m)&&m.set(l[p])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,Jyt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(W1e.current||Vyt(),this.shouldReduceMotion=M7.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),xm(this.notifyUpdate),xm(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&S1e.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:A,times:s,ease:l,duration:d}=n.accelerate,u=new D1e({element:this.current,name:e,keyframes:A,times:s,ease:l,duration:lc(d)}),g=o(u);this.valueSubscriptions.set(e,()=>{g(),u.cancel()});return}const a=fB.has(e);a&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&_r.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in hR){const n=hR[e];if(!n)continue;const{isEnabled:a,Feature:r}=n;if(!this.features[e]&&r&&a(this.props)&&(this.features[e]=new r(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):oo()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<Tce.length;a++){const r=Tce[a];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=e[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Wyt(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const a=this.values.get(e);n!==a&&(a&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let a=this.values.get(e);return a===void 0&&n!==void 0&&(a=SI(n===null?void 0:n,{owner:this}),this.addValue(e,a)),a}readValue(e,n){let a=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return a!=null&&(typeof a=="string"&&(Jxe(a)||Zxe(a))?a=parseFloat(a):!zyt(a)&&Jl.test(n)&&(a=P1e(e,n)),this.setBaseTarget(e,Xo(a)?a.get():a)),Xo(a)?a.get():a}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const i=Oz(this.props,n,this.presenceContext?.custom);i&&(a=i[e])}if(n&&a!==void 0)return a;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Xo(r)?r:this.initialValues[e]!==void 0&&a===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new vz),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Kz.render(this.render)}}class V1e extends $yt{constructor(){super(...arguments),this.KeyframeResolver=kyt}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const a=e.style;return a?a[n]:void 0}removeValueFromRenderState(e,{vars:n,style:a}){delete n[e],delete a[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xo(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xm{constructor(e){this.isMounted=!1,this.node=e}update(){}}function X1e({top:t,left:e,right:n,bottom:a}){return{x:{min:e,max:n},y:{min:t,max:a}}}function eQt({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function tQt(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),a=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function V9(t){return t===void 0||t===1}function F7({scale:t,scaleX:e,scaleY:n}){return!V9(t)||!V9(e)||!V9(n)}function Af(t){return F7(t)||$1e(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function $1e(t){return Gce(t.x)||Gce(t.y)}function Gce(t){return t&&t!=="0%"}function fR(t,e,n){const a=t-n,r=e*a;return n+r}function Oce(t,e,n,a,r){return r!==void 0&&(t=fR(t,r,a)),fR(t,n,a)+e}function L7(t,e=0,n=1,a,r){t.min=Oce(t.min,e,n,a,r),t.max=Oce(t.max,e,n,a,r)}function eSe(t,{x:e,y:n}){L7(t.x,e.translate,e.scale,e.originPoint),L7(t.y,n.translate,n.scale,n.originPoint)}const Uce=.999999999999,Pce=1.0000000000001;function nQt(t,e,n,a=!1){const r=n.length;if(!r)return;e.x=e.y=1;let i,o;for(let A=0;A<r;A++){i=n[A],o=i.projectionDelta;const{visualElement:s}=i.options;s&&s.props.style&&s.props.style.display==="contents"||(a&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Hd(t.x,-i.scroll.offset.x),Hd(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,eSe(t,o)),a&&Af(i.latestValues)&&PS(t,i.latestValues,i.layout?.layoutBox))}e.x<Pce&&e.x>Uce&&(e.x=1),e.y<Pce&&e.y>Uce&&(e.y=1)}function Hd(t,e){t.min+=e,t.max+=e}function Kce(t,e,n,a,r=.5){const i=jr(t.min,t.max,r);L7(t,e,n,i,a)}function Hce(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function PS(t,e,n){const a=n??t;Kce(t.x,Hce(e.x,a.x),e.scaleX,e.scale,e.originX),Kce(t.y,Hce(e.y,a.y),e.scaleY,e.scale,e.originY)}function tSe(t,e){return X1e(tQt(t.getBoundingClientRect(),e))}function aQt(t,e,n){const a=tSe(t,n),{scroll:r}=e;return r&&(Hd(a.x,r.offset.x),Hd(a.y,r.offset.y)),a}const rQt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iQt=hB.length;function oQt(t,e,n){let a="",r=!0;for(let i=0;i<iQt;i++){const o=hB[i],A=t[o];if(A===void 0)continue;let s=!0;if(typeof A=="number")s=A===(o.startsWith("scale")?1:0);else{const l=parseFloat(A);s=o.startsWith("scale")?l===1:l===0}if(!s||n){const l=H1e(A,Pz[o]);if(!s){r=!1;const d=rQt[o]||o;a+=`${d}(${l}) `}n&&(e[o]=l)}}return a=a.trim(),n?a=n(e,r?"":a):r&&(a="none"),a}function zz(t,e,n){const{style:a,vars:r,transformOrigin:i}=t;let o=!1,A=!1;for(const s in e){const l=e[s];if(fB.has(s)){o=!0;continue}else if(d1e(s)){r[s]=l;continue}else{const d=H1e(l,Pz[s]);s.startsWith("origin")?(A=!0,i[s]=d):a[s]=d}}if(e.transform||(o||n?a.transform=oQt(e,t.transform,n):a.transform&&(a.transform="none")),A){const{originX:s="50%",originY:l="50%",originZ:d=0}=i;a.transformOrigin=`${s} ${l} ${d}`}}function nSe(t,{style:e,vars:n},a,r){const i=t.style;let o;for(o in e)i[o]=e[o];r?.applyProjectionStyles(i,a);for(o in n)i.setProperty(o,n[o])}function Yce(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const CQ={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Sn.test(t))t=parseFloat(t);else return t;const n=Yce(t,e.target.x),a=Yce(t,e.target.y);return`${n}% ${a}%`}},AQt={correct:(t,{treeScale:e,projectionDelta:n})=>{const a=t,r=Jl.parse(t);if(r.length>5)return a;const i=Jl.createTransformer(t),o=typeof r[0]!="number"?1:0,A=n.x.scale*e.x,s=n.y.scale*e.y;r[0+o]/=A,r[1+o]/=s;const l=jr(A,s,.5);return typeof r[2+o]=="number"&&(r[2+o]/=l),typeof r[3+o]=="number"&&(r[3+o]/=l),i(r)}},T7={borderRadius:{...CQ,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:CQ,borderTopRightRadius:CQ,borderBottomLeftRadius:CQ,borderBottomRightRadius:CQ,boxShadow:AQt};function aSe(t,{layout:e,layoutId:n}){return fB.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!T7[t]||t==="opacity")}function Jz(t,e,n){const a=t.style,r=e?.style,i={};if(!a)return i;for(const o in a)(Xo(a[o])||r&&Xo(r[o])||aSe(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=a[o]);return i}function sQt(t){return window.getComputedStyle(t)}class cQt extends V1e{constructor(){super(...arguments),this.type="html",this.renderInstance=nSe}readValueFromInstance(e,n){if(fB.has(n))return this.projection?.isProjecting?y7(n):DBt(e,n);{const a=sQt(e),r=(d1e(n)?a.getPropertyValue(n):a[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return tSe(e,n)}build(e,n,a){zz(e,n,a.transformTemplate)}scrapeMotionValuesFromProps(e,n,a){return Jz(e,n,a)}}const lQt={offset:"stroke-dashoffset",array:"stroke-dasharray"},dQt={offset:"strokeDashoffset",array:"strokeDasharray"};function uQt(t,e,n=1,a=0,r=!0){t.pathLength=1;const i=r?lQt:dQt;t[i.offset]=`${-a}`,t[i.array]=`${e} ${n}`}const gQt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rSe(t,{attrX:e,attrY:n,attrScale:a,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...A},s,l,d){if(zz(t,A,l),s){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:u,style:g}=t;u.transform&&(g.transform=u.transform,delete u.transform),(g.transform||u.transformOrigin)&&(g.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),g.transform&&(g.transformBox=d?.transformBox??"fill-box",delete u.transformBox);for(const p of gQt)u[p]!==void 0&&(g[p]=u[p],delete u[p]);e!==void 0&&(u.x=e),n!==void 0&&(u.y=n),a!==void 0&&(u.scale=a),r!==void 0&&uQt(u,r,i,o,!1)}const iSe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),oSe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function pQt(t,e,n,a){nSe(t,e,void 0,a);for(const r in e.attrs)t.setAttribute(iSe.has(r)?r:Uz(r),e.attrs[r])}function ASe(t,e,n){const a=Jz(t,e,n);for(const r in t)if(Xo(t[r])||Xo(e[r])){const i=hB.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;a[i]=t[r]}return a}class mQt extends V1e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=oo}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(fB.has(n)){const a=U1e(n);return a&&a.default||0}return n=iSe.has(n)?n:Uz(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,a){return ASe(e,n,a)}build(e,n,a){rSe(e,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(e,n,a,r){pQt(e,n,a,r)}mount(e){this.isSVGTag=oSe(e.tagName),super.mount(e)}}const hQt=jz.length;function sSe(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?sSe(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<hQt;n++){const a=jz[n],r=t.props[a];($0(r)||r===!1)&&(e[a]=r)}return e}function cSe(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let a=0;a<n;a++)if(e[a]!==t[a])return!1;return!0}const fQt=[...qz].reverse(),bQt=qz.length;function CQt(t){return e=>Promise.all(e.map(({animation:n,options:a})=>myt(t,n,a)))}function EQt(t){let e=CQt(t),n=qce(),a=!0,r=!1;const i=l=>(d,u)=>{const g=Of(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:p,transitionEnd:m,...h}=g;d={...d,...h,...m}}return d};function o(l){e=l(t)}function A(l){const{props:d}=t,u=sSe(t.parent)||{},g=[],p=new Set;let m={},h=1/0;for(let C=0;C<bQt;C++){const B=fQt[C],y=n[B],Q=d[B]!==void 0?d[B]:u[B],k=$0(Q),_=B===l?y.isActive:null;_===!1&&(h=C);let v=Q===u[B]&&Q!==d[B]&&k;if(v&&(a||r)&&t.manuallyAnimateOnMount&&(v=!1),y.protectedKeys={...m},!y.isActive&&_===null||!Q&&!y.prevProp||WM(Q)||typeof Q=="boolean")continue;if(B==="exit"&&y.isActive&&_!==!0){y.prevResolvedValues&&(m={...m,...y.prevResolvedValues});continue}const x=IQt(y.prevProp,Q);let S=x||B===l&&y.isActive&&!v&&k||C>h&&k,L=!1;const N=Array.isArray(Q)?Q:[Q];let U=N.reduce(i(B),{});_===!1&&(U={});const{prevResolvedValues:K={}}=y,R={...K,...U},O=G=>{S=!0,p.has(G)&&(L=!0,p.delete(G)),y.needsAnimating[G]=!0;const H=t.getValue(G);H&&(H.liveStyle=!1)};for(const G in R){const H=U[G],q=K[G];if(m.hasOwnProperty(G))continue;let P=!1;x7(H)&&x7(q)?P=!cSe(H,q):P=H!==q,P?H!=null?O(G):p.add(G):H!==void 0&&p.has(G)?O(G):y.protectedKeys[G]=!0}y.prevProp=Q,y.prevResolvedValues=U,y.isActive&&(m={...m,...U}),(a||r)&&t.blockInitialAnimation&&(S=!1);const F=v&&x;S&&(!F||L)&&g.push(...N.map(G=>{const H={type:B};if(typeof G=="string"&&(a||r)&&!F&&t.manuallyAnimateOnMount&&t.parent){const{parent:q}=t,P=Of(q,G);if(q.enteringChildren&&P){const{delayChildren:z}=P.transition||{};H.delay=_1e(q.enteringChildren,t,z)}}return{animation:G,options:H}}))}if(p.size){const C={};if(typeof d.initial!="boolean"){const B=Of(t,Array.isArray(d.initial)?d.initial[0]:d.initial);B&&B.transition&&(C.transition=B.transition)}p.forEach(B=>{const y=t.getBaseTarget(B),Q=t.getValue(B);Q&&(Q.liveStyle=!0),C[B]=y??null}),g.push({animation:C})}let b=!!g.length;return a&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(b=!1),a=!1,r=!1,b?e(g):Promise.resolve()}function s(l,d){if(n[l].isActive===d)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(l,d)),n[l].isActive=d;const u=A(l);for(const g in n)n[g].protectedKeys={};return u}return{animateChanges:A,setActive:s,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qce(),r=!0}}}function IQt(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!cSe(e,t):!1}function Jh(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qce(){return{animate:Jh(!0),whileInView:Jh(),whileHover:Jh(),whileTap:Jh(),whileDrag:Jh(),whileFocus:Jh(),exit:Jh()}}function G7(t,e){t.min=e.min,t.max=e.max}function yl(t,e){G7(t.x,e.x),G7(t.y,e.y)}function jce(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const lSe=1e-4,BQt=1-lSe,yQt=1+lSe,dSe=.01,QQt=0-dSe,wQt=0+dSe;function YA(t){return t.max-t.min}function kQt(t,e,n){return Math.abs(t-e)<=n}function zce(t,e,n,a=.5){t.origin=a,t.originPoint=jr(e.min,e.max,t.origin),t.scale=YA(n)/YA(e),t.translate=jr(n.min,n.max,t.origin)-t.originPoint,(t.scale>=BQt&&t.scale<=yQt||isNaN(t.scale))&&(t.scale=1),(t.translate>=QQt&&t.translate<=wQt||isNaN(t.translate))&&(t.translate=0)}function t0(t,e,n,a){zce(t.x,e.x,n.x,a?a.originX:void 0),zce(t.y,e.y,n.y,a?a.originY:void 0)}function Jce(t,e,n,a=0){const r=a?jr(n.min,n.max,a):n.min;t.min=r+e.min,t.max=t.min+YA(e)}function vQt(t,e,n,a){Jce(t.x,e.x,n.x,a?.x),Jce(t.y,e.y,n.y,a?.y)}function Wce(t,e,n,a=0){const r=a?jr(n.min,n.max,a):n.min;t.min=e.min-r,t.max=t.min+YA(e)}function bR(t,e,n,a){Wce(t.x,e.x,n.x,a?.x),Wce(t.y,e.y,n.y,a?.y)}function Zce(t,e,n,a,r){return t-=e,t=fR(t,1/n,a),r!==void 0&&(t=fR(t,1/r,a)),t}function DQt(t,e=0,n=1,a=.5,r,i=t,o=t){if(ou.test(e)&&(e=parseFloat(e),e=jr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let A=jr(i.min,i.max,a);t===i&&(A-=e),t.min=Zce(t.min,e,n,A,r),t.max=Zce(t.max,e,n,A,r)}function Vce(t,e,[n,a,r],i,o){DQt(t,e[n],e[a],e[r],e.scale,i,o)}const xQt=["x","scaleX","originX"],SQt=["y","scaleY","originY"];function Xce(t,e,n,a){Vce(t.x,e,xQt,n?n.x:void 0,a?a.x:void 0),Vce(t.y,e,SQt,n?n.y:void 0,a?a.y:void 0)}function $ce(t){return t.translate===0&&t.scale===1}function uSe(t){return $ce(t.x)&&$ce(t.y)}function ele(t,e){return t.min===e.min&&t.max===e.max}function _Qt(t,e){return ele(t.x,e.x)&&ele(t.y,e.y)}function tle(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function gSe(t,e){return tle(t.x,e.x)&&tle(t.y,e.y)}function nle(t){return YA(t.x)/YA(t.y)}function ale(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Gd(t){return[t("x"),t("y")]}function RQt(t,e,n){let a="";const r=t.x.translate/e.x,i=t.y.translate/e.y,o=n?.z||0;if((r||i||o)&&(a=`translate3d(${r}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(a+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:d,rotateX:u,rotateY:g,skewX:p,skewY:m}=n;l&&(a=`perspective(${l}px) ${a}`),d&&(a+=`rotate(${d}deg) `),u&&(a+=`rotateX(${u}deg) `),g&&(a+=`rotateY(${g}deg) `),p&&(a+=`skewX(${p}deg) `),m&&(a+=`skewY(${m}deg) `)}const A=t.x.scale*e.x,s=t.y.scale*e.y;return(A!==1||s!==1)&&(a+=`scale(${A}, ${s})`),a||"none"}const pSe=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],NQt=pSe.length,rle=t=>typeof t=="string"?parseFloat(t):t,ile=t=>typeof t=="number"||Sn.test(t);function MQt(t,e,n,a,r,i){r?(t.opacity=jr(0,n.opacity??1,FQt(a)),t.opacityExit=jr(e.opacity??1,0,LQt(a))):i&&(t.opacity=jr(e.opacity??1,n.opacity??1,a));for(let o=0;o<NQt;o++){const A=pSe[o];let s=ole(e,A),l=ole(n,A);if(s===void 0&&l===void 0)continue;s||(s=0),l||(l=0),s===0||l===0||ile(s)===ile(l)?(t[A]=Math.max(jr(rle(s),rle(l),a),0),(ou.test(l)||ou.test(s))&&(t[A]+="%")):t[A]=l}(e.rotate||n.rotate)&&(t.rotate=jr(e.rotate||0,n.rotate||0,a))}function ole(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const FQt=mSe(0,.5,i1e),LQt=mSe(.5,.95,tl);function mSe(t,e,n){return a=>a<t?0:a>e?1:n(V0(t,e,a))}function TQt(t,e,n){const a=Xo(t)?t:SI(t);return a.start(Gz("",a,e,n)),a.animation}function ek(t,e,n,a={passive:!0}){return t.addEventListener(e,n,a),()=>t.removeEventListener(e,n)}const GQt=(t,e)=>t.depth-e.depth;class OQt{constructor(){this.children=[],this.isDirty=!1}add(e){wz(this.children,e),this.isDirty=!0}remove(e){dR(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(GQt),this.isDirty=!1,this.children.forEach(e)}}function UQt(t,e){const n=HA.now(),a=({timestamp:r})=>{const i=r-n;i>=e&&(xm(a),t(i-e))};return _r.setup(a,!0),()=>xm(a)}function KS(t){return Xo(t)?t.get():t}class PQt{constructor(){this.members=[]}add(e){wz(this.members,e);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===e||a===this.lead||a===this.prevLead)continue;const r=a.instance;(!r||r.isConnected===!1)&&!a.snapshot&&(dR(this.members,a),a.unmount())}e.scheduleRender()}remove(e){if(dR(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(e,n){const a=this.lead;if(e!==a&&(this.prevLead=a,this.lead=e,e.show(),a)){a.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=a.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(e.snapshot=a.snapshot,e.snapshot.latestValues=a.animationValues||a.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const HS={hasAnimatedSinceResize:!0,hasEverUpdated:!1},X9=["","X","Y","Z"],KQt=1e3;let HQt=0;function $9(t,e,n,a){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),a&&(a[t]=0))}function hSe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=L1e(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",_r,!(r||i))}const{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&hSe(a)}function fSe({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:a,resetTransform:r}){return class{constructor(o={},A=e?.()){this.id=HQt++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jQt),this.nodes.forEach(XQt),this.nodes.forEach($Qt),this.nodes.forEach(zQt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=A?A.root||A:this,this.path=A?[...A.path,A]:[],this.parent=A,this.depth=A?A.depth+1:0;for(let s=0;s<this.path.length;s++)this.path[s].shouldResetTransform=!0;this.root===this&&(this.nodes=new OQt)}addEventListener(o,A){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vz),this.eventHandlers.get(o).add(A)}notifyListeners(o,...A){const s=this.eventHandlers.get(o);s&&s.notify(...A)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Yz(o)&&!qyt(o),this.instance=o;const{layoutId:A,layout:s,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||A)&&(this.isLayoutDirty=!0),t){let d,u=0;const g=()=>this.root.updateBlockedByResize=!1;_r.read(()=>{u=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==u&&(u=p,this.root.updateBlockedByResize=!0,d&&d(),d=UQt(g,250),HS.hasAnimatedSinceResize&&(HS.hasAnimatedSinceResize=!1,this.nodes.forEach(cle)))})}A&&this.root.registerSharedNode(A,this),this.options.animate!==!1&&l&&(A||s)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:u,hasRelativeLayoutChanged:g,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||rwt,{onLayoutAnimationStart:h,onLayoutAnimationComplete:b}=l.getProps(),C=!this.targetLayout||!gSe(this.targetLayout,p),B=!u&&g;if(this.options.layoutRoot||this.resumeFrom||B||u&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Tz(m,"layout"),onPlay:h,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,B)}else u||cle(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),xm(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ewt),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hSe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:A,layout:s}=this.options;if(A===void 0&&!s)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const s=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),s&&this.nodes.forEach(WQt),this.nodes.forEach(Ale);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(sle);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ZQt),this.nodes.forEach(VQt),this.nodes.forEach(YQt),this.nodes.forEach(qQt)):this.nodes.forEach(sle),this.clearAllSnapshots();const A=HA.now();Jo.delta=uu(0,1e3/60,A-Jo.timestamp),Jo.timestamp=A,Jo.isProcessing=!0,Y9.update.process(Jo),Y9.preRender.process(Jo),Y9.render.process(Jo),Jo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kz.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JQt),this.sharedNodes.forEach(twt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_r.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_r.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!YA(this.snapshot.measuredBox.x)&&!YA(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let s=0;s<this.path.length;s++)this.path[s].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=oo()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:A}=this.options;A&&A.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let A=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(A=!1),A&&this.instance){const s=a(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:s,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:s}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,A=this.projectionDelta&&!uSe(this.projectionDelta),s=this.getTransformTemplate(),l=s?s(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;o&&this.instance&&(A||Af(this.latestValues)||d)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const A=this.measurePageBox();let s=this.removeElementScroll(A);return o&&(s=this.removeTransform(s)),iwt(s),{animationId:this.root.animationId,measuredBox:A,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return oo();const A=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(owt))){const{scroll:l}=this.root;l&&(Hd(A.x,l.offset.x),Hd(A.y,l.offset.y))}return A}removeElementScroll(o){const A=oo();if(yl(A,o),this.scroll?.wasRoot)return A;for(let s=0;s<this.path.length;s++){const l=this.path[s],{scroll:d,options:u}=l;l!==this.root&&d&&u.layoutScroll&&(d.wasRoot&&yl(A,o),Hd(A.x,d.offset.x),Hd(A.y,d.offset.y))}return A}applyTransform(o,A=!1,s){const l=s||oo();yl(l,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!A&&u.options.layoutScroll&&u.scroll&&u!==u.root&&(Hd(l.x,-u.scroll.offset.x),Hd(l.y,-u.scroll.offset.y)),Af(u.latestValues)&&PS(l,u.latestValues,u.layout?.layoutBox)}return Af(this.latestValues)&&PS(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const A=oo();yl(A,o);for(let s=0;s<this.path.length;s++){const l=this.path[s];if(!Af(l.latestValues))continue;let d;l.instance&&(F7(l.latestValues)&&l.updateSnapshot(),d=oo(),yl(d,l.measurePageBox())),Xce(A,l.latestValues,l.snapshot?.layoutBox,d)}return Af(this.latestValues)&&Xce(A,this.latestValues),A}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Jo.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const A=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=A.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=A.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=A.isSharedProjectionDirty);const s=!!this.resumingFrom||this!==A;if(!(o||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!this.layout||!(d||u))return;this.resolvedRelativeTargetAt=Jo.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=oo(),this.targetWithTransforms=oo()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vQt(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):yl(this.target,this.layout.layoutBox),eSe(this.target,this.targetDelta)):yl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||F7(this.parent.latestValues)||$1e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,A,s){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=oo(),this.relativeTargetOrigin=oo(),bR(this.relativeTargetOrigin,A,s,this.options.layoutAnchor||void 0),yl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),A=!!this.resumingFrom||this!==o;let s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),A&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===Jo.timestamp&&(s=!1),s)return;const{layout:l,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||d))return;yl(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,g=this.treeScale.y;nQt(this.layoutCorrected,this.treeScale,this.path,A),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=oo());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jce(this.prevProjectionDelta.x,this.projectionDelta.x),jce(this.prevProjectionDelta.y,this.projectionDelta.y)),t0(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==g||!ale(this.projectionDelta.x,this.prevProjectionDelta.x)||!ale(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const A=this.getStack();A&&A.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wE(),this.projectionDelta=wE(),this.projectionDeltaWithTransform=wE()}setAnimationOrigin(o,A=!1){const s=this.snapshot,l=s?s.latestValues:{},d={...this.latestValues},u=wE();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!A;const g=oo(),p=s?s.source:void 0,m=this.layout?this.layout.source:void 0,h=p!==m,b=this.getStack(),C=!b||b.members.length<=1,B=!!(h&&!C&&this.options.crossfade===!0&&!this.path.some(awt));this.animationProgress=0;let y;this.mixTargetDelta=Q=>{const k=Q/1e3;lle(u.x,o.x,k),lle(u.y,o.y,k),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bR(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),nwt(this.relativeTarget,this.relativeTargetOrigin,g,k),y&&_Qt(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=oo()),yl(y,this.relativeTarget)),h&&(this.animationValues=d,MQt(d,l,this.latestValues,k,B,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(xm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_r.update(()=>{HS.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=SI(0)),this.motionValue.jump(0,!1),this.currentAnimation=TQt(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:A=>{this.mixTargetDelta(A),o.onUpdate&&o.onUpdate(A)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KQt),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:A,target:s,layout:l,latestValues:d}=o;if(!(!A||!s||!l)){if(this!==o&&this.layout&&l&&bSe(this.options.animationType,this.layout.layoutBox,l.layoutBox)){s=this.target||oo();const u=YA(this.layout.layoutBox.x);s.x.min=o.target.x.min,s.x.max=s.x.min+u;const g=YA(this.layout.layoutBox.y);s.y.min=o.target.y.min,s.y.max=s.y.min+g}yl(A,s),PS(A,d),t0(this.projectionDeltaWithTransform,this.layoutCorrected,A,d)}}registerSharedNode(o,A){this.sharedNodes.has(o)||this.sharedNodes.set(o,new PQt),this.sharedNodes.get(o).add(A);const l=A.options.initialPromotionConfig;A.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(A):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:A,preserveFollowOpacity:s}={}){const l=this.getStack();l&&l.promote(this,s),o&&(this.projectionDelta=void 0,this.needsReset=!0),A&&this.setOptions({transition:A})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let A=!1;const{latestValues:s}=o;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(A=!0),!A)return;const l={};s.z&&$9("z",o,l,this.animationValues);for(let d=0;d<X9.length;d++)$9(`rotate${X9[d]}`,o,l,this.animationValues),$9(`skew${X9[d]}`,o,l,this.animationValues);o.render();for(const d in l)o.setStaticValue(d,l[d]),this.animationValues&&(this.animationValues[d]=l[d]);o.scheduleRender()}applyProjectionStyles(o,A){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=KS(A?.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=KS(A?.pointerEvents)||""),this.hasProjected&&!Af(this.latestValues)&&(o.transform=s?s({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let u=RQt(this.projectionDeltaWithTransform,this.treeScale,d);s&&(u=s(d,u)),o.transform=u;const{x:g,y:p}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=l===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in T7){if(d[m]===void 0)continue;const{correct:h,applyTo:b,isCSSVariable:C}=T7[m],B=u==="none"?d[m]:h(d[m],l);if(b){const y=b.length;for(let Q=0;Q<y;Q++)o[b[Q]]=B}else C?this.options.visualElement.renderState.vars[m]=B:o[m]=B}this.options.layoutId&&(o.pointerEvents=l===this?KS(A?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ale),this.root.sharedNodes.clear()}}}function YQt(t){t.updateLayout()}function qQt(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=t.layout,{animationType:r}=t.options,i=e.source!==t.layout.source;if(r==="size")Gd(d=>{const u=i?e.measuredBox[d]:e.layoutBox[d],g=YA(u);u.min=n[d].min,u.max=u.min+g});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";G7(i?e.measuredBox[d]:e.layoutBox[d],n[d])}else bSe(r,e.layoutBox,n)&&Gd(d=>{const u=i?e.measuredBox[d]:e.layoutBox[d],g=YA(n[d]);u.max=u.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+g)});const o=wE();t0(o,n,e.layoutBox);const A=wE();i?t0(A,t.applyTransform(a,!0),e.measuredBox):t0(A,n,e.layoutBox);const s=!uSe(o);let l=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:u,layout:g}=d;if(u&&g){const p=t.options.layoutAnchor||void 0,m=oo();bR(m,e.layoutBox,u.layoutBox,p);const h=oo();bR(h,n,g.layoutBox,p),gSe(m,h)||(l=!0),d.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:A,layoutDelta:o,hasLayoutChanged:s,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function jQt(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zQt(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function JQt(t){t.clearSnapshot()}function Ale(t){t.clearMeasurements()}function WQt(t){t.isLayoutDirty=!0,t.updateLayout()}function sle(t){t.isLayoutDirty=!1}function ZQt(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function VQt(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function cle(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function XQt(t){t.resolveTargetDelta()}function $Qt(t){t.calcProjection()}function ewt(t){t.resetSkewAndRotation()}function twt(t){t.removeLeadSnapshot()}function lle(t,e,n){t.translate=jr(e.translate,0,n),t.scale=jr(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function dle(t,e,n,a){t.min=jr(e.min,n.min,a),t.max=jr(e.max,n.max,a)}function nwt(t,e,n,a){dle(t.x,e.x,n.x,a),dle(t.y,e.y,n.y,a)}function awt(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rwt={duration:.45,ease:[.4,0,.1,1]},ule=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),gle=ule("applewebkit/")&&!ule("chrome/")?Math.round:tl;function ple(t){t.min=gle(t.min),t.max=gle(t.max)}function iwt(t){ple(t.x),ple(t.y)}function bSe(t,e,n){return t==="position"||t==="preserve-aspect"&&!kQt(nle(e),nle(n),.2)}function owt(t){return t!==t.root&&t.scroll?.wasRoot}const Awt=fSe({attachResizeListener:(t,e)=>ek(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),eU={current:void 0},CSe=fSe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!eU.current){const t=new Awt({});t.mount(window),t.setOptions({layoutScroll:!0}),eU.current=t}return eU.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ESe=Y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function swt(t=!0){const e=Y.useContext(Qz);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:r}=e,i=Y.useId();Y.useEffect(()=>{if(t)return r(i)},[t]);const o=Y.useCallback(()=>t&&a&&a(i),[i,a,t]);return!n&&a?[!1,o]:[!0]}const ISe=Y.createContext({strict:!1}),mle={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let hle=!1;function cwt(){if(hle)return;const t={};for(const e in mle)t[e]={isEnabled:n=>mle[e].some(a=>!!n[a])};Z1e(t),hle=!0}function BSe(){return cwt(),Xyt()}function lwt(t){const e=BSe();for(const n in t)e[n]={...e[n],...t[n]};Z1e(e)}const dwt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function CR(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dwt.has(t)}let ySe=t=>!CR(t);function uwt(t){typeof t=="function"&&(ySe=e=>e.startsWith("on")?!CR(e):t(e))}try{uwt(require("@emotion/is-prop-valid").default)}catch{}function gwt(t,e,n){const a={};for(const r in t)r==="values"&&typeof t.values=="object"||Xo(t[r])||(ySe(r)||n===!0&&CR(r)||!e&&!CR(r)||t.draggable&&r.startsWith("onDrag"))&&(a[r]=t[r]);return a}const VM=Y.createContext({});function pwt(t,e){if(ZM(t)){const{initial:n,animate:a}=t;return{initial:n===!1||$0(n)?n:void 0,animate:$0(a)?a:void 0}}return t.inherit!==!1?e:{}}function mwt(t){const{initial:e,animate:n}=pwt(t,Y.useContext(VM));return Y.useMemo(()=>({initial:e,animate:n}),[fle(e),fle(n)])}function fle(t){return Array.isArray(t)?t.join(" "):t}const Wz=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function QSe(t,e,n){for(const a in e)!Xo(e[a])&&!aSe(a,n)&&(t[a]=e[a])}function hwt({transformTemplate:t},e){return Y.useMemo(()=>{const n=Wz();return zz(n,e,t),Object.assign({},n.vars,n.style)},[e])}function fwt(t,e){const n=t.style||{},a={};return QSe(a,n,t),Object.assign(a,hwt(t,e)),a}function bwt(t,e){const n={},a=fwt(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=a,n}const wSe=()=>({...Wz(),attrs:{}});function Cwt(t,e,n,a){const r=Y.useMemo(()=>{const i=wSe();return rSe(i,e,oSe(a),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};QSe(i,t.style,t),r.style={...i,...r.style}}return r}const Ewt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zz(t){return typeof t!="string"||t.includes("-")?!1:!!(Ewt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Iwt(t,e,n,{latestValues:a},r,i=!1,o){const s=(o??Zz(t)?Cwt:bwt)(e,a,r,t),l=gwt(e,typeof t=="string",i),d=t!==Y.Fragment?{...l,...s,ref:n}:{},{children:u}=e,g=Y.useMemo(()=>Xo(u)?u.get():u,[u]);return Y.createElement(t,{...d,children:g})}function Bwt({scrapeMotionValuesFromProps:t,createRenderState:e},n,a,r){return{latestValues:ywt(n,a,r,t),renderState:e()}}function ywt(t,e,n,a){const r={},i=a(t,{});for(const g in i)r[g]=KS(i[g]);let{initial:o,animate:A}=t;const s=ZM(t),l=J1e(t);e&&l&&!s&&t.inherit!==!1&&(o===void 0&&(o=e.initial),A===void 0&&(A=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?A:o;if(u&&typeof u!="boolean"&&!WM(u)){const g=Array.isArray(u)?u:[u];for(let p=0;p<g.length;p++){const m=Oz(t,g[p]);if(m){const{transitionEnd:h,transition:b,...C}=m;for(const B in C){let y=C[B];if(Array.isArray(y)){const Q=d?y.length-1:0;y=y[Q]}y!==null&&(r[B]=y)}for(const B in h)r[B]=h[B]}}}return r}const kSe=t=>(e,n)=>{const a=Y.useContext(VM),r=Y.useContext(Qz),i=()=>Bwt(t,e,a,r);return n?i():EIt(i)},Qwt=kSe({scrapeMotionValuesFromProps:Jz,createRenderState:Wz}),wwt=kSe({scrapeMotionValuesFromProps:ASe,createRenderState:wSe}),kwt=Symbol.for("motionComponentSymbol");function vwt(t,e,n){const a=Y.useRef(n);Y.useInsertionEffect(()=>{a.current=n});const r=Y.useRef(null);return Y.useCallback(i=>{i&&t.onMount?.(i);const o=a.current;if(typeof o=="function")if(i){const A=o(i);typeof A=="function"&&(r.current=A)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i);e&&(i?e.mount(i):e.unmount())},[e])}const vSe=Y.createContext({});function cE(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Dwt(t,e,n,a,r,i){const{visualElement:o}=Y.useContext(VM),A=Y.useContext(ISe),s=Y.useContext(Qz),l=Y.useContext(ESe),d=l.reducedMotion,u=l.skipAnimations,g=Y.useRef(null),p=Y.useRef(!1);a=a||A.renderer,!g.current&&a&&(g.current=a(t,{visualState:e,parent:o,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:d,skipAnimations:u,isSVG:i}),p.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const m=g.current,h=Y.useContext(vSe);m&&!m.projection&&r&&(m.type==="html"||m.type==="svg")&&xwt(g.current,n,r,h);const b=Y.useRef(!1);Y.useInsertionEffect(()=>{m&&b.current&&m.update(n,s)});const C=n[F1e],B=Y.useRef(!!C&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(C)&&window.MotionHasOptimisedAnimation?.(C));return BIt(()=>{p.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),B.current&&m.animationState&&m.animationState.animateChanges())}),Y.useEffect(()=>{m&&(!B.current&&m.animationState&&m.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(C)}),B.current=!1),m.enteringChildren=void 0)}),m}function xwt(t,e,n,a){const{layoutId:r,layout:i,drag:o,dragConstraints:A,layoutScroll:s,layoutRoot:l,layoutAnchor:d,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:DSe(t.parent)),t.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||A&&cE(A),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:a,crossfade:u,layoutScroll:s,layoutRoot:l,layoutAnchor:d})}function DSe(t){if(t)return t.options.allowProjection!==!1?t.projection:DSe(t.parent)}function tU(t,{forwardMotionProps:e=!1,type:n}={},a,r){a&&lwt(a);const i=n?n==="svg":Zz(t),o=i?wwt:Qwt;function A(l,d){let u;const g={...Y.useContext(ESe),...l,layoutId:Swt(l)},{isStatic:p}=g,m=mwt(l),h=o(l,p);if(!p&&typeof window<"u"){_wt();const b=Rwt(g);u=b.MeasureLayout,m.visualElement=Dwt(t,h,g,r,b.ProjectionNode,i)}return I.jsxs(VM.Provider,{value:m,children:[u&&m.visualElement?I.jsx(u,{visualElement:m.visualElement,...g}):null,Iwt(t,l,vwt(h,m.visualElement,d),h,p,e,i)]})}A.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=Y.forwardRef(A);return s[kwt]=t,s}function Swt({layoutId:t}){const e=Y.useContext(zxe).id;return e&&t!==void 0?e+"-"+t:t}function _wt(t,e){Y.useContext(ISe).strict}function Rwt(t){const e=BSe(),{drag:n,layout:a}=e;if(!n&&!a)return{};const r={...n,...a};return{MeasureLayout:n?.isEnabled(t)||a?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Nwt(t,e){if(typeof Proxy>"u")return tU;const n=new Map,a=(i,o)=>tU(i,o,t,e),r=(i,o)=>a(i,o);return new Proxy(r,{get:(i,o)=>o==="create"?a:(n.has(o)||n.set(o,tU(o,void 0,t,e)),n.get(o))})}const Mwt=(t,e)=>e.isSVG??Zz(t)?new mQt(e):new cQt(e,{allowProjection:t!==Y.Fragment});class Fwt extends Xm{constructor(e){super(e),e.animationState||(e.animationState=EQt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();WM(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Lwt=0;class Twt extends Xm{constructor(){super(...arguments),this.id=Lwt++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===a)return;if(e&&a===!1){if(this.isExitComplete){const{initial:i,custom:o}=this.node.getProps();if(typeof i=="string"){const A=Of(this.node,i,o);if(A){const{transition:s,transitionEnd:l,...d}=A;for(const u in d)this.node.getValue(u)?.jump(d[u])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Gwt={animation:{Feature:Fwt},exit:{Feature:Twt}};function $k(t){return{point:{x:t.pageX,y:t.pageY}}}const Owt=t=>e=>Hz(e)&&t(e,$k(e));function n0(t,e,n,a){return ek(t,e,Owt(n),a)}const xSe=({current:t})=>t?t.ownerDocument.defaultView:null,ble=(t,e)=>Math.abs(t-e);function Uwt(t,e){const n=ble(t.x,e.x),a=ble(t.y,e.y);return Math.sqrt(n**2+a**2)}const Cle=new Set(["auto","scroll"]);class SSe{constructor(e,n,{transformPagePoint:a,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:A}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zx(this.lastRawMoveEventInfo,this.transformPagePoint));const p=nU(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,h=Uwt(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!h)return;const{point:b}=p,{timestamp:C}=Jo;this.history.push({...b,timestamp:C});const{onStart:B,onMove:y}=this.handlers;m||(B&&B(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=zx(m,this.transformPagePoint),_r.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:h,onSessionEnd:b,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const B=nU(p.type==="pointercancel"?this.lastMoveEventInfo:zx(m,this.transformPagePoint),this.history);this.startEvent&&h&&h(p,B),b&&b(p,B)},!Hz(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=o,this.contextWindow=r||window;const s=$k(e),l=zx(s,this.transformPagePoint),{point:d}=l,{timestamp:u}=Jo;this.history=[{...d,timestamp:u}];const{onSessionStart:g}=n;g&&g(e,nU(l,this.history)),this.removeListeners=Zk(n0(this.contextWindow,"pointermove",this.handlePointerMove),n0(this.contextWindow,"pointerup",this.handlePointerUp),n0(this.contextWindow,"pointercancel",this.handlePointerUp)),A&&this.startScrollTracking(A)}startScrollTracking(e){let n=e.parentElement;for(;n;){const a=getComputedStyle(n);(Cle.has(a.overflowX)||Cle.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const a=e===window,r=a?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-n.x,y:r.y-n.y};i.x===0&&i.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),_r.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),xm(this.updatePoint)}}function zx(t,e){return e?{point:e(t.point)}:t}function Ele(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nU({point:t},e){return{point:t,delta:Ele(t,_Se(e)),offset:Ele(t,Pwt(e)),velocity:Kwt(e,.1)}}function Pwt(t){return t[0]}function _Se(t){return t[t.length-1]}function Kwt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,a=null;const r=_Se(t);for(;n>=0&&(a=t[n],!(r.timestamp-a.timestamp>lc(e)));)n--;if(!a)return{x:0,y:0};a===t[0]&&t.length>2&&r.timestamp-a.timestamp>lc(e)*2&&(a=t[1]);const i=Vc(r.timestamp-a.timestamp);if(i===0)return{x:0,y:0};const o={x:(r.x-a.x)/i,y:(r.y-a.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Hwt(t,{min:e,max:n},a){return e!==void 0&&t<e?t=a?jr(e,t,a.min):Math.max(t,e):n!==void 0&&t>n&&(t=a?jr(n,t,a.max):Math.min(t,n)),t}function Ile(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ywt(t,{top:e,left:n,bottom:a,right:r}){return{x:Ile(t.x,n,r),y:Ile(t.y,e,a)}}function Ble(t,e){let n=e.min-t.min,a=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,a]=[a,n]),{min:n,max:a}}function qwt(t,e){return{x:Ble(t.x,e.x),y:Ble(t.y,e.y)}}function jwt(t,e){let n=.5;const a=YA(t),r=YA(e);return r>a?n=V0(e.min,e.max-a,t.min):a>r&&(n=V0(t.min,t.max-r,e.min)),uu(0,1,n)}function zwt(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const O7=.35;function Jwt(t=O7){return t===!1?t=0:t===!0&&(t=O7),{x:yle(t,"left","right"),y:yle(t,"top","bottom")}}function yle(t,e,n){return{min:Qle(t,e),max:Qle(t,n)}}function Qle(t,e){return typeof t=="number"?t:t[e]||0}const Wwt=new WeakMap;class Zwt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=oo(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{n&&this.snapToCursor($k(u).point),this.stopAnimation()},o=(u,g)=>{const{drag:p,dragPropagation:m,onDragStart:h}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Dyt(p),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gd(C=>{let B=this.getAxisMotionValue(C).get()||0;if(ou.test(B)){const{projection:y}=this.visualElement;if(y&&y.layout){const Q=y.layout.layoutBox[C];Q&&(B=YA(Q)*(parseFloat(B)/100))}}this.originPoint[C]=B}),h&&_r.update(()=>h(u,g),!1,!0),S7(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},A=(u,g)=>{this.latestPointerEvent=u,this.latestPanInfo=g;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:h,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:C}=g;if(m&&this.currentDirection===null){this.currentDirection=Xwt(C),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",g.point,C),this.updateAxis("y",g.point,C),this.visualElement.render(),b&&_r.update(()=>b(u,g),!1,!0)},s=(u,g)=>{this.latestPointerEvent=u,this.latestPanInfo=g,this.stop(u,g),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new SSe(e,{onSessionStart:i,onStart:o,onMove:A,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:a,contextWindow:xSe(this.visualElement),element:this.visualElement.current})}stop(e,n){const a=e||this.latestPointerEvent,r=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!a)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:A}=this.getProps();A&&_r.postRender(()=>A(a,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,a){const{drag:r}=this.getProps();if(!a||!Jx(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+a[e];this.constraints&&this.constraints[e]&&(o=Hwt(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&cE(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&a?this.constraints=Ywt(a.layoutBox,e):this.constraints=!1,this.elastic=Jwt(n),r!==this.constraints&&!cE(e)&&a&&this.constraints&&!this.hasMutatedConstraints&&Gd(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=zwt(a.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!cE(e))return!1;const a=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=aQt(a,r.root,this.visualElement.getTransformPagePoint());let o=qwt(r.layout.layoutBox,i);if(n){const A=n(eQt(o));this.hasMutatedConstraints=!!A,A&&(o=X1e(A))}return o}startAnimation(e){const{drag:n,dragMomentum:a,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:A}=this.getProps(),s=this.constraints||{},l=Gd(d=>{if(!Jx(d,n,this.currentDirection))return;let u=s&&s[d]||{};(o===!0||o===d)&&(u={min:0,max:0});const g=r?200:1e6,p=r?40:1e7,m={type:"inertia",velocity:a?e[d]:0,bounceStiffness:g,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(d,m)});return Promise.all(l).then(A)}startAxisValueAnimation(e,n){const a=this.getAxisMotionValue(e);return S7(this.visualElement,e),a.start(Gz(e,a,0,n,this.visualElement,!1))}stopAnimation(){Gd(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,a=this.visualElement.getProps(),r=a[n];return r||this.visualElement.getValue(e,(a.initial?a.initial[e]:void 0)||0)}snapToCursor(e){Gd(n=>{const{drag:a}=this.getProps();if(!Jx(n,a,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:A}=r.layout.layoutBox[n],s=i.get()||0;i.set(e[n]-jr(o,A,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!cE(n)||!a||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Gd(o=>{const A=this.getAxisMotionValue(o);if(A&&this.constraints!==!1){const s=A.get();r[o]=jwt({min:s,max:s},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gd(o=>{if(!Jx(o,e,null))return;const A=this.getAxisMotionValue(o),{min:s,max:l}=this.constraints[o];A.set(jr(s,l,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Wwt.set(this.visualElement,this);const e=this.visualElement.current,n=n0(e,"pointerdown",l=>{const{drag:d,dragListener:u=!0}=this.getProps(),g=l.target,p=g!==e&&Myt(g);d&&u&&!p&&this.start(l)});let a;const r=()=>{const{dragConstraints:l}=this.getProps();cE(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),a||(a=Vwt(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_r.read(r);const A=ek(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Gd(u=>{const g=this.getAxisMotionValue(u);g&&(this.originPoint[u]+=l[u].translate,g.set(g.get()+l[u].translate))}),this.visualElement.render())}));return()=>{A(),n(),o(),s&&s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=O7,dragMomentum:A=!0}=e;return{...e,drag:n,dragDirectionLock:a,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:A}}}function wle(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Vwt(t,e,n){const a=Mce(t,wle(n)),r=Mce(e,wle(n));return()=>{a(),r()}}function Jx(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Xwt(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class $wt extends Xm{constructor(e){super(e),this.removeGroupControls=tl,this.removeListeners=tl,this.controls=new Zwt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tl}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const aU=t=>(e,n)=>{t&&_r.update(()=>t(e,n),!1,!0)};class e0t extends Xm{constructor(){super(...arguments),this.removePointerDownListener=tl}onPointerDown(e){this.session=new SSe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xSe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:a,onPanEnd:r}=this.node.getProps();return{onSessionStart:aU(e),onStart:aU(n),onMove:aU(a),onEnd:(i,o)=>{delete this.session,r&&_r.postRender(()=>r(i,o))}}}mount(){this.removePointerDownListener=n0(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rU=!1;class t0t extends Y.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a,layoutId:r}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),a&&a.register&&r&&a.register(i),rU&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),HS.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:a,drag:r,isPresent:i}=this.props,{projection:o}=a;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),rU=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||_r.postRender(()=>{const A=o.getStack();(!A||!A.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:a}=e;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Kz.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:r}=e;rU=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),a&&a.deregister&&a.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function RSe(t){const[e,n]=swt(),a=Y.useContext(zxe);return I.jsx(t0t,{...t,layoutGroup:a,switchLayoutGroup:Y.useContext(vSe),isPresent:e,safeToRemove:n})}const n0t={pan:{Feature:e0t},drag:{Feature:$wt,ProjectionNode:CSe,MeasureLayout:RSe}};function kle(t,e,n){const{props:a}=t;t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=a[r];i&&_r.postRender(()=>i(e,$k(e)))}class a0t extends Xm{mount(){const{current:e}=this.node;e&&(this.unmount=Syt(e,(n,a)=>(kle(this.node,a,"Start"),r=>kle(this.node,r,"End"))))}unmount(){}}class r0t extends Xm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Zk(ek(this.node.current,"focus",()=>this.onFocus()),ek(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function vle(t,e,n){const{props:a}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&a.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=a[r];i&&_r.postRender(()=>i(e,$k(e)))}class i0t extends Xm{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=Lyt(e,(r,i)=>(vle(this.node,i,"Start"),(o,{success:A})=>vle(this.node,o,A?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const U7=new WeakMap,iU=new WeakMap,o0t=t=>{const e=U7.get(t.target);e&&e(t)},A0t=t=>{t.forEach(o0t)};function s0t({root:t,...e}){const n=t||document;iU.has(n)||iU.set(n,{});const a=iU.get(n),r=JSON.stringify(e);return a[r]||(a[r]=new IntersectionObserver(A0t,{root:t,...e})),a[r]}function c0t(t,e,n){const a=s0t(e);return U7.set(t,n),a.observe(t),()=>{U7.delete(t),a.unobserve(t)}}const l0t={some:0,all:1};class d0t extends Xm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:a,amount:r="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:a,threshold:typeof r=="number"?r:l0t[r]},A=s=>{const{isIntersecting:l}=s;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),g=l?d:u;g&&g(s)};this.stopObserver=c0t(this.node.current,o,A)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(u0t(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function u0t({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const g0t={inView:{Feature:d0t},tap:{Feature:i0t},focus:{Feature:r0t},hover:{Feature:a0t}},p0t={layout:{ProjectionNode:CSe,MeasureLayout:RSe}},m0t={...Gwt,...g0t,...n0t,...p0t},h0t=Nwt(m0t,Mwt);function f0t({children:t,as:e="span",className:n,duration:a=2,spread:r=2}){const i=h0t.create(e),o=Y.useMemo(()=>t.length*r,[t,r]);return I.jsx(i,{className:["relative inline-block bg-[length:250%_100%,auto] bg-clip-text","text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]","[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]","dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]",n].filter(Boolean).join(" "),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:a,ease:"linear"},style:{"--spread":`${o}px`,backgroundImage:"var(--bg), linear-gradient(var(--base-color), var(--base-color))"},children:t})}const b0t=Yt.memo(f0t),C0t="pi install npm:@plannotator/pi-extension";function E0t(t,e=!1){return t==="pi"?C0t:dHe&&!e?'powershell -c "irm https://plannotator.ai/install.ps1 | iex"':"curl -fsSL https://plannotator.ai/install.sh | bash"}const I0t=({appVersion:t,updateInfo:e,origin:n,isWSL:a,closeMenu:r})=>{const[i,o]=Y.useState(!1),A=!!e?.updateAvailable,s=async()=>{try{await navigator.clipboard.writeText(E0t(n,a)),o(!0),setTimeout(()=>o(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return I.jsxs("div",{className:"px-3 py-2 space-y-2",children:[I.jsxs("div",{className:"flex items-center justify-between gap-3",children:[I.jsx("a",{href:"https://github.com/backnotprop/plannotator",target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-[10px] font-semibold tracking-wide text-muted-foreground hover:text-foreground transition-colors",children:"Plannotator"}),I.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground/70",children:["v",t]})]}),I.jsxs("div",{className:"flex flex-col items-start gap-1 text-[11px]",children:[I.jsxs("span",{className:"flex items-center gap-1.5",children:[I.jsx("a",{href:A?e.releaseUrl:"https://github.com/backnotprop/plannotator/releases",target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors",children:"Release notes"}),A&&I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"text-muted-foreground/40",children:"·"}),I.jsx(b0t,{className:"text-[10px] font-medium",duration:2.5,spread:1.5,children:"New update available!"})]})]}),A&&I.jsx("button",{onClick:s,className:"text-emerald-500 hover:text-emerald-400 transition-colors",children:i?"Copied!":"Copy update command"})]})]})},B0t=({appVersion:t,updateInfo:e,origin:n,isWSL:a=!1,onOpenSettings:r,onOpenExport:i,onCopyAgentInstructions:o,onDownloadAnnotations:A,onPrint:s,onCopyShareLink:l,onOpenImport:d,onSaveToObsidian:u,onSaveToBear:g,onSaveToOctarine:p,sharingEnabled:m,isApiMode:h,agentInstructionsEnabled:b,obsidianConfigured:C,bearConfigured:B,octarineConfigured:y})=>{const{theme:Q,setTheme:k}=Hj(),_=!!e?.updateAvailable&&!e.dismissed,v=h&&(C||B||y);return I.jsx(fIt,{renderTrigger:({isOpen:x,toggleMenu:S})=>I.jsxs("button",{onClick:()=>{!x&&_&&e?.dismiss(),S()},className:`relative flex items-center gap-1.5 p-1.5 md:px-2.5 md:py-1 rounded-md text-xs font-medium transition-colors ${x?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Options","aria-label":"Options","aria-expanded":x,children:[x?I.jsx(Q0t,{}):I.jsx(y0t,{}),I.jsx("span",{className:"hidden md:inline",children:"Options"}),_&&I.jsx("span",{className:"absolute top-0.5 right-0.5 md:-top-0.5 md:-right-0.5 w-2 h-2 rounded-full bg-primary ring-2 ring-background"})]}),children:({closeMenu:x})=>I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"px-3 py-2 space-y-1.5",children:[I.jsx(bIt,{children:"Theme"}),I.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-muted/50 p-0.5",children:["light","dark","system"].map(S=>I.jsxs("button",{onClick:()=>{x(),k(S)},className:`flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Q===S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[S==="light"?I.jsx(Yxe,{}):S==="dark"?I.jsx(qxe,{}):I.jsx(jxe,{}),I.jsx("span",{className:"capitalize",children:S})]},S))})]}),I.jsx(Yx,{}),I.jsx(kd,{onClick:()=>{x(),r()},icon:I.jsx(w0t,{}),label:"Settings"}),I.jsx(kd,{onClick:()=>{x(),i()},icon:I.jsx(k0t,{}),label:"Export"}),b&&I.jsx(kd,{onClick:()=>{x(),o()},icon:I.jsx(CIt,{}),label:"Agent Instructions",subtitle:"Copy agent instructions for external annotations"}),I.jsx(Yx,{}),I.jsx(kd,{onClick:()=>{x(),A()},icon:I.jsx(v0t,{}),label:"Download Annotations"}),I.jsx(kd,{onClick:()=>{x(),s()},icon:I.jsx(D0t,{}),label:"Print / Save as PDF",subtitle:"Choose 'Save as PDF' in the print dialog"}),m&&I.jsx(kd,{onClick:()=>{x(),l()},icon:I.jsx(x0t,{}),label:"Copy Share Link"}),m&&I.jsx(kd,{onClick:()=>{x(),d()},icon:I.jsx(S0t,{}),label:"Import Review"}),v&&I.jsxs(I.Fragment,{children:[I.jsx(Yx,{}),C&&I.jsx(kd,{onClick:()=>{x(),u()},icon:I.jsx(oU,{}),label:"Save to Obsidian"}),B&&I.jsx(kd,{onClick:()=>{x(),g()},icon:I.jsx(oU,{}),label:"Save to Bear"}),y&&I.jsx(kd,{onClick:()=>{x(),p()},icon:I.jsx(oU,{}),label:"Save to Octarine"})]}),I.jsx(Yx,{}),I.jsx(I0t,{appVersion:t,updateInfo:e,origin:n,isWSL:a,closeMenu:x})]})})},y0t=()=>I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),Q0t=()=>I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),w0t=()=>I.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),k0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),v0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),D0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),x0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),S0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3"})}),oU=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),_0t=Yt.memo(({isApiMode:t,annotateMode:e,archiveMode:n,goalSetupMode:a,goalSetupCanSubmit:r,goalSetupIsSubmitting:i,goalSetupSubmitLabel:o,gate:A,isSharedSession:s,origin:l,isSubmitting:d,isExiting:u,isPanelOpen:g,aiAvailable:p,isAIChatOpen:m,aiHasMessages:h,hasAnyAnnotations:b,linkedDocIsActive:C,callbackShareUrlReady:B,canShareCurrentSession:y,agentName:Q,availableAgents:k,showAnnotationsWarning:_,callbackConfig:v,taterMode:x,mobileSettingsOpen:S,gitUser:L,onCallbackFeedback:N,onCallbackApprove:U,onAnnotateExit:K,onGoalSetupExit:R,onGoalSetupSubmit:O,onAnnotateFeedback:F,onAnnotateApprove:T,onFeedback:G,onApprove:H,onAnnotationPanelToggle:q,onAIChatToggle:P,onArchiveCopy:z,onArchiveDone:Z,onTaterModeChange:$,onIdentityChange:V,onUIPreferencesChange:Ae,onOpenSettings:ne,onCloseSettings:pe,onOpenExport:te,onCopyAgentInstructions:re,onDownloadAnnotations:se,onPrint:oe,onCopyShareLink:ue,onOpenImport:le,onSaveToObsidian:De,onSaveToBear:he,onSaveToOctarine:qe,appVersion:ce,updateInfo:et,isWSL:ke,agentInstructionsEnabled:rt,obsidianConfigured:tt,bearConfigured:gt,octarineConfigured:Ge})=>I.jsxs("header",{"data-app-header":"true",className:"h-12 flex items-center justify-between px-2 md:px-4 border-b border-border/50 bg-card/50 backdrop-blur-xl sticky top-0 z-[50]",children:[I.jsx(R0t,{}),I.jsxs("div",{className:"flex items-center gap-1 md:gap-2",children:[v&&!t&&s&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"}),I.jsx(P9,{onClick:N,disabled:d||!B,isLoading:d,title:"Send feedback to bot"}),I.jsx(K9,{onClick:U,disabled:d||!B,isLoading:d,title:"Approve design and notify bot"})]}),t&&!C&&n&&I.jsxs(I.Fragment,{children:[I.jsxs("button",{onClick:z,className:"px-2.5 py-1 rounded-md text-xs font-medium transition-all bg-muted text-foreground hover:bg-muted/80 border border-border",title:"Copy plan content",children:[I.jsx("span",{className:"hidden md:inline",children:"Copy"}),I.jsx("svg",{className:"w-4 h-4 md:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]}),I.jsx("button",{onClick:Z,className:"px-2.5 py-1 rounded-md text-xs font-medium transition-all bg-success text-success-foreground hover:opacity-90",title:"Close archive",children:"Done"})]}),t&&!C&&a&&I.jsxs(I.Fragment,{children:[I.jsx(cce,{onClick:R,disabled:u||i,isLoading:u,title:"Close goal setup without submitting"}),I.jsx(K9,{onClick:O,disabled:!r||i||u,isLoading:i,label:o,loadingLabel:"Submitting...",mobileLabel:"Submit",title:o}),I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"})]}),t&&(!C||e)&&!n&&!a&&I.jsxs(I.Fragment,{children:[e?I.jsxs(I.Fragment,{children:[I.jsx(cce,{onClick:K,disabled:d||u,isLoading:u}),b&&I.jsx(P9,{onClick:F,disabled:d||u,isLoading:d,label:"Send Annotations",title:"Send Annotations"})]}):I.jsx(P9,{onClick:G,disabled:d,isLoading:d,label:"Send Feedback",title:"Send Feedback"}),(!e||A)&&(l==="opencode"&&!e&&k.length>0?I.jsx(qEt,{onApprove:H,agents:k,disabled:d,isLoading:d}):I.jsxs("div",{className:"relative group/approve",children:[I.jsx(K9,{onClick:H,disabled:d||e&&u,isLoading:d,dimmed:!e&&(l==="claude-code"||l==="gemini-cli")&&_,title:e?"Approve — no changes requested":void 0}),!e&&(l==="claude-code"||l==="gemini-cli")&&_&&I.jsxs("div",{className:"absolute top-full right-0 mt-2 px-3 py-2 bg-popover border border-border rounded-lg shadow-xl text-xs text-foreground w-56 text-center opacity-0 invisible group-hover/approve:opacity-100 group-hover/approve:visible transition-all pointer-events-none z-50",children:[I.jsx("div",{className:"absolute bottom-full right-4 border-4 border-transparent border-b-border"}),I.jsx("div",{className:"absolute bottom-full right-4 mt-px border-4 border-transparent border-b-popover"}),Q," doesn't support feedback on approval. Your annotations won't be seen."]})]})),I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"})]}),!a&&I.jsx("button",{onClick:q,className:`p-1.5 rounded-md text-xs font-medium transition-all ${g?"bg-primary/15 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:g?"Hide annotations":"Show annotations",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!a&&p&&I.jsxs("button",{onClick:P,className:`relative p-1.5 rounded-md text-xs font-medium transition-all ${m?"bg-primary/15 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:m?"Hide AI chat":"Show AI chat","aria-label":m?"Hide AI chat":"Show AI chat",children:[I.jsx(cm,{className:"w-4 h-4"}),h&&!m&&I.jsx("span",{className:"absolute top-0 right-0 w-1.5 h-1.5 rounded-full bg-primary"})]}),I.jsx("div",{className:"hidden",children:I.jsx(hIt,{taterMode:x,onTaterModeChange:$,onIdentityChange:V,origin:l,onUIPreferencesChange:Ae,externalOpen:S,onExternalClose:pe,gitUser:L})}),I.jsx(B0t,{appVersion:ce,updateInfo:et,origin:l,isWSL:ke,onOpenSettings:ne,onOpenExport:te,onCopyAgentInstructions:re,onDownloadAnnotations:se,onPrint:oe,onCopyShareLink:ue,onOpenImport:le,onSaveToObsidian:De,onSaveToBear:he,onSaveToOctarine:qe,sharingEnabled:y,isApiMode:t,agentInstructionsEnabled:rt,obsidianConfigured:!a&&tt,bearConfigured:!a&>,octarineConfigured:!a&&Ge})]})]})),R0t=()=>I.jsx("div",{className:"flex items-center gap-2 md:gap-3",children:I.jsx("a",{href:"https://plannotator.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 md:gap-2 hover:opacity-80 transition-opacity",children:I.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"Plannotator"})})}),N0t=OEt,M0t=()=>{const[t,e]=Y.useState(N0t),[n,a]=Y.useState([]),[r,i]=Y.useState([]),[o,A]=Y.useState(null),[s,l]=Y.useState(null),d=Y.useMemo(()=>tbe(t).frontmatter,[t]),u=Y.useMemo(()=>g0(t),[t]),[g,p]=Y.useState(!1),[m,h]=Y.useState(!1),[b,C]=Y.useState(!1),[B,y]=Y.useState(!1),[Q,k]=Y.useState(!1),[_,v]=Y.useState("close"),[x,S]=Y.useState(!1),[L,N]=Y.useState(""),[U,K]=Y.useState(()=>window.innerWidth>=768),[R,O]=Y.useState("annotations"),[F,T]=Y.useState(!1),[G,H]=Y.useState(zdt),[q,P]=Y.useState(Zdt),[z,Z]=Y.useState(()=>qt.getItem("plannotator-tater-mode")==="true"),[$,V]=Y.useState(()=>PK()),Ae=Y.useRef(null),[ne,pe]=Y.useState("full"),[te,re]=Y.useState(!1),[se,oe]=Y.useState(null),[ue,le]=Y.useState(),[De,he]=Y.useState(!1),qe=Tdt(),[ce,et]=Y.useState([]),[ke,rt]=Y.useState(!1),[tt,gt]=Y.useState(!1),[Ge,ot]=Y.useState(null),[He,ze]=Y.useState(null),ut=Y.useRef(null),[Se,Ze]=Y.useState({canSubmit:!1,isSubmitting:!1,submitted:!1,submitLabel:"Submit"}),[be,ve]=Y.useState(),[X,we]=Y.useState(!1),[Be,Ne]=Y.useState("markdown"),[Me,Ke]=Y.useState(""),[Ee,_e]=Y.useState(),[We,it]=Y.useState(void 0),[ht,Ie]=Y.useState(!0),[Pe,Oe]=Y.useState(!1),[at,Rt]=Y.useState(!1),[ft,ie]=Y.useState(null),[lt,At]=Y.useState(null),[vt,_t]=Y.useState(!1),[Tt,Kt]=Y.useState("bypassPermissions"),[$t,Ft]=Y.useState(!0),[Mt,Wt]=Y.useState(void 0),[vn,Qn]=Y.useState(void 0),[mn,Tn]=Y.useState(null),[fa,Et]=Y.useState(null),[fe,$e]=Y.useState(null),Dt=Y.useRef(null),hn=Y.useRef($.tocEnabled),dn=He!==null;Y.useEffect(()=>{document.title=mn?`${mn.display} · Plannotator`:"Plannotator"},[mn]);const[on,zn]=Y.useState(),[Hn,ga]=Y.useState(!1),[Ut,Ct]=Y.useState("clean"),[Gt,Lt]=Y.useState(null),[It,Bn]=Y.useState(null),[Le,ur]=Y.useState(!1),[Ue,Yn]=Y.useState(!1),[To,Go]=Y.useState([]),[Xi,os]=Y.useState(()=>{const Te=ru(),xt=Te.providerId;return{providerId:xt,model:xt?Te.preferredModels[xt]??null:null,reasoningEffort:null}}),[kr,vr]=Y.useState(Pdt),$i=T0e(),Zr=Y.useRef(null),{ref:As,viewport:Dr,onViewportReady:Ks}=nut();tut();const ar=TAe({storageKey:"plannotator-panel-width"}),wn=TAe({storageKey:"plannotator-toc-width",defaultWidth:240,minWidth:160,maxWidth:400,side:"left"}),Un=ar.isDragging||wn.isDragging,bn=out(PK().tocEnabled),pa=Y.useMemo(()=>u.some(Te=>Te.type==="heading"&&(Te.level??0)<=3),[u]),Ua=Y.useCallback(Te=>{if(fe===null){Te?.sidebarTab&&bn.open(Te.sidebarTab),Te?.panelOpen===!0?K(!0):Te?.panelOpen===!1&&K(!1);return}const xt=Dt.current,zt=PEt(xt,Te);$e(null),Dt.current=null,zt.sidebarOpen&&zt.sidebarTab?bn.open(zt.sidebarTab):bn.close(),zt.panelOpen!==void 0&&K(zt.panelOpen)},[fe,bn.close,bn.open]),rr=Y.useCallback(Te=>{if(fe!==null){Ua({restore:!1,sidebarTab:Te,panelOpen:!1});return}bn.open(Te)},[Ua,fe,bn.open]),Ni=Y.useCallback(Te=>{if(fe!==null){Ua({restore:!1,sidebarTab:Te,panelOpen:!1});return}bn.toggleTab(Te)},[Ua,fe,bn.toggleTab]),Mi=Y.useCallback(()=>{if(fe!==null){Ua({restore:!1,panelOpen:!0}),O("annotations");return}O("annotations"),K(Te=>R==="annotations"?!Te:!0)},[Ua,R,fe]),Xt=Y.useCallback(()=>{Kdt(),vr(!1)},[]),J=Y.useCallback(()=>{if(Xt(),fe!==null){Ua({restore:!1,panelOpen:!0}),O("ai");return}O("ai"),K(Te=>R==="ai"?!Te:!0)},[Xt,Ua,R,fe]);Y.useEffect(()=>{fe===null&&hn.current!==$.tocEnabled&&(hn.current=$.tocEnabled,$.tocEnabled&&pa?bn.open("toc"):$.tocEnabled||bn.close())},[fe,bn.close,bn.open,$.tocEnabled,pa]),Y.useEffect(()=>{u.length!==0&&(pa||bn.activeTab==="toc"&&bn.isOpen&&bn.close())},[u,pa]),Y.useEffect(()=>{bn.activeTab==="toc"&&Hn&&ga(!1)},[bn.activeTab]),Y.useEffect(()=>{if(!Hn)return;const Te=xt=>{xt.key==="Escape"&&ga(!1)};return document.addEventListener("keydown",Te),()=>document.removeEventListener("keydown",Te)},[Hn]);const ee=qut(t,Gt,It),me=Y.useMemo(()=>({...bn,open:rr,toggleTab:Ni}),[rr,bn.activeTab,bn.close,bn.isOpen,Ni]),Ce=jut({markdown:t,annotations:n,selectedAnnotationId:o,globalAttachments:ce,setMarkdown:e,setAnnotations:a,setSelectedAnnotationId:A,setGlobalAttachments:et,viewerRef:Zr,sidebar:me,sourceFilePath:Ee,sourceConverted:X}),Ye=Y.useMemo(()=>Ce.filepath?Ce.filepath.replace(/\/[^/]+$/,""):We?.includes("/")?We:void 0,[Ce.filepath,We]),nt=zut({buildUrl:Y.useCallback(Te=>Ye?`/api/doc?path=${encodeURIComponent(Te)}&base=${encodeURIComponent(Ye)}`:`/api/doc?path=${encodeURIComponent(Te)}`,[Ye])}),ct=Xut({markdown:t,viewerRef:Zr,linkedDocHook:Ce,setMarkdown:e,setAnnotations:a,setSelectedAnnotationId:A,setSubmitted:ie}),Bt=Y.useMemo(()=>UEt({archiveMode:ct.archiveMode,isPlanDiffActive:Hn}),[ct.archiveMode,Hn]),An=Y.useCallback(Te=>{Bt&&(fe===null&&(Dt.current={sidebarIsOpen:bn.isOpen,sidebarTab:bn.activeTab,panelOpen:U}),$e(Te),bn.close(),K(!1))},[Bt,U,fe,bn.activeTab,bn.close,bn.isOpen]),ta=Y.useCallback(Te=>{fe===Te?Ua():An(Te)},[An,Ua,fe]);Y.useEffect(()=>{!Bt&&fe!==null&&Ua()},[Bt,Ua,fe]);const un=ogt(),sa=Y.useMemo(()=>iAe()?tm(em()):"",[$]),na=Y.useMemo(()=>!!fa||XAe()||iAe(),[fa,$]),xn=Y.useMemo(()=>{const Te=fa?[fa]:[],xt=XAe()?rz().directories:[];return[...new Set([...Te,...xt])]},[fa,$]);Y.useEffect(()=>{na||un.setActiveFile(null)},[na]),Y.useEffect(()=>{sa||un.clearVaultDirs()},[sa]),Y.useEffect(()=>{if(bn.activeTab==="files"&&na){if(xn.length>0){const Te=un.dirs.filter(zt=>!zt.isVault).map(zt=>zt.path);(xn.some(zt=>!Te.includes(zt))||Te.some(zt=>!xn.includes(zt)))&&un.fetchAll(xn)}sa&&!un.dirs.find(Te=>Te.isVault&&Te.path===sa&&!Te.error)&&un.addVaultDir(sa)}},[bn.activeTab,na,xn,sa]);const qn=Yt.useCallback((Te,xt)=>{const an=un.dirs.find(aa=>aa.path===xt)?.isVault?aa=>`/api/reference/obsidian/doc?vaultPath=${encodeURIComponent(xt)}&path=${encodeURIComponent(aa)}`:aa=>`/api/doc?path=${encodeURIComponent(aa)}&base=${encodeURIComponent(xt)}`;Ce.open(Te,an,"files"),un.setActiveFile(Te)},[Ce,un]),Cr=Yt.useCallback(Te=>{if(un.dirs.find(zt=>zt.path===un.activeDirPath)?.isVault&&un.activeDirPath)Ce.open(Te,zt=>`/api/reference/obsidian/doc?vaultPath=${encodeURIComponent(un.activeDirPath)}&path=${encodeURIComponent(zt)}`);else if(un.activeFile&&un.activeDirPath){const zt=Ce.filepath?.replace(/\/[^/]+$/,"")||un.activeDirPath;Ce.open(Te,an=>`/api/doc?path=${encodeURIComponent(an)}&base=${encodeURIComponent(zt)}`)}else{const zt=Ce.filepath?Ce.filepath.replace(/\/[^/]+$/,""):We?.includes("/")?We:void 0;zt?Ce.open(Te,an=>`/api/doc?path=${encodeURIComponent(an)}&base=${encodeURIComponent(zt)}`):Ce.open(Te)}},[un.dirs,un.activeDirPath,un.activeFile,Ce,We]),eo=Yt.useCallback(()=>{Ce.back(),un.setActiveFile(null),ct.clearSelection()},[Ce,un,ct]),Vr=Y.useMemo(()=>{const Te=new Map;for(const[xt,zt]of Ce.getDocAnnotations()){const an=zt.annotations.length+zt.globalAttachments.length;an>0&&Te.set(xt,an)}return Te},[Ce.getDocAnnotations,n,ce]),gr=Y.useMemo(()=>{const Te=un.dirs.map(zt=>zt.path);if(Te.length===0)return Vr;const xt=new Map;for(const[zt,an]of Vr)Te.some(aa=>zt.startsWith(aa+"/"))&&xt.set(zt,an);return xt},[Vr,un.dirs]),ii=gr.size>0,kc=Y.useMemo(()=>{const Te=Ce.filepath;let xt=0,zt=0;for(const[an,aa]of Vr)an!==Te&&(xt+=aa,zt++);return xt>0?{count:xt,files:zt}:void 0},[Vr,Ce.filepath]),[Qo,vc]=Y.useState(),Pr=Yt.useRef(),FB=Yt.useCallback(()=>{const Te=new Set(Vr.keys());Te.size!==0&&((!bn.isOpen||bn.activeTab!=="files")&&rr("files"),Pr.current&&clearTimeout(Pr.current),vc(void 0),requestAnimationFrame(()=>{vc(Te),Pr.current=setTimeout(()=>vc(void 0),1200)}))},[Vr,rr,bn,ii]),sp=Ge==="folder"?"file list":Ge==="file"?"file":Ge==="message"?"message":"plan",Zb=Y.useMemo(()=>u.filter(Te=>Te.type==="heading").length,[u]),Ov=Sdt(As,Zb,Dr),{editorAnnotations:Hs,deleteEditorAnnotation:CL}=egt(),{externalAnnotations:pd,updateExternalAnnotation:LB,deleteExternalAnnotation:EL}=agt({enabled:te&&!dn}),{reset:Uv}=rgt({viewerRef:Zr,externalAnnotations:pd,enabled:te&&!dn&&!Ce.isActive&&!Hn,planKey:t}),Er=Y.useMemo(()=>pd.length===0?n:[...n.filter(xt=>xt.source?!pd.some(zt=>zt.source===xt.source&&zt.type===xt.type&&zt.originalText===xt.originalText):!0),...pd],[n,pd]),IL=Y.useMemo(()=>Er.filter(Te=>!!Te.diffContext),[Er]),Pv=Y.useMemo(()=>Er.filter(Te=>!Te.diffContext),[Er]),Dc=Y.useMemo(()=>Er.length>0||r.length>0||Hs.length>0||Ce.docAnnotationCount>0||ce.length>0,[Er.length,r.length,Hs.length,Ce.docAnnotationCount,ce.length]),Kv=Er.length+r.length+Hs.length+Ce.docAnnotationCount+ce.length,Vb=$t&&r.length===0,{isSharedSession:vA,isLoadingShared:TB,shareUrl:fl,shareUrlSize:BL,shortShareUrl:Su,isGeneratingShortUrl:yL,shortUrlError:Hv,pendingSharedAnnotations:Xb,clearPendingSharedAnnotations:Yv,generateShortUrl:QL,importFromShareUrl:wL,shareLoadError:qv,clearShareLoadError:kL}=Qdt(t,Er,ce,e,a,et,()=>{Ie(!1)},Mt,vn,Me,Ke,Ne);Y.useLayoutEffect(()=>{if(ht&&!vA)return;const Te=Ae.current;if(!Te)return;const xt=an=>an>=800?"full":an>=680?"short":"icon";pe(xt(Te.getBoundingClientRect().width));const zt=new ResizeObserver(([an])=>{const aa=xt(an.contentRect.width);pe(Sa=>Sa===aa?Sa:aa)});return zt.observe(Te),()=>zt.disconnect()},[ht,vA]);const{draftBanner:fh,restoreDraft:jv,dismissDraft:vL}=Vut({annotations:Er,codeAnnotations:r,globalAttachments:ce,isApiMode:te&&!dn,isSharedSession:vA,submitted:!!ft}),GB=Yt.useCallback(()=>{const{annotations:Te,codeAnnotations:xt,globalAttachments:zt}=jv();(Te.length>0||xt.length>0||zt.length>0)&&(a(Te),i(xt),zt.length>0&&et(zt),setTimeout(()=>{Zr.current?.applySharedAnnotations(Te.filter(an=>!an.diffContext))},100))},[jv]),{agents:bh,getAgentWarning:$b}=Ove(se);Y.useEffect(()=>{if(Xb&&Xb.length>0){const Te=setTimeout(()=>{Zr.current?.clearAllHighlights(),Zr.current?.applySharedAnnotations(Xb.filter(xt=>!xt.diffContext)),Yv(),Uv()},100);return()=>clearTimeout(Te)}},[Xb,Yv,Uv]);const zv=Y.useCallback(Te=>{Z(Te),qt.setItem("plannotator-tater-mode",String(Te))},[]),OB=Te=>{H(Te),Jdt(Te)},eC=Te=>{P(Te),Vdt(Te)};eut(q,eC),Y.useEffect(()=>{TB||vA||fetch("/api/plan").then(Te=>{if(!Te.ok)throw new Error("Not in API mode");return Te.json()}).then(Te=>{Ai.init(Te.serverConfig),ur(Te.mode!=="archive"&&Te.mode!=="goal-setup"),le(Te.serverConfig?.gitUser),Te.mode==="goal-setup"&&Te.goalSetup?(ze(Te.goalSetup),e(""),Ft(!1)):Te.mode==="archive"?(e(Te.plan||""),Te.archivePlans&&ct.init(Te.archivePlans),ct.fetchPlans(),Ft(!1),bn.open("archive")):Te.renderAs==="html"&&Te.rawHtml?(Ne("html"),Ke(Te.rawHtml),e("")):Te.mode==="annotate-folder"?e(""):Te.plan&&e(Te.plan),re(!0),(Te.mode==="annotate"||Te.mode==="annotate-last"||Te.mode==="annotate-folder")&&(rt(!0),gt(Te.gate??!1)),Te.mode==="annotate-folder"&&bn.open("files"),(Te.mode==="annotate"||Te.mode==="annotate-last"||Te.mode==="annotate-folder")&&ot(Te.mode==="annotate-last"?"message":Te.mode==="annotate-folder"?"folder":"file"),ve(Te.sourceInfo??void 0),we(!!Te.sourceConverted),Te.filePath&&(it(Te.mode==="annotate-folder"?Te.filePath:Te.filePath.replace(/\/[^/]+$/,"")),Te.mode==="annotate"&&_e(Te.filePath)),Te.sharingEnabled!==void 0&&Ft(Te.sharingEnabled),Te.shareBaseUrl&&Wt(Te.shareBaseUrl),Te.pasteApiUrl&&Qn(Te.pasteApiUrl),Te.repoInfo&&Tn(Te.repoInfo),Te.projectRoot&&Et(Te.projectRoot),Te.previousPlan!==void 0&&Lt(Te.previousPlan),Te.versionInfo&&Bn(Te.versionInfo),Te.origin&&(oe(Te.origin),Te.origin==="claude-code"&&Te.mode!=="goal-setup"&&rut()&&_t(!0),Kt(Xve().mode)),Te.isWSL&&he(!0)}).catch(()=>{re(!1),ur(!1)}).finally(()=>Ie(!1))},[TB,vA]),Y.useEffect(()=>{if(!Le||!te||vA){Yn(!1),Go([]);return}let Te=!1;return fetch("/api/ai/capabilities").then(xt=>xt.ok?xt.json():null).then(xt=>{if(!Te)if(xt?.available){const zt=xt.providers??[];Yn(!0),Go(zt),os(an=>{const aa=ru(),Sa=Pj({providers:zt,origin:se,settings:aa,serverDefaultProvider:xt.defaultProvider??null});return an.providerId===Sa.providerId&&an.model===Sa.model?an:{...an,providerId:Sa.providerId,model:Sa.model}})}else Yn(!1),Go([])}).catch(()=>{Te||(Yn(!1),Go([]))}),()=>{Te=!0}},[Le,te,vA,se]);const tC=Y.useRef(!1),Ch=Y.useRef({}),bl=Y.useRef(null);Y.useEffect(()=>{tC.current=!1,Ch.current={},bl.current=null},[t]),Y.useEffect(()=>{if(!te||!t||vA||ke||ct.archiveMode||tC.current)return;const Te={},xt=[],zt=em();if(zt.autoSave&&zt.enabled){const ba=tm(zt);ba&&(Te.obsidian={vaultPath:ba,folder:zt.folder||"plannotator",plan:t,...zt.filenameFormat&&{filenameFormat:zt.filenameFormat},...zt.filenameSeparator&&zt.filenameSeparator!=="space"&&{filenameSeparator:zt.filenameSeparator}},xt.push("Obsidian"))}const an=gf();an.autoSave&&an.enabled&&(Te.bear={plan:t,customTags:an.customTags,tagPosition:an.tagPosition},xt.push("Bear"));const aa=PE();if(aa.autoSave&&Rx()&&(Te.octarine={plan:t,workspace:aa.workspace,folder:aa.folder||"plannotator"},xt.push("Octarine")),xt.length===0)return;tC.current=!0;const Sa=fetch("/api/save-notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(ba=>ba.json()).then(ba=>{const Jn={...Te.obsidian?{obsidian:!!ba.results?.obsidian?.success}:{},...Te.bear?{bear:!!ba.results?.bear?.success}:{},...Te.octarine?{octarine:!!ba.results?.octarine?.success}:{}};Ch.current=Jn;const Ca=xt.filter(Oo=>!ba.results?.[Oo.toLowerCase()]?.success);return Ca.length===0?Ws.success(`Auto-saved to ${xt.join(" & ")}`):Ws.error(`Auto-save failed for ${Ca.join(" & ")}`),Jn}).catch(()=>(Ch.current={},Ws.error("Auto-save failed"),{}));bl.current=Sa},[te,t,vA,ke]),Y.useEffect(()=>{const Te=xt=>{const zt=xt.clipboardData?.items;if(zt){for(const an of zt)if(an.type.startsWith("image/")){xt.preventDefault();const aa=an.getAsFile();if(aa){const Sa=d6(aa.name,ce.map(Jn=>Jn.name)),ba=URL.createObjectURL(aa);At({file:aa,blobUrl:ba,initialName:Sa})}break}}};return document.addEventListener("paste",Te),()=>document.removeEventListener("paste",Te)},[ce]);const DL=async(Te,xt,zt)=>{if(lt)try{const an=new FormData,aa=xt?new File([Te],"annotated.png",{type:"image/png"}):lt.file;an.append("file",aa);const Sa=await fetch("/api/upload",{method:"POST",body:an});if(Sa.ok){const ba=await Sa.json();et(Jn=>[...Jn,{path:ba.path,name:zt}])}}catch{}finally{URL.revokeObjectURL(lt.blobUrl),At(null)}},xL=()=>{lt&&(URL.revokeObjectURL(lt.blobUrl),At(null))},Eh=async()=>{Oe(!0);try{const Te=em(),xt=gf(),zt=PE(),an=z2(),aa=xt.autoSave&&bl.current?await bl.current:Ch.current,Sa={};se==="claude-code"&&(Sa.permissionMode=Tt);const ba=xdt(OM());ba&&(Sa.agentSwitch=ba),Sa.planSave={enabled:an.enabled,...an.customPath&&{customPath:an.customPath}};const Jn=tm(Te);Te.enabled&&Jn&&(Sa.obsidian={vaultPath:Jn,folder:Te.folder||"plannotator",plan:t,...Te.filenameFormat&&{filenameFormat:Te.filenameFormat},...Te.filenameSeparator&&Te.filenameSeparator!=="space"&&{filenameSeparator:Te.filenameSeparator}}),xt.enabled&&!(xt.autoSave&&aa.bear)&&(Sa.bear={plan:t,customTags:xt.customTags,tagPosition:xt.tagPosition}),Rx()&&(Sa.octarine={plan:t,workspace:zt.workspace,folder:zt.folder||"plannotator"});const Ca=Array.from(Ce.getDocAnnotations().values()).some(Oo=>Oo.annotations.length>0||Oo.globalAttachments.length>0);(Er.length>0||r.length>0||ce.length>0||Ca||Hs.length>0)&&(Sa.feedback=xc),await fetch("/api/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Sa)}),ie("approved")}catch{Oe(!1)}},nC=async()=>{Oe(!0);try{const Te=z2();await fetch("/api/deny",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:xc,planSave:{enabled:Te.enabled,...Te.customPath&&{customPath:Te.customPath}}})}),ie("denied")}catch{Oe(!1)}},aC=async()=>{Oe(!0);try{await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:xc,annotations:Er,codeAnnotations:r})}),ie("denied")}catch{Oe(!1)}},md=async()=>{Oe(!0);try{await fetch("/api/approve",{method:"POST"}),ie("approved")}catch{Oe(!1)}},_u=Y.useCallback(async()=>{Rt(!0);try{if((await fetch("/api/exit",{method:"POST"})).ok)ie("exited");else throw new Error("Failed to exit")}catch{Rt(!1)}},[]),SL=Y.useCallback(()=>{ut.current?.submit()},[]),rC=Y.useCallback(async()=>{Rt(!0);try{if((await fetch("/api/exit",{method:"POST"})).ok)ie("exited");else throw new Error("Failed to exit")}catch{Rt(!1)}},[]);Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="Enter"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target,an=zt?.tagName,aa=an==="INPUT"||an==="TEXTAREA"||!!zt?.isContentEditable;if(document.querySelector('[data-plannotator-confirm-dialog="true"]')||g||m||b||B||Q||x||vt||lt||ft||Pe||at||Se.isSubmitting||!te||Ce.isActive)return;if(dn){if(document.querySelector('[data-comment-popover="true"]')||aa&&!zt?.closest(".goal-shell"))return;xt.preventDefault(),Se.canSubmit&&ut.current?.submit();return}if(aa)return;if(xt.preventDefault(),ke){if(tt&&!Dc){md();return}aC();return}const Sa=Ce.getDocAnnotations(),ba=Array.from(Sa.values()).some(Jn=>Jn.annotations.length>0||Jn.globalAttachments.length>0);if(Er.length===0&&r.length===0&&Hs.length===0&&!ba){if(se==="opencode"){const Jn=$b();if(Jn){N(Jn),S(!0);return}}Eh()}else nC()};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,m,b,B,Q,x,vt,lt,ft,Pe,at,Se.isSubmitting,te,Ce.isActive,n.length,r.length,pd.length,ke,tt,Dc,dn,Se.canSubmit,se,$b]);const Ih=Te=>{a(xt=>[...xt,Te]),A(Te.id),l(null),fe===null&&K(!0)},Bh=Yt.useCallback(Te=>{A(Te),Te&&l(null),Te&&$i&&fe===null&&K(!0)},[$i,fe]),UB=Yt.useCallback(Te=>{const xt={id:nz("code-ann"),type:"comment",scope:"line",filePath:Te.filePath,lineStart:Te.lineStart,lineEnd:Te.lineEnd,side:"new",text:Te.text,images:Te.images,originalCode:Te.originalCode,createdAt:Date.now(),author:Ai.get("displayName")||void 0};i(zt=>[...zt,xt]),A(null),l(xt.id),fe===null&&K(!0)},[fe]),PB=Yt.useCallback(Te=>{const xt=r.find(zt=>zt.id===Te);xt&&(A(null),l(Te),nt.open(xt.filePath),$i&&fe===null&&K(!0))},[r,nt.open,$i,fe]),KB=Yt.useCallback(Te=>{i(xt=>xt.filter(zt=>zt.id!==Te)),s===Te&&l(null)},[s]),HB=Yt.useCallback((Te,xt)=>{i(zt=>zt.map(an=>an.id===Te?{...an,...xt}:an))},[]),YB=Te=>{Zr.current?.removeHighlight(Te),a(xt=>xt.filter(zt=>zt.id!==Te)),o===Te&&A(null)},qB=KEt({blocks:u,annotations:n,addAnnotation:Ih,removeAnnotation:YB}),_L=Te=>{const xt=Er.find(zt=>zt.id===Te);if(xt?.source&&pd.some(zt=>zt.id===Te)){EL(Te),o===Te&&A(null);return}Te.startsWith("ann-checkbox-")&&xt&&qB.revertOverride(xt.blockId),YB(Te)},RL=(Te,xt)=>{if(Er.find(an=>an.id===Te)?.source&&pd.some(an=>an.id===Te)){LB(Te,xt);return}a(an=>an.map(aa=>aa.id===Te?{...aa,...xt}:aa))},NL=Y.useCallback((Te,xt)=>{a(zt=>zt.map(an=>an.author===Te?{...an,author:xt}:an)),i(zt=>zt.map(an=>an.author===Te?{...an,author:xt}:an))},[]),Jv=Te=>{et(xt=>[...xt,Te])},oA=Te=>{et(xt=>xt.filter(zt=>zt.path!==Te))},yh=Te=>{},xc=Y.useMemo(()=>{const Te=Ce.getDocAnnotations(),xt=Array.from(Te.values()).some(Jn=>Jn.annotations.length>0||Jn.globalAttachments.length>0),zt=Er.length>0||ce.length>0,an=Hs.length>0,aa=r.length>0;if(!zt&&!xt&&!an&&!aa)return"User reviewed the document and has no feedback.";const Sa=Ce.isActive?Te.get(Ce.filepath??"")?.isConverted??!1:X;let ba=zt?p8e(u,Er,ce,Ge==="message"?"Message Feedback":Ge==="folder"?"Folder Feedback":Ge==="file"?"File Feedback":"Plan Feedback",Ge??"plan",{sourceConverted:Sa}):"";if(xt){const Jn=new Map(Te);for(const[Ca,Oo]of Jn)Oo.markdown&&Jn.set(Ca,{...Oo,blocks:g0(Oo.markdown)});ba+=m8e(Jn)}return an&&(ba+=h8e(Hs)),aa&&(ba+=f8e(r)),ba},[u,Er,ce,Ce.getDocAnnotations,Hs,r,X,Ge,Ce.isActive,Ce.filepath]),cp=Y.useMemo(()=>Dc?xc:void 0,[xc,Dc]),hd=Ce.isActive?Ce.filepath??"linked document":Ee??(Ge==="message"?"agent message":Ge==="folder"?"folder document":"plan"),jB=Ce.isActive?Ce.filepath??void 0:be,iC=Ce.isActive?Ce.getDocAnnotations().get(Ce.filepath??"")?.isConverted??!1:X,oC=Ce.isActive?"markdown":Be,DA=ke||Ce.isActive,AC=!DA||Ge!=="folder"||Ce.isActive||!!Ee,Ru=Y.useMemo(()=>!Le||ct.archiveMode||dn||DA&&!AC?null:DA?{mode:"annotate",annotate:{content:oC==="html"&&Me?Me:t,filePath:hd,sourceInfo:jB,sourceConverted:iC,renderAs:oC,annotations:cp}}:{mode:"plan-review",plan:{plan:t,previousPlan:Gt??void 0,version:It?.version,totalVersions:It?.totalVersions,project:It?.project,annotations:cp}},[cp,hd,oC,Le,iC,jB,DA,AC,ct.archiveMode,dn,t,Gt,Me,Be,It]),zB=Ydt({context:Ru,providerId:Xi.providerId,model:Xi.model,reasoningEffort:Xi.reasoningEffort,threadTitle:DA?"Document chat":"Plan chat"}),{messages:Qh,isCreatingSession:Nu,isStreaming:lp,permissionRequests:JB,respondToPermission:Wv,ask:fd,resetSession:WB,resetThread:ZB,sessionId:VB}=zB,bd=Ue&&Ru!==null,XB=Ru?`${DA?"document":"plan"}:${oC}:${hd}:${It?.version??"current"}`:"none",$B=Y.useRef(null);Y.useEffect(()=>{Le&&($B.current&&$B.current!==XB&&ZB(),$B.current=XB)},[XB,Le,ZB]);const Zv=Y.useCallback(Te=>{os(xt=>{const zt=ru(),an=Te.providerId!==void 0?Te.providerId:xt.providerId,aa=Te.providerId!==void 0&&Te.providerId!==xt.providerId,Sa=To.find(Ca=>Ca.id===an)??null,ba=aa?Te.model!==void 0?Te.model:Uj(Sa,zt.preferredModels):Te.model!==void 0?Te.model:xt.model,Jn={...xt,...Te,providerId:an,model:ba};return Ske({providerId:Jn.providerId,model:Jn.model,origin:se,settings:zt}),Jn}),WB()},[To,se,WB]),wh=Y.useCallback(()=>{fe!==null&&Ua({restore:!1,panelOpen:!0}),O("ai"),K(!0)},[Ua,fe]),ey=Y.useCallback(()=>{Xt(),wh()},[Xt,wh]),AA=Y.useCallback((Te,xt)=>{bd&&(Xt(),wh(),fd({prompt:Te,scope:xt?{kind:xt.kind,label:xt.label,text:xt.text,sourcePath:xt.sourcePath??hd}:void 0,contextUpdate:VB?cp:void 0}))},[cp,hd,VB,fd,bd,Xt,wh]),sC=Y.useCallback(Te=>{AA(Te,{kind:"general",label:DA?"Document":"Plan",sourcePath:hd})},[DA,hd,AA]),wo=Yt.useMemo(()=>wdt(),[]),Cl=Yt.useCallback(async Te=>{if(!(!wo||Pe||!fl&&!Su)){Oe(!0);try{const xt=await kdt(Te,wo,Su||fl);xt&&(xt.type==="success"?(Ws.success(xt.message),ie(Te===kS.Approve?"approved":"denied")):Ws.error(xt.message))}finally{Oe(!1)}}},[wo,Pe,fl,Su]),ty=Yt.useCallback(()=>Cl(kS.Approve),[Cl]),cC=Yt.useCallback(()=>Cl(kS.Feedback),[Cl]),dp=()=>{const Te=new Blob([xc],{type:"text/plain"}),xt=URL.createObjectURL(Te),zt=document.createElement("a");zt.href=xt,zt.download="annotations.md",zt.click(),URL.revokeObjectURL(xt),Ws.success("Downloaded annotations")},Mu=async Te=>{const xt={};if(Te==="obsidian"){const an=em(),aa=tm(an);aa&&(xt.obsidian={vaultPath:aa,folder:an.folder||"plannotator",plan:t,...an.filenameFormat&&{filenameFormat:an.filenameFormat},...an.filenameSeparator&&an.filenameSeparator!=="space"&&{filenameSeparator:an.filenameSeparator}})}if(Te==="bear"){const an=gf();xt.bear={plan:t,customTags:an.customTags,tagPosition:an.tagPosition}}if(Te==="octarine"){const an=PE();xt.octarine={plan:t,workspace:an.workspace,folder:an.folder||"plannotator"}}const zt=Te==="obsidian"?"Obsidian":Te==="bear"?"Bear":"Octarine";try{const Sa=(await(await fetch("/api/save-notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(xt)})).json()).results?.[Te];Sa?.success?Ws.success(`Saved to ${zt}`):Ws.error(Sa?.error||"Save failed")}catch{Ws.error("Save failed")}},Cd=async()=>{const Te=igt(window.location.origin);try{await navigator.clipboard.writeText(Te),Ws.success("Agent instructions copied")}catch{Ws.error("Failed to copy")}},ny=async()=>{const Te=Su||fl;if(Te)try{await navigator.clipboard.writeText(Te),Ws.success("Share link copied")}catch{Ws.error("Failed to copy")}};Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="s"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target?.tagName;if(zt==="INPUT"||zt==="TEXTAREA"||g||b||B||Q||x||vt||lt||ft||!te)return;xt.preventDefault();const an=Kve(),aa=rAe(),Sa=gf().enabled,ba=Rx();an==="download"?dp():an==="obsidian"&&aa?Mu("obsidian"):an==="bear"&&Sa?Mu("bear"):an==="octarine"&&ba?Mu("octarine"):(zn("notes"),p(!0))};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,b,B,Q,x,vt,lt,ft,te,t,xc]),Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="p"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target?.tagName;zt==="INPUT"||zt==="TEXTAREA"||g||b||B||Q||x||vt||lt||ft||(xt.preventDefault(),window.print())};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,b,B,Q,x,vt,lt,ft]);const ss=Y.useMemo(()=>q5(se),[se]),to=Y.useRef({handleApprove:Eh,handleDeny:nC,handleAnnotateApprove:md,handleAnnotateFeedback:aC,handleAnnotateExit:_u,handleQuickSaveToNotes:Mu,handleDownloadAnnotations:dp,handleCopyAgentInstructions:Cd,handleCopyShareLink:ny,getAgentWarning:$b,getDocAnnotations:Ce.getDocAnnotations});to.current={handleApprove:Eh,handleDeny:nC,handleAnnotateApprove:md,handleAnnotateFeedback:aC,handleAnnotateExit:_u,handleQuickSaveToNotes:Mu,handleDownloadAnnotations:dp,handleCopyAgentInstructions:Cd,handleCopyShareLink:ny,getAgentWarning:$b,getDocAnnotations:Ce.getDocAnnotations};const ML=Y.useCallback(()=>{Dc?(v("close"),k(!0)):to.current.handleAnnotateExit()},[Dc]),xA=Y.useCallback(()=>{const Te=to.current,xt=Te.getDocAnnotations(),zt=Array.from(xt.values()).some(an=>an.annotations.length>0||an.globalAttachments.length>0);Er.length===0&&r.length===0&&Hs.length===0&&!zt?C(!0):Te.handleDeny()},[Er.length,r.length,Hs.length]),ay=Y.useCallback(()=>{const Te=to.current;if(ke){if(Dc){v("approve"),k(!0);return}Te.handleAnnotateApprove();return}if(se==="claude-code"&&(Er.length>0||r.length>0)){y(!0);return}if(se==="opencode"){const xt=Te.getAgentWarning();if(xt){N(xt),S(!0);return}}Te.handleApprove()},[ke,Dc,se,Er.length,r.length]),El=Y.useCallback(()=>to.current.handleAnnotateFeedback(),[]),Vv=Y.useCallback(()=>to.current.handleAnnotateApprove(),[]),lC=Y.useCallback(()=>to.current.handleDownloadAnnotations(),[]),Fu=Y.useCallback(()=>to.current.handleCopyAgentInstructions(),[]),ry=Y.useCallback(()=>to.current.handleCopyShareLink(),[]),Xv=Y.useCallback(()=>T(!0),[]),iy=Y.useCallback(()=>T(!1),[]),$v=Y.useCallback(()=>{zn(void 0),p(!0)},[]),cs=Y.useCallback(()=>window.print(),[]),up=Y.useCallback(()=>h(!0),[]),gp=Y.useCallback(()=>to.current.handleQuickSaveToNotes("obsidian"),[]),dC=Y.useCallback(()=>to.current.handleQuickSaveToNotes("octarine"),[]),kh=Y.useCallback(()=>to.current.handleQuickSaveToNotes("bear"),[]),sA=Y.useMemo(()=>({compact:832,default:1040,wide:1280})[$.planWidth]??832,[$.planWidth]),Fi=Bt&&fe==="wide"?null:sA,Ed=To.find(Te=>Te.id===Xi.providerId)??null,Sc=kr&&bd&&Le&&te&&!vA&&!ct.archiveMode&&!dn&&!vt&&!ft;return ht&&!vA?I.jsx(sAe,{defaultTheme:"dark",children:I.jsx("div",{className:"h-screen bg-background"})}):I.jsx(sAe,{defaultTheme:"dark",children:I.jsx(ndt,{delayDuration:900,skipDelayDuration:200,disableHoverableContent:!0,children:I.jsxs("div",{"data-print-region":"root",className:"h-screen flex flex-col bg-background overflow-hidden",children:[I.jsx(_0t,{isApiMode:te,annotateMode:ke,archiveMode:ct.archiveMode,goalSetupMode:dn,goalSetupCanSubmit:Se.canSubmit,goalSetupIsSubmitting:Se.isSubmitting,goalSetupSubmitLabel:Se.submitLabel,gate:tt,isSharedSession:vA,origin:se,isSubmitting:Pe,isExiting:at,isPanelOpen:U&&R==="annotations",aiAvailable:bd,isAIChatOpen:U&&R==="ai",aiHasMessages:Qh.length>0,hasAnyAnnotations:Dc,linkedDocIsActive:Ce.isActive,callbackShareUrlReady:wo?!!(fl||Su):!0,canShareCurrentSession:Vb,agentName:ss,availableAgents:bh,showAnnotationsWarning:Er.length>0||r.length>0,callbackConfig:wo,taterMode:z,mobileSettingsOpen:F,gitUser:ue,onCallbackFeedback:cC,onCallbackApprove:ty,onAnnotateExit:ML,onGoalSetupExit:rC,onGoalSetupSubmit:SL,onAnnotateFeedback:El,onAnnotateApprove:Vv,onFeedback:xA,onApprove:ay,onAnnotationPanelToggle:Mi,onAIChatToggle:J,onArchiveCopy:ct.copy,onArchiveDone:ct.done,onTaterModeChange:zv,onIdentityChange:NL,onUIPreferencesChange:V,onOpenSettings:Xv,onCloseSettings:iy,onOpenExport:$v,onCopyAgentInstructions:Fu,onDownloadAnnotations:lC,onPrint:cs,onCopyShareLink:ry,onOpenImport:up,onSaveToObsidian:gp,onSaveToBear:kh,onSaveToOctarine:dC,appVersion:"0.19.23",updateInfo:qe,isWSL:De,agentInstructionsEnabled:te&&!ct.archiveMode&&!ke&&!dn,obsidianConfigured:rAe(),bearConfigured:gf().enabled,octarineConfigured:Rx()}),Ce.error&&I.jsxs("div",{className:"bg-destructive/10 border-b border-destructive/20 px-4 py-2 flex items-center gap-2 flex-shrink-0",children:[I.jsx("span",{className:"text-xs text-destructive",children:Ce.error}),I.jsx("button",{onClick:Ce.dismissError,className:"ml-auto text-xs text-destructive/60 hover:text-destructive",children:"dismiss"})]}),I.jsx(F0e.Provider,{value:Dr,children:I.jsxs("div",{"data-print-region":"content",className:`flex-1 flex overflow-hidden relative z-0 ${Un?"select-none":""}`,children:[z&&I.jsx(fdt,{}),fe===null&&!bn.isOpen&&!dn&&I.jsx(sgt,{activeTab:bn.activeTab,onToggleTab:Ni,hasDiff:ee.hasPreviousVersion,showVersionsTab:It!==null&&It.totalVersions>1,showFilesTab:na&&!ct.archiveMode,hasFileAnnotations:ii,className:"hidden lg:flex absolute left-0 top-0 z-10"}),bn.isOpen&&!dn&&I.jsxs(I.Fragment,{children:[I.jsx(Egt,{activeTab:bn.activeTab,onTabChange:Te=>{Ni(Te),Te==="archive"&&!ct.archiveMode&&ct.fetchPlans()},onClose:bn.close,width:wn.width,blocks:u,annotations:n,activeSection:Ov,onTocNavigate:yh,linkedDocFilepath:Ce.filepath,onLinkedDocBack:Ce.isActive?eo:void 0,backLabel:sp,showFilesTab:na&&!ct.archiveMode,fileAnnotationCounts:gr,highlightedFiles:Qo,fileBrowser:un,onFilesSelectFile:qn,onFilesFetchAll:()=>un.fetchAll(xn),onFilesRetryVaultDir:Te=>un.addVaultDir(Te),hasFileAnnotations:ii,showVersionsTab:It!==null&&It.totalVersions>1,versionInfo:It,versions:ee.versions,selectedBaseVersion:ee.diffBaseVersion,onSelectBaseVersion:ee.selectBaseVersion,isPlanDiffActive:Hn,hasPreviousVersion:ee.hasPreviousVersion,onActivatePlanDiff:()=>ga(!0),isLoadingVersions:ee.isLoadingVersions,isSelectingVersion:ee.isSelectingVersion,fetchingVersion:ee.fetchingVersion,onFetchVersions:ee.fetchVersions,showArchiveTab:te&&!ke&&!dn,archivePlans:ct.plans,selectedArchiveFile:ct.selectedFile,onArchiveSelect:ct.select,isLoadingArchive:ct.isLoading}),I.jsx(GAe,{...wn.handleProps,className:"hidden lg:block",side:"left"})]}),I.jsxs(sB,{element:"main",className:`flex-1 min-w-0 bg-grid ${!dn&&!bn.isOpen&&fe===null?"lg:pl-[30px]":""}`,"data-print-region":"document",onViewportReady:Ks,children:[I.jsx(qp,{isOpen:!!fh,onClose:vL,onConfirm:GB,title:"Draft Recovered",message:fh?`Found ${fh.count} annotation${fh.count!==1?"s":""} from ${fh.timeAgo}. Would you like to restore them?`:"",confirmText:"Restore",cancelText:"Dismiss",showCancel:!0}),I.jsxs("div",{ref:Ae,className:"min-h-full flex flex-col items-center px-2 py-3 md:px-10 md:py-8 xl:px-16 relative z-10",children:[!dn&&!Hn&&!ct.archiveMode&&$.stickyActionsEnabled&&I.jsx(udt,{inputMethod:q,onInputMethodChange:eC,mode:G,onModeChange:OB,taterMode:z,repoInfo:mn,planDiffStats:ee.diffStats,isPlanDiffActive:Hn,hasPreviousVersion:ee.hasPreviousVersion,onPlanDiffToggle:()=>ga(!Hn),archiveInfo:ct.currentInfo,maxWidth:Fi,remountToken:Ce.isActive?`doc:${Ce.filepath}`:"plan"}),!dn&&!Hn&&!ct.archiveMode&&I.jsx("div",{"data-print-hide":!0,className:"w-full mb-3 md:mb-4 flex items-center justify-start",style:Fi==null?void 0:{maxWidth:Fi},children:I.jsx(vve,{inputMethod:q,onInputMethodChange:eC,mode:G,onModeChange:OB,taterMode:z})}),He&&I.jsx("div",{className:"w-full flex justify-center",children:I.jsx(Oxe,{ref:ut,bundle:He,maxWidth:sA,onActionStateChange:Ze,onSubmitted:()=>ie("approved")})}),ee.diffBlocks&&ee.diffStats&&!dn&&I.jsx("div",{className:"w-full flex justify-center",style:{display:Hn?void 0:"none"},children:I.jsx(Ngt,{diffBlocks:ee.diffBlocks,diffStats:ee.diffStats,diffMode:Ut,onDiffModeChange:Ct,onPlanDiffToggle:()=>ga(!1),repoInfo:mn,baseVersionLabel:ee.diffBaseVersion!=null?`v${ee.diffBaseVersion}`:void 0,baseVersion:ee.diffBaseVersion??void 0,maxWidth:sA,annotations:IL,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G})}),Ge==="folder"&&!t&&!Ce.isActive&&!dn&&I.jsx("div",{className:"w-full flex justify-center",children:I.jsxs("div",{className:"w-full max-w-3xl p-12 text-center text-muted-foreground",children:[I.jsx("p",{className:"text-lg font-medium mb-2",children:"Select a file to annotate"}),I.jsx("p",{className:"text-sm",children:"Pick a markdown file from the sidebar to begin."})]})}),I.jsxs("div",{className:"w-full flex justify-center relative",style:{display:dn||Hn&&ee.diffBlocks||Ge==="folder"&&!t&&!Ce.isActive?"none":void 0},children:[Bt&&!Hn&&!ct.archiveMode&&I.jsx("div",{"data-print-hide":!0,className:"absolute -top-5 left-0 right-0 mx-auto w-full flex justify-end pointer-events-none",style:Fi===null?void 0:{maxWidth:Fi??832},children:I.jsx("div",{className:`pointer-events-auto flex items-center gap-1.5 text-[11px] tracking-wide ${z?"mr-[60px]":"mr-[4px]"}`,children:["wide","focus"].map((Te,xt)=>I.jsxs(Yt.Fragment,{children:[xt>0&&I.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground/30 select-none",children:"|"}),I.jsx(adt,{side:"top",align:"end",content:Te==="wide"?"Hide panels and expand document width":"Hide panels, keep document width",children:I.jsx("button",{type:"button",onClick:()=>ta(Te),"aria-pressed":fe===Te,className:`cursor-pointer rounded-sm transition-colors duration-150 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:opacity-80 ${fe===Te?"text-foreground":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:Te.charAt(0).toUpperCase()+Te.slice(1)})})]},Te))})}),Be==="html"?I.jsx(L0e,{ref:Zr,rawHtml:Me,annotations:Pv,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G,globalAttachments:ce,onAddGlobalAttachment:Jv,onRemoveGlobalAttachment:oA,maxWidth:Fi,onAskAI:bd?AA:void 0}):I.jsx(IAt,{ref:Zr,blocks:u,markdown:t,frontmatter:d,annotations:Pv,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G,inputMethod:q,taterMode:z,globalAttachments:ce,onAddGlobalAttachment:Jv,onRemoveGlobalAttachment:oA,repoInfo:mn,stickyActions:$.stickyActionsEnabled,planDiffStats:Ce.isActive?null:ee.diffStats,isPlanDiffActive:Hn,onPlanDiffToggle:()=>ga(!Hn),hasPreviousVersion:!Ce.isActive&&ee.hasPreviousVersion,showDemoBadge:!te&&!TB&&!vA,maxWidth:Fi,onOpenLinkedDoc:Cr,onOpenCodeFile:nt.open,linkedDocInfo:Ce.isActive?{filepath:Ce.filepath,onBack:eo,label:un.dirs.find(Te=>Te.path===un.activeDirPath)?.isVault?"Vault File":un.activeFile?"File":void 0,backLabel:sp}:null,imageBaseDir:We,codePathBaseDir:Ye,copyLabel:Ge==="message"?"Copy message":Ge==="file"||Ge==="folder"?"Copy file":void 0,archiveInfo:ct.currentInfo,sourceInfo:be,onToggleCheckbox:qB.toggle,checkboxOverrides:qB.overrides,actionsLabelMode:ne,onAskAI:bd?AA:void 0},Ce.isActive?`doc:${Ce.filepath}`:"plan")]})]})]}),U&&fe===null&&!dn&&(R==="annotations"||bd)&&I.jsx(GAe,{...ar.handleProps,className:"hidden md:block",side:"right"}),I.jsx(Gst,{isOpen:U&&R==="annotations"&&fe===null&&!dn,blocks:u,annotations:Er,selectedId:o??s,onSelect:Bh,onDelete:_L,onEdit:RL,codeAnnotations:r,onSelectCodeAnnotation:PB,onDeleteCodeAnnotation:KB,onEditCodeAnnotation:HB,sharingEnabled:Vb,width:ar.width,editorAnnotations:Hs,onDeleteEditorAnnotation:CL,onClose:()=>K(!1),onQuickCopy:async()=>{await navigator.clipboard.writeText(abe(xc))},onShare:Vb&&(fl||Su)?()=>{K(!1),zn("share"),p(!0)}:void 0,otherFileAnnotations:kc,onOtherFileAnnotationsClick:FB}),U&&R==="ai"&&fe===null&&!dn&&bd&&I.jsxs("aside",{"data-annotation-panel":"true",className:`border-l border-border/50 bg-card/30 backdrop-blur-sm flex flex-col flex-shrink-0 ${$i?"fixed top-12 bottom-0 right-0 z-[60] w-full max-w-sm shadow-2xl bg-card":""}`,style:$i?void 0:{width:ar.width??288},children:[I.jsx("div",{className:"px-3 flex items-center border-b border-border/50",style:{height:"var(--panel-header-h)"},children:I.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[I.jsx("button",{onClick:()=>K(!1),className:"flex items-center justify-center w-5 h-5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors flex-shrink-0",title:"Close sidebar","aria-label":"Close AI sidebar",children:I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}),I.jsx(cm,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),I.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground truncate",children:"AI"}),Qh.length>0&&I.jsx("span",{className:"text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground",children:Qh.length})]})}),I.jsx(act,{messages:Qh,isCreatingSession:Nu,isStreaming:lp,onAskGeneral:sC,permissionRequests:JB,onRespondToPermission:Wv,aiProviders:To,aiConfig:Xi,onAIConfigChange:Zv})]})]})}),nt.popoutProps&&I.jsx(sEt,{...nt.popoutProps,annotations:r.filter(Te=>Te.filePath===nt.popoutProps?.filepath),selectedAnnotationId:s,onAddAnnotation:UB,onEditAnnotation:HB,onDeleteAnnotation:KB,onSelectAnnotation:Te=>{A(null),l(Te)}}),I.jsx(uct,{isOpen:g,onClose:()=>{p(!1),zn(void 0)},shareUrl:fl,shareUrlSize:BL,shortShareUrl:Su,isGeneratingShortUrl:yL,shortUrlError:Hv,onGenerateShortUrl:QL,annotationsOutput:xc,annotationCount:Er.length+r.length,taterSprite:z?I.jsx(ez,{}):void 0,sharingEnabled:Vb,markdown:t,isApiMode:te,initialTab:on}),I.jsx(gct,{isOpen:m,onClose:()=>h(!1),onImport:wL,shareBaseUrl:Mt}),I.jsx(qp,{isOpen:b,onClose:()=>C(!1),title:"Add Annotations First",message:`To provide feedback, select text in the plan and add annotations. ${ss} will use your annotations to revise the plan.`,variant:"info"}),I.jsx(qp,{isOpen:B,onClose:()=>y(!1),onConfirm:()=>{y(!1),Eh()},title:"Annotations Won't Be Sent",message:I.jsxs(I.Fragment,{children:[ss," doesn't yet support feedback on approval. Your ",Er.length+r.length," annotation",Er.length+r.length!==1?"s":""," will be lost."]}),subMessage:I.jsxs(I.Fragment,{children:["To send feedback, use ",I.jsx("strong",{children:"Send Feedback"})," instead.",I.jsx("br",{}),I.jsx("br",{}),"Want this feature? Upvote these issues:",I.jsx("br",{}),I.jsx("a",{href:"https://github.com/anthropics/claude-code/issues/16001",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"#16001"})," · ",I.jsx("a",{href:"https://github.com/anthropics/claude-code/issues/15755",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"#15755"})]}),confirmText:"Approve Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:Q,onClose:()=>k(!1),onConfirm:()=>{k(!1),_==="approve"?md():_u()},title:"Annotations Won't Be Sent",message:I.jsxs(I.Fragment,{children:["You have ",Kv," annotation",Kv!==1?"s":""," that will be lost if you ",_==="approve"?"approve":"close","."]}),subMessage:"To send your annotations, use Send Annotations instead.",confirmText:_==="approve"?"Approve Anyway":"Close Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:x,onClose:()=>S(!1),onConfirm:()=>{S(!1),Eh()},title:"Agent Not Found",message:L,subMessage:I.jsxs(I.Fragment,{children:["You can change the agent in ",I.jsx("strong",{children:"Settings"}),", or approve anyway and OpenCode will use the default agent."]}),confirmText:"Approve Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:!!qv&&!te,onClose:kL,title:"Shared Plan Could Not Be Loaded",message:qv,subMessage:"You are viewing a demo plan. This is sample content — it is not your data or anyone else's.",variant:"warning"}),I.jsx(c8e,{position:"top-right",offset:64,toastOptions:{style:{"--normal-bg":"var(--card)","--normal-border":"var(--border)","--normal-text":"var(--foreground)","--success-bg":"oklch(from var(--success) l c h / 0.15)","--success-border":"oklch(from var(--success) l c h / 0.3)","--success-text":"var(--success)","--error-bg":"oklch(from var(--destructive) l c h / 0.15)","--error-border":"oklch(from var(--destructive) l c h / 0.3)","--error-text":"var(--destructive)"}}}),I.jsx(Mdt,{submitted:ft,title:ct.archiveMode?"Archive Closed":ft==="exited"?"Session Closed":dn?"Answers Submitted":ft==="approved"?ke?"Approved":"Plan Approved":ke?"Annotations Sent":"Feedback Sent",subtitle:ft==="exited"?"Annotation session closed without feedback.":ct.archiveMode?"You can reopen with plannotator archive.":dn?`${ss} will use your answers to continue.`:ft==="approved"?ke?`${ss} will proceed.`:`${ss} will proceed with the implementation.`:ke?`${ss} will address your annotations on the ${Ge==="message"?"message":Ge==="folder"?"files":"file"}.`:`${ss} will revise the plan based on your annotations.`,agentLabel:ss}),I.jsx(Odt,{isOpen:Sc,origin:se,providerName:Ed?.name??null,onOpenAI:ey,onDismiss:Xt}),I.jsx(kCe,{isOpen:!!lt,imageSrc:lt?.blobUrl??"",initialName:lt?.initialName,onAccept:DL,onClose:xL}),I.jsx(iut,{isOpen:vt,onComplete:Te=>{Kt(Te),_t(!1)}})]})})})},NSe=document.getElementById("root");if(!NSe)throw new Error("Could not find root element to mount to");const F0t=L4e.createRoot(NSe);F0t.render(I.jsx(Yt.StrictMode,{children:I.jsx(M0t,{})}));class Cs{constructor(e,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=a}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Cs(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class dc{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new dc(n,Cs.range(this,e))}}class nn{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+e,r,i,o=n&&n.loc;if(o&&o.start<=o.end){var A=o.lexer.input;r=o.start,i=o.end,r===A.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var s=A.slice(r,i).replace(/[^]/g,"$&̲"),l;r>15?l="…"+A.slice(r-15,r):l=A.slice(0,r);var d;i+15<A.length?d=A.slice(i,i+15)+"…":d=A.slice(i),a+=l+s+d}var u=new Error(a);return u.name="ParseError",u.__proto__=nn.prototype,u.position=r,r!=null&&i!=null&&(u.length=i-r),u.rawMessage=e,u}}nn.prototype.__proto__=Error.prototype;var L0t=function(e,n){return e===void 0?n:e},T0t=/([A-Z])/g,G0t=function(e){return e.replace(T0t,"-$1").toLowerCase()},O0t={"&":"&",">":">","<":"<",'"':""","'":"'"},U0t=/[&><"']/g;function P0t(t){return String(t).replace(U0t,e=>O0t[e])}var MSe=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},K0t=function(e){var n=MSe(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},H0t=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Y0t=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Xa={deflt:L0t,escape:P0t,hyphenate:G0t,getBaseElem:MSe,isCharacterBox:K0t,protocolFromUrl:Y0t},a0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function q0t(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Vz{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in a0)if(a0.hasOwnProperty(n)){var a=a0[n];this[n]=e[n]!==void 0?a.processor?a.processor(e[n]):e[n]:q0t(a)}}reportNonstrict(e,n,a){var r=this.strict;if(typeof r=="function"&&(r=r(e,n,a)),!(!r||r==="ignore")){if(r===!0||r==="error")throw new nn("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),a);r==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,a){var r=this.strict;if(typeof r=="function")try{r=r(e,n,a)}catch{r="error"}return!r||r==="ignore"?!1:r===!0||r==="error"?!0:r==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=Xa.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class Fp{constructor(e,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=a}sup(){return Yd[j0t[this.id]]}sub(){return Yd[z0t[this.id]]}fracNum(){return Yd[J0t[this.id]]}fracDen(){return Yd[W0t[this.id]]}cramp(){return Yd[Z0t[this.id]]}text(){return Yd[V0t[this.id]]}isTight(){return this.size>=2}}var Xz=0,ER=1,zE=2,Sg=3,tk=4,Xc=5,_I=6,qA=7,Yd=[new Fp(Xz,0,!1),new Fp(ER,0,!0),new Fp(zE,1,!1),new Fp(Sg,1,!0),new Fp(tk,2,!1),new Fp(Xc,2,!0),new Fp(_I,3,!1),new Fp(qA,3,!0)],j0t=[tk,Xc,tk,Xc,_I,qA,_I,qA],z0t=[Xc,Xc,Xc,Xc,qA,qA,qA,qA],J0t=[zE,Sg,tk,Xc,_I,qA,_I,qA],W0t=[Sg,Sg,Xc,Xc,qA,qA,qA,qA],Z0t=[ER,ER,Sg,Sg,Xc,Xc,qA,qA],V0t=[Xz,ER,zE,Sg,zE,Sg,zE,Sg],Zn={DISPLAY:Yd[Xz],TEXT:Yd[zE],SCRIPT:Yd[tk],SCRIPTSCRIPT:Yd[_I]},P7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function X0t(t){for(var e=0;e<P7.length;e++)for(var n=P7[e],a=0;a<n.blocks.length;a++){var r=n.blocks[a];if(t>=r[0]&&t<=r[1])return n.name}return null}var YS=[];P7.forEach(t=>t.blocks.forEach(e=>YS.push(...e)));function FSe(t){for(var e=0;e<YS.length;e+=2)if(t>=YS[e]&&t<=YS[e+1])return!0;return!1}var jC=80,$0t=function(e,n){return"M95,"+(622+e+n)+`
|
|
1850
|
+
---`})]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Obsidian when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":B.autoSave,onClick:()=>ut({autoSave:!B.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${B.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${B.autoSave?"translate-x-6":"translate-x-1"}`})})]}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Vault Browser"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Browse and annotate vault files from the sidebar"})]}),I.jsx("button",{role:"switch","aria-checked":B.vaultBrowserEnabled,onClick:()=>ut({vaultBrowserEnabled:!B.vaultBrowserEnabled}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${B.vaultBrowserEnabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${B.vaultBrowserEnabled?"translate-x-6":"translate-x-1"}`})})]})]})]})]}),m==="bear"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Bear Notes"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save approved plans to Bear"})]}),I.jsx("button",{role:"switch","aria-checked":x.enabled,onClick:()=>Se({enabled:!x.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${x.enabled?"translate-x-6":"translate-x-1"}`})})]}),x.enabled&&I.jsxs("div",{className:"mt-3 space-y-3",children:[I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Custom Tags"}),I.jsx("input",{type:"text",value:x.customTags,onChange:Ee=>Se({customTags:Ee.target.value}),onBlur:Ee=>Se({customTags:lct(Ee.target.value)}),placeholder:"plan, work",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Comma-separated, kebab-case. Leave empty for auto-generated tags."})]}),I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Tag Position"}),I.jsxs("select",{value:x.tagPosition,onChange:Ee=>Se({tagPosition:Ee.target.value}),className:"w-full px-3 py-2 bg-muted rounded-lg text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",children:[I.jsx("option",{value:"append",children:"Append (end of note)"}),I.jsx("option",{value:"prepend",children:"Prepend (after title)"})]})]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Bear when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":x.autoSave,onClick:()=>Se({autoSave:!x.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${x.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${x.autoSave?"translate-x-6":"translate-x-1"}`})})]})]})]}),m==="octarine"&&I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-sm font-medium",children:"Octarine"}),I.jsx("div",{className:"text-xs text-muted-foreground",children:"Auto-save approved plans to Octarine"})]}),I.jsx("button",{role:"switch","aria-checked":L.enabled,onClick:()=>Ze({enabled:!L.enabled}),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${L.enabled?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${L.enabled?"translate-x-6":"translate-x-1"}`})})]}),L.enabled&&I.jsxs("div",{className:"mt-3 space-y-3",children:[I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Workspace Name"}),I.jsx("input",{type:"text",value:L.workspace,onChange:Ee=>Ze({workspace:Ee.target.value}),placeholder:"My Workspace",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"The Octarine workspace name to save plans into."})]}),I.jsxs("div",{className:"space-y-1.5 pl-0.5",children:[I.jsx("label",{className:"text-xs text-muted-foreground",children:"Folder"}),I.jsx("input",{type:"text",value:L.folder,onChange:Ee=>Ze({folder:Ee.target.value}),placeholder:"plannotator",className:"w-full px-3 py-2 bg-muted rounded-lg text-xs font-mono placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Subfolder within the workspace for saved plans."})]}),I.jsxs("div",{className:"text-[10px] text-muted-foreground/70",children:["Plans saved to: ",L.workspace||"..."," / ",L.folder||"plannotator","/"]}),I.jsx("div",{className:"border-t border-border/30"}),I.jsxs("div",{className:"flex items-center justify-between",children:[I.jsxs("div",{children:[I.jsx("div",{className:"text-xs font-medium",children:"Auto-save on Plan Arrival"}),I.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Automatically save to Octarine when a plan loads, before you approve or deny"})]}),I.jsx("button",{role:"switch","aria-checked":L.autoSave,onClick:()=>Ze({autoSave:!L.autoSave}),className:`relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full transition-colors ${L.autoSave?"bg-primary":"bg-muted"}`,children:I.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition-transform ${L.autoSave?"translate-x-6":"translate-x-1"}`})})]})]})]})]})})]})]})}),document.body),g&&ui.createPortal(I.jsxs("div",{className:"fixed inset-0 z-[100] flex flex-col pointer-events-none",children:[I.jsx("div",{className:"flex-1"}),I.jsxs("div",{className:"pointer-events-auto w-full bg-card border-t-2 border-primary/30 shadow-[0_-4px_20px_rgba(0,0,0,0.4)] flex flex-col max-h-[35vh] overflow-hidden",onClick:Ee=>Ee.stopPropagation(),children:[I.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border flex-shrink-0",children:[I.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Theme Preview"}),I.jsx("button",{onClick:()=>{p(!1),u(!0)},className:"px-2.5 py-1 rounded-md text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:"Done"})]}),I.jsx("div",{className:"p-3 overflow-y-auto flex-1 min-h-0",children:I.jsx(dce,{compact:!0})})]})]}),document.body)]})},fIt=({className:t,panelClassName:e,renderTrigger:n,children:a})=>{const[r,i]=Y.useState(!1),o=Y.useRef(null);return Y.useEffect(()=>{if(!r)return;const A=l=>{o.current&&!o.current.contains(l.target)&&i(!1)},s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",A),document.addEventListener("keydown",s),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",s)}},[r]),I.jsxs("div",{ref:o,className:t?`relative ${t}`:"relative",children:[n({isOpen:r,toggleMenu:()=>i(A=>!A)}),r&&I.jsx("div",{className:e??"absolute top-full right-0 mt-1 w-56 rounded-lg border border-border bg-popover py-1 shadow-xl z-[70]",children:a({closeMenu:()=>i(!1)})})]})},kd=({onClick:t,icon:e,label:n,subtitle:a,badge:r})=>I.jsxs("button",{onClick:t,className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-muted",children:[I.jsx("span",{className:"text-muted-foreground",children:e}),a?I.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[I.jsx("span",{children:n}),I.jsx("span",{className:"text-[10px] text-muted-foreground",children:a})]}):I.jsx("span",{className:"flex-1",children:n}),r]}),Yx=()=>I.jsx("div",{className:"my-1 border-t border-border"}),bIt=({children:t})=>I.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),CIt=({className:t="w-3.5 h-3.5"})=>I.jsxs("svg",{className:`${t} flex-shrink-0`,viewBox:"0 0 64 64",fill:"none",stroke:"currentColor",children:[I.jsx("path",{d:"M40.5 40.5L55 55",strokeWidth:7,strokeLinecap:"round"}),I.jsx("circle",{cx:"27",cy:"27",r:"20",strokeWidth:4}),I.jsx("path",{d:"M27 14L29.2 14.3L30.2 17.2L32.6 18.6L35.5 17.5L37.2 19.2L36.1 22.1L37.5 24.5L40.4 25.5L40.7 27.7L40.4 29.9L37.5 30.9L36.1 33.3L37.2 36.2L35.5 37.9L32.6 36.8L30.2 38.2L29.2 41.1L27 41.4L24.8 41.1L23.8 38.2L21.4 36.8L18.5 37.9L16.8 36.2L17.9 33.3L16.5 30.9L13.6 29.9L13.3 27.7L13.6 25.5L16.5 24.5L17.9 22.1L16.8 19.2L18.5 17.5L21.4 18.6L23.8 17.2L24.8 14.3Z",strokeWidth:1.5,strokeLinejoin:"round"}),I.jsx("circle",{cx:"27",cy:"27.7",r:"7",strokeWidth:1.5})]}),zxe=Y.createContext({});function EIt(t){const e=Y.useRef(null);return e.current===null&&(e.current=t()),e.current}const IIt=typeof window<"u",BIt=IIt?Y.useLayoutEffect:Y.useEffect,Qz=Y.createContext(null);function wz(t,e){t.indexOf(e)===-1&&t.push(e)}function dR(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const uu=(t,e,n)=>n>e?e:n<t?t:n;let kz=()=>{};const Dm={},Jxe=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Wxe(t){return typeof t=="object"&&t!==null}const Zxe=t=>/^0[^.\s]+$/u.test(t);function Vxe(t){let e;return()=>(e===void 0&&(e=t()),e)}const tl=t=>t,yIt=(t,e)=>n=>e(t(n)),Zk=(...t)=>t.reduce(yIt),V0=(t,e,n)=>{const a=e-t;return a===0?1:(n-t)/a};class vz{constructor(){this.subscriptions=[]}add(e){return wz(this.subscriptions,e),()=>dR(this.subscriptions,e)}notify(e,n,a){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,a);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(e,n,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lc=t=>t*1e3,Vc=t=>t/1e3;function Xxe(t,e){return e?t*(1e3/e):0}const $xe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,QIt=1e-7,wIt=12;function kIt(t,e,n,a,r){let i,o,A=0;do o=e+(n-e)/2,i=$xe(o,a,r)-t,i>0?n=o:e=o;while(Math.abs(i)>QIt&&++A<wIt);return o}function Vk(t,e,n,a){if(t===e&&n===a)return tl;const r=i=>kIt(i,0,1,t,n);return i=>i===0||i===1?i:$xe(r(i),e,a)}const e1e=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,t1e=t=>e=>1-t(1-e),n1e=Vk(.33,1.53,.69,.99),Dz=t1e(n1e),a1e=e1e(Dz),r1e=t=>t>=1?1:(t*=2)<1?.5*Dz(t):.5*(2-Math.pow(2,-10*(t-1))),xz=t=>1-Math.sin(Math.acos(t)),i1e=t1e(xz),o1e=e1e(xz),vIt=Vk(.42,0,1,1),DIt=Vk(0,0,.58,1),A1e=Vk(.42,0,.58,1),xIt=t=>Array.isArray(t)&&typeof t[0]!="number",s1e=t=>Array.isArray(t)&&typeof t[0]=="number",SIt={linear:tl,easeIn:vIt,easeInOut:A1e,easeOut:DIt,circIn:xz,circInOut:o1e,circOut:i1e,backIn:Dz,backInOut:a1e,backOut:n1e,anticipate:r1e},_It=t=>typeof t=="string",pce=t=>{if(s1e(t)){kz(t.length===4);const[e,n,a,r]=t;return Vk(e,n,a,r)}else if(_It(t))return SIt[t];return t},qx=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function RIt(t,e){let n=new Set,a=new Set,r=!1,i=!1;const o=new WeakSet;let A={delta:0,timestamp:0,isProcessing:!1};function s(d){o.has(d)&&(l.schedule(d),t()),d(A)}const l={schedule:(d,u=!1,g=!1)=>{const m=g&&r?n:a;return u&&o.add(d),m.add(d),d},cancel:d=>{a.delete(d),o.delete(d)},process:d=>{if(A=d,r){i=!0;return}r=!0;const u=n;n=a,a=u,n.forEach(s),n.clear(),r=!1,i&&(i=!1,l.process(d))}};return l}const NIt=40;function c1e(t,e){let n=!1,a=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=qx.reduce((y,Q)=>(y[Q]=RIt(i),y),{}),{setup:A,read:s,resolveKeyframes:l,preUpdate:d,update:u,preRender:g,render:p,postRender:m}=o,h=()=>{const y=Dm.useManualTiming,Q=y?r.timestamp:performance.now();n=!1,y||(r.delta=a?1e3/60:Math.max(Math.min(Q-r.timestamp,NIt),1)),r.timestamp=Q,r.isProcessing=!0,A.process(r),s.process(r),l.process(r),d.process(r),u.process(r),g.process(r),p.process(r),m.process(r),r.isProcessing=!1,n&&e&&(a=!1,t(h))},b=()=>{n=!0,a=!0,r.isProcessing||t(h)};return{schedule:qx.reduce((y,Q)=>{const k=o[Q];return y[Q]=(_,v=!1,x=!1)=>(n||b(),k.schedule(_,v,x)),y},{}),cancel:y=>{for(let Q=0;Q<qx.length;Q++)o[qx[Q]].cancel(y)},state:r,steps:o}}const{schedule:_r,cancel:xm,state:Jo,steps:Y9}=c1e(typeof requestAnimationFrame<"u"?requestAnimationFrame:tl,!0);let LS;function MIt(){LS=void 0}const HA={now:()=>(LS===void 0&&HA.set(Jo.isProcessing||Dm.useManualTiming?Jo.timestamp:performance.now()),LS),set:t=>{LS=t,queueMicrotask(MIt)}},l1e=t=>e=>typeof e=="string"&&e.startsWith(t),d1e=l1e("--"),FIt=l1e("var(--"),Sz=t=>FIt(t)?LIt.test(t.split("/*")[0].trim()):!1,LIt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mce(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const mB={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},X0={...mB,transform:t=>uu(0,1,t)},jx={...mB,default:1},$w=t=>Math.round(t*1e5)/1e5,_z=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function TIt(t){return t==null}const GIt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Rz=(t,e)=>n=>!!(typeof n=="string"&&GIt.test(n)&&n.startsWith(t)||e&&!TIt(n)&&Object.prototype.hasOwnProperty.call(n,e)),u1e=(t,e,n)=>a=>{if(typeof a!="string")return a;const[r,i,o,A]=a.match(_z);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:A!==void 0?parseFloat(A):1}},OIt=t=>uu(0,255,t),q9={...mB,transform:t=>Math.round(OIt(t))},Df={test:Rz("rgb","red"),parse:u1e("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:a=1})=>"rgba("+q9.transform(t)+", "+q9.transform(e)+", "+q9.transform(n)+", "+$w(X0.transform(a))+")"};function UIt(t){let e="",n="",a="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),a=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),a=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,a+=a,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(a,16),alpha:r?parseInt(r,16)/255:1}}const f7={test:Rz("#"),parse:UIt,transform:Df.transform},Xk=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Hp=Xk("deg"),ou=Xk("%"),Sn=Xk("px"),PIt=Xk("vh"),KIt=Xk("vw"),hce={...ou,parse:t=>ou.parse(t)/100,transform:t=>ou.transform(t*100)},yE={test:Rz("hsl","hue"),parse:u1e("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:a=1})=>"hsla("+Math.round(t)+", "+ou.transform($w(e))+", "+ou.transform($w(n))+", "+$w(X0.transform(a))+")"},Ki={test:t=>Df.test(t)||f7.test(t)||yE.test(t),parse:t=>Df.test(t)?Df.parse(t):yE.test(t)?yE.parse(t):f7.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Df.transform(t):yE.transform(t),getAnimatableNone:t=>{const e=Ki.parse(t);return e.alpha=0,Ki.transform(e)}},HIt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function YIt(t){return isNaN(t)&&typeof t=="string"&&(t.match(_z)?.length||0)+(t.match(HIt)?.length||0)>0}const g1e="number",p1e="color",qIt="var",jIt="var(",fce="${}",zIt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function xI(t){const e=t.toString(),n=[],a={color:[],number:[],var:[]},r=[];let i=0;const A=e.replace(zIt,s=>(Ki.test(s)?(a.color.push(i),r.push(p1e),n.push(Ki.parse(s))):s.startsWith(jIt)?(a.var.push(i),r.push(qIt),n.push(s)):(a.number.push(i),r.push(g1e),n.push(parseFloat(s))),++i,fce)).split(fce);return{values:n,split:A,indexes:a,types:r}}function JIt(t){return xI(t).values}function m1e({split:t,types:e}){const n=t.length;return a=>{let r="";for(let i=0;i<n;i++)if(r+=t[i],a[i]!==void 0){const o=e[i];o===g1e?r+=$w(a[i]):o===p1e?r+=Ki.transform(a[i]):r+=a[i]}return r}}function WIt(t){return m1e(xI(t))}const ZIt=t=>typeof t=="number"?0:Ki.test(t)?Ki.getAnimatableNone(t):t,VIt=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:ZIt(t);function XIt(t){const e=xI(t);return m1e(e)(e.values.map((a,r)=>VIt(a,e.split[r])))}const Jl={test:YIt,parse:JIt,createTransformer:WIt,getAnimatableNone:XIt};function j9(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $It({hue:t,saturation:e,lightness:n,alpha:a}){t/=360,e/=100,n/=100;let r=0,i=0,o=0;if(!e)r=i=o=n;else{const A=n<.5?n*(1+e):n+e-n*e,s=2*n-A;r=j9(s,A,t+1/3),i=j9(s,A,t),o=j9(s,A,t-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:a}}function uR(t,e){return n=>n>0?e:t}const jr=(t,e,n)=>t+(e-t)*n,z9=(t,e,n)=>{const a=t*t,r=n*(e*e-a)+a;return r<0?0:Math.sqrt(r)},eBt=[f7,Df,yE],tBt=t=>eBt.find(e=>e.test(t));function bce(t){const e=tBt(t);if(!e)return!1;let n=e.parse(t);return e===yE&&(n=$It(n)),n}const Cce=(t,e)=>{const n=bce(t),a=bce(e);if(!n||!a)return uR(t,e);const r={...n};return i=>(r.red=z9(n.red,a.red,i),r.green=z9(n.green,a.green,i),r.blue=z9(n.blue,a.blue,i),r.alpha=jr(n.alpha,a.alpha,i),Df.transform(r))},b7=new Set(["none","hidden"]);function nBt(t,e){return b7.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function aBt(t,e){return n=>jr(t,e,n)}function Nz(t){return typeof t=="number"?aBt:typeof t=="string"?Sz(t)?uR:Ki.test(t)?Cce:oBt:Array.isArray(t)?h1e:typeof t=="object"?Ki.test(t)?Cce:rBt:uR}function h1e(t,e){const n=[...t],a=n.length,r=t.map((i,o)=>Nz(i)(i,e[o]));return i=>{for(let o=0;o<a;o++)n[o]=r[o](i);return n}}function rBt(t,e){const n={...t,...e},a={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(a[r]=Nz(t[r])(t[r],e[r]));return r=>{for(const i in a)n[i]=a[i](r);return n}}function iBt(t,e){const n=[],a={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],o=t.indexes[i][a[i]],A=t.values[o]??0;n[r]=A,a[i]++}return n}const oBt=(t,e)=>{const n=Jl.createTransformer(e),a=xI(t),r=xI(e);return a.indexes.var.length===r.indexes.var.length&&a.indexes.color.length===r.indexes.color.length&&a.indexes.number.length>=r.indexes.number.length?b7.has(t)&&!r.values.length||b7.has(e)&&!a.values.length?nBt(t,e):Zk(h1e(iBt(a,r),r.values),n):uR(t,e)};function f1e(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?jr(t,e,n):Nz(t)(t,e)}const ABt=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>_r.update(e,n),stop:()=>xm(e),now:()=>Jo.isProcessing?Jo.timestamp:HA.now()}},b1e=(t,e,n=10)=>{let a="";const r=Math.max(Math.round(e/n),2);for(let i=0;i<r;i++)a+=Math.round(t(i/(r-1))*1e4)/1e4+", ";return`linear(${a.substring(0,a.length-2)})`},gR=2e4;function Mz(t){let e=0;const n=50;let a=t.next(e);for(;!a.done&&e<gR;)e+=n,a=t.next(e);return e>=gR?1/0:e}function sBt(t,e=100,n){const a=n({...t,keyframes:[0,e]}),r=Math.min(Mz(a),gR);return{type:"keyframes",ease:i=>a.next(r*i).value/e,duration:Vc(r)}}const fi={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function C7(t,e){return t*Math.sqrt(1-e*e)}const cBt=12;function lBt(t,e,n){let a=n;for(let r=1;r<cBt;r++)a=a-t(a)/e(a);return a}const J9=.001;function dBt({duration:t=fi.duration,bounce:e=fi.bounce,velocity:n=fi.velocity,mass:a=fi.mass}){let r,i,o=1-e;o=uu(fi.minDamping,fi.maxDamping,o),t=uu(fi.minDuration,fi.maxDuration,Vc(t)),o<1?(r=l=>{const d=l*o,u=d*t,g=d-n,p=C7(l,o),m=Math.exp(-u);return J9-g/p*m},i=l=>{const u=l*o*t,g=u*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,m=Math.exp(-u),h=C7(Math.pow(l,2),o);return(-r(l)+J9>0?-1:1)*((g-p)*m)/h}):(r=l=>{const d=Math.exp(-l*t),u=(l-n)*t+1;return-J9+d*u},i=l=>{const d=Math.exp(-l*t),u=(n-l)*(t*t);return d*u});const A=5/t,s=lBt(r,i,A);if(t=lc(t),isNaN(s))return{stiffness:fi.stiffness,damping:fi.damping,duration:t};{const l=Math.pow(s,2)*a;return{stiffness:l,damping:o*2*Math.sqrt(a*l),duration:t}}}const uBt=["duration","bounce"],gBt=["stiffness","damping","mass"];function Ece(t,e){return e.some(n=>t[n]!==void 0)}function pBt(t){let e={velocity:fi.velocity,stiffness:fi.stiffness,damping:fi.damping,mass:fi.mass,isResolvedFromDuration:!1,...t};if(!Ece(t,gBt)&&Ece(t,uBt))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,a=2*Math.PI/(n*1.2),r=a*a,i=2*uu(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:fi.mass,stiffness:r,damping:i}}else{const n=dBt({...t,velocity:0});e={...e,...n,mass:fi.mass},e.isResolvedFromDuration=!0}return e}function pR(t=fi.visualDuration,e=fi.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:a,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],A={done:!1,value:i},{stiffness:s,damping:l,mass:d,duration:u,velocity:g,isResolvedFromDuration:p}=pBt({...n,velocity:-Vc(n.velocity||0)}),m=g||0,h=l/(2*Math.sqrt(s*d)),b=o-i,C=Vc(Math.sqrt(s/d)),B=Math.abs(b)<5;a||(a=B?fi.restSpeed.granular:fi.restSpeed.default),r||(r=B?fi.restDelta.granular:fi.restDelta.default);let y,Q,k,_,v,x;if(h<1)k=C7(C,h),_=(m+h*C*b)/k,y=L=>{const N=Math.exp(-h*C*L);return o-N*(_*Math.sin(k*L)+b*Math.cos(k*L))},v=h*C*_+b*k,x=h*C*b-_*k,Q=L=>Math.exp(-h*C*L)*(v*Math.sin(k*L)+x*Math.cos(k*L));else if(h===1){y=N=>o-Math.exp(-C*N)*(b+(m+C*b)*N);const L=m+C*b;Q=N=>Math.exp(-C*N)*(C*L*N-m)}else{const L=C*Math.sqrt(h*h-1);y=R=>{const O=Math.exp(-h*C*R),F=Math.min(L*R,300);return o-O*((m+h*C*b)*Math.sinh(F)+L*b*Math.cosh(F))/L};const N=(m+h*C*b)/L,U=h*C*N-b*L,K=h*C*b-N*L;Q=R=>{const O=Math.exp(-h*C*R),F=Math.min(L*R,300);return O*(U*Math.sinh(F)+K*Math.cosh(F))}}const S={calculatedDuration:p&&u||null,velocity:L=>lc(Q(L)),next:L=>{if(!p&&h<1){const U=Math.exp(-h*C*L),K=Math.sin(k*L),R=Math.cos(k*L),O=o-U*(_*K+b*R),F=lc(U*(v*K+x*R));return A.done=Math.abs(F)<=a&&Math.abs(o-O)<=r,A.value=A.done?o:O,A}const N=y(L);if(p)A.done=L>=u;else{const U=lc(Q(L));A.done=Math.abs(U)<=a&&Math.abs(o-N)<=r}return A.value=A.done?o:N,A},toString:()=>{const L=Math.min(Mz(S),gR),N=b1e(U=>S.next(L*U).value,L,30);return L+"ms "+N},toTransition:()=>{}};return S}pR.applyToOptions=t=>{const e=sBt(t,100,pR);return t.ease=e.ease,t.duration=lc(e.duration),t.type="keyframes",t};const mBt=5;function C1e(t,e,n){const a=Math.max(e-mBt,0);return Xxe(n-t(a),e-a)}function E7({keyframes:t,velocity:e=0,power:n=.8,timeConstant:a=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:A,max:s,restDelta:l=.5,restSpeed:d}){const u=t[0],g={done:!1,value:u},p=x=>A!==void 0&&x<A||s!==void 0&&x>s,m=x=>A===void 0?s:s===void 0||Math.abs(A-x)<Math.abs(s-x)?A:s;let h=n*e;const b=u+h,C=o===void 0?b:o(b);C!==b&&(h=C-u);const B=x=>-h*Math.exp(-x/a),y=x=>C+B(x),Q=x=>{const S=B(x),L=y(x);g.done=Math.abs(S)<=l,g.value=g.done?C:L};let k,_;const v=x=>{p(g.value)&&(k=x,_=pR({keyframes:[g.value,m(g.value)],velocity:C1e(y,x,g.value),damping:r,stiffness:i,restDelta:l,restSpeed:d}))};return v(0),{calculatedDuration:null,next:x=>{let S=!1;return!_&&k===void 0&&(S=!0,Q(x),v(x)),k!==void 0&&x>=k?_.next(x-k):(!S&&Q(x),g)}}}function hBt(t,e,n){const a=[],r=n||Dm.mix||f1e,i=t.length-1;for(let o=0;o<i;o++){let A=r(t[o],t[o+1]);if(e){const s=Array.isArray(e)?e[o]||tl:e;A=Zk(s,A)}a.push(A)}return a}function fBt(t,e,{clamp:n=!0,ease:a,mixer:r}={}){const i=t.length;if(kz(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const A=hBt(e,a,r),s=A.length,l=d=>{if(o&&d<t[0])return e[0];let u=0;if(s>1)for(;u<t.length-2&&!(d<t[u+1]);u++);const g=V0(t[u],t[u+1],d);return A[u](g)};return n?d=>l(uu(t[0],t[i-1],d)):l}function bBt(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const r=V0(0,e,a);t.push(jr(n,1,r))}}function CBt(t){const e=[0];return bBt(e,t.length-1),e}function EBt(t,e){return t.map(n=>n*e)}function IBt(t,e){return t.map(()=>e||A1e).splice(0,t.length-1)}function e0({duration:t=300,keyframes:e,times:n,ease:a="easeInOut"}){const r=xIt(a)?a.map(pce):pce(a),i={done:!1,value:e[0]},o=EBt(n&&n.length===e.length?n:CBt(e),t),A=fBt(o,e,{ease:Array.isArray(r)?r:IBt(e,r)});return{calculatedDuration:t,next:s=>(i.value=A(s),i.done=s>=t,i)}}const BBt=t=>t!==null;function JM(t,{repeat:e,repeatType:n="loop"},a,r=1){const i=t.filter(BBt),A=r<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!A||a===void 0?i[A]:a}const yBt={decay:E7,inertia:E7,tween:e0,keyframes:e0,spring:pR};function E1e(t){typeof t.type=="string"&&(t.type=yBt[t.type])}class Fz{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const QBt=t=>t/100;class mR extends Fz{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==HA.now()&&this.tick(HA.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;E1e(e);const{type:n=e0,repeat:a=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=e;let{keyframes:A}=e;const s=n||e0;s!==e0&&typeof A[0]!="number"&&(this.mixKeyframes=Zk(QBt,f1e(A[0],A[1])),A=[0,100]);const l=s({...e,keyframes:A});i==="mirror"&&(this.mirroredGenerator=s({...e,keyframes:[...A].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Mz(l));const{calculatedDuration:d}=l;this.calculatedDuration=d,this.resolvedDuration=d+r,this.totalDuration=this.resolvedDuration*(a+1)-r,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:a,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:A,calculatedDuration:s}=this;if(this.startTime===null)return a.next(0);const{delay:l=0,keyframes:d,repeat:u,repeatType:g,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-l*(this.playbackSpeed>=0?1:-1),B=this.playbackSpeed>=0?C<0:C>r;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,Q=a;if(u){const x=Math.min(this.currentTime,r)/A;let S=Math.floor(x),L=x%1;!L&&x>=1&&(L=1),L===1&&S--,S=Math.min(S,u+1),!!(S%2)&&(g==="reverse"?(L=1-L,p&&(L-=p/A)):g==="mirror"&&(Q=o)),y=uu(0,1,L)*A}let k;B?(this.delayState.value=d[0],k=this.delayState):k=Q.next(y),i&&!B&&(k.value=i(k.value));let{done:_}=k;!B&&s!==null&&(_=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const v=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return v&&m!==E7&&(k.value=JM(d,this.options,b,this.speed)),h&&h(k.value),v&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return Vc(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vc(e)}get time(){return Vc(this.currentTime)}set time(e){e=lc(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return C1e(a=>this.generator.next(a).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(HA.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Vc(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=ABt,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),this.options.onPlay?.();const a=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=a):this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime||(this.startTime=n??a),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(HA.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function wBt(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const xf=t=>t*180/Math.PI,I7=t=>{const e=xf(Math.atan2(t[1],t[0]));return B7(e)},kBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:I7,rotateZ:I7,skewX:t=>xf(Math.atan(t[1])),skewY:t=>xf(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},B7=t=>(t=t%360,t<0&&(t+=360),t),Ice=I7,Bce=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),yce=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bce,scaleY:yce,scale:t=>(Bce(t)+yce(t))/2,rotateX:t=>B7(xf(Math.atan2(t[6],t[5]))),rotateY:t=>B7(xf(Math.atan2(-t[2],t[0]))),rotateZ:Ice,rotate:Ice,skewX:t=>xf(Math.atan(t[4])),skewY:t=>xf(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function y7(t){return t.includes("scale")?1:0}function Q7(t,e){if(!t||t==="none")return y7(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let a,r;if(n)a=vBt,r=n;else{const A=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);a=kBt,r=A}if(!r)return y7(e);const i=a[e],o=r[1].split(",").map(xBt);return typeof i=="function"?i(o):o[i]}const DBt=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Q7(n,e)};function xBt(t){return parseFloat(t.trim())}const hB=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fB=new Set(hB),Qce=t=>t===mB||t===Sn,SBt=new Set(["x","y","z"]),_Bt=hB.filter(t=>!SBt.has(t));function RBt(t){const e=[];return _Bt.forEach(n=>{const a=t.getValue(n);a!==void 0&&(e.push([n,a.get()]),a.set(n.startsWith("scale")?1:0))}),e}const nm={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:a})=>{const r=t.max-t.min;return a==="border-box"?r:r-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:a})=>{const r=t.max-t.min;return a==="border-box"?r:r-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Q7(e,"x"),y:(t,{transform:e})=>Q7(e,"y")};nm.translateX=nm.x;nm.translateY=nm.y;const Gf=new Set;let w7=!1,k7=!1,v7=!1;function I1e(){if(k7){const t=Array.from(Gf).filter(a=>a.needsMeasurement),e=new Set(t.map(a=>a.element)),n=new Map;e.forEach(a=>{const r=RBt(a);r.length&&(n.set(a,r),a.render())}),t.forEach(a=>a.measureInitialState()),e.forEach(a=>{a.render();const r=n.get(a);r&&r.forEach(([i,o])=>{a.getValue(i)?.set(o)})}),t.forEach(a=>a.measureEndState()),t.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}k7=!1,w7=!1,Gf.forEach(t=>t.complete(v7)),Gf.clear()}function B1e(){Gf.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(k7=!0)})}function NBt(){v7=!0,B1e(),I1e(),v7=!1}class Lz{constructor(e,n,a,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=a,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Gf.add(this),w7||(w7=!0,_r.read(B1e),_r.resolveKeyframes(I1e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:a,motionValue:r}=this;if(e[0]===null){const i=r?.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(a&&n){const A=a.readValue(n,o);A!=null&&(e[0]=A)}e[0]===void 0&&(e[0]=o),r&&i===void 0&&r.set(e[0])}wBt(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Gf.delete(this)}cancel(){this.state==="scheduled"&&(Gf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const MBt=t=>t.startsWith("--");function y1e(t,e,n){MBt(e)?t.style.setProperty(e,n):t.style[e]=n}const FBt={};function Q1e(t,e){const n=Vxe(t);return()=>FBt[e]??n()}const LBt=Q1e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),w1e=Q1e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),zQ=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,wce={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zQ([0,.65,.55,1]),circOut:zQ([.55,0,1,.45]),backIn:zQ([.31,.01,.66,-.59]),backOut:zQ([.33,1.53,.69,.99])};function k1e(t,e){if(t)return typeof t=="function"?w1e()?b1e(t,e):"ease-out":s1e(t)?zQ(t):Array.isArray(t)?t.map(n=>k1e(n,e)||wce.easeOut):wce[t]}function TBt(t,e,n,{delay:a=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:A="easeOut",times:s}={},l=void 0){const d={[e]:n};s&&(d.offset=s);const u=k1e(A,r);Array.isArray(u)&&(d.easing=u);const g={delay:a,duration:r,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(g.pseudoElement=l),t.animate(d,g)}function v1e(t){return typeof t=="function"&&"applyToOptions"in t}function GBt({type:t,...e}){return v1e(t)&&w1e()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class D1e extends Fz{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:a,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:A,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,kz(typeof e.type!="string");const l=GBt(e);this.animation=TBt(n,a,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=JM(r,this.options,A,this.speed);this.updateMotionValue&&this.updateMotionValue(d),y1e(n,a,d),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Vc(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vc(e)}get time(){return Vc(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lc(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:a,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&LBt()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),a&&(this.animation.rangeEnd=a),tl):r(this)}}const x1e={anticipate:r1e,backInOut:a1e,circInOut:o1e};function OBt(t){return t in x1e}function UBt(t){typeof t.ease=="string"&&OBt(t.ease)&&(t.ease=x1e[t.ease])}const W9=10;class PBt extends D1e{constructor(e){UBt(e),E1e(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:a,onComplete:r,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const A=new mR({...o,autoplay:!1}),s=Math.max(W9,HA.now()-this.startTime),l=uu(0,W9,s-W9),d=A.sample(s).value,{name:u}=this.options;i&&u&&y1e(i,u,d),n.setWithVelocity(A.sample(Math.max(0,s-l)).value,d,l),A.stop()}}const kce=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Jl.test(t)||t==="0")&&!t.startsWith("url("));function KBt(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function HBt(t,e,n,a){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=kce(r,e),A=kce(i,e);return!o||!A?!1:KBt(t)||(n==="spring"||v1e(n))&&a}function D7(t){t.duration=0,t.type="keyframes"}const S1e=new Set(["opacity","clipPath","filter","transform"]),YBt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function qBt(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&YBt.test(t[e]))return!0;return!1}const jBt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),zBt=Vxe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function JBt(t){const{motionValue:e,name:n,repeatDelay:a,repeatType:r,damping:i,type:o,keyframes:A}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:d}=e.owner.getProps();return zBt()&&n&&(S1e.has(n)||jBt.has(n)&&qBt(A))&&(n!=="transform"||!d)&&!l&&!a&&r!=="mirror"&&i!==0&&o!=="inertia"}const WBt=40;class ZBt extends Fz{constructor({autoplay:e=!0,delay:n=0,type:a="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:A,name:s,motionValue:l,element:d,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=HA.now();const g={autoplay:e,delay:n,type:a,repeat:r,repeatDelay:i,repeatType:o,name:s,motionValue:l,element:d,...u},p=d?.KeyframeResolver||Lz;this.keyframeResolver=new p(A,(m,h,b)=>this.onKeyframesResolved(m,h,g,!b),s,l,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,a,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:A,delay:s,isHandoff:l,onUpdate:d}=a;this.resolvedAt=HA.now();let u=!0;HBt(e,i,o,A)||(u=!1,(Dm.instantAnimations||!s)&&d?.(JM(e,a,n)),e[0]=e[e.length-1],D7(a),a.repeat=0);const p={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>WBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...a,keyframes:e},m=u&&!l&&JBt(p),h=p.motionValue?.owner?.current;let b;if(m)try{b=new PBt({...p,element:h})}catch{b=new mR(p)}else b=new mR(p);b.finished.then(()=>{this.notifyFinished()}).catch(tl),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),NBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function _1e(t,e,n,a=0,r=1){const i=Array.from(t).sort((l,d)=>l.sortNodePosition(d)).indexOf(e),o=t.size,A=(o-1)*a;return typeof n=="function"?n(i,o):r===1?i*a:A-i*a}const VBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function XBt(t){const e=VBt.exec(t);if(!e)return[,];const[,n,a,r]=e;return[`--${n??a}`,r]}function R1e(t,e,n=1){const[a,r]=XBt(t);if(!a)return;const i=window.getComputedStyle(e).getPropertyValue(a);if(i){const o=i.trim();return Jxe(o)?parseFloat(o):o}return Sz(r)?R1e(r,e,n+1):r}const $Bt={type:"spring",stiffness:500,damping:25,restSpeed:10},eyt=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),tyt={type:"keyframes",duration:.8},nyt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ayt=(t,{keyframes:e})=>e.length>2?tyt:fB.has(t)?t.startsWith("scale")?eyt(e[1]):$Bt:nyt;function N1e(t,e){if(t?.inherit&&e){const{inherit:n,...a}=t;return{...e,...a}}return t}function Tz(t,e){const n=t?.[e]??t?.default??t;return n!==t?N1e(n,t):n}const ryt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function iyt(t){for(const e in t)if(!ryt.has(e))return!0;return!1}const Gz=(t,e,n,a={},r,i)=>o=>{const A=Tz(a,t)||{},s=A.delay||a.delay||0;let{elapsed:l=0}=a;l=l-lc(s);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...A,delay:-l,onUpdate:g=>{e.set(g),A.onUpdate&&A.onUpdate(g)},onComplete:()=>{o(),A.onComplete&&A.onComplete()},name:t,motionValue:e,element:i?void 0:r};iyt(A)||Object.assign(d,ayt(t,d)),d.duration&&(d.duration=lc(d.duration)),d.repeatDelay&&(d.repeatDelay=lc(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(D7(d),d.delay===0&&(u=!0)),(Dm.instantAnimations||Dm.skipAnimations||r?.shouldSkipAnimations)&&(u=!0,D7(d),d.delay=0),d.allowFlatten=!A.type&&!A.ease,u&&!i&&e.get()!==void 0){const g=JM(d.keyframes,A);if(g!==void 0){_r.update(()=>{d.onUpdate(g),d.onComplete()});return}}return A.isSync?new mR(d):new ZBt(d)};function vce(t){const e=[{},{}];return t?.values.forEach((n,a)=>{e[0][a]=n.get(),e[1][a]=n.getVelocity()}),e}function Oz(t,e,n,a){if(typeof e=="function"){const[r,i]=vce(a);e=e(n!==void 0?n:t.custom,r,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,i]=vce(a);e=e(n!==void 0?n:t.custom,r,i)}return e}function Of(t,e,n){const a=t.getProps();return Oz(a,e,n!==void 0?n:a.custom,t)}const M1e=new Set(["width","height","top","left","right","bottom",...hB]),Dce=30,oyt=t=>!isNaN(parseFloat(t));class Ayt{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=a=>{const r=HA.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=HA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=oyt(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new vz);const a=this.events[e].add(n);return e==="change"?()=>{a(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,a){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-a}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=HA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Dce)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Dce);return Xxe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function SI(t,e){return new Ayt(t,e)}const x7=t=>Array.isArray(t);function syt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,SI(n))}function cyt(t){return x7(t)?t[t.length-1]||0:t}function lyt(t,e){const n=Of(t,e);let{transitionEnd:a={},transition:r={},...i}=n||{};i={...i,...a};for(const o in i){const A=cyt(i[o]);syt(t,o,A)}}const Xo=t=>!!(t&&t.getVelocity);function dyt(t){return!!(Xo(t)&&t.add)}function S7(t,e){const n=t.getValue("willChange");if(dyt(n))return n.add(e);if(!n&&Dm.WillChange){const a=new Dm.WillChange("auto");t.addValue("willChange",a),a.add(e)}}function Uz(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const uyt="framerAppearId",F1e="data-"+Uz(uyt);function L1e(t){return t.props[F1e]}function gyt({protectedKeys:t,needsAnimating:e},n){const a=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,a}function T1e(t,e,{delay:n=0,transitionOverride:a,type:r}={}){let{transition:i,transitionEnd:o,...A}=e;const s=t.getDefaultTransition();i=i?N1e(i,s):s;const l=i?.reduceMotion;a&&(i=a);const d=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const g in A){const p=t.getValue(g,t.latestValues[g]??null),m=A[g];if(m===void 0||u&&gyt(u,g))continue;const h={delay:n,...Tz(i||{},g)},b=p.get();if(b!==void 0&&!p.isAnimating()&&!Array.isArray(m)&&m===b&&!h.velocity){_r.update(()=>p.set(m));continue}let C=!1;if(window.MotionHandoffAnimation){const Q=L1e(t);if(Q){const k=window.MotionHandoffAnimation(Q,g,_r);k!==null&&(h.startTime=k,C=!0)}}S7(t,g);const B=l??t.shouldReduceMotion;p.start(Gz(g,p,m,B&&M1e.has(g)?{type:!1}:h,t,C));const y=p.animation;y&&d.push(y)}if(o){const g=()=>_r.update(()=>{o&&lyt(t,o)});d.length?Promise.all(d).then(g):g()}return d}function _7(t,e,n={}){const a=Of(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(r=n.transitionOverride);const i=a?()=>Promise.all(T1e(t,a,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:l=0,staggerChildren:d,staggerDirection:u}=r;return pyt(t,e,s,l,d,u,n)}:()=>Promise.resolve(),{when:A}=r;if(A){const[s,l]=A==="beforeChildren"?[i,o]:[o,i];return s().then(()=>l())}else return Promise.all([i(),o(n.delay)])}function pyt(t,e,n=0,a=0,r=0,i=1,o){const A=[];for(const s of t.variantChildren)s.notify("AnimationStart",e),A.push(_7(s,e,{...o,delay:n+(typeof a=="function"?0:a)+_1e(t.variantChildren,s,a,r,i)}).then(()=>s.notify("AnimationComplete",e)));return Promise.all(A)}function myt(t,e,n={}){t.notify("AnimationStart",e);let a;if(Array.isArray(e)){const r=e.map(i=>_7(t,i,n));a=Promise.all(r)}else if(typeof e=="string")a=_7(t,e,n);else{const r=typeof e=="function"?Of(t,e,n.custom):e;a=Promise.all(T1e(t,r,n))}return a.then(()=>{t.notify("AnimationComplete",e)})}const hyt={test:t=>t==="auto",parse:t=>t},G1e=t=>e=>e.test(t),O1e=[mB,Sn,ou,Hp,KIt,PIt,hyt],xce=t=>O1e.find(G1e(t));function fyt(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Zxe(t):!0}const byt=new Set(["brightness","contrast","saturate","opacity"]);function Cyt(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[a]=n.match(_z)||[];if(!a)return t;const r=n.replace(a,"");let i=byt.has(e)?1:0;return a!==n&&(i*=100),e+"("+i+r+")"}const Eyt=/\b([a-z-]*)\(.*?\)/gu,R7={...Jl,getAnimatableNone:t=>{const e=t.match(Eyt);return e?e.map(Cyt).join(" "):t}},N7={...Jl,getAnimatableNone:t=>{const e=Jl.parse(t);return Jl.createTransformer(t)(e.map(a=>typeof a=="number"?0:typeof a=="object"?{...a,alpha:1}:a))}},Sce={...mB,transform:Math.round},Iyt={rotate:Hp,rotateX:Hp,rotateY:Hp,rotateZ:Hp,scale:jx,scaleX:jx,scaleY:jx,scaleZ:jx,skew:Hp,skewX:Hp,skewY:Hp,distance:Sn,translateX:Sn,translateY:Sn,translateZ:Sn,x:Sn,y:Sn,z:Sn,perspective:Sn,transformPerspective:Sn,opacity:X0,originX:hce,originY:hce,originZ:Sn},Pz={borderWidth:Sn,borderTopWidth:Sn,borderRightWidth:Sn,borderBottomWidth:Sn,borderLeftWidth:Sn,borderRadius:Sn,borderTopLeftRadius:Sn,borderTopRightRadius:Sn,borderBottomRightRadius:Sn,borderBottomLeftRadius:Sn,width:Sn,maxWidth:Sn,height:Sn,maxHeight:Sn,top:Sn,right:Sn,bottom:Sn,left:Sn,inset:Sn,insetBlock:Sn,insetBlockStart:Sn,insetBlockEnd:Sn,insetInline:Sn,insetInlineStart:Sn,insetInlineEnd:Sn,padding:Sn,paddingTop:Sn,paddingRight:Sn,paddingBottom:Sn,paddingLeft:Sn,paddingBlock:Sn,paddingBlockStart:Sn,paddingBlockEnd:Sn,paddingInline:Sn,paddingInlineStart:Sn,paddingInlineEnd:Sn,margin:Sn,marginTop:Sn,marginRight:Sn,marginBottom:Sn,marginLeft:Sn,marginBlock:Sn,marginBlockStart:Sn,marginBlockEnd:Sn,marginInline:Sn,marginInlineStart:Sn,marginInlineEnd:Sn,fontSize:Sn,backgroundPositionX:Sn,backgroundPositionY:Sn,...Iyt,zIndex:Sce,fillOpacity:X0,strokeOpacity:X0,numOctaves:Sce},Byt={...Pz,color:Ki,backgroundColor:Ki,outlineColor:Ki,fill:Ki,stroke:Ki,borderColor:Ki,borderTopColor:Ki,borderRightColor:Ki,borderBottomColor:Ki,borderLeftColor:Ki,filter:R7,WebkitFilter:R7,mask:N7,WebkitMask:N7},U1e=t=>Byt[t],yyt=new Set([R7,N7]);function P1e(t,e){let n=U1e(t);return yyt.has(n)||(n=Jl),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Qyt=new Set(["auto","none","0"]);function wyt(t,e,n){let a=0,r;for(;a<t.length&&!r;){const i=t[a];typeof i=="string"&&!Qyt.has(i)&&xI(i).values.length&&(r=t[a]),a++}if(r&&n)for(const i of e)t[i]=P1e(n,r)}class kyt extends Lz{constructor(e,n,a,r,i){super(e,n,a,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:a}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let u=e[d];if(typeof u=="string"&&(u=u.trim(),Sz(u))){const g=R1e(u,n.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!M1e.has(a)||e.length!==2)return;const[r,i]=e,o=xce(r),A=xce(i),s=mce(r),l=mce(i);if(s!==l&&nm[a]){this.needsMeasurement=!0;return}if(o!==A)if(Qce(o)&&Qce(A))for(let d=0;d<e.length;d++){const u=e[d];typeof u=="string"&&(e[d]=parseFloat(u))}else nm[a]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,a=[];for(let r=0;r<e.length;r++)(e[r]===null||fyt(e[r]))&&a.push(r);a.length&&wyt(e,a,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:a}=this;if(!e||!e.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nm[a](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(a,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:a}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=a.length-1,o=a[i];a[i]=nm[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([A,s])=>{e.getValue(A).set(s)}),this.resolveNoneKeyframes()}}function K1e(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let a=document;const r=n?.[t]??a.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t).filter(a=>a!=null)}const H1e=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function vyt(t){return Wxe(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Kz}=c1e(queueMicrotask,!1),vl={x:!1,y:!1};function Y1e(){return vl.x||vl.y}function Dyt(t){return t==="x"||t==="y"?vl[t]?null:(vl[t]=!0,()=>{vl[t]=!1}):vl.x||vl.y?null:(vl.x=vl.y=!0,()=>{vl.x=vl.y=!1})}function q1e(t,e){const n=K1e(t),a=new AbortController,r={passive:!0,...e,signal:a.signal};return[n,r,()=>a.abort()]}function xyt(t){return!(t.pointerType==="touch"||Y1e())}function Syt(t,e,n={}){const[a,r,i]=q1e(t,n);return a.forEach(o=>{let A=!1,s=!1,l;const d=()=>{o.removeEventListener("pointerleave",m)},u=b=>{l&&(l(b),l=void 0),d()},g=b=>{A=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),s&&(s=!1,u(b))},p=()=>{A=!0,window.addEventListener("pointerup",g,r),window.addEventListener("pointercancel",g,r)},m=b=>{if(b.pointerType!=="touch"){if(A){s=!0;return}u(b)}},h=b=>{if(!xyt(b))return;s=!1;const C=e(o,b);typeof C=="function"&&(l=C,o.addEventListener("pointerleave",m,r))};o.addEventListener("pointerenter",h,r),o.addEventListener("pointerdown",p,r)}),i}const j1e=(t,e)=>e?t===e?!0:j1e(t,e.parentElement):!1,Hz=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_yt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ryt(t){return _yt.has(t.tagName)||t.isContentEditable===!0}const Nyt=new Set(["INPUT","SELECT","TEXTAREA"]);function Myt(t){return Nyt.has(t.tagName)||t.isContentEditable===!0}const TS=new WeakSet;function _ce(t){return e=>{e.key==="Enter"&&t(e)}}function Z9(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Fyt=(t,e)=>{const n=t.currentTarget;if(!n)return;const a=_ce(()=>{if(TS.has(n))return;Z9(n,"down");const r=_ce(()=>{Z9(n,"up")}),i=()=>Z9(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",a,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",a),e)};function Rce(t){return Hz(t)&&!Y1e()}const Nce=new WeakSet;function Lyt(t,e,n={}){const[a,r,i]=q1e(t,n),o=A=>{const s=A.currentTarget;if(!Rce(A)||Nce.has(A))return;TS.add(s),n.stopPropagation&&Nce.add(A);const l=e(s,A),d=(p,m)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",g),TS.has(s)&&TS.delete(s),Rce(p)&&typeof l=="function"&&l(p,{success:m})},u=p=>{d(p,s===window||s===document||n.useGlobalTarget||j1e(s,p.target))},g=p=>{d(p,!1)};window.addEventListener("pointerup",u,r),window.addEventListener("pointercancel",g,r)};return a.forEach(A=>{(n.useGlobalTarget?window:A).addEventListener("pointerdown",o,r),vyt(A)&&(A.addEventListener("focus",l=>Fyt(l,r)),!Ryt(A)&&!A.hasAttribute("tabindex")&&(A.tabIndex=0))}),i}function Yz(t){return Wxe(t)&&"ownerSVGElement"in t}const GS=new WeakMap;let OS;const z1e=(t,e,n)=>(a,r)=>r&&r[0]?r[0][t+"Size"]:Yz(a)&&"getBBox"in a?a.getBBox()[e]:a[n],Tyt=z1e("inline","width","offsetWidth"),Gyt=z1e("block","height","offsetHeight");function Oyt({target:t,borderBoxSize:e}){GS.get(t)?.forEach(n=>{n(t,{get width(){return Tyt(t,e)},get height(){return Gyt(t,e)}})})}function Uyt(t){t.forEach(Oyt)}function Pyt(){typeof ResizeObserver>"u"||(OS=new ResizeObserver(Uyt))}function Kyt(t,e){OS||Pyt();const n=K1e(t);return n.forEach(a=>{let r=GS.get(a);r||(r=new Set,GS.set(a,r)),r.add(e),OS?.observe(a)}),()=>{n.forEach(a=>{const r=GS.get(a);r?.delete(e),r?.size||OS?.unobserve(a)})}}const US=new Set;let QE;function Hyt(){QE=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};US.forEach(e=>e(t))},window.addEventListener("resize",QE)}function Yyt(t){return US.add(t),QE||Hyt(),()=>{US.delete(t),!US.size&&typeof QE=="function"&&(window.removeEventListener("resize",QE),QE=void 0)}}function Mce(t,e){return typeof t=="function"?Yyt(t):Kyt(t,e)}function qyt(t){return Yz(t)&&t.tagName==="svg"}const jyt=[...O1e,Ki,Jl],zyt=t=>jyt.find(G1e(t)),Fce=()=>({translate:0,scale:1,origin:0,originPoint:0}),wE=()=>({x:Fce(),y:Fce()}),Lce=()=>({min:0,max:0}),oo=()=>({x:Lce(),y:Lce()}),Jyt=new WeakMap;function WM(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $0(t){return typeof t=="string"||Array.isArray(t)}const qz=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jz=["initial",...qz];function ZM(t){return WM(t.animate)||jz.some(e=>$0(t[e]))}function J1e(t){return!!(ZM(t)||t.variants)}function Wyt(t,e,n){for(const a in e){const r=e[a],i=n[a];if(Xo(r))t.addValue(a,r);else if(Xo(i))t.addValue(a,SI(r,{owner:t}));else if(i!==r)if(t.hasValue(a)){const o=t.getValue(a);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=t.getStaticValue(a);t.addValue(a,SI(o!==void 0?o:r,{owner:t}))}}for(const a in n)e[a]===void 0&&t.removeValue(a);return e}const M7={current:null},W1e={current:!1},Zyt=typeof window<"u";function Vyt(){if(W1e.current=!0,!!Zyt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>M7.current=t.matches;t.addEventListener("change",e),e()}else M7.current=!1}const Tce=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hR={};function Z1e(t){hR=t}function Xyt(){return hR}class $yt{scrapeMotionValuesFromProps(e,n,a){return{}}constructor({parent:e,props:n,presenceContext:a,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:o,visualState:A},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Lz,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=HA.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,_r.render(this.render,!1,!0))};const{latestValues:l,renderState:d}=A;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=a,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!o,this.isControllingVariants=ZM(n),this.isVariantNode=J1e(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in g){const m=g[p];l[p]!==void 0&&Xo(m)&&m.set(l[p])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,Jyt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(W1e.current||Vyt(),this.shouldReduceMotion=M7.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),xm(this.notifyUpdate),xm(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&S1e.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:A,times:s,ease:l,duration:d}=n.accelerate,u=new D1e({element:this.current,name:e,keyframes:A,times:s,ease:l,duration:lc(d)}),g=o(u);this.valueSubscriptions.set(e,()=>{g(),u.cancel()});return}const a=fB.has(e);a&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&_r.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in hR){const n=hR[e];if(!n)continue;const{isEnabled:a,Feature:r}=n;if(!this.features[e]&&r&&a(this.props)&&(this.features[e]=new r(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):oo()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let a=0;a<Tce.length;a++){const r=Tce[a];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=e[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=Wyt(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const a=this.values.get(e);n!==a&&(a&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let a=this.values.get(e);return a===void 0&&n!==void 0&&(a=SI(n===null?void 0:n,{owner:this}),this.addValue(e,a)),a}readValue(e,n){let a=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return a!=null&&(typeof a=="string"&&(Jxe(a)||Zxe(a))?a=parseFloat(a):!zyt(a)&&Jl.test(n)&&(a=P1e(e,n)),this.setBaseTarget(e,Xo(a)?a.get():a)),Xo(a)?a.get():a}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const i=Oz(this.props,n,this.presenceContext?.custom);i&&(a=i[e])}if(n&&a!==void 0)return a;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Xo(r)?r:this.initialValues[e]!==void 0&&a===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new vz),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Kz.render(this.render)}}class V1e extends $yt{constructor(){super(...arguments),this.KeyframeResolver=kyt}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const a=e.style;return a?a[n]:void 0}removeValueFromRenderState(e,{vars:n,style:a}){delete n[e],delete a[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xo(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Xm{constructor(e){this.isMounted=!1,this.node=e}update(){}}function X1e({top:t,left:e,right:n,bottom:a}){return{x:{min:e,max:n},y:{min:t,max:a}}}function eQt({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function tQt(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),a=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:a.y,right:a.x}}function V9(t){return t===void 0||t===1}function F7({scale:t,scaleX:e,scaleY:n}){return!V9(t)||!V9(e)||!V9(n)}function Af(t){return F7(t)||$1e(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function $1e(t){return Gce(t.x)||Gce(t.y)}function Gce(t){return t&&t!=="0%"}function fR(t,e,n){const a=t-n,r=e*a;return n+r}function Oce(t,e,n,a,r){return r!==void 0&&(t=fR(t,r,a)),fR(t,n,a)+e}function L7(t,e=0,n=1,a,r){t.min=Oce(t.min,e,n,a,r),t.max=Oce(t.max,e,n,a,r)}function eSe(t,{x:e,y:n}){L7(t.x,e.translate,e.scale,e.originPoint),L7(t.y,n.translate,n.scale,n.originPoint)}const Uce=.999999999999,Pce=1.0000000000001;function nQt(t,e,n,a=!1){const r=n.length;if(!r)return;e.x=e.y=1;let i,o;for(let A=0;A<r;A++){i=n[A],o=i.projectionDelta;const{visualElement:s}=i.options;s&&s.props.style&&s.props.style.display==="contents"||(a&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Hd(t.x,-i.scroll.offset.x),Hd(t.y,-i.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,eSe(t,o)),a&&Af(i.latestValues)&&PS(t,i.latestValues,i.layout?.layoutBox))}e.x<Pce&&e.x>Uce&&(e.x=1),e.y<Pce&&e.y>Uce&&(e.y=1)}function Hd(t,e){t.min+=e,t.max+=e}function Kce(t,e,n,a,r=.5){const i=jr(t.min,t.max,r);L7(t,e,n,i,a)}function Hce(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function PS(t,e,n){const a=n??t;Kce(t.x,Hce(e.x,a.x),e.scaleX,e.scale,e.originX),Kce(t.y,Hce(e.y,a.y),e.scaleY,e.scale,e.originY)}function tSe(t,e){return X1e(tQt(t.getBoundingClientRect(),e))}function aQt(t,e,n){const a=tSe(t,n),{scroll:r}=e;return r&&(Hd(a.x,r.offset.x),Hd(a.y,r.offset.y)),a}const rQt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iQt=hB.length;function oQt(t,e,n){let a="",r=!0;for(let i=0;i<iQt;i++){const o=hB[i],A=t[o];if(A===void 0)continue;let s=!0;if(typeof A=="number")s=A===(o.startsWith("scale")?1:0);else{const l=parseFloat(A);s=o.startsWith("scale")?l===1:l===0}if(!s||n){const l=H1e(A,Pz[o]);if(!s){r=!1;const d=rQt[o]||o;a+=`${d}(${l}) `}n&&(e[o]=l)}}return a=a.trim(),n?a=n(e,r?"":a):r&&(a="none"),a}function zz(t,e,n){const{style:a,vars:r,transformOrigin:i}=t;let o=!1,A=!1;for(const s in e){const l=e[s];if(fB.has(s)){o=!0;continue}else if(d1e(s)){r[s]=l;continue}else{const d=H1e(l,Pz[s]);s.startsWith("origin")?(A=!0,i[s]=d):a[s]=d}}if(e.transform||(o||n?a.transform=oQt(e,t.transform,n):a.transform&&(a.transform="none")),A){const{originX:s="50%",originY:l="50%",originZ:d=0}=i;a.transformOrigin=`${s} ${l} ${d}`}}function nSe(t,{style:e,vars:n},a,r){const i=t.style;let o;for(o in e)i[o]=e[o];r?.applyProjectionStyles(i,a);for(o in n)i.setProperty(o,n[o])}function Yce(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const CQ={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Sn.test(t))t=parseFloat(t);else return t;const n=Yce(t,e.target.x),a=Yce(t,e.target.y);return`${n}% ${a}%`}},AQt={correct:(t,{treeScale:e,projectionDelta:n})=>{const a=t,r=Jl.parse(t);if(r.length>5)return a;const i=Jl.createTransformer(t),o=typeof r[0]!="number"?1:0,A=n.x.scale*e.x,s=n.y.scale*e.y;r[0+o]/=A,r[1+o]/=s;const l=jr(A,s,.5);return typeof r[2+o]=="number"&&(r[2+o]/=l),typeof r[3+o]=="number"&&(r[3+o]/=l),i(r)}},T7={borderRadius:{...CQ,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:CQ,borderTopRightRadius:CQ,borderBottomLeftRadius:CQ,borderBottomRightRadius:CQ,boxShadow:AQt};function aSe(t,{layout:e,layoutId:n}){return fB.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!T7[t]||t==="opacity")}function Jz(t,e,n){const a=t.style,r=e?.style,i={};if(!a)return i;for(const o in a)(Xo(a[o])||r&&Xo(r[o])||aSe(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(i[o]=a[o]);return i}function sQt(t){return window.getComputedStyle(t)}class cQt extends V1e{constructor(){super(...arguments),this.type="html",this.renderInstance=nSe}readValueFromInstance(e,n){if(fB.has(n))return this.projection?.isProjecting?y7(n):DBt(e,n);{const a=sQt(e),r=(d1e(n)?a.getPropertyValue(n):a[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return tSe(e,n)}build(e,n,a){zz(e,n,a.transformTemplate)}scrapeMotionValuesFromProps(e,n,a){return Jz(e,n,a)}}const lQt={offset:"stroke-dashoffset",array:"stroke-dasharray"},dQt={offset:"strokeDashoffset",array:"strokeDasharray"};function uQt(t,e,n=1,a=0,r=!0){t.pathLength=1;const i=r?lQt:dQt;t[i.offset]=`${-a}`,t[i.array]=`${e} ${n}`}const gQt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rSe(t,{attrX:e,attrY:n,attrScale:a,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...A},s,l,d){if(zz(t,A,l),s){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:u,style:g}=t;u.transform&&(g.transform=u.transform,delete u.transform),(g.transform||u.transformOrigin)&&(g.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),g.transform&&(g.transformBox=d?.transformBox??"fill-box",delete u.transformBox);for(const p of gQt)u[p]!==void 0&&(g[p]=u[p],delete u[p]);e!==void 0&&(u.x=e),n!==void 0&&(u.y=n),a!==void 0&&(u.scale=a),r!==void 0&&uQt(u,r,i,o,!1)}const iSe=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),oSe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function pQt(t,e,n,a){nSe(t,e,void 0,a);for(const r in e.attrs)t.setAttribute(iSe.has(r)?r:Uz(r),e.attrs[r])}function ASe(t,e,n){const a=Jz(t,e,n);for(const r in t)if(Xo(t[r])||Xo(e[r])){const i=hB.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;a[i]=t[r]}return a}class mQt extends V1e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=oo}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(fB.has(n)){const a=U1e(n);return a&&a.default||0}return n=iSe.has(n)?n:Uz(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,a){return ASe(e,n,a)}build(e,n,a){rSe(e,n,this.isSVGTag,a.transformTemplate,a.style)}renderInstance(e,n,a,r){pQt(e,n,a,r)}mount(e){this.isSVGTag=oSe(e.tagName),super.mount(e)}}const hQt=jz.length;function sSe(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?sSe(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<hQt;n++){const a=jz[n],r=t.props[a];($0(r)||r===!1)&&(e[a]=r)}return e}function cSe(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let a=0;a<n;a++)if(e[a]!==t[a])return!1;return!0}const fQt=[...qz].reverse(),bQt=qz.length;function CQt(t){return e=>Promise.all(e.map(({animation:n,options:a})=>myt(t,n,a)))}function EQt(t){let e=CQt(t),n=qce(),a=!0,r=!1;const i=l=>(d,u)=>{const g=Of(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:p,transitionEnd:m,...h}=g;d={...d,...h,...m}}return d};function o(l){e=l(t)}function A(l){const{props:d}=t,u=sSe(t.parent)||{},g=[],p=new Set;let m={},h=1/0;for(let C=0;C<bQt;C++){const B=fQt[C],y=n[B],Q=d[B]!==void 0?d[B]:u[B],k=$0(Q),_=B===l?y.isActive:null;_===!1&&(h=C);let v=Q===u[B]&&Q!==d[B]&&k;if(v&&(a||r)&&t.manuallyAnimateOnMount&&(v=!1),y.protectedKeys={...m},!y.isActive&&_===null||!Q&&!y.prevProp||WM(Q)||typeof Q=="boolean")continue;if(B==="exit"&&y.isActive&&_!==!0){y.prevResolvedValues&&(m={...m,...y.prevResolvedValues});continue}const x=IQt(y.prevProp,Q);let S=x||B===l&&y.isActive&&!v&&k||C>h&&k,L=!1;const N=Array.isArray(Q)?Q:[Q];let U=N.reduce(i(B),{});_===!1&&(U={});const{prevResolvedValues:K={}}=y,R={...K,...U},O=G=>{S=!0,p.has(G)&&(L=!0,p.delete(G)),y.needsAnimating[G]=!0;const H=t.getValue(G);H&&(H.liveStyle=!1)};for(const G in R){const H=U[G],q=K[G];if(m.hasOwnProperty(G))continue;let P=!1;x7(H)&&x7(q)?P=!cSe(H,q):P=H!==q,P?H!=null?O(G):p.add(G):H!==void 0&&p.has(G)?O(G):y.protectedKeys[G]=!0}y.prevProp=Q,y.prevResolvedValues=U,y.isActive&&(m={...m,...U}),(a||r)&&t.blockInitialAnimation&&(S=!1);const F=v&&x;S&&(!F||L)&&g.push(...N.map(G=>{const H={type:B};if(typeof G=="string"&&(a||r)&&!F&&t.manuallyAnimateOnMount&&t.parent){const{parent:q}=t,P=Of(q,G);if(q.enteringChildren&&P){const{delayChildren:z}=P.transition||{};H.delay=_1e(q.enteringChildren,t,z)}}return{animation:G,options:H}}))}if(p.size){const C={};if(typeof d.initial!="boolean"){const B=Of(t,Array.isArray(d.initial)?d.initial[0]:d.initial);B&&B.transition&&(C.transition=B.transition)}p.forEach(B=>{const y=t.getBaseTarget(B),Q=t.getValue(B);Q&&(Q.liveStyle=!0),C[B]=y??null}),g.push({animation:C})}let b=!!g.length;return a&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(b=!1),a=!1,r=!1,b?e(g):Promise.resolve()}function s(l,d){if(n[l].isActive===d)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(l,d)),n[l].isActive=d;const u=A(l);for(const g in n)n[g].protectedKeys={};return u}return{animateChanges:A,setActive:s,setAnimateFunction:o,getState:()=>n,reset:()=>{n=qce(),r=!0}}}function IQt(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!cSe(e,t):!1}function Jh(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qce(){return{animate:Jh(!0),whileInView:Jh(),whileHover:Jh(),whileTap:Jh(),whileDrag:Jh(),whileFocus:Jh(),exit:Jh()}}function G7(t,e){t.min=e.min,t.max=e.max}function yl(t,e){G7(t.x,e.x),G7(t.y,e.y)}function jce(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const lSe=1e-4,BQt=1-lSe,yQt=1+lSe,dSe=.01,QQt=0-dSe,wQt=0+dSe;function YA(t){return t.max-t.min}function kQt(t,e,n){return Math.abs(t-e)<=n}function zce(t,e,n,a=.5){t.origin=a,t.originPoint=jr(e.min,e.max,t.origin),t.scale=YA(n)/YA(e),t.translate=jr(n.min,n.max,t.origin)-t.originPoint,(t.scale>=BQt&&t.scale<=yQt||isNaN(t.scale))&&(t.scale=1),(t.translate>=QQt&&t.translate<=wQt||isNaN(t.translate))&&(t.translate=0)}function t0(t,e,n,a){zce(t.x,e.x,n.x,a?a.originX:void 0),zce(t.y,e.y,n.y,a?a.originY:void 0)}function Jce(t,e,n,a=0){const r=a?jr(n.min,n.max,a):n.min;t.min=r+e.min,t.max=t.min+YA(e)}function vQt(t,e,n,a){Jce(t.x,e.x,n.x,a?.x),Jce(t.y,e.y,n.y,a?.y)}function Wce(t,e,n,a=0){const r=a?jr(n.min,n.max,a):n.min;t.min=e.min-r,t.max=t.min+YA(e)}function bR(t,e,n,a){Wce(t.x,e.x,n.x,a?.x),Wce(t.y,e.y,n.y,a?.y)}function Zce(t,e,n,a,r){return t-=e,t=fR(t,1/n,a),r!==void 0&&(t=fR(t,1/r,a)),t}function DQt(t,e=0,n=1,a=.5,r,i=t,o=t){if(ou.test(e)&&(e=parseFloat(e),e=jr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let A=jr(i.min,i.max,a);t===i&&(A-=e),t.min=Zce(t.min,e,n,A,r),t.max=Zce(t.max,e,n,A,r)}function Vce(t,e,[n,a,r],i,o){DQt(t,e[n],e[a],e[r],e.scale,i,o)}const xQt=["x","scaleX","originX"],SQt=["y","scaleY","originY"];function Xce(t,e,n,a){Vce(t.x,e,xQt,n?n.x:void 0,a?a.x:void 0),Vce(t.y,e,SQt,n?n.y:void 0,a?a.y:void 0)}function $ce(t){return t.translate===0&&t.scale===1}function uSe(t){return $ce(t.x)&&$ce(t.y)}function ele(t,e){return t.min===e.min&&t.max===e.max}function _Qt(t,e){return ele(t.x,e.x)&&ele(t.y,e.y)}function tle(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function gSe(t,e){return tle(t.x,e.x)&&tle(t.y,e.y)}function nle(t){return YA(t.x)/YA(t.y)}function ale(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Gd(t){return[t("x"),t("y")]}function RQt(t,e,n){let a="";const r=t.x.translate/e.x,i=t.y.translate/e.y,o=n?.z||0;if((r||i||o)&&(a=`translate3d(${r}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(a+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:d,rotateX:u,rotateY:g,skewX:p,skewY:m}=n;l&&(a=`perspective(${l}px) ${a}`),d&&(a+=`rotate(${d}deg) `),u&&(a+=`rotateX(${u}deg) `),g&&(a+=`rotateY(${g}deg) `),p&&(a+=`skewX(${p}deg) `),m&&(a+=`skewY(${m}deg) `)}const A=t.x.scale*e.x,s=t.y.scale*e.y;return(A!==1||s!==1)&&(a+=`scale(${A}, ${s})`),a||"none"}const pSe=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],NQt=pSe.length,rle=t=>typeof t=="string"?parseFloat(t):t,ile=t=>typeof t=="number"||Sn.test(t);function MQt(t,e,n,a,r,i){r?(t.opacity=jr(0,n.opacity??1,FQt(a)),t.opacityExit=jr(e.opacity??1,0,LQt(a))):i&&(t.opacity=jr(e.opacity??1,n.opacity??1,a));for(let o=0;o<NQt;o++){const A=pSe[o];let s=ole(e,A),l=ole(n,A);if(s===void 0&&l===void 0)continue;s||(s=0),l||(l=0),s===0||l===0||ile(s)===ile(l)?(t[A]=Math.max(jr(rle(s),rle(l),a),0),(ou.test(l)||ou.test(s))&&(t[A]+="%")):t[A]=l}(e.rotate||n.rotate)&&(t.rotate=jr(e.rotate||0,n.rotate||0,a))}function ole(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const FQt=mSe(0,.5,i1e),LQt=mSe(.5,.95,tl);function mSe(t,e,n){return a=>a<t?0:a>e?1:n(V0(t,e,a))}function TQt(t,e,n){const a=Xo(t)?t:SI(t);return a.start(Gz("",a,e,n)),a.animation}function ek(t,e,n,a={passive:!0}){return t.addEventListener(e,n,a),()=>t.removeEventListener(e,n)}const GQt=(t,e)=>t.depth-e.depth;class OQt{constructor(){this.children=[],this.isDirty=!1}add(e){wz(this.children,e),this.isDirty=!0}remove(e){dR(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(GQt),this.isDirty=!1,this.children.forEach(e)}}function UQt(t,e){const n=HA.now(),a=({timestamp:r})=>{const i=r-n;i>=e&&(xm(a),t(i-e))};return _r.setup(a,!0),()=>xm(a)}function KS(t){return Xo(t)?t.get():t}class PQt{constructor(){this.members=[]}add(e){wz(this.members,e);for(let n=this.members.length-1;n>=0;n--){const a=this.members[n];if(a===e||a===this.lead||a===this.prevLead)continue;const r=a.instance;(!r||r.isConnected===!1)&&!a.snapshot&&(dR(this.members,a),a.unmount())}e.scheduleRender()}remove(e){if(dR(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&a.instance?.isConnected!==!1)return this.promote(a),!0}return!1}promote(e,n){const a=this.lead;if(e!==a&&(this.prevLead=a,this.lead=e,e.show(),a)){a.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=a.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=a,n&&(a.preserveOpacity=!0),a.snapshot&&(e.snapshot=a.snapshot,e.snapshot.latestValues=a.animationValues||a.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const HS={hasAnimatedSinceResize:!0,hasEverUpdated:!1},X9=["","X","Y","Z"],KQt=1e3;let HQt=0;function $9(t,e,n,a){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),a&&(a[t]=0))}function hSe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=L1e(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",_r,!(r||i))}const{parent:a}=t;a&&!a.hasCheckedOptimisedAppear&&hSe(a)}function fSe({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:a,resetTransform:r}){return class{constructor(o={},A=e?.()){this.id=HQt++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jQt),this.nodes.forEach(XQt),this.nodes.forEach($Qt),this.nodes.forEach(zQt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=A?A.root||A:this,this.path=A?[...A.path,A]:[],this.parent=A,this.depth=A?A.depth+1:0;for(let s=0;s<this.path.length;s++)this.path[s].shouldResetTransform=!0;this.root===this&&(this.nodes=new OQt)}addEventListener(o,A){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vz),this.eventHandlers.get(o).add(A)}notifyListeners(o,...A){const s=this.eventHandlers.get(o);s&&s.notify(...A)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Yz(o)&&!qyt(o),this.instance=o;const{layoutId:A,layout:s,visualElement:l}=this.options;if(l&&!l.current&&l.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||A)&&(this.isLayoutDirty=!0),t){let d,u=0;const g=()=>this.root.updateBlockedByResize=!1;_r.read(()=>{u=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==u&&(u=p,this.root.updateBlockedByResize=!0,d&&d(),d=UQt(g,250),HS.hasAnimatedSinceResize&&(HS.hasAnimatedSinceResize=!1,this.nodes.forEach(cle)))})}A&&this.root.registerSharedNode(A,this),this.options.animate!==!1&&l&&(A||s)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:u,hasRelativeLayoutChanged:g,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||rwt,{onLayoutAnimationStart:h,onLayoutAnimationComplete:b}=l.getProps(),C=!this.targetLayout||!gSe(this.targetLayout,p),B=!u&&g;if(this.options.layoutRoot||this.resumeFrom||B||u&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Tz(m,"layout"),onPlay:h,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,B)}else u||cle(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),xm(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ewt),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hSe(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,(typeof u.latestValues.x=="string"||typeof u.latestValues.y=="string")&&(u.isLayoutDirty=!0),u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:A,layout:s}=this.options;if(A===void 0&&!s)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const s=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),s&&this.nodes.forEach(WQt),this.nodes.forEach(Ale);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(sle);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ZQt),this.nodes.forEach(VQt),this.nodes.forEach(YQt),this.nodes.forEach(qQt)):this.nodes.forEach(sle),this.clearAllSnapshots();const A=HA.now();Jo.delta=uu(0,1e3/60,A-Jo.timestamp),Jo.timestamp=A,Jo.isProcessing=!0,Y9.update.process(Jo),Y9.preRender.process(Jo),Y9.render.process(Jo),Jo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kz.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JQt),this.sharedNodes.forEach(twt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_r.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_r.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!YA(this.snapshot.measuredBox.x)&&!YA(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let s=0;s<this.path.length;s++)this.path[s].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=oo()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:A}=this.options;A&&A.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let A=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(A=!1),A&&this.instance){const s=a(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:s,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:s}}}resetTransform(){if(!r)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,A=this.projectionDelta&&!uSe(this.projectionDelta),s=this.getTransformTemplate(),l=s?s(this.latestValues,""):void 0,d=l!==this.prevTransformTemplateValue;o&&this.instance&&(A||Af(this.latestValues)||d)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const A=this.measurePageBox();let s=this.removeElementScroll(A);return o&&(s=this.removeTransform(s)),iwt(s),{animationId:this.root.animationId,measuredBox:A,layoutBox:s,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return oo();const A=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(owt))){const{scroll:l}=this.root;l&&(Hd(A.x,l.offset.x),Hd(A.y,l.offset.y))}return A}removeElementScroll(o){const A=oo();if(yl(A,o),this.scroll?.wasRoot)return A;for(let s=0;s<this.path.length;s++){const l=this.path[s],{scroll:d,options:u}=l;l!==this.root&&d&&u.layoutScroll&&(d.wasRoot&&yl(A,o),Hd(A.x,d.offset.x),Hd(A.y,d.offset.y))}return A}applyTransform(o,A=!1,s){const l=s||oo();yl(l,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!A&&u.options.layoutScroll&&u.scroll&&u!==u.root&&(Hd(l.x,-u.scroll.offset.x),Hd(l.y,-u.scroll.offset.y)),Af(u.latestValues)&&PS(l,u.latestValues,u.layout?.layoutBox)}return Af(this.latestValues)&&PS(l,this.latestValues,this.layout?.layoutBox),l}removeTransform(o){const A=oo();yl(A,o);for(let s=0;s<this.path.length;s++){const l=this.path[s];if(!Af(l.latestValues))continue;let d;l.instance&&(F7(l.latestValues)&&l.updateSnapshot(),d=oo(),yl(d,l.measurePageBox())),Xce(A,l.latestValues,l.snapshot?.layoutBox,d)}return Af(this.latestValues)&&Xce(A,this.latestValues),A}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Jo.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const A=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=A.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=A.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=A.isSharedProjectionDirty);const s=!!this.resumingFrom||this!==A;if(!(o||s&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!this.layout||!(d||u))return;this.resolvedRelativeTargetAt=Jo.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=oo(),this.targetWithTransforms=oo()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vQt(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):yl(this.target,this.layout.layoutBox),eSe(this.target,this.targetDelta)):yl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||F7(this.parent.latestValues)||$1e(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,A,s){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=oo(),this.relativeTargetOrigin=oo(),bR(this.relativeTargetOrigin,A,s,this.options.layoutAnchor||void 0),yl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),A=!!this.resumingFrom||this!==o;let s=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(s=!1),A&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(s=!1),this.resolvedRelativeTargetAt===Jo.timestamp&&(s=!1),s)return;const{layout:l,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||d))return;yl(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,g=this.treeScale.y;nQt(this.layoutCorrected,this.treeScale,this.path,A),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=oo());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(jce(this.prevProjectionDelta.x,this.projectionDelta.x),jce(this.prevProjectionDelta.y,this.projectionDelta.y)),t0(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==g||!ale(this.projectionDelta.x,this.prevProjectionDelta.x)||!ale(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const A=this.getStack();A&&A.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wE(),this.projectionDelta=wE(),this.projectionDeltaWithTransform=wE()}setAnimationOrigin(o,A=!1){const s=this.snapshot,l=s?s.latestValues:{},d={...this.latestValues},u=wE();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!A;const g=oo(),p=s?s.source:void 0,m=this.layout?this.layout.source:void 0,h=p!==m,b=this.getStack(),C=!b||b.members.length<=1,B=!!(h&&!C&&this.options.crossfade===!0&&!this.path.some(awt));this.animationProgress=0;let y;this.mixTargetDelta=Q=>{const k=Q/1e3;lle(u.x,o.x,k),lle(u.y,o.y,k),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bR(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),nwt(this.relativeTarget,this.relativeTargetOrigin,g,k),y&&_Qt(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=oo()),yl(y,this.relativeTarget)),h&&(this.animationValues=d,MQt(d,l,this.latestValues,k,B,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(xm(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_r.update(()=>{HS.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=SI(0)),this.motionValue.jump(0,!1),this.currentAnimation=TQt(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:A=>{this.mixTargetDelta(A),o.onUpdate&&o.onUpdate(A)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KQt),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:A,target:s,layout:l,latestValues:d}=o;if(!(!A||!s||!l)){if(this!==o&&this.layout&&l&&bSe(this.options.animationType,this.layout.layoutBox,l.layoutBox)){s=this.target||oo();const u=YA(this.layout.layoutBox.x);s.x.min=o.target.x.min,s.x.max=s.x.min+u;const g=YA(this.layout.layoutBox.y);s.y.min=o.target.y.min,s.y.max=s.y.min+g}yl(A,s),PS(A,d),t0(this.projectionDeltaWithTransform,this.layoutCorrected,A,d)}}registerSharedNode(o,A){this.sharedNodes.has(o)||this.sharedNodes.set(o,new PQt),this.sharedNodes.get(o).add(A);const l=A.options.initialPromotionConfig;A.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(A):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:A,preserveFollowOpacity:s}={}){const l=this.getStack();l&&l.promote(this,s),o&&(this.projectionDelta=void 0,this.needsReset=!0),A&&this.setOptions({transition:A})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let A=!1;const{latestValues:s}=o;if((s.z||s.rotate||s.rotateX||s.rotateY||s.rotateZ||s.skewX||s.skewY)&&(A=!0),!A)return;const l={};s.z&&$9("z",o,l,this.animationValues);for(let d=0;d<X9.length;d++)$9(`rotate${X9[d]}`,o,l,this.animationValues),$9(`skew${X9[d]}`,o,l,this.animationValues);o.render();for(const d in l)o.setStaticValue(d,l[d]),this.animationValues&&(this.animationValues[d]=l[d]);o.scheduleRender()}applyProjectionStyles(o,A){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const s=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=KS(A?.pointerEvents)||"",o.transform=s?s(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=KS(A?.pointerEvents)||""),this.hasProjected&&!Af(this.latestValues)&&(o.transform=s?s({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=l.animationValues||l.latestValues;this.applyTransformsToTarget();let u=RQt(this.projectionDeltaWithTransform,this.treeScale,d);s&&(u=s(d,u)),o.transform=u;const{x:g,y:p}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${p.origin*100}% 0`,l.animationValues?o.opacity=l===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=l===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in T7){if(d[m]===void 0)continue;const{correct:h,applyTo:b,isCSSVariable:C}=T7[m],B=u==="none"?d[m]:h(d[m],l);if(b){const y=b.length;for(let Q=0;Q<y;Q++)o[b[Q]]=B}else C?this.options.visualElement.renderState.vars[m]=B:o[m]=B}this.options.layoutId&&(o.pointerEvents=l===this?KS(A?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Ale),this.root.sharedNodes.clear()}}}function YQt(t){t.updateLayout()}function qQt(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=t.layout,{animationType:r}=t.options,i=e.source!==t.layout.source;if(r==="size")Gd(d=>{const u=i?e.measuredBox[d]:e.layoutBox[d],g=YA(u);u.min=n[d].min,u.max=u.min+g});else if(r==="x"||r==="y"){const d=r==="x"?"y":"x";G7(i?e.measuredBox[d]:e.layoutBox[d],n[d])}else bSe(r,e.layoutBox,n)&&Gd(d=>{const u=i?e.measuredBox[d]:e.layoutBox[d],g=YA(n[d]);u.max=u.min+g,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+g)});const o=wE();t0(o,n,e.layoutBox);const A=wE();i?t0(A,t.applyTransform(a,!0),e.measuredBox):t0(A,n,e.layoutBox);const s=!uSe(o);let l=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:u,layout:g}=d;if(u&&g){const p=t.options.layoutAnchor||void 0,m=oo();bR(m,e.layoutBox,u.layoutBox,p);const h=oo();bR(h,n,g.layoutBox,p),gSe(m,h)||(l=!0),d.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:A,layoutDelta:o,hasLayoutChanged:s,hasRelativeLayoutChanged:l})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function jQt(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function zQt(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function JQt(t){t.clearSnapshot()}function Ale(t){t.clearMeasurements()}function WQt(t){t.isLayoutDirty=!0,t.updateLayout()}function sle(t){t.isLayoutDirty=!1}function ZQt(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function VQt(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function cle(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function XQt(t){t.resolveTargetDelta()}function $Qt(t){t.calcProjection()}function ewt(t){t.resetSkewAndRotation()}function twt(t){t.removeLeadSnapshot()}function lle(t,e,n){t.translate=jr(e.translate,0,n),t.scale=jr(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function dle(t,e,n,a){t.min=jr(e.min,n.min,a),t.max=jr(e.max,n.max,a)}function nwt(t,e,n,a){dle(t.x,e.x,n.x,a),dle(t.y,e.y,n.y,a)}function awt(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rwt={duration:.45,ease:[.4,0,.1,1]},ule=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),gle=ule("applewebkit/")&&!ule("chrome/")?Math.round:tl;function ple(t){t.min=gle(t.min),t.max=gle(t.max)}function iwt(t){ple(t.x),ple(t.y)}function bSe(t,e,n){return t==="position"||t==="preserve-aspect"&&!kQt(nle(e),nle(n),.2)}function owt(t){return t!==t.root&&t.scroll?.wasRoot}const Awt=fSe({attachResizeListener:(t,e)=>ek(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),eU={current:void 0},CSe=fSe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!eU.current){const t=new Awt({});t.mount(window),t.setOptions({layoutScroll:!0}),eU.current=t}return eU.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ESe=Y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function swt(t=!0){const e=Y.useContext(Qz);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:a,register:r}=e,i=Y.useId();Y.useEffect(()=>{if(t)return r(i)},[t]);const o=Y.useCallback(()=>t&&a&&a(i),[i,a,t]);return!n&&a?[!1,o]:[!0]}const ISe=Y.createContext({strict:!1}),mle={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let hle=!1;function cwt(){if(hle)return;const t={};for(const e in mle)t[e]={isEnabled:n=>mle[e].some(a=>!!n[a])};Z1e(t),hle=!0}function BSe(){return cwt(),Xyt()}function lwt(t){const e=BSe();for(const n in t)e[n]={...e[n],...t[n]};Z1e(e)}const dwt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function CR(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dwt.has(t)}let ySe=t=>!CR(t);function uwt(t){typeof t=="function"&&(ySe=e=>e.startsWith("on")?!CR(e):t(e))}try{uwt(require("@emotion/is-prop-valid").default)}catch{}function gwt(t,e,n){const a={};for(const r in t)r==="values"&&typeof t.values=="object"||Xo(t[r])||(ySe(r)||n===!0&&CR(r)||!e&&!CR(r)||t.draggable&&r.startsWith("onDrag"))&&(a[r]=t[r]);return a}const VM=Y.createContext({});function pwt(t,e){if(ZM(t)){const{initial:n,animate:a}=t;return{initial:n===!1||$0(n)?n:void 0,animate:$0(a)?a:void 0}}return t.inherit!==!1?e:{}}function mwt(t){const{initial:e,animate:n}=pwt(t,Y.useContext(VM));return Y.useMemo(()=>({initial:e,animate:n}),[fle(e),fle(n)])}function fle(t){return Array.isArray(t)?t.join(" "):t}const Wz=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function QSe(t,e,n){for(const a in e)!Xo(e[a])&&!aSe(a,n)&&(t[a]=e[a])}function hwt({transformTemplate:t},e){return Y.useMemo(()=>{const n=Wz();return zz(n,e,t),Object.assign({},n.vars,n.style)},[e])}function fwt(t,e){const n=t.style||{},a={};return QSe(a,n,t),Object.assign(a,hwt(t,e)),a}function bwt(t,e){const n={},a=fwt(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=a,n}const wSe=()=>({...Wz(),attrs:{}});function Cwt(t,e,n,a){const r=Y.useMemo(()=>{const i=wSe();return rSe(i,e,oSe(a),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};QSe(i,t.style,t),r.style={...i,...r.style}}return r}const Ewt=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Zz(t){return typeof t!="string"||t.includes("-")?!1:!!(Ewt.indexOf(t)>-1||/[A-Z]/u.test(t))}function Iwt(t,e,n,{latestValues:a},r,i=!1,o){const s=(o??Zz(t)?Cwt:bwt)(e,a,r,t),l=gwt(e,typeof t=="string",i),d=t!==Y.Fragment?{...l,...s,ref:n}:{},{children:u}=e,g=Y.useMemo(()=>Xo(u)?u.get():u,[u]);return Y.createElement(t,{...d,children:g})}function Bwt({scrapeMotionValuesFromProps:t,createRenderState:e},n,a,r){return{latestValues:ywt(n,a,r,t),renderState:e()}}function ywt(t,e,n,a){const r={},i=a(t,{});for(const g in i)r[g]=KS(i[g]);let{initial:o,animate:A}=t;const s=ZM(t),l=J1e(t);e&&l&&!s&&t.inherit!==!1&&(o===void 0&&(o=e.initial),A===void 0&&(A=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?A:o;if(u&&typeof u!="boolean"&&!WM(u)){const g=Array.isArray(u)?u:[u];for(let p=0;p<g.length;p++){const m=Oz(t,g[p]);if(m){const{transitionEnd:h,transition:b,...C}=m;for(const B in C){let y=C[B];if(Array.isArray(y)){const Q=d?y.length-1:0;y=y[Q]}y!==null&&(r[B]=y)}for(const B in h)r[B]=h[B]}}}return r}const kSe=t=>(e,n)=>{const a=Y.useContext(VM),r=Y.useContext(Qz),i=()=>Bwt(t,e,a,r);return n?i():EIt(i)},Qwt=kSe({scrapeMotionValuesFromProps:Jz,createRenderState:Wz}),wwt=kSe({scrapeMotionValuesFromProps:ASe,createRenderState:wSe}),kwt=Symbol.for("motionComponentSymbol");function vwt(t,e,n){const a=Y.useRef(n);Y.useInsertionEffect(()=>{a.current=n});const r=Y.useRef(null);return Y.useCallback(i=>{i&&t.onMount?.(i);const o=a.current;if(typeof o=="function")if(i){const A=o(i);typeof A=="function"&&(r.current=A)}else r.current?(r.current(),r.current=null):o(i);else o&&(o.current=i);e&&(i?e.mount(i):e.unmount())},[e])}const vSe=Y.createContext({});function cE(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Dwt(t,e,n,a,r,i){const{visualElement:o}=Y.useContext(VM),A=Y.useContext(ISe),s=Y.useContext(Qz),l=Y.useContext(ESe),d=l.reducedMotion,u=l.skipAnimations,g=Y.useRef(null),p=Y.useRef(!1);a=a||A.renderer,!g.current&&a&&(g.current=a(t,{visualState:e,parent:o,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:d,skipAnimations:u,isSVG:i}),p.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const m=g.current,h=Y.useContext(vSe);m&&!m.projection&&r&&(m.type==="html"||m.type==="svg")&&xwt(g.current,n,r,h);const b=Y.useRef(!1);Y.useInsertionEffect(()=>{m&&b.current&&m.update(n,s)});const C=n[F1e],B=Y.useRef(!!C&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(C)&&window.MotionHasOptimisedAnimation?.(C));return BIt(()=>{p.current=!0,m&&(b.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),B.current&&m.animationState&&m.animationState.animateChanges())}),Y.useEffect(()=>{m&&(!B.current&&m.animationState&&m.animationState.animateChanges(),B.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(C)}),B.current=!1),m.enteringChildren=void 0)}),m}function xwt(t,e,n,a){const{layoutId:r,layout:i,drag:o,dragConstraints:A,layoutScroll:s,layoutRoot:l,layoutAnchor:d,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:DSe(t.parent)),t.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||A&&cE(A),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:a,crossfade:u,layoutScroll:s,layoutRoot:l,layoutAnchor:d})}function DSe(t){if(t)return t.options.allowProjection!==!1?t.projection:DSe(t.parent)}function tU(t,{forwardMotionProps:e=!1,type:n}={},a,r){a&&lwt(a);const i=n?n==="svg":Zz(t),o=i?wwt:Qwt;function A(l,d){let u;const g={...Y.useContext(ESe),...l,layoutId:Swt(l)},{isStatic:p}=g,m=mwt(l),h=o(l,p);if(!p&&typeof window<"u"){_wt();const b=Rwt(g);u=b.MeasureLayout,m.visualElement=Dwt(t,h,g,r,b.ProjectionNode,i)}return I.jsxs(VM.Provider,{value:m,children:[u&&m.visualElement?I.jsx(u,{visualElement:m.visualElement,...g}):null,Iwt(t,l,vwt(h,m.visualElement,d),h,p,e,i)]})}A.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const s=Y.forwardRef(A);return s[kwt]=t,s}function Swt({layoutId:t}){const e=Y.useContext(zxe).id;return e&&t!==void 0?e+"-"+t:t}function _wt(t,e){Y.useContext(ISe).strict}function Rwt(t){const e=BSe(),{drag:n,layout:a}=e;if(!n&&!a)return{};const r={...n,...a};return{MeasureLayout:n?.isEnabled(t)||a?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Nwt(t,e){if(typeof Proxy>"u")return tU;const n=new Map,a=(i,o)=>tU(i,o,t,e),r=(i,o)=>a(i,o);return new Proxy(r,{get:(i,o)=>o==="create"?a:(n.has(o)||n.set(o,tU(o,void 0,t,e)),n.get(o))})}const Mwt=(t,e)=>e.isSVG??Zz(t)?new mQt(e):new cQt(e,{allowProjection:t!==Y.Fragment});class Fwt extends Xm{constructor(e){super(e),e.animationState||(e.animationState=EQt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();WM(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Lwt=0;class Twt extends Xm{constructor(){super(...arguments),this.id=Lwt++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===a)return;if(e&&a===!1){if(this.isExitComplete){const{initial:i,custom:o}=this.node.getProps();if(typeof i=="string"){const A=Of(this.node,i,o);if(A){const{transition:s,transitionEnd:l,...d}=A;for(const u in d)this.node.getValue(u)?.jump(d[u])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Gwt={animation:{Feature:Fwt},exit:{Feature:Twt}};function $k(t){return{point:{x:t.pageX,y:t.pageY}}}const Owt=t=>e=>Hz(e)&&t(e,$k(e));function n0(t,e,n,a){return ek(t,e,Owt(n),a)}const xSe=({current:t})=>t?t.ownerDocument.defaultView:null,ble=(t,e)=>Math.abs(t-e);function Uwt(t,e){const n=ble(t.x,e.x),a=ble(t.y,e.y);return Math.sqrt(n**2+a**2)}const Cle=new Set(["auto","scroll"]);class SSe{constructor(e,n,{transformPagePoint:a,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:A}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zx(this.lastRawMoveEventInfo,this.transformPagePoint));const p=nU(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,h=Uwt(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!h)return;const{point:b}=p,{timestamp:C}=Jo;this.history.push({...b,timestamp:C});const{onStart:B,onMove:y}=this.handlers;m||(B&&B(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,p)},this.handlePointerMove=(p,m)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=m,this.lastMoveEventInfo=zx(m,this.transformPagePoint),_r.update(this.updatePoint,!0)},this.handlePointerUp=(p,m)=>{this.end();const{onEnd:h,onSessionEnd:b,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const B=nU(p.type==="pointercancel"?this.lastMoveEventInfo:zx(m,this.transformPagePoint),this.history);this.startEvent&&h&&h(p,B),b&&b(p,B)},!Hz(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=a,this.distanceThreshold=o,this.contextWindow=r||window;const s=$k(e),l=zx(s,this.transformPagePoint),{point:d}=l,{timestamp:u}=Jo;this.history=[{...d,timestamp:u}];const{onSessionStart:g}=n;g&&g(e,nU(l,this.history)),this.removeListeners=Zk(n0(this.contextWindow,"pointermove",this.handlePointerMove),n0(this.contextWindow,"pointerup",this.handlePointerUp),n0(this.contextWindow,"pointercancel",this.handlePointerUp)),A&&this.startScrollTracking(A)}startScrollTracking(e){let n=e.parentElement;for(;n;){const a=getComputedStyle(n);(Cle.has(a.overflowX)||Cle.has(a.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const a=e===window,r=a?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-n.x,y:r.y-n.y};i.x===0&&i.y===0||(a?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),_r.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),xm(this.updatePoint)}}function zx(t,e){return e?{point:e(t.point)}:t}function Ele(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nU({point:t},e){return{point:t,delta:Ele(t,_Se(e)),offset:Ele(t,Pwt(e)),velocity:Kwt(e,.1)}}function Pwt(t){return t[0]}function _Se(t){return t[t.length-1]}function Kwt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,a=null;const r=_Se(t);for(;n>=0&&(a=t[n],!(r.timestamp-a.timestamp>lc(e)));)n--;if(!a)return{x:0,y:0};a===t[0]&&t.length>2&&r.timestamp-a.timestamp>lc(e)*2&&(a=t[1]);const i=Vc(r.timestamp-a.timestamp);if(i===0)return{x:0,y:0};const o={x:(r.x-a.x)/i,y:(r.y-a.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Hwt(t,{min:e,max:n},a){return e!==void 0&&t<e?t=a?jr(e,t,a.min):Math.max(t,e):n!==void 0&&t>n&&(t=a?jr(n,t,a.max):Math.min(t,n)),t}function Ile(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ywt(t,{top:e,left:n,bottom:a,right:r}){return{x:Ile(t.x,n,r),y:Ile(t.y,e,a)}}function Ble(t,e){let n=e.min-t.min,a=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,a]=[a,n]),{min:n,max:a}}function qwt(t,e){return{x:Ble(t.x,e.x),y:Ble(t.y,e.y)}}function jwt(t,e){let n=.5;const a=YA(t),r=YA(e);return r>a?n=V0(e.min,e.max-a,t.min):a>r&&(n=V0(t.min,t.max-r,e.min)),uu(0,1,n)}function zwt(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const O7=.35;function Jwt(t=O7){return t===!1?t=0:t===!0&&(t=O7),{x:yle(t,"left","right"),y:yle(t,"top","bottom")}}function yle(t,e,n){return{min:Qle(t,e),max:Qle(t,n)}}function Qle(t,e){return typeof t=="number"?t:t[e]||0}const Wwt=new WeakMap;class Zwt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=oo(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:a}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{n&&this.snapToCursor($k(u).point),this.stopAnimation()},o=(u,g)=>{const{drag:p,dragPropagation:m,onDragStart:h}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Dyt(p),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gd(C=>{let B=this.getAxisMotionValue(C).get()||0;if(ou.test(B)){const{projection:y}=this.visualElement;if(y&&y.layout){const Q=y.layout.layoutBox[C];Q&&(B=YA(Q)*(parseFloat(B)/100))}}this.originPoint[C]=B}),h&&_r.update(()=>h(u,g),!1,!0),S7(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},A=(u,g)=>{this.latestPointerEvent=u,this.latestPanInfo=g;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:h,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:C}=g;if(m&&this.currentDirection===null){this.currentDirection=Xwt(C),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",g.point,C),this.updateAxis("y",g.point,C),this.visualElement.render(),b&&_r.update(()=>b(u,g),!1,!0)},s=(u,g)=>{this.latestPointerEvent=u,this.latestPanInfo=g,this.stop(u,g),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:u}=this.getProps();(u||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new SSe(e,{onSessionStart:i,onStart:o,onMove:A,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:a,contextWindow:xSe(this.visualElement),element:this.visualElement.current})}stop(e,n){const a=e||this.latestPointerEvent,r=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!a)return;const{velocity:o}=r;this.startAnimation(o);const{onDragEnd:A}=this.getProps();A&&_r.postRender(()=>A(a,r))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,a){const{drag:r}=this.getProps();if(!a||!Jx(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+a[e];this.constraints&&this.constraints[e]&&(o=Hwt(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&cE(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&a?this.constraints=Ywt(a.layoutBox,e):this.constraints=!1,this.elastic=Jwt(n),r!==this.constraints&&!cE(e)&&a&&this.constraints&&!this.hasMutatedConstraints&&Gd(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=zwt(a.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!cE(e))return!1;const a=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=aQt(a,r.root,this.visualElement.getTransformPagePoint());let o=qwt(r.layout.layoutBox,i);if(n){const A=n(eQt(o));this.hasMutatedConstraints=!!A,A&&(o=X1e(A))}return o}startAnimation(e){const{drag:n,dragMomentum:a,dragElastic:r,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:A}=this.getProps(),s=this.constraints||{},l=Gd(d=>{if(!Jx(d,n,this.currentDirection))return;let u=s&&s[d]||{};(o===!0||o===d)&&(u={min:0,max:0});const g=r?200:1e6,p=r?40:1e7,m={type:"inertia",velocity:a?e[d]:0,bounceStiffness:g,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...u};return this.startAxisValueAnimation(d,m)});return Promise.all(l).then(A)}startAxisValueAnimation(e,n){const a=this.getAxisMotionValue(e);return S7(this.visualElement,e),a.start(Gz(e,a,0,n,this.visualElement,!1))}stopAnimation(){Gd(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,a=this.visualElement.getProps(),r=a[n];return r||this.visualElement.getValue(e,(a.initial?a.initial[e]:void 0)||0)}snapToCursor(e){Gd(n=>{const{drag:a}=this.getProps();if(!Jx(n,a,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:o,max:A}=r.layout.layoutBox[n],s=i.get()||0;i.set(e[n]-jr(o,A,.5)+s)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:a}=this.visualElement;if(!cE(n)||!a||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Gd(o=>{const A=this.getAxisMotionValue(o);if(A&&this.constraints!==!1){const s=A.get();r[o]=jwt({min:s,max:s},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.constraints=!1,this.resolveConstraints(),Gd(o=>{if(!Jx(o,e,null))return;const A=this.getAxisMotionValue(o),{min:s,max:l}=this.constraints[o];A.set(jr(s,l,r[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Wwt.set(this.visualElement,this);const e=this.visualElement.current,n=n0(e,"pointerdown",l=>{const{drag:d,dragListener:u=!0}=this.getProps(),g=l.target,p=g!==e&&Myt(g);d&&u&&!p&&this.start(l)});let a;const r=()=>{const{dragConstraints:l}=this.getProps();cE(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),a||(a=Vwt(e,l.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_r.read(r);const A=ek(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:d})=>{this.isDragging&&d&&(Gd(u=>{const g=this.getAxisMotionValue(u);g&&(this.originPoint[u]+=l[u].translate,g.set(g.get()+l[u].translate))}),this.visualElement.render())}));return()=>{A(),n(),o(),s&&s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:a=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:o=O7,dragMomentum:A=!0}=e;return{...e,drag:n,dragDirectionLock:a,dragPropagation:r,dragConstraints:i,dragElastic:o,dragMomentum:A}}}function wle(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Vwt(t,e,n){const a=Mce(t,wle(n)),r=Mce(e,wle(n));return()=>{a(),r()}}function Jx(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Xwt(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class $wt extends Xm{constructor(e){super(e),this.removeGroupControls=tl,this.removeListeners=tl,this.controls=new Zwt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tl}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const aU=t=>(e,n)=>{t&&_r.update(()=>t(e,n),!1,!0)};class e0t extends Xm{constructor(){super(...arguments),this.removePointerDownListener=tl}onPointerDown(e){this.session=new SSe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xSe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:a,onPanEnd:r}=this.node.getProps();return{onSessionStart:aU(e),onStart:aU(n),onMove:aU(a),onEnd:(i,o)=>{delete this.session,r&&_r.postRender(()=>r(i,o))}}}mount(){this.removePointerDownListener=n0(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rU=!1;class t0t extends Y.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a,layoutId:r}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),a&&a.register&&r&&a.register(i),rU&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),HS.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:a,drag:r,isPresent:i}=this.props,{projection:o}=a;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),rU=!0,r||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||_r.postRender(()=>{const A=o.getStack();(!A||!A.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:a}=e;a&&(a.options.layoutAnchor=n,a.root.didUpdate(),Kz.postRender(()=>{!a.currentAnimation&&a.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:a}=this.props,{projection:r}=e;rU=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),a&&a.deregister&&a.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function RSe(t){const[e,n]=swt(),a=Y.useContext(zxe);return I.jsx(t0t,{...t,layoutGroup:a,switchLayoutGroup:Y.useContext(vSe),isPresent:e,safeToRemove:n})}const n0t={pan:{Feature:e0t},drag:{Feature:$wt,ProjectionNode:CSe,MeasureLayout:RSe}};function kle(t,e,n){const{props:a}=t;t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=a[r];i&&_r.postRender(()=>i(e,$k(e)))}class a0t extends Xm{mount(){const{current:e}=this.node;e&&(this.unmount=Syt(e,(n,a)=>(kle(this.node,a,"Start"),r=>kle(this.node,r,"End"))))}unmount(){}}class r0t extends Xm{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Zk(ek(this.node.current,"focus",()=>this.onFocus()),ek(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function vle(t,e,n){const{props:a}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&a.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=a[r];i&&_r.postRender(()=>i(e,$k(e)))}class i0t extends Xm{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:a}=this.node.props;this.unmount=Lyt(e,(r,i)=>(vle(this.node,i,"Start"),(o,{success:A})=>vle(this.node,o,A?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:a?.tap===!1})}unmount(){}}const U7=new WeakMap,iU=new WeakMap,o0t=t=>{const e=U7.get(t.target);e&&e(t)},A0t=t=>{t.forEach(o0t)};function s0t({root:t,...e}){const n=t||document;iU.has(n)||iU.set(n,{});const a=iU.get(n),r=JSON.stringify(e);return a[r]||(a[r]=new IntersectionObserver(A0t,{root:t,...e})),a[r]}function c0t(t,e,n){const a=s0t(e);return U7.set(t,n),a.observe(t),()=>{U7.delete(t),a.unobserve(t)}}const l0t={some:0,all:1};class d0t extends Xm{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:a,amount:r="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:a,threshold:typeof r=="number"?r:l0t[r]},A=s=>{const{isIntersecting:l}=s;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),g=l?d:u;g&&g(s)};this.stopObserver=c0t(this.node.current,o,A)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(u0t(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function u0t({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const g0t={inView:{Feature:d0t},tap:{Feature:i0t},focus:{Feature:r0t},hover:{Feature:a0t}},p0t={layout:{ProjectionNode:CSe,MeasureLayout:RSe}},m0t={...Gwt,...g0t,...n0t,...p0t},h0t=Nwt(m0t,Mwt);function f0t({children:t,as:e="span",className:n,duration:a=2,spread:r=2}){const i=h0t.create(e),o=Y.useMemo(()=>t.length*r,[t,r]);return I.jsx(i,{className:["relative inline-block bg-[length:250%_100%,auto] bg-clip-text","text-transparent [--base-color:#a1a1aa] [--base-gradient-color:#000]","[background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]","dark:[--base-color:#71717a] dark:[--base-gradient-color:#ffffff] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]",n].filter(Boolean).join(" "),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:a,ease:"linear"},style:{"--spread":`${o}px`,backgroundImage:"var(--bg), linear-gradient(var(--base-color), var(--base-color))"},children:t})}const b0t=Yt.memo(f0t),C0t="pi install npm:@plannotator/pi-extension";function E0t(t,e=!1){return t==="pi"?C0t:dHe&&!e?'powershell -c "irm https://plannotator.ai/install.ps1 | iex"':"curl -fsSL https://plannotator.ai/install.sh | bash"}const I0t=({appVersion:t,updateInfo:e,origin:n,isWSL:a,closeMenu:r})=>{const[i,o]=Y.useState(!1),A=!!e?.updateAvailable,s=async()=>{try{await navigator.clipboard.writeText(E0t(n,a)),o(!0),setTimeout(()=>o(!1),2e3)}catch(l){console.error("Failed to copy:",l)}};return I.jsxs("div",{className:"px-3 py-2 space-y-2",children:[I.jsxs("div",{className:"flex items-center justify-between gap-3",children:[I.jsx("a",{href:"https://github.com/backnotprop/plannotator",target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-[10px] font-semibold tracking-wide text-muted-foreground hover:text-foreground transition-colors",children:"Plannotator"}),I.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground/70",children:["v",t]})]}),I.jsxs("div",{className:"flex flex-col items-start gap-1 text-[11px]",children:[I.jsxs("span",{className:"flex items-center gap-1.5",children:[I.jsx("a",{href:A?e.releaseUrl:"https://github.com/backnotprop/plannotator/releases",target:"_blank",rel:"noopener noreferrer",onClick:r,className:"text-muted-foreground hover:text-foreground transition-colors",children:"Release notes"}),A&&I.jsxs(I.Fragment,{children:[I.jsx("span",{className:"text-muted-foreground/40",children:"·"}),I.jsx(b0t,{className:"text-[10px] font-medium",duration:2.5,spread:1.5,children:"New update available!"})]})]}),A&&I.jsx("button",{onClick:s,className:"text-emerald-500 hover:text-emerald-400 transition-colors",children:i?"Copied!":"Copy update command"})]})]})},B0t=({appVersion:t,updateInfo:e,origin:n,isWSL:a=!1,onOpenSettings:r,onOpenExport:i,onCopyAgentInstructions:o,onDownloadAnnotations:A,onPrint:s,onCopyShareLink:l,onOpenImport:d,onSaveToObsidian:u,onSaveToBear:g,onSaveToOctarine:p,sharingEnabled:m,isApiMode:h,agentInstructionsEnabled:b,obsidianConfigured:C,bearConfigured:B,octarineConfigured:y})=>{const{theme:Q,setTheme:k}=Hj(),_=!!e?.updateAvailable&&!e.dismissed,v=h&&(C||B||y);return I.jsx(fIt,{renderTrigger:({isOpen:x,toggleMenu:S})=>I.jsxs("button",{onClick:()=>{!x&&_&&e?.dismiss(),S()},className:`relative flex items-center gap-1.5 p-1.5 md:px-2.5 md:py-1 rounded-md text-xs font-medium transition-colors ${x?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:"Options","aria-label":"Options","aria-expanded":x,children:[x?I.jsx(Q0t,{}):I.jsx(y0t,{}),I.jsx("span",{className:"hidden md:inline",children:"Options"}),_&&I.jsx("span",{className:"absolute top-0.5 right-0.5 md:-top-0.5 md:-right-0.5 w-2 h-2 rounded-full bg-primary ring-2 ring-background"})]}),children:({closeMenu:x})=>I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"px-3 py-2 space-y-1.5",children:[I.jsx(bIt,{children:"Theme"}),I.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-muted/50 p-0.5",children:["light","dark","system"].map(S=>I.jsxs("button",{onClick:()=>{x(),k(S)},className:`flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Q===S?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[S==="light"?I.jsx(Yxe,{}):S==="dark"?I.jsx(qxe,{}):I.jsx(jxe,{}),I.jsx("span",{className:"capitalize",children:S})]},S))})]}),I.jsx(Yx,{}),I.jsx(kd,{onClick:()=>{x(),r()},icon:I.jsx(w0t,{}),label:"Settings"}),I.jsx(kd,{onClick:()=>{x(),i()},icon:I.jsx(k0t,{}),label:"Export"}),b&&I.jsx(kd,{onClick:()=>{x(),o()},icon:I.jsx(CIt,{}),label:"Agent Instructions",subtitle:"Copy agent instructions for external annotations"}),I.jsx(Yx,{}),I.jsx(kd,{onClick:()=>{x(),A()},icon:I.jsx(v0t,{}),label:"Download Annotations"}),I.jsx(kd,{onClick:()=>{x(),s()},icon:I.jsx(D0t,{}),label:"Print / Save as PDF",subtitle:"Choose 'Save as PDF' in the print dialog"}),m&&I.jsx(kd,{onClick:()=>{x(),l()},icon:I.jsx(x0t,{}),label:"Copy Share Link"}),m&&I.jsx(kd,{onClick:()=>{x(),d()},icon:I.jsx(S0t,{}),label:"Import Review"}),v&&I.jsxs(I.Fragment,{children:[I.jsx(Yx,{}),C&&I.jsx(kd,{onClick:()=>{x(),u()},icon:I.jsx(oU,{}),label:"Save to Obsidian"}),B&&I.jsx(kd,{onClick:()=>{x(),g()},icon:I.jsx(oU,{}),label:"Save to Bear"}),y&&I.jsx(kd,{onClick:()=>{x(),p()},icon:I.jsx(oU,{}),label:"Save to Octarine"})]}),I.jsx(Yx,{}),I.jsx(I0t,{appVersion:t,updateInfo:e,origin:n,isWSL:a,closeMenu:x})]})})},y0t=()=>I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})}),Q0t=()=>I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),w0t=()=>I.jsxs("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),k0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})}),v0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),D0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),x0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),S0t=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3"})}),oU=()=>I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),_0t=Yt.memo(({isApiMode:t,annotateMode:e,archiveMode:n,goalSetupMode:a,goalSetupCanSubmit:r,goalSetupIsSubmitting:i,goalSetupSubmitLabel:o,gate:A,isSharedSession:s,origin:l,isSubmitting:d,isExiting:u,isPanelOpen:g,aiAvailable:p,isAIChatOpen:m,aiHasMessages:h,hasAnyAnnotations:b,linkedDocIsActive:C,callbackShareUrlReady:B,canShareCurrentSession:y,agentName:Q,availableAgents:k,showAnnotationsWarning:_,callbackConfig:v,taterMode:x,mobileSettingsOpen:S,gitUser:L,onCallbackFeedback:N,onCallbackApprove:U,onAnnotateExit:K,onGoalSetupExit:R,onGoalSetupSubmit:O,onAnnotateFeedback:F,onAnnotateApprove:T,onFeedback:G,onApprove:H,onAnnotationPanelToggle:q,onAIChatToggle:P,onArchiveCopy:z,onArchiveDone:Z,onTaterModeChange:$,onIdentityChange:V,onUIPreferencesChange:Ae,onOpenSettings:ne,onCloseSettings:pe,onOpenExport:te,onCopyAgentInstructions:re,onDownloadAnnotations:se,onPrint:oe,onCopyShareLink:ue,onOpenImport:le,onSaveToObsidian:De,onSaveToBear:he,onSaveToOctarine:qe,appVersion:ce,updateInfo:et,isWSL:ke,agentInstructionsEnabled:rt,obsidianConfigured:tt,bearConfigured:gt,octarineConfigured:Ge})=>I.jsxs("header",{"data-app-header":"true",className:"h-12 flex items-center justify-between px-2 md:px-4 border-b border-border/50 bg-card/50 backdrop-blur-xl sticky top-0 z-[50]",children:[I.jsx(R0t,{}),I.jsxs("div",{className:"flex items-center gap-1 md:gap-2",children:[v&&!t&&s&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"}),I.jsx(P9,{onClick:N,disabled:d||!B,isLoading:d,title:"Send feedback to bot"}),I.jsx(K9,{onClick:U,disabled:d||!B,isLoading:d,title:"Approve design and notify bot"})]}),t&&!C&&n&&I.jsxs(I.Fragment,{children:[I.jsxs("button",{onClick:z,className:"px-2.5 py-1 rounded-md text-xs font-medium transition-all bg-muted text-foreground hover:bg-muted/80 border border-border",title:"Copy plan content",children:[I.jsx("span",{className:"hidden md:inline",children:"Copy"}),I.jsx("svg",{className:"w-4 h-4 md:hidden",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]}),I.jsx("button",{onClick:Z,className:"px-2.5 py-1 rounded-md text-xs font-medium transition-all bg-success text-success-foreground hover:opacity-90",title:"Close archive",children:"Done"})]}),t&&!C&&a&&I.jsxs(I.Fragment,{children:[I.jsx(cce,{onClick:R,disabled:u||i,isLoading:u,title:"Close goal setup without submitting"}),I.jsx(K9,{onClick:O,disabled:!r||i||u,isLoading:i,label:o,loadingLabel:"Submitting...",mobileLabel:"Submit",title:o}),I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"})]}),t&&(!C||e)&&!n&&!a&&I.jsxs(I.Fragment,{children:[e?I.jsxs(I.Fragment,{children:[I.jsx(cce,{onClick:K,disabled:d||u,isLoading:u}),b&&I.jsx(P9,{onClick:F,disabled:d||u,isLoading:d,label:"Send Annotations",title:"Send Annotations"})]}):I.jsx(P9,{onClick:G,disabled:d,isLoading:d,label:"Send Feedback",title:"Send Feedback"}),(!e||A)&&(l==="opencode"&&!e&&k.length>0?I.jsx(qEt,{onApprove:H,agents:k,disabled:d,isLoading:d}):I.jsxs("div",{className:"relative group/approve",children:[I.jsx(K9,{onClick:H,disabled:d||e&&u,isLoading:d,dimmed:!e&&(l==="claude-code"||l==="gemini-cli")&&_,title:e?"Approve — no changes requested":void 0}),!e&&(l==="claude-code"||l==="gemini-cli")&&_&&I.jsxs("div",{className:"absolute top-full right-0 mt-2 px-3 py-2 bg-popover border border-border rounded-lg shadow-xl text-xs text-foreground w-56 text-center opacity-0 invisible group-hover/approve:opacity-100 group-hover/approve:visible transition-all pointer-events-none z-50",children:[I.jsx("div",{className:"absolute bottom-full right-4 border-4 border-transparent border-b-border"}),I.jsx("div",{className:"absolute bottom-full right-4 mt-px border-4 border-transparent border-b-popover"}),Q," doesn't support feedback on approval. Your annotations won't be seen."]})]})),I.jsx("div",{className:"w-px h-5 bg-border/50 mx-1 hidden md:block"})]}),!a&&I.jsx("button",{onClick:q,className:`p-1.5 rounded-md text-xs font-medium transition-all ${g?"bg-primary/15 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:g?"Hide annotations":"Show annotations",children:I.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!a&&p&&I.jsxs("button",{onClick:P,className:`relative p-1.5 rounded-md text-xs font-medium transition-all ${m?"bg-primary/15 text-primary":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:m?"Hide AI chat":"Show AI chat","aria-label":m?"Hide AI chat":"Show AI chat",children:[I.jsx(cm,{className:"w-4 h-4"}),h&&!m&&I.jsx("span",{className:"absolute top-0 right-0 w-1.5 h-1.5 rounded-full bg-primary"})]}),I.jsx("div",{className:"hidden",children:I.jsx(hIt,{taterMode:x,onTaterModeChange:$,onIdentityChange:V,origin:l,onUIPreferencesChange:Ae,externalOpen:S,onExternalClose:pe,gitUser:L})}),I.jsx(B0t,{appVersion:ce,updateInfo:et,origin:l,isWSL:ke,onOpenSettings:ne,onOpenExport:te,onCopyAgentInstructions:re,onDownloadAnnotations:se,onPrint:oe,onCopyShareLink:ue,onOpenImport:le,onSaveToObsidian:De,onSaveToBear:he,onSaveToOctarine:qe,sharingEnabled:y,isApiMode:t,agentInstructionsEnabled:rt,obsidianConfigured:!a&&tt,bearConfigured:!a&>,octarineConfigured:!a&&Ge})]})]})),R0t=()=>I.jsx("div",{className:"flex items-center gap-2 md:gap-3",children:I.jsx("a",{href:"https://plannotator.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 md:gap-2 hover:opacity-80 transition-opacity",children:I.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"Plannotator"})})}),N0t=OEt,M0t=()=>{const[t,e]=Y.useState(N0t),[n,a]=Y.useState([]),[r,i]=Y.useState([]),[o,A]=Y.useState(null),[s,l]=Y.useState(null),d=Y.useMemo(()=>tbe(t).frontmatter,[t]),u=Y.useMemo(()=>g0(t),[t]),[g,p]=Y.useState(!1),[m,h]=Y.useState(!1),[b,C]=Y.useState(!1),[B,y]=Y.useState(!1),[Q,k]=Y.useState(!1),[_,v]=Y.useState("close"),[x,S]=Y.useState(!1),[L,N]=Y.useState(""),[U,K]=Y.useState(()=>window.innerWidth>=768),[R,O]=Y.useState("annotations"),[F,T]=Y.useState(!1),[G,H]=Y.useState(zdt),[q,P]=Y.useState(Zdt),[z,Z]=Y.useState(()=>qt.getItem("plannotator-tater-mode")==="true"),[$,V]=Y.useState(()=>PK()),Ae=Y.useRef(null),[ne,pe]=Y.useState("full"),[te,re]=Y.useState(!1),[se,oe]=Y.useState(null),[ue,le]=Y.useState(),[De,he]=Y.useState(!1),qe=Tdt(),[ce,et]=Y.useState([]),[ke,rt]=Y.useState(!1),[tt,gt]=Y.useState(!1),[Ge,ot]=Y.useState(null),[He,ze]=Y.useState(null),ut=Y.useRef(null),[Se,Ze]=Y.useState({canSubmit:!1,isSubmitting:!1,submitted:!1,submitLabel:"Submit"}),[be,ve]=Y.useState(),[X,we]=Y.useState(!1),[Be,Ne]=Y.useState("markdown"),[Me,Ke]=Y.useState(""),[Ee,_e]=Y.useState(),[We,it]=Y.useState(void 0),[ht,Ie]=Y.useState(!0),[Pe,Oe]=Y.useState(!1),[at,Rt]=Y.useState(!1),[ft,ie]=Y.useState(null),[lt,At]=Y.useState(null),[vt,_t]=Y.useState(!1),[Tt,Kt]=Y.useState("bypassPermissions"),[$t,Ft]=Y.useState(!0),[Mt,Wt]=Y.useState(void 0),[vn,Qn]=Y.useState(void 0),[mn,Tn]=Y.useState(null),[fa,Et]=Y.useState(null),[fe,$e]=Y.useState(null),Dt=Y.useRef(null),hn=Y.useRef($.tocEnabled),dn=He!==null;Y.useEffect(()=>{document.title=mn?`${mn.display} · Plannotator`:"Plannotator"},[mn]);const[on,zn]=Y.useState(),[Hn,ga]=Y.useState(!1),[Ut,Ct]=Y.useState("clean"),[Gt,Lt]=Y.useState(null),[It,Bn]=Y.useState(null),[Le,ur]=Y.useState(!1),[Ue,Yn]=Y.useState(!1),[To,Go]=Y.useState([]),[Xi,os]=Y.useState(()=>{const Te=ru(),xt=Te.providerId;return{providerId:xt,model:xt?Te.preferredModels[xt]??null:null,reasoningEffort:null}}),[kr,vr]=Y.useState(Pdt),$i=T0e(),Zr=Y.useRef(null),{ref:As,viewport:Dr,onViewportReady:Ks}=nut();tut();const ar=TAe({storageKey:"plannotator-panel-width"}),wn=TAe({storageKey:"plannotator-toc-width",defaultWidth:240,minWidth:160,maxWidth:400,side:"left"}),Un=ar.isDragging||wn.isDragging,bn=out(PK().tocEnabled),pa=Y.useMemo(()=>u.some(Te=>Te.type==="heading"&&(Te.level??0)<=3),[u]),Ua=Y.useCallback(Te=>{if(fe===null){Te?.sidebarTab&&bn.open(Te.sidebarTab),Te?.panelOpen===!0?K(!0):Te?.panelOpen===!1&&K(!1);return}const xt=Dt.current,zt=PEt(xt,Te);$e(null),Dt.current=null,zt.sidebarOpen&&zt.sidebarTab?bn.open(zt.sidebarTab):bn.close(),zt.panelOpen!==void 0&&K(zt.panelOpen)},[fe,bn.close,bn.open]),rr=Y.useCallback(Te=>{if(fe!==null){Ua({restore:!1,sidebarTab:Te,panelOpen:!1});return}bn.open(Te)},[Ua,fe,bn.open]),Ni=Y.useCallback(Te=>{if(fe!==null){Ua({restore:!1,sidebarTab:Te,panelOpen:!1});return}bn.toggleTab(Te)},[Ua,fe,bn.toggleTab]),Mi=Y.useCallback(()=>{if(fe!==null){Ua({restore:!1,panelOpen:!0}),O("annotations");return}O("annotations"),K(Te=>R==="annotations"?!Te:!0)},[Ua,R,fe]),Xt=Y.useCallback(()=>{Kdt(),vr(!1)},[]),J=Y.useCallback(()=>{if(Xt(),fe!==null){Ua({restore:!1,panelOpen:!0}),O("ai");return}O("ai"),K(Te=>R==="ai"?!Te:!0)},[Xt,Ua,R,fe]);Y.useEffect(()=>{fe===null&&hn.current!==$.tocEnabled&&(hn.current=$.tocEnabled,$.tocEnabled&&pa?bn.open("toc"):$.tocEnabled||bn.close())},[fe,bn.close,bn.open,$.tocEnabled,pa]),Y.useEffect(()=>{u.length!==0&&(pa||bn.activeTab==="toc"&&bn.isOpen&&bn.close())},[u,pa]),Y.useEffect(()=>{bn.activeTab==="toc"&&Hn&&ga(!1)},[bn.activeTab]),Y.useEffect(()=>{if(!Hn)return;const Te=xt=>{xt.key==="Escape"&&ga(!1)};return document.addEventListener("keydown",Te),()=>document.removeEventListener("keydown",Te)},[Hn]);const ee=qut(t,Gt,It),me=Y.useMemo(()=>({...bn,open:rr,toggleTab:Ni}),[rr,bn.activeTab,bn.close,bn.isOpen,Ni]),Ce=jut({markdown:t,annotations:n,selectedAnnotationId:o,globalAttachments:ce,setMarkdown:e,setAnnotations:a,setSelectedAnnotationId:A,setGlobalAttachments:et,viewerRef:Zr,sidebar:me,sourceFilePath:Ee,sourceConverted:X}),Ye=Y.useMemo(()=>Ce.filepath?Ce.filepath.replace(/\/[^/]+$/,""):We?.includes("/")?We:void 0,[Ce.filepath,We]),nt=zut({buildUrl:Y.useCallback(Te=>Ye?`/api/doc?path=${encodeURIComponent(Te)}&base=${encodeURIComponent(Ye)}`:`/api/doc?path=${encodeURIComponent(Te)}`,[Ye])}),ct=Xut({markdown:t,viewerRef:Zr,linkedDocHook:Ce,setMarkdown:e,setAnnotations:a,setSelectedAnnotationId:A,setSubmitted:ie}),Bt=Y.useMemo(()=>UEt({archiveMode:ct.archiveMode,isPlanDiffActive:Hn}),[ct.archiveMode,Hn]),An=Y.useCallback(Te=>{Bt&&(fe===null&&(Dt.current={sidebarIsOpen:bn.isOpen,sidebarTab:bn.activeTab,panelOpen:U}),$e(Te),bn.close(),K(!1))},[Bt,U,fe,bn.activeTab,bn.close,bn.isOpen]),ta=Y.useCallback(Te=>{fe===Te?Ua():An(Te)},[An,Ua,fe]);Y.useEffect(()=>{!Bt&&fe!==null&&Ua()},[Bt,Ua,fe]);const un=ogt(),sa=Y.useMemo(()=>iAe()?tm(em()):"",[$]),na=Y.useMemo(()=>!!fa||XAe()||iAe(),[fa,$]),xn=Y.useMemo(()=>{const Te=fa?[fa]:[],xt=XAe()?rz().directories:[];return[...new Set([...Te,...xt])]},[fa,$]);Y.useEffect(()=>{na||un.setActiveFile(null)},[na]),Y.useEffect(()=>{sa||un.clearVaultDirs()},[sa]),Y.useEffect(()=>{if(bn.activeTab==="files"&&na){if(xn.length>0){const Te=un.dirs.filter(zt=>!zt.isVault).map(zt=>zt.path);(xn.some(zt=>!Te.includes(zt))||Te.some(zt=>!xn.includes(zt)))&&un.fetchAll(xn)}sa&&!un.dirs.find(Te=>Te.isVault&&Te.path===sa&&!Te.error)&&un.addVaultDir(sa)}},[bn.activeTab,na,xn,sa]);const qn=Yt.useCallback((Te,xt)=>{const an=un.dirs.find(aa=>aa.path===xt)?.isVault?aa=>`/api/reference/obsidian/doc?vaultPath=${encodeURIComponent(xt)}&path=${encodeURIComponent(aa)}`:aa=>`/api/doc?path=${encodeURIComponent(aa)}&base=${encodeURIComponent(xt)}`;Ce.open(Te,an,"files"),un.setActiveFile(Te)},[Ce,un]),Cr=Yt.useCallback(Te=>{if(un.dirs.find(zt=>zt.path===un.activeDirPath)?.isVault&&un.activeDirPath)Ce.open(Te,zt=>`/api/reference/obsidian/doc?vaultPath=${encodeURIComponent(un.activeDirPath)}&path=${encodeURIComponent(zt)}`);else if(un.activeFile&&un.activeDirPath){const zt=Ce.filepath?.replace(/\/[^/]+$/,"")||un.activeDirPath;Ce.open(Te,an=>`/api/doc?path=${encodeURIComponent(an)}&base=${encodeURIComponent(zt)}`)}else{const zt=Ce.filepath?Ce.filepath.replace(/\/[^/]+$/,""):We?.includes("/")?We:void 0;zt?Ce.open(Te,an=>`/api/doc?path=${encodeURIComponent(an)}&base=${encodeURIComponent(zt)}`):Ce.open(Te)}},[un.dirs,un.activeDirPath,un.activeFile,Ce,We]),eo=Yt.useCallback(()=>{Ce.back(),un.setActiveFile(null),ct.clearSelection()},[Ce,un,ct]),Vr=Y.useMemo(()=>{const Te=new Map;for(const[xt,zt]of Ce.getDocAnnotations()){const an=zt.annotations.length+zt.globalAttachments.length;an>0&&Te.set(xt,an)}return Te},[Ce.getDocAnnotations,n,ce]),gr=Y.useMemo(()=>{const Te=un.dirs.map(zt=>zt.path);if(Te.length===0)return Vr;const xt=new Map;for(const[zt,an]of Vr)Te.some(aa=>zt.startsWith(aa+"/"))&&xt.set(zt,an);return xt},[Vr,un.dirs]),ii=gr.size>0,kc=Y.useMemo(()=>{const Te=Ce.filepath;let xt=0,zt=0;for(const[an,aa]of Vr)an!==Te&&(xt+=aa,zt++);return xt>0?{count:xt,files:zt}:void 0},[Vr,Ce.filepath]),[Qo,vc]=Y.useState(),Pr=Yt.useRef(),FB=Yt.useCallback(()=>{const Te=new Set(Vr.keys());Te.size!==0&&((!bn.isOpen||bn.activeTab!=="files")&&rr("files"),Pr.current&&clearTimeout(Pr.current),vc(void 0),requestAnimationFrame(()=>{vc(Te),Pr.current=setTimeout(()=>vc(void 0),1200)}))},[Vr,rr,bn,ii]),sp=Ge==="folder"?"file list":Ge==="file"?"file":Ge==="message"?"message":"plan",Zb=Y.useMemo(()=>u.filter(Te=>Te.type==="heading").length,[u]),Ov=Sdt(As,Zb,Dr),{editorAnnotations:Hs,deleteEditorAnnotation:CL}=egt(),{externalAnnotations:pd,updateExternalAnnotation:LB,deleteExternalAnnotation:EL}=agt({enabled:te&&!dn}),{reset:Uv}=rgt({viewerRef:Zr,externalAnnotations:pd,enabled:te&&!dn&&!Ce.isActive&&!Hn,planKey:t}),Er=Y.useMemo(()=>pd.length===0?n:[...n.filter(xt=>xt.source?!pd.some(zt=>zt.source===xt.source&&zt.type===xt.type&&zt.originalText===xt.originalText):!0),...pd],[n,pd]),IL=Y.useMemo(()=>Er.filter(Te=>!!Te.diffContext),[Er]),Pv=Y.useMemo(()=>Er.filter(Te=>!Te.diffContext),[Er]),Dc=Y.useMemo(()=>Er.length>0||r.length>0||Hs.length>0||Ce.docAnnotationCount>0||ce.length>0,[Er.length,r.length,Hs.length,Ce.docAnnotationCount,ce.length]),Kv=Er.length+r.length+Hs.length+Ce.docAnnotationCount+ce.length,Vb=$t&&r.length===0,{isSharedSession:vA,isLoadingShared:TB,shareUrl:fl,shareUrlSize:BL,shortShareUrl:Su,isGeneratingShortUrl:yL,shortUrlError:Hv,pendingSharedAnnotations:Xb,clearPendingSharedAnnotations:Yv,generateShortUrl:QL,importFromShareUrl:wL,shareLoadError:qv,clearShareLoadError:kL}=Qdt(t,Er,ce,e,a,et,()=>{Ie(!1)},Mt,vn,Me,Ke,Ne);Y.useLayoutEffect(()=>{if(ht&&!vA)return;const Te=Ae.current;if(!Te)return;const xt=an=>an>=800?"full":an>=680?"short":"icon";pe(xt(Te.getBoundingClientRect().width));const zt=new ResizeObserver(([an])=>{const aa=xt(an.contentRect.width);pe(Sa=>Sa===aa?Sa:aa)});return zt.observe(Te),()=>zt.disconnect()},[ht,vA]);const{draftBanner:fh,restoreDraft:jv,dismissDraft:vL}=Vut({annotations:Er,codeAnnotations:r,globalAttachments:ce,isApiMode:te&&!dn,isSharedSession:vA,submitted:!!ft}),GB=Yt.useCallback(()=>{const{annotations:Te,codeAnnotations:xt,globalAttachments:zt}=jv();(Te.length>0||xt.length>0||zt.length>0)&&(a(Te),i(xt),zt.length>0&&et(zt),setTimeout(()=>{Zr.current?.applySharedAnnotations(Te.filter(an=>!an.diffContext))},100))},[jv]),{agents:bh,getAgentWarning:$b}=Ove(se);Y.useEffect(()=>{if(Xb&&Xb.length>0){const Te=setTimeout(()=>{Zr.current?.clearAllHighlights(),Zr.current?.applySharedAnnotations(Xb.filter(xt=>!xt.diffContext)),Yv(),Uv()},100);return()=>clearTimeout(Te)}},[Xb,Yv,Uv]);const zv=Y.useCallback(Te=>{Z(Te),qt.setItem("plannotator-tater-mode",String(Te))},[]),OB=Te=>{H(Te),Jdt(Te)},eC=Te=>{P(Te),Vdt(Te)};eut(q,eC),Y.useEffect(()=>{TB||vA||fetch("/api/plan").then(Te=>{if(!Te.ok)throw new Error("Not in API mode");return Te.json()}).then(Te=>{Ai.init(Te.serverConfig),ur(Te.mode!=="archive"&&Te.mode!=="goal-setup"),le(Te.serverConfig?.gitUser),Te.mode==="goal-setup"&&Te.goalSetup?(ze(Te.goalSetup),e(""),Ft(!1)):Te.mode==="archive"?(e(Te.plan||""),Te.archivePlans&&ct.init(Te.archivePlans),ct.fetchPlans(),Ft(!1),bn.open("archive")):Te.renderAs==="html"&&Te.rawHtml?(Ne("html"),Ke(Te.rawHtml),e("")):Te.mode==="annotate-folder"?e(""):Te.plan&&e(Te.plan),re(!0),(Te.mode==="annotate"||Te.mode==="annotate-last"||Te.mode==="annotate-folder")&&(rt(!0),gt(Te.gate??!1)),Te.mode==="annotate-folder"&&bn.open("files"),(Te.mode==="annotate"||Te.mode==="annotate-last"||Te.mode==="annotate-folder")&&ot(Te.mode==="annotate-last"?"message":Te.mode==="annotate-folder"?"folder":"file"),ve(Te.sourceInfo??void 0),we(!!Te.sourceConverted),Te.filePath&&(it(Te.mode==="annotate-folder"?Te.filePath:Te.filePath.replace(/\/[^/]+$/,"")),Te.mode==="annotate"&&_e(Te.filePath)),Te.sharingEnabled!==void 0&&Ft(Te.sharingEnabled),Te.shareBaseUrl&&Wt(Te.shareBaseUrl),Te.pasteApiUrl&&Qn(Te.pasteApiUrl),Te.repoInfo&&Tn(Te.repoInfo),Te.projectRoot&&Et(Te.projectRoot),Te.previousPlan!==void 0&&Lt(Te.previousPlan),Te.versionInfo&&Bn(Te.versionInfo),Te.origin&&(oe(Te.origin),Te.origin==="claude-code"&&Te.mode!=="goal-setup"&&rut()&&_t(!0),Kt(Xve().mode)),Te.isWSL&&he(!0)}).catch(()=>{re(!1),ur(!1)}).finally(()=>Ie(!1))},[TB,vA]),Y.useEffect(()=>{if(!Le||!te||vA){Yn(!1),Go([]);return}let Te=!1;return fetch("/api/ai/capabilities").then(xt=>xt.ok?xt.json():null).then(xt=>{if(!Te)if(xt?.available){const zt=xt.providers??[];Yn(!0),Go(zt),os(an=>{const aa=ru(),Sa=Pj({providers:zt,origin:se,settings:aa,serverDefaultProvider:xt.defaultProvider??null});return an.providerId===Sa.providerId&&an.model===Sa.model?an:{...an,providerId:Sa.providerId,model:Sa.model}})}else Yn(!1),Go([])}).catch(()=>{Te||(Yn(!1),Go([]))}),()=>{Te=!0}},[Le,te,vA,se]);const tC=Y.useRef(!1),Ch=Y.useRef({}),bl=Y.useRef(null);Y.useEffect(()=>{tC.current=!1,Ch.current={},bl.current=null},[t]),Y.useEffect(()=>{if(!te||!t||vA||ke||ct.archiveMode||tC.current)return;const Te={},xt=[],zt=em();if(zt.autoSave&&zt.enabled){const ba=tm(zt);ba&&(Te.obsidian={vaultPath:ba,folder:zt.folder||"plannotator",plan:t,...zt.filenameFormat&&{filenameFormat:zt.filenameFormat},...zt.filenameSeparator&&zt.filenameSeparator!=="space"&&{filenameSeparator:zt.filenameSeparator}},xt.push("Obsidian"))}const an=gf();an.autoSave&&an.enabled&&(Te.bear={plan:t,customTags:an.customTags,tagPosition:an.tagPosition},xt.push("Bear"));const aa=PE();if(aa.autoSave&&Rx()&&(Te.octarine={plan:t,workspace:aa.workspace,folder:aa.folder||"plannotator"},xt.push("Octarine")),xt.length===0)return;tC.current=!0;const Sa=fetch("/api/save-notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Te)}).then(ba=>ba.json()).then(ba=>{const Jn={...Te.obsidian?{obsidian:!!ba.results?.obsidian?.success}:{},...Te.bear?{bear:!!ba.results?.bear?.success}:{},...Te.octarine?{octarine:!!ba.results?.octarine?.success}:{}};Ch.current=Jn;const Ca=xt.filter(Oo=>!ba.results?.[Oo.toLowerCase()]?.success);return Ca.length===0?Ws.success(`Auto-saved to ${xt.join(" & ")}`):Ws.error(`Auto-save failed for ${Ca.join(" & ")}`),Jn}).catch(()=>(Ch.current={},Ws.error("Auto-save failed"),{}));bl.current=Sa},[te,t,vA,ke]),Y.useEffect(()=>{const Te=xt=>{const zt=xt.clipboardData?.items;if(zt){for(const an of zt)if(an.type.startsWith("image/")){xt.preventDefault();const aa=an.getAsFile();if(aa){const Sa=d6(aa.name,ce.map(Jn=>Jn.name)),ba=URL.createObjectURL(aa);At({file:aa,blobUrl:ba,initialName:Sa})}break}}};return document.addEventListener("paste",Te),()=>document.removeEventListener("paste",Te)},[ce]);const DL=async(Te,xt,zt)=>{if(lt)try{const an=new FormData,aa=xt?new File([Te],"annotated.png",{type:"image/png"}):lt.file;an.append("file",aa);const Sa=await fetch("/api/upload",{method:"POST",body:an});if(Sa.ok){const ba=await Sa.json();et(Jn=>[...Jn,{path:ba.path,name:zt}])}}catch{}finally{URL.revokeObjectURL(lt.blobUrl),At(null)}},xL=()=>{lt&&(URL.revokeObjectURL(lt.blobUrl),At(null))},Eh=async()=>{Oe(!0);try{const Te=em(),xt=gf(),zt=PE(),an=z2(),aa=xt.autoSave&&bl.current?await bl.current:Ch.current,Sa={};se==="claude-code"&&(Sa.permissionMode=Tt);const ba=xdt(OM());ba&&(Sa.agentSwitch=ba),Sa.planSave={enabled:an.enabled,...an.customPath&&{customPath:an.customPath}};const Jn=tm(Te);Te.enabled&&Jn&&(Sa.obsidian={vaultPath:Jn,folder:Te.folder||"plannotator",plan:t,...Te.filenameFormat&&{filenameFormat:Te.filenameFormat},...Te.filenameSeparator&&Te.filenameSeparator!=="space"&&{filenameSeparator:Te.filenameSeparator}}),xt.enabled&&!(xt.autoSave&&aa.bear)&&(Sa.bear={plan:t,customTags:xt.customTags,tagPosition:xt.tagPosition}),Rx()&&(Sa.octarine={plan:t,workspace:zt.workspace,folder:zt.folder||"plannotator"});const Ca=Array.from(Ce.getDocAnnotations().values()).some(Oo=>Oo.annotations.length>0||Oo.globalAttachments.length>0);(Er.length>0||r.length>0||ce.length>0||Ca||Hs.length>0)&&(Sa.feedback=xc),await fetch("/api/approve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Sa)}),ie("approved")}catch{Oe(!1)}},nC=async()=>{Oe(!0);try{const Te=z2();await fetch("/api/deny",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:xc,planSave:{enabled:Te.enabled,...Te.customPath&&{customPath:Te.customPath}}})}),ie("denied")}catch{Oe(!1)}},aC=async()=>{Oe(!0);try{await fetch("/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:xc,annotations:Er,codeAnnotations:r})}),ie("denied")}catch{Oe(!1)}},md=async()=>{Oe(!0);try{await fetch("/api/approve",{method:"POST"}),ie("approved")}catch{Oe(!1)}},_u=Y.useCallback(async()=>{Rt(!0);try{if((await fetch("/api/exit",{method:"POST"})).ok)ie("exited");else throw new Error("Failed to exit")}catch{Rt(!1)}},[]),SL=Y.useCallback(()=>{ut.current?.submit()},[]),rC=Y.useCallback(async()=>{Rt(!0);try{if((await fetch("/api/exit",{method:"POST"})).ok)ie("exited");else throw new Error("Failed to exit")}catch{Rt(!1)}},[]);Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="Enter"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target,an=zt?.tagName,aa=an==="INPUT"||an==="TEXTAREA"||!!zt?.isContentEditable;if(document.querySelector('[data-plannotator-confirm-dialog="true"]')||g||m||b||B||Q||x||vt||lt||ft||Pe||at||Se.isSubmitting||!te||Ce.isActive)return;if(dn){if(document.querySelector('[data-comment-popover="true"]')||aa&&!zt?.closest(".goal-shell"))return;xt.preventDefault(),Se.canSubmit&&ut.current?.submit();return}if(aa)return;if(xt.preventDefault(),ke){if(tt&&!Dc){md();return}aC();return}const Sa=Ce.getDocAnnotations(),ba=Array.from(Sa.values()).some(Jn=>Jn.annotations.length>0||Jn.globalAttachments.length>0);if(Er.length===0&&r.length===0&&Hs.length===0&&!ba){if(se==="opencode"){const Jn=$b();if(Jn){N(Jn),S(!0);return}}Eh()}else nC()};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,m,b,B,Q,x,vt,lt,ft,Pe,at,Se.isSubmitting,te,Ce.isActive,n.length,r.length,pd.length,ke,tt,Dc,dn,Se.canSubmit,se,$b]);const Ih=Te=>{a(xt=>[...xt,Te]),A(Te.id),l(null),fe===null&&K(!0)},Bh=Yt.useCallback(Te=>{A(Te),Te&&l(null),Te&&$i&&fe===null&&K(!0)},[$i,fe]),UB=Yt.useCallback(Te=>{const xt={id:nz("code-ann"),type:"comment",scope:"line",filePath:Te.filePath,lineStart:Te.lineStart,lineEnd:Te.lineEnd,side:"new",text:Te.text,images:Te.images,originalCode:Te.originalCode,createdAt:Date.now(),author:Ai.get("displayName")||void 0};i(zt=>[...zt,xt]),A(null),l(xt.id),fe===null&&K(!0)},[fe]),PB=Yt.useCallback(Te=>{const xt=r.find(zt=>zt.id===Te);xt&&(A(null),l(Te),nt.open(xt.filePath),$i&&fe===null&&K(!0))},[r,nt.open,$i,fe]),KB=Yt.useCallback(Te=>{i(xt=>xt.filter(zt=>zt.id!==Te)),s===Te&&l(null)},[s]),HB=Yt.useCallback((Te,xt)=>{i(zt=>zt.map(an=>an.id===Te?{...an,...xt}:an))},[]),YB=Te=>{Zr.current?.removeHighlight(Te),a(xt=>xt.filter(zt=>zt.id!==Te)),o===Te&&A(null)},qB=KEt({blocks:u,annotations:n,addAnnotation:Ih,removeAnnotation:YB}),_L=Te=>{const xt=Er.find(zt=>zt.id===Te);if(xt?.source&&pd.some(zt=>zt.id===Te)){EL(Te),o===Te&&A(null);return}Te.startsWith("ann-checkbox-")&&xt&&qB.revertOverride(xt.blockId),YB(Te)},RL=(Te,xt)=>{if(Er.find(an=>an.id===Te)?.source&&pd.some(an=>an.id===Te)){LB(Te,xt);return}a(an=>an.map(aa=>aa.id===Te?{...aa,...xt}:aa))},NL=Y.useCallback((Te,xt)=>{a(zt=>zt.map(an=>an.author===Te?{...an,author:xt}:an)),i(zt=>zt.map(an=>an.author===Te?{...an,author:xt}:an))},[]),Jv=Te=>{et(xt=>[...xt,Te])},oA=Te=>{et(xt=>xt.filter(zt=>zt.path!==Te))},yh=Te=>{},xc=Y.useMemo(()=>{const Te=Ce.getDocAnnotations(),xt=Array.from(Te.values()).some(Jn=>Jn.annotations.length>0||Jn.globalAttachments.length>0),zt=Er.length>0||ce.length>0,an=Hs.length>0,aa=r.length>0;if(!zt&&!xt&&!an&&!aa)return"User reviewed the document and has no feedback.";const Sa=Ce.isActive?Te.get(Ce.filepath??"")?.isConverted??!1:X;let ba=zt?p8e(u,Er,ce,Ge==="message"?"Message Feedback":Ge==="folder"?"Folder Feedback":Ge==="file"?"File Feedback":"Plan Feedback",Ge??"plan",{sourceConverted:Sa}):"";if(xt){const Jn=new Map(Te);for(const[Ca,Oo]of Jn)Oo.markdown&&Jn.set(Ca,{...Oo,blocks:g0(Oo.markdown)});ba+=m8e(Jn)}return an&&(ba+=h8e(Hs)),aa&&(ba+=f8e(r)),ba},[u,Er,ce,Ce.getDocAnnotations,Hs,r,X,Ge,Ce.isActive,Ce.filepath]),cp=Y.useMemo(()=>Dc?xc:void 0,[xc,Dc]),hd=Ce.isActive?Ce.filepath??"linked document":Ee??(Ge==="message"?"agent message":Ge==="folder"?"folder document":"plan"),jB=Ce.isActive?Ce.filepath??void 0:be,iC=Ce.isActive?Ce.getDocAnnotations().get(Ce.filepath??"")?.isConverted??!1:X,oC=Ce.isActive?"markdown":Be,DA=ke||Ce.isActive,AC=!DA||Ge!=="folder"||Ce.isActive||!!Ee,Ru=Y.useMemo(()=>!Le||ct.archiveMode||dn||DA&&!AC?null:DA?{mode:"annotate",annotate:{content:oC==="html"&&Me?Me:t,filePath:hd,sourceInfo:jB,sourceConverted:iC,renderAs:oC,annotations:cp}}:{mode:"plan-review",plan:{plan:t,previousPlan:Gt??void 0,version:It?.version,totalVersions:It?.totalVersions,project:It?.project,annotations:cp}},[cp,hd,oC,Le,iC,jB,DA,AC,ct.archiveMode,dn,t,Gt,Me,Be,It]),zB=Ydt({context:Ru,providerId:Xi.providerId,model:Xi.model,reasoningEffort:Xi.reasoningEffort,threadTitle:DA?"Document chat":"Plan chat"}),{messages:Qh,isCreatingSession:Nu,isStreaming:lp,permissionRequests:JB,respondToPermission:Wv,ask:fd,resetSession:WB,resetThread:ZB,sessionId:VB}=zB,bd=Ue&&Ru!==null,XB=Ru?`${DA?"document":"plan"}:${oC}:${hd}:${It?.version??"current"}`:"none",$B=Y.useRef(null);Y.useEffect(()=>{Le&&($B.current&&$B.current!==XB&&ZB(),$B.current=XB)},[XB,Le,ZB]);const Zv=Y.useCallback(Te=>{os(xt=>{const zt=ru(),an=Te.providerId!==void 0?Te.providerId:xt.providerId,aa=Te.providerId!==void 0&&Te.providerId!==xt.providerId,Sa=To.find(Ca=>Ca.id===an)??null,ba=aa?Te.model!==void 0?Te.model:Uj(Sa,zt.preferredModels):Te.model!==void 0?Te.model:xt.model,Jn={...xt,...Te,providerId:an,model:ba};return Ske({providerId:Jn.providerId,model:Jn.model,origin:se,settings:zt}),Jn}),WB()},[To,se,WB]),wh=Y.useCallback(()=>{fe!==null&&Ua({restore:!1,panelOpen:!0}),O("ai"),K(!0)},[Ua,fe]),ey=Y.useCallback(()=>{Xt(),wh()},[Xt,wh]),AA=Y.useCallback((Te,xt)=>{bd&&(Xt(),wh(),fd({prompt:Te,scope:xt?{kind:xt.kind,label:xt.label,text:xt.text,sourcePath:xt.sourcePath??hd}:void 0,contextUpdate:VB?cp:void 0}))},[cp,hd,VB,fd,bd,Xt,wh]),sC=Y.useCallback(Te=>{AA(Te,{kind:"general",label:DA?"Document":"Plan",sourcePath:hd})},[DA,hd,AA]),wo=Yt.useMemo(()=>wdt(),[]),Cl=Yt.useCallback(async Te=>{if(!(!wo||Pe||!fl&&!Su)){Oe(!0);try{const xt=await kdt(Te,wo,Su||fl);xt&&(xt.type==="success"?(Ws.success(xt.message),ie(Te===kS.Approve?"approved":"denied")):Ws.error(xt.message))}finally{Oe(!1)}}},[wo,Pe,fl,Su]),ty=Yt.useCallback(()=>Cl(kS.Approve),[Cl]),cC=Yt.useCallback(()=>Cl(kS.Feedback),[Cl]),dp=()=>{const Te=new Blob([xc],{type:"text/plain"}),xt=URL.createObjectURL(Te),zt=document.createElement("a");zt.href=xt,zt.download="annotations.md",zt.click(),URL.revokeObjectURL(xt),Ws.success("Downloaded annotations")},Mu=async Te=>{const xt={};if(Te==="obsidian"){const an=em(),aa=tm(an);aa&&(xt.obsidian={vaultPath:aa,folder:an.folder||"plannotator",plan:t,...an.filenameFormat&&{filenameFormat:an.filenameFormat},...an.filenameSeparator&&an.filenameSeparator!=="space"&&{filenameSeparator:an.filenameSeparator}})}if(Te==="bear"){const an=gf();xt.bear={plan:t,customTags:an.customTags,tagPosition:an.tagPosition}}if(Te==="octarine"){const an=PE();xt.octarine={plan:t,workspace:an.workspace,folder:an.folder||"plannotator"}}const zt=Te==="obsidian"?"Obsidian":Te==="bear"?"Bear":"Octarine";try{const Sa=(await(await fetch("/api/save-notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(xt)})).json()).results?.[Te];Sa?.success?Ws.success(`Saved to ${zt}`):Ws.error(Sa?.error||"Save failed")}catch{Ws.error("Save failed")}},Cd=async()=>{const Te=igt(window.location.origin);try{await navigator.clipboard.writeText(Te),Ws.success("Agent instructions copied")}catch{Ws.error("Failed to copy")}},ny=async()=>{const Te=Su||fl;if(Te)try{await navigator.clipboard.writeText(Te),Ws.success("Share link copied")}catch{Ws.error("Failed to copy")}};Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="s"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target?.tagName;if(zt==="INPUT"||zt==="TEXTAREA"||g||b||B||Q||x||vt||lt||ft||!te)return;xt.preventDefault();const an=Kve(),aa=rAe(),Sa=gf().enabled,ba=Rx();an==="download"?dp():an==="obsidian"&&aa?Mu("obsidian"):an==="bear"&&Sa?Mu("bear"):an==="octarine"&&ba?Mu("octarine"):(zn("notes"),p(!0))};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,b,B,Q,x,vt,lt,ft,te,t,xc]),Y.useEffect(()=>{const Te=xt=>{if(xt.key!=="p"||!(xt.metaKey||xt.ctrlKey))return;const zt=xt.target?.tagName;zt==="INPUT"||zt==="TEXTAREA"||g||b||B||Q||x||vt||lt||ft||(xt.preventDefault(),window.print())};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[g,b,B,Q,x,vt,lt,ft]);const ss=Y.useMemo(()=>q5(se),[se]),to=Y.useRef({handleApprove:Eh,handleDeny:nC,handleAnnotateApprove:md,handleAnnotateFeedback:aC,handleAnnotateExit:_u,handleQuickSaveToNotes:Mu,handleDownloadAnnotations:dp,handleCopyAgentInstructions:Cd,handleCopyShareLink:ny,getAgentWarning:$b,getDocAnnotations:Ce.getDocAnnotations});to.current={handleApprove:Eh,handleDeny:nC,handleAnnotateApprove:md,handleAnnotateFeedback:aC,handleAnnotateExit:_u,handleQuickSaveToNotes:Mu,handleDownloadAnnotations:dp,handleCopyAgentInstructions:Cd,handleCopyShareLink:ny,getAgentWarning:$b,getDocAnnotations:Ce.getDocAnnotations};const ML=Y.useCallback(()=>{Dc?(v("close"),k(!0)):to.current.handleAnnotateExit()},[Dc]),xA=Y.useCallback(()=>{const Te=to.current,xt=Te.getDocAnnotations(),zt=Array.from(xt.values()).some(an=>an.annotations.length>0||an.globalAttachments.length>0);Er.length===0&&r.length===0&&Hs.length===0&&!zt?C(!0):Te.handleDeny()},[Er.length,r.length,Hs.length]),ay=Y.useCallback(()=>{const Te=to.current;if(ke){if(Dc){v("approve"),k(!0);return}Te.handleAnnotateApprove();return}if(se==="claude-code"&&(Er.length>0||r.length>0)){y(!0);return}if(se==="opencode"){const xt=Te.getAgentWarning();if(xt){N(xt),S(!0);return}}Te.handleApprove()},[ke,Dc,se,Er.length,r.length]),El=Y.useCallback(()=>to.current.handleAnnotateFeedback(),[]),Vv=Y.useCallback(()=>to.current.handleAnnotateApprove(),[]),lC=Y.useCallback(()=>to.current.handleDownloadAnnotations(),[]),Fu=Y.useCallback(()=>to.current.handleCopyAgentInstructions(),[]),ry=Y.useCallback(()=>to.current.handleCopyShareLink(),[]),Xv=Y.useCallback(()=>T(!0),[]),iy=Y.useCallback(()=>T(!1),[]),$v=Y.useCallback(()=>{zn(void 0),p(!0)},[]),cs=Y.useCallback(()=>window.print(),[]),up=Y.useCallback(()=>h(!0),[]),gp=Y.useCallback(()=>to.current.handleQuickSaveToNotes("obsidian"),[]),dC=Y.useCallback(()=>to.current.handleQuickSaveToNotes("octarine"),[]),kh=Y.useCallback(()=>to.current.handleQuickSaveToNotes("bear"),[]),sA=Y.useMemo(()=>({compact:832,default:1040,wide:1280})[$.planWidth]??832,[$.planWidth]),Fi=Bt&&fe==="wide"?null:sA,Ed=To.find(Te=>Te.id===Xi.providerId)??null,Sc=kr&&bd&&Le&&te&&!vA&&!ct.archiveMode&&!dn&&!vt&&!ft;return ht&&!vA?I.jsx(sAe,{defaultTheme:"dark",children:I.jsx("div",{className:"h-screen bg-background"})}):I.jsx(sAe,{defaultTheme:"dark",children:I.jsx(ndt,{delayDuration:900,skipDelayDuration:200,disableHoverableContent:!0,children:I.jsxs("div",{"data-print-region":"root",className:"h-screen flex flex-col bg-background overflow-hidden",children:[I.jsx(_0t,{isApiMode:te,annotateMode:ke,archiveMode:ct.archiveMode,goalSetupMode:dn,goalSetupCanSubmit:Se.canSubmit,goalSetupIsSubmitting:Se.isSubmitting,goalSetupSubmitLabel:Se.submitLabel,gate:tt,isSharedSession:vA,origin:se,isSubmitting:Pe,isExiting:at,isPanelOpen:U&&R==="annotations",aiAvailable:bd,isAIChatOpen:U&&R==="ai",aiHasMessages:Qh.length>0,hasAnyAnnotations:Dc,linkedDocIsActive:Ce.isActive,callbackShareUrlReady:wo?!!(fl||Su):!0,canShareCurrentSession:Vb,agentName:ss,availableAgents:bh,showAnnotationsWarning:Er.length>0||r.length>0,callbackConfig:wo,taterMode:z,mobileSettingsOpen:F,gitUser:ue,onCallbackFeedback:cC,onCallbackApprove:ty,onAnnotateExit:ML,onGoalSetupExit:rC,onGoalSetupSubmit:SL,onAnnotateFeedback:El,onAnnotateApprove:Vv,onFeedback:xA,onApprove:ay,onAnnotationPanelToggle:Mi,onAIChatToggle:J,onArchiveCopy:ct.copy,onArchiveDone:ct.done,onTaterModeChange:zv,onIdentityChange:NL,onUIPreferencesChange:V,onOpenSettings:Xv,onCloseSettings:iy,onOpenExport:$v,onCopyAgentInstructions:Fu,onDownloadAnnotations:lC,onPrint:cs,onCopyShareLink:ry,onOpenImport:up,onSaveToObsidian:gp,onSaveToBear:kh,onSaveToOctarine:dC,appVersion:"0.19.24",updateInfo:qe,isWSL:De,agentInstructionsEnabled:te&&!ct.archiveMode&&!ke&&!dn,obsidianConfigured:rAe(),bearConfigured:gf().enabled,octarineConfigured:Rx()}),Ce.error&&I.jsxs("div",{className:"bg-destructive/10 border-b border-destructive/20 px-4 py-2 flex items-center gap-2 flex-shrink-0",children:[I.jsx("span",{className:"text-xs text-destructive",children:Ce.error}),I.jsx("button",{onClick:Ce.dismissError,className:"ml-auto text-xs text-destructive/60 hover:text-destructive",children:"dismiss"})]}),I.jsx(F0e.Provider,{value:Dr,children:I.jsxs("div",{"data-print-region":"content",className:`flex-1 flex overflow-hidden relative z-0 ${Un?"select-none":""}`,children:[z&&I.jsx(fdt,{}),fe===null&&!bn.isOpen&&!dn&&I.jsx(sgt,{activeTab:bn.activeTab,onToggleTab:Ni,hasDiff:ee.hasPreviousVersion,showVersionsTab:It!==null&&It.totalVersions>1,showFilesTab:na&&!ct.archiveMode,hasFileAnnotations:ii,className:"hidden lg:flex absolute left-0 top-0 z-10"}),bn.isOpen&&!dn&&I.jsxs(I.Fragment,{children:[I.jsx(Egt,{activeTab:bn.activeTab,onTabChange:Te=>{Ni(Te),Te==="archive"&&!ct.archiveMode&&ct.fetchPlans()},onClose:bn.close,width:wn.width,blocks:u,annotations:n,activeSection:Ov,onTocNavigate:yh,linkedDocFilepath:Ce.filepath,onLinkedDocBack:Ce.isActive?eo:void 0,backLabel:sp,showFilesTab:na&&!ct.archiveMode,fileAnnotationCounts:gr,highlightedFiles:Qo,fileBrowser:un,onFilesSelectFile:qn,onFilesFetchAll:()=>un.fetchAll(xn),onFilesRetryVaultDir:Te=>un.addVaultDir(Te),hasFileAnnotations:ii,showVersionsTab:It!==null&&It.totalVersions>1,versionInfo:It,versions:ee.versions,selectedBaseVersion:ee.diffBaseVersion,onSelectBaseVersion:ee.selectBaseVersion,isPlanDiffActive:Hn,hasPreviousVersion:ee.hasPreviousVersion,onActivatePlanDiff:()=>ga(!0),isLoadingVersions:ee.isLoadingVersions,isSelectingVersion:ee.isSelectingVersion,fetchingVersion:ee.fetchingVersion,onFetchVersions:ee.fetchVersions,showArchiveTab:te&&!ke&&!dn,archivePlans:ct.plans,selectedArchiveFile:ct.selectedFile,onArchiveSelect:ct.select,isLoadingArchive:ct.isLoading}),I.jsx(GAe,{...wn.handleProps,className:"hidden lg:block",side:"left"})]}),I.jsxs(sB,{element:"main",className:`flex-1 min-w-0 bg-grid ${!dn&&!bn.isOpen&&fe===null?"lg:pl-[30px]":""}`,"data-print-region":"document",onViewportReady:Ks,children:[I.jsx(qp,{isOpen:!!fh,onClose:vL,onConfirm:GB,title:"Draft Recovered",message:fh?`Found ${fh.count} annotation${fh.count!==1?"s":""} from ${fh.timeAgo}. Would you like to restore them?`:"",confirmText:"Restore",cancelText:"Dismiss",showCancel:!0}),I.jsxs("div",{ref:Ae,className:"min-h-full flex flex-col items-center px-2 py-3 md:px-10 md:py-8 xl:px-16 relative z-10",children:[!dn&&!Hn&&!ct.archiveMode&&$.stickyActionsEnabled&&I.jsx(udt,{inputMethod:q,onInputMethodChange:eC,mode:G,onModeChange:OB,taterMode:z,repoInfo:mn,planDiffStats:ee.diffStats,isPlanDiffActive:Hn,hasPreviousVersion:ee.hasPreviousVersion,onPlanDiffToggle:()=>ga(!Hn),archiveInfo:ct.currentInfo,maxWidth:Fi,remountToken:Ce.isActive?`doc:${Ce.filepath}`:"plan"}),!dn&&!Hn&&!ct.archiveMode&&I.jsx("div",{"data-print-hide":!0,className:"w-full mb-3 md:mb-4 flex items-center justify-start",style:Fi==null?void 0:{maxWidth:Fi},children:I.jsx(vve,{inputMethod:q,onInputMethodChange:eC,mode:G,onModeChange:OB,taterMode:z})}),He&&I.jsx("div",{className:"w-full flex justify-center",children:I.jsx(Oxe,{ref:ut,bundle:He,maxWidth:sA,onActionStateChange:Ze,onSubmitted:()=>ie("approved")})}),ee.diffBlocks&&ee.diffStats&&!dn&&I.jsx("div",{className:"w-full flex justify-center",style:{display:Hn?void 0:"none"},children:I.jsx(Ngt,{diffBlocks:ee.diffBlocks,diffStats:ee.diffStats,diffMode:Ut,onDiffModeChange:Ct,onPlanDiffToggle:()=>ga(!1),repoInfo:mn,baseVersionLabel:ee.diffBaseVersion!=null?`v${ee.diffBaseVersion}`:void 0,baseVersion:ee.diffBaseVersion??void 0,maxWidth:sA,annotations:IL,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G})}),Ge==="folder"&&!t&&!Ce.isActive&&!dn&&I.jsx("div",{className:"w-full flex justify-center",children:I.jsxs("div",{className:"w-full max-w-3xl p-12 text-center text-muted-foreground",children:[I.jsx("p",{className:"text-lg font-medium mb-2",children:"Select a file to annotate"}),I.jsx("p",{className:"text-sm",children:"Pick a markdown file from the sidebar to begin."})]})}),I.jsxs("div",{className:"w-full flex justify-center relative",style:{display:dn||Hn&&ee.diffBlocks||Ge==="folder"&&!t&&!Ce.isActive?"none":void 0},children:[Bt&&!Hn&&!ct.archiveMode&&I.jsx("div",{"data-print-hide":!0,className:"absolute -top-5 left-0 right-0 mx-auto w-full flex justify-end pointer-events-none",style:Fi===null?void 0:{maxWidth:Fi??832},children:I.jsx("div",{className:`pointer-events-auto flex items-center gap-1.5 text-[11px] tracking-wide ${z?"mr-[60px]":"mr-[4px]"}`,children:["wide","focus"].map((Te,xt)=>I.jsxs(Yt.Fragment,{children:[xt>0&&I.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground/30 select-none",children:"|"}),I.jsx(adt,{side:"top",align:"end",content:Te==="wide"?"Hide panels and expand document width":"Hide panels, keep document width",children:I.jsx("button",{type:"button",onClick:()=>ta(Te),"aria-pressed":fe===Te,className:`cursor-pointer rounded-sm transition-colors duration-150 outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:opacity-80 ${fe===Te?"text-foreground":"text-muted-foreground/50 hover:text-muted-foreground"}`,children:Te.charAt(0).toUpperCase()+Te.slice(1)})})]},Te))})}),Be==="html"?I.jsx(L0e,{ref:Zr,rawHtml:Me,annotations:Pv,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G,globalAttachments:ce,onAddGlobalAttachment:Jv,onRemoveGlobalAttachment:oA,maxWidth:Fi,onAskAI:bd?AA:void 0}):I.jsx(IAt,{ref:Zr,blocks:u,markdown:t,frontmatter:d,annotations:Pv,onAddAnnotation:Ih,onSelectAnnotation:Bh,selectedAnnotationId:o,mode:G,inputMethod:q,taterMode:z,globalAttachments:ce,onAddGlobalAttachment:Jv,onRemoveGlobalAttachment:oA,repoInfo:mn,stickyActions:$.stickyActionsEnabled,planDiffStats:Ce.isActive?null:ee.diffStats,isPlanDiffActive:Hn,onPlanDiffToggle:()=>ga(!Hn),hasPreviousVersion:!Ce.isActive&&ee.hasPreviousVersion,showDemoBadge:!te&&!TB&&!vA,maxWidth:Fi,onOpenLinkedDoc:Cr,onOpenCodeFile:nt.open,linkedDocInfo:Ce.isActive?{filepath:Ce.filepath,onBack:eo,label:un.dirs.find(Te=>Te.path===un.activeDirPath)?.isVault?"Vault File":un.activeFile?"File":void 0,backLabel:sp}:null,imageBaseDir:We,codePathBaseDir:Ye,copyLabel:Ge==="message"?"Copy message":Ge==="file"||Ge==="folder"?"Copy file":void 0,archiveInfo:ct.currentInfo,sourceInfo:be,onToggleCheckbox:qB.toggle,checkboxOverrides:qB.overrides,actionsLabelMode:ne,onAskAI:bd?AA:void 0},Ce.isActive?`doc:${Ce.filepath}`:"plan")]})]})]}),U&&fe===null&&!dn&&(R==="annotations"||bd)&&I.jsx(GAe,{...ar.handleProps,className:"hidden md:block",side:"right"}),I.jsx(Gst,{isOpen:U&&R==="annotations"&&fe===null&&!dn,blocks:u,annotations:Er,selectedId:o??s,onSelect:Bh,onDelete:_L,onEdit:RL,codeAnnotations:r,onSelectCodeAnnotation:PB,onDeleteCodeAnnotation:KB,onEditCodeAnnotation:HB,sharingEnabled:Vb,width:ar.width,editorAnnotations:Hs,onDeleteEditorAnnotation:CL,onClose:()=>K(!1),onQuickCopy:async()=>{await navigator.clipboard.writeText(abe(xc))},onShare:Vb&&(fl||Su)?()=>{K(!1),zn("share"),p(!0)}:void 0,otherFileAnnotations:kc,onOtherFileAnnotationsClick:FB}),U&&R==="ai"&&fe===null&&!dn&&bd&&I.jsxs("aside",{"data-annotation-panel":"true",className:`border-l border-border/50 bg-card/30 backdrop-blur-sm flex flex-col flex-shrink-0 ${$i?"fixed top-12 bottom-0 right-0 z-[60] w-full max-w-sm shadow-2xl bg-card":""}`,style:$i?void 0:{width:ar.width??288},children:[I.jsx("div",{className:"px-3 flex items-center border-b border-border/50",style:{height:"var(--panel-header-h)"},children:I.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[I.jsx("button",{onClick:()=>K(!1),className:"flex items-center justify-center w-5 h-5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors flex-shrink-0",title:"Close sidebar","aria-label":"Close AI sidebar",children:I.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:I.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}),I.jsx(cm,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),I.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground truncate",children:"AI"}),Qh.length>0&&I.jsx("span",{className:"text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground",children:Qh.length})]})}),I.jsx(act,{messages:Qh,isCreatingSession:Nu,isStreaming:lp,onAskGeneral:sC,permissionRequests:JB,onRespondToPermission:Wv,aiProviders:To,aiConfig:Xi,onAIConfigChange:Zv})]})]})}),nt.popoutProps&&I.jsx(sEt,{...nt.popoutProps,annotations:r.filter(Te=>Te.filePath===nt.popoutProps?.filepath),selectedAnnotationId:s,onAddAnnotation:UB,onEditAnnotation:HB,onDeleteAnnotation:KB,onSelectAnnotation:Te=>{A(null),l(Te)}}),I.jsx(uct,{isOpen:g,onClose:()=>{p(!1),zn(void 0)},shareUrl:fl,shareUrlSize:BL,shortShareUrl:Su,isGeneratingShortUrl:yL,shortUrlError:Hv,onGenerateShortUrl:QL,annotationsOutput:xc,annotationCount:Er.length+r.length,taterSprite:z?I.jsx(ez,{}):void 0,sharingEnabled:Vb,markdown:t,isApiMode:te,initialTab:on}),I.jsx(gct,{isOpen:m,onClose:()=>h(!1),onImport:wL,shareBaseUrl:Mt}),I.jsx(qp,{isOpen:b,onClose:()=>C(!1),title:"Add Annotations First",message:`To provide feedback, select text in the plan and add annotations. ${ss} will use your annotations to revise the plan.`,variant:"info"}),I.jsx(qp,{isOpen:B,onClose:()=>y(!1),onConfirm:()=>{y(!1),Eh()},title:"Annotations Won't Be Sent",message:I.jsxs(I.Fragment,{children:[ss," doesn't yet support feedback on approval. Your ",Er.length+r.length," annotation",Er.length+r.length!==1?"s":""," will be lost."]}),subMessage:I.jsxs(I.Fragment,{children:["To send feedback, use ",I.jsx("strong",{children:"Send Feedback"})," instead.",I.jsx("br",{}),I.jsx("br",{}),"Want this feature? Upvote these issues:",I.jsx("br",{}),I.jsx("a",{href:"https://github.com/anthropics/claude-code/issues/16001",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"#16001"})," · ",I.jsx("a",{href:"https://github.com/anthropics/claude-code/issues/15755",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"#15755"})]}),confirmText:"Approve Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:Q,onClose:()=>k(!1),onConfirm:()=>{k(!1),_==="approve"?md():_u()},title:"Annotations Won't Be Sent",message:I.jsxs(I.Fragment,{children:["You have ",Kv," annotation",Kv!==1?"s":""," that will be lost if you ",_==="approve"?"approve":"close","."]}),subMessage:"To send your annotations, use Send Annotations instead.",confirmText:_==="approve"?"Approve Anyway":"Close Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:x,onClose:()=>S(!1),onConfirm:()=>{S(!1),Eh()},title:"Agent Not Found",message:L,subMessage:I.jsxs(I.Fragment,{children:["You can change the agent in ",I.jsx("strong",{children:"Settings"}),", or approve anyway and OpenCode will use the default agent."]}),confirmText:"Approve Anyway",cancelText:"Cancel",variant:"warning",showCancel:!0}),I.jsx(qp,{isOpen:!!qv&&!te,onClose:kL,title:"Shared Plan Could Not Be Loaded",message:qv,subMessage:"You are viewing a demo plan. This is sample content — it is not your data or anyone else's.",variant:"warning"}),I.jsx(c8e,{position:"top-right",offset:64,toastOptions:{style:{"--normal-bg":"var(--card)","--normal-border":"var(--border)","--normal-text":"var(--foreground)","--success-bg":"oklch(from var(--success) l c h / 0.15)","--success-border":"oklch(from var(--success) l c h / 0.3)","--success-text":"var(--success)","--error-bg":"oklch(from var(--destructive) l c h / 0.15)","--error-border":"oklch(from var(--destructive) l c h / 0.3)","--error-text":"var(--destructive)"}}}),I.jsx(Mdt,{submitted:ft,title:ct.archiveMode?"Archive Closed":ft==="exited"?"Session Closed":dn?"Answers Submitted":ft==="approved"?ke?"Approved":"Plan Approved":ke?"Annotations Sent":"Feedback Sent",subtitle:ft==="exited"?"Annotation session closed without feedback.":ct.archiveMode?"You can reopen with plannotator archive.":dn?`${ss} will use your answers to continue.`:ft==="approved"?ke?`${ss} will proceed.`:`${ss} will proceed with the implementation.`:ke?`${ss} will address your annotations on the ${Ge==="message"?"message":Ge==="folder"?"files":"file"}.`:`${ss} will revise the plan based on your annotations.`,agentLabel:ss}),I.jsx(Odt,{isOpen:Sc,origin:se,providerName:Ed?.name??null,onOpenAI:ey,onDismiss:Xt}),I.jsx(kCe,{isOpen:!!lt,imageSrc:lt?.blobUrl??"",initialName:lt?.initialName,onAccept:DL,onClose:xL}),I.jsx(iut,{isOpen:vt,onComplete:Te=>{Kt(Te),_t(!1)}})]})})})},NSe=document.getElementById("root");if(!NSe)throw new Error("Could not find root element to mount to");const F0t=L4e.createRoot(NSe);F0t.render(I.jsx(Yt.StrictMode,{children:I.jsx(M0t,{})}));class Cs{constructor(e,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=a}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Cs(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class dc{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new dc(n,Cs.range(this,e))}}class nn{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+e,r,i,o=n&&n.loc;if(o&&o.start<=o.end){var A=o.lexer.input;r=o.start,i=o.end,r===A.length?a+=" at end of input: ":a+=" at position "+(r+1)+": ";var s=A.slice(r,i).replace(/[^]/g,"$&̲"),l;r>15?l="…"+A.slice(r-15,r):l=A.slice(0,r);var d;i+15<A.length?d=A.slice(i,i+15)+"…":d=A.slice(i),a+=l+s+d}var u=new Error(a);return u.name="ParseError",u.__proto__=nn.prototype,u.position=r,r!=null&&i!=null&&(u.length=i-r),u.rawMessage=e,u}}nn.prototype.__proto__=Error.prototype;var L0t=function(e,n){return e===void 0?n:e},T0t=/([A-Z])/g,G0t=function(e){return e.replace(T0t,"-$1").toLowerCase()},O0t={"&":"&",">":">","<":"<",'"':""","'":"'"},U0t=/[&><"']/g;function P0t(t){return String(t).replace(U0t,e=>O0t[e])}var MSe=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},K0t=function(e){var n=MSe(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},H0t=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Y0t=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},Xa={deflt:L0t,escape:P0t,hyphenate:G0t,getBaseElem:MSe,isCharacterBox:K0t,protocolFromUrl:Y0t},a0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand <n>",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function q0t(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Vz{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in a0)if(a0.hasOwnProperty(n)){var a=a0[n];this[n]=e[n]!==void 0?a.processor?a.processor(e[n]):e[n]:q0t(a)}}reportNonstrict(e,n,a){var r=this.strict;if(typeof r=="function"&&(r=r(e,n,a)),!(!r||r==="ignore")){if(r===!0||r==="error")throw new nn("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),a);r==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,a){var r=this.strict;if(typeof r=="function")try{r=r(e,n,a)}catch{r="error"}return!r||r==="ignore"?!1:r===!0||r==="error"?!0:r==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=Xa.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class Fp{constructor(e,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=a}sup(){return Yd[j0t[this.id]]}sub(){return Yd[z0t[this.id]]}fracNum(){return Yd[J0t[this.id]]}fracDen(){return Yd[W0t[this.id]]}cramp(){return Yd[Z0t[this.id]]}text(){return Yd[V0t[this.id]]}isTight(){return this.size>=2}}var Xz=0,ER=1,zE=2,Sg=3,tk=4,Xc=5,_I=6,qA=7,Yd=[new Fp(Xz,0,!1),new Fp(ER,0,!0),new Fp(zE,1,!1),new Fp(Sg,1,!0),new Fp(tk,2,!1),new Fp(Xc,2,!0),new Fp(_I,3,!1),new Fp(qA,3,!0)],j0t=[tk,Xc,tk,Xc,_I,qA,_I,qA],z0t=[Xc,Xc,Xc,Xc,qA,qA,qA,qA],J0t=[zE,Sg,tk,Xc,_I,qA,_I,qA],W0t=[Sg,Sg,Xc,Xc,qA,qA,qA,qA],Z0t=[ER,ER,Sg,Sg,Xc,Xc,qA,qA],V0t=[Xz,ER,zE,Sg,zE,Sg,zE,Sg],Zn={DISPLAY:Yd[Xz],TEXT:Yd[zE],SCRIPT:Yd[tk],SCRIPTSCRIPT:Yd[_I]},P7=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function X0t(t){for(var e=0;e<P7.length;e++)for(var n=P7[e],a=0;a<n.blocks.length;a++){var r=n.blocks[a];if(t>=r[0]&&t<=r[1])return n.name}return null}var YS=[];P7.forEach(t=>t.blocks.forEach(e=>YS.push(...e)));function FSe(t){for(var e=0;e<YS.length;e+=2)if(t>=YS[e]&&t<=YS[e+1])return!0;return!1}var jC=80,$0t=function(e,n){return"M95,"+(622+e+n)+`
|
|
1851
1851
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
1852
1852
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
1853
1853
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|