@seaveyon/harness-switch 0.31.0 → 0.33.0

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.
@@ -0,0 +1,63 @@
1
+ (()=>{"use strict";var e,t,n,r,o,i,a,l,s,c={6974(e,t,n){var r,o=n(7967),i=n(4041),a=n(3144);function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do 0!=(4098&(t=e).flags)&&(n=t.return),e=t.return;while(e)}return 3===t.tag?n:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function u(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function d(e){if(s(e)!==e)throw Error(l(188))}var f=Object.assign,p=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),x=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),O=Symbol.for("react.lazy");Symbol.for("react.scope");var C=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var N=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var P=Symbol.iterator;function E(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=P&&e[P]||e["@@iterator"])?e:null}var I=Symbol.for("react.client.reference"),A=Array.isArray,_=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T={pending:!1,data:null,method:null,action:null},R=[],z=-1;function D(e){return{current:e}}function L(e){0>z||(e.current=R[z],R[z]=null,z--)}function F(e,t){R[++z]=e.current,e.current=t}var U=D(null),H=D(null),$=D(null),B=D(null);function K(e,t){switch(F($,t),F(H,e),F(U,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=cy(t=cg(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(U),F(U,e)}function q(){L(U),L(H),L($)}function V(e){null!==e.memoizedState&&F(B,e);var t=U.current,n=cy(t,e.type);t!==n&&(F(H,e),F(U,n))}function W(e){H.current===e&&(L(U),L(H)),B.current===e&&(L(B),ue._currentValue=T)}function G(e){if(void 0===tz)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);tz=t&&t[1]||"",tD=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+tz+e+tD}var Z=!1;function Y(e,t){if(!e||Z)return"";Z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(e){if(e&&r&&"string"==typeof e.stack)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=r.DetermineComponentFrameRoot(),a=i[0],l=i[1];if(a&&l){var s=a.split("\n"),c=l.split("\n");for(o=r=0;r<s.length&&!s[r].includes("DetermineComponentFrameRoot");)r++;for(;o<c.length&&!c[o].includes("DetermineComponentFrameRoot");)o++;if(r===s.length||o===c.length)for(r=s.length-1,o=c.length-1;1<=r&&0<=o&&s[r]!==c[o];)o--;for(;1<=r&&0<=o;r--,o--)if(s[r]!==c[o]){if(1!==r||1!==o)do if(r--,o--,0>o||s[r]!==c[o]){var u="\n"+s[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=r&&0<=o);break}}}finally{Z=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?G(n):""}function X(e){try{var t="",n=null;do t+=function(e,t){switch(e.tag){case 26:case 27:case 5:return G(e.type);case 16:return G("Lazy");case 13:return e.child!==t&&null!==t?G("Suspense Fallback"):G("Suspense");case 19:return G("SuspenseList");case 0:case 15:return Y(e.type,!1);case 11:return Y(e.type.render,!1);case 1:return Y(e.type,!0);case 31:return G("Activity");default:return""}}(e,n),n=e,e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var J=Object.prototype.hasOwnProperty,Q=o.unstable_scheduleCallback,ee=o.unstable_cancelCallback,et=o.unstable_shouldYield,en=o.unstable_requestPaint,er=o.unstable_now,eo=o.unstable_getCurrentPriorityLevel,ei=o.unstable_ImmediatePriority,ea=o.unstable_UserBlockingPriority,el=o.unstable_NormalPriority,es=o.unstable_LowPriority,ec=o.unstable_IdlePriority,eu=o.log,ed=o.unstable_setDisableYieldValue,ef=null,ep=null;function eh(e){if("function"==typeof eu&&ed(e),ep&&"function"==typeof ep.setStrictMode)try{ep.setStrictMode(ef,e)}catch(e){}}var em=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(ev(e)/eg|0)|0},ev=Math.log,eg=Math.LN2,ey=256,eb=262144,ex=4194304;function ew(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 261888&e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 0x1000000:case 0x2000000:return 0x3c00000&e;case 0x4000000:return 0x4000000;case 0x8000000:return 0x8000000;case 0x10000000:return 0x10000000;case 0x20000000:return 0x20000000;case 0x40000000:return 0;default:return e}}function ek(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var o=0,i=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=0x7ffffff&r;return 0!==l?0!=(r=l&~i)?o=ew(r):0!=(a&=l)?o=ew(a):n||0!=(n=l&~e)&&(o=ew(n)):0!=(l=r&~i)?o=ew(l):0!==a?o=ew(a):n||0!=(n=r&~e)&&(o=ew(n)),0===o?0:0!==t&&t!==o&&0==(t&i)&&((i=o&-o)>=(n=t&-t)||32===i&&0!=(4194048&n))?t:o}function ej(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function eS(){var e=ex;return 0==(0x3c00000&(ex<<=1))&&(ex=4194304),e}function eO(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function eC(e,t){e.pendingLanes|=t,0x10000000!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function eN(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-em(t);e.entangledLanes|=t,e.entanglements[r]=0x40000000|e.entanglements[r]|261930&n}function eP(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-em(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}function eE(e,t){var n=t&-t;return 0!=((n=0!=(42&n)?1:eI(n))&(e.suspendedLanes|t))?0:n}function eI(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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 0x1000000:case 0x2000000:e=128;break;case 0x10000000:e=0x8000000;break;default:e=0}return e}function eA(e){return 2<(e&=-e)?8<e?0!=(0x7ffffff&e)?32:0x10000000:8:2}function e_(){var e=M.p;return 0!==e?e:void 0===(e=window.event)?32:uh(e.type)}function eM(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var eT=Math.random().toString(36).slice(2),eR="__reactFiber$"+eT,ez="__reactProps$"+eT,eD="__reactContainer$"+eT,eL="__reactEvents$"+eT,eF="__reactListeners$"+eT,eU="__reactHandles$"+eT,eH="__reactResources$"+eT,e$="__reactMarker$"+eT;function eB(e){delete e[eR],delete e[ez],delete e[eL],delete e[eF],delete e[eU]}function eK(e){var t=e[eR];if(t)return t;for(var n=e.parentNode;n;){if(t=n[eD]||n[eR]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=cz(e);null!==e;){if(n=e[eR])return n;e=cz(e)}return t}n=(e=n).parentNode}return null}function eq(e){if(e=e[eR]||e[eD]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function eV(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(l(33))}function eW(e){var t=e[eH];return t||(t=e[eH]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function eG(e){e[e$]=!0}var eZ=new Set,eY={};function eX(e,t){eJ(e,t),eJ(e+"Capture",t)}function eJ(e,t){for(eY[e]=t,e=0;e<t.length;e++)eZ.add(t[e])}var eQ=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]*$"),e0={},e1={};function e2(e,t,n){if(J.call(e1,t)||!J.call(e0,t)&&(eQ.test(t)?e1[t]=!0:(e0[t]=!0,!1)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function e3(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function e4(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function e5(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e6(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e8(e){if(!e._valueTracker){var t=e6(e)?"checked":"value";e._valueTracker=function(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){n=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function e9(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e6(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e7(e){if(void 0===(e=e||("u">typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var te=/[\n"\\]/g;function tt(e){return e.replace(te,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function tn(e,t,n,r,o,i,a,l){e.name="",null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e5(t)):e.value!==""+e5(t)&&(e.value=""+e5(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?to(e,a,e5(t)):null!=n?to(e,a,e5(n)):null!=r&&e.removeAttribute("value"),null==o&&null!=i&&(e.defaultChecked=!!i),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=l&&"function"!=typeof l&&"symbol"!=typeof l&&"boolean"!=typeof l?e.name=""+e5(l):e.removeAttribute("name")}function tr(e,t,n,r,o,i,a,l){if(null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(e.type=i),null!=t||null!=n){if(("submit"===i||"reset"===i)&&null==t)return void e8(e);n=null!=n?""+e5(n):"",t=null!=t?""+e5(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:o)&&"symbol"!=typeof r&&!!r,e.checked=l?e.checked:!!r,e.defaultChecked=!!r,null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.name=a),e8(e)}function to(e,t,n){"number"===t&&e7(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function ti(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(o=0,n=""+e5(n),t=null;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ta(e,t,n){if(null!=t&&((t=""+e5(t))!==e.value&&(e.value=t),null==n)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=null!=n?""+e5(n):""}function tl(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(l(92));if(A(r)){if(1<r.length)throw Error(l(93));r=r[0]}n=r}null==n&&(n=""),t=n}e.defaultValue=n=e5(t),(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r),e8(e)}function ts(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var tc=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 tu(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||tc.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function td(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(l(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var o in t)r=t[o],t.hasOwnProperty(o)&&n[o]!==r&&tu(e,o,r)}else for(var i in t)t.hasOwnProperty(i)&&tu(e,i,t[i])}function tf(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=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"]]),th=/^[\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 tm(e){return th.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tv(){}var tg=null;function ty(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tb=null,tx=null;function tw(e){var t=eq(e);if(t&&(e=t.stateNode)){var n=e[ez]||null;switch(e=t.stateNode,t.type){case"input":if(tn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+tt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=r[ez]||null;if(!o)throw Error(l(90));tn(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&e9(r)}break;case"textarea":ta(e,n.value,n.defaultValue);break;case"select":null!=(t=n.value)&&ti(e,!!n.multiple,t,!1)}}}var tk=!1;function tj(e,t,n){if(tk)return e(t,n);tk=!0;try{return e(t)}finally{if(tk=!1,(null!==tb||null!==tx)&&(sd(),tb&&(t=tb,e=tx,tx=tb=null,tw(t),e)))for(t=0;t<e.length;t++)tw(e[t])}}function tS(e,t){var n=e.stateNode;if(null===n)return null;var r=n[ez]||null;if(null===r)return null;switch(n=r[t],t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r="button"!==(e=e.type)&&"input"!==e&&"select"!==e&&"textarea"!==e),e=!r;break;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(l(231,t,typeof n));return n}var tO="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement,tC=!1;if(tO)try{var tN={};Object.defineProperty(tN,"passive",{get:function(){tC=!0}}),window.addEventListener("test",tN,tN),window.removeEventListener("test",tN,tN)}catch(e){tC=!1}var tP=null,tE=null,tI=null;function tA(){if(tI)return tI;var e,t,n=tE,r=n.length,o="value"in tP?tP.value:tP.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return tI=o.slice(e,1<t?1-t:void 0)}function t_(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function tM(){return!0}function tT(){return!1}function tR(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?tM:tT,this.isPropagationStopped=tT,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=tM)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=tM)},persist:function(){},isPersistent:tM}),t}var tz,tD,tL,tF,tU,tH={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},t$=tR(tH),tB=f({},tH,{view:0,detail:0}),tK=tR(tB),tq=f({},tB,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:t2,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==tU&&(tU&&"mousemove"===e.type?(tL=e.screenX-tU.screenX,tF=e.screenY-tU.screenY):tF=tL=0,tU=e),tL)},movementY:function(e){return"movementY"in e?e.movementY:tF}}),tV=tR(tq),tW=tR(f({},tq,{dataTransfer:0})),tG=tR(f({},tB,{relatedTarget:0})),tZ=tR(f({},tH,{animationName:0,elapsedTime:0,pseudoElement:0})),tY=tR(f({},tH,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),tX=tR(f({},tH,{data:0})),tJ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tQ={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"},t0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function t1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=t0[e])&&!!t[e]}function t2(){return t1}var t3=tR(f({},tB,{key:function(e){if(e.key){var t=tJ[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=t_(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?tQ[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:t2,charCode:function(e){return"keypress"===e.type?t_(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?t_(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),t4=tR(f({},tq,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),t5=tR(f({},tB,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:t2})),t6=tR(f({},tH,{propertyName:0,elapsedTime:0,pseudoElement:0})),t8=tR(f({},tq,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),t9=tR(f({},tH,{newState:0,oldState:0})),t7=[9,13,27,32],ne=tO&&"CompositionEvent"in window,nt=null;tO&&"documentMode"in document&&(nt=document.documentMode);var nn=tO&&"TextEvent"in window&&!nt,nr=tO&&(!ne||nt&&8<nt&&11>=nt),no=!1;function ni(e,t){switch(e){case"keyup":return -1!==t7.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function na(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var nl=!1,ns={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(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ns[e.type]:"textarea"===t}function nu(e,t,n,r){tb?tx?tx.push(r):tx=[r]:tb=r,0<(t=cr(t,"onChange")).length&&(n=new t$("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nd=null,nf=null;function np(e){s5(e,0)}function nh(e){if(e9(eV(e)))return e}function nm(e,t){if("change"===e)return t}var nv=!1;if(tO){if(tO){var ng="oninput"in document;if(!ng){var ny=document.createElement("div");ny.setAttribute("oninput","return;"),ng="function"==typeof ny.oninput}r=ng}else r=!1;nv=r&&(!document.documentMode||9<document.documentMode)}function nb(){nd&&(nd.detachEvent("onpropertychange",nx),nf=nd=null)}function nx(e){if("value"===e.propertyName&&nh(nf)){var t=[];nu(t,nf,e,ty(e)),tj(np,t)}}function nw(e,t,n){"focusin"===e?(nb(),nd=t,nf=n,nd.attachEvent("onpropertychange",nx)):"focusout"===e&&nb()}function nk(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return nh(nf)}function nj(e,t){if("click"===e)return nh(t)}function nS(e,t){if("input"===e||"change"===e)return nh(t)}var nO="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nC(e,t){if(nO(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!J.call(t,o)||!nO(e[o],t[o]))return!1}return!0}function nN(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nP(e,t){var n,r=nN(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nN(r)}}function nE(e){e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;for(var t=e7(e.document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e7(e.document)}return t}function nI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nA=tO&&"documentMode"in document&&11>=document.documentMode,n_=null,nM=null,nT=null,nR=!1;function nz(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;nR||null==n_||n_!==e7(r)||(r="selectionStart"in(r=n_)&&nI(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},nT&&nC(nT,r)||(nT=r,0<(r=cr(nM,"onSelect")).length&&(t=new t$("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=n_)))}function nD(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var nL={animationend:nD("Animation","AnimationEnd"),animationiteration:nD("Animation","AnimationIteration"),animationstart:nD("Animation","AnimationStart"),transitionrun:nD("Transition","TransitionRun"),transitionstart:nD("Transition","TransitionStart"),transitioncancel:nD("Transition","TransitionCancel"),transitionend:nD("Transition","TransitionEnd")},nF={},nU={};function nH(e){if(nF[e])return nF[e];if(!nL[e])return e;var t,n=nL[e];for(t in n)if(n.hasOwnProperty(t)&&t in nU)return nF[e]=n[t];return e}tO&&(nU=document.createElement("div").style,"AnimationEvent"in window||(delete nL.animationend.animation,delete nL.animationiteration.animation,delete nL.animationstart.animation),"TransitionEvent"in window||delete nL.transitionend.transition);var n$=nH("animationend"),nB=nH("animationiteration"),nK=nH("animationstart"),nq=nH("transitionrun"),nV=nH("transitionstart"),nW=nH("transitioncancel"),nG=nH("transitionend"),nZ=new Map,nY="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(" ");function nX(e,t){nZ.set(e,t),eX(t,[e])}nY.push("scrollEnd");var nJ="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},nQ=[],n0=0,n1=0;function n2(){for(var e=n0,t=n1=n0=0;t<e;){var n=nQ[t];nQ[t++]=null;var r=nQ[t];nQ[t++]=null;var o=nQ[t];nQ[t++]=null;var i=nQ[t];if(nQ[t++]=null,null!==r&&null!==o){var a=r.pending;null===a?o.next=o:(o.next=a.next,a.next=o),r.pending=o}0!==i&&n6(n,o,i)}}function n3(e,t,n,r){nQ[n0++]=e,nQ[n0++]=t,nQ[n0++]=n,nQ[n0++]=r,n1|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function n4(e,t,n,r){return n3(e,t,n,r),n8(e)}function n5(e,t){return n3(e,null,null,t),n8(e)}function n6(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var o=!1,i=e.return;null!==i;)i.childLanes|=n,null!==(r=i.alternate)&&(r.childLanes|=n),22===i.tag&&(null===(e=i.stateNode)||1&e._visibility||(o=!0)),e=i,i=i.return;return 3===e.tag?(i=e.stateNode,o&&null!==t&&(o=31-em(n),null===(r=(e=i.hiddenUpdates)[o])?e[o]=[t]:r.push(t),t.lane=0x20000000|n),i):null}function n8(e){if(50<sr)throw sr=0,so=null,Error(l(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var n9={};function n7(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function re(e,t,n,r){return new n7(e,t,n,r)}function rt(e){return!(!(e=e.prototype)||!e.isReactComponent)}function rn(e,t){var n=e.alternate;return null===n?((n=re(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=0x3e00000&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function rr(e,t){e.flags&=0x3e00002;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,e.dependencies=null===(t=n.dependencies)?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ro(e,t,n,r,o,i){var a=0;if(r=e,"function"==typeof e)rt(e)&&(a=1);else if("string"==typeof e)a=!function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;if("stylesheet"===t.rel)return e=t.disabled,"string"==typeof t.precedence&&null==e;return!0;case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,U.current)?"html"===e||"head"===e||"body"===e?27:5:26;else e:switch(e){case C:return(e=re(31,n,t,o)).elementType=C,e.lanes=i,e;case v:return ri(n.children,o,i,t);case g:a=8,o|=24;break;case y:return(e=re(12,n,t,2|o)).elementType=y,e.lanes=i,e;case k:return(e=re(13,n,t,o)).elementType=k,e.lanes=i,e;case j:return(e=re(19,n,t,o)).elementType=j,e.lanes=i,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:a=10;break e;case b:a=9;break e;case w:a=11;break e;case S:a=14;break e;case O:a=16,r=null;break e}a=29,n=Error(l(130,null===e?"null":typeof e,"")),r=null}return(t=re(a,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function ri(e,t,n,r){return(e=re(7,e,r,t)).lanes=n,e}function ra(e,t,n){return(e=re(6,e,null,t)).lanes=n,e}function rl(e){var t=re(18,null,null,0);return t.stateNode=e,t}function rs(e,t,n){return(t=re(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var rc=new WeakMap;function ru(e,t){if("object"==typeof e&&null!==e){var n=rc.get(e);return void 0!==n?n:(t={value:e,source:t,stack:X(t)},rc.set(e,t),t)}return{value:e,source:t,stack:X(t)}}var rd=[],rf=0,rp=null,rh=0,rm=[],rv=0,rg=null,ry=1,rb="";function rx(e,t){rd[rf++]=rh,rd[rf++]=rp,rp=e,rh=t}function rw(e,t,n){rm[rv++]=ry,rm[rv++]=rb,rm[rv++]=rg,rg=e;var r=ry;e=rb;var o=32-em(r)-1;r&=~(1<<o),n+=1;var i=32-em(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,ry=1<<32-em(t)+o|n<<o|r,rb=i+e}else ry=1<<i|n<<o|r,rb=e}function rk(e){null!==e.return&&(rx(e,1),rw(e,1,0))}function rj(e){for(;e===rp;)rp=rd[--rf],rd[rf]=null,rh=rd[--rf],rd[rf]=null;for(;e===rg;)rg=rm[--rv],rm[rv]=null,rb=rm[--rv],rm[rv]=null,ry=rm[--rv],rm[rv]=null}function rS(e,t){rm[rv++]=ry,rm[rv++]=rb,rm[rv++]=rg,ry=t.id,rb=t.overflow,rg=e}var rO=null,rC=null,rN=!1,rP=null,rE=!1,rI=Error(l(519));function rA(e){var t=Error(l(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML",""));throw rD(ru(t,e)),rI}function r_(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[eR]=e,t[ez]=r,n){case"dialog":s6("cancel",t),s6("close",t);break;case"iframe":case"object":case"embed":s6("load",t);break;case"video":case"audio":for(n=0;n<s3.length;n++)s6(s3[n],t);break;case"source":s6("error",t);break;case"img":case"image":case"link":s6("error",t),s6("load",t);break;case"details":s6("toggle",t);break;case"input":s6("invalid",t),tr(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":s6("invalid",t);break;case"textarea":s6("invalid",t),tl(t,r.value,r.defaultValue,r.children)}"string"!=typeof(n=r.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||cc(t.textContent,n)?(null!=r.popover&&(s6("beforetoggle",t),s6("toggle",t)),null!=r.onScroll&&s6("scroll",t),null!=r.onScrollEnd&&s6("scrollend",t),null!=r.onClick&&(t.onclick=tv),t=!0):t=!1,t||rA(e,!0)}function rM(e){for(rO=e.return;rO;)switch(rO.tag){case 5:case 31:case 13:rE=!1;return;case 27:case 3:rE=!0;return;default:rO=rO.return}}function rT(e){if(e!==rO)return!1;if(!rN)return rM(e),rN=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t="form"===(t=e.type)||"button"===t||cb(e.type,e.memoizedProps)),t=!t),t&&rC&&rA(e),rM(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));rC=cR(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(l(317));rC=cR(e)}else 27===n?(n=rC,cC(e.type)?(e=cT,cT=null,rC=e):rC=n):rC=rO?cM(e.stateNode.nextSibling):null;return!0}function rR(){rC=rO=null,rN=!1}function rz(){var e=rP;return null!==e&&(null===lQ?lQ=e:lQ.push.apply(lQ,e),rP=null),e}function rD(e){null===rP?rP=[e]:rP.push(e)}var rL=D(null),rF=null,rU=null;function rH(e,t,n){F(rL,t._currentValue),t._currentValue=n}function r$(e){e._currentValue=rL.current,L(rL)}function rB(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function rK(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){var i=o.dependencies;if(null!==i){var a=o.child;i=i.firstContext;e:for(;null!==i;){var s=i;i=o;for(var c=0;c<t.length;c++)if(s.context===t[c]){i.lanes|=n,null!==(s=i.alternate)&&(s.lanes|=n),rB(i.return,n,e),r||(a=null);break e}i=s.next}}else if(18===o.tag){if(null===(a=o.return))throw Error(l(341));a.lanes|=n,null!==(i=a.alternate)&&(i.lanes|=n),rB(a,n,e),a=null}else a=o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===e){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}}function rq(e,t,n,r){e=null;for(var o=t,i=!1;null!==o;){if(!i){if(0!=(524288&o.flags))i=!0;else if(0!=(262144&o.flags))break}if(10===o.tag){var a=o.alternate;if(null===a)throw Error(l(387));if(null!==(a=a.memoizedProps)){var s=o.type;nO(o.pendingProps.value,a.value)||(null!==e?e.push(s):e=[s])}}else if(o===B.current){if(null===(a=o.alternate))throw Error(l(387));a.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(null!==e?e.push(ue):e=[ue])}o=o.return}null!==e&&rK(t,e,n,r),t.flags|=262144}function rV(e){for(e=e.firstContext;null!==e;){if(!nO(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rW(e){rF=e,rU=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function rG(e){return rY(rF,e)}function rZ(e,t){return null===rF&&rW(e),rY(e,t)}function rY(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===rU){if(null===e)throw Error(l(308));rU=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else rU=rU.next=t;return n}var rX="u">typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},rJ=o.unstable_scheduleCallback,rQ=o.unstable_NormalPriority,r0={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function r1(){return{controller:new rX,data:new Map,refCount:0}}function r2(e){e.refCount--,0===e.refCount&&rJ(rQ,function(){e.controller.abort()})}var r3=null,r4=0,r5=0,r6=null;function r8(){if(0==--r4&&null!==r3){null!==r6&&(r6.status="fulfilled");var e=r3;r3=null,r5=0,r6=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var r9=_.S;_.S=function(e,t){l2=er(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e){if(null===r3){var t=r3=[];r4=0,r5=sJ(),r6={status:"pending",value:void 0,then:function(e){t.push(e)}}}r4++,e.then(r8,r8)}(t),null!==r9&&r9(e,t)};var r7=D(null);function oe(){var e=r7.current;return null!==e?e:lD.pooledCache}function ot(e,t){null===t?F(r7,r7.current):F(r7,t.pool)}function on(){var e=oe();return null===e?null:{parent:r0._currentValue,pool:e}}var or=Error(l(460)),oo=Error(l(474)),oi=Error(l(542)),oa={then:function(){}};function ol(e){return"fulfilled"===(e=e.status)||"rejected"===e}function os(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(tv,tv),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw of(e=t.reason),e;default:if("string"==typeof t.status)t.then(tv,tv);else{if(null!==(e=lD)&&100<e.shellSuspendCounter)throw Error(l(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw of(e=t.reason),e}throw ou=t,or}}function oc(e){try{return(0,e._init)(e._payload)}catch(e){if(null!==e&&"object"==typeof e&&"function"==typeof e.then)throw ou=e,or;throw e}}var ou=null;function od(){if(null===ou)throw Error(l(459));var e=ou;return ou=null,e}function of(e){if(e===or||e===oi)throw Error(l(483))}var op=null,oh=0;function om(e){var t=oh;return oh+=1,null===op&&(op=[]),os(op,e,t)}function ov(e,t){e.ref=void 0!==(t=t.props.ref)?t:null}function og(e,t){if(t.$$typeof===p)throw Error(l(525));throw Error(l(31,"[object Object]"===(e=Object.prototype.toString.call(t))?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function oy(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function o(e,t){return(e=rn(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return(t.index=r,e)?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=0x4000002,n):r:(t.flags|=0x4000002,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=0x4000002),t}function s(e,t,n,r){return null===t||6!==t.tag?(t=ra(n,e.mode,r)).return=e:(t=o(t,n)).return=e,t}function c(e,t,n,r){var i=n.type;return i===v?d(e,t,n.props.children,r,n.key):(null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===O&&oc(i)===t.type)?ov(t=o(t,n.props),n):ov(t=ro(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=rs(n,e.mode,r)).return=e:(t=o(t,n.children||[])).return=e,t}function d(e,t,n,r,i){return null===t||7!==t.tag?(t=ri(n,e.mode,r,i)).return=e:(t=o(t,n)).return=e,t}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=ra(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case h:return ov(n=ro(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case m:return(t=rs(t,e.mode,n)).return=e,t;case O:return f(e,t=oc(t),n)}if(A(t)||E(t))return(t=ri(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return f(e,om(t),n);if(t.$$typeof===x)return f(e,rZ(e,t),n);og(e,t)}return null}function p(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==o?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case h:return n.key===o?c(e,t,n,r):null;case m:return n.key===o?u(e,t,n,r):null;case O:return p(e,t,n=oc(n),r)}if(A(n)||E(n))return null!==o?null:d(e,t,n,r,null);if("function"==typeof n.then)return p(e,t,om(n),r);if(n.$$typeof===x)return p(e,t,rZ(e,n),r);og(e,n)}return null}function g(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r||"bigint"==typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case h:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case m:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case O:return g(e,t,n,r=oc(r),o)}if(A(r)||E(r))return d(t,e=e.get(n)||null,r,o,null);if("function"==typeof r.then)return g(e,t,n,om(r),o);if(r.$$typeof===x)return g(e,t,n,rZ(t,r),o);og(t,r)}return null}return function(s,c,u,d){try{oh=0;var y=function s(c,u,d,y){if("object"==typeof d&&null!==d&&d.type===v&&null===d.key&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case h:e:{for(var b=d.key;null!==u;){if(u.key===b){if((b=d.type)===v){if(7===u.tag){n(c,u.sibling),(y=o(u,d.props.children)).return=c,c=y;break e}}else if(u.elementType===b||"object"==typeof b&&null!==b&&b.$$typeof===O&&oc(b)===u.type){n(c,u.sibling),ov(y=o(u,d.props),d),y.return=c,c=y;break e}n(c,u);break}t(c,u),u=u.sibling}d.type===v?(y=ri(d.props.children,c.mode,y,d.key)).return=c:(ov(y=ro(d.type,d.key,d.props,null,c.mode,y),d),y.return=c),c=y}return a(c);case m:e:{for(b=d.key;null!==u;){if(u.key===b)if(4===u.tag&&u.stateNode.containerInfo===d.containerInfo&&u.stateNode.implementation===d.implementation){n(c,u.sibling),(y=o(u,d.children||[])).return=c,c=y;break e}else{n(c,u);break}t(c,u),u=u.sibling}(y=rs(d,c.mode,y)).return=c,c=y}return a(c);case O:return s(c,u,d=oc(d),y)}if(A(d))return function(o,a,l,s){for(var c=null,u=null,d=a,h=a=0,m=null;null!==d&&h<l.length;h++){d.index>h?(m=d,d=null):m=d.sibling;var v=p(o,d,l[h],s);if(null===v){null===d&&(d=m);break}e&&d&&null===v.alternate&&t(o,d),a=i(v,a,h),null===u?c=v:u.sibling=v,u=v,d=m}if(h===l.length)return n(o,d),rN&&rx(o,h),c;if(null===d){for(;h<l.length;h++)null!==(d=f(o,l[h],s))&&(a=i(d,a,h),null===u?c=d:u.sibling=d,u=d);return rN&&rx(o,h),c}for(d=r(d);h<l.length;h++)null!==(m=g(d,o,h,l[h],s))&&(e&&null!==m.alternate&&d.delete(null===m.key?h:m.key),a=i(m,a,h),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach(function(e){return t(o,e)}),rN&&rx(o,h),c}(c,u,d,y);if(E(d)){if("function"!=typeof(b=E(d)))throw Error(l(150));return function(o,a,s,c){if(null==s)throw Error(l(151));for(var u=null,d=null,h=a,m=a=0,v=null,y=s.next();null!==h&&!y.done;m++,y=s.next()){h.index>m?(v=h,h=null):v=h.sibling;var b=p(o,h,y.value,c);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&t(o,h),a=i(b,a,m),null===d?u=b:d.sibling=b,d=b,h=v}if(y.done)return n(o,h),rN&&rx(o,m),u;if(null===h){for(;!y.done;m++,y=s.next())null!==(y=f(o,y.value,c))&&(a=i(y,a,m),null===d?u=y:d.sibling=y,d=y);return rN&&rx(o,m),u}for(h=r(h);!y.done;m++,y=s.next())null!==(y=g(h,o,m,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?m:y.key),a=i(y,a,m),null===d?u=y:d.sibling=y,d=y);return e&&h.forEach(function(e){return t(o,e)}),rN&&rx(o,m),u}(c,u,d=b.call(d),y)}if("function"==typeof d.then)return s(c,u,om(d),y);if(d.$$typeof===x)return s(c,u,rZ(c,d),y);og(c,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==u&&6===u.tag?(n(c,u.sibling),(y=o(u,d)).return=c):(n(c,u),(y=ra(d,c.mode,y)).return=c),a(c=y)):n(c,u)}(s,c,u,d);return op=null,y}catch(e){if(e===or||e===oi)throw e;var b=re(29,e,null,s.mode);return b.lanes=d,b.return=s,b}finally{}}}var ob=oy(!0),ox=oy(!1),ow=!1;function ok(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oj(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oS(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function oO(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!=(2&lz)){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,t=n8(e),n6(e,null,n),t}return n3(e,r,t,n),n8(e)}function oC(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194048&n))){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eP(e,n)}}function oN(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oP=!1;function oE(){if(oP){var e=r6;if(null!==e)throw e}}function oI(e,t,n,r){oP=!1;var o=e.updateQueue;ow=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var s=l,c=s.next;s.next=null,null===a?i=c:a.next=c,a=s;var u=e.alternate;null!==u&&(l=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===l?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=s)}if(null!==i){var d=o.baseState;for(a=0,u=c=s=null,l=i;;){var p=-0x20000001&l.lane,h=p!==l.lane;if(h?(lF&p)===p:(r&p)===p){0!==p&&p===r5&&(oP=!0),null!==u&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,v=l;switch(p=t,v.tag){case 1:if("function"==typeof(m=v.payload)){d=m.call(n,d,p);break e}d=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(p="function"==typeof(m=v.payload)?m.call(n,d,p):m))break e;d=f({},d,p);break e;case 2:ow=!0}}null!==(p=l.callback)&&(e.flags|=64,h&&(e.flags|=8192),null===(h=o.callbacks)?o.callbacks=[p]:h.push(p))}else h={lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===u?(c=u=h,s=d):u=u.next=h,a|=p;if(null===(l=l.next))if(null===(l=o.shared.pending))break;else l=(h=l).next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}null===u&&(s=d),o.baseState=s,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null===i&&(o.shared.lanes=0),lW|=a,e.lanes=a,e.memoizedState=d}}function oA(e,t){if("function"!=typeof e)throw Error(l(191,e));e.call(t)}function o_(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)oA(n[e],t)}var oM=D(null),oT=D(0);function oR(e,t){F(oT,e=lq),F(oM,t),lq=e|t.baseLanes}function oz(){F(oT,lq),F(oM,oM.current)}function oD(){lq=oT.current,L(oM),L(oT)}var oL=D(null),oF=null;function oU(e){var t=e.alternate;F(oq,1&oq.current),F(oL,e),null===oF&&(null===t||null!==oM.current?oF=e:null!==t.memoizedState&&(oF=e))}function oH(e){F(oq,oq.current),F(oL,e),null===oF&&(oF=e)}function o$(e){22===e.tag?(F(oq,oq.current),F(oL,e),null===oF&&(oF=e)):oB(e)}function oB(){F(oq,oq.current),F(oL,oL.current)}function oK(e){L(oL),oF===e&&(oF=null),L(oq)}var oq=D(0);function oV(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||cA(n)||c_(n)))return t}else if(19===t.tag&&("forwards"===t.memoizedProps.revealOrder||"backwards"===t.memoizedProps.revealOrder||"unstable_legacy-backwards"===t.memoizedProps.revealOrder||"together"===t.memoizedProps.revealOrder)){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oW=0,oG=null,oZ=null,oY=null,oX=!1,oJ=!1,oQ=!1,o0=0,o1=0,o2=null,o3=0;function o4(){throw Error(l(321))}function o5(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!nO(e[n],t[n]))return!1;return!0}function o6(e,t,n,r,o,i){return oW=i,oG=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=null===e||null===e.memoizedState?ao:ai,oQ=!1,i=n(r,o),oQ=!1,oJ&&(i=o9(t,n,r,o)),o8(e),i}function o8(e){_.H=ar;var t=null!==oZ&&null!==oZ.next;if(oW=0,oY=oZ=oG=null,oX=!1,o1=0,o2=null,t)throw Error(l(300));null===e||aw||null!==(e=e.dependencies)&&rV(e)&&(aw=!0)}function o9(e,t,n,r){oG=e;var o=0;do{if(oJ&&(o2=null),o1=0,oJ=!1,25<=o)throw Error(l(301));if(o+=1,oY=oZ=null,null!=e.updateQueue){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,null!=i.memoCache&&(i.memoCache.index=0)}_.H=aa,i=t(n,r)}while(oJ);return i}function o7(){var e=_.H,t=e.useState()[0];return t="function"==typeof t.then?il(t):t,e=e.useState()[0],(null!==oZ?oZ.memoizedState:null)!==e&&(oG.flags|=1024),t}function ie(){var e=0!==o0;return o0=0,e}function it(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ir(e){if(oX){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}oX=!1}oW=0,oY=oZ=oG=null,oJ=!1,o1=o0=0,o2=null}function io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===oY?oG.memoizedState=oY=e:oY=oY.next=e,oY}function ii(){if(null===oZ){var e=oG.alternate;e=null!==e?e.memoizedState:null}else e=oZ.next;var t=null===oY?oG.memoizedState:oY.next;if(null!==t)oY=t,oZ=e;else{if(null===e){if(null===oG.alternate)throw Error(l(467));throw Error(l(310))}e={memoizedState:(oZ=e).memoizedState,baseState:oZ.baseState,baseQueue:oZ.baseQueue,queue:oZ.queue,next:null},null===oY?oG.memoizedState=oY=e:oY=oY.next=e}return oY}function ia(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function il(e){var t=o1;return o1+=1,null===o2&&(o2=[]),e=os(o2,e,t),t=oG,null===(null===oY?t.memoizedState:oY.next)&&(_.H=null===(t=t.alternate)||null===t.memoizedState?ao:ai),e}function is(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return il(e);if(e.$$typeof===x)return rG(e)}throw Error(l(438,String(e)))}function ic(e){var t=null,n=oG.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=oG.alternate;null!==r&&null!==(r=r.updateQueue)&&null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n=ia(),oG.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=N;return t.index++,n}function iu(e,t){return"function"==typeof t?t(e):t}function id(e){return ip(ii(),oZ,e)}function ip(e,t,n){var r=e.queue;if(null===r)throw Error(l(311));r.lastRenderedReducer=n;var o=e.baseQueue,i=r.pending;if(null!==i){if(null!==o){var a=o.next;o.next=i.next,i.next=a}t.baseQueue=o=i,r.pending=null}if(i=e.baseState,null===o)e.memoizedState=i;else{t=o.next;var s=a=null,c=null,u=t,d=!1;do{var f=-0x20000001&u.lane;if(f!==u.lane?(lF&f)===f:(oW&f)===f){var p=u.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===r5&&(d=!0);else if((oW&p)===p){u=u.next,p===r5&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=f,a=i):c=c.next=f,oG.lanes|=p,lW|=p;f=u.action,oQ&&n(i,f),i=u.hasEagerState?u.eagerState:n(i,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(s=c=p,a=i):c=c.next=p,oG.lanes|=f,lW|=f;u=u.next}while(null!==u&&u!==t);if(null===c?a=i:c.next=s,!nO(i,e.memoizedState)&&(aw=!0,d&&null!==(n=r6)))throw n;e.memoizedState=i,e.baseState=a,e.baseQueue=c,r.lastRenderedState=i}return null===o&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ih(e){var t=ii(),n=t.queue;if(null===n)throw Error(l(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);nO(i,t.memoizedState)||(aw=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function im(e,t,n){var r=oG,o=ii(),i=rN;if(i){if(void 0===n)throw Error(l(407));n=n()}else n=t();var a=!nO((oZ||o).memoizedState,n);if(a&&(o.memoizedState=n,aw=!0),o=o.queue,iU(iy.bind(null,r,o,e),[e]),o.getSnapshot!==t||a||null!==oY&&1&oY.memoizedState.tag){if(r.flags|=2048,iR(9,{destroy:void 0},ig.bind(null,r,o,n,t),null),null===lD)throw Error(l(349));i||0!=(127&oW)||iv(r,t,n)}return n}function iv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=oG.updateQueue)?(t=ia(),oG.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function ig(e,t,n,r){t.value=n,t.getSnapshot=r,ib(t)&&ix(e)}function iy(e,t,n){return n(function(){ib(t)&&ix(e)})}function ib(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nO(e,n)}catch(e){return!0}}function ix(e){var t=n5(e,2);null!==t&&sl(t,e,2)}function iw(e){var t=io();if("function"==typeof e){var n=e;if(e=n(),oQ){eh(!0);try{n()}finally{eh(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:e},t}function ik(e,t,n,r){return e.baseState=n,ip(e,oZ,"function"==typeof r?r:iu)}function ij(e,t,n,r,o){if(ae(e))throw Error(l(485));if(null!==(e=t.action)){var i={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){i.listeners.push(e)}};null!==_.T?n(!0):i.isTransition=!1,r(i),null===(n=t.pending)?(i.next=t.pending=i,iS(t,i)):(i.next=n.next,t.pending=n.next=i)}}function iS(e,t){var n=t.action,r=t.payload,o=e.state;if(t.isTransition){var i=_.T,a={};_.T=a;try{var l=n(o,r),s=_.S;null!==s&&s(a,l),iO(e,t,l)}catch(n){iN(e,t,n)}finally{null!==i&&null!==a.types&&(i.types=a.types),_.T=i}}else try{i=n(o,r),iO(e,t,i)}catch(n){iN(e,t,n)}}function iO(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){iC(e,t,n)},function(n){return iN(e,t,n)}):iC(e,t,n)}function iC(e,t,n){t.status="fulfilled",t.value=n,iP(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,iS(e,n)))}function iN(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do t.status="rejected",t.reason=n,iP(t),t=t.next;while(t!==r)}e.action=null}function iP(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function iE(e,t){return t}function iI(e,t){if(rN){var n=lD.formState;if(null!==n){e:{var r=oG;if(rN){if(rC){t:{for(var o=rC,i=rE;8!==o.nodeType;)if(!i||null===(o=cM(o.nextSibling))){o=null;break t}o="F!"===(i=o.data)||"F"===i?o:null}if(o){rC=cM(o.nextSibling),r="F!"===o.data;break e}}rA(r)}r=!1}r&&(t=n[0])}}return(n=io()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iE,lastRenderedState:t},n.queue=r,n=i8.bind(null,oG,r),r.dispatch=n,r=iw(!1),i=i7.bind(null,oG,!1,r.queue),r=io(),o={state:t,dispatch:null,action:e,pending:null},r.queue=o,n=ij.bind(null,oG,o,i,n),o.dispatch=n,r.memoizedState=e,[t,n,!1]}function iA(e){return i_(ii(),oZ,e)}function i_(e,t,n){if(t=ip(e,t,iE)[0],e=id(iu)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var r=il(t)}catch(e){if(e===or)throw oi;throw e}else r=t;var o=(t=ii()).queue,i=o.dispatch;return n!==t.memoizedState&&(oG.flags|=2048,iR(9,{destroy:void 0},iM.bind(null,o,n),null)),[r,i,e]}function iM(e,t){e.action=t}function iT(e){var t=ii(),n=oZ;if(null!==n)return i_(t,n,e);ii(),t=t.memoizedState;var r=(n=ii()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function iR(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=oG.updateQueue)&&(t=ia(),oG.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function iz(){return ii().memoizedState}function iD(e,t,n,r){var o=io();oG.flags|=e,o.memoizedState=iR(1|t,{destroy:void 0},n,void 0===r?null:r)}function iL(e,t,n,r){var o=ii();r=void 0===r?null:r;var i=o.memoizedState.inst;null!==oZ&&null!==r&&o5(r,oZ.memoizedState.deps)?o.memoizedState=iR(t,i,n,r):(oG.flags|=e,o.memoizedState=iR(1|t,i,n,r))}function iF(e,t){iD(8390656,8,e,t)}function iU(e,t){iL(2048,8,e,t)}function iH(e){var t=ii().memoizedState,n={ref:t,nextImpl:e};oG.flags|=4;var r=oG.updateQueue;if(null===r)r=ia(),oG.updateQueue=r,r.events=[n];else{var o=r.events;null===o?r.events=[n]:o.push(n)}return function(){if(0!=(2&lz))throw Error(l(440));return t.impl.apply(void 0,arguments)}}function i$(e,t){return iL(4,2,e,t)}function iB(e,t){return iL(4,4,e,t)}function iK(e,t){if("function"==typeof t){var n=t(e=e());return function(){"function"==typeof n?n():t(null)}}if(null!=t)return t.current=e=e(),function(){t.current=null}}function iq(e,t,n){n=null!=n?n.concat([e]):null,iL(4,4,iK.bind(null,t,e),n)}function iV(){}function iW(e,t){var n=ii();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&o5(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function iG(e,t){var n=ii();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&o5(t,r[1]))return r[0];if(r=e(),oQ){eh(!0);try{e()}finally{eh(!1)}}return n.memoizedState=[r,t],r}function iZ(e,t,n){return void 0===n||0!=(0x40000000&oW)&&0==(261930&lF)?e.memoizedState=t:(e.memoizedState=n,e=sa(),oG.lanes|=e,lW|=e,n)}function iY(e,t,n,r){return nO(n,t)?n:null!==oM.current?(nO(e=iZ(e,n,r),t)||(aw=!0),e):0==(42&oW)||0!=(0x40000000&oW)&&0==(261930&lF)?(aw=!0,e.memoizedState=n):(e=sa(),oG.lanes|=e,lW|=e,t)}function iX(e,t,n,r,o){var i=M.p;M.p=0!==i&&8>i?i:8;var a=_.T,l={};_.T=l,i7(e,!1,t,n);try{var s=o(),c=_.S;if(null!==c&&c(l,s),null!==s&&"object"==typeof s&&"function"==typeof s.then){var u,d,f=(u=[],d={status:"pending",value:null,reason:null,then:function(e){u.push(e)}},s.then(function(){d.status="fulfilled",d.value=r;for(var e=0;e<u.length;e++)(0,u[e])(r)},function(e){for(d.status="rejected",d.reason=e,e=0;e<u.length;e++)(0,u[e])(void 0)}),d);i9(e,t,f,si(e))}else i9(e,t,r,si(e))}catch(n){i9(e,t,{then:function(){},status:"rejected",reason:n},si())}finally{M.p=i,null!==a&&null!==l.types&&(a.types=l.types),_.T=a}}function iJ(){}function iQ(e,t,n,r){if(5!==e.tag)throw Error(l(476));var o=i0(e).queue;iX(e,o,t,T,null===n?iJ:function(){return i1(e),n(r)})}function i0(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:T,baseState:T,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:T},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function i1(e){var t=i0(e);null===t.next&&(t=e.alternate.memoizedState),i9(e,t.next.queue,{},si())}function i2(){return rG(ue)}function i3(){return ii().memoizedState}function i4(){return ii().memoizedState}function i5(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=si(),r=oO(t,e=oS(n),n);null!==r&&(sl(r,t,n),oC(r,t,n)),t={cache:r1()},e.payload=t;return}t=t.return}}function i6(e,t,n){var r=si();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ae(e)?at(t,n):null!==(n=n4(e,t,n,r))&&(sl(n,e,r),an(n,t,r))}function i8(e,t,n){i9(e,t,n,si())}function i9(e,t,n,r){var o={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ae(e))at(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,nO(l,a))return n3(e,t,o,0),null===lD&&n2(),!1}catch(e){}finally{}if(null!==(n=n4(e,t,o,r)))return sl(n,e,r),an(n,t,r),!0}return!1}function i7(e,t,n,r){if(r={lane:2,revertLane:sJ(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ae(e)){if(t)throw Error(l(479))}else null!==(t=n4(e,n,r,2))&&sl(t,e,2)}function ae(e){var t=e.alternate;return e===oG||null!==t&&t===oG}function at(e,t){oJ=oX=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function an(e,t,n){if(0!=(4194048&n)){var r=t.lanes;r&=e.pendingLanes,t.lanes=n|=r,eP(e,n)}}var ar={readContext:rG,use:is,useCallback:o4,useContext:o4,useEffect:o4,useImperativeHandle:o4,useLayoutEffect:o4,useInsertionEffect:o4,useMemo:o4,useReducer:o4,useRef:o4,useState:o4,useDebugValue:o4,useDeferredValue:o4,useTransition:o4,useSyncExternalStore:o4,useId:o4,useHostTransitionStatus:o4,useFormState:o4,useActionState:o4,useOptimistic:o4,useMemoCache:o4,useCacheRefresh:o4};ar.useEffectEvent=o4;var ao={readContext:rG,use:is,useCallback:function(e,t){return io().memoizedState=[e,void 0===t?null:t],e},useContext:rG,useEffect:iF,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,iD(4194308,4,iK.bind(null,t,e),n)},useLayoutEffect:function(e,t){return iD(4194308,4,e,t)},useInsertionEffect:function(e,t){iD(4,2,e,t)},useMemo:function(e,t){var n=io();t=void 0===t?null:t;var r=e();if(oQ){eh(!0);try{e()}finally{eh(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=io();if(void 0!==n){var o=n(t);if(oQ){eh(!0);try{n(t)}finally{eh(!1)}}}else o=t;return r.memoizedState=r.baseState=o,r.queue=e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},e=e.dispatch=i6.bind(null,oG,e),[r.memoizedState,e]},useRef:function(e){return io().memoizedState={current:e}},useState:function(e){var t=(e=iw(e)).queue,n=i8.bind(null,oG,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:iV,useDeferredValue:function(e,t){return iZ(io(),e,t)},useTransition:function(){var e=iw(!1);return e=iX.bind(null,oG,e.queue,!0,!1),io().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oG,o=io();if(rN){if(void 0===n)throw Error(l(407));n=n()}else{if(n=t(),null===lD)throw Error(l(349));0!=(127&lF)||iv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,iF(iy.bind(null,r,i,e),[e]),r.flags|=2048,iR(9,{destroy:void 0},ig.bind(null,r,i,n,t),null),n},useId:function(){var e=io(),t=lD.identifierPrefix;if(rN){var n=rb,r=ry;t="_"+t+"R_"+(n=(r&~(1<<32-em(r)-1)).toString(32)+n),0<(n=o0++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=o3++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:i2,useFormState:iI,useActionState:iI,useOptimistic:function(e){var t=io();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=i7.bind(null,oG,!0,n),n.dispatch=t,[e,t]},useMemoCache:ic,useCacheRefresh:function(){return io().memoizedState=i5.bind(null,oG)},useEffectEvent:function(e){var t=io(),n={impl:e};return t.memoizedState=n,function(){if(0!=(2&lz))throw Error(l(440));return n.impl.apply(void 0,arguments)}}},ai={readContext:rG,use:is,useCallback:iW,useContext:rG,useEffect:iU,useImperativeHandle:iq,useInsertionEffect:i$,useLayoutEffect:iB,useMemo:iG,useReducer:id,useRef:iz,useState:function(){return id(iu)},useDebugValue:iV,useDeferredValue:function(e,t){return iY(ii(),oZ.memoizedState,e,t)},useTransition:function(){var e=id(iu)[0],t=ii().memoizedState;return["boolean"==typeof e?e:il(e),t]},useSyncExternalStore:im,useId:i3,useHostTransitionStatus:i2,useFormState:iA,useActionState:iA,useOptimistic:function(e,t){return ik(ii(),oZ,e,t)},useMemoCache:ic,useCacheRefresh:i4};ai.useEffectEvent=iH;var aa={readContext:rG,use:is,useCallback:iW,useContext:rG,useEffect:iU,useImperativeHandle:iq,useInsertionEffect:i$,useLayoutEffect:iB,useMemo:iG,useReducer:ih,useRef:iz,useState:function(){return ih(iu)},useDebugValue:iV,useDeferredValue:function(e,t){var n=ii();return null===oZ?iZ(n,e,t):iY(n,oZ.memoizedState,e,t)},useTransition:function(){var e=ih(iu)[0],t=ii().memoizedState;return["boolean"==typeof e?e:il(e),t]},useSyncExternalStore:im,useId:i3,useHostTransitionStatus:i2,useFormState:iT,useActionState:iT,useOptimistic:function(e,t){var n=ii();return null!==oZ?ik(n,oZ,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ic,useCacheRefresh:i4};function al(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:f({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}aa.useEffectEvent=iH;var as={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=si(),o=oS(r);o.payload=t,null!=n&&(o.callback=n),null!==(t=oO(e,o,r))&&(sl(t,e,r),oC(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=si(),o=oS(r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=oO(e,o,r))&&(sl(t,e,r),oC(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=si(),r=oS(n);r.tag=2,null!=t&&(r.callback=t),null!==(t=oO(e,r,n))&&(sl(t,e,n),oC(t,e,n))}};function ac(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||!nC(n,r)||!nC(o,i)}function au(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&as.enqueueReplaceState(t,t.state,null)}function ad(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var o in n===t&&(n=f({},n)),e)void 0===n[o]&&(n[o]=e[o]);return n}function af(e){nJ(e)}function ap(e){console.error(e)}function ah(e){nJ(e)}function am(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function av(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ag(e,t,n){return(n=oS(n)).tag=3,n.payload={element:null},n.callback=function(){am(e,t)},n}function ay(e){return(e=oS(e)).tag=3,e}function ab(e,t,n,r){var o=n.type.getDerivedStateFromError;if("function"==typeof o){var i=r.value;e.payload=function(){return o(i)},e.callback=function(){av(t,n,r)}}var a=n.stateNode;null!==a&&"function"==typeof a.componentDidCatch&&(e.callback=function(){av(t,n,r),"function"!=typeof o&&(null===l5?l5=new Set([this]):l5.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var ax=Error(l(461)),aw=!1;function ak(e,t,n,r){t.child=null===e?ox(t,null,n,r):ob(t,e.child,n,r)}function aj(e,t,n,r,o){n=n.render;var i=t.ref;if("ref"in r){var a={};for(var l in r)"ref"!==l&&(a[l]=r[l])}else a=r;return(rW(t),r=o6(e,t,n,a,i,o),l=ie(),null===e||aw)?(rN&&l&&rk(t),t.flags|=1,ak(e,t,r,o),t.child):(it(e,t,o),aV(e,t,o))}function aS(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||rt(i)||void 0!==i.defaultProps||null!==n.compare?((e=ro(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,aO(e,t,i,r,o))}if(i=e.child,!aW(e,o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:nC)(a,r)&&e.ref===t.ref)return aV(e,t,o)}return t.flags|=1,(e=rn(i,r)).ref=t.ref,e.return=t,t.child=e}function aO(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(nC(i,r)&&e.ref===t.ref)if(aw=!1,t.pendingProps=r=i,!aW(e,o))return t.lanes=e.lanes,aV(e,t,o);else 0!=(131072&e.flags)&&(aw=!0)}return a_(e,t,n,r,o)}function aC(e,t,n,r){var o=r.children,i=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===r.mode){if(0!=(128&t.flags)){if(i=null!==i?i.baseLanes|n:n,null!==e){for(o=0,r=t.child=e.child;null!==r;)o=o|r.lanes|r.childLanes,r=r.sibling;r=o&~i}else r=0,t.child=null;return aP(e,t,i,n,r)}if(0==(0x20000000&n))return r=t.lanes=0x20000000,aP(e,t,null!==i?i.baseLanes|n:n,n,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&ot(t,null!==i?i.cachePool:null),null!==i?oR(t,i):oz(),o$(t)}else null!==i?(ot(t,i.cachePool),oR(t,i),oB(t),t.memoizedState=null):(null!==e&&ot(t,null),oz(),oB(t));return ak(e,t,o,n),t.child}function aN(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function aP(e,t,n,r,o){var i=oe();return t.memoizedState={baseLanes:n,cachePool:i=null===i?null:{parent:r0._currentValue,pool:i}},null!==e&&ot(t,null),oz(),o$(t),null!==e&&rq(e,t,r,!0),t.childLanes=o,null}function aE(e,t){return(t=aH({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function aI(e,t,n){return ob(t,e.child,null,n),e=aE(t,t.pendingProps),e.flags|=2,oK(t),t.memoizedState=null,e}function aA(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(l(284));(null===e||e.ref!==n)&&(t.flags|=4194816)}}function a_(e,t,n,r,o){return(rW(t),n=o6(e,t,n,r,void 0,o),r=ie(),null===e||aw)?(rN&&r&&rk(t),t.flags|=1,ak(e,t,n,o),t.child):(it(e,t,o),aV(e,t,o))}function aM(e,t,n,r,o,i){return(rW(t),t.updateQueue=null,n=o9(t,r,n,o),o8(e),r=ie(),null===e||aw)?(rN&&r&&rk(t),t.flags|=1,ak(e,t,n,i),t.child):(it(e,t,i),aV(e,t,i))}function aT(e,t,n,r,o){if(rW(t),null===t.stateNode){var i=n9,a=n.contextType;"object"==typeof a&&null!==a&&(i=rG(a)),t.memoizedState=null!==(i=new n(r,i)).state&&void 0!==i.state?i.state:null,i.updater=as,t.stateNode=i,i._reactInternals=t,(i=t.stateNode).props=r,i.state=t.memoizedState,i.refs={},ok(t),a=n.contextType,i.context="object"==typeof a&&null!==a?rG(a):n9,i.state=t.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(al(t,n,a,r),i.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(a=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),a!==i.state&&as.enqueueReplaceState(i,i.state,null),oI(t,r,i,o),oE(),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){i=t.stateNode;var l=t.memoizedProps,s=ad(n,l);i.props=s;var c=i.context,u=n.contextType;a=n9,"object"==typeof u&&null!==u&&(a=rG(u));var d=n.getDerivedStateFromProps;u="function"==typeof d||"function"==typeof i.getSnapshotBeforeUpdate,l=t.pendingProps!==l,u||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(l||c!==a)&&au(t,i,r,a),ow=!1;var f=t.memoizedState;i.state=f,oI(t,r,i,o),oE(),c=t.memoizedState,l||f!==c||ow?("function"==typeof d&&(al(t,n,d,r),c=t.memoizedState),(s=ow||ac(t,n,s,r,f,c,a))?(u||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),i.props=r,i.state=c,i.context=a,r=s):("function"==typeof i.componentDidMount&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,oj(e,t),u=ad(n,a=t.memoizedProps),i.props=u,d=t.pendingProps,f=i.context,c=n.contextType,s=n9,"object"==typeof c&&null!==c&&(s=rG(c)),(c="function"==typeof(l=n.getDerivedStateFromProps)||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(a!==d||f!==s)&&au(t,i,r,s),ow=!1,f=t.memoizedState,i.state=f,oI(t,r,i,o),oE();var p=t.memoizedState;a!==d||f!==p||ow||null!==e&&null!==e.dependencies&&rV(e.dependencies)?("function"==typeof l&&(al(t,n,l,r),p=t.memoizedState),(u=ow||ac(t,n,u,r,f,p,s)||null!==e&&null!==e.dependencies&&rV(e.dependencies))?(c||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(r,p,s),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(r,p,s)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=s,r=u):("function"!=typeof i.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return i=r,aA(e,t),r=0!=(128&t.flags),i||r?(i=t.stateNode,n=r&&"function"!=typeof n.getDerivedStateFromError?null:i.render(),t.flags|=1,null!==e&&r?(t.child=ob(t,e.child,null,o),t.child=ob(t,null,n,o)):ak(e,t,n,o),t.memoizedState=i.state,e=t.child):e=aV(e,t,o),e}function aR(e,t,n,r){return rR(),t.flags|=256,ak(e,t,n,r),t.child}var az={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function aD(e){return{baseLanes:e,cachePool:on()}}function aL(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=lY),e}function aF(e,t,n){var r,o=t.pendingProps,i=!1,a=0!=(128&t.flags);if((r=a)||(r=(null===e||null!==e.memoizedState)&&0!=(2&oq.current)),r&&(i=!0,t.flags&=-129),r=0!=(32&t.flags),t.flags&=-33,null===e){if(rN){if(i?oU(t):oB(t),(e=rC)?null!==(e=null!==(e=cI(e,rE))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==rg?{id:ry,overflow:rb}:null,retryLane:0x20000000,hydrationErrors:null},(n=rl(e)).return=t,t.child=n,rO=t,rC=null):e=null,null===e)throw rA(t);return c_(e)?t.lanes=32:t.lanes=0x20000000,null}var s=o.children;return(o=o.fallback,i)?(oB(t),s=aH({mode:"hidden",children:s},i=t.mode),o=ri(o,i,n,null),s.return=t,o.return=t,s.sibling=o,t.child=s,(o=t.child).memoizedState=aD(n),o.childLanes=aL(e,r,n),t.memoizedState=az,aN(null,o)):(oU(t),aU(t,s))}var c=e.memoizedState;if(null!==c&&null!==(s=c.dehydrated)){if(a)256&t.flags?(oU(t),t.flags&=-257,t=a$(e,t,n)):null!==t.memoizedState?(oB(t),t.child=e.child,t.flags|=128,t=null):(oB(t),s=o.fallback,i=t.mode,o=aH({mode:"visible",children:o.children},i),s=ri(s,i,n,null),s.flags|=2,o.return=t,s.return=t,o.sibling=s,t.child=o,ob(t,e.child,null,n),(o=t.child).memoizedState=aD(n),o.childLanes=aL(e,r,n),t.memoizedState=az,t=aN(null,o));else if(oU(t),c_(s)){if(r=s.nextSibling&&s.nextSibling.dataset)var u=r.dgst;r=u,(o=Error(l(419))).stack="",o.digest=r,rD({value:o,source:null,stack:null}),t=a$(e,t,n)}else if(aw||rq(e,t,n,!1),r=0!=(n&e.childLanes),aw||r){if(null!==(r=lD)&&0!==(o=eE(r,n))&&o!==c.retryLane)throw c.retryLane=o,n5(e,o),sl(r,e,o),ax;cA(s)||sy(),t=a$(e,t,n)}else cA(s)?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,rC=cM(s.nextSibling),rO=t,rN=!0,rP=null,rE=!1,null!==e&&rS(t,e),t=aU(t,o.children),t.flags|=4096);return t}return i?(oB(t),s=o.fallback,i=t.mode,u=(c=e.child).sibling,(o=rn(c,{mode:"hidden",children:o.children})).subtreeFlags=0x3e00000&c.subtreeFlags,null!==u?s=rn(u,s):(s=ri(s,i,n,null),s.flags|=2),s.return=t,o.return=t,o.sibling=s,t.child=o,aN(null,o),o=t.child,null===(s=e.child.memoizedState)?s=aD(n):(null!==(i=s.cachePool)?(c=r0._currentValue,i=i.parent!==c?{parent:c,pool:c}:i):i=on(),s={baseLanes:s.baseLanes|n,cachePool:i}),o.memoizedState=s,o.childLanes=aL(e,r,n),t.memoizedState=az,aN(e.child,o)):(oU(t),e=(n=e.child).sibling,(n=rn(n,{mode:"visible",children:o.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function aU(e,t){return(t=aH({mode:"visible",children:t},e.mode)).return=e,e.child=t}function aH(e,t){return(e=re(22,e,null,t)).lanes=0,e}function a$(e,t,n){return ob(t,e.child,null,n),e=aU(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aB(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),rB(e.return,t,n)}function aK(e,t,n,r,o,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o,treeForkCount:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=o,a.treeForkCount=i)}function aq(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;r=r.children;var a=oq.current,l=0!=(2&a);if(l?(a=1&a|2,t.flags|=128):a&=1,F(oq,a),ak(e,t,r,n),r=rN?rh:0,!l&&null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&aB(e,n,t);else if(19===e.tag)aB(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(o=null,n=t.child;null!==n;)null!==(e=n.alternate)&&null===oV(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),aK(t,!1,o,n,i,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===oV(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}aK(t,!0,n,null,i,r);break;case"together":aK(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function aV(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),lW|=t.lanes,0==(n&t.childLanes)){if(null===e)return null;else if(rq(e,t,n,!1),0==(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(l(153));if(null!==t.child){for(n=rn(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=rn(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function aW(e,t){return 0!=(e.lanes&t)||!!(null!==(e=e.dependencies)&&rV(e))}function aG(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)aw=!0;else{if(!aW(e,n)&&0==(128&t.flags))return aw=!1,function(e,t,n){switch(t.tag){case 3:K(t,t.stateNode.containerInfo),rH(t,r0,e.memoizedState.cache),rR();break;case 27:case 5:V(t);break;case 4:K(t,t.stateNode.containerInfo);break;case 10:rH(t,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,oH(t),null;break;case 13:var r=t.memoizedState;if(null!==r){if(null!==r.dehydrated)return oU(t),t.flags|=128,null;if(0!=(n&t.child.childLanes))return aF(e,t,n);return oU(t),null!==(e=aV(e,t,n))?e.sibling:null}oU(t);break;case 19:var o=0!=(128&e.flags);if((r=0!=(n&t.childLanes))||(rq(e,t,n,!1),r=0!=(n&t.childLanes)),o){if(r)return aq(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),F(oq,oq.current),!r)return null;break;case 22:return t.lanes=0,aC(e,t,n,t.pendingProps);case 24:rH(t,r0,e.memoizedState.cache)}return aV(e,t,n)}(e,t,n);aw=0!=(131072&e.flags)}else aw=!1,rN&&0!=(1048576&t.flags)&&rw(t,rh,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=oc(t.elementType),t.type=e,"function"==typeof e)rt(e)?(r=ad(e,r),t.tag=1,t=aT(null,t,e,r,n)):(t.tag=0,t=a_(null,t,e,r,n));else{if(null!=e){var o=e.$$typeof;if(o===w){t.tag=11,t=aj(null,t,e,r,n);break e}if(o===S){t.tag=14,t=aS(null,t,e,r,n);break e}}throw Error(l(306,t=function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===I?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case v:return"Fragment";case y:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList";case C:return"Activity"}if("object"==typeof t)switch(t.$$typeof){case m:return"Portal";case x:return t.displayName||"Context";case b:return(t._context.displayName||"Context")+".Consumer";case w:var n=t.render;return(t=t.displayName)||(t=""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case S:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case O:n=t._payload,t=t._init;try{return e(t(n))}catch(e){}}return null}(e)||e,""))}}return t;case 0:return a_(e,t,t.type,t.pendingProps,n);case 1:return o=ad(r=t.type,t.pendingProps),aT(e,t,r,o,n);case 3:e:{if(K(t,t.stateNode.containerInfo),null===e)throw Error(l(387));r=t.pendingProps;var i=t.memoizedState;o=i.element,oj(e,t),oI(t,r,null,n);var a=t.memoizedState;if(rH(t,r0,r=a.cache),r!==i.cache&&rK(t,[r0],n,!0),oE(),r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=aR(e,t,r,n);break e}else if(r!==o){rD(o=ru(Error(l(424)),t)),t=aR(e,t,r,n);break e}else for(rC=cM((e=9===(e=t.stateNode.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e).firstChild),rO=t,rN=!0,rP=null,rE=!0,n=ox(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling;else{if(rR(),r===o){t=aV(e,t,n);break e}ak(e,t,r,n)}t=t.child}return t;case 26:return aA(e,t),null===e?(n=cq(t.type,null,t.pendingProps,null))?t.memoizedState=n:rN||(n=t.type,e=t.pendingProps,(r=cv($.current).createElement(n))[eR]=t,r[ez]=e,cf(r,n,e),eG(r),t.stateNode=r):t.memoizedState=cq(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return V(t),null===e&&rN&&(r=t.stateNode=cD(t.type,t.pendingProps,$.current),rO=t,rE=!0,o=rC,cC(t.type)?(cT=o,rC=cM(r.firstChild)):rC=o),ak(e,t,t.pendingProps.children,n),aA(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&rN&&((o=r=rC)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[e$])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence")||o!==n.rel||e.getAttribute("href")!==(null==n.href||""===n.href?null:n.href)||e.getAttribute("crossorigin")!==(null==n.crossOrigin?null:n.crossOrigin)||e.getAttribute("title")!==(null==n.title?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==n.src?null:n.src)||e.getAttribute("type")!==(null==n.type?null:n.type)||e.getAttribute("crossorigin")!==(null==n.crossOrigin?null:n.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==n.name?null:""+n.name;if("hidden"===n.type&&e.getAttribute("name")===o)return e}if(null===(e=cM(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,rE))?(t.stateNode=r,rO=t,rC=cM(r.firstChild),rE=!1,o=!0):o=!1),o||rA(t)),V(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,r=i.children,cb(o,i)?r=null:null!==a&&cb(o,a)&&(t.flags|=32),null!==t.memoizedState&&(ue._currentValue=o=o6(e,t,o7,null,null,n)),aA(e,t),ak(e,t,r,n),t.child;case 6:return null===e&&rN&&((e=n=rC)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;)if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n||null===(e=cM(e.nextSibling)))return null;return e}(n,t.pendingProps,rE))?(t.stateNode=n,rO=t,rC=null,e=!0):e=!1),e||rA(t)),null;case 13:return aF(e,t,n);case 4:return K(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ob(t,null,r,n):ak(e,t,r,n),t.child;case 11:return aj(e,t,t.type,t.pendingProps,n);case 7:return ak(e,t,t.pendingProps,n),t.child;case 8:case 12:return ak(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,rH(t,t.type,r.value),ak(e,t,r.children,n),t.child;case 9:return o=t.type._context,r=t.pendingProps.children,rW(t),r=r(o=rG(o)),t.flags|=1,ak(e,t,r,n),t.child;case 14:return aS(e,t,t.type,t.pendingProps,n);case 15:return aO(e,t,t.type,t.pendingProps,n);case 19:return aq(e,t,n);case 31:var s=e,c=t,u=n,d=c.pendingProps,f=0!=(128&c.flags);if(c.flags&=-129,null===s){if(rN){if("hidden"===d.mode)return s=aE(c,d),c.lanes=0x20000000,aN(null,s);if(oH(c),(s=rC)?null!==(s=null!==(s=cI(s,rE))&&"&"===s.data?s:null)&&(c.memoizedState={dehydrated:s,treeContext:null!==rg?{id:ry,overflow:rb}:null,retryLane:0x20000000,hydrationErrors:null},(u=rl(s)).return=c,c.child=u,rO=c,rC=null):s=null,null===s)throw rA(c);return c.lanes=0x20000000,null}return aE(c,d)}var p=s.memoizedState;if(null!==p){var h=p.dehydrated;if(oH(c),f)if(256&c.flags)c.flags&=-257,c=aI(s,c,u);else if(null!==c.memoizedState)c.child=s.child,c.flags|=128,c=null;else throw Error(l(558));else if(aw||rq(s,c,u,!1),f=0!=(u&s.childLanes),aw||f){if(null!==(d=lD)&&0!==(h=eE(d,u))&&h!==p.retryLane)throw p.retryLane=h,n5(s,h),sl(d,s,h),ax;sy(),c=aI(s,c,u)}else s=p.treeContext,rC=cM(h.nextSibling),rO=c,rN=!0,rP=null,rE=!1,null!==s&&rS(c,s),c=aE(c,d),c.flags|=4096;return c}return(s=rn(s.child,{mode:d.mode,children:d.children})).ref=c.ref,c.child=s,s.return=c,s;case 22:return aC(e,t,n,t.pendingProps);case 24:return rW(t),r=rG(r0),null===e?(null===(o=oe())&&(o=lD,i=r1(),o.pooledCache=i,i.refCount++,null!==i&&(o.pooledCacheLanes|=n),o=i),t.memoizedState={parent:r,cache:o},ok(t),rH(t,r0,o)):(0!=(e.lanes&n)&&(oj(e,t),oI(t,null,null,n),oE()),o=e.memoizedState,i=t.memoizedState,o.parent!==r?(o={parent:r,cache:r},t.memoizedState=o,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=o),rH(t,r0,r)):(rH(t,r0,r=i.cache),r!==o.cache&&rK(t,[r0],n,!0))),ak(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function aZ(e){e.flags|=4}function aY(e,t,n,r,o){if((t=0!=(32&e.mode))&&(t=!1),t){if(e.flags|=0x1000000,(0x13ffff40&o)===o)if(e.stateNode.complete)e.flags|=8192;else if(sm())e.flags|=8192;else throw ou=oa,oo}else e.flags&=-0x1000001}function aX(e,t){if("stylesheet"!==t.type||0!=(4&t.state.loading))e.flags&=-0x1000001;else if(e.flags|=0x1000000,!c4(t))if(sm())e.flags|=8192;else throw ou=oa,oo}function aJ(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?eS():0x20000000,e.lanes|=t,lX|=t)}function aQ(e,t){if(!rN)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function a0(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=0x3e00000&o.subtreeFlags,r|=0x3e00000&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function a1(e,t){switch(rj(t),t.tag){case 3:r$(r0),q();break;case 26:case 27:case 5:W(t);break;case 4:q();break;case 31:null!==t.memoizedState&&oK(t);break;case 13:oK(t);break;case 19:L(oq);break;case 10:r$(t.type);break;case 22:case 23:oK(t),oD(),null!==e&&L(r7);break;case 24:r$(r0)}}function a2(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var o=r.next;n=o;do{if((n.tag&e)===e){r=void 0;var i=n.create;n.inst.destroy=r=i()}n=n.next}while(n!==o)}}catch(e){sM(t,t.return,e)}}function a3(e,t,n){try{var r=t.updateQueue,o=null!==r?r.lastEffect:null;if(null!==o){var i=o.next;r=i;do{if((r.tag&e)===e){var a=r.inst,l=a.destroy;if(void 0!==l){a.destroy=void 0,o=t;try{l()}catch(e){sM(o,n,e)}}}r=r.next}while(r!==i)}}catch(e){sM(t,t.return,e)}}function a4(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{o_(t,n)}catch(t){sM(e,e.return,t)}}}function a5(e,t,n){n.props=ad(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){sM(e,t,n)}}function a6(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"==typeof n?e.refCleanup=n(r):n.current=r}}catch(n){sM(e,t,n)}}function a8(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"==typeof r)try{r()}catch(n){sM(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){sM(e,t,n)}else n.current=null}function a9(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){sM(e,e.return,t)}}function a7(e,t,n){try{var r=e.stateNode;(function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,i=null,a=null,s=null,c=null,u=null,d=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&null!=f)switch(h){case"checked":case"value":break;case"defaultValue":c=f;default:r.hasOwnProperty(h)||cu(e,t,h,null,r,f)}}for(var p in r){var h=r[p];if(f=n[p],r.hasOwnProperty(p)&&(null!=h||null!=f))switch(p){case"type":i=h;break;case"name":o=h;break;case"checked":u=h;break;case"defaultChecked":d=h;break;case"value":a=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(l(137,t));break;default:h!==f&&cu(e,t,p,h,r,f)}}tn(e,a,s,c,u,d,i,o);return;case"select":for(i in h=a=s=p=null,n)if(c=n[i],n.hasOwnProperty(i)&&null!=c)switch(i){case"value":break;case"multiple":h=c;default:r.hasOwnProperty(i)||cu(e,t,i,null,r,c)}for(o in r)if(i=r[o],c=n[o],r.hasOwnProperty(o)&&(null!=i||null!=c))switch(o){case"value":p=i;break;case"defaultValue":s=i;break;case"multiple":a=i;default:i!==c&&cu(e,t,o,i,r,c)}t=s,n=a,r=h,null!=p?ti(e,!!n,p,!1):!!r!=!!n&&(null!=t?ti(e,!!n,t,!0):ti(e,!!n,n?[]:"",!1));return;case"textarea":for(s in h=p=null,n)if(o=n[s],n.hasOwnProperty(s)&&null!=o&&!r.hasOwnProperty(s))switch(s){case"value":case"children":break;default:cu(e,t,s,null,r,o)}for(a in r)if(o=r[a],i=n[a],r.hasOwnProperty(a)&&(null!=o||null!=i))switch(a){case"value":p=o;break;case"defaultValue":h=o;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=o)throw Error(l(91));break;default:o!==i&&cu(e,t,a,o,r,i)}ta(e,p,h);return;case"option":for(var m in n)p=n[m],n.hasOwnProperty(m)&&null!=p&&!r.hasOwnProperty(m)&&("selected"===m?e.selected=!1:cu(e,t,m,null,r,p));for(c in r)p=r[c],h=n[c],r.hasOwnProperty(c)&&p!==h&&(null!=p||null!=h)&&("selected"===c?e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p:cu(e,t,c,p,r,h));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 v in n)p=n[v],n.hasOwnProperty(v)&&null!=p&&!r.hasOwnProperty(v)&&cu(e,t,v,null,r,p);for(u in r)if(p=r[u],h=n[u],r.hasOwnProperty(u)&&p!==h&&(null!=p||null!=h))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(l(137,t));break;default:cu(e,t,u,p,r,h)}return;default:if(tf(t)){for(var g in n)p=n[g],n.hasOwnProperty(g)&&void 0!==p&&!r.hasOwnProperty(g)&&cd(e,t,g,void 0,r,p);for(d in r)p=r[d],h=n[d],r.hasOwnProperty(d)&&p!==h&&(void 0!==p||void 0!==h)&&cd(e,t,d,p,r,h);return}}for(var y in n)p=n[y],n.hasOwnProperty(y)&&null!=p&&!r.hasOwnProperty(y)&&cu(e,t,y,null,r,p);for(f in r)p=r[f],h=n[f],r.hasOwnProperty(f)&&p!==h&&(null!=p||null!=h)&&cu(e,t,f,p,r,h)})(r,e.type,n,t),r[ez]=t}catch(t){sM(e,e.return,t)}}function le(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&cC(e.type)||4===e.tag}function lt(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||le(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&cC(e.type)||2&e.flags||null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ln(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&cC(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(ln(e,t,n),e=e.sibling;null!==e;)ln(e,t,n),e=e.sibling}function lr(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);cf(t,r,n),t[eR]=e,t[ez]=n}catch(t){sM(e,e.return,t)}}var lo=!1,li=!1,la=!1,ll="function"==typeof WeakSet?WeakSet:Set,ls=null;function lc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:lw(e,n),4&r&&a2(5,n);break;case 1:if(lw(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){sM(n,n.return,e)}else{var o=ad(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){sM(n,n.return,e)}}64&r&&a4(n),512&r&&a6(n,n.return);break;case 3:if(lw(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{o_(e,t)}catch(e){sM(n,n.return,e)}}break;case 27:null===t&&4&r&&lr(n);case 26:case 5:lw(e,n),null===t&&4&r&&a9(n),512&r&&a6(n,n.return);break;case 12:default:lw(e,n);break;case 31:lw(e,n),4&r&&lh(e,n);break;case 13:lw(e,n),4&r&&lm(e,n),64&r&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=sD.bind(null,n));break;case 22:if(!(r=null!==n.memoizedState||lo)){t=null!==t&&null!==t.memoizedState||li,o=lo;var i=li;lo=r,(li=t)&&!i?function e(t,n,r){for(r=r&&0!=(8772&n.subtreeFlags),n=n.child;null!==n;){var o=n.alternate,i=t,a=n,l=a.flags;switch(a.tag){case 0:case 11:case 15:e(i,a,r),a2(4,a);break;case 1:if(e(i,a,r),"function"==typeof(i=(o=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(e){sM(o,o.return,e)}if(null!==(i=(o=a).updateQueue)){var s=o.stateNode;try{var c=i.shared.hiddenCallbacks;if(null!==c)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)oA(c[i],s)}catch(e){sM(o,o.return,e)}}r&&64&l&&a4(a),a6(a,a.return);break;case 27:lr(a);case 26:case 5:e(i,a,r),r&&null===o&&4&l&&a9(a),a6(a,a.return);break;case 12:default:e(i,a,r);break;case 31:e(i,a,r),r&&4&l&&lh(i,a);break;case 13:e(i,a,r),r&&4&l&&lm(i,a);break;case 22:null===a.memoizedState&&e(i,a,r),a6(a,a.return);case 30:}n=n.sibling}}(e,n,0!=(8772&n.subtreeFlags)):lw(e,n),lo=o,li=i}case 30:}}var lu=null,ld=!1;function lf(e,t,n){for(n=n.child;null!==n;)lp(e,t,n),n=n.sibling}function lp(e,t,n){if(ep&&"function"==typeof ep.onCommitFiberUnmount)try{ep.onCommitFiberUnmount(ef,n)}catch(e){}switch(n.tag){case 26:li||a8(n,t),lf(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:li||a8(n,t);var r=lu,o=ld;cC(n.type)&&(lu=n.stateNode,ld=!1),lf(e,t,n),cL(n.stateNode),lu=r,ld=o;break;case 5:li||a8(n,t);case 6:if(r=lu,o=ld,lu=null,lf(e,t,n),lu=r,ld=o,null!==lu)if(ld)try{(9===lu.nodeType?lu.body:"HTML"===lu.nodeName?lu.ownerDocument.body:lu).removeChild(n.stateNode)}catch(e){sM(n,t,e)}else try{lu.removeChild(n.stateNode)}catch(e){sM(n,t,e)}break;case 18:null!==lu&&(ld?(cN(9===(e=lu).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),u_(e)):cN(lu,n.stateNode));break;case 4:r=lu,o=ld,lu=n.stateNode.containerInfo,ld=!0,lf(e,t,n),lu=r,ld=o;break;case 0:case 11:case 14:case 15:a3(2,n,t),li||a3(4,n,t),lf(e,t,n);break;case 1:li||(a8(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount&&a5(n,t,r)),lf(e,t,n);break;case 21:default:lf(e,t,n);break;case 22:li=(r=li)||null!==n.memoizedState,lf(e,t,n),li=r}}function lh(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{u_(e)}catch(e){sM(t,t.return,e)}}}function lm(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{u_(e)}catch(e){sM(t,t.return,e)}}function lv(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new ll),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new ll),t;default:throw Error(l(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sL.bind(null,e,t);t.then(r,r)}})}function lg(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r],i=e,a=t,s=a;e:for(;null!==s;){switch(s.tag){case 27:if(cC(s.type)){lu=s.stateNode,ld=!1;break e}break;case 5:lu=s.stateNode,ld=!1;break e;case 3:case 4:lu=s.stateNode.containerInfo,ld=!0;break e}s=s.return}if(null===lu)throw Error(l(160));lp(i,a,o),lu=null,ld=!1,null!==(i=o.alternate)&&(i.return=null),o.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)lb(t,e),t=t.sibling}var ly=null;function lb(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:lg(t,e),lx(e),4&r&&(a3(3,e,e.return),a2(3,e),a3(5,e,e.return));break;case 1:lg(t,e),lx(e),512&r&&(li||null===n||a8(n,n.return)),64&r&&lo&&null!==(e=e.updateQueue)&&null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r));break;case 26:var o=ly;if(lg(t,e),lx(e),512&r&&(li||null===n||a8(n,n.return)),4&r){var i=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,o=o.ownerDocument||o;t:switch(r){case"title":(!(i=o.getElementsByTagName("title")[0])||i[e$]||i[eR]||"http://www.w3.org/2000/svg"===i.namespaceURI||i.hasAttribute("itemprop"))&&(i=o.createElement(r),o.head.insertBefore(i,o.querySelector("head > title"))),cf(i,r,n),i[eR]=e,eG(i),r=i;break e;case"link":var a=c2("link","href",o).get(r+(n.href||""));if(a){for(var s=0;s<a.length;s++)if((i=a[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&i.getAttribute("rel")===(null==n.rel?null:n.rel)&&i.getAttribute("title")===(null==n.title?null:n.title)&&i.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){a.splice(s,1);break t}}cf(i=o.createElement(r),r,n),o.head.appendChild(i);break;case"meta":if(a=c2("meta","content",o).get(r+(n.content||""))){for(s=0;s<a.length;s++)if((i=a[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&i.getAttribute("name")===(null==n.name?null:n.name)&&i.getAttribute("property")===(null==n.property?null:n.property)&&i.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&i.getAttribute("charset")===(null==n.charSet?null:n.charSet)){a.splice(s,1);break t}}cf(i=o.createElement(r),r,n),o.head.appendChild(i);break;default:throw Error(l(468,r))}i[eR]=e,eG(i),r=i}e.stateNode=r}else c3(o,e.type,e.stateNode);else e.stateNode=cX(o,r,e.memoizedProps);else i!==r?(null===i?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):i.count--,null===r?c3(o,e.type,e.stateNode):cX(o,r,e.memoizedProps)):null===r&&null!==e.stateNode&&a7(e,e.memoizedProps,n.memoizedProps)}break;case 27:lg(t,e),lx(e),512&r&&(li||null===n||a8(n,n.return)),null!==n&&4&r&&a7(e,e.memoizedProps,n.memoizedProps);break;case 5:if(lg(t,e),lx(e),512&r&&(li||null===n||a8(n,n.return)),32&e.flags){o=e.stateNode;try{ts(o,"")}catch(t){sM(e,e.return,t)}}4&r&&null!=e.stateNode&&(o=e.memoizedProps,a7(e,o,null!==n?n.memoizedProps:o)),1024&r&&(la=!0);break;case 6:if(lg(t,e),lx(e),4&r){if(null===e.stateNode)throw Error(l(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){sM(e,e.return,t)}}break;case 3:if(c1=null,o=ly,ly=cH(t.containerInfo),lg(t,e),ly=o,lx(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{u_(t.containerInfo)}catch(t){sM(e,e.return,t)}la&&(la=!1,function e(t){if(1024&t.subtreeFlags)for(t=t.child;null!==t;){var n=t;e(n),5===n.tag&&1024&n.flags&&n.stateNode.reset(),t=t.sibling}}(e));break;case 4:r=ly,ly=cH(e.stateNode.containerInfo),lg(t,e),lx(e),ly=r;break;case 12:default:lg(t,e),lx(e);break;case 31:case 19:lg(t,e),lx(e),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,lv(e,r));break;case 13:lg(t,e),lx(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==n&&null!==n.memoizedState)&&(l1=er()),4&r&&null!==(r=e.updateQueue)&&(e.updateQueue=null,lv(e,r));break;case 22:o=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=lo,d=li;if(lo=u||o,li=d||c,lg(t,e),li=d,lo=u,lx(e),8192&r)e:for((t=e.stateNode)._visibility=o?-2&t._visibility:1|t._visibility,o&&(null===n||c||lo||li||function e(t){for(t=t.child;null!==t;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:a3(4,n,n.return),e(n);break;case 1:a8(n,n.return);var r=n.stateNode;"function"==typeof r.componentWillUnmount&&a5(n,n.return,r),e(n);break;case 27:cL(n.stateNode);case 26:case 5:a8(n,n.return),e(n);break;case 22:null===n.memoizedState&&e(n);break;default:e(n)}t=t.sibling}}(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(i=c.stateNode,o)a=i.style,"function"==typeof a.setProperty?a.setProperty("display","none","important"):a.display="none";else{s=c.stateNode;var f=c.memoizedProps.style,p=null!=f&&f.hasOwnProperty("display")?f.display:null;s.style.display=null==p||"boolean"==typeof p?"":(""+p).trim()}}catch(e){sM(c,c.return,e)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=o?"":c.memoizedProps}catch(e){sM(c,c.return,e)}}}else if(18===t.tag){if(null===n){c=t;try{var h=c.stateNode;o?cP(h,!0):cP(c.stateNode,!1)}catch(e){sM(c,c.return,e)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&null!==(r=e.updateQueue)&&null!==(n=r.retryQueue)&&(r.retryQueue=null,lv(e,n));case 30:case 21:}}function lx(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(le(r)){n=r;break}r=r.return}if(null==n)throw Error(l(160));switch(n.tag){case 27:var o=n.stateNode,i=lt(e);ln(e,i,o);break;case 5:var a=n.stateNode;32&n.flags&&(ts(a,""),n.flags&=-33);var s=lt(e);ln(e,s,a);break;case 3:case 4:var c=n.stateNode.containerInfo,u=lt(e);!function e(t,n,r){var o=t.tag;if(5===o||6===o)t=t.stateNode,n?(9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).insertBefore(t,n):((n=9===r.nodeType?r.body:"HTML"===r.nodeName?r.ownerDocument.body:r).appendChild(t),null!=(r=r._reactRootContainer)||null!==n.onclick||(n.onclick=tv));else if(4!==o&&(27===o&&cC(t.type)&&(r=t.stateNode,n=null),null!==(t=t.child)))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,u,c);break;default:throw Error(l(161))}}catch(t){sM(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function lw(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)lc(e,t.alternate,t),t=t.sibling}function lk(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&r2(n))}function lj(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&r2(e))}function lS(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)lO(e,t,n,r),t=t.sibling}function lO(e,t,n,r){var o=t.flags;switch(t.tag){case 0:case 11:case 15:lS(e,t,n,r),2048&o&&a2(9,t);break;case 1:case 31:case 13:default:lS(e,t,n,r);break;case 3:lS(e,t,n,r),2048&o&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&r2(e)));break;case 12:if(2048&o){lS(e,t,n,r),e=t.stateNode;try{var i=t.memoizedProps,a=i.id,l=i.onPostCommit;"function"==typeof l&&l(a,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(e){sM(t,t.return,e)}}else lS(e,t,n,r);break;case 23:break;case 22:i=t.stateNode,a=t.alternate,null!==t.memoizedState?2&i._visibility?lS(e,t,n,r):lC(e,t):2&i._visibility?lS(e,t,n,r):(i._visibility|=2,function e(t,n,r,o,i){for(i=i&&0!=(10256&n.subtreeFlags),n=n.child;null!==n;){var a=n,l=a.flags;switch(a.tag){case 0:case 11:case 15:e(t,a,r,o,i),a2(8,a);break;case 23:break;case 22:var s=a.stateNode;null!==a.memoizedState?2&s._visibility?e(t,a,r,o,i):lC(t,a):(s._visibility|=2,e(t,a,r,o,i)),i&&2048&l&&lk(a.alternate,a);break;case 24:e(t,a,r,o,i),i&&2048&l&&lj(a.alternate,a);break;default:e(t,a,r,o,i)}n=n.sibling}}(e,t,n,r,0!=(10256&t.subtreeFlags))),2048&o&&lk(a,t);break;case 24:lS(e,t,n,r),2048&o&&lj(t.alternate,t)}}function lC(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=t,r=n.flags;switch(n.tag){case 22:lC(e,n),2048&r&&lk(n.alternate,n);break;case 24:lC(e,n),2048&r&&lj(n.alternate,n);break;default:lC(e,n)}t=t.sibling}}var lN=8192;function lP(e,t,n){if(e.subtreeFlags&lN)for(e=e.child;null!==e;)lE(e,t,n),e=e.sibling}function lE(e,t,n){switch(e.tag){case 26:lP(e,t,n),e.flags&lN&&null!==e.memoizedState&&function(e,t,n,r){if("stylesheet"===n.type&&("string"!=typeof r.media||!1!==matchMedia(r.media).matches)&&0==(4&n.state.loading)){if(null===n.instance){var o=cV(r.href),i=t.querySelector(cW(o));if(i){null!==(t=i._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=c6.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,eG(i);return}i=t.ownerDocument||t,r=cG(r),(o=cF.get(o))&&cQ(r,o),eG(i=i.createElement("link"));var a=i;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),cf(i,"link",r),n.instance=i}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&0==(3&n.state.loading)&&(e.count++,n=c6.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,ly,e.memoizedState,e.memoizedProps);break;case 5:default:lP(e,t,n);break;case 3:case 4:var r=ly;ly=cH(e.stateNode.containerInfo),lP(e,t,n),ly=r;break;case 22:null===e.memoizedState&&(null!==(r=e.alternate)&&null!==r.memoizedState?(r=lN,lN=0x1000000,lP(e,t,n),lN=r):lP(e,t,n))}}function lI(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(null!==e)}}function lA(e){var t=e.deletions;if(0!=(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];ls=r,lM(r,e)}lI(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)l_(e),e=e.sibling}function l_(e){switch(e.tag){case 0:case 11:case 15:lA(e),2048&e.flags&&a3(9,e,e.return);break;case 3:case 12:default:lA(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,function e(t){var n=t.deletions;if(0!=(16&t.flags)){if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];ls=o,lM(o,t)}lI(t)}for(t=t.child;null!==t;){switch((n=t).tag){case 0:case 11:case 15:a3(8,n,n.return),e(n);break;case 22:2&(r=n.stateNode)._visibility&&(r._visibility&=-3,e(n));break;default:e(n)}t=t.sibling}}(e)):lA(e)}}function lM(e,t){for(;null!==ls;){var n=ls;switch(n.tag){case 0:case 11:case 15:a3(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:r2(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,ls=r;else for(n=e;null!==ls;){var o=(r=ls).sibling,i=r.return;if(!function e(t){var n=t.alternate;null!==n&&(t.alternate=null,e(n)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(n=t.stateNode)&&eB(n),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}(r),r===n){ls=null;break}if(null!==o){o.return=i,ls=o;break}ls=i}}}var lT={getCacheForType:function(e){var t=rG(r0),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return rG(r0).controller.signal}},lR="function"==typeof WeakMap?WeakMap:Map,lz=0,lD=null,lL=null,lF=0,lU=0,lH=null,l$=!1,lB=!1,lK=!1,lq=0,lV=0,lW=0,lG=0,lZ=0,lY=0,lX=0,lJ=null,lQ=null,l0=!1,l1=0,l2=0,l3=1/0,l4=null,l5=null,l6=0,l8=null,l9=null,l7=0,se=0,st=null,sn=null,sr=0,so=null;function si(){return 0!=(2&lz)&&0!==lF?lF&-lF:null!==_.T?sJ():e_()}function sa(){if(0===lY)if(0==(0x20000000&lF)||rN){var e=eb;0==(3932160&(eb<<=1))&&(eb=262144),lY=e}else lY=0x20000000;return null!==(e=oL.current)&&(e.flags|=32),lY}function sl(e,t,n){(e===lD&&(2===lU||9===lU)||null!==e.cancelPendingCommit)&&(sp(e,0),su(e,lF,lY,!1)),eC(e,n),(0==(2&lz)||e!==lD)&&(e===lD&&(0==(2&lz)&&(lG|=n),4===lV&&su(e,lF,lY,!1)),sq(e))}function ss(e,t,n){if(0!=(6&lz))throw Error(l(327));for(var r=!n&&0==(127&t)&&0==(t&e.expiredLanes)||ej(e,t),o=r?function(e,t){var n=lz;lz|=2;var r=sv(),o=sg();lD!==e||lF!==t?(l4=null,l3=er()+500,sp(e,t)):lB=ej(e,t);e:for(;;)try{if(0!==lU&&null!==lL){t=lL;var i=lH;t:switch(lU){case 1:lU=0,lH=null,sk(e,t,i,1);break;case 2:case 9:if(ol(i)){lU=0,lH=null,sw(t);break}t=function(){2!==lU&&9!==lU||lD!==e||(lU=7),sq(e)},i.then(t,t);break e;case 3:lU=7;break e;case 4:lU=5;break e;case 7:ol(i)?(lU=0,lH=null,sw(t)):(lU=0,lH=null,sk(e,t,i,7));break;case 5:var a=null;switch(lL.tag){case 26:a=lL.memoizedState;case 5:case 27:var s=lL;if(a?c4(a):s.stateNode.complete){lU=0,lH=null;var c=s.sibling;if(null!==c)lL=c;else{var u=s.return;null!==u?(lL=u,sj(u)):lL=null}break t}}lU=0,lH=null,sk(e,t,i,5);break;case 6:lU=0,lH=null,sk(e,t,i,6);break;case 8:sf(),lV=6;break e;default:throw Error(l(462))}}for(;null!==lL&&!et();)sx(lL);break}catch(t){sh(e,t)}return(rU=rF=null,_.H=r,_.A=o,lz=n,null!==lL)?0:(lD=null,lF=0,n2(),lV)}(e,t):sb(e,t,!0),i=r;;){if(0===o)lB&&!r&&su(e,t,0,!1);else{if(n=e.current.alternate,i&&!function(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!nO(i(),o))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(n)){o=sb(e,t,!1),i=!1;continue}if(2===o){if(i=t,e.errorRecoveryDisabledLanes&i)var a=0;else a=0!=(a=-0x20000001&e.pendingLanes)?a:0x20000000&a?0x20000000:0;if(0!==a){t=a;e:{o=lJ;var s=e.current.memoizedState.isDehydrated;if(s&&(sp(e,a).flags|=256),2!==(a=sb(e,a,!1))){if(lK&&!s){e.errorRecoveryDisabledLanes|=i,lG|=i,o=4;break e}i=lQ,lQ=o,null!==i&&(null===lQ?lQ=i:lQ.push.apply(lQ,i))}o=a}if(i=!1,2!==o)continue}}if(1===o){sp(e,0),su(e,t,0,!0);break}e:{switch(r=e,i=o){case 0:case 1:throw Error(l(345));case 4:if((4194048&t)!==t)break;case 6:su(r,t,lY,!l$);break e;case 2:lQ=null;break;case 3:case 5:break;default:throw Error(l(329))}if((0x3c00000&t)===t&&10<(o=l1+300-er())){if(su(r,t,lY,!l$),0!==ek(r,0,!0))break e;l7=t,r.timeoutHandle=cw(sc.bind(null,r,n,lQ,l4,l0,t,lY,lG,lX,l$,i,"Throttled",-0,0),o);break e}sc(r,n,lQ,l4,l0,t,lY,lG,lX,l$,i,null,-0,0)}}break}sq(e)}function sc(e,t,n,r,o,i,a,l,s,c,u,d,f,p){if(e.timeoutHandle=-1,8192&(d=t.subtreeFlags)||0x1002000==(0x1002000&d)){lE(t,i,d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tv});var h,m,v=(0x3c00000&i)===i?l1-er():(4194048&i)===i?l2-er():0;if(null!==(h=d,m=v,h.stylesheets&&0===h.count&&c9(h,h.stylesheets),v=0<h.count||0<h.imgCount?function(e){var t=setTimeout(function(){if(h.stylesheets&&c9(h,h.stylesheets),h.unsuspend){var e=h.unsuspend;h.unsuspend=null,e()}},6e4+m);0<h.imgBytes&&0===c5&&(c5=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var o=n[r],i=o.transferSize,a=o.initiatorType,l=o.duration;if(i&&l&&cp(a)){for(a=0,l=o.responseEnd,r+=1;r<n.length;r++){var s=n[r],c=s.startTime;if(c>l)break;var u=s.transferSize,d=s.initiatorType;u&&cp(d)&&(a+=u*((s=s.responseEnd)<l?1:(l-c)/(s-c)))}if(--r,t+=8*(i+a)/(o.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var n=setTimeout(function(){if(h.waitingForImages=!1,0===h.count&&(h.stylesheets&&c9(h,h.stylesheets),h.unsuspend)){var e=h.unsuspend;h.unsuspend=null,e()}},(h.imgBytes>c5?50:800)+m);return h.unsuspend=e,function(){h.unsuspend=null,clearTimeout(t),clearTimeout(n)}}:null)){l7=i,e.cancelPendingCommit=v(sO.bind(null,e,t,i,n,r,o,a,l,s,u,d,null,f,p)),su(e,i,a,!c);return}}sO(e,t,i,n,r,o,a,l,s)}function su(e,t,n,r){t&=~lZ,t&=~lG,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var o=t;0<o;){var i=31-em(o),a=1<<i;r[i]=-1,o&=~a}0!==n&&eN(e,n,t)}function sd(){return 0!=(6&lz)||(sV(0,!1),!1)}function sf(){if(null!==lL){if(0===lU)var e=lL.return;else e=lL,rU=rF=null,ir(e),op=null,oh=0,e=lL;for(;null!==e;)a1(e.alternate,e),e=e.return;lL=null}}function sp(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,ck(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),l7=0,sf(),lD=e,lL=n=rn(e.current,null),lF=t,lU=0,lH=null,l$=!1,lB=ej(e,t),lK=!1,lX=lY=lZ=lG=lW=lV=0,lQ=lJ=null,l0=!1,0!=(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var o=31-em(r),i=1<<o;t|=e[o],r&=~i}return lq=t,n2(),n}function sh(e,t){oG=null,_.H=ar,t===or||t===oi?(t=od(),lU=3):t===oo?(t=od(),lU=4):lU=t===ax?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,lH=t,null===lL&&(lV=1,am(e,ru(t,e.current)))}function sm(){var e=oL.current;return null===e||((4194048&lF)===lF?null===oF:((0x3c00000&lF)===lF||0!=(0x20000000&lF))&&e===oF)}function sv(){var e=_.H;return _.H=ar,null===e?ar:e}function sg(){var e=_.A;return _.A=lT,e}function sy(){lV=4,l$||(4194048&lF)!==lF&&null!==oL.current||(lB=!0),0==(0x7ffffff&lW)&&0==(0x7ffffff&lG)||null===lD||su(lD,lF,lY,!1)}function sb(e,t,n){var r=lz;lz|=2;var o=sv(),i=sg();(lD!==e||lF!==t)&&(l4=null,sp(e,t)),t=!1;var a=lV;e:for(;;)try{if(0!==lU&&null!==lL){var l=lL,s=lH;switch(lU){case 8:sf(),a=6;break e;case 3:case 2:case 9:case 6:null===oL.current&&(t=!0);var c=lU;if(lU=0,lH=null,sk(e,l,s,c),n&&lB){a=0;break e}break;default:c=lU,lU=0,lH=null,sk(e,l,s,c)}}(function(){for(;null!==lL;)sx(lL)})(),a=lV;break}catch(t){sh(e,t)}return t&&e.shellSuspendCounter++,rU=rF=null,lz=r,_.H=o,_.A=i,null===lL&&(lD=null,lF=0,n2()),a}function sx(e){var t=aG(e.alternate,e,lq);e.memoizedProps=e.pendingProps,null===t?sj(e):lL=t}function sw(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=aM(n,t,t.pendingProps,t.type,void 0,lF);break;case 11:t=aM(n,t,t.pendingProps,t.type.render,t.ref,lF);break;case 5:ir(t);default:a1(n,t),t=aG(n,t=lL=rr(t,lq),lq)}e.memoizedProps=e.pendingProps,null===t?sj(e):lL=t}function sk(e,t,n,r){rU=rF=null,ir(t),op=null,oh=0;var o=t.return;try{if(function(e,t,n,r,o){if(n.flags|=32768,null!==r&&"object"==typeof r&&"function"==typeof r.then){if(null!==(t=n.alternate)&&rq(t,n,o,!0),null!==(n=oL.current)){switch(n.tag){case 31:case 13:return null===oF?sy():null===n.alternate&&0===lV&&(lV=3),n.flags&=-257,n.flags|=65536,n.lanes=o,r===oa?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),sT(e,r,o)),!1;case 22:return n.flags|=65536,r===oa?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),sT(e,r,o)),!1}throw Error(l(435,n.tag))}return sT(e,r,o),sy(),!1}if(rN)return null!==(t=oL.current)?(0==(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=o,r!==rI&&rD(ru(e=Error(l(422),{cause:r}),n))):(r!==rI&&rD(ru(t=Error(l(423),{cause:r}),n)),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,r=ru(r,n),o=ag(e.stateNode,r,o),oN(e,o),4!==lV&&(lV=2)),!1;var i=Error(l(520),{cause:r});if(i=ru(i,n),null===lJ?lJ=[i]:lJ.push(i),4!==lV&&(lV=2),null===t)return!0;r=ru(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=o&-o,n.lanes|=e,e=ag(n.stateNode,r,e),oN(n,e),!1;case 1:if(t=n.type,i=n.stateNode,0==(128&n.flags)&&("function"==typeof t.getDerivedStateFromError||null!==i&&"function"==typeof i.componentDidCatch&&(null===l5||!l5.has(i))))return n.flags|=65536,o&=-o,n.lanes|=o,ab(o=ay(o),e,n,r),oN(n,o),!1}n=n.return}while(null!==n);return!1}(e,o,t,n,lF)){lV=1,am(e,ru(n,e.current)),lL=null;return}}catch(t){if(null!==o)throw lL=o,t;lV=1,am(e,ru(n,e.current)),lL=null;return}32768&t.flags?(rN||1===r?e=!0:lB||0!=(0x20000000&lF)?e=!1:(l$=e=!0,(2===r||9===r||3===r||6===r)&&null!==(r=oL.current)&&13===r.tag&&(r.flags|=16384)),sS(t,e)):sj(t)}function sj(e){var t=e;do{if(0!=(32768&t.flags))return void sS(t,l$);e=t.return;var n=function(e,t,n){var r=t.pendingProps;switch(rj(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return a0(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),r$(r0),q(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(null===e||null===e.child)&&(rT(t)?aZ(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,rz())),a0(t),null;case 26:var o=t.type,i=t.memoizedState;return null===e?(aZ(t),null!==i?(a0(t),aX(t,i)):(a0(t),aY(t,o,null,r,n))):i?i!==e.memoizedState?(aZ(t),a0(t),aX(t,i)):(a0(t),t.flags&=-0x1000001):((e=e.memoizedProps)!==r&&aZ(t),a0(t),aY(t,o,e,r,n)),null;case 27:if(W(t),n=$.current,o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&aZ(t);else{if(!r){if(null===t.stateNode)throw Error(l(166));return a0(t),null}e=U.current,rT(t)?r_(t,e):(t.stateNode=e=cD(o,r,n),aZ(t))}return a0(t),null;case 5:if(W(t),o=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&aZ(t);else{if(!r){if(null===t.stateNode)throw Error(l(166));return a0(t),null}if(i=U.current,rT(t))r_(t,i);else{var a=cv($.current);switch(i){case 1:i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=a.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=a.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":(i=a.createElement("div")).innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i="string"==typeof r.is?a.createElement("select",{is:r.is}):a.createElement("select"),r.multiple?i.multiple=!0:r.size&&(i.size=r.size);break;default:i="string"==typeof r.is?a.createElement(o,{is:r.is}):a.createElement(o)}}i[eR]=t,i[ez]=r;e:for(a=t.child;null!==a;){if(5===a.tag||6===a.tag)i.appendChild(a.stateNode);else if(4!==a.tag&&27!==a.tag&&null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(t.stateNode=i,cf(i,o,r),o){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break;case"img":r=!0;break;default:r=!1}r&&aZ(t)}}return a0(t),aY(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&aZ(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(l(166));if(e=$.current,rT(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(o=rO))switch(o.tag){case 27:case 5:r=o.memoizedProps}e[eR]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||cc(e.nodeValue,n)))||rA(t,!0)}else(e=cv(e).createTextNode(r))[eR]=t,t.stateNode=e}return a0(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(r=rT(t),null!==n){if(null===e){if(!r)throw Error(l(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(l(557));e[eR]=t}else rR(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;a0(t),e=!1}else n=rz(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e){if(256&t.flags)return oK(t),t;return oK(t),null}if(0!=(128&t.flags))throw Error(l(558))}return a0(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(o=rT(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(l(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(l(317));o[eR]=t}else rR(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;a0(t),o=!1}else o=rz(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o){if(256&t.flags)return oK(t),t;return oK(t),null}}if(oK(t),0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,o=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(o=r.alternate.memoizedState.cachePool.pool),i=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(i=r.memoizedState.cachePool.pool),i!==o&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),aJ(t,t.updateQueue),a0(t),null;case 4:return q(),null===e&&s7(t.stateNode.containerInfo),a0(t),null;case 10:return r$(t.type),a0(t),null;case 19:if(L(oq),null===(r=t.memoizedState))return a0(t),null;if(o=0!=(128&t.flags),null===(i=r.rendering))if(o)aQ(r,!1);else{if(0!==lV||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(i=oV(e))){for(t.flags|=128,aQ(r,!1),t.updateQueue=e=i.updateQueue,aJ(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)rr(n,e),n=n.sibling;return F(oq,1&oq.current|2),rN&&rx(t,r.treeForkCount),t.child}e=e.sibling}null!==r.tail&&er()>l3&&(t.flags|=128,o=!0,aQ(r,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=oV(i))){if(t.flags|=128,o=!0,t.updateQueue=e=e.updateQueue,aJ(t,e),aQ(r,!0),null===r.tail&&"hidden"===r.tailMode&&!i.alternate&&!rN)return a0(t),null}else 2*er()-r.renderingStartTime>l3&&0x20000000!==n&&(t.flags|=128,o=!0,aQ(r,!1),t.lanes=4194304);r.isBackwards?(i.sibling=t.child,t.child=i):(null!==(e=r.last)?e.sibling=i:t.child=i,r.last=i)}if(null!==r.tail)return e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=er(),e.sibling=null,n=oq.current,F(oq,o?1&n|2:1&n),rN&&rx(t,r.treeForkCount),e;return a0(t),null;case 22:case 23:return oK(t),oD(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!=(0x20000000&n)&&0==(128&t.flags)&&(a0(t),6&t.subtreeFlags&&(t.flags|=8192)):a0(t),null!==(n=t.updateQueue)&&aJ(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&L(r7),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),r$(r0),a0(t),null;case 25:case 30:return null}throw Error(l(156,t.tag))}(t.alternate,t,lq);if(null!==n){lL=n;return}if(null!==(t=t.sibling)){lL=t;return}lL=t=e}while(null!==t);0===lV&&(lV=5)}function sS(e,t){do{var n=function(e,t){switch(rj(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return r$(r0),q(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return W(t),null;case 31:if(null!==t.memoizedState){if(oK(t),null===t.alternate)throw Error(l(340));rR()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(oK(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(l(340));rR()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return L(oq),null;case 4:return q(),null;case 10:return r$(t.type),null;case 22:case 23:return oK(t),oD(),null!==e&&L(r7),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return r$(r0),null;default:return null}}(e.alternate,e);if(null!==n){n.flags&=32767,lL=n;return}if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling)){lL=e;return}lL=e=n}while(null!==e);lV=6,lL=null}function sO(e,t,n,r,o,i,a,s,c){e.cancelPendingCommit=null;do sI();while(0!==l6);if(0!=(6&lz))throw Error(l(327));if(null!==t){if(t===e.current)throw Error(l(177));if(!function(e,t,n,r,o,i){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,s=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var u=31-em(n),d=1<<u;l[u]=0,s[u]=-1;var f=c[u];if(null!==f)for(c[u]=null,u=0;u<f.length;u++){var p=f[u];null!==p&&(p.lane&=-0x20000001)}n&=~d}0!==r&&eN(e,r,0),0!==i&&0===o&&0!==e.tag&&(e.suspendedLanes|=i&~(a&~t))}(e,n,i=t.lanes|t.childLanes|n1,a,s,c),e===lD&&(lL=lD=null,lF=0),l9=t,l8=e,l7=n,se=i,st=o,sn=r,0!=(10256&t.subtreeFlags)||0!=(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,Q(el,function(){return sA(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!=(13878&t.flags),0!=(13878&t.subtreeFlags)||r){r=_.T,_.T=null,o=M.p,M.p=2,a=lz,lz|=4;try{!function(e,t){if(e=e.containerInfo,ch=ul,nI(e=nE(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o,i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(e){n=null;break e}var s=0,c=-1,u=-1,d=0,f=0,p=e,h=null;t:for(;;){for(;p!==n||0!==i&&3!==p.nodeType||(c=s+i),p!==a||0!==r&&3!==p.nodeType||(u=s+r),3===p.nodeType&&(s+=p.nodeValue.length),null!==(o=p.firstChild);)h=p,p=o;for(;;){if(p===e)break t;if(h===n&&++d===i&&(c=s),h===a&&++f===r&&(u=s),null!==(o=p.nextSibling))break;h=(p=h).parentNode}p=o}n=-1===c||-1===u?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(cm={focusedElem:e,selectionRange:n},ul=!1,ls=t;null!==ls;)if(e=(t=ls).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ls=e;else for(;null!==ls;){switch(a=(t=ls).alternate,e=t.flags,t.tag){case 0:if(0!=(4&e)&&null!==(e=null!==(e=t.updateQueue)?e.events:null))for(n=0;n<e.length;n++)(i=e[n]).ref.impl=i.nextImpl;break;case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!=(1024&e)&&null!==a){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var m=ad(n.type,i);e=r.getSnapshotBeforeUpdate(m,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){sM(n,n.return,e)}}break;case 3:if(0!=(1024&e)){if(9===(n=(e=t.stateNode.containerInfo).nodeType))cE(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cE(e);break;default:e.textContent=""}}break;default:if(0!=(1024&e))throw Error(l(163))}if(null!==(e=t.sibling)){e.return=t.return,ls=e;break}ls=t.return}}(e,t)}finally{lz=a,M.p=o,_.T=r}}l6=1,sC(),sN(),sP()}}function sC(){if(1===l6){l6=0;var e=l8,t=l9,n=0!=(13878&t.flags);if(0!=(13878&t.subtreeFlags)||n){n=_.T,_.T=null;var r=M.p;M.p=2;var o=lz;lz|=4;try{lb(t,e);var i=cm,a=nE(e.containerInfo),l=i.focusedElem,s=i.selectionRange;if(a!==l&&l&&l.ownerDocument&&function e(t,n){return!!t&&!!n&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(l.ownerDocument.documentElement,l)){if(null!==s&&nI(l)){var c=s.start,u=s.end;if(void 0===u&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var d=l.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),h=l.textContent.length,m=Math.min(s.start,h),v=void 0===s.end?m:Math.min(s.end,h);!p.extend&&m>v&&(a=v,v=m,m=a);var g=nP(l,m),y=nP(l,v);if(g&&y&&(1!==p.rangeCount||p.anchorNode!==g.node||p.anchorOffset!==g.offset||p.focusNode!==y.node||p.focusOffset!==y.offset)){var b=d.createRange();b.setStart(g.node,g.offset),p.removeAllRanges(),m>v?(p.addRange(b),p.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),p.addRange(b))}}}}for(d=[],p=l;p=p.parentNode;)1===p.nodeType&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof l.focus&&l.focus(),l=0;l<d.length;l++){var x=d[l];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}ul=!!ch,cm=ch=null}finally{lz=o,M.p=r,_.T=n}}e.current=t,l6=2}}function sN(){if(2===l6){l6=0;var e=l8,t=l9,n=0!=(8772&t.flags);if(0!=(8772&t.subtreeFlags)||n){n=_.T,_.T=null;var r=M.p;M.p=2;var o=lz;lz|=4;try{lc(e,t.alternate,t)}finally{lz=o,M.p=r,_.T=n}}l6=3}}function sP(){if(4===l6||3===l6){l6=0,en();var e=l8,t=l9,n=l7,r=sn;0!=(10256&t.subtreeFlags)||0!=(10256&t.flags)?l6=5:(l6=0,l9=l8=null,sE(e,e.pendingLanes));var o=e.pendingLanes;if(0===o&&(l5=null),eA(n),t=t.stateNode,ep&&"function"==typeof ep.onCommitFiberRoot)try{ep.onCommitFiberRoot(ef,t,void 0,128==(128&t.current.flags))}catch(e){}if(null!==r){t=_.T,o=M.p,M.p=2,_.T=null;try{for(var i=e.onRecoverableError,a=0;a<r.length;a++){var l=r[a];i(l.value,{componentStack:l.stack})}}finally{_.T=t,M.p=o}}0!=(3&l7)&&sI(),sq(e),o=e.pendingLanes,0!=(261930&n)&&0!=(42&o)?e===so?sr++:(sr=0,so=e):sr=0,sV(0,!1)}}function sE(e,t){0==(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,r2(t))}function sI(){return sC(),sN(),sP(),sA()}function sA(){if(5!==l6)return!1;var e=l8,t=se;se=0;var n=eA(l7),r=_.T,o=M.p;try{M.p=32>n?32:n,_.T=null,n=st,st=null;var i=l8,a=l7;if(l6=0,l9=l8=null,l7=0,0!=(6&lz))throw Error(l(331));var s=lz;if(lz|=4,l_(i.current),lO(i,i.current,a,n),lz=s,sV(0,!1),ep&&"function"==typeof ep.onPostCommitFiberRoot)try{ep.onPostCommitFiberRoot(ef,i)}catch(e){}return!0}finally{M.p=o,_.T=r,sE(e,t)}}function s_(e,t,n){t=ru(n,t),t=ag(e.stateNode,t,2),null!==(e=oO(e,t,2))&&(eC(e,2),sq(e))}function sM(e,t,n){if(3===e.tag)s_(e,e,n);else for(;null!==t;){if(3===t.tag){s_(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===l5||!l5.has(r))){e=ru(n,e),null!==(r=oO(t,n=ay(2),2))&&(ab(n,r,t,e),eC(r,2),sq(r));break}}t=t.return}}function sT(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new lR;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(lK=!0,o.add(n),e=sR.bind(null,e,t,n),t.then(e,e))}function sR(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,lD===e&&(lF&n)===n&&(4===lV||3===lV&&(0x3c00000&lF)===lF&&300>er()-l1?0==(2&lz)&&sp(e,0):lZ|=n,lX===lF&&(lX=0)),sq(e)}function sz(e,t){0===t&&(t=eS()),null!==(e=n5(e,t))&&(eC(e,t),sq(e))}function sD(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),sz(e,n)}function sL(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(l(314))}null!==r&&r.delete(t),sz(e,n)}var sF=null,sU=null,sH=!1,s$=!1,sB=!1,sK=0;function sq(e){e!==sU&&null===e.next&&(null===sU?sF=sU=e:sU=sU.next=e),s$=!0,sH||(sH=!0,cS(function(){0!=(6&lz)?Q(ei,sW):sG()}))}function sV(e,t){if(!sB&&s$){sB=!0;do for(var n=!1,r=sF;null!==r;){if(!t)if(0!==e){var o=r.pendingLanes;if(0===o)var i=0;else{var a=r.suspendedLanes,l=r.pingedLanes;i=0xc000095&(i=(1<<31-em(42|e)+1)-1&(o&~(a&~l)))?0xc000095&i|1:i?2|i:0}0!==i&&(n=!0,sX(r,i))}else i=lF,0==(3&(i=ek(r,r===lD?i:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||ej(r,i)||(n=!0,sX(r,i));r=r.next}while(n);sB=!1}}function sW(){sG()}function sG(){s$=sH=!1;var e,t=0;0===sK||((e=window.event)&&"popstate"===e.type?e===cx||(cx=e,0):(cx=null,1))||(t=sK);for(var n=er(),r=null,o=sF;null!==o;){var i=o.next,a=sZ(o,n);0===a?(o.next=null,null===r?sF=i:r.next=i,null===i&&(sU=r)):(r=o,(0!==t||0!=(3&a))&&(s$=!0)),o=i}0!==l6&&5!==l6||sV(t,!1),0!==sK&&(sK=0)}function sZ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=-0x3c00001&e.pendingLanes;0<i;){var a=31-em(i),l=1<<a,s=o[a];-1===s?(0==(l&n)||0!=(l&r))&&(o[a]=function(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5e3;default:return -1}}(l,t)):s<=t&&(e.expiredLanes|=l),i&=~l}if(t=lD,n=lF,n=ek(e,e===t?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===lU||9===lU)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&ee(r),e.callbackNode=null,e.callbackPriority=0;if(0==(3&n)||ej(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&ee(r),eA(n)){case 2:case 8:n=ea;break;case 32:default:n=el;break;case 0x10000000:n=ec}return n=Q(n,r=sY.bind(null,e)),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&ee(r),e.callbackPriority=2,e.callbackNode=null,2}function sY(e,t){if(0!==l6&&5!==l6)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(sI()&&e.callbackNode!==n)return null;var r=lF;return 0===(r=ek(e,e===lD?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(ss(e,r,t),sZ(e,er()),null!=e.callbackNode&&e.callbackNode===n?sY.bind(null,e):null)}function sX(e,t){if(sI())return null;ss(e,t,!0)}function sJ(){if(0===sK){var e=r5;0===e&&(e=ey,0==(261888&(ey<<=1))&&(ey=256)),sK=e}return sK}function sQ(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:tm(""+e)}function s0(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var s1=0;s1<nY.length;s1++){var s2=nY[s1];nX(s2.toLowerCase(),"on"+(s2[0].toUpperCase()+s2.slice(1)))}nX(n$,"onAnimationEnd"),nX(nB,"onAnimationIteration"),nX(nK,"onAnimationStart"),nX("dblclick","onDoubleClick"),nX("focusin","onFocus"),nX("focusout","onBlur"),nX(nq,"onTransitionRun"),nX(nV,"onTransitionStart"),nX(nW,"onTransitionCancel"),nX(nG,"onTransitionEnd"),eJ("onMouseEnter",["mouseout","mouseover"]),eJ("onMouseLeave",["mouseout","mouseover"]),eJ("onPointerEnter",["pointerout","pointerover"]),eJ("onPointerLeave",["pointerout","pointerover"]),eX("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),eX("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),eX("onBeforeInput",["compositionend","keypress","textInput","paste"]),eX("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),eX("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),eX("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var s3="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(" "),s4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(s3));function s5(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],s=l.instance,c=l.currentTarget;if(l=l.listener,s!==i&&o.isPropagationStopped())break e;i=l,o.currentTarget=c;try{i(o)}catch(e){nJ(e)}o.currentTarget=null,i=s}else for(a=0;a<r.length;a++){if(s=(l=r[a]).instance,c=l.currentTarget,l=l.listener,s!==i&&o.isPropagationStopped())break e;i=l,o.currentTarget=c;try{i(o)}catch(e){nJ(e)}o.currentTarget=null,i=s}}}}function s6(e,t){var n=t[eL];void 0===n&&(n=t[eL]=new Set);var r=e+"__bubble";n.has(r)||(ce(t,e,2,!1),n.add(r))}function s8(e,t,n){var r=0;t&&(r|=4),ce(n,e,r,t)}var s9="_reactListening"+Math.random().toString(36).slice(2);function s7(e){if(!e[s9]){e[s9]=!0,eZ.forEach(function(t){"selectionchange"!==t&&(s4.has(t)||s8(t,!1,e),s8(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[s9]||(t[s9]=!0,s8("selectionchange",!1,t))}}function ce(e,t,n,r){switch(uh(t)){case 2:var o=us;break;case 8:o=uc;break;default:o=uu}n=o.bind(null,t,n,e),o=void 0,tC&&("touchstart"===t||"touchmove"===t||"wheel"===t)&&(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ct(e,t,n,r,o){var i=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var l=r.stateNode.containerInfo;if(l===o)break;if(4===a)for(a=r.return;null!==a;){var c=a.tag;if((3===c||4===c)&&a.stateNode.containerInfo===o)return;a=a.return}for(;null!==l;){if(null===(a=eK(l)))return;if(5===(c=a.tag)||6===c||26===c||27===c){r=i=a;continue e}l=l.parentNode}}r=r.return}tj(function(){var r=i,o=ty(n),a=[];e:{var l=nZ.get(e);if(void 0!==l){var c=t$,u=e;switch(e){case"keypress":if(0===t_(n))break e;case"keydown":case"keyup":c=t3;break;case"focusin":u="focus",c=tG;break;case"focusout":u="blur",c=tG;break;case"beforeblur":case"afterblur":c=tG;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=tV;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=tW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=t5;break;case n$:case nB:case nK:c=tZ;break;case nG:c=t6;break;case"scroll":case"scrollend":c=tK;break;case"wheel":c=t8;break;case"copy":case"cut":case"paste":c=tY;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=t4;break;case"toggle":case"beforetoggle":c=t9}var d=0!=(4&t),f=!d&&("scroll"===e||"scrollend"===e),p=d?null!==l?l+"Capture":null:l;d=[];for(var h,m=r;null!==m;){var v=m;if(h=v.stateNode,5!==(v=v.tag)&&26!==v&&27!==v||null===h||null===p||null!=(v=tS(m,p))&&d.push(cn(m,v,h)),f)break;m=m.return}0<d.length&&(l=new c(l,u,null,n,o),a.push({event:l,listeners:d}))}}if(0==(7&t)){if((l="mouseover"===e||"pointerover"===e,c="mouseout"===e||"pointerout"===e,!(l&&n!==tg&&(u=n.relatedTarget||n.fromElement)&&(eK(u)||u[eD])))&&(c||l)&&(l=o.window===o?o:(l=o.ownerDocument)?l.defaultView||l.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,null!==(u=u?eK(u):null)&&(f=s(u),d=u.tag,u!==f||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=tV,v="onMouseLeave",p="onMouseEnter",m="mouse",("pointerout"===e||"pointerover"===e)&&(d=t4,v="onPointerLeave",p="onPointerEnter",m="pointer"),f=null==c?l:eV(c),h=null==u?l:eV(u),(l=new d(v,m+"leave",c,n,o)).target=f,l.relatedTarget=h,v=null,eK(o)===r&&((d=new d(p,m+"enter",u,n,o)).target=h,d.relatedTarget=f,v=d),f=v,c&&u)t:{for(d=co,p=c,m=u,h=0,v=p;v;v=d(v))h++;v=0;for(var g,y=m;y;y=d(y))v++;for(;0<h-v;)p=d(p),h--;for(;0<v-h;)m=d(m),v--;for(;h--;){if(p===m||null!==m&&p===m.alternate){d=p;break t}p=d(p),m=d(m)}d=null}else d=null;null!==c&&ci(a,l,c,d,!1),null!==u&&null!==f&&ci(a,f,u,d,!0)}e:{if("select"===(c=(l=r?eV(r):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var b=nm;else if(nc(l))if(nv)b=nS;else{b=nk;var x=nw}else(c=l.nodeName)&&"input"===c.toLowerCase()&&("checkbox"===l.type||"radio"===l.type)?b=nj:r&&tf(r.elementType)&&(b=nm);if(b&&(b=b(e,r))){nu(a,b,n,o);break e}x&&x(e,l,r),"focusout"===e&&r&&"number"===l.type&&null!=r.memoizedProps.value&&to(l,"number",l.value)}switch(x=r?eV(r):window,e){case"focusin":(nc(x)||"true"===x.contentEditable)&&(n_=x,nM=r,nT=null);break;case"focusout":nT=nM=n_=null;break;case"mousedown":nR=!0;break;case"contextmenu":case"mouseup":case"dragend":nR=!1,nz(a,n,o);break;case"selectionchange":if(nA)break;case"keydown":case"keyup":nz(a,n,o)}if(ne)t:{switch(e){case"compositionstart":var w="onCompositionStart";break t;case"compositionend":w="onCompositionEnd";break t;case"compositionupdate":w="onCompositionUpdate";break t}w=void 0}else nl?ni(e,n)&&(w="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(w="onCompositionStart");w&&(nr&&"ko"!==n.locale&&(nl||"onCompositionStart"!==w?"onCompositionEnd"===w&&nl&&(g=tA()):(tE="value"in(tP=o)?tP.value:tP.textContent,nl=!0)),0<(x=cr(r,w)).length&&(w=new tX(w,e,null,n,o),a.push({event:w,listeners:x}),g?w.data=g:null!==(g=na(n))&&(w.data=g))),(g=nn?function(e,t){switch(e){case"compositionend":return na(t);case"keypress":if(32!==t.which)return null;return no=!0," ";case"textInput":return" "===(e=t.data)&&no?null:e;default:return null}}(e,n):function(e,t){if(nl)return"compositionend"===e||!ne&&ni(e,t)?(e=tA(),tI=tE=tP=null,nl=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return nr&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(w=cr(r,"onBeforeInput")).length&&(x=new tX("onBeforeInput","beforeinput",null,n,o),a.push({event:x,listeners:w}),x.data=g);var k=e;if("submit"===k&&r&&r.stateNode===o){var j=sQ((o[ez]||null).action),S=n.submitter;S&&null!==(k=(k=S[ez]||null)?sQ(k.formAction):S.getAttribute("formAction"))&&(j=k,S=null);var O=new t$("action","action",null,n,o);a.push({event:O,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==sK){var e=S?s0(o,S):new FormData(o);iQ(r,{pending:!0,data:e,method:o.method,action:j},null,e)}}else"function"==typeof j&&(O.preventDefault(),iQ(r,{pending:!0,data:e=S?s0(o,S):new FormData(o),method:o.method,action:j},j,e))},currentTarget:o}]})}}s5(a,t)})}function cn(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;if(5!==(o=o.tag)&&26!==o&&27!==o||null===i||(null!=(o=tS(e,n))&&r.unshift(cn(e,o,i)),null!=(o=tS(e,t))&&r.push(cn(e,o,i))),3===e.tag)return r;e=e.return}return[]}function co(e){if(null===e)return null;do e=e.return;while(e&&5!==e.tag&&27!==e.tag);return e||null}function ci(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var l=n,s=l.alternate,c=l.stateNode;if(l=l.tag,null!==s&&s===r)break;5!==l&&26!==l&&27!==l||null===c||(s=c,o?null!=(c=tS(n,i))&&a.unshift(cn(n,c,s)):o||null!=(c=tS(n,i))&&a.push(cn(n,c,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var ca=/\r\n?/g,cl=/\u0000|\uFFFD/g;function cs(e){return("string"==typeof e?e:""+e).replace(ca,"\n").replace(cl,"")}function cc(e,t){return t=cs(t),cs(e)===t}function cu(e,t,n,r,o,i){switch(n){case"children":"string"==typeof r?"body"===t||"textarea"===t&&""===r||ts(e,r):("number"==typeof r||"bigint"==typeof r)&&"body"!==t&&ts(e,""+r);break;case"className":e3(e,"class",r);break;case"tabIndex":e3(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":e3(e,n,r);break;case"style":td(e,r,i);break;case"data":if("object"!==t){e3(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)||null==r||"function"==typeof r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=tm(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"==typeof r){e.setAttribute(n,"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}if("function"==typeof i&&("formAction"===n?("input"!==t&&cu(e,t,"name",o.name,o,null),cu(e,t,"formEncType",o.formEncType,o,null),cu(e,t,"formMethod",o.formMethod,o,null),cu(e,t,"formTarget",o.formTarget,o,null)):(cu(e,t,"encType",o.encType,o,null),cu(e,t,"method",o.method,o,null),cu(e,t,"target",o.target,o,null))),null==r||"symbol"==typeof r||"boolean"==typeof r){e.removeAttribute(n);break}r=tm(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=tv);break;case"onScroll":null!=r&&s6("scroll",e);break;case"onScrollEnd":null!=r&&s6("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(l(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(l(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"muted":e.muted=r&&"function"!=typeof r&&"symbol"!=typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":case"innerText":case"textContent":break;case"xlinkHref":if(null==r||"function"==typeof r||"boolean"==typeof r||"symbol"==typeof r){e.removeAttribute("xlink:href");break}n=tm(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!=typeof r&&"symbol"!=typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!=typeof r&&"symbol"!=typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"==typeof r||"symbol"==typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":s6("beforetoggle",e),s6("toggle",e),e2(e,"popover",r);break;case"xlinkActuate":e4(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":e4(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":e4(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":e4(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":e4(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":e4(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":e4(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":e4(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":e4(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":e2(e,"is",r);break;default:2<n.length&&("o"===n[0]||"O"===n[0])&&("n"===n[1]||"N"===n[1])||e2(e,n=tp.get(n)||n,r)}}function cd(e,t,n,r,o,i){switch(n){case"style":td(e,r,i);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!=typeof r||!("__html"in r))throw Error(l(61));if(null!=(n=r.__html)){if(null!=o.children)throw Error(l(60));e.innerHTML=n}}break;case"children":"string"==typeof r?ts(e,r):("number"==typeof r||"bigint"==typeof r)&&ts(e,""+r);break;case"onScroll":null!=r&&s6("scroll",e);break;case"onScrollEnd":null!=r&&s6("scrollend",e);break;case"onClick":null!=r&&(e.onclick=tv);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:if(!eY.hasOwnProperty(n))e:{if("o"===n[0]&&"n"===n[1]&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),"function"==typeof(i=null!=(i=e[ez]||null)?i[n]:null)&&e.removeEventListener(t,i,o),"function"==typeof r)){"function"!=typeof i&&null!==i&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,o);break e}n in e?e[n]=r:!0===r?e.setAttribute(n,""):e2(e,n,r)}}}function cf(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":s6("error",e),s6("load",e);var r,o=!1,i=!1;for(r in n)if(n.hasOwnProperty(r)){var a=n[r];if(null!=a)switch(r){case"src":o=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:cu(e,t,r,a,n,null)}}i&&cu(e,t,"srcSet",n.srcSet,n,null),o&&cu(e,t,"src",n.src,n,null);return;case"input":s6("invalid",e);var s=r=a=i=null,c=null,u=null;for(o in n)if(n.hasOwnProperty(o)){var d=n[o];if(null!=d)switch(o){case"name":i=d;break;case"type":a=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":s=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(l(137,t));break;default:cu(e,t,o,d,n,null)}}tr(e,r,s,c,u,a,i,!1);return;case"select":for(i in s6("invalid",e),o=a=r=null,n)if(n.hasOwnProperty(i)&&null!=(s=n[i]))switch(i){case"value":r=s;break;case"defaultValue":a=s;break;case"multiple":o=s;default:cu(e,t,i,s,n,null)}t=r,n=a,e.multiple=!!o,null!=t?ti(e,!!o,t,!1):null!=n&&ti(e,!!o,n,!0);return;case"textarea":for(a in s6("invalid",e),r=i=o=null,n)if(n.hasOwnProperty(a)&&null!=(s=n[a]))switch(a){case"value":o=s;break;case"defaultValue":i=s;break;case"children":r=s;break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(l(91));break;default:cu(e,t,a,s,n,null)}tl(e,o,i,r);return;case"option":for(c in n)n.hasOwnProperty(c)&&null!=(o=n[c])&&("selected"===c?e.selected=o&&"function"!=typeof o&&"symbol"!=typeof o:cu(e,t,c,o,n,null));return;case"dialog":s6("beforetoggle",e),s6("toggle",e),s6("cancel",e),s6("close",e);break;case"iframe":case"object":s6("load",e);break;case"video":case"audio":for(o=0;o<s3.length;o++)s6(s3[o],e);break;case"image":s6("error",e),s6("load",e);break;case"details":s6("toggle",e);break;case"embed":case"source":case"link":s6("error",e),s6("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(o=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:cu(e,t,u,o,n,null)}return;default:if(tf(t)){for(d in n)n.hasOwnProperty(d)&&void 0!==(o=n[d])&&cd(e,t,d,o,n,void 0);return}}for(s in n)n.hasOwnProperty(s)&&null!=(o=n[s])&&cu(e,t,s,o,n,null)}function cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var ch=null,cm=null;function cv(e){return 9===e.nodeType?e:e.ownerDocument}function cg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cy(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function cb(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var cx=null,cw="function"==typeof setTimeout?setTimeout:void 0,ck="function"==typeof clearTimeout?clearTimeout:void 0,cj="function"==typeof Promise?Promise:void 0,cS="function"==typeof queueMicrotask?queueMicrotask:void 0!==cj?function(e){return cj.resolve(null).then(e).catch(cO)}:cw;function cO(e){setTimeout(function(){throw e})}function cC(e){return"head"===e}function cN(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)||"/&"===n){if(0===r){e.removeChild(o),u_(t);return}r--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)r++;else if("html"===n)cL(e.ownerDocument.documentElement);else if("head"===n){cL(n=e.ownerDocument.head);for(var i=n.firstChild;i;){var a=i.nextSibling,l=i.nodeName;i[e$]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===i.rel.toLowerCase()||n.removeChild(i),i=a}}else"body"===n&&cL(e.ownerDocument.body);n=o}while(n);u_(t)}function cP(e,t){var n=e;e=0;do{var r=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&8===r.nodeType)if("/$"===(n=r.data))if(0===e)break;else e--;else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=r}while(n)}function cE(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":cE(n),eB(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function cI(e,t){for(;8!==e.nodeType;)if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t||null===(e=cM(e.nextSibling)))return null;return e}function cA(e){return"$?"===e.data||"$~"===e.data}function c_(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function cM(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}var cT=null;function cR(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return cM(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function cz(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function cD(e,t,n){switch(t=cv(n),e){case"html":if(!(e=t.documentElement))throw Error(l(452));return e;case"head":if(!(e=t.head))throw Error(l(453));return e;case"body":if(!(e=t.body))throw Error(l(454));return e;default:throw Error(l(451))}}function cL(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);eB(e)}var cF=new Map,cU=new Set;function cH(e){return"function"==typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var c$=M.d;M.d={f:function(){var e=c$.f(),t=sd();return e||t},r:function(e){var t=eq(e);null!==t&&5===t.tag&&"form"===t.type?i1(t):c$.r(e)},D:function(e){c$.D(e),cK("dns-prefetch",e,null)},C:function(e,t){c$.C(e,t),cK("preconnect",e,t)},L:function(e,t,n){if(c$.L(e,t,n),cB&&e&&t){var r='link[rel="preload"][as="'+tt(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+tt(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+tt(n.imageSizes)+'"]')):r+='[href="'+tt(e)+'"]';var o=r;switch(t){case"style":o=cV(e);break;case"script":o=cZ(e)}cF.has(o)||(e=f({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),cF.set(o,e),null!==cB.querySelector(r)||"style"===t&&cB.querySelector(cW(o))||"script"===t&&cB.querySelector(cY(o))||(cf(t=cB.createElement("link"),"link",e),eG(t),cB.head.appendChild(t)))}},m:function(e,t){if(c$.m(e,t),cB&&e){var n=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+tt(n)+'"][href="'+tt(e)+'"]',o=r;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=cZ(e)}if(!cF.has(o)&&(e=f({rel:"modulepreload",href:e},t),cF.set(o,e),null===cB.querySelector(r))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(cB.querySelector(cY(o)))return}cf(n=cB.createElement("link"),"link",e),eG(n),cB.head.appendChild(n)}}},X:function(e,t){if(c$.X(e,t),cB&&e){var n=eW(cB).hoistableScripts,r=cZ(e),o=n.get(r);o||((o=cB.querySelector(cY(r)))||(e=f({src:e,async:!0},t),(t=cF.get(r))&&c0(e,t),eG(o=cB.createElement("script")),cf(o,"link",e),cB.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}},S:function(e,t,n){if(c$.S(e,t,n),cB&&e){var r=eW(cB).hoistableStyles,o=cV(e);t=t||"default";var i=r.get(o);if(!i){var a={loading:0,preload:null};if(i=cB.querySelector(cW(o)))a.loading=5;else{e=f({rel:"stylesheet",href:e,"data-precedence":t},n),(n=cF.get(o))&&cQ(e,n);var l=i=cB.createElement("link");eG(l),cf(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,cJ(i,t,cB)}i={type:"stylesheet",instance:i,count:1,state:a},r.set(o,i)}}},M:function(e,t){if(c$.M(e,t),cB&&e){var n=eW(cB).hoistableScripts,r=cZ(e),o=n.get(r);o||((o=cB.querySelector(cY(r)))||(e=f({src:e,async:!0,type:"module"},t),(t=cF.get(r))&&c0(e,t),eG(o=cB.createElement("script")),cf(o,"link",e),cB.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(r,o))}}};var cB="u"<typeof document?null:document;function cK(e,t,n){if(cB&&"string"==typeof t&&t){var r=tt(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),cU.has(r)||(cU.add(r),e={rel:e,crossOrigin:n,href:t},null===cB.querySelector(r)&&(cf(t=cB.createElement("link"),"link",e),eG(t),cB.head.appendChild(t)))}}function cq(e,t,n,r){var o=(o=$.current)?cH(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(t=cV(n.href),(r=(n=eW(o).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=cV(n.href);var i,a,s,c,u=eW(o).hoistableStyles,d=u.get(e);if(d||(o=o.ownerDocument||o,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=o.querySelector(cW(e)))&&!u._p&&(d.instance=u,d.state.loading=5),cF.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},cF.set(e,n),u||(i=o,a=e,s=n,c=d.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(c.preload=a=i.createElement("link"),a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),cf(a,"link",s),eG(a),i.head.appendChild(a))))),t&&null===r)throw Error(l(528,""));return d}if(t&&null!==r)throw Error(l(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(t=cZ(n),(r=(n=eW(o).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function cV(e){return'href="'+tt(e)+'"'}function cW(e){return'link[rel="stylesheet"]['+e+"]"}function cG(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function cZ(e){return'[src="'+tt(e)+'"]'}function cY(e){return"script[async]"+e}function cX(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+tt(n.href)+'"]');if(r)return t.instance=r,eG(r),r;var o=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return eG(r=(e.ownerDocument||e).createElement("style")),cf(r,"style",o),cJ(r,n.precedence,e),t.instance=r;case"stylesheet":o=cV(n.href);var i=e.querySelector(cW(o));if(i)return t.state.loading|=4,t.instance=i,eG(i),i;r=cG(n),(o=cF.get(o))&&cQ(r,o),eG(i=(e.ownerDocument||e).createElement("link"));var a=i;return a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),cf(i,"link",r),t.state.loading|=4,cJ(i,n.precedence,e),t.instance=i;case"script":if(i=cZ(n.src),o=e.querySelector(cY(i)))return t.instance=o,eG(o),o;return r=n,(o=cF.get(i))&&c0(r=f({},n),o),eG(o=(e=e.ownerDocument||e).createElement("script")),cf(o,"link",r),e.head.appendChild(o),t.instance=o;case"void":return null;default:throw Error(l(443,t.type))}return"stylesheet"===t.type&&0==(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,cJ(r,n.precedence,e)),t.instance}function cJ(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=r.length?r[r.length-1]:null,i=o,a=0;a<r.length;a++){var l=r[a];if(l.dataset.precedence===t)i=l;else if(i!==o)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function cQ(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function c0(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var c1=null;function c2(e,t,n){if(null===c1){var r=new Map,o=c1=new Map;o.set(n,r)}else(r=(o=c1).get(n))||(r=new Map,o.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var i=n[o];if(!(i[e$]||i[eR]||"link"===e&&"stylesheet"===i.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==i.namespaceURI){var a=i.getAttribute(t)||"";a=e+a;var l=r.get(a);l?l.push(i):r.set(a,[i])}}return r}function c3(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function c4(e){return"stylesheet"!==e.type||0!=(3&e.state.loading)}var c5=0;function c6(){if(this.count--,0===this.count&&(0===this.imgCount||!this.waitingForImages)){if(this.stylesheets)c9(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c8=null;function c9(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c8=new Map,t.forEach(c7,e),c8=null,c6.call(e))}function c7(e,t){if(!(4&t.state.loading)){var n=c8.get(e);if(n)var r=n.get(null);else{n=new Map,c8.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<o.length;i++){var a=o[i];("LINK"===a.nodeName||"not all"!==a.getAttribute("media"))&&(n.set(a.dataset.precedence,a),r=a)}r&&n.set(null,r)}a=(o=t.instance).getAttribute("data-precedence"),(i=n.get(a)||r)===r&&n.set(null,o),n.set(a,o),this.count++,r=c6.bind(this),o.addEventListener("load",r),o.addEventListener("error",r),i?i.parentNode.insertBefore(o,i.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(o,e.firstChild),t.state.loading|=4}}var ue={$$typeof:x,Provider:null,Consumer:null,_currentValue:T,_currentValue2:T,_threadCount:0};function ut(e,t,n,r,o,i,a,l,s){this.tag=1,this.containerInfo=e,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=eO(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eO(0),this.hiddenUpdates=eO(null),this.identifierPrefix=r,this.onUncaughtError=o,this.onCaughtError=i,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function un(e,t,n,r,o,i){o=o?n9:n9,null===r.context?r.context=o:r.pendingContext=o,(r=oS(t)).payload={element:n},null!==(i=void 0===i?null:i)&&(r.callback=i),null!==(n=oO(e,r,t))&&(sl(n,e,t),oC(n,e,t))}function ur(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function uo(e,t){ur(e,t),(e=e.alternate)&&ur(e,t)}function ui(e){if(13===e.tag||31===e.tag){var t=n5(e,0x4000000);null!==t&&sl(t,e,0x4000000),uo(e,0x4000000)}}function ua(e){if(13===e.tag||31===e.tag){var t=si(),n=n5(e,t=eI(t));null!==n&&sl(n,e,t),uo(e,t)}}var ul=!0;function us(e,t,n,r){var o=_.T;_.T=null;var i=M.p;try{M.p=2,uu(e,t,n,r)}finally{M.p=i,_.T=o}}function uc(e,t,n,r){var o=_.T;_.T=null;var i=M.p;try{M.p=8,uu(e,t,n,r)}finally{M.p=i,_.T=o}}function uu(e,t,n,r){if(ul){var o=ud(r);if(null===o)ct(e,t,r,uf,n),uj(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return uv=uS(uv,e,t,n,r,o),!0;case"dragenter":return ug=uS(ug,e,t,n,r,o),!0;case"mouseover":return uy=uS(uy,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ub.set(i,uS(ub.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ux.set(i,uS(ux.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(uj(e,r),4&t&&-1<uk.indexOf(e)){for(;null!==o;){var i=eq(o);if(null!==i)switch(i.tag){case 3:if((i=i.stateNode).current.memoizedState.isDehydrated){var a=ew(i.pendingLanes);if(0!==a){var l=i;for(l.pendingLanes|=2,l.entangledLanes|=2;a;){var s=1<<31-em(a);l.entanglements[1]|=s,a&=~s}sq(i),0==(6&lz)&&(l3=er()+500,sV(0,!1))}}break;case 31:case 13:null!==(l=n5(i,2))&&sl(l,i,2),sd(),uo(i,2)}if(null===(i=ud(r))&&ct(e,t,r,uf,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else ct(e,t,r,null,n)}}function ud(e){return up(e=ty(e))}var uf=null;function up(e){if(uf=null,null!==(e=eK(e))){var t=s(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(31===n){if(null!==(e=u(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return uf=e,null}function uh(e){switch(e){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(eo()){case ei:return 2;case ea:return 8;case el:case es:return 32;case ec:return 0x10000000;default:return 32}default:return 32}}var um=!1,uv=null,ug=null,uy=null,ub=new Map,ux=new Map,uw=[],uk="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 uj(e,t){switch(e){case"focusin":case"focusout":uv=null;break;case"dragenter":case"dragleave":ug=null;break;case"mouseover":case"mouseout":uy=null;break;case"pointerover":case"pointerout":ub.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ux.delete(t.pointerId)}}function uS(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&null!==(t=eq(t))&&ui(t)):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o)),e}function uO(e){var t=eK(e.target);if(null!==t){var n=s(t);if(null!==n){if(13===(t=n.tag)){if(null!==(t=c(n))){e.blockedOn=t,eM(e.priority,function(){ua(n)});return}}else if(31===t){if(null!==(t=u(n))){e.blockedOn=t,eM(e.priority,function(){ua(n)});return}}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=3===n.tag?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uC(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=ud(e.nativeEvent);if(null!==n)return null!==(t=eq(n))&&ui(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);tg=r,n.target.dispatchEvent(r),tg=null,t.shift()}return!0}function uN(e,t,n){uC(e)&&n.delete(t)}function uP(){um=!1,null!==uv&&uC(uv)&&(uv=null),null!==ug&&uC(ug)&&(ug=null),null!==uy&&uC(uy)&&(uy=null),ub.forEach(uN),ux.forEach(uN)}function uE(e,t){e.blockedOn===t&&(e.blockedOn=null,um||(um=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,uP)))}var uI=null;function uA(e){uI!==e&&(uI=e,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){uI===e&&(uI=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],o=e[t+2];if("function"!=typeof r)if(null===up(r||n))continue;else break;var i=eq(n);null!==i&&(e.splice(t,3),t-=3,iQ(i,{pending:!0,data:o,method:n.method,action:r},r,o))}}))}function u_(e){function t(t){return uE(t,e)}null!==uv&&uE(uv,e),null!==ug&&uE(ug,e),null!==uy&&uE(uy,e),ub.forEach(t),ux.forEach(t);for(var n=0;n<uw.length;n++){var r=uw[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<uw.length&&null===(n=uw[0]).blockedOn;)uO(n),null===n.blockedOn&&uw.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var o=n[r],i=n[r+1],a=o[ez]||null;if("function"==typeof i)a||uA(n);else if(a){var l=null;if(i&&i.hasAttribute("formAction")){if(o=i,a=i[ez]||null)l=a.formAction;else if(null!==up(o))continue}else l=a.action;"function"==typeof l?n[r+1]=l:(n.splice(r,3),r-=3),uA(n)}}}function uM(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return o=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==o&&(o(),o=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var r=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),null!==o&&(o(),o=null)}}}function uT(e){this._internalRoot=e}function uR(e){this._internalRoot=e}uR.prototype.render=uT.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(l(409));un(t.current,si(),e,t,null,null)},uR.prototype.unmount=uT.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;un(e.current,2,null,e,null,null),sd(),t[eD]=null}},uR.prototype.unstable_scheduleHydration=function(e){if(e){var t=e_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<uw.length&&0!==t&&t<uw[n].priority;n++);uw.splice(n,0,e),0===n&&uO(e)}};var uz=i.version;if("19.2.8"!==uz)throw Error(l(527,uz,"19.2.8"));if(M.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(l(188));throw Error(l(268,e=Object.keys(e).join(",")))}return null===(e=null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=s(e)))throw Error(l(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return d(o),e;if(i===r)return d(o),t;i=i.sibling}throw Error(l(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,c=o.child;c;){if(c===n){a=!0,n=o,r=i;break}if(c===r){a=!0,r=o,n=i;break}c=c.sibling}if(!a){for(c=i.child;c;){if(c===n){a=!0,n=i,r=o;break}if(c===r){a=!0,r=i,n=o;break}c=c.sibling}if(!a)throw Error(l(189))}}if(n.alternate!==r)throw Error(l(190))}if(3!==n.tag)throw Error(l(188));return n.stateNode.current===n?e:t}(t))?function e(t){var n=t.tag;if(5===n||26===n||27===n||6===n)return t;for(t=t.child;null!==t;){if(null!==(n=e(t)))return n;t=t.sibling}return null}(e):null)?null:e.stateNode},"u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uD=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uD.isDisabled&&uD.supportsFiber)try{ef=uD.inject({bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"}),ep=uD}catch(e){}}t.createRoot=function(e,t){if(!(n=e)||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(l(299));var n,r,o,i,a,s=!1,c="",u=af,d=ap,f=ah;return null!=t&&(!0===t.unstable_strictMode&&(s=!0),void 0!==t.identifierPrefix&&(c=t.identifierPrefix),void 0!==t.onUncaughtError&&(u=t.onUncaughtError),void 0!==t.onCaughtError&&(d=t.onCaughtError),void 0!==t.onRecoverableError&&(f=t.onRecoverableError)),r=e,o=1,i=!1,a=s,r=new ut(r,o,i,c,u,d,f,uM,null),o=1,!0===a&&(o|=24),a=re(3,null,null,o),r.current=a,a.stateNode=r,o=r1(),o.refCount++,r.pooledCache=o,o.refCount++,a.memoizedState={element:null,isDehydrated:i,cache:o},ok(a),t=r,e[eD]=t.current,s7(e),new uT(t)}},2310(e,t,n){var r=n(4041);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var a={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal"),s=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:l,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=a.p;try{if(s.T=null,a.p=2,e)return e()}finally{s.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){"string"==typeof e&&(t=t?"string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:null,a.d.C(e,t))},t.prefetchDNS=function(e){"string"==typeof e&&a.d.D(e)},t.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=c(n,t.crossOrigin),o="string"==typeof t.integrity?t.integrity:void 0,i="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?a.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:i}):"script"===n&&a.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:i,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=c(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&a.d.M(e)},t.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=c(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=c(t.as,t.crossOrigin);a.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},t.useFormStatus=function(){return s.H.useHostTransitionStatus()},t.version="19.2.8"},5873(e,t,n){!function e(){if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(6974)},3144(e,t,n){!function e(){if("u">typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(2310)},1197(e,t){var n=Symbol.for("react.transitional.element");function r(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return{$$typeof:n,type:e,key:o,ref:void 0!==(t=r.ref)?t:null,props:r}}t.Fragment=Symbol.for("react.fragment"),t.jsx=r,t.jsxs=r},2062(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator,m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function b(){}function x(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var w=x.prototype=new b;w.constructor=x,v(w,y.prototype),w.isPureReactComponent=!0;var k=Array.isArray;function j(){}var S={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function C(e,t,r){var o=r.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==o?o:null,props:r}}function N(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var P=/\/+/g;function E(e,t){var n,r;return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return r[e]})):t.toString(36)}function I(e,t,o){if(null==e)return e;var i=[],a=0;return!function e(t,o,i,a,l){var s,c,u,d=typeof t;("undefined"===d||"boolean"===d)&&(t=null);var p=!1;if(null===t)p=!0;else switch(d){case"bigint":case"string":case"number":p=!0;break;case"object":switch(t.$$typeof){case n:case r:p=!0;break;case f:return e((p=t._init)(t._payload),o,i,a,l)}}if(p)return l=l(t),p=""===a?"."+E(t,0):a,k(l)?(i="",null!=p&&(i=p.replace(P,"$&/")+"/"),e(l,o,i,"",function(e){return e})):null!=l&&(N(l)&&(s=l,c=i+(null==l.key||t&&t.key===l.key?"":(""+l.key).replace(P,"$&/")+"/")+p,l=C(s.type,c,s.props)),o.push(l)),1;p=0;var m=""===a?".":a+":";if(k(t))for(var v=0;v<t.length;v++)d=m+E(a=t[v],v),p+=e(a,o,i,d,l);else if("function"==typeof(v=null===(u=t)||"object"!=typeof u?null:"function"==typeof(u=h&&u[h]||u["@@iterator"])?u:null))for(t=v.call(t),v=0;!(a=t.next()).done;)d=m+E(a=a.value,v++),p+=e(a,o,i,d,l);else if("object"===d){if("function"==typeof t.then)return e(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(j,j):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(t),o,i,a,l);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===(o=String(t))?"object with keys {"+Object.keys(t).join(", ")+"}":o)+"). If you meant to render a collection of children, use an array instead.")}return p}(e,i,"","",function(e){return t.call(o,e,a++)}),i}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){(0===e._status||-1===e._status)&&(e._status=1,e._result=t)},function(t){(0===e._status||-1===e._status)&&(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var _="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};t.Activity=p,t.Children={map:I,forEach:function(e,t,n){I(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return I(e,function(){t++}),t},toArray:function(e){return I(e,function(e){return e})||[]},only:function(e){if(!N(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=o,t.Profiler=a,t.PureComponent=x,t.StrictMode=i,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var r=v({},e.props),o=e.key;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)O.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&("ref"!==i||void 0!==t.ref)&&(r[i]=t[i]);var i=arguments.length-2;if(1===i)r.children=n;else if(1<i){for(var a=Array(i),l=0;l<i;l++)a[l]=arguments[l+2];r.children=a}return C(e.type,o,r)},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:l,_context:e},e},t.createElement=function(e,t,n){var r,o={},i=null;if(null!=t)for(r in void 0!==t.key&&(i=""+t.key),t)O.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(o[r]=t[r]);var a=arguments.length-2;if(1===a)o.children=n;else if(1<a){for(var l=Array(a),s=0;s<a;s++)l[s]=arguments[s+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps)void 0===o[r]&&(o[r]=a[r]);return C(e,i,o)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=N,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=S.T,n={};S.T=n;try{var r=e(),o=S.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(j,_)}catch(e){_(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),S.T=t}},t.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},t.use=function(e){return S.H.use(e)},t.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},t.useCallback=function(e,t){return S.H.useCallback(e,t)},t.useContext=function(e){return S.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return S.H.useEffect(e,t)},t.useEffectEvent=function(e){return S.H.useEffectEvent(e)},t.useId=function(){return S.H.useId()},t.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return S.H.useMemo(e,t)},t.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},t.useRef=function(e){return S.H.useRef(e)},t.useState=function(e){return S.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return S.H.useTransition()},t.version="19.2.8"},4041(e,t,n){e.exports=n(2062)},1085(e,t,n){e.exports=n(1197)},6310(e,t){function n(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,o=e[r];if(0<i(o,t))e[r]=t,e[n]=o,n=r;else break}}function r(e){return 0===e.length?null:e[0]}function o(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,o=e.length,a=o>>>1;r<a;){var l=2*(r+1)-1,s=e[l],c=l+1,u=e[c];if(0>i(s,n))c<o&&0>i(u,s)?(e[r]=u,e[c]=n,r=c):(e[r]=s,e[l]=n,r=l);else if(c<o&&0>i(u,n))e[r]=u,e[c]=n,r=c;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a,l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var u=[],d=[],f=1,p=null,h=3,m=!1,v=!1,g=!1,y=!1,b="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,w="u">typeof setImmediate?setImmediate:null;function k(e){for(var t=r(d);null!==t;){if(null===t.callback)o(d);else if(t.startTime<=e)o(d),t.sortIndex=t.expirationTime,n(u,t);else break;t=r(d)}}function j(e){if(g=!1,k(e),!v)if(null!==r(u))v=!0,S||(S=!0,a());else{var t=r(d);null!==t&&_(j,t.startTime-e)}}var S=!1,O=-1,C=5,N=-1;function P(){return!!y||!(t.unstable_now()-N<C)}function E(){if(y=!1,S){var e=t.unstable_now();N=e;var n=!0;try{e:{v=!1,g&&(g=!1,x(O),O=-1),m=!0;var i=h;try{t:{for(k(e),p=r(u);null!==p&&!(p.expirationTime>e&&P());){var l=p.callback;if("function"==typeof l){p.callback=null,h=p.priorityLevel;var s=l(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof s){p.callback=s,k(e),n=!0;break t}p===r(u)&&o(u),k(e)}else o(u);p=r(u)}if(null!==p)n=!0;else{var c=r(d);null!==c&&_(j,c.startTime-e),n=!1}}break e}finally{p=null,h=i,m=!1}}}finally{n?a():S=!1}}}if("function"==typeof w)a=function(){w(E)};else if("u">typeof MessageChannel){var I=new MessageChannel,A=I.port2;I.port1.onmessage=E,a=function(){A.postMessage(null)}}else a=function(){b(E,0)};function _(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},t.unstable_scheduleCallback=function(e,o,i){var l=t.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?l+i:l,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=i+s,e={id:f++,callback:o,priorityLevel:e,startTime:i,expirationTime:s,sortIndex:-1},i>l?(e.sortIndex=i,n(d,e),null===r(u)&&e===r(d)&&(g?(x(O),O=-1):g=!0,_(j,i-l))):(e.sortIndex=s,n(u,e),v||m||(v=!0,S||(S=!0,a()))),e},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},7967(e,t,n){e.exports=n(6310)},3296(e,t,n){var r=n(4041),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})},[e,n,t]),a(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},1435(e,t,n){var r=n(4041),o=n(8139),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var d=l(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var p=a(e,(d=c(function(){function e(e){if(!s){if(s=!0,a=e,e=r(e),void 0!==o&&f.hasValue){var t=f.value;if(o(t,e))return l=t}return l=e}if(t=l,i(a,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(a=e,t):(a=e,l=n)}var a,l,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]))[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}},8139(e,t,n){e.exports=n(3296)},7121(e,t,n){e.exports=n(1435)},1434(e,t,n){let r;n.d(t,{Ru:()=>eb,CY:()=>eS,s9:()=>ej,Bd:()=>eh});var o,i=n(1085),a=n(7983);let l=e=>"string"==typeof e,s=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},c=e=>null==e?"":String(e),u=/###/g,d=e=>e&&e.includes("###")?e.replace(u,"."):e,f=e=>!e||l(e),p=(e,t,n)=>{let r=l(t)?t.split("."):t,o=0;for(;o<r.length-1;){if(f(e))return{};let t=d(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return f(e)?{}:{obj:e,k:d(r[o])}},h=(e,t,n)=>{let{obj:r,k:o}=p(e,t,Object);if(void 0!==r||1===t.length){r[o]=n;return}let i=t[t.length-1],a=t.slice(0,t.length-1),l=p(e,a,Object);for(;void 0===l.obj&&a.length;)i=`${a[a.length-1]}.${i}`,l=p(e,a=a.slice(0,a.length-1),Object),l?.obj&&void 0!==l.obj[`${l.k}.${i}`]&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=n},m=(e,t)=>{let{obj:n,k:r}=p(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},v=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(Object.prototype.hasOwnProperty.call(e,r)?l(e[r])||e[r]instanceof String||l(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):v(e[r],t[r],n):e[r]=t[r]);return e},g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},y=e=>l(e)?e.replace(/[&<>"'\/]/g,e=>g[e]):e,b=[" ",",","?","!",";"],x=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),w=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),o=e;for(let e=0;e<r.length;){let t;if(!o||"object"!=typeof o)return;let i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],void 0!==(t=o[i])){if(["string","number","boolean"].includes(typeof t)&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},k=e=>e?.replace(/_/g,"-"),j={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class S{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||j,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(e=e.map(e=>l(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),l(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new S(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new S(this.logger,e)}}var O=new S;class C{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n(e,...t)})}}class N extends C{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let o,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.includes(".")?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):l(n)&&i?o.push(...n.split(i)):o.push(n)));let s=m(this.data,o);return(!s&&!t&&!n&&e.includes(".")&&(e=o[0],t=o[1],n=o.slice(2).join(".")),!s&&a&&l(n))?w(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,o={silent:!1}){let i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.includes(".")&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),h(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(l(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o,i={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let l=m(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?v(l,n,o):l={...l,...n},h(this.data,a,l),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var P={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,o)??t}),t}};let E=Symbol("i18next/PATH_KEY");function I(e,t){let n,r,o,{[E]:i}=e((r=[],(o=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===E)?r:(r.push(t),(n=Proxy.revocable(e,o)).proxy),Proxy.revocable(Object.create(null),o).proxy)),a=t?.keySeparator??".",l=t?.nsSeparator??":",s=t?.enableSelector==="strict";if(i.length>1&&l){let e=t?.ns,n=s?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(n&&(s?n:n.length>1?n.slice(1):[]).includes(i[0]))return`${i[0]}${l}${i.slice(1).join(a)}`}return i.join(a)}let A=e=>!l(e)&&"boolean"!=typeof e&&"number"!=typeof e;class _ extends C{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=O.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let o=A(r.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.includes(n),a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=b.filter(e=>!t.includes(e)&&!n.includes(e));if(0===r.length)return!0;let o=x.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),i=!o.test(e);if(!i){let t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r);if(i&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:l(o)?[o]:o};let i=e.split(n);(n!==r||n===r&&this.options.ns.includes(i[0]))&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:l(o)?[o]:o}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=I(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?I(e,{...this.options,...r}):String(e));let o=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),c=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let d=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return f?o?{res:`${c}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${u}${a}`:o?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:a;let p=this.resolve(e,r),h=p?.res,m=p?.usedKey||a,v=p?.exactUsedKey||a,g=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==r.count&&!l(r.count),x=_.hasDefaultValue(r),w=b?this.pluralResolver.getSuffix(d,r.count,r):"",k=r.ordinal&&b?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",j=b&&!r.ordinal&&0===r.count,S=j&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${k}`]||r.defaultValue,O=h;y&&!h&&x&&(O=S);let C=A(O),N=Object.prototype.toString.apply(O);if(y&&O&&C&&!["[object Number]","[object Function]","[object RegExp]"].includes(N)&&!(l(g)&&Array.isArray(O))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,O,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return o?(p.res=e,p.usedParams=this.getUsedParamsDetails(r),p):e}if(i){let e=Array.isArray(O),t=e?[]:{},n=e?v:m;for(let e in O)if(Object.prototype.hasOwnProperty.call(O,e)){let o=`${n}${i}${e}`;x&&!h?t[e]=this.translate(o,{...r,defaultValue:A(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(o,{...r,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=O[e])}h=t}}else if(y&&l(g)&&Array.isArray(h))(h=h.join(g))&&(h=this.extendTranslation(h,e,r,n));else{let t=!1,o=!1;!this.isValidLookup(h)&&x&&(t=!0,h=S),this.isValidLookup(h)||(o=!0,h=a);let l=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,s=x&&S!==h&&this.options.updateMissing;if(o||t||s){if(this.logger.log(s?"updateKey":"missingKey",d,c,b&&!s?`${a}${this.pluralResolver.getSuffix(d,r.count,r)}`:a,s?S:h),i){let e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let o=x&&n!==h?n:l;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,o,s,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,c,t,o,s,r),this.emit("missingKey",e,c,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);j&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||S)})}):n(e,a,S))}h=this.extendTranslation(h,e,r,p,n),o&&h===a&&this.options.appendNamespaceToMissingKey&&(h=`${c}${u}${a}`),(o||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${a}`:a,t?h:void 0,r))}return o?(p.res=h,p.usedParams=this.getUsedParamsDetails(r),p):h}extendTranslation(e,t,n,r,o){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let a=l(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let s=n.replace&&!l(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>o?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let i=n.postProcess||this.options.postProcess,a=l(i)?[i]:i;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=P.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,o,i,a;return l(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?I(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let d=void 0!==t.count&&!l(t.count),f=d&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(l(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(a=e,!this.checkedLoadedFor[`${h[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(this.checkedLoadedFor[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${h.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(r=>{let a;if(this.isValidLookup(n))return;i=r;let l=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(l,c,r,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(o)&&l.push(c+e.replace(o,this.options.pluralSeparator)),l.push(c+e),f&&l.push(c+n)),p){let r=`${c}${this.options.contextSeparator||"_"}${t.context}`;l.push(r),d&&(t.ordinal&&e.startsWith(o)&&l.push(r+e.replace(o,this.options.pluralSeparator)),l.push(r+e),f&&l.push(r+n))}}for(;a=l.pop();)this.isValidLookup(n)||(o=a,n=this.getResource(r,e,a,t))}))})}),{res:n,usedKey:r,exactUsedKey:o,usedLng:i,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!l(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n={...n,count:e.count}),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class M{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=k(e))||!e.includes("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=k(e))||!e.includes("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(l(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r||(!!e.includes("-")||!!r.includes("-"))&&!!(e.includes("-")&&!r.includes("-")&&e.slice(0,e.indexOf("-"))===r||e.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),l(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.options.fallbackLng,r=Array.isArray(n)?n.join("|"):n;r!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=r);let o=void 0===t||!1===t||l(t),i=void 0===t&&"function"==typeof this.options.fallbackLng,a=l(e)&&o&&!i,s=null;if(a){let n;n=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,s=`${e.length}:${e}|${n}`}if(null!==s){let e=this.resolveHierarchyCache[s];if(void 0!==e)return e.slice()}let c=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),u=[],d=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return(l(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&d(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&d(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&d(this.getLanguagePartFromCode(e))):l(e)&&d(this.formatLanguageCode(e)),c.forEach(e=>{u.includes(e)||d(this.formatLanguageCode(e))}),null!==s)?(this.resolveHierarchyCache[s]=u,u.slice()):u}}let T={zero:0,one:1,two:2,few:3,many:4,other:5},R={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class z{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=O.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=k("dev"===e?"en":e),o=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:o});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];try{n=new Intl.PluralRules(r,{type:o})}catch(o){if("u"<typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),R;if(!e.match(/-|_/))return R;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[i]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>T[e]-T[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let D=(e,t,n,r=".",o=!0)=>{let i,a=void 0!==(i=m(e,n))?i:m(t,n);return!a&&o&&l(n)&&void 0===(a=w(e,n,r))&&(a=w(t,n,r)),a},L=e=>e.replace(/\$/g,"$$$$");class F{constructor(e={}){this.logger=O.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:l,formatSeparator:s,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:y,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):i||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):l||"}}",this.formatSeparator=s||",",this.unescapePrefix=c?"":u?u.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"-",this.unescapeSuffix=this.unescapePrefix?"":c?c.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==g&&g,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(!e.includes(this.formatSeparator)){let o=D(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}let o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(D(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");let d=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}].forEach(t=>{for(a=0;o=t.regex.exec(e);){let n=o[1].trim();if(void 0===(i=u(n)))if("function"==typeof d){let t=d(e,o,r);i=l(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else if(f){i=o[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i="";else l(i)||this.useRawValueToEscape||(i=c(i));let s=t.safeValue(i);if(e=e.replace(o[0],L(s)),f?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,o,i,a=(e,t)=>{let n=this.nestingOptionsSeparator;if(!e.includes(n))return e;let r=e.split(RegExp(`${n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}[ ]*{`)),o=`{${r[1]}`;e=r[0];let a=(o=this.interpolate(o,i)).match(/'/g),l=o.match(/"/g);((a?.length??0)%2!=0||l)&&(l?.length??0)%2==0||(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return i.defaultValue&&i.defaultValue.includes(this.prefix)&&delete i.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(i=(i={...n}).replace&&!l(i.replace)?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;let u=/{.*}/s.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==u&&(s=r[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,u)),(o=t(a.call(this,r[1].trim(),i),i))&&r[0]===e&&!l(o))return o;l(o)||(o=c(o)),o||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),o.trim())),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e}}let U=e=>{let t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});let a=r+JSON.stringify(i),l=t[a];return l||(l=e(k(r),o),t[a]=l),l(n)}},H=e=>(t,n,r)=>e(k(n),r)(t);class ${constructor(e={}){this.logger=O.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?U:H;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=U(t)}format(e,t,n,r={}){if(!t||null==e)return e;let o=t.split(this.formatSeparator),i=[];for(let e=0;e<o.length;e++){let t=o[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<o.length;)t=`${t}${this.formatSeparator}${o[++e]}`;i.push(t)}return i.reduce((e,t)=>{let{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.includes("(")){let r=e.split("(");t=r[0].toLowerCase().trim();let o=r[1].slice(0,-1);"currency"!==t||o.includes(":")?"relativetime"!==t||o.includes(":")?o.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}}):n.range||(n.range=o.trim()):n.currency||(n.currency=o.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{let a=r?.formatParams?.[r.interpolationkey]||{},l=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,l,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class B extends C{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=O.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let o={},i={},a={},l={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===l[t]&&(l[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,n){let r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let a={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:o,k:i}=p(e,t,Object);o[i]=o[i]||[],o[i].push(n)})(n.loaded,[o],i),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;let a=(a,l)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&l&&r<this.maxRetries?setTimeout(()=>{this.read(e,t,n,r+1,2*o,i)},o):i(a,l)},l=this.backend[n].bind(this.backend);if(2===l.length){try{let n=l(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}return}return l(e,t,a)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();l(e)&&(e=this.languageUtils.toResolveHierarchy(e)),l(t)&&(t=[t]);let o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o,i={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let l={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;(o=5===s.length?s(e,t,n,r,l):s(e,t,n,r))&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let K=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),l(e[1])&&(t.defaultValue=e[1]),l(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),q=e=>(l(e.ns)&&(e.ns=[e.ns]),l(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),l(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),V=()=>{};class W extends C{constructor(e={},t){if(super(),this.options=q(e),this.services={},this.logger=O,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(l(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));let n=K();this.options={...n,...this.options,...q(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?O.init(r(this.modules.logger),this.options):O.init(null,this.options),e=this.modules.formatter?this.modules.formatter:$;let t=new M(this.options);this.store=new N(this.options.resources,this.options);let n=this.services;n.logger=O,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new z(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=r(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new F(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new B(r(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=r(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=r(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new _(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=V),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let o=s(),i=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),o}loadResources(e,t=V){let n=t,r=l(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=s();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=V),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&P.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=s();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);let n=l(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(l(t)?[t]:t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),n}getFixedT(e,t,n,r){let o=r?.scopeNs,i=(e,t,...r)=>{let a,l;(a="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(r)):{...t}).lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs;let s=void 0!==a.ns&&null!==a.ns;a.ns=a.ns||i.ns,""!==a.keyPrefix&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);let c={...this.options,...a};Array.isArray(o)&&!s&&(c.ns=o),"function"==typeof a.keyPrefix&&(a.keyPrefix=I(a.keyPrefix,c));let u=this.options.keySeparator||".";return a.keyPrefix&&Array.isArray(e)?l=e.map(e=>("function"==typeof e&&(e=I(e,c)),`${a.keyPrefix}${u}${e}`)):("function"==typeof e&&(e=I(e,c)),l=a.keyPrefix?`${a.keyPrefix}${u}${e}`:e),this.t(l,a)};return l(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let i=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,i);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!r||i(o,e)))}loadNamespaces(e,t){let n=s();return this.options.ns?(l(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=s();l(e)&&(e=[e]);let r=this.options.preload||[],o=e.filter(e=>!r.includes(e)&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new M(K());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){let n=new W(e,t);return n.createInstance=W.createInstance,n}cloneInstance(e={},t=V){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},o=new W(r);if((void 0!==e.debug||void 0!==e.prefix)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new N(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),o.services.resourceStore=o.store),e.interpolation){let t={...K().interpolation,...this.options.interpolation,...e.interpolation},n={...r,interpolation:t};o.services.interpolator=new F(n)}return o.translator=new _(o.services,r),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let G=W.createInstance();G.createInstance,G.dir,G.init,G.loadResources,G.reloadResources,G.use,G.changeLanguage,G.getFixedT,G.t,G.exists,G.setDefaultNamespace,G.hasLoadedNamespace,G.loadNamespaces,G.loadLanguages;var Z=n(4041);Object.create(null);let Y=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,X={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},J=e=>X[e],Q={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(Y,J),transDefaultProps:void 0},ee=(0,Z.createContext)();class et{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let en=(e,t,n,r)=>{let o=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);es(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},er={},eo=(e,t,n,r)=>{es(n)&&er[n]||(es(n)&&(er[n]=new Date),en(e,t,n,r))},ei=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},ea=(e,t,n)=>{e.loadNamespaces(t,ei(e,n))},el=(e,t,n,r)=>{if(es(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return ea(e,n,r);n.forEach(t=>{0>e.options.ns.indexOf(t)&&e.options.ns.push(t)}),e.loadLanguages(t,ei(e,r))},es=e=>"string"==typeof e,ec={"&nbsp;":"\xa0","&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'","&copy;":"\xa9","&reg;":"\xae","&trade;":"™","&hellip;":"…","&ndash;":"–","&mdash;":"—","&lsquo;":"‘","&rsquo;":"’","&sbquo;":"‚","&ldquo;":"“","&rdquo;":"”","&bdquo;":"„","&dagger;":"†","&Dagger;":"‡","&bull;":"•","&prime;":"′","&Prime;":"″","&lsaquo;":"‹","&rsaquo;":"›","&sect;":"\xa7","&para;":"\xb6","&middot;":"\xb7","&ensp;":" ","&emsp;":" ","&thinsp;":" ","&euro;":"€","&pound;":"\xa3","&yen;":"\xa5","&cent;":"\xa2","&curren;":"\xa4","&times;":"\xd7","&divide;":"\xf7","&minus;":"−","&plusmn;":"\xb1","&ne;":"≠","&le;":"≤","&ge;":"≥","&asymp;":"≈","&equiv;":"≡","&infin;":"∞","&int;":"∫","&sum;":"∑","&prod;":"∏","&radic;":"√","&part;":"∂","&permil;":"‰","&deg;":"\xb0","&micro;":"\xb5","&larr;":"←","&uarr;":"↑","&rarr;":"→","&darr;":"↓","&harr;":"↔","&crarr;":"↵","&lArr;":"⇐","&uArr;":"⇑","&rArr;":"⇒","&dArr;":"⇓","&hArr;":"⇔","&alpha;":"α","&beta;":"β","&gamma;":"γ","&delta;":"δ","&epsilon;":"ε","&zeta;":"ζ","&eta;":"η","&theta;":"θ","&iota;":"ι","&kappa;":"κ","&lambda;":"λ","&mu;":"μ","&nu;":"ν","&xi;":"ξ","&omicron;":"ο","&pi;":"π","&rho;":"ρ","&sigma;":"σ","&tau;":"τ","&upsilon;":"υ","&phi;":"φ","&chi;":"χ","&psi;":"ψ","&omega;":"ω","&Alpha;":"Α","&Beta;":"Β","&Gamma;":"Γ","&Delta;":"Δ","&Epsilon;":"Ε","&Zeta;":"Ζ","&Eta;":"Η","&Theta;":"Θ","&Iota;":"Ι","&Kappa;":"Κ","&Lambda;":"Λ","&Mu;":"Μ","&Nu;":"Ν","&Xi;":"Ξ","&Omicron;":"Ο","&Pi;":"Π","&Rho;":"Ρ","&Sigma;":"Σ","&Tau;":"Τ","&Upsilon;":"Υ","&Phi;":"Φ","&Chi;":"Χ","&Psi;":"Ψ","&Omega;":"Ω","&Agrave;":"\xc0","&Aacute;":"\xc1","&Acirc;":"\xc2","&Atilde;":"\xc3","&Auml;":"\xc4","&Aring;":"\xc5","&AElig;":"\xc6","&Ccedil;":"\xc7","&Egrave;":"\xc8","&Eacute;":"\xc9","&Ecirc;":"\xca","&Euml;":"\xcb","&Igrave;":"\xcc","&Iacute;":"\xcd","&Icirc;":"\xce","&Iuml;":"\xcf","&ETH;":"\xd0","&Ntilde;":"\xd1","&Ograve;":"\xd2","&Oacute;":"\xd3","&Ocirc;":"\xd4","&Otilde;":"\xd5","&Ouml;":"\xd6","&Oslash;":"\xd8","&Ugrave;":"\xd9","&Uacute;":"\xda","&Ucirc;":"\xdb","&Uuml;":"\xdc","&Yacute;":"\xdd","&THORN;":"\xde","&szlig;":"\xdf","&agrave;":"\xe0","&aacute;":"\xe1","&acirc;":"\xe2","&atilde;":"\xe3","&auml;":"\xe4","&aring;":"\xe5","&aelig;":"\xe6","&ccedil;":"\xe7","&egrave;":"\xe8","&eacute;":"\xe9","&ecirc;":"\xea","&euml;":"\xeb","&igrave;":"\xec","&iacute;":"\xed","&icirc;":"\xee","&iuml;":"\xef","&eth;":"\xf0","&ntilde;":"\xf1","&ograve;":"\xf2","&oacute;":"\xf3","&ocirc;":"\xf4","&otilde;":"\xf5","&ouml;":"\xf6","&oslash;":"\xf8","&ugrave;":"\xf9","&uacute;":"\xfa","&ucirc;":"\xfb","&uuml;":"\xfc","&yacute;":"\xfd","&thorn;":"\xfe","&yuml;":"\xff","&iexcl;":"\xa1","&iquest;":"\xbf","&fnof;":"ƒ","&circ;":"ˆ","&tilde;":"˜","&OElig;":"Œ","&oelig;":"œ","&Scaron;":"Š","&scaron;":"š","&Yuml;":"Ÿ","&ordf;":"\xaa","&ordm;":"\xba","&macr;":"\xaf","&acute;":"\xb4","&cedil;":"\xb8","&sup1;":"\xb9","&sup2;":"\xb2","&sup3;":"\xb3","&frac14;":"\xbc","&frac12;":"\xbd","&frac34;":"\xbe","&spades;":"♠","&clubs;":"♣","&hearts;":"♥","&diams;":"♦","&loz;":"◊","&oline;":"‾","&frasl;":"⁄","&weierp;":"℘","&image;":"ℑ","&real;":"ℜ","&alefsym;":"ℵ"},eu=RegExp(Object.keys(ec).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");var ed=n(8139);let ef={t:(e,t)=>{if(es(t))return t;if("object"==typeof t&&null!==t&&es(t.defaultValue))return t.defaultValue;if("function"==typeof e)return"";if(Array.isArray(e)){let t=e[e.length-1];return"function"==typeof t?"":t}return e},ready:!1},ep=()=>()=>{},eh=(e,t={})=>{let{i18n:n}=t,{i18n:o,defaultNS:i}=(0,Z.useContext)(ee)||{},a=n||o||r;a&&!a.reportNamespaces&&(a.reportNamespaces=new et),a||eo(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");let l=(0,Z.useMemo)(()=>({...Q,...a?.options?.react,...t}),[a,t]),{useSuspense:s,keyPrefix:c}=l,u=e||i||a?.options?.defaultNS,d=es(u)?[u]:u||["translation"],f=(0,Z.useMemo)(()=>d,d);a?.reportNamespaces?.addUsedNamespaces?.(f);let p=(0,Z.useRef)(0),h=(0,Z.useCallback)(e=>{if(!a)return ep;let{bindI18n:t,bindI18nStore:n}=l,r=()=>{p.current+=1,e()};return t&&a.on(t,r),n&&a.store.on(n,r),()=>{t&&t.split(" ").forEach(e=>a.off(e,r)),n&&n.split(" ").forEach(e=>a.store.off(e,r))}},[a,l]),m=(0,Z.useRef)(),v=(0,Z.useCallback)(()=>{if(!a)return ef;let e=!!(a.isInitialized||a.initializedStoreOnce)&&f.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(eo(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,l)),n=t.lng||a.language,r=p.current,o=m.current;if(o&&o.ready===e&&o.lng===n&&o.keyPrefix===c&&o.revision===r)return o;let i={t:a.getFixedT(n,"fallback"===l.nsMode?f:f[0],c,{scopeNs:f}),ready:e,lng:n,keyPrefix:c,revision:r};return m.current=i,i},[a,f,c,l,t.lng]),[g,y]=(0,Z.useState)(0),{t:b,ready:x}=(0,ed.useSyncExternalStore)(h,v,v);(0,Z.useEffect)(()=>{if(a&&!x&&!s){let e=()=>y(e=>e+1);t.lng?el(a,t.lng,f,e):ea(a,f,e)}},[a,t.lng,f,x,s,g]);let w=a||{},k=(0,Z.useRef)(null),j=(0,Z.useRef)(),S=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,"__original"))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch(e){}return n},O=(0,Z.useMemo)(()=>{let e=w?.language,t=w;w&&(k.current&&k.current.__original===w?j.current!==e?(k.current=t=S(w),j.current=e):t=k.current:(k.current=t=S(w),j.current=e));let n=x||s?b:(...e)=>(eo(a,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...e)),r=[n,t,x];return r.t=n,r.i18n=t,r.ready=x,r},[b,w,x,w.resolvedLanguage,w.language,w.languages]);if(a&&s&&!x){let e=!1;try{e=!1}catch(e){}throw e&&eo(a,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),new Promise(e=>{let n=()=>e();t.lng?el(a,t.lng,f,n):ea(a,f,n)})}return O};function em({i18n:e,defaultNS:t,children:n}){let r=(0,Z.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,Z.createElement)(ee.Provider,{value:r},n)}function ev(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var eg="hs-language",ey={"zh-CN":"zh-CN",en:"en-US"},eb=G.createInstance();function ex(e){"u">typeof document&&(document.documentElement.lang=e)}function ew(e){return eb.on("languageChanged",e),function(){return eb.off("languageChanged",e)}}function ek(){return(0,a.lX)(eb.language)?eb.language:a.gI}function ej(){var e=(0,Z.useSyncExternalStore)(ew,ek,ek),t=(0,Z.useCallback)(function(e){try{localStorage.setItem(eg,e)}catch(e){}eb.changeLanguage(e)},[]);return(0,Z.useMemo)(function(){return{language:e,locale:ey[e],setLanguage:t}},[e,t])}function eS(e){var t=e.children;return(0,i.jsx)(em,{i18n:eb,children:t})}eb.use({type:"3rdParty",init(e){((e={})=>{Q={...Q,...e}})(e.options.react),r=e}}).init({lng:function(){try{var e=localStorage.getItem(eg);return(0,a.lX)(e)?e:a.gI}catch(e){return a.gI}}(),fallbackLng:a.gI,supportedLngs:function(e){if(Array.isArray(e))return ev(e)}(o=a.Yj)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e){if(e){if("string"==typeof e)return ev(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ev(e,void 0)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),resources:{"zh-CN":{translation:a.jF["zh-CN"]},en:{translation:a.jF.en}},initAsync:!1,interpolation:{escapeValue:!1},returnNull:!1}),ex(eb.language),eb.on("languageChanged",ex)},2935(e,t,n){n.d(t,{AZ:()=>l,OD:()=>s,PY:()=>a,ec:()=>c});var r=n(4041);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var i="hs-theme";function a(){var e=function(){try{var e=localStorage.getItem(i);return"light"===e||"dark"===e?e:null}catch(e){return null}}();return e||("u">typeof window&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}function l(e){document.documentElement.classList.toggle("dark","dark"===e),document.documentElement.style.colorScheme=e;try{localStorage.setItem(i,e)}catch(e){}}function s(e){var t="dark"===e?"light":"dark";return l(t),t}function c(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(function(){return"u">typeof document&&document.documentElement.classList.contains("dark")?"dark":"light"}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],i=t[1];return(0,r.useEffect)(function(){var e=document.documentElement,t=new MutationObserver(function(){i(e.classList.contains("dark")?"dark":"light")});return t.observe(e,{attributes:!0,attributeFilter:["class"]}),function(){return t.disconnect()}},[]),n}},7983(e,t,n){n.d(t,{Lk:()=>rK,AW:()=>rA,OQ:()=>i,RP:()=>d,gI:()=>v,KT:()=>rB,Gl:()=>rD,AF:()=>l,Hr:()=>rV,wl:()=>r_,lX:()=>g,LK:()=>rL,T_:()=>rJ,jF:()=>y,b1:()=>r0,oo:()=>u,Yj:()=>m,Vz:()=>s,YG:()=>f});var r,o,i={toolModelsFactsInvalid:"toolModelsFactsInvalid",toolModelsInvalid:"toolModelsInvalid",toolModelsDefaultRequired:"toolModelsDefaultRequired",toolModelsConflict:"toolModelsConflict",favoriteNotFound:"favoriteNotFound",favoriteRevisionRequired:"favoriteRevisionRequired",favoriteRevisionConflict:"favoriteRevisionConflict",favoriteInUse:"favoriteInUse",favoriteConnectionInUse:"favoriteConnectionInUse",favoriteEndpointMissing:"favoriteEndpointMissing",favoriteProtocolUnsupported:"favoriteProtocolUnsupported",favoriteProjectionUnsupported:"favoriteProjectionUnsupported",favoriteProfileDiverged:"favoriteProfileDiverged",favoriteRawOverrideConflict:"favoriteRawOverrideConflict",favoriteActiveUpdateRequiresApply:"favoriteActiveUpdateRequiresApply",favoritePlanStale:"favoritePlanStale",favoritePlanExpired:"favoritePlanExpired",favoriteIdempotencyConflict:"favoriteIdempotencyConflict",favoriteUndoConflict:"favoriteUndoConflict",favoritePreferenceNotRepresented:"favoritePreferenceNotRepresented",favoriteEffortUnverified:"favoriteEffortUnverified",favoriteReasoningLevelsMissing:"favoriteReasoningLevelsMissing",favoriteEffortMapped:"favoriteEffortMapped",favoriteEffortUnset:"favoriteEffortUnset",favoriteStoreInvalid:"favoriteStoreInvalid",favoriteBackupInvalid:"favoriteBackupInvalid",favoriteBackupStale:"favoriteBackupStale",favoriteBackupRecoveryFailed:"favoriteBackupRecoveryFailed",favoriteLimitReached:"favoriteLimitReached",favoriteCredentialConsentRequired:"favoriteCredentialConsentRequired",requestFailed:"http.requestFailed",invalidRequest:"http.invalidRequest",internalServerError:"http.internalServerError",authenticationRequired:"http.authenticationRequired",crossOriginDenied:"http.crossOriginDenied",invalidPassword:"auth.invalidPassword",passwordChangeRejected:"auth.passwordChangeRejected",passwordTooShort:"auth.passwordTooShort",passwordUnchanged:"auth.passwordUnchanged",tooManyAttempts:"auth.tooManyAttempts",missingArgument:"cli.missingArgument",invalidConflictPolicy:"sync.invalidConflictPolicy",harnessNotFound:"harness.notFound",fileNotRegular:"file.notRegular",fileOutsideManagedDirectory:"file.outsideManagedDirectory",fileOwnershipRequiresRoot:"file.ownershipRequiresRoot",nativeConfigInvalid:"adapter.nativeConfigInvalid",adapterUnknownTarget:"adapter.unknownTarget",profileActiveDeleteForbidden:"profile.activeDeleteForbidden",profileAlreadyExists:"profile.alreadyExists",profileNotFound:"profile.notFound",profileEndpointNotFound:"profile.endpointNotFound",profileApiKeyRequired:"profile.apiKeyRequired",profileNameRequired:"profile.nameRequired",profileNameInvalid:"profile.nameInvalid",profileNameTooLong:"profile.nameTooLong",adapterModelRequired:"adapter.modelRequired",adapterApiKeyRequired:"adapter.apiKeyRequired",officialLoginUnsupported:"activation.officialLoginUnsupported",officialLoginMissing:"activation.officialLoginMissing",officialApiKeyMissing:"activation.officialApiKeyMissing",noActiveProfile:"activation.noActiveProfile",officialProfileCannotAdopt:"activation.officialProfileCannotAdopt",adoptUnsupported:"activation.adoptUnsupported",manualOverridesPreventAdopt:"activation.manualOverridesPreventAdopt",officialProfileAlreadyExists:"activation.officialProfileAlreadyExists",providerInUse:"provider.inUse",providerCredentialUnreadable:"provider.credentialUnreadable",providerNotFound:"provider.notFound",providerNameRequired:"provider.nameRequired",providerApiKeyRequired:"provider.apiKeyRequired",providerEndpointsInvalid:"provider.endpointsInvalid",providerEndpointKeyRequired:"provider.endpointKeyRequired",providerEndpointKeyInvalid:"provider.endpointKeyInvalid",providerEndpointKeyDuplicate:"provider.endpointKeyDuplicate",providerEndpointUrlRequired:"provider.endpointUrlRequired",codexCacheTooLarge:"codex.loginCacheTooLarge",codexCacheInvalidJson:"codex.loginCacheInvalidJson",codexConfigDirNotRegular:"codex.configDirectoryNotRegular",codexCacheNotRegular:"codex.loginCacheNotRegular",transferEnvelopeInvalid:"transfer.envelopeInvalid",transferPassphraseTooShort:"transfer.passphraseTooShort",transferDecryptFailed:"transfer.decryptFailed",transferTooManyProfiles:"transfer.tooManyProfiles",transferProfilesInvalid:"transfer.profilesInvalid",transferProfileNameInvalid:"transfer.profileNameInvalid",transferDuplicateProfile:"transfer.duplicateProfile",transferProvidersInvalid:"transfer.providersInvalid",transferDuplicateProvider:"transfer.duplicateProvider",transferProviderMissing:"transfer.providerMissing",transferActiveInvalid:"transfer.activeInvalid",transferDuplicateActive:"transfer.duplicateActive",transferActiveProfileMissing:"transfer.activeProfileMissing",transferOfficialActiveInvalid:"transfer.officialActiveInvalid",transferCodexCacheInvalid:"transfer.codexCacheInvalid",syncSourceCacheMissing:"sync.sourceCodexLoginCacheMissing",syncSourceEqualsTarget:"sync.sourceEqualsTarget",scanApiKeyRequired:"scan.apiKeyRequired",backupTargetInvalid:"backup.targetInvalid",backupInvalidId:"backup.invalidId",backupNotFound:"backup.notFound",backupFileNotOwned:"backup.fileNotOwned",backupPayloadMissing:"backup.payloadMissing",backupPayloadNameInvalid:"backup.payloadNameInvalid",operationAlreadyUndone:"operation.alreadyUndone",operationIncomplete:"operation.incomplete",operationBackupMissing:"operation.backupMissing",operationStorageUnknown:"operation.storageUnknown",operationSnapshotMissing:"operation.snapshotMissing",operationInvalidId:"operation.invalidId",operationNotFound:"operation.notFound",githubNotConnected:"github.notConnected",githubAuthFailed:"github.authFailed",githubGistNotFound:"github.gistNotFound",githubDeviceCodeExpired:"github.deviceCodeExpired",githubRateLimitExceeded:"github.rateLimitExceeded",githubUnexpectedResponse:"github.unexpectedResponse",userNotManageable:"user.notManageable",userNotSwitchable:"user.notSwitchable",storageUnreadable:"storage.unreadable",storageQuarantineFailed:"storage.quarantineFailed",storageCorruptQuarantined:"storage.corruptQuarantined",storageInvalid:"storage.invalid"},a={nameRequired:"validation.nameRequired",nameTooLong:"validation.nameTooLong",nameSlash:"validation.nameSlash",passwordRequired:"validation.passwordRequired",endpointKeyRequired:"validation.endpointKeyRequired",endpointKeyTooLong:"validation.endpointKeyTooLong",endpointKeySlash:"validation.endpointKeySlash",endpointKeyDuplicate:"validation.endpointKeyDuplicate",endpointBaseUrlRequired:"validation.endpointBaseUrlRequired",apiKeyRequired:"validation.apiKeyRequired",sourceUserRequired:"validation.sourceUserRequired",providerIdSlash:"validation.providerIdSlash",providerIdReserved:"validation.providerIdReserved",selectionRequired:"validation.selectionRequired",baseUrlRequired:"validation.baseUrlRequired",tokenRequired:"validation.tokenRequired"};Object.values(a);var l={badUrl:"probe.badUrl",missingBaseUrl:"probe.missingBaseUrl",missingApiKey:"probe.missingApiKey",timeout:"probe.timeout",networkError:"probe.networkError",unauthorized:"probe.unauthorized",httpError:"probe.httpError",invalidResponse:"probe.invalidResponse",missingModel:"probe.missingModel",completionUnsupported:"probe.completionUnsupported",completionHttpError:"probe.completionHttpError",completionInvalid:"probe.completionInvalid"};function s(e){return c.some(function(t){return e.startsWith(t)})?e:"error.".concat(e)}var c=["warning.","doctor.check.","scan.note.","favorite.","validation."];[i,{result:"favorite.result"},a,{envRebuildFailed:"warning.activation.envRebuildFailed",officialEnvRebuildFailed:"warning.activation.officialEnvRebuildFailed",backfillFailed:"warning.activation.backfillFailed",endpointFallback:"warning.provider.endpointFallback",reapplyFailed:"warning.provider.reapplyFailed",syncReapplyFailed:"warning.sync.activeReapplyFailed",transferActiveRestoreFailed:"warning.transfer.activeRestoreFailed",scanProfileGone:"warning.scan.profileGone",scanProfileExists:"warning.scan.profileExists",scanImportFailed:"warning.scan.importFailed"},{installFound:"doctor.check.installFound",installMissing:"doctor.check.installMissing",installNotRequired:"doctor.check.installNotRequired",fileMissing:"doctor.check.fileMissing",fileUnreadable:"doctor.check.fileUnreadable",fileUnwritable:"doctor.check.fileUnwritable",filePermissive:"doctor.check.filePermissive",fileOk:"doctor.check.fileOk",parseOk:"doctor.check.parseOk",parseFailed:"doctor.check.parseFailed",parseUnreadable:"doctor.check.parseUnreadable",driftNoProfile:"doctor.check.driftNoProfile",driftInvalid:"doctor.check.driftInvalid",driftMismatch:"doctor.check.driftMismatch",driftInSync:"doctor.check.driftInSync",officialCredentialMissing:"doctor.check.officialCredentialMissing",probeNoProfile:"doctor.check.probeNoProfile",probeOfficialLogin:"doctor.check.probeOfficialLogin",probeMissingCredential:"doctor.check.probeMissingCredential",probeOk:"doctor.check.probeOk",probeFailed:"doctor.check.probeFailed",completionOk:"doctor.check.completionOk",completionFailed:"doctor.check.completionFailed",completionOkCached:"doctor.check.completionOkCached",completionFailedCached:"doctor.check.completionFailedCached",homePatchOverride:"doctor.check.homePatchOverride"},{unsupported:"scan.note.unsupported",noConfigFiles:"scan.note.noConfigFiles",unparsable:"scan.note.unparsable",noCandidates:"scan.note.noCandidates"},l,{homeUnsearchable:"user.block.homeUnsearchable",homeUnwritable:"user.block.homeUnwritable",storeInaccessible:"user.block.storeInaccessible",ownershipRequiresRoot:"user.block.ownershipRequiresRoot",homeMissing:"user.block.homeMissing"}].flatMap(function(e){return Object.values(e)});var u=["claude","codex","kimi","pi","dsh"],d={claude:"Claude Code",codex:"Codex",kimi:"Kimi Code",pi:"Pi",dsh:"DeepSeek Harness"};function f(e){return u.includes(e)}var p=JSON.parse('{"app":{"name":"harness-switch","tagline":"Native configuration management","checkingSession":"Checking session…","brandMark":"HS / harness-switch","devMode":"Local development mode: this page is served by a local dev server"},"language":{"toEnglish":"Switch to English","toChinese":"Switch to Chinese","short":"中文"},"theme":{"toLight":"Switch to the light theme","toDark":"Switch to the dark theme"},"login":{"title":"Server configuration control plane","intro":"Activating a profile writes directly to each CLI\'s own configuration files, with no shell setup required.","hint":"Enter the web password printed in the terminal on first launch.","password":"Web password","submitting":"Signing in…","submit":"Sign in"},"nav":{"currentLocalUser":"Current local user","localUser":"Local user","transfer":"Move configuration","vault":"Provider vault","signOut":"Sign out","switchHarness":"Switch harness"},"account":{"password":{"title":"Change password","intro":"Update the shared web password. Every other signed-in session is ended.","current":"Current password","next":"New password","confirm":"Confirm new password","hint_one":"At least {{count}} character.","hint_other":"At least {{count}} characters.","mismatch":"The two passwords do not match","changed":"Password changed","submit":"Change password","submitting":"Saving…"}},"feedback":{"label":"Feedback","hint":"Report an issue on GitHub"},"harness":{"field":{"toggle":{"on":"On","off":"Off"},"providerId":{"label":"Provider ID (optional)","placeholder":"Defaults to the profile name"},"contextLength":{"label":"Context length"},"maxTokens":{"label":"Max output tokens"},"claude":{"authVar":{"label":"Credential variable","help":"Third-party relays usually require ANTHROPIC_AUTH_TOKEN; use ANTHROPIC_API_KEY for an official API key.","option":{"authToken":"ANTHROPIC_AUTH_TOKEN (third-party relay)","official":"ANTHROPIC_API_KEY (official)"}},"haikuModel":{"label":"Haiku model mapping"},"sonnetModel":{"label":"Sonnet model mapping"},"opusModel":{"label":"Opus model mapping"},"fableModel":{"label":"Fable model mapping (optional)","help":"Written to ANTHROPIC_DEFAULT_FABLE_MODEL, for newer Claude Code builds that support the Fable tier."},"subagentModel":{"label":"Subagent model (optional)","help":"Written to CLAUDE_CODE_SUBAGENT_MODEL, so subagents can use a faster or cheaper model."},"haikuModelName":{"label":"Haiku display name (optional)"},"sonnetModelName":{"label":"Sonnet display name (optional)"},"opusModelName":{"label":"Opus display name (optional)"},"fableModelName":{"label":"Fable display name (optional)"},"modelMapping":{"help":"Written to {{envVar}}."},"modelName":{"help":"Written to {{envVar}}; left empty, Claude Code shows the model ID itself.","placeholder":"Leave empty to use the {{role}} model ID"},"example":{"placeholder":"e.g. {{value}}"},"extraEnv":{"label":"Extra environment variables (optional)","help":"One KEY=VALUE per line, merged into the env block of settings.json."},"oneM":{"subagentLabel":"Declare 1M support for subagents","label":"Declare 1M support for {{role}}","help":"Appends [1m] to the model ID to declare a 1M context window to Claude Code, which strips the suffix before calling the provider. Enable it only when the model really supports 1M."}},"codex":{"envNote":"Only the environment-variable auth mode needs env.sh; the other modes keep their credential inside config.toml.","authMode":{"label":"Authentication mode","help":"auth.json is Codex\'s own login cache. Overwriting it loses the ChatGPT session, so it is left alone by default.","option":{"bearerToken":"Write to config.toml (recommended, keeps official login)","envKey":"Environment variable (requires sourcing env.sh)","openaiAuth":"Write to auth.json (overwrites the ChatGPT login cache)"}},"providerId":{"help":"openai, ollama, lmstudio, amazon-bedrock and similar are reserved by Codex and get renamed automatically."},"envKeyName":{"label":"Environment variable name","help":"Only used by the environment-variable mode."},"reasoningEffort":{"label":"Reasoning effort (optional)","option":{"unset":"Not set"}},"target":{"auth":"auth.json (auth.json mode only)"}},"kimi":{"envNote":"Kimi Code does not read credentials from the shell, so env.sh has no effect on it.","providerType":{"label":"Provider type","help":"Decides which protocol implementation Kimi Code uses.","option":{"kimi":"kimi (Moonshot / Kimi Code)"}},"maxContextSize":{"help":"Kimi Code requires every models entry to declare max_context_size."}},"pi":{"envNote":"The API key is written straight into models.json, so no environment variable is needed; --model still overrides at run time.","providerId":{"help":"Models are referenced as provider/model."},"api":{"label":"Protocol"},"authHeader":{"label":"Authorization header","help":"Sent as Authorization: Bearer <key>."},"reasoning":{"label":"Reasoning support","help":"Maps to reasoning in models.json. Enable it for thinking models such as GPT or Claude."},"target":{"auth":"auth.json (official-login detection only)"}},"dsh":{"envNote":"The API key is written securely to DSH\'s .credentials.yaml and referenced from DSH\'s config file.","providerType":{"label":"Provider type","option":{"custom":"Custom provider","official":"DeepSeek official API"}},"providerId":{"help":"DSH\'s model routing identifier; it must start with a lowercase letter."},"models":{"label":"Model catalog (optional)","placeholder":"One model ID per line; left empty, only the default model above is registered","help":"One provider can register several models; the Model field above is the default for new sessions."},"api":{"label":"API protocol"},"reasoningEfforts":{"label":"Supported reasoning levels","help":"DSH only shows the levels declared here that the upstream model actually supports.","option":{"unset":"Not declared (provider default)","none":"Model does not support reasoning levels","lowToMax":"Low / Medium / High / XHigh / Max","lowToXhigh":"Low / Medium / High / XHigh","minimalToHigh":"Minimal / Low / Medium / High"}}}},"subtitle":"Manage profiles and safely write this tool\'s native configuration files.","newProfile":"New profile","addCustomProvider":"Add custom provider","current":"Current: {{name}}","currentInactive":"Current: inactive","activeConfig":"Active configuration","defaultModel":"Default model","activeNamed":"Active \xb7 {{name}}","inactive":"Inactive","active":"Active","activate":"Activate","setDefault":"Set as default","default":"Default","deepseekOfficial":"DeepSeek official","writeTargets":"Write targets","noTargetFile":"No target file configured","moreFiles_one":"and {{count}} more file","moreFiles_other":"and {{count}} more files","overwriteWarning":"The profile overwrites the target files directly. A backup is taken first; verify connectivity and model availability after switching.","profiles":"Profiles","providers":"Providers","profileCount_one":"{{count}} custom profile","profileCount_other":"{{count}} custom profiles","copy":"Copy {{name}}","noProfiles":"No profiles yet","manualOverride":"Manual override","edit":"Edit {{name}}","delete":"Delete {{name}}","deleteBlocked":"Activate another profile before deleting this one","deleteTitle":"Delete profile?","deleteBody":"This deletes {{harness}} / {{profile}}. {{extra}}This cannot be undone.","deleteAdditiveExtra":"Its provider entry in the configuration file is removed as well. ","deleteDshOfficialExtra":"Its native DeepSeek route and credential reference are removed as well. ","official":"Official login","officialActive":"In use","officialSwitch":"Back to official","officialHintClaude":"Use Claude Code\'s own Anthropic account login","officialHintCodex":"Use Codex\'s own ChatGPT / OpenAI account login","officialHintKimi":"Use Kimi Code\'s own Kimi account login (the OAuth credential written by /login)","officialHintPi":"Return to the account Pi\'s own /login stored in auth.json; Pi picks the startup model, adjust it with /model","officialHintDsh":"Detect and switch to DeepSeek Harness\'s existing official DeepSeek API key configuration","application":"Application","writeMode":"Write mode","modeReplace":"Replace current configuration","modeAdditive":"Keep entries and switch pointer"},"profile":{"editTitle":"Edit {{harness}} / {{profile}}","createTitle":"New {{harness}} profile","copyTitle":"Copy {{harness}} / {{profile}}","intro":"Saving writes to {{targets}}.","additiveNote":"This tool\'s config file keeps providers side by side, so switching only moves the current pointer — the other providers you wrote by hand are left alone.","useSharedProvider":"Use a shared provider (vault)","useSharedProviderLabel":"Use a shared provider","keyFromVault":"Key comes from the vault","providerNone":"None (this profile carries its own key)","vaultEmpty":"The vault is empty. Add a provider entry under “Vault” at the top first.","namedEndpoint":"Named endpoint (optional)","namedEndpointLabel":"Named endpoint","endpointNone":"Unset (use the base URL below)","endpointOption":"{{label}} ({{key}})","noEndpoints":"This provider has no named endpoint, so the base URL below is used.","quickFill":"Quick fill:","name":"Profile name","namePlaceholder":"e.g. openrouter-main","renameHint":"Renaming also updates the recorded active profile and the provider id in the native config.","baseUrl":"API base URL","baseUrlPlaceholder":"https://api.example.com/v1","baseUrlFromVault":"The base URL comes from vault endpoint “{{endpoint}}”.","apiKey":"API key","apiKeyKeep":"Leave empty to keep the current key","apiKeyRequiredPlaceholder":"Required","apiKeySharedHint":"This profile references a shared provider; rotate the key in the vault instead.","dshOfficialApiKeyHint":"Enter a DeepSeek Platform API key. It is securely written to DSH\'s .credentials.yaml and referenced as DEEPSEEK_API_KEY from DSH\'s config file.","fallbackModel":"Fallback model (ANTHROPIC_MODEL)","model":"Model","fallbackModelPlaceholder":"Optional; used when no tier matches, e.g. glm-5","modelPlaceholder":"e.g. claude-sonnet-4-5","claudeModelHint":"Leave empty to keep Claude Code\'s default model; map the individual tiers below.","notes":"Notes (optional)","advanced":"Advanced: raw configuration","overridden":"Overridden by hand","saveFirst":"Save this profile first, then reopen it to take over the raw file contents.","save":"Save profile","saving":"Saving…","rawLoading":"Reading what will be written…","rawIntro":"Below is what is currently written to disk, generated from the fields as last saved. Editing any of them counts as taking it over by hand, and the form fields stop affecting that file.","resetToGenerated":"Back to generated","selectPlaceholder":"Select one","mapping":{"title":"Model mapping","intro":"Display names only affect Claude Code\'s /model menu; an empty one shows the actual model ID. Turning on “1M context” appends [1m] to the model ID — only enable it for a model that really supports 1M.","role":"Model role","displayName":"Display name","actualModel":"Model actually requested","oneM":"1M context","defaultTo":"Default: {{model}}","notInMenu":"Not shown in the /model menu","oneMUnsupported":"{{role}} has no 1M variant","enable":"Enable"},"error":{"nameRequired":"Enter a profile name","nameSlash":"A profile name cannot contain / or \\\\","nameTooLong":"A profile name is at most {{max}} characters","nameDuplicate":"A profile with this name already exists","baseUrlRequired":"Enter an API base URL","apiKeyRequired":"Enter an API key","modelRequired":"Enter a model name","providerGone":"The referenced provider no longer exists — pick another","endpointGone":"The referenced endpoint no longer exists — pick another","fieldRequired":"Fill in {{label}}","checkFields":"Check the fields marked in red."}},"vault":{"title":"Vault","intro":"A provider entry keeps the API key in one place (AES-256-GCM encrypted, hidden by default) along with reusable endpoints. Profiles can reference an entry here instead of each holding its own copy of the key.","createTitle":"New provider","editTitle":"Edit {{name}}","formIntro":"Set the credential and any reusable named endpoints; saving returns to the list.","loading":"Reading the vault…","entryCount_one":"{{count}} provider entry","entryCount_other":"{{count}} provider entries","add":"New credential","empty":"The vault is empty — add a provider first.","keyConfigured":"Key set","keyMissing":"No key","noEndpoints":"No named endpoint","reveal":"Show {{name}}\'s key","hide":"Hide {{name}}\'s key","edit":"Edit {{name}}","delete":"Delete {{name}}","close":"Close","deleteTitle":"Delete this provider?","deleteBody":"This deletes “{{name}}”. An entry referenced by a profile cannot be deleted — remove the reference first.","deleted":"Deleted.","deleteFailed":"Delete failed","revealFailed":"Could not read the key","name":"Name","namePlaceholder":"e.g. openrouter","apiKey":"API key","apiKeyKeep":"Leave empty to keep the current key","apiKeyRequiredPlaceholder":"Required","notes":"Notes (optional)","endpoints":"Named endpoints (optional)","endpointsHint":"A profile referencing this provider can pick one of these endpoints, whose base URL then wins over the profile\'s own address.","noEndpointDrafts":"No endpoint yet","endpointKeyLabel":"Endpoint {{index}} name","endpointKeyPlaceholder":"id, e.g. default","endpointUrlLabel":"Endpoint {{index}} base URL","endpointUrlPlaceholder":"https://api.example.com/v1","endpointLabelLabel":"Endpoint {{index}} label","endpointLabelPlaceholder":"Display label (optional)","removeEndpoint":"Remove endpoint {{index}}","addEndpoint":"Add endpoint","saving":"Saving…","saveChanges":"Save changes","updated":"Updated.","created":"Provider entry added.","saveFailed":"Save failed","error":{"nameRequired":"Enter a provider name","apiKeyRequired":"Enter an API key","endpointKeyRequired":"Enter an endpoint id","endpointKeyInvalid":"Cannot contain / or \\\\, and is at most {{max}} characters","endpointKeyDuplicate":"Endpoint ids must be unique","endpointUrlRequired":"Enter a base URL","checkFields":"Check the fields marked in red."},"probeEndpointLabel":"Endpoint to test","probeFailed":"Probe request failed"},"activate":{"title":"Activate profile?","officialTitle":"Return to official login?","body":"This switches {{harness}} to \\"{{profile}}\\" and writes its native configuration files{{changed}}. Target local user: {{user}}. A backup is taken first.","officialBody":"This returns {{harness}} to its official login and writes its native configuration files{{changed}}. Target local user: {{user}}. A backup is taken first.","changedFiles_one":", of which {{count}} file will change","changedFiles_other":", of which {{count}} files will change","loadFailed":"Could not read the content to be written: {{reason}}","loading":"Loading the content to be written…","confirm":"Confirm activation","executing":"Writing…","failed":"Writing failed: {{reason}}. The configuration was not switched; fix the issue and retry.","retry":"Retry activation","retryPreview":"Reload preview"},"env":{"title":"Environment file compatibility","intro":"Switching does not require it. Run this in the relevant shell only when Codex uses environment-variable authentication:","note":"The file contains only variables recognized by each tool. Kimi Code and Pi do not read credentials from the shell, so their sections contain only a comment."},"backup":{"latest":"Latest backup","profile":"Profile","fileCount_one":"{{count}} file","fileCount_other":"{{count}} files","empty":"No snapshots yet","history":"Configuration history","restore":"Restore","restoreTitle":"Restore this snapshot?","restoreBody":"This writes the {{harness}} / {{profile}} configuration files from {{time}} back to disk, overwriting the current content.","confirmRestore":"Confirm restore","current":"Matches disk","loadFailed":"Could not read the snapshot: {{reason}}","loading":"Loading the snapshot…","written":"Restored the files from that snapshot to disk.","historyTitle":"{{harness}} configuration history","historyIntro":"Every write snapshots the original files into the data directory, keeping the last 10. Only this tool’s history is listed; entries that match what is on disk are marked current.","currentBadge":"Current","withDeletions":"includes deletions","restoreHistoryTitle":"Restore this snapshot?","restoreHistoryBody":"Red is what you lose, green is what the restore writes. Confirming overwrites the files on disk from this snapshot; the active profile harness-switch has on record does not roll back with it.","comparing":"Computing the diff…","diffFailed":"Could not load the diff"},"diff":{"delete":"Will delete","create":"Will create","replace":"Will overwrite","same":"No change","rendering":"Rendering the diff…","absent":"(absent)","afterRestore":"↓ after restore","deletedAfterRestore":"(deleted after restore)","bothAbsent":"Absent on both sides"},"drift":{"title":"Configuration drift","recheck":"Re-check drift","checking":"Checking for drift…","noData":"No drift data yet.","none":"No drift","mismatch_one":"{{count}} file differs","mismatch_other":"{{count}} files differ","moreFiles":"and {{count}} more…","viewDiff":"View diff","dialogTitle":"{{harness}} configuration drift","legend":"Red is what is on disk; green is what the active profile would write.","noActiveProfile":"This tool has no active profile.","nothingToCompare":"No active profile, so there is nothing to compare.","allInSync":"Every file matches the active profile.","adopt":"Adopt live configuration","reapply":"Re-apply","reapplyTitle":"Re-apply the active profile?","reapplyBody":"This rewrites {{harness}}\'s native configuration files from the active profile, overwriting local edits on disk. A backup is taken first.","confirmReapply":"Confirm re-apply","reapplyFailed":"Re-apply failed","adoptTitle":"Adopt the live configuration?","adoptBody":"This writes the current on-disk content back into the profile, and later writes will use it as the source. This cannot be undone.","confirmAdopt":"Confirm adopt","adoptFailed":"Adopt failed","reapplied":"Rewrote {{harness}}\'s native configuration files from the active profile.","adopted":"Adopted {{harness}}\'s live configuration into the profile.","status":{"in-sync":"In sync","drifted":"Modified","missing":"Missing","invalid":"Unparseable","unknown":"Unknown"}},"doctor":{"title":"Diagnostics","titleFor":"{{harness}} diagnostics","intro":"Checks tool installation, whether configuration files are readable, writable and parseable, storage permissions, and drift.","checking":"Checking…","notRun":"Diagnostics have not run yet","viewDetails":"View details","rerun":"Run again","close":"Close","updateAvailable":"A new version is available","noChecks":"Nothing to check","countOk":"{{count}} ok","countWarn":"{{count}} warning","countError":"{{count}} error","countUnknown":"{{count}} unknown","status":{"ok":"OK","warn":"Warning","error":"Error","unknown":"Unknown"},"check":{"installFound":"Found the {{bin}} executable","installMissing":"No {{bin}} executable on PATH — the tool may not be installed","installNotRequired":"{{harness}} is typically a web service — no PATH CLI is required","fileMissing":"{{target}} does not exist ({{path}})","fileUnreadable":"{{target}} is not readable ({{path}})","fileUnwritable":"{{target}} is not writable ({{path}})","filePermissive":"{{target}} is readable and writable, but its mode is {{mode}} — group/other can read it; 0600 is recommended","fileOk":"{{target}} exists and is readable and writable ({{path}})","parseOk":"{{target}} parses cleanly","parseFailed":"{{target}} could not be parsed: {{reason}}","parseUnreadable":"{{target}} could not be read: {{reason}}","driftNoProfile":"No active profile, so there is no drift to check","driftInvalid":"The live files contain content that cannot be parsed","driftMismatch_one":"{{count}} file does not match the active profile ({{status}})","driftMismatch_other":"{{count}} files do not match the active profile ({{status}})","driftInSync":"The live files match the active profile","officialCredentialMissing":"The official login’s credential file {{target}} is missing ({{path}}) — the tool is logged out","probeNoProfile":"No active profile; connectivity probe skipped","probeOfficialLogin":"{{harness}} is on its built-in account login; no custom endpoint to probe","probeMissingCredential":"Profile {{profile}} has no base URL or API key; cannot probe","probeOk":"Endpoint of profile {{profile}} is reachable","probeFailed":"Connectivity probe failed for profile {{profile}}","completionOk":"Model {{model}} completed a request ({{latencyMs}}ms)","completionFailed":"Model {{model}} failed to complete: the endpoint is reachable, but this model cannot answer","completionOkCached":"Model {{model}} completed a request ({{latencyMs}}ms, cached)","completionFailedCached":"Model {{model}} failed to complete: the endpoint is reachable, but this model cannot answer (cached)","homePatchOverride":"{{path}} overrides {{entries}} and outranks every profile, so the profile file harness-switch writes does not take effect for them"}},"notice":{"switchDone":"Switch complete","warningPrefix":"Note: {{message}}","currentUser":"the current user","transferImported":"Import finished.","userSynced":"Sync finished."},"operations":{"undone":"Undid that operation on {{harness}}; both the native configuration files and the recorded active profile are back to where they were.","title":"Operation history","titleFor":"{{harness}} operation history","intro":"Every write to a native configuration file is recorded first, so after a power loss or a killed process the service rolls back whatever was left unfinished on its next start. Undo returns both the configuration files and the recorded active profile to their state before the operation.","loading":"Loading…","empty":"No operations recorded yet","viewDetails":"View details","refresh":"Refresh","close":"Close","count_one":"{{count}} entry","count_other":"{{count}} entries","fileCount_one":"{{count}} file","fileCount_other":"{{count}} files","user":"user {{user}}","undo":"Undo","undoTitle":"Undo this operation?","undoBody":"This restores {{harness}}\'s {{count}} native configuration files to their content before the operation and returns the recorded active profile with them. A snapshot is taken first.","undoFailed":"Undo failed","confirmUndo":"Confirm undo","kind":{"activate":"Switch profile","activate-official":"Back to official login","revoke":"Remove provider","reapply":"Re-write","import":"Import","sync":"Cross-user sync"},"state":{"prepared":"Prepared","applying":"Writing","metadata-committed":"Finishing","committed":"Done","rolled-back":"Rolled back","degraded":"Needs attention"}},"error":{"unknown":"Unknown error","http":{"requestFailed":"Request failed","invalidRequest":"The request data is invalid","internalServerError":"Internal server error","authenticationRequired":"Sign-in required","crossOriginDenied":"Cross-origin request denied"},"auth":{"invalidPassword":"Incorrect password","passwordChangeRejected":"The current password is incorrect","passwordTooShort_one":"The new password must be at least {{count}} character","passwordTooShort_other":"The new password must be at least {{count}} characters","passwordUnchanged":"The new password matches the current one","tooManyAttempts":"Too many failed attempts. Try again in {{seconds}}s"},"github":{"notConnected":"Connect GitHub before continuing","authFailed":"GitHub authorization failed; sign in again","gistNotFound":"No harness-switch backup Gist was found in GitHub","deviceCodeExpired":"The device code expired; get a new one","rateLimitExceeded":"GitHub API rate limit exceeded; try again later","unexpectedResponse":"GitHub returned a response this version cannot read; try again later"},"cli":{"missingArgument":"A required argument is missing"},"profile":{"activeDeleteForbidden":"This profile is in use; activate another one before deleting it","alreadyExists":"A profile with this name already exists","notFound":"Profile not found","endpointNotFound":"Endpoint {{endpoint}} was not found","apiKeyRequired":"Enter an API key","nameRequired":"Enter a profile name","nameInvalid":"A profile name cannot contain slashes","nameTooLong":"A profile name is too long"},"adapter":{"modelRequired":"{{harness}} requires a model name","apiKeyRequired":"{{harness}} requires an API key","nativeConfigInvalid":"{{path}} is not valid {{format}} configuration","unknownTarget":"The adapter produced an unknown target {{key}}"},"activation":{"officialLoginUnsupported":"{{harness}} does not support official account login","officialLoginMissing":"No official login entry was found for {{harness}}; complete its official login in a terminal once first","officialApiKeyMissing":"No official DeepSeek API key configuration was found for {{harness}}","noActiveProfile":"This tool has no active profile, so there is nothing to render","officialProfileCannotAdopt":"The official login is active, so there is no profile to adopt into","adoptUnsupported":"This tool cannot adopt a live configuration","manualOverridesPreventAdopt":"Manual overrides would be lost by adoption; restore generated files first","officialProfileAlreadyExists":"A DeepSeek official profile already exists; edit it instead"},"provider":{"inUse_one":"This credential is referenced by {{count}} profile; remove the reference first","inUse_other":"This credential is referenced by {{count}} profiles; remove the references first","credentialUnreadable":"Could not read the key for credential {{id}}","notFound":"Provider not found","nameRequired":"Enter a provider name","apiKeyRequired":"Enter an API key","endpointsInvalid":"Endpoints must be an array","endpointKeyRequired":"Enter an endpoint id","endpointKeyInvalid":"An endpoint id contains invalid characters","endpointKeyDuplicate":"Endpoint {{key}} is duplicated","endpointUrlRequired":"Enter a base URL for endpoint {{key}}"},"codex":{"loginCacheTooLarge":"The Codex login cache file is too large and was skipped","loginCacheInvalidJson":"The Codex login cache is not valid JSON","configDirectoryNotRegular":"The Codex configuration directory is not a regular directory","loginCacheNotRegular":"The Codex login cache is not a regular file"},"transfer":{"envelopeInvalid":"Unsupported export file format","passphraseTooShort":"The migration passphrase must be at least 8 characters","decryptFailed":"Wrong migration passphrase, or the export file is damaged","tooManyProfiles":"The export file contains too many profiles","profilesInvalid":"The profile data in the export file is invalid","profileNameInvalid":"The export file contains an invalid profile name","duplicateProfile":"The export file contains a duplicate profile","providersInvalid":"The vault data in the export file is invalid","duplicateProvider":"The export file contains a duplicate vault entry","providerMissing":"A profile in the export file references a vault entry that does not exist","activeInvalid":"The active-profile data in the export file is invalid","duplicateActive":"The export file contains a duplicate active profile","activeProfileMissing":"An active profile in the export file references a profile that does not exist","officialActiveInvalid":"The official-login state in the export file is invalid","codexCacheInvalid":"The Codex login cache in the export file is invalid"},"sync":{"sourceCodexLoginCacheMissing":"The source user has no usable Codex official login cache","sourceEqualsTarget":"The source and target users are the same","invalidConflictPolicy":"The conflict policy is invalid"},"harness":{"notFound":"Harness not found"},"file":{"notRegular":"{{file}} is not a regular file","outsideManagedDirectory":"{{file}} is outside the managed directories","ownershipRequiresRoot":"Changing ownership of {{path}} requires running as root"},"scan":{"apiKeyRequired":"No credential could be extracted; enter an API key first"},"backup":{"targetInvalid":"{{path}} is not a valid {{harness}} backup target","invalidId":"The backup id is invalid","notFound":"Backup not found","fileNotOwned":"The backup references a file that {{harness}} does not own","payloadMissing":"Backup data for {{file}} is missing","payloadNameInvalid":"The backup payload name is invalid"},"operation":{"alreadyUndone":"This operation has already been undone","incomplete":"This operation has not finished; wait or restart the server to recover it","backupMissing":"Backup {{backupId}} for operation {{id}} has been rotated away","storageUnknown":"The operation refers to unknown storage {{key}}","snapshotMissing":"Operation {{id}} is missing the {{key}} snapshot","invalidId":"The operation id is invalid","notFound":"Operation not found"},"user":{"notManageable":"User {{username}} is not manageable","notSwitchable":"Cannot switch to user {{username}}","block":{"homeUnsearchable":"No permission to access","homeUnwritable":"No permission to write","storeInaccessible":"Config dir not writable","ownershipRequiresRoot":"Requires running as root","homeMissing":"Home directory missing"}},"storage":{"unreadable":"Could not read {{file}}","quarantineFailed":"Could not quarantine the corrupt {{file}}","corruptQuarantined":"The data store is corrupt. The original was quarantined as {{quarantine}}; restore from a backup before continuing","invalid":"The data store {{file}} does not have the expected shape ({{issue}}). It was left untouched rather than overwritten; inspect the file or restore from a backup"},"probe":{"badUrl":"Base URL does not parse, or is not http/https","missingBaseUrl":"No base URL supplied; nothing to test","missingApiKey":"No API key supplied; nothing to test","timeout":"Request timed out (10 seconds)","networkError":"Could not reach the endpoint (DNS, refused connection or TLS failure)","unauthorized":"Endpoint reachable but rejected the credential (HTTP {{status}}); check the API key","httpError":"Endpoint returned HTTP {{status}}","invalidResponse":"The response is not a recognized model-catalog format","missingModel":"No model to complete against: fill in a model name, or fetch the catalog first","completionUnsupported":"The endpoint accepts none of the known completion protocols","completionHttpError":"Model {{model}} returned HTTP {{status}} for a completion: the catalog lists it, but it cannot answer","completionInvalid":"The completion response is not a recognized format, so the model cannot be confirmed to have answered"},"favoriteNotFound":"Favorite not found.","favoriteRevisionRequired":"Favorite revision required.","favoriteRevisionConflict":"Favorite revision conflict.","favoriteInUse":"Favorite in use.","favoriteConnectionInUse":"Favorite connection in use.","favoriteEndpointMissing":"Favorite endpoint missing.","favoriteProtocolUnsupported":"Favorite protocol unsupported.","favoriteProjectionUnsupported":"Favorite projection unsupported.","favoriteProfileDiverged":"Favorite profile diverged.","favoriteRawOverrideConflict":"Favorite raw override conflict.","favoriteActiveUpdateRequiresApply":"Favorite active update requires apply.","favoritePlanStale":"Favorite plan stale.","favoritePlanExpired":"Favorite plan expired.","favoriteIdempotencyConflict":"Favorite idempotency conflict.","favoriteUndoConflict":"Favorite undo conflict.","favoritePreferenceNotRepresented":"Confirm ignoring the reasoning preference this harness cannot express.","favoriteEffortUnverified":"The connection reasoning effort levels are unverified.","favoriteEffortMapped":"Reasoning effort {{from}} is beyond what this harness can express and was mapped to the nearest level, {{to}}.","favoriteEffortUnset":"Reasoning effort {{from}} has no equivalent in this harness\'s configuration and will be left unset.","favoriteStoreInvalid":"Favorite store invalid.","favoriteLimitReached":"Favorite limit reached.","favoriteCredentialConsentRequired":"Favorite credential consent required.","favoriteBackupInvalid":"The backup is invalid, damaged or belongs to different configuration paths. Nothing was restored.","favoriteBackupRecoveryFailed":"Restore rollback is incomplete. Configuration operations are paused to protect data. Check file permissions and retry.","favoriteBackupStale":"Configuration changed after preview. Check the restore impact again.","toolModelsInvalid":"The model collection file is invalid. Restore it before editing.","toolModelsDefaultRequired":"Choose a replacement default before removing or changing the current default model.","toolModelsConflict":"The model conflicts with an existing entry. Manage collection models from the tool model list.","toolModelsFactsInvalid":"Model reasoning settings conflict. Check reasoning support, supported levels and the selected effort, or restore inheritance.","favoriteReasoningLevelsMissing":"Reasoning support is declared, but supported effort levels are unspecified. This apply will omit effort levels and still apply other settings. Add supported levels in the template model settings."},"warning":{"activation":{"envRebuildFailed":"The native configuration was written, but rebuilding env.sh failed","officialEnvRebuildFailed":"The official login was restored, but rebuilding env.sh failed","backfillFailed":"Could not save {{profile}}\'s existing configuration back into the profile"},"provider":{"endpointFallback":"Endpoint {{endpoint}} no longer exists; falling back to the provider\'s first endpoint","reapplyFailed":"Re-apply failed: {{reason}}"},"sync":{"activeReapplyFailed":"The profile store was updated, but automatic re-activation failed: {{reason}}"},"transfer":{"activeRestoreFailed":"Could not restore the active state: {{reason}}"},"scan":{"profileGone":"The configuration is no longer on disk; skipped","profileExists":"A profile with the same name already exists; skipped","importFailed":"Import failed: {{reason}}"},"favorite":{"probeFailed":"{{count}} channels failed the connectivity probe; the template was saved anyway."}},"update":{"updating":"Updating…","failed":"Update failed","failedHint":"Run bunx @seaveyon/harness-switch@latest manually","short":"Update","toVersion":"Update to v{{version}}"},"sync":{"title":"Sync from another user","intro":"Copies the source user\'s profiles and the credentials they reference to {{user}}. Active state, backups and native configuration files are not copied by default; migrating the Codex login cache is a separate opt-in.","sourceUser":"Source user","selectUser":"Select a local user","profileCount":"Profiles {{count}}","providerCount":"Credentials {{count}}","conflictCount":"Name conflicts {{count}}","overwriteByHarness":"Overwrite same-named profiles per harness","overwriteHint":"Only checked harnesses are overwritten; unchecked ones keep the current user\'s version.","overwriteHarness":"Overwrite {{harness}}","conflictsInHarness_one":"{{count}} same-named profile","conflictsInHarness_other":"{{count}} same-named profiles","migrateCache":"Migrate the Codex official login cache (auth.json)","migrateCacheHint":"This copies a reusable Codex login session, not ordinary configuration. Choose it only when the target user is entitled to that login.","migrateCacheOverwrite":"The target user already has a login cache; continuing overwrites it and takes a backup first.","storeOnlyHint":"Syncing only writes to the profile store. Activate the profile you want after syncing to make it take effect.","noOtherUsers":"There are no other manageable local login users.","inspecting":"Checking…","inspect":"Check what can be synced","syncing":"Syncing…","syncTo":"Sync to {{user}}","confirmCacheTitle":"Migrate the Codex login cache?","confirmCacheBody":"This copies {{source}}\'s Codex official login cache (auth.json) to {{target}}. {{extra}}Continue only if the target user is entitled to use that login session.","confirmCacheOverwrite":"The target user already has a cache; it will be overwritten and backed up. ","confirmCacheFresh":"The target user will get a new local login cache. ","confirmCacheAction":"Migrate the login cache and sync","done":"Sync complete: {{imported}} added, {{overwritten}} overwritten, {{skipped}} skipped, {{providersCopied}} credentials copied.","cacheMigrated":"The Codex login cache was migrated.","cacheNotMigrated":"The Codex login cache was not migrated."},"transfer":{"title":"Move configuration","intro":"Bring profiles and credentials onto this machine, or pack them up to take along. Every source writes to this manager’s own store.","exportTitle":"Export everything","exportIntro":"The file is AES-256-GCM encrypted with the transfer passphrase, independent of this machine\'s local key.","passphrase":"Transfer passphrase","passphrasePlaceholder":"At least {{min}} characters","passphraseConfirm":"Confirm the passphrase","passphraseConfirmPlaceholder":"Type it again","passphraseMismatch":"The two passphrases do not match.","encrypting":"Encrypting…","download":"Download the encrypted export","exported":"The encrypted export is ready. The passphrase is not written to the file — keep it separately.","importTitle":"Import onto this machine","importIntro":"The file is decrypted and checked for conflicts first; nothing is written until you confirm. Profiles of the same name on this machine are kept by default.","pickFile":"Choose a .hsw-backup file","pickFileHint":"The file is decrypted by the server on this machine; nothing is sent to an external service.","notAnExport":"Not a valid harness-switch export file","importPassphrasePlaceholder":"The passphrase set at export time","inspecting":"Checking…","inspect":"Check what would be imported","profileCount_one":"{{count}} profile","profileCount_other":"{{count}} profiles","providerCount_one":"{{count}} credential","providerCount_other":"{{count}} credentials","conflictCount_one":"{{count}} name conflict","conflictCount_other":"{{count}} name conflicts","activeCount_one":"{{count}} activation state","activeCount_other":"{{count}} activation states","harnessProfiles":"{{harness}}: {{count}}","conflictList":"Same name: {{items}}","previewStale":"The import options changed — check the contents again before confirming.","conflictPolicy":"Profiles with the same name","policySkip":"Keep this machine’s profile, skip the import","policyOverwrite":"Overwrite this machine’s profile from the export","restoreActive":"Restore the activation state from the export","recheckNeeded":"Check the contents again","confirmImport":"Confirm the import","confirmAuthTitle":"Confirm a change to Codex auth.json?","confirmTitle":"Import every profile?","confirmBody":"This imports {{count}} profiles.","confirmOverwrite_one":"{{count}} of them has the same name and will be overwritten.","confirmOverwrite_other":"{{count}} of them have the same name and will be overwritten.","confirmKeep":"Profiles with the same name are kept, not overwritten.","proceedAware":"Understood, import anyway","proceedOverwrite":"Overwrite and import","proceedSafe":"Import safely","importedCount_one":"{{count}} added","importedCount_other":"{{count}} added","overwrittenCount_one":"{{count}} overwritten","overwrittenCount_other":"{{count}} overwritten","providersCopiedCount_one":"{{count}} credential restored","providersCopiedCount_other":"{{count}} credentials restored","skippedCount_one":"{{count}} skipped","skippedCount_other":"{{count}} skipped","activeRestoredCount_one":"{{count}} activation state restored","activeRestoredCount_other":"{{count}} activation states restored","cacheMigrated":"the export\'s Codex login cache was migrated","cacheNotMigrated":"the export\'s Codex login cache was not migrated","importedSummary":"Import complete: {{parts}}.","authEffect":{"openai-api-key":"Restoring the selected Codex profile updates OPENAI_API_KEY in this machine\'s auth.json; that is not the same as migrating the export\'s full official login session.","auth-override":"Restoring the selected Codex profile writes that profile\'s raw auth override into this machine\'s auth.json.","official-cleanup":"Restoring Codex\'s official-login state may clear a leftover OPENAI_API_KEY from this machine\'s auth.json."},"sourceLabel":"Pick a source","sources":{"scan":"Config already here","user":"Another local user","file":"Encrypted file","gist":"GitHub Gist"},"currentPolicy":"Current policy: {{policy}}","importing":"Importing…"},"githubSync":{"title":"GitHub Cloud Sync","loading":"Checking GitHub connection…","intro":"Seamless multi-machine configuration synchronization using your GitHub account. Backups are end-to-end AES-256-GCM encrypted with a master passphrase before storing into a private Gist.","tabDevice":"GitHub OAuth Login","tabToken":"Personal Access Token","deviceIntro":"Enter the user code on GitHub to complete binding.","openAuthPage":"Authorize on GitHub","getCode":"Get Device Code","userCode":"User Code","copyCode":"Copy Code","copied":"Copied","waitingAuth":"Waiting for GitHub authorization…","waitingAuthInterval":"Waiting for GitHub authorization (polling in {{seconds}}s)…","checkingAuth":"Checking authorization…","checkNow":"Check now","regenerateCode":"Get a new device code","tokenPlaceholder":"Enter GitHub Token with gist permission (ghp_...)","connectToken":"Connect & Sign in","connecting":"Connecting…","disconnect":"Disconnect","lastSynced":"Last synced:","neverSynced":"Never synced","cloudGist":"Cloud Gist:","pushTitle":"Upload to Cloud","pushIntro":"Encrypts all profiles and provider credentials on this machine and uploads to your private Gist.","passphrase":"Sync Passphrase","passphrasePlaceholder":"Passphrase for end-to-end encryption","pushing":"Encrypting and uploading…","pushSuccess":"Successfully synced to GitHub Gist ({{profiles}} profiles, {{vault}} credentials).","pullTitle":"Pull from Cloud","pullIntro":"Downloads the encrypted backup from your private Gist and decrypts it locally.","pullPassphrasePlaceholder":"Sync passphrase set during upload","inspect":"Inspect Cloud Backup","pulling":"Pulling…","confirmPull":"Confirm Sync to Local","pullSuccess":"Cloud sync complete: {{summary}}","authorized":"GitHub authorized — welcome, {{user}}.","connected":"GitHub connected — welcome, {{user}}.","disconnected":"Disconnected from GitHub.","codeExpired":"The authorization code expired — request a new one.","authFailed":"Authorization failed — try again.","connectedBadge":"Connected","refreshStatus":"Refresh status","previewTitle":"What the cloud backup holds","backedUpAt":"Backed up {{time}}","tokenLabel":"Personal access token","tokenScopeHint":"The token needs the gist scope to read and write the encrypted config file."},"import":{"title":"Import existing configuration","intro":"Reads what these five tools currently have on disk and picks out the providers that can be adopted. Neither the scan nor the import touches their configuration files; you have to activate a profile yourself before anything is written.","scanning":"Reading the existing configuration…","failed":"Import failed","summary":"Imported {{imported}}, skipped {{skipped}}, created {{providersCreated}} credentials","providerCount_one":"{{count}} provider","providerCount_other":"{{count}} providers","sourceMissing":"missing","sourceRead":"read","sourceUnparsable":"unparseable","select":"Select {{name}}","inUse":"In use","nameTaken":"A profile with this name exists","matchesProvider":"Already in the vault: {{name}}","noBaseUrl":"(no base url)","keyOutsideConfig":"credential is not in the config file","profileName":"Profile name","credentialTarget":"Where to keep the credential","targetProfile":"In this profile itself","targetNewVault":"As a new vault entry","targetExisting":"Link to existing credential: {{name}}","apiKeyFromEnv":"This provider reads its credential from the environment, so it is not in the config file","overwriteExisting":"Overwrite the existing profile with this name","selected":"{{count}} selected","selectPrompt":"Check the providers to adopt","rescan":"Scan again","importSelected":"Import selected"},"scan":{"note":{"unsupported":"This tool does not support scan-and-import yet","noConfigFiles":"No config file for this tool was found on disk","unparsable":"The config file exists but cannot be parsed — fix it before importing","noCandidates":"No importable provider was found in the config file"}},"common":{"cancel":"Cancel","delete":"Delete","close":"Close","closeDialog":"Close dialog","apiKey":"API key","listSeparator":", "},"preset":{"zaiAnthropic":"Z.AI (Anthropic compatible)","moonshotAnthropic":"Moonshot (Anthropic compatible)","deepseekAnthropic":"DeepSeek (Anthropic compatible)","openrouter":"OpenRouter","zai":"Z.AI","moonshot":"Moonshot","deepseek":"DeepSeek","cliproxyResponses":"CLIProxy (Responses)"},"probe":{"action":"Test connection","fetchModels":"Fetch models","fetchingModels":"Fetching…","completionAction":"Test completion","testingCompletion":"Testing completion…","completionHint":"Sends one real minimal request to prove the model actually answers (costs a token or two).","probing":"Testing…","ok":"Reachable \xb7 {{latencyMs}}ms \xb7 {{count}} models","okNoCatalog":"Reachable \xb7 {{latencyMs}}ms \xb7 no model catalog returned","completionOk":"Model {{model}} answers \xb7 {{latencyMs}}ms","completionCached":"Model {{model}} answers \xb7 cached {{at}}","completionFailedCached":"cached {{at}}","catalogHint":"Fetched {{count}} models; model fields can now use the dropdown.","missingBaseUrl":"Add an endpoint URL before testing."},"favorites":{"linked":"Linked template","sourceMissing":"Template source is missing","connectionMissing":"Source connection is missing","importCount":"{{count}} templates","retryFailed":"Preview unfinished items again","saveFavorite":"Save template","authentication":"Authentication mode","liveState":"Native file state","preserved":"These existing fields keep their values; fixed model slots continue using their existing models","exportVersion":"Default exports use payload v2; the receiving version must support model favorites.","legacyExport":"Legacy export (omits favorites and source links)","catalog":"Fetch model catalog (no completion request)","catalogModel":"Choose a model ID from the catalog","noCatalog":"Catalog unavailable or empty; you can still enter a model ID.","title":"Templates","subtitle":"Save templates, choose connections, configure your tools.","add":"New template","edit":"Edit template","name":"Template name","notes":"Notes","save":"Save configuration only","delete":"Delete template","connections":"Model connections","connection":"Select connection","label":"Connection label","endpoint":"Vault endpoint","protocol":"Protocol","protocolMultiHint":"Select every protocol this endpoint speaks. Claude and Codex each pick the one they need — no separate connection copy.","model":"Exact request model ID","addConnection":"Add model connection","removeConnection":"Remove connection","contextWindow":"Context window","maxOutputTokens":"Maximum output tokens","reasoningSupported":"Reasoning capability","reasoningEffort":"Default reasoning preference","supportedReasoningEfforts":"Supported reasoning efforts","effortsHint":"Comma-separated: none,minimal,low,medium,high,xhigh,max,ultra","unknown":"Not set","true":"Yes","false":"No","declared":"User-declared values; capabilities are not verified.","inherited":"Inherited from template","overridden":"Connection override; blank clears inheritance","inherit":"Inherit","invalid":"Check the name, connections and capability declarations.","validation":{"required":"Fill in this field.","invalidValue":"This value is invalid.","invalidFacts":"The reasoning capability conflicts with the declared efforts or the preferred effort.","duplicateConnection":"Another channel already uses the same provider, endpoint, protocol and model."},"nextStep":{"saved":"Template “{{name}}” saved.","reviewAffected":"Review affected profiles"},"catalogAutoFailed":"List unavailable. Enter a model ID manually.","catalogRetry":"Retry","configure":"Configure tools","saveOnlyHint":"Saving alone does not change native files. Choose activation to apply to a tool.","target":"Target profile","newProfile":"New profile","profileName":"Profile name (blank for automatic naming)","mode":"Operation","activate":"Save and activate","ignorePreference":"Ignore unsupported reasoning preference","overwriteDiverged":"Overwrite diverged controlled fields from template","preview":"Preview","appliedToast":"Applied the template to {{count}} tools.","confirm":"Apply reviewed plan","rendererDefault":"Renderer default","notRepresented":"Fields not represented","nativeFiles":"Native write targets","none":"None","applied":"Applied","unchanged":"Unchanged","failed":"Failed; preview again","skipped":"Skipped; preview again","capture":"Create template from existing profile","extractCredential":"Store inline credential in the vault for reuse","linkSource":"Link the source profile","search":"Search names, models or connections","loading":"Loading favorites…","empty":"No favorites yet. Capture a profile or add one manually.","pending":"Not connected","generated":"Generated profiles","needsUpdate":"Update available","diverged":"Local divergence","detach":"Detach, keep profile","harnesses":"Harness profiles","autoName":"Use the model name when empty","modelAdvanced":"Shared capabilities and notes (optional)","protocolOptions":{"openaiChat":"OpenAI-compatible (Chat Completions)","openaiResponses":"OpenAI Responses","anthropicMessages":"Anthropic Messages"},"connectionsEmpty":"No channels yet. Add a provider channel, or save now and connect later.","addProvider":"Add provider","advancedSummary":"Defaults: {{value}} \xb7 editable","suggestedValue":"Suggested: {{value}}","createChoice":{"title":"New template","preset":"Quick setup (recommended)","presetHint":"Choose a service, add your API Key, then select a model.","captureHint":"Reuse a configuration you have already saved for a tool.","blank":"Manual setup (advanced)","blankHint":"Enter your own service address and model. Useful for custom services.","description":"Choose how to start. Saving a template does not switch your current tool configuration."},"presets":{"title":"Choose a provider","back":"Back","providerHint":"Enter the API Key from your service account. It is stored in the credential vault and can be reused by other templates.","createProvider":"Connect provider","baseUrl":"Service address","deepseek":"DeepSeek","zhipu":"Zhipu GLM","kimi":"Kimi (Moonshot)","minimax":"MiniMax","qwen":"Qwen (DashScope)","siliconflow":"SiliconFlow","openrouter":"OpenRouter","openai":"OpenAI","anthropic":"Anthropic","chooseAccount":"Choose a saved account","accountHint":"Several matching accounts or endpoints are available. Choose which one this template should use.","newAccount":"Add another account","chooseEndpoint":"Which tool connection do you need?","endpointHint":"Claude Code uses the Anthropic-compatible endpoint; Codex requires Responses. Tool compatibility is checked before saving.","getKey":"Get an API Key from the official site"},"clone":{"action":"Copy template","name":"{{name}} copy"},"targetAdvanced":"Change target profile or name","changeDetails":"View parameter changes","fileDetails":"View native file changes","activateSelected":"Activate in selected tools after saving","noCompatibleChannel":"No compatible channel","otherChannelAvailable":"Configurable via another channel","updateProfile":"Update existing profile","backups":"Backup and restore","backupHint":"Back up this user’s favorites, profiles, credentials and native tool files. The last 20 automatic checkpoints before favorite changes and one manual checkpoint are kept, encrypted locally.","backupNow":"Back up current state","backupCreated":"Checkpoint created","backupRestored":"Restored. The previous state was also backed up, so you can revert this restore.","backupEmpty":"No checkpoints yet. One will be created before the first change.","restoreScope":"Restore all favorites, profiles, provider credentials, active records and native configuration for the five tools to this time, replacing later changes. The current state will be backed up first. Manager sign-in and password stay unchanged.","restore":"Review restore impact","restoreConfirm":"Confirm restore","cancel":"Cancel","backupReason":{"manual":"Manual checkpoint","change":"Before favorite change","apply":"Before applying to tools","restore":"Before restore"},"workflow":"Configuration steps","chooseTools":"Choose tools","reviewChanges":"Review changes","chooseHint":"Choose tools to configure. Existing linked profiles are selected automatically.","reviewHint":"Review the changes below. Nothing is written until you confirm.","targetTools":"Target tools","activateCount":"Activate now","changedFiles":"Native file changes","autoBackupNotice":"A checkpoint is created before applying. Restore it from the global Recovery timeline.","resolveBeforeApply":"Go back to resolve the conflicts, then generate a new preview.","activeSaveRequiresActivate":"These profiles are currently active. Save-only will not change the live configuration. Switch to save-and-activate, or activate another profile first.","switchToActivateAndPreview":"Switch to activate and refresh preview","selectedCount":"{{count}} tools selected","compatibleCount":"{{count}} compatible channels","selected":"Selected","backToSelection":"Back to selection","done":"Done","confirmSave":"Save profiles","confirmActivate":"Save and activate","parameter":"Parameter","before":"Before","after":"After","noParameterChanges":"No parameter changes","mappingDetails":"Mapping and preserved settings","redactedDiffHint":"Only credentials such as API keys and tokens are hidden; models and ordinary settings remain visible. Files are shown in a normalized structure.","modeLabel":{"save":"Save for later","activate":"Save and switch now"},"toolNames":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi Code","pi":"Pi","dsh":"DeepSeek Harness"},"liveComparison":"Current tool configuration → after applying","liveComparisonHint":"Compare the current native files on disk with what will be written. Only credentials such as API keys and tokens are hidden.","previewBlocked":"Native file preview is unavailable. Resolve the blocking issues first.","savedComparison":"View saved profile changes","savedComparisonHint":"This compares the saved target profile with the profile to be saved, not the configuration currently used by the tool.","savedUnchanged":"Saved profile unchanged \xb7 View details","savedUnchangedHint":"The target profile already contains these settings. Switching to it may still change the tool\'s native files.","savedBefore":"Saved profile","savedAfter":"After saving","batchSummary":"{{count}} tools \xb7 Switch {{activate}} \xb7 Change {{files}} native files","confirmBatchSave":"Save {{count}} configuration(s) for later","confirmBatchActivate":"Confirm save and switch {{count}} tools","tabBlocked":"Needs attention","tabChanges":"{{count}} changed files","restoreReview":"Confirm global restore","restoreReviewHint":"Review the impact on the current state before restoring.","restoreChecking":"Working, please wait…","restoreRecheck":"Check impact again","restoreImpact":"{{count}} items will change","restoreNoChanges":"Current contents match this restore point. No restore is needed.","restoreUnchanged":"{{count}} unchanged items","restoreArea":{"favorites":"All model favorites","profiles":"Profiles for all tools","vault":"Providers and credential vault","active":"Active configuration records","env":"Environment file"},"restoreAction":{"create":"Restore missing file","replace":"Replace with backup contents","delete":"Delete file absent from backup"},"backupAction":{"create":"Before adding favorite “{{name}}”","update":"Before editing favorite “{{name}}”","delete":"Before deleting favorite “{{name}}”","capture":"Before capturing “{{name}}” from {{tools}}","detach":"Before detaching “{{name}}” from {{tools}}","apply":"Before configuring “{{name}}” for {{tools}}","restore":"Before global restore to {{name}}"},"channelNumber":"Channel {{count}}","channelHint":"Choose an account and model","channelProvider":"Provider account","chooseProvider":"Choose a provider endpoint","removeChannelNamed":"Remove channel: {{name}}","modelPicker":"Model","modelPickerHint":"Choose a model or enter its ID.","modelPlaceholder":"Choose or enter a model ID","modelSearch":"Search or enter a model ID","modelEmpty":"Enter a model ID to add it, or load the provider catalog first.","modelCustom":"Use “{{value}}”","catalogLoad":"Load catalog","catalogRefresh":"Refresh model list","catalogLoading":"Loading model list…","catalogCount":"{{count}} catalog models available to search above.","noCatalogManual":"No catalog available. You can still enter a model ID.","modeHint":{"save":"Save a configuration for each selected tool. Your current configuration stays in use.","activate":"Save and switch each selected tool to this configuration."},"resultTitleComplete":"Configuration complete","resultTitlePartial":"Some configurations need attention","resultHint":"Check each tool below. Successful configurations will not be repeated when you retry.","resultStatus":{"saved":"Saved for later","activated":"Switched","savedUnchanged":"Already saved \xb7 no changes needed","activatedUnchanged":"Already in use \xb7 no changes needed","failed":"Not completed","skipped":"Not run"},"resultSavedHint":"Saved to the tool\'s configuration list. Its current configuration is unchanged.","resultActivatedHint":"The tool\'s current configuration has been updated.","resultFailedHint":"This configuration did not complete. Review the reason before trying again.","resultSkippedHint":"This tool was not processed. Preview it again to continue.","resultNoticeSaved":"Saved {{count}} configuration(s) for later.","resultNoticeActivated":"Switched {{count}} tool(s).","resultNoticeUnchanged":"{{count}} configuration(s) already match.","resultNoticeFailed":"{{count}} configuration(s) did not complete.","resultNoticeSkipped":"{{count}} tool(s) were not processed.","results":"Results","backToResults":"Back to results","refreshPreview":"Generate a new preview","checkResult":"Check result and retry","unconfirmedResult":"The result is not confirmed yet. Check again using the same request to avoid repeating completed changes.","editForCompatibility":"Edit template connection","noCompatibleHint":"This tool needs a supported connection. Edit the template to choose a suitable account, endpoint and protocol.","retryTargets":"Check tool compatibility again","closeResults":"Close results","onboarding":{"createFirst":"Create your first template","startHint":"Choose a provider account and model, then save to the tools you use. Preview every write before confirming. Saving a template does not switch tools.","captureEmpty":"No profiles available to reuse","captureEmptyHint":"This list includes regular profiles without template links or custom file overrides. Create a template directly, then save it to a tool.","savedCount":"{{count}} linked profiles","activeCount":"{{count}} in use","updateCount":"{{count}} awaiting updates","configureNext":"Next: save to a tool","connectNext":"Next: add a model connection","savedHint":"Your template is saved and currently has no linked tool profiles. Choose tools and preview to save and switch.","connectedHint":"Template changes do not update linked profiles automatically. Preview and confirm to sync them.","reviewUpdates":"Preview pending updates ({{count}})","ignoreUpdates":"Ignore this update","ignoreUpdatesHint":"Keep the current configuration and template link. Future template changes will still notify you."},"relationships":{"chooseConnection":"Choose a model connection","hint":"Check each tool’s profile status, then preview and confirm the switch.","save":"Save to tool","switch":"Save and switch","savedCount":"{{count}} saved profiles","requestModel":"Request model ID","noConnection":"Add a provider and model connection before saving to a tool."},"management":{"view":"View profile","detachTitle":"Detach this template?","detachHint":"Detach {{harness}} / {{name}} from the template. Keep its configuration and current activation state. It will no longer receive updates from this template.","detached":"Detached {{harness}} / {{name}}. Its configuration and current activation state are unchanged.","deleteBlocked":"{{count}} profiles still link to this template. Detach each profile before deleting the template. Detaching keeps configurations and current activation states.","deleteTitle":"Delete this template?","deleteHint":"Delete template “{{name}}”. It has no linked profiles. This does not change tool configurations or current activation states.","noReferences":"No linked profiles. This template can be deleted safely.","missingProfile":"This profile is unavailable. Refresh and try again."},"connectionDetails":"Service address and API protocol","connectionDetailsHint":"View the service address and adjust the API protocol for this connection. Manage addresses in the credential vault. Usually the protocol needs no changes; follow your provider documentation for custom services.","connectionCapabilities":"Customize per connection","connectionCapabilitiesHint":"Each connection shows its effective capabilities. Change only values that differ by provider or model; connection settings take precedence over template defaults.","catalogFallbackAvailable":"List unavailable. Use a preset or enter a model ID.","capabilityUnknownHint":"Unit: tokens; clear to leave unspecified","draft":{"discardTitle":"Discard unsaved changes?","discardHint":"Your changes have not been saved. Keep editing to preserve this draft.","keepEditing":"Keep editing","discard":"Discard changes"},"capabilitiesSource":{"preset":"Includes preset declarations added this session (not tested)","declared":"Capabilities declared","unspecified":"No connection override"},"editorSections":"Template settings","connectionTab":"Connections","capabilitiesTab":"Model capabilities","advanced":"Advanced","advancedHint":"Model capabilities, more connections, default model and notes","sharedCapabilities":"Template defaults","sharedCapabilitiesHint":"Shared by all connections unless overridden. Missing fields are prefilled with 256K context, 64K output and reasoning enabled; existing values are preserved. Changes take effect when you save the template. Adjust or clear them for your model.","inheritedValue":"Inherited from template","overriddenValue":"Set for this connection","unspecifiedValue":"Unspecified","resetInheritance":"Reset all to template defaults","notesOptional":"Template notes (optional)","effortLevelsHint":"Select only levels supported by this model; leave empty if unknown. Reasoning support does not imply support for every level.","effortPreferenceHint":"Choose a declared level, or leave unspecified to use the tool or provider default.","effortUnknownHint":"Supported levels are not declared. Keep the default behavior until the levels are confirmed.","followDefault":"Unspecified; use default","changeProtocol":"Change protocol","scheme":{"modelMulti":"Models (multiple)","defaultModel":"Default model","chooseDefault":"Choose a default model","defaultHint":"The first model is selected initially; later changes are your choice.","defaultRemoved":"The default model was removed. Choose a replacement.","toolSettings":"Tool settings","toolHint":"Save how each tool uses this template.","useConnection":"Connection","noCompatible":"Add a compatible connection and model first.","default":"Use the default model for all tiers","tiers":"Assign models by tier","chooseModel":"Choose a model","sameConnection":"Choose within one connection. Models can be reused.","allDefault":"Use default for all tiers","availableModels":"Available models","startModel":"Startup model","followTemplate":"Follow template default","defaultIncompatible":"The default is not available. Choose a model explicitly.","followModel":"Follow model settings","tools":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi","dsh":"DSH","pi":"Pi"},"tier":{"opus":"Opus","sonnet":"Sonnet","haiku":"Haiku"},"collectionApplyHint":"Apply this template’s selected models and retain models managed by other templates.","modelSettings":"Settings for {{model}}","editorHint":"Manage connections, models, and how each tool uses them.","toggleConnection":"Expand or collapse connection: {{name}}","selectedCount":"{{count}} models","invalidBinding":"Tool model assignments are incomplete, removed, or outside the selected connection. Choose again.","invalidBindingTools":"{{tools}} still points at a deleted connection. Open that tool on the right: pick a connection again, or enable the needed protocol on the remaining connection, then save.","toolListSep":", ","draftSaved":"Pending configuration saved. The active tool configuration is unchanged.","reasoningEffort":"Reasoning effort","chooseConnection":"Choose a model connection","protocolRequired":"{{tool}} requires {{protocol}}; existing connections use another protocol.","enableProtocolOnConnection":"Enable {{protocol}} on {{name}}","protocolConnectionHint":"Add the protocol to the same connection so the account and models stay shared. Confirm this endpoint supports it.","reviewTool":"Selected {{tool}}. Next, review the configuration, resolve conflicts, and confirm saving or switching.","searchModels":"Search connections or models","filteredSelectionHint":"Bulk actions affect only models matching this filter.","groupSelectionCount":"{{selected}} / {{count}} selected","collectionProfile":"Multi-model configuration \xb7 {{count}} models","manageCollection":"Manage template and models","missingReasoningCount":"{{count}} models have unspecified reasoning levels","selection":{"all":"Select all","none":"Clear","invert":"Invert"}}},"favorite":{"result":"Operation completed"},"templates":{"tag":"Template"},"workspace":{"fileDiffTab":"File changes","navigation":"Main navigation","breadcrumb":"Breadcrumb","nav":{"workspace":"Workspace","favorites":"Templates","history":"Recovery timeline"},"eyebrow":"CONFIGURATION WORKSPACE","title":"What are your tools using?","subtitle":"Choose a tool and inspect the configuration currently in use.","homeSubtitle":"Home shows only live configuration; switching and management stay in each tool\'s configuration workspace.","manageFavorites":"Manage templates","switchTool":"Switch {{name}}","configureTool":"Configure and switch","configureSwitch":"Configure and switch","switcherEyebrow":"CONFIGURE AND SWITCH","switcherTitle":"Configure and switch {{name}}","switcherHint":"Create a candidate from a configuration or template, compare its route and file changes, then confirm the write.","configurations":"Configurations","useConfiguration":"Use this configuration","newConfiguration":"New configuration","noProfiles":"No local configuration is available to switch to yet.","noTemplates":"No template yet.","manageConfigurations":"Manage configuration entries","mappedModels":"Role-based mapping","toolDefaultModel":"Default model selected by the tool","currentConfigurationManagement":"Current configuration and advanced management","chooseTemplate":"Choose a template","pickTemplate":"Search and select a template","pickTemplateHint":"Choose a template to see its connections and preview the switch.","newFromTemplate":"Create configuration from template","templateAlreadyLinked":"Already linked","manageTemplates":"Manage templates","noMatches":"No matching models.","startTitle":"Save a model once. Use it across your tools.","startHint":"Start from an existing tool profile to reuse its provider and model ID. Then choose a tool to preview a switch without entering credentials again.","noTools":"No tool information available.","lastBackup":"Latest recovery point: {{time}}","historyHint":"Save a checkpoint or explore automatic backups before favorite operations.","openHistory":"View timeline","relationship":"Configuration connections","provider":"Provider","tool":"Tool","missingProvider":"Provider missing","relationshipHint":"Connections show configuration sources and writes. Tools send model requests directly.","currentChain":"Current route","configuration":"Configuration","currentChainHint":"This route is active in the current tool.","currentForTool":"{{name}} is currently using","currentForToolHint":"Home only shows active configuration, never an unconfirmed candidate.","activeNow":"Active","switchMap":"Current and new routes","candidateChain":"New route","appliesAfterConfirm":"Active after apply","notWritten":"Not written","switchTarget":"Switching {{name}} in this preview","switchTargetHint":"This is a preview target for {{name}} and has not been written. Other tools keep their own current configuration.","checking":"Checking available channels…","chooseChannel":"Choose a channel for this switch","current":"Current","currentToolModel":"Current {{name}} model","targetToolModel":"{{name}} will switch to","preview":"Preview switch","previewHint":"Takes effect after confirmation. An automatic backup is available in the recovery timeline.","captureHint":"Reuse the model and provider from an existing profile.","favoriteEyebrow":"MODELS CONNECTED TO TOOLS","favoriteHint":"Choose a template to inspect model connections and tool status, then preview the profiles to save or switch.","favoriteDetail":"Connections reflect actual channels and tool profiles.","graphHint":"Choose an account on the left (and a model above when it has several), then a tool on the right.","manageLinks":"Manage generated profiles and favorite","inUse":"In use","saved":"Saved","available":"Available","linkMissing":"Linked source missing","back":"Back to workspace","backToTool":"Back to {{name}}","details":"Details","detailsSummary":"Write targets and mode, env file, history","sharedProviderHint_one":"{{count}} configuration shares a provider with another. Save them as a template: edit once, apply everywhere.","sharedProviderHint_other":"{{count}} configurations share one provider. Save them as a template: edit once, apply everywhere.","captureCurrent":"Favorite the current profile"},"timeline":{"title":"Recovery timeline","eyebrow":"YOUR CONFIGURATION THROUGH TIME","subtitle":"Return to a working configuration. Select a checkpoint to review its impact.","points":"Recovery points","current":"Current state","currentHint":"Models currently used by your tools","snapshot":"Historical snapshot","snapshotHint":"Automatic checkpoints preserve the state before the named operation. Review the file changes needed to restore it from the current state.","older":"Older","newer":"Newer","restore":"Restore all to this point","protection":"Your current state is backed up before restoring.","currentDescription":"These are your tools\' active configurations. Save a manual checkpoint or choose a historical recovery point.","selectHint":"Select a recovery point to review files that will be replaced, deleted, or created."},"validation":{"nameRequired":"The name cannot be empty","nameTooLong":"The name is too long","nameSlash":"The name cannot contain slashes","passwordRequired":"The password cannot be empty","endpointKeyRequired":"The endpoint key cannot be empty","endpointKeyTooLong":"The endpoint key is too long","endpointKeySlash":"The endpoint key cannot contain slashes","endpointKeyDuplicate":"Endpoint keys must be unique","endpointBaseUrlRequired":"The endpoint needs a base URL","apiKeyRequired":"The API key cannot be empty","sourceUserRequired":"The source user cannot be empty","providerIdSlash":"The provider ID cannot contain slashes","providerIdReserved":"That provider ID is reserved","selectionRequired":"Select at least one configuration","baseUrlRequired":"The base URL cannot be empty","tokenRequired":"The token cannot be empty"},"cli":{"error":{"unknownShortOption":"Unknown option: {{option}}","invalidOption":"Invalid option: --","optionTakesNoValue":"Option --{{option}} does not take a value","optionNeedsValue":"Option --{{option}} needs a value","unknownOption":"Unknown option: --{{option}}","usage":"Usage: harness-switch {{usage}}","missingArgument":"Missing argument: {{what}}","loginNoSession":"Sign-in failed: the server returned no session","loginFailed":"Sign-in failed: {{reason}}","requestFailed":"Request failed: HTTP {{status}}","serviceUnreachable":"Cannot reach the local service at {{url}}. Start it first (harness-switch daemon or server)","passwordFileMissing":"{{file}} not found. Run the service once (harness-switch daemon or server) to generate the password, then use the CLI.","syncNeedsUsers":"sync needs --from <source user> and --to <target user>","importNeedsId":"import needs at least one candidate id; run harness-switch scan to list them","nameSingleImportOnly":"--name only applies to a single import","apiKeyConflict":"--api-key and --api-key-env cannot be used together","envVarUnset":"Environment variable {{name}} is unset or empty","confirmNeedsTty":"A non-interactive terminal needs --yes to confirm this operation","unknownCommand":"Unknown command: {{command}}"},"output":{"officialLogin":"Official login","notSwitchable":"not switchable","syncDone":"Synced from {{source}} to {{target}}","syncCounts":"added={{imported}} overwritten={{overwritten}} skipped={{skipped}} credentials={{providers}} codexLoginCache={{cache}}","migrated":"migrated","notMigrated":"not migrated","created":"Created {{harness}}/{{profile}}","deleted":"Deleted {{harness}}/{{profile}}","confirmDelete":"Delete {{harness}}/{{profile}}? [y/N] ","confirmActivate":"Activate {{harness}}/{{profile}}? [y/N] ","confirmOfficial":"Return {{harness}} to its official login? [y/N] ","cancelled":"Cancelled","activated":"Activated {{harness}}/{{profile}}","undone":"Reverted {{kind}} {{harness}}/{{profile}}","importCounts":"imported={{imported}} skipped={{skipped}} newVaultEntries={{providers}}","importNote":"The tools\' own configuration files were not modified; run activate to apply.","willWrite":"will write","noChange":"no change","planNote":"The content includes API keys; view it only on a trusted terminal.","sourceMissing":"missing","sourceRead":"read","sourceUnparsable":"unparsable","candidateActive":"in use","candidateKeyManual":"key=fill in manually","candidateInVault":"already in vault: {{provider}}","noBaseUrl":"(no base url)","scanNote":"Use harness-switch import <id>... to import; neither scanning nor importing changes the tools\' own configuration.","undoable":"undoable","notUndoable":"not undoable"}},"toolModels":{"title":"Available models","hint":"Combine model templates for this tool and choose a default independently.","manage":"Manage models","loading":"Loading model collection…","retry":"Reload","missing":"Missing template or connection","remove":"Remove","connection":"Connection","settings":"Settings for this tool","inheritHint":"Values follow this template and connection. Only fields you edit are overridden for this tool.","reset":"Follow template and connection","previewTitle":"Review model changes","previewCount":"Write {{count}} models; remove {{removed}} previous entries.","defaultChanged":"Default: {{name}} \xb7 {{model}}","keepDefault":"Keep the current default","notRepresented":"This tool cannot write these settings: {{fields}}","apply":"Apply these changes","empty":"No models selected. Add templates below.","add":"Add from templates (select multiple)","noTemplates":"Create a model template with a connection first.","default":"Default model after applying","scope":{"kimi":"Models are written to Kimi Code. Restart or reload the tool to read the new configuration.","dsh":"The default applies to new DSH sessions; an existing session keeps its own model selection."},"save":"Save draft only","preview":"Preview application","saving":"Saving draft…","previewing":"Preparing preview…","applying":"Writing model configuration…","saved":"Draft saved. Native configuration has not changed.","applied":"Model configuration applied.","appliedCount":"{{count}} models last applied","draftHint":"Saved draft; preview to compare it with the native configuration.","nativeStatus":{"unknown":"No applied models to compare yet.","in-sync":"Applied models match the native configuration.","drifted":"Native models differ from the last application. Review changes before applying again.","invalid":"Unable to compare native configuration. Check the files and preview again."}}}'),h=JSON.parse('{"app":{"name":"harness-switch","tagline":"写入原生配置","checkingSession":"正在检查会话…","brandMark":"HS / harness-switch","devMode":"本地开发模式:当前页面由本地 dev server 提供"},"language":{"toEnglish":"Switch to English","toChinese":"Switch to Chinese","short":"EN"},"theme":{"toLight":"切换到浅色主题","toDark":"切换到深色主题"},"login":{"title":"服务器端配置中枢","intro":"激活档案时直接写入各 CLI 自己的配置文件,不依赖你在某个 shell 里 source 过什么。","hint":"输入首次启动时终端打印的 Web 密码。","password":"Web 密码","submitting":"登录中…","submit":"登录"},"nav":{"currentLocalUser":"当前本地用户","localUser":"本地用户","transfer":"配置迁移","vault":"凭据库","signOut":"退出","switchHarness":"切换 Harness"},"account":{"password":{"title":"修改密码","intro":"更新共享的网页密码。其他所有已登录会话都会被结束。","current":"当前密码","next":"新密码","confirm":"确认新密码","hint_one":"至少 {{count}} 个字符。","hint_other":"至少 {{count}} 个字符。","mismatch":"两次输入的密码不一致","changed":"密码已修改","submit":"修改密码","submitting":"保存中…"}},"feedback":{"label":"反馈","hint":"在 GitHub 上反馈问题"},"harness":{"field":{"toggle":{"on":"开启","off":"关闭"},"providerId":{"label":"Provider ID(可选)","placeholder":"默认取配置名称"},"contextLength":{"label":"上下文长度"},"maxTokens":{"label":"最大输出 tokens"},"claude":{"authVar":{"label":"凭据变量","help":"第三方中转通常要求 ANTHROPIC_AUTH_TOKEN;官方 API key 用 ANTHROPIC_API_KEY。","option":{"authToken":"ANTHROPIC_AUTH_TOKEN(第三方中转)","official":"ANTHROPIC_API_KEY(官方)"}},"haikuModel":{"label":"Haiku 模型映射"},"sonnetModel":{"label":"Sonnet 模型映射"},"opusModel":{"label":"Opus 模型映射"},"fableModel":{"label":"Fable 模型映射(可选)","help":"写入 ANTHROPIC_DEFAULT_FABLE_MODEL;用于支持 Fable 档位的新版 Claude Code。"},"subagentModel":{"label":"子代理模型(可选)","help":"写入 CLAUDE_CODE_SUBAGENT_MODEL,可让子代理使用更快或成本更低的模型。"},"haikuModelName":{"label":"Haiku 显示名称(选填)"},"sonnetModelName":{"label":"Sonnet 显示名称(选填)"},"opusModelName":{"label":"Opus 显示名称(选填)"},"fableModelName":{"label":"Fable 显示名称(选填)"},"modelMapping":{"help":"写入 {{envVar}}。"},"modelName":{"help":"写入 {{envVar}};留空时 Claude Code 默认显示对应模型 ID。","placeholder":"留空则使用 {{role}} 模型 ID"},"example":{"placeholder":"例如:{{value}}"},"extraEnv":{"label":"追加环境变量(可选)","help":"每行一个 KEY=VALUE,会合并进 settings.json 的 env。"},"oneM":{"subagentLabel":"子代理 声明支持 1M","label":"{{role}} 声明支持 1M","help":"在模型 ID 末尾追加 [1m],向 Claude Code 声明 1M 上下文;Claude Code 请求上游前会去掉该后缀。仅在该模型确实支持 1M 时开启。"}},"codex":{"envNote":"仅「环境变量」认证模式需要 env.sh,其余模式的凭据自包含在 config.toml 里。","authMode":{"label":"认证方式","help":"auth.json 就是 Codex 的登录缓存,覆盖它会丢失 ChatGPT 登录态,所以默认不碰它。","option":{"bearerToken":"写入 config.toml(推荐,保留官方登录)","envKey":"环境变量(需要 source env.sh)","openaiAuth":"写入 auth.json(会覆盖 ChatGPT 登录缓存)"}},"providerId":{"help":"openai / ollama / lmstudio / amazon-bedrock 等是 Codex 保留字,会自动改名。"},"envKeyName":{"label":"环境变量名","help":"仅「环境变量」模式生效。"},"reasoningEffort":{"label":"推理强度(可选)","option":{"unset":"不设置"}},"target":{"auth":"auth.json(仅 auth.json 模式)"}},"kimi":{"envNote":"Kimi Code 不从 shell 读取凭据,env.sh 对它无效。","providerType":{"label":"Provider 类型","help":"决定 Kimi Code 使用哪套协议实现。","option":{"kimi":"kimi(Moonshot / Kimi Code)"}},"maxContextSize":{"help":"Kimi Code 要求 models 条目必须声明 max_context_size。"}},"pi":{"envNote":"API key 直接写入 models.json,无需环境变量;运行时仍可用 --model 覆盖。","providerId":{"help":"模型引用格式为 provider/model。"},"api":{"label":"协议"},"authHeader":{"label":"Authorization 头","help":"以 Authorization: Bearer <key> 发送。"},"reasoning":{"label":"推理能力","help":"对应 models.json 的 reasoning。GPT / Claude 思考模型需要开启。"},"target":{"auth":"auth.json(仅检测官方登录)"}},"dsh":{"envNote":"API key 安全写入 DSH 的 .credentials.yaml,并由 DSH 的配置文件引用。","providerType":{"label":"提供方类型","option":{"custom":"自定义提供方","official":"DeepSeek 官方 API"}},"providerId":{"help":"DSH 的模型路由标识;必须以小写字母开头。"},"models":{"label":"模型目录(可选)","placeholder":"每行一个模型 ID;留空时只注册上方的默认模型","help":"一个提供方可注册多个模型;上方“模型”作为新会话的默认模型。"},"api":{"label":"API 协议"},"reasoningEfforts":{"label":"支持的思考程度","help":"DSH 只会显示这里声明且上游模型实际支持的档位。","option":{"unset":"不声明(提供方默认)","none":"模型不支持思考程度","lowToMax":"Low / Medium / High / XHigh / Max","lowToXhigh":"Low / Medium / High / XHigh","minimalToHigh":"Minimal / Low / Medium / High"}}}},"subtitle":"管理配置档案并安全写入该工具的原生配置文件。","newProfile":"新增配置","addCustomProvider":"添加自定义提供方","current":"当前:{{name}}","currentInactive":"当前:未激活","activeConfig":"当前生效配置","defaultModel":"默认模型","activeNamed":"当前激活 \xb7 {{name}}","inactive":"未激活","active":"已激活","activate":"激活","setDefault":"设为默认","default":"默认","deepseekOfficial":"DeepSeek 官方","writeTargets":"写入目标","noTargetFile":"未配置目标文件","moreFiles_one":"以及另外 {{count}} 个文件","moreFiles_other":"以及另外 {{count}} 个文件","overwriteWarning":"配置将直接覆盖目标文件。写入前会自动备份,切换后请验证服务连通性与模型可用性。","profiles":"配置档案","providers":"提供方","profileCount_one":"{{count}} 个自定义配置","profileCount_other":"{{count}} 个自定义配置","copy":"复制 {{name}}","noProfiles":"还没有配置档案","manualOverride":"手动接管","edit":"编辑 {{name}}","delete":"删除 {{name}}","deleteBlocked":"先激活另一个配置,才能删除当前配置","deleteTitle":"删除配置?","deleteBody":"将删除 {{harness}} / {{profile}}。{{extra}}此操作不可撤销。","deleteAdditiveExtra":"它在配置文件里的 provider 条目也会被一并摘掉。","deleteDshOfficialExtra":"它的 DeepSeek 原生路由和凭据引用也会被一并移除。","official":"官方登录","officialActive":"已使用","officialSwitch":"切回官方","officialHintClaude":"使用 Claude Code 自身的 Anthropic 账号登录","officialHintCodex":"使用 Codex 自身的 ChatGPT / OpenAI 账号登录","officialHintKimi":"使用 Kimi Code 自身的 Kimi 账号登录(/login 写入的 OAuth 凭据)","officialHintPi":"回到 Pi 自身 /login 写入 auth.json 的账号;启动模型由 Pi 自行选择,可用 /model 调整","officialHintDsh":"检测并切换到 DeepSeek Harness 已有的 DeepSeek 官方 API Key 配置。","application":"应用","writeMode":"写入模式","modeReplace":"替换当前配置","modeAdditive":"保留并切换指针"},"profile":{"editTitle":"编辑 {{harness}} / {{profile}}","createTitle":"新增 {{harness}} 配置","copyTitle":"复制 {{harness}} / {{profile}}","intro":"保存后会写入 {{targets}}。","additiveNote":"该工具的配置文件按 provider 共存,切换只会移动当前指针,不会删除你手写的其他 provider。","useSharedProvider":"使用共享 Provider(凭据库)","useSharedProviderLabel":"使用共享 Provider","keyFromVault":"密钥由凭据库提供","providerNone":"不使用(本配置自带密钥)","vaultEmpty":"凭据库为空,可先在顶部「凭据库」中新增 Provider 条目。","namedEndpoint":"命名 Endpoint(可选)","namedEndpointLabel":"命名 Endpoint","endpointNone":"不指定(使用下方 Base URL)","endpointOption":"{{label}}({{key}})","noEndpoints":"该 Provider 没有命名 endpoint,将使用下方 Base URL。","quickFill":"快速填充:","name":"配置名称","namePlaceholder":"例如:openrouter-main","renameHint":"修改后会同步更新当前激活状态和原生配置中的 Provider 标识。","baseUrl":"API Base URL","baseUrlPlaceholder":"https://api.example.com/v1","baseUrlFromVault":"Base URL 来自凭据库 endpoint「{{endpoint}}」。","apiKey":"API Key","apiKeyKeep":"留空表示保持不变","apiKeyRequiredPlaceholder":"必填","apiKeySharedHint":"已引用共享 Provider,密钥在「凭据库」中统一轮换。","dshOfficialApiKeyHint":"填写 DeepSeek 开放平台 API Key;它会安全写入 DSH 的 .credentials.yaml,并以 DEEPSEEK_API_KEY 被 DSH 的配置文件引用。","fallbackModel":"回退模型(ANTHROPIC_MODEL)","model":"模型","fallbackModelPlaceholder":"可选;各档未匹配时使用,例如 glm-5","modelPlaceholder":"例如:claude-sonnet-4-5","claudeModelHint":"留空则沿用 Claude Code 默认模型;可在下面分别映射各模型档位。","notes":"备注(可选)","advanced":"高级:原始配置","overridden":"已手动接管","saveFirst":"先保存这份配置,之后回到编辑界面即可接管原始文件内容。","save":"保存配置","saving":"保存中…","rawLoading":"正在读取将写入的内容…","rawIntro":"下面是当前会写入磁盘的内容,基于最近一次保存的字段生成。改动任意一份即视为手动接管,之后表单字段不再影响这份文件。","resetToGenerated":"恢复为自动生成","selectPlaceholder":"请选择","mapping":{"title":"模型映射","intro":"显示名称仅影响 Claude Code 的 /model 菜单;留空时显示对应的实际模型 ID。开启「1M 上下文」会在模型 ID 末尾追加 [1m],仅在该模型确实支持 1M 时开启。","role":"模型角色","displayName":"显示名称","actualModel":"实际请求模型","oneM":"1M 上下文","defaultTo":"默认:{{model}}","notInMenu":"不显示在 /model 菜单","oneMUnsupported":"{{role}} 不支持 1M","enable":"启用"},"error":{"nameRequired":"请输入配置名称","nameSlash":"配置名称不能包含 / 或 \\\\","nameTooLong":"配置名称最多 {{max}} 个字符","nameDuplicate":"同名配置已经存在","baseUrlRequired":"请输入 API Base URL","apiKeyRequired":"请输入 API Key","modelRequired":"请输入模型名称","providerGone":"引用的 Provider 已不存在,请重新选择","endpointGone":"引用的 Endpoint 已不存在,请重新选择","fieldRequired":"请填写{{label}}","checkFields":"请检查标红的必填项或输入内容。"}},"vault":{"title":"凭据库","intro":"Provider 条目集中保存 API Key(AES-256-GCM 加密,默认不显示明文),并附带可复用的 endpoint。配置档案可以引用这里的条目,而不是各自保存一份密钥。","createTitle":"新增 Provider","editTitle":"编辑 {{name}}","formIntro":"配置凭据和可复用的命名 Endpoint;保存后返回凭据库列表。","loading":"正在读取凭据库…","entryCount_one":"{{count}} 个 Provider 条目","entryCount_other":"{{count}} 个 Provider 条目","add":"新增凭据","empty":"凭据库为空,先新增一个 Provider。","keyConfigured":"密钥已配置","keyMissing":"未配置密钥","noEndpoints":"没有命名 endpoint","reveal":"显示 {{name}} 的密钥","hide":"隐藏 {{name}} 的密钥","edit":"编辑 {{name}}","delete":"删除 {{name}}","close":"关闭","deleteTitle":"删除这个 Provider?","deleteBody":"将删除「{{name}}」。被配置档案引用的条目无法删除,请先移除引用。","deleted":"已删除。","deleteFailed":"删除失败","revealFailed":"无法读取密钥","name":"名称","namePlaceholder":"例如:openrouter","apiKey":"API Key","apiKeyKeep":"留空表示保持不变","apiKeyRequiredPlaceholder":"必填","notes":"备注(可选)","endpoints":"命名 Endpoint(可选)","endpointsHint":"配置档案引用此 Provider 时可以选择某个 endpoint,其 Base URL 优先于配置自身的地址。","noEndpointDrafts":"还没有 endpoint","endpointKeyLabel":"Endpoint {{index}} 名称","endpointKeyPlaceholder":"标识,如 default","endpointUrlLabel":"Endpoint {{index}} Base URL","endpointUrlPlaceholder":"https://api.example.com/v1","endpointLabelLabel":"Endpoint {{index}} 标签","endpointLabelPlaceholder":"显示标签(可选)","removeEndpoint":"移除 Endpoint {{index}}","addEndpoint":"添加 endpoint","saving":"保存中…","saveChanges":"保存修改","updated":"已更新。","created":"已新增 Provider 条目。","saveFailed":"保存失败","error":{"nameRequired":"请输入 Provider 名称","apiKeyRequired":"请输入 API Key","endpointKeyRequired":"请输入 Endpoint 标识","endpointKeyInvalid":"不能包含 / 或 \\\\,且最多 {{max}} 个字符","endpointKeyDuplicate":"Endpoint 标识不能重复","endpointUrlRequired":"请输入 Base URL","checkFields":"请检查标红的必填项。"},"probeEndpointLabel":"选择要测试的 endpoint","probeFailed":"测试请求失败"},"activate":{"title":"激活配置?","officialTitle":"切回官方登录?","body":"将把 {{harness}} 切换到「{{profile}}」并写入原生配置文件{{changed}}。目标本地用户:{{user}}。写入前会自动备份。","officialBody":"将把 {{harness}} 切回官方登录并写入原生配置文件{{changed}}。目标本地用户:{{user}}。写入前会自动备份。","changedFiles_one":",其中 {{count}} 个文件将变更","changedFiles_other":",其中 {{count}} 个文件将变更","loadFailed":"无法读取将要写入的内容:{{reason}}","loading":"正在读取将要写入的内容…","confirm":"确认激活","executing":"正在写入…","failed":"写入失败:{{reason}}。配置未切换,请修正后重试。","retry":"重试激活","retryPreview":"重新读取预览"},"env":{"title":"环境变量文件兼容性","intro":"切换本身不需要它。只有 Codex 选择「环境变量」认证方式时才需要在对应 shell 执行:","note":"文件里只会写入对应工具确实认识的变量。Kimi Code 与 Pi 不从 shell 读取凭据,所以它们只有一行注释。"},"backup":{"latest":"最近备份","profile":"配置档案","fileCount_one":"{{count}} 个文件","fileCount_other":"{{count}} 个文件","empty":"还没有历史快照","history":"历史快照","restore":"恢复","restoreTitle":"恢复这份快照?","restoreBody":"将把 {{harness}} / {{profile}} 在 {{time}} 的配置文件写回磁盘,覆盖当前内容。","confirmRestore":"确认恢复","current":"与磁盘一致","loadFailed":"无法读取快照内容:{{reason}}","loading":"正在读取快照…","written":"已把该历史快照的文件写回磁盘。","historyTitle":"{{harness}} 配置历史","historyIntro":"每次写入前都会把原文件快照到数据目录,保留最近 10 份。这里只显示当前工具的历史;与磁盘一致的条目会标成「当前」。","currentBadge":"当前","withDeletions":"含删除","restoreHistoryTitle":"恢复这份历史?","restoreHistoryBody":"红是当前将丢失的内容,绿是恢复后的内容。确认后会按历史快照覆盖磁盘文件,harness-switch 记录的「当前激活」不会随之回退。","comparing":"正在对比差异…","diffFailed":"加载差异失败"},"diff":{"delete":"将删除","create":"将新建","replace":"将覆盖","same":"无变更","rendering":"正在渲染差异…","absent":"(当前不存在)","afterRestore":"↓ 恢复后","deletedAfterRestore":"(恢复后删除)","bothAbsent":"两侧都不存在"},"drift":{"title":"配置漂移","recheck":"重新检查漂移","checking":"正在检查漂移…","noData":"暂无漂移数据。","none":"无漂移","mismatch_one":"{{count}} 个文件不一致","mismatch_other":"{{count}} 个文件不一致","moreFiles":"还有 {{count}} 个文件…","viewDiff":"查看差异","dialogTitle":"{{harness}} 配置漂移","legend":"红色是磁盘现状,绿色是按激活配置应写入的内容。","noActiveProfile":"该工具未激活任何配置。","nothingToCompare":"未激活任何配置,没有可对比的内容。","allInSync":"所有文件与激活配置一致。","adopt":"采纳现场配置","reapply":"重新应用","reapplyTitle":"重新应用激活配置?","reapplyBody":"将按激活配置重新写入 {{harness}} 的原生配置文件,覆盖磁盘上的现场修改。写入前会自动备份。","confirmReapply":"确认重新应用","reapplyFailed":"重新应用失败","adoptTitle":"采纳现场配置?","adoptBody":"将把磁盘上的当前内容回填进配置档案,之后的写入会以现场为准。此操作不可撤销。","confirmAdopt":"确认采纳","adoptFailed":"采纳失败","reapplied":"已按激活配置重新写入 {{harness}} 的原生配置文件。","adopted":"已把 {{harness}} 现场配置回填进配置档案。","status":{"in-sync":"一致","drifted":"已修改","missing":"缺失","invalid":"无法解析","unknown":"未知"}},"doctor":{"title":"诊断","titleFor":"{{harness}} 诊断","intro":"检查工具安装、配置文件可读可写可解析、存储权限与漂移状态。","checking":"正在检查…","notRun":"尚未运行诊断","viewDetails":"查看详情","rerun":"重新诊断","close":"关闭","updateAvailable":"有新版本可用","noChecks":"没有可检查的项目","countOk":"{{count}} 项正常","countWarn":"{{count}} 项警告","countError":"{{count}} 项错误","countUnknown":"{{count}} 项未知","status":{"ok":"正常","warn":"警告","error":"错误","unknown":"未知"},"check":{"installFound":"已找到可执行文件 {{bin}}","installMissing":"未找到可执行文件 {{bin}}(PATH 中不存在),工具可能未安装","installNotRequired":"{{harness}} 以 Web 服务部署,不要求 PATH 上有 CLI","fileMissing":"{{target}} 不存在({{path}})","fileUnreadable":"{{target}} 不可读({{path}})","fileUnwritable":"{{target}} 不可写({{path}})","filePermissive":"{{target}} 存在可读写,但权限为 {{mode}},group/other 可读,建议 0600","fileOk":"{{target}} 存在且可读可写({{path}})","parseOk":"{{target}} 解析正常","parseFailed":"{{target}} 无法解析:{{reason}}","parseUnreadable":"{{target}} 无法读取:{{reason}}","driftNoProfile":"未激活任何配置,无漂移可检查","driftInvalid":"live 文件存在无法解析的内容","driftMismatch_one":"{{count}} 个文件与激活配置不一致({{status}})","driftMismatch_other":"{{count}} 个文件与激活配置不一致({{status}})","driftInSync":"live 文件与激活配置一致","officialCredentialMissing":"官方登录的凭据文件 {{target}} 不存在({{path}}),工具已退出登录","probeNoProfile":"未激活任何配置,跳过连通性探测","probeOfficialLogin":"{{harness}} 处于官方账号登录状态,无自定义端点可探测","probeMissingCredential":"配置 {{profile}} 缺少 Base URL 或 API Key,无法探测","probeOk":"配置 {{profile}} 的端点可达","probeFailed":"配置 {{profile}} 的连通性探测失败","completionOk":"模型 {{model}} 补全成功({{latencyMs}}ms)","completionFailed":"模型 {{model}} 补全失败:端点可达,但这个模型无法作答","completionOkCached":"模型 {{model}} 补全成功({{latencyMs}}ms,缓存结果)","completionFailedCached":"模型 {{model}} 补全失败:端点可达,但这个模型无法作答(缓存结果)","homePatchOverride":"{{path}} 覆盖了 {{entries}};它优先于所有 profile,harness-switch 写入的 profile 配置对这些条目不会生效"}},"notice":{"switchDone":"切换完成","warningPrefix":"注意:{{message}}","currentUser":"当前用户","transferImported":"导入完成。","userSynced":"同步完成。"},"operations":{"undone":"已撤销 {{harness}} 的这次操作,原生配置文件与「当前激活」记录都回到了操作前。","title":"操作记录","titleFor":"{{harness}} 操作记录","intro":"每次写入原生配置都会先落一条记录,断电或进程被杀掉后,服务下次启动会按它把没做完的操作回滚。撤销会把配置文件和「当前激活」一起退回操作前的状态。","loading":"正在加载…","empty":"还没有操作记录","viewDetails":"查看详情","refresh":"刷新","close":"关闭","count_one":"{{count}} 条记录","count_other":"{{count}} 条记录","fileCount_one":"{{count}} 个文件","fileCount_other":"{{count}} 个文件","user":"用户 {{user}}","undo":"撤销","undoTitle":"撤销这次操作?","undoBody":"会把 {{harness}} 的 {{count}} 个原生配置文件恢复成这次操作之前的内容,并把「当前激活」一并退回。这一步本身也会先做一次快照。","undoFailed":"撤销失败","confirmUndo":"确认撤销","kind":{"activate":"切换配置","activate-official":"切回官方登录","revoke":"移除 provider","reapply":"重新写入","import":"导入","sync":"跨用户同步"},"state":{"prepared":"准备中","applying":"写入中","metadata-committed":"收尾中","committed":"已完成","rolled-back":"已回滚","degraded":"需人工处理"}},"error":{"unknown":"未知错误","http":{"requestFailed":"请求失败","invalidRequest":"请求数据无效","internalServerError":"服务器内部错误","authenticationRequired":"需要登录","crossOriginDenied":"跨域请求被拒绝"},"auth":{"invalidPassword":"密码错误","passwordChangeRejected":"当前密码不正确","passwordTooShort_one":"新密码至少需要 {{count}} 个字符","passwordTooShort_other":"新密码至少需要 {{count}} 个字符","passwordUnchanged":"新密码与当前密码相同","tooManyAttempts":"失败次数过多,请在 {{seconds}} 秒后重试"},"github":{"notConnected":"请先连接 GitHub","authFailed":"GitHub 授权失败,请重新登录","gistNotFound":"GitHub 中未找到 harness-switch 备份 Gist","deviceCodeExpired":"设备授权码已过期,请重新获取","rateLimitExceeded":"GitHub API 请求速率超限,请稍后再试","unexpectedResponse":"GitHub 返回了无法识别的响应,请稍后重试"},"cli":{"missingArgument":"缺少必要参数"},"profile":{"activeDeleteForbidden":"该配置正在使用中,请先激活另一个配置再删除","alreadyExists":"同名配置已经存在","notFound":"未找到配置","endpointNotFound":"未找到 endpoint {{endpoint}}","apiKeyRequired":"请填写 API key","nameRequired":"请填写配置名称","nameInvalid":"配置名称不能包含斜杠","nameTooLong":"配置名称过长"},"adapter":{"modelRequired":"{{harness}} 需要填写模型名称","apiKeyRequired":"{{harness}} 需要填写 API key","nativeConfigInvalid":"{{path}} 不是合法的 {{format}} 配置","unknownTarget":"适配器产生了未知写入目标 {{key}}"},"activation":{"officialLoginUnsupported":"{{harness}} 不支持官方账号登录模式","officialLoginMissing":"未检测到 {{harness}} 的官方登录条目,请先在终端完成一次官方登录","officialApiKeyMissing":"未检测到 {{harness}} 的 DeepSeek 官方 API Key 配置","noActiveProfile":"该工具未激活任何配置,无可渲染的内容","officialProfileCannotAdopt":"当前处于官方登录状态,没有可回填的配置档案","adoptUnsupported":"该工具不支持采纳现场配置","manualOverridesPreventAdopt":"采纳会丢弃手动覆盖的内容;请先恢复为自动生成","officialProfileAlreadyExists":"DeepSeek 官方配置已存在,请直接编辑它"},"provider":{"inUse_one":"该凭据正被 {{count}} 个配置引用,请先解除引用","inUse_other":"该凭据正被 {{count}} 个配置引用,请先解除引用","credentialUnreadable":"无法读取凭据 {{id}} 的密钥","notFound":"未找到 provider","nameRequired":"请填写 provider 名称","apiKeyRequired":"请填写 API key","endpointsInvalid":"endpoints 必须是数组","endpointKeyRequired":"请填写 endpoint 标识","endpointKeyInvalid":"endpoint 标识包含无效字符","endpointKeyDuplicate":"endpoint {{key}} 重复","endpointUrlRequired":"请填写 endpoint {{key}} 的 Base URL"},"codex":{"loginCacheTooLarge":"Codex 登录缓存文件过大,已跳过","loginCacheInvalidJson":"Codex 登录缓存不是合法 JSON","configDirectoryNotRegular":"Codex 配置目录不是普通目录","loginCacheNotRegular":"Codex 登录缓存不是普通文件"},"transfer":{"envelopeInvalid":"不支持的导出文件格式","passphraseTooShort":"迁移密码至少需要 8 个字符","decryptFailed":"迁移密码错误或导出文件已损坏","tooManyProfiles":"导出文件包含过多配置","profilesInvalid":"导出文件中的配置数据无效","profileNameInvalid":"导出文件包含无效的配置名称","duplicateProfile":"导出文件包含重复的配置","providersInvalid":"导出文件中的凭据库数据无效","duplicateProvider":"导出文件包含重复的凭据库条目","providerMissing":"导出文件中的配置引用了不存在的凭据库条目","activeInvalid":"导出文件中的激活状态无效","duplicateActive":"导出文件包含重复的激活状态","activeProfileMissing":"导出文件中的激活状态引用了不存在的配置","officialActiveInvalid":"导出文件中的官方登录状态无效","codexCacheInvalid":"导出文件中的 Codex 登录缓存无效"},"sync":{"sourceCodexLoginCacheMissing":"源用户没有可用的 Codex 官方登录缓存","sourceEqualsTarget":"源用户与目标用户相同","invalidConflictPolicy":"冲突处理策略无效"},"harness":{"notFound":"未找到工具"},"file":{"notRegular":"{{file}} 不是普通文件","outsideManagedDirectory":"{{file}} 位于可管理目录之外","ownershipRequiresRoot":"修改 {{path}} 的所有权需要以 root 运行"},"scan":{"apiKeyRequired":"这条配置里没有可提取的凭据,请先填写 API key"},"backup":{"targetInvalid":"{{path}} 不是 {{harness}} 的有效备份目标","invalidId":"备份 ID 无效","notFound":"未找到备份","fileNotOwned":"备份引用了 {{harness}} 不拥有的文件","payloadMissing":"备份中缺少 {{file}} 的内容","payloadNameInvalid":"备份内容文件名无效"},"operation":{"alreadyUndone":"该操作已经撤销过了","incomplete":"该操作尚未完成,请等待或重启服务以自动恢复","backupMissing":"操作 {{id}} 的备份 {{backupId}} 已被轮换删除","storageUnknown":"操作引用了未知的存储文件 {{key}}","snapshotMissing":"操作 {{id}} 缺少 {{key}} 的快照","invalidId":"操作 ID 无效","notFound":"未找到操作"},"user":{"notManageable":"用户 {{username}} 不可管理","notSwitchable":"无法切换到用户 {{username}}","block":{"homeUnsearchable":"没有权限访问","homeUnwritable":"没有权限写入","storeInaccessible":"配置目录不可写","ownershipRequiresRoot":"需要以 root 运行","homeMissing":"主目录不存在"}},"storage":{"unreadable":"无法读取 {{file}}","quarantineFailed":"无法隔离损坏的 {{file}}","corruptQuarantined":"数据存储已损坏,原文件已隔离为 {{quarantine}},请从备份恢复后再继续","invalid":"数据存储 {{file}} 的内容不符合预期结构({{issue}}),已拒绝读取以免覆盖;请检查该文件或从备份恢复"},"probe":{"badUrl":"Base URL 无法解析,或不是 http/https","missingBaseUrl":"未提供 Base URL,无法测试","missingApiKey":"未提供 API Key,无法测试","timeout":"请求超时(10 秒)","networkError":"无法连接到端点(DNS、拒绝连接或 TLS 失败)","unauthorized":"端点可达但拒绝了凭据(HTTP {{status}}),请检查 API Key","httpError":"端点返回 HTTP {{status}}","invalidResponse":"响应不是已知的模型目录格式","missingModel":"没有可用于补全测试的模型:请填写模型名称,或先获取模型目录","completionUnsupported":"端点不接受任何已知的补全协议","completionHttpError":"模型 {{model}} 的补全请求返回 HTTP {{status}}:目录里有这个模型,但它无法作答","completionInvalid":"补全响应不是已知的格式,无法确认模型真的作答"},"favoriteNotFound":"收藏不存在","favoriteRevisionRequired":"请提供当前收藏版本","favoriteRevisionConflict":"收藏版本已变化,请重新加载","favoriteInUse":"收藏仍被引用,请先解除关联","favoriteConnectionInUse":"渠道仍被引用,请先解除关联","favoriteEndpointMissing":"渠道引用的供应商端点不存在","favoriteProtocolUnsupported":"此工具不支持所选渠道协议","favoriteProjectionUnsupported":"无法无损表达模型设置","favoriteProfileDiverged":"配置已发生分歧,请明确选择覆盖或解除关联","favoriteRawOverrideConflict":"请先移除原始文件覆盖","favoriteActiveUpdateRequiresApply":"激活配置的变更必须同时应用","favoritePlanStale":"计划已过期或输入已变化,请重新预览","favoritePlanExpired":"计划已过期,请重新预览","favoriteIdempotencyConflict":"请求标识已用于其他批准内容","favoriteUndoConflict":"后续修改阻止撤销,请重新规划","favoritePreferenceNotRepresented":"此工具无法设置默认思考偏好,需要确认忽略","favoriteEffortUnverified":"渠道的可选思考档位未经验证","favoriteEffortMapped":"思考档位 {{from}} 超出此工具的可表达范围,已就近映射为 {{to}}","favoriteEffortUnset":"思考档位 {{from}} 在此工具的配置层没有对应值,将不设置","favoriteStoreInvalid":"收藏文件损坏或版本不受支持","favoriteLimitReached":"收藏数量已达上限","favoriteCredentialConsentRequired":"需要明确同意将内联密钥存入凭据库","favoriteBackupInvalid":"备份无效、已损坏或配置目录已改变,未恢复。","favoriteBackupRecoveryFailed":"恢复回滚未完成,已暂停配置操作以保护数据。请检查文件权限后重试。","favoriteBackupStale":"配置在预览后发生变化,请重新检查恢复影响。","toolModelsInvalid":"模型集合文件无法读取,请恢复文件后再编辑。","toolModelsDefaultRequired":"移除或更换当前默认模型前,请先指定新的默认模型。","toolModelsConflict":"模型与已有条目冲突。集合中的模型请从工具的可用模型列表管理。","toolModelsFactsInvalid":"模型的推理设置互相冲突,请检查推理支持、可选档位和所选强度,或恢复跟随模板。","favoriteReasoningLevelsMissing":"已声明支持推理,但尚未填写支持的档位。本次不写入推理档位,不影响其他配置应用;可在模板的模型参数中补充。"},"warning":{"activation":{"envRebuildFailed":"原生配置已写入,但重建 env.sh 失败","officialEnvRebuildFailed":"已恢复官方登录,但重建 env.sh 失败","backfillFailed":"未能把 {{profile}} 的现有配置回填保存"},"provider":{"endpointFallback":"endpoint {{endpoint}} 已不存在,将回退到 provider 首个 endpoint","reapplyFailed":"重新应用失败:{{reason}}"},"sync":{"activeReapplyFailed":"已更新配置库,但自动重新激活失败:{{reason}}"},"transfer":{"activeRestoreFailed":"未能恢复激活状态:{{reason}}"},"scan":{"profileGone":"配置已不在磁盘上,已跳过","profileExists":"同名配置已存在,已跳过","importFailed":"导入失败:{{reason}}"},"favorite":{"probeFailed":"{{count}} 个渠道连通性探测失败;模板已保存。"}},"update":{"updating":"更新中…","failed":"更新失败","failedHint":"手动运行 bunx @seaveyon/harness-switch@latest","short":"更新","toVersion":"更新到 v{{version}}"},"sync":{"title":"从其他用户同步","intro":"将来源用户的配置和所引用的凭据复制到 {{user}}。激活状态、备份和原生配置文件默认不会复制;可单独选择迁移 Codex 登录缓存。","sourceUser":"来源用户","selectUser":"选择本地用户","profileCount":"配置 {{count}}","providerCount":"凭据 {{count}}","conflictCount":"同名冲突 {{count}}","overwriteByHarness":"按 Harness 覆盖同名配置","overwriteHint":"只覆盖勾选的 Harness;未勾选的同名配置会保留当前用户版本。","overwriteHarness":"覆盖 {{harness}}","conflictsInHarness_one":"{{count}} 个同名配置","conflictsInHarness_other":"{{count}} 个同名配置","migrateCache":"迁移 Codex 官方登录缓存(auth.json)","migrateCacheHint":"这会复制可复用的 Codex 登录会话,不是普通配置。仅在目标用户可以使用该登录时选择。","migrateCacheOverwrite":"目标用户已有登录缓存;继续后将覆盖它,并自动创建备份。","storeOnlyHint":"同步仅写入配置库。需要生效时,请在同步后手动激活对应配置。","noOtherUsers":"没有其他可管理的本地登录用户。","inspecting":"正在检查…","inspect":"检查可同步内容","syncing":"正在同步…","syncTo":"同步到 {{user}}","confirmCacheTitle":"确认迁移 Codex 登录缓存?","confirmCacheBody":"将把 {{source}} 的 Codex 官方登录缓存(auth.json)复制到 {{target}}。{{extra}}仅当目标用户可以使用这个登录会话时才继续。","confirmCacheOverwrite":"目标用户已有缓存,会被覆盖并创建备份。","confirmCacheFresh":"目标用户将获得新的本地登录缓存。","confirmCacheAction":"迁移登录缓存并同步","done":"同步完成:新增 {{imported}},覆盖 {{overwritten}},跳过 {{skipped}},复制凭据 {{providersCopied}}。","cacheMigrated":"Codex 登录缓存已迁移。","cacheNotMigrated":"Codex 登录缓存未迁移。"},"transfer":{"title":"配置迁移","intro":"把配置档案和凭据搬进这台机器,或打包带走。所有来源写入的都是本管理器自己的配置库。","exportTitle":"导出所有配置","exportIntro":"文件使用迁移密码进行 AES-256-GCM 加密,不依赖当前机器的本地密钥。","passphrase":"迁移密码","passphrasePlaceholder":"至少 {{min}} 个字符","passphraseConfirm":"确认迁移密码","passphraseConfirmPlaceholder":"再次输入","passphraseMismatch":"两次输入的迁移密码不一致。","encrypting":"正在加密…","download":"下载加密导出包","exported":"加密导出包已生成。迁移密码不会写入文件,请单独保管。","importTitle":"导入到当前机器","importIntro":"先解密并检查冲突,确认后才会写入。默认保留当前机器上的同名配置。","pickFile":"选择 .hsw-backup 文件","pickFileHint":"文件内容在本机服务端解密,不会发送到外部服务。","notAnExport":"不是有效的 harness-switch 导出文件","importPassphrasePlaceholder":"导出时设置的密码","inspecting":"正在检查…","inspect":"检查导入内容","profileCount_one":"{{count}} 个配置","profileCount_other":"{{count}} 个配置","providerCount_one":"{{count}} 条凭据","providerCount_other":"{{count}} 条凭据","conflictCount_one":"{{count}} 个同名冲突","conflictCount_other":"{{count}} 个同名冲突","activeCount_one":"{{count}} 个激活状态","activeCount_other":"{{count}} 个激活状态","harnessProfiles":"{{harness}}:{{count}}","conflictList":"同名项:{{items}}","previewStale":"已修改导入选项,请重新检查内容后再确认导入。","conflictPolicy":"同名配置处理","policySkip":"保留本机配置,跳过导入","policyOverwrite":"使用导出包覆盖本机配置","restoreActive":"恢复导出时的激活状态","recheckNeeded":"请重新检查导入内容","confirmImport":"确认导入","confirmAuthTitle":"确认可能改动 Codex auth.json?","confirmTitle":"确认导入全部配置?","confirmBody":"将导入 {{count}} 个配置。","confirmOverwrite_one":"其中 {{count}} 个同名配置会被覆盖。","confirmOverwrite_other":"其中 {{count}} 个同名配置会被覆盖。","confirmKeep":"同名配置会保留,不会被覆盖。","proceedAware":"了解并继续导入","proceedOverwrite":"覆盖并导入","proceedSafe":"安全导入","importedCount_one":"新增 {{count}} 项","importedCount_other":"新增 {{count}} 项","overwrittenCount_one":"覆盖 {{count}} 项","overwrittenCount_other":"覆盖 {{count}} 项","providersCopiedCount_one":"恢复 {{count}} 条凭据","providersCopiedCount_other":"恢复 {{count}} 条凭据","skippedCount_one":"跳过 {{count}} 项","skippedCount_other":"跳过 {{count}} 项","activeRestoredCount_one":"恢复 {{count}} 个激活状态","activeRestoredCount_other":"恢复 {{count}} 个激活状态","cacheMigrated":"已迁移导出包内的 Codex 登录缓存","cacheNotMigrated":"未迁移导出包内的 Codex 登录缓存","importedSummary":"导入完成:{{parts}}。","authEffect":{"openai-api-key":"恢复选定的 Codex 激活配置会更新本机 auth.json 中的 OPENAI_API_KEY;这不是迁移导出包内的完整官方登录会话。","auth-override":"恢复选定的 Codex 激活配置会按该配置的原始 auth 覆盖内容写入本机 auth.json。","official-cleanup":"恢复 Codex 官方登录状态可能清理本机 auth.json 中遗留的 OPENAI_API_KEY。"},"sourceLabel":"选择来源","sources":{"scan":"本机现有配置","user":"其他本地用户","file":"加密文件","gist":"GitHub Gist"},"currentPolicy":"当前策略:{{policy}}","importing":"正在导入…"},"githubSync":{"title":"GitHub 云端同步","loading":"正在读取 GitHub 连接状态…","intro":"通过 GitHub 账号实现多机器无缝同步。配置包使用主密码进行端到端 AES-256-GCM 加密后存入私有 Gist,保护凭据安全。","tabDevice":"GitHub 授权登录","tabToken":"Token 登录","deviceIntro":"在 GitHub 输入下方授权码即可完成绑定。","openAuthPage":"前往 GitHub 授权","getCode":"获取设备授权码","userCode":"用户授权码","copyCode":"复制授权码","copied":"已复制","waitingAuth":"等待 GitHub 授权中…","waitingAuthInterval":"等待 GitHub 授权中({{seconds}} 秒后轮询)…","checkingAuth":"正在检查授权…","checkNow":"立即检查","regenerateCode":"重新获取授权码","tokenPlaceholder":"输入具有 gist 权限的 GitHub Token (ghp_...)","connectToken":"连接并登录","connecting":"连接中…","disconnect":"断开连接","lastSynced":"上次同步:","neverSynced":"尚未同步","cloudGist":"云端 Gist:","pushTitle":"上传到云端","pushIntro":"将当前机器的全部 Profiles 和凭据库加密备份到 GitHub 私有 Gist。","passphrase":"同步主密码","passphrasePlaceholder":"用于端到端加密与解密的密码","pushing":"正在加密并上传…","pushSuccess":"成功上传并同步到云端 Gist({{profiles}} 个配置,{{vault}} 条凭据)。","pullTitle":"从云端拉取","pullIntro":"从 GitHub 私有 Gist 下载加密备份并在本地解密还原。","pullPassphrasePlaceholder":"上传时设置的同步主密码","inspect":"检查云端备份","pulling":"正在拉取…","confirmPull":"确认同步到本地","pullSuccess":"云端同步完成:{{summary}}","authorized":"GitHub 授权成功,欢迎 {{user}}。","connected":"GitHub 连接成功,欢迎 {{user}}。","disconnected":"已断开与 GitHub 的连接。","codeExpired":"授权码已过期,请重新获取。","authFailed":"授权失败,请重试。","connectedBadge":"已连接","refreshStatus":"刷新状态","previewTitle":"云端备份检查结果","backedUpAt":"备份时间:{{time}}","tokenLabel":"Personal Access Token","tokenScopeHint":"Token 需具备 gist 权限,才能读写加密配置文件。"},"import":{"title":"导入已有配置","intro":"读取这五个工具当前在磁盘上的配置,挑出可以接管的 provider。扫描和导入都不会改动它们的配置文件;导入后需要你手动激活才会真正写盘。","scanning":"正在读取现有配置…","failed":"导入失败","summary":"导入 {{imported}} 条,跳过 {{skipped}} 条,新建凭据 {{providersCreated}} 条","providerCount_one":"{{count}} 个 provider","providerCount_other":"{{count}} 个 provider","sourceMissing":"缺失","sourceRead":"已读取","sourceUnparsable":"无法解析","select":"选择 {{name}}","inUse":"使用中","nameTaken":"同名配置已存在","matchesProvider":"凭据已在库中:{{name}}","noBaseUrl":"(没有 base url)","keyOutsideConfig":"凭据不在配置文件里","profileName":"配置名称","credentialTarget":"凭据保存方式","targetProfile":"存进这条配置自己","targetNewVault":"抽成新的凭据库条目","targetExisting":"关联已有凭据:{{name}}","apiKeyFromEnv":"这个 provider 从环境变量读取凭据,配置文件里没有","overwriteExisting":"覆盖同名的现有配置","selected":"已选择 {{count}} 条","selectPrompt":"勾选要接管的 provider","rescan":"重新扫描","importSelected":"导入所选"},"scan":{"note":{"unsupported":"该工具暂不支持扫描导入","noConfigFiles":"磁盘上没有找到该工具的配置文件","unparsable":"配置文件存在但无法解析,导入前请先修复它","noCandidates":"配置文件里没有找到可导入的 provider"}},"common":{"cancel":"取消","delete":"删除","close":"关闭","closeDialog":"关闭对话框","apiKey":"API 密钥","listSeparator":"、"},"preset":{"zaiAnthropic":"Z.AI(Anthropic 兼容)","moonshotAnthropic":"Moonshot(Anthropic 兼容)","deepseekAnthropic":"DeepSeek(Anthropic 兼容)","openrouter":"OpenRouter","zai":"Z.AI","moonshot":"Moonshot","deepseek":"DeepSeek","cliproxyResponses":"CLIProxy(Responses)"},"probe":{"action":"测试连接","fetchModels":"拉取模型","fetchingModels":"正在拉取…","completionAction":"测试补全","testingCompletion":"正在测试补全…","completionHint":"真实发送一条最小请求,验证模型确实能作答(会消耗一两个 token)。","probing":"正在测试…","ok":"连接正常 \xb7 {{latencyMs}}ms \xb7 {{count}} 个模型","okNoCatalog":"连接正常 \xb7 {{latencyMs}}ms \xb7 端点未提供模型目录","completionOk":"模型 {{model}} 可作答 \xb7 {{latencyMs}}ms","completionCached":"模型 {{model}} 可作答 \xb7 缓存于 {{at}}","completionFailedCached":"缓存于 {{at}}","catalogHint":"已获取 {{count}} 个模型,模型字段现可从下拉列表选择。","missingBaseUrl":"请先填写至少一个 endpoint URL 再测试。"},"favorites":{"linked":"关联模板","sourceMissing":"模板来源不存在","connectionMissing":"来源渠道不存在","importCount":"{{count}} 个模板","retryFailed":"重新预览未完成项","saveFavorite":"保存模板","authentication":"认证方式","liveState":"原生文件状态","preserved":"这些现有字段保留原值;固定模型档位继续使用原模型","exportVersion":"默认使用 payload v2,目标版本必须支持模型收藏夹。","legacyExport":"兼容旧版导出(不迁移收藏和来源关联)","catalog":"获取模型目录(不发送补全请求)","catalogModel":"从目录选择模型 ID","noCatalog":"目录不可用或为空,仍可手工输入模型 ID。","title":"模板库","subtitle":"保存模板,选择渠道,配置到工具。","add":"新建模板","edit":"编辑模板","name":"模板名称","notes":"备注","save":"仅保存配置","delete":"删除模板","connections":"模型连接","connection":"选择渠道","label":"渠道标签","endpoint":"凭据库端点","protocol":"协议","protocolMultiHint":"同一地址可同时勾选多种协议,Claude / Codex 会各自选用需要的那种,无需再建一份连接。","model":"精确请求模型 ID","addConnection":"添加模型连接","removeConnection":"移除此渠道","contextWindow":"上下文窗口","maxOutputTokens":"最大输出 token","reasoningSupported":"支持推理","reasoningEffort":"默认思考偏好","supportedReasoningEfforts":"支持的思考档位","effortsHint":"逗号分隔:none,minimal,low,medium,high,xhigh,max,ultra","unknown":"未设置","true":"是","false":"否","declared":"填写值:由你声明,不代表实测能力。","inherited":"继承模板","overridden":"此渠道覆写;留空表示清除继承","inherit":"恢复继承","invalid":"请检查名称、渠道和能力声明是否完整且一致。","validation":{"required":"请填写此项。","invalidValue":"此项的值无效。","invalidFacts":"思考能力声明与已声明档位或偏好档位冲突。","duplicateConnection":"已有渠道使用相同的供应商、入口、协议和模型。"},"nextStep":{"saved":"模板「{{name}}」已保存。","reviewAffected":"查看受影响配置"},"catalogAutoFailed":"暂时无法获取列表,可手动输入模型 ID。","catalogRetry":"重试","configure":"配置到工具","saveOnlyHint":"仅保存不会修改原生文件。选择同时激活后才会应用到工具。","target":"目标配置","newProfile":"新建配置","profileName":"配置名称(留空自动生成)","mode":"操作方式","activate":"保存并激活","ignorePreference":"确认忽略无法表达的思考偏好","overwriteDiverged":"以模板覆盖已分歧的受控字段","preview":"生成预览","appliedToast":"已将模板应用到 {{count}} 个工具。","confirm":"确认执行计划","rendererDefault":"工具渲染默认值","notRepresented":"无法表达的字段","nativeFiles":"原生写入目标","none":"无","applied":"已完成","unchanged":"无变化","failed":"失败,请重新预览","skipped":"未执行,请重新预览","capture":"从已有配置创建模板","extractCredential":"同意将内联密钥存入凭据库并复用","linkSource":"关联来源配置","search":"搜索名称、模型或渠道","loading":"正在加载收藏…","empty":"还没有收藏。可从已有配置收藏,或手动添加。","pending":"待连接","generated":"已生成配置","needsUpdate":"有更新","diverged":"有本地分歧","detach":"解除关联,保留配置","harnesses":"工具配置","autoName":"留空使用模型名称","modelAdvanced":"公共能力与备注(可选)","protocolOptions":{"openaiChat":"OpenAI 兼容(Chat Completions)","openaiResponses":"OpenAI Responses","anthropicMessages":"Anthropic Messages"},"connectionsEmpty":"还没有渠道。添加一个供应商渠道,或先保存为待连接模板。","addProvider":"添加供应商","advancedSummary":"默认:{{value}} \xb7 可修改","suggestedValue":"建议 {{value}}","createChoice":{"title":"新建模板","preset":"快速创建(推荐)","presetHint":"选择服务商,填写 API Key,再选择模型。","captureHint":"复用已经给工具保存好的配置,无需重新填写。","blank":"手动配置(高级)","blankHint":"自行填写服务地址和模型,适合自定义服务。","description":"选择起步方式。保存模板后,工具当前使用的配置不会自动切换。"},"presets":{"title":"选择供应商","back":"返回","providerHint":"填写服务商账号的 API Key。它会保存在凭据库中,后续模板可直接复用。","createProvider":"连接供应商","baseUrl":"服务地址","deepseek":"DeepSeek","zhipu":"智谱 GLM","kimi":"Kimi(月之暗面)","minimax":"MiniMax","qwen":"通义千问(百炼)","siliconflow":"SiliconFlow(硅基流动)","openrouter":"OpenRouter","openai":"OpenAI","anthropic":"Anthropic","chooseAccount":"选择已有账号","accountHint":"发现多个可用账号或入口,请选择这个模板要使用的账号。","newAccount":"添加另一个账号","chooseEndpoint":"选择工具连接方式","endpointHint":"Claude Code 使用 Anthropic 兼容入口,Codex 需要 Responses 入口;各工具的兼容情况会在保存前检查。","getKey":"前往官方页面获取 API Key"},"clone":{"action":"复制模板","name":"{{name}} 副本"},"targetAdvanced":"更改目标配置或名称","changeDetails":"查看参数差异","fileDetails":"查看原生文件差异","activateSelected":"保存后立即激活到所选工具","noCompatibleChannel":"暂无兼容渠道","otherChannelAvailable":"换渠道可配置","updateProfile":"更新已有配置","backups":"备份与恢复","backupHint":"备份当前用户的收藏、配置、凭据和工具原生文件。收藏变更前自动保留最近 20 次备份,另可保留一个手动恢复点。备份加密保存在本机。","backupNow":"备份当前状态","backupCreated":"已创建恢复点","backupRestored":"已恢复;恢复前的状态也已备份,可随时撤回","backupEmpty":"还没有恢复点,首次变更前会自动创建。","restoreScope":"将当前用户的全部收藏、配置档案、凭据库、激活记录和五种工具的原生配置恢复到此时刻,覆盖此后修改。恢复前会再次备份当前状态;管理后台的登录会话和密码不变。","restore":"查看恢复影响","restoreConfirm":"确认恢复","cancel":"取消","backupReason":{"manual":"手动恢复点","change":"收藏变更前","apply":"应用到工具前","restore":"恢复前的状态"},"workflow":"配置步骤","chooseTools":"选择工具","reviewChanges":"预览并确认","chooseHint":"选择要配置的工具,已有配置会自动沿用。","reviewHint":"核对本次变更,确认后才会写入。","targetTools":"目标工具","activateCount":"立即激活","changedFiles":"原生文件变更","autoBackupNotice":"应用前自动备份,可从全局「恢复时间线」回退。","resolveBeforeApply":"请返回上一步处理冲突,再重新生成预览。","activeSaveRequiresActivate":"这些是工具当前正在使用的配置。「保存备用」不会改动正在使用的配置。请改选「保存并立即切换」,或先切换到其他配置后再保存备用。","switchToActivateAndPreview":"改为立即切换并重新预览","selectedCount":"已选择 {{count}} 个工具","compatibleCount":"{{count}} 个可用渠道","selected":"已选","backToSelection":"返回选择","done":"完成","confirmSave":"确认保存配置","confirmActivate":"确认保存并激活","parameter":"参数","before":"变更前","after":"变更后","noParameterChanges":"参数保持不变","mappingDetails":"映射依据与保留设置","redactedDiffHint":"仅隐藏 API key、token 等凭据,保留模型与普通配置;以下以统一结构展示文件差异。","modeLabel":{"save":"保存备用","activate":"保存并立即切换"},"toolNames":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi Code","pi":"Pi","dsh":"DeepSeek Harness"},"liveComparison":"工具当前配置 → 应用后","liveComparisonHint":"以下比较磁盘上的当前原生文件与本次将写入的内容;仅隐藏密钥、token 等凭据。","previewBlocked":"尚未生成原生文件预览,请先处理阻止应用的问题。","savedComparison":"查看保存档案的变更","savedComparisonHint":"这里比较已保存的目标档案与本次保存结果,不代表工具当前使用的配置。","savedUnchanged":"保存档案无变化 \xb7 查看详情","savedUnchangedHint":"目标档案已经包含这些参数;切换到该档案时,工具的原生文件仍可能变化。","savedBefore":"已保存的档案","savedAfter":"本次保存后","batchSummary":"本次处理 {{count}} 个工具 \xb7 切换 {{activate}} 个 \xb7 改动 {{files}} 个原生文件","confirmBatchSave":"保存 {{count}} 份备用配置","confirmBatchActivate":"确认保存并切换 {{count}} 个工具","tabBlocked":"需处理","tabChanges":"{{count}} 个文件变化","restoreReview":"确认全局恢复","restoreReviewHint":"先核对当前状态将受到的影响,再决定是否恢复。","restoreChecking":"正在处理,请稍候…","restoreRecheck":"重新检查影响","restoreImpact":"将更改 {{count}} 项","restoreNoChanges":"当前内容与此恢复点相同,无需恢复。","restoreUnchanged":"{{count}} 项内容相同","restoreArea":{"favorites":"全部模型收藏","profiles":"全部工具的配置档案","vault":"供应商与凭据库","active":"当前激活记录","env":"环境变量文件"},"restoreAction":{"create":"还原缺失文件","replace":"还原为备份内容","delete":"删除备份时不存在的文件"},"backupAction":{"create":"添加收藏「{{name}}」前","update":"修改收藏「{{name}}」前","delete":"删除收藏「{{name}}」前","capture":"从 {{tools}} 收藏「{{name}}」前","detach":"解除 {{tools}} 配置「{{name}}」的关联前","apply":"将「{{name}}」配置到 {{tools}} 前","restore":"全局恢复到 {{name}} 前"},"channelNumber":"渠道 {{count}}","channelHint":"选择账号和模型","channelProvider":"服务商账号","chooseProvider":"选择供应商入口","removeChannelNamed":"移除渠道:{{name}}","modelPicker":"模型","modelPickerHint":"可选择模型,也可直接输入模型 ID。","modelPlaceholder":"选择或输入模型 ID","modelSearch":"搜索或输入模型 ID","modelEmpty":"输入模型 ID 即可添加,也可以先加载供应商目录。","modelCustom":"使用「{{value}}」","catalogLoad":"加载目录","catalogRefresh":"刷新模型列表","catalogLoading":"正在获取模型列表…","catalogCount":"目录中有 {{count}} 个模型,可在上方搜索选择。","noCatalogManual":"暂无可用目录,仍可手动输入模型 ID。","modeHint":{"save":"为所选工具保存一份配置,当前使用的配置保持不变。","activate":"保存配置,并让所选工具立即切换到这份配置。"},"resultTitleComplete":"配置已完成","resultTitlePartial":"还有配置需要处理","resultHint":"请查看每个工具的结果。重试时不会重复处理成功的配置。","resultStatus":{"saved":"已保存备用","activated":"已切换","savedUnchanged":"已保存 \xb7 无需更改","activatedUnchanged":"已在使用 \xb7 无需更改","failed":"未完成","skipped":"未执行"},"resultSavedHint":"已保存到工具的配置列表,当前使用的配置保持不变。","resultActivatedHint":"已更新工具当前使用的配置。","resultFailedHint":"这份配置未完成,请根据原因处理后重试。","resultSkippedHint":"尚未处理这个工具,重新预览后可继续。","resultNoticeSaved":"已保存 {{count}} 份备用配置。","resultNoticeActivated":"已切换 {{count}} 个工具。","resultNoticeUnchanged":"{{count}} 份配置已一致,无需更改。","resultNoticeFailed":"{{count}} 份配置未完成。","resultNoticeSkipped":"{{count}} 个工具尚未执行。","results":"查看结果","backToResults":"返回结果","refreshPreview":"重新生成预览","checkResult":"重新检查结果并重试","unconfirmedResult":"操作结果尚未确认。请用同一请求重新检查,避免重复处理已完成的配置。","editForCompatibility":"编辑模板渠道","noCompatibleHint":"这个工具需要兼容的渠道。请编辑模板,选择适合的账号、接口地址和协议。","retryTargets":"重新检查工具兼容性","closeResults":"关闭结果","onboarding":{"createFirst":"创建第一个模板","startHint":"先选择服务商账号和模型,再保存到需要的工具。每次写入前都可以预览,保存模板本身不会切换工具。","captureEmpty":"还没有可复用的配置","captureEmptyHint":"这里只列出尚未关联模板、没有自定义文件覆盖的普通配置。你可以直接新建模板,再保存到工具。","savedCount":"已关联 {{count}} 个配置","activeCount":"{{count}} 个正在使用","updateCount":"{{count}} 个待更新","configureNext":"下一步:保存到工具","connectNext":"下一步:添加模型连接","savedHint":"模板已保存,目前没有关联的工具配置。选择工具并预览后即可保存并切换。","connectedHint":"模板有更新时,已关联配置不会自动改变。预览并确认后再同步。","reviewUpdates":"预览待更新配置({{count}})","ignoreUpdates":"忽略本次更新","ignoreUpdatesHint":"保留当前配置和模板关联;模板下次变化时仍会提醒。"},"relationships":{"chooseConnection":"选择模型连接","hint":"查看每个工具的配置状态,再预览并确认切换。","save":"保存到工具","switch":"保存并切换","savedCount":"已保存 {{count}} 个配置","requestModel":"实际请求模型","noConnection":"先添加服务商和模型连接,才能保存到工具。"},"management":{"view":"查看配置","detachTitle":"解除模板关联?","detachHint":"解除 {{harness}} / {{name}} 与模板的关联。配置内容和当前使用状态都会保留,之后不再接收此模板的更新。","detached":"已解除 {{harness}} / {{name}} 的关联,配置和当前使用状态已保留。","deleteBlocked":"还有 {{count}} 个配置关联此模板。先逐个解除关联,即可删除模板;解除关联会保留配置和当前使用状态。","deleteTitle":"删除这个模板?","deleteHint":"将删除模板「{{name}}」。它已没有关联配置,此操作不会改变工具配置或当前使用状态。","noReferences":"没有关联配置,可以安全删除模板。","missingProfile":"配置暂不可用,请刷新后重试。"},"connectionDetails":"服务地址与接口协议","connectionDetailsHint":"这里显示此连接使用的服务地址,并可调整接口协议。服务地址在凭据库中管理;协议通常无需修改,自定义服务请以供应商文档为准。","connectionCapabilities":"按连接单独设置","connectionCapabilitiesHint":"下面显示各连接最终使用的能力。只有供应商或模型存在差异时才需要修改;单独设置的值优先于模板默认值。","catalogFallbackAvailable":"暂时无法获取列表,可使用预设或手动输入。","capabilityUnknownHint":"单位:token,可清空为未指定","draft":{"discardTitle":"放弃未保存的修改?","discardHint":"当前修改尚未保存,继续编辑可保留本次填写的内容。","keepEditing":"继续编辑","discard":"放弃修改"},"capabilitiesSource":{"preset":"含本次预设声明(未实测)","declared":"已填写能力声明","unspecified":"未单独指定"},"editorSections":"模板设置","connectionTab":"连接配置","capabilitiesTab":"模型能力","advanced":"高级设置","advancedHint":"模型能力、更多连接、默认模型与备注","sharedCapabilities":"模板默认能力","sharedCapabilitiesHint":"所有连接共用这些值,单独设置的连接除外。缺失项会预填 256K 上下文、64K 最大输出、支持推理;已有值保留,点击保存模板后生效。可按实际模型修改或清空。","inheritedValue":"继承模板","overriddenValue":"连接单独设置","unspecifiedValue":"未指定","resetInheritance":"全部恢复为继承模板","notesOptional":"模板备注(可选)","effortLevelsHint":"仅勾选该模型支持的档位;不确定时留空。支持推理并不代表支持全部档位。","effortPreferenceHint":"从已声明的档位中选择;不指定时沿用工具或服务商的默认行为。","effortUnknownHint":"尚未声明支持的档位,先沿用默认行为;确认档位后再指定偏好。","followDefault":"不指定,沿用默认","changeProtocol":"更改协议","scheme":{"modelMulti":"模型(可多选)","defaultModel":"默认模型","chooseDefault":"选择默认模型","defaultHint":"首次选择第一个模型;之后由你决定默认模型。","defaultRemoved":"默认模型已移除,请重新选择。","toolSettings":"工具适配","toolHint":"保存各工具的使用方式。","useConnection":"使用连接","noCompatible":"请先添加此工具支持的连接和模型。","default":"统一使用默认模型","tiers":"按档位分配","chooseModel":"选择模型","sameConnection":"同一连接内分配,可重复选择模型。","allDefault":"全部使用默认模型","availableModels":"可用模型","startModel":"启动默认模型","followTemplate":"跟随模板默认模型","defaultIncompatible":"默认模型不在可用模型中,请明确选择。","followModel":"跟随模型设置","tools":{"claude":"Claude Code","codex":"Codex","kimi":"Kimi","dsh":"DSH","pi":"Pi"},"tier":{"opus":"Opus","sonnet":"Sonnet","haiku":"Haiku"},"collectionApplyHint":"将应用模板中为此工具选中的模型,并保留其他模板管理的模型。","modelSettings":"设置 {{model}} 的参数","editorHint":"管理连接、模型与各工具的使用方式。","toggleConnection":"展开或收起连接:{{name}}","selectedCount":"{{count}} 个模型","invalidBinding":"工具配置中的模型未选全、已移除或不属于所选连接,请重新选择。","invalidBindingTools":"{{tools}} 仍指向已删除的连接。请在右侧工具设置中打开对应标签:重新选择连接,或在原连接上启用所需协议后再保存。","toolListSep":"、","draftSaved":"待应用配置已保存,工具当前配置未改变。","reasoningEffort":"推理强度","chooseConnection":"选择模型连接","protocolRequired":"{{tool}} 需要 {{protocol}} 协议,现有连接使用了其他协议。","enableProtocolOnConnection":"在 {{name}} 上启用 {{protocol}}","protocolConnectionHint":"在同一连接上追加协议,账号与模型保持不变。请确认服务商该地址支持所选协议。","reviewTool":"已选择 {{tool}}。下一步核对配置、处理冲突并确认保存或切换。","searchModels":"搜索连接或模型","filteredSelectionHint":"批量操作只影响当前筛选出的模型。","groupSelectionCount":"已选 {{selected}} / {{count}}","collectionProfile":"多模型配置 \xb7 {{count}} 个模型","manageCollection":"管理模板与模型","missingReasoningCount":"{{count}} 个模型未填写推理档位","selection":{"all":"全选","none":"清空","invert":"反选"}}},"favorite":{"result":"操作完成"},"templates":{"tag":"模板"},"workspace":{"fileDiffTab":"文件差异","navigation":"主导航","breadcrumb":"路径导航","nav":{"workspace":"工作台","favorites":"模板","history":"恢复时间线"},"eyebrow":"配置工作台","title":"你的工具,现在用什么","subtitle":"选择工具,查看当前正在使用的配置。","homeSubtitle":"首页只展示真实生效的配置;切换和管理集中到工具的配置工作区。","manageFavorites":"管理模板","switchTool":"切换 {{name}}","configureTool":"配置与切换","configureSwitch":"配置与切换","switcherEyebrow":"配置与切换","switcherTitle":"{{name}} 配置与切换","switcherHint":"从配置或模板创建候选,先比较链路与文件差异,再确认写入。","configurations":"配置","useConfiguration":"使用此配置","newConfiguration":"新建配置","noProfiles":"还没有可用于切换的本地配置。","noTemplates":"还没有模板。","manageConfigurations":"管理配置条目","mappedModels":"按角色映射","toolDefaultModel":"由工具选择默认模型","currentConfigurationManagement":"当前配置与高级管理","chooseTemplate":"选择模板","pickTemplate":"搜索并选择模板","pickTemplateHint":"选一个模板,即可查看配置关系和切换影响。","newFromTemplate":"从模板创建配置","templateAlreadyLinked":"已有配置","manageTemplates":"管理模板","noMatches":"没有找到匹配的模型。","startTitle":"把常用模型收藏起来,一次配置,多处使用","startHint":"从已有工具配置收藏模型,供应商和模型 ID 会自动带入。之后选一个工具就能预览切换,无需重复填写凭据。","noTools":"暂无工具信息。","lastBackup":"最近恢复点:{{time}}","historyHint":"手动保存恢复点,或查看收藏操作前的自动备份。","openHistory":"查看时间线","relationship":"配置关系","provider":"供应商","tool":"工具","missingProvider":"供应商已缺失","relationshipHint":"连线表示配置来源与写入关系;模型请求由工具直接发出。","currentChain":"当前链路","configuration":"配置","currentChainHint":"这条链路已经在当前工具中生效。","currentForTool":"{{name}} 当前正在使用","currentForToolHint":"首页只展示已经生效的配置,不包含未确认的候选。","activeNow":"生效中","switchMap":"当前与新链路","candidateChain":"新链路","appliesAfterConfirm":"应用后生效","notWritten":"未写入","switchTarget":"本次将切换到 {{name}}","switchTargetHint":"这是 {{name}} 的预览目标,尚未写入;其他工具保持各自当前配置。","checking":"正在检查可用渠道…","chooseChannel":"请选择本次使用的渠道","current":"当前","currentToolModel":"{{name}} 当前","targetToolModel":"{{name}} 将切换为","preview":"预览切换","previewHint":"确认后生效;应用前自动备份,可在恢复时间线回退。","captureHint":"复用已有配置中的模型和供应商,无需重新填写。","favoriteEyebrow":"模型与工具的连接","favoriteHint":"选择模板,查看模型连接和工具状态,再预览需要保存或切换的配置。","favoriteDetail":"渠道与工具之间的关系由实际配置生成。","graphHint":"选择左侧账号(多个模型时在上方选模型),再点击右侧工具。","manageLinks":"管理已生成配置与收藏","inUse":"正在使用","saved":"已保存","available":"可配置","linkMissing":"关联来源缺失","back":"返回工作台","backToTool":"返回 {{name}}","details":"详情","detailsSummary":"写入位置与方式、环境变量文件、历史记录","sharedProviderHint_one":"有 {{count}} 个配置共用同一供应商,可以收成一个模板:一处修改,多处生效。","sharedProviderHint_other":"有 {{count}} 个配置共用同一供应商,可以收成一个模板:一处修改,多处生效。","captureCurrent":"收藏当前配置"},"timeline":{"title":"恢复时间线","eyebrow":"配置的时间回廊","subtitle":"回到配置正常的那一刻。选中恢复点,先查看实际影响。","points":"恢复时间点","current":"当前状态","currentHint":"查看工具当前使用的模型","snapshot":"查看历史快照","snapshotHint":"自动恢复点保存的是所列操作发生前的状态。下面列出从当前状态恢复到这里的文件影响。","older":"更早","newer":"较新","restore":"全局恢复到此时","protection":"恢复前会自动保存当前状态。","currentDescription":"这里展示当前生效的工具配置。可以先手动备份,也可以从时间线选择一个历史恢复点。","selectHint":"选择左侧恢复点,即可查看覆盖、删除和新增的文件。"},"validation":{"nameRequired":"名称不能为空","nameTooLong":"名称过长","nameSlash":"名称不能包含斜杠","passwordRequired":"密码不能为空","endpointKeyRequired":"endpoint key 不能为空","endpointKeyTooLong":"endpoint key 过长","endpointKeySlash":"endpoint key 不能包含斜杠","endpointKeyDuplicate":"endpoint key 不能重复","endpointBaseUrlRequired":"endpoint 需要 baseUrl","apiKeyRequired":"API key 不能为空","sourceUserRequired":"来源用户不能为空","providerIdSlash":"provider id 不能包含斜杠","providerIdReserved":"provider id 不合法","selectionRequired":"请至少选择一条配置","baseUrlRequired":"baseUrl 不能为空","tokenRequired":"Token 不能为空"},"cli":{"error":{"unknownShortOption":"未知选项:{{option}}","invalidOption":"无效选项:--","optionTakesNoValue":"选项 --{{option}} 不接受值","optionNeedsValue":"选项 --{{option}} 需要一个值","unknownOption":"未知选项:--{{option}}","usage":"用法:harness-switch {{usage}}","missingArgument":"缺少参数:{{what}}","loginNoSession":"登录失败:服务端未返回会话","loginFailed":"登录失败:{{reason}}","requestFailed":"请求失败:HTTP {{status}}","serviceUnreachable":"无法连接本地服务 {{url}},请先启动服务(harness-switch daemon 或 server)","passwordFileMissing":"未找到 {{file}}。请先运行一次服务(harness-switch daemon 或 server)生成密码,再使用 CLI。","syncNeedsUsers":"sync 需要 --from <来源用户> 和 --to <目标用户>","importNeedsId":"import 需要至少一个候选 id,可先运行 harness-switch scan 查看","nameSingleImportOnly":"--name 只能用于单条导入","apiKeyConflict":"--api-key 与 --api-key-env 不能同时使用","envVarUnset":"环境变量 {{name}} 未设置或为空","confirmNeedsTty":"非交互式终端需要 --yes 确认此操作","unknownCommand":"未知命令:{{command}}"},"output":{"officialLogin":"官方登录","notSwitchable":"不可切换","syncDone":"已从 {{source}} 同步到 {{target}}","syncCounts":"新增={{imported}} 覆盖={{overwritten}} 跳过={{skipped}} 凭据={{providers}} Codex登录缓存={{cache}}","migrated":"已迁移","notMigrated":"未迁移","created":"已创建 {{harness}}/{{profile}}","deleted":"已删除 {{harness}}/{{profile}}","confirmDelete":"确认删除 {{harness}}/{{profile}}?[y/N] ","confirmActivate":"确认激活 {{harness}}/{{profile}}?[y/N] ","confirmOfficial":"确认让 {{harness}} 恢复官方登录?[y/N] ","cancelled":"已取消","activated":"已激活 {{harness}}/{{profile}}","undone":"已撤销 {{kind}} {{harness}}/{{profile}}","importCounts":"导入={{imported}} 跳过={{skipped}} 新建Vault条目={{providers}}","importNote":"工具本身的配置文件未被修改;需要生效请再执行 activate。","willWrite":"将写入","noChange":"无变更","planNote":"内容包含 API key,请仅在可信终端查看。","sourceMissing":"缺失","sourceRead":"已读取","sourceUnparsable":"无法解析","candidateActive":"使用中","candidateKeyManual":"key=需手动填写","candidateInVault":"已在 Vault:{{provider}}","noBaseUrl":"(无 base url)","scanNote":"用 harness-switch import <id>... 导入;扫描和导入都不会改动工具本身的配置。","undoable":"可撤销","notUndoable":"不可撤销"}},"toolModels":{"title":"可用模型","hint":"组合多个模型模板,单独选择这个工具的默认模型。","manage":"管理模型","loading":"正在加载模型集合…","retry":"重新加载","missing":"模板或连接已不存在","remove":"移除","connection":"使用的连接","settings":"为这个工具单独设置","inheritHint":"默认跟随模型模板和连接;只有修改过的字段才会在这个工具中覆盖。","reset":"恢复跟随模板和连接","previewTitle":"确认模型变更","previewCount":"写入 {{count}} 个模型,移除 {{removed}} 个原有条目。","defaultChanged":"默认模型:{{name}} \xb7 {{model}}","keepDefault":"保持当前默认模型","notRepresented":"此工具无法写入这些设置:{{fields}}","apply":"应用这些变更","empty":"尚未选择模型,请从下方添加模板。","add":"从模板添加(可多选)","noTemplates":"请先创建包含连接的模型模板。","default":"应用后的默认模型","scope":{"kimi":"写入 Kimi Code 配置后,请重启或重新加载工具以读取配置。","dsh":"默认模型用于新的 DSH 会话,现有会话保持自己的模型选择。"},"save":"仅保存草稿","preview":"预览应用","saving":"正在保存草稿…","previewing":"正在生成预览…","applying":"正在写入模型配置…","saved":"草稿已保存,工具配置尚未改变。","applied":"模型配置已生效。","appliedCount":"上次已应用 {{count}} 个模型","draftHint":"当前为保存的草稿,可预览与工具实际配置的差异。","nativeStatus":{"unknown":"尚无已应用模型可供比较。","in-sync":"已应用模型与工具原生配置一致。","drifted":"工具中的模型配置已发生变化,请预览差异后再应用。","invalid":"暂时无法比较工具配置,请检查文件后重新预览。"}}}'),m=["zh-CN","en"],v="zh-CN";function g(e){return m.includes(e)}var y={en:p,"zh-CN":h};function b(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:a,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let o=a.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){let t=i[e];t in n||(n[t]=o[t].bind(n))}}let o=n?.Parent??Object;class i extends o{}function a(e){var t;let o=n?.Parent?new i:this;for(let n of(r(o,e),(t=o._zod).deferred??(t.deferred=[]),o._zod.deferred))n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}Symbol("zod_brand");class x extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class w extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(r=globalThis).__zod_globalConfig??(r.__zod_globalConfig={});let k=globalThis.__zod_globalConfig;function j(e){return e&&Object.assign(k,e),k}let S=/^[cC][0-9a-z]{6,}$/,O=/^[0-9a-z]+$/,C=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,N=/^[0-9a-vA-V]{20}$/,P=/^[A-Za-z0-9]{27}$/,E=/^[a-zA-Z0-9_-]{21}$/,I=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,A=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,M=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,z=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,D=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,L=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,F=/^[A-Za-z0-9_-]*$/,U=/^https?$/,H=/^\+[1-9]\d{6,14}$/,$="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",B=RegExp(`^${$}$`);function K(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let q=/^-?\d+$/,V=/^-?\d+(?:\.\d+)?$/,W=/^(?:true|false)$/i,G=/^[^A-Z]*$/,Z=/^[^a-z]*$/;function Y(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function X(e,t){return"bigint"==typeof t?t.toString():t}function J(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Q(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}let ee=Symbol("evaluating");function et(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ee)return void 0===r&&(r=ee,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function en(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function er(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function eo(e){return JSON.stringify(e)}let ei="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ea(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let el=J(()=>{if(k.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function es(e){if(!1===ea(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==ea(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ec(e){return es(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let eu=new Set(["string","number","symbol"]);function ed(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ef(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ep(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}let eh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function em(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ev(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eg(e){return"string"==typeof e?e:e?.message}function ey(e,t,n){let r=e.message?e.message:eg(e.inst?._zod.def?.error?.(e))??eg(t?.error?.(e))??eg(n.customError?.(e))??eg(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:a,...l}=e;return l.path??(l.path=[]),l.message=r,t?.reportInput&&(l.input=a),l}function eb(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ex(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}let ew=b("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ek={number:"number",bigint:"bigint",object:"date"},ej=b("$ZodCheckLessThan",(e,t)=>{ew.init(e,t);let n=ek[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eS=b("$ZodCheckGreaterThan",(e,t)=>{ew.init(e,t);let n=ek[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eO=b("$ZodCheckMultipleOf",(e,t)=>{ew.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{let r,o,i;if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0==(o=Math.round(r=n.value/t.value),i=Number.EPSILON*Math.max(Math.abs(r),1),Math.abs(r-o)<i?0:r-o))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),eC=b("$ZodCheckNumberFormat",(e,t)=>{ew.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=eh[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=q)}),e._zod.check=a=>{let l=a.value;if(n){if(!Number.isInteger(l))return void a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});if(!Number.isSafeInteger(l))return void(l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),eN=b("$ZodCheckMaxLength",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let o=eb(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eP=b("$ZodCheckMinLength",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let o=eb(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eE=b("$ZodCheckLengthEquals",(e,t)=>{var n;ew.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return null!=t&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,o=r.length;if(o===t.length)return;let i=eb(r),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),eI=b("$ZodCheckStringFormat",(e,t)=>{var n,r;ew.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),eA=b("$ZodCheckRegex",(e,t)=>{eI.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),e_=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=G),eI.init(e,t)}),eM=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Z),eI.init(e,t)}),eT=b("$ZodCheckIncludes",(e,t)=>{ew.init(e,t);let n=ed(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),eR=b("$ZodCheckStartsWith",(e,t)=>{ew.init(e,t);let n=RegExp(`^${ed(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ez=b("$ZodCheckEndsWith",(e,t)=>{ew.init(e,t);let n=RegExp(`.*${ed(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),eD=b("$ZodCheckOverwrite",(e,t)=>{ew.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class eL{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let eF=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,X,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eU=b("$ZodError",eF),eH=b("$ZodError",eF,{Parent:Error}),e$=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new x;if(a.issues.length){let t=new(o?.Err??e)(a.issues.map(e=>ey(e,i,j())));throw ei(t,o?.callee),t}return a.value},eB=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let t=new(o?.Err??e)(a.issues.map(e=>ey(e,i,j())));throw ei(t,o?.callee),t}return a.value},eK=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new x;return i.issues.length?{success:!1,error:new(e??eU)(i.issues.map(e=>ey(e,o,j())))}:{success:!0,data:i.value}},eq=eK(eH),eV=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ey(e,o,j())))}:{success:!0,data:i.value}},eW=eV(eH),eG={major:4,minor:4,patch:3},eZ=b("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=eG;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,o=em(e);for(let i of t){if(i._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}(e)||!i._zod.def.when(e))continue}else if(o)continue;let t=e.issues.length,a=i._zod.check(e);if(a instanceof Promise&&n?.async===!1)throw new x;if(r||a instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await a,e.issues.length!==t&&(o||(o=em(e,t)))});else{if(e.issues.length===t)continue;o||(o=em(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(em(n))return n.aborted=!0,n;let a=t(o,r,i);if(a instanceof Promise){if(!1===i.async)throw new x;return a.then(t=>e._zod.parse(t,i))}return e._zod.parse(a,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){let t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}let a=e._zod.parse(o,i);if(a instanceof Promise){if(!1===i.async)throw new x;return a.then(e=>t(e,r,i))}return t(a,r,i)}}et(e,"~standard",()=>({validate:t=>{try{let n=eq(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return eW(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),eY=b("$ZodString",(e,t)=>{var n;let r;eZ.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=(n=e._zod.bag)?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*",RegExp(`^${r}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),eX=b("$ZodStringFormat",(e,t)=>{eI.init(e,t),eY.init(e,t)}),eJ=b("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=A),eX.init(e,t)}),eQ=b("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=_(e))}else t.pattern??(t.pattern=_());eX.init(e,t)}),e0=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=M),eX.init(e,t)}),e1=b("$ZodURL",(e,t)=>{eX.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===U.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});let o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),e2=b("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),eX.init(e,t)}),e3=b("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=E),eX.init(e,t)}),e4=b("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=S),eX.init(e,t)}),e5=b("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=O),eX.init(e,t)}),e6=b("$ZodULID",(e,t)=>{t.pattern??(t.pattern=C),eX.init(e,t)}),e8=b("$ZodXID",(e,t)=>{t.pattern??(t.pattern=N),eX.init(e,t)}),e9=b("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=P),eX.init(e,t)}),e7=b("$ZodISODateTime",(e,t)=>{let n,r,o;t.pattern??(n=K({precision:t.precision}),r=["Z"],t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),o=`${n}(?:${r.join("|")})`,t.pattern=RegExp(`^${$}T(?:${o})$`)),eX.init(e,t)}),te=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=B),eX.init(e,t)}),tt=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${K(t)}$`)),eX.init(e,t)}),tn=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=I),eX.init(e,t)}),tr=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=T),eX.init(e,t),e._zod.bag.format="ipv4"}),to=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=R),eX.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ti=b("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=z),eX.init(e,t)}),ta=b("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=D),eX.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function tl(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ts=b("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=L),eX.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{tl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),tc=b("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=F),eX.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{!function(e){if(!F.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tl(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),tu=b("$ZodE164",(e,t)=>{t.pattern??(t.pattern=H),eX.init(e,t)}),td=b("$ZodJWT",(e,t)=>{eX.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));if("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),tf=b("$ZodNumber",(e,t)=>{eZ.init(e,t),e._zod.pattern=e._zod.bag.pattern??V,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;let i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),tp=b("$ZodNumberFormat",(e,t)=>{eC.init(e,t),tf.init(e,t)}),th=b("$ZodBoolean",(e,t)=>{eZ.init(e,t),e._zod.pattern=W,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),tm=b("$ZodUnknown",(e,t)=>{eZ.init(e,t),e._zod.parse=e=>e}),tv=b("$ZodNever",(e,t)=>{eZ.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function tg(e,t,n){e.issues.length&&t.issues.push(...ev(n,e.issues)),t.value[n]=e.value}let ty=b("$ZodArray",(e,t)=>{eZ.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);let i=[];for(let e=0;e<o.length;e++){let a=o[e],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(t=>tg(t,n,e))):tg(l,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function tb(e,t,n,r,o,i){let a=n in r;if(e.issues.length){if(o&&i&&!a)return;t.issues.push(...ev(n,e.issues))}if(!a&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?a&&(t.value[n]=void 0):t.value[n]=e.value}function tx(e){var t;let n=Object.keys(e.shape);for(let t of n)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${t}": expected a Zod schema`);let r=Object.keys(t=e.shape).filter(e=>"optional"===t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function tw(e,t,n,r,o,i){let a=[],l=o.keySet,s=o.catchall._zod,c=s.def.type,u="optional"===s.optin,d="optional"===s.optout;for(let o in t){if("__proto__"===o||l.has(o))continue;if("never"===c){a.push(o);continue}let i=s.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>tb(e,n,o,t,u,d))):tb(i,n,o,t,u,d)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length)?Promise.all(e).then(()=>n):n}let tk=b("$ZodObject",(e,t)=>{let n;eZ.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let o=J(()=>tx(t));et(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let i=t.catchall;e._zod.parse=(t,r)=>{n??(n=o.value);let a=t.value;if(!ea(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};let l=[],s=n.shape;for(let e of n.keys){let n=s[e],o="optional"===n._zod.optin,i="optional"===n._zod.optout,c=n._zod.run({value:a[e],issues:[]},r);c instanceof Promise?l.push(c.then(n=>tb(n,t,e,a,o,i))):tb(c,t,e,a,o,i)}return i?tw(l,a,t,r,o.value,e):l.length?Promise.all(l).then(()=>t):t}}),tj=b("$ZodObjectJIT",(e,t)=>{let n,r;tk.init(e,t);let o=e._zod.parse,i=J(()=>tx(t)),a=!k.jitless,l=a&&el.value,s=t.catchall;e._zod.parse=(c,u)=>{r??(r=i.value);let d=c.value;return ea(d)?a&&l&&u?.async===!1&&!0!==u.jitless?(n||(n=(e=>{let t=new eL(["shape","payload","ctx"]),n=i.value,r=e=>{let t=eo(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let o=Object.create(null),a=0;for(let e of n.keys)o[e]=`key_${a++}`;for(let i of(t.write("const newResult = {};"),n.keys)){let n=o[i],a=eo(i),l=e[i],s=l?._zod?.optin==="optional",c=l?._zod?.optout==="optional";t.write(`const ${n} = ${r(i)};`),s&&c?t.write(`
2
+ if (${n}.issues.length) {
3
+ if (${a} in input) {
4
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
5
+ ...iss,
6
+ path: iss.path ? [${a}, ...iss.path] : [${a}]
7
+ })));
8
+ }
9
+ }
10
+
11
+ if (${n}.value === undefined) {
12
+ if (${a} in input) {
13
+ newResult[${a}] = undefined;
14
+ }
15
+ } else {
16
+ newResult[${a}] = ${n}.value;
17
+ }
18
+
19
+ `):s?t.write(`
20
+ if (${n}.issues.length) {
21
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
22
+ ...iss,
23
+ path: iss.path ? [${a}, ...iss.path] : [${a}]
24
+ })));
25
+ }
26
+
27
+ if (${n}.value === undefined) {
28
+ if (${a} in input) {
29
+ newResult[${a}] = undefined;
30
+ }
31
+ } else {
32
+ newResult[${a}] = ${n}.value;
33
+ }
34
+
35
+ `):t.write(`
36
+ const ${n}_present = ${a} in input;
37
+ if (${n}.issues.length) {
38
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
39
+ ...iss,
40
+ path: iss.path ? [${a}, ...iss.path] : [${a}]
41
+ })));
42
+ }
43
+ if (!${n}_present && !${n}.issues.length) {
44
+ payload.issues.push({
45
+ code: "invalid_type",
46
+ expected: "nonoptional",
47
+ input: undefined,
48
+ path: [${a}]
49
+ });
50
+ }
51
+
52
+ if (${n}_present) {
53
+ if (${n}.value === undefined) {
54
+ newResult[${a}] = undefined;
55
+ } else {
56
+ newResult[${a}] = ${n}.value;
57
+ }
58
+ }
59
+
60
+ `)}t.write("payload.value = newResult;"),t.write("return payload;");let l=t.compile();return(t,n)=>l(e,t,n)})(t.shape)),c=n(c,u),s)?tw([],d,c,u,r,e):c:o(c,u):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function tS(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let o=e.filter(e=>!em(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ey(e,r,j())))}),t)}let tO=b("$ZodUnion",(e,t)=>{eZ.init(e,t),et(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),et(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),et(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),et(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Q(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)a.push(t),i=!0;else{if(0===t.issues.length)return t;a.push(t)}}return i?Promise.all(a).then(t=>tS(t,r,e,o)):tS(a,r,e,o)}}),tC=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tO.init(e,t);let n=e._zod.parse;et(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=J(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(o,i)=>{let a=o.value;if(!ea(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;let l=r.value.get(a?.[t.discriminator]);return l?l._zod.run(o,i):t.unionFallback||"backward"===i.direction?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:a,path:[t.discriminator],inst:e}),o)}}),tN=b("$ZodIntersection",(e,t)=>{eZ.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>tP(e,t,n)):tP(e,o,i)}});function tP(e,t,n){let r,o=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))o.has(e)||o.set(e,{}),o.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)o.has(e)||o.set(e,{}),o.get(e).r=!0;else e.issues.push(t);let i=[...o].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&r&&e.issues.push({...r,keys:i}),em(e))return e;let a=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(es(t)&&es(n)){let r=Object.keys(n),o=Object.keys(t).filter(e=>-1!==r.indexOf(e)),i={...t,...n};for(let r of o){let o=e(t[r],n[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};i[r]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<t.length;o++){let i=e(t[o],n[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}let tE=b("$ZodRecord",(e,t)=>{eZ.init(e,t),e._zod.parse=(n,r)=>{let o=n.value;if(!es(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let i=[],a=t.keyType._zod.values;if(a){let l;n.value={};let s=new Set;for(let l of a)if("string"==typeof l||"number"==typeof l||"symbol"==typeof l){s.add("number"==typeof l?l.toString():l);let a=t.keyType._zod.run({value:l,issues:[]},r);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ey(e,r,j())),input:l,path:[l],inst:e});continue}let c=a.value,u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?i.push(u.then(e=>{e.issues.length&&n.issues.push(...ev(l,e.issues)),n.value[c]=e.value})):(u.issues.length&&n.issues.push(...ev(l,u.issues)),n.value[c]=u.value)}for(let e in o)s.has(e)||(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else for(let a of(n.value={},Reflect.ownKeys(o))){if("__proto__"===a||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof a&&V.test(a)&&l.issues.length){let e=t.keyType._zod.run({value:Number(a),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(l=e)}if(l.issues.length){"loose"===t.mode?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(e=>ey(e,r,j())),input:a,path:[a],inst:e});continue}let s=t.valueType._zod.run({value:o[a],issues:[]},r);s instanceof Promise?i.push(s.then(e=>{e.issues.length&&n.issues.push(...ev(a,e.issues)),n.value[l.value]=e.value})):(s.issues.length&&n.issues.push(...ev(a,s.issues)),n.value[l.value]=s.value)}return i.length?Promise.all(i).then(()=>n):n}}),tI=b("$ZodEnum",(e,t)=>{eZ.init(e,t);let n=Y(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>eu.has(typeof e)).map(e=>"string"==typeof e?ed(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{let i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),tA=b("$ZodLiteral",(e,t)=>{if(eZ.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?ed(e):e?ed(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{let i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),t_=b("$ZodTransform",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new w(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new x;return n.value=o,n.fallback=!0,n}});function tM(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let tT=b("$ZodOptional",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",e._zod.optout="optional",et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),et(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Q(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>tM(e,r)):tM(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),tR=b("$ZodExactOptional",(e,t)=>{tT.init(e,t),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tz=b("$ZodNullable",(e,t)=>{eZ.init(e,t),et(e._zod,"optin",()=>t.innerType._zod.optin),et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Q(e.source)}|null)$`):void 0}),et(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),tD=b("$ZodDefault",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tL(e,t)):tL(r,t)}});function tL(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let tF=b("$ZodPrefault",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),tU=b("$ZodNonOptional",(e,t)=>{eZ.init(e,t),et(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>tH(t,e)):tH(o,e)}});function tH(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let t$=b("$ZodCatch",(e,t)=>{eZ.init(e,t),e._zod.optin="optional",et(e._zod,"optout",()=>t.innerType._zod.optout),et(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ey(e,n,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ey(e,n,j()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),tB=b("$ZodPipe",(e,t)=>{eZ.init(e,t),et(e._zod,"values",()=>t.in._zod.values),et(e._zod,"optin",()=>t.in._zod.optin),et(e._zod,"optout",()=>t.out._zod.optout),et(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>tK(e,t.in,n)):tK(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>tK(e,t.out,n)):tK(r,t.out,n)}});function tK(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let tq=b("$ZodReadonly",(e,t)=>{eZ.init(e,t),et(e._zod,"propValues",()=>t.innerType._zod.propValues),et(e._zod,"values",()=>t.innerType._zod.values),et(e._zod,"optin",()=>t.innerType?._zod?.optin),et(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(tV):tV(r)}});function tV(e){return e.value=Object.freeze(e.value),e}let tW=b("$ZodCustom",(e,t)=>{ew.init(e,t),eZ.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>tG(t,n,r,e));tG(o,n,r,e)}});function tG(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ex(e))}}Symbol("ZodOutput"),Symbol("ZodInput");(o=globalThis).__zod_globalRegistry??(o.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let tZ=globalThis.__zod_globalRegistry;function tY(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ep(t)})}function tX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ep(t)})}function tJ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ep(t)})}function tQ(e,t){return new ej({check:"less_than",...ep(t),value:e,inclusive:!1})}function t0(e,t){return new ej({check:"less_than",...ep(t),value:e,inclusive:!0})}function t1(e,t){return new eS({check:"greater_than",...ep(t),value:e,inclusive:!1})}function t2(e,t){return new eS({check:"greater_than",...ep(t),value:e,inclusive:!0})}function t3(e,t){return new eO({check:"multiple_of",...ep(t),value:e})}function t4(e,t){return new eN({check:"max_length",...ep(t),maximum:e})}function t5(e,t){return new eP({check:"min_length",...ep(t),minimum:e})}function t6(e,t){return new eE({check:"length_equals",...ep(t),length:e})}function t8(e){return new eD({check:"overwrite",tx:e})}function t9(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tZ,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function t7(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let l=e._zod.toJSONSchema?.();if(l)a.schema=l;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,i=t.processors[o.type];if(!i)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}let i=e._zod.parent;i&&(a.ref||(a.ref=i),t7(i,t,r),t.seen.get(i).isParent=!0)}let s=t.metadataRegistry.get(e);return s&&Object.assign(a.schema,s),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return e(o.element,r);if("set"===o.type)return e(o.valueType,r);if("lazy"===o.type)return e(o.getter(),r);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return e(o.innerType,r);if("intersection"===o.type)return e(o.left,r)||e(o.right,r);if("record"===o.type||"map"===o.type)return e(o.keyType,r)||e(o.valueType,r);if("pipe"===o.type)return!!t._zod.traits.has("$ZodCodec")||e(o.in,r)||e(o.out,r);if("object"===o.type){for(let t in o.shape)if(e(o.shape[t],r))return!0;return!1}if("union"===o.type){for(let t of o.options)if(e(t,r))return!0;return!1}if("tuple"===o.type){for(let t of o.items)if(e(t,r))return!0;if(o.rest&&e(o.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function ne(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let o=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:o,defId:i}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};let i=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};let o=`#/${r}/`,i=t[1].schema.id??`__schema${e.counter++}`;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);let a=r.schema;for(let e in a)delete a[e];a.$ref=o};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
61
+
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){o(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){o(n);continue}}}function nt(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let o=n.def??n.schema,i={...o},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),l=n.schema;if(l.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(o.allOf=o.allOf??[],o.allOf.push(l)):Object.assign(o,l),Object.assign(o,i),t._zod.parent===a)for(let e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(l.$ref&&n.def)for(let e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}let l=t._zod.parent;if(l&&l!==a){r(l);let t=e.seen.get(l);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(let e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;void 0!==i&&o.id===i&&delete o.id;let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?o.$defs=a:o.definitions=a);try{let n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:nn(t,"input",e.processors),output:nn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let nn=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},a=t9({...o??{},target:i,io:t,processors:n});return t7(e,a),ne(a,e),nt(a,e)},nr={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},no=(e,t,n,r)=>{let o=e._zod.def;t7(o.innerType,t,r),t.seen.get(e).ref=o.innerType},ni=b("ZodISODateTime",(e,t)=>{e7.init(e,t),nE.init(e,t)});function na(e){return new ni({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ep(e)})}let nl=b("ZodISODate",(e,t)=>{te.init(e,t),nE.init(e,t)}),ns=b("ZodISOTime",(e,t)=>{tt.init(e,t),nE.init(e,t)}),nc=b("ZodISODuration",(e,t)=>{tn.init(e,t),nE.init(e,t)}),nu=b("ZodError",(e,t)=>{eU.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,o=[])=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)r({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)r({issues:i.issues},[...o,...i.path]);else{let e=[...o,...i.path];if(0===e.length)n._errors.push(t(i));else{let r=n,o=0;for(;o<e.length;){let n=e[o];o===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(i))):r[n]=r[n]||{_errors:[]},r=r[n],o++}}}};return r(e),n})(e,t)},flatten:{value:t=>(function(e,t=e=>e.message){let n={},r=[];for(let o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}})(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,X,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,X,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),nd=e$(nu),nf=eB(nu),np=eK(nu),nh=eV(nu),nm=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return e$(nu)(e,t,r)},nv=(e,t,n)=>e$(nu)(e,t,n),ng=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eB(nu)(e,t,r)},ny=async(e,t,n)=>eB(nu)(e,t,n),nb=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eK(nu)(e,t,r)},nx=(e,t,n)=>eK(nu)(e,t,n),nw=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return eV(nu)(e,t,r)},nk=async(e,t,n)=>eV(nu)(e,t,n),nj=new WeakMap;function nS(e,t,n){let r=Object.getPrototypeOf(e),o=nj.get(r);if(o||(o=new Set,nj.set(r,o)),!o.has(t))for(let e in o.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let nO=b("ZodType",(e,t)=>(eZ.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nn(e,"input"),output:nn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{let r=t9({...n,processors:t});return t7(e,r),ne(r,e),nt(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>nd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>np(e,t,n),e.parseAsync=async(t,n)=>nf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nh(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>nm(e,t,n),e.decode=(t,n)=>nv(e,t,n),e.encodeAsync=async(t,n)=>ng(e,t,n),e.decodeAsync=async(t,n)=>ny(e,t,n),e.safeEncode=(t,n)=>nb(e,t,n),e.safeDecode=(t,n)=>nx(e,t,n),e.safeEncodeAsync=async(t,n)=>nw(e,t,n),e.safeDecodeAsync=async(t,n)=>nk(e,t,n),nS(e,"ZodType",{check(...e){let t=this.def;return this.clone(er(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ef(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new rj({type:"custom",check:"custom",fn:e,...ep(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,o;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ex(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ex(e)))},e(t.value,t)),(o=new ew({check:"custom",...ep(t)}))._zod.check=n,r=o}(e,t))},overwrite(e){return this.check(t8(e))},optional(){return rf(this)},exactOptional(){var e;return e=this,new rp({type:"optional",innerType:e})},nullable(){return rm(this)},nullish(){return rf(rm(this))},nonoptional(e){var t;return t=this,new ry({type:"nonoptional",innerType:t,...ep(e)})},array(){return n6(this)},or(e){return re([this,e])},and(e){var t;return t=this,new rn({type:"intersection",left:t,right:e})},transform(e){return rw(this,new ru({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new rv({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():ec(n)}})},prefault(e){var t,n;return t=this,n=e,new rg({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():ec(n)}})},catch(e){var t,n;return t=this,new rb({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:()=>n})},pipe(e){return rw(this,e)},readonly(){var e;return e=this,new rk({type:"readonly",innerType:e})},describe(e){let t=this.clone();return tZ.add(t,{description:e}),t},meta(...e){if(0===e.length)return tZ.get(this);let t=this.clone();return tZ.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>tZ.get(e)?.description,configurable:!0}),e)),nC=b("_ZodString",(e,t)=>{eY.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{n.type="string";let{minimum:o,maximum:i,format:a,patterns:l,contentEncoding:s}=e._zod.bag;if("number"==typeof o&&(n.minLength=o),"number"==typeof i&&(n.maxLength=i),a&&(n.format=nr[a]??a,""===n.format&&delete n.format,"time"===a&&delete n.format),s&&(n.contentEncoding=s),l&&l.size>0){let e=[...l];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n,0);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,nS(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new eA({check:"string_format",format:"regex",...ep(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new eT({check:"string_format",format:"includes",...ep(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new eR({check:"string_format",format:"starts_with",...ep(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ez({check:"string_format",format:"ends_with",...ep(t),suffix:e})}(...e))},min(...e){return this.check(t5(...e))},max(...e){return this.check(t4(...e))},length(...e){return this.check(t6(...e))},nonempty(...e){return this.check(t5(1,...e))},lowercase(e){return this.check(new e_({check:"string_format",format:"lowercase",...ep(e)}))},uppercase(e){return this.check(new eM({check:"string_format",format:"uppercase",...ep(e)}))},trim(){return this.check(t8(e=>e.trim()))},normalize(...e){return this.check(function(e){return t8(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(t8(e=>e.toLowerCase()))},toUpperCase(){return this.check(t8(e=>e.toUpperCase()))},slugify(){return this.check(t8(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})}),nN=b("ZodString",(e,t)=>{eY.init(e,t),nC.init(e,t),e.email=t=>e.check(new nI({type:"string",format:"email",check:"string_format",abort:!1,...ep(t)})),e.url=t=>e.check(tJ(nT,t)),e.jwt=t=>e.check(new nZ({type:"string",format:"jwt",check:"string_format",abort:!1,...ep(t)})),e.emoji=t=>e.check(new nR({type:"string",format:"emoji",check:"string_format",abort:!1,...ep(t)})),e.guid=t=>e.check(tY(nA,t)),e.uuid=t=>e.check(tX(n_,t)),e.uuidv4=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ep(t)})),e.uuidv6=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ep(t)})),e.uuidv7=t=>e.check(new n_({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ep(t)})),e.nanoid=t=>e.check(new nz({type:"string",format:"nanoid",check:"string_format",abort:!1,...ep(t)})),e.guid=t=>e.check(tY(nA,t)),e.cuid=t=>e.check(new nD({type:"string",format:"cuid",check:"string_format",abort:!1,...ep(t)})),e.cuid2=t=>e.check(new nL({type:"string",format:"cuid2",check:"string_format",abort:!1,...ep(t)})),e.ulid=t=>e.check(new nF({type:"string",format:"ulid",check:"string_format",abort:!1,...ep(t)})),e.base64=t=>e.check(new nV({type:"string",format:"base64",check:"string_format",abort:!1,...ep(t)})),e.base64url=t=>e.check(new nW({type:"string",format:"base64url",check:"string_format",abort:!1,...ep(t)})),e.xid=t=>e.check(new nU({type:"string",format:"xid",check:"string_format",abort:!1,...ep(t)})),e.ksuid=t=>e.check(new nH({type:"string",format:"ksuid",check:"string_format",abort:!1,...ep(t)})),e.ipv4=t=>e.check(new n$({type:"string",format:"ipv4",check:"string_format",abort:!1,...ep(t)})),e.ipv6=t=>e.check(new nB({type:"string",format:"ipv6",check:"string_format",abort:!1,...ep(t)})),e.cidrv4=t=>e.check(new nK({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ep(t)})),e.cidrv6=t=>e.check(new nq({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ep(t)})),e.e164=t=>e.check(new nG({type:"string",format:"e164",check:"string_format",abort:!1,...ep(t)})),e.datetime=t=>e.check(na(t)),e.date=t=>e.check(new nl({type:"string",format:"date",check:"string_format",...ep(t)})),e.time=t=>e.check(new ns({type:"string",format:"time",check:"string_format",precision:null,...ep(t)})),e.duration=t=>e.check(new nc({type:"string",format:"duration",check:"string_format",...ep(t)}))});function nP(e){return new nN({type:"string",...ep(e)})}let nE=b("ZodStringFormat",(e,t)=>{eX.init(e,t),nC.init(e,t)}),nI=b("ZodEmail",(e,t)=>{e0.init(e,t),nE.init(e,t)}),nA=b("ZodGUID",(e,t)=>{eJ.init(e,t),nE.init(e,t)}),n_=b("ZodUUID",(e,t)=>{eQ.init(e,t),nE.init(e,t)});function nM(e){return tX(n_,e)}let nT=b("ZodURL",(e,t)=>{e1.init(e,t),nE.init(e,t)}),nR=b("ZodEmoji",(e,t)=>{e2.init(e,t),nE.init(e,t)}),nz=b("ZodNanoID",(e,t)=>{e3.init(e,t),nE.init(e,t)}),nD=b("ZodCUID",(e,t)=>{e4.init(e,t),nE.init(e,t)}),nL=b("ZodCUID2",(e,t)=>{e5.init(e,t),nE.init(e,t)}),nF=b("ZodULID",(e,t)=>{e6.init(e,t),nE.init(e,t)}),nU=b("ZodXID",(e,t)=>{e8.init(e,t),nE.init(e,t)}),nH=b("ZodKSUID",(e,t)=>{e9.init(e,t),nE.init(e,t)}),n$=b("ZodIPv4",(e,t)=>{tr.init(e,t),nE.init(e,t)}),nB=b("ZodIPv6",(e,t)=>{to.init(e,t),nE.init(e,t)}),nK=b("ZodCIDRv4",(e,t)=>{ti.init(e,t),nE.init(e,t)}),nq=b("ZodCIDRv6",(e,t)=>{ta.init(e,t),nE.init(e,t)}),nV=b("ZodBase64",(e,t)=>{ts.init(e,t),nE.init(e,t)}),nW=b("ZodBase64URL",(e,t)=>{tc.init(e,t),nE.init(e,t)}),nG=b("ZodE164",(e,t)=>{tu.init(e,t),nE.init(e,t)}),nZ=b("ZodJWT",(e,t)=>{td.init(e,t),nE.init(e,t)}),nY=b("ZodNumber",(e,t)=>{tf.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:o,maximum:i,format:a,multipleOf:l,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;"string"==typeof a&&a.includes("int")?n.type="integer":n.type="number";let u="number"==typeof c&&c>=(o??-1/0),d="number"==typeof s&&s<=(i??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;u?f?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c:"number"==typeof o&&(n.minimum=o),d?f?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s:"number"==typeof i&&(n.maximum=i),"number"==typeof l&&(n.multipleOf=l)})(e,t,n,0),nS(e,"ZodNumber",{gt(e,t){return this.check(t1(e,t))},gte(e,t){return this.check(t2(e,t))},min(e,t){return this.check(t2(e,t))},lt(e,t){return this.check(tQ(e,t))},lte(e,t){return this.check(t0(e,t))},max(e,t){return this.check(t0(e,t))},int(e){return this.check(nQ(e))},safe(e){return this.check(nQ(e))},positive(e){return this.check(t1(0,e))},nonnegative(e){return this.check(t2(0,e))},negative(e){return this.check(tQ(0,e))},nonpositive(e){return this.check(t0(0,e))},multipleOf(e,t){return this.check(t3(e,t))},step(e,t){return this.check(t3(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function nX(e){return new nY({type:"number",checks:[],...ep(e)})}let nJ=b("ZodNumberFormat",(e,t)=>{tp.init(e,t),nY.init(e,t)});function nQ(e){return new nJ({type:"number",check:"number_format",abort:!1,format:"safeint",...ep(e)})}let n0=b("ZodBoolean",(e,t)=>{th.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function n1(e){return new n0({type:"boolean",...ep(e)})}let n2=b("ZodUnknown",(e,t)=>{tm.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function n3(){return new n2({type:"unknown"})}let n4=b("ZodNever",(e,t)=>{tv.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),n5=b("ZodArray",(e,t)=>{ty.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;"number"==typeof i&&(n.minItems=i),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=t7(o.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,nS(e,"ZodArray",{min(e,t){return this.check(t5(e,t))},nonempty(e){return this.check(t5(1,e))},max(e,t){return this.check(t4(e,t))},length(e,t){return this.check(t6(e,t))},unwrap(){return this.element}})});function n6(e,t){return new n5({type:"array",element:e,...ep(t)})}let n8=b("ZodObject",(e,t)=>{tj.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def;n.type="object",n.properties={};let i=o.shape;for(let e in i)n.properties[e]=t7(i[e],t,{...r,path:[...r.path,"properties",e]});let a=new Set([...new Set(Object.keys(i))].filter(e=>{let n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));a.size>0&&(n.required=Array.from(a)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=t7(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),et(e,"shape",()=>t.shape),nS(e,"ZodObject",{keyof(){return rl(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:n3()})},loose(){return this.clone({...this._zod.def,catchall:n3()})},strict(){return this.clone({...this._zod.def,catchall:new n4({type:"never",...ep(void 0)})})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!es(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=er(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return en(this,"shape",n),n}});return ef(e,r)}(this,e)},safeExtend(e){var t=this;if(!es(e))throw Error("Invalid input to safeExtend: expected a plain object");let n=er(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return en(this,"shape",n),n}});return ef(t,n)},merge(e){var t=this;if(t._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=er(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return en(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ef(t,n)},pick(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let o=er(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return en(this,"shape",e),e},checks:[]});return ef(e,o)}(this,e)},omit(e){return function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let o=er(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return en(this,"shape",r),r},checks:[]});return ef(e,o)}(this,e)},partial(...e){return function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let o=er(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return en(this,"shape",o),o},checks:[]});return ef(t,o)}(rd,this,e[0])},required(...e){var t,n;let r;return t=this,n=e[0],r=er(t._zod.def,{get shape(){let e=t._zod.def.shape,r={...e};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new ry({type:"nonoptional",innerType:e[t]}))}else for(let t in e)r[t]=new ry({type:"nonoptional",innerType:e[t]});return en(this,"shape",r),r}}),ef(t,r)}})});function n9(e,t){return new n8({type:"object",shape:e??{},...ep(t)})}let n7=b("ZodUnion",(e,t)=>{tO.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,i,a;return i=!1===(o=e._zod.def).inclusive,a=o.options.map((e,n)=>t7(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]})),void(i?n.oneOf=a:n.anyOf=a)},e.options=t.options});function re(e,t){return new n7({type:"union",options:e,...ep(t)})}let rt=b("ZodDiscriminatedUnion",(e,t)=>{n7.init(e,t),tC.init(e,t)}),rn=b("ZodIntersection",(e,t)=>{tN.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,i,a,l;return i=t7((o=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=t7(o.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=[...(l=e=>"allOf"in e&&1===Object.keys(e).length)(i)?i.allOf:[i],...l(a)?a.allOf:[a]])}}),rr=b("ZodRecord",(e,t)=>{tE.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def;n.type="object";let i=o.keyType,a=i._zod.bag,l=a?.patterns;if("loose"===o.mode&&l&&l.size>0){let e=t7(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},l))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=t7(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=t7(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let s=i._zod.values;if(s){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ro(e,t,n){return new rr(t&&t._zod?{type:"record",keyType:e,valueType:t,...ep(n)}:{type:"record",keyType:nP(),valueType:e,...ep(t)})}function ri(e,t,n){let r=ef(e);return r._zod.values=void 0,new rr({type:"record",keyType:r,valueType:t,...ep(n)})}let ra=b("ZodEnum",(e,t)=>{tI.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;(o=Y(e._zod.def.entries)).every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=o},e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let o={};for(let r of e)if(n.has(r))o[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ra({...t,checks:[],...ep(r),entries:o})},e.exclude=(e,r)=>{let o={...t.entries};for(let t of e)if(n.has(t))delete o[t];else throw Error(`Key ${t} not found in enum`);return new ra({...t,checks:[],...ep(r),entries:o})}});function rl(e,t){return new ra({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ep(t)})}let rs=b("ZodLiteral",(e,t)=>{tA.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o=e._zod.def,i=[];for(let e of o.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(e));else i.push(e);if(0===i.length);else if(1===i.length){let e=i[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else i.every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),i.every(e=>"boolean"==typeof e)&&(n.type="boolean"),i.every(e=>null===e)&&(n.type="null"),n.enum=i})(e,t,n,0),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function rc(e,t){return new rs({type:"literal",values:Array.isArray(e)?e:[e],...ep(t)})}let ru=b("ZodTransform",(e,t)=>{t_.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")})(0,e,0,0),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new w(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(ex(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(ex(r)))};let o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}}),rd=b("ZodOptional",(e,t)=>{tT.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function rf(e){return new rd({type:"optional",innerType:e})}let rp=b("ZodExactOptional",(e,t)=>{tR.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),rh=b("ZodNullable",(e,t)=>{tz.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,i,a;return i=t7((o=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function rm(e){return new rh({type:"nullable",innerType:e})}let rv=b("ZodDefault",(e,t)=>{tD.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t7((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),rg=b("ZodPrefault",(e,t)=>{tF.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t7((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},e.unwrap=()=>e._zod.def.innerType}),ry=b("ZodNonOptional",(e,t)=>{tU.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t7((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType},e.unwrap=()=>e._zod.def.innerType}),rb=b("ZodCatch",(e,t)=>{t$.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let o,i=e._zod.def;t7(i.innerType,t,r),t.seen.get(e).ref=i.innerType;try{o=i.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),rx=b("ZodPipe",(e,t)=>{tB.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o,i,a;return i=(o=e._zod.def).in._zod.traits.has("$ZodTransform"),void(t7(a="input"===t.io?i?o.out:o.in:o.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function rw(e,t){return new rx({type:"pipe",in:e,out:t})}let rk=b("ZodReadonly",(e,t)=>{tq.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let o;t7((o=e._zod.def).innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),rj=b("ZodCustom",(e,t)=>{tW.init(e,t),nO.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")})(0,e,0,0)});function rS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){rO(e,t,n[t])})}return e}function rN(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function rP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||rI(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rE(e){return function(e){if(Array.isArray(e))return rS(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||rI(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rI(e,t){if(e){if("string"==typeof e)return rS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rS(e,t)}}var rA=rl(["openai-chat","openai-responses","anthropic-messages"]),r_=rl(["none","minimal","low","medium","high","xhigh","max","ultra"]),rM=nX().int().positive().max(1e8),rT=n6(r_).max(8).refine(function(e){return new Set(e).size===e.length}),rR=n9({contextWindow:rM.optional(),maxOutputTokens:rM.optional(),reasoningSupported:n1().optional(),supportedReasoningEfforts:rT.optional()}),rz=n9({reasoningEffort:r_.optional()});function rD(e){var t;return(null==(t=e.protocols)?void 0:t.length)?rE(new Set(e.protocols)):e.protocol?[e.protocol]:[]}function rL(e){var t=rE(new Set(e));if(!t.length)throw Error("connection requires at least one protocol");return{protocols:t,protocol:t[0]}}var rF=n9({id:nM(),groupId:nM().optional(),label:nP().trim().min(1).max(120),providerId:nP().min(1).max(120),endpointKey:nP().min(1).max(60),protocol:rA.optional(),protocols:n6(rA).min(1).max(3).optional(),requestModelId:nP().trim().min(1).max(120),factOverrides:n9({contextWindow:rM.nullable().optional(),maxOutputTokens:rM.nullable().optional(),reasoningSupported:n1().nullable().optional(),supportedReasoningEfforts:rT.nullable().optional()}).default({}),preferenceOverrides:n9({reasoningEffort:r_.nullable().optional()}).default({})}),rU=rF.superRefine(function(e,t){rD(e).length||t.addIssue({code:"custom",path:["protocols"],message:"favoriteInvalidFacts"})}).transform(function(e){var t=rL(rD(e));return rC({},e,t)}),rH=n9({connectionId:nM().optional(),modelIds:n6(nM()).max(50).optional(),defaultModelId:nM().optional(),mode:rl(["default","tiers"]).optional(),tiers:n9({opus:nM().optional(),sonnet:nM().optional(),haiku:nM().optional()}).optional(),reasoningEffort:r_.optional()}),r$=n9({name:nP().trim().min(1).max(120),notes:nP().max(4096).default(""),defaults:rR.default({}),preferences:rz.default({}),connections:n6(rU).max(50).default([]),defaultConnectionId:nM().optional(),toolBindings:ri(rl(u),rH).optional()});function rB(e,t){var n=new Map,r=function(e){var r,o=null!=(r=n.get(e))?r:t(e);return n.set(e,o),o};return rN(rC({},e),{defaultConnectionId:e.defaultConnectionId?r(e.defaultConnectionId):void 0,connections:e.connections.map(function(e){return rN(rC({},e),{id:r(e.id),groupId:e.groupId?r(e.groupId):void 0})}),toolBindings:e.toolBindings?Object.fromEntries(Object.entries(e.toolBindings).map(function(e){var t,n=rP(e,2),o=n[0],i=n[1];return[o,rN(rC({},i),{connectionId:i.connectionId?r(i.connectionId):void 0,defaultModelId:i.defaultModelId?r(i.defaultModelId):void 0,modelIds:null==(t=i.modelIds)?void 0:t.map(r),tiers:i.tiers?Object.fromEntries(Object.entries(i.tiers).map(function(e){var t=rP(e,2),n=t[0],o=t[1];return[n,o?r(o):void 0]})):void 0})]})):void 0})}function rK(e,t){var n=rC({},e.defaults),r={},o=!0,i=!1,a=void 0;try{for(var l,s=Object.keys(rR.shape)[Symbol.iterator]();!(o=(l=s.next()).done);o=!0){var c=l.value,u=t.factOverrides[c];null===u?delete n[c]:void 0!==u&&Object.assign(n,rO({},c,u)),r[c]=null===u?"unknown":void 0!==u?"connection":void 0!==n[c]?"favorite":"unknown"}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}var d=t.preferenceOverrides.reasoningEffort,f=null===d?{}:void 0===d?rC({},e.preferences):{reasoningEffort:d};return r.reasoningEffort=null===d?"unknown":void 0!==d?"connection":f.reasoningEffort?"favorite":"unknown",{facts:n,preferences:f,sources:r}}function rq(e,t){var n=new Set,r=new Set,o=function(e,n,r){var o,i,a=n.reasoningEffort;(!1===e.reasoningSupported&&((null!=(o=null==(i=e.supportedReasoningEfforts)?void 0:i.length)?o:0)>0||a&&"none"!==a)||a&&e.supportedReasoningEfforts&&!e.supportedReasoningEfforts.includes(a))&&t.addIssue({code:"custom",path:r,message:"favoriteInvalidFacts"})};o(e.defaults,e.preferences,["defaults"]),e.connections.forEach(function(i,a){var l=JSON.stringify([i.providerId,i.endpointKey,rE(rD(i)).slice().sort(),i.requestModelId]);(n.has(l)||r.has(i.id))&&t.addIssue({code:"custom",path:["connections",a],message:"favoriteDuplicateConnection"}),n.add(l),r.add(i.id);var s=rK(e,i);o(s.facts,s.preferences,["connections",a])}),e.defaultConnectionId&&!r.has(e.defaultConnectionId)&&t.addIssue({code:"custom",path:["defaultConnectionId"],message:"favoriteDefaultRequired"});var i=new Map,a=!0,l=!1,s=void 0;try{for(var c,u,d=e.connections[Symbol.iterator]();!(a=(u=d.next()).done);a=!0)!function(){var e,n=u.value,r=null!=(e=n.groupId)?e:n.id,o=i.get(r);o&&(["providerId","endpointKey","label"].some(function(e){return o[e]!==n[e]})||rE(rD(o)).slice().sort().join("\0")!==rE(rD(n)).slice().sort().join("\0"))&&t.addIssue({code:"custom",path:["connections"],message:"favoriteInvalidGroup"}),i.set(r,n)}()}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}var f=!0,p=!1,h=void 0;try{for(var m,v=Object.entries(null!=(c=e.toolBindings)?c:{})[Symbol.iterator]();!(f=(m=v.next()).done);f=!0)!function(){var n,r,a=rP(m.value,2),l=a[0],s=a[1],c=e.connections.find(function(t){return t.id===e.defaultConnectionId}),u=e.connections.find(function(t){var n;return t.id===(null!=(n=s.defaultModelId)?n:e.defaultConnectionId)});s.reasoningEffort&&u&&o(rK(e,u).facts,{reasoningEffort:s.reasoningEffort},["toolBindings",l]);var d=s.connectionId?i.get(s.connectionId):c,f=[s.defaultModelId].concat(rE(null!=(n=s.modelIds)?n:[]),rE(Object.values(null!=(r=s.tiers)?r:{}))).filter(function(e){return!!e});(s.connectionId&&!d||"claude"===l&&"tiers"===s.mode&&["opus","sonnet","haiku"].some(function(e){var t;return!(null==(t=s.tiers)?void 0:t[e])})||f.some(function(t){var n,r,o=e.connections.find(function(e){return e.id===t});return!o||d&&!["kimi","dsh","pi"].includes(l)&&(null!=(n=o.groupId)?n:o.id)!==(null!=(r=d.groupId)?r:d.id)})||s.modelIds&&new Set(s.modelIds).size!==s.modelIds.length)&&t.addIssue({code:"custom",path:["toolBindings",l],message:"favoriteInvalidBinding"})}()}catch(e){p=!0,h=e}finally{try{f||null==v.return||v.return()}finally{if(p)throw h}}}var rV=r$.superRefine(rq),rW=r$.extend({id:nM(),revision:nX().int().positive(),createdAt:na(),updatedAt:na()}).superRefine(rq);n9({schemaVersion:rc(1),favorites:n6(rW).max(1e3)}).refine(function(e){return new Set(e.favorites.map(function(e){return e.id})).size===e.favorites.length}),n9({name:r$.shape.name.optional(),notes:nP().max(4096).optional(),defaults:rR.optional(),preferences:rz.optional(),connections:n6(rU).max(50).optional(),defaultConnectionId:r$.shape.defaultConnectionId,toolBindings:r$.shape.toolBindings,expectedRevision:nX().int().positive().optional()}),n9({expectedRevision:nX().int().positive().optional()});var rG=rl(["api","providerType","contextWindow","maxContextSize","maxTokens","reasoning","reasoningEfforts","reasoningEffort","effortLevel","opusModel","sonnetModel","haikuModel","modelCatalog"]),rZ=n9({harness:rl(u),model:nP().max(120),providerId:nP().max(120),providerEndpoint:nP().max(60),extras:ri(rG,nP().max(65536).nullable())}),rY=n9({collectionOverrides:n9({factOverrides:rF.shape.factOverrides,preferenceOverrides:rF.shape.preferenceOverrides}).optional(),favoriteId:nM(),connectionId:nM(),appliedRevision:nX().int().positive(),ignoredRevision:nX().int().positive().optional(),projectionVersion:nX().int().positive(),baseline:rZ});n9({harness:rl(u),name:nP().min(1).max(120),sourceFingerprint:nP().length(64),favoriteName:nP().trim().min(1).max(120),extractCredential:n1().optional(),linkSource:n1().optional()}),n9({sourceFingerprint:nP().length(64)}),n9({favoriteId:nM(),expectedRevision:nX().int().positive(),items:n6(n9({harness:rl(u),connectionId:nM(),profile:nP().trim().min(1).max(120).refine(function(e){return!/[\\/]/.test(e)}).optional(),existing:n1().default(!1),mode:rl(["save","activate"]).default("save"),overwriteDiverged:n1().default(!1),allowAuthOverwrite:n1().optional(),ignorePreference:n1().default(!1)})).min(1).max(5).refine(function(e){return new Set(e.map(function(e){return e.harness})).size===e.length})}),n9({requestId:nM()}),n9({action:rl(["create","update","delete","capture","detach","apply","restore"]),name:nP().optional(),tools:n6(rl(u)).optional()}),n9({fingerprint:nP().optional()});var rX=n9({id:nP().min(1),nameKey:nP().min(1),getKeyUrl:tJ(nT,void 0).optional(),protocols:n6(rA).min(1),endpoints:n6(n9({key:nP().min(1),baseUrl:tJ(nT,void 0),protocol:rA})).min(1),defaultFacts:rR.optional(),modelCatalog:n6(n9({requestModelId:nP().min(1),facts:rR.optional()})).optional()}),rJ=n6(rX).parse([{id:"deepseek",getKeyUrl:"https://api-docs.deepseek.com/",nameKey:"favorites.presets.deepseek",protocols:["openai-chat"],endpoints:[{key:"main",baseUrl:"https://api.deepseek.com/v1",protocol:"openai-chat"}],modelCatalog:[{requestModelId:"deepseek-flash",facts:{contextWindow:1e6,maxOutputTokens:384e3,reasoningSupported:!0}},{requestModelId:"deepseek-v4-pro",facts:{contextWindow:1e6,maxOutputTokens:384e3,reasoningSupported:!0}}]},{id:"zhipu",getKeyUrl:"https://docs.bigmodel.cn/cn/guide/start/quick-start",nameKey:"favorites.presets.zhipu",protocols:["openai-chat"],endpoints:[{key:"main",baseUrl:"https://open.bigmodel.cn/api/paas/v4",protocol:"openai-chat"}],modelCatalog:[{requestModelId:"glm-4.6",facts:{contextWindow:2e5,maxOutputTokens:8192,reasoningSupported:!0}},{requestModelId:"glm-4.5-air",facts:{contextWindow:128e3,maxOutputTokens:8192}}]},{id:"kimi",getKeyUrl:"https://platform.kimi.com/docs/get-api-key",nameKey:"favorites.presets.kimi",protocols:["openai-chat","anthropic-messages"],endpoints:[{key:"openai",baseUrl:"https://api.moonshot.cn/v1",protocol:"openai-chat"},{key:"anthropic",baseUrl:"https://api.moonshot.cn/anthropic",protocol:"anthropic-messages"}],modelCatalog:[{requestModelId:"kimi-k2-0905-preview",facts:{contextWindow:262144,maxOutputTokens:8192}},{requestModelId:"kimi-k2-thinking",facts:{contextWindow:262144,maxOutputTokens:8192,reasoningSupported:!0}}]},{id:"minimax",getKeyUrl:"https://platform.minimaxi.com/docs/guides/quickstart-preparation",nameKey:"favorites.presets.minimax",protocols:["openai-chat","anthropic-messages"],endpoints:[{key:"openai",baseUrl:"https://api.minimaxi.com/v1",protocol:"openai-chat"},{key:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",protocol:"anthropic-messages"}],modelCatalog:[{requestModelId:"MiniMax-M2",facts:{contextWindow:204800,maxOutputTokens:8192,reasoningSupported:!0}}]},{id:"qwen",getKeyUrl:"https://help.aliyun.com/zh/model-studio/get-api-key",nameKey:"favorites.presets.qwen",protocols:["openai-chat"],endpoints:[{key:"main",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",protocol:"openai-chat"}],modelCatalog:[{requestModelId:"qwen3-max",facts:{contextWindow:262144,maxOutputTokens:8192}},{requestModelId:"qwen3-coder-plus",facts:{contextWindow:1e6,maxOutputTokens:8192}}]},{id:"siliconflow",getKeyUrl:"https://docs.siliconflow.cn/docs/userguide/quickstart",nameKey:"favorites.presets.siliconflow",protocols:["openai-chat"],endpoints:[{key:"main",baseUrl:"https://api.siliconflow.cn/v1",protocol:"openai-chat"}],modelCatalog:[{requestModelId:"deepseek-ai/DeepSeek-V3.2"},{requestModelId:"Qwen/Qwen3-235B-A22B"}]},{id:"openrouter",getKeyUrl:"https://openrouter.ai/docs/quickstart",nameKey:"favorites.presets.openrouter",protocols:["openai-chat"],endpoints:[{key:"main",baseUrl:"https://openrouter.ai/api/v1",protocol:"openai-chat"}]},{id:"openai",getKeyUrl:"https://developers.openai.com/api/docs/quickstart",nameKey:"favorites.presets.openai",protocols:["openai-responses"],endpoints:[{key:"main",baseUrl:"https://api.openai.com/v1",protocol:"openai-responses"}],modelCatalog:[{requestModelId:"gpt-5",facts:{contextWindow:4e5,maxOutputTokens:128e3,reasoningSupported:!0,supportedReasoningEfforts:["minimal","low","medium","high"]}},{requestModelId:"gpt-5-codex",facts:{contextWindow:4e5,maxOutputTokens:128e3,reasoningSupported:!0}}]},{id:"anthropic",getKeyUrl:"https://platform.claude.com/docs/en/get-started",nameKey:"favorites.presets.anthropic",protocols:["anthropic-messages"],endpoints:[{key:"main",baseUrl:"https://api.anthropic.com",protocol:"anthropic-messages"}],modelCatalog:[{requestModelId:"claude-opus-4-1",facts:{contextWindow:2e5,maxOutputTokens:32e3,reasoningSupported:!0}},{requestModelId:"claude-sonnet-4-5",facts:{contextWindow:2e5,maxOutputTokens:64e3,reasoningSupported:!0}},{requestModelId:"claude-haiku-4-5",facts:{contextWindow:2e5,maxOutputTokens:64e3}}]}]);function rQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var r0={name:120,endpointKey:60,url:2048,notes:4096,apiKey:4096,minPassword:10},r1=nP().trim().min(1,a.nameRequired).max(120,a.nameTooLong).refine(function(e){return!e.includes("/")&&!e.includes("\\")},a.nameSlash),r2=function(e){return nP().max(e)},r3=nP().min(1).max(120),r4=rl(u),r5=ro(r3,r2(65536)).superRefine(function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.entries(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l,s=(l=i.value,function(e){if(Array.isArray(e))return e}(l)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return rQ(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rQ(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],u=s[1];"modelCatalog"!==c&&u.length>4096&&t.addIssue({code:"too_big",origin:"string",maximum:4096,inclusive:!0,path:[c]})}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}),r6=ro(r3,r2(1048576)),r8=rl(["skip","overwrite"]),r9=rl(["openai-chat","openai-responses","anthropic-messages"]);n9({password:nP().trim().min(1,a.passwordRequired).max(4096)}),n9({currentPassword:nP().min(1,a.passwordRequired).max(4096),newPassword:nP().min(1,a.passwordRequired).max(4096)}),n9({name:r1,copySourceName:r1.optional(),baseUrl:r2(2048).optional(),apiKey:r2(4096).optional(),model:r2(120).optional(),notes:r2(4096).optional(),extras:r5.optional(),overrides:r6.optional(),providerId:r2(120).optional(),providerEndpoint:r2(120).optional()}).partial();var r7=n6(n9({key:nP().trim().min(1,a.endpointKeyRequired).max(60,a.endpointKeyTooLong).refine(function(e){return!e.includes("/")&&!e.includes("\\")},a.endpointKeySlash),label:r2(120).optional(),baseUrl:nP().trim().min(1,a.endpointBaseUrlRequired).max(2048)})).max(50).refine(function(e){return new Set(e.map(function(e){return e.key})).size===e.length},a.endpointKeyDuplicate);n9({name:r1,apiKey:nP().min(1,a.apiKeyRequired).max(4096),endpoints:r7.optional(),notes:r2(4096).optional()}),n9({name:r1.optional(),apiKey:r2(4096).optional(),endpoints:r7.optional(),notes:r2(4096).optional()}),n9({sourceUser:nP().trim().min(1,a.sourceUserRequired).max(120),conflictPolicy:r8.optional(),overwriteHarnesses:n6(r4).optional(),migrateCodexLoginCache:n1().optional()});var oe=n9({format:rc("harness-switch-encrypted-export"),version:rc(1),kdf:n9({name:rc("scrypt"),salt:nP().min(1)}),cipher:n9({name:rc("aes-256-gcm"),iv:nP().min(1),tag:nP().min(1),data:nP().min(1)})}),ot=n9({modelFavorite:rY.optional(),harness:r4,name:r1,baseUrl:r2(2048),apiKey:r2(4096),model:r2(120),notes:r2(4096),extras:r5,overrides:r6,providerId:r2(120).optional(),providerEndpoint:r2(120).optional()}),on=n9({id:nP().min(1).max(64).refine(function(e){return!e.includes("/")&&!e.includes("\\")},a.providerIdSlash).refine(function(e){return"__proto__"!==e&&"constructor"!==e},a.providerIdReserved),name:nP().min(1).max(120),apiKey:nP().min(1).max(4096),notes:r2(4096).optional(),endpoints:n6(n9({key:r3,label:r2(120),baseUrl:r2(2048)}))}),or=n9({harness:r4,name:r1,official:n1()});n9({format:rc("harness-switch-portable-config"),version:re([rc(1),rc(2)]),favorites:n6(rW).max(1e3).optional(),exportedAt:nP(),profiles:n6(ot).max(1e4),providers:n6(on).max(1e4).optional(),active:n6(or),codexLoginCache:nP().optional()}),n9({legacy:n1().optional(),passphrase:r2(4096),includeCodexLoginCache:n1().optional()}),n9({envelope:oe,passphrase:r2(4096),conflictPolicy:r8.optional(),restoreActive:n1().optional(),migrateCodexLoginCache:n1().optional()});var oo=n9({id:nP().min(1).max(240),name:r1,target:rl(["profile","vault"]),apiKey:r2(4096).optional(),providerId:r2(120).optional(),providerName:r1.optional(),overwrite:n1().optional()});n9({selections:n6(oo).min(1,a.selectionRequired).max(200)}),n9({baseUrl:nP().trim().min(1,a.baseUrlRequired).max(2048),apiKey:r2(4096).optional(),providerId:r2(120).optional(),completion:n1().optional(),model:r2(120).optional(),protocol:r9.optional()}),n9({endpoint:r2(120).optional(),completion:n1().optional(),model:r2(120).optional(),protocol:r9.optional(),refresh:n1().optional()}),n9({clientId:r2(100).optional()}),n9({deviceCode:nP().min(1).max(200),clientId:r2(100).optional()}),n9({token:nP().trim().min(1,a.tokenRequired).max(500)}),n9({passphrase:r2(4096),includeCodexLoginCache:n1().optional()}),n9({passphrase:r2(4096),conflictPolicy:r8.optional(),restoreActive:n1().optional()}),n9({passphrase:r2(4096),conflictPolicy:r8.optional(),restoreActive:n1().optional(),migrateCodexLoginCache:n1().optional()}),rl(["kimi","dsh"]);var oi=n9({id:nM(),source:new rt({type:"union",options:[n9({kind:rc("profile"),name:nP().min(1).max(120)}),n9({kind:rc("favorite"),favoriteId:nM(),connectionId:nM()})],discriminator:"kind",...ep(void 0)}),factOverrides:rF.shape.factOverrides,preferenceOverrides:rF.shape.preferenceOverrides}),oa=n9({items:n6(oi).max(50),defaultItemId:nM().nullable().default(null)}).superRefine(function(e,t){(new Set(e.items.map(function(e){return e.id})).size!==e.items.length||new Set(e.items.map(function(e){return JSON.stringify(e.source)})).size!==e.items.length)&&t.addIssue({code:"custom",message:i.toolModelsConflict}),e.defaultItemId&&!e.items.some(function(t){return t.id===e.defaultItemId})&&t.addIssue({code:"custom",message:i.toolModelsDefaultRequired})});n9({expectedRevision:nX().int().nonnegative(),draft:oa}),n9({planId:nM()})}},u={};function d(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,d),n.exports}d.m=c,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(n,r){if(1&r&&(n=this(n)),8&r||"object"==typeof n&&n&&(4&r&&n.__esModule||16&r&&"function"==typeof n.then))return n;var o=Object.create(null);d.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>{i[e]=()=>n[e]});return i.default=()=>n,d.d(o,i),o},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,n)=>(d.f[n](e,t),t),[])),d.k=e=>""+e+".css",d.u=e=>"assets/"+e+"."+({38:"12ddaa3e",403:"83e8a5aa",703:"74dabcc4",780:"6c88bbeb",886:"215586f6",911:"fae0dbda",952:"906cea7c",997:"79084a9d"})[e]+".js",d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},d.l=function(e,t,r,o){if(n[e])return void n[e].push(t);if(void 0!==r)for(var i,a,l=document.getElementsByTagName("script"),s=0;s<l.length;s++){var c=l[s];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@seaveyon/harness-switch-web:"+r){i=c;break}}i||(a=!0,(i=document.createElement("script")).timeout=120,d.nc&&i.setAttribute("nonce",d.nc),i.setAttribute("data-rspack","@seaveyon/harness-switch-web:"+r),i.src=e),n[e]=[t];var u=function(t,r){i.onerror=i.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(function(e){return e(r)}),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),a&&document.head.appendChild(i)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nc=void 0,d.p="/",d.rv=()=>"1.7.12",r={889:0},i="data-rspack-loading",(o=(e,t)=>{r[t]=0})(d.m,0,"889"),d.f.css=(e,t,n)=>{var a=d.o(r,e)?r[e]:void 0;if(0!==a)if(a)t.push(a[2]);else if(889==e){var l=new Promise(function(t,n){a=r[e]=[t,n]});t.push(a[2]=l);var s=d.p+d.k(e),c=Error(),u=function(t){if(d.o(r,e)&&(0!==(a=r[e])&&(r[e]=void 0),a))if("load"!==t.type){var n=t&&t.type,i=t&&t.target&&t.target.src;c.message="Loading css chunk "+e+" failed.\n("+n+": "+i+")",c.name="ChunkLoadError",c.type=n,c.request=i,a[1](c)}else o(d.m,e),a[0]()};"u">typeof document?((e,t,n,r,o)=>{var a,l,s="chunk-"+e;if(!r){for(var c=document.getElementsByTagName("link"),u=0;u<c.length;u++){var f=c[u],p=f.getAttribute("href")||f.href;if(p&&!p.startsWith(d.p)&&(p=d.p+(p.startsWith("/")?p.slice(1):p)),"stylesheet"==f.rel&&(p&&p.startsWith(t)||f.getAttribute("data-rspack")=="@seaveyon/harness-switch-web:"+s)){a=f;break}}if(!n)return}a||(l=!0,a=document.createElement("link"),d.nc&&a.setAttribute("nonce",d.nc),a.setAttribute("data-rspack","@seaveyon/harness-switch-web:"+s),a.setAttribute(i,1),a.rel="stylesheet",a.href=t);var h=(e,t)=>{if(a.onerror=a.onload=null,a.removeAttribute(i),clearTimeout(m),t&&"load"!=t.type&&a.parentNode.removeChild(a),n(t),e)return e(t)};if(a.getAttribute(i)){var m=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload)}else h(void 0,{type:"load",target:a});return r&&r.getAttribute("fetchpriority")&&a.setAttribute("fetchpriority",r.getAttribute("fetchpriority")),r?document.head.insertBefore(a,r):l&&document.head.appendChild(a)})(e,s,u,void 0,0):u({type:"load"})}else r[e]=0},a={889:0},d.f.j=function(e,t){var n=d.o(a,e)?a[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise((t,r)=>n=a[e]=[t,r]);t.push(n[2]=r);var o=d.p+d.u(e),i=Error();d.l(o,function(t){if(d.o(a,e)&&(0!==(n=a[e])&&(a[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},l=(e,t)=>{var n,r,[o,i,l]=t,s=0;if(o.some(e=>0!==a[e])){for(n in i)d.o(i,n)&&(d.m[n]=i[n]);l&&l(d)}for(e&&e(t);s<o.length;s++)r=o[s],d.o(a,r)&&a[r]&&a[r][0](),a[r]=0},(s=self.webpackChunk_seaveyon_harness_switch_web=self.webpackChunk_seaveyon_harness_switch_web||[]).forEach(l.bind(null,0)),s.push=l.bind(null,s.push.bind(s)),d.ruid="bundler=rspack@1.7.12",(()=>{let e,t;var n,r,o,i,a,l,s,c,u,f,p,h,m,v,g,y,b,x=d(1085),w=d(4041),k=d.t(w,2),j=d(5873);let S=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},O=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim();var C={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let N=(0,w.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...l},s)=>(0,w.createElement)("svg",{ref:s,...C,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:O("lucide",o),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(l)&&{"aria-hidden":"true"},...l},[...a.map(([e,t])=>(0,w.createElement)(e,t)),...Array.isArray(i)?i:[i]])),P=(e,t)=>{let n=(0,w.forwardRef)(({className:n,...r},o)=>(0,w.createElement)(N,{ref:o,iconNode:t,className:O(`lucide-${S(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r}));return n.displayName=S(e),n},E=P("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);var I=Object.defineProperty,A=(e,t)=>I(e,"name",{value:t,configurable:!0});function _(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function M(...e){return t=>{let n=!1,r=e.map(e=>{let r=_(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():_(e[t],null)}}}}function T(...e){return w.useCallback(M(...e),e)}A(_,"setRef"),A(M,"composeRefs"),A(T,"useComposedRefs");var R=Object.defineProperty,z=(e,t)=>R(e,"name",{value:t,configurable:!0});function D(e){let t=w.forwardRef((t,n)=>{let{children:r,...o}=t,i=null,a=!1,l=[];V(r)&&"function"==typeof Y&&(r=Y(r._payload)),w.Children.forEach(r,e=>{if(K(e)){a=!0;let t="child"in e.props?e.props.child:e.props.children;V(t)&&"function"==typeof Y&&(t=Y(t._payload)),i=H(e,t),l.push(i?.props?.children)}else l.push(e)}),i?i=w.cloneElement(i,void 0,l):!a&&1===w.Children.count(r)&&w.isValidElement(r)&&(i=r);let s=i?B(i):void 0,c=T(n,s);if(!i){if(r||0===r)throw Error(a?Z(e):G(e));return r}let u=$(o,i.props??{});return i.type!==w.Fragment&&(u.ref=n?c:s),w.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}z(D,"createSlot");var L=D("Slot"),F=Symbol.for("radix.slottable");function U(e){let t=z(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=F,t}z(U,"createSlottable");var H=z((e,t)=>{if("child"in e.props){let t=e.props.child;return w.isValidElement(t)?w.cloneElement(t,void 0,e.props.children(t.props.children)):null}return w.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function $(e,t){let n={...t};for(let r in t){let o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{let t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function B(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function K(e){return w.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===F}z($,"mergeProps"),z(B,"getElementRef"),z(K,"isSlottable");var q=Symbol.for("react.lazy");function V(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===q&&"_payload"in e&&W(e._payload)}function W(e){return"object"==typeof e&&null!==e&&"then"in e}z(V,"isLazyComponent"),z(W,"isPromiseLike");var G=z(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Z=z(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Y=k[" use ".trim().toString()];function X(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}(e))&&(r&&(r+=" "),r+=t);return r}let J=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Q=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return X(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(e=>{let t=null==n?void 0:n[e],r=null==i?void 0:i[e];if(null===t)return null;let a=J(t)||J(r);return o[e][a]}),l=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return X(e,a,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...l}[t]):({...i,...l})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)},ee=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),et=[],en=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],o=n.nextPart.get(r);if(o){let n=en(e,t+1,o);if(n)return n}let i=n.validators;if(null===i)return;let a=0===t?e.join("-"):e.slice(t).join("-"),l=i.length;for(let e=0;e<l;e++){let t=i[e];if(t.validator(a))return t.classGroupId}},er=(e,t)=>{let n=ee();for(let r in e)eo(e[r],n,r,t);return n},eo=(e,t,n,r)=>{let o=e.length;for(let i=0;i<o;i++)ei(e[i],t,n,r)},ei=(e,t,n,r)=>{"string"==typeof e?ea(e,t,n):"function"==typeof e?el(e,t,n,r):es(e,t,n,r)},ea=(e,t,n)=>{(""===e?t:ec(t,e)).classGroupId=n},el=(e,t,n,r)=>{eu(e)?eo(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},es=(e,t,n,r)=>{let o=Object.entries(e),i=o.length;for(let e=0;e<i;e++){let[i,a]=o[e];eo(a,ec(t,i),n,r)}},ec=(e,t)=>{let n=e,r=t.split("-"),o=r.length;for(let e=0;e<o;e++){let t=r[e],o=n.nextPart.get(t);o||(o=ee(),n.nextPart.set(t,o)),n=o}return n},eu=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,ed=[],ef=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ep=/\s+/,eh=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=eh(e[r]))&&(n&&(n+=" "),n+=t);return n},em=[],ev=e=>{let t=t=>t[e]||em;return t.isThemeGetter=!0,t},eg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ey=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ew=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ek=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ej=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eO=e=>eb.test(e),eC=e=>!!e&&!Number.isNaN(Number(e)),eN=e=>!!e&&Number.isInteger(Number(e)),eP=e=>e.endsWith("%")&&eC(e.slice(0,-1)),eE=e=>ex.test(e),eI=()=>!0,eA=e=>ew.test(e)&&!ek.test(e),e_=()=>!1,eM=e=>ej.test(e),eT=e=>eS.test(e),eR=e=>!eL(e)&&!eV(e),ez=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),eD=e=>e0(e,e4,e_),eL=e=>eg.test(e),eF=e=>e0(e,e5,eA),eU=e=>e0(e,e6,eC),eH=e=>e0(e,e9,eI),e$=e=>e0(e,e8,e_),eB=e=>e0(e,e2,e_),eK=e=>e0(e,e3,eT),eq=e=>e0(e,e7,eM),eV=e=>ey.test(e),eW=e=>e1(e,e5),eG=e=>e1(e,e8),eZ=e=>e1(e,e2),eY=e=>e1(e,e4),eX=e=>e1(e,e3),eJ=e=>e1(e,e7,!0),eQ=e=>e1(e,e9,!0),e0=(e,t,n)=>{let r=eg.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},e1=(e,t,n=!1)=>{let r=ey.exec(e);return!!r&&(r[1]?t(r[1]):n)},e2=e=>"position"===e||"percentage"===e,e3=e=>"image"===e||"url"===e,e4=e=>"length"===e||"size"===e||"bg-size"===e,e5=e=>"length"===e,e6=e=>"number"===e,e8=e=>"family-name"===e,e9=e=>"number"===e||"weight"===e,e7=e=>"shadow"===e,te=((e,...t)=>{let n,r,o,i,a=e=>{let t=r(e);if(t)return t;let i=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:a}=t,l=[],s=e.trim().split(ep),c="";for(let e=s.length-1;e>=0;e-=1){let t,u=s[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}=n(u);if(d){c=u+(c.length>0?" "+c:c);continue}let v=!!m;if(v){let e=(t=r(h.substring(0,m)))&&a[t]?r(h):void 0;e&&e!==t&&(t=e,v=!1)}else t=r(h);if(!t){if(!v||!(t=r(h))){c=u+(c.length>0?" "+c:c);continue}v=!1}let g=0===f.length?"":1===f.length?f[0]:i(f).join(":"),y=p?g+"!":g,b=y+t;if(l.indexOf(b)>-1)continue;l.push(b);let x=o(t,v);for(let e=0;e<x.length;++e){let t=x[e];l.push(y+t)}c=u+(c.length>0?" "+c:c)}return c})(e,n);return o(e,i),i};return i=l=>{var s;let c;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),o=(o,i)=>{n[o]=i,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}})((s=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,o=0,i=0,a=e.length;for(let l=0;l<a;l++){let a=e[l];if(0===r&&0===o){if(":"===a){n.push(e.slice(i,l)),i=l+1;continue}if("/"===a){t=l;continue}}"["===a?r++:"]"===a?r--:"("===a?o++:")"===a&&o--}let l=0===n.length?e:e.slice(i),s=l,c=!1;return l.endsWith("!")?(s=l.slice(0,-1),c=!0):l.startsWith("!")&&(s=l.slice(1),c=!0),ef(n,c,s,t&&t>i?t-i:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ef(ed,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(s),sortModifiers:(c=new Map,s.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let o=e[r],i="["===o[0],a=c.has(o);i||a?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(o)):n.push(o)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(s),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return er(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,o;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(o=t.slice(0,r))?"arbitrary.."+o:void 0)}let r=e.split("-"),o=+(""===r[0]&&r.length>1);return en(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],o=n[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let n=0;n<t.length;n++)e[o.length+n]=t[n];return e}return t}return o||et}return n[e]||et}}})(s)}).cache.get,o=n.cache.set,i=a,a(l)},(...e)=>i(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=eh(t))&&(o&&(o+=" "),o+=n);return o})(...e))})(()=>{let e=ev("color"),t=ev("font"),n=ev("text"),r=ev("font-weight"),o=ev("tracking"),i=ev("leading"),a=ev("breakpoint"),l=ev("container"),s=ev("spacing"),c=ev("radius"),u=ev("shadow"),d=ev("inset-shadow"),f=ev("text-shadow"),p=ev("drop-shadow"),h=ev("blur"),m=ev("perspective"),v=ev("aspect"),g=ev("ease"),y=ev("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),eV,eL],k=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],S=()=>[eV,eL,s],O=()=>[eO,"full","auto",...S()],C=()=>[eN,"none","subgrid",eV,eL],N=()=>["auto",{span:["full",eN,eV,eL]},eN,eV,eL],P=()=>[eN,"auto",eV,eL],E=()=>["auto","min","max","fr",eV,eL],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...S()],M=()=>[eO,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],T=()=>[eO,"screen","full","dvw","lvw","svw","min","max","fit",...S()],R=()=>[eO,"screen","full","lh","dvh","lvh","svh","min","max","fit",...S()],z=()=>[e,eV,eL],D=()=>[...x(),eZ,eB,{position:[eV,eL]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",eY,eD,{size:[eV,eL]}],U=()=>[eP,eW,eF],H=()=>["","none","full",c,eV,eL],$=()=>["",eC,eW,eF],B=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[eC,eP,eZ,eB],V=()=>["","none",h,eV,eL],W=()=>["none",eC,eV,eL],G=()=>["none",eC,eV,eL],Z=()=>[eC,eV,eL],Y=()=>[eO,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eE],breakpoint:[eE],color:[eI],container:[eE],"drop-shadow":[eE],ease:["in","out","in-out"],font:[eR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eE],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eE],shadow:[eE],spacing:["px",eC],text:[eE],"text-shadow":[eE],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eO,eL,eV,v]}],container:["container"],"container-type":[{"@container":["","normal","size",eV,eL]}],"container-named":[ez],columns:[{columns:[eC,eL,eV,l]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[eN,"auto",eV,eL]}],basis:[{basis:[eO,"full","auto",l,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[eC,eO,"auto","initial","none",eL]}],grow:[{grow:["",eC,eV,eL]}],shrink:[{shrink:["",eC,eV,eL]}],order:[{order:[eN,"first","last","none",eV,eL]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...R()]}],"min-block-size":[{"min-block":["auto",...R()]}],"max-block-size":[{"max-block":["none",...R()]}],w:[{w:[l,"screen",...M()]}],"min-w":[{"min-w":[l,"screen","none",...M()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,eW,eF]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,eQ,eH]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eP,eL]}],"font-family":[{font:[eG,e$,t]}],"font-features":[{"font-features":[eL]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,eV,eL]}],"line-clamp":[{"line-clamp":[eC,"none",eV,eU]}],leading:[{leading:[i,...S()]}],"list-image":[{"list-image":["none",eV,eL]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eV,eL]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[eC,"from-font","auto",eV,eF]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[eC,"auto",eV,eL]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"tab-size":[{tab:[eN,eV,eL]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eV,eL]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",eV,eL]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eN,eV,eL],radial:["",eV,eL],conic:[eN,eV,eL]},eX,eK]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:$()}],"border-w-x":[{"border-x":$()}],"border-w-y":[{"border-y":$()}],"border-w-s":[{"border-s":$()}],"border-w-e":[{"border-e":$()}],"border-w-bs":[{"border-bs":$()}],"border-w-be":[{"border-be":$()}],"border-w-t":[{"border-t":$()}],"border-w-r":[{"border-r":$()}],"border-w-b":[{"border-b":$()}],"border-w-l":[{"border-l":$()}],"divide-x":[{"divide-x":$()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":$()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[eC,eV,eL]}],"outline-w":[{outline:["",eC,eW,eF]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,eJ,eq]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,eJ,eq]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[eC,eF]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":$()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",f,eJ,eq]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[eC,eV,eL]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[eC]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[eV,eL]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[eC]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eV,eL]}],filter:[{filter:["","none",eV,eL]}],blur:[{blur:V()}],brightness:[{brightness:[eC,eV,eL]}],contrast:[{contrast:[eC,eV,eL]}],"drop-shadow":[{"drop-shadow":["","none",p,eJ,eq]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",eC,eV,eL]}],"hue-rotate":[{"hue-rotate":[eC,eV,eL]}],invert:[{invert:["",eC,eV,eL]}],saturate:[{saturate:[eC,eV,eL]}],sepia:[{sepia:["",eC,eV,eL]}],"backdrop-filter":[{"backdrop-filter":["","none",eV,eL]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[eC,eV,eL]}],"backdrop-contrast":[{"backdrop-contrast":[eC,eV,eL]}],"backdrop-grayscale":[{"backdrop-grayscale":["",eC,eV,eL]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eC,eV,eL]}],"backdrop-invert":[{"backdrop-invert":["",eC,eV,eL]}],"backdrop-opacity":[{"backdrop-opacity":[eC,eV,eL]}],"backdrop-saturate":[{"backdrop-saturate":[eC,eV,eL]}],"backdrop-sepia":[{"backdrop-sepia":["",eC,eV,eL]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eV,eL]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[eC,"initial",eV,eL]}],ease:[{ease:["linear","initial",g,eV,eL]}],delay:[{delay:[eC,eV,eL]}],animate:[{animate:["none",y,eV,eL]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,eV,eL]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:W()}],"rotate-x":[{"rotate-x":W()}],"rotate-y":[{"rotate-y":W()}],"rotate-z":[{"rotate-z":W()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Z()}],"skew-x":[{"skew-x":Z()}],"skew-y":[{"skew-y":Z()}],transform:[{transform:[eV,eL,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[eN,eV,eL]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",eV,eL]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",eV,eL]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[eC,eW,eF,eU]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function tt(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return te(X(t))}var tn=Q("inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[10px] text-sm font-medium transition-[color,background-color,border-color,box-shadow,transform] duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-2 focus-visible:ring-offset-background active:translate-y-px disabled:pointer-events-none disabled:opacity-50 disabled:active:translate-y-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-[0_8px_20px_-10px_color-mix(in_srgb,var(--primary)_65%,transparent)] hover:bg-primary/90 hover:shadow-[0_10px_24px_-10px_color-mix(in_srgb,var(--primary)_80%,transparent)]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/88",outline:"border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] hover:border-ring/35 hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent/75 hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3 text-xs",lg:"h-11 px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function tr(e){var t=e.className,n=e.variant,r=e.size,o=e.asChild,i=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className","variant","size","asChild"]);return(0,x.jsx)(void 0!==o&&o?L:"button",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"button",className:tt(tn({variant:n,size:r,className:t}))},i))}var to=d(1434);function ti(){var e=(0,to.Bd)().t;return(0,x.jsx)(tr,{asChild:!0,size:"sm",variant:"outline",className:"fixed bottom-4 right-4 z-30 rounded-full shadow-lg",children:(0,x.jsxs)("a",{href:"https://github.com/B1anker/harness-switch/issues",target:"_blank",rel:"noopener noreferrer",title:e("feedback.hint"),children:[(0,x.jsx)(E,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:e("feedback.label")})]})})}var ta=d(7983);let tl=P("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),ts=P("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),tc=P("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]),tu=P("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),td=P("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]),tf=P("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),tp=P("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),th=P("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),tm=P("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),tv=P("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tg=P("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var ty=Q("inline-flex items-center rounded-full border px-2.5 py-1 text-[11px] font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function tb(e){var t=e.className,n=e.variant,r=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className","variant"]);return(0,x.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"badge",className:tt(ty({variant:n}),t)},r))}function tx(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function tw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tk(e){return(tk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function tj(e,t){return(tj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tS=function(){return!!e})()}var tO=(0,w.lazy)(function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,Promise.all([d.e("780"),d.e("38")]).then(d.bind(d,1419))];case 1:return[2,{default:e.sent().PierreFileDiff}]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){tx(i,r,o,a,l,"next",e)}function l(e){tx(i,r,o,a,l,"throw",e)}a(void 0)})})()});function tC(e){return null===e.content&&null===e.currentContent?"same":null===e.content?"delete":null===e.currentContent?"create":e.content===e.currentContent?"same":"replace"}function tN(e){var t=e.files,n=e.intent,r=void 0===n?"restore":n,o=e.collapseUnchanged,i=void 0!==o&&o;return(0,x.jsx)("div",{className:"space-y-3",children:t.map(function(e){return(0,x.jsx)(tP,{file:e,intent:r,collapseUnchanged:i},e.path)})})}function tP(e){var t=e.file,n=e.intent,r=e.collapseUnchanged,o=(0,to.Bd)().t,i=tC(t);return(0,x.jsxs)("div",{className:"overflow-hidden rounded-xl border",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b bg-muted/40 px-3 py-2",children:[(0,x.jsx)("p",{className:"min-w-0 truncate font-mono text-xs",title:t.path,children:t.path}),(0,x.jsx)(tb,{variant:"secondary",children:o("diff.".concat(i))})]}),(0,x.jsx)(tI,{fallback:(0,x.jsx)(tE,{file:t,intent:n}),children:(0,x.jsx)(w.Suspense,{fallback:(0,x.jsx)("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:o("diff.rendering")}),children:(0,x.jsx)(tO,{file:t,collapseUnchanged:r})})})]})}function tE(e){var t,n,r=e.file,o=e.intent,i=(0,to.Bd)().t;return(0,x.jsxs)("div",{className:"grid gap-2 p-3 font-mono text-xs",children:[(0,x.jsx)("pre",{className:"whitespace-pre-wrap text-red-400/90",children:null!=(t=r.currentContent)?t:i("diff.absent")}),(0,x.jsx)("p",{className:"font-sans text-muted-foreground",children:i("apply"===o?"favorites.after":"diff.afterRestore")}),(0,x.jsx)("pre",{className:"whitespace-pre-wrap text-emerald-400/90",children:null!=(n=r.content)?n:i("apply"===o?"diff.absent":"diff.deletedAfterRestore")})]})}var tI=function(e){var t,n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t,n,o,i;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=tk(t),e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,tS()?Reflect.construct(t,n||[],tk(this).constructor):t.apply(this,n)),i={failed:!1},(o="state")in e?Object.defineProperty(e,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[o]=i,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&tj(r,e),n=[{key:"getDerivedStateFromError",value:function(){return{failed:!0}}}],t=[{key:"render",value:function(){return this.state.failed?this.props.fallback:this.props.children}}],tw(r.prototype,t),n&&tw(r,n),r}(w.Component),tA=Object.defineProperty,t_=(e,t)=>tA(e,"name",{value:t,configurable:!0}),tM=!!("u">typeof window&&window.document&&window.document.createElement);function tT(e,t,{checkForDefaultPrevented:n=!0}={}){return t_(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function tR(e){if(!tM)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function tz(e){return"IFRAME"===e.tagName}t_(tT,"composeEventHandlers"),t_(function(e){if(!tM)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),t_(tR,"getOwnerDocument"),t_(function e(t,n=!1){let{activeElement:r}=tR(t);if(!r?.nodeName)return null;if(tz(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=tR(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),t_(tz,"isFrame");var tD=Object.defineProperty,tL=(e,t)=>tD(e,"name",{value:t,configurable:!0});function tF(e,t=[]){let n=[];function r(t,r){let o=w.createContext(r);o.displayName=t+"Context";let i=n.length;n=[...n,r];let a=tL(t=>{let{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,s=w.useMemo(()=>a,Object.values(a));return(0,x.jsx)(l.Provider,{value:s,children:r})},"Provider");function l(n,a,s={}){let{optional:c=!1}=s,u=a?.[e]?.[i]||o,d=w.useContext(u);if(d)return d;if(void 0!==r)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return a.displayName=t+"Provider",tL(l,"useContext"),[a,l]}tL(r,"createContext");let o=tL(()=>{let t=n.map(e=>w.createContext(e));return tL(function(n){let r=n?.[e]||t;return w.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return o.scopeName=e,[r,tU(o,...t)]}function tU(...e){let t=e[0];if(1===e.length)return t;let n=tL(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return tL(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}tL(function(e,t){let n=w.createContext(t);n.displayName=e+"Context";let r=tL(e=>{let{children:t,...r}=e,o=w.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:o,children:t})},"Provider");function o(r,i={}){let{optional:a=!1}=i,l=w.useContext(n);if(l)return l;if(void 0!==t)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",tL(o,"useContext"),[r,o]},"createContext"),tL(tF,"createContextScope"),tL(tU,"composeContextScopes");var tH=globalThis?.document?w.useLayoutEffect:()=>{},t$=Object.defineProperty,tB=k[" useId ".trim().toString()]||(()=>void 0),tK=0;function tq(e){let[t,n]=w.useState(tB());return tH(()=>{e||n(e=>e??String(tK++))},[e]),e||(t?`radix-${t}`:"")}t$(tq,"name",{value:"useId",configurable:!0});var tV=Object.defineProperty,tW=k[" useEffectEvent ".trim().toString()],tG=k[" useInsertionEffect ".trim().toString()];function tZ(e){if("function"==typeof tW)return tW(e);let t=w.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof tG?tG(()=>{t.current=e}):tH(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}tV(tZ,"name",{value:"useEffectEvent",configurable:!0});var tY=Object.defineProperty,tX=(e,t)=>tY(e,"name",{value:t,configurable:!0}),tJ=k[" useInsertionEffect ".trim().toString()]||tH;function tQ({prop:e,defaultProp:t,onChange:n=tX(()=>{},"onChange"),caller:r}){let[o,i,a]=t0({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:o;return[s,w.useCallback(t=>{if(l){let n=t1(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[l,e,i,a])]}function t0({defaultProp:e,onChange:t}){let[n,r]=w.useState(e),o=w.useRef(n),i=w.useRef(t);return tJ(()=>{i.current=t},[t]),w.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function t1(e){return"function"==typeof e}tX(tQ,"useControllableState"),tX(t0,"useUncontrolledState"),tX(t1,"isFunction");var t2=Symbol("RADIX:SYNC_STATE");tX(function(e,t,n,r){let{prop:o,defaultProp:i,onChange:a,caller:l}=t,s=void 0!==o,c=tZ(a),u=[{...n,state:i}];r&&u.push(r);let[d,f]=w.useReducer((t,n)=>{if(n.type===t2)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&c(r.state),r},...u),p=d.state,h=w.useRef(p);w.useEffect(()=>{h.current!==p&&(h.current=p,s||c(p))},[p,h,s]);let m=w.useMemo(()=>void 0!==o?{...d,state:o}:d,[d,o]);return w.useEffect(()=>{s&&!Object.is(o,d.state)&&f({type:t2,state:o})},[o,d.state,s]),[m,f]},"useControllableStateReducer");var t3=d(3144),t4=Object.defineProperty,t5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=D(`Primitive.${t}`),r=w.forwardRef((e,r)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,x.jsx)(o?n:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t6(e,t){e&&t3.flushSync(()=>e.dispatchEvent(t))}function t8(e){let t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...e)=>t.current?.(...e),[])}t4(t6,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(t8,"name",{value:"useCallbackRef",configurable:!0});var t9=Object.defineProperty,t7=(e,t)=>t9(e,"name",{value:t,configurable:!0}),ne="dismissableLayer.update",nt=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),nn=w.forwardRef(t7(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:s,...c}=e,u=w.useContext(nt),[d,f]=w.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=w.useState({}),m=T(t,f),v=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g?v.indexOf(g):-1,b=d?v.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=y,S=w.useRef(!1),O=ni(e=>{i?.(e),l?.(e),e.defaultPrevented||s?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:w.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return j&&!t},[u.branches,j])}),C=na(e=>{if(r&&S.current)return;let t=e.target;![...u.branches].some(e=>e.contains(t))&&(a?.(e),l?.(e),e.defaultPrevented||s?.())},p),N=!!d&&b===v.length-1,P=t8(e=>{"Escape"===e.key&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))});return w.useEffect(()=>{if(N)return p.addEventListener("keydown",P,{capture:!0}),()=>p.removeEventListener("keydown",P,{capture:!0})},[p,N,P]),w.useEffect(()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(pf=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),nl(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),0===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=pf))}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),nl())},[d,u]),w.useEffect(()=>{let e=t7(()=>h({}),"handleUpdate");return document.addEventListener(ne,e),()=>document.removeEventListener(ne,e)},[]),(0,x.jsx)(t5.div,{...c,ref:m,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:tT(e.onFocusCapture,C.onFocusCapture),onBlurCapture:tT(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:tT(e.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function nr(){let e=w.useContext(nt),[t,n]=w.useState(null);return w.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}t7(nr,"useDismissableLayerSurface");var no=t7(()=>!0,"IS_TRUE");function ni(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=no}=t,l=t8(e),s=w.useRef(!1),c=w.useRef(!1),u=w.useRef(new Map),d=w.useRef(()=>{});return w.useEffect(()=>{function e(){c.current=!1,o.current=!1,u.current.clear()}function t(){return Array.from(u.current.values()).some(Boolean)}function f(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function p(e){c.current&&u.current.set(e.type,!1)}t7(e,"resetOutsideInteraction"),t7(t,"isOutsideInteractionIntercepted"),t7(f,"handleInteractionCapture"),t7(p,"handleInteractionBubble");let h=t7(i=>{if(i.target&&!s.current){let f=function(){n.removeEventListener("click",d.current);let r=t();e(),r||ns("dismissableLayer.pointerDownOutside",l,p,{discrete:!0})};if(t7(f,"handleAndDispatchPointerDownOutsideEvent"),!a(i.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let p={originalEvent:i};c.current=!0,o.current=r&&0===i.button,u.current.clear(),r&&0===i.button?(n.removeEventListener("click",d.current),d.current=f,n.addEventListener("click",d.current,{once:!0})):f()}else n.removeEventListener("click",d.current),e();s.current=!1},"handlePointerDown"),m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,f,!0),n.addEventListener(e,p);let v=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{for(let e of(window.clearTimeout(v),n.removeEventListener("pointerdown",h),n.removeEventListener("click",d.current),m))n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,l,r,o,i,a]),{onPointerDownCapture:t7(()=>s.current=!0,"onPointerDownCapture")}}function na(e,t=globalThis?.document){let n=t8(e),r=w.useRef(!1);return w.useEffect(()=>{let e=t7(e=>{e.target&&!r.current&&ns("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:t7(()=>r.current=!0,"onFocusCapture"),onBlurCapture:t7(()=>r.current=!1,"onBlurCapture")}}function nl(){let e=new CustomEvent(ne);document.dispatchEvent(e)}function ns(e,t,n,{discrete:r}){let o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?t6(o,i):o.dispatchEvent(i)}t7(ni,"usePointerDownOutside"),t7(na,"useFocusOutside"),t7(nl,"dispatchUpdate"),t7(ns,"handleAndDispatchCustomEvent");var nc=Object.defineProperty,nu=(e,t)=>nc(e,"name",{value:t,configurable:!0}),nd="focusScope.autoFocusOnMount",nf="focusScope.autoFocusOnUnmount",np={bubbles:!1,cancelable:!0},nh=w.forwardRef(nu(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[l,s]=w.useState(null),c=t8(o),u=t8(i),d=w.useRef(null),f=T(t,s),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:nw(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||nw(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&nw(l)};nu(e,"handleFocusIn"),nu(t,"handleFocusOut"),nu(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,p.paused]),w.useEffect(()=>{if(l){nk.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(nd,np);l.addEventListener(nd,c),l.dispatchEvent(t),t.defaultPrevented||(nm(nO(ng(l)),{select:!0}),document.activeElement===e&&nw(l))}return()=>{l.removeEventListener(nd,c),setTimeout(()=>{let t=new CustomEvent(nf,np);l.addEventListener(nf,u),l.dispatchEvent(t),t.defaultPrevented||nw(e??document.body,{select:!0}),l.removeEventListener(nf,u),nk.remove(p)},0)}}},[l,c,u,p]);let h=w.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[r,i]=nv(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&nw(i,{select:!0})):(e.preventDefault(),n&&nw(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(t5.div,{tabIndex:-1,...a,ref:f,onKeyDown:h})},"FocusScope"));function nm(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(nw(r,{select:t}),document.activeElement!==n)return}function nv(e){let t=ng(e);return[ny(t,e),ny(t.reverse(),e)]}function ng(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:nu(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function ny(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nb(r,{upTo:t})))return r}function nb(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function nx(e){return e instanceof HTMLInputElement&&"select"in e}function nw(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nx(e)&&t&&e.select()}}nu(nm,"focusFirst"),nu(nv,"getTabbableEdges"),nu(ng,"getTabbableCandidates"),nu(ny,"findVisible"),nu(nb,"isHidden"),nu(nx,"isSelectableInput"),nu(nw,"focus");var nk=nj();function nj(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=nS(e,t)).unshift(t)},remove(t){e=nS(e,t),e[0]?.resume()}}}function nS(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function nO(e){return e.filter(e=>"A"!==e.tagName)}nu(nj,"createFocusScopesStack"),nu(nS,"arrayRemove"),nu(nO,"removeLinks");var nC=Object.defineProperty,nN=w.forwardRef(nC(function(e,t){let{container:n,...r}=e,[o,i]=w.useState(!1);tH(()=>i(!0),[]);let a=n||o&&globalThis?.document?.body;return a?t3.createPortal((0,x.jsx)(t5.div,{...r,ref:t}),a):null},"name",{value:"Portal",configurable:!0})),nP=Object.defineProperty,nE=(e,t)=>nP(e,"name",{value:t,configurable:!0});function nI(e,t){return w.useReducer((e,n)=>t[e][n]??e,e)}nE(nI,"useStateMachine");var nA=nE(e=>{let{present:t,children:n}=e,r=n_(t),o="function"==typeof n?n({present:r.isPresent}):w.Children.only(n),i=nT(r.ref,nz(o));return"function"==typeof n||r.isPresent?w.cloneElement(o,{ref:i}):null},"Presence");function n_(e){let[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),i=w.useRef("none"),a=w.useRef(void 0),[l,s]=nI(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{"mounted"===l?(i.current=a.current??nR(r.current),a.current=void 0):i.current="none"},[l]),tH(()=>{let t=r.current,n=o.current;if(n!==e){let r=i.current,l=nR(t);e?(a.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):n&&r!==l?s("ANIMATION_OUT"):s("UNMOUNT"),o.current=e}},[e,s]),tH(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=nE(i=>{let a=nR(r.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(s("ANIMATION_END"),!o.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),l=nE(e=>{e.target===t&&(i.current=nR(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,a.current=nR(t)}else r.current=null;n(e)},[])}}function nM(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function nT(...e){let t=w.useRef(e);return t.current=e,w.useCallback(e=>{let n=t.current,r=!1,o=n.map(t=>{let n=nM(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let t=o[e];"function"==typeof t?t():nM(n[e],null)}}},[])}function nR(e){return e?.animationName||"none"}function nz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}nE(n_,"usePresence"),nE(nM,"setRef"),nE(nT,"useStableComposedRefs"),nE(nR,"getAnimationName"),nE(nz,"getElementRef");var nD=Object.defineProperty,nL=(e,t)=>nD(e,"name",{value:t,configurable:!0}),nF=0,nU=null;function nH(){w.useEffect(()=>{nU||(nU={start:n$(),end:n$()});let{start:e,end:t}=nU;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),nF++,()=>{1===nF&&(nU?.start.remove(),nU?.end.remove(),nU=null),nF=Math.max(0,nF-1)}},[])}function n$(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}nL(function(e){return nH(),e.children},"FocusGuards"),nL(nH,"useFocusGuards"),nL(n$,"createFocusGuard");var nB=function(){return(nB=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function nK(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>t.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var nq="right-scroll-bar-position",nV="width-before-scroll-bar";function nW(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var nG="u">typeof window?w.useLayoutEffect:w.useEffect,nZ=new WeakMap,nY=(void 0===pa&&(pa={}),(void 0===pl&&(pl=function(e){return e}),ps=[],pc=!1,pu={read:function(){if(pc)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return ps.length?ps[ps.length-1]:null},useMedium:function(e){var t=pl(e,pc);return ps.push(t),function(){ps=ps.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(pc=!0;ps.length;){var t=ps;ps=[],t.forEach(e)}ps={push:function(t){return e(t)},filter:function(){return ps}}},assignMedium:function(e){pc=!0;var t=[];if(ps.length){var n=ps;ps=[],n.forEach(e),t=ps}var r=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(r)};o(),ps={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),ps}}}}).options=nB({async:!0,ssr:!1},pa),pu),nX=function(){},nJ=w.forwardRef(function(e,t){var n,r,o,i,a=w.useRef(null),l=w.useState({onScrollCapture:nX,onWheelCapture:nX,onTouchMoveCapture:nX}),s=l[0],c=l[1],u=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,g=e.noRelative,y=e.noIsolation,b=e.inert,x=e.allowPinchZoom,k=e.as,j=e.gapMode,S=nK(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=(n=[a,t],r=function(e){return n.forEach(function(t){return nW(t,e)})},(o=(0,w.useState)(function(){return{value:null,callback:r,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=r,i=o.facade,nG(function(){var e=nZ.get(i);if(e){var t=new Set(e),r=new Set(n),o=i.current;t.forEach(function(e){r.has(e)||nW(e,null)}),r.forEach(function(e){t.has(e)||nW(e,o)})}nZ.set(i,n)},[n]),i),C=nB(nB({},S),s);return w.createElement(w.Fragment,null,h&&w.createElement(v,{sideCar:nY,removeScrollBar:p,shards:m,noRelative:g,noIsolation:y,inert:b,setCallbacks:c,allowPinchZoom:!!x,lockRef:a,gapMode:j}),u?w.cloneElement(w.Children.only(d),nB(nB({},C),{ref:O})):w.createElement(void 0===k?"div":k,nB({},C,{className:f,ref:O}),d))});nJ.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nJ.classNames={fullWidth:nV,zeroRight:nq};var nQ=function(e){var t=e.sideCar,n=nK(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return w.createElement(r,nB({},n))};nQ.isSideCarExport=!0;var n0=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pp||d.nc;return t&&e.setAttribute("nonce",t),e}())){var r,o;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},n1=function(){var e=n0();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n2=function(){var e=n1();return function(t){return e(t.styles,t.dynamic),null}},n3={left:0,top:0,right:0,gap:0},n4=function(e){return parseInt(e||"",10)||0},n5=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[n4(n),n4(r),n4(o)]},n6=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return n3;var t=n5(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},n8=n2(),n9="data-scroll-locked",n7=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(n9,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(nq," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(nV," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(nq," .").concat(nq," {\n right: 0 ").concat(r,";\n }\n \n .").concat(nV," .").concat(nV," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(n9,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},re=function(){var e=parseInt(document.body.getAttribute(n9)||"0",10);return isFinite(e)?e:0},rt=function(){w.useEffect(function(){return document.body.setAttribute(n9,(re()+1).toString()),function(){var e=re()-1;e<=0?document.body.removeAttribute(n9):document.body.setAttribute(n9,e.toString())}},[])},rn=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;rt();var i=w.useMemo(function(){return n6(o)},[o]);return w.createElement(n8,{styles:n7(i,!t,o,n?"":"!important")})},rr=!1;if("u">typeof window)try{var ro=Object.defineProperty({},"passive",{get:function(){return rr=!0,!0}});window.addEventListener("test",ro,ro),window.removeEventListener("test",ro,ro)}catch(e){rr=!1}var ri=!!rr&&{passive:!1},ra=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},rl=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),rs(e,r)){var o=rc(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rs=function(e,t){return"v"===e?ra(t,"overflowY"):ra(t,"overflowX")},rc=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},ru=function(e,t,n,r,o){var i,a=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),l=a*r,s=n.target,c=t.contains(s),u=!1,d=l>0,f=0,p=0;do{if(!s)break;var h=rc(e,s),m=h[0],v=h[1]-h[2]-a*m;(m||v)&&rs(e,s)&&(f+=v,p+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return d&&(o&&1>Math.abs(f)||!o&&l>f)?u=!0:!d&&(o&&1>Math.abs(p)||!o&&-l>p)&&(u=!0),u},rd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rf=function(e){return[e.deltaX,e.deltaY]},rp=function(e){return e&&"current"in e?e.current:e},rh=0,rm=[];let rv=(pd=function(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(rh++)[0],i=w.useState(n2)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(rp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=w.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=rd(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],c="deltaY"in e?e.deltaY:l[1]-i[1],u=e.target,d=Math.abs(s)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var h=rl(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=rl(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(s||c)&&(r.current=o),!o)return!0;var m=r.current||o;return ru(m,t,e,"h"===m?s:c,!0)},[]),s=w.useCallback(function(e){if(rm.length&&rm[rm.length-1]===i){var n="deltaY"in e?rf(e):rd(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var o=(a.current.shards||[]).map(rp).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?l(e,o[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=w.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),u=w.useCallback(function(e){n.current=rd(e),r.current=void 0},[]),d=w.useCallback(function(t){c(t.type,rf(t),t.target,l(t,e.lockRef.current))},[]),f=w.useCallback(function(t){c(t.type,rd(t),t.target,l(t,e.lockRef.current))},[]);w.useEffect(function(){return rm.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,ri),document.addEventListener("touchmove",s,ri),document.addEventListener("touchstart",u,ri),function(){rm=rm.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,ri),document.removeEventListener("touchmove",s,ri),document.removeEventListener("touchstart",u,ri)}},[]);var p=e.removeScrollBar,h=e.inert;return w.createElement(w.Fragment,null,h?w.createElement(i,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,p?w.createElement(rn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},nY.useMedium(pd),nQ);var rg=w.forwardRef(function(e,t){return w.createElement(nJ,nB({},e,{ref:t,sideCar:rv}))});rg.classNames=nJ.classNames;var ry=new WeakMap,rb=new WeakMap,rx={},rw=0,rk=function(e){return e&&(e.host||rk(e.parentNode))},rj=function(e,t,n,r){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=rk(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});rx[n]||(rx[n]=new WeakMap);var i=rx[n],a=[],l=new Set,s=new Set(o),c=function(e){!e||l.has(e)||(l.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(ry.get(e)||0)+1,c=(i.get(e)||0)+1;ry.set(e,s),i.set(e,c),a.push(e),1===s&&o&&rb.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),l.clear(),rw++,function(){a.forEach(function(e){var t=ry.get(e)-1,o=i.get(e)-1;ry.set(e,t),i.set(e,o),t||(rb.has(e)||e.removeAttribute(r),rb.delete(e)),o||e.removeAttribute(n)}),--rw||(ry=new WeakMap,ry=new WeakMap,rb=new WeakMap,rx={})}},rS=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),rj(r,o,n,"aria-hidden")):function(){return null}},rO=Object.defineProperty,rC=(e,t)=>rO(e,"name",{value:t,configurable:!0}),rN="Dialog",[rP,rE]=tF(rN),[rI,rA]=rP(rN),r_=rC(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=w.useRef(null),s=w.useRef(null),[c,u]=tQ({prop:r,defaultProp:o??!1,onChange:i,caller:rN}),[d,f]=w.useState(0),[p,h]=w.useState(0);return(0,x.jsx)(rI,{scope:t,triggerRef:l,contentRef:s,contentId:tq(),titleId:tq(),descriptionId:tq(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(e=>!e),[u]),modal:a,children:n})},"Dialog"),rM=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,...r}=e,o=rA("DialogTrigger",n),i=T(t,o.triggerRef);return(0,x.jsx)(t5.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":rY(o.open),...r,ref:i,onClick:tT(e.onClick,o.onOpenToggle)})},"DialogTrigger")),rT="DialogPortal",[rR,rz]=rP(rT,{forceMount:void 0}),rD=rC(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=rA(rT,t);return(0,x.jsx)(rR,{scope:t,forceMount:n,children:w.Children.map(r,e=>(0,x.jsx)(nA,{present:n||i.open,children:(0,x.jsx)(nN,{asChild:!0,container:o,children:e})}))})},"DialogPortal"),rL="DialogOverlay",rF=w.forwardRef(rC(function(e,t){let n=rz(rL,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=rA(rL,e.__scopeDialog);return i.modal?(0,x.jsx)(nA,{present:r||i.open,children:(0,x.jsx)(rH,{...o,ref:t})}):null},"DialogOverlay")),rU=D("DialogOverlay.RemoveScroll"),rH=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,...r}=e,o=rA(rL,n),i=T(t,nr());return(0,x.jsx)(rg,{as:rU,allowPinchZoom:!0,shards:[o.contentRef],children:(0,x.jsx)(t5.div,{"data-state":rY(o.open),...r,ref:i,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),r$="DialogContent",rB=w.forwardRef(rC(function(e,t){let n=rz(r$,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=rA(r$,e.__scopeDialog);return(0,x.jsx)(nA,{present:r||i.open,children:i.modal?(0,x.jsx)(rK,{...o,ref:t}):(0,x.jsx)(rq,{...o,ref:t})})},"DialogContent")),rK=w.forwardRef(rC(function(e,t){let n=rA(r$,e.__scopeDialog),r=w.useRef(null),o=T(t,n.contentRef,r);return w.useEffect(()=>{let e=r.current;if(e)return rS(e)},[]),(0,x.jsx)(rV,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:tT(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:tT(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:tT(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),rq=w.forwardRef(rC(function(e,t){let n=rA(r$,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return(0,x.jsx)(rV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})},"DialogContentNonModal")),rV=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,l=rA(r$,n);return nH(),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(nh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,x.jsx)(nn,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":rY(l.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),rW=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,...r}=e,o=rA("DialogTitle",n),{setTitleCount:i}=o;return tH(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,x.jsx)(t5.h2,{id:o.titleId,...r,ref:t})},"DialogTitle")),rG=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,...r}=e,o=rA("DialogDescription",n),{setDescriptionCount:i}=o;return tH(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,x.jsx)(t5.p,{id:o.descriptionId,...r,ref:t})},"DialogDescription")),rZ=w.forwardRef(rC(function(e,t){let{__scopeDialog:n,...r}=e,o=rA("DialogClose",n);return(0,x.jsx)(t5.button,{type:"button",...r,ref:t,onClick:tT(e.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function rY(e){return e?"open":"closed"}rC(rY,"getState");let rX=P("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function rJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function rQ(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function r0(e){var t=e.className,n=rQ(e,["className"]);return(0,x.jsx)(rF,rJ({"data-slot":"dialog-overlay",className:tt("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function r1(e){var t,n,r=e.className,o=e.children,i=rQ(e,["className","children"]),a=(0,to.Bd)().t;return(0,x.jsxs)(rD,{children:[(0,x.jsx)(r0,{}),(0,x.jsxs)(rB,(t=rJ({"data-slot":"dialog-content",className:tt("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",r)},i),n=n={children:[o,(0,x.jsxs)(rZ,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-[opacity,background-color] hover:bg-accent hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 active:bg-accent/80 disabled:pointer-events-none",children:[(0,x.jsx)(rX,{className:"size-4"}),(0,x.jsx)("span",{className:"sr-only",children:a("common.closeDialog")})]})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))]})}function r2(e){var t=e.className,n=rQ(e,["className"]);return(0,x.jsx)("div",rJ({"data-slot":"dialog-header",className:tt("flex flex-col space-y-1.5 text-center sm:text-left",t)},n))}function r3(e){var t=e.className,n=rQ(e,["className"]);return(0,x.jsx)("div",rJ({"data-slot":"dialog-footer",className:tt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function r4(e){var t=e.className,n=rQ(e,["className"]);return(0,x.jsx)(rW,rJ({"data-slot":"dialog-title",className:tt("text-lg font-semibold leading-none tracking-tight",t)},n))}function r5(e){var t=e.className,n=rQ(e,["className"]);return(0,x.jsx)(rG,rJ({"data-slot":"dialog-description",className:tt("text-sm text-muted-foreground",t)},n))}function r6(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function r8(e,t,n){return(r8=on()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&oe(o,n.prototype),o}).apply(null,arguments)}function r9(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r7(e){return(r7=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ot(e){var t="function"==typeof Map?new Map:void 0;return(ot=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return r8(e,arguments,r7(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),oe(n,e)})(e)}function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(on=function(){return!!e})()}var or=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(e,n){var r,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=t,o=[n],r=r7(r),r9(i=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,on()?Reflect.construct(r,o||[],r7(this).constructor):r.apply(this,o)),"status",void 0),r9(i,"code",void 0),r9(i,"data",void 0),i.status=e,i.name="ApiError",i.code=a.code,i.data=a.data,i}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&oe(t,e),t}(ot(Error));function oo(){return"/api/harnesses"}function oi(e){return"".concat(oo(),"/").concat(e,"/profiles")}function oa(e,t){return"".concat(oi(e),"/").concat(encodeURIComponent(t))}function ol(e){return e?"/api/backups/".concat(encodeURIComponent(e)):"/api/backups"}function os(){return"/api/providers"}function oc(e){return"".concat(os(),"/").concat(encodeURIComponent(e))}function ou(e){return"".concat(oc(e),"/probe")}function od(e){return e?"/api/drift/".concat(encodeURIComponent(e)):"/api/drift"}function of(){return"/api/scan"}function op(e){return e?"/api/operations?harness=".concat(encodeURIComponent(e)):"/api/operations"}function oh(){return"/api/users"}var om="/api/version";function ov(e){var t;return(t=function(e){var t,n,r,o,i,a=arguments;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:var s,c;return(n=new Headers((t=a.length>1&&void 0!==a[1]?a[1]:{}).headers)).set("Accept-Language",to.Ru.language),t.body&&!n.has("Content-Type")&&n.set("Content-Type","application/json"),[4,fetch(e,(s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){r9(e,t,n[t])})}return e}({credentials:"include"},t),c=c={headers:n},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(c)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(c)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(c,e))}),s))];case 1:return[4,(r=l.sent()).json().catch(function(){return{}})];case 2:if(o=l.sent(),!r.ok)throw new or(r.status,null!=(i=o.msg)?i:"",{code:o.code,data:o.data});return[2,o]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){r6(i,r,o,a,l,"next",e)}function l(e){r6(i,r,o,a,l,"throw",e)}a(void 0)})}).apply(this,arguments)}var og=function(e){return"/api/model-favorites".concat(e?"/".concat(e):"")},oy=function(e){return"".concat(og(),"/").concat(encodeURIComponent(e))},ob=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return"".concat(og(),"/source/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)).concat(n?"/detach":"")},ox=function(){return"/api/model-favorite-plans"},ow=function(e){return"".concat(og("backups")).concat(e?"/".concat(encodeURIComponent(e),"/restore"):"")},ok=function(e,t){return"/api/tool-models/".concat(encodeURIComponent(e)).concat(t?"/".concat(t):"")};function oj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oS(e,t){return null!=t&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function oO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function oC(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function oN(e){return{key:(0,ta.Vz)(e.code),params:e.data,scope:e.scope}}function oP(e){return oS(e,or)&&e.code?oN({code:e.code,data:e.data}):{key:"error.unknown",fallback:oS(e,Error)?e.message:String(e)}}function oE(e,t){var n=oP(e);return"error.unknown"===n.key?oC(oO({},n),{key:t}):n}var oI=new Set(["drift.adoptFailed","drift.reapplyFailed","vault.deleteFailed","vault.saveFailed","vault.revealFailed","operations.undoFailed","import.failed","activate.loadFailed","backup.loadFailed","backup.diffFailed"]);function oA(e,t){if(t.fallback&&("error.unknown"===t.key||oI.has(t.key))){var n,r,o,i=null!=(o=t.fallback)?o:t.key;return t.scope?"".concat(t.scope,": ").concat(i):i}var a=Object.fromEntries(Object.entries(null!=(n=t.paramKeys)?n:{}).map(function(t){var n=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return oj(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oj(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[n[0],e(n[1])]})),l=e([t.key,"error.unknown"],oC(oO({},t.params,a),{defaultValue:null!=(r=t.fallback)?r:t.key}));return t.scope?"".concat(t.scope,": ").concat(l):l}function o_(e,t,n,r){return t?oA(e,{key:t,params:r,fallback:n}):n}function oM(e,t,n){return e(t,oO({},n))}function oT(e,t){return t.placeholderCode?oM(e,t.placeholderCode,t.params):t.placeholder}let oR=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e))},a=t=e(r,o,i);return i},oz=e=>{let t=e?oR(e):oR,n=e=>(function(e,t=e=>e){let n=w.useSyncExternalStore(e.subscribe,w.useCallback(()=>t(e.getState()),[e,t]),w.useCallback(()=>t(e.getInitialState()),[e,t]));return w.useDebugValue(n),n})(t,e);return Object.assign(n,t),n};function oD(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oL(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){oD(i,r,o,a,l,"next",e)}function l(e){oD(i,r,o,a,l,"throw",e)}a(void 0)})}}function oF(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var oU=function(e,t){return{backups:[],loadBackups:function(){return oL(function(){var t;return oF(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,ov(ol())];case 1:return e({backups:n.sent().items}),[3,3];case 2:var r;return r=t=n.sent(),(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?or[Symbol.hasInstance](r):r instanceof or)&&401===t.status||e({error:oP(t)}),[3,3];case 3:return[2]}})})()},loadBackupDetail:function(e){return oL(function(){return oF(this,function(t){return[2,ov(ol(e))]})})()},restoreBackup:function(n){return oL(function(){return oF(this,function(r){switch(r.label){case 0:return[4,ov("".concat(ol(n),"/restore"),{method:"POST"})];case 1:return r.sent(),e({notice:[{key:"backup.written"}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 2:return r.sent(),[2]}})})()}}};function oH(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function o$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oB(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){o$(e,t,n[t])})}return e}function oK(e,t,n){var r;return(r=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:e(oq(t,!0,null)),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n()];case 2:return e(oB({},o$({},t,o.sent()),oq(t,!1,null))),[3,4];case 3:var i;if(i=r=o.sent(),(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?!!or[Symbol.hasInstance](i):i instanceof or)&&401===r.status)return e(oB({authenticated:!1},o$({},t,"githubStatus"===t?null:[]),oq(t,!1,null))),[2];return e(oq(t,!1,oP(r))),[3,4];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){oH(i,n,o,a,l,"next",e)}function l(e){oH(i,n,o,a,l,"throw",e)}a(void 0)})})()}function oq(e,t,n){var r;return o$(r={},"".concat(e,"Loading"),t),o$(r,"".concat(e,"Error"),n),r}function oV(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oW(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){oV(i,r,o,a,l,"next",e)}function l(e){oV(i,r,o,a,l,"throw",e)}a(void 0)})}}function oG(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var oZ=function(e){return{githubStatus:null,githubStatusLoading:!1,githubStatusError:null,loadGithubStatus:function(){return oW(function(){return oG(this,function(t){switch(t.label){case 0:return[4,oK(e,"githubStatus",function(){return ov("/api/github/status")})];case 1:return t.sent(),[2]}})})()},setGithubStatus:function(t){e({githubStatus:t,githubStatusError:null})},disconnectGithub:function(){return oW(function(){return oG(this,function(t){switch(t.label){case 0:return[4,ov("/api/github/disconnect",{method:"POST"})];case 1:return t.sent(),e({githubStatus:{connected:!1},githubStatusError:null}),[2]}})})()}}};function oY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oX(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function oJ(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){oX(i,r,o,a,l,"next",e)}function l(e){oX(i,r,o,a,l,"throw",e)}a(void 0)})}}function oQ(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var o0=function(e,t){var n=function(n){return oJ(function(){return oQ(this,function(r){switch(r.label){case 0:return[4,ov(n,{method:"POST"})];case 1:var o;return e({notice:[{key:"notice.switchDone"}].concat(function(e){if(Array.isArray(e))return oY(e)}(o=r.sent().warnings.map(oN))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(o)||function(e){if(e){if("string"==typeof e)return oY(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oY(e,void 0)}}(o)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()};return{envFile:"",harnesses:[],loadHarnesses:function(){return oJ(function(){var n,r;return oQ(this,function(o){switch(o.label){case 0:e({loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,ov(oo())];case 2:return e({harnesses:(n=o.sent()).items,envFile:n.envFile,loading:!1}),[4,t().loadDrift()];case 3:return o.sent(),[3,5];case 4:var i;if(i=r=o.sent(),(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?!!or[Symbol.hasInstance](i):i instanceof or)&&401===r.status)return e({authenticated:!1,loading:!1,harnesses:[]}),[2];return e({loading:!1,error:oP(r)}),[3,5];case 5:return[2]}})})()},createProfile:function(e,n){return oJ(function(){return oQ(this,function(r){switch(r.label){case 0:return[4,ov(oi(e),{method:"POST",body:JSON.stringify(n)})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},updateProfile:function(e,n,r){return oJ(function(){return oQ(this,function(o){switch(o.label){case 0:return[4,ov(oa(e,n),{method:"PATCH",body:JSON.stringify(r)})];case 1:return o.sent(),[4,t().loadHarnesses()];case 2:return o.sent(),[2]}})})()},deleteProfile:function(e,n){return oJ(function(){return oQ(this,function(r){switch(r.label){case 0:return[4,ov(oa(e,n),{method:"DELETE"})];case 1:return r.sent(),[4,t().loadHarnesses()];case 2:return r.sent(),[2]}})})()},activateProfile:function(e,t){return oJ(function(){return oQ(this,function(r){switch(r.label){case 0:return[4,n("".concat(oa(e,t),"/activate"))];case 1:return r.sent(),[2]}})})()},activateOfficial:function(e){return oJ(function(){return oQ(this,function(t){switch(t.label){case 0:return[4,n("".concat(oo(),"/").concat(e,"/official/activate"))];case 1:return t.sent(),[2]}})})()},previewProfile:function(e,t){return oJ(function(){return oQ(this,function(n){switch(n.label){case 0:return[4,ov("".concat(oa(e,t),"/preview"))];case 1:return[2,n.sent().targets]}})})()},previewOfficial:function(e){return oJ(function(){return oQ(this,function(t){switch(t.label){case 0:return[4,ov("".concat(oo(),"/").concat(e,"/official/preview"))];case 1:return[2,t.sent().targets]}})})()}}};function o1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o2(e){return function(e){if(Array.isArray(e))return o1(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return o1(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o1(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o3(e,t,n){return o2((null!=e?e:[]).filter(function(e){return e.harness!==n})).concat(o2(t.filter(function(e){return e.harness===n})))}function o4(e,t){var n,r;return null!=(n=null==(r=e.harnesses.find(function(e){return e.id===t}))?void 0:r.label)?n:t}function o5(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function o6(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){o5(i,r,o,a,l,"next",e)}function l(e){o5(i,r,o,a,l,"throw",e)}a(void 0)})}}function o8(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var o9=function(e,t){return{doctor:null,doctorUpdatedAvailable:!1,doctorLoading:!1,doctorError:null,drift:null,driftLoading:!1,driftError:null,loadDoctor:function(n){return o6(function(){return o8(this,function(r){switch(r.label){case 0:return[4,oK(e,"doctor",function(){return o6(function(){var r;return o8(this,function(o){switch(o.label){case 0:return[4,ov(n?"/api/doctor?harness=".concat(encodeURIComponent(n)):"/api/doctor")];case 1:return e({doctorUpdatedAvailable:(r=o.sent()).updatedAvailable}),[2,o3(t().doctor,r.items,n)]}})})()})];case 1:return r.sent(),[2]}})})()},loadDrift:function(){return o6(function(){return o8(this,function(t){switch(t.label){case 0:return[4,oK(e,"drift",function(){return o6(function(){var e;return o8(this,function(t){switch(t.label){case 0:return[4,ov(od())];case 1:return[2,null!=(e=t.sent().items)?e:[]]}})})()})];case 1:return t.sent(),[2]}})})()},reapplyDrift:function(n){return o6(function(){var r;return o8(this,function(o){switch(o.label){case 0:return[4,ov("".concat(od(n),"/reapply"),{method:"POST"})];case 1:return r=o.sent(),e({notice:[{key:"drift.reapplied",params:{harness:o4(t(),n)}}]}),[4,t().loadDrift()];case 2:return o.sent(),[2,r.files]}})})()},adoptDrift:function(n){return o6(function(){var r;return o8(this,function(o){switch(o.label){case 0:return[4,ov("".concat(od(n),"/adopt"),{method:"POST"})];case 1:return r=o.sent(),e({notice:[{key:"drift.adopted",params:{harness:o4(t(),n)}}]}),[4,t().loadHarnesses()];case 2:return o.sent(),[2,r]}})})()}}};function o7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ie(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function it(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ie(i,r,o,a,l,"next",e)}function l(e){ie(i,r,o,a,l,"throw",e)}a(void 0)})}}function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ir(e,t,n[t])})}return e}function ii(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ia(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||il(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function il(e,t){if(e){if("string"==typeof e)return o7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o7(e,t)}}function is(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ic=function(e,t){var n=0,r=0;return{favoriteBackups:[],favoriteBackupPreview:null,previewFavoriteBackup:function(r){return it(function(){var o,i,a;return is(this,function(l){switch(l.label){case 0:return o=++n,i=t().currentUser,e({favoriteBackupPreview:null}),[4,ov("".concat(og("backups"),"/").concat(encodeURIComponent(r),"/preview"))];case 1:return a=l.sent(),i===t().currentUser&&o===n&&e({favoriteBackupPreview:a.data}),[2]}})})()},loadFavoriteBackups:function(){return it(function(){var n,r;return is(this,function(o){switch(o.label){case 0:return n=t().currentUser,[4,ov(ow())];case 1:return r=o.sent(),n===t().currentUser&&e({favoriteBackups:r.data}),[2]}})})()},createFavoriteBackup:function(){return it(function(){return is(this,function(e){switch(e.label){case 0:return[4,ov(ow(),{method:"POST"})];case 1:return e.sent(),[4,t().loadFavoriteBackups()];case 2:return e.sent(),[2]}})})()},restoreFavoriteBackup:function(o,i){return it(function(){var a;return is(this,function(l){switch(l.label){case 0:return n++,r++,a=t().currentUser,[4,ov(ow(o),{method:"POST",body:JSON.stringify({fingerprint:i})})];case 1:if(l.sent(),a!==t().currentUser)return[2];return e({favoritePlan:null,favoriteBackupPreview:null,favoriteOperation:null,favoriteOperationHistory:[],favoriteTargets:{},favoriteCatalogs:{}}),[4,Promise.all([t().loadFavoriteBackups(),t().loadFavorites(),t().loadHarnesses(),t().loadProviders(),t().loadBackups()])];case 2:return l.sent(),[2]}})})()},favoriteTargets:{},loadFavoriteTargets:function(n){return it(function(){var r,o;return is(this,function(i){switch(i.label){case 0:return r=t().currentUser,[4,ov("".concat(oy(n),"/targets"))];case 1:return o=i.sent(),r===t().currentUser&&e({favoriteTargets:ii(io({},t().favoriteTargets),ir({},n,o.data))}),[2]}})})()},favoriteCatalogs:{},loadFavoriteCatalog:function(n,r,o){return it(function(){var i,a,l,s,c;return is(this,function(u){switch(u.label){case 0:i=t().currentUser,a=new AbortController,l=setTimeout(function(){return a.abort()},25e3),s=o?AbortSignal.any([o,a.signal]):a.signal,u.label=1;case 1:return u.trys.push([1,,3,4]),[4,ov(ou(n),{method:"POST",body:JSON.stringify({endpoint:r,completion:!1}),signal:s})];case 2:return c=u.sent(),s.throwIfAborted(),t().currentUser===i&&e({favoriteCatalogs:ii(io({},t().favoriteCatalogs),ir({},"".concat(n,"/").concat(r),c.result))}),[2,c.result];case 3:return clearTimeout(l),[7];case 4:return[2]}})})()},favorites:null,favoritesLoading:!1,favoritesError:null,favoritePlan:null,favoriteOperation:null,favoriteOperationHistory:[],loadFavorites:function(){return it(function(){var n;return is(this,function(r){switch(r.label){case 0:if(t().favoritesLoading)return[2];return n=t().currentUser,[4,oK(e,"favorites",function(){return it(function(){var e;return is(this,function(r){switch(r.label){case 0:return[4,ov(og())];case 1:return e=r.sent(),[2,n===t().currentUser?e.data:t().favorites]}})})()})];case 1:return r.sent(),[2]}})})()},saveFavorite:function(e,n){return it(function(){var r,o;return is(this,function(i){switch(i.label){case 0:return r=n?ii(io({},e),{expectedRevision:n.revision}):e,[4,ov(n?oy(n.id):og(),{method:n?"PATCH":"POST",body:JSON.stringify(r)})];case 1:return o=i.sent(),[4,t().loadFavorites()];case 2:return i.sent(),[2,o.data]}})})()},deleteFavorite:function(e){return it(function(){return is(this,function(n){switch(n.label){case 0:return[4,ov(oy(e.id),{method:"DELETE",body:JSON.stringify({expectedRevision:e.revision})})];case 1:return n.sent(),[4,t().loadFavorites()];case 2:return n.sent(),[2]}})})()},captureFavorite:function(e,n,r,o,i){return it(function(){var a;return is(this,function(l){switch(l.label){case 0:return[4,ov(ob(e,n))];case 1:return a=l.sent(),[4,ov(og("from-profile"),{method:"POST",body:JSON.stringify(io({harness:e,name:n,favoriteName:r,extractCredential:o,linkSource:i},a.data))})];case 2:return l.sent(),[4,Promise.all([t().loadFavorites(),t().loadHarnesses(),t().loadProviders()])];case 3:return l.sent(),[2]}})})()},planFavorite:function(n){return it(function(){var o,i,a;return is(this,function(l){switch(l.label){case 0:return o=++r,i=t().currentUser,e({favoritePlan:null,favoriteOperation:null}),[4,ov(ox(),{method:"POST",body:JSON.stringify(n)})];case 1:return a=l.sent(),i===t().currentUser&&o===r&&e({favoritePlan:a.data}),[2]}})})()},applyFavorite:function(n){return it(function(){var o,i,a,l,s,c,u,d;return is(this,function(f){var p,h;switch(f.label){case 0:if(o=t().favoritePlan,i=t().currentUser,a=r,!o)return[2];l=function(){var e;return ov((e=o.id,"".concat(ox(),"/").concat(encodeURIComponent(e),"/apply")),{method:"POST",body:JSON.stringify({requestId:n})})},f.label=1;case 1:return f.trys.push([1,3,,7]),[4,l()];case 2:return s=f.sent(),[3,7];case 3:if(c=f.sent(),i!==t().currentUser||a!==r)return[2];if(p=c,(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?!or[Symbol.hasInstance](p):!(p instanceof or))||c.code!==ta.OQ.favoritePlanStale)return[3,5];return[4,l()];case 4:return s=f.sent(),[3,6];case 5:throw c;case 6:return[3,7];case 7:if(i!==t().currentUser||a!==r)return[2];return d=[["favorites.resultNoticeSaved",(u={requestId:s.data.requestId,items:o.items.map(function(e){var t;return null!=(t=s.data.items.find(function(t){return t.harness===e.harness}))?t:{harness:e.harness,profile:e.profile,status:"skipped"}})}).items.filter(function(e){var t;return"applied"===e.status&&(null==(t=o.items.find(function(t){return t.harness===e.harness}))?void 0:t.mode)==="save"}).length],["favorites.resultNoticeActivated",u.items.filter(function(e){var t;return"applied"===e.status&&(null==(t=o.items.find(function(t){return t.harness===e.harness}))?void 0:t.mode)==="activate"}).length],["favorites.resultNoticeUnchanged",u.items.filter(function(e){return"unchanged"===e.status}).length],["favorites.resultNoticeFailed",u.items.filter(function(e){return"failed"===e.status}).length],["favorites.resultNoticeSkipped",u.items.filter(function(e){return"skipped"===e.status}).length]],e({favoriteOperation:u,favoriteOperationHistory:((function(e){if(Array.isArray(e))return o7(e)})(h=t().favoriteOperationHistory.filter(function(e){return e.requestId!==n}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(h)||il(h)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([u]).slice(-10),notice:d.filter(function(e){return ia(e,2)[1]>0}).map(function(e){var t=ia(e,2);return{key:t[0],params:{count:t[1]}}})}),[4,Promise.all([t().loadFavorites(),t().loadHarnesses()])];case 8:if(f.sent(),i===t().currentUser&&a===r)return[2,u];return[2]}})})()},ignoreFavoriteUpdates:function(e){return it(function(){return is(this,function(n){switch(n.label){case 0:var r;return[4,ov((r=e.id,"".concat(oy(r),"/ignore-updates")),{method:"POST",body:JSON.stringify({expectedRevision:e.revision})})];case 1:return n.sent(),[4,Promise.all([t().loadFavorites(),t().loadHarnesses()])];case 2:return n.sent(),[2]}})})()},detachFavorite:function(e,n){return it(function(){var r;return is(this,function(o){switch(o.label){case 0:return[4,ov(ob(e,n))];case 1:return r=o.sent(),[4,ov(ob(e,n,!0),{method:"POST",body:JSON.stringify(r.data)})];case 2:return o.sent(),[4,Promise.all([t().loadFavorites(),t().loadHarnesses()])];case 3:return o.sent(),[2]}})})()},clearFavoritePlan:function(){r++,e({favoritePlan:null,favoriteOperation:null})}}},iu=function(e){return{notice:null,setNotice:function(t){return e({notice:t})},clearNotice:function(){return e({notice:null})}}};function id(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ip(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){id(i,r,o,a,l,"next",e)}function l(e){id(i,r,o,a,l,"throw",e)}a(void 0)})}}function ih(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var im=function(e,t){return{operations:null,operationsLoading:!1,operationsError:null,loadOperations:function(n){return ip(function(){return ih(this,function(r){switch(r.label){case 0:return[4,oK(e,"operations",function(){return ip(function(){var e;return ih(this,function(r){switch(r.label){case 0:return[4,ov(op(n))];case 1:return e=r.sent(),[2,o3(t().operations,e.items,n)]}})})()})];case 1:return r.sent(),[2]}})})()},undoOperation:function(n){return ip(function(){var r;return ih(this,function(o){switch(o.label){case 0:return[4,ov("".concat(op(),"/").concat(encodeURIComponent(n),"/undo"),{method:"POST"})];case 1:return r=o.sent().receipt,e({notice:[{key:"operations.undone",params:{harness:o4(t(),r.harness)}}]}),[4,Promise.all([t().loadHarnesses(),t().loadBackups(),t().loadOperations(r.harness)])];case 2:return o.sent(),[2]}})})()}}};function iv(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ig(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iv(i,r,o,a,l,"next",e)}function l(e){iv(i,r,o,a,l,"throw",e)}a(void 0)})}}function iy(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var ib=function(){return{probeDraft:function(e){return ig(function(){return iy(this,function(t){return[2,ix("/api/probe",e)]})})()},probeProfile:function(e,t,n){return ig(function(){return iy(this,function(r){return[2,ix("".concat(oa(e,t),"/probe"),null!=n?n:{})]})})()},probeVaultEntry:function(e,t){return ig(function(){return iy(this,function(n){return[2,ix(ou(e),null!=t?t:{})]})})()}}};function ix(e,t){return ig(function(){return iy(this,function(n){switch(n.label){case 0:return[4,ov(e,{method:"POST",body:JSON.stringify(t)})];case 1:return[2,n.sent().result]}})})()}function iw(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ik(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iw(i,r,o,a,l,"next",e)}function l(e){iw(i,r,o,a,l,"throw",e)}a(void 0)})}}function ij(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var iS=function(e,t){return{providers:null,providersLoading:!1,providersError:null,loadProviders:function(){return ik(function(){return ij(this,function(t){switch(t.label){case 0:return[4,oK(e,"providers",function(){return ik(function(){return ij(this,function(e){switch(e.label){case 0:return[4,ov(os())];case 1:return[2,e.sent().items]}})})()})];case 1:return t.sent(),[2]}})})()},createProvider:function(e){return ik(function(){var n;return ij(this,function(r){switch(r.label){case 0:return[4,ov(os(),{method:"POST",body:JSON.stringify(e)})];case 1:return n=r.sent(),[4,t().loadProviders()];case 2:return r.sent(),[2,n.provider]}})})()},updateProvider:function(e,n){return ik(function(){var r;return ij(this,function(o){switch(o.label){case 0:return[4,ov(oc(e),{method:"PATCH",body:JSON.stringify(n)})];case 1:return r=o.sent(),[4,t().loadProviders()];case 2:return o.sent(),[4,t().loadHarnesses()];case 3:return o.sent(),[4,t().loadDrift()];case 4:return o.sent(),[2,r]}})})()},deleteProvider:function(e){return ik(function(){return ij(this,function(n){switch(n.label){case 0:return[4,ov(oc(e),{method:"DELETE"})];case 1:return n.sent(),[4,t().loadProviders()];case 2:return n.sent(),[2]}})})()},revealProvider:function(e){return ik(function(){return ij(this,function(t){return[2,ov("".concat(oc(e),"/reveal"))]})})()}}};function iO(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function iC(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iO(i,r,o,a,l,"next",e)}function l(e){iO(i,r,o,a,l,"throw",e)}a(void 0)})}}function iN(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var iP=function(e,t){return{scan:null,scanLoading:!1,scanError:null,loadScan:function(){return iC(function(){return iN(this,function(t){switch(t.label){case 0:return[4,oK(e,"scan",function(){return iC(function(){return iN(this,function(e){switch(e.label){case 0:return[4,ov(of())];case 1:return[2,e.sent().items]}})})()})];case 1:return t.sent(),[2]}})})()},importScan:function(e){return iC(function(){var n;return iN(this,function(r){switch(r.label){case 0:return[4,ov("".concat(of(),"/import"),{method:"POST",body:JSON.stringify({selections:e})})];case 1:return n=r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadProviders(),t().loadScan()])];case 2:return r.sent(),[2,n]}})})()}}};function iE(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function iI(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iE(i,r,o,a,l,"next",e)}function l(e){iE(i,r,o,a,l,"throw",e)}a(void 0)})}}function iA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function i_(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var iM={toolModels:[],toolModelsDrafts:{},toolModelsPreview:null,toolModelsLoading:!1,toolModelsError:null,favoriteCatalogs:{},favoriteBackups:[],favoriteBackupPreview:null,favoriteTargets:{},favoriteOperationHistory:[],favorites:null,favoritePlan:null,favoriteOperation:null,favoritesError:null,favoritesLoading:!1,harnesses:[],backups:[],envFile:"",providers:null,doctor:null,doctorUpdatedAvailable:!1,drift:null},iT=function(e,t){return{sessionChecked:!1,authenticated:!1,currentUser:"",users:[],usersLoading:!1,loading:!1,error:null,loadSession:function(){return iI(function(){var n;return i_(this,function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),[4,ov("/api/auth/session")];case 1:return e({authenticated:!0,sessionChecked:!0,currentUser:r.sent().currentUser,error:null}),[4,t().loadUsers()];case 2:return r.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 3:return r.sent(),[4,t().loadDrift()];case 4:return r.sent(),[3,6];case 5:var o;return e({authenticated:!1,sessionChecked:!0,error:(o=n=r.sent(),(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?!!or[Symbol.hasInstance](o):o instanceof or)&&401===n.status)?null:oP(n)}),[3,6];case 6:return[2]}})})()},login:function(n){return iI(function(){var r;return i_(this,function(o){switch(o.label){case 0:e({loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,ov("/api/auth/login",{method:"POST",body:JSON.stringify({password:n})})];case 2:return e({authenticated:!0,loading:!1,currentUser:o.sent().currentUser}),[4,t().loadUsers()];case 3:return o.sent(),[4,t().loadHarnesses()];case 4:return o.sent(),[3,6];case 5:throw e({loading:!1,error:oP(r=o.sent())}),r;case 6:return[2]}})})()},logout:function(){return iI(function(){return i_(this,function(t){switch(t.label){case 0:return[4,ov("/api/auth/logout",{method:"POST"})];case 1:return t.sent(),e(iA({authenticated:!1,currentUser:"",users:[]},iM)),[2]}})})()},changePassword:function(e,t){return iI(function(){return i_(this,function(n){switch(n.label){case 0:return[4,ov("/api/auth/password",{method:"POST",body:JSON.stringify({currentPassword:e,newPassword:t})})];case 1:return n.sent(),[2]}})})()},loadUsers:function(){return iI(function(){var t;return i_(this,function(n){switch(n.label){case 0:e({usersLoading:!0}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,ov(oh())];case 2:return e({users:(t=n.sent()).items,currentUser:t.currentUser,usersLoading:!1}),[3,4];case 3:return e({usersLoading:!1,error:oP(n.sent())}),[3,4];case 4:return[2]}})})()},switchUser:function(n){return iI(function(){var r;return i_(this,function(o){switch(o.label){case 0:if(!n||n===t().currentUser)return[2];e({usersLoading:!0,loading:!0,error:null}),o.label=1;case 1:return o.trys.push([1,5,,6]),[4,ov("".concat(oh(),"/").concat(encodeURIComponent(n),"/select"),{method:"POST"})];case 2:return o.sent(),e(iA({currentUser:n},iM)),[4,t().loadUsers()];case 3:return o.sent(),[4,Promise.all([t().loadHarnesses(),t().loadBackups()])];case 4:return o.sent(),e({usersLoading:!1,loading:!1}),[3,6];case 5:throw e({usersLoading:!1,loading:!1,error:oP(r=o.sent())}),r;case 6:return[2]}})})()}}};function iR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iz(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function iD(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){iz(i,r,o,a,l,"next",e)}function l(e){iz(i,r,o,a,l,"throw",e)}a(void 0)})}}function iL(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){iL(e,t,n[t])})}return e}function iU(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function iH(e){return function(e){if(Array.isArray(e))return iR(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return iR(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return iR(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i$(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var iB=function(e,t){var n=0;return{toolModelsDrafts:{},editToolModelsDraft:function(n,r){return e({toolModelsDrafts:iU(iF({},t().toolModelsDrafts),iL({},n,r))})},toolModels:[],toolModelsLoading:!1,toolModelsError:null,toolModelsPreview:null,loadToolModels:function(n){return iD(function(){var r;return i$(this,function(o){switch(o.label){case 0:return r=t().currentUser,[4,oK(e,"toolModels",function(){return iD(function(){var e;return i$(this,function(o){switch(o.label){case 0:return[4,ov(ok(n))];case 1:return e=o.sent(),[2,r===t().currentUser?iH(t().toolModels.filter(function(e){return e.harness!==n})).concat([{harness:n,state:e.data}]):t().toolModels]}})})()})];case 1:return o.sent(),[2]}})})()},saveToolModels:function(n,r){return iD(function(){var o,i;return i$(this,function(a){switch(a.label){case 0:return o=t().currentUser,[4,ov(ok(n),{method:"PUT",body:JSON.stringify(r)})];case 1:return i=a.sent(),o===t().currentUser&&e({toolModelsDrafts:iU(iF({},t().toolModelsDrafts),iL({},n,void 0)),toolModels:iH(t().toolModels.filter(function(e){return e.harness!==n})).concat([{harness:n,state:i.data}]),toolModelsPreview:null}),[2]}})})()},previewToolModels:function(r,o){return iD(function(){var i,a,l;return i$(this,function(s){switch(s.label){case 0:return i=t().currentUser,a=++n,e({toolModelsPreview:null}),[4,ov(ok(r,"preview"),{method:"POST",body:JSON.stringify(o)})];case 1:return l=s.sent(),i===t().currentUser&&a===n&&e({toolModelsPreview:l.data}),[2]}})})()},applyToolModels:function(n,r){return iD(function(){var o,i;return i$(this,function(a){switch(a.label){case 0:return o=t().currentUser,[4,ov(ok(n,"apply"),{method:"POST",body:JSON.stringify({planId:r})})];case 1:if(i=a.sent(),o!==t().currentUser)return[2];return e({toolModelsDrafts:iU(iF({},t().toolModelsDrafts),iL({},n,void 0)),toolModels:iH(t().toolModels.filter(function(e){return e.harness!==n})).concat([{harness:n,state:i.data}]),toolModelsPreview:null}),[4,Promise.all([t().loadHarnesses(),t().loadFavorites(),t().loadBackups()])];case 2:return a.sent(),[2]}})})()},clearToolModelsPreview:function(){n++,e({toolModelsPreview:null})}}};function iK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iq(e){return function(e){if(Array.isArray(e))return iK(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return iK(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return iK(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var iV=(t?oz(t):oz)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},iT.apply(void 0,iq(t)),iB.apply(void 0,iq(t)),ic.apply(void 0,iq(t)),o0.apply(void 0,iq(t)),oU.apply(void 0,iq(t)),iS.apply(void 0,iq(t)),ib.apply(void 0,iq(t)),o9.apply(void 0,iq(t)),iP.apply(void 0,iq(t)),im.apply(void 0,iq(t)),oZ.apply(void 0,iq(t)),iu.apply(void 0,iq(t)))});function iW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return iW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iW(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iZ(e){var t,n=e.harnessId,r=(0,to.s9)().locale,o=(0,to.Bd)().t,i=iV(function(e){return e.backups}),a=iV(function(e){return e.loadBackups}),l=iV(function(e){return e.loadBackupDetail}),s=iV(function(e){return e.restoreBackup}),c=iG((0,w.useState)(!1),2),u=c[0],d=c[1],f=iG((0,w.useState)(null),2),p=f[0],h=f[1],m=iG((0,w.useState)(null),2),v=m[0],g=m[1],y=iG((0,w.useState)(null),2),b=y[0],k=y[1],j=iG((0,w.useState)(!1),2),S=j[0],O=j[1],C=i.filter(function(e){return e.harness===n}),N=null!=(t=i.find(function(e){return e.id===p}))?t:null,P=ta.RP[n];return(0,w.useEffect)(function(){a()},[a]),(0,w.useEffect)(function(){d(!1),h(null)},[n]),(0,w.useEffect)(function(){if(!p){g(null),k(null),O(!1);return}var e=!1;return g(null),k(null),O(!0),l(p).then(function(t){e||g(t)}).catch(function(t){e||k(oE(t,"backup.diffFailed"))}).finally(function(){e||O(!1)}),function(){e=!0}},[p,l]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(tr,{className:"w-full justify-between",size:"sm",variant:"outline",onClick:function(){return d(!0)},children:[(0,x.jsx)(ts,{}),o("backup.history"),C.length>0?(0,x.jsx)(tb,{variant:"secondary",children:C.length}):null]}),(0,x.jsx)(r_,{open:u,onOpenChange:d,children:(0,x.jsxs)(r1,{className:"max-w-xl",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:o("backup.historyTitle",{harness:P})}),(0,x.jsx)(r5,{children:o("backup.historyIntro")})]}),0===C.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:o("backup.empty")}):(0,x.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:C.map(function(e){var t,n,i;return(0,x.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-muted/30",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,x.jsx)("p",{className:"truncate text-sm font-medium",children:e.profile}),e.current?(0,x.jsx)(tb,{children:o("backup.currentBadge")}):null]}),(0,x.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(t=e.createdAt,n=r,Number.isNaN((i=new Date(t)).getTime())?t:i.toLocaleString(n))," \xb7"," ",o("backup.fileCount",{count:e.files.length}),e.files.some(function(e){return!e.existed})?" \xb7 ".concat(o("backup.withDeletions")):""]})]}),e.current?null:(0,x.jsx)(tr,{size:"sm",variant:"outline",className:"shrink-0",onClick:function(){return h(e.id)},children:o("backup.restore")})]},e.id)})})]})}),(0,x.jsx)(r_,{open:null!==N,onOpenChange:function(e){return!e&&h(null)},children:(0,x.jsxs)(r1,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:o("backup.restoreHistoryTitle")}),(0,x.jsx)(r5,{children:o("backup.restoreHistoryBody")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[S?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:o("backup.comparing")}):null,b?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-destructive",children:oA(o,b)}):null,v?(0,x.jsx)(tN,{files:v.files}):null]}),(0,x.jsxs)(r3,{children:[(0,x.jsx)(tr,{variant:"outline",onClick:function(){return h(null)},children:o("common.cancel")}),(0,x.jsx)(tr,{disabled:S||null!==b||null===v,onClick:function(){p&&s(p).then(function(){h(null),d(!1)})},children:o("backup.confirmRestore")})]})]})})]})}function iY(e){var t=e.className;return(0,x.jsxs)("span",{"aria-hidden":"true",className:tt("relative inline-block size-6 overflow-hidden rounded-[26%]",t),children:[(0,x.jsx)("img",{alt:"",className:"size-full object-cover dark:hidden",draggable:!1,src:"/brand-mark-light.png"}),(0,x.jsx)("img",{alt:"",className:"hidden size-full object-cover dark:block",draggable:!1,src:"/brand-mark-dark.png"})]})}var iX=Object.defineProperty,iJ=w.forwardRef(iX(function(e,t){return(0,x.jsx)(t5.label,{...e,ref:t,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}));function iQ(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className"]);return(0,x.jsx)(iJ,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"label",className:tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t)},n))}function i0(e){var t=e.id,n=e.label,r=e.error,o=e.hint,i=e.className,a=e.labelClassName,l=e.children;return(0,x.jsxs)("div",{className:tt("space-y-2",i),children:[(0,x.jsx)(iQ,{htmlFor:t,className:a,children:n}),l(i1(t,r)),(0,x.jsx)(i2,{id:t,children:r}),o?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o}):null]})}function i1(e,t){return{id:e,"aria-invalid":!!t||void 0,"aria-describedby":t?i3(e):void 0}}function i2(e){var t=e.id,n=e.children;return n?(0,x.jsx)("p",{id:i3(t),className:"text-xs text-destructive",children:n}):null}function i3(e){return"".concat(e,"-error")}function i4(e){var t=e.className,n=e.type,r=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className","type"]);return(0,x.jsx)("input",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({type:n,"data-slot":"input",className:tt("flex h-10 w-full rounded-[10px] border border-input bg-card px-3 py-1 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},r))}function i5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i6(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function i8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i9(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i8(e,t,n[t])})}return e}function i7(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ae(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function at(e){var t=e.open,n=e.onOpenChange,r=(0,to.Bd)().t,o=iV(function(e){return e.changePassword}),i=iV(function(e){return e.setNotice}),a=ae((0,w.useState)({current:"",next:"",confirm:""}),2),l=a[0],s=a[1],c=ae((0,w.useState)({}),2),u=c[0],d=c[1],f=ae((0,w.useState)(!1),2),p=f[0],h=f[1],m=function(e,t){s(function(n){return i7(i9({},n),i8({},e,t))}),d(function(t){return t[e]?i7(i9({},t),i8({},e,void 0)):t})},v=function(){var e={};return l.next.length<ta.b1.minPassword?e.next={key:"error.auth.passwordTooShort",params:{count:ta.b1.minPassword}}:l.next===l.current&&(e.next={key:"error.auth.passwordUnchanged"}),l.confirm!==l.next&&(e.confirm={key:"account.password.mismatch"}),e};return(0,x.jsx)(r_,{open:t,onOpenChange:n,children:(0,x.jsxs)(r1,{className:"sm:max-w-md",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:r("account.password.title")}),(0,x.jsx)(r5,{children:r("account.password.intro")})]}),(0,x.jsxs)("form",{className:"space-y-4",onSubmit:function(e){var t;return(t=function(){var t,r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:if(e.preventDefault(),Object.keys(t=v()).length>0)return d(t),[2];h(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,o(l.current,l.next)];case 2:return a.sent(),i([{key:"account.password.changed"}]),n(!1),[3,5];case 3:return d(i8({},"error.auth.passwordChangeRejected"===(r=oP(a.sent())).key?"current":"next",r)),[3,5];case 4:return h(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){i6(i,r,o,a,l,"next",e)}function l(e){i6(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[(0,x.jsx)(i0,{id:"current-password",label:r("account.password.current"),error:u.current?oA(r,u.current):void 0,children:function(e){return(0,x.jsx)(i4,i7(i9({},e),{type:"password",autoComplete:"current-password",autoFocus:!0,maxLength:ta.b1.apiKey,value:l.current,onChange:function(e){return m("current",e.target.value)}}))}}),(0,x.jsx)(i0,{id:"new-password",label:r("account.password.next"),hint:r("account.password.hint",{count:ta.b1.minPassword}),error:u.next?oA(r,u.next):void 0,children:function(e){return(0,x.jsx)(i4,i7(i9({},e),{type:"password",autoComplete:"new-password",maxLength:ta.b1.apiKey,value:l.next,onChange:function(e){return m("next",e.target.value)}}))}}),(0,x.jsx)(i0,{id:"confirm-password",label:r("account.password.confirm"),error:u.confirm?oA(r,u.confirm):void 0,children:function(e){return(0,x.jsx)(i4,i7(i9({},e),{type:"password",autoComplete:"new-password",maxLength:ta.b1.apiKey,value:l.confirm,onChange:function(e){return m("confirm",e.target.value)}}))}}),(0,x.jsxs)(r3,{children:[(0,x.jsx)(tr,{type:"button",variant:"outline",onClick:function(){return n(!1)},children:r("common.cancel")}),(0,x.jsx)(tr,{type:"submit",disabled:p,children:r(p?"account.password.submitting":"account.password.submit")})]})]})]})})}let an=P("file-search",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]),ar=P("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),ao=P("file-lock-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v1",key:"jmtmu2"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"5",x:"2",y:"13",rx:"1",key:"10y5wo"}],["path",{d:"M8 13v-2a2 2 0 1 0-4 0v2",key:"1pdxzg"}]]),ai=P("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]),aa=P("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),al=P("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var as=Object.defineProperty,ac=(e,t)=>as(e,"name",{value:t,configurable:!0}),[au,ad]=tF("AlertDialog",[rE]),af=rE(),ap=ac(e=>{let{__scopeAlertDialog:t,...n}=e,r=af(t);return(0,x.jsx)(r_,{...r,...n,modal:!0})},"AlertDialog");w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=af(n);return(0,x.jsx)(rM,{...o,...r,ref:t})},"AlertDialogTrigger"));var ah=ac(e=>{let{__scopeAlertDialog:t,...n}=e,r=af(t);return(0,x.jsx)(rD,{...r,...n})},"AlertDialogPortal"),am=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=af(n);return(0,x.jsx)(rF,{...o,...r,ref:t})},"AlertDialogOverlay")),[av,ag]=au("AlertDialogContent"),ay=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,children:r,...o}=e,i=af(n),a=T(t,w.useRef(null)),l=w.useRef(null);return(0,x.jsx)(av,{scope:n,cancelRef:l,children:(0,x.jsx)(rB,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:tT(o.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},"AlertDialogContent")),ab=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=af(n);return(0,x.jsx)(rW,{...o,...r,ref:t})},"AlertDialogTitle")),ax=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=af(n);return(0,x.jsx)(rG,{...o,...r,ref:t})},"AlertDialogDescription")),aw=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,o=af(n);return(0,x.jsx)(rZ,{...o,...r,ref:t})},"AlertDialogAction")),ak=w.forwardRef(ac(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=ag("AlertDialogCancel",n),i=af(n),a=T(t,o);return(0,x.jsx)(rZ,{...i,...r,ref:a})},"AlertDialogCancel"));function aj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function aS(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function aO(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)(am,aj({"data-slot":"alert-dialog-overlay",className:tt("fixed inset-0 z-50 bg-black/70 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t)},n))}function aC(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsxs)(ah,{children:[(0,x.jsx)(aO,{}),(0,x.jsx)(ay,aj({"data-slot":"alert-dialog-content",className:tt("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-card p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-2xl",t)},n))]})}function aN(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)("div",aj({className:tt("flex flex-col space-y-2 text-center sm:text-left",t)},n))}function aP(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)("div",aj({className:tt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},n))}function aE(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)(ab,aj({className:tt("text-lg font-semibold",t)},n))}function aI(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)(ax,aj({className:tt("text-sm text-muted-foreground",t)},n))}function aA(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)(aw,aj({className:tt(tn(),t)},n))}function a_(e){var t=e.className,n=aS(e,["className"]);return(0,x.jsx)(ak,aj({className:tt(tn({variant:"outline"}),"mt-2 sm:mt-0",t)},n))}function aM(e){let[t,n]=w.useState(void 0);return tH(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(aM,"name",{value:"useSize",configurable:!0});var aT=Object.defineProperty,aR=(e,t)=>aT(e,"name",{value:t,configurable:!0}),az="Checkbox",[aD,aL]=tF(az),[aF,aU]=aD(az);function aH(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:l,onCheckedChange:s,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,p]=tQ({prop:n,defaultProp:o??!1,onChange:s,caller:az}),[h,m]=w.useState(null),[v,g]=w.useState(null),y=w.useRef(!1),[b,k]=w.useReducer(e=>e+1,0),j=!h||!!a||!!h.closest("form"),S={checked:f,disabled:i,setChecked:p,control:h,setControl:m,name:l,form:a,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:k,required:c,defaultChecked:!aW(o)&&o,isFormControl:j,bubbleInput:v,setBubbleInput:g};return(0,x.jsx)(aF,{scope:t,...S,children:aV(d)?d(S):r})}aR(aH,"CheckboxProvider");var a$=w.forwardRef(aR(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o){let{control:i,value:a,disabled:l,checked:s,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:m}=aU("CheckboxTrigger",e),v=T(o,u),g=w.useRef(s);return w.useEffect(()=>{let e=i?.form;if(e){let t=aR(()=>d(g.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,d]),(0,x.jsx)(t5.button,{type:"button",role:"checkbox","aria-checked":aW(s)?"mixed":s,"aria-required":c,"data-state":aG(s),"data-disabled":l?"":void 0,disabled:l,value:a,...r,ref:v,onKeyDown:tT(t,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:tT(n,e=>{p(),d(e=>!!aW(e)||!e),m&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},"CheckboxTrigger")),aB=w.forwardRef(aR(function(e,t){let{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:l,value:s,onCheckedChange:c,form:u,...d}=e;return(0,x.jsx)(aH,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:l,required:a,onCheckedChange:c,name:r,form:u,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a$,{...d,ref:t,__scopeCheckbox:n}),e&&(0,x.jsx)(aq,{__scopeCheckbox:n})]})})},"Checkbox")),aK=w.forwardRef(aR(function(e,t){let{__scopeCheckbox:n,forceMount:r,...o}=e,i=aU("CheckboxIndicator",n);return(0,x.jsx)(nA,{present:r||aW(i.checked)||!0===i.checked,children:(0,x.jsx)(t5.span,{"data-state":aG(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),aq=w.forwardRef(aR(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:o,hasConsumerStoppedPropagationRef:i,userInteractionCount:a,checked:l,defaultChecked:s,required:c,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:m}=aU("CheckboxBubbleInput",e),v=T(r,m),g=aM(o),y=w.useRef(!1),b=w.useRef(l),k=w.useRef(a);w.useEffect(()=>{if(!h)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=a!==k.current;k.current=a;let n=b.current!==l;b.current=l;let r=!(t&&i.current);if(n&&e){y.current=!t;let n=new Event("click",{bubbles:r});h.indeterminate=aW(l),e.call(h,!aW(l)&&l),h.dispatchEvent(n),y.current=!1}},[h,l,i,a]);let j=w.useRef(!aW(l)&&l);return(0,x.jsx)(t5.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:c,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:v,onClick:tT(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function aV(e){return"function"==typeof e}function aW(e){return"indeterminate"===e}function aG(e){return aW(e)?"indeterminate":e?"checked":"unchecked"}aR(aV,"isFunction"),aR(aW,"isIndeterminate"),aR(aG,"getState");let aZ=P("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),aY=P("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function aX(e){var t,n,r=e.className,o=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className"]);return(0,x.jsx)(aB,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"checkbox",className:tt("peer size-4 shrink-0 cursor-pointer rounded-[5px] border border-input bg-card shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",r)},o),n=n={children:(0,x.jsx)(aK,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:"indeterminate"===o.checked?(0,x.jsx)(aZ,{className:"size-3",strokeWidth:3.5}):(0,x.jsx)(aY,{className:"size-3",strokeWidth:3.5})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function aJ(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(aJ,"name",{value:"clamp",configurable:!0});var aQ=Object.defineProperty,a0=(e,t)=>aQ(e,"name",{value:t,configurable:!0});function a1(e){let t=e+"CollectionProvider",[n,r]=tF(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=a0(e=>{let{scope:t,children:n}=e,r=w.useRef(null),i=w.useRef(new Map).current;return(0,x.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},"CollectionProvider");a.displayName=t;let l=e+"CollectionSlot",s=D(l),c=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=T(t,i(l,n).collectionRef);return(0,x.jsx)(s,{ref:o,children:r})});c.displayName=l;let u=e+"CollectionItemSlot",d="data-radix-collection-item",f=D(u),p=w.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,a=w.useRef(null),l=T(t,a),s=i(u,n);return w.useEffect(()=>(s.itemMap.set(a,{ref:a,...o}),()=>void s.itemMap.delete(a))),(0,x.jsx)(f,{...{[d]:""},ref:l,children:r})});function h(t){let n=i(e+"CollectionConsumer",t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return p.displayName=u,a0(h,"useCollection"),[{Provider:a,Slot:c,ItemSlot:p},h,r]}a0(a1,"createCollection");var a2=new WeakMap,a3=class e extends Map{static{a0(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],a2.set(this,!0)}set(e,t){return a2.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,o=this.has(t),i=this.#e.length,a=a6(e),l=a>=0?a:i+a,s=l<0||l>=i?-1:l;if(s===this.size||o&&s===this.size-1||-1===s)return this.set(t,n),this;let c=this.size+ +!o;a<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e<c;e++)if(l===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),r=this.get(i),this.set(t,n)}else{d||u[e-1]!==t||(d=!0);let n=u[d?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=a4(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=a4(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return a4(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(...e){let[t,n]=e,r=0,o=n??this.at(0);for(let n of this)o=0===r&&1===e.length?n:Reflect.apply(t,this,[o,n,r,this]),r++;return o}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let o=this.at(n);r=n===this.size-1&&1===e.length?o:Reflect.apply(t,this,[r,o,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function a4(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=a5(e,t);return -1===n?void 0:e[n]}function a5(e,t){let n=e.length,r=a6(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function a6(e){return e!=e||0===e?0:Math.trunc(e)}function a8(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function a9(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function a7(e,t){return e[1].element&&t[1].element?a9(e[1].element,t[1].element)?-1:1:0}function le(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}a0(a4,"at"),a0(a5,"toSafeIndex"),a0(a6,"toSafeInteger"),a0(function(e){let t=e+"CollectionProvider",[n,r]=tF(t),[o,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new a3,setItemMap:a0(()=>void 0,"setItemMap")}),a=a0(({state:e,...t})=>e?(0,x.jsx)(s,{...t,state:e}):(0,x.jsx)(l,{...t}),"CollectionProvider");a.displayName=t;let l=a0(e=>{let t=m();return(0,x.jsx)(s,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let s=a0(e=>{let{scope:t,children:n,state:r}=e,i=w.useRef(null),[a,l]=w.useState(null),s=T(i,l),[c,u]=r;return w.useEffect(()=>{if(!a)return;let e=le(()=>{});return e.observe(a,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[a]),(0,x.jsx)(o,{scope:t,itemMap:c,setItemMap:u,collectionRef:s,collectionRefObject:i,collectionElement:a,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let c=e+"CollectionSlot",u=D(c),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=T(t,i(c,n).collectionRef);return(0,x.jsx)(u,{ref:o,children:r})});d.displayName=c;let f=e+"CollectionItemSlot",p=D(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,a=w.useRef(null),[l,s]=w.useState(null),c=T(t,a,s),{setItemMap:u}=i(f,n),d=w.useRef(o);a8(d.current,o)||(d.current=o);let h=d.current;return w.useEffect(()=>(u(e=>l?e.has(l)?e.set(l,{...h,element:l}).toSorted(a7):(e.set(l,{...h,element:l}),e.toSorted(a7)):e),()=>{u(e=>l&&e.has(l)?(e.delete(l),new a3(e)):e)}),[l,h,u]),(0,x.jsx)(p,{"data-radix-collection-item":"",ref:c,children:r})});function m(){return w.useState(new a3)}function v(t){let{itemMap:n}=i(e+"CollectionConsumer",t);return n}return h.displayName=f,a0(m,"useInitCollection"),a0(v,"useCollection"),[{Provider:a,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:v,useInitCollection:m}]},"createCollection"),a0(a8,"shallowEqual"),a0(a9,"isElementPreceding"),a0(a7,"sortByDocumentPosition"),a0(le,"getChildListObserver");var lt=Object.defineProperty,ln=w.createContext(void 0);function lr(e){let t=w.useContext(ln);return e||t||"ltr"}lt(lr,"name",{value:"useDirection",configurable:!0});let lo=["top","right","bottom","left"],li=Math.min,la=Math.max,ll=Math.round,ls=Math.floor,lc=e=>({x:e,y:e}),lu={left:"right",right:"left",bottom:"top",top:"bottom"};function ld(e,t){return"function"==typeof e?e(t):e}function lf(e){return e.split("-")[0]}function lp(e){return e.split("-")[1]}function lh(e){return"x"===e?"y":"x"}function lm(e){return"y"===e?"height":"width"}function lv(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function lg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let ly=["left","right"],lb=["right","left"],lx=["top","bottom"],lw=["bottom","top"];function lk(e){let t=lf(e);return lu[t]+e.slice(t.length)}function lj(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function lS(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function lO(e,t,n){let r,{reference:o,floating:i}=e,a=lv(t),l=lh(lv(t)),s=lm(l),c=lf(t),u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,f=o[s]/2-i[s]/2;switch(c){case"top":r={x:u,y:o.y-i.height};break;case"bottom":r={x:u,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:d};break;case"left":r={x:o.x-i.width,y:d};break;default:r={x:o.x,y:o.y}}let p=lp(t);return p&&(r[l]+=f*("end"===p?1:-1)*(n&&"y"===a?-1:1)),r}async function lC(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=ld(t,e),h=lj(p),m=l[f?"floating"===d?"reference":"floating":d],v=lS(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await (null==i.isElement?void 0:i.isElement(y))&&await (null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=lS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:s}):g);return{top:(v.top-x.top+h.top)/b.y,bottom:(x.bottom-v.bottom+h.bottom)/b.y,left:(v.left-x.left+h.left)/b.x,right:(x.right-v.right+h.right)/b.x}}let lN=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:lC},s=await (null==a.isRTL?void 0:a.isRTL(t)),c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=lO(c,r,s),f=r,p=0,h={};for(let n=0;n<i.length;n++){let m=i[n];if(!m)continue;let{name:v,fn:g}=m,{x:y,y:b,data:x,reset:w}=await g({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:l,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,h[v]={...h[v],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=lO(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};function lP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lE(e){return lo.some(t=>e[t]>=0)}let lI=new Set(["left","top"]);async function lA(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),a=lf(n),l=lp(n),s="y"===lv(n),c=lI.has(a)?-1:1,u=i&&s?-1:1,d=ld(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function l_(){return"u">typeof window}function lM(e){return lz(e)?(e.nodeName||"").toLowerCase():"#document"}function lT(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function lR(e){var t;return null==(t=(lz(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function lz(e){return!!l_()&&(e instanceof Node||e instanceof lT(e).Node)}function lD(e){return!!l_()&&(e instanceof Element||e instanceof lT(e).Element)}function lL(e){return!!l_()&&(e instanceof HTMLElement||e instanceof lT(e).HTMLElement)}function lF(e){return!(!l_()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof lT(e).ShadowRoot)}function lU(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=lG(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function lH(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let l$=/transform|translate|scale|rotate|perspective|filter/,lB=/paint|layout|strict|content/,lK=e=>!!e&&"none"!==e;function lq(e){let t=lD(e)?lG(e):e;return lK(t.transform)||lK(t.translate)||lK(t.scale)||lK(t.rotate)||lK(t.perspective)||!lV()&&(lK(t.backdropFilter)||lK(t.filter))||l$.test(t.willChange||"")||lB.test(t.contain||"")}function lV(){return null==e&&(e="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),e}function lW(e){return/^(html|body|#document)$/.test(lM(e))}function lG(e){return lT(e).getComputedStyle(e)}function lZ(e){return lD(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lY(e){if("html"===lM(e))return e;let t=e.assignedSlot||e.parentNode||lF(e)&&e.host||lR(e);return lF(t)?t.host:t}function lX(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=lY(t);return lW(n)?(t.ownerDocument||t).body:lL(n)&&lU(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=lT(o);if(!i)return t.concat(o,lX(o,[],n));{let e=lJ(a);return t.concat(a,a.visualViewport||[],lU(o)?o:[],e&&n?lX(e):[])}}function lJ(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lQ(e){let t=lG(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=lL(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=ll(n)!==i||ll(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function l0(e){return lD(e)?e:e.contextElement}function l1(e){let t=l0(e);if(!lL(t))return lc(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=lQ(t),a=(i?ll(n.width):n.width)/r,l=(i?ll(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}let l2=lc(0);function l3(e){let t=lT(e);return lV()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:l2}function l4(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),a=l0(e),l=lc(1);t&&(r?lD(r)&&(l=l1(r)):l=l1(e));let s=(void 0===(o=n)&&(o=!1),r&&o&&r===lT(a))?l3(a):lc(0),c=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,d=i.width/l.x,f=i.height/l.y;if(a&&r){let e=lT(a),t=lD(r)?lT(r):r,n=e,o=lJ(n);for(;o&&t!==n;){let e=l1(o),t=o.getBoundingClientRect(),r=lG(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=i,u+=a,o=lJ(n=lT(o))}}return lS({width:d,height:f,x:c,y:u})}function l5(e,t){let n=lZ(e).scrollLeft;return t?t.left+n:l4(lR(e)).left+n}function l6(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-l5(e,n),y:n.top+t.scrollTop}}function l8(e,t,n){var r;let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=lT(e),i=lR(e),a=o.visualViewport,l=i.clientWidth,s=i.clientHeight,c=0,u=0;if(a){let e=!lV()||"fixed"===t;r?e||(c=-a.offsetLeft,u=-a.offsetTop):(l=a.width,s=a.height,e&&(c=a.offsetLeft,u=a.offsetTop))}if(0>=l5(i)){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),a="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;a<=25&&(l-=a)}return{width:l,height:s,x:c,y:u}}(e,n,t);else if("document"===t){let t,n,i,a,l,s;t=lZ(r=lR(e)),n=r.ownerDocument.body,i=la(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),a=la(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),l=-t.scrollLeft+l5(r),s=-t.scrollTop,"rtl"===lG(n).direction&&(l+=la(r.clientWidth,n.clientWidth)-i),o={width:i,height:a,x:l,y:s}}else if(lD(t)){let e,r,i,a,l,s;r=(e=l4(t,!0,"fixed"===n)).top+t.clientTop,i=e.left+t.clientLeft,a=l1(t),l=t.clientWidth*a.x,s=t.clientHeight*a.y,o={width:l,height:s,x:i*a.x,y:r*a.y}}else{let n=l3(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return lS(o)}function l9(e){return"static"===lG(e).position}function l7(e,t){if(!lL(e)||"fixed"===lG(e).position)return null;if(t)return t(e);let n=e.offsetParent;return lR(e)===n&&(n=n.ownerDocument.body),n}function se(e,t){var n;let r=lT(e);if(lH(e))return r;if(!lL(e)){let t=lY(e);for(;t&&!lW(t);){if(lD(t)&&!l9(t))return t;t=lY(t)}return r}let o=l7(e,t);for(;o&&(n=o,/^(table|td|th)$/.test(lM(n)))&&l9(o);)o=l7(o,t);return o&&lW(o)&&l9(o)&&!lq(o)?r:o||function(e){let t=lY(e);for(;lL(t)&&!lW(t);){if(lq(t))return t;if(lH(t))break;t=lY(t)}return null}(e)||r}let st=async function(e){let t=this.getOffsetParent||se,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=lL(t),o=lR(t),i="fixed"===n,a=l4(e,!0,i,t),l={scrollLeft:0,scrollTop:0},s=lc(0);if((r||!i)&&(("body"!==lM(t)||lU(o))&&(l=lZ(t)),r)){let e=l4(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&o&&(s.x=l5(o));let c=!o||r||i?lc(0):l6(o,l);return{x:a.left+l.scrollLeft-s.x-c.x,y:a.top+l.scrollTop-s.y-c.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},sn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,a=lR(r),l=!!t&&lH(t.floating);if(r===a||l&&i)return n;let s={scrollLeft:0,scrollTop:0},c=lc(1),u=lc(0),d=lL(r);if((d||!i)&&(("body"!==lM(r)||lU(a))&&(s=lZ(r)),d)){let e=l4(r);c=l1(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!a||d||i?lc(0):l6(a,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:lR,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[..."clippingAncestors"===n?lH(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=lX(e,[],!1).filter(e=>lD(e)&&"body"!==lM(e)),o=null,i="fixed"===lG(e).position,a=i?lY(e):e;for(;lD(a)&&!lW(a);){let e=lG(a),t=lq(a),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==a),a=lY(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=l8(t,i[0],o),l=a.top,s=a.right,c=a.bottom,u=a.left;for(let e=1;e<i.length;e++){let n=l8(t,i[e],o);l=la(n.top,l),s=li(n.right,s),c=li(n.bottom,c),u=la(n.left,u)}return{width:s-u,height:c-l,x:u,y:l}},getOffsetParent:se,getElementRects:st,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=lQ(e);return{width:t,height:n}},getScale:l1,isElement:lD,isRTL:function(e){return"rtl"===lG(e).direction}};function sr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let so=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:s}=t,{element:c,padding:u=0}=ld(e,t)||{};if(null==c)return{};let d=lj(u),f={x:n,y:r},p=lh(lv(o)),h=lm(p),m=await a.getDimensions(c),v="y"===p,g=v?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[p]-f[p]-i.floating[h],b=f[p]-i.reference[p],x=await (null==a.getOffsetParent?void 0:a.getOffsetParent(c)),w=x?x[g]:0;w&&await (null==a.isElement?void 0:a.isElement(x))||(w=l.floating[g]||i.floating[h]);let k=w/2-m[h]/2-1,j=li(d[v?"top":"left"],k),S=li(d[v?"bottom":"right"],k),O=w-m[h]-S,C=w/2-m[h]/2+(y/2-b/2),N=la(j,li(C,O)),P=!s.arrow&&null!=lp(o)&&C!==N&&i.reference[h]/2-(C<j?j:S)-m[h]/2<0,E=P?C<j?C-j:C-O:0;return{[p]:f[p]+E,data:{[p]:N,centerOffset:C-N-E,...P&&{alignmentOffset:E}},reset:P}}});var si="u">typeof document?w.useLayoutEffect:function(){};function sa(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!sa(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!sa(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function sl(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ss(e,t){let n=sl(e);return Math.round(t*n)/n}function sc(e){let t=w.useRef(e);return si(()=>{t.current=e}),t}var su=Object.defineProperty,sd=(e,t)=>su(e,"name",{value:t,configurable:!0}),sf="Popper",[sp,sh]=tF(sf),[sm,sv]=sp(sf),sg=sd(e=>{let{__scopePopper:t,children:n}=e,[r,o]=w.useState(null),[i,a]=w.useState(void 0);return(0,x.jsx)(sm,{scope:t,anchor:r,onAnchorChange:o,placementState:i,setPlacementState:a,children:n})},"Popper"),sy=w.forwardRef(sd(function(e,t){let{__scopePopper:n,virtualRef:r,...o}=e,i=sv("PopperAnchor",n),a=w.useRef(null),l=i.onAnchorChange,s=T(t,w.useCallback(e=>{a.current=e,e&&l(e)},[l])),c=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=c.current;c.current=r.current,e!==c.current&&l(c.current)});let u=i.placementState&&sO(i.placementState),d=u?.[0],f=u?.[1];return r?null:(0,x.jsx)(t5.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...o,ref:s})},"PopperAnchor")),sb="PopperContent",[sx,sw]=sp(sb),sk=w.forwardRef(sd(function(e,t){var n,r,o,i,a,l,s,c,u,d,f,p,h,m,v,g,y,b,k,j,S;let O,C,N,P,E,I,{__scopePopper:A,side:_="bottom",sideOffset:M=0,align:R="center",alignOffset:z=0,arrowPadding:D=0,avoidCollisions:L=!0,collisionBoundary:F=[],collisionPadding:U=0,sticky:H="partial",hideWhenDetached:$=!1,updatePositionStrategy:B="optimized",onPlaced:K,...q}=e,V=sv(sb,A),[W,G]=w.useState(null),Z=T(t,G),[Y,X]=w.useState(null),J=aM(Y),Q=J?.width??0,ee=J?.height??0,et="number"==typeof U?U:{top:0,right:0,bottom:0,left:0,...U},en=Array.isArray(F)?F:[F],er=en.length>0,eo={padding:et,boundary:en.filter(sj),altBoundary:er},{refs:ei,floatingStyles:ea,placement:el,isPositioned:es,middlewareData:ec}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:s,open:c}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);sa(f,r)||p(r);let[h,m]=w.useState(null),[v,g]=w.useState(null),y=w.useCallback(e=>{e!==j.current&&(j.current=e,m(e))},[]),b=w.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),x=i||h,k=a||v,j=w.useRef(null),S=w.useRef(null),O=w.useRef(u),C=null!=s,N=sc(s),P=sc(o),E=sc(c),I=w.useCallback(()=>{var e,r;let o,i,a;if(!j.current||!S.current)return;let l={placement:t,strategy:n,middleware:f};P.current&&(l.platform=P.current),(e=j.current,r=S.current,o=new Map,i=null!=l?l:{},a={...sn,...i.platform,_c:o},lN(e,r,{...i,platform:a})).then(e=>{let t={...e,isPositioned:!1!==E.current};A.current&&!sa(O.current,t)&&(O.current=t,t3.flushSync(()=>{d(t)}))})},[f,t,n,P,E]);si(()=>{!1===c&&O.current.isPositioned&&(O.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let A=w.useRef(!1);si(()=>(A.current=!0,()=>{A.current=!1}),[]),si(()=>{if(x&&(j.current=x),k&&(S.current=k),x&&k){if(N.current)return N.current(x,k,I);I()}},[x,k,I,N,C]);let _=w.useMemo(()=>({reference:j,floating:S,setReference:y,setFloating:b}),[y,b]),M=w.useMemo(()=>({reference:x,floating:k}),[x,k]),T=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=ss(M.floating,u.x),r=ss(M.floating,u.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...sl(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,M.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:I,refs:_,elements:M,floatingStyles:T}),[u,I,_,M,T])}({strategy:"fixed",placement:_+("center"!==R?"-"+R:""),whileElementsMounted:sd((...e)=>(function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=l0(e),d=i||a?[...u?lX(u):[],...t?lX(t):[]]:[];d.forEach(e=>{i&&e.addEventListener("scroll",n),a&&e.addEventListener("resize",n)});let f=u&&s?function(e,t,n){let r,o=null,i=lR(e);function a(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function l(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),a();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(n||t(),!f||!p)return;let h={rootMargin:-ls(d)+"px "+-ls(i.clientWidth-(u+f))+"px "+-ls(i.clientHeight-(d+p))+"px "+-ls(u)+"px",threshold:la(0,li(1,s))||1},m=!0;function v(t){let n=t[0].intersectionRatio;if(!sr(c,e.getBoundingClientRect()))return l();if(n!==s){if(!m)return l();n?l(!1,n):r=setTimeout(()=>{l(!1,1e-7)},1e3)}m=!1}try{o=new IntersectionObserver(v,{...h,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(v,h)}o.observe(e)}let s=lT(e),c=()=>l(n);return s.addEventListener("resize",c),l(!0),()=>{s.removeEventListener("resize",c),a()}}(u,n,a):null,p=-1,h=null;l&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),u&&!c&&h.observe(u),t&&h.observe(t));let m=c?l4(e):null;return c&&function t(){let r=l4(e);m&&!sr(m,r)&&n(),m=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===B}),"whileElementsMounted"),elements:{reference:V.anchor},middleware:[{name:(O={name:"offset",options:o=n={mainAxis:M+ee,alignmentAxis:z},async fn(e){var t,n;let{x:r,y:i,placement:a,middlewareData:l}=e,s=await lA(e,o);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}).name,fn:O.fn,options:[n,r]},L&&{name:(C={name:"shift",options:u=s={mainAxis:!0,crossAxis:!1,limiter:"partial"===H?{fn:(void 0===(l=i)&&(l={}),{options:l,fn(e){var t,n,r,o;let{x:i,y:a,placement:s,rects:c,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=ld(l,e),h={x:i,y:a},m=lv(s),v=lh(m),g=h[v],y=h[m],b=ld(d,e),x="number"==typeof b?{mainAxis:b,crossAxis:0}:{mainAxis:null!=(t=b.mainAxis)?t:0,crossAxis:null!=(n=b.crossAxis)?n:0};if(f){let e="y"===v?"height":"width",t=c.reference[v]-c.floating[e]+x.mainAxis,n=c.reference[v]+c.reference[e]-x.mainAxis;g<t?g=t:g>n&&(g=n)}if(p){let e="y"===v?"width":"height",t=lI.has(lf(s)),n=c.reference[m]-c.floating[e]+(t&&(null==(r=u.offset)?void 0:r[m])||0)+(t?0:x.crossAxis),i=c.reference[m]+c.reference[e]+(t?0:(null==(o=u.offset)?void 0:o[m])||0)-(t?x.crossAxis:0);y<n?y=n:y>i&&(y=i)}return{[v]:g,[m]:y}}}).fn,options:[i,a]}:void 0,...eo},async fn(e){let{x:t,y:n,placement:r,platform:o}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=ld(u,e),c={x:t,y:n},d=await o.detectOverflow(e,s),f=lv(r),p=lh(f),h=c[p],m=c[f],v=(e,t)=>la(t+d["y"===e?"top":"left"],li(t,t-d["y"===e?"bottom":"right"]));i&&(h=v(p,h)),a&&(m=v(f,m));let g=l.fn({...e,[p]:h,[f]:m});return{...g,data:{x:g.x-t,y:g.y-n,enabled:{[p]:i,[f]:a}}}}}).name,fn:C.fn,options:[s,c]},L&&{name:(N={name:"flip",options:p=d={...eo},async fn(e){var t,n,r,o,i,a,l,s;let c,u,d,{placement:f,middlewareData:h,rects:m,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:x=!0,fallbackPlacements:w,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:S=!0,...O}=ld(p,e);if(null!=(t=h.arrow)&&t.alignmentOffset)return{};let C=lf(f),N=lv(v),P=lf(v)===v,E=await (null==g.isRTL?void 0:g.isRTL(y.floating)),I=w||(P||!S?[lk(v)]:(c=lk(v),[lg(v),c,lg(c)])),A="none"!==j;!w&&A&&I.push(...(u=lp(v),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?lb:ly;return t?ly:lb;case"left":case"right":return t?lx:lw;default:return[]}}(lf(v),"start"===j,E),u&&(d=d.map(e=>e+"-"+u),S&&(d=d.concat(d.map(lg)))),d));let _=[v,...I],M=await g.detectOverflow(e,O),T=[],R=(null==(n=h.flip)?void 0:n.overflows)||[];if(b&&T.push(M[C]),x){let e,t,n,r,o=(a=f,l=m,void 0===(s=E)&&(s=!1),e=lp(a),n=lm(t=lh(lv(a))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",l.reference[n]>l.floating[n]&&(r=lk(r)),[r,lk(r)]);T.push(M[o[0]],M[o[1]])}if(R=[...R,{placement:f,overflows:T}],!T.every(e=>e<=0)){let e=((null==(r=h.flip)?void 0:r.index)||0)+1,t=_[e];if(t&&("alignment"!==x||N===lv(t)||R.every(e=>lv(e.placement)!==N||e.overflows[0]>0)))return{data:{index:e,overflows:R},reset:{placement:t}};let n=null==(o=R.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(k){case"bestFit":{let e=null==(i=R.filter(e=>{if(A){let t=lv(e.placement);return t===N||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(n=e);break}case"initialPlacement":n=v}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:N.fn,options:[d,f]},{name:(P={name:"size",options:v=h={...eo,apply:sd(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")},async fn(e){let t,n,{placement:r,rects:o,platform:i,elements:a}=e,{apply:l=()=>{},...s}=ld(v,e),c=await i.detectOverflow(e,s),u=lf(r),d=lp(r),f="y"===lv(r),{width:p,height:h}=o.floating;"top"===u||"bottom"===u?(t=u,n=d===(await (null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(n=u,t="end"===d?"top":"bottom");let m=h-c.top-c.bottom,g=p-c.left-c.right,y=li(h-c[t],m),b=li(p-c[n],g),x=e.middlewareData.shift,w=!x,k=y,j=b;null!=x&&x.enabled.x&&(j=g),null!=x&&x.enabled.y&&(k=m),w&&!d&&(f?j=p-2*la(c.left,c.right):k=h-2*la(c.top,c.bottom)),await l({...e,availableWidth:j,availableHeight:k});let S=await i.getDimensions(a.floating);return p!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}).name,fn:P.fn,options:[h,m]},Y&&{name:(E={name:"arrow",options:b=g={element:Y,padding:D},fn(e){let{element:t,padding:n}="function"==typeof b?b(e):b;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?so({element:t.current,padding:n}).fn(e):{}:t?so({element:t,padding:n}).fn(e):{}}}).name,fn:E.fn,options:[g,y]},sS({arrowWidth:Q,arrowHeight:ee}),$&&{name:(I={name:"hide",options:S=k={strategy:"referenceHidden",...eo,boundary:er?eo.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...o}=ld(S,e);switch(r){case"referenceHidden":{let r=lP(await n.detectOverflow(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:lE(r)}}}case"escaped":{let r=lP(await n.detectOverflow(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:lE(r)}}}default:return{}}}}).name,fn:I.fn,options:[k,j]}]}),eu=V.setPlacementState;tH(()=>(eu(el),()=>{eu(void 0)}),[el,eu]);let[ed,ef]=sO(el),ep=t8(K);tH(()=>{es&&ep?.()},[es,ep]);let eh=ec.arrow?.x,em=ec.arrow?.y,ev=ec.arrow?.centerOffset!==0,[eg,ey]=w.useState();return tH(()=>{W&&ey(window.getComputedStyle(W).zIndex)},[W]),(0,x.jsx)("div",{ref:ei.setFloating,"data-radix-popper-content-wrapper":"",style:{...ea,transform:es?ea.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eg,"--radix-popper-transform-origin":[ec.transformOrigin?.x,ec.transformOrigin?.y].join(" "),...ec.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,x.jsx)(sx,{scope:A,placedSide:ed,placedAlign:ef,onArrowChange:X,arrowX:eh,arrowY:em,shouldHideArrow:ev,children:(0,x.jsx)(t5.div,{"data-side":ed,"data-align":ef,...q,ref:Z,style:{...q.style,animation:es?q.style?.animation:"none"}})})})},"PopperContent"));function sj(e){return null!==e}sd(sj,"isNotNull");var sS=sd(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,c]=sO(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2,p="",h="";return"bottom"===s?(p=i?u:`${d}px`,h=`${-l}px`):"top"===s?(p=i?u:`${d}px`,h=`${r.floating.height+l}px`):"right"===s?(p=`${-l}px`,h=i?u:`${f}px`):"left"===s&&(p=`${r.floating.width+l}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}}),"transformOrigin");function sO(e){let[t,n="center"]=e.split("-");return[t,n]}function sC(e){let t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}sd(sO,"getSideAndAlignFromPlacement"),(0,Object.defineProperty)(sC,"name",{value:"usePrevious",configurable:!0});var sN=Object.defineProperty,sP=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sE=w.forwardRef(sN(function(e,t){return(0,x.jsx)(t5.span,{...e,ref:t,style:{...sP,...e.style}})},"name",{value:"VisuallyHidden",configurable:!0})),sI=Object.defineProperty,sA=(e,t)=>sI(e,"name",{value:t,configurable:!0}),s_=[" ","Enter","ArrowUp","ArrowDown"],sM=[" ","Enter"],sT="Select",[sR,sz,sD]=a1(sT),[sL,sF]=tF(sT,[sD,sh]),sU=sh(),[sH,s$]=sL(sT),[sB,sK]=sL(sT);function sq(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:l,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:m}=e,v=sU(t),[g,y]=w.useState(null),[b,k]=w.useState(null),[j,S]=w.useState(!1),O=lr(c),[C,N]=tQ({prop:r,defaultProp:o??!1,onChange:i,caller:sT}),[P,E]=tQ({prop:a,defaultProp:l,onChange:s,caller:sT}),I=w.useRef(null),A=w.useRef(P);w.useEffect(()=>{let e=h?g?.ownerDocument.getElementById(h):g?.form;if(e instanceof HTMLFormElement){let t=sA(()=>E(A.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,g,E]);let _=!g||!!h||!!g.closest("form"),[M,T]=w.useState(new Set),R=tq(),z=Array.from(M).map(e=>e.props.value).join(";"),D=w.useCallback(e=>{T(t=>new Set(t).add(e))},[]),L=w.useCallback(e=>{T(t=>{let n=new Set(t);return n.delete(e),n})},[]),F={required:p,trigger:g,onTriggerChange:y,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:R,value:P,onValueChange:E,open:C,onOpenChange:N,dir:O,triggerPointerDownPosRef:I,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:M,nativeSelectKey:z,isFormControl:_};return(0,x.jsx)(sg,{...v,children:(0,x.jsx)(sH,{scope:t,...F,children:(0,x.jsx)(sR.Provider,{scope:t,children:(0,x.jsx)(sB,{scope:t,onNativeOptionAdd:D,onNativeOptionRemove:L,children:cb(m)?m(F):n})})})})}sA(sq,"SelectProvider");var sV=sA(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,x.jsx)(sq,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[n,e?(0,x.jsx)(cy,{__scopeSelect:t}):null]})})},"Select"),sW=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,disabled:r=!1,...o}=e,i=sU(n),a=s$("SelectTrigger",n),l=a.disabled||r,s=T(t,a.onTriggerChange),c=sz(n),u=w.useRef("touch"),[d,f,p]=cw(e=>{let t=c().filter(e=>!e.disabled),n=t.find(e=>e.value===a.value),r=ck(t,e,n);void 0!==r&&a.onValueChange(r.value)}),h=sA(e=>{l||(a.onOpenChange(!0),p()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,x.jsx)(sy,{asChild:!0,...i,children:(0,x.jsx)(t5.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":cx(a.value)?"":void 0,...o,ref:s,onClick:tT(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==u.current&&h(e)}),onPointerDown:tT(o.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:tT(o.onKeyDown,e=>{let t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),(!t||" "!==e.key)&&s_.includes(e.key)&&(h(),e.preventDefault())})})})},"SelectTrigger")),sG=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...l}=e,s=s$("SelectValue",n),{onValueNodeHasChildrenChange:c}=s,u=void 0!==i,d=T(t,s.onValueNodeChange);tH(()=>{c(u)},[c,u]);let f=cx(s.value);return(0,x.jsx)(t5.span,{...l,asChild:!f&&l.asChild,ref:d,style:{pointerEvents:"none"},children:(0,x.jsx)(w.Fragment,{children:f?a:i},f?"placeholder":"value")})},"SelectValue")),sZ=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,x.jsx)(t5.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})},"SelectIcon")),[sY,sX]=sL("SelectPortal",{forceMount:void 0}),sJ=sA(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,x.jsx)(sY,{scope:e.__scopeSelect,forceMount:n,children:(0,x.jsx)(nN,{asChild:!0,...r})})},"SelectPortal"),sQ="SelectContent",s0=w.forwardRef(sA(function(e,t){let n=sX(sQ,e.__scopeSelect),{forceMount:r=n.forceMount,...o}=e,i=s$(sQ,e.__scopeSelect),[a,l]=w.useState();return tH(()=>{l(new DocumentFragment)},[]),(0,x.jsx)(nA,{present:r||i.open,children:({present:e})=>e?(0,x.jsx)(s5,{...o,ref:t}):(0,x.jsx)(s1,{...o,fragment:a})})},"SelectContent")),s1=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?t3.createPortal((0,x.jsx)(s2,{scope:n,children:(0,x.jsx)(sR.Slot,{scope:n,children:(0,x.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[s2,s3]=sL(sQ),s4=D("SelectContent.RemoveScroll"),s5=w.forwardRef(sA(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:l,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v,...g}=e,y=s$(sQ,n),[b,k]=w.useState(null),[j,S]=w.useState(null),O=T(t,k),[C,N]=w.useState(null),[P,E]=w.useState(null),I=sz(n),[A,_]=w.useState(!1),M=w.useRef(!1);w.useEffect(()=>{if(b)return rS(b)},[b]),nH();let R=w.useCallback(e=>{let[t,...n]=I().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===r&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==o))return},[I,j]),z=w.useCallback(()=>R([C,b]),[R,C,b]);w.useEffect(()=>{A&&z()},[A,z]);let{onOpenChange:D,triggerPointerDownPosRef:L}=y;w.useEffect(()=>{if(b){let e={x:0,y:0},t=sA(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},"handlePointerMove"),n=sA(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||D(!1),document.removeEventListener("pointermove",t),L.current=null},"handlePointerUp");return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[b,D,L]),w.useEffect(()=>{let e=sA(()=>D(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[D]);let[F,U]=cw(e=>{let t=I().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=ck(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),H=w.useCallback((e,t,n)=>{let r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&(N(e),r&&(M.current=!0))},[y.value]),$=w.useCallback(()=>b?.focus(),[b]),B=w.useCallback((e,t,n)=>{let r=!M.current&&!n;(void 0!==y.value&&y.value===t||r)&&E(e)},[y.value]),K="popper"===r?s8:s6;return(0,x.jsx)(s2,{scope:n,content:b,viewport:j,onViewportChange:S,itemRefCallback:H,selectedItem:C,onItemLeave:$,itemTextRefCallback:B,focusSelectedItem:z,selectedItemText:P,position:r,isPositioned:A,searchRef:F,children:(0,x.jsx)(rg,{as:s4,allowPinchZoom:!0,children:(0,x.jsx)(nh,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:tT(o,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,x.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,x.jsx)(K,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:e=>e.preventDefault(),...g,...K===s8?{side:l,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:v}:{},onPlaced:()=>_(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:tT(g.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||U(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=I().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>R(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),s6=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,onPlaced:r,...o}=e,i=s$(sQ,n),a=s3(sQ,n),[l,s]=w.useState(null),[c,u]=w.useState(null),d=T(t,u),f=sz(n),p=w.useRef(!1),h=w.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:g,focusSelectedItem:y}=a,b=w.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&c&&m&&v&&g){let e=i.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=g.getBoundingClientRect();if("rtl"!==i.dir){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=aJ(i,[10,Math.max(10,window.innerWidth-10-c)]);l.style.minWidth=s+"px",l.style.left=u+"px"}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=aJ(i,[10,Math.max(10,window.innerWidth-10-c)]);l.style.minWidth=s+"px",l.style.right=u+"px"}let a=f(),s=window.innerHeight-20,u=m.scrollHeight,d=window.getComputedStyle(c),h=parseInt(d.borderTopWidth,10),y=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),x=h+y+u+parseInt(d.paddingBottom,10)+b,w=Math.min(5*v.offsetHeight,x),k=window.getComputedStyle(m),j=parseInt(k.paddingTop,10),S=parseInt(k.paddingBottom,10),O=e.top+e.height/2-10,C=v.offsetHeight/2,N=h+y+(v.offsetTop+C);if(N<=O){let e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";let t=Math.max(s-O,C+(e?S:0)+(c.clientHeight-m.offsetTop-m.offsetHeight)+b);l.style.height=N+t+"px"}else{let e=a.length>0&&v===a[0].ref.current;l.style.top="0px";let t=Math.max(O,h+m.offsetTop+(e?j:0)+C);l.style.height=t+(x-N)+"px",m.scrollTop=N-O+m.offsetTop}l.style.margin="10px 0",l.style.minHeight=w+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,l,c,m,v,g,i.dir,r]);tH(()=>b(),[b]);let[k,j]=w.useState();tH(()=>{c&&j(window.getComputedStyle(c).zIndex)},[c]);let S=w.useCallback(e=>{e&&!0===h.current&&(b(),y?.(),h.current=!1)},[b,y]);return(0,x.jsx)(s9,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,x.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,x.jsx)(t5.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})},"SelectItemAlignedPosition")),s8=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...i}=e,a=sU(n);return(0,x.jsx)(sk,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[s9,s7]=sL(sQ,{}),ce="SelectViewport",ct=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,nonce:r,...o}=e,i=s3(ce,n),a=s7(ce,n),l=T(t,i.onViewportChange),s=w.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,x.jsx)(sR.Slot,{scope:n,children:(0,x.jsx)(t5.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:tT(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=a;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let i=o+e,a=Math.min(r,i),l=i-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[cn,cr]=sL("SelectGroup"),co=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,...r}=e,o=cr("SelectLabel",n);return(0,x.jsx)(t5.div,{id:o.id,...r,ref:t})},"SelectLabel")),ci="SelectItem",[ca,cl]=sL(ci),cs=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,l=s$(ci,n),s=s3(ci,n),c=l.value===r,[u,d]=w.useState(i??""),[f,p]=w.useState(!1),h=T(t,t8(e=>s.itemRefCallback?.(e,r,o))),m=tq(),v=w.useRef("touch"),g=sA(()=>{o||(l.onValueChange(r),l.onOpenChange(!1))},"handleSelect");return(0,x.jsx)(ca,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:(0,x.jsx)(sR.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:(0,x.jsx)(t5.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:h,onFocus:tT(a.onFocus,()=>p(!0)),onBlur:tT(a.onBlur,()=>p(!1)),onClick:tT(a.onClick,()=>{"mouse"!==v.current&&g()}),onPointerUp:tT(a.onPointerUp,()=>{"mouse"===v.current&&g()}),onPointerDown:tT(a.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:tT(a.onPointerMove,e=>{v.current=e.pointerType,o?s.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:tT(a.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:tT(a.onKeyDown,e=>{o||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(sM.includes(e.key)&&g()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),cc="SelectItemText",cu=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,className:r,style:o,...i}=e,a=s$(cc,n),l=s3(cc,n),s=cl(cc,n),c=sK(cc,n),[u,d]=w.useState(null),f=t8(e=>l.itemTextRefCallback?.(e,s.value,s.disabled)),p=T(t,d,s.onItemTextChange,f),h=u?.textContent,m=w.useMemo(()=>(0,x.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=c;return tH(()=>(v(m),()=>g(m)),[v,g,m]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(t5.span,{id:s.textId,...i,ref:p}),s.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!cx(a.value)?t3.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),cd=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,...r}=e;return cl("SelectItemIndicator",n).isSelected?(0,x.jsx)(t5.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),cf="SelectScrollUpButton",cp=w.forwardRef(sA(function(e,t){let n=s3(cf,e.__scopeSelect),r=s7(cf,e.__scopeSelect),[o,i]=w.useState(!1),a=T(t,r.onScrollButtonChange);return tH(()=>{if(n.viewport&&n.isPositioned){let e=function(){i(t.scrollTop>0)};sA(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,x.jsx)(cv,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),ch="SelectScrollDownButton",cm=w.forwardRef(sA(function(e,t){let n=s3(ch,e.__scopeSelect),r=s7(ch,e.__scopeSelect),[o,i]=w.useState(!1),a=T(t,r.onScrollButtonChange);return tH(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)};sA(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,x.jsx)(cv,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),cv=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...o}=e,i=s3("SelectScrollButton",n),a=w.useRef(null),l=sz(n),s=w.useCallback(()=>{null!==a.current&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>s(),[s]),tH(()=>{let e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,x.jsx)(t5.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:tT(o.onPointerDown,()=>{null===a.current&&(a.current=window.setInterval(r,50))}),onPointerMove:tT(o.onPointerMove,()=>{i.onItemLeave?.(),null===a.current&&(a.current=window.setInterval(r,50))}),onPointerLeave:tT(o.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),cg=w.forwardRef(sA(function(e,t){let{__scopeSelect:n,...r}=e;return(0,x.jsx)(t5.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),cy=w.forwardRef(sA(function({__scopeSelect:e,...t},n){let r=s$("SelectBubbleInput",e),{value:o,onValueChange:i,required:a,disabled:l,name:s,autoComplete:c,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=w.useRef(null),h=T(n,p),m=o??"",v=sC(m),g=Array.from(d).some(e=>(e.props.value??"")==="");return w.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(v!==m&&t){let n=new Event("change",{bubbles:!0});t.call(e,m),e.dispatchEvent(n)}},[v,m]),(0,x.jsxs)(t5.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:s,autoComplete:c,disabled:l,form:u,onChange:e=>i(e.target.value),...t,style:{...sP,...t.style},ref:h,defaultValue:m,children:[cx(o)&&!g?(0,x.jsx)("option",{value:""}):null,Array.from(d)]},f)},"SelectBubbleInput"));function cb(e){return"function"==typeof e}function cx(e){return""===e||void 0===e}function cw(e){let t=t8(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(e=>{t(n.current+e)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function ck(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,i=cj(e,Math.max(o,0));1===r.length&&(i=i.filter(e=>e!==n));let a=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==n?a:void 0}function cj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}sA(cb,"isFunction"),sA(cx,"shouldShowPlaceholder"),sA(cw,"useTypeaheadSearch"),sA(ck,"findNextItem"),sA(cj,"wrapArray");let cS=P("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function cO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cC(e){if(Array.isArray(e))return e}function cN(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function cP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function cE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function cI(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function cA(e,t){return cC(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||cM(e,t)||cN()}function c_(e){return cC(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||cM(e)||cN()}function cM(e,t){if(e){if("string"==typeof e)return cO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cO(e,t)}}var cT=w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=r.children,l=cI(r,["className","children"]),s=cA(o,1)[0];return(0,x.jsxs)(sW,cE(cP({ref:s,"data-slot":"select-trigger",className:tt("flex h-10 w-full cursor-pointer items-center justify-between gap-2 rounded-[10px] border border-input bg-card px-3 py-2 text-sm text-foreground shadow-[0_1px_2px_rgb(20_24_40/0.04)] outline-none transition-[border-color,box-shadow,background-color] hover:border-ring/35 focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:pointer-events-none disabled:opacity-50 data-[placeholder]:text-muted-foreground [&>span]:truncate",i)},l),{children:[a,(0,x.jsx)(sZ,{asChild:!0,children:(0,x.jsx)(tf,{className:"size-4 shrink-0 text-muted-foreground"})})]}))});cT.displayName=sW.displayName;var cR=w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=cI(r,["className"]),l=cA(o,1)[0];return(0,x.jsx)(cp,cE(cP({ref:l,className:tt("flex cursor-default items-center justify-center py-1",i)},a),{children:(0,x.jsx)(cS,{className:"size-4"})}))});cR.displayName=cp.displayName;var cz=w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=cI(r,["className"]),l=cA(o,1)[0];return(0,x.jsx)(cm,cE(cP({ref:l,className:tt("flex cursor-default items-center justify-center py-1",i)},a),{children:(0,x.jsx)(tf,{className:"size-4"})}))});cz.displayName=cm.displayName;var cD=w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=r.children,l=r.position,s=void 0===l?"popper":l,c=r.sideOffset,u=cI(r,["className","children","position","sideOffset"]),d=cA(o,1)[0];return(0,x.jsx)(sJ,{children:(0,x.jsxs)(s0,cE(cP({ref:d,"data-slot":"select-content",position:s,sideOffset:void 0===c?6:c,className:tt("relative z-50 max-h-[min(20rem,var(--radix-select-content-available-height))] min-w-[8rem] overflow-hidden rounded-xl border border-border/80 bg-popover text-popover-foreground shadow-[0_18px_50px_rgb(22_27_45/0.14)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","popper"===s&&"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",i)},u),{children:[(0,x.jsx)(cR,{}),(0,x.jsx)(ct,{className:tt("p-1.5","popper"===s&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,x.jsx)(cz,{})]}))})});cD.displayName=s0.displayName,w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=cI(r,["className"]),l=cA(o,1)[0];return(0,x.jsx)(co,cP({ref:l,className:tt("px-2 py-1.5 text-xs font-semibold text-muted-foreground",i)},a))}).displayName=co.displayName;var cL=w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=r.children,l=cI(r,["className","children"]),s=cA(o,1)[0];return(0,x.jsxs)(cs,cE(cP({ref:s,"data-slot":"select-item",className:tt("relative flex w-full cursor-pointer select-none items-center rounded-lg py-2 pr-8 pl-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",i)},l),{children:[(0,x.jsx)(cu,{children:a}),(0,x.jsx)("span",{className:"absolute right-2 flex size-4 items-center justify-center text-primary",children:(0,x.jsx)(cd,{children:(0,x.jsx)(aY,{className:"size-4",strokeWidth:2.5})})})]}))});function cF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cU(e,t){if(e){if("string"==typeof e)return cF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cF(e,t)}}function cH(e){var t,n=e.preview,r=e.conflictPolicy,o=e.restoreActive,i=e.stale,a=e.pending,l=e.canImport,s=e.onPolicyChange,c=e.onRestoreActiveChange,u=e.onConfirm,d=e.meta,f=e.idPrefix,p=(0,to.Bd)().t,h=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||cU(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=h[0],v=h[1],g=i?null:function(e,t){switch(t){case"openai-api-key":return e("transfer.authEffect.openai-api-key");case"auth-override":return e("transfer.authEffect.auth-override");case"official-cleanup":return e("transfer.authEffect.official-cleanup");case"none":return null}}(p,n.codexActivationAuthEffect);return(0,x.jsxs)("div",{className:"space-y-4 rounded-xl border bg-card p-4",children:[d?(0,x.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b pb-3 text-xs text-muted-foreground",children:d}):null,(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)(tb,{children:p("transfer.profileCount",{count:n.profileCount})}),n.favoriteCount?(0,x.jsx)(tb,{children:p("favorites.importCount",{count:n.favoriteCount})}):null,(0,x.jsx)(tb,{variant:"secondary",children:p("transfer.providerCount",{count:n.providerCount})}),(0,x.jsx)(tb,{variant:n.conflicts.length>0?"outline":"secondary",children:p("transfer.conflictCount",{count:n.conflicts.length})}),(0,x.jsx)(tb,{variant:"secondary",children:p("transfer.activeCount",{count:n.activeCount})})]}),(0,x.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:n.harnesses.map(function(e){return(0,x.jsx)("span",{children:p("transfer.harnessProfiles",{harness:ta.RP[e.harness],count:e.profiles})},e.harness)})}),n.conflicts.length>0?(0,x.jsxs)("div",{className:"space-y-1 rounded-xl bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:[(0,x.jsx)("p",{children:p("transfer.conflictList",{items:n.conflicts.map(function(e){return"".concat(ta.RP[e.harness]," / ").concat(e.name)}).join(p("common.listSeparator"))})}),(0,x.jsx)("p",{children:p("transfer.currentPolicy",{policy:"skip"===r?p("transfer.policySkip"):p("transfer.policyOverwrite")})})]}):null,g?(0,x.jsx)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:g}):null,i?(0,x.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:p("transfer.previewStale")}):null,(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"".concat(f,"-conflict-policy"),children:p("transfer.conflictPolicy")}),(0,x.jsxs)(sV,{value:r,onValueChange:function(e){return s(e)},children:[(0,x.jsx)(cT,{id:"".concat(f,"-conflict-policy"),children:(0,x.jsx)(sG,{})}),(0,x.jsxs)(cD,{children:[(0,x.jsx)(cL,{value:"skip",children:p("transfer.policySkip")}),(0,x.jsx)(cL,{value:"overwrite",children:p("transfer.policyOverwrite")})]})]})]}),(0,x.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 text-sm",children:[(0,x.jsx)(aX,{checked:o,onCheckedChange:function(e){return c(!0===e)}}),p("transfer.restoreActive")]})]}),(0,x.jsxs)(tr,{type:"button",disabled:!l,onClick:function(){return v(!0)},children:[(0,x.jsx)(aa,{}),i?p("transfer.recheckNeeded"):a?p("transfer.importing"):p("transfer.confirmImport")]}),(0,x.jsx)(ap,{open:m,onOpenChange:v,children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:g?p("transfer.confirmAuthTitle"):p("transfer.confirmTitle")}),(0,x.jsxs)(aI,{children:[p("transfer.confirmBody",{count:n.profileCount}),"overwrite"===r&&n.conflicts.length>0?p("transfer.confirmOverwrite",{count:n.conflicts.length}):p("transfer.confirmKeep"),g?" ".concat(g):null]})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:p("common.cancel")}),(0,x.jsx)(aA,{onClick:function(){v(!1),u()},children:g?p("transfer.proceedAware"):"overwrite"===r?p("transfer.proceedOverwrite"):p("transfer.proceedSafe")})]})]})})]})}function c$(e,t){var n,r=[e("transfer.importedCount",{count:t.imported})];return t.overwritten>0&&r.push(e("transfer.overwrittenCount",{count:t.overwritten})),t.providersCopied>0&&r.push(e("transfer.providersCopiedCount",{count:t.providersCopied})),t.skipped>0&&r.push(e("transfer.skippedCount",{count:t.skipped})),t.activeRestored>0&&r.push(e("transfer.activeRestoredCount",{count:t.activeRestored})),r.push(e(t.codexLoginCacheMigrated?"transfer.cacheMigrated":"transfer.cacheNotMigrated")),[{key:"transfer.importedSummary",params:{parts:r.join(e("common.listSeparator"))}}].concat(function(e){if(Array.isArray(e))return cF(e)}(n=t.warnings.map(function(e){return oN(e)}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||cU(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}function cB(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cK(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cq(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){cK(i,r,o,a,l,"next",e)}function l(e){cK(i,r,o,a,l,"throw",e)}a(void 0)})}}function cV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cB(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cW(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function cG(e){var t=e.fetchPreview,n=e.runImport,r=e.onImported,o=cV((0,w.useState)(null),2),i=o[0],a=o[1],l=cV((0,w.useState)(!1),2),s=l[0],c=l[1],u=cV((0,w.useState)("skip"),2),d=u[0],f=u[1],p=cV((0,w.useState)(!0),2),h=p[0],m=p[1],v=cV((0,w.useState)(null),2),g=v[0],y=v[1],b=cV((0,w.useState)(null),2),x=b[0],k=b[1],j=(0,w.useCallback)(function(){a(null),c(!1)},[]),S=(0,w.useCallback)(function(){j(),k(null),y(null)},[j]),O=(0,w.useCallback)(function(){return cq(function(){var e;return cW(this,function(n){switch(n.label){case 0:y("preview"),k(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,t({conflictPolicy:d,restoreActive:h})];case 2:return a(n.sent()),c(!1),[3,5];case 3:return e=n.sent(),a(null),k(oP(e)),[3,5];case 4:return y(null),[7];case 5:return[2]}})})()},[t,d,h]),C=(0,w.useCallback)(function(){return cq(function(){var e;return cW(this,function(t){switch(t.label){case 0:if(!i||s)return[2];y("import"),k(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),[4,n({conflictPolicy:d,restoreActive:h})];case 2:return e=t.sent(),j(),[4,r(e)];case 3:return t.sent(),[3,6];case 4:return k(oP(t.sent())),[3,6];case 5:return y(null),[7];case 6:return[2]}})})()},[i,s,n,d,h,j,r]),N=(null==i?void 0:i.conflictPolicy)===d&&(null==i?void 0:i.restoreActive)===h;return{preview:i,conflictPolicy:d,restoreActive:h,pending:g,error:x,setError:k,stale:s||null!==i&&!N,canImport:null!==i&&N&&!s&&null===g,inspect:O,confirm:C,invalidate:j,reset:S,changePolicy:(0,w.useCallback)(function(e){f(e),c(!0)},[]),changeRestoreActive:(0,w.useCallback)(function(e){m(e),c(!0)},[])}}function cZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cY(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function cX(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){cY(i,r,o,a,l,"next",e)}function l(e){cY(i,r,o,a,l,"throw",e)}a(void 0)})}}function cJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function cQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cZ(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c0(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function c1(e){var t=e.onDone,n=(0,to.Bd)().t,r=iV(function(e){return e.loadHarnesses}),o=iV(function(e){return e.setNotice}),i=(0,w.useRef)(null),a=cQ((0,w.useState)("import"),2),l=a[0],s=a[1],c=cQ((0,w.useState)(""),2),u=c[0],d=c[1],f=cQ((0,w.useState)(""),2),p=f[0],h=f[1],m=cQ((0,w.useState)(!1),2),v=m[0],g=m[1],y=cQ((0,w.useState)(!1),2),b=y[0],k=y[1],j=cQ((0,w.useState)(null),2),S=j[0],O=j[1],C=cQ((0,w.useState)(null),2),N=C[0],P=C[1],E=cQ((0,w.useState)(null),2),I=E[0],A=E[1],_=cQ((0,w.useState)(""),2),M=_[0],T=_[1],R=cQ((0,w.useState)(""),2),z=R[0],D=R[1],L=cQ((0,w.useState)(null),2),F=L[0],U=L[1],H=cG({fetchPreview:function(e){return ov("/api/transfer/preview",{method:"POST",body:JSON.stringify(cJ({envelope:I,passphrase:z},e))})},runImport:function(e){var t,n;return ov("/api/transfer/import",{method:"POST",body:JSON.stringify((t=cJ({envelope:I,passphrase:z},e),n=n={migrateCodexLoginCache:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})},onImported:function(e){return cX(function(){return c0(this,function(i){switch(i.label){case 0:return[4,r()];case 1:return i.sent(),o(c$(n,e)),t(),[2]}})})()}}),$=u.length>=8&&u===p&&!v,B=null!==I&&z.length>=8&&null===H.pending,K="export"===l?S:null!=F?F:H.error;return(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)("div",{className:"grid grid-cols-2 rounded-lg bg-muted p-1",children:["import","export"].map(function(e){return(0,x.jsxs)("button",{type:"button","aria-pressed":l===e,className:l===e?"flex items-center justify-center gap-2 rounded-md bg-background py-1.5 text-sm font-medium text-foreground shadow-sm":"flex cursor-pointer items-center justify-center gap-2 rounded-md py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground",onClick:function(){return s(e)},children:["import"===e?(0,x.jsx)(aa,{className:"size-4"}):(0,x.jsx)(al,{className:"size-4"}),"import"===e?n("transfer.importTitle"):n("transfer.exportTitle")]},e)})}),"export"===l?(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("transfer.exportIntro")}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.exportVersion")}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aX,{id:"legacy-export",checked:b,onCheckedChange:function(e){return k(!0===e)}}),(0,x.jsx)(iQ,{htmlFor:"legacy-export",children:n("favorites.legacyExport")})]}),(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"export-passphrase",children:n("transfer.passphrase")}),(0,x.jsx)(i4,{id:"export-passphrase",type:"password",autoComplete:"new-password",value:u,onChange:function(e){return d(e.target.value)},placeholder:n("transfer.passphrasePlaceholder",{min:8})})]}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"export-passphrase-confirm",children:n("transfer.passphraseConfirm")}),(0,x.jsx)(i4,{id:"export-passphrase-confirm",type:"password",autoComplete:"new-password",value:p,onChange:function(e){return h(e.target.value)},placeholder:n("transfer.passphraseConfirmPlaceholder")})]})]}),p&&u!==p?(0,x.jsx)("p",{className:"text-xs text-destructive",children:n("transfer.passphraseMismatch")}):null,(0,x.jsxs)(tr,{type:"button",onClick:function(){cX(function(){return c0(this,function(e){switch(e.label){case 0:g(!0),O(null),P(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,ov("/api/transfer/export",{method:"POST",body:JSON.stringify(cJ({passphrase:u,includeCodexLoginCache:!0},b?{legacy:!0}:{}))})];case 2:var t,r,o,i,a;return t=e.sent(),r=new Date().toISOString().slice(0,10),o=new Blob(["".concat(JSON.stringify(t,null,2),"\n")],{type:"application/json"}),i=URL.createObjectURL(o),(a=document.createElement("a")).href=i,a.download="harness-switch-".concat(r,".hsw-backup"),a.click(),URL.revokeObjectURL(i),P(n("transfer.exported")),[3,5];case 3:return O(oP(e.sent())),[3,5];case 4:return g(!1),[7];case 5:return[2]}})})()},disabled:!$,children:[(0,x.jsx)(al,{}),v?n("transfer.encrypting"):n("transfer.download")]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("transfer.importIntro")}),(0,x.jsx)("input",{ref:i,type:"file",accept:".hsw-backup,application/json",className:"sr-only",onChange:function(e){var t,n;n=null==(t=e.target.files)?void 0:t[0],cX(function(){var e,t,r;return c0(this,function(o){switch(o.label){case 0:if(H.reset(),U(null),P(null),!n)return A(null),T(""),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),t=JSON.parse,[4,n.text()];case 2:if("harness-switch-encrypted-export"!==(e=t.apply(JSON,[o.sent()])).format||1!==e.version)return U({key:"transfer.notAnExport"}),A(null),T(""),[2];return A(e),T(n.name),[3,4];case 3:return r=o.sent(),A(null),T(""),U(oP(r)),[3,4];case 4:return[2]}})})()}}),(0,x.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-3 rounded-xl border border-dashed bg-muted/20 px-4 py-4 text-left transition-colors hover:border-primary/40 hover:bg-primary/5",onClick:function(){var e;return null==(e=i.current)?void 0:e.click()},children:[(0,x.jsx)(ao,{className:"size-5 text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("span",{className:"block truncate text-sm font-medium",children:M||n("transfer.pickFile")}),(0,x.jsx)("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:n("transfer.pickFileHint")})]})]}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"import-passphrase",children:n("transfer.passphrase")}),(0,x.jsx)(i4,{id:"import-passphrase",type:"password",value:z,onChange:function(e){D(e.target.value),H.invalidate()},placeholder:n("transfer.importPassphrasePlaceholder")})]}),(0,x.jsx)(tr,{type:"button",variant:"outline",disabled:!B,onClick:function(){H.inspect()},children:"preview"===H.pending?n("transfer.inspecting"):n("transfer.inspect")})]}),H.preview?(0,x.jsx)(cH,{idPrefix:"file",preview:H.preview,conflictPolicy:H.conflictPolicy,restoreActive:H.restoreActive,stale:H.stale,pending:"import"===H.pending,canImport:H.canImport,onPolicyChange:H.changePolicy,onRestoreActiveChange:H.changeRestoreActive,onConfirm:function(){H.confirm()}}):null]}),N?(0,x.jsx)("p",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:N}):null,K?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(n,K)}):null]})}cL.displayName=cs.displayName,w.forwardRef(function(e,t){var n=c_([e,t]),r=n[0],o=n.slice(1),i=r.className,a=cI(r,["className"]),l=cA(o,1)[0];return(0,x.jsx)(cg,cP({ref:l,className:tt("-mx-1 my-1 h-px bg-border",i)},a))}).displayName=cg.displayName;let c2=P("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),c3=P("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),c4=P("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),c5=P("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),c6=P("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);function c8(e){var t=e.status,n=e.refreshing,r=e.onRefresh,o=e.onDisconnect,i=(0,to.Bd)().t,a=(0,to.s9)().locale;return(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-xl border bg-muted/40 p-4",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[t.avatarUrl?(0,x.jsx)("img",{src:t.avatarUrl,alt:t.username,className:"size-10 rounded-full border"}):(0,x.jsx)(c3,{className:"size-10 text-muted-foreground"}),(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("span",{className:"font-semibold",children:t.username}),(0,x.jsxs)(tb,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:[(0,x.jsx)(c4,{className:"mr-1 size-3"}),i("githubSync.connectedBadge")]})]}),(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[i("githubSync.lastSynced")," ",t.lastSyncedAt?new Date(t.lastSyncedAt).toLocaleString(a):i("githubSync.neverSynced")]}),t.gistId?(0,x.jsxs)("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,x.jsx)("span",{children:i("githubSync.cloudGist")}),(0,x.jsxs)("a",{href:"https://gist.github.com/".concat(t.username?"".concat(t.username,"/"):"").concat(t.gistId),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 font-mono text-primary hover:underline",children:[t.gistId.slice(0,8),"…",(0,x.jsx)(c5,{className:"size-3"})]})]}):null]})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(tr,{variant:"outline",size:"sm",onClick:r,disabled:n,"aria-label":i("githubSync.refreshStatus"),children:(0,x.jsx)(c6,{className:tt("size-4",n&&"animate-spin")})}),(0,x.jsxs)(tr,{variant:"outline",size:"sm",className:"text-destructive hover:border-destructive/30 hover:bg-destructive/10 hover:text-destructive",onClick:o,children:[(0,x.jsx)(th,{className:"mr-1.5 size-4"}),i("githubSync.disconnect")]})]})]})}let c9=P("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),c7=P("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);function ue(e,t){return"".concat(e,"-tab-").concat(t)}function ut(e,t){return"".concat(e,"-panel-").concat(t)}function un(e){var t=e.label,n=e.idPrefix,r=e.items,o=e.value,i=e.onChange,a=e.orientation,l=e.className,s=e.tabClassName,c=e.children;return(0,x.jsx)("div",{role:"tablist","aria-label":t,"aria-orientation":void 0===a?"horizontal":a,className:l,children:r.map(function(e,t){var a=e.id===o;return(0,x.jsx)("button",{type:"button",role:"tab",id:ue(n,e.id),"aria-controls":ut(n,e.id),"aria-selected":a,tabIndex:a?0:-1,onClick:function(){return i(e.id)},onKeyDown:function(e){return function(e,t){var n,o,a=function(e,t,n){if("Home"===e)return 0;if("End"===e)return n-1;var r="ArrowRight"===e||"ArrowDown"===e;return r||"ArrowLeft"===e||"ArrowUp"===e?(t+(r?1:-1)+n)%n:null}(e.key,t,r.length);if(null!==a){e.preventDefault();var l=r[a];if(l){i(l.id);var s=null==(n=e.currentTarget.parentElement)?void 0:n.querySelectorAll('[role="tab"]');null==s||null==(o=s[a])||o.focus()}}}(e,t)},className:tt("flex shrink-0 cursor-pointer items-center rounded-xl text-left transition-[color,background-color,box-shadow,transform] duration-150 active:translate-y-px",a?"bg-primary/[0.09] text-primary shadow-[inset_0_0_0_1px_rgb(99_91_255/0.13)]":"text-muted-foreground hover:bg-card hover:text-foreground",s),children:c(e,a)},e.id)})})}function ur(e){var t,n=e.options,r=e.value,o=e.onChange,i=e.className,a=e.children;return(0,x.jsx)("div",{className:tt("grid rounded-lg bg-muted p-1",i),style:(t=n.length,{gridTemplateColumns:"repeat(".concat(t,", minmax(0, 1fr))")}),children:n.map(function(e){return(0,x.jsx)("button",{type:"button","aria-pressed":e===r,onClick:function(){return o(e)},className:tt("flex items-center justify-center gap-2 rounded-md py-1.5 text-sm font-medium transition-colors",e===r?"bg-background text-foreground shadow-sm":"cursor-pointer text-muted-foreground hover:text-foreground"),children:a(e)},e)})})}function uo(e){var t=e.idPrefix,n=e.value,r=e.as,o=e.className,i=e.children;return(0,x.jsx)(void 0===r?"div":r,{role:"tabpanel",id:ut(t,n),"aria-labelledby":ue(t,n),className:o,children:i})}function ui(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ua(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ul(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ua(i,r,o,a,l,"next",e)}function l(e){ua(i,r,o,a,l,"throw",e)}a(void 0)})}}function us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ui(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ui(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uc(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function uu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ud(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uu(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var up=["device","token"];function uh(e){var t=e.onConnected,n=e.onMessage,r=e.onError,o=e.onClear,i=(0,to.Bd)().t,a=uf((0,w.useState)("device"),2),l=a[0],s=a[1],c=uf((0,w.useState)(""),2),u=c[0],d=c[1],f=uf((0,w.useState)(!1),2),p=f[0],h=f[1],m=function(e){var t=us((0,w.useState)(null),2),n=t[0],r=t[1],o=us((0,w.useState)(!1),2),i=o[0],a=o[1],l=us((0,w.useState)(!1),2),s=l[0],c=l[1],u=us((0,w.useState)(!1),2),d=u[0],f=u[1],p=us((0,w.useState)(5),2),h=p[0],m=p[1],v=(0,w.useRef)(null),g=(0,w.useRef)(e);function y(){v.current&&(clearInterval(v.current),v.current=null),c(!1)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;v.current&&clearInterval(v.current),c(!0),m(t),v.current=setInterval(function(){x(e,!1)},1e3*Math.max(t,5))}function x(e,t){return ul(function(){var n;return uc(this,function(o){switch(o.label){case 0:t&&(f(!0),g.current.onStarted()),o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,ov("/api/github/device/poll",{method:"POST",body:JSON.stringify({deviceCode:e})})];case 2:return function(e,t){if("authorized"===e.status){var n;y(),r(null),g.current.onAuthorized(null!=(n=e.username)?n:"");return}if("expired"===e.status||"error"===e.status){y();var o="expired"===e.status?"githubSync.codeExpired":"githubSync.authFailed";g.current.onError(e.error?oP(e.error):{key:o});return}e.interval&&e.interval>5&&b(t,e.interval)}(o.sent(),e),[3,5];case 3:return n=o.sent(),t&&g.current.onError(oP(n)),[3,5];case 4:return t&&f(!1),[7];case 5:return[2]}})})()}return g.current=e,(0,w.useEffect)(function(){return function(){return y()}},[]),{code:n,requesting:i,polling:s,checking:d,intervalSeconds:h,requestCode:function(){return ul(function(){var e,t;return uc(this,function(n){switch(n.label){case 0:a(!0),g.current.onStarted(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,ov("/api/github/device/code",{method:"POST",body:JSON.stringify({})})];case 2:return r(e=n.sent()),b(e.deviceCode,e.interval),[3,5];case 3:return t=n.sent(),g.current.onError(oP(t)),[3,5];case 4:return a(!1),[7];case 5:return[2]}})})()},checkNow:function(){return ul(function(){return uc(this,function(e){switch(e.label){case 0:if(!(null==n?void 0:n.deviceCode))return[3,2];return[4,x(n.deviceCode,!0)];case 1:e.sent(),e.label=2;case 2:return[2]}})})()}}}({onStarted:o,onError:r,onAuthorized:function(e){return n({key:"githubSync.authorized",params:{user:e}})}});return(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:i("githubSync.intro")}),(0,x.jsx)(ur,{options:up,value:l,onChange:s,children:function(e){return"device"===e?i("githubSync.tabDevice"):i("githubSync.tabToken")}}),"device"===l?(0,x.jsx)(um,{device:m}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"github-pat",children:i("githubSync.tokenLabel")}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(c9,{className:"absolute left-3 top-2.5 size-4 text-muted-foreground"}),(0,x.jsx)(i4,{id:"github-pat",type:"password",className:"pl-9",placeholder:i("githubSync.tokenPlaceholder"),value:u,onChange:function(e){return d(e.target.value)}})]}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:i("githubSync.tokenScopeHint")})]}),(0,x.jsxs)(tr,{disabled:!u.trim()||p,onClick:function(){var e;(e=function(){var e,i;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:if(!u.trim())return[2];h(!0),o(),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,ov("/api/github/token",{method:"POST",body:JSON.stringify({token:u.trim()})})];case 2:return t(i=a.sent()),d(""),n({key:"githubSync.connected",params:{user:null!=(e=i.username)?e:""}}),[3,5];case 3:return r(oP(a.sent())),[3,5];case 4:return h(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ud(i,r,o,a,l,"next",e)}function l(e){ud(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[(0,x.jsx)(c3,{className:"mr-2 size-4"}),p?i("githubSync.connecting"):i("githubSync.connectToken")]})]})]})}function um(e){var t=e.device,n=(0,to.Bd)().t,r=uf((0,w.useState)(!1),2),o=r[0],i=r[1];function a(){var e;(null==(e=t.code)?void 0:e.userCode)&&(navigator.clipboard.writeText(t.code.userCode),i(!0),setTimeout(function(){return i(!1)},2e3))}return t.code?(0,x.jsxs)("div",{className:"space-y-5 rounded-2xl border bg-muted/20 p-5",children:[(0,x.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-2",children:[(0,x.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:n("githubSync.userCode")}),(0,x.jsxs)("button",{type:"button",onClick:a,className:"group inline-flex cursor-pointer items-center gap-3 rounded-xl border border-primary/20 bg-background/90 px-5 py-2.5 font-mono text-3xl font-extrabold tracking-widest text-primary transition-colors hover:border-primary/50 hover:bg-primary/5",title:n("githubSync.copyCode"),children:[(0,x.jsx)("span",{children:t.code.userCode}),(0,x.jsx)("span",{className:"rounded-md bg-primary/10 p-1 text-primary transition-colors group-hover:bg-primary/20",children:o?(0,x.jsx)(aY,{className:"size-4 text-emerald-600 dark:text-emerald-400"}):(0,x.jsx)(c7,{className:"size-4"})})]}),o?(0,x.jsx)("p",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:n("githubSync.copied")}):null]}),(0,x.jsxs)("div",{className:"flex flex-col items-center space-y-3",children:[(0,x.jsx)(tr,{className:"px-6 font-semibold",asChild:!0,children:(0,x.jsxs)("a",{href:t.code.verificationUri,target:"_blank",rel:"noopener noreferrer",onClick:a,children:[(0,x.jsx)(c5,{className:"mr-1.5 size-4"}),n("githubSync.openAuthPage")]})}),(0,x.jsxs)("div",{className:"flex w-full items-center justify-between rounded-xl border border-border/40 bg-background/50 px-3 py-2 text-xs text-muted-foreground",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(c6,{className:tt("size-3.5 text-primary",(t.polling||t.checking)&&"animate-spin")}),(0,x.jsx)("span",{children:t.checking?n("githubSync.checkingAuth"):t.polling&&t.intervalSeconds>5?n("githubSync.waitingAuthInterval",{seconds:t.intervalSeconds}):n("githubSync.waitingAuth")})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("button",{type:"button",className:"cursor-pointer font-medium text-primary hover:underline disabled:opacity-50",disabled:t.checking,onClick:function(){t.checkNow()},children:n("githubSync.checkNow")}),(0,x.jsx)("span",{children:"\xb7"}),(0,x.jsx)("button",{type:"button",className:"cursor-pointer text-muted-foreground hover:text-foreground",onClick:function(){t.requestCode()},children:n("githubSync.regenerateCode")})]})]})]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("githubSync.deviceIntro")}),(0,x.jsx)("div",{className:"flex justify-center",children:(0,x.jsxs)(tr,{className:"px-6",disabled:t.requesting,onClick:function(){t.requestCode()},children:[(0,x.jsx)(c3,{className:"mr-2 size-4"}),n(t.requesting?"githubSync.checkingAuth":"githubSync.getCode")]})})]})}let uv=P("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]),ug=P("cloud-download",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);function uy(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ub(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function ux(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ub(i,r,o,a,l,"next",e)}function l(e){ub(i,r,o,a,l,"throw",e)}a(void 0)})}}function uw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function uk(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uy(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uj(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var uS=["push","pull"];function uO(e){var t=e.onDone,n=e.onSynced,r=e.onMessage,o=e.onError,i=e.onClear,a=(0,to.Bd)().t,l=(0,to.s9)().locale,s=iV(function(e){return e.loadHarnesses}),c=iV(function(e){return e.setNotice}),u=uk((0,w.useState)("push"),2),d=u[0],f=u[1],p=uk((0,w.useState)(""),2),h=p[0],m=p[1],v=uk((0,w.useState)(!1),2),g=v[0],y=v[1],b=uk((0,w.useState)(""),2),k=b[0],j=b[1],S=uk((0,w.useState)(null),2),O=S[0],C=S[1],N=cG({fetchPreview:function(e){return ux(function(){var t;return uj(this,function(n){switch(n.label){case 0:return[4,ov("/api/github/pull/preview",{method:"POST",body:JSON.stringify(uw({passphrase:k},e))})];case 1:return C((t=n.sent()).gistUpdatedAt),[2,t.preview]}})})()},runImport:function(e){var t,n;return ov("/api/github/pull",{method:"POST",body:JSON.stringify((t=uw({passphrase:k},e),n=n={migrateCodexLoginCache:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})},onImported:function(e){return ux(function(){return uj(this,function(n){switch(n.label){case 0:return[4,s()];case 1:return n.sent(),c(c$(a,e)),t(),[2]}})})()}});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ur,{options:uS,value:d,onChange:f,children:function(e){return(0,x.jsxs)(x.Fragment,{children:["push"===e?(0,x.jsx)(uv,{className:"size-4"}):(0,x.jsx)(ug,{className:"size-4"}),"push"===e?a("githubSync.pushTitle"):a("githubSync.pullTitle")]})}}),"push"===d?(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:a("githubSync.pushIntro")}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsx)(uC,{id:"push-passphrase",placeholder:a("githubSync.passphrasePlaceholder"),value:h,onChange:m}),(0,x.jsxs)(tr,{disabled:!h||g,onClick:function(){ux(function(){var e;return uj(this,function(t){switch(t.label){case 0:if(!h)return[2];y(!0),i(),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,ov("/api/github/push",{method:"POST",body:JSON.stringify({passphrase:h,includeCodexLoginCache:!0})})];case 2:return r({key:"githubSync.pushSuccess",params:{profiles:(e=t.sent()).exportedProfilesCount,vault:e.exportedVaultCount}}),n(),[3,5];case 3:return o(oP(t.sent())),[3,5];case 4:return y(!1),[7];case 5:return[2]}})})()},children:[(0,x.jsx)(uv,{className:"mr-1.5 size-4"}),g?a("githubSync.pushing"):a("githubSync.pushTitle")]})]})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:a("githubSync.pullIntro")}),(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[(0,x.jsx)(uC,{id:"pull-passphrase",placeholder:a("githubSync.pullPassphrasePlaceholder"),value:k,onChange:function(e){j(e),N.invalidate()}}),(0,x.jsxs)(tr,{variant:"outline",disabled:!k||null!==N.pending,onClick:function(){N.inspect()},children:[(0,x.jsx)(c6,{className:tt("mr-1.5 size-4","preview"===N.pending&&"animate-spin")}),"preview"===N.pending?a("transfer.inspecting"):a("githubSync.inspect")]})]}),N.preview?(0,x.jsx)(cH,{idPrefix:"gist",preview:N.preview,conflictPolicy:N.conflictPolicy,restoreActive:N.restoreActive,stale:N.stale,pending:"import"===N.pending,canImport:N.canImport,onPolicyChange:N.changePolicy,onRestoreActiveChange:N.changeRestoreActive,onConfirm:function(){N.confirm()},meta:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:"font-medium text-foreground",children:a("githubSync.previewTitle")}),O?(0,x.jsx)("span",{children:a("githubSync.backedUpAt",{time:new Date(O).toLocaleString(l)})}):null]})}):null]})]})}function uC(e){var t=e.id,n=e.placeholder,r=e.value,o=e.onChange,i=(0,to.Bd)().t;return(0,x.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:t,children:i("githubSync.passphrase")}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(tp,{className:"absolute left-3 top-2.5 size-4 text-muted-foreground"}),(0,x.jsx)(i4,{id:t,type:"password",className:"pl-9",placeholder:n,value:r,onChange:function(e){return o(e.target.value)}})]})]})}function uN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uP(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return uN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uN(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uI(e){var t=e.onDone,n=(0,to.Bd)().t,r=iV(function(e){return e.githubStatus}),o=iV(function(e){return e.githubStatusLoading}),i=iV(function(e){return e.githubStatusError}),a=iV(function(e){return e.loadGithubStatus}),l=iV(function(e){return e.setGithubStatus}),s=iV(function(e){return e.disconnectGithub}),c=uE((0,w.useState)(null),2),u=c[0],d=c[1],f=uE((0,w.useState)(null),2),p=f[0],h=f[1];function m(){d(null),h(null)}(0,w.useEffect)(function(){null===r&&a()},[r,a]);var v=null!=u?u:i,g=null===r&&null===i;return(0,x.jsxs)("div",{className:"space-y-5",children:[v?(0,x.jsx)("div",{className:"rounded-lg border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive",children:oA(n,v)}):null,p?(0,x.jsx)("div",{className:"rounded-lg border border-emerald-500/40 bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400",children:oA(n,p)}):null,g?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(c2,{className:"size-4 animate-spin"}),n("githubSync.loading")]}):(null==r?void 0:r.connected)?(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)(c8,{status:r,refreshing:o,onRefresh:function(){a()},onDisconnect:function(){var e;(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:m(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s()];case 2:return e.sent(),h({key:"githubSync.disconnected"}),[3,4];case 3:return d(oP(e.sent())),[3,4];case 4:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){uP(i,r,o,a,l,"next",e)}function l(e){uP(i,r,o,a,l,"throw",e)}a(void 0)})})()}}),(0,x.jsx)(uO,{onDone:t,onSynced:function(){a()},onMessage:h,onError:d,onClear:m})]}):(0,x.jsx)(uh,{onConnected:l,onMessage:function(e){h(e),a()},onError:d,onClear:m})]})}let uA=P("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function u_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uM(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){uT(e,t,n[t])})}return e}function uz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u_(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u_(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uD(){var e=(0,to.Bd)().t,t=iV(function(e){return e.scan}),n=iV(function(e){return e.scanLoading}),r=iV(function(e){return e.scanError}),o=iV(function(e){return e.loadScan}),i=iV(function(e){return e.importScan}),a=iV(function(e){return e.providers}),l=iV(function(e){return e.loadProviders}),s=uz((0,w.useState)({}),2),c=s[0],u=s[1],d=uz((0,w.useState)(!1),2),f=d[0],p=d[1],h=uz((0,w.useState)(null),2),m=h[0],v=h[1],g=uz((0,w.useState)(null),2),y=g[0],b=g[1];(0,w.useEffect)(function(){o(),l()},[o,l]),(0,w.useEffect)(function(){t&&u(function(e){var n={},r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s=a.value,c=!0,u=!1,d=void 0;try{for(var f,p=s.candidates[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var h,m,v=f.value;n[v.id]=null!=(h=e[v.id])?h:{selected:!1,name:v.suggestedName,target:v.matchesProvider?"vault":"profile",providerId:null!=(m=v.matchesProvider)?m:"",apiKey:"",overwrite:!1}}}catch(e){u=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(u)throw d}}}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n})},[t]);var k=(null!=t?t:[]).flatMap(function(e){return e.candidates}).filter(function(e){var t;return null==(t=c[e.id])?void 0:t.selected}),j=k.filter(function(e){var t=c[e.id],n=!e.apiKeyPresent&&!t.apiKey.trim(),r="vault"===t.target&&""!==t.providerId;return!t.name.trim()||n&&!r});return(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e("import.intro")}),n?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(c2,{className:"size-4 animate-spin"}),e("import.scanning")]}):null,r?(0,x.jsx)("p",{className:"py-6 text-sm text-destructive",children:oA(e,r)}):null,y?(0,x.jsxs)("div",{className:"rounded-xl border border-emerald-500/40 bg-emerald-500/5 px-4 py-3 text-sm",children:[(0,x.jsxs)("p",{className:"flex items-center gap-2 font-medium",children:[(0,x.jsx)(uA,{className:"size-4 text-emerald-600"}),e("import.summary",{imported:y.imported,skipped:y.skipped,providersCreated:y.providersCreated})]}),y.warnings.map(function(t){return(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:oA(e,t)},t.key+t.scope)})]}):null,(null!=t?t:[]).map(function(t){var n,r;return(0,x.jsxs)("section",{className:"rounded-2xl border bg-card px-4 py-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("h3",{className:"text-sm font-semibold",children:t.label}),t.candidates.length>0?(0,x.jsx)(tb,{variant:"secondary",children:e("import.providerCount",{count:t.candidates.length})}):null]}),(0,x.jsx)("ul",{className:"mt-2 space-y-0.5",children:t.sources.map(function(t){return(0,x.jsxs)("li",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[t.path," \xb7"," ",t.exists?t.parsable?e("import.sourceRead"):e("import.sourceUnparsable"):e("import.sourceMissing")]},t.key)})}),0===t.candidates.length?(0,x.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:(n=e,(r=t).noteCode?oA(n,{key:r.noteCode,params:r.noteData}):"")}):(0,x.jsx)("ul",{className:"mt-3 space-y-3",children:t.candidates.map(function(e){return(0,x.jsx)(uL,{candidate:e,choice:c[e.id],providers:null!=a?a:[],onChange:function(t){var n;return n=e.id,void u(function(e){var r,o;return r=uR({},e),o=null!=(o=uT({},n,uR({},e[n],t)))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r})}},e.id)})})]},t.harness)}),m?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(e,m)}):null,(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,x.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:k.length>0?e("import.selected",{count:k.length}):e("import.selectPrompt")}),(0,x.jsxs)(tr,{variant:"outline",onClick:function(){o()},disabled:n,children:[(0,x.jsx)(an,{}),e("import.rescan")]}),(0,x.jsxs)(tr,{disabled:0===k.length||j.length>0||f,onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:p(!0),v(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,i(k.map(function(e){var t=c[e.id];return uR({id:e.id,name:t.name.trim(),target:t.target},"vault"===t.target&&t.providerId?{providerId:t.providerId}:{},t.apiKey.trim()?{apiKey:t.apiKey.trim()}:{},t.overwrite?{overwrite:!0}:{})}))];case 2:return b({imported:(e=t.sent()).imported,skipped:e.skipped,providersCreated:e.providersCreated,warnings:e.warnings.map(oN)}),u({}),[3,5];case 3:return v(oE(t.sent(),"import.failed")),[3,5];case 4:return p(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){uM(i,r,o,a,l,"next",e)}function l(e){uM(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[f?(0,x.jsx)(c2,{className:"animate-spin"}):null,e("import.importSelected")]})]})]})}function uL(e){var t=e.candidate,n=e.choice,r=e.providers,o=e.onChange,i=(0,to.Bd)().t;if(!n)return null;var a="vault"===n.target&&""!==n.providerId,l=!t.apiKeyPresent&&!a;return(0,x.jsx)("li",{className:"rounded-xl border bg-background px-3 py-3",children:(0,x.jsxs)("div",{className:"flex items-start gap-3",children:[(0,x.jsx)(aX,{className:"mt-1",checked:n.selected,onCheckedChange:function(e){return o({selected:!0===e})},"aria-label":i("import.select",{name:t.sourceKey})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("span",{className:"truncate font-mono text-sm",children:t.sourceKey}),t.active?(0,x.jsx)(tb,{children:i("import.inUse")}):null,t.conflictsWith?(0,x.jsx)(tb,{variant:"secondary",children:i("import.nameTaken")}):null,t.matchesProvider?(0,x.jsx)(tb,{variant:"secondary",children:i("import.matchesProvider",{name:t.matchesProvider})}):null]}),(0,x.jsxs)("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[t.baseUrl||i("import.noBaseUrl"),t.model?" \xb7 ".concat(t.model):"",t.apiKeyPresent?" \xb7 ".concat(t.apiKeyPreview):" \xb7 ".concat(i("import.keyOutsideConfig"))]}),n.selected?(0,x.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(iQ,{htmlFor:"name-".concat(t.id),children:i("import.profileName")}),(0,x.jsx)(i4,{id:"name-".concat(t.id),value:n.name,onChange:function(e){return o({name:e.target.value})}})]}),(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(iQ,{htmlFor:"target-".concat(t.id),children:i("import.credentialTarget")}),(0,x.jsxs)(sV,{value:"vault"===n.target?n.providerId||"new-vault":"profile",onValueChange:function(e){return o("profile"===e?{target:"profile",providerId:""}:"new-vault"===e?{target:"vault",providerId:""}:{target:"vault",providerId:e})},children:[(0,x.jsx)(cT,{id:"target-".concat(t.id),children:(0,x.jsx)(sG,{})}),(0,x.jsxs)(cD,{children:[(0,x.jsx)(cL,{value:"profile",children:i("import.targetProfile")}),(0,x.jsx)(cL,{value:"new-vault",children:i("import.targetNewVault")}),r.map(function(e){return(0,x.jsx)(cL,{value:e.id,children:i("import.targetExisting",{name:e.name})},e.id)})]})]})]}),l?(0,x.jsxs)("div",{className:"space-y-1.5 sm:col-span-2",children:[(0,x.jsx)(iQ,{htmlFor:"key-".concat(t.id),children:i("common.apiKey")}),(0,x.jsx)(i4,{id:"key-".concat(t.id),type:"password",value:n.apiKey,placeholder:i("import.apiKeyFromEnv"),onChange:function(e){return o({apiKey:e.target.value})}})]}):null,t.conflictsWith?(0,x.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground sm:col-span-2",children:[(0,x.jsx)(aX,{checked:n.overwrite,onCheckedChange:function(e){return o({overwrite:!0===e})}}),i("import.overwriteExisting")]}):null]}):null]})]})})}function uF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uU(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function uH(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){uU(i,r,o,a,l,"next",e)}function l(e){uU(i,r,o,a,l,"throw",e)}a(void 0)})}}function u$(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||uK(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uB(e){return function(e){if(Array.isArray(e))return uF(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uK(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uK(e,t){if(e){if("string"==typeof e)return uF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uF(e,t)}}function uq(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function uV(e){var t=e.onDone,n=(0,to.Bd)().t,r=iV(function(e){return e.users}),o=iV(function(e){return e.currentUser}),i=iV(function(e){return e.loadHarnesses}),a=iV(function(e){return e.loadProviders}),l=iV(function(e){return e.setNotice}),s=(0,w.useMemo)(function(){return r.filter(function(e){return e.username!==o&&!1!==e.manageable})},[r,o]),c=u$((0,w.useState)(""),2),u=c[0],d=c[1],f=u$((0,w.useState)(null),2),p=f[0],h=f[1],m=u$((0,w.useState)([]),2),v=m[0],g=m[1],y=u$((0,w.useState)(!1),2),b=y[0],k=y[1],j=u$((0,w.useState)(!1),2),S=j[0],O=j[1],C=u$((0,w.useState)(!1),2),N=C[0],P=C[1],E=u$((0,w.useState)(null),2),I=E[0],A=E[1],_=(0,w.useMemo)(function(){return ta.oo.flatMap(function(e){var t,n=null!=(t=null==p?void 0:p.conflicts.filter(function(t){return t.harness===e}).length)?t:0;return n>0?[{harness:e,count:n}]:[]})},[p]),M=o||n("notice.currentUser");function T(){return uH(function(){var e;return uq(this,function(n){switch(n.label){case 0:if(!u||!p)return[2];P(!0),A(null),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,ov("/api/users/sync",{method:"POST",body:JSON.stringify({sourceUser:u,conflictPolicy:"skip",overwriteHarnesses:v,migrateCodexLoginCache:b})})];case 2:return e=n.sent(),[4,Promise.all([i(),a()])];case 3:return n.sent(),l([{key:"sync.done",params:{imported:e.imported,overwritten:e.overwritten,skipped:e.skipped,providersCopied:e.providersCopied}},{key:e.codexLoginCacheMigrated?"sync.cacheMigrated":"sync.cacheNotMigrated"}].concat(uB(e.warnings.map(function(e){return oN(e)})))),t(),[3,6];case 4:return A(oP(n.sent())),[3,6];case 5:return P(!1),[7];case 6:return[2]}})})()}return(0,w.useEffect)(function(){d(function(e){var t,n;return s.some(function(t){return t.username===e})?e:null!=(t=null==(n=s[0])?void 0:n.username)?t:""})},[s]),0===s.length?(0,x.jsxs)("div",{className:"flex items-start gap-3 rounded-2xl border bg-muted/25 p-4",children:[(0,x.jsx)(ar,{className:"mt-0.5 size-5 text-muted-foreground"}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("sync.noOtherUsers")})]}):(0,x.jsxs)("div",{className:"space-y-5",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:n("sync.intro",{user:M})}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"sync-source-user",children:n("sync.sourceUser")}),(0,x.jsxs)(sV,{value:u,onValueChange:function(e){d(e),h(null),g([]),k(!1)},children:[(0,x.jsx)(cT,{id:"sync-source-user",children:(0,x.jsx)(sG,{placeholder:n("sync.selectUser")})}),(0,x.jsx)(cD,{children:s.map(function(e){return(0,x.jsxs)(cL,{value:e.username,children:[e.username," \xb7 ",e.homeDir]},e.username)})})]})]}),p?(0,x.jsxs)("div",{className:"space-y-4 rounded-2xl border bg-muted/25 p-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,x.jsx)(tb,{variant:"secondary",children:n("sync.profileCount",{count:p.profileCount})}),(0,x.jsx)(tb,{variant:"secondary",children:n("sync.providerCount",{count:p.providerCount})}),(0,x.jsx)(tb,{variant:p.conflicts.length>0?"destructive":"outline",children:n("sync.conflictCount",{count:p.conflicts.length})})]}),p.conflicts.length>0?(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"space-y-1",children:[(0,x.jsx)(iQ,{children:n("sync.overwriteByHarness")}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("sync.overwriteHint")})]}),(0,x.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:_.map(function(e){var t=e.harness,r=e.count;return(0,x.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,x.jsx)(aX,{checked:v.includes(t),onCheckedChange:function(e){return g(function(n){return!0===e?uB(n).concat([t]):n.filter(function(e){return e!==t})})},className:"mt-0.5"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block font-medium",children:n("sync.overwriteHarness",{harness:ta.RP[t]})}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:n("sync.conflictsInHarness",{count:r})})]})]},t)})})]}):null,p.codexLoginCache.available&&p.codexLoginCache.migrationNeeded?(0,x.jsxs)("label",{className:"block space-y-3 rounded-xl border bg-background/70 p-3 text-sm",children:[(0,x.jsxs)("span",{className:"flex cursor-pointer items-start gap-3",children:[(0,x.jsx)(aX,{checked:b,onCheckedChange:function(e){return k(!0===e)},className:"mt-0.5"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block font-medium",children:n("sync.migrateCache")}),(0,x.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-muted-foreground",children:n("sync.migrateCacheHint")})]})]}),p.codexLoginCache.targetExists?(0,x.jsx)("span",{className:"block rounded-lg bg-amber-500/10 px-3 py-2 text-xs leading-relaxed text-amber-700 dark:text-amber-300",children:n("sync.migrateCacheOverwrite")}):null]}):null,(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("sync.storeOnlyHint")})]}):null,I?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(n,I)}):null,p?b?(0,x.jsxs)(ap,{open:S,onOpenChange:O,children:[(0,x.jsxs)(tr,{disabled:N,onClick:function(){return O(!0)},children:[(0,x.jsx)(c7,{}),N?n("sync.syncing"):n("sync.syncTo",{user:M})]}),(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:n("sync.confirmCacheTitle")}),(0,x.jsx)(aI,{children:n("sync.confirmCacheBody",{source:u,target:M,extra:p.codexLoginCache.targetExists?n("sync.confirmCacheOverwrite"):n("sync.confirmCacheFresh")})})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:n("common.cancel")}),(0,x.jsx)(aA,{onClick:function(){T()},children:n("sync.confirmCacheAction")})]})]})]}):(0,x.jsxs)(tr,{disabled:N,onClick:function(){T()},children:[(0,x.jsx)(c7,{}),N?n("sync.syncing"):n("sync.syncTo",{user:M})]}):(0,x.jsxs)(tr,{disabled:!u||N,onClick:function(){uH(function(){var e;return uq(this,function(t){switch(t.label){case 0:if(!u)return[2];P(!0),A(null),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,ov("/api/users/sync/preview",{method:"POST",body:JSON.stringify({sourceUser:u})})];case 2:return h(t.sent()),g([]),k(!1),O(!1),[3,5];case 3:return e=t.sent(),h(null),g([]),A(oP(e)),[3,5];case 4:return P(!1),[7];case 5:return[2]}})})()},children:[(0,x.jsx)(c7,{}),N?n("sync.inspecting"):n("sync.inspect")]})]})}function uW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var uG=[{id:"scan",icon:an},{id:"user",icon:ar},{id:"file",icon:ao},{id:"gist",icon:ai}];function uZ(e){var t,n=e.open,r=e.onOpenChange,o=(0,to.Bd)().t,i=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)("scan"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return uW(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return uW(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1];return(0,x.jsx)(r_,{open:n,onOpenChange:r,children:(0,x.jsxs)(r1,{className:"flex h-[calc(100dvh-1rem)] max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-4xl flex-col gap-0 overflow-hidden p-0 sm:h-[min(90dvh,40rem)] sm:max-h-[90dvh] sm:w-full",children:[(0,x.jsxs)(r2,{className:"shrink-0 border-b px-5 py-4 pr-12 text-left sm:px-6",children:[(0,x.jsx)(r4,{children:o("transfer.title")}),(0,x.jsx)(r5,{children:o("transfer.intro")})]}),(0,x.jsxs)("div",{className:"grid min-h-0 flex-1 grid-rows-[auto_minmax(0,1fr)] sm:grid-cols-[13rem_minmax(0,1fr)] sm:grid-rows-[minmax(0,1fr)]",children:[(0,x.jsx)(un,{label:o("transfer.sourceLabel"),idPrefix:"transfer",orientation:"vertical",items:uG,value:a,onChange:l,className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 sm:flex-col sm:overflow-x-visible sm:overflow-y-auto sm:border-b-0 sm:border-r",tabClassName:"gap-2.5 px-3 py-2.5 text-sm sm:w-full",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,x.jsx)("span",{className:"whitespace-nowrap font-medium sm:whitespace-normal",children:o("transfer.sources.".concat(e.id))})]})}}),(0,x.jsxs)(uo,{idPrefix:"transfer",value:a,className:"min-h-0 overflow-y-auto overscroll-contain px-4 py-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:px-6",children:["scan"===a?(0,x.jsx)(uD,{}):null,"user"===a?(0,x.jsx)(uV,{onDone:function(){return r(!1)}}):null,"file"===a?(0,x.jsx)(c1,{onDone:function(){return r(!1)}}):null,"gist"===a?(0,x.jsx)(uI,{onDone:function(){return r(!1)}}):null]})]})]})})}let uY=P("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),uX=P("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),uJ=P("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),uQ=P("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var u0={ok:"bg-emerald-500",warn:"bg-amber-500",error:"bg-red-500",unknown:"bg-slate-400"};function u1(e){var t,n=e.harnessId,r=e.open,o=e.onOpenChange,i=(0,to.Bd)().t,a=iV(function(e){return e.doctor}),l=iV(function(e){return e.doctorLoading}),s=iV(function(e){return e.doctorError}),c=iV(function(e){return e.doctorUpdatedAvailable}),u=iV(function(e){return e.loadDoctor}),d=null!=(t=null==a?void 0:a.find(function(e){return e.harness===n}))?t:null;(0,w.useEffect)(function(){r&&null===d&&u(n)},[r,d,n,u]);var f=function(e){var t={ok:0,warn:0,error:0,unknown:0};if(!e)return t;var n=!0,r=!1,o=void 0;try{for(var i,a=e.checks[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;t[l.status]++}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}(d),p=ta.RP[n];return(0,x.jsx)(r_,{open:r,onOpenChange:o,children:(0,x.jsxs)(r1,{className:"flex max-h-[88vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,x.jsxs)(r2,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,x.jsx)(r4,{children:i("doctor.titleFor",{harness:p})}),(0,x.jsx)(r5,{children:i("doctor.intro")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain px-6",children:[l&&null===d?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("doctor.checking")}):null,s?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(i,s)}):null,d?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[f.ok>0?(0,x.jsx)(tb,{variant:"secondary",children:i("doctor.countOk",{count:f.ok})}):null,f.warn>0?(0,x.jsx)(tb,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:i("doctor.countWarn",{count:f.warn})}):null,f.error>0?(0,x.jsx)(tb,{variant:"destructive",children:i("doctor.countError",{count:f.error})}):null,f.unknown>0?(0,x.jsx)(tb,{variant:"outline",children:i("doctor.countUnknown",{count:f.unknown})}):null,c?(0,x.jsxs)("span",{className:"ml-auto flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:[(0,x.jsx)(uQ,{className:"size-3.5"}),i("doctor.updateAvailable")]}):null]}),(0,x.jsx)(u2,{checks:d.checks})]}):null,null!==d||l||s?null:(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("doctor.notRun")})]}),(0,x.jsxs)(r3,{className:"shrink-0 px-6 py-4",children:[(0,x.jsxs)(tr,{variant:"outline",disabled:l,onClick:function(){u(n)},children:[(0,x.jsx)(uJ,{className:l?"animate-spin":void 0}),i("doctor.rerun")]}),(0,x.jsx)(tr,{onClick:function(){return o(!1)},children:i("doctor.close")})]})]})})}function u2(e){var t=e.checks,n=(0,to.Bd)().t;return 0===t.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.noChecks")}):(0,x.jsx)("ul",{className:"divide-y rounded-xl border",children:t.map(function(e){return(0,x.jsxs)("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[(0,x.jsx)("span",{className:tt("mt-1.5 size-2 shrink-0 rounded-full",u0[e.status]),"aria-hidden":!0}),(0,x.jsx)("div",{className:"min-w-0 flex-1",children:(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,x.jsx)("p",{className:"text-sm leading-relaxed",children:oA(n,{key:e.code,params:e.data})}),(0,x.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:n("doctor.status.".concat(e.status))})]})})]},e.id)})})}function u3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u4(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u3(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u5(e){switch(e){case"in-sync":return"border-transparent bg-emerald-500/15 text-emerald-600 dark:text-emerald-400";case"drifted":return"border-amber-500/30 text-amber-700 dark:text-amber-300";case"missing":case"invalid":return"border-transparent bg-destructive/15 text-destructive";default:return""}}function u6(e){var t,n=e.harness,r=e.open,o=e.onOpenChange,i=(0,to.Bd)().t,a=iV(function(e){return e.drift}),l=iV(function(e){return e.driftLoading}),s=iV(function(e){return e.reapplyDrift}),c=iV(function(e){return e.adoptDrift}),u=u4((0,w.useState)(null),2),d=u[0],f=u[1],p=u4((0,w.useState)(null),2),h=p[0],m=p[1],v=(0,w.useMemo)(function(){var e;return null!=(e=null==a?void 0:a.find(function(e){return e.harness===n.id}))?e:null},[a,n.id]),g=null!=(t=null==v?void 0:v.files.filter(function(e){return"in-sync"!==e.status}))?t:[],y=(null==v?void 0:v.active)===!0;return(0,x.jsxs)(r_,{open:r,onOpenChange:o,children:[(0,x.jsxs)(r1,{className:"flex max-h-[85vh] w-[min(64rem,calc(100vw-2rem))] max-w-5xl flex-col overflow-hidden",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:i("drift.dialogTitle",{harness:n.label})}),(0,x.jsx)(r5,{children:i(y?"drift.legend":"drift.noActiveProfile")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[l&&null===v?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:i("drift.checking")}):null,null!==v||l?null:(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:i("drift.noData")}),v&&!y?(0,x.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground",children:i("drift.nothingToCompare")}):null,v&&y?(0,x.jsx)("div",{className:"space-y-3",children:0===g.length?(0,x.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:i("drift.allInSync")}):g.map(function(e){return(0,x.jsx)(u8,{file:e},e.key)})}):null]}),h?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(i,h)}):null,(0,x.jsxs)(r3,{children:[(0,x.jsx)(tr,{variant:"outline",disabled:null===v||!y,onClick:function(){return f("adopt")},children:i("drift.adopt")}),(0,x.jsx)(tr,{disabled:null===v||!y,onClick:function(){return f("reapply")},children:i("drift.reapply")})]})]}),(0,x.jsx)(ap,{open:"reapply"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:i("drift.reapplyTitle")}),(0,x.jsx)(aI,{children:i("drift.reapplyBody",{harness:n.label})})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:i("common.cancel")}),(0,x.jsx)(aA,{onClick:function(){f(null),m(null),s(n.id).then(function(){return o(!1)}).catch(function(e){m(oE(e,"drift.reapplyFailed"))})},children:i("drift.confirmReapply")})]})]})}),(0,x.jsx)(ap,{open:"adopt"===d,onOpenChange:function(e){return!e&&f(null)},children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:i("drift.adoptTitle")}),(0,x.jsx)(aI,{children:i("drift.adoptBody")})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:i("common.cancel")}),(0,x.jsx)(aA,{onClick:function(){f(null),m(null),c(n.id).then(function(){return o(!1)}).catch(function(e){m(oE(e,"drift.adoptFailed"))})},children:i("drift.confirmAdopt")})]})]})})]})}function u8(e){var t=e.file,n=(0,to.Bd)().t;return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,x.jsx)(tb,{className:u5(t.status),children:n("drift.status.".concat(t.status))}),(0,x.jsx)("p",{className:"min-w-0 truncate font-mono text-xs text-muted-foreground",title:t.path,children:t.path})]}),(0,x.jsx)(tN,{files:[{path:t.path,existed:null!==t.currentContent,content:t.expectedContent,currentContent:t.currentContent}]})]})}function u9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u9(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e){var t,n,r,o=iV(function(e){return e.doctor}),i=iV(function(e){return e.doctorLoading}),a=iV(function(e){return e.doctorError}),l=iV(function(e){return e.loadDoctor}),s=iV(function(e){return e.drift}),c=iV(function(e){return e.driftLoading}),u=iV(function(e){return e.driftError}),d=iV(function(e){return e.loadDrift}),f=null!=(t=null==o?void 0:o.find(function(t){return t.harness===e.id}))?t:null,p=null!=(n=null==s?void 0:s.find(function(t){return t.harness===e.id}))?n:null,h=null!=(r=null==p?void 0:p.files.filter(function(e){return"in-sync"!==e.status}))?r:[],m=null!==p&&p.active&&"in-sync"!==p.status,v=f?dl(f):null,g=null!==v&&v.error+v.warn>0;return{report:f,summary:v,unhealthy:g,doctorError:a,driftReport:p,driftError:u,changed:h,drifted:m,refreshing:i||c,refresh:function(){l(e.id),d()},loadDoctor:l,loadDrift:d,drift:s}}function dt(e){var t,n,r=e.harness,o=(0,to.Bd)().t,i=de(r),a=i.loadDoctor,l=i.loadDrift,s=i.drift,c=u7((0,w.useState)(!1),2),u=c[0],d=c[1],f=u7((0,w.useState)(!1),2),p=f[0],h=f[1];(0,w.useEffect)(function(){a(r.id)},[r.id,a]),(0,w.useEffect)(function(){null===s&&l()},[s,l]);var m=i.drifted&&i.changed.length>0;if(!i.unhealthy&&!i.drifted)return null;var v=(null!=(t=null==(n=i.summary)?void 0:n.error)?t:0)>0;return(0,x.jsxs)("section",{className:tt("rounded-2xl border p-5 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.38)]",v?"border-destructive/40 bg-destructive/5":"border-amber-500/40 bg-amber-500/5 dark:bg-amber-500/10"),children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(uY,{className:tt("size-4",v?"text-destructive":"text-amber-600 dark:text-amber-400")}),(0,x.jsx)("h3",{className:"font-semibold",children:o("doctor.title")}),(0,x.jsx)("span",{className:"ml-auto",children:(0,x.jsx)(dr,{refreshing:i.refreshing,onClick:i.refresh})})]}),(0,x.jsxs)("div",{className:"mt-4 space-y-3",children:[i.unhealthy&&i.report?(0,x.jsx)(di,{report:i.report,statuses:["error","warn"]}):null,i.drifted&&i.driftReport?(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(da,{report:i.driftReport}),i.changed.length>0?(0,x.jsxs)("ul",{className:"space-y-1",children:[i.changed.slice(0,3).map(function(e){return(0,x.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,x.jsx)("span",{className:"size-1.5 shrink-0 rounded-full bg-destructive/70"}),(0,x.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:e.path.split("/").pop()}),(0,x.jsx)("span",{className:"ml-auto shrink-0 font-mono text-[11px] text-muted-foreground",children:o("drift.status.".concat(e.status))})]},e.key)}),i.changed.length>3?(0,x.jsx)("li",{className:"pl-3.5 text-xs text-muted-foreground",children:o("drift.moreFiles",{count:i.changed.length-3})}):null]}):null]}):null]}),(0,x.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,x.jsx)(tr,{size:"sm",variant:"outline",disabled:null===i.report,onClick:function(){return d(!0)},children:o("doctor.viewDetails")}),m?(0,x.jsx)(tr,{size:"sm",variant:"outline",onClick:function(){return h(!0)},children:o("drift.viewDiff")}):null]}),(0,x.jsx)(u1,{harnessId:r.id,open:u,onOpenChange:d}),(0,x.jsx)(u6,{harness:r,open:p,onOpenChange:h})]})}function dn(e){var t=e.harness,n=(0,to.Bd)().t,r=de(t),o=u7((0,w.useState)(!1),2),i=o[0],a=o[1];return(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(uX,{className:"size-4 text-primary"}),(0,x.jsx)("h4",{className:"text-sm font-semibold",children:n("doctor.title")}),(0,x.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[(0,x.jsx)(tr,{size:"sm",variant:"ghost",disabled:null===r.report,onClick:function(){return a(!0)},children:n("doctor.viewDetails")}),(0,x.jsx)(dr,{refreshing:r.refreshing,onClick:r.refresh})]})]}),(0,x.jsxs)("div",{className:"mt-3 space-y-2",children:[r.doctorError?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(n,r.doctorError)}):null===r.report?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("doctor.checking")}):(0,x.jsx)(di,{report:r.report}),r.driftError?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(n,r.driftError)}):null===r.driftReport?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("drift.checking")}):(0,x.jsx)(da,{report:r.driftReport})]}),(0,x.jsx)(u1,{harnessId:t.id,open:i,onOpenChange:a})]})}function dr(e){var t=e.refreshing,n=e.onClick,r=(0,to.Bd)().t;return(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":r("doctor.rerun"),onClick:n,children:(0,x.jsx)(uJ,{className:t?"animate-spin":void 0})})}function di(e){var t=e.report,n=e.statuses,r=(0,to.Bd)().t,o=dl(t),i=(void 0===n?["error","warn","ok","unknown"]:n).filter(function(e){return o[e]>0});return 0===i.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:r("doctor.noChecks")}):(0,x.jsx)("div",{className:"flex flex-wrap gap-2",children:i.map(function(e){var t,n;return(0,x.jsx)(tb,{variant:"error"===(t=e)?"destructive":"ok"===t?"secondary":"outline",className:"warn"===e?"border-amber-500/30 text-amber-700 dark:text-amber-300":void 0,children:r("doctor.count".concat((n=e,"".concat(n[0].toUpperCase()).concat(n.slice(1)))),{count:o[e]})},e)})})}function da(e){var t=e.report,n=(0,to.Bd)().t;if(!t.active)return(0,x.jsx)(tb,{variant:"secondary",children:n("harness.inactive")});if("in-sync"===t.status)return(0,x.jsx)(tb,{variant:"secondary",children:n("drift.none")});if("drifted"===t.status){var r=t.files.filter(function(e){return"in-sync"!==e.status}).length;return(0,x.jsx)(tb,{variant:"outline",className:"border-amber-500/30 text-amber-700 dark:text-amber-300",children:n("drift.mismatch",{count:r})})}return(0,x.jsx)(tb,{className:u5(t.status),children:n("drift.status.".concat(t.status))})}function dl(e){var t={ok:0,warn:0,error:0,unknown:0},n=!0,r=!1,o=void 0;try{for(var i,a=e.checks[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;t[l.status]++}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}function ds(e){return(ds="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var dc=["size","style"];function du(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?du(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=ds(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ds(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ds(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var df=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,dc);return(0,x.jsxs)("svg",dd(dd({height:n,style:dd({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Claude Code"}),(0,x.jsx)("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]}))});let dp=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;var dh=function(e){var t=(0,w.useId)(),n="lobe-icons-".concat(Array.from(e.match(dp)??[]).map(e=>e.toLowerCase()).join("-"),"-").concat(t);return(0,w.useMemo)(function(){return{fill:"url(#".concat(n,")"),id:n}},[e])},dm="Codex";function dv(e){return(dv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var dg=["size","style"];function dy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function db(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dy(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=dv(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dv(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dv(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dx=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,dg),i=dh(dm),a=i.id,l=i.fill;return(0,x.jsxs)("svg",db(db({height:n,style:db({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:dm}),(0,x.jsx)("path",{d:"M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z",fill:"#fff"}),(0,x.jsx)("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:l}),(0,x.jsx)("defs",{children:(0,x.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:a,x1:"12",x2:"12",y1:"3",y2:"21",children:[(0,x.jsx)("stop",{stopColor:"#B1A7FF"}),(0,x.jsx)("stop",{offset:".5",stopColor:"#7A9DFF"}),(0,x.jsx)("stop",{offset:"1",stopColor:"#3941FF"})]})})]}))});function dw(e){return(dw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var dk=["size","style"];function dj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dj(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=dw(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dw(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dw(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dO=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,dk);return(0,x.jsxs)("svg",dS(dS({height:n,style:dS({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"DeepSeek"}),(0,x.jsx)("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z",fill:"#4D6BFE"})]}))});function dC(e){return(dC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var dN=["size","style"];function dP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dE(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dP(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=dC(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dC(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dC(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dI=(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,dN);return(0,x.jsxs)("svg",dE(dE({fill:"currentColor",fillRule:"evenodd",height:n,style:dE({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Kimi"}),(0,x.jsx)("path",{d:"M21.846 0a1.923 1.923 0 110 3.846H20.15a.226.226 0 01-.227-.226V1.923C19.923.861 20.784 0 21.846 0z"}),(0,x.jsx)("path",{d:"M11.065 11.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164 0 00-.117.051l-7.82 7.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103 0-.186.103-.186.23V19.77c0 .128.083.23.186.23h2.69c.103 0 .186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158 0 01.205-.023l6.484 4.772a7.677 7.677 0 003.453 1.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028 5.028 0 01-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z"})]}))});function dA(e){return(dA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var d_=["size","style"];function dM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dM(Object(n),!0).forEach(function(t){var r,o,i;r=e,o=t,i=n[t],(o=function(e){var t=function(e,t){if("object"!=dA(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=dA(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==dA(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dR={claude:df,codex:dx,kimi:dI,pi:(0,w.memo)(function(e){var t=e.size,n=void 0===t?"1em":t,r=e.style,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,d_);return(0,x.jsxs)("svg",dT(dT({fill:"currentColor",fillRule:"evenodd",height:n,style:dT({flex:"none",lineHeight:1},r),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},o),{},{children:[(0,x.jsx)("title",{children:"Pi"}),(0,x.jsx)("path",{clipRule:"evenodd",d:"M1 1h16.5v11H12v5.5H6.5V23H1V1zm5.5 5.5V12H12V6.5H6.5z"}),(0,x.jsx)("path",{d:"M17.5 12H23v11h-5.5V12z"})]}))}),dsh:dO};function dz(e){var t=e.id,n=e.className,r=dR[t];return(0,x.jsx)(r,{"aria-hidden":!0,className:tt("size-5",n)})}function dD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dL(e,t){var n,r,o;return(null==e||null==(r=e.modelFavorite)?void 0:r.collectionOverrides)?null!=(n=null==t||null==(o=t.find(function(t){return t.id===e.modelFavorite.favoriteId}))?void 0:o.name)?n:e.name:null==e?void 0:e.name}function dF(e){var t,n=new Map,r=!0,o=!1,i=void 0;try{for(var a,l=e.profiles[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s,c,u,d,f=a.value,p=("kimi"===e.id||"dsh"===e.id)&&(null==(c=f.modelFavorite)?void 0:c.collectionOverrides)?f.modelFavorite.favoriteId:void 0,h=p?"collection/".concat(p):"profile/".concat(f.name),m=null!=(s=n.get(h))?s:{id:h,favoriteId:p,profiles:[],selected:f};m.profiles.push(f),(null==(u=e.active)?void 0:u.official)||(null==(d=e.active)?void 0:d.name)!==f.name||(m.selected=f),n.set(h,m)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return function(e){if(Array.isArray(e))return dD(e)}(t=n.values())||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e){if(e){if("string"==typeof e)return dD(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dD(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dU(e){var t=e.harnesses,n=e.value,r=e.onChange,o=(0,to.Bd)().t,i=iV(function(e){return e.favorites});return(0,x.jsx)(un,{label:o("nav.switchHarness"),idPrefix:"harness",orientation:"vertical",items:t,value:n,onChange:r,className:"flex gap-2 overflow-x-auto border-b bg-card/45 p-3 xl:sticky xl:top-20 xl:h-[calc(100dvh-80px)] xl:flex-col xl:self-start xl:overflow-x-visible xl:overflow-y-auto xl:border-b-0 xl:border-r xl:p-4",tabClassName:"min-w-[12rem] gap-3 px-3 py-3 xl:min-w-0 xl:w-full",children:function(e,t){var n,r,a,l,s=(null==(a=e.active)?void 0:a.official)?o("harness.official"):null!=(n=null!=(r=dL(e.profiles.find(function(t){var n;return t.name===(null==(n=e.active)?void 0:n.name)}),i))?r:null==(l=e.active)?void 0:l.name)?n:null;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{className:tt("flex size-10 shrink-0 items-center justify-center rounded-xl border bg-card shadow-[0_4px_12px_-8px_rgb(36_39_70/0.28)]",t?"border-primary/20":"border-border"),children:(0,x.jsx)(dz,{id:e.id})}),(0,x.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,x.jsx)("span",{className:"block truncate text-sm font-medium text-current",children:e.label}),(0,x.jsx)("span",{className:"mt-0.5 block truncate font-mono text-[11px] text-muted-foreground",children:null===s?o("harness.currentInactive"):o("harness.current",{name:s})})]}),(0,x.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:dF(e).length})]})}})}let dH=P("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);function d$(){var e=(0,to.Bd)().t,t=(0,to.s9)(),n=t.language,r=t.setLanguage,o="en"===n,i=e(o?"language.toChinese":"language.toEnglish");return(0,x.jsxs)(tr,{type:"button",size:"sm",variant:"outline","aria-label":i,title:i,onClick:function(){return r(o?"zh-CN":"en")},children:[(0,x.jsx)(dH,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:e("language.short")})]})}let dB=P("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),dK=P("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),dq=P("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),dV=P("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),dW=P("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);var dG=Q("text-sm",{variants:{variant:{destructive:"text-destructive",warning:"text-amber-600 dark:text-amber-500",muted:"text-muted-foreground"},size:{default:"text-sm",sm:"text-xs"}},defaultVariants:{variant:"destructive",size:"default"}});function dZ(e){var t=e.className,n=e.variant,r=e.size,o=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className","variant","size"]);return(0,x.jsx)("p",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"alert",role:"muted"===n?void 0:"alert",className:tt(dG({variant:n,size:r}),t)},o))}function dY(e){var t,n,r=e.flow,o=e.favoriteId,i=e.quick,a=e.blocked,l=e.onEditConnections,s=(0,to.Bd)().t,c=r.step,u=r.busy,d=r.plan,f=r.items,p=null!=(t=null==d?void 0:d.items.flatMap(function(e){return e.projection.blockers.map(function(t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({harness:e.harness},t)})}))?t:[];return(0,x.jsxs)("div",{className:"shrink-0 space-y-3 border-t bg-card px-6 py-4 sm:px-8",children:[r.error?(0,x.jsxs)(dZ,{children:[r.error,r.targets?!i||r.quickReady||r.uncertain||r.needsPreview||2===c?null:(0,x.jsx)(tr,{variant:"link",onClick:r.refreshQuickPreview,children:s("activate.retryPreview")}):(0,x.jsx)(tr,{variant:"link",disabled:u,onClick:function(){r.run(function(){return r.loadTargets(o)})},children:s("favorites.retryTargets")})]}):null,r.uncertain?(0,x.jsx)(dZ,{variant:"warning",children:s("favorites.unconfirmedResult")}):null,1===c&&a?(0,x.jsx)(dZ,{variant:"warning",children:(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)("p",{children:s("favorites.resolveBeforeApply")}),p.map(function(e,t){return(0,x.jsxs)("p",{className:"text-sm",children:[s("favorites.toolNames.".concat(e.harness))," \xb7"," ",s((0,ta.Vz)(e.code),e.data)]},"".concat(e.harness,"-").concat(e.code,"-").concat(t))})]})}):null,i&&1===c&&r.targets&&!r.connections.length&&l?(0,x.jsx)(tr,{variant:"outline",onClick:l,children:s("favorites.editForCompatibility")}):null,(0,x.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between [&>button]:h-auto [&>button]:min-h-10 [&>button]:max-w-full [&>button]:whitespace-normal",children:[2===c&&r.failed?(0,x.jsx)(tr,{variant:"outline",disabled:u,onClick:r.close,children:s("favorites.closeResults")}):2===c?(0,x.jsx)("span",{}):0===c?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:s("favorites.selectedCount",{count:f.length})}):i&&!a?(0,x.jsx)(tr,{variant:"outline",disabled:u,onClick:r.close,children:s("common.cancel")}):(0,x.jsxs)(tr,{variant:"outline",disabled:u||r.uncertain,onClick:function(){r.setError(""),r.setStep(0)},children:[(0,x.jsx)(tm,{}),s("favorites.backToSelection")]}),0===c?(0,x.jsxs)(tr,{disabled:u||!f.length||f.some(function(e){return!e.connectionId}),onClick:function(){r.run(function(){return r.preview()})},children:[u?(0,x.jsx)(c2,{className:"animate-spin"}):null,s("favorites.preview"),(0,x.jsx)(dW,{})]}):2===c?r.failed?(0,x.jsxs)(tr,{disabled:u,onClick:function(){r.retry()},children:[u?(0,x.jsx)(c2,{className:"animate-spin"}):null,s("favorites.retryFailed")]}):(0,x.jsxs)(tr,{onClick:r.close,children:[(0,x.jsx)(aY,{}),s("favorites.done")]}):r.needsPreview?(0,x.jsxs)(tr,{disabled:u,onClick:function(){r.run(function(){return r.preview()})},children:[u?(0,x.jsx)(c2,{className:"animate-spin"}):null,s("favorites.refreshPreview")]}):(0,x.jsxs)(tr,{disabled:u||!d||a||i&&!r.quickReady,onClick:function(){r.submit()},children:[u?(0,x.jsx)(c2,{className:"animate-spin"}):(0,x.jsx)(aY,{}),s(r.uncertain?"favorites.checkResult":"favorites.confirmBatchActivate",{count:null!=(n=null==d?void 0:d.items.length)?n:0})]})]})]})}function dX(e){var t=e.results,n=(0,to.Bd)().t;return(0,x.jsx)("section",{"aria-label":n("favorites.results"),className:"h-full space-y-4 overflow-y-auto p-6 sm:px-8",children:t.map(function(e){var t="applied"===e.status||"unchanged"===e.status,r=t?"unchanged"===e.status?"activatedUnchanged":"activated":e.status;return(0,x.jsxs)("article",{className:"space-y-3 rounded-xl border bg-card p-4",children:[(0,x.jsxs)("header",{className:"flex flex-wrap items-center gap-3",children:[(0,x.jsx)(dz,{id:e.harness,className:"size-6"}),(0,x.jsxs)("h3",{className:"min-w-0 flex-1 break-words font-semibold",children:[n("favorites.toolNames.".concat(e.harness))," \xb7 ",e.profile]}),(0,x.jsx)(tb,{variant:t?"secondary":"destructive",children:n("favorites.resultStatus.".concat(r))})]}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n(t?"favorites.resultActivatedHint":"failed"===e.status?"favorites.resultFailedHint":"favorites.resultSkippedHint")}),e.code?(0,x.jsx)(dZ,{variant:t?"warning":"destructive",children:n((0,ta.Vz)(e.code))}):null]},e.harness)})})}let dJ=P("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);function dQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d0(e){var t,n=e.title,r=e.children,o=e.forceOpen,i=e.defaultOpen,a=e.summary,l=e.triggerClassName,s=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(void 0!==i&&i))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return dQ(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dQ(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],u=s[1],d=(0,w.useId)(),f=c||void 0!==o&&o;return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)(tr,{type:"button",variant:"ghost","aria-expanded":f,"aria-controls":d,onClick:function(){return u(!c)},className:l,children:[n,a?(0,x.jsx)("span",{className:"font-normal text-muted-foreground text-xs",children:a}):null,(0,x.jsx)(tf,{className:"size-4 transition-transform ".concat(f?"rotate-180":"")})]}),(0,x.jsx)("div",{id:d,hidden:!f,className:"space-y-3",children:r})]})}var d1=new Set(["contextWindow","maxOutputTokens","maxTokens","maxContextSize"]);function d2(e,t){var n,r=e.startsWith("extras.")?e.slice(7):e;return null!==t&&d1.has(r)&&/^\d+$/.test(t)?0!==(n=Number(t))&&n%1024==0?"".concat(n/1024,"K"):String(n):t}function d3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d4(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||d6(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d5(e){return function(e){if(Array.isArray(e))return d3(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d6(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d6(e,t){if(e){if("string"==typeof e)return d3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d3(e,t)}}function d8(e){var t=e.item,n=(0,to.Bd)().t;return(0,x.jsxs)("article",{className:"overflow-hidden rounded-xl border bg-card shadow-sm",children:[(0,x.jsxs)("header",{className:"flex items-center gap-3 border-b p-4",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl border bg-muted/30",children:(0,x.jsx)(dz,{id:t.harness,className:"size-6"})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("h3",{className:"font-semibold",children:n("favorites.toolNames.".concat(t.harness))}),(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:t.profile})]}),(0,x.jsx)(tb,{variant:"secondary",children:n(t.existing?"favorites.updateProfile":"favorites.newProfile")})]}),(0,x.jsxs)("div",{className:"space-y-4 p-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,x.jsx)("p",{className:"break-all font-mono text-sm font-medium",children:t.projection.projection.model}),(0,x.jsx)(tb,{variant:"outline",children:n("favorites.modeLabel.activate")})]}),t.projection.notRepresented.length?(0,x.jsxs)(dZ,{variant:"warning",children:[n("favorites.notRepresented"),":"," ",t.projection.notRepresented.map(function(e){return n("favorites.".concat(e))}).join(", ")]}):null,d5(t.projection.warnings).concat(d5(t.projection.blockers)).map(function(e,t){return(0,x.jsx)(dZ,{variant:"warning",children:n((0,ta.Vz)(e.code),e.data)},"".concat(e.code,"-").concat(t))}),(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,x.jsx)(dJ,{className:"size-4"}),n("favorites.liveComparison")]}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:n("favorites.liveComparisonHint")}),t.nativeFiles.length?(0,x.jsx)(tN,{collapseUnchanged:!0,intent:"apply",files:t.nativeFiles.map(function(e){return{path:e.key,existed:null!==e.before,currentContent:e.before,content:e.after}})}):(0,x.jsx)(dZ,{variant:"warning",children:n("favorites.previewBlocked")})]}),(0,x.jsxs)(d0,{title:n(t.diff.length?"favorites.savedComparison":"favorites.savedUnchanged"),children:[(0,x.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:n("favorites.savedComparisonHint")}),t.diff.length?(0,x.jsx)("div",{className:"overflow-x-auto rounded-lg border",children:(0,x.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,x.jsx)("thead",{className:"bg-muted/40 text-muted-foreground",children:(0,x.jsxs)("tr",{children:[(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.parameter")}),(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.savedBefore")}),(0,x.jsx)("th",{className:"px-3 py-2 font-medium",children:n("favorites.savedAfter")})]})}),(0,x.jsx)("tbody",{children:t.diff.map(function(e){var t,n;return(0,x.jsxs)("tr",{className:"border-t",children:[(0,x.jsx)("td",{className:"px-3 py-2 font-mono",children:e.field}),(0,x.jsx)("td",{className:"max-w-60 break-all px-3 py-2 text-muted-foreground",children:null!=(t=d2(e.field,e.before))?t:"—"}),(0,x.jsx)("td",{className:"max-w-60 break-all bg-primary/[0.025] px-3 py-2 font-medium",children:null!=(n=d2(e.field,e.after))?n:"—"})]},e.field)})})]})}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.savedUnchangedHint")})]}),(0,x.jsxs)(d0,{title:n("favorites.mappingDetails"),children:[(0,x.jsx)("dl",{className:"grid gap-2 text-xs sm:grid-cols-2",children:Object.entries(t.resolved.sources).map(function(e){var t=d4(e,2),r=t[0],o=t[1];return(0,x.jsxs)("div",{className:"flex justify-between gap-2 rounded-lg bg-muted/40 p-2",children:[(0,x.jsx)("dt",{children:n("favorites.".concat(r))}),(0,x.jsx)("dd",{className:"text-muted-foreground",children:n("favorite"===o?"favorites.inherited":"connection"===o?"favorites.overridden":"favorites.unknown")})]},r)})}),t.preservedFields.length?(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n("favorites.preserved"),": ",t.preservedFields.join(", ")]}):null,Object.entries(t.projection.rendererDefaults).map(function(e){var t=d4(e,2),r=t[0],o=t[1];return(0,x.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n("favorites.rendererDefault"),": ",r," = ",d2(r,o)]},r)})]})]})]})}function d9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d7(e){var t,n,r,o=e.items,i=e.history,a=(0,to.Bd)().t,l=(0,w.useId)(),s=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(null==(r=o[0])?void 0:r.harness))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return d9(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d9(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],u=s[1],d=null!=(n=o.find(function(e){return e.harness===c}))?n:o[0];return d?(0,x.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,x.jsx)(un,{label:a("favorites.targetTools"),idPrefix:l,items:o.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={id:e.harness},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t}),value:d.harness,onChange:u,className:"flex shrink-0 gap-2 overflow-x-auto border-b pb-3",tabClassName:"gap-2 px-4 py-3 text-sm font-medium",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(dz,{id:e.harness,className:"size-5"}),a("favorites.toolNames.".concat(e.harness)),(0,x.jsx)(tb,{variant:e.projection.blockers.length?"destructive":"secondary",children:e.projection.blockers.length?a("favorites.tabBlocked"):a("favorites.tabChanges",{count:e.nativeFiles.filter(function(e){return e.changed}).length})})]})}}),(0,x.jsxs)(uo,{idPrefix:l,value:d.harness,className:"min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain pr-1",children:[(void 0===i?[]:i).flatMap(function(e){return e.items.filter(function(e){return e.harness===d.harness}).map(function(t){return(0,x.jsx)(dZ,{variant:"failed"===t.status?"destructive":"muted",children:(0,x.jsxs)("span",{role:"status",children:[t.profile,": ",a("favorites.".concat(t.status))," ",t.code?a((0,ta.Vz)(t.code)):""]})},e.requestId)})}),(0,x.jsx)(d8,{item:d})]},d.harness)]}):null}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){ft(e,t,n[t])})}return e}function fr(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function fo(e){return function(e){if(Array.isArray(e))return fe(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return fe(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fe(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fi(e){var t=e.id,n=e.label,r=e.value,o=e.options,i=e.onChange,a=e.placeholder,l=e.hint,s=e.error,c=e.className;return(0,x.jsx)(i0,{id:t,label:n,hint:l,error:s,children:function(e){return(0,x.jsxs)(sV,{value:r||void 0,onValueChange:i,children:[(0,x.jsx)(cT,fr(fn({},e),{className:c,children:(0,x.jsx)(sG,{placeholder:a})})),(0,x.jsx)(cD,{children:o.map(function(e){return(0,x.jsx)(cL,{value:e.value,children:e.description?(0,x.jsxs)("span",{className:"flex flex-col",children:[(0,x.jsx)("span",{children:e.label}),(0,x.jsx)("span",{className:"font-mono text-muted-foreground text-xs",children:e.description})]}):e.label},e.value)})})]})}})}function fa(e){var t=e.id,n=e.facts,r=e.effort,o=e.onFacts,i=e.onEffort,a=e.errors,l=void 0===a?{}:a,s=e.sourceHints,c=void 0===s?{}:s,u=(0,to.Bd)().t,d=n.supportedReasoningEfforts,f=(null==d?void 0:d.length)?d:null,p=["unknown"].concat(fo(ta.wl.options)).filter(function(e){return"unknown"===e||(null==f?void 0:f.includes(e))||e===r}),h=!1===n.reasoningSupported;return(0,x.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[["contextWindow","maxOutputTokens"].map(function(e){return(0,x.jsx)(i0,{id:"".concat(t,"-").concat(e),label:u("favorites.".concat(e)),hint:[c[e],u("favorites.capabilityUnknownHint")].filter(Boolean).join(" \xb7 "),error:l["".concat(t,"-").concat(e)],children:function(t){var r;return(0,x.jsx)(i4,fr(fn({},t),{type:"number",min:1,max:1e8,className:"w-full",value:null!=(r=n[e])?r:"",placeholder:void 0===n[e]?u("favorites.unknown"):void 0,onChange:function(t){return o(fr(fn({},n),ft({},e,t.target.value?Number(t.target.value):void 0)))}}))}},e)}),(0,x.jsx)(fi,{id:"".concat(t,"-reasoning"),label:u("favorites.reasoningSupported"),hint:c.reasoningSupported,error:l["".concat(t,"-reasoning")],className:"w-full",value:void 0===n.reasoningSupported?"unknown":String(n.reasoningSupported),options:["unknown","true","false"].map(function(e){return{value:e,label:u("favorites.".concat(e))}}),onChange:function(e){return o(fr(fn({},n),{reasoningSupported:"unknown"===e?void 0:"true"===e,supportedReasoningEfforts:"false"===e?void 0:n.supportedReasoningEfforts}))}}),h?null:(0,x.jsx)(fi,{id:"".concat(t,"-effort"),label:u("favorites.reasoningEffort"),hint:[c.reasoningEffort,u(f?"favorites.effortPreferenceHint":"favorites.effortUnknownHint")].filter(Boolean).join(" \xb7 "),error:l["".concat(t,"-effort")],className:"w-full",value:r||"unknown",options:p.map(function(e){return{value:e,label:"unknown"===e?u("favorites.followDefault"):e}}),onChange:function(e){return i("unknown"===e?"":e)}}),h?null:(0,x.jsxs)("fieldset",{className:"space-y-2 sm:col-span-2",children:[(0,x.jsx)("legend",{className:"text-sm font-medium",children:u("favorites.supportedReasoningEfforts")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:[c.supportedReasoningEfforts,u("favorites.effortLevelsHint")].filter(Boolean).join(" \xb7 ")}),(0,x.jsx)("div",{className:"flex flex-wrap gap-3",children:ta.wl.options.map(function(e){var t,r;return(0,x.jsxs)("label",{className:"flex items-center gap-1",children:[(0,x.jsx)(aX,{checked:null!=(t=null==(r=n.supportedReasoningEfforts)?void 0:r.includes(e))&&t,onCheckedChange:function(t){var r,i,a=t?fo(null!=(r=n.supportedReasoningEfforts)?r:[]).concat([e]):null==(i=n.supportedReasoningEfforts)?void 0:i.filter(function(t){return t!==e});o(fr(fn({},n),{supportedReasoningEfforts:(null==a?void 0:a.length)?a:void 0}))}}),e]},e)})}),l["".concat(t,"-supportedReasoningEfforts")]?(0,x.jsx)("p",{className:"text-destructive text-xs",children:l["".concat(t,"-supportedReasoningEfforts")]}):null]})]})}function fl(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)""!==(r=fl(e[n]))&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var fs={value:()=>{}};function fc(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw Error("illegal type: "+e);r[e]=[]}return new fu(r)}function fu(e){this._=e}function fd(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=fs,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}function ff(){}function fp(e){return null==e?ff:function(){return this.querySelector(e)}}function fh(){return[]}function fm(e){return null==e?fh:function(){return this.querySelectorAll(e)}}function fv(e){return function(){return this.matches(e)}}function fg(e){return function(t){return t.matches(e)}}fu.prototype=fc.prototype={constructor:fu,on:function(e,t){var n,r=this._,o=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=o.length;if(arguments.length<2){for(;++i<a;)if((n=(e=o[i]).type)&&(n=function(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}(r[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=fd(r[n],e.name,t);else if(null==t)for(n in r)r[n]=fd(r[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fu(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(r=this._[e],i=0,n=r.length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var fy=Array.prototype.find;function fb(){return this.firstElementChild}var fx=Array.prototype.filter;function fw(){return Array.from(this.children)}function fk(e){return Array(e.length)}function fj(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function fS(e,t,n,r,o,i){for(var a,l=0,s=t.length,c=i.length;l<c;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new fj(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function fO(e,t,n,r,o,i,a){var l,s,c,u=new Map,d=t.length,f=i.length,p=Array(d);for(l=0;l<d;++l)(s=t[l])&&(p[l]=c=a.call(s,s.__data__,l,t)+"",u.has(c)?o[l]=s:u.set(c,s));for(l=0;l<f;++l)c=a.call(e,i[l],l,i)+"",(s=u.get(c))?(r[l]=s,s.__data__=i[l],u.delete(c)):n[l]=new fj(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&u.get(p[l])===s&&(o[l]=s)}function fC(e){return e.__data__}function fN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}fj.prototype={constructor:fj,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var fP="http://www.w3.org/1999/xhtml";let fE={svg:"http://www.w3.org/2000/svg",xhtml:fP,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fI(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),fE.hasOwnProperty(t)?{space:fE[t],local:e}:e}function fA(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function f_(e,t){return e.style.getPropertyValue(t)||fA(e).getComputedStyle(e,null).getPropertyValue(t)}function fM(e){return e.trim().split(/^|\s+/)}function fT(e){return e.classList||new fR(e)}function fR(e){this._node=e,this._names=fM(e.getAttribute("class")||"")}function fz(e,t){for(var n=fT(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function fD(e,t){for(var n=fT(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function fL(){this.textContent=""}function fF(){this.innerHTML=""}function fU(){this.nextSibling&&this.parentNode.appendChild(this)}function fH(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f$(e){var t=fI(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fP&&t.documentElement.namespaceURI===fP?t.createElement(e):t.createElementNS(n,e)}})(t)}function fB(){return null}function fK(){var e=this.parentNode;e&&e.removeChild(this)}function fq(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fV(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fW(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)(n=t[r],e.type&&n.type!==e.type||n.name!==e.name)?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function fG(e,t,n){return function(){var r,o=this.__on,i=function(e){t.call(this,e,this.__data__)};if(o){for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function fZ(e,t,n){var r=fA(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}fR.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var fY=[null];function fX(e,t){this._groups=e,this._parents=t}function fJ(){return new fX([[document.documentElement]],fY)}function fQ(e){return"string"==typeof e?new fX([[document.querySelector(e)]],[document.documentElement]):new fX([[e]],fY)}function f0(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}fX.prototype=fJ.prototype={constructor:fX,select:function(e){"function"!=typeof e&&(e=fp(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,c=r[o]=Array(s),u=0;u<s;++u)(i=l[u])&&(a=e.call(i,i.__data__,u,l))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new fX(r,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=fm(e);for(var n=this._groups,r=n.length,o=[],i=[],a=0;a<r;++a)for(var l,s=n[a],c=s.length,u=0;u<c;++u)(l=s[u])&&(o.push(e.call(l,l.__data__,u,s)),i.push(l));return new fX(o,i)},selectChild:function(e){var t;return this.select(null==e?fb:(t="function"==typeof e?e:fg(e),function(){return fy.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?fw:(t="function"==typeof e?e:fg(e),function(){return fx.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=fv(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new fX(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fC);var n=t?fO:fS,r=this._parents,o=this._groups;"function"!=typeof e&&(y=e,e=function(){return y});for(var i=o.length,a=Array(i),l=Array(i),s=Array(i),c=0;c<i;++c){var u=r[c],d=o[c],f=d.length,p="object"==typeof(g=e.call(u,u&&u.__data__,c,r))&&"length"in g?g:Array.from(g),h=p.length,m=l[c]=Array(h),v=a[c]=Array(h);n(u,d,m,v,s[c]=Array(f),p,t);for(var g,y,b,x,w=0,k=0;w<h;++w)if(b=m[w]){for(w>=k&&(k=w+1);!(x=v[k])&&++k<h;);b._next=x||null}}return(a=new fX(a,r))._enter=l,a._exit=s,a},enter:function(){return new fX(this._enter||this._groups.map(fk),this._parents)},exit:function(){return new fX(this._exit||this._groups.map(fk),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),l=Array(o),s=0;s<a;++s)for(var c,u=n[s],d=r[s],f=u.length,p=l[s]=Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;s<o;++s)l[s]=n[s];return new fX(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=fN);for(var n=this._groups,r=n.length,o=Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,c=o[i]=Array(s),u=0;u<s;++u)(a=l[u])&&(c[u]=a);c.sort(t)}return new fX(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=fI(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):f_(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=fM(e+"");if(arguments.length<2){for(var r=fT(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?fz:fD)(this,e)}}:t?function(e){return function(){fz(this,e)}}:function(e){return function(){fD(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?fL:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?fF:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(fU)},lower:function(){return this.each(fH)},append:function(e){var t="function"==typeof e?e:f$(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:f$(e),r=null==t?fB:"function"==typeof t?t:fp(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(fK)},clone:function(e){return this.select(e?fV:fq)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=i.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,c=0,u=l.length;c<u;++c)for(r=0,s=l[c];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value}return}for(r=0,l=t?fG:fW;r<a;++r)this.each(l(i[r],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return fZ(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return fZ(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};let f1={passive:!1},f2={capture:!0,passive:!1};function f3(e){e.stopImmediatePropagation()}function f4(e){e.preventDefault(),e.stopImmediatePropagation()}function f5(e){var t=e.document.documentElement,n=fQ(e).on("dragstart.drag",f4,f2);"onselectstart"in t?n.on("selectstart.drag",f4,f2):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function f6(e,t){var n=e.document.documentElement,r=fQ(e).on("dragstart.drag",null);t&&(r.on("click.drag",f4,f2),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let f8=e=>()=>e;function f9(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:l,dx:s,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function f7(e){return!e.ctrlKey&&!e.button}function pe(){return this.parentNode}function pt(e,t){return null==t?{x:e.x,y:e.y}:t}function pn(){return navigator.maxTouchPoints||"ontouchstart"in this}function pr(){var e,t,n,r,o=f7,i=pe,a=pt,l=pn,s={},c=fc("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(l).on("touchstart.drag",v).on("touchmove.drag",g,f1).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,l){if(!r&&o.call(this,a,l)){var s=b(this,i.call(this,a,l),a,l,"mouse");s&&(fQ(a.view).on("mousemove.drag",h,f2).on("mouseup.drag",m,f2),f5(a.view),f3(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function h(r){if(f4(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}s.mouse("drag",r)}function m(e){fQ(e.view).on("mousemove.drag mouseup.drag",null),f6(e.view,n),f4(e),s.mouse("end",e)}function v(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(r=b(this,l,e,t,a[n].identifier,a[n]))&&(f3(e),r("start",e,a[n]))}}function g(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=s[r[t].identifier])&&(f4(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=s[o[t].identifier])&&(f3(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var l,d,p,h=c.copy(),m=f0(i||n,t);if(null!=(p=a.call(e,new f9("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return l=p.x-m[0]||0,d=p.y-m[1]||0,function n(i,a,c){var v,g=m;switch(i){case"start":s[o]=n,v=u++;break;case"end":delete s[o],--u;case"drag":m=f0(c||a,t),v=u}h.call(i,e,new f9(i,{sourceEvent:a,subject:p,target:f,identifier:o,active:v,x:m[0]+l,y:m[1]+d,dx:m[0]-g[0],dy:m[1]-g[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:f8(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:f8(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:f8(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:f8(!!e),f):l},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f}function po(e){return((e=Math.exp(e))+1/e)/2}f9.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let pi=function e(t,n,r){function o(e,o){var i,a,l=e[0],s=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-l,h=d-s,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[l+e*p,s+e*h,c*Math.exp(t*e*a)]};else{var v=Math.sqrt(m),g=(f*f-c*c+r*m)/(2*c*n*v),y=(f*f-c*c-r*m)/(2*f*n*v),b=Math.log(Math.sqrt(g*g+1)-g);a=(Math.log(Math.sqrt(y*y+1)-y)-b)/t,i=function(e){var r,o,i=e*a,u=po(b),d=c/(n*v)*(u*(((r=Math.exp(2*(r=t*i+b)))-1)/(r+1))-((o=Math.exp(o=b))-1/o)/2);return[l+d*p,s+d*h,c*u/po(t*i+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var pa,pl,ps,pc,pu,pd,pf,pp,ph,pm,pv=0,pg=0,py=0,pb=0,px=0,pw=0,pk="object"==typeof performance&&performance.now?performance:Date,pj="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function pS(){return px||(pj(pO),px=pk.now()+pw)}function pO(){px=0}function pC(){this._call=this._time=this._next=null}function pN(e,t,n){var r=new pC;return r.restart(e,t,n),r}function pP(){px=(pb=pk.now())+pw,pv=pg=0;try{pS(),++pv;for(var e,t=ph;t;)(e=px-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pv}finally{pv=0,function(){for(var e,t,n=ph,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ph=t);pm=e,pI(r)}(),px=0}}function pE(){var e=pk.now(),t=e-pb;t>1e3&&(pw-=t,pb=e)}function pI(e){!pv&&(pg&&(pg=clearTimeout(pg)),e-px>24?(e<1/0&&(pg=setTimeout(pP,e-pk.now()-pw)),py&&(py=clearInterval(py))):(py||(pb=pk.now(),py=setInterval(pE,1e3)),pv=1,pj(pP)))}function pA(e,t,n){var r=new pC;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}pC.prototype=pN.prototype={constructor:pC,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?pS():+n)+(null==t?0:+t),this._next||pm===this||(pm?pm._next=this:ph=this,pm=this),this._call=e,this._time=n,pI()},stop:function(){this._call&&(this._call=null,this._time=1/0,pI())}};var p_=fc("start","end","cancel","interrupt"),pM=[];function pT(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(s){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return pA(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(pA(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(c=0,n.state=3,r=Array(d=n.tween.length),u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=pN(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:o,on:p_,tween:pM,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function pR(e,t){var n=pD(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function pz(e,t){var n=pD(e,t);if(n.state>3)throw Error("too late; already running");return n}function pD(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function pL(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i){if((n=i[o]).name!==t){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]}a&&delete e.__transition}}function pF(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var pU=180/Math.PI,pH={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function p$(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*pU,skewX:Math.atan(s)*pU,scaleX:a,scaleY:l}}function pB(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l,s,c,u,d=[],f=[];return i=e(i),a=e(a),!function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:pF(e,o)},{i:s-2,x:pF(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,d,f),l=i.rotate,s=a.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:pF(l,s)})):s&&d.push(o(d)+"rotate("+s+r),c=i.skewX,u=a.skewX,c!==u?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:pF(c,u)}):u&&d.push(o(d)+"skewX("+u+r),!function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:pF(e,n)},{i:l-2,x:pF(t,r)})}else(1!==n||1!==r)&&i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,d,f),i=a=null,function(e){for(var t,n=-1,r=f.length;++n<r;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var pK=pB(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?pH:p$(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),pq=pB(function(e){return null==e?pH:(u||(u=document.createElementNS("http://www.w3.org/2000/svg","g")),u.setAttribute("transform",e),e=u.transform.baseVal.consolidate())?p$((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):pH},", ",")",")");function pV(e,t,n){var r=e._id;return e.each(function(){var e=pz(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return pD(e,r).value[t]}}function pW(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function pG(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pZ(){}var pY="\\s*([+-]?\\d+)\\s*",pX="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pJ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pQ=/^#([0-9a-f]{3,8})$/,p0=RegExp(`^rgb\\(${pY},${pY},${pY}\\)$`),p1=RegExp(`^rgb\\(${pJ},${pJ},${pJ}\\)$`),p2=RegExp(`^rgba\\(${pY},${pY},${pY},${pX}\\)$`),p3=RegExp(`^rgba\\(${pJ},${pJ},${pJ},${pX}\\)$`),p4=RegExp(`^hsl\\(${pX},${pJ},${pJ}\\)$`),p5=RegExp(`^hsla\\(${pX},${pJ},${pJ},${pX}\\)$`),p6={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function p8(){return this.rgb().formatHex()}function p9(){return this.rgb().formatRgb()}function p7(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pQ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?he(t):3===n?new hr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ht(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ht(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=p0.exec(e))?new hr(t[1],t[2],t[3],1):(t=p1.exec(e))?new hr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=p2.exec(e))?ht(t[1],t[2],t[3],t[4]):(t=p3.exec(e))?ht(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=p4.exec(e))?hc(t[1],t[2]/100,t[3]/100,1):(t=p5.exec(e))?hc(t[1],t[2]/100,t[3]/100,t[4]):p6.hasOwnProperty(e)?he(p6[e]):"transparent"===e?new hr(NaN,NaN,NaN,0):null}function he(e){return new hr(e>>16&255,e>>8&255,255&e,1)}function ht(e,t,n,r){return r<=0&&(e=t=n=NaN),new hr(e,t,n,r)}function hn(e,t,n,r){var o;return 1==arguments.length?((o=e)instanceof pZ||(o=p7(o)),o)?new hr((o=o.rgb()).r,o.g,o.b,o.opacity):new hr:new hr(e,t,n,null==r?1:r)}function hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ho(){return`#${hs(this.r)}${hs(this.g)}${hs(this.b)}`}function hi(){let e=ha(this.opacity);return`${1===e?"rgb(":"rgba("}${hl(this.r)}, ${hl(this.g)}, ${hl(this.b)}${1===e?")":`, ${e})`}`}function ha(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function hs(e){return((e=hl(e))<16?"0":"")+e.toString(16)}function hc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hd(e,t,n,r)}function hu(e){if(e instanceof hd)return new hd(e.h,e.s,e.l,e.opacity);if(e instanceof pZ||(e=p7(e)),!e)return new hd;if(e instanceof hd)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+(n<r)*6:n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new hd(a,l,s,e.opacity)}function hd(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function hf(e){return(e=(e||0)%360)<0?e+360:e}function hp(e){return Math.max(0,Math.min(1,e||0))}function hh(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function hm(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}pW(pZ,p7,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:p8,formatHex:p8,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hu(this).formatHsl()},formatRgb:p9,toString:p9}),pW(hr,hn,pG(pZ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hr(hl(this.r),hl(this.g),hl(this.b),ha(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ho,formatHex:ho,formatHex8:function(){return`#${hs(this.r)}${hs(this.g)}${hs(this.b)}${hs((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:hi,toString:hi})),pW(hd,function(e,t,n,r){return 1==arguments.length?hu(e):new hd(e,t,n,null==r?1:r)},pG(pZ,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new hd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new hd(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new hr(hh(e>=240?e-240:e+120,o,r),hh(e,o,r),hh(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new hd(hf(this.h),hp(this.s),hp(this.l),ha(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=ha(this.opacity);return`${1===e?"hsl(":"hsla("}${hf(this.h)}, ${100*hp(this.s)}%, ${100*hp(this.l)}%${1===e?")":`, ${e})`}`}}));let hv=e=>()=>e;function hg(e,t){var n=t-e;return n?function(t){return e+t*n}:hv(isNaN(e)?t:e)}let hy=function e(t){var n,r=1==(n=+t)?hg:function(e,t){var r,o,i;return t-e?(r=e,o=t,r=Math.pow(r,i=n),o=Math.pow(o,i)-r,i=1/i,function(e){return Math.pow(r+e*o,i)}):hv(isNaN(e)?t:e)};function o(e,t){var n=r((e=hn(e)).r,(t=hn(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=hg(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return o.gamma=e,o}(1);function hb(e){return function(t){var n,r,o=t.length,i=Array(o),a=Array(o),l=Array(o);for(n=0;n<o;++n)r=hn(t[n]),i[n]=r.r||0,a[n]=r.g||0,l[n]=r.b||0;return i=e(i),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=l(e),r+""}}}hb(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,l=r<t-1?e[r+2]:2*i-o;return hm((n-r/t)*t,a,o,i,l)}}),hb(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],l=e[(r+2)%t];return hm((n-r/t)*t,o,i,a,l)}});var hx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hw=RegExp(hx.source,"g");function hk(e,t){var n,r,o,i,a,l=hx.lastIndex=hw.lastIndex=0,s=-1,c=[],u=[];for(e+="",t+="";(o=hx.exec(e))&&(i=hw.exec(t));)(a=i.index)>l&&(a=t.slice(l,a),c[s]?c[s]+=a:c[++s]=a),(o=o[0])===(i=i[0])?c[s]?c[s]+=i:c[++s]=i:(c[++s]=null,u.push({i:s,x:pF(o,i)})),l=hw.lastIndex;return l<t.length&&(a=t.slice(l),c[s]?c[s]+=a:c[++s]=a),c.length<2?u[0]?(n=u[0].x,function(e){return n(e)+""}):(r=t,function(){return r}):(t=u.length,function(e){for(var n,r=0;r<t;++r)c[(n=u[r]).i]=n.x(e);return c.join("")})}function hj(e,t){var n;return("number"==typeof t?pF:t instanceof p7?hy:(n=p7(t))?(t=n,hy):hk)(e,t)}var hS=fJ.prototype.constructor;function hO(e){return function(){this.style.removeProperty(e)}}var hC=0;function hN(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}var hP=fJ.prototype;hN.prototype=(function(e){return fJ().transition(e)}).prototype={constructor:hN,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=fp(e));for(var r=this._groups,o=r.length,i=Array(o),a=0;a<o;++a)for(var l,s,c=r[a],u=c.length,d=i[a]=Array(u),f=0;f<u;++f)(l=c[f])&&(s=e.call(l,l.__data__,f,c))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,pT(d[f],t,n,f,d,pD(l,n)));return new hN(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=fm(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,c=r[l],u=c.length,d=0;d<u;++d)if(s=c[d]){for(var f,p=e.call(s,s.__data__,d,c),h=pD(s,n),m=0,v=p.length;m<v;++m)(f=p[m])&&pT(f,t,n,m,p,h);i.push(p),a.push(s)}return new hN(i,a,t,n)},selectChild:hP.selectChild,selectChildren:hP.selectChildren,filter:function(e){"function"!=typeof e&&(e=fv(e));for(var t=this._groups,n=t.length,r=Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],c=0;c<l;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&s.push(i);return new hN(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=Array(r),l=0;l<i;++l)for(var s,c=t[l],u=n[l],d=c.length,f=a[l]=Array(d),p=0;p<d;++p)(s=c[p]||u[p])&&(f[p]=s);for(;l<r;++l)a[l]=t[l];return new hN(a,this._parents,this._name,this._id)},selection:function(){return new hS(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++hC,r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)if(a=l[c]){var u=pD(a,t);pT(a,e,n,c,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new hN(r,this._parents,e,n)},call:hP.call,nodes:hP.nodes,node:hP.node,size:hP.size,empty:hP.empty,each:hP.each,on:function(e,t){var n,r,o,i,a,l,s=this._id;return arguments.length<2?pD(this.node(),s).on.on(e):this.each((n=s,r=e,o=t,l=(r+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?pR:pz,function(){var e=l(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(r,o),e.on=a}))},attr:function(e,t){var n=fI(e),r="transform"===n?pq:hj;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}:function(e,t,n){var r,o,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttribute(e):(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}})(n,r,pV(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}:function(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}})(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var r=fI(e);return this.tween(n,(r.local?function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttributeNS(e.space,e.local,o.call(this,t))}),n}return o._value=t,o}:function(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(t){this.setAttribute(e,o.call(this,t))}),n}return o._value=t,o})(r,t))},style:function(e,t,n){var r,o,i,a,l,s,c,u,d,f,p,h,m,v,g,y,b,x,w,k,j,S="transform"==(e+="")?pK:hj;return null==t?this.styleTween(e,(r=e,function(){var e=f_(this,r),t=(this.style.removeProperty(r),f_(this,r));return e===t?null:e===o&&t===i?a:a=S(o=e,i=t)})).on("end.style."+e,hO(e)):"function"==typeof t?this.styleTween(e,(l=e,s=pV(this,"style."+e,t),function(){var e=f_(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=f_(this,l)),e===n?null:e===c&&n===u?d:(u=n,d=S(c=e,t))})).each((f=this._id,b="end."+(y="style."+(p=e)),function(){var e=pz(this,f),t=e.on,n=null==e.value[y]?g||(g=hO(p)):void 0;(t!==h||v!==n)&&(m=(h=t).copy()).on(b,v=n),e.on=m})):this.styleTween(e,(x=e,j=t+"",function(){var e=f_(this,x);return e===j?null:e===w?k:k=S(w=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw Error();return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=pV(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){this.textContent=r.call(this,e)}),t}return r._value=e,r}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=pD(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?function(e,t){var n,r;return function(){var o=pz(this,e),i=o.tween;if(i!==n){r=n=i;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}}o.tween=r}}:function(e,t,n){var r,o;if("function"!=typeof n)throw Error();return function(){var i=pz(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,c=o.length;s<c;++s)if(o[s].name===t){o[s]=l;break}s===c&&o.push(l)}i.tween=o}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){pR(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){pR(this,e).delay=t}})(t,e)):pD(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){pz(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){pz(this,e).duration=t}})(t,e)):pD(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){pz(this,e).ease=t}}(t,e)):pD(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();pz(this,t).ease=n}))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each(function(){var n=pz(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===o&&i()})},[Symbol.iterator]:hP[Symbol.iterator]};var hE={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};fJ.prototype.interrupt=function(e){return this.each(function(){pL(this,e)})},fJ.prototype.transition=function(e){var t,n;e instanceof hN?(t=e._id,e=e._name):(t=++hC,(n=hE).time=pS(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,c=0;c<s;++c)(a=l[c])&&pT(a,e,t,c,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new hN(r,this._parents,e,t)};let hI=e=>()=>e;function hA(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function h_(e,t,n){this.k=e,this.x=t,this.y=n}h_.prototype={constructor:h_,scale:function(e){return 1===e?this:new h_(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new h_(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hM=new h_(1,0,0);function hT(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hM;return e.__zoom}function hR(e){e.stopImmediatePropagation()}function hz(e){e.preventDefault(),e.stopImmediatePropagation()}function hD(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function hL(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function hF(){return this.__zoom||hM}function hU(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hH(){return navigator.maxTouchPoints||"ontouchstart"in this}function h$(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function hB(){var e,t,n,r=hD,o=hL,i=h$,a=hU,l=hH,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=pi,f=fc("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",hF).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",S).filter(l).on("touchstart.zoom",O).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new h_(t,e.x,e.y)}function g(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new h_(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){x(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(r).end()}).tween("zoom",function(){var e=arguments,i=x(this,e).event(r),a=o.apply(this,e),l=null==n?y(a):"function"==typeof n?n.apply(this,e):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=this.__zoom,u="function"==typeof t?t.apply(this,e):t,f=d(c.invert(l).concat(s/c.k),u.invert(l).concat(s/u.k));return function(e){if(1===e)e=u;else{var t=f(e),n=s/t[2];e=new h_(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=x(this,t).event(e),o=this.__zoom,l=Math.max(s[0],Math.min(s[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=f0(e);if(n.wheel)(n.mouse[0][0]!==u[0]||n.mouse[0][1]!==u[1])&&(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===l)return;n.mouse=[u,o.invert(u)],pL(this),n.start()}hz(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(g(v(o,l),n.mouse[0],n.mouse[1]),n.extent,c))}}function j(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=x(this,t,!0).event(e),l=fQ(e.view).on("mousemove.zoom",function(e){if(hz(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(g(a.that.__zoom,a.mouse[0]=f0(e,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),f6(e.view,a.moved),hz(e),a.event(e).end()},!0),s=f0(e,o),u=e.clientX,d=e.clientY;f5(e.view),hR(e),a.mouse=[s,this.__zoom.invert(s)],pL(this),a.start()}}function S(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=f0(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(g(v(n,s),a,l),o.apply(this,t),c);hz(e),u>0?fQ(this).transition().duration(u).call(b,d,a,e):fQ(this).call(m.transform,d,a,e)}}function O(n,...o){if(r.apply(this,arguments)){var i,a,l,s,c=n.touches,u=c.length,d=x(this,o,n.changedTouches.length===u).event(n);for(hR(n),a=0;a<u;++a)s=[s=f0(l=c[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),pL(this),d.start())}}function C(e,...t){if(this.__zooming){var n,r,o,a,l=x(this,t).event(e),s=e.changedTouches,u=s.length;for(hz(e),n=0;n<u;++n)o=f0(r=s[n],this),l.touch0&&l.touch0[2]===r.identifier?l.touch0[0]=o:l.touch1&&l.touch1[2]===r.identifier&&(l.touch1[0]=o);if(r=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],p=l.touch1[0],h=l.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,y=(y=h[0]-f[0])*y+(y=h[1]-f[1])*y;r=v(r,Math.sqrt(m/y)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!l.touch0)return;o=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(g(r,o,a),l.extent,c))}}function N(e,...r){if(this.__zooming){var o,i,a=x(this,r).event(e),l=e.changedTouches,s=l.length;for(hR(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<s;++o)i=l[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=f0(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=fQ(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",hF),e!==o?b(e,t,n,r):o.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,l=r.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(g(v(r,s),a,l),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,l=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return i(hM.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=fQ(this.that).datum();f.call(e,this.that,new hA(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:hI(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:hI(!!e),m):r},m.touchable=function(e){return arguments.length?(l="function"==typeof e?e:hI(!!e),m):l},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:hI([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],m):[s[0],s[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e*=1)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}function hK(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?hv(t):("number"===o?pF:"string"===o?(r=p7(t))?(t=r,hy):hk:t instanceof p7?hy:t instanceof Date?function(e,t){var n=new Date;return e*=1,t*=1,function(r){return n.setTime(e*(1-r)+t*r),n}}:!ArrayBuffer.isView(n=t)||n instanceof DataView?Array.isArray(t)?function(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=Array(o),a=Array(r);for(n=0;n<o;++n)i[n]=hK(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?function(e,t){var n,r={},o={};for(n in(null===e||"object"!=typeof e)&&(e={}),(null===t||"object"!=typeof t)&&(t={}),t)n in e?r[n]=hK(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}:pF:function(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}})(e,t)}hT.prototype=h_.prototype;let hq=[[-1/0,-1/0],[1/0,1/0]],hV=["Enter"," ","Escape"],hW={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};(n=f||(f={})).Strict="strict",n.Loose="loose",(r=p||(p={})).Free="free",r.Vertical="vertical",r.Horizontal="horizontal",(o=h||(h={})).Partial="partial",o.Full="full";let hG={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};(i=m||(m={})).Bezier="default",i.Straight="straight",i.Step="step",i.SmoothStep="smoothstep",i.SimpleBezier="simplebezier",(a=v||(v={})).Arrow="arrow",a.ArrowClosed="arrowclosed",(l=g||(g={})).Left="left",l.Top="top",l.Right="right",l.Bottom="bottom";let hZ={[g.Left]:g.Right,[g.Right]:g.Left,[g.Top]:g.Bottom,[g.Bottom]:g.Top},hY=e=>!!e&&"object"==typeof e&&"id"in e&&"source"in e&&"target"in e,hX=e=>!!e&&"object"==typeof e&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),hJ=(e,t=[0,0])=>{let{width:n,height:r}=mg(e),o=e.origin??t,i=n*o[0],a=r*o[1];return{x:e.position.x-i,y:e.position.y-a}},hQ=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=h7(n,mr(e)),r=!0)}),r?mt(n):{x:0,y:0,width:0,height:0}},h0=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1)=>{let l=(t.x-n)/o,s=(t.y-r)/o,c=t.width/o,u=t.height/o,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(a&&!n||r)continue;let o=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:h}=t.internals.positionAbsolute,m=mi(l,s,c,u,p,h,o,f),v=o*f,g=i&&m>0;(!t.internals.handleBounds||g||m>=v||t.dragging)&&d.push(t)}return d};async function h1({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},a){let l,s;if(0===e.size)return!0;let c=mh(hQ((l=new Map,s=a?.nodes?new Set(a.nodes.map(e=>e.id)):null,e.forEach(e=>{let t;if(a?.includeHiddenNodes){let{width:n,height:r}=mg(e);t=n>0&&r>0}else t=!!(e.measured.width&&e.measured.height&&!e.hidden);t&&(!s||s.has(e.id))&&l.set(e.id,e)}),l)),t,n,a?.minZoom??o,a?.maxZoom??i,a?.padding??.1);return await r.setViewport(c,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}function h2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:s,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},u=a.origin??r,d=a.extent||o;if("parent"!==a.extent||a.expandParent)l&&mv(a.extent)&&(d=[[a.extent[0][0]+s,a.extent[0][1]+c],[a.extent[1][0]+s,a.extent[1][1]+c]]);else if(l){let{width:e,height:t}=mg(l);e&&t&&(d=[[s,c],[s+e,c+t]])}else i?.("005","Only child nodes can use a parent extent.");let f=mv(d)?h5(t,d,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&i?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-s+(a.measured.width??0)*u[0],y:f.y-c+(a.measured.height??0)*u[1]},positionAbsolute:f}}async function h3({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){let i,a=new Set(e.map(e=>e.id)),l=[];for(let e of n){if(!1===e.deletable)continue;let t=a.has(e.id),n=!t&&e.parentId&&l.find(t=>t.id===e.parentId);(t||n)&&l.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>!1!==e.deletable),u=(i=new Set,l.forEach(e=>{i.add(e.id)}),c.filter(e=>i.has(e.source)||i.has(e.target)));for(let e of c)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!o)return{edges:u,nodes:l};let d=await o({nodes:l,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:l}:{edges:[],nodes:[]}:d}let h4=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),h5=(e={x:0,y:0},t,n)=>({x:h4(e.x,t[0][0],t[1][0]-(n?.width??0)),y:h4(e.y,t[0][1],t[1][1]-(n?.height??0))});function h6(e,t,n){let{width:r,height:o}=mg(n),{x:i,y:a}=n.internals.positionAbsolute;return h5(e,[[i,a],[i+r,a+o]],t)}let h8=(e,t,n)=>e<t?h4(Math.abs(e-t),1,t)/t:e>n?-h4(Math.abs(e-n),1,t)/t:0,h9=(e,t,n=15,r=40)=>[h8(e.x,r,t.width-r)*n,h8(e.y,r,t.height-r)*n],h7=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),me=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mt=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),mn=(e,t=[0,0])=>{let{x:n,y:r}=hX(e)?e.internals.positionAbsolute:hJ(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},mr=(e,t=[0,0])=>{let{x:n,y:r}=hX(e)?e.internals.positionAbsolute:hJ(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},mo=(e,t)=>mt(h7(me(e),me(t))),mi=(e,t,n,r,o,i,a,l)=>Math.ceil(Math.max(0,Math.min(e+n,o+a)-Math.max(e,o))*Math.max(0,Math.min(t+r,i+l)-Math.max(t,i))),ma=(e,t)=>mi(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),ml=e=>ms(e.width)&&ms(e.height)&&ms(e.x)&&ms(e.y),ms=e=>!isNaN(e)&&isFinite(e),mc=(e,t)=>(e,t)=>{},mu=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),md=({x:e,y:t},[n,r,o],i=!1,a=[1,1])=>{let l={x:(e-n)/o,y:(t-r)/o};return i?mu(l,a):l},mf=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function mp(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let mh=(e,t,n,r,o,i)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let r=mp(e,n),o=mp(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){let r=mp(e.top??e.y??0,n),o=mp(e.bottom??e.y??0,n),i=mp(e.left??e.x??0,t),a=mp(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:i,x:i+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),l=h4(Math.min((t-a.x)/e.width,(n-a.y)/e.height),r,o),s=e.x+e.width/2,c=e.y+e.height/2,u=t/2-s*l,d=n/2-c*l,f=function(e,t,n,r,o,i){let{x:a,y:l}=mf(e,[t,n,r]),{x:s,y:c}=mf({x:e.x+e.width,y:e.y+e.height},[t,n,r]);return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(o-s),bottom:Math.floor(i-c)}}(e,u,d,l,t,n),p={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:u-p.left+p.right,y:d-p.top+p.bottom,zoom:l}},mm=()=>"u">typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function mv(e){return null!=e&&"parent"!==e}function mg(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function my(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function mb(e,t={width:0,height:0},n,r,o){let i={...e},a=r.get(n);if(a){let e=a.origin||o;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function mx(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function mw(e){return null===e?null:e?"valid":"invalid"}function mk(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){let{x:i,y:a}=mN(e),l=md({x:i-(o?.left??0),y:a-(o?.top??0)},r),{x:s,y:c}=n?mu(l,t):l;return{xSnapped:s,ySnapped:c,...l}}let mj=e=>({width:e.offsetWidth,height:e.offsetHeight}),mS=e=>e?.getRootNode?.()||window?.document,mO=["INPUT","SELECT","TEXTAREA"];function mC(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(mO.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let mN=(e,t)=>{let n="clientX"in e,r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},mP=(e,t,n,r,o)=>{let i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{let i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...mj(t)}}):null};function mE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:l}){let s=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*l+.125*r,u=Math.abs(s-e),d=Math.abs(c-t);return[s,c,u,d]}function mI(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function mA({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case g.Left:return[t-mI(t-r,i),n];case g.Right:return[t+mI(r-t,i),n];case g.Top:return[t,n-mI(n-o,i)];case g.Bottom:return[t,n+mI(o-n,i)]}}function m_({sourceX:e,sourceY:t,sourcePosition:n=g.Bottom,targetX:r,targetY:o,targetPosition:i=g.Top,curvature:a=.25}){let[l,s]=mA({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=mA({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,h]=mE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:s,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${s} ${c},${u} ${r},${o}`,d,f,p,h]}function mM({sourceX:e,sourceY:t,targetX:n,targetY:r}){let o=Math.abs(n-e)/2,i=Math.abs(r-t)/2;return[n<e?n+o:n-o,r<t?r+i:r-i,o,i]}let mT=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`;function mR({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[o,i,a,l]=mM({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,l]}let mz={[g.Left]:{x:-1,y:0},[g.Right]:{x:1,y:0},[g.Top]:{x:0,y:-1},[g.Bottom]:{x:0,y:1}},mD=({source:e,sourcePosition:t=g.Bottom,target:n})=>t===g.Left||t===g.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},mL=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function mF({sourceX:e,sourceY:t,sourcePosition:n=g.Bottom,targetX:r,targetY:o,targetPosition:i=g.Top,borderRadius:a=5,centerX:l,centerY:s,offset:c=20,stepPosition:u=.5}){let[d,f,p,h,m]=function({source:e,sourcePosition:t=g.Bottom,target:n,targetPosition:r=g.Top,center:o,offset:i,stepPosition:a}){let l,s,c=mz[t],u=mz[r],d={x:e.x+c.x*i,y:e.y+c.y*i},f={x:n.x+u.x*i,y:n.y+u.y*i},p=mD({source:d,sourcePosition:t,target:f}),h=0!==p.x?"x":"y",m=p[h],v=[],y={x:0,y:0},b={x:0,y:0},[,,x,w]=mM({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[h]*u[h]==-1){"x"===h?(l=o.x??d.x+(f.x-d.x)*a,s=o.y??(d.y+f.y)/2):(l=o.x??(d.x+f.x)/2,s=o.y??d.y+(f.y-d.y)*a);let e=[{x:l,y:d.y},{x:l,y:f.y}],t=[{x:d.x,y:s},{x:f.x,y:s}];v=c[h]===m?"x"===h?e:t:"x"===h?t:e}else{let o=[{x:d.x,y:f.y}],a=[{x:f.x,y:d.y}];if(v="x"===h?c.x===m?a:o:c.y===m?o:a,t===r){let t=Math.abs(e[h]-n[h]);if(t<=i){let r=Math.min(i-1,i-t);c[h]===m?y[h]=(d[h]>e[h]?-1:1)*r:b[h]=(f[h]>n[h]?-1:1)*r}}if(t!==r){let e="x"===h?"y":"x",t=c[h]===u[e],n=d[e]>f[e],r=d[e]<f[e];(1===c[h]&&(!t&&n||t&&r)||1!==c[h]&&(!t&&r||t&&n))&&(v="x"===h?o:a)}let p={x:d.x+y.x,y:d.y+y.y},g={x:f.x+b.x,y:f.y+b.y};Math.max(Math.abs(p.x-v[0].x),Math.abs(g.x-v[0].x))>=Math.max(Math.abs(p.y-v[0].y),Math.abs(g.y-v[0].y))?(l=(p.x+g.x)/2,s=v[0].y):(l=v[0].x,s=(p.y+g.y)/2)}let k={x:d.x+y.x,y:d.y+y.y},j={x:f.x+b.x,y:f.y+b.y};return[[e,...k.x!==v[0].x||k.y!==v[0].y?[k]:[],...v,...j.x!==v[v.length-1].x||j.y!==v[v.length-1].y?[j]:[],n],l,s,x,w]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:s},offset:c,stepPosition:u}),v=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)v+=function(e,t,n,r){let o=Math.min(mL(e,t)/2,mL(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${i+o*t},${a}Q ${i},${a} ${i},${a+o*r}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${i},${a+o*s}Q ${i},${a} ${i+o*l},${a}`}(d[e-1],d[e],d[e+1],a);return[v+=`L${d[d.length-1].x} ${d[d.length-1].y}`,f,p,h,m]}function mU(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function mH(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function m$(e,t,n=g.Left,r=!1){let o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??mg(e);if(r)return{x:o+a/2,y:i+l/2};switch(t?.position??n){case g.Top:return{x:o+a/2,y:i};case g.Right:return{x:o+a,y:i+l/2};case g.Bottom:return{x:o+a/2,y:i+l};case g.Left:return{x:o,y:i+l/2}}}function mB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function mK(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}let mq={nodeOrigin:[0,0],nodeExtent:hq,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mV={...mq,checkEquality:!0};function mW(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function mG(e){return"manual"===e}function mZ(e,t,n,r={}){let o=mW(mV,r),i={i:0},a=new Map(t),l=o?.elevateNodesOnSelect&&!mG(o.zIndexMode)?1e3:0,s=e.length>0,c=!1;for(let u of(t.clear(),n.clear(),e)){let e=a.get(u.id);if(o.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=h5(hJ(u,o.nodeOrigin),mv(u.extent)?u.extent:o.nodeExtent,mg(u));e={...o.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:function(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let o={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(o):"target"===t.type&&r.push(o)}return{source:n,target:r}}(u,e),z:mX(u,l,o.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(s=!1),u.parentId&&mY(e,t,n,r,i),c||=u.selected??!1}return{nodesInitialized:s,hasSelectedNodes:c}}function mY(e,t,n,r,o){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:l,zIndexMode:s}=mW(mq,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===s&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+10*o.i),o&&void 0!==u.internals.rootParentIndex&&(o.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=function(e,t,n,r,o,i){let{x:a,y:l}=t.internals.positionAbsolute,s=mg(e),c=hJ(e,n),u=mv(e.extent)?h5(c,e.extent,s):c,d=h5({x:a+u.x,y:l+u.y},r,s);"parent"===e.extent&&(d=h6(d,s,t));let f=mX(e,o,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}(e,u,a,l,i&&!mG(s)?1e3:0,s),{positionAbsolute:h}=e.internals,m=d!==h.x||f!==h.y;(m||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:d,y:f}:h,z:p}})}function mX(e,t,n){let r=ms(e.zIndex)?e.zIndex:0;return mG(n)?r:r+(e.selected?t:0)}function mJ(e,t,n,r=[0,0]){let o=[],i=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=mo(i.get(n.parentId)?.expandedRect??mn(e),n.rect);i.set(n.parentId,{expandedRect:r,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{let l=i.internals.positionAbsolute,s=mg(i),c=i.origin??r,u=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,d=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,f=Math.max(s.width,Math.round(t.width)),p=Math.max(s.height,Math.round(t.height)),h=(f-s.width)*c[0],m=(p-s.height)*c[1];(u>0||d>0||h||m)&&(o.push({id:a,type:"position",position:{x:i.position.x-u+h,y:i.position.y-d+m}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||o.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(s.width<t.width||s.height<t.height||u||d)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-h:0),height:p+(d?c[1]*d-m:0)}})}),o}async function mQ({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function m0(e,t,n,r,o,i){let a=o,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${o}-${e}`;let s=r.get(a)||new Map;if(r.set(a,s.set(n,t)),i){a=`${o}-${e}-${i}`;let l=r.get(a)||new Map;r.set(a,l.set(n,t))}}function m1(e,t,n){for(let r of(e.clear(),t.clear(),n)){let{source:n,target:o,sourceHandle:i=null,targetHandle:a=null}=r,l={edgeId:r.id,source:n,target:o,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${o}-${a}`;m0("source",l,`${o}-${a}--${n}-${i}`,e,n,i),m0("target",l,s,e,o,a),t.set(r.id,r)}}function m2(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)break;r=r?.parentElement}while(r);return!1}function m3({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let o=[];for(let[e,i]of t){let t=n.get(e)?.internals.userNode;t&&o.push({...t,position:i.position,dragging:r})}if(!e)return[o[0],o];let i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:r}:o[0],o]}function m4(e,t,n,r,o,i=!1){let a=r.get(e);if(!a)return null;let l="strict"===o?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],s=(n?l?.find(e=>e.id===n):l?.[0])??null;return s&&i?{...s,...m$(a,s,s.position,!0)}:s}function m5(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let m6=()=>!0;function m8(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:a,lib:l,flowId:s,isValidConnection:c=m6,nodeLookup:u}){let d="target"===i,p=t?a.querySelector(`.${l}-flow__handle[data-id="${s}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:m}=mN(e),v=a.elementFromPoint(h,m),g=v?.classList.contains(`${l}-flow__handle`)?v:p,y={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=m5(void 0,g),t=g.getAttribute("data-nodeid"),i=g.getAttribute("data-handleid"),a=g.classList.contains("connectable"),l=g.classList.contains("connectableend");if(!t||!e)return y;let s={source:d?t:r,sourceHandle:d?i:o,target:d?r:t,targetHandle:d?o:i};y.connection=s,y.isValid=a&&l&&(n===f.Strict?d&&"source"===e||!d&&"target"===e:t!==r||i!==o)&&c(s),y.toHandle=m4(t,e,i,u,n,!0)}return y}let m9=function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:s,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:h,onConnect:m,onConnectEnd:v,isValidConnection:y=m6,onReconnectEnd:b,updateConnection:x,getTransform:w,getFromHandle:k,autoPanSpeed:j,dragThreshold:S=1,handleDomNode:O}){let C,N=mS(e.target),P=0,{x:E,y:I}=mN(e),A=m5(i,O),_=l?.getBoundingClientRect(),M=!1;if(!_||!A)return;let T=m4(o,A,r,s,t);if(!T)return;let R=mN(e,_),z=!1,D=null,L=!1,F=null,U={...T,nodeId:o,type:A,position:T.position},H=s.get(o),$={inProgress:!0,isValid:null,from:m$(H,U,g.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:H,to:R,toHandle:null,toPosition:hZ[U.position],toNode:null,pointer:R};function B(){M=!0,x($),h?.(e,{nodeId:o,handleId:r,handleType:A})}function K(e){var i,l;let p;if(!M){let{x:t,y:n}=mN(e),r=t-E,o=n-I;if(!(r*r+o*o>S*S))return;B()}if(!k()||!U)return void q(e);let h=w();C=function(e,t,n,r){let o=[],i=1/0;for(let a of function(e,t,n){let r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())ma(o,mn(e))>0&&r.push(e);return r}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(r.nodeId===n.nodeId&&r.type===n.type&&r.id===n.id)continue;let{x:l,y:s}=m$(a,n,n.position,!0),c=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(s-e.y,2));c>t||(c<i?(o=[{...n,x:l,y:s}],i=c):c===i&&o.push({...n,x:l,y:s}))}if(!o.length)return null;if(o.length>1){let e="source"===r.type?"target":"source";return o.find(t=>t.type===e)??o[0]}return o[0]}(md(R=mN(e,_),h,!1,[1,1]),n,s,U),z||(!function e(){if(!u||!_)return;let[t,n]=h9(R,_,j);f({x:t,y:n}),P=requestAnimationFrame(e)}(),z=!0);let m=m8(e,{handle:C,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:N,lib:c,flowId:d,nodeLookup:s});F=m.handleDomNode,D=m.connection,i=!!C,l=m.isValid,p=null,l?p=!0:i&&!l&&(p=!1),L=p;let v=s.get(o),b=v?m$(v,U,g.Left,!0):$.from,O={...$,from:b,isValid:L,to:m.toHandle&&L?mf({x:m.toHandle.x,y:m.toHandle.y},h):R,toHandle:m.toHandle,toPosition:L&&m.toHandle?m.toHandle.position:hZ[U.position],toNode:m.toHandle?s.get(m.toHandle.nodeId):null,pointer:R};x(O),$=O}function q(e){if(!("touches"in e)||!(e.touches.length>0)){if(M){(C||F)&&D&&L&&m?.(D);let{inProgress:t,...n}=$,r={...n,toPosition:$.toHandle?$.toPosition:null};v?.(e,r),i&&b?.(e,r)}p(),cancelAnimationFrame(P),z=!1,L=!1,D=null,F=null,N.removeEventListener("mousemove",K),N.removeEventListener("mouseup",q),N.removeEventListener("touchmove",K),N.removeEventListener("touchend",q)}}0===S&&B(),N.addEventListener("mousemove",K),N.addEventListener("mouseup",q),N.addEventListener("touchmove",K),N.addEventListener("touchend",q)},m7=e=>({x:e.x,y:e.y,zoom:e.k}),ve=({x:e,y:t,zoom:n})=>hM.translate(e,t).scale(n),vt=(e,t)=>e.target.closest(`.${t}`),vn=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),vr=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,vo=(e,t=0,n=vr,r=()=>{})=>{let o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},vi=e=>{let t=e.ctrlKey&&mm()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function va(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}function vl(e,t){return Math.max(0,t-e)}function vs(e,t){return Math.max(0,e-t)}function vc(e,t,n){return Math.max(0,t-e,e-n)}(s=y||(y={})).Line="line",s.Handle="handle";let vu={width:0,height:0,x:0,y:0},vd={...vu,pointerX:0,pointerY:0,aspectRatio:1};var vf=d(7121);let vp=e=>{let t,n=new Set,r=(e,r)=>{let o="function"==typeof e?e(t):e;if(!Object.is(o,t)){let e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},{useDebugValue:vh}=w,{useSyncExternalStoreWithSelector:vm}=vf,vv=e=>e;function vg(e,t=vv,n){let r=vm(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return vh(r),r}let vy=(e,t)=>{let n=e?vp(e):vp,r=(e,r=t)=>vg(n,e,r);return Object.assign(r,n),r};function vb(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}let vx=(0,w.createContext)(null),vw=vx.Provider,vk=((e="react")=>`Seems like you have not used ${"svelte"===e?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`)("react");function vj(e,t){let n=(0,w.useContext)(vx);if(null===n)throw Error(vk);return vg(n,e,t)}function vS(){let e=(0,w.useContext)(vx);if(null===e)throw Error(vk);return(0,w.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let vO={display:"none"},vC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vN="react-flow__node-desc",vP="react-flow__edge-desc",vE=e=>e.ariaLiveMessage,vI=e=>e.ariaLabelConfig;function vA({rfId:e}){let t=vj(vE);return(0,x.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vC,children:t})}function v_({rfId:e,disableKeyboardA11y:t}){let n=vj(vI);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{id:`${vN}-${e}`,style:vO,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,x.jsx)("div",{id:`${vP}-${e}`,style:vO,children:n["edge.a11yDescription.default"]}),!t&&(0,x.jsx)(vA,{rfId:e})]})}let vM=(0,w.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{let a=`${e}`.split("-");return(0,x.jsx)("div",{className:fl(["react-flow__panel",n,...a]),style:r,ref:i,...o,children:t})});vM.displayName="Panel";let vT="https://reactflow.dev?utm_source=attribution";function vR({proOptions:e,position:t="bottom-right"}){return((0,w.useEffect)(()=>{},[]),e?.hideAttribution)?null:(0,x.jsx)(vM,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${vT}`,children:(0,x.jsx)("a",{href:vT,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}let vz=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},vD=e=>e.id;function vL(e,t){return vb(e.selectedNodes.map(vD),t.selectedNodes.map(vD))&&vb(e.selectedEdges.map(vD),t.selectedEdges.map(vD))}function vF({onSelectionChange:e}){let t=vS(),{selectedNodes:n,selectedEdges:r}=vj(vz,vL);return(0,w.useEffect)(()=>{let o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}let vU=e=>!!e.onSelectionChangeHandlers;function vH({onSelectionChange:e}){let t=vj(vU);return e||t?(0,x.jsx)(vF,{onSelectionChange:e}):null}let v$=[0,0],vB={x:0,y:0,zoom:1},vK=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],vq=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),vV={translateExtent:hq,nodeOrigin:v$,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vW(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:s}=vj(vq,vb),c=vS();(0,w.useEffect)(()=>(s(e.defaultNodes,e.defaultEdges),()=>{u.current=vV,l()}),[]);let u=(0,w.useRef)(vV);return(0,w.useEffect)(()=>{for(let l of vK){let s=e[l];if(s!==u.current[l]&&void 0!==e[l])if("nodes"===l)t(s);else if("edges"===l)n(s);else if("minZoom"===l)r(s);else if("maxZoom"===l)o(s);else if("translateExtent"===l)i(s);else if("nodeExtent"===l)a(s);else if("ariaLabelConfig"===l)c.setState({ariaLabelConfig:{...hW,...s||{}}});else"fitView"===l?c.setState({fitViewQueued:s}):"fitViewOptions"===l?c.setState({fitViewOptions:s}):c.setState({[l]:s})}u.current=e},vK.map(t=>e[t])),null}function vG(){return"u"<typeof window||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}let vZ="u">typeof document?document:null;function vY(e=null,t={target:vZ,actInsideInputWithModifier:!0}){let[n,r]=(0,w.useState)(!1),o=(0,w.useRef)(!1),i=(0,w.useRef)(new Set([])),[a,l]=(0,w.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace(/\+/g,"\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,w.useEffect)(()=>{let n=t?.target??vZ,s=t?.actInsideInputWithModifier??!0;if(null!==e){let e=e=>{if(o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!o.current||o.current&&!s)&&mC(e))return!1;let n=vJ(e.code,l);if(i.current.add(e[n]),vX(a,i.current,!1)){let n=e.composedPath?.()?.[0]||e.target,i=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(o.current||!i)&&e.preventDefault(),r(!0)}},c=e=>{let t=vJ(e.code,l);vX(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),o.current=!1},u=()=>{i.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function vX(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function vJ(e,t){return t.includes(e)?"code":"key"}function vQ(e,t){let n=[],r=new Map,o=[];for(let t of e)if("add"===t.type){o.push(t);continue}else if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let o={...e};for(let e of t){var i=e,a=o;switch(i.type){case"select":a.selected=i.selected;break;case"position":void 0!==i.position&&(a.position=i.position),void 0!==i.dragging&&(a.dragging=i.dragging);break;case"dimensions":void 0!==i.dimensions&&(a.measured={...i.dimensions},i.setAttributes&&((!0===i.setAttributes||"width"===i.setAttributes)&&(a.width=i.dimensions.width),(!0===i.setAttributes||"height"===i.setAttributes)&&(a.height=i.dimensions.height))),"boolean"==typeof i.resizing&&(a.resizing=i.resizing)}}n.push(o)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function v0(e,t){return{id:e,type:"select",selected:t}}function v1(e,t=new Set,n=!1){let r=[];for(let[o,i]of e){let e=t.has(o);(void 0!==i.selected||e)&&i.selected!==e&&(n&&(i.selected=e),r.push(v0(i.id,e)))}return r}function v2({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,o]of e.entries()){let e=t.get(o.id),i=e?.internals?.userNode??e;void 0!==i&&i!==o&&n.push({id:o.id,item:o,type:"replace"}),void 0===i&&n.push({item:o,type:"add",index:r})}for(let[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function v3(e){return{id:e.id,type:"remove"}}let v4=mc("React Flow","https://reactflow.dev/"),v5=e=>!!e&&"object"==typeof e&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e);function v6(e){return(0,w.forwardRef)(e)}let v8="u">typeof window?w.useLayoutEffect:w.useEffect;function v9(e){let[t,n]=(0,w.useState)(BigInt(0)),[r]=(0,w.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return v8(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}let v7=(0,w.createContext)(null);function ge({children:e}){let t=vS(),n=v9((0,w.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:i,nodeLookup:a,fitViewQueued:l,onNodesChangeMiddlewareMap:s}=t.getState(),c=n;for(let t of e)c="function"==typeof t?t(c):t;let u=v2({items:c,lookup:a});for(let e of s.values())u=e(u);o&&r(c),u.length>0?i?.(u):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=v9((0,w.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i,edgeLookup:a}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;o?r(l):i&&i(v2({items:l,lookup:a}))},[])),o=(0,w.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,x.jsx)(v7.Provider,{value:o,children:e})}let gt=e=>!!e.panZoom;function gn(){let e,t=(e=vS(),(0,w.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1.2,t)},zoomOut:async t=>{let{panZoom:n}=e.getState();return!!n&&n.scaleBy(1/1.2,t)},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return!!r&&r.scaleTo(t,n)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,o,i],panZoom:a}=e.getState();return!!a&&(await a.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:o,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),s=mh(t,r,o,i,a,n?.padding??.1);return!!l&&(await l.setViewport(s,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:o,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:l,y:s}=a.getBoundingClientRect(),c={x:t.x-l,y:t.y-s},u=n.snapGrid??o;return md(c,r,n.snapToGrid??i,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:o,y:i}=r.getBoundingClientRect(),a=mf(t,n);return{x:a.x+o,y:a.y+i}}}),[])),n=vS(),r=function(){let e=(0,w.useContext)(v7);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),o=vj(gt),i=(0,w.useMemo)(()=>{let e=e=>n.getState().nodeLookup.get(e),t=e=>{r.nodeQueue.push(e)},o=e=>{r.edgeQueue.push(e)},i=e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState(),o=v5(e)?e:t.get(e.id),i=o.parentId?mb(o.position,o.measured,o.parentId,t,r):o.position;return mn({...o,position:i,width:o.measured?.width??o.width,height:o.measured?.height??o.height})},a=(e,n,r={replace:!1})=>{t(t=>t.map(t=>{if(t.id===e){let e="function"==typeof n?n(t):n;return r.replace&&v5(e)?e:{...t,...e}}return t}))},l=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){let e="function"==typeof t?t(r):t;return n.replace&&hY(e)?e:{...r,...e}}return r}))};return{getNodes:()=>n.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=n.getState();return e.map(e=>({...e}))},getEdge:e=>n.getState().edgeLookup.get(e),setNodes:t,setEdges:o,addNodes:e=>{let t=Array.isArray(e)?e:[e];r.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];r.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:t=[],transform:r}=n.getState(),[o,i,a]=r;return{nodes:e.map(e=>({...e})),edges:t.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:t=[]})=>{let{nodes:r,edges:o,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:l,triggerEdgeChanges:s,onDelete:c,onBeforeDelete:u}=n.getState(),{nodes:d,edges:f}=await h3({nodesToRemove:e,edgesToRemove:t,nodes:r,edges:o,onBeforeDelete:u}),p=f.length>0,h=d.length>0;if(p){let e=f.map(v3);a?.(f),s(e)}if(h){let e=d.map(v3);i?.(d),l(e)}return(h||p)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,t=!0,r)=>{let o=ml(e),a=o?e:i(e),l=void 0!==r;return a?(r||n.getState().nodes).filter(r=>{let i=n.getState().nodeLookup.get(r.id);if(i&&!o&&(r.id===e.id||!i.internals.positionAbsolute))return!1;let s=mn(l?r:i),c=ma(s,a);return t&&c>0||c>=s.width*s.height||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=ml(e)?e:i(e);if(!r)return!1;let o=ma(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:t,nodeOrigin:r}=n.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let o="string"==typeof r,i=t.nodeLookup||o?void 0:r;return(t.nodeLookup&&(i=o?t.nodeLookup.get(r):hX(r)?r:t.nodeLookup.get(r.id)),i)?(n=!0,h7(e,mr(i,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?mt(r):{x:0,y:0,width:0,height:0}})(e,{nodeLookup:t,nodeOrigin:r})},getHandleConnections:({type:e,id:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}-${e}${t?`-${t}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:t,nodeId:r})=>Array.from(n.getState().connectionLookup.get(`${r}${e?t?`-${e}-${t}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let t,o,i=n.getState().fitViewResolver??{promise:new Promise((e,n)=>{t=e,o=n}),resolve:t,reject:o};return n.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:i}),r.nodeQueue.push(e=>[...e]),i.promise}}},[]);return(0,w.useMemo)(()=>({...i,...t,viewportInitialized:o}),[o])}let gr=e=>e.selected,go="u">typeof window?window:void 0,gi={position:"absolute",width:"100%",height:"100%",top:0,left:0},ga=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function gl({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:a=p.Free,zoomOnDoubleClick:l=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:v,noWheelClassName:g,noPanClassName:y,onViewportChange:b,isControlledViewport:k,paneClickDistance:j,selectionOnDrag:S}){let O,C=vS(),N=(0,w.useRef)(null),{userSelectionActive:P,lib:E,connectionInProgress:I}=vj(ga,vb),A=vY(h),_=(0,w.useRef)();O=vS(),(0,w.useEffect)(()=>{let e=()=>{if(!N.current||!(N.current.checkVisibility?.()??!0))return!1;let e=mj(N.current);(0===e.height||0===e.width)&&O.getState().onError?.("004","The parent container needs a width and a height to render the graph."),O.setState({width:e.width||500,height:e.height||500})};if(N.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(N.current),()=>{window.removeEventListener("resize",e),t&&N.current&&t.unobserve(N.current)}}},[]);let M=(0,w.useCallback)(e=>{b?.({x:e[0],y:e[1],zoom:e[2]}),k||C.setState({transform:e})},[b,k]);return(0,w.useEffect)(()=>{if(N.current){_.current=function({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:s}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f="u">typeof ResizeObserver?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let h=hB().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=fQ(e).call(h);x({x:o.x,y:o.y,zoom:h4(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);let v=m.on("wheel.zoom"),g=m.on("dblclick.zoom");async function y(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?hK:pi).transform(vo(m,t?.duration,t?.ease,()=>n(!0)),e)})}function b(){h.on("zoom",null)}async function x(e,t,n){let r=ve(e),o=h?.constrain()(r,t,n);return o&&await y(o),o}return h.wheelDelta(vi),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:y,zoomOnPinch:x,zoomOnScroll:w,zoomOnDoubleClick:k,panActivationKeyPressed:j=!1,zoomActivationKeyPressed:S,lib:O,onTransformChange:C,connectionInProgress:N,paneClickDistance:P,selectionOnDrag:E}){r&&!c.isZoomingOrPanning&&b();let I=o&&!S&&!r;h.clickDistance(E?1/0:!ms(P)||P<0?0:P);let A=I?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:c}){return u=>{if(vt(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(u.ctrlKey&&a){let e=f0(u),t=d*Math.pow(2,vi(u));r.scaleTo(n,t,e,u);return}let f=1===u.deltaMode?20:1,h=o===p.Vertical?0:u.deltaX*f,m=o===p.Horizontal?0:u.deltaY*f;!mm()&&u.shiftKey&&o!==p.Vertical&&(h=u.deltaY*f,m=0),r.translateBy(n,-(h/d)*i,-(m/d)*i,{internal:!0});let v=m7(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?s?.(u,v):(e.isPanScrolling=!0,l?.(u,v)),e.panScrollTimeout=setTimeout(()=>{c?.(u,v),e.isPanScrolling=!1},150)}}({zoomPanValues:c,noWheelClassName:e,d3Selection:m,d3Zoom:h,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:x,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:l}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){let i="wheel"===r.type,a=!t&&i&&!r.ctrlKey,l=vt(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:v});m.on("wheel.zoom",A,{passive:!1});let _=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let o=m7(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,o)}}({zoomPanValues:c,onDraggingChange:s,onPanZoomStart:a});h.on("start",_);let M=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&vn(t,e.mouseButton??0)),i.sourceEvent?.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,m7(i.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:i,onTransformChange:C});h.on("zoom",M);let T=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&vn(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){let t=m7(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:l,onDraggingChange:s});h.on("end",T);let R=function({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:s,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{let p=t||n,h=r&&f.ctrlKey,m="wheel"===f.type;if(1===f.button&&"mousedown"===f.type&&(vt(f,`${u}-flow__node`)||vt(f,`${u}-flow__edge`)||vt(f,`${u}-flow__selection`)||vt(f,`${u}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!a&&!r||l||d&&!m||vt(f,s)&&m||vt(f,c)&&(!m||i&&m&&!t)||!r&&f.ctrlKey&&m)return!1;if(!r&&"touchstart"===f.type&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!i&&!h&&m||!o&&("mousedown"===f.type||"touchstart"===f.type)||Array.isArray(o)&&!o.includes(f.button)&&"mousedown"===f.type)return!1;let v=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m||e)&&v}}({panActivationKeyPressed:j,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:w,panOnScroll:o,zoomOnDoubleClick:k,zoomOnPinch:x,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:O,connectionInProgress:N});h.filter(R),k?m.on("dblclick.zoom",g):m.on("dblclick.zoom",null)},destroy:b,setViewport:async function e(e,t){let n=ve(e);return await y(n,t),n},setViewportConstrained:x,getViewport:function(){let e=m?hT(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:async function e(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?hK:pi).scaleTo(vo(m,t?.duration,t?.ease,()=>n(!0)),e)})},scaleBy:async function e(e,t){return!!m&&new Promise(n=>{h?.interpolate(t?.interpolate==="linear"?hK:pi).scaleBy(vo(m,t?.duration,t?.ease,()=>n(!0)),e)})},setScaleExtent:function(e){h?.scaleExtent(e)},setTranslateExtent:function(e){h?.translateExtent(e)},syncViewport:function(e){if(m){let t=ve(e),n=m.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&h?.transform(m,t,null,{sync:!0})}},setClickDistance:function(e){let t=!ms(e)||e<0?0:e;h?.clickDistance(t)}}}({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=_.current.getViewport();return C.setState({panZoom:_.current,transform:[e,t,n],domNode:N.current.closest(".react-flow")}),()=>{_.current?.destroy()}}},[]),(0,w.useEffect)(()=>{_.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:s,zoomActivationKeyPressed:A,preventScrolling:m,noPanClassName:y,userSelectionActive:P,noWheelClassName:g,lib:E,onTransformChange:M,connectionInProgress:I,selectionOnDrag:S,paneClickDistance:j})},[e,t,n,r,o,i,a,l,s,A,m,y,P,g,E,M,I,S,j]),(0,x.jsx)("div",{className:"react-flow__renderer",ref:N,style:gi,children:v})}let gs=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function gc(){let{userSelectionActive:e,userSelectionRect:t}=vj(gs,vb);return e&&t?(0,x.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let gu=(e,t)=>n=>{n.target===t.current&&e?.(n)},gd=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function gf({isSelecting:e,selectionKeyPressed:t,selectionMode:n=h.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:v}){let g=(0,w.useRef)(0),y=vS(),{userSelectionActive:b,elementsSelectable:k,dragging:j,panBy:S,autoPanSpeed:O}=vj(gd,vb),C=k&&(e||b),N=(0,w.useRef)(null),P=(0,w.useRef)(),E=(0,w.useRef)(new Set),I=(0,w.useRef)(new Set),A=(0,w.useRef)(!1),_=(0,w.useRef)(!1),M=(0,w.useRef)({x:0,y:0}),T=(0,w.useRef)(!1),R=e=>{if(_.current||A.current||y.getState().connection.inProgress){_.current=!1,A.current=!1;return}c?.(e),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})};function z(e,t){let{userSelectionRect:r}=y.getState();if(!r)return;let{transform:o,nodeLookup:i,edgeLookup:a,connectionLookup:l,triggerNodeChanges:s,triggerEdgeChanges:c,defaultEdgeOptions:u}=y.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=mf(d,o),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},v=E.current,g=I.current;E.current=new Set(h0(i,m,o,n===h.Partial,!0).map(e=>e.id)),I.current=new Set;let b=u?.selectable??!0;for(let e of E.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=a.get(e);t&&(t.selectable??b)&&I.current.add(e)}}mx(v,E.current)||s(v1(i,E.current,!0)),mx(g,I.current)||c(v1(a,I.current)),y.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}let D=()=>{cancelAnimationFrame(g.current),g.current=0,T.current=!1};(0,w.useEffect)(()=>()=>D(),[]);let L=!0===r||Array.isArray(r)&&r.includes(0);return(0,x.jsxs)("div",{className:fl(["react-flow__pane",{draggable:L,dragging:j,selection:e}]),onClick:C?void 0:gu(R,N),onContextMenu:gu(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},N),onWheel:gu(d?e=>d(e):void 0,N),onPointerEnter:C?void 0:f,onPointerMove:C?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:a}=y.getState();if(!P.current||!n)return;let{x:s,y:c}=mN(e.nativeEvent,P.current);M.current={x:s,y:c};let u=mf({x:n.startX,y:n.startY},r);if(!_.current){if(Math.hypot(s-u.x,c-u.y)<=(t?0:i))return;a(),l?.(e)}_.current=!0,T.current||(!function e(){if(!o||!P.current)return;let[t,n]=h9(M.current,P.current,O);S({x:t,y:n}).then(t=>{if(!_.current||!t){g.current=requestAnimationFrame(e);return}let{x:n,y:r}=M.current;z(n,r),g.current=requestAnimationFrame(e)})}(),T.current=!0),z(s,c)}:p,onPointerUp:e=>{if(!C){e.target===N.current&&y.getState().connection.inProgress&&(A.current=!0);return}0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!b&&e.target===N.current&&y.getState().userSelectionRect&&R?.(e),y.setState({userSelectionActive:!1,userSelectionRect:null}),_.current&&(s?.(e),y.setState({nodesSelectionActive:E.current.size>0})),D())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),D()}:void 0,onPointerDownCapture:C?n=>{if("touch"===n.pointerType&&!1!==r&&!t)return;let{domNode:o,transform:i}=y.getState();if(P.current=o?.getBoundingClientRect(),!P.current)return;let l=n.target===N.current;if(!l&&n.target.closest(".nokey")||!e||!(a&&l||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),_.current=!1;let{x:s,y:c}=mN(n.nativeEvent,P.current),u=md({x:s,y:c},i);y.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:s,y:c}}),l||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:C?e=>{_.current&&(e.stopPropagation(),_.current=!1)}:void 0,onPointerLeave:m,ref:N,style:gi,children:[v,(0,x.jsx)(gc,{})]})}function gp({id:e,store:t,unselect:n=!1,nodeRef:r}){let o,{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:s,onError:c}=t.getState(),u=s.get(e);u?(t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(a({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.("012",(o=e,`Node with id "${o}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`))}function gh({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:a}){let l=vS(),[s,c]=(0,w.useState)(!1),u=(0,w.useRef)();return(0,w.useEffect)(()=>{if(!t)return u.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},a=0,l=new Map,s=!1,c={x:0,y:0},u=null,d=!1,f=null,p=!1,h=!1,m=null;return{update:function({noDragClassName:v,handleSelector:g,domNode:y,isSelectable:b,nodeId:x,nodeClickDistance:w=0}){function k({x:e,y:n}){let{nodeLookup:o,nodeExtent:a,snapGrid:s,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:v}=t();i={x:e,y:n};let g=!1,y=l.size>1,b=y&&a?me(hQ(l)):null,w=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){let o=e.values().next().value;if(!o)return null;let i={x:n-o.distance.x,y:r-o.distance.y},a=mu(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:l,snapGrid:s,x:e,y:n}):null;for(let[t,r]of l){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};c&&(i=w?{x:Math.round(i.x+w.x),y:Math.round(i.y+w.y)}:mu(i,s));let l=null;if(y&&a&&!r.extent&&b){let{positionAbsolute:e}=r.internals,t=e.x-b.x+a[0][0],n=e.x+r.measured.width-b.x2+a[1][0];l=[[t,e.y-b.y+a[0][1]],[n,e.y+r.measured.height-b.y2+a[1][1]]]}let{position:d,positionAbsolute:f}=h2({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:l||a,nodeOrigin:u,onError:p});g=g||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(h=h||g,g&&(v(l,!0),m&&(r||d||!x&&f))){let[e,t]=m3({nodeId:x,dragItems:l,nodeLookup:o});r?.(m,l,e,t),d?.(m,e,t),x||f?.(m,t)}}async function j(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o){s=!1,cancelAnimationFrame(a);return}let[l,d]=h9(c,u,r);(0!==l||0!==d)&&(i.x=(i.x??0)-l/e[2],i.y=(i.y??0)-d/e[2],await n({x:l,y:d})&&k(i)),a=requestAnimationFrame(j)}function S(r){let{nodeLookup:o,multiSelectionActive:a,nodesDraggable:s,transform:c,snapGrid:f,snapToGrid:p,selectNodesOnDrag:h,onNodeDragStart:m,onSelectionDragStart:v,unselectNodesAndEdges:g}=t();d=!0,h&&b||a||!x||o.get(x)?.selected||g(),b&&h&&x&&e?.(x);let y=mk(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:p,containerBounds:u});if(i=y,(l=function(e,t,n,r){let o=new Map;for(let[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let r=n.get(t.parentId);return!!r&&(!!r.selected||e(r,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(i);t&&o.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(o,s,y,x)).size>0&&(n||m||!x&&v)){let[e,t]=m3({nodeId:x,dragItems:l,nodeLookup:o});n?.(r.sourceEvent,l,e,t),m?.(r.sourceEvent,e,t),x||v?.(r.sourceEvent,t)}}f=fQ(y);let O=pr().clickDistance(w).on("start",e=>{let{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:a,snapToGrid:l}=t();u=n?.getBoundingClientRect()||null,p=!1,h=!1,m=e.sourceEvent,0===r&&S(e),i=mk(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:l,containerBounds:u}),c=mN(e.sourceEvent,u)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:a,nodeDragThreshold:f,nodeLookup:h}=t(),v=mk(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:a,containerBounds:u});if(m=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||x&&!h.has(x))&&(p=!0),!p){if(!s&&n&&d&&(s=!0,j()),!d){let t=mN(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&S(e)}(i.x!==v.xSnapped||i.y!==v.ySnapped)&&l&&d&&(c=mN(e.sourceEvent,u),k(v))}}).on("end",e=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(s=!1,d=!1,cancelAnimationFrame(a),l.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:i,onSelectionDragStop:a}=t();if(h&&(r(l,!1),h=!1),o||i||!x&&a){let[t,r]=m3({nodeId:x,dragItems:l,nodeLookup:n,dragging:!1});o?.(e.sourceEvent,l,t,r),i?.(e.sourceEvent,t,r),x||a?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!v||!m2(t,`.${v}`,y))&&(!g||m2(t,g,y))});f.call(O)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{gp({id:t,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,l,e]),(0,w.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:a})},[n,r,t,i,e,o,a]),s}function gm(){let e=vS();return(0,w.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:i,onError:a,updateNodePositions:l,nodeLookup:s,nodeOrigin:c}=e.getState(),u=new Map,d=e=>e.selected&&(e.draggable||i&&void 0===e.draggable),f=r?o[0]:5,p=r?o[1]:5,h=t.direction.x*f*t.factor,m=t.direction.y*p*t.factor;for(let[,e]of s){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+h,y:e.internals.positionAbsolute.y+m};r&&(t=mu(t,o));let{position:i,positionAbsolute:l}=h2({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=l,u.set(e.id,e)}l(u)},[])}let gv=(0,w.createContext)(null),gg=gv.Provider;gv.Consumer;let gy=()=>(0,w.useContext)(gv),gb=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),gx=(0,w.createContext)(null);function gw({children:e}){let t=vj(gb,vb);return(0,x.jsx)(gx.Provider,{value:t,children:e})}let gk={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},gj=(0,w.memo)(v6(function({type:e="source",position:t=g.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:s,className:c,onMouseDown:u,onTouchStart:d,...p},h){let m=a||null,v="target"===e,y=vS(),b=gy(),{connectOnClick:k,noPanClassName:j,rfId:S}=function(){let e=(0,w.useContext)(gx);if(!e)throw Error("useHandleConfig must be used within a HandleConfigProvider");return e}(),{connectingFrom:O,connectingTo:C,clickConnecting:N,isPossibleEndHandle:P,connectionInProcess:E,clickConnectionInProcess:I,valid:A}=vj(t=>{let{connectionClickStartHandle:n,connectionMode:r,connection:o}=t,{fromHandle:i,toHandle:a,isValid:l}=o;if(!i&&!n)return gk;let s=a?.nodeId===b&&a?.id===m&&a?.type===e;return{connectingFrom:i?.nodeId===b&&i?.id===m&&i?.type===e,connectingTo:s,clickConnecting:n?.nodeId===b&&n?.id===m&&n?.type===e,isPossibleEndHandle:r===f.Strict?i?.type!==e:b!==i?.nodeId||m!==i?.id,connectionInProcess:!!i,clickConnectionInProcess:!!n,valid:s&&l}},vb);b||y.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");let _=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=y.getState(),o={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=y.getState();t(function(e,t,n={}){return((e,t,n={})=>{let r,o;if(!e.source||!e.target)return n.onError?.("006","Can't create edge. An edge needs a source and a target."),t;let i=n.getEdgeId||mT;return(o=r=hY(e)?{...e}:{...e,id:i(e)},t.some(e=>e.source===o.source&&e.target===o.target&&(e.sourceHandle===o.sourceHandle||!e.sourceHandle&&!o.sourceHandle)&&(e.targetHandle===o.targetHandle||!e.targetHandle&&!o.targetHandle)))?t:(null===r.sourceHandle&&delete r.sourceHandle,null===r.targetHandle&&delete r.targetHandle,t.concat(r))})(e,t,{...n,onError:n.onError??v4})}(o,e,{onError:n}))}n?.(o),l?.(o)},M=e=>{if(!b)return;let t="clientX"in e.nativeEvent;if(o&&(t&&0===e.button||!t)){let t=y.getState();m9(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:v,handleId:m,nodeId:b,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>y.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:_,isValidConnection:n||((...e)=>y.getState().isValidConnection?.(...e)??!0),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,x.jsx)("div",{"data-handleid":m,"data-nodeid":b,"data-handlepos":t,"data-id":`${S}-${b}-${m}-${e}`,className:fl(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",j,c,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:O,connectingto:C,valid:A,connectionindicator:r&&(!E||P)&&(E||I?i:o)}]),onMouseDown:M,onTouchStart:M,onClick:k?t=>{let{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s,lib:c,rfId:u,nodeLookup:d,connection:f}=y.getState();if(!b||!a&&!o)return;if(!a){r?.(t.nativeEvent,{nodeId:b,handleId:m,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:b,type:e,id:m}});return}let p=mS(t.target),h=n||s,{connection:v,isValid:g}=m8(t.nativeEvent,{handle:{nodeId:b,id:m,type:e},connectionMode:l,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:h,flowId:u,doc:p,lib:c,nodeLookup:d});g&&v&&_(v);let x=structuredClone(f);delete x.inProgress,x.toPosition=x.toHandle?x.toHandle.position:null,i?.(t,x),y.setState({connectionClickStartHandle:null})}:void 0,ref:h,...p,children:s})})),gS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gO={input:function({data:e,isConnectable:t,sourcePosition:n=g.Bottom}){return(0,x.jsxs)(x.Fragment,{children:[e?.label,(0,x.jsx)(gj,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=g.Top,sourcePosition:r=g.Bottom}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(gj,{type:"target",position:n,isConnectable:t}),e?.label,(0,x.jsx)(gj,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=g.Top}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(gj,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},gC=e=>{let{width:t,height:n,x:r,y:o}=hQ(e.nodeLookup,{filter:e=>!!e.selected});return{width:ms(t)?t:null,height:ms(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function gN({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=vS(),{width:o,height:i,transformString:a,userSelectionActive:l}=vj(gC,vb),s=gm(),c=(0,w.useRef)(null);(0,w.useEffect)(()=>{n||c.current?.focus({preventScroll:!0})},[n]);let u=!l&&null!==o&&null!==i;if(gh({nodeRef:c,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,x.jsx)("div",{className:fl(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,x.jsx)("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(gS,e.key)&&(e.preventDefault(),s({direction:gS[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:i}})})}let gP="u">typeof window?window:void 0,gE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gI({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:k,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:O,panOnDrag:C,autoPanOnSelection:N,defaultViewport:P,translateExtent:E,minZoom:I,maxZoom:A,preventScrolling:_,onSelectionContextMenu:M,noWheelClassName:T,noPanClassName:R,disableKeyboardA11y:z,onViewportChange:D,isControlledViewport:L}){let{nodesSelectionActive:F,userSelectionActive:U}=vj(gE,vb),H=vY(c,{target:gP}),$=vY(m,{target:gP}),B=$||C,K=$||k,q=u&&!0!==B,V=H||U||q;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=vS(),{deleteElements:r}=gn(),o=vY(e,{actInsideInputWithModifier:!1}),i=vY(t,{target:go});(0,w.useEffect)(()=>{if(o){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(gr),edges:e.filter(gr)}),n.setState({nodesSelectionActive:!1})}},[o]),(0,w.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:s,multiSelectionKeyCode:h}),(0,x.jsx)(gl,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:K,panActivationKeyPressed:$,panOnScrollSpeed:j,panOnScrollMode:S,zoomOnDoubleClick:O,panOnDrag:!H&&B,defaultViewport:P,translateExtent:E,minZoom:I,maxZoom:A,zoomActivationKeyCode:v,preventScrolling:_,noWheelClassName:T,noPanClassName:R,onViewportChange:D,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:q,children:(0,x.jsxs)(gf,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:B,autoPanOnSelection:N,isSelecting:!!V,selectionMode:d,selectionKeyPressed:H,paneClickDistance:l,selectionOnDrag:q,children:[e,F&&(0,x.jsx)(gN,{onSelectionContextMenu:M,noPanClassName:R,disableKeyboardA11y:z})]})})}gI.displayName="FlowRenderer";let gA=(0,w.memo)(gI),g_=e=>e.updateNodeInternals;var gM=(0,w.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:s,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:h,rfId:m,nodeTypes:v,nodeClickDistance:g,onError:y}){let b,{node:k,internals:j,isParent:S}=vj(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},vb),O=k.type||"default",C=v?.[O]||gO[O];void 0===C&&(y?.("003",(b=O,`Node type "${b}" not found. Using fallback type "default".`)),O="default",C=v?.default||gO.default);let N=!!(k.draggable||l&&void 0===k.draggable),P=!!(k.selectable||s&&void 0===k.selectable),E=!!(k.connectable||c&&void 0===k.connectable),I=!!(k.focusable||u&&void 0===k.focusable),A=vS(),_=my(k),M=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let o=vS(),i=(0,w.useRef)(null),a=(0,w.useRef)(null),l=(0,w.useRef)(e.sourcePosition),s=(0,w.useRef)(e.targetPosition),c=(0,w.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,w.useEffect)(()=>{!i.current||e.hidden||u&&a.current===i.current||(a.current&&r?.unobserve(a.current),r?.observe(i.current),a.current=i.current)},[u,e.hidden]),(0,w.useEffect)(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),(0,w.useEffect)(()=>{if(i.current){let n=c.current!==t,r=l.current!==e.sourcePosition,a=s.current!==e.targetPosition;(n||r||a)&&(c.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}({node:k,nodeType:O,hasDimensions:_,resizeObserver:d}),T=gh({nodeRef:M,disabled:k.hidden||!N,noDragClassName:f,handleSelector:k.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:g}),R=gm();if(k.hidden)return null;let z=mg(k),D=void 0===k.internals.handleBounds?{width:k.width??k.initialWidth??k.style?.width,height:k.height??k.initialHeight??k.style?.height}:{width:k.width??k.style?.width,height:k.height??k.style?.height},L=P||N||t||n||r||o,F=n?e=>n(e,{...j.userNode}):void 0,U=r?e=>r(e,{...j.userNode}):void 0,H=o?e=>o(e,{...j.userNode}):void 0,$=i?e=>i(e,{...j.userNode}):void 0,B=a?e=>a(e,{...j.userNode}):void 0;return(0,x.jsx)("div",{className:fl(["react-flow__node",`react-flow__node-${O}`,{[p]:N},k.className,{selected:k.selected,selectable:P,parent:S,draggable:N,dragging:T}]),ref:M,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:_?"visible":"hidden",...k.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:F,onMouseMove:U,onMouseLeave:H,onContextMenu:$,onClick:n=>{let{selectNodesOnDrag:r,nodeDragThreshold:o}=A.getState();P&&(!r||!N||o>0)&&gp({id:e,store:A,nodeRef:M}),t&&t(n,{...j.userNode})},onDoubleClick:B,onKeyDown:I?t=>{if(!mC(t.nativeEvent)&&!h){if(hV.includes(t.key)&&P)gp({id:e,store:A,unselect:"Escape"===t.key,nodeRef:M});else if(N&&k.selected&&Object.prototype.hasOwnProperty.call(gS,t.key)){t.preventDefault();let{ariaLabelConfig:e}=A.getState();A.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),R({direction:gS[t.key],factor:t.shiftKey?4:1})}}}:void 0,tabIndex:I?0:void 0,onFocus:I?()=>{if(h||!M.current?.matches(":focus-visible"))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:o,setCenter:i}=A.getState();!o||h0(new Map([[e,k]]),{x:0,y:0,width:n,height:r},t,!0).length>0||i(k.position.x+z.width/2,k.position.y+z.height/2,{zoom:t[2]})}:void 0,role:k.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${vN}-${m}`,"aria-label":k.ariaLabel,...k.domAttributes,children:(0,x.jsx)(gg,{value:e,children:(0,x.jsx)(C,{id:e,data:k.data,type:O,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:k.selected??!1,selectable:P,draggable:N,deletable:k.deletable??!0,isConnectable:E,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:T,dragHandle:k.dragHandle,zIndex:j.z,parentId:k.parentId,...z})})})});let gT=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function gR(e){var t;let{nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=vj(gT,vb),a=(t=e.onlyRenderVisibleElements,vj((0,w.useCallback)(e=>t?h0(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(e=>e.id):Array.from(e.nodeLookup.keys()),[t]),vb)),l=function(){let e=vj(g_),[t]=(0,w.useState)(()=>"u"<typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,w.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,x.jsx)("div",{className:"react-flow__nodes",style:gi,children:a.map(t=>(0,x.jsx)(gM,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},t))})}gR.displayName="NodeRenderer";let gz=(0,w.memo)(gR),gD={[v.Arrow]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,x.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[v.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,x.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},gL=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let s,c=(s=vS(),(0,w.useMemo)(()=>{let e;return Object.prototype.hasOwnProperty.call(gD,t)?gD[t]:(s.getState().onError?.("009",(e=t,`Marker type "${e}" doesn't exist.`)),null)},[t]));return c?(0,x.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:(0,x.jsx)(c,{color:n,strokeWidth:a})}):null},gF=({defaultColor:e,rfId:t})=>{let n=vj(e=>e.edges),r=vj(e=>e.defaultEdgeOptions),o=(0,w.useMemo)(()=>(function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){let i=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){let o=mK(r,t);i.has(o)||(e.push({id:o,color:r.color||n,...r}),i.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))})(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return o.length?(0,x.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,x.jsx)("defs",{children:o.map(e=>(0,x.jsx)(gL,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};gF.displayName="MarkerDefinitions";var gU=(0,w.memo)(gF);function gH({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:s,className:c,...u}){let[d,f]=(0,w.useState)({x:1,y:0,width:0,height:0}),p=fl(["react-flow__edge-textwrapper",c]),h=(0,w.useRef)(null);return((0,w.useEffect)(()=>{if(h.current){let e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,x.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u,children:[o&&(0,x.jsx)("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),(0,x.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:h,style:r,children:n}),s]}):null}gH.displayName="EdgeText";let g$=(0,w.memo)(gH);function gB({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:c=20,...u}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("path",{...u,d:e,fill:"none",className:fl(["react-flow__edge-path",u.className])}),c?(0,x.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&ms(t)&&ms(n)?(0,x.jsx)(g$,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function gK({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===g.Left||e===g.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function gq({sourceX:e,sourceY:t,sourcePosition:n=g.Bottom,targetX:r,targetY:o,targetPosition:i=g.Top}){let[a,l]=gK({pos:n,x1:e,y1:t,x2:r,y2:o}),[s,c]=gK({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=mE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:c});return[`M${e},${t} C${a},${l} ${s},${c} ${r},${o}`,u,d,f,p]}function gV(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a,targetPosition:l,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:g})=>{let[y,b,w]=gq({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:l}),k=e.isInternal?void 0:t;return(0,x.jsx)(gB,{id:k,path:y,labelX:b,labelY:w,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:g})})}let gW=gV({isInternal:!1}),gG=gV({isInternal:!0});function gZ(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=g.Bottom,targetPosition:h=g.Top,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:b})=>{let[w,k,j]=mF({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:h,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),S=e.isInternal?void 0:t;return(0,x.jsx)(gB,{id:S,path:w,labelX:k,labelY:j,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:v,interactionWidth:b})})}gW.displayName="SimpleBezierEdge",gG.displayName="SimpleBezierEdgeInternal";let gY=gZ({isInternal:!1}),gX=gZ({isInternal:!0});function gJ(e){return(0,w.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,x.jsx)(gY,{...n,id:r,pathOptions:(0,w.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}gY.displayName="SmoothStepEdge",gX.displayName="SmoothStepEdgeInternal";let gQ=gJ({isInternal:!1}),g0=gJ({isInternal:!0});function g1(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})=>{let[v,g,y]=mR({sourceX:n,sourceY:r,targetX:o,targetY:i}),b=e.isInternal?void 0:t;return(0,x.jsx)(gB,{id:b,path:v,labelX:g,labelY:y,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:h,interactionWidth:m})})}gQ.displayName="StepEdge",g0.displayName="StepEdgeInternal";let g2=g1({isInternal:!1}),g3=g1({isInternal:!0});function g4(e){return(0,w.memo)(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a=g.Bottom,targetPosition:l=g.Top,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:b})=>{let[w,k,j]=m_({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:l,curvature:y?.curvature}),S=e.isInternal?void 0:t;return(0,x.jsx)(gB,{id:S,path:w,labelX:k,labelY:j,label:s,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:v,interactionWidth:b})})}g2.displayName="StraightEdge",g3.displayName="StraightEdgeInternal";let g5=g4({isInternal:!1}),g6=g4({isInternal:!0});g5.displayName="BezierEdge",g6.displayName="BezierEdgeInternal";let g8={default:g6,straight:g3,step:g0,smoothstep:gX,simplebezier:gG},g9={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},g7="react-flow__edgeupdater";function ye({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:l}){return(0,x.jsx)("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:fl([g7,`${g7}-${l}`]),cx:e===g.Left?t-r:e===g.Right?t+r:t,cy:e===g.Top?n-r:e===g.Bottom?n+r:n,r:r,stroke:"transparent",fill:"transparent"})}function yt({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:a,sourcePosition:l,targetPosition:s,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let h=vS(),m=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:r,domNode:o,connectionMode:i,connectionRadius:a,lib:l,onConnectStart:s,cancelConnection:p,nodeLookup:m,rfId:v,panBy:g,updateConnection:y}=h.getState(),b="target"===t.type;m9(e.nativeEvent,{autoPanOnConnect:r,connectionMode:i,connectionRadius:a,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:b,edgeUpdaterType:t.type,lib:l,flowId:v,cancelConnection:p,panBy:g,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,o)=>{f(!0),u?.(e,n,t.type),s?.(r,o)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:y,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},v=()=>p(!0),g=()=>p(!1);return(0,x.jsxs)(x.Fragment,{children:[(!0===e||"source"===e)&&(0,x.jsx)(ye,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:e=>m(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:v,onMouseOut:g,type:"source"}),(!0===e||"target"===e)&&(0,x.jsx)(ye,{position:s,centerX:i,centerY:a,radius:t,onMouseDown:e=>m(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:v,onMouseOut:g,type:"target"})]})}var yn=(0,w.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,rfId:m,edgeTypes:v,noPanClassName:y,onError:b,disableKeyboardA11y:k}){let j,S=vj(t=>t.edgeLookup.get(e)),O=vj(e=>e.defaultEdgeOptions),C=(S=O?{...O,...S}:S).type||"default",N=v?.[C]||g8[C];void 0===N&&(b?.("011",(j=C,`Edge type "${j}" not found. Using fallback type "default".`)),C="default",N=v?.default||g8.default);let P=!!(S.focusable||t&&void 0===S.focusable),E=void 0!==d&&(S.reconnectable||n&&void 0===S.reconnectable),I=!!(S.selectable||r&&void 0===S.selectable),A=(0,w.useRef)(null),[_,M]=(0,w.useState)(!1),[T,R]=(0,w.useState)(!1),z=vS(),{zIndex:D=S.zIndex,sourceX:L,sourceY:F,targetX:U,targetY:H,sourcePosition:$,targetPosition:B}=vj((0,w.useCallback)(t=>{let n=t.nodeLookup.get(S.source),r=t.nodeLookup.get(S.target);if(!n||!r)return g9;let o=function(e){let{sourceNode:t,targetNode:n}=e;if(!mU(t)||!mU(n))return null;let r=t.internals.handleBounds||mH(t.handles),o=n.internals.handleBounds||mH(n.handles),i=mB(r?.source??[],e.sourceHandle),a=mB(e.connectionMode===f.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!i||!a)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(!i?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=i?.position||g.Bottom,s=a?.position||g.Top,c=m$(t,i,l),u=m$(n,a,s);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:l,targetPosition:s}}({id:e,sourceNode:n,targetNode:r,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:t.connectionMode,onError:b}),i=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if("manual"===i)return r;let a=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return(o&&n?r+1e3:r)+a}({selected:S.selected,zIndex:S.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...o||g9,zIndex:i}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex,b]),vb),K=(0,w.useMemo)(()=>S.markerStart?`url('#${mK(S.markerStart,m)}')`:void 0,[S.markerStart,m]),q=(0,w.useMemo)(()=>S.markerEnd?`url('#${mK(S.markerEnd,m)}')`:void 0,[S.markerEnd,m]);if(S.hidden||null===L||null===F||null===U||null===H)return null;let V=i?e=>{i(e,{...S})}:void 0,W=a?e=>{a(e,{...S})}:void 0,G=l?e=>{l(e,{...S})}:void 0,Z=s?e=>{s(e,{...S})}:void 0,Y=c?e=>{c(e,{...S})}:void 0;return(0,x.jsx)("svg",{style:{zIndex:D},children:(0,x.jsxs)("g",{className:fl(["react-flow__edge",`react-flow__edge-${C}`,S.className,y,{selected:S.selected,animated:S.animated,inactive:!I&&!o,updating:_,selectable:I}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:i}=z.getState();I&&(z.setState({nodesSelectionActive:!1}),S.selected&&i?(r({nodes:[],edges:[S]}),A.current?.blur()):n([e])),o&&o(t,S)},onDoubleClick:V,onContextMenu:W,onMouseEnter:G,onMouseMove:Z,onMouseLeave:Y,onKeyDown:P?t=>{if(!k&&hV.includes(t.key)&&I){let{unselectNodesAndEdges:n,addSelectedEdges:r}=z.getState();"Escape"===t.key?(A.current?.blur(),n({edges:[S]})):r([e])}}:void 0,tabIndex:P?0:void 0,role:S.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===S.ariaLabel?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":P?`${vP}-${m}`:void 0,ref:A,...S.domAttributes,children:[!T&&(0,x.jsx)(N,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:I,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:L,sourceY:F,targetX:U,targetY:H,sourcePosition:$,targetPosition:B,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:K,markerEnd:q,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),E&&(0,x.jsx)(yt,{edge:S,isReconnectable:E,reconnectRadius:u,onReconnect:d,onReconnectStart:p,onReconnectEnd:h,sourceX:L,sourceY:F,targetX:U,targetY:H,sourcePosition:$,targetPosition:B,setUpdateHover:M,setReconnecting:R})]})})});let yr=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function yo({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:m}){let{edgesFocusable:v,edgesReconnectable:g,elementsSelectable:y,onError:b}=vj(yr,vb),k=vj((0,w.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let r=e.nodeLookup.get(t.source),o=e.nodeLookup.get(t.target);r&&o&&function({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){let i=h7(mr(e),mr(t));return i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1),ma({x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]},mt(i))>0}({sourceNode:r,targetNode:o,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),vb);return(0,x.jsxs)("div",{className:"react-flow__edges",children:[(0,x.jsx)(gU,{defaultColor:e,rfId:n}),k.map(e=>(0,x.jsx)(yn,{id:e,edgesFocusable:v,edgesReconnectable:g,elementsSelectable:y,noPanClassName:o,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:m},e))]})}yo.displayName="EdgeRenderer";let yi=(0,w.memo)(yo),ya=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function yl({children:e}){let t=vS(),n=(0,w.useRef)(null),[r]=(0,w.useState)(()=>t.getState().transform);return v8(()=>{let e=null,r=()=>{let r=t.getState().transform;(!e||r[0]!==e[0]||r[1]!==e[1]||r[2]!==e[2])&&(e=r,n.current&&(n.current.style.transform=ya(r)))};return r(),t.subscribe(r)},[t]),(0,x.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:ya(r)},children:e})}let ys=e=>e.panZoom?.syncViewport;function yc(e){return e.connection.inProgress?{...e.connection,to:md(e.connection.to,e.transform)}:{...e.connection}}let yu=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function yd({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:o,width:i,height:a,isValid:l,inProgress:s}=vj(yu,vb);return i&&o&&s?(0,x.jsx)("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:(0,x.jsx)("g",{className:fl(["react-flow__connection",mw(l)]),children:(0,x.jsx)(yf,{style:t,type:n,CustomComponent:r,isValid:l})})}):null}let yf=({style:e,type:t=m.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:o,from:i,fromNode:a,fromHandle:l,fromPosition:s,to:c,toNode:u,toHandle:d,toPosition:f,pointer:p}=vj(yc,vb);if(!o)return;if(n)return(0,x.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:s,toPosition:f,connectionStatus:mw(r),toNode:u,toHandle:d,pointer:p});let h="",v={sourceX:i.x,sourceY:i.y,sourcePosition:s,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case m.Bezier:[h]=m_(v);break;case m.SimpleBezier:[h]=gq(v);break;case m.Step:[h]=mF({...v,borderRadius:0});break;case m.SmoothStep:[h]=mF(v);break;default:[h]=mR(v)}return(0,x.jsx)("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};yf.displayName="ConnectionLine";let yp={};function yh(e=yp){(0,w.useRef)(e),vS(),(0,w.useEffect)(()=>{},[e])}function ym({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:g,selectionKeyCode:y,selectionOnDrag:b,selectionMode:k,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:O,deleteKeyCode:C,onlyRenderVisibleElements:N,elementsSelectable:P,defaultViewport:E,translateExtent:I,minZoom:A,maxZoom:_,preventScrolling:M,defaultMarkerColor:T,zoomOnScroll:R,zoomOnPinch:z,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:F,zoomOnDoubleClick:U,panOnDrag:H,autoPanOnSelection:$,onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:q,onPaneMouseLeave:V,onPaneScroll:W,onPaneContextMenu:G,paneClickDistance:Z,nodeClickDistance:Y,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,onReconnect:en,onReconnectStart:er,onReconnectEnd:eo,noDragClassName:ei,noWheelClassName:ea,noPanClassName:el,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,viewport:ed,onViewportChange:ef,nodesDraggable:ep}){let eh,em,ev,eg;return yh(e),yh(t),vS(),(0,w.useRef)(!1),(0,w.useEffect)(()=>{},[]),eh=gn(),em=(0,w.useRef)(!1),(0,w.useEffect)(()=>{!em.current&&eh.viewportInitialized&&n&&(setTimeout(()=>n(eh),1),em.current=!0)},[n,eh.viewportInitialized]),ev=vj(ys),eg=vS(),(0,w.useEffect)(()=>{ed&&(ev?.(ed),eg.setState({transform:[ed.x,ed.y,ed.zoom]}))},[ed,ev]),(0,x.jsx)(gA,{onPaneClick:B,onPaneMouseEnter:K,onPaneMouseMove:q,onPaneMouseLeave:V,onPaneContextMenu:G,onPaneScroll:W,paneClickDistance:Z,deleteKeyCode:C,selectionKeyCode:y,selectionOnDrag:b,selectionMode:k,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:j,panActivationKeyCode:S,zoomActivationKeyCode:O,elementsSelectable:P,zoomOnScroll:R,zoomOnPinch:z,zoomOnDoubleClick:U,panOnScroll:D,panOnScrollSpeed:L,panOnScrollMode:F,panOnDrag:H,autoPanOnSelection:$,defaultViewport:E,translateExtent:I,minZoom:A,maxZoom:_,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:ei,noWheelClassName:ea,noPanClassName:el,disableKeyboardA11y:es,onViewportChange:ef,isControlledViewport:!!ed,children:(0,x.jsxs)(yl,{children:[(0,x.jsx)(yi,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:a,onReconnect:en,onReconnectStart:er,onReconnectEnd:eo,onlyRenderVisibleElements:N,onEdgeContextMenu:X,onEdgeMouseEnter:J,onEdgeMouseMove:Q,onEdgeMouseLeave:ee,reconnectRadius:et,defaultMarkerColor:T,noPanClassName:el,disableKeyboardA11y:es,rfId:eu}),(0,x.jsx)(yd,{style:m,type:h,component:v,containerStyle:g}),(0,x.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,x.jsx)(gz,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Y,onlyRenderVisibleElements:N,noPanClassName:el,noDragClassName:ei,disableKeyboardA11y:es,nodeExtent:ec,rfId:eu,nodesDraggable:ep}),(0,x.jsx)("div",{className:"react-flow__viewport-portal"})]})})}ym.displayName="GraphView";let yv=(0,w.memo)(ym),yg=mc("React Flow","https://reactflow.dev/"),yy=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:p="basic"}={})=>{let h=new Map,m=new Map,v=new Map,g=new Map,y=r??t??[],b=n??e??[],x=u??[0,0],w=d??hq;m1(v,g,y);let{nodesInitialized:k}=mZ(b,h,m,{nodeOrigin:x,nodeExtent:w,zIndexMode:p}),j=[0,0,1];if(a&&o&&i){let{x:e,y:t,zoom:n}=mh(hQ(h,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),o,i,s,c,l?.padding??.1);j=[e,t,n]}return{rfId:"1",width:o??0,height:i??0,transform:j,nodes:b,nodesInitialized:k,nodeLookup:h,parentLookup:m,edges:y,edgeLookup:g,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:s,maxZoom:c,translateExtent:hq,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...hG},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:yg,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:hW,zIndexMode:p,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}};function yb({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:s,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[h]=(0,w.useState)(()=>(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>{let p,h;return p=(p,h)=>{async function m(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:i,minZoom:a,maxZoom:l}=h();t&&(await h1({nodes:e,width:o,height:i,panZoom:t,minZoom:a,maxZoom:l},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...yy({nodes:e,edges:t,width:o,height:i,fitView:a,fitViewOptions:l,minZoom:s,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:o,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:l,nodesSelectionActive:s}=h(),{nodesInitialized:c,hasSelectedNodes:u}=mZ(e,t,n,{nodeOrigin:r,nodeExtent:o,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:l}),d=s&&u;a&&c?(m(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=h();m1(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=h();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=h();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:i,nodeExtent:a,debug:l,fitViewQueued:s,zIndexMode:c}=h(),{changes:u,updatedInternals:d}=function(e,t,n,r,o,i,a){let l=r?.querySelector(".xyflow__viewport"),s=!1;if(!l)return{changes:[],updatedInternals:s};let c=[],u=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),s=!0;continue}let l=mj(r.nodeElement),u=e.measured.width!==l.width||e.measured.height!==l.height;if(l.width&&l.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),h=mv(e.extent)?e.extent:i,{positionAbsolute:m}=e.internals;if(e.parentId&&"parent"===e.extent){let n=t.get(e.parentId);n&&(m=h6(m,l,n))}else h&&(m=h5(m,h,l));let v={...e,measured:l,internals:{...e.internals,positionAbsolute:m,handleBounds:{source:mP("source",r.nodeElement,p,d,e.id),target:mP("target",r.nodeElement,p,d,e.id)}}};t.set(e.id,v),e.parentId&&mY(v,t,n,{nodeOrigin:o,zIndexMode:a}),s=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:l}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:mn(v,o)}))}}if(f.length>0){let e=mJ(f,t,n,o);c.push(...e)}return{changes:c,updatedInternals:s}}(e,n,r,o,i,a,c);d&&(!function(e,t,n){let r=mW(mq,n);for(let n of e.values())if(n.parentId)mY(n,e,t,r);else{let e=h5(hJ(n,r.nodeOrigin),mv(n.extent)?n.extent:r.nodeExtent,mg(n));n.internals.positionAbsolute=e}}(n,r,{nodeOrigin:i,nodeExtent:a,zIndexMode:c}),s?(m(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(l&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:o,triggerNodeChanges:i,connection:a,updateConnection:l,onNodesChangeMiddlewareMap:s}=h();for(let[i,s]of e){let e=o.get(i),c=!!(e?.expandParent&&e?.parentId&&s?.position),u={id:i,type:"position",position:c?{x:Math.max(0,s.position.x),y:Math.max(0,s.position.y)}:s.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){let t=m$(e,a.fromHandle,g.Left,!0);l({...a,from:t})}c&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...s.internals.positionAbsolute,width:s.measured.width??0,height:s.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=h(),i=mJ(n,o,e,t);r.push(...i)}for(let e of s.values())r=e(r);i(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:i}=h();e?.length&&(o&&n(vQ(e,r)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:i}=h();e?.length&&(o&&n(vQ(e,r)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=h();t?o(e.map(e=>v0(e,!0))):(o(v1(r,new Set([...e]),!0)),i(v1(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=h();t?i(e.map(e=>v0(e,!0))):(i(v1(n,new Set([...e]))),o(v1(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:i,triggerEdgeChanges:a}=h(),l=[];for(let t of e||r){if(!t.selected)continue;let e=o.get(t.id);e&&(e.selected=!1),l.push(v0(t.id,!1))}let s=[];for(let e of t||n)e.selected&&s.push(v0(e.id,!1));i(l),a(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=h();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=h();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{h().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=h();if(!o)return;let i=t.reduce((e,t)=>t.selected?[...e,v0(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,v0(t.id,!1)]:e,[]);n(i),r(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:i,nodeExtent:a,zIndexMode:l}=h();(e[0][0]!==a[0][0]||e[0][1]!==a[0][1]||e[1][0]!==a[1][0]||e[1][1]!==a[1][1])&&(mZ(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1,zIndexMode:l}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:o,translateExtent:i}=h();return mQ({delta:e,panZoom:o,transform:t,translateExtent:i,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:o,maxZoom:i,panZoom:a}=h();if(!a)return!1;let l=void 0!==n?.zoom?n.zoom:i;return await a.setViewport({x:r/2-e*l,y:o/2-t*l,zoom:l},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...hG}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...yy()})}},h=Object.is,p?vy(p,h):vy})({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:c,minZoom:a,maxZoom:l,fitViewOptions:s,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,x.jsx)(vw,{value:h,children:(0,x.jsx)(ge,{children:(0,x.jsx)(gw,{children:p})})})}function yx({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:a,fitView:l,fitViewOptions:s,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,w.useContext)(vx)?(0,x.jsx)(x.Fragment,{children:e}):(0,x.jsx)(yb,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:a,fitView:l,initialFitViewOptions:s,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}let yw={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var yk=v6(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:s,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:v,onConnectStart:g,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:C,onNodeDoubleClick:N,onNodeDragStart:P,onNodeDrag:E,onNodeDragStop:I,onNodesDelete:A,onEdgesDelete:_,onDelete:M,onSelectionChange:T,onSelectionDragStart:R,onSelectionDrag:z,onSelectionDragStop:D,onSelectionContextMenu:L,onSelectionStart:F,onSelectionEnd:U,onBeforeDelete:H,connectionMode:$,connectionLineType:B=m.Bezier,connectionLineStyle:K,connectionLineComponent:q,connectionLineContainerStyle:V,deleteKeyCode:W="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:Z=!1,selectionMode:Y=h.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:J=mm()?"Meta":"Control",zoomActivationKeyCode:Q=mm()?"Meta":"Control",snapToGrid:ee,snapGrid:et,onlyRenderVisibleElements:en=!1,selectNodesOnDrag:er,nodesDraggable:eo,autoPanOnNodeFocus:ei,nodesConnectable:ea,nodesFocusable:el,nodeOrigin:es=v$,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed=!0,defaultViewport:ef=vB,minZoom:ep=.5,maxZoom:eh=2,translateExtent:em=hq,preventScrolling:ev=!0,nodeExtent:eg,defaultMarkerColor:ey="#b1b1b7",zoomOnScroll:eb=!0,zoomOnPinch:ex=!0,panOnScroll:ew=!1,panOnScrollSpeed:ek=.5,panOnScrollMode:ej=p.Free,zoomOnDoubleClick:eS=!0,panOnDrag:eO=!0,onPaneClick:eC,onPaneMouseEnter:eN,onPaneMouseMove:eP,onPaneMouseLeave:eE,onPaneScroll:eI,onPaneContextMenu:eA,paneClickDistance:e_=1,nodeClickDistance:eM=0,children:eT,onReconnect:eR,onReconnectStart:ez,onReconnectEnd:eD,onEdgeContextMenu:eL,onEdgeDoubleClick:eF,onEdgeMouseEnter:eU,onEdgeMouseMove:eH,onEdgeMouseLeave:e$,reconnectRadius:eB=10,onNodesChange:eK,onEdgesChange:eq,noDragClassName:eV="nodrag",noWheelClassName:eW="nowheel",noPanClassName:eG="nopan",fitView:eZ,fitViewOptions:eY,connectOnClick:eX,attributionPosition:eJ,proOptions:eQ,defaultEdgeOptions:e0,elevateNodesOnSelect:e1=!0,elevateEdgesOnSelect:e2=!1,disableKeyboardA11y:e3=!1,autoPanOnConnect:e4,autoPanOnNodeDrag:e5,autoPanOnSelection:e6=!0,autoPanSpeed:e8,connectionRadius:e9,isValidConnection:e7,onError:te,style:tt,id:tn,nodeDragThreshold:tr,connectionDragThreshold:to,viewport:ti,onViewportChange:ta,width:tl,height:ts,colorMode:tc="light",debug:tu,onScroll:td,ariaLabelConfig:tf,zIndexMode:tp="basic",...th},tm){let tv=tn||"1",tg=function(e){let[t,n]=(0,w.useState)("system"===e?null:e);return(0,w.useEffect)(()=>{if("system"!==e)return void n(e);let t=vG(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:vG()?.matches?"dark":"light"}(tc),ty=(0,w.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),td?.(e)},[td]);return(0,x.jsx)("div",{"data-testid":"rf__wrapper",...th,onScroll:ty,style:{...tt,...yw},ref:tm,className:fl(["react-flow",o,tg]),id:tn,role:"application",children:(0,x.jsxs)(yx,{nodes:e,edges:t,width:tl,height:ts,fitView:eZ,fitViewOptions:eY,minZoom:ep,maxZoom:eh,nodeOrigin:es,nodeExtent:eg,zIndexMode:tp,children:[(0,x.jsx)(vW,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:g,onConnectEnd:y,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:eo,autoPanOnNodeFocus:ei,nodesConnectable:ea,nodesFocusable:el,edgesFocusable:ec,edgesReconnectable:eu,elementsSelectable:ed,elevateNodesOnSelect:e1,elevateEdgesOnSelect:e2,minZoom:ep,maxZoom:eh,nodeExtent:eg,onNodesChange:eK,onEdgesChange:eq,snapToGrid:ee,snapGrid:et,connectionMode:$,translateExtent:em,connectOnClick:eX,defaultEdgeOptions:e0,fitView:eZ,fitViewOptions:eY,onNodesDelete:A,onEdgesDelete:_,onDelete:M,onNodeDragStart:P,onNodeDrag:E,onNodeDragStop:I,onSelectionDrag:z,onSelectionDragStart:R,onSelectionDragStop:D,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:eG,nodeOrigin:es,rfId:tv,autoPanOnConnect:e4,autoPanOnNodeDrag:e5,autoPanSpeed:e8,onError:te,connectionRadius:e9,isValidConnection:e7,selectNodesOnDrag:er,nodeDragThreshold:tr,connectionDragThreshold:to,onBeforeDelete:H,debug:tu,ariaLabelConfig:tf,zIndexMode:tp}),(0,x.jsx)(yv,{onInit:c,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:O,onNodeContextMenu:C,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:a,connectionLineType:B,connectionLineStyle:K,connectionLineComponent:q,connectionLineContainerStyle:V,selectionKeyCode:G,selectionOnDrag:Z,selectionMode:Y,deleteKeyCode:W,multiSelectionKeyCode:J,panActivationKeyCode:X,zoomActivationKeyCode:Q,onlyRenderVisibleElements:en,defaultViewport:ef,translateExtent:em,minZoom:ep,maxZoom:eh,preventScrolling:ev,zoomOnScroll:eb,zoomOnPinch:ex,zoomOnDoubleClick:eS,panOnScroll:ew,panOnScrollSpeed:ek,panOnScrollMode:ej,panOnDrag:eO,autoPanOnSelection:e6,onPaneClick:eC,onPaneMouseEnter:eN,onPaneMouseMove:eP,onPaneMouseLeave:eE,onPaneScroll:eI,onPaneContextMenu:eA,paneClickDistance:e_,nodeClickDistance:eM,onSelectionContextMenu:L,onSelectionStart:F,onSelectionEnd:U,onReconnect:eR,onReconnectStart:ez,onReconnectEnd:eD,onEdgeContextMenu:eL,onEdgeDoubleClick:eF,onEdgeMouseEnter:eU,onEdgeMouseMove:eH,onEdgeMouseLeave:e$,reconnectRadius:eB,defaultMarkerColor:ey,noDragClassName:eV,noWheelClassName:eW,noPanClassName:eG,rfId:tv,disableKeyboardA11y:e3,nodeExtent:eg,viewport:ti,onViewportChange:ta,nodesDraggable:eo}),(0,x.jsx)(vH,{onSelectionChange:T}),eT,(0,x.jsx)(vR,{proOptions:eQ,position:eJ}),(0,x.jsx)(v_,{rfId:tv,disableKeyboardA11y:e3})]})})});function yj({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,x.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fl(["react-flow__background-pattern",n,r])})}function yS({radius:e,className:t}){return(0,x.jsx)("circle",{cx:e,cy:e,r:e,className:fl(["react-flow__background-pattern","dots",t])})}(c=b||(b={})).Lines="lines",c.Dots="dots",c.Cross="cross";let yO={[b.Dots]:1,[b.Lines]:1,[b.Cross]:6},yC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function yN({id:e,variant:t=b.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:a,bgColor:l,style:s,className:c,patternClassName:u}){let d=(0,w.useRef)(null),{transform:f,patternId:p}=vj(yC,vb),h=r||yO[t],m=t===b.Dots,v=t===b.Cross,g=Array.isArray(n)?n:[n,n],y=[g[0]*f[2]||1,g[1]*f[2]||1],k=h*f[2],j=Array.isArray(i)?i:[i,i],S=v?[k,k]:y,O=[j[0]*f[2]+S[0]/2,j[1]*f[2]+S[1]/2],C=`${p}${e||""}`;return(0,x.jsxs)("svg",{className:fl(["react-flow__background",c]),style:{...s,...gi,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[(0,x.jsx)("pattern",{id:C,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:m?(0,x.jsx)(yS,{radius:k/2,className:u}):(0,x.jsx)(yj,{dimensions:S,lineWidth:o,variant:t,className:u})}),(0,x.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}function yP(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,x.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function yE(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,x.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function yI(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,x.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function yA(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,x.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function y_(){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,x.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function yM({children:e,className:t,...n}){return(0,x.jsx)("button",{type:"button",className:fl(["react-flow__controls-button",t]),...n,children:e})}yN.displayName="Background",(0,w.memo)(yN);let yT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function yR({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:s,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":p}){let h=vS(),{isInteractive:m,minZoomReached:v,maxZoomReached:g,ariaLabelConfig:y}=vj(yT,vb),{zoomIn:b,zoomOut:w,fitView:k}=gn();return(0,x.jsxs)(vM,{className:fl(["react-flow__controls","horizontal"===f?"horizontal":"vertical",c]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??y["controls.ariaLabel"],children:[t&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(yM,{onClick:()=>{b(),i?.()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:g,children:(0,x.jsx)(yP,{})}),(0,x.jsx)(yM,{onClick:()=>{w(),a?.()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:v,children:(0,x.jsx)(yE,{})})]}),n&&(0,x.jsx)(yM,{className:"react-flow__controls-fitview",onClick:()=>{k(o),l?.()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:(0,x.jsx)(yI,{})}),r&&(0,x.jsx)(yM,{className:"react-flow__controls-interactive",onClick:()=>{h.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),s?.(!m)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:m?(0,x.jsx)(y_,{}):(0,x.jsx)(yA,{})}),u]})}yR.displayName="Controls",(0,w.memo)(yR);let yz=(0,w.memo)(function({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:l,strokeWidth:s,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:h,backgroundColor:m}=i||{};return(0,x.jsx)("rect",{className:fl(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:a||h||m,stroke:l,strokeWidth:s},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}),yD=e=>e.nodes.map(e=>e.id),yL=e=>e instanceof Function?e:()=>e,yF=(0,w.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:s}){let{node:c,x:u,y:d,width:f,height:p}=vj(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:o,y:i}=n.internals.positionAbsolute,{width:a,height:l}=mg(r);return{node:r,x:o,y:i,width:a,height:l}},vb);return c&&!c.hidden&&my(c)?(0,x.jsx)(l,{x:u,y:d,width:f,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:i,shapeRendering:a,onClick:s,id:c.id}):null});var yU=(0,w.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=yz,onClick:a}){let l=vj(yD,vb),s=yL(t),c=yL(e),u=yL(n),d="u"<typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,x.jsx)(x.Fragment,{children:l.map(e=>(0,x.jsx)(yF,{id:e,nodeColorFunc:s,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:a,shapeRendering:d},e))})});let yH=e=>!e.hidden,y$=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?mo(hQ(e.nodeLookup,{filter:yH}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},yB=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,yK=(e,t)=>yB(e.viewBB,t.viewBB)&&yB(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig;function yq({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:s,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:h,pannable:m=!1,zoomable:v=!1,ariaLabel:g,inversePan:y,zoomStep:b=1,offsetScale:k=5}){let j=vS(),S=(0,w.useRef)(null),{boundingRect:O,panZoom:C,viewBB:N,rfId:P,translateExtent:E,flowWidth:I,flowHeight:A,ariaLabelConfig:_}=vj(y$,yK),M=e?.width??200,T=e?.height??150,R=Math.max(O.width/M,O.height/T),z=R*M,D=R*T,L=k*R,F=O.x-(z-O.width)/2-L,U=O.y-(D-O.height)/2-L,H=z+2*L,$=D+2*L,B=`react-flow__minimap-desc-${P}`,K=(0,w.useRef)(0),q=(0,w.useRef)();K.current=R,(0,w.useEffect)(()=>{let e=j.getState().panZoom;if(S.current&&e)return q.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let o=fQ(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:l=1,pannable:s=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0],f=hB().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",s?o=>{let l=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;let s=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],c=[s[0]-d[0],s[1]-d[1]];d=s;let f=r()*Math.max(l[2],Math.log(l[2]))*(u?-1:1),p={x:l[0]-c[0]*f,y:l[1]-c[1]*f};t.setViewportConstrained({x:p.x,y:p.y,zoom:l[2]},[[0,0],[i,a]],e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;let r=n(),o=e.sourceEvent.ctrlKey&&mm()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*l,a=r[2]*Math.pow(2,i*o);t.scaleTo(a)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:f0}}({domNode:S.current,panZoom:e,getTransform:()=>j.getState().transform,getViewScale:()=>K.current}),()=>{q.current?.destroy()}},[C]),(0,w.useEffect)(()=>{q.current?.update({translateExtent:E,width:I,height:A,inversePan:y,pannable:m,zoomStep:b,zoomable:v})},[m,v,y,b,E,I,A]);let V=p?e=>{let[t,n]=q.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,W=(0,w.useCallback)((e,t)=>{let n=j.getState().nodeLookup.get(t).internals.userNode;h?.(e,n)},[h]),G=g??_["minimap.ariaLabel"];return(0,x.jsx)(vM,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof s?s:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*R:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof a?a:void 0},className:fl(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,x.jsxs)("svg",{width:M,height:T,viewBox:`${F} ${U} ${H} ${$}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:S,onClick:V,children:[G&&(0,x.jsx)("title",{id:B,children:G}),(0,x.jsx)(yU,{onClick:h?W:void 0,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),(0,x.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-L},${U-L}h${H+2*L}v${$+2*L}h${-H-2*L}z
63
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}yq.displayName="MiniMap",(0,w.memo)(yq);let yV={[y.Line]:"right",[y.Handle]:"bottom-right"};(0,w.memo)(function({nodeId:e,position:t,variant:n=y.Handle,className:r,style:o,children:i,color:a,minWidth:l=10,minHeight:s=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:h,onResizeStart:m,onResize:v,onResizeEnd:g}){let b,k=gy(),j="string"==typeof e?e:k,S=vS(),O=(0,w.useRef)(null),C=n===y.Handle,N=vj((0,w.useCallback)((b=C&&p,e=>b?`${Math.max(1/e.transform[2],1)}`:void 0),[C,p]),vb),P=(0,w.useRef)(null),E=t??yV[n];(0,w.useEffect)(()=>{if(O.current&&j)return P.current||(P.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){let i=fQ(e),a={controlDirection:va("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:l,keepAspectRatio:s,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let h,m,v,g,y={...vu},b={...vd};a={boundaries:l,resizeDirection:c,keepAspectRatio:s,controlDirection:va(e)};let x=null,w=[],k=!1,j=pr().on("start",e=>{let{nodeLookup:r,transform:o,snapGrid:i,snapToGrid:a,nodeOrigin:l,paneDomNode:s}=n();if(!(h=r.get(t)))return;x=s?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:d}=mk(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:a,containerBounds:x});for(let[e,n]of(b={...y={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},pointerX:c,pointerY:d,aspectRatio:y.width/y.height},m=void 0,v=mv(h.extent)?h.extent:void 0,h.parentId&&("parent"===h.extent||h.expandParent)&&(m=r.get(h.parentId)),m&&"parent"===h.extent&&(v=[[0,0],[m.measured.width,m.measured.height]]),w=[],g=void 0,r))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,l=n[0]*i,s=n[1]*a;return[[r-l,o-s],[r+i-l,o+a-s]]}(n,h,n.origin??l);g=g?[[Math.min(e[0][0],g[0][0]),Math.min(e[0][1],g[0][1])],[Math.max(e[1][0],g[1][0]),Math.max(e[1][1],g[1][1])]]:e}u?.(e,{...y})}).on("drag",e=>{let{transform:t,snapGrid:o,snapToGrid:i,nodeOrigin:l}=n(),s=mk(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:i,containerBounds:x}),c=[];if(!h)return;let{x:u,y:f,width:j,height:S}=y,O={},C=h.origin??l,{width:N,height:P,x:E,y:I}=function(e,t,n,r,o,i,a,l){var s,c,u,d;let{affectsX:f,affectsY:p}=t,{isHorizontal:h,isVertical:m}=t,v=h&&m,{xSnapped:g,ySnapped:y}=n,{minWidth:b,maxWidth:x,minHeight:w,maxHeight:k}=r,{x:j,y:S,width:O,height:C,aspectRatio:N}=e,P=Math.floor(h?g-e.pointerX:0),E=Math.floor(m?y-e.pointerY:0),I=O+(f?-P:P),A=C+(p?-E:E),_=-i[0]*O,M=-i[1]*C,T=vc(I,b,x),R=vc(A,w,k);if(a){let e=0,t=0;f&&P<0?e=vl(j+P+_,a[0][0]):!f&&P>0&&(e=vs(j+I+_,a[1][0])),p&&E<0?t=vl(S+E+M,a[0][1]):!p&&E>0&&(t=vs(S+A+M,a[1][1])),T=Math.max(T,e),R=Math.max(R,t)}if(l){let e=0,t=0;f&&P>0?e=vs(j+P,l[0][0]):!f&&P<0&&(e=vl(j+I,l[1][0])),p&&E>0?t=vs(S+E,l[0][1]):!p&&E<0&&(t=vl(S+A,l[1][1])),T=Math.max(T,e),R=Math.max(R,t)}if(o){if(h){(T=Math.max(T,vc(I/N,w,k)*N),a)&&(T=Math.max(T,(f||p)&&(!f||p||!v)?vl(S+M+(f?P:-P)/N,a[0][1])*N:vs(S+M+I/N,a[1][1])*N));l&&(T=Math.max(T,(f||p)&&(!f||p||!v)?vs(S+(f?P:-P)/N,l[0][1])*N:vl(S+I/N,l[1][1])*N))}if(m){(R=Math.max(R,vc(A*N,b,x)/N),a)&&(R=Math.max(R,(f||p)&&(!p||f||!v)?vl(j+(p?E:-E)*N+_,a[0][0])/N:vs(j+A*N+_,a[1][0])/N));l&&(R=Math.max(R,(f||p)&&(!p||f||!v)?vs(j+(p?E:-E)*N,l[0][0])/N:vl(j+A*N,l[1][0])/N))}}E+=E<0?R:-R,P+=P<0?T:-T,o&&(v?I>A*N?E=((s=f,c=p,s?!c:c)?-P:P)/N:P=((u=f,d=p,u?!d:d)?-E:E)*N:h?(E=P/N,p=f):(P=E*N,f=p));let z=f?j+P:j,D=p?S+E:S;return{width:O+(f?-P:P),height:C+(p?-E:E),x:i[0]*P*(f?-1:1)+z,y:i[1]*E*(p?-1:1)+D}}(b,a.controlDirection,s,a.boundaries,a.keepAspectRatio,C,v,g),A=N!==j,_=P!==S,M=E!==u&&A,T=I!==f&&_;if(!M&&!T&&!A&&!_)return;if((M||T||1===C[0]||1===C[1])&&(O.x=M?E:y.x,O.y=T?I:y.y,y.x=O.x,y.y=O.y,w.length>0)){let e=E-u,t=I-f;for(let n of w)n.position={x:n.position.x-e+C[0]*(N-j),y:n.position.y-t+C[1]*(P-S)},c.push(n)}if((A||_)&&(O.width=A&&(!a.resizeDirection||"horizontal"===a.resizeDirection)?N:y.width,O.height=_&&(!a.resizeDirection||"vertical"===a.resizeDirection)?P:y.height,y.width=O.width,y.height=O.height),m&&h.expandParent){let e=C[0]*(O.width??0);O.x&&O.x<e&&(y.x=e,b.x=b.x-(O.x-e));let t=C[1]*(O.height??0);O.y&&O.y<t&&(y.y=t,b.y=b.y-(O.y-t))}let R=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){let a=e-t,l=n-r,s=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&o&&(s[0]=-1*s[0]),l&&i&&(s[1]=-1*s[1]),s}({width:y.width,prevWidth:j,height:y.height,prevHeight:S,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),z={...y,direction:R};!1!==p?.(e,z)&&(k=!0,d?.(e,z),r(O,c))}).on("end",e=>{k&&(f?.(e,{...y}),o?.({...y}),k=!1)});i.call(j)},destroy:function(){i.on(".drag",null)}}}({domNode:O.current,nodeId:j,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:i}=S.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:i}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:i}=S.getState(),a=[],l={x:e.x,y:e.y},s=r.get(j);if(s&&s.expandParent&&s.parentId){let t=s.origin??i,n=e.width??s.measured.width??0,c=e.height??s.measured.height??0,u=mJ([{id:s.id,parentId:s.parentId,rect:{width:n,height:c,...mb({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:c},s.parentId,r,t)}}],r,o,i);a.push(...u),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:j,type:"position",position:{...l}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:j,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(let e of t){let t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{S.getState().triggerNodeChanges([{id:j,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),P.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:s,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:v,onResizeEnd:g,shouldResize:h}),()=>{P.current?.destroy()}},[E,l,s,c,u,d,m,v,g,h]);let I=E.split("-");return(0,x.jsx)("div",{className:fl(["react-flow__resize-control","nodrag",...I,n,r]),ref:O,style:{...o,scale:N,...a&&{[C?"backgroundColor":"borderColor"]:a}},children:i})});var yW=Object.defineProperty,yG=(e,t)=>yW(e,"name",{value:t,configurable:!0}),[yZ,yY]=tF("Tooltip",[sh]),yX=sh(),yJ="tooltip.open",[yQ,y0]=yZ("TooltipProvider"),y1=yG(e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=w.useRef(!0),l=w.useRef(!1),s=w.useRef(0);return w.useEffect(()=>{let e=s.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(yQ,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:w.useCallback(()=>{r<=0||(window.clearTimeout(s.current),a.current=!1)},[r]),onClose:w.useCallback(()=>{r<=0||(window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(e=>{l.current=e},[]),disableHoverableContent:o,children:i})},"TooltipProvider"),y2="Tooltip",[y3,y4]=yZ(y2),y5=yG(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,s=y0(y2,e.__scopeTooltip),c=yX(t),[u,d]=w.useState(null),[f,p]=w.useState(void 0),h=tq(),m=w.useRef(0),v=a??s.disableHoverableContent,g=l??s.delayDuration,y=w.useRef(!1),[b,k]=tQ({prop:r,defaultProp:o??!1,onChange:yG(e=>{e?(s.onOpen(),document.dispatchEvent(new CustomEvent(yJ))):s.onClose(),i?.(e)},"onChange"),caller:y2}),j=w.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),S=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,k(!0)},[k]),O=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),C=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,k(!0),m.current=0},g)},[g,k]);return w.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,x.jsx)(sg,{...c,children:(0,x.jsx)(y3,{scope:t,contentId:f??h,setContentId:p,open:b,stateAttribute:j,trigger:u,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{s.isOpenDelayedRef.current?C():S()},[s.isOpenDelayedRef,C,S]),onTriggerLeave:w.useCallback(()=>{v?O():(window.clearTimeout(m.current),m.current=0)},[O,v]),onOpen:S,onClose:O,disableHoverableContent:v,children:n})})},"Tooltip"),y6="TooltipTrigger",y8=w.forwardRef(yG(function(e,t){let{__scopeTooltip:n,...r}=e,o=y4(y6,n),i=y0(y6,n),a=yX(n),l=T(t,w.useRef(null),o.onTriggerChange),s=w.useRef(!1),c=w.useRef(!1),u=w.useCallback(()=>s.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),(0,x.jsx)(sy,{asChild:!0,...a,children:(0,x.jsx)(t5.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:tT(e.onPointerMove,e=>{"touch"!==e.pointerType&&(c.current||i.isPointerInTransitRef.current||(o.onTriggerEnter(),c.current=!0))}),onPointerLeave:tT(e.onPointerLeave,()=>{o.onTriggerLeave(),c.current=!1}),onPointerDown:tT(e.onPointerDown,()=>{o.open&&o.onClose(),s.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:tT(e.onFocus,()=>{s.current||o.onOpen()}),onBlur:tT(e.onBlur,o.onClose),onClick:tT(e.onClick,o.onClose)})})},"TooltipTrigger")),y9="TooltipPortal",[y7,be]=yZ(y9,{forceMount:void 0}),bt=yG(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=y4(y9,t);return(0,x.jsx)(y7,{scope:t,forceMount:n,children:(0,x.jsx)(nA,{present:n||i.open,children:(0,x.jsx)(nN,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),bn="TooltipContent",br=w.forwardRef(yG(function(e,t){let n=be(bn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=y4(bn,e.__scopeTooltip);return(0,x.jsx)(nA,{present:r||a.open,children:a.disableHoverableContent?(0,x.jsx)(ba,{side:o,...i,ref:t}):(0,x.jsx)(bo,{side:o,...i,ref:t})})},"TooltipContent")),bo=w.forwardRef(yG(function(e,t){let n=y4(bn,e.__scopeTooltip),r=y0(bn,e.__scopeTooltip),o=w.useRef(null),i=T(t,o),[a,l]=w.useState(null),{trigger:s,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{l(null),d(!1)},[d]),p=w.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=bl(r,n.getBoundingClientRect());l(bd([...bs(r,o),...bc(t.getBoundingClientRect())])),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(s&&u){let e=yG(e=>p(e,u),"handleTriggerLeave"),t=yG(e=>p(e,s),"handleContentLeave");return s.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{s.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}},[s,u,p,f]),w.useEffect(()=>{if(a){let e=yG(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=s?.contains(t)||u?.contains(t),o=!bu(n,a);r?f():o&&(f(),c())},"handleTrackPointerGrace");return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[s,u,a,c,f]),(0,x.jsx)(ba,{...e,ref:i})},"TooltipContentHoverable")),bi=U("TooltipContent"),ba=w.forwardRef(yG(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":o,id:i,onEscapeKeyDown:a,onPointerDownOutside:l,...s}=e,c=y4(bn,n),u=yX(n),{onClose:d}=c;w.useEffect(()=>(document.addEventListener(yJ,d),()=>document.removeEventListener(yJ,d)),[d]),w.useEffect(()=>{if(c.trigger){let e=yG(e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()},"handleScroll");return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]);let{setContentId:f}=c;return tH(()=>(f(i),()=>{f(void 0)}),[i,f]),(0,x.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,x.jsxs)(sk,{"data-state":c.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:c.contentId,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,x.jsx)(bi,{children:r}),o?(0,x.jsx)(sE,{id:c.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl"));function bl(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}function bs(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function bc(e){let{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function bu(e,t){let{x:n,y:r}=e,o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let a=t[e],l=t[i],s=a.x,c=a.y,u=l.x,d=l.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(o=!o)}return o}function bd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),bf(t)}function bf(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}function bp(e){var t=e.className,n=e.sideOffset,r=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className","sideOffset"]);return(0,x.jsx)(bt,{children:(0,x.jsx)(br,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({sideOffset:void 0===n?6:n,className:tt("z-50 max-w-sm rounded-md bg-popover px-2 py-1 text-xs text-popover-foreground shadow-md",t)},r))})}yG(bl,"getExitSideFromRect"),yG(bs,"getPaddedExitPoints"),yG(bc,"getPointsFromRect"),yG(bu,"isPointInPolygon"),yG(bd,"getHull"),yG(bf,"getHullPresorted");let bh=P("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);function bm(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("tool"===e)return t?[{id:"current",type:"target",position:g.Left,x:-4,y:17.12,width:8,height:8},{id:"new",type:"target",position:g.Left,x:-4,y:40.88,width:8,height:8}]:[{type:"target",position:g.Left,x:-4,y:29,width:8,height:8}];var n={type:"source",position:g.Right,x:186,y:29,width:8,height:8};return"model"===e?[n,{type:"target",position:g.Left,x:-4,y:29,width:8,height:8}]:[n]}function bv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default";return{id:"".concat(e,"-").concat(t),source:e,target:t,targetHandle:n,type:o,animated:!0,style:{stroke:r?"var(--primary)":"color-mix(in srgb, var(--primary) 58%, var(--border))",strokeWidth:2}}}function bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function by(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bg(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var bb={route:function(e){var t,n=e.data,r="model"===n.kind;return(0,x.jsxs)("div",{className:"next"===n.lane||n.selected?"switch-flow-node switch-flow-node-next":"switch-flow-node","data-disabled":n.disabled?"true":void 0,children:["model"===n.kind?(0,x.jsx)(gj,{type:"target",position:g.Left,className:"switch-flow-handle"}):null,"tool"===n.kind&&n.dual?(0,x.jsx)(gj,{type:"target",id:"current",position:g.Left,className:"switch-flow-handle",style:{top:"32%"}}):null,"tool"===n.kind&&n.dual?(0,x.jsx)(gj,{type:"target",id:"new",position:g.Left,className:"switch-flow-handle",style:{top:"68%"}}):null,"tool"!==n.kind||n.dual?null:(0,x.jsx)(gj,{type:"target",position:g.Left,className:"switch-flow-handle"}),n.action?(0,x.jsx)("button",{type:"button",className:"switch-flow-hit","aria-label":null!=(t=n.actionLabel)?t:n.value,disabled:n.disabled,onClick:function(e){var t;e.stopPropagation(),null==(t=n.action)||t.call(n)}}):null,"source"===n.kind||"model"===n.kind?(0,x.jsx)(gj,{type:"source",position:g.Right,className:"switch-flow-handle"}):null,"tool"===n.kind&&n.harnessId?(0,x.jsx)(dz,{id:n.harnessId}):r?(0,x.jsx)(dV,{className:"text-primary"}):(0,x.jsx)(bh,{className:"text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:n.label}),r?(0,x.jsxs)(y5,{children:[(0,x.jsx)(y8,{asChild:!0,children:(0,x.jsx)("strong",{className:"block truncate font-mono text-xs",children:n.value})}),(0,x.jsx)(bp,{className:"font-mono",children:n.value})]}):(0,x.jsx)("strong",{className:"block truncate text-sm",children:n.value})]})]})}};function bx(e,t,n,r){return{id:e,type:"route",position:{x:t,y:n},data:r,style:{pointerEvents:r.action?"all":void 0},width:190,height:66,handles:bm(r.kind,r.dual)}}function bw(e){var t=e.nodes,n=e.edges,r=e.height,o=void 0===r?160:r,i=e.children,a=(0,w.useRef)(null),l=by((0,w.useState)(820),2),s=l[0],c=l[1];(0,w.useEffect)(function(){var e=a.current;if(e){var t=0,n=new ResizeObserver(function(e){var n=by(e,1)[0];cancelAnimationFrame(t);var r=Math.floor(n.contentRect.width);t=requestAnimationFrame(function(){r>0&&c(function(e){return e===r?e:r})})});return n.observe(e),function(){cancelAnimationFrame(t),n.disconnect()}}},[]);var u=Math.min(1,s/820),d=(s-820*u)/2;return(0,x.jsx)(y1,{delayDuration:250,children:(0,x.jsxs)("div",{ref:a,className:"switch-flow-canvas",style:{height:o*u},children:[i?(0,x.jsx)("div",{style:{position:"absolute",inset:0,transformOrigin:"top left",transform:"translateX(".concat(d,"px) scale(").concat(u,")"),pointerEvents:"none",zIndex:2},children:i}):null,(0,x.jsx)(yk,{width:s,height:o*u,viewport:{x:d,y:0,zoom:u},minZoom:.1,nodes:t,edges:n,nodeTypes:bb,onNodeClick:function(e,t){if(!t.data.disabled){var n,r;null==(n=(r=t.data).action)||n.call(r)}},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1})]})})}function bk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bj(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null==e?void 0:e.model;return(null==r?void 0:r.trim())?r:t(((null==e?void 0:e.harness)==="claude"?function(e){if(Array.isArray(e))return bk(e)}(n=new Set(["sonnetModel","opusModel","fableModel","haikuModel","subagentModel"].map(function(t){var n;return null==(n=e.extras[t])?void 0:n.trim()}).filter(Boolean)))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return bk(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bk(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}():[]).length?"workspace.mappedModels":"workspace.toolDefaultModel")}function bS(e){var t=e.current,n=e.candidate,r=e.harness,o=(0,to.Bd)().t,i=(0,w.useMemo)(function(){var e,i;return[{id:"current-source",type:"route",position:{x:24,y:38},data:{label:null!=(e=t.sourceLabel)?e:o("workspace.configuration"),value:t.provider,kind:"source",lane:"current"}},{id:"current-model",type:"route",position:{x:260,y:38},data:{label:o("favorites.modelPicker"),value:t.model,kind:"model",lane:"current"}},{id:"new-source",type:"route",position:{x:24,y:154},data:{label:null!=(i=n.sourceLabel)?i:o("templates.tag"),value:n.provider,kind:"source",lane:"next"}},{id:"new-model",type:"route",position:{x:260,y:154},data:{label:o("favorites.modelPicker"),value:n.model,kind:"model",lane:"next"}},{id:"tool",type:"route",position:{x:606,y:96},data:{dual:!0,label:o("workspace.tool"),value:r.label,kind:"tool",harnessId:r.id}}].map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={data:e.data,width:190,height:66,handles:bm(e.data.kind,"tool"===e.data.kind)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})},[t.provider,t.model,t.sourceLabel,n.provider,n.model,n.sourceLabel,r.id,r.label,o]),a=[bv("current-source","current-model",void 0,!1,"straight"),bv("current-model","tool","current"),bv("new-source","new-model",void 0,!0,"straight"),bv("new-model","tool","new",!0)];return(0,x.jsxs)(bw,{nodes:i,edges:a,height:250,children:[(0,x.jsx)("span",{className:"switch-flow-label switch-flow-label-current",children:o("workspace.currentChain")}),(0,x.jsxs)("span",{className:"switch-flow-label switch-flow-label-new",children:[o("workspace.candidateChain"),(0,x.jsx)("span",{children:o("workspace.appliesAfterConfirm")})]})]})}function bO(e){var t=e.harness,n=(0,to.Bd)().t,r=bN(t,n);return(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("section",{"aria-label":n("workspace.currentChain"),className:"space-y-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("p",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:n("workspace.currentChain")}),(0,x.jsx)("span",{className:"rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-300",children:n("workspace.activeNow")})]}),(0,x.jsx)(bw,{nodes:[bx("source",24,40,{kind:"source",label:r.sourceLabel,value:r.provider}),bx("model",315,40,{kind:"model",label:n("favorites.modelPicker"),value:r.model}),bx("tool",606,40,{kind:"tool",label:n("workspace.tool"),value:t.label,harnessId:t.id})],edges:[bv("source","model"),bv("model","tool")]}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:n("workspace.currentChainHint")})]})})}function bC(e){var t=e.connection,n=e.harness,r=e.templateName,o=(0,to.Bd)().t,i={provider:r,model:t.requestModelId};return(0,x.jsxs)("section",{"aria-label":o("workspace.candidateChain",{name:n.label}),className:"space-y-4",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsx)("p",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:o("workspace.switchMap")}),(0,x.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2 py-0.5 text-xs font-medium text-primary",children:o("workspace.notWritten")})]}),(0,x.jsx)(bS,{current:bN(n,o),candidate:i,harness:n}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:o("workspace.switchTargetHint",{name:n.label})})]})}function bN(e,t){var n,r,o,i=e.profiles.find(function(t){var n,r;return!(null==(n=e.active)?void 0:n.official)&&t.name===(null==(r=e.active)?void 0:r.name)});return{sourceLabel:t((null==i||null==(r=i.modelFavorite)?void 0:r.favoriteId)?"templates.tag":"workspace.configuration"),provider:null!=(n=null==i?void 0:i.name)?n:t((null==(o=e.active)?void 0:o.official)?"harness.official":"harness.currentInactive"),model:e.active?bj(i,t,e.active.model):t("harness.currentInactive")}}function bP(e){var t=e.connections,n=e.connection,r=e.selectedChannel,o=e.setChannel,i=e.targetsLoaded,a=e.reviewTab,l=e.setReviewTab,s=e.quickHarness,c=e.templateName,u=e.quickReady,d=e.plan,f=(0,to.Bd)().t;return(0,x.jsxs)(x.Fragment,{children:[t.length>1?(0,x.jsx)(fi,{id:"quick-channel",label:f("favorites.connection"),placeholder:f("workspace.chooseChannel"),value:r,options:t.map(function(e){return{value:e.id,label:e.label+" \xb7 "+e.requestModelId}}),onChange:o}):null,n?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(un,{idPrefix:"quick-preview",label:f("favorites.reviewChanges"),items:[{id:"route",label:f("workspace.switchMap")},{id:"diff",label:f("workspace.fileDiffTab")}],value:a,onChange:l,className:"flex gap-2",tabClassName:"px-4 py-2 text-sm",children:function(e){return e.label}}),(0,x.jsx)(uo,{idPrefix:"quick-preview",value:a,className:"min-h-80 shrink-0",children:"route"===a?(0,x.jsx)(bC,{connection:n,harness:s,templateName:c}):u&&d?(0,x.jsx)("div",{className:"space-y-4",children:d.items.map(function(e){return(0,x.jsx)(d8,{item:e},e.harness)})}):(0,x.jsx)("p",{role:"status",children:f("activate.loading")})})]}):(0,x.jsx)("p",{role:"status",children:f(t.length?"workspace.chooseChannel":i?"favorites.noCompatibleChannel":"workspace.checking")})]})}function bE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function bA(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function b_(e){return function(e){if(Array.isArray(e))return bE(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||bM(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bM(e,t){if(e){if("string"==typeof e)return bE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bE(e,t)}}function bT(e){var t=new Map,n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l,s,c=i.value,u=null!=(l=c.groupId)?l:c.id,d=null!=(s=t.get(u))?s:[];d.push(c),t.set(u,d)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return b_(t.values())}var bR=/\s·\s(?:claude|codex|kimi|dsh|pi)$/i;function bz(e){return b_(new Set(e.map(function(e){return e.id}))).sort().join(":")}function bD(e){var t,n=new Set(e.connections.map(function(e){return e.id})),r=new Set(e.connections.map(function(e){var t;return null!=(t=e.groupId)?t:e.id})),o=void 0===e.defaultConnectionId?null==(t=e.connections.find(function(e){return e.requestModelId}))?void 0:t.id:e.defaultConnectionId;if(!e.toolBindings)return bA(bI({},e),{defaultConnectionId:o});var i=Object.fromEntries(Object.entries(e.toolBindings).flatMap(function(t){var o=function(e){if(Array.isArray(e))return e}(t)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||bM(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o[1],l=a.connectionId&&r.has(a.connectionId)?a.connectionId:void 0,s=l?e.connections.filter(function(e){var t;return(null!=(t=e.groupId)?t:e.id)===l}):void 0,c=function(e){return!!e&&!!n.has(e)&&(!s||s.some(function(t){return t.id===e}))},u=void 0===a.modelIds?void 0:a.modelIds.filter(c),d=a.tiers?{opus:c(a.tiers.opus)?a.tiers.opus:void 0,sonnet:c(a.tiers.sonnet)?a.tiers.sonnet:void 0,haiku:c(a.tiers.haiku)?a.tiers.haiku:void 0}:void 0,f=bA(bI({},a),{connectionId:l,defaultModelId:c(a.defaultModelId)?a.defaultModelId:void 0,modelIds:u,mode:a.mode,tiers:"tiers"===a.mode?d:void 0});return f.connectionId||f.defaultModelId||void 0!==f.modelIds||f.tiers||"tiers"===f.mode||f.reasoningEffort?[[i,f]]:[]}));return bA(bI({},e),{defaultConnectionId:o,toolBindings:Object.keys(i).length?i:void 0})}function bL(e){var t=e.preview,n=e.onApply,r=(0,to.Bd)().t,o=t.items.filter(function(e){return e.warnings.some(function(e){return e.code===ta.OQ.favoriteReasoningLevelsMissing})}),i=t.items.find(function(e){return e.id===t.defaultItemId});return(0,x.jsxs)("div",{className:"space-y-4 rounded-xl border border-primary/30 bg-primary/5 p-4",children:[(0,x.jsx)("h4",{className:"font-semibold",children:r("toolModels.previewTitle")}),(0,x.jsx)("p",{className:"text-sm",children:r("toolModels.previewCount",{count:t.items.length,removed:t.removed.length})}),(0,x.jsx)("p",{className:"text-sm",children:i?r("toolModels.defaultChanged",{name:i.name,model:i.model}):r("toolModels.keepDefault")}),o.length?(0,x.jsxs)(dZ,{variant:"muted",children:[(0,x.jsx)("p",{children:r("favorites.scheme.missingReasoningCount",{count:o.length})}),(0,x.jsx)("p",{children:r((0,ta.Vz)(ta.OQ.favoriteReasoningLevelsMissing))})]}):null,t.items.map(function(e){return(0,x.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,x.jsxs)("p",{children:[e.name," \xb7 ",(0,x.jsx)("span",{className:"font-mono",children:e.model})]}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:e.connection}),e.warnings.filter(function(e){return e.code!==ta.OQ.favoriteReasoningLevelsMissing}).map(function(e,t){return(0,x.jsx)(dZ,{variant:"warning",children:r((0,ta.Vz)(e.code),e.data)},"".concat(e.code,"-").concat(t))}),e.notRepresented.length?(0,x.jsx)(dZ,{variant:"warning",children:r("toolModels.notRepresented",{fields:e.notRepresented.map(function(e){return r("favorites.".concat(e))}).join(" \xb7 ")})}):null]},e.id)}),(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,x.jsx)(dJ,{className:"size-4"}),r("favorites.liveComparison")]}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:r("favorites.liveComparisonHint")}),(0,x.jsx)(tN,{collapseUnchanged:!0,intent:"apply",files:t.files.map(function(e){return{path:e.key,existed:""!==e.before,currentContent:e.before||null,content:e.after}})})]}),n?(0,x.jsx)(tr,{onClick:n,children:r("toolModels.apply")}):null]})}function bF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bU(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function bH(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){bU(i,r,o,a,l,"next",e)}function l(e){bU(i,r,o,a,l,"throw",e)}a(void 0)})}}function b$(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||bK(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bB(e){return function(e){if(Array.isArray(e))return bF(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||bK(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bK(e,t){if(e){if("string"==typeof e)return bF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bF(e,t)}}function bq(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function bV(e){var t,n,r=e.harness,o=e.favorite,i=e.onApplied,a=e.onBusyChange,l=e.onClose,s=(0,to.Bd)().t,c=iV(function(e){return e.loadToolModels}),u=iV(function(e){return e.toolModelsPreview}),d=iV(function(e){return e.previewToolModels}),f=iV(function(e){return e.applyToolModels}),p=iV(function(e){return e.clearToolModelsPreview}),h=b$((0,w.useState)(!1),2),m=h[0],v=h[1],g=b$((0,w.useState)(""),2),y=g[0],b=g[1],k=b$((0,w.useState)("choose"),2),j=k[0],S=k[1],O=b$((0,w.useState)(!1),2),C=O[0],N=O[1],P=null==(n=o.toolBindings)?void 0:n[r],E=null!=(t=null==P?void 0:P.defaultModelId)?t:o.defaultConnectionId,I=function(e,t){var n=new Map,r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s=a.value;if(s.requestModelId){var c="".concat(s.providerId,"\0").concat(s.endpointKey,"\0").concat(s.requestModelId);n.get(c)&&t!==s.id||n.set(c,s)}}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return b_(n.values())}(o.connections.filter(function(e){return e.requestModelId&&(!(null==P?void 0:P.modelIds)||P.modelIds.includes(e.id))}),E),A=b$((0,w.useState)(function(e,t,n){if(e&&t.some(function(t){return t.id===e}))return e;var r=e?n.find(function(t){return t.id===e}):void 0;if(null==r?void 0:r.requestModelId){var o=t.find(function(e){return e.providerId===r.providerId&&e.endpointKey===r.endpointKey&&e.requestModelId===r.requestModelId});if(o)return o.id}return 1===t.length?t[0].id:""}(E,I,o.connections)),2),_=A[0],M=A[1],T=I.find(function(e){return e.id===_});(0,w.useEffect)(function(){return p(),p},[p]);var R=function(e){return bH(function(){return bq(this,function(t){switch(t.label){case 0:v(!0),a(!0),b(""),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,e()];case 2:return t.sent(),[3,5];case 3:return b(oA(s,oP(t.sent()))),[3,5];case 4:return v(!1),a(!1),[7];case 5:return[2]}})})()};return(0,x.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,x.jsxs)("fieldset",{disabled:m||C,className:"min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-contain p-6",children:["choose"===j?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("favorites.scheme.collectionApplyHint")}),(0,x.jsx)(d0,{title:s("favorites.scheme.selectedCount",{count:I.length}),children:I.map(function(e){return(0,x.jsxs)("p",{className:"break-all font-mono text-sm",children:[e.label," / ",e.requestModelId]},e.id)})}),(0,x.jsx)(fi,{id:"scheme-apply-default",label:s("favorites.scheme.startModel"),value:_,options:I.map(function(e){return{value:e.id,label:"".concat(e.label," / ").concat(e.requestModelId)}}),onChange:M,error:T?void 0:s("favorites.scheme.defaultIncompatible")})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("favorites.modeHint.activate")}),u?(0,x.jsx)(bL,{preview:u}):(0,x.jsx)("p",{role:"status",children:s("activate.loading")})]}),y?(0,x.jsx)(dZ,{children:y}):null,(0,x.jsx)("p",{role:"status",className:"min-h-5 text-sm",children:m?s("choose"===j?"toolModels.previewing":"toolModels.applying"):C?s("toolModels.applied"):""})]}),(0,x.jsx)("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t bg-card px-6 py-4",children:C?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("span",{}),(0,x.jsxs)(tr,{onClick:l,children:[(0,x.jsx)(aY,{}),s("favorites.done")]})]}):"choose"===j?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(tr,{variant:"outline",disabled:m,onClick:l,children:s("common.cancel")}),(0,x.jsxs)(tr,{disabled:m||!T,onClick:function(){R(function(){return bH(function(){var e;return bq(this,function(t){switch(t.label){case 0:return[4,bH(function(){var e,t,n,i,a,l;return bq(this,function(u){switch(u.label){case 0:return[4,c(r)];case 1:if(u.sent(),!(i=null==(t=iV.getState().toolModels.find(function(e){return e.harness===r}))?void 0:t.state)||iV.getState().toolModelsError)return b(s("toolModels.retry")),[2];return a=i.draft.items.filter(function(e){return"favorite"!==e.source.kind||e.source.favoriteId!==o.id}),l=I.map(function(e){var t,n=i.draft.items.find(function(t){return"favorite"===t.source.kind&&t.source.favoriteId===o.id&&t.source.connectionId===e.id});return{id:null!=(t=null==n?void 0:n.id)?t:e.id,source:{kind:"favorite",favoriteId:o.id,connectionId:e.id},factOverrides:{},preferenceOverrides:(null==P?void 0:P.reasoningEffort)?{reasoningEffort:P.reasoningEffort}:{}}}),[2,{expectedRevision:i.revision,draft:{items:bB(a).concat(bB(l)),defaultItemId:null!=(e=null==(n=l.find(function(e){return e.source.connectionId===_}))?void 0:n.id)?e:null}}]}})})()];case 1:if(!(e=t.sent()))return[2];return[4,d(r,e)];case 2:return t.sent(),S("review"),[2]}})})()})},children:[m?(0,x.jsx)(c2,{className:"animate-spin"}):null,s("favorites.reviewChanges")]})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(tr,{variant:"outline",disabled:m,onClick:function(){p(),b(""),S("choose")},children:[(0,x.jsx)(tm,{}),s("favorites.backToSelection")]}),(0,x.jsxs)(tr,{disabled:m||!u,onClick:function(){R(function(){return bH(function(){return bq(this,function(e){switch(e.label){case 0:if(!u)return[2];return[4,f(r,u.id)];case 1:return e.sent(),N(!0),null==i||i(),[2]}})})()})},children:[m?(0,x.jsx)(c2,{className:"animate-spin"}):(0,x.jsx)(aY,{}),s("favorites.confirmBatchActivate",{count:1})]})]})})]})}function bW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function bZ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return bW(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bW(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bY(e){var t,n,r,o,i,a,l,s,c=e.props,u=e.renderSingle,d=(0,to.Bd)().t,f=iV(function(e){return e.harnesses}),p=bZ((0,w.useState)(null!=(r=null!=(o=null==(i=c.quickHarness)?void 0:i.id)?o:null==(l=c.initialItems)||null==(a=l[0])?void 0:a.harness)?r:"claude"),2),h=p[0],m=p[1],v=bZ((0,w.useState)(!1),2),g=v[0],y=v[1],b=bZ((0,w.useState)(!1),2),k=b[0],j=b[1];return g&&h?u((t=bG({},c),n=n={initialMode:"activate",quickHarness:f.find(function(e){return e.id===h}),initialItems:null==(s=c.initialItems)?void 0:s.filter(function(e){return e.harness===h}),onClose:c.onClose},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)):(0,x.jsx)(r_,{open:!0,onOpenChange:function(e){e||k||c.onClose()},children:(0,x.jsxs)(r1,{className:"flex max-h-[90dvh] max-w-3xl flex-col gap-0 overflow-hidden p-0",style:{height:"kimi"===h||"dsh"===h?"min(760px,90dvh)":void 0},onEscapeKeyDown:function(e){k&&e.preventDefault()},onInteractOutside:function(e){k&&e.preventDefault()},children:[(0,x.jsxs)(r2,{className:"shrink-0 border-b p-6 pr-12",children:[(0,x.jsx)(r4,{children:d("favorites.configure")}),(0,x.jsx)(r5,{children:c.favorite.name})]}),(0,x.jsx)("fieldset",{disabled:k,className:"shrink-0 border-b px-6 py-3",children:(0,x.jsx)(un,{idPrefix:"scheme-apply-tools",label:d("favorites.targetTools"),items:f.map(function(e){return{id:e.id}}),value:h,onChange:function(e){return m(e)},className:"flex flex-wrap gap-2",tabClassName:"px-3 py-2 text-sm",children:function(e){return d("favorites.scheme.tools.".concat(e.id))}})}),(0,x.jsx)(uo,{idPrefix:"scheme-apply-tools",value:h,className:"flex min-h-0 flex-1 flex-col",children:"kimi"===h||"dsh"===h?(0,x.jsx)(bV,bG({harness:h,onBusyChange:j},c),h):h?(0,x.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,x.jsxs)("div",{className:"space-y-4 p-6",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:d("favorites.scheme.reviewTool",{tool:d("favorites.scheme.tools.".concat(h))})}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:d("favorites.modeHint.activate")})]}),(0,x.jsxs)("div",{className:"flex shrink-0 justify-between gap-3 border-t bg-card px-6 py-4",children:[(0,x.jsx)(tr,{variant:"outline",onClick:c.onClose,children:d("common.cancel")}),(0,x.jsx)(tr,{onClick:function(){return y(!0)},children:d("favorites.reviewChanges")})]})]}):null})]})})}function bX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bQ(e){return function(e){if(Array.isArray(e))return bX(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return bX(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bX(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b0(e){var t=e.favorite,n=e.items,r=e.setItems,o=e.plan,i=e.targets,a=e.clear,l=e.change,s=e.completedHarnesses,c=void 0===s?[]:s,u=e.onEditConnections,d=e.onlyHarness,f=(0,to.Bd)().t,p=iV(function(e){return e.harnesses});return(0,x.jsx)("div",{className:"space-y-3",children:ta.oo.filter(function(e){return(!d||e===d)&&!c.includes(e)}).map(function(e){var s,c,d,h,m,v,g=null!=(s=null==i||null==(d=i.find(function(t){return t.harness===e}))?void 0:d.connections.flatMap(function(e){return e.projection.blockers}))?s:[],y=t.connections.filter(function(t){var n;return null==i||null==(n=i.find(function(t){return t.harness===e}))?void 0:n.connections.some(function(e){return e.id===t.id&&0===e.projection.blockers.length})}),b=n.find(function(t){return t.harness===e}),w=null!=(c=null==(h=p.find(function(t){return t.id===e}))?void 0:h.profiles.filter(function(e){var n;return(null==(n=e.modelFavorite)?void 0:n.favoriteId)===t.id}))?c:[];return(0,x.jsxs)("section",{className:tt("overflow-hidden rounded-xl border transition-colors",b?"border-primary/40 bg-primary/[0.035] shadow-sm":"bg-card",!y.length&&"bg-muted/35"),children:[(0,x.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl border bg-background",children:(0,x.jsx)(dz,{id:e,className:"size-6"})}),(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("label",{htmlFor:"target-".concat(e),className:"block cursor-pointer font-semibold",children:(null==(m=p.find(function(t){return t.id===e}))?void 0:m.label)||f("favorites.toolNames.".concat(e))}),(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?y.length?1===y.length?"".concat(y[0].label," \xb7 ").concat(y[0].requestModelId):f("favorites.compatibleCount",{count:y.length}):f("favorites.noCompatibleChannel"):f("favorites.loading")})]}),b?(0,x.jsx)(tb,{variant:"secondary",children:f("favorites.selected")}):null,(0,x.jsx)(aX,{"aria-label":(null==(v=p.find(function(t){return t.id===e}))?void 0:v.label)||f("favorites.toolNames.".concat(e)),id:"target-".concat(e),checked:!!b,disabled:!y.length,onCheckedChange:function(t){a(),r(t?bQ(n).concat([{harness:e,connectionId:1===w.length&&y.some(function(e){return e.id===w[0].modelFavorite.connectionId})?w[0].modelFavorite.connectionId:1===y.length?y[0].id:"",existing:1===w.length,profile:1===w.length?w[0].name:void 0,mode:"activate",ignorePreference:!1,overwriteDiverged:!1}]):n.filter(function(t){return t.harness!==e}))}})]}),i&&!y.length?(0,x.jsxs)("div",{className:"space-y-2 border-t px-4 py-3 text-xs text-muted-foreground",children:[(0,x.jsx)("p",{children:f("favorites.noCompatibleHint")}),g.slice(0,2).map(function(e,t){return(0,x.jsx)("p",{children:f((0,ta.Vz)(e.code),e.data)},"".concat(e.code,"-").concat(t))}),u?(0,x.jsx)(tr,{size:"sm",variant:"outline",onClick:u,children:f("favorites.editForCompatibility")}):null]}):null,b?(0,x.jsxs)("div",{className:"space-y-3 border-t border-primary/10 px-4 py-3",children:[y.length>1?(0,x.jsx)(fi,{id:"connection-".concat(e),label:f("favorites.connection"),value:b.connectionId,options:y.map(function(e){return{value:e.id,label:"".concat(e.label," \xb7 ").concat(e.protocol," \xb7 ").concat(e.requestModelId)}}),onChange:function(t){return l(e,{connectionId:t})}}):null,(0,x.jsxs)("p",{className:"text-sm text-muted-foreground",children:[f(b.existing?"favorites.updateProfile":"favorites.newProfile"),":"," ",b.profile||t.name]}),(0,x.jsxs)(d0,{title:f("favorites.targetAdvanced"),children:[(0,x.jsx)(fi,{id:"existing-".concat(e),label:f("favorites.target"),value:b.existing?b.profile:"__new__",options:[{value:"__new__",label:f("favorites.newProfile")}].concat(bQ(w.map(function(e){return{value:e.name,label:e.name}}))),onChange:function(t){return l(e,{existing:"__new__"!==t,profile:"__new__"===t?void 0:t})}}),b.existing?null:(0,x.jsx)(i0,{id:"profile-".concat(e),label:f("favorites.profileName"),children:function(n){var r,o,i;return(0,x.jsx)(i4,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){bJ(e,t,n[t])})}return e}({},n),i=i={value:null!=(r=b.profile)?r:"",placeholder:t.name,onChange:function(t){return l(e,{profile:t.target.value||void 0})}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))}})]}),["ignorePreference","overwriteDiverged"].filter(function(t){var n,r,a=null==i||null==(r=i.find(function(t){return t.harness===e}))||null==(n=r.connections.find(function(e){return e.id===b.connectionId}))?void 0:n.projection;return"ignorePreference"===t?null==a?void 0:a.notRepresented.includes("reasoningEffort"):b.overwriteDiverged||(null==o?void 0:o.items.some(function(t){return t.harness===e&&t.projection.blockers.some(function(e){return e.code===ta.OQ.favoriteProfileDiverged})}))}).map(function(t){return(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aX,{id:"".concat(t,"-").concat(e),checked:b[t],onCheckedChange:function(n){return l(e,bJ({},t,!0===n))}}),(0,x.jsx)("label",{htmlFor:"".concat(t,"-").concat(e),children:f("favorites.".concat(t))})]},t)}),"activate"===b.mode&&w.some(function(e){return e.name===b.profile&&"openai_auth"===e.extras.authMode})?(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aX,{id:"auth-overwrite-".concat(e),checked:!0===b.allowAuthOverwrite,onCheckedChange:function(t){return l(e,{allowAuthOverwrite:!0===t})}}),(0,x.jsx)("label",{htmlFor:"auth-overwrite-".concat(e),children:f("favorites.allowAuthOverwrite")})]}):null]}):null]},e)})})}function b1(e,t,n){return e.connections.filter(function(e){var r;return null==n||null==(r=n.find(function(e){return e.harness===t}))?void 0:r.connections.some(function(t){return t.id===e.id&&!t.projection.blockers.length})})}function b2(e,t,n){var r,o,i,a,l=b1(e,t.id,n),s=t.profiles.filter(function(t){var n;return(null==(n=t.modelFavorite)?void 0:n.favoriteId)===e.id}),c=s.find(function(e){var n,r;return!(null==(n=t.active)?void 0:n.official)&&e.name===(null==(r=t.active)?void 0:r.name)}),u=null!=c?c:1===s.length?s[0]:void 0,d=null==u||null==(o=u.modelFavorite)?void 0:o.connectionId,f=null!=(r=null==(a=e.toolBindings)||null==(i=a[t.id])?void 0:i.defaultModelId)?r:e.defaultConnectionId;return{harness:t.id,connectionId:f?l.some(function(e){return e.id===f})?f:"":l.some(function(e){return e.id===d})?d:1===l.length?l[0].id:"",existing:!!u,profile:null==u?void 0:u.name,mode:"activate",ignorePreference:!1,overwriteDiverged:!1}}function b3(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b4(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function b5(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){b4(i,r,o,a,l,"next",e)}function l(e){b4(i,r,o,a,l,"throw",e)}a(void 0)})}}function b6(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b8(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function b9(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||xe(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b7(e){return function(e){if(Array.isArray(e))return b3(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||xe(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){if(e){if("string"==typeof e)return b3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b3(e,t)}}function xt(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var xn=function(e){return e.map(function(e){return b8(b6({},e),{mode:"activate"})})};function xr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function xi(e){var t;return(!e.quickHarness||["kimi","dsh"].includes(e.quickHarness.id))&&(!(null==(t=e.initialItems)?void 0:t.length)||e.initialItems.every(function(e){return["kimi","dsh"].includes(e.harness)}))&&(e.favorite.defaultConnectionId||e.favorite.toolBindings||e.favorite.connections.some(function(e){return e.groupId}))?(0,x.jsx)(bY,{props:e,renderSingle:function(e){return(0,x.jsx)(xa,xo({},e))}}):(0,x.jsx)(xa,xo({},e))}function xa(e){var t,n,r,o,i,a,l,s,c,u,d,f,p,h,m,v,g,y,b,k,j,S,O,C,N,P,E,I,A,_,M,T,R,z,D,L,F,U,H,$,B,K,q,V,W,G,Z,Y,X,J,Q,ee,et,en,er,eo,ei,ea,el,es,ec,eu=e.favorite,ed=e.quickHarness,ef=e.onEditConnections,ep=(0,to.Bd)().t,eh=(t=e.favorite,n=e.onClose,o=void 0===(r=e.initialItems)?[]:r,i=e.initialPreview,a=e.onApplied,l=e.quickHarness,s=(0,to.Bd)().t,c=iV(function(e){return e.favoritePlan}),u=iV(function(e){return e.planFavorite}),d=iV(function(e){return e.applyFavorite}),f=iV(function(e){return e.clearFavoritePlan}),p=iV(function(e){return e.favoriteTargets[t.id]}),h=iV(function(e){return e.loadFavoriteTargets}),v=(m=b9((0,w.useState)(function(){return xn(o)}),2))[0],g=m[1],y=function(e){g(function(t){return xn("function"==typeof e?e(t):e)})},k=(b=b9((0,w.useState)(void 0!==i&&i||l?1:0),2))[0],j=b[1],O=(S=b9((0,w.useState)(!1),2))[0],C=S[1],P=(N=b9((0,w.useState)(""),2))[0],E=N[1],A=(I=b9((0,w.useState)([]),2))[0],_=I[1],T=(M=b9((0,w.useState)(!1),2))[0],R=M[1],D=(z=b9((0,w.useState)(!1),2))[0],L=z[1],U=(F=b9((0,w.useState)(""),2))[0],H=F[1],B=($=b9((0,w.useState)(!1),2))[0],K=$[1],V=(q=b9((0,w.useState)(0),2))[0],W=q[1],Z=(G=b9((0,w.useState)(function(){return crypto.randomUUID()}),2))[0],Y=G[1],X=(0,w.useRef)(!1),J=(0,w.useRef)(!1),Q=(0,w.useRef)(!1),ee=(0,w.useRef)(new Map),et=(0,w.useRef)(!0),en=l?b1(t,l.id,p):[],er=U||(l?b2(t,l,p).connectionId:""),eo=en.find(function(e){return e.id===er}),ei=A.some(function(e){return"failed"===e.status||"skipped"===e.status}),ea=A.filter(function(e){return"applied"===e.status||"unchanged"===e.status}).map(function(e){return e.harness}),(0,w.useEffect)(function(){return et.current=!0,function(){et.current=!1}},[]),(0,w.useEffect)(function(){var e=!0;return h(t.id).catch(function(t){e&&E(oA(s,oP(t)))}),function(){e=!1}},[t.id,h,s]),(0,w.useEffect)(function(){if(l&&er&&!X.current&&!Q.current&&1===k){var e=!0;f(),K(!1),E("");var n=[b8(b6({},b2(t,l,p)),{connectionId:er})];return y(n),Y(crypto.randomUUID()),u({favoriteId:t.id,expectedRevision:t.revision,items:n}).then(function(){e&&K(!0)}).catch(function(t){e&&E(oA(s,oP(t)))}),function(){e=!1}}},[l,er,t,p,f,u,s,V,k]),el=function(e){return b5(function(){var t;return xt(this,function(n){switch(n.label){case 0:if(J.current)return[2];J.current=!0,C(!0),E(""),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,e()];case 2:return n.sent(),[3,5];case 3:return t=n.sent(),et.current&&E(oA(s,oP(t))),[3,5];case 4:return J.current=!1,et.current&&C(!1),[7];case 5:return[2]}})})()},es=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;return b5(function(){return xt(this,function(n){switch(n.label){case 0:return Q.current=!0,K(!1),[4,u({favoriteId:t.id,expectedRevision:t.revision,items:e})];case 1:return n.sent(),et.current&&(Y(crypto.randomUUID()),L(!1),R(!1),K(!0),j(1)),[2]}})})()},{plan:c,clear:f,targets:p,items:v,setItems:y,mode:"activate",step:k,setStep:j,busy:O,error:P,setError:E,results:A,failed:ei,completedHarnesses:ea,uncertain:T,needsPreview:D,quickReady:B,connections:en,selectedChannel:er,connection:eo,changeChannel:function(e){Q.current=!1,H(e),W(function(e){return e+1})},refreshQuickPreview:function(){Q.current=!1,W(function(e){return e+1})},run:el,preview:es,submit:function(){return el(function(){return b5(function(){var e,t,n,r,o,i,a,l,s,u;return xt(this,function(f){switch(f.label){case 0:if(!c||X.current)return[2];X.current=!0,Q.current=!0,e=!0,t=!1,n=void 0;try{for(r=v[Symbol.iterator]();!(e=(o=r.next()).done);e=!0)i=o.value,ee.current.set(i.harness,i)}catch(e){t=!0,n=e}finally{try{e||null==r.return||r.return()}finally{if(t)throw n}}f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,d(Z)];case 2:if(a=f.sent(),!et.current||!a)return[2];return l=a.items.map(function(e){return b8(b6({},e),{mode:c.items.find(function(t){return t.harness===e.harness}).mode})}),_(function(e){return b7(e.filter(function(e){return!l.some(function(t){return t.harness===e.harness})})).concat(b7(l))}),R(!1),j(2),[3,5];case 3:if(s=f.sent(),!et.current)return[2];throw L(u=(null!=or&&"u">typeof Symbol&&or[Symbol.hasInstance]?!!or[Symbol.hasInstance](s):s instanceof or)&&(s.code===ta.OQ.favoritePlanExpired||s.code===ta.OQ.favoritePlanStale)),R(!u),s;case 4:return X.current=!1,[7];case 5:return[2]}})})()})},retry:function(){return el(function(){return b5(function(){var e;return xt(this,function(t){switch(t.label){case 0:return y(xn(e=A.filter(function(e){return"failed"===e.status||"skipped"===e.status}).flatMap(function(e){var t,n=null!=(t=v.find(function(t){return t.harness===e.harness}))?t:ee.current.get(e.harness);return n?[n]:[]}))),[4,es(xn(e))];case 1:return t.sent(),[2]}})})()})},close:function(){O||J.current||(f(),ea.length&&(null==a||a()),n())},change:function(e,t){f(),y(function(n){return n.map(function(n){return n.harness===e?b6({},n,t):n})})},loadTargets:h}),em=eh.step,ev=eh.plan,eg=eh.busy,ey=eh.items,eb=function(e){if(Array.isArray(e))return e}(ec=(0,w.useState)("route"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(ec)||function(e){if(e){if("string"==typeof e)return xr(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xr(e,2)}}(ec)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),ex=eb[0],ew=eb[1],ek=(0,w.useRef)(null),ej=null==ev?void 0:ev.items.some(function(e){return e.projection.blockers.length>0});(0,w.useEffect)(function(){var e;null==(e=ek.current)||e.focus({preventScroll:!0})},[em]);var eS=ef?function(){eh.close(),ef()}:void 0;return(0,x.jsx)(r_,{open:!0,onOpenChange:function(e){return!e&&eh.close()},children:(0,x.jsxs)(r1,{style:{height:2===em?"min(".concat(Math.max(400,270+150*eh.results.length),"px, 90dvh)"):"min(820px, 90dvh)"},className:"flex h-[min(720px,90dvh)] max-w-4xl flex-col gap-0 overflow-hidden p-0 data-[state=open]:animate-none data-[state=closed]:animate-none",onEscapeKeyDown:function(e){return eg&&e.preventDefault()},children:[(0,x.jsxs)(r2,{className:"shrink-0 border-b px-6 pb-5 pt-6 text-left sm:px-8",children:[ed?null:(0,x.jsx)("div",{className:"mb-4 flex flex-wrap items-center gap-2 pr-8 text-xs font-medium text-muted-foreground","aria-label":ep("favorites.workflow"),children:["favorites.chooseTools","favorites.reviewChanges","favorites.results"].map(function(e,t){return(0,x.jsxs)("span",{className:tt("flex items-center gap-2",em===t&&"text-primary"),"aria-current":em===t?"step":void 0,children:[t>0?(0,x.jsx)("span",{className:"h-px w-4 bg-border"}):null,(0,x.jsx)("span",{className:"flex size-6 items-center justify-center rounded-full bg-muted",children:em>t?(0,x.jsx)(aY,{className:"size-3.5"}):t+1}),ep(e)]},e)})}),(0,x.jsx)(r4,{ref:ek,tabIndex:-1,className:"text-xl outline-none",children:ep(2===em?eh.failed?"favorites.resultTitlePartial":"favorites.resultTitleComplete":0===em?"favorites.configure":"favorites.reviewChanges")}),(0,x.jsxs)(r5,{children:[eu.name," \xb7"," ",ep(2===em?"favorites.resultHint":0===em?"favorites.chooseHint":"favorites.reviewHint")]})]}),(0,x.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:2===em?(0,x.jsx)(dX,{results:eh.results}):(0,x.jsxs)("div",{className:"flex h-full w-[200%] transition-transform duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",style:{transform:"translateX(".concat(1===em?"-50%":"0",")")},children:[(0,x.jsxs)("section",{"aria-label":ep("favorites.chooseTools"),"aria-hidden":0!==em,inert:0!==em||eg,className:"h-full w-1/2 shrink-0 space-y-5 overflow-y-auto p-6 sm:px-8",children:[(0,x.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:(0,x.jsx)("p",{className:"text-sm font-medium",children:ep("favorites.targetTools")})}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:ep("favorites.modeHint.activate")}),(0,x.jsx)(b0,{favorite:eu,items:ey,setItems:eh.setItems,plan:ev,targets:eh.targets,clear:eh.clear,change:eh.change,completedHarnesses:eh.completedHarnesses,onlyHarness:null==ed?void 0:ed.id,onEditConnections:eS})]}),(0,x.jsxs)("section",{"aria-label":ep("favorites.reviewChanges"),"aria-hidden":1!==em,inert:1!==em||eg||eh.uncertain,className:"flex h-full w-1/2 shrink-0 flex-col gap-4 overflow-y-auto overscroll-contain bg-muted/20 p-6 sm:px-8",children:[(0,x.jsx)("p",{className:"shrink-0 text-sm text-muted-foreground",children:ep("favorites.modeHint.activate")}),ed?(0,x.jsx)(bP,{connections:eh.connections,connection:eh.connection,selectedChannel:eh.selectedChannel,setChannel:eh.changeChannel,targetsLoaded:!!eh.targets,reviewTab:ex,setReviewTab:ew,quickHarness:ed,templateName:eu.name,quickReady:eh.quickReady,plan:ev}):ev?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"shrink-0 text-sm font-medium",children:ep("favorites.batchSummary",{count:ev.items.length,activate:ev.items.length,files:ev.items.reduce(function(e,t){return e+t.nativeFiles.filter(function(e){return e.changed}).length},0)})}),(0,x.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)(c4,{className:"size-4 shrink-0"}),ep("favorites.autoBackupNotice")]}),(0,x.jsx)(d7,{items:ev.items},ev.id)]}):null]})]})}),(0,x.jsx)(dY,{flow:eh,favoriteId:eu.id,quick:!!ed,blocked:!!ej,onEditConnections:eS})]})})}function xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xs(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function xc(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){xs(i,r,o,a,l,"next",e)}function l(e){xs(i,r,o,a,l,"throw",e)}a(void 0)})}}function xu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xl(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xd(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function xf(e){var t,n,r=e.onClose,o=e.onCreate,i=e.initialSource,a=(0,to.Bd)().t,l=iV(function(e){return e.captureFavorite}),s=iV(function(e){return e.harnesses}),c=xu((0,w.useState)(function(){return i?JSON.stringify([i.harness,i.name]):""}),2),u=c[0],d=c[1],f=xu((0,w.useState)(null!=(t=null==i?void 0:i.name)?t:""),2),p=f[0],h=f[1],m=xu((0,w.useState)(!1),2),v=m[0],g=m[1],y=xu((0,w.useState)(!0),2),b=y[0],k=y[1],j=xu((0,w.useState)(!1),2),S=j[0],O=j[1],C=xu((0,w.useState)(""),2),N=C[0],P=C[1],E=s.flatMap(function(e){return e.profiles.filter(function(t){var n;return!t.modelFavorite&&!t.overriddenTargets.length&&t.name!==(null==(n=e.official)?void 0:n.linkedProfileName)}).map(function(t){return{harness:e.id,profile:t,value:JSON.stringify([e.id,t.name])}})});return(0,x.jsx)(r_,{open:!0,onOpenChange:function(e){return!e&&!S&&r()},children:(0,x.jsxs)(r1,{className:"flex max-h-[90dvh] flex-col overflow-hidden p-0",children:[(0,x.jsxs)(r2,{className:"shrink-0 border-b p-6",children:[(0,x.jsx)(r4,{children:a("favorites.capture")}),(0,x.jsx)(r5,{children:a("workspace.captureHint")})]}),(0,x.jsxs)("div",{className:"min-h-0 overflow-y-auto p-6",children:[E.length?(0,x.jsxs)("fieldset",{disabled:S,className:"grid gap-4 sm:grid-cols-2",children:[(0,x.jsx)(fi,{id:"favorite-source",label:a("favorites.capture"),value:u,options:E.map(function(e){return{value:e.value,label:"".concat(e.harness," / ").concat(e.profile.name)}}),onChange:function(e){d(e);var t,n=E.find(function(t){return t.value===e});h(null!=(t=null==n?void 0:n.profile.name)?t:"")}}),(0,x.jsx)(i0,{id:"capture-name",label:a("favorites.name"),children:function(e){var t,n;return(0,x.jsx)(i4,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={maxLength:120,value:p,onChange:function(e){return h(e.target.value)}},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}}),!u||(null==(n=E.find(function(e){return e.value===u}))?void 0:n.profile.providerId)?null:(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aX,{id:"capture-credential",checked:v,onCheckedChange:function(e){return g(!0===e)}}),(0,x.jsx)("label",{htmlFor:"capture-credential",children:a("favorites.extractCredential")})]}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(aX,{id:"capture-link",checked:b,onCheckedChange:function(e){return k(!0===e)}}),(0,x.jsx)("label",{htmlFor:"capture-link",children:a("favorites.linkSource")})]}),(0,x.jsx)(tr,{disabled:S||!u||!p,onClick:function(){xc(function(){return xd(this,function(e){switch(e.label){case 0:O(!0),P(""),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,function(){return xc(function(){var e;return xd(this,function(t){switch(t.label){case 0:if(!(e=E.find(function(e){return e.value===u})))return[3,2];return[4,l(e.harness,e.profile.name,p,v,b)];case 1:t.sent(),r(),t.label=2;case 2:return[2]}})})()}()];case 2:return e.sent(),[3,5];case 3:return P(oA(a,oP(e.sent()))),[3,5];case 4:return O(!1),[7];case 5:return[2]}})})()},children:a("favorites.capture")})]}):(0,x.jsxs)("div",{className:"space-y-4",children:[(0,x.jsx)("h3",{className:"font-medium",children:a("favorites.onboarding.captureEmpty")}),(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:a("favorites.onboarding.captureEmptyHint")}),o?(0,x.jsx)(tr,{onClick:o,children:a("favorites.add")}):(0,x.jsx)(tr,{variant:"outline",onClick:r,children:a("favorites.cancel")})]}),N?(0,x.jsx)("p",{role:"alert",className:"mt-3 text-sm text-destructive",children:N}):null]})]})})}let xp=P("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),xh=P("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);function xm(e){var t=e.open,n=e.onOpenChange,r=e.onDiscard,o=(0,to.Bd)().t;return(0,x.jsx)(ap,{open:t,onOpenChange:n,children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:o("favorites.draft.discardTitle")}),(0,x.jsx)(aI,{children:o("favorites.draft.discardHint")})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:o("favorites.draft.keepEditing")}),(0,x.jsx)(aA,{onClick:r,children:o("favorites.draft.discard")})]})]})})}var xv=function(e){return e.replace(/\/+$/,"")};function xg(e){var t;return null==(t=ta.T_.flatMap(function(e){return e.endpoints}).find(function(t){return xv(t.baseUrl)===xv(e)}))?void 0:t.protocol}function xy(e,t){return e.flatMap(function(e){return e.endpoints.flatMap(function(n){var r=t.endpoints.find(function(e){return xv(e.baseUrl)===xv(n.baseUrl)});return r?[{provider:e,endpointKey:n.key,protocol:r.protocol}]:[]})})}function xb(e,t,n,r){var o,i,a,l,s=null==(o=e.find(function(e){return e.id===t}))?void 0:o.endpoints.find(function(e){return e.key===n});if(s)return null==(l=ta.T_.find(function(e){return e.endpoints.some(function(e){return xv(e.baseUrl)===xv(s.baseUrl)})}))||null==(a=l.modelCatalog)||null==(i=a.find(function(e){return e.requestModelId===r}))?void 0:i.facts}function xx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function xw(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function xk(e){var t=e.preset,n=e.name,r=e.setName,o=e.apiKey,i=e.setApiKey,a=e.endpointKey,l=e.setEndpointKey,s=e.busy,c=e.error,u=e.onBack,d=e.onCreate,f=(0,to.Bd)().t,p=t.endpoints.find(function(e){return e.key===a});return(0,x.jsxs)("fieldset",{disabled:s,className:"grid gap-4",children:[(0,x.jsx)(i0,{id:"preset-provider-name",label:f("vault.name"),children:function(e){return(0,x.jsx)(i4,xw(xx({},e),{maxLength:120,value:n,onChange:function(e){return r(e.target.value)}}))}}),(0,x.jsx)(i0,{id:"preset-provider-key",label:f("vault.apiKey"),children:function(e){return(0,x.jsx)(i4,xw(xx({},e),{type:"password",autoComplete:"off",value:o,onChange:function(e){return i(e.target.value)}}))}}),t.getKeyUrl?(0,x.jsx)("a",{className:"text-sm text-primary underline underline-offset-4",href:t.getKeyUrl,target:"_blank",rel:"noreferrer",children:f("favorites.presets.getKey")}):null,t.endpoints.length>1?(0,x.jsx)(fi,{id:"preset-endpoint",label:f("favorites.presets.chooseEndpoint"),hint:f("favorites.presets.endpointHint"),value:a,options:t.endpoints.map(function(e){return{value:e.key,label:f("anthropic-messages"===e.protocol?"favorites.protocolOptions.anthropicMessages":"openai-responses"===e.protocol?"favorites.protocolOptions.openaiResponses":"favorites.protocolOptions.openaiChat"),description:e.baseUrl}}),onChange:l}):null,(0,x.jsxs)("p",{className:"break-all text-muted-foreground text-xs",children:[f("favorites.presets.baseUrl"),": ",null==p?void 0:p.baseUrl]}),c?(0,x.jsx)("p",{role:"alert",className:"text-destructive text-sm",children:c}):null,(0,x.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,x.jsx)(tr,{variant:"ghost",onClick:u,children:f("favorites.presets.back")}),(0,x.jsx)(tr,{disabled:s||!n.trim()||!o.trim(),onClick:d,children:f("favorites.presets.createProvider")})]})]})}function xj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xS(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function xO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xj(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xC(e){var t,n=e.onClose,r=e.onCapture,o=e.onBlank,i=e.onPreset,a=(0,to.Bd)().t,l=null!=(t=iV(function(e){return e.providers}))?t:[],s=iV(function(e){return e.createProvider}),c=xO((0,w.useState)({kind:"choice"}),2),u=c[0],d=c[1],f=xO((0,w.useState)(""),2),p=f[0],h=f[1],m=xO((0,w.useState)(""),2),v=m[0],g=m[1],y=xO((0,w.useState)(""),2),b=y[0],k=y[1],j=xO((0,w.useState)(!1),2),S=j[0],O=j[1],C=xO((0,w.useState)(""),2),N=C[0],P=C[1],E=xO((0,w.useState)(!1),2),I=E[0],A=E[1],_=xO((0,w.useState)("close"),2),M=_[0],T=_[1],R=function(e){g(""),"back"===e?d({kind:"preset"}):n()},z=function(e){S||("provider"===u.kind&&(v||p!==a(u.preset.nameKey)||b!==u.preset.endpoints[0].key)?(T(e),A(!0)):R(e))},D=function(e){h(a(e.nameKey)),g(""),k(e.endpoints[0].key),P(""),d({kind:"provider",preset:e})},L=function(e){var t=xy(l,e);if(1===t.length){var n=t[0];i(e,n.provider,n.endpointKey,n.protocol)}else t.length>1?d({kind:"account",preset:e}):D(e)},F=function(e){var t;return(t=function(){var t,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:if(!(t=e.endpoints.find(function(e){return e.key===b})))return[2];O(!0),P(""),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,s({name:p.trim(),apiKey:v.trim(),endpoints:[{key:t.key,baseUrl:t.baseUrl}]})];case 2:return n=r.sent(),g(""),i(e,n,t.key,t.protocol),[3,5];case 3:return P(oA(a,oP(r.sent()))),[3,5];case 4:return O(!1),[7];case 5:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){xS(i,r,o,a,l,"next",e)}function l(e){xS(i,r,o,a,l,"throw",e)}a(void 0)})})()},U=[{icon:(0,x.jsx)(xp,{className:"size-5 text-primary"}),label:a("favorites.createChoice.preset"),hint:a("favorites.createChoice.presetHint"),action:function(){return d({kind:"preset"})}},{icon:(0,x.jsx)(dB,{className:"size-5 text-primary"}),label:a("favorites.capture"),hint:a("favorites.createChoice.captureHint"),action:r},{icon:(0,x.jsx)(xh,{className:"size-5 text-primary"}),label:a("favorites.createChoice.blank"),hint:a("favorites.createChoice.blankHint"),action:o}];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r_,{open:!0,onOpenChange:function(e){return!e&&z("close")},children:(0,x.jsxs)(r1,{className:"max-h-[90dvh] max-w-lg overflow-y-auto",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:"choice"===u.kind?a("favorites.createChoice.title"):"preset"===u.kind?a("favorites.presets.title"):"account"===u.kind?a("favorites.presets.chooseAccount"):a("favorites.presets.createProvider")}),(0,x.jsx)(r5,{children:a("provider"===u.kind?"favorites.presets.providerHint":"account"===u.kind?"favorites.presets.accountHint":"favorites.createChoice.description")})]}),"choice"===u.kind?(0,x.jsx)("div",{className:"grid gap-3",children:U.map(function(e){return(0,x.jsxs)(tr,{variant:"outline",className:"h-auto items-start justify-start gap-3 whitespace-normal rounded-xl px-4 py-4 text-left",onClick:e.action,children:[e.icon,(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block font-medium",children:e.label}),(0,x.jsx)("span",{className:"mt-1 block text-muted-foreground text-xs",children:e.hint})]})]},e.label)})}):null,"preset"===u.kind?(0,x.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[ta.T_.map(function(e){return(0,x.jsx)(tr,{variant:"outline",className:"h-auto justify-start rounded-xl px-4 py-3 text-left",onClick:function(){return L(e)},children:a(e.nameKey)},e.id)}),(0,x.jsx)(tr,{variant:"ghost",onClick:function(){return d({kind:"choice"})},children:a("favorites.presets.back")})]}):null,"account"===u.kind?(0,x.jsxs)("div",{className:"grid gap-3",children:[xy(l,u.preset).map(function(e){var t=e.provider.endpoints.find(function(t){return t.key===e.endpointKey});return(0,x.jsx)(tr,{variant:"outline",className:"h-auto justify-start whitespace-normal py-3 text-left",onClick:function(){return i(u.preset,e.provider,e.endpointKey,e.protocol)},children:(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsxs)("span",{className:"block",children:[e.provider.name," \xb7 ",t.label||t.key]}),(0,x.jsx)("span",{className:"mt-1 block break-all text-xs text-muted-foreground",children:t.baseUrl})]})},e.provider.id+"/"+e.endpointKey)}),(0,x.jsx)(tr,{variant:"outline",onClick:function(){return D(u.preset)},children:a("favorites.presets.newAccount")}),(0,x.jsx)(tr,{variant:"ghost",onClick:function(){return d({kind:"preset"})},children:a("favorites.presets.back")})]}):null,"provider"===u.kind?(0,x.jsx)(xk,{preset:u.preset,name:p,setName:h,apiKey:v,setApiKey:g,endpointKey:b,setEndpointKey:k,busy:S,error:N,onBack:function(){return z("back")},onCreate:function(){F(u.preset)}}):null]})}),(0,x.jsx)(xm,{open:I,onOpenChange:A,onDiscard:function(){return R(M)}})]})}function xN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){xN(e,t,n[t])})}return e}function xE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var xI={contextWindow:262144,maxOutputTokens:65536,reasoningSupported:!0},xA=["contextWindow","maxOutputTokens","reasoningSupported","supportedReasoningEfforts"],x_=function(e,t){return JSON.stringify(e)===JSON.stringify(t)};function xM(e,t,n,r,o){var i=e.connections.find(function(e){return e.id===t});if(!i)return{draft:e,inferred:r};var a=xE(xP({},i,n),{factOverrides:xP({},i.factOverrides,n.factOverrides)}),l=xP({},r[t]);if(n.factOverrides){var s=!0,c=!1,u=void 0;try{for(var d,f,p,h=xA[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){var m=p.value;x_(i.factOverrides[m],a.factOverrides[m])||delete l[m]}}catch(e){c=!0,u=e}finally{try{s||null==h.return||h.return()}finally{if(c)throw u}}}var v=["requestModelId","providerId","endpointKey"].some(function(e){return e in n&&n[e]!==i[e]});if(v){delete a.factOverrides.supportedReasoningEfforts,a.preferenceOverrides=xE(xP({},a.preferenceOverrides),{reasoningEffort:null});var g=!0,y=!1,b=void 0;try{for(var x,w=xA[Symbol.iterator]();!(g=(x=w.next()).done);g=!0){var k=x.value;void 0!==l[k]&&x_(i.factOverrides[k],l[k])&&delete a.factOverrides[k],delete l[k],(null==o?void 0:o[k])!==void 0&&void 0===a.factOverrides[k]&&("supportedReasoningEfforts"===k||void 0===e.defaults[k]||x_(e.defaults[k],xI[k]))&&(Object.assign(a.factOverrides,xN({},k,o[k])),Object.assign(l,xN({},k,o[k])))}}catch(e){y=!0,b=e}finally{try{g||null==w.return||w.return()}finally{if(y)throw b}}}var j=(0,ta.Lk)(e,a),S=n.factOverrides&&"supportedReasoningEfforts"in n.factOverrides&&!x_(i.factOverrides.supportedReasoningEfforts,a.factOverrides.supportedReasoningEfforts);return j.preferences.reasoningEffort&&!(null==(d=j.facts.supportedReasoningEfforts)?void 0:d.includes(j.preferences.reasoningEffort))&&(S||v&&(j.facts.supportedReasoningEfforts||(null==(f=r[t])?void 0:f.supportedReasoningEfforts)))&&(a.preferenceOverrides=xE(xP({},a.preferenceOverrides),{reasoningEffort:null})),!1===j.facts.reasoningSupported&&(a.factOverrides.supportedReasoningEfforts=null,a.preferenceOverrides=xE(xP({},a.preferenceOverrides),{reasoningEffort:null})),{draft:xE(xP({},e),{connections:e.connections.map(function(e){return e.id===t?a:e})}),inferred:xE(xP({},r),xN({},t,l))}}let xT=Array(12).fill(0),xR=({visible:e,className:t})=>w.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},w.createElement("div",{className:"sonner-spinner"},xT.map((e,t)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),xz=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.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"})),xD=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.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"})),xL=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.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"})),xF=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},w.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"})),xU=w.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","aria-hidden":"true"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),xH=1,x$=e=>{var t;return"number"==typeof(null==e?void 0:e.id)||(null==e||null==(t=e.id)?void 0:t.length)>0?e.id:xH++},xB=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-100;e<=0||(this.toasts=this.toasts.filter(t=>!(e>0&&this.dismissedToasts.has(t.id))||(this.dismissedToasts.delete(t.id),e--,!1)))},this.create=e=>{let{message:t,...n}=e,r=x$(e),o=this.pendingDismissals.get(r);void 0!==o&&(cancelAnimationFrame(o),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let i=this.dismissedToasts.has(r),a=void 0===e.dismissible||e.dismissible;return i&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),(i?void 0:this.toasts.find(e=>e.id===r))?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>{if(null==e)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return void 0!==t&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let n,r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let o=Promise.resolve(e instanceof Function?e():e),i=void 0!==r,a=o.then(async e=>{if(n=["resolve",e],w.isValidElement(e))i=!1,this.create({id:r,type:"default",message:e});else if(xK(e)&&!e.ok){i=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,a="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...a})}else if(e instanceof Error){i=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...a})}else if(void 0!==t.success){i=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"success",description:o,...a})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){i=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,a="object"!=typeof n||w.isValidElement(n)?{message:n}:n;this.create({id:r,type:"error",description:o,...a})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),null==t.finally||t.finally.call(t)}),l=()=>new Promise((e,t)=>a.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let n=x$(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},xK=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,xq=Object.assign((e,t)=>xB.message(e,t),{success:xB.success,info:xB.info,warning:xB.warning,error:xB.error,custom:xB.custom,message:xB.message,promise:xB.promise,dismiss:xB.dismiss,loading:xB.loading},{getHistory:()=>xB.toasts,getToasts:()=>xB.getActiveToasts()});function xV(e){return void 0!==e.label}function xW(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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%)}");let xG=e=>{var t,n,r,o,i,a,l,s,c,u,d;let{invert:f,toast:p,unstyled:h,interacting:m,setHeights:v,visibleToasts:g,heights:y,index:b,toasts:x,expanded:k,removeToast:j,defaultRichColors:S,closeButton:O,style:C,cancelButtonStyle:N,actionButtonStyle:P,className:E="",descriptionClassName:I="",duration:A,position:_,gap:M,expandByDefault:T,classNames:R,icons:z,closeButtonAriaLabel:D="Close toast"}=e,[L,F]=w.useState(null),[U,H]=w.useState(null),[$,B]=w.useState(!1),[K,q]=w.useState(!1),[V,W]=w.useState(!1),[G,Z]=w.useState(!1),[Y,X]=w.useState(!1),[J,Q]=w.useState(0),[ee,et]=w.useState(0),en=w.useRef(p.duration||A||4e3),er=w.useRef(null),eo=w.useRef(null),ei=0===b,ea=b+1<=g,el=p.type,es=null!=el?el:"default",ec=!1!==p.dismissible,eu=p.className||"",ed=p.descriptionClassName||"",ef=w.useMemo(()=>y.findIndex(e=>e.toastId===p.id)||0,[y,p.id]),ep=w.useMemo(()=>{var e;return null!=(e=p.closeButton)?e:O},[p.closeButton,O]),eh=w.useMemo(()=>p.duration||A||4e3,[p.duration,A]),em=w.useRef(0),ev=w.useRef(0),eg=w.useRef(0),ey=w.useRef(null),[eb,ex]=_.split("-"),ew=w.useMemo(()=>y.reduce((e,t,n)=>n>=ef?e:e+t.height,0),[y,ef]),ek=(()=>{let[e,t]=w.useState(document.hidden);return w.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),e})(),ej=w.useMemo(()=>{var t;return null!=(t=e.swipeDirections)?t:function(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}(_)},[e.swipeDirections,_]),eS=p.invert||f,eO="loading"===el;ev.current=w.useMemo(()=>ef*M+ew,[ef,ew]),w.useEffect(()=>{en.current=eh},[eh]),w.useEffect(()=>{B(!0)},[]),w.useEffect(()=>{let e=eo.current;if(e){let t=e.getBoundingClientRect().height;return et(t),v(e=>[{toastId:p.id,height:t,position:p.position},...e]),()=>v(e=>e.filter(e=>e.toastId!==p.id))}},[v,p.id]),w.useLayoutEffect(()=>{if(!$)return;let e=eo.current,t=e.style.height;e.style.height="auto";let n=e.getBoundingClientRect().height;e.style.height=t,et(n),v(e=>e.find(e=>e.toastId===p.id)?e.map(e=>e.toastId===p.id?{...e,height:n}:e):[{toastId:p.id,height:n,position:p.position},...e])},[$,p.title,p.description,v,p.id,p.jsx,p.action,p.cancel]);let eC=w.useCallback(()=>{q(!0),Q(ev.current),v(e=>e.filter(e=>e.toastId!==p.id)),setTimeout(()=>{j(p)},200)},[p,j,v,ev]);function eN(){var e,t;return(null==z?void 0:z.loading)?w.createElement("div",{className:xW(null==R?void 0:R.loader,null==p||null==(t=p.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===el},z.loading):w.createElement(xR,{className:xW(null==R?void 0:R.loader,null==p||null==(e=p.classNames)?void 0:e.loader),visible:"loading"===el})}w.useEffect(()=>{let e;if((!p.promise||"loading"!==el)&&p.duration!==1/0&&"loading"!==p.type){if(k||m||ek){if(eg.current<em.current){let e=new Date().getTime()-em.current;en.current=en.current-e}eg.current=new Date().getTime()}else en.current!==1/0&&(em.current=new Date().getTime(),e=setTimeout(()=>{null==p.onAutoClose||p.onAutoClose.call(p,p),eC()},en.current));return()=>clearTimeout(e)}},[k,m,p,el,ek,eC]),w.useEffect(()=>{p.delete&&(eC(),null==p.onDismiss||p.onDismiss.call(p,p))},[eC,p.delete]);let eP=p.icon||(null==z?void 0:z[el])||(e=>{switch(e){case"success":return xz;case"info":return xL;case"warning":return xD;case"error":return xF;default:return null}})(el);return w.createElement("li",{tabIndex:0,ref:eo,className:xW(E,eu,null==R?void 0:R.toast,null==p||null==(t=p.classNames)?void 0:t.toast,null==R?void 0:R[es],null==p||null==(n=p.classNames)?void 0:n[es]),"data-sonner-toast":"","data-rich-colors":null!=(u=p.richColors)?u:S,"data-styled":!(p.jsx||p.unstyled||h),"data-mounted":$,"data-promise":!!p.promise,"data-swiped":Y,"data-removed":K,"data-visible":ea,"data-y-position":eb,"data-x-position":ex,"data-index":b,"data-front":ei,"data-swiping":V,"data-dismissible":ec,"data-type":el,"data-invert":eS,"data-swipe-out":G,"data-swipe-direction":U,"data-expanded":!!(k||T&&$),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${K?J:ev.current}px`,"--initial-height":T?"auto":`${ee}px`,...C,...p.style},onDragEnd:()=>{W(!1),F(null),ey.current=null},onPointerDown:e=>{2===e.button||eO||!ec||(er.current=new Date,Q(ev.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(W(!0),ey.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n,r,o;if(G||!ec)return;ey.current=null;let i=Number((null==(e=eo.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=eo.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),l=new Date().getTime()-(null==(n=er.current)?void 0:n.getTime()),s="x"===L?i:a,c=Math.abs(s)/l;if(("x"===L?ej.includes(i>0?"right":"left"):ej.includes(a>0?"bottom":"top"))&&(Math.abs(s)>=45||c>.11)){Q(ev.current),null==p.onDismiss||p.onDismiss.call(p,p),"x"===L?H(i>0?"right":"left"):H(a>0?"down":"up"),eC(),Z(!0);return}null==(r=eo.current)||r.style.setProperty("--swipe-amount-x","0px"),null==(o=eo.current)||o.style.setProperty("--swipe-amount-y","0px"),X(!1),W(!1),F(null)},onPointerMove:e=>{var t,n,r;if(!ey.current||!ec||(null==(t=window.getSelection())?void 0:t.toString().length)>0)return;let o=e.clientY-ey.current.y,i=e.clientX-ey.current.x;!L&&(Math.abs(i)>1||Math.abs(o)>1)&&F(Math.abs(i)>Math.abs(o)?"x":"y");let a={x:0,y:0},l=e=>1/(1.5+Math.abs(e)/20);if("y"===L){if(ej.includes("top")||ej.includes("bottom"))if(ej.includes("top")&&o<0||ej.includes("bottom")&&o>0)a.y=o;else{let e=o*l(o);a.y=Math.abs(e)<Math.abs(o)?e:o}}else if("x"===L&&(ej.includes("left")||ej.includes("right")))if(ej.includes("left")&&i<0||ej.includes("right")&&i>0)a.x=i;else{let e=i*l(i);a.x=Math.abs(e)<Math.abs(i)?e:i}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&X(!0),null==(n=eo.current)||n.style.setProperty("--swipe-amount-x",`${a.x}px`),null==(r=eo.current)||r.style.setProperty("--swipe-amount-y",`${a.y}px`)}},ep&&!p.jsx&&"loading"!==el?w.createElement("button",{"aria-label":D,"data-disabled":eO,"data-close-button":!0,onClick:eO||!ec?()=>{}:()=>{eC(),null==p.onDismiss||p.onDismiss.call(p,p)},className:xW(null==R?void 0:R.closeButton,null==p||null==(r=p.classNames)?void 0:r.closeButton)},null!=(d=null==z?void 0:z.close)?d:xU):null,(el||p.icon||p.promise)&&null!==p.icon&&((null==z?void 0:z[el])!==null||p.icon)?w.createElement("div",{"data-icon":"",className:xW(null==R?void 0:R.icon,null==p||null==(o=p.classNames)?void 0:o.icon)},"loading"===el?p.icon||eN():p.promise?eN():null,"loading"!==el?eP:null):null,w.createElement("div",{"data-content":"",className:xW(null==R?void 0:R.content,null==p||null==(i=p.classNames)?void 0:i.content)},w.createElement("div",{"data-title":"",className:xW(null==R?void 0:R.title,null==p||null==(a=p.classNames)?void 0:a.title)},p.jsx?p.jsx:"function"==typeof p.title?p.title():p.title),p.description?w.createElement("div",{"data-description":"",className:xW(I,ed,null==R?void 0:R.description,null==p||null==(l=p.classNames)?void 0:l.description)},"function"==typeof p.description?p.description():p.description):null),w.isValidElement(p.cancel)?p.cancel:p.cancel&&xV(p.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||N,onClick:e=>{!xV(p.cancel)||ec&&(null==p.cancel.onClick||p.cancel.onClick.call(p.cancel,e),eC())},className:xW(null==R?void 0:R.cancelButton,null==p||null==(s=p.classNames)?void 0:s.cancelButton)},p.cancel.label):null,w.isValidElement(p.action)?p.action:p.action&&xV(p.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:e=>{!xV(p.action)||(null==p.action.onClick||p.action.onClick.call(p.action,e),e.defaultPrevented||eC())},className:xW(null==R?void 0:R.actionButton,null==p||null==(c=p.classNames)?void 0:c.actionButton)},p.action.label):null)};function xZ(){if("u"<typeof window||"u"<typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let xY=w.forwardRef(function(e,t){let{id:n,invert:r,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:l,className:s,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:m=3,toastOptions:v,dir:g=xZ(),gap:y=14,icons:b,customAriaLabel:x,containerAriaLabel:k="Notifications"}=e,[j,S]=w.useState([]),O=w.useMemo(()=>n?j.filter(e=>e.toasterId===n):j.filter(e=>!e.toasterId),[j,n]),C=w.useMemo(()=>Array.from(new Set([o].concat(O.filter(e=>e.position).map(e=>e.position)))),[O,o]),[N,P]=w.useState([]),[E,I]=w.useState(!1),[A,_]=w.useState(!1),[M,T]=w.useState("system"!==d?d:"u">typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),R=w.useRef(null),z=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=w.useRef(null),L=w.useRef(!1),F=w.useCallback(e=>{S(t=>{var n;return(null==(n=t.find(t=>t.id===e.id))?void 0:n.delete)||xB.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return w.useEffect(()=>xB.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{t3.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return -1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[]),w.useEffect(()=>{if("system"!==d)return void T(d);if("system"===d&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?T("dark"):T("light")),"u"<typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?T("dark"):T("light")})}catch(t){e.addListener(({matches:e})=>{try{e?T("dark"):T("light")}catch(e){console.error(e)}})}},[d]),w.useEffect(()=>{j.length<=1&&I(!1)},[j]),w.useEffect(()=>{let e=e=>{var t,n;i.length>0&&i.every(t=>e[t]||e.code===t)&&(I(!0),null==(n=R.current)||n.focus()),"Escape"===e.code&&(document.activeElement===R.current||(null==(t=R.current)?void 0:t.contains(document.activeElement)))&&I(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),w.useEffect(()=>{if(R.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,L.current=!1)}},[R.current]),w.createElement("section",{ref:t,"aria-label":null!=x?x:`${k} ${z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},C.map((t,n)=>{var o;let i,[d,x]=t.split("-");return O.length?w.createElement("ol",{key:t,dir:"auto"===g?xZ():g,tabIndex:-1,ref:R,className:s,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":d,"data-x-position":x,style:{"--front-toast-height":`${(null==(o=N[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${y}px`,...h,...(i={},[c,u].forEach((e,t)=>{let n=1===t,r=n?"--mobile-offset":"--offset",o=n?"16px":"24px";function a(e){["top","right","bottom","left"].forEach(t=>{i[`${r}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?a(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?i[`${r}-${t}`]=o:i[`${r}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):a(o)}),i)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(L.current||(L.current=!0,D.current=e.relatedTarget))},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{A||I(!1)},onDragEnd:()=>I(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||_(!0)},onPointerUp:()=>_(!1)},O.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var i,s;return w.createElement(xG,{key:n.id,icons:b,index:o,toast:n,defaultRichColors:f,duration:null!=(i=null==v?void 0:v.duration)?i:p,className:null==v?void 0:v.className,descriptionClassName:null==v?void 0:v.descriptionClassName,invert:r,visibleToasts:m,closeButton:null!=(s=null==v?void 0:v.closeButton)?s:l,interacting:A,position:t,style:null==v?void 0:v.style,unstyled:null==v?void 0:v.unstyled,classNames:null==v?void 0:v.classNames,cancelButtonStyle:null==v?void 0:v.cancelButtonStyle,actionButtonStyle:null==v?void 0:v.actionButtonStyle,closeButtonAriaLabel:null==v?void 0:v.closeButtonAriaLabel,removeToast:F,toasts:O.filter(e=>e.position==n.position),heights:N.filter(e=>e.position==n.position),setHeights:P,expandByDefault:a,gap:y,expanded:E,swipeDirections:e.swipeDirections})})):null}))}),xX=P("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),xJ=P("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),xQ=P("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),x0=P("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function x1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x2(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function x3(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x1(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x4(e){var t=x3((0,w.useState)(!1),2),n=t[0],r=t[1],o=x3((0,w.useState)({signature:e,result:null}),2),i=o[0],a=o[1];return{pending:n,result:i.signature===e?i.result:null,run:function(t){var n;return(n=function(){var n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:r(!0),a({signature:e,result:null}),o.label=1;case 1:return o.trys.push([1,,3,4]),n={signature:e},[4,t()];case 2:return a.apply(void 0,[(n.result=o.sent(),n)]),[3,4];case 3:return r(!1),[7];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){x2(i,r,o,a,l,"next",e)}function l(e){x2(i,r,o,a,l,"throw",e)}a(void 0)})})()}}}function x5(e,t){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];(0,w.useEffect)(function(){n&&null===e&&t()},[n,e,t])}function x6(e){var t=e.className,n=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["className"]);return(0,x.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-slot":"textarea",className:tt("flex min-h-[60px] w-full rounded-[10px] border border-input bg-card px-3 py-2 text-base shadow-[0_1px_2px_rgb(20_24_40/0.04)] transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:border-ring/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:border-destructive aria-invalid:focus-visible:ring-destructive/25 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t)},n))}let x8=P("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function x9(e){var t=e.result;return(0,x.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,x.jsx)(x7,{result:t}),t.completion?(0,x.jsx)(we,{completion:t.completion}):null]})}function x7(e){var t=e.result,n=(0,to.Bd)().t;if(t.ok){var r,o,i,a,l=null!=(o=null==(a=t.models)?void 0:a.length)?o:0;return(0,x.jsx)(wt,{ok:!0,children:n(l>0?"probe.ok":"probe.okNoCatalog",{latencyMs:null!=(i=t.latencyMs)?i:"?",count:l})})}return(0,x.jsx)(wt,{ok:!1,children:oA(n,oN({code:null!=(r=t.code)?r:ta.AF.networkError,data:t.data}))})}function we(e){var t,n,r,o,i,a,l,s=e.completion,c=(0,to.Bd)().t,u=(0,to.s9)().locale,d=s.cachedAt?(t=s.cachedAt,n=u,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n,{dateStyle:"short",timeStyle:"short"})):"";if(s.ok)return(0,x.jsx)(wt,{ok:!0,children:d?c("probe.completionCached",{model:null!=(i=s.model)?i:"?",at:d}):c("probe.completionOk",{model:null!=(a=s.model)?a:"?",latencyMs:null!=(l=s.latencyMs)?l:"?"})});var f=oA(c,oN({code:null!=(o=s.code)?o:ta.AF.networkError,data:s.data}));return(0,x.jsx)(wt,{ok:!1,children:d?"".concat(f,"(").concat(c("probe.completionFailedCached",{at:d}),")"):f})}function wt(e){var t=e.ok,n=e.children;return(0,x.jsxs)("span",{className:t?"flex items-center gap-1.5 text-sm text-emerald-600 dark:text-emerald-400":"flex items-center gap-1.5 text-sm text-destructive",children:[(0,x.jsx)(t?uA:x8,{className:"size-4 shrink-0","aria-hidden":!0}),n]})}function wn(e){var t,n,r=e.options,o=e.targetIndex,i=e.onTargetChange,a=e.hasStoredKey,l=e.hasTypedKey,s=e.onMissingKey,c=e.probing,u=e.probeAction,d=e.result,f=e.probeError,p=e.onProbe,h=(0,to.Bd)().t;if(0===r.length&&!a)return null;var m=null!=(t=r.find(function(e){return e.index===o}))?t:r[0];function v(e){l||a?p(e):s()}return(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-t pt-3",children:[(0,x.jsxs)(tr,{type:"button",variant:"outline",size:"sm",disabled:c||0===r.length&&!l,onClick:function(){return v(!1)},children:[c&&"models"===u?(0,x.jsx)(c2,{className:"animate-spin"}):null,h(c&&"models"===u?"probe.probing":"probe.action")]}),(0,x.jsxs)(tr,{type:"button",variant:"outline",size:"sm",disabled:c||0===r.length&&!l,onClick:function(){return v(!0)},children:[c&&"completion"===u?(0,x.jsx)(c2,{className:"animate-spin"}):null,h(c&&"completion"===u?"probe.testingCompletion":"probe.completionAction")]}),r.length>1?(0,x.jsxs)(sV,{value:String(null!=(n=null==m?void 0:m.index)?n:""),onValueChange:function(e){return i(Number(e))},children:[(0,x.jsx)(cT,{className:"h-9 w-56","aria-label":h("vault.probeEndpointLabel"),children:(0,x.jsx)(sG,{})}),(0,x.jsx)(cD,{children:r.map(function(e){return(0,x.jsx)(cL,{value:String(e.index),children:e.key||e.baseUrl},e.index)})})]}):null,f?(0,x.jsxs)("span",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[(0,x.jsx)(x8,{className:"size-4 shrink-0","aria-hidden":!0}),oA(h,f)]}):d?(0,x.jsx)(x9,{result:d}):null]})}function wr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wo(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function wi(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){wo(i,r,o,a,l,"next",e)}function l(e){wo(i,r,o,a,l,"throw",e)}a(void 0)})}}function wa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wl(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ws(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||wu(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wc(e){return function(e){if(Array.isArray(e))return wr(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wu(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wu(e,t){if(e){if("string"==typeof e)return wr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wr(e,t)}}function wd(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function wf(e){var t,n,r=e.entry,o=e.onCancel,i=e.onSaved,a=(0,to.Bd)().t,l=iV(function(e){return e.createProvider}),s=iV(function(e){return e.updateProvider}),c=iV(function(e){return e.probeDraft}),u=null!==r,d=ws((0,w.useState)(null!=(t=null==r?void 0:r.name)?t:""),2),f=d[0],p=d[1],h=ws((0,w.useState)(""),2),m=h[0],v=h[1],g=ws((0,w.useState)(null!=(n=null==r?void 0:r.notes)?n:""),2),y=g[0],b=g[1],k=ws((0,w.useState)(function(){var e;return(null!=(e=null==r?void 0:r.endpoints)?e:[]).map(function(e){return{key:e.key,baseUrl:e.baseUrl,label:e.label}})}),2),j=k[0],S=k[1],O=ws((0,w.useState)(!1),2),C=O[0],N=O[1],P=ws((0,w.useState)(null),2),E=P[0],I=P[1],A=ws((0,w.useState)({}),2),_=A[0],M=A[1],T=ws((0,w.useState)({}),2),R=T[0],z=T[1],D=ws((0,w.useState)(null),2),L=D[0],F=D[1],U=ws((0,w.useState)(0),2),H=U[0],$=U[1],B=ws((0,w.useState)(null),2),K=B[0],q=B[1],V=JSON.stringify(j),W=x4(JSON.stringify([m,V]));function G(e,t){S(function(n){return n.map(function(n,r){return r===e?wa({},n,t):n})}),z(function(n){if(!n[e])return n;var r=wa({},n),o=wa({},r[e]);return void 0!==t.key&&delete o.key,void 0!==t.baseUrl&&delete o.baseUrl,0===Object.keys(o).length?delete r[e]:r[e]=o,r})}return(0,w.useEffect)(function(){return F(null)},[m,V]),(0,x.jsxs)("form",{onSubmit:function(e){return wi(function(){var t,n,o,a,c,d,p,h,v,g,b,x;return wd(this,function(w){switch(w.label){case 0:e.preventDefault(),t=j.map(function(e){return{key:e.key.trim(),label:e.label.trim(),baseUrl:e.baseUrl.trim()}}),n=wa({},f.trim()?{}:{name:{key:"vault.error.nameRequired"}},u||m.trim()?{}:{apiKey:{key:"vault.error.apiKeyRequired"}}),o=new Map,a=!0,c=!1,d=void 0;try{for(p=t[Symbol.iterator]();!(a=(h=p.next()).done);a=!0)(v=h.value).key&&o.set(v.key,(null!=(g=o.get(v.key))?g:0)+1)}catch(e){c=!0,d=e}finally{try{a||null==p.return||p.return()}finally{if(c)throw d}}if(b=Object.fromEntries(t.flatMap(function(e,t){var n,r={};return e.key?e.key.includes("/")||e.key.includes("\\")||e.key.length>ta.b1.endpointKey?r.key={key:"vault.error.endpointKeyInvalid",params:{max:ta.b1.endpointKey}}:(null!=(n=o.get(e.key))?n:0)>1&&(r.key={key:"vault.error.endpointKeyDuplicate"}):r.key={key:"vault.error.endpointKeyRequired"},e.baseUrl||(r.baseUrl={key:"vault.error.endpointUrlRequired"}),Object.keys(r).length>0?[[t,r]]:[]})),M(n),z(b),Object.keys(n).length>0||Object.keys(b).length>0)return I({key:"vault.error.checkFields"}),[2];x={name:f.trim(),notes:y.trim()||void 0,endpoints:t},N(!0),I(null),w.label=1;case 1:if(w.trys.push([1,6,7,8]),!(u&&r))return[3,3];return[4,s(r.id,wa({},x,m.trim()?{apiKey:m.trim()}:{}))];case 2:return i([{key:"vault.updated"}].concat(wc(w.sent().warnings.map(oN)))),[3,5];case 3:return[4,l(wl(wa({},x),{apiKey:m.trim()}))];case 4:w.sent(),i([{key:"vault.created"}]),w.label=5;case 5:return[3,8];case 6:return I(oE(w.sent(),"vault.saveFailed")),[3,8];case 7:return N(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"space-y-4",children:[(0,x.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[(0,x.jsx)(i0,{id:"provider-name",className:"sm:col-span-2",label:a("vault.name"),error:_.name?oA(a,_.name):void 0,children:function(e){return(0,x.jsx)(i4,wl(wa({},e),{value:f,onChange:function(e){p(e.target.value),M(function(e){return wl(wa({},e),{name:void 0})})},placeholder:a("vault.namePlaceholder")}))}}),(0,x.jsx)(i0,{id:"provider-api-key",className:"sm:col-span-2",label:a("vault.apiKey"),error:_.apiKey?oA(a,_.apiKey):void 0,children:function(e){return(0,x.jsx)(i4,wl(wa({},e),{type:"password",value:m,onChange:function(e){v(e.target.value),M(function(e){return wl(wa({},e),{apiKey:void 0})})},placeholder:u?a("vault.apiKeyKeep"):a("vault.apiKeyRequiredPlaceholder")}))}}),(0,x.jsx)(i0,{id:"provider-notes",className:"sm:col-span-2",label:a("vault.notes"),children:function(e){return(0,x.jsx)(x6,wl(wa({},e),{rows:2,value:y,onChange:function(e){return b(e.target.value)}}))}})]}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{children:a("vault.endpoints")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:a("vault.endpointsHint")}),0===j.length?(0,x.jsx)("p",{className:"rounded-xl border border-dashed px-3 py-3 text-center text-xs text-muted-foreground",children:a("vault.noEndpointDrafts")}):(0,x.jsx)("div",{className:"space-y-2",children:j.map(function(e,t){var n,r;return(0,x.jsxs)("div",{className:"grid items-start gap-2 sm:grid-cols-[10rem_minmax(0,1fr)_minmax(0,1fr)_auto]",children:[(0,x.jsx)(wp,{id:"endpoint-".concat(t,"-key"),label:a("vault.endpointKeyLabel",{index:t+1}),value:e.key,placeholder:a("vault.endpointKeyPlaceholder"),error:null==(n=R[t])?void 0:n.key,onChange:function(e){return G(t,{key:e})}}),(0,x.jsx)(wp,{id:"endpoint-".concat(t,"-url"),label:a("vault.endpointUrlLabel",{index:t+1}),value:e.baseUrl,placeholder:a("vault.endpointUrlPlaceholder"),error:null==(r=R[t])?void 0:r.baseUrl,onChange:function(e){return G(t,{baseUrl:e})}}),(0,x.jsx)(i4,{"aria-label":a("vault.endpointLabelLabel",{index:t+1}),value:e.label,onChange:function(e){return G(t,{label:e.target.value})},placeholder:a("vault.endpointLabelPlaceholder")}),(0,x.jsx)(tr,{type:"button",size:"icon",variant:"ghost","aria-label":a("vault.removeEndpoint",{index:t+1}),onClick:function(){S(function(e){return e.filter(function(e,n){return n!==t})}),z({})},children:(0,x.jsx)(x0,{})})]},t)})}),(0,x.jsxs)(tr,{type:"button",size:"sm",variant:"outline",onClick:function(){return S(function(e){return wc(e).concat([{key:"",baseUrl:"",label:""}])})},children:[(0,x.jsx)(dK,{}),a("vault.addEndpoint")]}),(0,x.jsx)(wn,{options:j.map(function(e,t){return{index:t,key:e.key,baseUrl:e.baseUrl}}).filter(function(e){return e.baseUrl.trim()}),targetIndex:H,onTargetChange:$,hasStoredKey:u,hasTypedKey:m.trim().length>0,onMissingKey:function(){return M(function(e){return wl(wa({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})})},probing:W.pending,probeAction:K,result:W.result,probeError:L,onProbe:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return wi(function(){var t,n,o;return wd(this,function(i){switch(i.label){case 0:if(!(o=null!=(t=(n=j.map(function(e,t){return{endpoint:e,index:t}}).filter(function(e){return""!==e.endpoint.baseUrl.trim()})).find(function(e){return e.index===H}))?t:n[0]))return F({key:"probe.missingBaseUrl"}),[2];if(!u&&!m.trim())return F(null),M(function(e){return wl(wa({},e),{apiKey:{key:"vault.error.apiKeyRequired"}})}),[2];F(null),q(e?"completion":"models"),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,W.run(function(){var t;return c(wa({baseUrl:o.endpoint.baseUrl},m.trim()?{apiKey:m}:{providerId:null!=(t=null==r?void 0:r.id)?t:""},e?{completion:!0}:{}))})];case 2:return i.sent(),[3,5];case 3:return F(oE(i.sent(),"vault.probeFailed")),[3,5];case 4:return q(null),[7];case 5:return[2]}})})()}})]}),E?(0,x.jsx)(dZ,{children:oA(a,E)}):null,(0,x.jsxs)(r3,{className:"flex-row justify-end gap-2 space-x-0",children:[(0,x.jsx)(tr,{type:"button",variant:"outline",className:"min-w-24",onClick:o,children:a("common.cancel")}),(0,x.jsx)(tr,{type:"submit",className:"min-w-24",disabled:C,children:C?a("vault.saving"):u?a("vault.saveChanges"):a("vault.add")})]})]})}function wp(e){var t=e.id,n=e.label,r=e.value,o=e.placeholder,i=e.error,a=e.onChange,l=(0,to.Bd)().t;return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)(i4,wl(wa({},i1(t,i)),{"aria-label":n,value:r,placeholder:o,onChange:function(e){return a(e.target.value)}})),(0,x.jsx)(i2,{id:t,children:i?oA(l,i):void 0})]})}function wh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wm(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function wv(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){wm(i,r,o,a,l,"next",e)}function l(e){wm(i,r,o,a,l,"throw",e)}a(void 0)})}}function wg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){wg(e,t,n[t])})}return e}function wb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wh(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wx(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function ww(e){var t,n=e.open,r=e.onOpenChange,o=(0,to.s9)().locale,i=(0,to.Bd)().t,a=iV(function(e){return e.providers}),l=iV(function(e){return e.providersLoading}),s=iV(function(e){return e.providersError}),c=iV(function(e){return e.loadProviders}),u=iV(function(e){return e.deleteProvider}),d=wb((0,w.useState)({kind:"list"}),2),f=d[0],p=d[1],h=wb((0,w.useState)(null),2),m=h[0],v=h[1],g=wb((0,w.useState)(null),2),y=g[0],b=g[1],k=wb((0,w.useState)(null),2),j=k[0],S=k[1],O=wb((0,w.useState)(null),2),C=O[0],N=O[1],P=wb((0,w.useState)({}),2),E=P[0],I=P[1],A=iV(function(e){return e.revealProvider});(0,w.useEffect)(function(){n&&(p({kind:"list"}),v(null),b(null),N(null))},[n]),x5(a,c,n);var _=null!=a?a:[];return(0,x.jsxs)(r_,{open:n,onOpenChange:r,children:[(0,x.jsxs)(r1,{className:"max-h-[88vh] overflow-y-auto sm:max-w-2xl",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:"create"===f.kind?i("vault.createTitle"):"edit"===f.kind?i("vault.editTitle",{name:f.entry.name}):i("vault.title")}),(0,x.jsx)(r5,{children:"list"===f.kind?i("vault.intro"):i("vault.formIntro")})]}),l&&0===_.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("vault.loading")}):null,s?(0,x.jsx)(dZ,{children:oA(i,s)}):null,"create"===f.kind||"edit"===f.kind?(0,x.jsx)(wf,{entry:"edit"===f.kind?f.entry:null,onCancel:function(){p({kind:"list"}),b(null)},onSaved:function(e){p({kind:"list"}),v(e),b(null)}}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:i("vault.entryCount",{count:_.length})}),(0,x.jsxs)(tr,{size:"sm",onClick:function(){return p({kind:"create"})},children:[(0,x.jsx)(dK,{}),i("vault.add")]})]}),m?(0,x.jsx)("div",{className:"rounded-xl bg-emerald-500/10 px-3 py-2 text-sm text-emerald-600 dark:text-emerald-400",children:m.map(function(e){return(0,x.jsx)("p",{children:oA(i,e)},e.key+e.scope)})}):null,y?(0,x.jsx)(dZ,{children:oA(i,y)}):null,0===_.length?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:i("vault.empty")}):(0,x.jsx)("ul",{className:"max-h-80 divide-y overflow-y-auto rounded-xl border",children:_.map(function(e){var t,n,r;return(0,x.jsxs)("li",{className:"px-4 py-3",children:[(0,x.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:e.name}),e.apiKeyConfigured?(0,x.jsx)(tb,{variant:"secondary",children:i("vault.keyConfigured")}):(0,x.jsx)(tb,{variant:"outline",children:i("vault.keyMissing")}),(0,x.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:(t=e.updatedAt,n=o,Number.isNaN((r=new Date(t)).getTime())?t:r.toLocaleString(n))})]}),e.notes?(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.notes}):null,e.endpoints.length>0?(0,x.jsx)("ul",{className:"mt-2 space-y-1",children:e.endpoints.map(function(e){return(0,x.jsxs)("li",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5",children:[(0,x.jsx)("code",{className:"font-mono text-xs",children:e.key}),(0,x.jsx)("span",{className:"break-all font-mono text-[11px] text-muted-foreground",children:e.baseUrl})]},e.key)})}):(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i("vault.noEndpoints")})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":void 0!==E[e.id]?i("vault.hide",{name:e.name}):i("vault.reveal",{name:e.name}),onClick:function(){wv(function(){var t;return wx(this,function(n){switch(n.label){case 0:if(void 0!==E[e.id])return I(function(t){var n=wy({},t);return delete n[e.id],n}),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,A(e.id)];case 2:return t=n.sent().apiKey,I(function(n){var r,o;return r=wy({},n),o=null!=(o=wg({},e.id,t))?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r}),[3,4];case 3:return b(oE(n.sent(),"vault.revealFailed")),[3,4];case 4:return[2]}})})()},children:void 0!==E[e.id]?(0,x.jsx)(xX,{}):(0,x.jsx)(xJ,{})}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":i("vault.edit",{name:e.name}),onClick:function(){p({kind:"edit",entry:e}),b(null)},children:(0,x.jsx)(xQ,{})}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":i("vault.delete",{name:e.name}),onClick:function(){N(null),S(e)},children:(0,x.jsx)(x0,{className:"text-destructive"})})]})]}),void 0!==E[e.id]?(0,x.jsx)("p",{className:"mt-2 break-all rounded-lg bg-muted/60 px-3 py-2 font-mono text-xs",children:E[e.id]}):null]},e.id)})})]}),"list"===f.kind?(0,x.jsx)(r3,{children:(0,x.jsx)(tr,{variant:"outline",onClick:function(){return r(!1)},children:i("vault.close")})}):null]}),(0,x.jsx)(ap,{open:null!==j,onOpenChange:function(e){return!e&&S(null)},children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:i("vault.deleteTitle")}),(0,x.jsx)(aI,{children:i("vault.deleteBody",{name:null!=(t=null==j?void 0:j.name)?t:""})})]}),C?(0,x.jsx)(dZ,{children:oA(i,C)}):null,(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:i("common.cancel")}),(0,x.jsx)(aA,{onClick:function(e){e.preventDefault(),j&&wv(function(){return wx(this,function(e){switch(e.label){case 0:N(null),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,u(j.id)];case 2:return e.sent(),S(null),v([{key:"vault.deleted"}]),[3,4];case 3:return N(oE(e.sent(),"vault.deleteFailed")),[3,4];case 4:return[2]}})})()},children:i("common.delete")})]})]})})]})}function wk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wj(e,t){if(e){if("string"==typeof e)return wk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wk(e,t)}}var wS={favoriteInvalidFacts:"favorites.validation.invalidFacts",favoriteDuplicateConnection:"favorites.validation.duplicateConnection",favoriteDefaultRequired:"favorites.scheme.defaultRemoved",favoriteInvalidBinding:"favorites.scheme.invalidBinding"},wO=function(e){return"reasoningSupported"===e?"reasoning":e};function wC(e,t){var n,r={fields:{},cards:{},global:[]},o=!0,i=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(o=(l=s.next()).done);o=!0){var c,u=l.value,d=function(e){if("custom"===e.code){var t;return null!=(t=wS[e.message])?t:"favorites.invalid"}return"too_small"===e.code||"invalid_type"===e.code?"favorites.validation.required":"favorites.validation.invalidValue"}(u),f=(c=u.path,function(e){if(Array.isArray(e))return e}(c)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),3!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(c)||wj(c,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=f[0],h=f[1],m=f[2];if("name"===p)r.fields["favorite-name"]=d;else if("notes"===p)r.fields["favorite-notes"]=d;else if("defaultConnectionId"===p)r.fields["favorite-default-model"]=d;else if("defaults"===p)r.fields["string"==typeof h?"favorite-".concat(wO(h)):"favorite-reasoning"]=d;else if("preferences"===p)r.fields["favorite-effort"]=d;else if("connections"===p&&"number"==typeof h){var v,g,y,b,x,w=e.connections[h];if(!w){r.global.push(d);continue}v=r,g=w.id,y=m,b=u.path[3],x=d,void 0===y?v.cards[g]=x:"providerId"===y||"endpointKey"===y?v.fields["".concat(g,"-provider")]=x:"requestModelId"===y?v.fields["".concat(g,"-model")]=x:"protocol"===y||"protocols"===y?v.fields["".concat(g,"-protocol")]=x:"label"===y?v.fields["".concat(g,"-label")]=x:"factOverrides"===y&&"string"==typeof b?v.fields["".concat(g,"-").concat(wO(b))]=x:"preferenceOverrides"===y?v.fields["".concat(g,"-effort")]=x:v.cards[g]=x}else r.global.push(d)}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return r.global=function(e){if(Array.isArray(e))return wk(e)}(n=new Set(r.global))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||wj(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r}function wN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function wI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wN(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wA(e){var t=e.draft,n=e.setDraft,r=e.update,o=e.inferredFacts,i=e.fieldErrors,a=e.cardErrors,l=e.focusConnectionId,s=(0,to.Bd)().t,c=wI((0,w.useState)(""),2),u=c[0],d=c[1],f=function(e){return e.id===l||!!a[e.id]||Object.keys(i).some(function(t){return t.startsWith(e.id+"-")})},p=t.connections.filter(function(e){return f(e)||"".concat(e.label," ").concat(e.requestModelId).toLowerCase().includes(u.trim().toLowerCase())});return(0,x.jsxs)("div",{className:"space-y-6",children:[(0,x.jsxs)("section",{className:"space-y-4","aria-label":s("favorites.sharedCapabilities"),children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"font-semibold",children:s("favorites.sharedCapabilities")}),(0,x.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s("favorites.sharedCapabilitiesHint")})]}),(0,x.jsx)(fa,{id:"favorite",facts:t.defaults,effort:t.preferences.reasoningEffort,errors:i,onFacts:function(e){return n(function(t){var n,r,o,i;return r=xP({},e),o=xP({},t.preferences),!1===r.reasoningSupported&&(delete r.supportedReasoningEfforts,delete o.reasoningEffort),!o.reasoningEffort||(null==(n=r.supportedReasoningEfforts)?void 0:n.includes(o.reasoningEffort))||x_(t.defaults.supportedReasoningEfforts,r.supportedReasoningEfforts)||delete o.reasoningEffort,i=xE(xP({},t),{defaults:r,preferences:o}),xE(xP({},i),{connections:i.connections.map(function(e){return!1===(0,ta.Lk)(i,e).facts.reasoningSupported?xE(xP({},e),{factOverrides:xE(xP({},e.factOverrides),{supportedReasoningEfforts:null}),preferenceOverrides:xE(xP({},e.preferenceOverrides),{reasoningEffort:null})}):e})})})},onEffort:function(e){return n(function(t){return wE(wP({},t),{preferences:{reasoningEffort:ta.wl.optional().parse(e||void 0)}})})}})]}),t.connections.length?(0,x.jsxs)("section",{className:"space-y-3 border-t pt-5","aria-label":s("favorites.connectionCapabilities"),children:[(0,x.jsx)("h3",{className:"font-semibold",children:s("favorites.connectionCapabilities")}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("favorites.connectionCapabilitiesHint")}),(0,x.jsx)(i4,{"aria-label":s("favorites.scheme.searchModels"),placeholder:s("favorites.scheme.searchModels"),value:u,onChange:function(e){return d(e.target.value)}}),bT(p).map(function(e,c){var d;return(0,x.jsx)("div",{className:"rounded-xl border p-4",children:(0,x.jsx)(d0,{title:e[0].label||s("favorites.channelNumber",{count:c+1}),summary:s("favorites.scheme.selectedCount",{count:e.length}),forceOpen:!!u.trim()||e.some(f),triggerClassName:"h-auto w-full flex-wrap justify-start whitespace-normal px-0 text-left",children:e.map(function(c,u){var d,f=(0,ta.Lk)(t,c),p=Object.values(c.factOverrides).some(function(e){return void 0!==e})||void 0!==c.preferenceOverrides.reasoningEffort,h=!!a[c.id]||Object.keys(i).some(function(e){return e.startsWith(c.id+"-")}),m=Object.fromEntries(Object.entries(f.sources).map(function(e){var t=wI(e,2),n=t[0],r=t[1];return[n,s("favorite"===r?"favorites.inheritedValue":"connection"===r?"favorites.overriddenValue":"favorites.unspecifiedValue")]}));return(0,x.jsx)("div",{className:"rounded-xl border p-4",children:(0,x.jsxs)(d0,{title:c.requestModelId||s("favorites.channelNumber",{count:u+1}),summary:s(p?"favorites.overriddenValue":"favorites.inheritedValue"),defaultOpen:1===e.length,forceOpen:h||c.id===l,triggerClassName:"h-auto max-w-full flex-wrap justify-start whitespace-normal px-0 text-left",children:[(0,x.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:[c.requestModelId," \xb7 ",c.protocol]}),a[c.id]?(0,x.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:a[c.id]}):null,Object.keys(null!=(d=o[c.id])?d:{}).length?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:s("favorites.capabilitiesSource.preset")}):null,(0,x.jsx)(fa,{id:c.id,facts:f.facts,effort:f.preferences.reasoningEffort,errors:i,sourceHints:m,onFacts:function(e){var t=Object.fromEntries(Object.entries(e).filter(function(e){var t=wI(e,2),n=t[0];return JSON.stringify(t[1])!==JSON.stringify(f.facts[n])}).map(function(e){var t=wI(e,2),n=t[0],r=t[1];return[n,null!=r?r:null]}));r(c.id,{factOverrides:wP({},c.factOverrides,t)})},onEffort:function(e){return r(c.id,{preferenceOverrides:{reasoningEffort:e?ta.wl.parse(e):null}})}}),(0,x.jsx)(tr,{variant:"outline",size:"sm",disabled:!p,onClick:function(){n(function(e){return wE(wP({},e),{connections:e.connections.map(function(e){return e.id===c.id?wE(wP({},e),{factOverrides:{},preferenceOverrides:{}}):e})})})},children:s("favorites.resetInheritance")})]})},c.id)})})},null!=(d=e[0].groupId)?d:e[0].id)})]}):null]})}let w_=P("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);function wM(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function wT(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function wR(e){var t=e.className,n=wT(e,["className"]);return(0,x.jsx)("div",wM({"data-slot":"card",className:tt("rounded-2xl border bg-card text-card-foreground shadow-[0_12px_34px_-26px_rgb(36_39_70/0.38)]",t)},n))}function wz(e){var t=e.className,n=wT(e,["className"]);return(0,x.jsx)("div",wM({"data-slot":"card-title",className:tt("font-semibold leading-none tracking-tight",t)},n))}function wD(e){var t=e.className,n=wT(e,["className"]);return(0,x.jsx)("div",wM({"data-slot":"card-description",className:tt("text-sm text-muted-foreground",t)},n))}function wL(e){var t=e.className,n=wT(e,["className"]);return(0,x.jsx)("div",wM({"data-slot":"card-content",className:tt("p-5 pt-0",t)},n))}var wF=Object.defineProperty,wU=(e,t)=>wF(e,"name",{value:t,configurable:!0}),wH="Popover",[w$,wB]=tF(wH,[sh]),wK=sh(),[wq,wV]=w$(wH),wW=wU(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,l=wK(t),s=w.useRef(null),[c,u]=w.useState(!1),[d,f]=tQ({prop:r,defaultProp:o??!1,onChange:i,caller:wH});return(0,x.jsx)(sg,{...l,children:(0,x.jsx)(wq,{scope:t,contentId:tq(),triggerRef:s,open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:c,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:a,children:n})})},"Popover"),wG=w.forwardRef(wU(function(e,t){let{__scopePopover:n,...r}=e,o=wV("PopoverTrigger",n),i=wK(n),a=T(t,o.triggerRef),l=(0,x.jsx)(t5.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":w5(o.open),...r,ref:a,onClick:tT(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:(0,x.jsx)(sy,{asChild:!0,...i,children:l})},"PopoverTrigger")),wZ="PopoverPortal",[wY,wX]=w$(wZ,{forceMount:void 0}),wJ=wU(e=>{let{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=wV(wZ,t);return(0,x.jsx)(wY,{scope:t,forceMount:n,children:(0,x.jsx)(nA,{present:n||i.open,children:(0,x.jsx)(nN,{asChild:!0,container:o,children:r})})})},"PopoverPortal"),wQ="PopoverContent",w0=w.forwardRef(wU(function(e,t){let n=wX(wQ,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=wV(wQ,e.__scopePopover);return(0,x.jsx)(nA,{present:r||i.open,children:i.modal?(0,x.jsx)(w2,{...o,ref:t}):(0,x.jsx)(w3,{...o,ref:t})})},"PopoverContent")),w1=D("PopoverContent.RemoveScroll"),w2=w.forwardRef(wU(function(e,t){let n=wV(wQ,e.__scopePopover),r=w.useRef(null),o=T(t,r),i=w.useRef(!1);return w.useEffect(()=>{let e=r.current;if(e)return rS(e)},[]),(0,x.jsx)(rg,{as:w1,allowPinchZoom:!0,children:(0,x.jsx)(w4,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tT(e.onCloseAutoFocus,e=>{e.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:tT(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;i.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:tT(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),w3=w.forwardRef(wU(function(e,t){let n=wV(wQ,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return(0,x.jsx)(w4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let i=t.target;n.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})},"PopoverContentNonModal")),w4=w.forwardRef(wU(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:u,...d}=e,f=wV(wQ,n),p=wK(n);return nH(),(0,x.jsx)(nh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:(0,x.jsx)(nn,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,x.jsx)(sk,{"data-state":w5(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function w5(e){return e?"open":"closed"}wU(w5,"getState");var w6=/[\\\/_+.#"@\[\(\{&]/,w8=/[\\\/_+.#"@\[\(\{&]/g,w9=/[\s-]/,w7=/[\s-]/g;function ke(e){return e.toLowerCase().replace(w7," ")}var kt='[cmdk-group=""]',kn='[cmdk-group-items=""]',kr='[cmdk-item=""]',ko=`${kr}:not([aria-disabled="true"])`,ki="cmdk-item-select",ka="data-value",kl=(e,t,n)=>{var r;return r=e,function e(t,n,r,o,i,a,l){if(a===n.length)return i===t.length?1:.99;var s=`${i},${a}`;if(void 0!==l[s])return l[s];for(var c,u,d,f,p=o.charAt(a),h=r.indexOf(p,i),m=0;h>=0;)(c=e(t,n,r,o,h+1,a+1,l))>m&&(h===i?c*=1:w6.test(t.charAt(h-1))?(c*=.8,(d=t.slice(i,h-1).match(w8))&&i>0&&(c*=Math.pow(.999,d.length))):w9.test(t.charAt(h-1))?(c*=.9,(f=t.slice(i,h-1).match(w7))&&i>0&&(c*=Math.pow(.999,f.length))):(c*=.17,i>0&&(c*=Math.pow(.999,h-i))),t.charAt(h)!==n.charAt(a)&&(c*=.9999)),(c<.1&&r.charAt(h-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&r.charAt(h-1)!==o.charAt(a))&&.1*(u=e(t,n,r,o,h+1,a+2,l))>c&&(c=.1*u),c>m&&(m=c),h=r.indexOf(p,h+1);return l[s]=m,m}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,ke(r),ke(t),0,0,{})},ks=w.createContext(void 0),kc=w.createContext(void 0),ku=w.createContext(void 0),kd=w.forwardRef((e,t)=>{let n=kw(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=kw(()=>new Set),o=kw(()=>new Map),i=kw(()=>new Map),a=kw(()=>new Set),l=kb(e),{label:s,children:c,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:m=!1,vimBindings:v=!0,...g}=e,y=tq(),b=tq(),x=tq(),k=w.useRef(null),j=kS();kx(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,S.emit()}},[u]),kx(()=>{j(6,I)},[]);let S=w.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,a,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),N(),j(1,P);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(x);e?e.focus():null==(o=document.getElementById(y))||o.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=A())?void 0:e.id,S.emit()}),r||j(5,I),(null==(i=l.current)?void 0:i.value)!==void 0){null==(s=(a=l.current).onValueChange)||s.call(a,null!=t?t:"");return}}S.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),O=w.useMemo(()=>({value:(e,t,r)=>{var o;t!==(null==(o=i.current.get(e))?void 0:o.value)&&(i.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,C(t,r)),j(2,()=>{N(),S.emit()}))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),j(3,()=>{E(),N(),n.current.value||P(),S.emit()}),()=>{i.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&P(),S.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{i.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:s||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:k}),[]);function C(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:kl;return e?i(e,n.current.search,t):0}function N(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=o.current.get(n),i=0;r.forEach(t=>{i=Math.max(e.get(t),i)}),t.push([n,i])});let r=k.current;_().sort((t,n)=>{var r,o;let i=t.getAttribute("id"),a=n.getAttribute("id");return(null!=(r=e.get(a))?r:0)-(null!=(o=e.get(i))?o:0)}).forEach(e=>{let t=e.closest(kn);t?t.appendChild(e.parentElement===t?e:e.closest(`${kn} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${kn} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${kt}[${ka}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function P(){let e=_().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(ka);S.setState("value",t||void 0)}function E(){var e,t,a,s;if(!n.current.search||!1===l.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=C(null!=(t=null==(e=i.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(a=i.current.get(o))?void 0:a.keywords)?s:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[e,t]of o.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function I(){var e,t,n;let r=A();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(kt))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function A(){var e;return null==(e=k.current)?void 0:e.querySelector(`${kr}[aria-selected="true"]`)}function _(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(ko))||[])}function M(e){let t=_()[e];t&&S.setState("value",t.getAttribute(ka))}function T(e){var t;let n=A(),r=_(),o=r.findIndex(e=>e===n),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&S.setState("value",i.getAttribute(ka))}function R(e){let t=A(),n=null==t?void 0:t.closest(kt),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,kt):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,kt))?void 0:n.querySelector(ko);r?S.setState("value",r.getAttribute(ka)):T(e)}let z=()=>M(_().length-1),D=e=>{e.preventDefault(),e.metaKey?z():e.altKey?R(1):T(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?R(-1):T(-1)};return w.createElement(t5.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=g.onKeyDown)||t.call(g,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":v&&e.ctrlKey&&D(e);break;case"ArrowDown":D(e);break;case"p":case"k":v&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),M(0);break;case"End":e.preventDefault(),z();break;case"Enter":{e.preventDefault();let t=A();if(t){let e=new Event(ki);t.dispatchEvent(e)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:kC},s),kO(e,e=>w.createElement(kc.Provider,{value:S},w.createElement(ks.Provider,{value:O},e))))}),kf=w.forwardRef((e,t)=>{var n,r;let o=tq(),i=w.useRef(null),a=w.useContext(ku),l=w.useContext(ks),s=kb(e),c=null!=(r=null==(n=s.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;kx(()=>{if(!c)return l.item(o,null==a?void 0:a.id)},[c]);let u=kj(o,i,[e.value,e.children,i],e.keywords),d=w.useContext(kc),f=kk(e=>e.value&&e.value===u.current),p=kk(e=>!!c||!1===l.filter()||!e.search||e.filtered.items.get(o)>0);function h(){var e,t;m(),null==(t=(e=s.current).onSelect)||t.call(e,u.current)}function m(){d.setState("value",u.current,!0)}if(w.useEffect(()=>{let t=i.current;if(!(!t||e.disabled))return t.addEventListener(ki,h),()=>t.removeEventListener(ki,h)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:g,onSelect:y,forceMount:b,keywords:x,...k}=e;return w.createElement(t5.div,{ref:M(i,t),...k,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:m,onClick:v?void 0:h},e.children)}),kp=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,a=tq(),l=w.useRef(null),s=w.useRef(null),c=tq(),u=w.useContext(ks),d=kk(e=>!!o||!1===u.filter()||!e.search||e.filtered.groups.has(a));kx(()=>u.group(a),[]),kj(a,l,[e.value,e.heading,s]);let f=w.useMemo(()=>({id:a,forceMount:o}),[o]);return w.createElement(t5.div,{ref:M(l,t),...i,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&w.createElement("div",{ref:s,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),kO(e,e=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},w.createElement(ku.Provider,{value:f},e))))}),kh=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=w.useRef(null),i=kk(e=>!e.search);return n||i?w.createElement(t5.div,{ref:M(o,t),...r,"cmdk-separator":"",role:"separator"}):null}),km=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,i=w.useContext(kc),a=kk(e=>e.search),l=kk(e=>e.selectedItemId),s=w.useContext(ks);return w.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),w.createElement(t5.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":s.listId,"aria-labelledby":s.labelId,"aria-activedescendant":l,id:s.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),kv=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=w.useRef(null),a=w.useRef(null),l=kk(e=>e.selectedItemId),s=w.useContext(ks);return w.useEffect(()=>{if(a.current&&i.current){let e=a.current,t=i.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),w.createElement(t5.div,{ref:M(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:s.listId},kO(e,e=>w.createElement("div",{ref:M(a,s.listInnerRef),"cmdk-list-sizer":""},e)))}),kg=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:a,...l}=e;return w.createElement(r_,{open:n,onOpenChange:r},w.createElement(rD,{container:a},w.createElement(rF,{"cmdk-overlay":"",className:o}),w.createElement(rB,{"aria-label":e.label,"cmdk-dialog":"",className:i},w.createElement(kd,{ref:t,...l}))))}),ky=Object.assign(kd,{List:kv,Item:kf,Input:km,Group:kp,Separator:kh,Dialog:kg,Empty:w.forwardRef((e,t)=>kk(e=>0===e.filtered.count)?w.createElement(t5.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:w.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return w.createElement(t5.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},kO(e,e=>w.createElement("div",{"aria-hidden":!0},e)))})});function kb(e){let t=w.useRef(e);return kx(()=>{t.current=e}),t}var kx="u"<typeof window?w.useEffect:w.useLayoutEffect;function kw(e){let t=w.useRef();return void 0===t.current&&(t.current=e()),t}function kk(e){let t=w.useContext(kc),n=()=>e(t.snapshot());return w.useSyncExternalStore(t.subscribe,n,n)}function kj(e,t,n,r=[]){let o=w.useRef(),i=w.useContext(ks);return kx(()=>{var a;let l=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),s=r.map(e=>e.trim());i.value(e,l,s),null==(a=t.current)||a.setAttribute(ka,l),o.current=l}),o}var kS=()=>{let[e,t]=w.useState(),n=kw(()=>new Map);return kx(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function kO({asChild:e,children:t},n){let r;return e&&w.isValidElement(t)?w.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var kC={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};let kN=P("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),kP=P("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);function kE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||k_(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kA(e){return function(e){if(Array.isArray(e))return kE(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k_(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k_(e,t){if(e){if("string"==typeof e)return kE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kE(e,t)}}function kM(e){var t,n,r=e.value,o=e.options,i=e.onChange,a=e.placeholder,l=e.searchLabel,s=e.emptyHint,c=e.customLabel,u=e.getLabel,d=void 0===u?function(e){return e}:u,f=e.isOptionDisabled,p=e.disabledHint,h=e.disabled,m=e.trigger,v=e.selectedValues,g=function(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}(e,["value","options","onChange","placeholder","searchLabel","emptyHint","customLabel","getLabel","isOptionDisabled","disabledHint","disabled","trigger","selectedValues"]),y=kI((0,w.useState)(!1),2),b=y[0],k=y[1],j=kI((0,w.useState)(""),2),S=j[0],O=j[1],C=kA(new Set(kA(null!=v?v:[]).concat(kA(r?[r]:[]),kA(o)))),N=C.filter(function(e){return"".concat(d(e)," ").concat(e).toLowerCase().includes(S.toLowerCase())}),P=S.trim(),E=function(e){(null==f||!f(e))&&(i(e),v||k(!1))};return(0,x.jsxs)(wW,{open:b,onOpenChange:function(e){k(e),O("")},children:[(0,x.jsx)(wG,{asChild:!0,children:null!=m?m:(0,x.jsxs)(tr,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},g),n=n={variant:"outline",role:"combobox","aria-expanded":b,disabled:h,className:"h-10 w-full justify-between gap-3 px-3 py-2 text-left font-normal",children:[(0,x.jsx)("span",{className:tt("min-w-0 truncate",r?"font-mono":"text-muted-foreground"),children:r?d(r):a}),(0,x.jsx)(kN,{className:"shrink-0 text-muted-foreground"})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}),(0,x.jsx)(wJ,{children:(0,x.jsx)(w0,{align:"start",sideOffset:6,className:"z-[60] min-w-64 w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-xl",onEscapeKeyDown:function(e){return e.stopPropagation()},children:(0,x.jsxs)(ky,{label:l,shouldFilter:!1,loop:!0,className:"w-full",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 border-b px-3",children:[(0,x.jsx)(kP,{className:"size-4 shrink-0 text-muted-foreground"}),(0,x.jsx)(ky.Input,{"aria-label":l,placeholder:l,maxLength:120,value:S,onValueChange:O,className:"h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),(0,x.jsxs)(ky.List,{label:l,className:"max-h-64 overflow-y-auto overscroll-contain p-1.5",onWheel:function(e){return e.stopPropagation()},children:[N.length||P&&c?null:(0,x.jsx)("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:s}),N.map(function(e){var t=!!(null==f?void 0:f(e));return(0,x.jsxs)(ky.Item,{value:e,disabled:t,title:t?p:void 0,onSelect:function(){return E(e)},className:tt("flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2.5 text-sm data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground",t&&"cursor-not-allowed opacity-50 data-[selected=true]:bg-transparent"),children:[(0,x.jsx)(aY,{className:tt("size-4 shrink-0",!(v?v.includes(e):r===e)&&"invisible")}),(0,x.jsx)("span",{className:"min-w-0 flex-1 break-all",children:d(e)}),t&&p?(0,x.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:p}):null]},e)}),c&&P&&!C.includes(P)?(0,x.jsxs)(ky.Item,{value:P,onSelect:function(){return E(P)},className:"flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2.5 text-sm data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground",children:[(0,x.jsx)(dK,{className:"size-4 shrink-0"}),(0,x.jsx)("span",{className:"break-all",children:c(P)})]}):null]})]})})})]})}function kT(e){var t,n=e.catalog,r=e.loading,o=e.failed,i=e.disabled,a=e.hasHints,l=e.onRefresh,s=(0,to.Bd)().t,c=o||(null==n?void 0:n.ok)===!1;return(0,x.jsxs)("div",{className:"mt-1 flex min-h-8 flex-wrap items-center justify-between gap-x-3 gap-y-1",children:[(0,x.jsxs)("p",{role:"status",className:"flex items-center gap-1.5 text-muted-foreground text-xs",children:[r?(0,x.jsx)(c2,{className:"size-3.5 animate-spin"}):null,r?s("favorites.catalogLoading"):c?s(a?"favorites.catalogFallbackAvailable":"favorites.catalogAutoFailed"):n?(null==(t=n.models)?void 0:t.length)?s("favorites.catalogCount",{count:n.models.length}):s("favorites.noCatalogManual"):null]}),(0,x.jsxs)(tr,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-7 gap-1.5 px-1.5 text-primary text-xs",disabled:i||r,onClick:l,children:[(0,x.jsx)(c6,{className:"size-3.5"}),s(c?"favorites.catalogRetry":"favorites.catalogRefresh")]})]})}function kR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kz(e,t){if(e){if("string"==typeof e)return kR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kR(e,t)}}var kD={"openai-chat":"openaiChat","openai-responses":"openaiResponses","anthropic-messages":"anthropicMessages"};function kL(e){var t,n=e.connection,r=e.endpoint,o=e.fieldErrors,i=e.onChange,a=(0,to.Bd)().t,l=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||kz(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],c=l[1],u=(0,ta.Gl)(n),d=r?xg(r.baseUrl):void 0,f=!!d&&1===u.length&&u[0]===d,p=o["".concat(n.id,"-protocol")],h=!f&&s||!!p,m=function(e,t){var n=t?((function(e){if(Array.isArray(e))return kR(e)})(u)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||kz(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e]):u.filter(function(t){return t!==e});n.length&&i((0,ta.LK)(n))};return(0,x.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,x.jsxs)("div",{className:"flex items-start gap-3",children:[(0,x.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1",children:[h?null:(0,x.jsx)("p",{className:"text-xs font-medium",children:u.map(function(e){return a("favorites.protocolOptions.".concat(kD[e]))}).join(" \xb7 ")}),r?(0,x.jsx)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:r.baseUrl}):null]}),f||p?null:(0,x.jsx)(tr,{type:"button",variant:"link",size:"sm",className:"h-auto shrink-0 p-0 text-xs",onClick:function(){return c(!s)},children:a(s?"favorites.done":"favorites.changeProtocol")})]}),h?(0,x.jsxs)("fieldset",{className:"space-y-2",children:[(0,x.jsx)("legend",{className:"text-sm font-medium",children:a("favorites.protocol")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:a("favorites.protocolMultiHint")}),(0,x.jsx)("div",{className:"flex flex-wrap gap-3",children:ta.AW.options.map(function(e){var t=d===e;return(0,x.jsxs)("label",{className:"flex items-center gap-1.5 text-sm",children:[(0,x.jsx)(aX,{checked:u.includes(e),disabled:t||1===u.length&&u[0]===e,onCheckedChange:function(t){return m(e,!0===t)}}),a("favorites.protocolOptions.".concat(kD[e]))]},e)})}),(0,x.jsx)(i2,{id:"".concat(n.id,"-protocol"),children:p})]}):null]})}function kF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kU(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function kH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function k$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kB(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kK(e){return function(e){if(Array.isArray(e))return kH(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||kq(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kq(e,t){if(e){if("string"==typeof e)return kH(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kH(e,t)}}function kV(e){var t,n,r,o,i,a,l,s,c,u,d,f,p,h,m=e.connection,v=e.index,g=e.disabled,y=e.error,b=e.fieldErrors,k=void 0===b?{}:b,j=e.modelHints,S=e.onAddProvider,O=e.onChange,C=e.onRemove,N=e.models,P=e.onModelsChange,E=e.onModelSettings,I=(0,to.Bd)().t,A=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!!N&&v>0&&!!m.requestModelId))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||kq(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),_=A[0],M=A[1],T=null!=(h=iV(function(e){return e.providers}))?h:[],R=T.find(function(e){return e.id===m.providerId}),z=(n=m.providerId,r=m.endpointKey,o=!!R,i="".concat(n,"/").concat(r),a=iV(function(e){return e.favoriteCatalogs[i]}),l=iV(function(e){return e.loadFavoriteCatalog}),s=(0,w.useRef)(null),d=(u=function(e){if(Array.isArray(e))return e}(c=(0,w.useState)("idle"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(c)||function(e){if(e){if("string"==typeof e)return kF(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kF(e,2)}}(c)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],f=u[1],p=(0,w.useCallback)(function(){var e;return(e=function(){var e,t,o;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:null==(e=s.current)||e.abort(),s.current=t=new AbortController,f("loading"),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,l(n,r,t.signal)];case 2:return o=i.sent(),s.current===t&&f((null==o?void 0:o.ok)===!1?"failed":"idle"),[3,4];case 3:return i.sent(),s.current===t&&f("failed"),[3,4];case 4:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){kU(i,r,o,a,l,"next",e)}function l(e){kU(i,r,o,a,l,"throw",e)}a(void 0)})})()},[l,n,r]),(0,w.useEffect)(function(){return f("idle"),o&&r&&!iV.getState().favoriteCatalogs[i]&&p(),function(){var e;null==(e=s.current)||e.abort(),s.current=null}},[i,r,o,p]),{catalog:a,loading:"loading"===d,failed:"failed"===d,retry:p}),D=z.catalog,L=z.loading,F=z.failed,U=z.retry,H=m.label||(null==R?void 0:R.name)||I("favorites.channelNumber",{count:v+1}),$="".concat(m.id,"-label"),B=k[$],K=T.flatMap(function(e){return e.endpoints.map(function(t){return{value:"".concat(e.id,"/").concat(t.key),label:"".concat(e.name," \xb7 ").concat(t.label||t.key),providerId:e.id,endpointKey:t.key,protocol:xg(t.baseUrl)}})}),q=!!y||Object.keys(k).some(function(e){return e.startsWith("".concat(m.id,"-"))});return(0,x.jsxs)(wR,{className:tt("overflow-hidden",q&&"border-destructive"),children:[(0,x.jsxs)("div",{className:tt("bg-muted/25 px-4 py-2",(!_||q)&&"border-b"),children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary",children:(0,x.jsx)(bh,{className:"size-4"})}),(0,x.jsx)(i4,kB(k$({},i1($,B)),{"aria-label":I("favorites.label"),value:m.label,placeholder:(null==R?void 0:R.name)||I("favorites.channelNumber",{count:v+1}),maxLength:120,disabled:g,onChange:function(e){return O({label:e.target.value})},className:"h-auto w-auto min-w-24 max-w-56 flex-none border-transparent bg-transparent px-0 py-0 font-semibold text-sm shadow-none [field-sizing:content] hover:border-input focus-visible:border-ring/50"})),N?(0,x.jsxs)(tr,{variant:"ghost",size:"sm",className:"ml-auto gap-2","aria-expanded":!_,"aria-label":I("favorites.scheme.toggleConnection",{name:H}),onClick:function(){return M(!_)},children:[I("favorites.scheme.selectedCount",{count:N.filter(function(e){return e.requestModelId}).length}),(0,x.jsx)(tf,{className:tt("size-4 transition-transform",!_&&"rotate-180")})]}):null,(0,x.jsx)(tr,{variant:"ghost",size:"icon",disabled:g,"aria-label":I("favorites.removeChannelNamed",{name:H}),onClick:C,className:tt("shrink-0 text-muted-foreground hover:text-destructive",!N&&"ml-auto"),children:(0,x.jsx)(x0,{className:"size-4"})})]}),(0,x.jsx)(i2,{id:$,children:B})]}),y?(0,x.jsx)("p",{role:"alert",className:"border-b bg-destructive/5 px-4 py-2 text-destructive text-xs",children:y}):null,(0,x.jsxs)("fieldset",{hidden:_&&!q,disabled:g,className:"min-w-0 space-y-3 p-4",children:[(0,x.jsxs)("div",{className:tt("grid gap-4",!N&&"sm:grid-cols-2"),children:[(0,x.jsxs)("div",{className:tt("space-y-2",N&&"relative"),children:[(0,x.jsx)(fi,{id:"".concat(m.id,"-provider"),label:I("favorites.channelProvider"),value:m.providerId?"".concat(m.providerId,"/").concat(m.endpointKey):"",placeholder:I("favorites.chooseProvider"),options:K,error:k["".concat(m.id,"-provider")],onChange:function(e){var t=K.find(function(t){return t.value===e});t&&O(k$({providerId:t.providerId,endpointKey:t.endpointKey},t.protocol?(0,ta.LK)([t.protocol]):{}))}}),S?(0,x.jsx)(tr,{type:"button",variant:"link",size:"sm",className:tt("h-auto px-0 text-primary",N&&"absolute right-0 top-0 m-0 py-0 text-xs"),disabled:g,onClick:S,children:I("favorites.addProvider")}):null]}),(0,x.jsxs)("div",{children:[(0,x.jsx)(i0,{id:"".concat(m.id,"-model"),label:I(N?"favorites.scheme.modelMulti":"favorites.modelPicker"),hint:N?void 0:I("favorites.modelPickerHint"),error:k["".concat(m.id,"-model")],children:function(e){var t;return(0,x.jsx)(kM,kB(k$({},e),{value:N?"":m.requestModelId,selectedValues:null==N?void 0:N.map(function(e){return e.requestModelId}).filter(Boolean),options:kK(new Set(kK(null!=j?j:[]).concat(kK(null!=(t=null==D?void 0:D.models)?t:[])))),disabled:g,onChange:function(e){if(N&&P){var t=N.map(function(e){return e.requestModelId}).filter(Boolean);P(t.includes(e)?t.filter(function(t){return t!==e}):kK(t).concat([e]))}else O({requestModelId:e})},placeholder:I("favorites.modelPlaceholder"),searchLabel:I("favorites.modelSearch"),emptyHint:I("favorites.modelEmpty"),customLabel:function(e){return I("favorites.modelCustom",{value:e})}}),"".concat(m.providerId,"/").concat(m.endpointKey))}}),(0,x.jsx)(kT,{catalog:D,loading:L,failed:F,disabled:g||!R||!m.endpointKey,hasHints:!!(null==j?void 0:j.length),onRefresh:function(){U()}}),(null==N?void 0:N.some(function(e){return e.requestModelId}))?(0,x.jsx)("div",{className:"mt-3 rounded-lg bg-primary/[0.035] p-2",children:N.filter(function(e){return e.requestModelId}).map(function(e){return(0,x.jsxs)("div",{className:"flex min-h-8 min-w-0 items-center gap-3 px-2 py-0.5",children:[(0,x.jsx)(aX,{"aria-label":e.requestModelId,checked:!0,disabled:g,onCheckedChange:function(){return null==P?void 0:P(N.filter(function(t){return t.id!==e.id}).map(function(e){return e.requestModelId}).filter(Boolean))}}),(0,x.jsx)("span",{className:"min-w-0 break-all font-mono text-sm",children:e.requestModelId}),(0,x.jsx)(tr,{variant:"ghost",size:"icon",className:"ml-auto size-7 shrink-0","aria-label":I("favorites.scheme.modelSettings",{model:e.requestModelId}),onClick:function(){return null==E?void 0:E(e.id)},children:(0,x.jsx)(w_,{className:"size-4"})})]},e.id)})}):null]})]}),(0,x.jsx)(kL,{connection:m,endpoint:null==R?void 0:R.endpoints.find(function(e){return e.key===m.endpointKey}),fieldErrors:k,onChange:O})]})]})}function kW(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kG(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kZ(e){var t,n=e.draft,r=e.setDraft,o=e.providers,i=e.busy,a=e.fieldErrors,l=e.cardErrors,s=e.modelHints,c=e.openVault,u=e.update,d=e.addConnection,f=e.onModelSettings,p=e.selectModels,h=e.advanced,m=void 0===h||h,v=(0,to.Bd)().t;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,x.jsx)("h3",{className:"font-semibold",children:v("favorites.connections")}),(0,x.jsx)("p",{className:"min-w-0 truncate text-muted-foreground text-xs",children:v("favorites.channelHint")})]}),bT(n.connections).map(function(e,t){var o=e[0];return(0,x.jsx)(kV,{connection:o,index:t,disabled:i,models:e,onModelSettings:f,onModelsChange:function(t){return p(e,t)},error:l[o.id],fieldErrors:a,modelHints:null==s?void 0:s["".concat(o.providerId,"/").concat(o.endpointKey)],onAddProvider:function(){return c(o.id)},onChange:function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;u(l.id,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},onRemove:function(){var t,o,i,a;return r((t=new Set(e.map(function(e){return e.id})),i=(o=e[0])?(0,ta.Gl)(o):[],a=n.connections.flatMap(function(e){return t.has(e.id)?[]:o&&e.providerId===o.providerId&&e.endpointKey===o.endpointKey&&i.length?[bI({},e,(0,ta.LK)(b_((0,ta.Gl)(e)).concat(b_(i))))]:[e]}),bD(bA(bI({},n),{connections:a,defaultConnectionId:n.defaultConnectionId}))))}},o.id)}),n.connections.length?m?(0,x.jsx)(tr,{variant:"link",className:"h-auto px-0 text-primary",disabled:i||n.connections.length>=50,onClick:d,children:v("favorites.addConnection")}):null:(0,x.jsxs)("div",{className:"space-y-3 rounded-xl border border-dashed px-4 py-8 text-center",children:[(0,x.jsx)("p",{className:"text-muted-foreground text-sm",children:v("favorites.connectionsEmpty")}),(0,x.jsxs)("div",{className:"flex flex-wrap justify-center gap-2",children:[(0,x.jsx)(tr,{variant:"outline",disabled:i,onClick:d,children:v("favorites.addConnection")}),o.length?null:(0,x.jsx)(tr,{variant:"ghost",disabled:i,onClick:function(){return c(null)},children:v("favorites.addProvider")})]})]}),m?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(fi,{id:"favorite-default-model",label:v("favorites.scheme.defaultModel"),value:null!=(t=n.defaultConnectionId)?t:"",placeholder:v("favorites.scheme.chooseDefault"),hint:v("favorites.scheme.defaultHint"),options:n.connections.filter(function(e){return e.requestModelId}).map(function(e){var t;return{value:e.id,label:"".concat(e.label||(null==(t=o.find(function(t){return t.id===e.providerId}))?void 0:t.name)||""," / ").concat(e.requestModelId)}}),onChange:function(e){return r(kG(kW({},n),{defaultConnectionId:e}))},error:n.defaultConnectionId&&!n.connections.some(function(e){return e.id===n.defaultConnectionId})?v("favorites.scheme.defaultRemoved"):void 0}),(0,x.jsx)(i0,{id:"favorite-notes",label:v("favorites.notesOptional"),error:a["favorite-notes"],children:function(e){return(0,x.jsx)(x6,kG(kW({},e),{className:"min-h-16",maxLength:4096,value:n.notes,onChange:function(e){return r(kG(kW({},n),{notes:e.target.value}))}}))}})]}):null]})}function kY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function kX(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function kJ(e){var t=e.editing,n=e.draft,r=e.setDraft,o=e.tab,i=e.setTab,a=e.advanced,l=e.onAdvanced,s=e.busy,c=e.error,u=(0,to.Bd)().t;return(0,x.jsxs)(r2,{className:"shrink-0 border-b px-6 py-4 pr-12",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-3",children:[(0,x.jsx)(r4,{children:u(t?"favorites.edit":"favorites.add")}),(0,x.jsx)(i0,{id:"favorite-name",label:u("favorites.name"),labelClassName:"sr-only",className:"w-64 max-w-full",error:c,children:function(e){var t;return(0,x.jsx)(i4,kX(kY({},e),{disabled:s,maxLength:120,placeholder:(null==(t=n.connections[0])?void 0:t.requestModelId)||u("favorites.autoName"),value:n.name,onChange:function(e){return r(function(t){return kX(kY({},t),{name:e.target.value})})}}))}}),a?(0,x.jsx)(un,{idPrefix:"favorite-editor",label:u("favorites.editorSections"),items:[{id:"connections"},{id:"capabilities"}],value:o,onChange:i,className:"flex gap-1 sm:ml-auto",tabClassName:"px-3 py-2 text-sm font-medium",children:function(e){return u("connections"===e.id?"favorites.connectionTab":"favorites.capabilitiesTab")}}):(0,x.jsxs)(tr,{variant:"ghost",size:"sm",className:"sm:ml-auto",title:u("favorites.advancedHint"),onClick:l,children:[(0,x.jsx)(w_,{}),u("favorites.advanced")]})]}),(0,x.jsx)(r5,{children:u("favorites.scheme.editorHint")})]})}var kQ=Object.defineProperty,k0=(e,t)=>kQ(e,"name",{value:t,configurable:!0}),k1=!1;function k2(){let[e,t]=w.useState(k1);return w.useEffect(()=>{k1||(k1=!0,t(!0))},[]),e}k0(k2,"useIsHydrated");var k3=k[" useSyncExternalStore ".trim().toString()];function k4(){return()=>{}}function k5(){return k3(k4,()=>!0,()=>!1)}k0(k4,"subscribe"),k0(k5,"useIsHydratedModern");var k6="function"==typeof k3?k5:k2,k8=Object.defineProperty,k9=(e,t)=>k8(e,"name",{value:t,configurable:!0}),k7="rovingFocusGroup.onEntryFocus",je={bubbles:!1,cancelable:!0},jt="RovingFocusGroup",[jn,jr,jo]=a1(jt),[ji,ja]=tF(jt,[jo]),[jl,js]=ji(jt),jc=w.forwardRef(k9(function(e,t){return(0,x.jsx)(jn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(jn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,x.jsx)(ju,{...e,ref:t})})})},"RovingFocusGroup")),ju=w.forwardRef(k9(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:s,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=w.useRef(null),p=T(t,f),h=lr(i),[m,v]=tQ({prop:a,defaultProp:l??null,onChange:s,caller:jt}),[g,y]=w.useState(!1),b=t8(c),k=jr(n),j=w.useRef(!1),[S,O]=w.useState(0);return w.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(k7,b),()=>e.removeEventListener(k7,b)},[b]),(0,x.jsx)(jl,{scope:n,orientation:r,dir:h,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(e=>v(e),[v]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>O(e=>e-1),[]),children:(0,x.jsx)(t5.div,{tabIndex:g||0===S?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:tT(e.onMouseDown,()=>{j.current=!0}),onFocus:tT(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!g){let t=new CustomEvent(k7,je);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);jm([e.find(e=>e.active),e.find(e=>e.id===m),...e].filter(Boolean).map(e=>e.ref.current),u)}}j.current=!1}),onBlur:tT(e.onBlur,()=>y(!1))})})},"RovingFocusGroupImpl")),jd=w.forwardRef(k9(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...l}=e,s=tq(),c=i||s,u=js("RovingFocusGroupItem",n),d=u.currentTabStopId===c,f=jr(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:m}=u,v=k6();return tH(()=>{if(v&&r)return p(),()=>h()},[v,r,p,h]),w.useEffect(()=>{if(!v&&r)return p(),()=>h()},[v,r,p,h]),(0,x.jsx)(jn.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:(0,x.jsx)(t5.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:tT(e.onMouseDown,e=>{r?u.onItemFocus(c):e.preventDefault()}),onFocus:tT(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:tT(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=jh(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?jv(n,r+1):n.slice(r+1)}setTimeout(()=>jm(n))}}),children:"function"==typeof a?a({isCurrentTabStop:d,hasTabStop:null!=m}):a})})},"RovingFocusGroupItem")),jf={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jp(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function jh(e,t,n){let r=jp(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return jf[r]}function jm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}k9(jp,"getDirectionAwareKey"),k9(jh,"getFocusIntent"),k9(jm,"focusFirst"),k9(jv,"wrapArray");var jg=Object.defineProperty,jy=(e,t)=>jg(e,"name",{value:t,configurable:!0}),jb="Radio",[jx,jw]=tF(jb),[jk,jj]=jx(jb);function jS(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:o,form:i,name:a,onCheck:l,required:s,value:c="on",internal_do_not_use_render:u}=e,[d,f]=w.useState(null),[p,h]=w.useState(null),m=w.useRef(!1),[v,g]=w.useReducer(e=>e+1,0),y=!d||!!i||!!d.closest("form"),b={checked:n,disabled:o,required:s,name:a,form:i,value:c,control:d,setControl:f,hasConsumerStoppedPropagationRef:m,userInteractionCount:v,onUserInteraction:g,isFormControl:y,bubbleInput:p,setBubbleInput:h,onCheck:jy(()=>l?.(),"onCheck")};return(0,x.jsx)(jk,{scope:t,...b,children:jP(u)?u(b):r})}jy(jS,"RadioProvider");var jO=w.forwardRef(jy(function({__scopeRadio:e,onClick:t,...n},r){let{checked:o,disabled:i,value:a,setControl:l,onCheck:s,hasConsumerStoppedPropagationRef:c,onUserInteraction:u,isFormControl:d,bubbleInput:f}=jj("RadioTrigger",e),p=T(r,l);return(0,x.jsx)(t5.button,{type:"button",role:"radio","aria-checked":o,"data-state":jE(o),"data-disabled":i?"":void 0,disabled:i,value:a,...n,ref:p,onClick:tT(t,e=>{o||(u(),s()),f&&d&&(c.current=e.isPropagationStopped(),c.current||e.stopPropagation())})})},"RadioTrigger")),jC=w.forwardRef(jy(function(e,t){let{__scopeRadio:n,forceMount:r,...o}=e,i=jj("RadioIndicator",n);return(0,x.jsx)(nA,{present:r||i.checked,children:(0,x.jsx)(t5.span,{"data-state":jE(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})},"RadioIndicator")),jN=w.forwardRef(jy(function({__scopeRadio:e,onClick:t,...n},r){let{control:o,checked:i,required:a,disabled:l,name:s,value:c,form:u,bubbleInput:d,setBubbleInput:f,hasConsumerStoppedPropagationRef:p,userInteractionCount:h}=jj("RadioBubbleInput",e),m=T(r,f),v=aM(o),g=w.useRef(!1),y=w.useRef(i),b=w.useRef(h);w.useEffect(()=>{if(!d)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=h!==b.current;b.current=h;let n=y.current!==i;y.current=i;let r=!(t&&p.current);if(n&&e){g.current=!t;let n=new Event("click",{bubbles:r});e.call(d,i),d.dispatchEvent(n),g.current=!1}},[d,i,p,h]);let k=w.useRef(i);return(0,x.jsx)(t5.input,{type:"radio","aria-hidden":!0,defaultChecked:k.current,required:a,disabled:l,name:s,value:c,form:u,...n,tabIndex:-1,ref:m,onClick:tT(t,e=>{g.current&&e.stopPropagation()}),style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function jP(e){return"function"==typeof e}function jE(e){return e?"checked":"unchecked"}jy(jP,"isFunction"),jy(jE,"getState");var jI=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],jA="RadioGroup",[j_,jM]=tF(jA,[ja,jw]),jT=ja(),jR=jw(),[jz,jD]=j_(jA),jL=w.forwardRef(jy(function(e,t){let{__scopeRadioGroup:n,name:r,form:o,defaultValue:i,value:a,required:l=!1,disabled:s=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...p}=e,h=jT(n),m=lr(u),[v,g]=tQ({prop:a,defaultProp:i??null,onChange:f,caller:jA}),[y,b]=w.useState(null),k=T(t,b),j=w.useRef(v);return w.useEffect(()=>{let e=o?y?.ownerDocument.getElementById(o):y?.closest("form");if(e instanceof HTMLFormElement){let t=jy(()=>g(j.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[y,o,g]),(0,x.jsx)(jz,{scope:n,name:r,form:o,required:l,disabled:s,value:v,onValueChange:g,children:(0,x.jsx)(jc,{asChild:!0,...h,orientation:c,dir:m,loop:d,children:(0,x.jsx)(t5.div,{role:"radiogroup","aria-required":l,"aria-orientation":c,"data-disabled":s?"":void 0,dir:m,...p,ref:k})})})},"RadioGroup"));function jF(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:o,internal_do_not_use_render:i}=e,a=jD("RadioGroupItemProvider",t),l=jR(t),s=a.disabled||r;return(0,x.jsx)(jS,{...l,checked:a.value===n,disabled:s,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:i,children:o})}jy(jF,"RadioGroupItemProvider");var jU=w.forwardRef(jy(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=jT(n),i=jR(n),{checked:a,disabled:l}=jj("RadioGroupItemTrigger",i.__scopeRadio),s=w.useRef(null),c=T(t,s),u=w.useRef(!1);return w.useEffect(()=>{let e=jy(e=>{jI.includes(e.key)&&(u.current=!0)},"handleKeyDown"),t=jy(()=>u.current=!1,"handleKeyUp");return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),(0,x.jsx)(jd,{asChild:!0,...o,focusable:!l,active:a,children:(0,x.jsx)(jO,{...i,...r,ref:c,onKeyDown:tT(r.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:tT(r.onFocus,()=>{u.current&&s.current?.click()})})})},"RadioGroupItemTrigger")),jH=w.forwardRef(jy(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:o,...i}=e;return(0,x.jsx)(jF,{__scopeRadioGroup:n,value:r,disabled:o,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(jU,{...i,ref:t,__scopeRadioGroup:n}),e&&(0,x.jsx)(j$,{__scopeRadioGroup:n})]})})},"RadioGroupItem")),j$=w.forwardRef(jy(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=jR(n);return(0,x.jsx)(jN,{...o,...r,ref:t})},"RadioGroupItemBubbleInput")),jB=w.forwardRef(jy(function(e,t){let{__scopeRadioGroup:n,...r}=e,o=jR(n);return(0,x.jsx)(jC,{...o,...r,ref:t})},"RadioGroupIndicator"));let jK=P("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function jq(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function jV(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function jW(e){var t=e.className,n=jV(e,["className"]);return(0,x.jsx)(jL,jq({className:tt("grid gap-3",t)},n))}function jG(e){var t,n,r=e.className,o=jV(e,["className"]);return(0,x.jsx)(jH,(t=jq({className:tt("size-4 shrink-0 rounded-full border border-input bg-background text-primary shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",r)},o),n=n={children:(0,x.jsx)(jB,{className:"flex items-center justify-center",children:(0,x.jsx)(jK,{className:"size-2 fill-current"})})},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}function jZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jY(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||jJ(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jX(e){return function(e){if(Array.isArray(e))return jZ(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||jJ(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jJ(e,t){if(e){if("string"==typeof e)return jZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jZ(e,t)}}function jQ(e){var t=e.connections,n=e.selectedIds,r=e.onChange,o=(0,to.Bd)().t,i=jY((0,w.useState)(""),2),a=i[0],l=i[1],s=bT(t),c=a.trim().toLowerCase(),u=function(e,t){var o=new Set(n),i=!0,a=!1,l=void 0;try{for(var s,c=e[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;t?o.add(u.id):o.delete(u.id)}}catch(e){a=!0,l=e}finally{try{i||null==c.return||c.return()}finally{if(a)throw l}}r(jX(o))},d=function(e){var t=new Set(n);t.has(e.id)?t.delete(e.id):t.add(e.id),r(jX(t))},f=s.map(function(e,t){var n=e.filter(function(e){return"".concat(e.label," ").concat(e.requestModelId).toLowerCase().includes(c)});return{group:e,index:t,entries:n}}).filter(function(e){return e.entries.length>0});return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[(0,x.jsx)("h4",{className:"text-sm font-medium",children:o("favorites.scheme.availableModels")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o("favorites.scheme.groupSelectionCount",{selected:n.filter(function(e){return t.some(function(t){return t.id===e})}).length,count:t.length})})]}),(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(kP,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,x.jsx)(i4,{"aria-label":o("favorites.scheme.searchModels"),placeholder:o("favorites.scheme.searchModels"),value:a,onChange:function(e){return l(e.target.value)},className:"pl-9"})]}),a?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o("favorites.scheme.filteredSelectionHint")}):null,f.length?null:(0,x.jsx)("p",{className:"rounded-xl border border-dashed bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground",children:o("workspace.noMatches")}),f.map(function(e){var t,r=e.group,i=e.index,a=e.entries;return(0,x.jsx)(j0,{title:r[0].label||o("favorites.channelNumber",{count:i+1}),group:r,entries:a,selectedIds:n,defaultOpen:1===s.length,forceOpen:!!c,onCheckAll:function(e){return u(a,e)},onToggle:d},null!=(t=r[0].groupId)?t:r[0].id)})]})}function j0(e){var t=e.title,n=e.group,r=e.entries,o=e.selectedIds,i=e.defaultOpen,a=e.forceOpen,l=e.onCheckAll,s=e.onToggle,c=(0,to.Bd)().t,u=jY((0,w.useState)(i),2),d=u[0],f=u[1],p=(0,w.useId)(),h=d||a,m=n.filter(function(e){return o.includes(e.id)}).length,v=r.filter(function(e){return o.includes(e.id)}).length,g=0!==v&&(v===r.length||"indeterminate"),y=new Set(r.map(function(e){return e.protocol}).filter(Boolean)).size>1;return(0,x.jsxs)("section",{className:"overflow-hidden rounded-xl border bg-card shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("button",{type:"button","aria-expanded":h,"aria-controls":p,onClick:function(){return f(!d)},className:"flex w-full items-center gap-2 bg-muted/35 px-3 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30",children:[(0,x.jsx)("span",{className:"min-w-0 truncate text-sm font-semibold text-primary",children:t}),(0,x.jsx)(tb,{variant:"secondary",className:"shrink-0 font-normal",children:c("favorites.scheme.groupSelectionCount",{selected:m,count:n.length})}),(0,x.jsx)(tf,{className:tt("ml-auto size-4 shrink-0 text-muted-foreground transition-transform",h&&"rotate-180")})]}),(0,x.jsxs)("div",{id:p,hidden:!h,className:"px-3 pb-3 pt-1",children:[(0,x.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 px-1 py-2.5 text-sm font-medium",children:[(0,x.jsx)(aX,{checked:g,onCheckedChange:function(e){return l(!0===e)}}),c("favorites.scheme.selection.all")]}),(0,x.jsx)("div",{className:"border-t"}),(0,x.jsx)("div",{className:"max-h-64 space-y-0.5 overflow-y-auto overscroll-contain pt-1",children:r.map(function(e){var t=o.includes(e.id);return(0,x.jsxs)("label",{className:tt("flex cursor-pointer items-center gap-3 rounded-lg px-1 py-2 text-sm transition-colors hover:bg-muted/40",t&&"bg-primary/[0.04]"),children:[(0,x.jsx)(aX,{checked:t,onCheckedChange:function(){return s(e)}}),(0,x.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,x.jsx)("span",{className:"block break-all font-mono text-[13px] leading-5",children:e.requestModelId}),y&&e.protocol?(0,x.jsx)("span",{className:"mt-0.5 block text-xs text-muted-foreground",children:e.protocol}):null]})]},e.id)})})]})]})}function j1(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j3(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){j2(e,t,n[t])})}return e}function j4(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function j5(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||j6(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j6(e,t){if(e){if("string"==typeof e)return j1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j1(e,t)}}function j8(e){var t=e.draft,n=e.setDraft,r=e.tool,o=e.groupId,i=e.onChange,a=(0,to.Bd)().t,l="codex"===r?"openai-responses":"anthropic-messages",s=bT(t.connections),c=s.filter(function(e){var t=j5(e,1)[0];return t&&(0,ta.Gl)(t).includes(l)});return c.length?(0,x.jsx)(fi,{id:"binding-".concat(r,"-connection"),label:a("favorites.scheme.useConnection"),value:o,options:c.map(function(e){var t,n=j5(e,1)[0];return{value:null!=(t=n.groupId)?t:n.id,label:n.label||n.requestModelId}}),placeholder:a("favorites.scheme.chooseConnection"),onChange:i}):(0,x.jsxs)("div",{className:"space-y-3 rounded-xl border bg-muted/30 p-4",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:a("favorites.scheme.protocolRequired",{tool:a("favorites.scheme.tools.".concat(r)),protocol:l})}),s.filter(function(e){var t;return(null==(t=e[0])?void 0:t.providerId)&&e.some(function(e){return e.requestModelId})}).map(function(e){return(0,x.jsx)(tr,{variant:"outline",className:"h-auto max-w-full whitespace-normal text-left",onClick:function(){var t,o,i=null!=(t=e[0].groupId)?t:e[0].id,a=null==(o=e.find(function(e){return e.requestModelId}))?void 0:o.id;n(function(t){return j4(j3({},t),{connections:t.connections.map(function(t){var n;return e.some(function(e){return e.id===t.id})?j3({},t,(0,ta.LK)(((function(e){if(Array.isArray(e))return j1(e)})(n=(0,ta.Gl)(t))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||j6(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([l]))):t}),toolBindings:j4(j3({},t.toolBindings),j2({},r,{connectionId:i,defaultModelId:a}))})})},children:a("favorites.scheme.enableProtocolOnConnection",{name:e[0].label||e[0].requestModelId,protocol:l})},e[0].id)}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:a("favorites.scheme.protocolConnectionHint")})]})}function j9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j7(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){j7(e,t,n[t])})}return e}function St(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Sn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||So(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(e){return function(e){if(Array.isArray(e))return j9(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||So(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function So(e,t){if(e){if("string"==typeof e)return j9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j9(e,t)}}function Si(e){var t,n,r,o,i,a,l,s,c,u,d,f,p,h=e.draft,m=e.setDraft,v=(0,to.Bd)().t,g=Sn((0,w.useState)("claude"),2),y=g[0],b=g[1],k=null!=(t=null==(d=h.toolBindings)?void 0:d[y])?t:{},j="kimi"===y||"dsh"===y,S="claude"===y?"anthropic-messages":"codex"===y?"openai-responses":void 0,O=bT(h.connections).filter(function(e){var t=Sn(e,1)[0];return t&&(j||"pi"===y||S&&(0,ta.Gl)(t).includes(S))}),C=h.connections.find(function(e){return e.id===h.defaultConnectionId}),N=C&&O.find(function(e){return e.some(function(e){return e.id===C.id})}),P=null!=(n=null!=(r=null!=(o=k.connectionId)?o:null==N||null==(f=N[0])?void 0:f.groupId)?r:null==N||null==(p=N[0])?void 0:p.id)?n:"",E=null!=(i=O.find(function(e){var t,n=Sn(e,1)[0];return(null!=(t=null==n?void 0:n.groupId)?t:null==n?void 0:n.id)===P}))?i:[],I=(j?O.flat():E).filter(function(e){return e.requestModelId}),A=I.map(function(e){return{value:e.id,label:j?"".concat(e.label," / ").concat(e.requestModelId):e.requestModelId}}),_=null!=(a=k.defaultModelId)?a:h.defaultConnectionId,M=I.find(function(e){return e.id===_}),T=M?(0,ta.Lk)(h,M).facts:void 0,R=(null==T?void 0:T.reasoningSupported)===!1?[]:null==T?void 0:T.supportedReasoningEfforts,z=null!=(l=k.modelIds)?l:I.map(function(e){return e.id}),D=function(e){return m(function(t){var n;return St(Se({},t),{toolBindings:St(Se({},t.toolBindings),j7({},y,Se({},null==(n=t.toolBindings)?void 0:n[y],e)))})})};return(0,x.jsxs)("section",{className:"space-y-5","aria-label":v("favorites.scheme.toolSettings"),children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-lg font-semibold",children:v("favorites.scheme.toolSettings")}),(0,x.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:v("favorites.scheme.toolHint")})]}),(0,x.jsx)(un,{idPrefix:"template-tools",label:v("favorites.scheme.toolSettings"),items:["claude","codex","kimi","dsh"].map(function(e){return{id:e}}),value:y,onChange:function(e){return b(e)},className:"flex flex-wrap gap-1 border-b pb-2",tabClassName:"px-3 py-2 text-sm",children:function(e){return v("favorites.scheme.tools.".concat(e.id))}}),(0,x.jsxs)(uo,{idPrefix:"template-tools",value:y,className:"space-y-5",children:[j?null:(0,x.jsx)(j8,{draft:h,setDraft:m,tool:y,groupId:P,onChange:function(e){var t,n,r=null!=(t=O.find(function(t){var n,r=Sn(t,1)[0];return(null!=(n=null==r?void 0:r.groupId)?n:null==r?void 0:r.id)===e}))?t:[];D({connectionId:e,defaultModelId:r.some(function(e){return e.id===h.defaultConnectionId})||null==(n=r.find(function(e){return e.requestModelId}))?void 0:n.id,modelIds:void 0,tiers:void 0})}}),I.length?(0,x.jsxs)(x.Fragment,{children:["claude"===y?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(jW,{value:null!=(s=k.mode)?s:"default",onValueChange:function(e){return D({mode:"tiers"===e?"tiers":"default"})},children:["default","tiers"].map(function(e){return(0,x.jsxs)("label",{className:"flex items-center gap-3 text-sm",children:[(0,x.jsx)(jG,{value:e}),v("favorites.scheme.".concat(e))]},e)})}),"tiers"===k.mode?(0,x.jsxs)("div",{className:"space-y-4",children:[["opus","sonnet","haiku"].map(function(e){var t,n;return(0,x.jsx)(fi,{id:"binding-".concat(e),label:v("favorites.scheme.tier.".concat(e)),value:null!=(t=null==(n=k.tiers)?void 0:n[e])?t:"",placeholder:v("favorites.scheme.chooseModel"),options:A,onChange:function(t){return D({tiers:St(Se({},k.tiers),j7({},e,t))})}},e)}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:v("favorites.scheme.sameConnection")}),(0,x.jsx)(tr,{variant:"link",className:"px-0",disabled:!I.some(function(e){return e.id===_}),onClick:function(){return D({tiers:{opus:_,sonnet:_,haiku:_}})},children:v("favorites.scheme.allDefault")})]}):null]}):(0,x.jsx)(jQ,{connections:I,selectedIds:z,onChange:function(e){return D({modelIds:e})}}),(0,x.jsx)(fi,{id:"binding-".concat(y,"-default"),label:v("favorites.scheme.startModel"),value:null!=(c=k.defaultModelId)?c:"inherit",options:[{value:"inherit",label:v("favorites.scheme.followTemplate")}].concat(Sr(A.filter(function(e){return"claude"===y||z.includes(e.value)}))),onChange:function(e){return D({defaultModelId:"inherit"===e?void 0:e})},error:I.some(function(e){return e.id===_&&("claude"===y||z.includes(e.id))})?void 0:v("favorites.scheme.defaultIncompatible")}),"codex"===y||"dsh"===y?(0,x.jsx)(fi,{id:"binding-".concat(y,"-effort"),label:v("favorites.scheme.reasoningEffort"),value:null!=(u=k.reasoningEffort)?u:"inherit",options:[{value:"inherit",label:v("favorites.scheme.followModel")}].concat(Sr(ta.wl.options.filter(function(e){return(null==R?void 0:R.includes(e))||e===k.reasoningEffort}).filter(function(e){return"codex"!==y||["minimal","low","medium","high","xhigh"].includes(e)}).map(function(e){return{value:e,label:e}}))),onChange:function(e){return D({reasoningEffort:"inherit"===e?void 0:ta.wl.parse(e)})}}):null]}):O.length?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:v("favorites.scheme.noCompatible")}):null]})]})}function Sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function Ss(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Sc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||Sd(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Su(e){return function(e){if(Array.isArray(e))return Sa(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Sd(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(e,t){if(e){if("string"==typeof e)return Sa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sa(e,t)}}function Sf(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ss(Sl({id:crypto.randomUUID(),label:"",providerId:e,endpointKey:t},(0,ta.LK)(["openai-responses"])),{requestModelId:"",factOverrides:{},preferenceOverrides:{}})}function Sp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sh(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function Sm(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Sh(i,r,o,a,l,"next",e)}function l(e){Sh(i,r,o,a,l,"throw",e)}a(void 0)})}}function Sv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function Sg(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Sy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||Sb(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sb(e,t){if(e){if("string"==typeof e)return Sp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sp(e,t)}}function Sx(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function Sw(e,t){var n;return Sg(Sv({},e),{name:e.name||(null==(n=e.connections[0])?void 0:n.requestModelId),connections:e.connections.map(function(e){var n;return Sg(Sv({},e),{label:e.label||(null==(n=t.find(function(t){return t.id===e.providerId}))?void 0:n.name)||e.requestModelId})})})}function Sk(e){var t,n,r,o,i,a,l,s,c,u,d,f,p=e.favorite,h=e.initialDraft,m=e.modelHints,v=e.hintFacts,g=e.guided,y=e.onClose,b=e.onSaved,k=(0,to.Bd)().t,j=iV(function(e){return e.saveFavorite}),S=iV(function(e){return e.loadFavoriteCatalog}),O=iV(function(e){return e.setNotice}),C=(t=null!=p?p:h,r=null!=(n=iV(function(e){return e.providers}))?n:[],i=(o=Sc((0,w.useState)(function(){var e,n,r,o,i,a=null!=t?t:{name:"",notes:"",defaults:{},preferences:{},connections:[]};return bD(Ss(Sl({},a),{defaultConnectionId:null!=(e=a.defaultConnectionId)?e:null==(i=a.connections.find(function(e){return e.requestModelId}))?void 0:i.id,defaults:Ss(Sl({},a.defaults),{contextWindow:null!=(n=a.defaults.contextWindow)?n:xI.contextWindow,maxOutputTokens:null!=(r=a.defaults.maxOutputTokens)?r:xI.maxOutputTokens,reasoningSupported:null!=(o=a.defaults.reasoningSupported)?o:xI.reasoningSupported})}))}),2))[0],a=o[1],l=(0,w.useRef)(JSON.stringify(i)),s=(0,w.useRef)({}),u=(c=Sc((0,w.useState)(void 0),2))[0],d=c[1],f=(0,w.useRef)([]),(0,w.useEffect)(function(){if(void 0!==u){var e,t=null==n?void 0:n.find(function(e){return!f.current.includes(e.id)});if(t){var r=t.endpoints[0],o=null!=(e=null==r?void 0:r.key)?e:"",i=r?xg(r.baseUrl):void 0;a(function(e){if(null===u)return Ss(Sl({},e),{connections:Su(e.connections).concat([Sl({},Sf(t.id,o),i?(0,ta.LK)([i]):{})])});var n=e.connections.find(function(e){return e.id===u}),r=e,a=!0,l=!1,c=void 0;try{for(var d,f=e.connections.filter(function(e){var t,r;return(null!=(t=e.groupId)?t:e.id)===(null!=(r=null==n?void 0:n.groupId)?r:null==n?void 0:n.id)})[Symbol.iterator]();!(a=(d=f.next()).done);a=!0){var p=d.value,h=xM(r,p.id,Sl({providerId:t.id,endpointKey:o},i?(0,ta.LK)([i]):{}),s.current);s.current=h.inferred,r=h.draft}}catch(e){l=!0,c=e}finally{try{a||null==f.return||f.return()}finally{if(l)throw c}}return r}),d(void 0)}}},[n,u]),{draft:i,setDraft:a,providers:r,vaultTarget:u,setVaultTarget:d,openVault:function(e){f.current=r.map(function(e){return e.id}),d(e)},addConnection:function(){return a(function(e){return Ss(Sl({},e),{connections:Su(e.connections).concat([Sf()])})})},update:function(e,t){return a(function(n){var o,i,a=Sl({},n.connections.find(function(t){return t.id===e}),t),l=null!=(o=a.requestModelId)?o:"",c=null==m?void 0:m["".concat(a.providerId,"/").concat(a.endpointKey)],u=null!=(i=!m||(null==c?void 0:c.includes(l))?null==v?void 0:v[l]:void 0)?i:a.providerId&&a.endpointKey?xb(r,a.providerId,a.endpointKey,l):void 0,d=xM(n,e,t,s.current,u);return s.current=d.inferred,d.draft})},selectModels:function(e,t){return a(function(n){var o=(d=null!=(c=(u=e[0]).groupId)?c:u.id,f=(t.length?t:[""]).map(function(t,n){var r=e.find(function(e){return e.requestModelId===t});return r?bA(bI({},r),{groupId:d}):bA(bI({},u),{id:u.requestModelId||0!==n?crypto.randomUUID():u.id,groupId:d,requestModelId:t,factOverrides:{},preferenceOverrides:{}})}),p=new Set(e.map(function(e){return e.id})),h=n.connections.flatMap(function(e){return e.id===u.id?f:p.has(e.id)?[]:[e]}),bD(bA(bI({},n),{connections:h,defaultConnectionId:n.defaultConnectionId}))),i=!0,a=!1,l=void 0;try{for(var c,u,d,f,p,h,g,y=o.connections[Symbol.iterator]();!(i=(g=y.next()).done);i=!0)!function(){var e,t=g.value;if(!(!t.requestModelId||n.connections.some(function(e){return e.id===t.id&&e.requestModelId===t.requestModelId}))){var i=null==m?void 0:m["".concat(t.providerId,"/").concat(t.endpointKey)],a=null!=(e=!m||(null==i?void 0:i.includes(t.requestModelId))?null==v?void 0:v[t.requestModelId]:void 0)?e:xb(r,t.providerId,t.endpointKey,t.requestModelId),l=Ss(Sl({},o),{connections:o.connections.map(function(e){return e.id===t.id?Ss(Sl({},e),{requestModelId:""}):e})}),c=xM(l,t.id,{requestModelId:t.requestModelId},s.current,a);o=c.draft,s.current=c.inferred}}()}catch(e){a=!0,l=e}finally{try{i||null==y.return||y.return()}finally{if(a)throw l}}return o})},inferredFacts:s.current,dirty:JSON.stringify(i)!==l.current}),N=C.draft,P=C.setDraft,E=C.providers,I=C.vaultTarget,A=C.setVaultTarget,_=C.openVault,M=C.addConnection,T=C.update,R=C.selectModels,z=C.inferredFacts,D=C.dirty,L=Sy((0,w.useState)("connections"),2),F=L[0],U=L[1],H=Sy((0,w.useState)(!(void 0!==g&&g)),2),$=H[0],B=H[1],K=Sy((0,w.useState)(),2),q=K[0],V=K[1],W=Sy((0,w.useState)(""),2),G=W[0],Z=W[1],Y=Sy((0,w.useState)(!1),2),X=Y[0],J=Y[1],Q=Sy((0,w.useState)(!1),2),ee=Q[0],et=Q[1],en=Sy((0,w.useState)(!1),2),er=en[0],eo=en[1],ei=function(){X||void 0!==I||(D?eo(!0):y())},ea=ta.Hr.safeParse(Sw(N,E)),el=ea.success?{fields:{},cards:{},global:[]}:wC(N,ea.error.issues.filter(function(e){return ee||"custom"===e.code})),es=Object.fromEntries(Object.entries(el.fields).map(function(e){var t=Sy(e,2);return[t[0],k(t[1])]})),ec=Object.fromEntries(Object.entries(el.cards).map(function(e){var t=Sy(e,2);return[t[0],k(t[1])]}));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r_,{open:!0,onOpenChange:function(e){return!e&&ei()},children:(0,x.jsxs)(r1,{className:"flex h-[min(960px,94dvh)] w-[96vw] max-w-7xl flex-col gap-0 overflow-hidden p-0",children:[(0,x.jsx)(kJ,{editing:!!p,draft:N,setDraft:P,tab:F,setTab:U,advanced:$,onAdvanced:function(){return B(!0)},busy:X,error:es["favorite-name"]}),(0,x.jsxs)("fieldset",{disabled:X,className:"min-h-0 min-w-0 flex-1 overflow-y-auto px-6 py-5",children:[(0,x.jsx)("div",{hidden:"connections"!==F,children:(0,x.jsxs)(uo,{idPrefix:"favorite-editor",value:"connections",className:"grid gap-8 lg:grid-cols-[minmax(0,1.35fr)_minmax(0,1fr)]",children:[(0,x.jsx)("div",{className:"min-w-0 space-y-3",children:(0,x.jsx)(kZ,{draft:N,setDraft:P,providers:E,busy:X,fieldErrors:es,cardErrors:ec,modelHints:m,advanced:$,openVault:_,update:T,addConnection:M,selectModels:R,onModelSettings:function(e){V(e),B(!0),U("capabilities")}})}),(0,x.jsx)("div",{className:"min-w-0 border-t pt-6 lg:border-l lg:border-t-0 lg:pl-8 lg:pt-0",children:(0,x.jsx)(Si,{draft:N,setDraft:P})})]})}),(0,x.jsx)("div",{hidden:"capabilities"!==F,children:(0,x.jsx)(uo,{idPrefix:"favorite-editor",value:"capabilities",children:(0,x.jsx)(wA,{draft:N,setDraft:P,update:T,inferredFacts:z,fieldErrors:es,cardErrors:ec,focusConnectionId:q})})})]}),(0,x.jsxs)("div",{className:"shrink-0 space-y-3 border-t bg-muted/20 px-6 py-3",children:[G?(0,x.jsx)("p",{role:"alert",className:"text-destructive",children:G}):null,(0,x.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,x.jsx)(tr,{variant:"outline",disabled:X,onClick:ei,children:k("common.cancel")}),(0,x.jsx)(tr,{disabled:X,onClick:function(){Sm(function(){var e,t,n,r,o,i,a,l,s,c,u,d,f;return Sx(this,function(h){var m;switch(h.label){case 0:if(e=bD(Sw(N,E)),!(t=ta.Hr.safeParse(e)).success){if(et(!0),r=wC(e,t.error.issues),U(o=t.error.issues.some(function(e){return"connections"===e.path[0]&&["providerId","endpointKey","requestModelId","label","protocol"].includes(String(e.path[2]))})||Object.values(r.cards).includes("favorites.validation.duplicateConnection")||r.fields["favorite-name"]||r.fields["favorite-notes"]||t.error.issues.some(function(e){return["defaultConnectionId","toolBindings"].includes(String(e.path[0]))})?"connections":"capabilities"),("capabilities"===o||r.fields["favorite-notes"]||t.error.issues.some(function(e){return"defaultConnectionId"===e.path[0]}))&&B(!0),(i=t.error.issues.filter(function(e){return"toolBindings"===e.path[0]})).length)return a=((function(e){if(Array.isArray(e))return Sp(e)})(m=new Set(i.map(function(e){var t;return k("favorites.scheme.tools.".concat(String(null!=(t=e.path[1])?t:"claude")))})))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(m)||Sb(m)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).join(k("favorites.scheme.toolListSep")),Z(k("favorites.scheme.invalidBindingTools",{tools:a})),[2];return Z(Object.keys(r.fields).length||Object.keys(r.cards).length?"":k(null!=(n=r.global[0])?n:"favorites.invalid")),[2]}J(!0),h.label=1;case 1:return h.trys.push([1,3,4,5]),[4,j(t.data,p)];case 2:return c=h.sent(),d=null!=(l=null==(u=null==(s=iV.getState().favorites)?void 0:s.find(function(e){return e.id===c.id}))?void 0:u.references.some(function(e){return e.needsUpdate||e.diverged}))&&l,f=p?d?"review":null:"configure",null==b||b(c,null),xq.success(k("favorites.nextStep.saved",{name:c.name}),{action:f?{label:k("configure"===f?"favorites.configure":"favorites.nextStep.reviewAffected"),onClick:function(){return null==b?void 0:b(c,f)}}:void 0}),y(),Sm(function(){var e,t;return Sx(this,function(n){switch(n.label){case 0:if(!(e=c.connections.filter(function(e){return e.providerId&&e.endpointKey})).length)return[2];return[4,Promise.allSettled(e.map(function(e){return S(e.providerId,e.endpointKey)}))];case 1:return(t=n.sent().filter(function(e){return"rejected"===e.status||!e.value||!1===e.value.ok}).length)&&O([{key:"warning.favorite.probeFailed",params:{count:t}}]),[2]}})})(),[3,5];case 3:return Z(oA(k,oP(h.sent()))),[3,5];case 4:return J(!1),[7];case 5:return[2]}})})()},children:k("favorites.saveFavorite")})]})]})]})}),(0,x.jsx)(ww,{open:void 0!==I,onOpenChange:function(e){e||A(void 0)}}),(0,x.jsx)(xm,{open:er,onOpenChange:eo,onDiscard:y})]})}function Sj(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function SO(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function SC(e){return function(e){if(Array.isArray(e))return Sj(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return Sj(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Sj(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var SN=[{role:"Sonnet",modelKey:"sonnetModel",nameKey:"sonnetModelName",oneMKey:"sonnetModel1m"},{role:"Opus",modelKey:"opusModel",nameKey:"opusModelName",oneMKey:"opusModel1m"},{role:"Fable",modelKey:"fableModel",nameKey:"fableModelName",oneMKey:"fableModel1m"},{role:"Haiku",modelKey:"haikuModel",nameKey:"haikuModelName",oneMKey:null}],SP="subagentModel",SE="subagentModel1m",SI=new Set(SC(SN.flatMap(function(e){var t=e.modelKey,n=e.nameKey,r=e.oneMKey;return r?[t,n,r]:[t,n]})).concat([SP,SE])),SA="md:grid-cols-[6.5rem_minmax(0,1fr)_minmax(0,1fr)_8.5rem]",S_="grid gap-2 rounded-lg border bg-card/70 p-3 ".concat(SA," md:items-start md:gap-3 md:border-0 md:bg-transparent md:p-0");function SM(e){var t,n=e.fields,r=e.values,o=e.errors,i=e.modelOptions,a=e.onChange,l=e.fetchAction,s=(0,to.Bd)().t,c=new Map(n.map(function(e){return[e.key,e]})),u=c.get(SP);return(0,x.jsxs)("section",{"data-slot":"claude-model-mapping",className:"space-y-4 rounded-xl border bg-muted/15 p-4 sm:col-span-2 sm:p-5",children:[(0,x.jsxs)("div",{className:"space-y-1",children:[(0,x.jsx)("h3",{className:"text-base font-semibold",children:s("profile.mapping.title")}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("profile.mapping.intro")})]}),(0,x.jsxs)("div",{className:"grid items-center gap-3 px-1 text-xs font-medium text-muted-foreground ".concat(SA),children:[(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.role")}),(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.displayName")}),(0,x.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[s("profile.mapping.actualModel"),l]}),(0,x.jsx)("span",{className:"hidden md:block",children:s("profile.mapping.oneM")})]}),(0,x.jsxs)("div",{className:"space-y-3",children:[SN.map(function(e){var t,n,l,u=e.role,d=e.modelKey,f=e.nameKey,p=e.oneMKey,h=c.get(d),m=c.get(f);if(!h||!m)return null;var v=o["extra:".concat(d)],g=o["extra:".concat(f)];return(0,x.jsxs)("div",{className:S_,children:[(0,x.jsxs)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:[u,h.required?(0,x.jsx)("span",{className:"ml-1 text-destructive",children:"*"}):null]}),(0,x.jsx)(ST,{field:m,value:null!=(t=r[f])?t:"",placeholder:(null==(l=r[d])?void 0:l.trim())?s("profile.mapping.defaultTo",{model:r[d].trim()}):void 0,error:g,onChange:function(e){return a(f,e)}}),(0,x.jsx)(ST,{field:h,value:null!=(n=r[d])?n:"",error:v,modelOptions:i,onChange:function(e){return a(d,e)}}),(0,x.jsx)(SR,{role:u,field:p?c.get(p):void 0,value:p?r[p]:void 0,error:p?o["extra:".concat(p)]:void 0,onChange:a})]},u)}),u?(0,x.jsxs)("div",{className:S_,children:[(0,x.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/45 px-3 text-sm font-medium",children:"Subagent"}),(0,x.jsx)("div",{className:"flex h-10 items-center rounded-lg border bg-muted/30 px-3 text-sm text-muted-foreground",children:s("profile.mapping.notInMenu")}),(0,x.jsx)(ST,{field:u,value:null!=(t=r.subagentModel)?t:"",error:o["extra:subagentModel"],modelOptions:i,onChange:function(e){return a("subagentModel",e)}}),(0,x.jsx)(SR,{role:"Subagent",field:c.get(SE),value:r[SE],error:o["extra:".concat(SE)],onChange:a})]}):null]})]})}function ST(e){var t=e.field,n=e.value,r=e.placeholder,o=e.error,i=e.modelOptions,a=void 0===i?[]:i,l=e.onChange,s=(0,to.Bd)().t,c=n&&!a.includes(n)?[n].concat(SC(a)):a,u=oM(s,t.labelCode,t.params);return(0,x.jsx)(i0,{id:"extra-".concat(t.key),label:u,labelClassName:"text-xs md:sr-only",error:o?oA(s,o):void 0,className:"space-y-1.5",children:function(e){return a.length>0?(0,x.jsxs)(sV,{value:n,onValueChange:l,children:[(0,x.jsx)(cT,SO(SS({},e),{"aria-label":u,children:(0,x.jsx)(sG,{placeholder:null!=r?r:oT(s,t)})})),(0,x.jsx)(cD,{children:c.map(function(e){return(0,x.jsx)(cL,{value:e,children:e},e)})})]}):(0,x.jsx)(i4,SO(SS({},e),{value:n,placeholder:null!=r?r:oT(s,t),onChange:function(e){return l(e.target.value)}}))}})}function SR(e){var t=e.role,n=e.field,r=e.value,o=e.error,i=e.onChange,a=(0,to.Bd)().t;if(!n)return(0,x.jsx)("div",{"data-slot":"one-m-unsupported",className:"flex h-10 items-center rounded-lg border border-dashed bg-muted/20 px-3 text-sm text-muted-foreground",children:a("profile.mapping.oneMUnsupported",{role:t})});var l="extra-".concat(n.key),s=oM(a,n.labelCode,n.params);return(0,x.jsxs)("div",{className:"space-y-1.5",children:[(0,x.jsx)("div",{className:"flex h-10 items-center",children:(0,x.jsxs)("label",{htmlFor:l,className:"flex cursor-pointer items-center gap-2 text-sm text-muted-foreground",children:[(0,x.jsx)(aX,SO(SS({},i1(l,o)),{checked:"true"===r,"aria-label":s,onCheckedChange:function(e){return i(n.key,!0===e?"true":"false")}})),(0,x.jsx)("span",{className:"md:hidden",children:s}),(0,x.jsx)("span",{className:"hidden md:inline",children:a("profile.mapping.enable")})]})}),(0,x.jsx)(i2,{id:l,children:o?oA(a,o):void 0})]})}function Sz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function SD(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function SL(e){var t=e.field,n=e.value,r=e.error,o=e.onChange,i=(0,to.Bd)().t,a=oM(i,t.labelCode,t.params),l=oT(i,t);return(0,x.jsx)(i0,{id:"extra-".concat(t.key),label:a,error:r?oA(i,r):void 0,hint:t.helpCode?oM(i,t.helpCode,t.params):void 0,className:"textarea"===t.kind||t.fullWidth?"sm:col-span-2":void 0,children:function(e){var r;return"select"===t.kind?(0,x.jsxs)(sV,{value:n,onValueChange:o,children:[(0,x.jsx)(cT,SD(Sz({},e),{"aria-label":a,children:(0,x.jsx)(sG,{placeholder:null!=l?l:i("profile.selectPlaceholder")})})),(0,x.jsx)(cD,{children:null==(r=t.options)?void 0:r.map(function(e){return(0,x.jsx)(cL,{value:e.value,children:e.labelCode?i(e.labelCode):e.value},e.value)})})]}):"textarea"===t.kind?(0,x.jsx)(x6,SD(Sz({},e),{rows:3,value:n,placeholder:l,className:"font-mono text-xs",onChange:function(e){return o(e.target.value)}})):(0,x.jsx)(i4,SD(Sz({},e),{type:"password"===t.kind?"password":"text",value:n,placeholder:l,onChange:function(e){return o(e.target.value)}}))}})}function SF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function SH(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function S$(e){return function(e){if(Array.isArray(e))return SF(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return SF(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return SF(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var SB=[{id:"openrouter",baseUrl:"https://openrouter.ai/api/v1"},{id:"zai",baseUrl:"https://api.z.ai/api/paas/v4",model:"glm-4.6"},{id:"moonshot",baseUrl:"https://api.moonshot.cn/v1"},{id:"deepseek",baseUrl:"https://api.deepseek.com/v1"}],SK={id:"cliproxyResponses",baseUrl:"https://api.seavey.ai/cliproxy/v1",model:"gpt-5.6-sol"},Sq={claude:[{id:"zaiAnthropic",baseUrl:"https://api.z.ai/api/anthropic",model:"glm-4.6"},{id:"moonshotAnthropic",baseUrl:"https://api.moonshot.cn/anthropic"},{id:"deepseekAnthropic",baseUrl:"https://api.deepseek.com/anthropic"}],codex:SB,kimi:SB,pi:[SH(SU({},SK),{extras:{api:"openai-responses",reasoning:"true"}})].concat(S$(SB)),dsh:[SH(SU({},SK),{extras:{api:"openai-responses",reasoningEfforts:"low,medium,high,xhigh,max"}})].concat(S$(SB))};function SV(e){var t,n=e.harnessId,r=e.onPick,o=(0,to.Bd)().t,i=null!=(t=Sq[n])?t:[];return 0===i.length?null:(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("span",{className:"text-xs text-muted-foreground",children:o("profile.quickFill")}),i.map(function(e){return(0,x.jsx)(tr,{type:"button",size:"sm",variant:"outline",onClick:function(){return r(e)},children:o("preset.".concat(e.id))},e.id)})]})}let SW=P("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function SG(e){var t=e.targets,n=e.overrides,r=e.onEdit,o=e.onReset,i=(0,to.Bd)().t;return null===t?(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:i("profile.rawLoading")}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:i("profile.rawIntro")}),t.map(function(e){var t,a=void 0!==n[e.key];return(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,x.jsx)(iQ,{htmlFor:"raw-".concat(e.key),className:"font-mono text-xs",children:e.path}),a?(0,x.jsxs)(tr,{type:"button",size:"sm",variant:"ghost",onClick:function(){return o(e.key)},children:[(0,x.jsx)(SW,{}),i("profile.resetToGenerated")]}):null]}),(0,x.jsx)(x6,{id:"raw-".concat(e.key),rows:10,spellCheck:!1,className:"font-mono text-xs",value:null!=(t=n[e.key])?t:e.content,onChange:function(t){return r(e.key,t.target.value)}})]},e.key)})]})}function SZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SY(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function SX(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){SY(i,r,o,a,l,"next",e)}function l(e){SY(i,r,o,a,l,"throw",e)}a(void 0)})}}function SJ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){SJ(e,t,n[t])})}return e}function S0(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function S1(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||S2(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S2(e,t){if(e){if("string"==typeof e)return SZ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SZ(e,t)}}function S3(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function S4(e){var t,n,r,o,i,a,l,s,c,u=e.harness,d=e.profile,f=e.copySource,p=void 0===f?null:f,h=e.onOpenChange,m=(0,to.Bd)().t,v=iV(function(e){return e.createProfile}),g=iV(function(e){return e.updateProfile}),y=iV(function(e){return e.previewProfile}),b=iV(function(e){return e.providers}),k=iV(function(e){return e.loadProviders}),j=iV(function(e){return e.probeDraft}),S=iV(function(e){return e.probeProfile}),O=null!==d,C=null!==p,N=null!=d?d:p,P=S1((0,w.useState)(null!=(t=null==d?void 0:d.name)?t:p?function(e,t){var n=new Set(t.map(function(e){return e.name})),r="".concat(e,"-copy");if(!n.has(r))return r;for(var o=2;n.has("".concat(r,"-").concat(o));)o++;return"".concat(r,"-").concat(o)}(p.name,u.profiles):""),2),E=P[0],I=P[1],A=S1((0,w.useState)(null!=(n=null==N?void 0:N.baseUrl)?n:""),2),_=A[0],M=A[1],T=S1((0,w.useState)(""),2),R=T[0],z=T[1],D=S1((0,w.useState)(null!=(r=null==N?void 0:N.model)?r:""),2),L=D[0],F=D[1],U=S1((0,w.useState)(null!=(o=null==N?void 0:N.notes)?o:""),2),H=U[0],$=U[1],B=S1((0,w.useState)(function(){return function(e,t){var n={},r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s,c,u=a.value;n[u.key]=null!=(s=null!=(c=null==t?void 0:t.extras[u.key])?c:u.defaultValue)?s:""}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(u.fields,N)}),2),K=B[0],q=B[1],V=S1((0,w.useState)({}),2),W=V[0],G=V[1],Z=S1((0,w.useState)(null!=(i=null==N?void 0:N.providerId)?i:""),2),Y=Z[0],X=Z[1],J=S1((0,w.useState)(null!=(a=null==N?void 0:N.providerEndpoint)?a:""),2),Q=J[0],ee=J[1],et=S1((0,w.useState)(!1),2),en=et[0],er=et[1],eo=S1((0,w.useState)(null),2),ei=eo[0],ea=eo[1],el=S1((0,w.useState)(null),2),es=el[0],ec=el[1],eu=S1((0,w.useState)(!1),2),ed=eu[0],ef=eu[1],ep=S1((0,w.useState)({}),2),eh=ep[0],em=ep[1],ev=S1((0,w.useState)(null),2),eg=ev[0],ey=ev[1],eb=null!=b?b:[],ex=null!=(l=eb.find(function(e){return e.id===Y}))?l:null,ew=null==ex?void 0:ex.endpoints.find(function(e){return e.key===Q}),ek=JSON.stringify([_,R,Y,Q]),ej=x4(ek),eS=S1((0,w.useState)(null),2),eO=eS[0],eC=eS[1],eN=(null==eO?void 0:eO.signature)===ek?eO.models:[],eP=L&&!eN.includes(L)?[L].concat(function(e){if(Array.isArray(e))return SZ(e)}(eN)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(eN)||S2(eN)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):eN,eE=null!==b&&""!==Y&&null===ex,eI=null!==ex&&""!==Q&&void 0===ew,eA="dsh"===u.id?u.fields.find(function(e){return"providerType"===e.key}):void 0,e_="dsh"===u.id&&"official"===K.providerType,eM="claude"===u.id?u.fields.filter(function(e){return!SI.has(e.key)}):"dsh"===u.id?u.fields.filter(function(e){return"providerType"!==e.key&&!e_}):u.fields,eT=e_?[]:"claude"===u.id?eM.filter(function(e){return"authVar"===e.key}):eM,eR="claude"===u.id?eM.filter(function(e){return"authVar"!==e.key}):[];function ez(){return SX(function(){var e;return S3(this,function(t){switch(t.label){case 0:if(!d)return[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,y(u.id,d.name)];case 2:return ea(e=t.sent()),G(Object.fromEntries(e.filter(function(e){return e.overridden}).map(function(e){return[e.key,e.content]}))),[3,4];case 3:return ec(oP(t.sent())),[3,4];case 4:return[2]}})})()}function eD(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];em(function(e){if(!t.some(function(t){return e[t]}))return e;var n=SQ({},e),r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s=a.value;delete n[s]}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n})}function eL(){var e;return ex&&Q&&null!=(e=null==ew?void 0:ew.baseUrl)?e:_}function eF(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return SX(function(){var t,n;return S3(this,function(r){switch(r.label){case 0:if(!(t=eL().trim()))return em(function(e){return S0(SQ({},e),{baseUrl:{key:"profile.error.baseUrlRequired"}})}),[2];if(n=L.trim(),!ex&&!R.trim()&&!(O&&d))return em(function(e){return S0(SQ({},e),{apiKey:{key:"profile.error.apiKeyRequired"}})}),[2];ec(null),ey(e?"completion":"models"),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,ej.run(function(){return SX(function(){var r,o,i;return S3(this,function(a){switch(a.label){case 0:return[4,ex||R.trim()?j(SQ({baseUrl:t},ex?{providerId:Y}:{apiKey:R},e?{completion:!0}:{},e&&n?{model:n}:{})):S(u.id,null!=(r=null==d?void 0:d.name)?r:"",e?SQ({completion:!0,refresh:!0},n?{model:n}:{}):void 0)];case 1:return o=a.sent(),e||eC({signature:ek,models:o.ok&&null!=(i=o.models)?i:[]}),[2,o]}})})()})];case 2:return r.sent(),[3,5];case 3:return ec(oP(r.sent())),[3,5];case 4:return ey(null),[7];case 5:return[2]}})})()}x5(b,k);var eU=(0,x.jsxs)(tr,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:function(){eF()},disabled:ej.pending,children:[ej.pending&&"models"===eg?(0,x.jsx)(c2,{className:"animate-spin"}):null,ej.pending&&"models"===eg?m("probe.fetchingModels"):m("probe.fetchModels")]});return(0,x.jsx)(r_,{open:!0,onOpenChange:h,children:(0,x.jsx)(r1,{className:"max-h-[92vh] w-[calc(100vw-2rem)] overflow-hidden p-0 sm:max-w-[1120px]",children:(0,x.jsxs)("form",{onSubmit:function(e){return SX(function(){var t,n;return S3(this,function(r){switch(r.label){case 0:if(e.preventDefault(),!function(){var e={},t=E.trim();t?t.includes("/")||t.includes("\\")?e.name={key:"profile.error.nameSlash"}:t.length>ta.b1.name?e.name={key:"profile.error.nameTooLong",params:{max:ta.b1.name}}:u.profiles.some(function(e){return e.name===t&&e.name!==(null==d?void 0:d.name)})&&(e.name={key:"profile.error.nameDuplicate"}):e.name={key:"profile.error.nameRequired"},eL().trim()||(e.baseUrl={key:"profile.error.baseUrlRequired"}),O||C||null!==ex||R.trim()||(e.apiKey={key:"profile.error.apiKeyRequired"}),u.modelRequired&&!L.trim()&&(e.model={key:"profile.error.modelRequired"}),eE&&(e.providerId={key:"profile.error.providerGone"}),eI&&(e.providerEndpoint={key:"profile.error.endpointGone"});var n=!0,r=!1,o=void 0;try{for(var i,a=u.fields[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l,s=i.value;!s.required||(null==(l=K[s.key])?void 0:l.trim())||(e["extra:".concat(s.key)]={key:"profile.error.fieldRequired",params:{label:oM(m,s.labelCode,s.params)}})}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return em(e),!(Object.keys(e).length>0)||(ec({key:"profile.error.checkFields"}),!1)}())return[2];ef(!0),ec(null),r.label=1;case 1:if(r.trys.push([1,6,7,8]),n=SQ({name:e_?"deepseek-official":E,baseUrl:e_?_||"https://api.deepseek.com/anthropic":ex&&Q&&null!=(t=null==ew?void 0:ew.baseUrl)?t:_,model:e_?L||"deepseek-flash":L,notes:H,extras:K},C?{copySourceName:p.name}:{},Y?SQ({providerId:Y},Q?{providerEndpoint:Q}:{}):O||C?{providerId:""}:{},ex?{}:{apiKey:R||void 0}),!O)return[3,3];return[4,g(u.id,d.name,S0(SQ({},n),{overrides:W}))];case 2:return r.sent(),[3,5];case 3:return[4,v(u.id,n)];case 4:r.sent(),r.label=5;case 5:return h(!1),[3,8];case 6:return ec(oP(r.sent())),[3,8];case 7:return ef(!1),[7];case 8:return[2]}})})()},noValidate:!0,className:"flex max-h-[92vh] min-h-0 flex-col",children:[(0,x.jsxs)(r2,{className:"shrink-0 border-b bg-card px-6 py-5 pr-12",children:[(0,x.jsx)(r4,{children:O?m("profile.editTitle",{harness:u.label,profile:d.name}):C?m("profile.copyTitle",{harness:u.label,profile:p.name}):m("profile.createTitle",{harness:u.label})}),(0,x.jsxs)(r5,{children:[m("profile.intro",{targets:u.targets.map(function(e){return o_(m,e.labelCode,e.label)}).join(m("common.listSeparator"))}),"additive"===u.mode?m("profile.additiveNote"):""]})]}),(0,x.jsxs)("div",{"data-slot":"profile-dialog-scroll",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 py-5",children:[eA&&!(O&&e_)?(0,x.jsx)(SL,{field:eA,value:null!=(s=K.providerType)?s:"custom",onChange:function(e){q(function(t){return S0(SQ({},t),{providerType:e})}),"official"===e&&(I("deepseek-official"),M("https://api.deepseek.com/anthropic"),F("deepseek-flash"),X(""),ee(""))}}):null,e_?null:(0,x.jsxs)("div",{"data-slot":"provider-reference-fields",className:"space-y-3 rounded-xl border p-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,x.jsx)(iQ,{htmlFor:"provider-select",className:"font-medium",children:m("profile.useSharedProvider")}),ex?(0,x.jsx)(tb,{variant:"secondary",children:m("profile.keyFromVault")}):null]}),(0,x.jsxs)(sV,{value:Y,onValueChange:function(e){X(e);var t,n,r=eb.find(function(t){return t.id===e});ee(null!=(t=null==r||null==(n=r.endpoints[0])?void 0:n.key)?t:""),eD("providerId","providerEndpoint","baseUrl","apiKey")},children:[(0,x.jsx)(cT,S0(SQ({},i1("provider-select",eh.providerId)),{"aria-label":m("profile.useSharedProviderLabel"),children:(0,x.jsx)(sG,{placeholder:m("profile.providerNone")})})),(0,x.jsxs)(cD,{children:[(0,x.jsx)(cL,{value:"",children:m("profile.providerNone")}),eb.map(function(e){return(0,x.jsx)(cL,{value:e.id,children:e.name},e.id)})]})]}),(0,x.jsx)(i2,{id:"provider-select",children:eh.providerId?oA(m,eh.providerId):void 0}),0===eb.length?(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:m("profile.vaultEmpty")}):null,ex?(0,x.jsx)(i0,{id:"provider-endpoint",label:m("profile.namedEndpoint"),error:eh.providerEndpoint?oA(m,eh.providerEndpoint):void 0,hint:0===ex.endpoints.length?m("profile.noEndpoints"):null,children:function(e){return(0,x.jsxs)(sV,{value:Q,onValueChange:function(e){ee(e),eD("providerEndpoint","baseUrl")},children:[(0,x.jsx)(cT,S0(SQ({},e),{"aria-label":m("profile.namedEndpointLabel"),children:(0,x.jsx)(sG,{placeholder:m("profile.endpointNone")})})),(0,x.jsxs)(cD,{children:[(0,x.jsx)(cL,{value:"",children:m("profile.endpointNone")}),ex.endpoints.map(function(e){return(0,x.jsx)(cL,{value:e.key,children:e.label?m("profile.endpointOption",{label:e.label,key:e.key}):e.key},e.key)})]})]})}}):null]}),e_?null:(0,x.jsx)(SV,{harnessId:u.id,onPick:function(e){M(e.baseUrl),eD("baseUrl"),e.model&&(F(e.model),eD("model")),e.extras&&q(function(t){return SQ({},t,e.extras)})}}),(0,x.jsxs)("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[e_?null:(0,x.jsx)(i0,{id:"name",className:"sm:col-span-2",label:m("profile.name"),error:eh.name?oA(m,eh.name):void 0,hint:O?m("profile.renameHint"):null,children:function(e){return(0,x.jsx)(i4,S0(SQ({},e),{value:E,onChange:function(e){I(e.target.value),eD("name")},placeholder:m("profile.namePlaceholder")}))}}),e_?null:(0,x.jsx)(i0,{id:"baseUrl",className:"sm:col-span-2",label:m("profile.baseUrl"),error:eh.baseUrl?oA(m,eh.baseUrl):void 0,hint:ex&&Q?m("profile.baseUrlFromVault",{endpoint:Q}):null,children:function(e){return(0,x.jsx)(i4,S0(SQ({},e),{value:eL(),onChange:function(e){M(e.target.value),eD("baseUrl")},placeholder:m("profile.baseUrlPlaceholder"),disabled:null!==ex&&""!==Q}))}}),(0,x.jsx)(i0,{id:"apiKey",label:m("profile.apiKey"),error:eh.apiKey?oA(m,eh.apiKey):void 0,hint:ex?m("profile.apiKeySharedHint"):e_?m("profile.dshOfficialApiKeyHint"):null,children:function(e){return(0,x.jsx)(i4,S0(SQ({},e),{type:"password",value:R,onChange:function(e){z(e.target.value),eD("apiKey")},placeholder:ex?m("profile.keyFromVault"):O?m("profile.apiKeyKeep"):m("profile.apiKeyRequiredPlaceholder"),disabled:null!==ex}))}}),e_?null:(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(i0,{id:"model",label:"claude"===u.id?m("profile.fallbackModel"):m("profile.model"),error:eh.model?oA(m,eh.model):void 0,hint:"claude"===u.id?m("profile.claudeModelHint"):null,children:function(e){return eN.length>0?(0,x.jsxs)(sV,{value:L,onValueChange:function(e){F(e),eD("model")},children:[(0,x.jsx)(cT,S0(SQ({},e),{"aria-label":m("profile.model"),children:(0,x.jsx)(sG,{placeholder:"claude"===u.id?m("profile.fallbackModelPlaceholder"):m("profile.modelPlaceholder")})})),(0,x.jsx)(cD,{children:eP.map(function(e){return(0,x.jsx)(cL,{value:e,children:e},e)})})]}):(0,x.jsx)(i4,S0(SQ({},e),{value:L,onChange:function(e){F(e.target.value),eD("model")},placeholder:"claude"===u.id?m("profile.fallbackModelPlaceholder"):m("profile.modelPlaceholder")}))}}),"claude"!==u.id?eU:null]}),e_?null:(0,x.jsxs)("div",{className:"space-y-2 sm:col-span-2",children:[(0,x.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:ej.result?(0,x.jsx)(x9,{result:ej.result}):null}),(null==(c=ej.result)?void 0:c.ok)&&eN.length>0?(0,x.jsx)(dZ,{variant:"muted",size:"sm",children:m("probe.catalogHint")}):null]}),eT.map(function(e){var t;return(0,x.jsx)(SL,{field:e,value:null!=(t=K[e.key])?t:"",error:eh["extra:".concat(e.key)],onChange:function(t){q(function(n){return S0(SQ({},n),SJ({},e.key,t))}),eD("extra:".concat(e.key))}},e.key)}),"claude"===u.id?(0,x.jsx)(SM,{fields:u.fields,values:K,errors:eh,modelOptions:eN,fetchAction:eU,onChange:function(e,t){q(function(n){return S0(SQ({},n),SJ({},e,t))}),eD("extra:".concat(e))}}):null,eR.map(function(e){var t;return(0,x.jsx)(SL,{field:e,value:null!=(t=K[e.key])?t:"",error:eh["extra:".concat(e.key)],onChange:function(t){q(function(n){return S0(SQ({},n),SJ({},e.key,t))}),eD("extra:".concat(e.key))}},e.key)}),(0,x.jsx)(i0,{id:"notes",className:"sm:col-span-2",label:m("profile.notes"),children:function(e){return(0,x.jsx)(x6,S0(SQ({},e),{rows:2,value:H,onChange:function(e){return $(e.target.value)}}))}})]}),(0,x.jsxs)("div",{className:"rounded-xl border",children:[(0,x.jsxs)("button",{type:"button",onClick:function(){var e=!en;er(e),e&&null===ei&&ez()},className:"flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground active:bg-accent/80 ".concat(en?"rounded-t-xl":"rounded-xl"),children:[en?(0,x.jsx)(tf,{className:"size-4"}):(0,x.jsx)(tv,{className:"size-4"}),m("profile.advanced"),d&&d.overriddenTargets.length>0?(0,x.jsx)(tb,{variant:"secondary",children:m("profile.overridden")}):null]}),en?(0,x.jsx)("div",{className:"space-y-4 border-t px-3 py-3",children:O?(0,x.jsx)(SG,{targets:ei,overrides:W,onEdit:function(e,t){return G(function(n){return S0(SQ({},n),SJ({},e,t))})},onReset:function(e){G(function(t){var n=SQ({},t);return delete n[e],n}),ez()}}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:m("profile.saveFirst")})}):null]}),es?(0,x.jsx)(dZ,{children:oA(m,es)}):null]}),(0,x.jsxs)(r3,{className:"shrink-0 border-t bg-card px-6 py-4",children:[(0,x.jsx)(tr,{type:"button",variant:"outline",onClick:function(){return h(!1)},children:m("common.cancel")}),e_?null:(0,x.jsxs)(tr,{type:"button",variant:"outline",title:m("probe.completionHint"),onClick:function(){eF(!0)},disabled:ej.pending,children:[ej.pending&&"completion"===eg?(0,x.jsx)(c2,{className:"animate-spin"}):null,ej.pending&&"completion"===eg?m("probe.testingCompletion"):m("probe.completionAction")]}),(0,x.jsx)(tr,{type:"submit",disabled:ed,children:ed?m("profile.saving"):m("profile.save")})]})]})})})}function S5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S6(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function S8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S9(e){var t=e.favorite,n=e.onApply,r=(0,to.Bd)().t,o=iV(function(e){return e.harnesses}),i=iV(function(e){return e.detachFavorite}),a=iV(function(e){return e.deleteFavorite}),l=S8((0,w.useState)(null),2),s=l[0],c=l[1],u=S8((0,w.useState)(null),2),d=u[0],f=u[1],p=S8((0,w.useState)(!1),2),h=p[0],m=p[1],v=S8((0,w.useState)(""),2),g=v[0],y=v[1],b=S8((0,w.useState)(""),2),k=b[0],j=b[1],S=o.find(function(e){return e.id===(null==s?void 0:s.harness)}),O=null==S?void 0:S.profiles.find(function(e){return e.name===(null==s?void 0:s.name)}),C=function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:if(!d)return[2];m(!0),y(""),j(""),e.label=1;case 1:if(e.trys.push([1,6,7,8]),"delete"!==d)return[3,3];return[4,a(t)];case 2:return e.sent(),[3,5];case 3:return[4,i(d.harness,d.name)];case 4:e.sent(),j(r("favorites.management.detached",d)),e.label=5;case 5:return f(null),[3,8];case 6:return y(oA(r,oP(e.sent()))),[3,8];case 7:return m(!1),[7];case 8:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){S6(i,r,o,a,l,"next",e)}function l(e){S6(i,r,o,a,l,"throw",e)}a(void 0)})})()};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(d0,{title:r("workspace.manageLinks"),triggerClassName:"h-auto max-w-full whitespace-normal text-left",children:(0,x.jsxs)("div",{className:"space-y-3",children:[k?(0,x.jsx)("p",{role:"status",className:"text-sm",children:k}):null,t.references.map(function(e){var i,a,l=o.find(function(t){return t.id===e.harness}),s=null==l?void 0:l.profiles.find(function(t){return t.name===e.name}),u=!(null==l||null==(i=l.active)?void 0:i.official)&&(null==l||null==(a=l.active)?void 0:a.name)===e.name,d=t.connections.find(function(e){var t;return e.id===(null==s||null==(t=s.modelFavorite)?void 0:t.connectionId)});return(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b py-3",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1 basis-48",children:[(0,x.jsxs)("p",{className:"break-all text-sm",children:[e.harness," / ",e.name," ",e.needsUpdate?r("favorites.needsUpdate"):""," ",e.diverged?r("favorites.diverged"):""]}),(0,x.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[u?r("workspace.inUse"):r("workspace.saved"),e.connectionMissing?" \xb7 "+r("favorites.connectionMissing"):""]}),s?null:(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r("favorites.management.missingProfile")})]}),(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[e.needsUpdate&&d?(0,x.jsx)(tr,{variant:"outline",size:"sm",disabled:h,onClick:function(){n([{harness:e.harness,profile:e.name,connectionId:d.id,existing:!0,mode:"activate",ignorePreference:!1,overwriteDiverged:!1}])},children:r("favorites.onboarding.reviewUpdates",{count:1})}):null,(0,x.jsx)(tr,{variant:"outline",size:"sm",disabled:h||!s,onClick:function(){return c(e)},children:r("favorites.management.view")}),(0,x.jsx)(tr,{variant:"outline",size:"sm",disabled:h,onClick:function(){y(""),f(e)},children:r("favorites.detach")})]})]},e.harness+"/"+e.name)}),(0,x.jsx)("p",{id:"favorite-delete-hint",className:"text-sm leading-relaxed text-muted-foreground",children:r(t.references.length?"favorites.management.deleteBlocked":"favorites.management.noReferences",{count:t.references.length})}),(0,x.jsx)(tr,{variant:"ghost",className:"text-destructive",disabled:h||!!t.references.length,"aria-describedby":"favorite-delete-hint",onClick:function(){y(""),f("delete")},children:r("favorites.delete")})]})}),S&&O?(0,x.jsx)(S4,{harness:S,profile:O,onOpenChange:function(e){e||c(null)}},S.id+"/"+O.name):null,(0,x.jsx)(ap,{open:null!==d,onOpenChange:function(e){e||h||f(null)},children:(0,x.jsxs)(aC,{className:"max-h-[90dvh] overflow-y-auto",children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:r("delete"===d?"favorites.management.deleteTitle":"favorites.management.detachTitle")}),(0,x.jsx)(aI,{children:"delete"===d?r("favorites.management.deleteHint",{name:t.name}):d?r("favorites.management.detachHint",d):""})]}),g?(0,x.jsx)(dZ,{children:g}):null,(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{disabled:h,children:r("favorites.cancel")}),(0,x.jsx)(aA,{disabled:h||"delete"===d&&!!t.references.length,onClick:function(e){e.preventDefault(),C()},children:r("delete"===d?"favorites.delete":"favorites.detach")})]})]})})]})}function S7(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S7(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S7(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e){var t=e.favorite,n=(0,to.Bd)().t,r=iV(function(e){return e.ignoreFavoriteUpdates}),o=Oe((0,w.useState)(!1),2),i=o[0],a=o[1],l=Oe((0,w.useState)(""),2),s=l[0],c=l[1];return(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(tr,{variant:"ghost",disabled:i,onClick:function(){a(!0),c(""),r(t).catch(function(e){return c(oA(n,oP(e)))}).finally(function(){return a(!1)})},children:n("favorites.onboarding.ignoreUpdates")}),(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:n("favorites.onboarding.ignoreUpdatesHint")}),s?(0,x.jsx)(dZ,{children:s}):null]})}function On(e,t){return e.references.filter(function(e){return e.needsUpdate}).flatMap(function(n){var r=t.find(function(e){return e.id===n.harness}),o=null==r?void 0:r.profiles.find(function(e){return e.name===n.name}),i=e.connections.find(function(e){var t;return e.id===(null==o||null==(t=o.modelFavorite)?void 0:t.connectionId)});return i?[{harness:n.harness,connectionId:i.id,profile:n.name,existing:!0,mode:"activate",ignorePreference:!1,overwriteDiverged:!1}]:[]}).filter(function(e,t,n){return n.findIndex(function(t){return t.harness===e.harness})===t})}function Or(e){var t=e.favorite,n=e.onConfigure,r=e.onConnect,o=e.onApply,i=(0,to.Bd)().t,a=iV(function(e){return e.harnesses}),l=function(e){var n,r,o=null==(n=a.find(function(t){return t.id===e.harness}))?void 0:n.profiles.find(function(t){return t.name===e.name});return("kimi"===e.harness||"dsh"===e.harness)&&(null==o||null==(r=o.modelFavorite)?void 0:r.collectionOverrides)?"".concat(e.harness,"/collection/").concat(t.id):"".concat(e.harness,"/").concat(e.name)},s=new Set(t.references.map(l)).size,c=new Set(t.references.filter(function(e){var t=a.find(function(t){return t.id===e.harness});return(null==t?void 0:t.active)&&!t.active.official&&t.active.name===e.name}).map(l)).size,u=On(t,a),d=new Set(t.references.filter(function(e){return e.needsUpdate}).map(l)).size;return(0,x.jsxs)("div",{className:"space-y-3 rounded-xl border bg-primary/5 p-4",role:"status",children:[(0,x.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-2 text-sm font-medium",children:[(0,x.jsx)("span",{children:i("favorites.onboarding.savedCount",{count:s})}),(0,x.jsx)("span",{children:i("favorites.onboarding.activeCount",{count:c})}),d?(0,x.jsx)("span",{children:i("favorites.onboarding.updateCount",{count:d})}):null]}),(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:i(t.references.length?"favorites.onboarding.connectedHint":"favorites.onboarding.savedHint")}),t.references.length?null:(0,x.jsx)(tr,{variant:"outline",className:"h-auto max-w-full whitespace-normal py-2",onClick:t.connections.length?n:r,children:i(t.connections.length?"favorites.onboarding.configureNext":"favorites.onboarding.connectNext")}),u.length?(0,x.jsx)(tr,{variant:"outline",className:"h-auto max-w-full whitespace-normal py-2",onClick:function(){return o(u)},children:i("favorites.onboarding.reviewUpdates",{count:u.length})}):null,d?(0,x.jsx)(Ot,{favorite:t}):null]})}function Oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Oo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oo(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ol(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||Oc(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Os(e){return function(e){if(Array.isArray(e))return Oa(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Oc(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oc(e,t){if(e){if("string"==typeof e)return Oa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oa(e,t)}}function Ou(e){var t,n,r,o,i,a,l,s,c,u,d,f,p,h,m,v=e.favorite,g=e.onApply,y=(0,to.Bd)().t,b=iV(function(e){return e.harnesses}),k=iV(function(e){return e.providers}),j=(t=(0,to.Bd)().t,n=iV(function(e){return e.loadFavoriteTargets}),r=iV(function(e){return e.favoriteTargets[v.id]}),i=(o=Oi((0,w.useState)(!0),2))[0],a=o[1],s=(l=Oi((0,w.useState)(""),2))[0],c=l[1],(0,w.useEffect)(function(){var e=!0;return a(!0),c(""),n(v.id).catch(function(n){e&&c(oA(t,oP(n)))}).finally(function(){e&&a(!1)}),function(){e=!1}},[n,v.id,v.revision,t]),{targets:i||s?void 0:r,loading:i,error:s}),S=j.targets,O=j.loading,C=j.error,N=Ol((0,w.useState)(null!=(u=v.defaultConnectionId)?u:null==(p=v.connections[0])?void 0:p.id),2),P=N[0],E=N[1],I=v.connections.find(function(e){return e.id===P}),A=function(e){var t=new Map,n=!0,r=!1,o=void 0;try{for(var i,a=bT(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l,s=i.value,c=s[0],u=b_(new Set(s.map(function(e){return e.requestModelId}).filter(Boolean))).slice().sort(),d="".concat(c.providerId,"\0").concat(c.endpointKey,"\0").concat(u.join("\0")),f=null!=(l=t.get(d))?l:[];f.push.apply(f,b_(s)),t.set(d,f)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return b_(t.values())}(v.connections),_=null!=(d=A.find(function(e){return e.some(function(e){return e.id===P})}))?d:[],M=Os(new Map(_.filter(function(e){return e.requestModelId}).map(function(e){return[e.requestModelId,e]})).entries()),T=function(e,t){var n,r,o,i,a=null!=t?t:null==I?void 0:I.requestModelId,l=a?e.filter(function(e){return e.requestModelId===a}):e;return(null!=(n=null!=(r=null!=(o=null!=(i=l.find(function(e){return e.id===P}))?i:l.find(function(e){return e.id===v.defaultConnectionId}))?o:l.find(function(e){return e.protocol===(null==I?void 0:I.protocol)}))?r:l[0])?n:e[0]).id},R=function(e){var t=v.references.filter(function(t){return t.harness===e.id&&e.profiles.some(function(e){var n;return e.name===t.name&&(null==(n=e.modelFavorite)?void 0:n.connectionId)===P})});return t.some(function(e){return e.connectionMissing||e.sourceMissing})?"workspace.linkMissing":t.some(function(e){return e.diverged})?"favorites.diverged":t.some(function(e){return e.needsUpdate})?"favorites.needsUpdate":t.some(function(t){var n,r;return!(null==(n=e.active)?void 0:n.official)&&t.name===(null==(r=e.active)?void 0:r.name)})?"workspace.inUse":t.length?"workspace.saved":"workspace.available"},z=88*Math.max(A.length,b.length,1)+48,D=(z-66)/2,L=Os(A.map(function(e,t){var n,r,o=e[0],i=null!=(n=null==k||null==(r=k.find(function(e){return e.id===o.providerId}))?void 0:r.name)?n:y("workspace.missingProvider"),a=b_(new Set(e.map(function(e){return e.label.replace(bR,"").trim()}).filter(Boolean))).slice().sort(function(e,t){return e.length-t.length||e.localeCompare(t)})[0]||i,l=Os(new Set(e.map(function(e){return e.protocol}))),s=new Set(e.map(function(e){return e.requestModelId}).filter(Boolean)).size,c=[l.join(" \xb7 "),s>1?y("favorites.scheme.selectedCount",{count:s}):""].filter(Boolean).join(" \xb7 ");return bx(bz(e),24,D-(A.length-1)*88/2+88*t,{kind:"source",label:c,value:a,selected:e.some(function(e){return e.id===P}),action:function(){return E(T(e))},actionLabel:a+" \xb7 "+c})})).concat([bx("model",260,D,{kind:"model",label:y("favorites.modelPicker"),value:null!=(f=null==I?void 0:I.requestModelId)?f:y("favorites.pending")})],Os(b.map(function(e,t){var n,r=b1(v,e.id,S),o=r.some(function(e){return e.id===P}),i=null!=(n=r.find(function(e){return e.requestModelId===(null==I?void 0:I.requestModelId)}))?n:r[0],a=y(O?"favorites.loading":o?R(e):i?"favorites.otherChannelAvailable":"favorites.noCompatibleChannel");return bx(e.id,606,D-(b.length-1)*88/2+88*t,{kind:"tool",harnessId:e.id,label:a,value:e.label,disabled:O||!o&&!i,actionLabel:e.label+" "+a,action:function(){var t,n;return g([(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},b2(v,e,S)),n=n={connectionId:o?P:i.id},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)])}})}))),F=I?[bv(bz(_),"model")].concat(Os(b.filter(function(e){return b1(v,e.id,S).some(function(e){return e.id===P})}).map(function(e){return bv("model",e.id)}))):[];return(0,x.jsxs)("section",{className:"space-y-5","aria-label":y("workspace.relationship"),children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-lg font-semibold",children:y("workspace.relationship")}),(0,x.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:y("workspace.graphHint")})]}),C?(0,x.jsx)(dZ,{children:C}):null,(0,x.jsx)("div",{className:"flex flex-wrap items-end gap-4",children:M.length>1?(0,x.jsx)(fi,{id:"relationship-model",label:y("favorites.modelPicker"),value:null!=P?P:"",options:M.map(function(e){var t=Ol(e,1)[0];return{value:T(_,t),label:t}}),onChange:function(e){return E(e)},className:"w-72 font-mono text-xs"}):null}),(0,x.jsx)(bw,{nodes:L,edges:F,height:z}),I?(0,x.jsxs)("p",{className:"break-all text-xs text-muted-foreground",children:[I.protocol," \xb7"," ",null==k||null==(m=k.find(function(e){return e.id===I.providerId}))||null==(h=m.endpoints.find(function(e){return e.key===I.endpointKey}))?void 0:h.baseUrl]}):null,v.connections.length?null:(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:y("favorites.pending")}),(0,x.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:y("workspace.relationshipHint")})]})}function Od(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Of(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Of(e,t,n[t])})}return e}function Oh(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function Om(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||Ov(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ov(e,t){if(e){if("string"==typeof e)return Od(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Od(e,t)}}function Og(e){var t,n,r=e.initialSelectedId,o=void 0===r?"":r,i=e.startCreating,a=e.startEditing,l=void 0!==a&&a,s=(0,to.Bd)().t,c=iV(function(e){return e.favorites}),u=iV(function(e){return e.favoritesLoading}),d=iV(function(e){return e.favoritesError}),f=iV(function(e){return e.loadFavorites}),p=iV(function(e){return e.loadProviders}),h=iV(function(e){return e.clearFavoritePlan}),m=Om((0,w.useState)(""),2),v=m[0],g=m[1],y=Om((0,w.useState)(o),2),b=y[0],k=y[1],j=Om((0,w.useState)(null),2),S=j[0],O=j[1],C=Om((0,w.useState)(void 0!==i&&i),2),N=C[0],P=C[1],E=Om((0,w.useState)(null),2),I=E[0],A=E[1],_=Om((0,w.useState)(!1),2),M=_[0],T=_[1],R=(0,w.useRef)(!1);(0,w.useEffect)(function(){f(),p()},[f,p]),(0,w.useEffect)(function(){if(l&&o&&c&&!R.current){var e=c.find(function(e){return e.id===o});e&&(R.current=!0,O({kind:"edit",favorite:e}))}},[l,o,c]);var z=null!=(t=null==c?void 0:c.filter(function(e){var t;return[e.name].concat(function(e){if(Array.isArray(e))return Od(e)}(t=e.connections.flatMap(function(e){return[e.label,e.requestModelId]}))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Ov(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).some(function(e){return e.toLowerCase().includes(v.toLowerCase())})}))?t:[],D=null!=(n=z.find(function(e){return e.id===b}))?n:z[0];return(0,x.jsxs)("main",{className:"workspace-page space-y-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:s("workspace.favoriteEyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold sm:text-3xl",children:s("favorites.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:s("workspace.favoriteHint")})]}),(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,x.jsxs)(tr,{variant:"outline",onClick:function(){return T(!0)},children:[(0,x.jsx)(dB,{}),s("favorites.capture")]}),(0,x.jsxs)(tr,{onClick:function(){return P(!0)},children:[(0,x.jsx)(dK,{}),s("favorites.add")]})]})]}),u?(0,x.jsx)("p",{role:"status",children:s("favorites.loading")}):null,d?(0,x.jsx)(dZ,{children:oA(s,d)}):null,(null==c?void 0:c.length)||u||d?(0,x.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-[16rem_minmax(0,1fr)]",children:[(0,x.jsxs)("aside",{className:"space-y-4",children:[(0,x.jsx)(i0,{id:"favorite-search",label:s("favorites.search"),labelClassName:"sr-only",children:function(e){return(0,x.jsx)(i4,Oh(Op({},e),{value:v,placeholder:s("favorites.search"),onChange:function(e){return g(e.target.value)}}))}}),(0,x.jsx)("div",{className:"space-y-2",children:z.map(function(e){var t,n;return(0,x.jsxs)("button",{type:"button","aria-pressed":e.id===(null==D?void 0:D.id),onClick:function(){return k(e.id)},className:tt("flex w-full items-start gap-3 rounded-xl border px-4 py-4 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring",e.id===(null==D?void 0:D.id)?"border-primary/50 bg-primary/5":"border-transparent hover:bg-card"),children:[(0,x.jsx)(dV,{className:"mt-1 size-5 shrink-0 text-primary"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("h3",{className:"break-words font-semibold",children:e.name}),(0,x.jsx)("span",{className:"mt-1 block truncate font-mono text-xs text-muted-foreground",children:null!=(t=null==(n=e.connections[0])?void 0:n.requestModelId)?t:s("favorites.pending")})]})]},e.id)})}),z.length?null:(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:s("workspace.noMatches")})]}),D?(0,x.jsxs)("article",{className:"workspace-surface min-w-0 space-y-6 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsx)("span",{className:"text-sm text-muted-foreground",children:D.notes||s("workspace.favoriteDetail")}),(0,x.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,x.jsxs)(tr,{variant:"ghost",size:"sm",onClick:function(){return O({kind:"draft",draft:(0,ta.KT)({name:s("favorites.clone.name",{name:D.name}),notes:D.notes,defaults:Op({},D.defaults),preferences:Op({},D.preferences),connections:structuredClone(D.connections),defaultConnectionId:D.defaultConnectionId,toolBindings:structuredClone(D.toolBindings)},function(){return crypto.randomUUID()})})},children:[(0,x.jsx)(c7,{}),s("favorites.clone.action")]}),(0,x.jsx)(tr,{variant:"ghost",size:"sm",onClick:function(){return O({kind:"edit",favorite:D})},children:s("favorites.edit")}),(0,x.jsx)(tr,{disabled:!D.connections.length,onClick:function(){h(),A([])},children:s("favorites.configure")})]})]}),(0,x.jsx)(Or,{favorite:D,onConfigure:function(){h(),A([])},onConnect:function(){return O({kind:"edit",favorite:D})},onApply:function(e){h(),A(e)}}),(0,x.jsx)(Ou,{favorite:D,onApply:function(e){h(),A(e)}},D.id+"/"+D.revision),(0,x.jsx)(S9,{favorite:D,onApply:function(e){h(),A(e)}},D.id)]}):null]}):(0,x.jsxs)("section",{className:"workspace-surface space-y-4 p-8 sm:p-12",children:[(0,x.jsx)(dq,{className:"size-10 text-primary"}),(0,x.jsx)("h3",{className:"text-xl font-semibold",children:s("workspace.startTitle")}),(0,x.jsx)("p",{className:"max-w-xl text-sm leading-7 text-muted-foreground",children:s("favorites.onboarding.startHint")}),(0,x.jsx)(tr,{onClick:function(){return P(!0)},children:s("favorites.onboarding.createFirst")})]}),N?(0,x.jsx)(xC,{onClose:function(){return P(!1)},onCapture:function(){P(!1),T(!0)},onBlank:function(){P(!1),O({kind:"new"})},onPreset:function(e,t,n,r){var o,i;P(!1),O({kind:"draft",guided:!0,draft:{name:"",notes:"",defaults:Op({},xI),preferences:{},connections:[Oh(Op({id:crypto.randomUUID(),label:"",providerId:t.id,endpointKey:n},(0,ta.LK)([r])),{requestModelId:"",factOverrides:{},preferenceOverrides:{}})]},modelHints:(null==(i=e.modelCatalog)?void 0:i.length)?Of({},"".concat(t.id,"/").concat(n),e.modelCatalog.map(function(e){return e.requestModelId})):void 0,hintFacts:Object.fromEntries((null!=(o=e.modelCatalog)?o:[]).filter(function(e){return e.facts}).map(function(e){return[e.requestModelId,e.facts]}))})}}):null,S?(0,x.jsx)(Sk,{favorite:"edit"===S.kind?S.favorite:void 0,initialDraft:"draft"===S.kind?S.draft:void 0,modelHints:"draft"===S.kind?S.modelHints:void 0,hintFacts:"draft"===S.kind?S.hintFacts:void 0,guided:"draft"===S.kind&&!0===S.guided,onClose:function(){return O(null)},onSaved:function(e,t){if(g(""),k(e.id),"configure"===t)h(),A([]);else if("review"===t){var n,r,o=On(null!=(n=null==(r=iV.getState().favorites)?void 0:r.find(function(t){return t.id===e.id}))?n:e,iV.getState().harnesses);o.length&&(h(),A(o))}}}):null,M?(0,x.jsx)(xf,{onClose:function(){return T(!1)},onCreate:function(){T(!1),P(!0)}}):null,I&&D?(0,x.jsx)(xi,{favorite:D,initialItems:I,initialMode:"activate",onClose:function(){return A(null)},onEditConnections:function(){A(null),O({kind:"edit",favorite:D})}}):null]})}var Oy=d(2935);function Ob(e){var t=(0,Oy.ec)();return(0,x.jsx)(xY,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({theme:t,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"}},e))}function Ox(){var e=(0,to.Bd)().t,t=iV(function(e){return e.notice}),n=iV(function(e){return e.clearNotice});return(0,w.useEffect)(function(){if(t){var r=!0,o=!1,i=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var s=a.value,c=oA(e,s);s.key.startsWith("warning.")?xq.warning(c):xq.success(c)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}n()}},[t,n,e]),(0,x.jsx)(Ob,{position:"top-center",richColors:!0})}let Ow=P("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);function Ok(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oj(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function OS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ok(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ok(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OO(e){var t,n,r=e.harnessId,o=e.open,i=e.onOpenChange,a=(0,to.s9)().locale,l=(0,to.Bd)().t,s=iV(function(e){return e.operations}),c=iV(function(e){return e.operationsLoading}),u=iV(function(e){return e.operationsError}),d=iV(function(e){return e.loadOperations}),f=iV(function(e){return e.undoOperation}),p=OS((0,w.useState)(null),2),h=p[0],m=p[1],v=OS((0,w.useState)(!1),2),g=v[0],y=v[1],b=OS((0,w.useState)(null),2),k=b[0],j=b[1],S=null!=(t=null==s?void 0:s.filter(function(e){return e.harness===r}))?t:[],O=ta.RP[r];return(0,w.useEffect)(function(){o&&(j(null),d(r))},[o,r,d]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r_,{open:o,onOpenChange:i,children:(0,x.jsxs)(r1,{className:"flex max-h-[85vh] w-[min(52rem,calc(100vw-2rem))] max-w-2xl flex-col gap-0 overflow-hidden p-0",children:[(0,x.jsxs)(r2,{className:"shrink-0 space-y-1.5 px-6 pb-4 pt-6 pr-12",children:[(0,x.jsx)(r4,{children:l("operations.titleFor",{harness:O})}),(0,x.jsx)(r5,{children:l("operations.intro")})]}),(0,x.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6",children:[c&&0===S.length?(0,x.jsxs)("p",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",children:[(0,x.jsx)(c2,{className:"size-4 animate-spin"}),l("operations.loading")]}):null,u?(0,x.jsx)("p",{className:"py-6 text-sm text-destructive",children:oA(l,u)}):null,c||0!==S.length?null:(0,x.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:l("operations.empty")}),S.length>0?(0,x.jsx)("ul",{className:"divide-y rounded-xl border",children:S.map(function(e){var t,n,r,o,i;return(0,x.jsxs)("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsxs)("span",{className:"truncate text-sm font-medium",children:[l("operations.kind.".concat(e.kind))," \xb7 ",e.profile]}),(0,x.jsx)(tb,{variant:"degraded"===(n=e.state)?"destructive":"committed"===n?"default":"secondary",children:l("operations.state.".concat(e.state))})]}),(0,x.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(r=null!=(t=e.finishedAt)?t:e.startedAt,o=a,Number.isNaN((i=new Date(r)).getTime())?r:i.toLocaleString(o))," \xb7"," ",l("operations.user",{user:e.user})," \xb7"," ",l("operations.fileCount",{count:e.files.length})]}),e.note?(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:e.note}):null]}),(0,x.jsxs)(tr,{size:"sm",variant:"outline",className:"shrink-0",disabled:!e.undoable,onClick:function(){return m(e)},children:[(0,x.jsx)(Ow,{}),l("operations.undo")]})]},e.id)})}):null]}),(0,x.jsx)(r3,{className:"shrink-0 px-6 py-4",children:(0,x.jsx)(tr,{onClick:function(){return i(!1)},children:l("operations.close")})})]})}),(0,x.jsx)(r_,{open:null!==h,onOpenChange:function(e){return!e&&m(null)},children:(0,x.jsxs)(r1,{className:"max-w-lg",children:[(0,x.jsxs)(r2,{children:[(0,x.jsx)(r4,{children:l("operations.undoTitle")}),(0,x.jsx)(r5,{children:h?l("operations.undoBody",{harness:null!=(n=ta.RP[h.harness])?n:h.harness,count:h.files.length}):""})]}),k?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(l,k)}):null,(0,x.jsxs)(r3,{children:[(0,x.jsx)(tr,{variant:"outline",onClick:function(){return m(null)},children:l("common.cancel")}),(0,x.jsxs)(tr,{disabled:g,onClick:function(){var e;(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:if(!h)return[2];y(!0),j(null),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,f(h.id)];case 2:return e.sent(),m(null),[3,5];case 3:return j(oE(e.sent(),"operations.undoFailed")),[3,5];case 4:return y(!1),[7];case 5:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Oj(i,r,o,a,l,"next",e)}function l(e){Oj(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[g?(0,x.jsx)(c2,{className:"animate-spin"}):null,l("operations.confirmUndo")]})]})]})})]})}function OC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ON(e){var t,n,r=e.harness,o=(0,to.Bd)().t,i=iV(function(e){return e.operations}),a=iV(function(e){return e.operationsLoading}),l=iV(function(e){return e.operationsError}),s=iV(function(e){return e.loadOperations}),c=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return OC(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OC(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=c[0],d=c[1],f=null!=(n=null==i?void 0:i.filter(function(e){return e.harness===r.id}))?n:[];return((0,w.useEffect)(function(){s(r.id)},[r.id,s]),0!==f.length||l)?(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ts,{className:"size-4 text-primary"}),(0,x.jsx)("h4",{className:"text-sm font-semibold",children:o("operations.title")}),(0,x.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[(0,x.jsx)(tr,{size:"sm",variant:"ghost",disabled:null===i,onClick:function(){return d(!0)},children:o("operations.viewDetails")}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":o("operations.refresh"),onClick:function(){s(r.id)},children:(0,x.jsx)(uJ,{className:a?"animate-spin":void 0})})]})]}),(0,x.jsx)("div",{className:"mt-2",children:l?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(o,l)}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:o("operations.count",{count:f.length})})}),(0,x.jsx)(OO,{harnessId:r.id,open:u,onOpenChange:d})]}):null}let OP=P("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),OE=P("archive-restore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);function OI(e){var t=e.preview,n=(0,to.Bd)().t,r=t.files.filter(function(e){return"unchanged"!==e.action}),o=t.files.filter(function(e){return"unchanged"===e.action}),i=function(e){return e.startsWith("store/")?n("favorites.restoreArea.".concat(e.slice(6))):e};return(0,x.jsxs)("div",{className:"space-y-3",children:[(0,x.jsx)("p",{className:"font-medium",children:n("favorites.restoreImpact",{count:r.length})}),r.length?(0,x.jsx)("ul",{className:"divide-y rounded-lg border px-3",children:r.map(function(e){return(0,x.jsxs)("li",{className:"space-y-1 py-3",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,x.jsx)("span",{className:"text-sm font-medium",children:i(e.key)}),(0,x.jsx)(tb,{variant:"delete"===e.action?"destructive":"secondary",children:n("favorites.restoreAction.".concat(e.action))})]}),(0,x.jsx)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:e.path})]},e.key)})}):(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:n("favorites.restoreNoChanges")}),o.length?(0,x.jsx)(d0,{title:n("favorites.restoreUnchanged",{count:o.length}),children:(0,x.jsx)("ul",{className:"space-y-2 text-xs text-muted-foreground",children:o.map(function(e){return(0,x.jsxs)("li",{children:[i(e.key),(0,x.jsx)("span",{className:"block break-all font-mono",children:e.path})]},e.key)})})}):null]})}function OA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O_(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function OM(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){O_(i,r,o,a,l,"next",e)}function l(e){O_(i,r,o,a,l,"throw",e)}a(void 0)})}}function OT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return OA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OA(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OR(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function Oz(){var e,t,n,r,o,i,a,l,s,c,u,d,f,p,h,m,v,g,y,b,k,j,S,O,C,N,P,E,I,A,_=(0,to.Bd)().t,M=(0,to.s9)().locale,T=(e=(0,to.Bd)().t,t=iV(function(e){return e.favoriteBackups}),n=iV(function(e){return e.loadFavoriteBackups}),r=iV(function(e){return e.createFavoriteBackup}),o=iV(function(e){return e.restoreFavoriteBackup}),i=iV(function(e){return e.favoriteBackupPreview}),a=iV(function(e){return e.previewFavoriteBackup}),s=(l=OT((0,w.useState)(null),2))[0],c=l[1],d=(u=OT((0,w.useState)(!0),2))[0],f=u[1],h=(p=OT((0,w.useState)(!1),2))[0],m=p[1],g=(v=OT((0,w.useState)(!1),2))[0],y=v[1],k=(b=OT((0,w.useState)(""),2))[0],j=b[1],O=(S=OT((0,w.useState)(""),2))[0],C=S[1],N=(0,w.useRef)(0),(0,w.useEffect)(function(){var t=!0;return n().catch(function(n){t&&j(oA(e,oP(n)))}).finally(function(){t&&f(!1)}),function(){t=!1,N.current++}},[n,e]),P=function(t,n){return OM(function(){return OR(this,function(r){switch(r.label){case 0:if(g)return[2];N.current++,y(!0),m(!1),j(""),C(""),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,t()];case 2:return r.sent(),c(null),C(e(n)),[3,5];case 3:return j(oA(e,oP(r.sent()))),[3,5];case 4:return y(!1),[7];case 5:return[2]}})})()},E=t.find(function(e){return e.id===s}),I=h||k||(null==i?void 0:i.id)!==s?null:i,{backups:t,selected:E,loading:d,checking:h,writing:g,error:k,notice:O,impact:I,select:function(t){return OM(function(){var n,r;return OR(this,function(o){switch(o.label){case 0:if(g||(n=++N.current,c(t),j(""),C(""),m(!!t),!t))return[2];o.label=1;case 1:return o.trys.push([1,3,4,5]),[4,a(t)];case 2:return o.sent(),[3,5];case 3:return r=o.sent(),n===N.current&&j(oA(e,oP(r))),[3,5];case 4:return n===N.current&&m(!1),[7];case 5:return[2]}})})()},create:function(){return P(r,"favorites.backupCreated")},restore:function(){return E&&I?P(function(){return o(E.id,I.fingerprint)},"favorites.backupRestored"):Promise.resolve()}}),R=iV(function(e){return e.harnesses}),z=function(e){var t,n,r;return e.context?_("favorites.backupAction.".concat(e.context.action),{name:null!=(t=e.context.name)?t:"",tools:null!=(n=null==(r=e.context.tools)?void 0:r.map(function(e){return _("favorites.toolNames.".concat(e))}).join(" / "))?n:""}):_("favorites.backupReason.".concat(e.reason))},D=function(e){return new Date(e.createdAt).toLocaleString(M)},L=T.backups.findIndex(function(e){var t;return e.id===(null==(t=T.selected)?void 0:t.id)}),F=[T.backups[L+2],T.backups[L+1]].filter(function(e){return void 0!==e});return(0,x.jsxs)("main",{className:"workspace-page space-y-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:_("timeline.eyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold sm:text-3xl",children:_("timeline.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:_("timeline.subtitle")})]}),(0,x.jsxs)(tr,{variant:"outline",disabled:T.writing,onClick:function(){T.create()},children:[T.writing?(0,x.jsx)(c2,{className:"animate-spin"}):(0,x.jsx)(dK,{}),_("favorites.backupNow")]})]}),T.error?(0,x.jsx)(dZ,{children:T.error}):null,T.notice?(0,x.jsxs)("p",{role:"status",className:"flex items-center gap-2 rounded-xl border border-primary/20 bg-primary/5 p-4 text-sm",children:[(0,x.jsx)(c4,{className:"size-4 text-primary"}),T.notice]}):null,(0,x.jsxs)("div",{className:"grid items-start gap-8 lg:grid-cols-[18rem_minmax(0,1fr)]",children:[(0,x.jsxs)("nav",{"aria-label":_("timeline.points"),className:"timeline-rail space-y-2",children:[(0,x.jsxs)("button",{type:"button","aria-current":T.selected?void 0:"true",disabled:T.writing,onClick:function(){T.select(null)},className:tt("timeline-point",!T.selected&&"timeline-point-selected"),children:[(0,x.jsx)(c4,{className:"size-5 shrink-0"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("strong",{className:"block text-sm",children:_("timeline.current")}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:_("timeline.currentHint")})]})]}),T.loading?(0,x.jsx)("p",{role:"status",className:"p-4 text-sm",children:_("favorites.loading")}):null,T.backups.map(function(e){var t,n;return(0,x.jsxs)("button",{type:"button",disabled:T.writing,"aria-current":(null==(t=T.selected)?void 0:t.id)===e.id?"true":void 0,className:tt("timeline-point",(null==(n=T.selected)?void 0:n.id)===e.id&&"timeline-point-selected"),onClick:function(){T.select(e.id)},children:[(0,x.jsx)(OP,{className:"size-4 shrink-0"}),(0,x.jsxs)("span",{className:"min-w-0",children:[(0,x.jsx)("time",{dateTime:e.createdAt,className:"block text-xs tabular-nums",children:D(e)}),(0,x.jsx)("strong",{className:"mt-2 block break-words text-sm font-medium",children:z(e)})]})]},e.id)}),T.loading||T.backups.length?null:(0,x.jsx)("p",{className:"p-4 text-sm leading-6 text-muted-foreground",children:_("favorites.backupEmpty")}),(0,x.jsx)("p",{className:"p-4 text-xs leading-6 text-muted-foreground",children:_("favorites.backupHint")})]}),(0,x.jsx)("div",{className:"min-w-0",children:T.selected?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"mb-5 flex flex-wrap items-center justify-between gap-3",children:[(0,x.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,x.jsx)(ts,{className:"size-4"}),_("timeline.snapshot")]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsxs)(tr,{variant:"outline",size:"sm",disabled:T.writing||L===T.backups.length-1,onClick:function(){T.select(T.backups[L+1].id)},children:[(0,x.jsx)(tm,{}),_("timeline.older")]}),(0,x.jsxs)(tr,{variant:"outline",size:"sm",disabled:T.writing||L<=0,onClick:function(){T.select(T.backups[L-1].id)},children:[_("timeline.newer"),(0,x.jsx)(dW,{})]})]})]}),(0,x.jsxs)("div",{className:"snapshot-stack",style:{paddingTop:22*F.length},children:[F.map(function(e,t){return(0,x.jsx)("div",{"aria-hidden":!0,className:"snapshot-behind",style:{top:22*t,left:(F.length-t)*18,right:(F.length-t)*18},children:(0,x.jsxs)("span",{children:[D(e)," \xb7 ",z(e)]})},e.id)}),(0,x.jsxs)("section",{className:"workspace-surface snapshot-front relative flex flex-col gap-4 p-5 sm:p-6","aria-label":_("favorites.restoreReview"),children:[(0,x.jsxs)("div",{className:"flex items-start gap-4",children:[(0,x.jsx)(OE,{className:"mt-1 size-6 shrink-0 text-primary"}),(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-xl font-semibold tabular-nums",children:D(T.selected)}),(0,x.jsx)("p",{className:"mt-2 break-words text-sm text-muted-foreground",children:z(T.selected)})]})]}),(0,x.jsx)("p",{className:"text-sm leading-6 text-muted-foreground",children:_("timeline.snapshotHint")}),(0,x.jsx)("div",{className:"snapshot-impact min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1",children:T.checking?(0,x.jsxs)("p",{role:"status",className:"flex items-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,x.jsx)(c2,{className:"size-4 animate-spin"}),_("favorites.restoreChecking")]}):T.impact?(0,x.jsx)(OI,{preview:T.impact}):null}),(0,x.jsx)(dZ,{variant:"warning",children:_("favorites.restoreScope")}),(0,x.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-t pt-4",children:[(0,x.jsx)(tr,{variant:"outline",disabled:T.writing||T.checking,onClick:function(){T.select(T.selected.id)},children:_("favorites.restoreRecheck")}),(0,x.jsxs)(tr,{size:"lg",disabled:T.writing||!(null==(A=T.impact)?void 0:A.files.some(function(e){return"unchanged"!==e.action})),onClick:function(){T.restore()},children:[T.writing?(0,x.jsx)(c2,{className:"animate-spin"}):(0,x.jsx)(OE,{}),_("timeline.restore")]})]})]},T.selected.id)]}),(0,x.jsxs)("p",{className:"mt-6 flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)(c4,{className:"size-4"}),_("timeline.protection")]})]}):(0,x.jsxs)("section",{className:"workspace-surface space-y-6 p-6 sm:p-8",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)(c4,{className:"size-7 text-primary"}),(0,x.jsx)("h3",{className:"text-xl font-semibold",children:_("timeline.current")})]}),(0,x.jsx)("p",{className:"text-sm leading-7 text-muted-foreground",children:_("timeline.currentDescription")}),(0,x.jsx)("div",{className:"divide-y",children:R.map(function(e){var t,n;return(0,x.jsxs)("div",{className:"flex items-center gap-3 py-4",children:[(0,x.jsx)(dz,{id:e.id}),(0,x.jsx)("span",{className:"text-sm font-medium",children:e.label}),(0,x.jsx)("span",{className:"ml-auto min-w-0 max-w-[55%] break-all text-right font-mono text-xs text-muted-foreground",children:(null==(t=e.active)?void 0:t.model)||_((null==(n=e.active)?void 0:n.official)?"harness.official":"harness.currentInactive")})]},e.id)})}),(0,x.jsx)("p",{className:"text-sm text-primary",children:_("timeline.selectHint")})]})})]})]})}let OD=P("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),OL=P("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);function OF(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OU(){var e,t=(0,to.Bd)().t,n=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)("light"))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return OF(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OF(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,w.useEffect)(function(){var e=(0,Oy.PY)();o(e),(0,Oy.AZ)(e)},[]),(0,x.jsx)(tr,{type:"button",size:"sm",variant:"outline",className:"w-9 px-0","aria-label":t("dark"===r?"theme.toLight":"theme.toDark"),onClick:function(){return o(function(e){return(0,Oy.OD)(e)})},children:"dark"===r?(0,x.jsx)(OD,{}):(0,x.jsx)(OL,{})})}function OH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function OB(e,t){if(null==e)return{};var n,r,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}if(i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.getOwnPropertyNames(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r]);return i}function OK(e){var t,n=e.label,r=e.className,o=e.trigger,i=e.children,a=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return OH(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OH(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],s=a[1],c=(0,w.useRef)(null);return(0,w.useEffect)(function(){var e=function(e){var t;(null==(t=c.current)?void 0:t.contains(e.target))||s(!1)};if(l)return window.addEventListener("pointerdown",e),function(){return window.removeEventListener("pointerdown",e)}},[l]),(0,x.jsxs)("div",{ref:c,className:tt("relative",r),children:[w.cloneElement(o,{"aria-expanded":l,"aria-haspopup":"menu",onClick:function(){return s(function(e){return!e})}}),l?(0,x.jsx)("div",{role:"menu","aria-label":n,className:"absolute right-0 top-full z-30 mt-2 w-52 rounded-xl border bg-popover p-1 text-popover-foreground shadow-lg",children:i(function(){return s(!1)})}):null]})}function Oq(e){var t=e.className,n=e.disabled,r=e.destructive,o=OB(e,["className","disabled","destructive"]);return(0,x.jsx)("button",O$({type:"button",disabled:n,className:tt("flex w-full items-center rounded-lg px-3 py-2 text-left text-sm transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35",r&&"text-destructive",n?"cursor-default opacity-60":r?"cursor-pointer hover:bg-destructive/10":"cursor-pointer hover:bg-accent hover:text-accent-foreground",t)},o))}function OV(e){var t=e.className,n=OB(e,["className"]);return(0,x.jsx)("div",O$({className:tt("px-3 py-2 text-xs text-muted-foreground",t)},n))}function OW(e){var t=e.className;return(0,x.jsx)("div",{className:tt("my-1 border-t",t)})}function OG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OZ(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function OY(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return OG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OG(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OX(){var e=(0,to.Bd)().t,t=OY((0,w.useState)(null),2),n=t[0],r=t[1],o=OY((0,w.useState)(null),2),i=o[0],a=o[1],l=OY((0,w.useState)("idle"),2),s=l[0],c=l[1];return((0,w.useEffect)(function(){var e=!1;return ov("/api/update/check").then(function(t){!e&&(r(t.current),t.updateAvailable&&t.latest&&a(t.latest))}).catch(function(){}),function(){e=!0}},[]),"updating"===s)?(0,x.jsxs)("span",{className:"flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-muted/70 px-2 font-mono text-[11px] text-muted-foreground",children:[(0,x.jsx)(c2,{className:"size-3 shrink-0 animate-spin"}),e("update.updating")]}):"failed"===s?(0,x.jsx)("span",{title:e("update.failedHint"),className:"flex h-6 shrink-0 items-center whitespace-nowrap rounded-md bg-destructive/10 px-2 font-mono text-[11px] text-destructive",children:e("update.failed")}):i?(0,x.jsxs)(tr,{variant:"outline",size:"sm","aria-label":e("update.toVersion",{version:i}),className:"h-6 shrink-0 gap-1 whitespace-nowrap px-2 font-mono text-[11px]",onClick:function(){var e;(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:c("updating"),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ov("/api/update",{method:"POST"})];case 2:case 3:return t.sent(),[3,4];case 4:e=Date.now()+18e4,t.label=5;case 5:if(!(Date.now()<e))return[3,11];return[4,new Promise(function(e){return setTimeout(e,2500)})];case 6:t.sent(),t.label=7;case 7:return t.trys.push([7,9,,10]),[4,ov(om)];case 8:if(t.sent().version!==n)return window.location.reload(),[2];return[3,10];case 9:return t.sent(),[3,10];case 10:return[3,5];case 11:return c("failed"),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){OZ(i,r,o,a,l,"next",e)}function l(e){OZ(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[(0,x.jsx)(uQ,{className:"size-3 shrink-0"}),(0,x.jsx)("span",{className:"sm:hidden",children:e("update.short")}),(0,x.jsx)("span",{className:"hidden sm:inline",children:e("update.toVersion",{version:i})})]}):null}function OJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OQ(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return OJ(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return OJ(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return((0,w.useEffect)(function(){var e=!1;return ov(om).then(function(t){e||r(t.version)}).catch(function(){}),function(){e=!0}},[]),n)?(0,x.jsxs)("span",{className:"shrink-0 whitespace-nowrap rounded-md bg-muted/70 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["v",n]}):null}function O0(){return(0,to.Bd)().t,null}let O1=P("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);function O2(e){var t,n=e.selectedHarnessId,r=e.onSelectHarness,o=e.onConfigure,i=e.onHistory,a=(0,to.Bd)().t,l=(0,to.s9)().locale,s=iV(function(e){return e.harnesses}),c=iV(function(e){return e.loadFavoriteBackups}),u=iV(function(e){return e.favoriteBackups});(0,w.useEffect)(function(){c().catch(function(){})},[c]);var d=null!=(t=s.find(function(e){return e.id===n}))?t:s[0];return(0,x.jsxs)("main",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)]",children:[(0,x.jsx)(dU,{harnesses:s,value:null==d?void 0:d.id,onChange:r}),(0,x.jsxs)("div",{className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:a("workspace.eyebrow")}),(0,x.jsx)("h2",{className:"mt-2 text-2xl font-semibold tracking-tight sm:text-3xl",children:a("workspace.title")}),(0,x.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:a("workspace.homeSubtitle")})]}),d?(0,x.jsxs)(uo,{idPrefix:"harness",value:d.id,className:"workspace-surface min-w-0 space-y-7 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"text-xl font-semibold",children:a("workspace.currentForTool",{name:d.label})}),(0,x.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:a("workspace.currentForToolHint")})]}),(0,x.jsxs)(tr,{onClick:function(){return o(d.id)},children:[(0,x.jsx)(O1,{}),a("workspace.configureSwitch")]})]}),(0,x.jsx)(bO,{harness:d})]}):(0,x.jsx)("p",{children:a("workspace.noTools")}),(0,x.jsxs)("button",{type:"button",onClick:i,className:"workspace-history-link group flex w-full flex-wrap items-center justify-between gap-4 rounded-2xl border bg-card/60 p-5 text-left focus-visible:outline-2 focus-visible:outline-ring",children:[(0,x.jsxs)("span",{className:"flex items-center gap-4",children:[(0,x.jsx)(ts,{className:"size-6 shrink-0 text-primary"}),(0,x.jsxs)("span",{children:[(0,x.jsx)("span",{className:"block text-sm font-semibold",children:a("timeline.title")}),(0,x.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:u[0]?a("workspace.lastBackup",{time:new Date(u[0].createdAt).toLocaleString(l)}):a("workspace.historyHint")})]})]}),(0,x.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[a("workspace.openHistory"),(0,x.jsx)(dW,{className:"size-4 transition-transform group-hover:translate-x-1 motion-reduce:transform-none"})]})]})]})]})}let O3=P("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),O4=P("circle-user-round",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function O5(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O6(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function O8(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O9(e){var t,n,r=e.harness,o=e.profile,i=e.official,a=void 0!==i&&i,l=e.open,s=e.onOpenChange,c=(0,to.Bd)().t,u=iV(function(e){return e.previewProfile}),d=iV(function(e){return e.previewOfficial}),f=iV(function(e){return e.activateProfile}),p=iV(function(e){return e.activateOfficial}),h=iV(function(e){return e.currentUser}),m=a?c("harness.official"):null==o?void 0:o.name,v=O8((0,w.useState)(null),2),g=v[0],y=v[1],b=O8((0,w.useState)(null),2),k=b[0],j=b[1],S=O8((0,w.useState)(null),2),O=S[0],C=S[1],N=O8((0,w.useState)(!1),2),P=N[0],E=N[1],I=O8((0,w.useState)(0),2),A=I[0],_=I[1],M=O8((0,w.useState)("route"),2),T=M[0],R=M[1];(0,w.useEffect)(function(){if(l){var e=!1;return y(null),j(null),C(null),E(!1),(a?d(r.id):u(r.id,null!=m?m:"")).then(function(t){e||y(t)}).catch(function(t){e||j(oP(t))}),function(){e=!0}}},[l,r.id,a,A,d,u,m]);var z=null!=(t=null==g?void 0:g.map(function(e){return{path:e.path,existed:null!==e.currentContent,content:e.content,currentContent:e.currentContent}}))?t:[],D=z.filter(function(e){return"same"!==tC(e)}).length;return(0,x.jsx)(ap,{open:l,onOpenChange:s,children:(0,x.jsxs)(aC,{style:{height:o&&"route"===T?"min(520px, 90dvh)":"min(820px, 90dvh)"},className:"flex flex-col overflow-hidden sm:max-w-4xl data-[state=open]:animate-none data-[state=closed]:animate-none",children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:c(a?"activate.officialTitle":"activate.title")}),(0,x.jsx)(aI,{children:c(a?"activate.officialBody":"activate.body",{harness:r.label,profile:null!=m?m:"",changed:D>0?c("activate.changedFiles",{count:D}):"",user:h||c("notice.currentUser")})})]}),o?(0,x.jsx)(un,{idPrefix:"profile-preview",label:c("favorites.reviewChanges"),items:[{id:"route",label:c("workspace.switchMap")},{id:"diff",label:c("workspace.fileDiffTab")}],value:T,onChange:R,className:"flex gap-2",tabClassName:"px-4 py-2 text-sm",children:function(e){return e.label}}):null,(0,x.jsx)(uo,{idPrefix:"profile-preview",value:T,className:"min-h-0 flex-1 overflow-auto",children:o&&"route"===T?(0,x.jsx)(bS,{current:bN(r,c),candidate:{provider:o.name,model:bj(o,c),sourceLabel:c((null==(n=o.modelFavorite)?void 0:n.favoriteId)?"templates.tag":"workspace.configuration")},harness:r}):k?(0,x.jsx)("p",{className:"text-sm text-destructive",children:c("activate.loadFailed",{reason:oA(c,k)})}):null===g?(0,x.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:c("activate.loading")}):(0,x.jsx)("div",{className:"max-h-[52dvh] overflow-y-auto rounded-xl border p-3",children:(0,x.jsx)(tN,{files:z})})}),o&&"route"===T&&k?(0,x.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:oA(c,k)}):null,O?(0,x.jsx)("p",{className:"text-sm text-destructive",children:c("activate.failed",{reason:oA(c,O)})}):null,(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{disabled:P,children:c("common.cancel")}),k?(0,x.jsx)(aA,{onClick:function(e){e.preventDefault(),_(function(e){return e+1})},children:c("activate.retryPreview")}):(0,x.jsx)(aA,{disabled:null===g||P,onClick:function(e){var t;return(t=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:if(e.preventDefault(),!g||P)return[2];E(!0),C(null),t.label=1;case 1:if(t.trys.push([1,6,7,8]),!a)return[3,3];return[4,p(r.id)];case 2:return t.sent(),[3,5];case 3:return[4,f(r.id,null!=m?m:"")];case 4:t.sent(),t.label=5;case 5:return s(!1),[3,8];case 6:return C(oP(t.sent())),[3,8];case 7:return E(!1),[7];case 8:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){O6(i,r,o,a,l,"next",e)}function l(e){O6(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:c(P?"activate.executing":O?"activate.retry":"activate.confirm")})]})]})})}let O7=P("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var Ce={collection:"harness.profiles",applied:"harness.activeConfig",appliedBadge:"harness.active",apply:"harness.activate",add:"harness.newProfile"},Ct={collection:"harness.providers",applied:"harness.defaultModel",appliedBadge:"harness.default",apply:"harness.setDefault",add:"harness.addCustomProvider"},Cn=new Set(["dsh","kimi"]);function Cr(e){return Cn.has(e)?Ct:Ce}function Co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ci(e){var t,n,r,o,i,a=e.group,l=e.harness,s=e.switching,c=e.onActivate,u=e.onOpenTemplate,d=(0,to.Bd)().t,f=Cr(l.id),p=iV(function(e){return e.favorites}),h=null==p?void 0:p.find(function(e){return e.id===a.favoriteId}),m=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return Co(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Co(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),v=m[0],g=m[1],y=null!=(n=a.profiles.find(function(e){return e.name===v}))?n:a.selected,b=(null==(o=l.active)?void 0:o.official)||null==(i=l.active)?void 0:i.name,k=a.profiles.some(function(e){return e.name===b}),j=y.name===b;return(0,x.jsxs)("div",{className:tt("flex flex-col gap-4 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)] transition-[border-color,background-color,box-shadow] sm:flex-row sm:items-center sm:justify-between",k?"border-primary/20 bg-primary/[0.035] shadow-[0_12px_30px_-24px_rgb(99_91_255/0.35)]":"hover:border-primary/15 hover:bg-card/85"),children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,x.jsx)("span",{className:tt("mt-2 size-2 shrink-0 rounded-full",k?"bg-primary":"bg-muted-foreground/30")}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:null!=(r=null==h?void 0:h.name)?r:a.selected.name}),k?(0,x.jsx)(tb,{children:d(f.appliedBadge)}):null,(0,x.jsx)(tb,{variant:"outline",children:d("favorites.scheme.collectionProfile",{count:a.profiles.length})})]}),(0,x.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:y.baseUrl}),(0,x.jsx)("p",{title:y.model,className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:y.model})]})]}),(0,x.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 self-end sm:self-auto",children:[(0,x.jsxs)(sV,{value:y.name,onValueChange:g,children:[(0,x.jsx)(cT,{"aria-label":d("favorites.scheme.startModel"),className:"h-9 w-56 font-mono text-xs",children:(0,x.jsx)(sG,{})}),(0,x.jsx)(cD,{children:a.profiles.map(function(e){return(0,x.jsx)(cL,{value:e.name,className:"font-mono text-xs",children:e.model},e.name)})})]}),(0,x.jsxs)(tr,{size:"sm",variant:j?"secondary":"outline",disabled:j,onClick:function(){return c(y)},children:[j?null:(0,x.jsx)(O7,{}),d(s?j?"workspace.activeNow":"workspace.useConfiguration":j?f.appliedBadge:f.apply)]}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":d("favorites.scheme.manageCollection"),title:d("favorites.scheme.manageCollection"),disabled:!u||!a.favoriteId,onClick:function(){return null==u?void 0:u(a.favoriteId)},children:(0,x.jsx)(uQ,{})})]})]})}function Ca(e){var t,n=e.profile,r=e.onOpenTemplate,o=(0,to.Bd)().t,i=iV(function(e){return e.favorites}),a=iV(function(e){return e.loadFavorites});(0,w.useEffect)(function(){null===i&&a()},[i,a]);var l=null==i?void 0:i.find(function(e){var t;return e.id===(null==(t=n.modelFavorite)?void 0:t.favoriteId)}),s=null==l?void 0:l.references.find(function(e){return e.harness===n.harness&&e.name===n.name});return(0,x.jsxs)("div",{className:"mt-2 space-y-1 text-xs text-muted-foreground",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[l&&r?(0,x.jsx)(tr,{size:"sm",variant:"outline",className:"h-6 rounded-full px-2 text-xs",onClick:function(){return r(l.id)},children:o("templates.tag")}):null,(0,x.jsxs)("span",{className:"min-w-0 break-words",children:[o("favorites.linked"),":"," ",null!=(t=null==l?void 0:l.name)?t:o(i?"favorites.sourceMissing":"favorites.loading")]})]}),(null==s?void 0:s.connectionMissing)?(0,x.jsx)("p",{children:o("favorites.connectionMissing")}):null,(null==s?void 0:s.needsUpdate)?(0,x.jsx)("p",{children:o("favorites.needsUpdate")}):null,(null==s?void 0:s.diverged)?(0,x.jsx)("p",{children:o("favorites.diverged")}):null]})}function Cl(e){var t,n=e.profile,r=e.harness,o=e.active,i=e.switching,a=e.onOpenTemplate,l=e.onEdit,s=e.onCopy,c=e.setActivating,u=e.setPendingName,d=(0,to.Bd)().t,f=Cr(r.id),p=null==(t=n.modelFavorite)?void 0:t.favoriteId;return(0,x.jsxs)("div",{className:tt("flex flex-col gap-4 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)] transition-[border-color,background-color,box-shadow] sm:flex-row sm:items-center sm:justify-between",o?"border-primary/20 bg-primary/[0.035] shadow-[0_12px_30px_-24px_rgb(99_91_255/0.35)]":"hover:border-primary/15 hover:bg-card/85"),children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,x.jsx)("span",{className:tt("mt-2 size-2 shrink-0 rounded-full",o?"bg-primary":"bg-muted-foreground/30")}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:n.name}),o?(0,x.jsx)(tb,{children:d(f.appliedBadge)}):null,n.overriddenTargets.length>0?(0,x.jsx)(tb,{variant:"outline",children:d("harness.manualOverride")}):null]}),(0,x.jsx)("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:n.baseUrl}),(0,x.jsx)("p",{title:bj(n,d),className:"mt-0.5 truncate font-mono text-xs text-muted-foreground",children:bj(n,d)}),n.modelFavorite?(0,x.jsx)(Ca,{profile:n,onOpenTemplate:a}):null]})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 self-end sm:self-auto",children:[(0,x.jsxs)(tr,{size:"sm",variant:o?"secondary":"outline",onClick:function(){return c(n)},disabled:o,children:[o?null:(0,x.jsx)(O7,{}),d(i?o?"workspace.activeNow":"workspace.useConfiguration":o?f.appliedBadge:f.apply)]}),p?(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":d("favorites.edit"),title:d("favorites.edit"),disabled:!a,onClick:function(){return null==a?void 0:a(p)},children:(0,x.jsx)(uQ,{})}):(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":d("harness.edit",{name:n.name}),onClick:function(){return l(n)},children:(0,x.jsx)(xQ,{})}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":d("harness.copy",{name:n.name}),onClick:function(){return null==s?void 0:s(n)},children:(0,x.jsx)(c7,{})}),(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":d("harness.delete",{name:n.name}),disabled:o,title:o?d("harness.deleteBlocked"):void 0,onClick:function(){return u(n.name)},children:(0,x.jsx)(x0,{className:o?void 0:"text-destructive"})})]})]},n.name)}function Cs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cs(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cu(e){var t,n,r,o,i,a,l=e.harness,s=e.onAdd,c=e.onEdit,u=e.onCopy,d=e.extraActions,f=e.onOpenTemplate,p=e.switching,h=(0,to.Bd)().t,m=iV(function(e){return e.favorites}),v=iV(function(e){return e.deleteProfile}),g=Cc((0,w.useState)(null),2),y=g[0],b=g[1],k=Cc((0,w.useState)(null),2),j=k[0],S=k[1],O=Cc((0,w.useState)(!1),2),C=O[0],N=O[1],P=l.official,E=(null==P?void 0:P.linkedProfileName)?l.profiles.find(function(e){return e.name===P.linkedProfileName}):void 0,I=dF(l).filter(function(e){return e.selected.name!==(null==P?void 0:P.linkedProfileName)}),A=l.profiles.find(function(e){return e.name===y}),_="dsh"===l.id&&(null==A?void 0:A.extras.providerType)==="official"&&1===l.profiles.filter(function(e){return"official"===e.extras.providerType}).length,M=Cr(l.id),T=(null==(o=l.active)?void 0:o.official)?h("harness.official"):null!=(t=null!=(n=dL(l.profiles.find(function(e){var t;return e.name===(null==(t=l.active)?void 0:t.name)}),m))?n:null==(i=l.active)?void 0:i.name)?t:null;return(0,x.jsxs)("div",{className:"space-y-6",children:[(0,x.jsx)(wR,{className:"overflow-hidden border-primary/10",children:(0,x.jsxs)(wL,{className:"p-5 sm:p-6",children:[(0,x.jsxs)("div",{className:"grid gap-5 sm:grid-cols-[minmax(0,1fr)_minmax(15rem,0.85fr)] sm:divide-x",children:[(0,x.jsxs)("div",{className:"min-w-0 sm:pr-5",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,x.jsx)("span",{className:"size-2 rounded-full bg-primary shadow-[0_0_0_4px_rgb(99_91_255/0.1)]"}),h(M.applied)]}),(0,x.jsx)(wz,{className:"mt-3 truncate text-xl",children:null===T?h("harness.inactive"):h("harness.activeNamed",{name:T})}),(0,x.jsx)(wD,{className:"mt-1",children:null===T?h("harness.currentInactive"):h("harness.current",{name:T})})]}),(0,x.jsxs)("div",{className:"min-w-0 sm:pl-5",children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:h("harness.writeTargets")}),(0,x.jsx)("p",{className:"mt-3 truncate font-mono text-sm",children:null!=(r=null==(a=l.targets[0])?void 0:a.path)?r:h("harness.noTargetFile")}),l.targets.length>1?(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.moreFiles",{count:l.targets.length-1})}):null]})]}),(0,x.jsxs)("div",{className:"mt-5 flex items-start gap-3 border-t pt-4 text-sm text-muted-foreground",children:[(0,x.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/[0.08] text-primary",children:(0,x.jsx)(c4,{className:"size-4"})}),(0,x.jsx)("p",{className:"pt-1 leading-relaxed",children:h("harness.overwriteWarning")})]})]})}),(0,x.jsxs)("section",{children:[(0,x.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,x.jsxs)("div",{children:[p?null:(0,x.jsx)("h3",{className:"text-sm font-semibold",children:h(M.collection)}),(0,x.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:h("harness.profileCount",{count:I.length})})]}),d]}),(0,x.jsxs)("div",{className:"space-y-3",children:[(null==P?void 0:P.available)?(0,x.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border bg-card px-4 py-4 shadow-[0_10px_28px_-26px_rgb(36_39_70/0.38)]",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,x.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:(0,x.jsx)(O4,{className:"size-4"})}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("p",{className:"font-medium",children:h(P.titleCode)}),P.active?(0,x.jsx)(tb,{variant:"secondary",children:h("harness.active")}):null]}),(0,x.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:h(P.hintCode)})]})]}),(0,x.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,x.jsx)(tr,{size:"sm",variant:P.active?"secondary":"outline",disabled:P.active,onClick:function(){return N(!0)},children:h(P.active?"harness.officialActive":"harness.officialSwitch")}),E?(0,x.jsx)(tr,{size:"icon",variant:"ghost","aria-label":h("harness.edit",{name:E.name}),onClick:function(){return c(E)},children:(0,x.jsx)(xQ,{})}):null]})]}):null,0!==I.length||E?I.length>0?I.map(function(e){if(e.favoriteId)return(0,x.jsx)(Ci,{group:e,harness:l,switching:p,onActivate:S,onOpenTemplate:f},e.id);var t,n,r=e.selected,o=(null==(t=l.active)?void 0:t.official)!==!0&&(null==(n=l.active)?void 0:n.name)===r.name;return(0,x.jsx)(Cl,{profile:r,harness:l,active:o,switching:p,onOpenTemplate:f,onEdit:c,onCopy:u,setActivating:S,setPendingName:b},r.name)}):null:(0,x.jsxs)("div",{className:"rounded-xl border border-dashed bg-card/60 px-5 py-8 text-center",children:[(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:h("harness.noProfiles")}),(0,x.jsxs)(tr,{className:"mt-4",size:"sm",onClick:s,children:[(0,x.jsx)(dK,{}),h("harness.newProfile")]})]})]})]}),j?(0,x.jsx)(O9,{harness:l,profile:j,open:!0,onOpenChange:function(e){return!e&&S(null)}}):null,C?(0,x.jsx)(O9,{harness:l,official:!0,open:!0,onOpenChange:function(e){return!e&&N(!1)}}):null,(0,x.jsx)(ap,{open:null!==y,onOpenChange:function(e){return!e&&b(null)},children:(0,x.jsxs)(aC,{children:[(0,x.jsxs)(aN,{children:[(0,x.jsx)(aE,{children:h("harness.deleteTitle")}),(0,x.jsx)(aI,{children:h("harness.deleteBody",{harness:l.label,profile:null!=y?y:"",extra:_?h("harness.deleteDshOfficialExtra"):"additive"===l.mode?h("harness.deleteAdditiveExtra"):""})})]}),(0,x.jsxs)(aP,{children:[(0,x.jsx)(a_,{children:h("common.cancel")}),(0,x.jsx)(aA,{onClick:function(){y&&v(l.id,y)},children:h("common.delete")})]})]})})]})}function Cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cf(e){var t,n,r=e.harness,o=e.onNewProfile,i=e.onOpenTemplate,a=e.onManageTemplates,l=e.onCreateTemplate,s=e.onEditProfile,c=e.onCopyProfile,u=(0,to.Bd)().t,d=iV(function(e){return e.favorites}),f=iV(function(e){return e.favoritesLoading}),p=iV(function(e){return e.favoritesError}),h=iV(function(e){return e.loadFavorites}),m=iV(function(e){return e.loadProviders}),v=function(e){if(Array.isArray(e))return e}(t=(0,w.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return Cd(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cd(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=v[0],y=v[1];(0,w.useEffect)(function(){h(),m()},[h,m]);var b=null==d?void 0:d.find(function(e){return e.id===g}),k=(null!=(n=null==d?void 0:d.length)?n:0)>0,j=null===d||k?0:function(e){var t=new Map,n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l,s=i.value;if(!s.modelFavorite){var c=s.providerId||s.baseUrl;c&&t.set(c,(null!=(l=t.get(c))?l:0)+1)}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}var u=0,d=!0,f=!1,p=void 0;try{for(var h,m=t.values()[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){var v=h.value;v>1&&(u+=v)}}catch(e){f=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(f)throw p}}return u}(r.profiles);return(0,x.jsxs)("section",{className:"workspace-surface space-y-6 p-5 sm:p-7",children:[(0,x.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,x.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,x.jsx)("p",{className:"workspace-eyebrow",children:u("workspace.switcherEyebrow")}),(0,x.jsx)("h3",{className:"mt-2 text-xl font-semibold",children:u("workspace.switcherTitle",{name:r.label})}),(0,x.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:u("workspace.switcherHint")})]}),(0,x.jsxs)("div",{className:"ml-auto flex flex-wrap justify-end gap-2",children:[(0,x.jsxs)(tr,{variant:"outline",size:"sm",onClick:o,children:[(0,x.jsx)(dK,{}),u("workspace.newConfiguration")]}),k?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(kM,{id:"switcher-template","aria-invalid":void 0,"aria-describedby":void 0,value:"",options:(null!=d?d:[]).map(function(e){return e.id}),getLabel:function(e){var t,n;return null!=(t=null==d||null==(n=d.find(function(t){return t.id===e}))?void 0:n.name)?t:e},isOptionDisabled:function(e){return r.profiles.some(function(t){var n;return(null==(n=t.modelFavorite)?void 0:n.favoriteId)===e})},disabledHint:u("workspace.templateAlreadyLinked"),onChange:y,placeholder:u("workspace.chooseTemplate"),searchLabel:u("favorites.search"),emptyHint:u(f?"favorites.loading":"workspace.noTemplates"),trigger:(0,x.jsxs)(tr,{variant:"outline",size:"sm",children:[(0,x.jsx)(uQ,{}),u("workspace.newFromTemplate")]})}),(0,x.jsx)(tr,{variant:"ghost",size:"sm",onClick:a,children:u("workspace.manageTemplates")})]}):null]})]}),p?(0,x.jsx)(dZ,{children:oA(u,p)}):null,j>0?(0,x.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-primary/20 bg-primary/[0.04] px-4 py-3 text-sm",children:[(0,x.jsx)(O3,{className:"size-4 shrink-0 text-primary"}),(0,x.jsx)("p",{className:"min-w-0 flex-1 leading-relaxed",children:u("workspace.sharedProviderHint",{count:j})}),(0,x.jsxs)(tr,{size:"sm",variant:"outline",onClick:l,children:[(0,x.jsx)(uQ,{}),u("favorites.add")]})]}):null,(0,x.jsx)(Cu,{harness:r,onAdd:o,onEdit:s,onCopy:c,onOpenTemplate:i,switching:!0}),b?(0,x.jsx)(xi,{favorite:b,quickHarness:r,initialMode:"activate",initialPreview:!0,onClose:function(){return y("")}},b.id):null]})}var Cp="hs-harness";function Ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ch(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(){var e,t,n,r,o,i=iV(function(e){return e.currentUser}),a=Cm((0,w.useState)("workspace"),2),l=a[0],s=a[1],c=(0,to.Bd)().t,u=iV(function(e){return e.harnesses}),d=Cm((0,w.useState)(null),2),f=d[0],p=d[1],h=Cm((0,w.useState)(!1),2),m=h[0],v=h[1],g=Cm((0,w.useState)(!1),2),y=g[0],b=g[1],k=Cm((0,w.useState)(function(){var e;return null!=(e=function(){try{var e=localStorage.getItem(Cp);return e&&(0,ta.YG)(e)?e:null}catch(e){return null}}())?e:"claude"}),2),j=k[0],S=k[1],O=Cm((0,w.useState)({id:"",create:!1}),2),C=O[0],N=O[1];function P(e){S(e);try{localStorage.setItem(Cp,e)}catch(e){}}var E=u.find(function(e){return e.id===(null==f?void 0:f.harnessId)}),I=null!=(e=u.find(function(e){return e.id===j}))?e:u[0],A="history"===l?"history":"workspace";function _(e){N(e),s("favorites")}return(0,x.jsxs)("div",{className:"min-h-[100dvh] bg-background",children:[(0,x.jsx)("header",{className:"sticky top-0 z-20 border-b bg-card/90 backdrop-blur-xl",children:(0,x.jsxs)("div",{className:"flex min-h-20 flex-wrap items-center justify-between gap-x-4 gap-y-2 px-4 py-2 sm:px-6",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,x.jsx)(iY,{className:"size-10 shrink-0 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsxs)("div",{className:"min-w-0",children:[(0,x.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,x.jsx)("h1",{className:"min-w-0 flex-1 truncate text-base font-semibold tracking-tight",children:"harness-switch"}),(0,x.jsx)(OQ,{}),(0,x.jsx)(O0,{}),(0,x.jsx)(OX,{})]}),(0,x.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:c("app.tagline")})]})]}),(0,x.jsx)(un,{label:c("workspace.navigation"),idPrefix:"dashboard",items:[{id:"workspace",icon:tl},{id:"history",icon:ts}],value:A,onChange:s,className:"order-3 flex w-full gap-2 overflow-x-auto border-t pt-2 lg:order-none lg:w-auto lg:border-0 lg:pt-0",tabClassName:"gap-2 px-4 py-3 text-sm font-medium",children:function(e){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(e.icon,{className:"size-4"}),c("workspace.nav."+e.id)]})}}),(0,x.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[(0,x.jsxs)(tr,{variant:"outline",size:"sm",onClick:function(){return v(!0)},children:[(0,x.jsx)(tc,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:c("nav.transfer")})]}),(0,x.jsxs)(tr,{variant:"outline",size:"sm",onClick:function(){return b(!0)},children:[(0,x.jsx)(tu,{}),(0,x.jsx)("span",{className:"hidden sm:inline",children:c("nav.vault")})]}),(0,x.jsx)(d$,{}),(0,x.jsx)(OU,{}),(0,x.jsx)(Cg,{})]})]})}),(0,x.jsx)(uo,{idPrefix:"dashboard",value:A,children:"workspace"===l?(0,x.jsx)(O2,{selectedHarnessId:j,onSelectHarness:P,onConfigure:function(e){P(e),s("tools")},onHistory:function(){return s("history")}},i):"favorites"===l?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Cy,{backLabel:I?c("workspace.backToTool",{name:I.label}):c("workspace.back"),onBack:function(){return s(I?"tools":"workspace")},children:c("workspace.nav.favorites")}),(0,x.jsx)(Og,{initialSelectedId:C.id,startCreating:C.create,startEditing:!!C.edit&&!!C.id},"".concat(i,"/").concat(C.id,"/").concat(C.create,"/").concat(C.edit))]}):"history"===l?(0,x.jsx)(Oz,{},i):(0,x.jsxs)("div",{className:"grid xl:grid-cols-[17rem_minmax(0,1fr)]",children:[(0,x.jsx)("div",{className:"xl:row-span-2",children:(0,x.jsx)(dU,{harnesses:u,value:null==I?void 0:I.id,onChange:P})}),I?(0,x.jsx)(Cy,{backLabel:c("workspace.back"),onBack:function(){return s("workspace")},children:I.label}):null,I?(0,x.jsxs)(uo,{as:"main",idPrefix:"harness",value:I.id,className:"min-w-0 space-y-6 p-4 sm:p-6 xl:p-8",children:[(0,x.jsx)(dt,{harness:I}),(0,x.jsx)(Cf,{harness:I,onNewProfile:function(){return p({harnessId:I.id,profile:null})},onEditProfile:function(e){return p({harnessId:I.id,profile:e})},onCopyProfile:function(e){return p({harnessId:I.id,profile:null,copySource:e})},onOpenTemplate:function(e){return _({id:e,create:!1,edit:!0})},onManageTemplates:function(){return _({id:"",create:!1})},onCreateTemplate:function(){return _({id:"",create:!0})}}),(0,x.jsx)(Cb,{harness:I})]}):null]})}),f&&E?(0,x.jsx)(S4,{harness:E,profile:f.profile,copySource:f.copySource,onOpenChange:function(e){return!e&&p(null)}},"".concat(f.harnessId,"-").concat(null!=(t=null!=(n=null==(r=f.profile)?void 0:r.name)?n:null==(o=f.copySource)?void 0:o.name)?t:"new")):null,(0,x.jsx)(uZ,{open:m,onOpenChange:v}),(0,x.jsx)(ww,{open:y,onOpenChange:b}),(0,x.jsx)(Ox,{})]})}function Cg(){var e=(0,to.Bd)().t,t=iV(function(e){return e.logout}),n=iV(function(e){return e.users}),r=iV(function(e){return e.currentUser}),o=iV(function(e){return e.usersLoading}),i=iV(function(e){return e.switchUser}),a=Cm((0,w.useState)(!1),2),l=a[0],s=a[1];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(OK,{label:e("nav.currentLocalUser"),trigger:(0,x.jsxs)(tr,{variant:"outline",size:"sm",className:"group","aria-label":e("nav.currentLocalUser"),disabled:o,children:[(0,x.jsx)(td,{}),(0,x.jsx)("span",{className:"max-w-28 truncate",children:r||e("nav.localUser")}),(0,x.jsx)(tf,{className:"transition-transform group-aria-expanded:rotate-180"})]}),children:function(a){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(OV,{children:e("nav.currentLocalUser")}),n.map(function(t){var n,l,s,c=!1===t.manageable,u=c?oA(e,{key:t.blockCode?(0,ta.Vz)(t.blockCode):"error.user.notSwitchable",params:t.blockData}):"",d=null!=(n=null==(l=t.blockData)?void 0:l.path)?n:null==(s=t.blockData)?void 0:s.home;return(0,x.jsxs)(Oq,{role:"menuitemradio","aria-checked":t.username===r,disabled:o||t.username===r||c,title:c?[u,d].filter(Boolean).join(" — "):void 0,className:"flex-col items-start",onClick:function(){i(t.username).then(a,function(){})},children:[(0,x.jsxs)("span",{className:"flex w-full items-center gap-1.5",children:[c?(0,x.jsx)(tp,{className:"size-3 shrink-0","aria-hidden":!0}):null,(0,x.jsx)("span",{className:"truncate",children:t.username})]}),c?(0,x.jsx)("span",{className:"mt-0.5 text-xs leading-snug text-muted-foreground",children:u}):null]},t.username)}),(0,x.jsx)(OW,{}),(0,x.jsxs)(Oq,{role:"menuitem",disabled:o,className:"gap-2",onClick:function(){a(),s(!0)},children:[(0,x.jsx)(tu,{className:"size-4"}),e("account.password.title")]}),(0,x.jsxs)(Oq,{role:"menuitem",destructive:!0,disabled:o,className:"gap-2",onClick:function(){t().then(a,function(){})},children:[(0,x.jsx)(th,{className:"size-4"}),e("nav.signOut")]})]})}}),(0,x.jsx)(at,{open:l,onOpenChange:s})]})}function Cy(e){var t=e.backLabel,n=e.onBack,r=e.children,o=(0,to.Bd)().t;return(0,x.jsxs)("nav",{"aria-label":o("workspace.breadcrumb"),className:"flex min-w-0 items-center gap-1 border-b bg-card/30 px-4 py-3 text-sm text-muted-foreground sm:px-6",children:[(0,x.jsxs)(tr,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:n,children:[(0,x.jsx)(tm,{}),t]}),(0,x.jsx)(tv,{className:"size-4 shrink-0","aria-hidden":!0}),(0,x.jsx)("span",{className:"truncate font-medium text-foreground",children:r})]})}function Cb(e){var t=e.harness,n=(0,to.Bd)().t,r=(0,to.s9)().locale,o=iV(function(e){return e.envFile}),i=iV(function(e){return e.backups}).find(function(e){return e.harness===t.id});return(0,x.jsx)("section",{className:"rounded-2xl border bg-card px-5 py-3 shadow-[0_12px_34px_-28px_rgb(36_39_70/0.35)]",children:(0,x.jsxs)(d0,{title:n("workspace.details"),summary:n("workspace.detailsSummary"),triggerClassName:"-mx-3 w-[calc(100%+1.5rem)] justify-start",children:[(0,x.jsxs)("div",{className:"grid gap-6 pt-1 text-sm sm:grid-cols-2",children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(tg,{className:"size-4 text-primary"}),(0,x.jsx)("h4",{className:"text-sm font-semibold",children:n("harness.writeTargets")})]}),(0,x.jsxs)("div",{className:"mt-3 space-y-3",children:[t.targets.map(function(e){return(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:o_(n,e.labelCode,e.label)}),(0,x.jsx)("p",{className:"mt-1 break-all font-mono text-xs leading-relaxed",children:e.path})]},e.key)}),(0,x.jsxs)("div",{children:[(0,x.jsx)("p",{className:"text-xs text-muted-foreground",children:n("harness.writeMode")}),(0,x.jsx)("p",{className:"mt-1 text-sm",children:"replace"===t.mode?n("harness.modeReplace"):n("harness.modeAdditive")})]})]})]}),(0,x.jsxs)("div",{children:[(0,x.jsx)("h4",{className:"font-mono text-[13px] font-semibold",children:n("env.title")}),(0,x.jsx)("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:n("env.intro")}),(0,x.jsxs)("code",{className:"mt-3 block rounded-xl bg-muted/70 px-4 py-3 font-mono text-[13px]",children:["source ",o||"~/.harness-switch/env.sh"]}),(0,x.jsx)("p",{className:"mt-3 leading-relaxed text-muted-foreground",children:n("env.note")})]})]}),(0,x.jsxs)("div",{className:"space-y-5 border-t pt-4 pb-2",children:[(0,x.jsx)(dn,{harness:t}),(0,x.jsx)(ON,{harness:t}),i?(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(ts,{className:"size-4 text-primary"}),(0,x.jsx)("h4",{className:"text-sm font-semibold",children:n("backup.latest")})]}),(0,x.jsxs)("p",{className:"mt-2 truncate text-sm",children:[(0,x.jsx)("span",{className:"font-medium",children:i.profile}),(0,x.jsxs)("span",{className:"text-muted-foreground",children:[" \xb7 ",new Date(i.createdAt).toLocaleString(r)," \xb7 ",n("backup.fileCount",{count:i.files.length})]})]}),(0,x.jsx)("div",{className:"mt-3",children:(0,x.jsx)(iZ,{harnessId:t.id})})]}):null]})]})})}function Cx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cw(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function Ck(){var e,t=(0,to.Bd)().t,n=iV(function(e){return e.login}),r=iV(function(e){return e.loading}),o=function(e){if(Array.isArray(e))return e}(e=(0,w.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return Cx(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Cx(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o[1];return(0,x.jsxs)("main",{className:"grid min-h-[100dvh] lg:grid-cols-2",children:[(0,x.jsxs)("section",{className:"hidden flex-col justify-between border-r bg-card p-10 lg:flex",children:[(0,x.jsxs)("div",{className:"flex items-center gap-3",children:[(0,x.jsx)(iY,{className:"size-9 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")})]}),(0,x.jsxs)("div",{className:"max-w-sm space-y-3",children:[(0,x.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:t("login.title")}),(0,x.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:t("login.intro")})]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(d$,{}),(0,x.jsx)(OU,{})]})]}),(0,x.jsx)("section",{className:"flex items-center justify-center px-4 py-10",children:(0,x.jsxs)("form",{className:"w-full max-w-sm space-y-5",onSubmit:function(e){var t;return(t=function(){var t,r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:s(0)}),l(a,"throw",{value:s(1)}),l(a,"return",{value:s(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function s(l){return function(s){var c=[l,s];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:e.preventDefault(),t=new FormData(e.currentTarget),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n(String(null!=(r=t.get("password"))?r:""))];case 2:return o.sent(),[3,4];case 3:return a(oP(o.sent())),[3,4];case 4:return[2]}})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(e){Cw(i,r,o,a,l,"next",e)}function l(e){Cw(i,r,o,a,l,"throw",e)}a(void 0)})})()},children:[(0,x.jsxs)("div",{className:"flex items-start justify-between gap-3 lg:hidden",children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(iY,{className:"size-7 ring-1 ring-black/5 dark:ring-white/10"}),(0,x.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:t("app.brandMark")})]}),(0,x.jsx)("h1",{className:"mt-2 text-2xl font-semibold tracking-tight",children:t("login.title")})]}),(0,x.jsxs)("div",{className:"flex gap-2",children:[(0,x.jsx)(d$,{}),(0,x.jsx)(OU,{})]})]}),(0,x.jsx)("p",{className:"text-sm text-muted-foreground",children:t("login.hint")}),(0,x.jsxs)("div",{className:"space-y-2",children:[(0,x.jsx)(iQ,{htmlFor:"password",children:t("login.password")}),(0,x.jsx)(i4,{id:"password",name:"password",type:"password",autoFocus:!0,required:!0})]}),i?(0,x.jsx)("p",{className:"text-sm text-destructive",children:oA(t,i)}):null,(0,x.jsx)(tr,{className:"w-full",type:"submit",disabled:r,children:t(r?"login.submitting":"login.submit")})]})})]})}(0,j.createRoot)(document.getElementById("root")).render((0,x.jsx)(w.StrictMode,{children:(0,x.jsx)(to.CY,{children:(0,x.jsx)(function(){var e=(0,to.Bd)().t,t=iV(function(e){return e.sessionChecked}),n=iV(function(e){return e.authenticated}),r=iV(function(e){return e.loadSession});return((0,w.useEffect)(function(){r()},[r]),t)?(0,x.jsxs)(x.Fragment,{children:[n?(0,x.jsx)(Cv,{}):(0,x.jsx)(Ck,{}),(0,x.jsx)(ti,{})]}):(0,x.jsx)("div",{className:"flex min-h-[100dvh] items-center justify-center text-sm text-muted-foreground",children:e("app.checkingSession")})},{})})}))})()})();