diff --git "a/assets/index-B2gd44R1.js" "b/assets/index-B2gd44R1.js" new file mode 100644--- /dev/null +++ "b/assets/index-B2gd44R1.js" @@ -0,0 +1,132 @@ +var Dv=Object.defineProperty;var Fv=(n,o,i)=>o in n?Dv(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i;var rt=(n,o,i)=>Fv(n,typeof o!="symbol"?o+"":o,i);function Vv(n,o){for(var i=0;il[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(u){if(u.ep)return;u.ep=!0;const c=i(u);fetch(u.href,c)}})();function mm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Su={exports:{}},gi={},ku={exports:{}},_e={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var np;function $v(){if(np)return _e;np=1;var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.iterator;function S(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function w(R,Y,ue){this.props=R,this.context=Y,this.refs=C,this.updater=ue||b}w.prototype.isReactComponent={},w.prototype.setState=function(R,Y){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,Y,"setState")},w.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function N(){}N.prototype=w.prototype;function D(R,Y,ue){this.props=R,this.context=Y,this.refs=C,this.updater=ue||b}var T=D.prototype=new N;T.constructor=D,k(T,w.prototype),T.isPureReactComponent=!0;var O=Array.isArray,j=Object.prototype.hasOwnProperty,F={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function A(R,Y,ue){var ce,le={},oe=null,he=null;if(Y!=null)for(ce in Y.ref!==void 0&&(he=Y.ref),Y.key!==void 0&&(oe=""+Y.key),Y)j.call(Y,ce)&&!W.hasOwnProperty(ce)&&(le[ce]=Y[ce]);var xe=arguments.length-2;if(xe===1)le.children=ue;else if(1>>1,Y=I[R];if(0>>1;Ru(le,B))oeu(he,le)?(I[R]=he,I[oe]=B,R=oe):(I[R]=le,I[ce]=B,R=ce);else if(oeu(he,B))I[R]=he,I[oe]=B,R=oe;else break e}}return q}function u(I,q){var B=I.sortIndex-q.sortIndex;return B!==0?B:I.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var h=[],m=[],v=1,g=null,S=3,b=!1,k=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(I){for(var q=i(m);q!==null;){if(q.callback===null)l(m);else if(q.startTime<=I)l(m),q.sortIndex=q.expirationTime,o(h,q);else break;q=i(m)}}function O(I){if(C=!1,T(I),!k)if(i(h)!==null)k=!0,X(j);else{var q=i(m);q!==null&&Q(O,q.startTime-I)}}function j(I,q){k=!1,C&&(C=!1,N(A),A=-1),b=!0;var B=S;try{for(T(q),g=i(h);g!==null&&(!(g.expirationTime>q)||I&&!te());){var R=g.callback;if(typeof R=="function"){g.callback=null,S=g.priorityLevel;var Y=R(g.expirationTime<=q);q=n.unstable_now(),typeof Y=="function"?g.callback=Y:g===i(h)&&l(h),T(q)}else l(h);g=i(h)}if(g!==null)var ue=!0;else{var ce=i(m);ce!==null&&Q(O,ce.startTime-q),ue=!1}return ue}finally{g=null,S=B,b=!1}}var F=!1,W=null,A=-1,$=5,ne=-1;function te(){return!(n.unstable_now()-ne<$)}function L(){if(W!==null){var I=n.unstable_now();ne=I;var q=!0;try{q=W(!0,I)}finally{q?K():(F=!1,W=null)}}else F=!1}var K;if(typeof D=="function")K=function(){D(L)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,z=G.port2;G.port1.onmessage=L,K=function(){z.postMessage(null)}}else K=function(){w(L,0)};function X(I){W=I,F||(F=!0,K())}function Q(I,q){A=w(function(){I(n.unstable_now())},q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_continueExecution=function(){k||b||(k=!0,X(j))},n.unstable_forceFrameRate=function(I){0>I||125R?(I.sortIndex=B,o(m,I),i(h)===null&&I===i(m)&&(C?(N(A),A=-1):C=!0,Q(O,B-R))):(I.sortIndex=Y,o(h,I),k||b||(k=!0,X(j))),I},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(I){var q=S;return function(){var B=S;S=q;try{return I.apply(this,arguments)}finally{S=B}}}})(Cu)),Cu}var lp;function Wv(){return lp||(lp=1,Eu.exports=Hv()),Eu.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ap;function Kv(){if(ap)return jt;ap=1;var n=Ii(),o=Wv();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},g={};function S(e){return h.call(g,e)?!0:h.call(v,e)?!1:m.test(e)?g[e]=!0:(v[e]=!0,!1)}function b(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,r,s){if(t===null||typeof t>"u"||b(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,r,s,a,d,x){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=x}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){w[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];w[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){w[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){w[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){w[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){w[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){w[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){w[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){w[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function D(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(N,D);w[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(N,D);w[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(N,D);w[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){w[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),w.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){w[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function T(e,t,r,s){var a=w.hasOwnProperty(t)?w[t]:null;(a!==null?a.type!==0:s||!(2_||a[x]!==d[_]){var P=` +`+a[x].replace(" at new "," at ");return e.displayName&&P.includes("")&&(P=P.replace("",e.displayName)),P}while(1<=x&&0<=_);break}}}finally{ue=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Y(e):""}function le(e){switch(e.tag){case 5:return Y(e.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function oe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case F:return"Portal";case $:return"Profiler";case A:return"StrictMode";case K:return"Suspense";case G:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case te:return(e.displayName||"Context")+".Consumer";case ne:return(e._context.displayName||"Context")+".Provider";case L:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:oe(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function he(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oe(t);case 8:return t===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Te(e){var t=fe(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(x){s=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ke(e){e._valueTracker||(e._valueTracker=Te(e))}function Wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=fe(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Et(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function it(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Lt(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=xe(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rn(e,t){t=t.checked,t!=null&&T(e,"checked",t,!1)}function Kt(e,t){rn(e,t);var r=xe(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Mn(e,t.type,xe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cr(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Mn(e,t,r){(t!=="number"||Et(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Re=Array.isArray;function ie(e,t,r,s){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=yn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function zt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ve={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sn=["Webkit","ms","Moz","O"];Object.keys(Ve).forEach(function(e){sn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ve[t]=Ve[e]})});function ln(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ve.hasOwnProperty(e)&&Ve[e]?(""+t).trim():t+"px"}function _r(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,a=ln(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,a):e[r]=a}}var Jr=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zn(e,t){if(t){if(Jr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Jn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var er=null;function je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ye=null,ut=null,et=null;function Gt(e){if(e=ti(e)){if(typeof Ye!="function")throw Error(i(280));var t=e.stateNode;t&&(t=as(t),Ye(e.stateNode,e.type,t))}}function Ct(e){ut?et?et.push(e):et=[e]:ut=e}function xn(){if(ut){var e=ut,t=et;if(et=ut=null,Gt(e),t)for(e=0;e>>=0,e===0?32:31-(eg(e)/tg|0)|0}var Hi=64,Wi=4194304;function zo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ki(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,a=e.suspendedLanes,d=e.pingedLanes,x=r&268435455;if(x!==0){var _=x&~a;_!==0?s=zo(_):(d&=x,d!==0&&(s=zo(d)))}else x=r&~a,x!==0?s=zo(x):d!==0&&(s=zo(d));if(s===0)return 0;if(t!==0&&t!==s&&(t&a)===0&&(a=s&-s,d=t&-t,a>=d||a===16&&(d&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0r;r++)t.push(e);return t}function Do(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=r}function ig(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Ko),Gc=" ",Qc=!1;function Xc(e,t){switch(e){case"keyup":return Og.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oo=!1;function Lg(e,t){switch(e){case"compositionend":return qc(t);case"keypress":return t.which!==32?null:(Qc=!0,Gc);case"textInput":return e=t.data,e===Gc&&Qc?null:e;default:return null}}function Ag(e,t){if(oo)return e==="compositionend"||!ta&&Xc(e,t)?(e=Uc(),qi=Ql=ir=null,oo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=od(r)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ld(){for(var e=window,t=Et();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Et(e.document)}return t}function oa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wg(e){var t=ld(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&sd(r.ownerDocument.documentElement,r)){if(s!==null&&oa(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,d=Math.min(s.start,a);s=s.end===void 0?d:Math.min(s.end,a),!e.extend&&d>s&&(a=s,s=d,d=a),a=id(r,d);var x=id(r,s);a&&x&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==x.node||e.focusOffset!==x.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),d>s?(e.addRange(t),e.extend(x.node,x.offset)):(t.setEnd(x.node,x.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,io=null,ia=null,Xo=null,sa=!1;function ad(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;sa||io==null||io!==Et(s)||(s=io,"selectionStart"in s&&oa(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Xo&&Qo(Xo,s)||(Xo=s,s=is(ia,"onSelect"),0co||(e.current=ya[co],ya[co]=null,co--)}function De(e,t){co++,ya[co]=e.current,e.current=t}var ur={},ft=ar(ur),_t=ar(!1),Nr=ur;function fo(e,t){var r=e.type.contextTypes;if(!r)return ur;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var a={},d;for(d in r)a[d]=t[d];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Rt(e){return e=e.childContextTypes,e!=null}function us(){Ue(_t),Ue(ft)}function bd(e,t,r){if(ft.current!==ur)throw Error(i(168));De(ft,t),De(_t,r)}function Ed(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var a in s)if(!(a in t))throw Error(i(108,he(e)||"Unknown",a));return B({},r,s)}function cs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ur,Nr=ft.current,De(ft,e),De(_t,_t.current),!0}function Cd(e,t,r){var s=e.stateNode;if(!s)throw Error(i(169));r?(e=Ed(e,t,Nr),s.__reactInternalMemoizedMergedChildContext=e,Ue(_t),Ue(ft),De(ft,e)):Ue(_t),De(_t,r)}var zn=null,ds=!1,xa=!1;function _d(e){zn===null?zn=[e]:zn.push(e)}function rv(e){ds=!0,_d(e)}function cr(){if(!xa&&zn!==null){xa=!0;var e=0,t=Le;try{var r=zn;for(Le=1;e>=x,a-=x,Dn=1<<32-un(t)+a|r<be?(at=Se,Se=null):at=Se.sibling;var Me=Z(V,Se,U[be],re);if(Me===null){Se===null&&(Se=at);break}e&&Se&&Me.alternate===null&&t(V,Se),M=d(Me,M,be),we===null?ye=Me:we.sibling=Me,we=Me,Se=at}if(be===U.length)return r(V,Se),Be&&Mr(V,be),ye;if(Se===null){for(;bebe?(at=Se,Se=null):at=Se.sibling;var xr=Z(V,Se,Me.value,re);if(xr===null){Se===null&&(Se=at);break}e&&Se&&xr.alternate===null&&t(V,Se),M=d(xr,M,be),we===null?ye=xr:we.sibling=xr,we=xr,Se=at}if(Me.done)return r(V,Se),Be&&Mr(V,be),ye;if(Se===null){for(;!Me.done;be++,Me=U.next())Me=ee(V,Me.value,re),Me!==null&&(M=d(Me,M,be),we===null?ye=Me:we.sibling=Me,we=Me);return Be&&Mr(V,be),ye}for(Se=s(V,Se);!Me.done;be++,Me=U.next())Me=ae(Se,V,be,Me.value,re),Me!==null&&(e&&Me.alternate!==null&&Se.delete(Me.key===null?be:Me.key),M=d(Me,M,be),we===null?ye=Me:we.sibling=Me,we=Me);return e&&Se.forEach(function(zv){return t(V,zv)}),Be&&Mr(V,be),ye}function qe(V,M,U,re){if(typeof U=="object"&&U!==null&&U.type===W&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case j:e:{for(var ye=U.key,we=M;we!==null;){if(we.key===ye){if(ye=U.type,ye===W){if(we.tag===7){r(V,we.sibling),M=a(we,U.props.children),M.return=V,V=M;break e}}else if(we.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===X&&Md(ye)===we.type){r(V,we.sibling),M=a(we,U.props),M.ref=ni(V,we,U),M.return=V,V=M;break e}r(V,we);break}else t(V,we);we=we.sibling}U.type===W?(M=Vr(U.props.children,V.mode,re,U.key),M.return=V,V=M):(re=Fs(U.type,U.key,U.props,null,V.mode,re),re.ref=ni(V,M,U),re.return=V,V=re)}return x(V);case F:e:{for(we=U.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===U.containerInfo&&M.stateNode.implementation===U.implementation){r(V,M.sibling),M=a(M,U.children||[]),M.return=V,V=M;break e}else{r(V,M);break}else t(V,M);M=M.sibling}M=gu(U,V.mode,re),M.return=V,V=M}return x(V);case X:return we=U._init,qe(V,M,we(U._payload),re)}if(Re(U))return pe(V,M,U,re);if(q(U))return ve(V,M,U,re);hs(V,U)}return typeof U=="string"&&U!==""||typeof U=="number"?(U=""+U,M!==null&&M.tag===6?(r(V,M.sibling),M=a(M,U),M.return=V,V=M):(r(V,M),M=hu(U,V.mode,re),M.return=V,V=M),x(V)):r(V,M)}return qe}var go=Od(!0),Id=Od(!1),gs=ar(null),vs=null,vo=null,Ca=null;function _a(){Ca=vo=vs=null}function Ra(e){var t=gs.current;Ue(gs),e._currentValue=t}function Pa(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function yo(e,t){vs=e,Ca=vo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Pt=!0),e.firstContext=null)}function qt(e){var t=e._currentValue;if(Ca!==e)if(e={context:e,memoizedValue:t,next:null},vo===null){if(vs===null)throw Error(i(308));vo=e,vs.dependencies={lanes:0,firstContext:e}}else vo=vo.next=e;return t}var Or=null;function Ta(e){Or===null?Or=[e]:Or.push(e)}function Ld(e,t,r,s){var a=t.interleaved;return a===null?(r.next=r,Ta(t)):(r.next=a.next,a.next=r),t.interleaved=r,Vn(e,s)}function Vn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var dr=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ad(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $n(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ne&2)!==0){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,Vn(e,r)}return a=s.interleaved,a===null?(t.next=t,Ta(s)):(t.next=a.next,a.next=t),s.interleaved=t,Vn(e,r)}function ys(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Hl(e,r)}}function zd(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var a=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var x={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};d===null?a=d=x:d=d.next=x,r=r.next}while(r!==null);d===null?a=d=t:d=d.next=t}else a=d=t;r={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:d,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function xs(e,t,r,s){var a=e.updateQueue;dr=!1;var d=a.firstBaseUpdate,x=a.lastBaseUpdate,_=a.shared.pending;if(_!==null){a.shared.pending=null;var P=_,H=P.next;P.next=null,x===null?d=H:x.next=H,x=P;var J=e.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==x&&(_===null?J.firstBaseUpdate=H:_.next=H,J.lastBaseUpdate=P))}if(d!==null){var ee=a.baseState;x=0,J=H=P=null,_=d;do{var Z=_.lane,ae=_.eventTime;if((s&Z)===Z){J!==null&&(J=J.next={eventTime:ae,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var pe=e,ve=_;switch(Z=t,ae=r,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){ee=pe.call(ae,ee,Z);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,Z=typeof pe=="function"?pe.call(ae,ee,Z):pe,Z==null)break e;ee=B({},ee,Z);break e;case 2:dr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,Z=a.effects,Z===null?a.effects=[_]:Z.push(_))}else ae={eventTime:ae,lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(H=J=ae,P=ee):J=J.next=ae,x|=Z;if(_=_.next,_===null){if(_=a.shared.pending,_===null)break;Z=_,_=Z.next,Z.next=null,a.lastBaseUpdate=Z,a.shared.pending=null}}while(!0);if(J===null&&(P=ee),a.baseState=P,a.firstBaseUpdate=H,a.lastBaseUpdate=J,t=a.shared.interleaved,t!==null){a=t;do x|=a.lane,a=a.next;while(a!==t)}else d===null&&(a.shared.lanes=0);Ar|=x,e.lanes=x,e.memoizedState=ee}}function Dd(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var s=La.transition;La.transition={};try{e(!1),t()}finally{Le=r,La.transition=s}}function rf(){return Zt().memoizedState}function lv(e,t,r){var s=gr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},of(e))sf(t,r);else if(r=Ld(e,t,r,s),r!==null){var a=wt();hn(r,e,s,a),lf(r,t,s)}}function av(e,t,r){var s=gr(e),a={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(of(e))sf(t,a);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,_=d(x,r);if(a.hasEagerState=!0,a.eagerState=_,cn(_,x)){var P=t.interleaved;P===null?(a.next=a,Ta(t)):(a.next=P.next,P.next=a),t.interleaved=a;return}}catch{}finally{}r=Ld(e,t,a,s),r!==null&&(a=wt(),hn(r,e,s,a),lf(r,t,s))}}function of(e){var t=e.alternate;return e===We||t!==null&&t===We}function sf(e,t){si=ks=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function lf(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Hl(e,r)}}var Cs={readContext:qt,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},uv={readContext:qt,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:Qd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,bs(4194308,4,Zd.bind(null,t,e),r)},useLayoutEffect:function(e,t){return bs(4194308,4,e,t)},useInsertionEffect:function(e,t){return bs(4,2,e,t)},useMemo:function(e,t){var r=Cn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=Cn();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=lv.bind(null,We,e),[s.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:Yd,useDebugValue:Ua,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Yd(!1),t=e[0];return e=sv.bind(null,e[1]),Cn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=We,a=Cn();if(Be){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),lt===null)throw Error(i(349));(Lr&30)!==0||Ud(s,t,r)}a.memoizedState=r;var d={value:r,getSnapshot:t};return a.queue=d,Qd(Hd.bind(null,s,d,e),[e]),s.flags|=2048,ui(9,Bd.bind(null,s,d,r,t),void 0,null),r},useId:function(){var e=Cn(),t=lt.identifierPrefix;if(Be){var r=Fn,s=Dn;r=(s&~(1<<32-un(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=li++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=x.createElement(r,{is:s.is}):(e=x.createElement(r),r==="select"&&(x=e,s.multiple?x.multiple=!0:s.size&&(x.size=s.size))):e=x.createElementNS(e,r),e[bn]=t,e[ei]=s,Rf(e,t,!1,!1),t.stateNode=e;e:{switch(x=Jn(r,s),r){case"dialog":$e("cancel",e),$e("close",e),a=s;break;case"iframe":case"object":case"embed":$e("load",e),a=s;break;case"video":case"audio":for(a=0;abo&&(t.flags|=128,s=!0,ci(d,!1),t.lanes=4194304)}else{if(!s)if(e=ws(x),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ci(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!Be)return mt(t),null}else 2*Xe()-d.renderingStartTime>bo&&r!==1073741824&&(t.flags|=128,s=!0,ci(d,!1),t.lanes=4194304);d.isBackwards?(x.sibling=t.child,t.child=x):(r=d.last,r!==null?r.sibling=x:t.child=x,d.last=x)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Xe(),t.sibling=null,r=He.current,De(He,s?r&1|2:r&1),t):(mt(t),null);case 22:case 23:return fu(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?($t&1073741824)!==0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function vv(e,t){switch(Sa(t),t.tag){case 1:return Rt(t.type)&&us(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),Ue(_t),Ue(ft),Ia(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ma(t),null;case 13:if(Ue(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(He),null;case 4:return xo(),null;case 10:return Ra(t.type._context),null;case 22:case 23:return fu(),null;case 24:return null;default:return null}}var Ts=!1,ht=!1,yv=typeof WeakSet=="function"?WeakSet:Set,de=null;function So(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){Ge(e,t,s)}else r.current=null}function eu(e,t,r){try{r()}catch(s){Ge(e,t,s)}}var Nf=!1;function xv(e,t){if(fa=Qi,e=ld(),oa(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var a=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var x=0,_=-1,P=-1,H=0,J=0,ee=e,Z=null;t:for(;;){for(var ae;ee!==r||a!==0&&ee.nodeType!==3||(_=x+a),ee!==d||s!==0&&ee.nodeType!==3||(P=x+s),ee.nodeType===3&&(x+=ee.nodeValue.length),(ae=ee.firstChild)!==null;)Z=ee,ee=ae;for(;;){if(ee===e)break t;if(Z===r&&++H===a&&(_=x),Z===d&&++J===s&&(P=x),(ae=ee.nextSibling)!==null)break;ee=Z,Z=ee.parentNode}ee=ae}r=_===-1||P===-1?null:{start:_,end:P}}else r=null}r=r||{start:0,end:0}}else r=null;for(pa={focusedElem:e,selectionRange:r},Qi=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,qe=pe.memoizedState,V=t.stateNode,M=V.getSnapshotBeforeUpdate(t.elementType===t.type?ve:fn(t.type,ve),qe);V.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var U=t.stateNode.containerInfo;U.nodeType===1?U.textContent="":U.nodeType===9&&U.documentElement&&U.removeChild(U.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(re){Ge(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return pe=Nf,Nf=!1,pe}function di(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&e)===e){var d=a.destroy;a.destroy=void 0,d!==void 0&&eu(t,r,d)}a=a.next}while(a!==s)}}function Ns(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function tu(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function jf(e){var t=e.alternate;t!==null&&(e.alternate=null,jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bn],delete t[ei],delete t[va],delete t[tv],delete t[nv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mf(e){return e.tag===5||e.tag===3||e.tag===4}function Of(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nu(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ls));else if(s!==4&&(e=e.child,e!==null))for(nu(e,t,r),e=e.sibling;e!==null;)nu(e,t,r),e=e.sibling}function ru(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(ru(e,t,r),e=e.sibling;e!==null;)ru(e,t,r),e=e.sibling}var ct=null,pn=!1;function pr(e,t,r){for(r=r.child;r!==null;)If(e,t,r),r=r.sibling}function If(e,t,r){if(kn&&typeof kn.onCommitFiberUnmount=="function")try{kn.onCommitFiberUnmount(Bi,r)}catch{}switch(r.tag){case 5:ht||So(r,t);case 6:var s=ct,a=pn;ct=null,pr(e,t,r),ct=s,pn=a,ct!==null&&(pn?(e=ct,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ct.removeChild(r.stateNode));break;case 18:ct!==null&&(pn?(e=ct,r=r.stateNode,e.nodeType===8?ga(e.parentNode,r):e.nodeType===1&&ga(e,r),Bo(e)):ga(ct,r.stateNode));break;case 4:s=ct,a=pn,ct=r.stateNode.containerInfo,pn=!0,pr(e,t,r),ct=s,pn=a;break;case 0:case 11:case 14:case 15:if(!ht&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){a=s=s.next;do{var d=a,x=d.destroy;d=d.tag,x!==void 0&&((d&2)!==0||(d&4)!==0)&&eu(r,t,x),a=a.next}while(a!==s)}pr(e,t,r);break;case 1:if(!ht&&(So(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(_){Ge(r,t,_)}pr(e,t,r);break;case 21:pr(e,t,r);break;case 22:r.mode&1?(ht=(s=ht)||r.memoizedState!==null,pr(e,t,r),ht=s):pr(e,t,r);break;default:pr(e,t,r)}}function Lf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yv),t.forEach(function(s){var a=Pv.bind(null,e,s);r.has(s)||(r.add(s),s.then(a,a))})}}function mn(e,t){var r=t.deletions;if(r!==null)for(var s=0;sa&&(a=x),s&=~d}if(s=a,s=Xe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Sv(s/1960))-s,10e?16:e,hr===null)var s=!1;else{if(e=hr,hr=null,Ls=0,(Ne&6)!==0)throw Error(i(331));var a=Ne;for(Ne|=4,de=e.current;de!==null;){var d=de,x=d.child;if((de.flags&16)!==0){var _=d.deletions;if(_!==null){for(var P=0;P<_.length;P++){var H=_[P];for(de=H;de!==null;){var J=de;switch(J.tag){case 0:case 11:case 15:di(8,J,d)}var ee=J.child;if(ee!==null)ee.return=J,de=ee;else for(;de!==null;){J=de;var Z=J.sibling,ae=J.return;if(jf(J),J===H){de=null;break}if(Z!==null){Z.return=ae,de=Z;break}de=ae}}}var pe=d.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var qe=ve.sibling;ve.sibling=null,ve=qe}while(ve!==null)}}de=d}}if((d.subtreeFlags&2064)!==0&&x!==null)x.return=d,de=x;else e:for(;de!==null;){if(d=de,(d.flags&2048)!==0)switch(d.tag){case 0:case 11:case 15:di(9,d,d.return)}var V=d.sibling;if(V!==null){V.return=d.return,de=V;break e}de=d.return}}var M=e.current;for(de=M;de!==null;){x=de;var U=x.child;if((x.subtreeFlags&2064)!==0&&U!==null)U.return=x,de=U;else e:for(x=M;de!==null;){if(_=de,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Ns(9,_)}}catch(ye){Ge(_,_.return,ye)}if(_===x){de=null;break e}var re=_.sibling;if(re!==null){re.return=_.return,de=re;break e}de=_.return}}if(Ne=a,cr(),kn&&typeof kn.onPostCommitFiberRoot=="function")try{kn.onPostCommitFiberRoot(Bi,e)}catch{}s=!0}return s}finally{Le=r,Jt.transition=t}}return!1}function Yf(e,t,r){t=wo(r,t),t=df(e,t,1),e=fr(e,t,1),t=wt(),e!==null&&(Do(e,1,t),Nt(e,t))}function Ge(e,t,r){if(e.tag===3)Yf(e,e,r);else for(;t!==null;){if(t.tag===3){Yf(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(mr===null||!mr.has(s))){e=wo(r,e),e=ff(t,e,1),t=fr(t,e,1),e=wt(),t!==null&&(Do(t,1,e),Nt(t,e));break}}t=t.return}}function _v(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&r,lt===e&&(dt&r)===r&&(nt===4||nt===3&&(dt&130023424)===dt&&500>Xe()-su?Dr(e,0):iu|=r),Nt(e,t)}function Gf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Wi,Wi<<=1,(Wi&130023424)===0&&(Wi=4194304)));var r=wt();e=Vn(e,t),e!==null&&(Do(e,t,r),Nt(e,r))}function Rv(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Gf(e,r)}function Pv(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(i(314))}s!==null&&s.delete(t),Gf(e,r)}var Qf;Qf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)Pt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Pt=!1,hv(e,t,r);Pt=(e.flags&131072)!==0}else Pt=!1,Be&&(t.flags&1048576)!==0&&Rd(t,ps,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;Ps(e,t),e=t.pendingProps;var a=fo(t,ft.current);yo(t,r),a=za(null,t,s,e,a,r);var d=Da();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Rt(s)?(d=!0,cs(t)):d=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Na(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,Ha(t,s,e,r),t=Ga(null,t,s,!0,d,r)):(t.tag=0,Be&&d&&wa(t),xt(null,t,a,r),t=t.child),t;case 16:s=t.elementType;e:{switch(Ps(e,t),e=t.pendingProps,a=s._init,s=a(s._payload),t.type=s,a=t.tag=Nv(s),e=fn(s,e),a){case 0:t=Ya(null,t,s,e,r);break e;case 1:t=Sf(null,t,s,e,r);break e;case 11:t=gf(null,t,s,e,r);break e;case 14:t=vf(null,t,s,fn(s.type,e),r);break e}throw Error(i(306,s,""))}return t;case 0:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:fn(s,a),Ya(e,t,s,a,r);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:fn(s,a),Sf(e,t,s,a,r);case 3:e:{if(kf(t),e===null)throw Error(i(387));s=t.pendingProps,d=t.memoizedState,a=d.element,Ad(e,t),xs(t,s,null,r);var x=t.memoizedState;if(s=x.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){a=wo(Error(i(423)),t),t=bf(e,t,s,r,a);break e}else if(s!==a){a=wo(Error(i(424)),t),t=bf(e,t,s,r,a);break e}else for(Vt=lr(t.stateNode.containerInfo.firstChild),Ft=t,Be=!0,dn=null,r=Id(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ho(),s===a){t=Un(e,t,r);break e}xt(e,t,s,r)}t=t.child}return t;case 5:return Fd(t),e===null&&ba(t),s=t.type,a=t.pendingProps,d=e!==null?e.memoizedProps:null,x=a.children,ma(s,a)?x=null:d!==null&&ma(s,d)&&(t.flags|=32),wf(e,t),xt(e,t,x,r),t.child;case 6:return e===null&&ba(t),null;case 13:return Ef(e,t,r);case 4:return ja(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=go(t,null,s,r):xt(e,t,s,r),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:fn(s,a),gf(e,t,s,a,r);case 7:return xt(e,t,t.pendingProps,r),t.child;case 8:return xt(e,t,t.pendingProps.children,r),t.child;case 12:return xt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,a=t.pendingProps,d=t.memoizedProps,x=a.value,De(gs,s._currentValue),s._currentValue=x,d!==null)if(cn(d.value,x)){if(d.children===a.children&&!_t.current){t=Un(e,t,r);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var _=d.dependencies;if(_!==null){x=d.child;for(var P=_.firstContext;P!==null;){if(P.context===s){if(d.tag===1){P=$n(-1,r&-r),P.tag=2;var H=d.updateQueue;if(H!==null){H=H.shared;var J=H.pending;J===null?P.next=P:(P.next=J.next,J.next=P),H.pending=P}}d.lanes|=r,P=d.alternate,P!==null&&(P.lanes|=r),Pa(d.return,r,t),_.lanes|=r;break}P=P.next}}else if(d.tag===10)x=d.type===t.type?null:d.child;else if(d.tag===18){if(x=d.return,x===null)throw Error(i(341));x.lanes|=r,_=x.alternate,_!==null&&(_.lanes|=r),Pa(x,r,t),x=d.sibling}else x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===t){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}xt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,yo(t,r),a=qt(a),s=s(a),t.flags|=1,xt(e,t,s,r),t.child;case 14:return s=t.type,a=fn(s,t.pendingProps),a=fn(s.type,a),vf(e,t,s,a,r);case 15:return yf(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:fn(s,a),Ps(e,t),t.tag=1,Rt(s)?(e=!0,cs(t)):e=!1,yo(t,r),uf(t,s,a),Ha(t,s,a,r),Ga(null,t,s,!0,e,r);case 19:return _f(e,t,r);case 22:return xf(e,t,r)}throw Error(i(156,t.tag))};function Xf(e,t){return Pc(e,t)}function Tv(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,r,s){return new Tv(e,t,r,s)}function mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nv(e){if(typeof e=="function")return mu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===L)return 11;if(e===z)return 14}return 2}function yr(e,t){var r=e.alternate;return r===null?(r=en(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Fs(e,t,r,s,a,d){var x=2;if(s=e,typeof e=="function")mu(e)&&(x=1);else if(typeof e=="string")x=5;else e:switch(e){case W:return Vr(r.children,a,d,t);case A:x=8,a|=8;break;case $:return e=en(12,r,t,a|2),e.elementType=$,e.lanes=d,e;case K:return e=en(13,r,t,a),e.elementType=K,e.lanes=d,e;case G:return e=en(19,r,t,a),e.elementType=G,e.lanes=d,e;case Q:return Vs(r,a,d,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:x=10;break e;case te:x=9;break e;case L:x=11;break e;case z:x=14;break e;case X:x=16,s=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=en(x,r,t,a),t.elementType=e,t.type=s,t.lanes=d,t}function Vr(e,t,r,s){return e=en(7,e,s,t),e.lanes=r,e}function Vs(e,t,r,s){return e=en(22,e,s,t),e.elementType=Q,e.lanes=r,e.stateNode={isHidden:!1},e}function hu(e,t,r){return e=en(6,e,null,t),e.lanes=r,e}function gu(e,t,r){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jv(e,t,r,s,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bl(0),this.expirationTimes=Bl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bl(0),this.identifierPrefix=s,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function vu(e,t,r,s,a,d,x,_,P){return e=new jv(e,t,r,_,P),t===1?(t=1,d===!0&&(t|=8)):t=0,d=en(3,null,null,t),e.current=d,d.stateNode=e,d.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(d),e}function Mv(e,t,r){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),bu.exports=Kv(),bu.exports}var cp;function Yv(){if(cp)return Ys;cp=1;var n=vm();return Ys.createRoot=n.createRoot,Ys.hydrateRoot=n.hydrateRoot,Ys}var Gv=Yv();const Qv=mm(Gv);async function vi(n){const o=await fetch(n);if(!o.ok)throw new Error(`${n}: ${o.status} ${o.statusText}`);return o.json()}function Xv(){const[n,o]=E.useState(null),[i,l]=E.useState(null);return E.useEffect(()=>{let u=!1;return(async()=>{try{const[c,f,p,h]=await Promise.all([vi("/data/summary.json"),vi("/data/clusters.json"),vi("/data/prs.json"),vi("/data/contributors.json")]);let m=[];if(c.pr_scope_available)try{m=await vi("/data/pr_scope_clusters.json")}catch{}u||o({summary:c,clusters:f,prs:p,contributors:h,prScopeClusters:m})}catch(c){u||l(c.message)}})(),()=>{u=!0}},[]),{data:n,error:i}}function Hn(n,o,i){return n&&o.includes(n)?n:i}function qv(){return typeof window>"u"?new URLSearchParams:new URLSearchParams(window.location.search)}function Zv(){const n=qv();return{activeTab:Hn(n.get("tab"),["clusters","prs","contributors","pr_scope"],"prs"),focusMode:Hn(n.get("focus"),["first","all","known"],"all"),selectedClusterId:n.get("cluster"),prSortKey:Hn(n.get("pr_sort"),["updated_at","size","automation_risk"],"updated_at"),prSortDirection:Hn(n.get("pr_dir"),["asc","desc"],"desc"),prFilter:Hn(n.get("pr_filter"),["open","all","flagged","clustered","unclustered","merged"],"open"),clusterSortKey:Hn(n.get("cluster_sort"),["recent_pr_count","pr_count","last_activity_at","flagged_prs"],"recent_pr_count"),prScopeSortKey:Hn(n.get("scope_sort"),["recent_pr_count","pr_count","average_similarity","last_activity_at"],"average_similarity"),contributorSortKey:Hn(n.get("contrib_sort"),["recent_pr_count","snapshot_pr_count","cluster_count","status","follow_through_score","automation_risk_signal","public_pr_count_42d","public_repo_count_42d"],"recent_pr_count"),contributorSortDirection:Hn(n.get("contrib_dir"),["asc","desc"],"desc")}}function Jv(){const n=E.useMemo(Zv,[]),[o,i]=E.useState(n.activeTab),[l,u]=E.useState(n.focusMode),[c,f]=E.useState(n.selectedClusterId),[p,h]=E.useState(n.prSortKey),[m,v]=E.useState(n.prSortDirection),[g,S]=E.useState(n.prFilter),[b,k]=E.useState(n.clusterSortKey),[C,w]=E.useState(n.prScopeSortKey),[N,D]=E.useState(n.contributorSortKey),[T,O]=E.useState(n.contributorSortDirection);return E.useEffect(()=>{const j=new URLSearchParams;j.set("tab",o),j.set("focus",l),j.set("pr_sort",p),j.set("pr_dir",m),j.set("pr_filter",g),j.set("cluster_sort",b),j.set("scope_sort",C),j.set("contrib_sort",N),j.set("contrib_dir",T),c&&j.set("cluster",c),window.history.replaceState(null,"",`${window.location.pathname}?${j}`)},[o,l,p,m,g,b,C,N,T,c]),{activeTab:o,setActiveTab:i,focusMode:l,setFocusMode:u,selectedClusterId:c,setSelectedClusterId:f,prSortKey:p,setPrSortKey:h,prSortDirection:m,setPrSortDirection:v,prFilter:g,setPrFilter:S,clusterSortKey:b,setClusterSortKey:k,prScopeSortKey:C,setPrScopeSortKey:w,contributorSortKey:N,setContributorSortKey:D,contributorSortDirection:T,setContributorSortDirection:O}}function To(n){switch((n??"").toLowerCase()){case"low":case"strong":return"low";case"mixed":case"medium":return"medium";case"high":case"weak":return"high";default:return"neutral"}}function tc(n,o){var i;return To((i=o.get(n.author??""))==null?void 0:i.automation_risk_signal)}function ey(n,o){var l;let i="neutral";for(const u of n.authors){const c=To((l=o.get(u))==null?void 0:l.automation_risk_signal);if(c==="high")return"high";c==="medium"?i="medium":c==="low"&&i==="neutral"&&(i="low")}return i}function jo(n,o){return!!(o.known_contributor||o.repo_association==="MEMBER"||o.repo_association==="OWNER"||o.repo_association==="COLLABORATOR"||(n==null?void 0:n.author_association)==="MEMBER"||(n==null?void 0:n.author_association)==="OWNER"||(n==null?void 0:n.author_association)==="COLLABORATOR")}function Mo(n,o){return o.first_seen_in_snapshot||o.repo_association==="FIRST_TIME_CONTRIBUTOR"||o.repo_association==="FIRST_TIMER"?!0:(n==null?void 0:n.author_association)==="FIRST_TIME_CONTRIBUTOR"||(n==null?void 0:n.author_association)==="FIRST_TIMER"}function ty(n){return Mo(void 0,n)?2:jo(void 0,n)?0:1}function ny(n){return Mo(void 0,n)?"first contribution":jo(void 0,n)?"known":"unknown"}function Bu(n,o){if(!n)return-1;const i=o.indexOf(n.toLowerCase());return i>=0?i:-1}function ym(n){return Math.max(n.patch_similarity,n.code_similarity,n.size_similarity,n.file_overlap,n.area_overlap)}function ry(n){return n?ym(n):null}function _i(n){return ym(n)}function oy(n,o,i){const l=(n.pairwise_similarity??[]).find(u=>u.left_pr_number===o&&u.right_pr_number===i||u.left_pr_number===i&&u.right_pr_number===o);return l?_i(l):0}function dp(n,o){return(n.pairwise_similarity??[]).flatMap(i=>i.left_pr_number===o?[{otherPrNumber:i.right_pr_number,similarity:_i(i)}]:i.right_pr_number===o?[{otherPrNumber:i.left_pr_number,similarity:_i(i)}]:[]).sort((i,l)=>l.similarity-i.similarity).slice(0,2)}function xm(n){return n>=.5?"mat-vhigh":n>=.25?"mat-high":n>=.1?"mat-med":n>0?"mat-low":"mat-none"}function iy(n,o,i){return n.recent_pr_numbers.reduce((l,u)=>{const c=o.get(u);if(!c)return l;const f=tc(c,i);return f==="medium"||f==="high"?l+1:l},0)}function sy(n,o,i){return n.pairwise.find(l=>l.left_pr_number===o&&l.right_pr_number===i||l.left_pr_number===i&&l.right_pr_number===o)}function wm(n,o){return n.pairwise.flatMap(i=>i.left_pr_number===o?[{otherPrNumber:i.right_pr_number,similarity:i.similarity}]:i.right_pr_number===o?[{otherPrNumber:i.left_pr_number,similarity:i.similarity}]:[]).sort((i,l)=>l.similarity-i.similarity).slice(0,3)}function Sm(n,o=.5){return n.pairwise.filter(i=>i.similarity>=o).length}function nc(n,o,i){return o?i==="all"?!0:i==="known"?jo(n,o):Mo(n,o):i!=="known"}function ly(n,o){return o==="all"?!0:o==="known"?jo(void 0,n):Mo(void 0,n)}function ay(n,o,i){switch(i){case"all":return!0;case"flagged":{const l=tc(n,o);return l==="medium"||l==="high"}case"clustered":return!!n.cluster_id;case"unclustered":return!n.cluster_id;case"open":return n.state==="open"&&!n.merged;case"merged":return n.merged}}function km(n,...o){if(!n)return!0;const i=n.toLowerCase();return o.some(l=>l==null?void 0:l.toLowerCase().includes(i))}function Kr(n){return n?new Intl.DateTimeFormat(void 0,{dateStyle:"medium"}).format(new Date(n)):"—"}function uy(n){return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(n))}function Li(n){return(n.additions??0)+(n.deletions??0)}function cy(n,o=!1){const i=[`${n.recent_pr_count} recent PRs`],l=Mo(void 0,n),u=jo(void 0,n);l?i.push("first contribution focus"):u&&i.push("known contributor");const c=dy(n.repo_association);return c&&!fy(c,{first:l,known:u})&&i.push(c),n.automation_risk_signal&&n.automation_risk_signal!=="low"&&i.push(`${n.automation_risk_signal} automation risk`),n.follow_through_score&&n.follow_through_score!=="strong"&&i.push(`${n.follow_through_score} follow-through`),n.heuristic_note&&i.push(n.heuristic_note),i.slice(0,o?4:6).join(" · ")}function dy(n){return n?n.toLowerCase().replace(/_/g," "):null}function fy(n,o){return!!(o.first&&(n==="first time contributor"||n==="first timer")||o.known&&(n==="member"||n==="owner"||n==="collaborator"))}function kl(n){return n.state==="open"&&!n.merged}function Hu(n,o){if(n&&!o)return n;if(!n&&o)return o;if(n||o)return{...n,...o}}const Si={};function rc(n,o,i,l,u){let c={...Wu(n,Si)};return o&&(c=ll(c,o)),i&&(c=ll(c,i)),l&&(c=ll(c,l)),c}function py(n){if(n.length===0)return Si;if(n.length===1)return Wu(n[0],Si);let o={...Wu(n[0],Si)};for(let i=1;i=65&&u<=90&&(typeof o=="function"||typeof o>"u")}function bm(n){return typeof n=="function"}function Wu(n,o){return bm(n)?n(o):n??Si}function gy(n,o){return o?n?i=>{if(vy(i)){const u=i;Ku(u);const c=o(u);return u.baseUIHandlerPrevented||n==null||n(u),c}const l=o(i);return n==null||n(i),l}:o:n}function Ku(n){return n.preventBaseUIHandler=()=>{n.baseUIHandlerPrevented=!0},n}function Em(n,o){return o?n?o+" "+n:o:n}function vy(n){return n!=null&&typeof n=="object"&&"nativeEvent"in n}function yy(n,o){return function(l,...u){const c=new URL(n);return c.searchParams.set("code",l.toString()),u.forEach(f=>c.searchParams.append("args[]",f)),`${o} error #${l}; visit ${c} for the full message.`}}const Nn=yy("https://base-ui.com/production-error","Base UI"),fp={};function Ot(n,o){const i=E.useRef(fp);return i.current===fp&&(i.current=n(o)),i}function Ri(n,o,i,l){const u=Ot(Cm).current;return wy(u,n,o,i,l)&&_m(u,[n,o,i,l]),u.callback}function xy(n){const o=Ot(Cm).current;return Sy(o,n)&&_m(o,n),o.callback}function Cm(){return{callback:null,cleanup:null,refs:[]}}function wy(n,o,i,l,u){return n.refs[0]!==o||n.refs[1]!==i||n.refs[2]!==l||n.refs[3]!==u}function Sy(n,o){return n.refs.length!==o.length||n.refs.some((i,l)=>i!==o[l])}function _m(n,o){if(n.refs=o,o.every(i=>i==null)){n.callback=null;return}n.callback=i=>{if(n.cleanup&&(n.cleanup(),n.cleanup=null),i!=null){const l=Array(o.length).fill(null);for(let u=0;u{for(let u=0;u=n}function pp(n){if(!E.isValidElement(n))return null;const o=n,i=o.props;return(Rm(19)?i==null?void 0:i.ref:o.ref)??null}function by(n,o){const i={};for(const l in n){const u=n[l];if(o!=null&&o.hasOwnProperty(l)){const c=o[l](u);c!=null&&Object.assign(i,c);continue}u===!0?i[`data-${l.toLowerCase()}`]="":u&&(i[`data-${l.toLowerCase()}`]=u.toString())}return i}function Ey(n,o){return typeof n=="function"?n(o):n}function Cy(n,o){return typeof n=="function"?n(o):n}function Bt(){}const dl=Object.freeze([]),gt=Object.freeze({}),_y={style:{transition:"none"}},Ry={fallbackAxisSide:"end"};function kt(n,o,i={}){const l=o.render,u=Py(o,i);if(i.enabled===!1)return null;const c=i.state??gt;return Ny(n,l,u,c)}function Py(n,o={}){const{className:i,style:l,render:u}=n,{state:c=gt,ref:f,props:p,stateAttributesMapping:h,enabled:m=!0}=o,v=m?Ey(i,c):void 0,g=m?Cy(l,c):void 0,S=m?by(c,h):gt,b=m?Hu(S,Array.isArray(p)?py(p):p)??gt:gt;return typeof document<"u"&&(m?Array.isArray(f)?b.ref=xy([b.ref,pp(u),...f]):b.ref=Ri(b.ref,pp(u),f):Ri(null,null)),m?(v!==void 0&&(b.className=Em(b.className,v)),g!==void 0&&(b.style=Hu(b.style,g)),b):gt}const Ty=Symbol.for("react.lazy");function Ny(n,o,i,l){if(o){if(typeof o=="function")return o(i,l);const u=rc(i,o.props);u.ref=i.ref;let c=o;return(c==null?void 0:c.$$typeof)===Ty&&(c=E.Children.toArray(o)[0]),E.cloneElement(c,u)}if(n&&typeof n=="string")return jy(n,i);throw new Error(Nn(8))}function jy(n,o){return n==="button"?E.createElement("button",{type:"button",...o,key:o.key}):n==="img"?E.createElement("img",{alt:"",...o,key:o.key}):E.createElement(n,o)}function My(n){return kt(n.defaultTagName??"div",n,n)}function Pm(n){var o,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(o=0;otypeof n=="boolean"?`${n}`:n===0?"0":n,hp=Tm,oc=(n,o)=>i=>{var l;if((o==null?void 0:o.variants)==null)return hp(n,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:u,defaultVariants:c}=o,f=Object.keys(u).map(m=>{const v=i==null?void 0:i[m],g=c==null?void 0:c[m];if(v===null)return null;const S=mp(v)||mp(g);return u[m][S]}),p=i&&Object.entries(i).reduce((m,v)=>{let[g,S]=v;return S===void 0||(m[g]=S),m},{}),h=o==null||(l=o.compoundVariants)===null||l===void 0?void 0:l.reduce((m,v)=>{let{class:g,className:S,...b}=v;return Object.entries(b).every(k=>{let[C,w]=k;return Array.isArray(w)?w.includes({...c,...p}[C]):{...c,...p}[C]===w})?[...m,g,S]:m},[]);return hp(n,f,h,i==null?void 0:i.class,i==null?void 0:i.className)},Oy=(n,o)=>{const i=new Array(n.length+o.length);for(let l=0;l({classGroupId:n,validator:o}),Nm=(n=new Map,o=null,i)=>({nextPart:n,validators:o,classGroupId:i}),fl="-",gp=[],Ly="arbitrary..",Ay=n=>{const o=Dy(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return zy(f);const p=f.split(fl),h=p[0]===""&&p.length>1?1:0;return jm(p,h,o)},getConflictingClassGroupIds:(f,p)=>{if(p){const h=l[f],m=i[f];return h?m?Oy(m,h):h:m||gp}return i[f]||gp}}},jm=(n,o,i)=>{if(n.length-o===0)return i.classGroupId;const u=n[o],c=i.nextPart.get(u);if(c){const m=jm(n,o+1,c);if(m)return m}const f=i.validators;if(f===null)return;const p=o===0?n.join(fl):n.slice(o).join(fl),h=f.length;for(let m=0;mn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const o=n.slice(1,-1),i=o.indexOf(":"),l=o.slice(0,i);return l?Ly+l:void 0})(),Dy=n=>{const{theme:o,classGroups:i}=n;return Fy(i,o)},Fy=(n,o)=>{const i=Nm();for(const l in n){const u=n[l];ic(u,i,l,o)}return i},ic=(n,o,i,l)=>{const u=n.length;for(let c=0;c{if(typeof n=="string"){$y(n,o,i);return}if(typeof n=="function"){Uy(n,o,i,l);return}By(n,o,i,l)},$y=(n,o,i)=>{const l=n===""?o:Mm(o,n);l.classGroupId=i},Uy=(n,o,i,l)=>{if(Hy(n)){ic(n(l),o,i,l);return}o.validators===null&&(o.validators=[]),o.validators.push(Iy(i,n))},By=(n,o,i,l)=>{const u=Object.entries(n),c=u.length;for(let f=0;f{let i=n;const l=o.split(fl),u=l.length;for(let c=0;c"isThemeGetter"in n&&n.isThemeGetter===!0,Wy=n=>{if(n<1)return{get:()=>{},set:()=>{}};let o=0,i=Object.create(null),l=Object.create(null);const u=(c,f)=>{i[c]=f,o++,o>n&&(o=0,l=i,i=Object.create(null))};return{get(c){let f=i[c];if(f!==void 0)return f;if((f=l[c])!==void 0)return u(c,f),f},set(c,f){c in i?i[c]=f:u(c,f)}}},Yu="!",vp=":",Ky=[],yp=(n,o,i,l,u)=>({modifiers:n,hasImportantModifier:o,baseClassName:i,maybePostfixModifierPosition:l,isExternal:u}),Yy=n=>{const{prefix:o,experimentalParseClassName:i}=n;let l=u=>{const c=[];let f=0,p=0,h=0,m;const v=u.length;for(let C=0;Ch?m-h:void 0;return yp(c,b,S,k)};if(o){const u=o+vp,c=l;l=f=>f.startsWith(u)?c(f.slice(u.length)):yp(Ky,!1,f,void 0,!0)}if(i){const u=l;l=c=>i({className:c,parseClassName:u})}return l},Gy=n=>{const o=new Map;return n.orderSensitiveModifiers.forEach((i,l)=>{o.set(i,1e6+l)}),i=>{const l=[];let u=[];for(let c=0;c0&&(u.sort(),l.push(...u),u=[]),l.push(f)):u.push(f)}return u.length>0&&(u.sort(),l.push(...u)),l}},Qy=n=>({cache:Wy(n.cacheSize),parseClassName:Yy(n),sortModifiers:Gy(n),...Ay(n)}),Xy=/\s+/,qy=(n,o)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:u,sortModifiers:c}=o,f=[],p=n.trim().split(Xy);let h="";for(let m=p.length-1;m>=0;m-=1){const v=p[m],{isExternal:g,modifiers:S,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:C}=i(v);if(g){h=v+(h.length>0?" "+h:h);continue}let w=!!C,N=l(w?k.substring(0,C):k);if(!N){if(!w){h=v+(h.length>0?" "+h:h);continue}if(N=l(k),!N){h=v+(h.length>0?" "+h:h);continue}w=!1}const D=S.length===0?"":S.length===1?S[0]:c(S).join(":"),T=b?D+Yu:D,O=T+N;if(f.indexOf(O)>-1)continue;f.push(O);const j=u(N,w);for(let F=0;F0?" "+h:h)}return h},Zy=(...n)=>{let o=0,i,l,u="";for(;o{if(typeof n=="string")return n;let o,i="";for(let l=0;l{let i,l,u,c;const f=h=>{const m=o.reduce((v,g)=>g(v),n());return i=Qy(m),l=i.cache.get,u=i.cache.set,c=p,p(h)},p=h=>{const m=l(h);if(m)return m;const v=qy(h,i);return u(h,v),v};return c=f,(...h)=>c(Zy(...h))},ex=[],ot=n=>{const o=i=>i[n]||ex;return o.isThemeGetter=!0,o},Im=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lm=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tx=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rx=/\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$/,ox=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ix=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wr=n=>tx.test(n),Ce=n=>!!n&&!Number.isNaN(Number(n)),Sr=n=>!!n&&Number.isInteger(Number(n)),_u=n=>n.endsWith("%")&&Ce(n.slice(0,-1)),Wn=n=>nx.test(n),Am=()=>!0,lx=n=>rx.test(n)&&!ox.test(n),sc=()=>!1,ax=n=>ix.test(n),ux=n=>sx.test(n),cx=n=>!me(n)&&!ge(n),dx=n=>kr(n,Fm,sc),me=n=>Im.test(n),$r=n=>kr(n,Vm,lx),xp=n=>kr(n,xx,Ce),fx=n=>kr(n,Um,Am),px=n=>kr(n,$m,sc),wp=n=>kr(n,zm,sc),mx=n=>kr(n,Dm,ux),Gs=n=>kr(n,Bm,ax),ge=n=>Lm.test(n),yi=n=>qr(n,Vm),hx=n=>qr(n,$m),Sp=n=>qr(n,zm),gx=n=>qr(n,Fm),vx=n=>qr(n,Dm),Qs=n=>qr(n,Bm,!0),yx=n=>qr(n,Um,!0),kr=(n,o,i)=>{const l=Im.exec(n);return l?l[1]?o(l[1]):i(l[2]):!1},qr=(n,o,i=!1)=>{const l=Lm.exec(n);return l?l[1]?o(l[1]):i:!1},zm=n=>n==="position"||n==="percentage",Dm=n=>n==="image"||n==="url",Fm=n=>n==="length"||n==="size"||n==="bg-size",Vm=n=>n==="length",xx=n=>n==="number",$m=n=>n==="family-name",Um=n=>n==="number"||n==="weight",Bm=n=>n==="shadow",wx=()=>{const n=ot("color"),o=ot("font"),i=ot("text"),l=ot("font-weight"),u=ot("tracking"),c=ot("leading"),f=ot("breakpoint"),p=ot("container"),h=ot("spacing"),m=ot("radius"),v=ot("shadow"),g=ot("inset-shadow"),S=ot("text-shadow"),b=ot("drop-shadow"),k=ot("blur"),C=ot("perspective"),w=ot("aspect"),N=ot("ease"),D=ot("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...O(),ge,me],F=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],A=()=>[ge,me,h],$=()=>[wr,"full","auto",...A()],ne=()=>[Sr,"none","subgrid",ge,me],te=()=>["auto",{span:["full",Sr,ge,me]},Sr,ge,me],L=()=>[Sr,"auto",ge,me],K=()=>["auto","min","max","fr",ge,me],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...A()],Q=()=>[wr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],I=()=>[wr,"screen","full","dvw","lvw","svw","min","max","fit",...A()],q=()=>[wr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],B=()=>[n,ge,me],R=()=>[...O(),Sp,wp,{position:[ge,me]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",gx,dx,{size:[ge,me]}],ce=()=>[_u,yi,$r],le=()=>["","none","full",m,ge,me],oe=()=>["",Ce,yi,$r],he=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ce,_u,Sp,wp],Te=()=>["","none",k,ge,me],Ke=()=>["none",Ce,ge,me],Wt=()=>["none",Ce,ge,me],Et=()=>[Ce,ge,me],it=()=>[wr,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wn],breakpoint:[Wn],color:[Am],container:[Wn],"drop-shadow":[Wn],ease:["in","out","in-out"],font:[cx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wn],shadow:[Wn],spacing:["px",Ce],text:[Wn],"text-shadow":[Wn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wr,me,ge,w]}],container:["container"],columns:[{columns:[Ce,me,ge,p]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:j()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Sr,"auto",ge,me]}],basis:[{basis:[wr,"full","auto",p,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,wr,"auto","initial","none",me]}],grow:[{grow:["",Ce,ge,me]}],shrink:[{shrink:["",Ce,ge,me]}],order:[{order:[Sr,"first","last","none",ge,me]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mbs:[{mbs:X()}],mbe:[{mbe:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[p,"screen",...Q()]}],"min-w":[{"min-w":[p,"screen","none",...Q()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",i,yi,$r]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,yx,fx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_u,me]}],"font-family":[{font:[hx,px,o]}],"font-features":[{"font-features":[me]}],"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:[u,ge,me]}],"line-clamp":[{"line-clamp":[Ce,"none",ge,xp]}],leading:[{leading:[c,...A()]}],"list-image":[{"list-image":["none",ge,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ge,$r]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ce,"auto",ge,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,me]}],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",ge,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sr,ge,me],radial:["",ge,me],conic:[Sr,ge,me]},vx,mx]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ge,me]}],"outline-w":[{outline:["",Ce,yi,$r]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",v,Qs,Gs]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",g,Qs,Gs]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ce,$r]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",S,Qs,Gs]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ce,ge,me]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[ge,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,me]}],filter:[{filter:["","none",ge,me]}],blur:[{blur:Te()}],brightness:[{brightness:[Ce,ge,me]}],contrast:[{contrast:[Ce,ge,me]}],"drop-shadow":[{"drop-shadow":["","none",b,Qs,Gs]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ce,ge,me]}],"hue-rotate":[{"hue-rotate":[Ce,ge,me]}],invert:[{invert:["",Ce,ge,me]}],saturate:[{saturate:[Ce,ge,me]}],sepia:[{sepia:["",Ce,ge,me]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,me]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ge,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ge,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ge,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ge,me]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ge,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ge,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ge,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ge,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ge,me]}],ease:[{ease:["linear","initial",N,ge,me]}],delay:[{delay:[Ce,ge,me]}],animate:[{animate:["none",D,ge,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ge,me]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:Ke()}],"rotate-x":[{"rotate-x":Ke()}],"rotate-y":[{"rotate-y":Ke()}],"rotate-z":[{"rotate-z":Ke()}],scale:[{scale:Wt()}],"scale-x":[{"scale-x":Wt()}],"scale-y":[{"scale-y":Wt()}],"scale-z":[{"scale-z":Wt()}],"scale-3d":["scale-3d"],skew:[{skew:Et()}],"skew-x":[{"skew-x":Et()}],"skew-y":[{"skew-y":Et()}],transform:[{transform:[ge,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",ge,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",ge,me]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ce,yi,$r,xp]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Sx=Jy(wx);function Pe(...n){return Sx(Tm(n))}const kx=oc("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline",cluster:"font-mono border-primary/20 bg-primary/8 text-primary cursor-pointer hover:bg-primary/16",reference:"text-[0.6rem] uppercase tracking-wide font-semibold border-primary/20 bg-primary/12 text-primary","risk-high":"border-risk-high/25 bg-risk-high/10 text-risk-high-foreground","risk-medium":"border-risk-medium/25 bg-risk-medium/8 text-risk-medium-foreground","risk-low":"border-risk-low/25 bg-risk-low/8 text-risk-low-foreground",warning:"border-warning/25 bg-warning/8 text-warning-foreground",count:"border-primary/20 text-primary"}},defaultVariants:{variant:"default"}});function vt({className:n,variant:o="default",render:i,...l}){return My({defaultTagName:"span",props:rc({className:Pe(kx({variant:o}),n)},l),render:i,state:{slot:"badge",variant:o}})}const Ru=gm[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],bx=Ru&&Ru!==E.useLayoutEffect?Ru:n=>n();function Ee(n){const o=Ot(Ex).current;return o.next=n,bx(o.effect),o.trampoline}function Ex(){const n={next:void 0,callback:Cx,trampoline:(...o)=>{var i;return(i=n.callback)==null?void 0:i.call(n,...o)},effect:()=>{n.callback=n.next}};return n}function Cx(){}let kp=(function(n){return n.disabled="data-disabled",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});const _x={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},wi={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Rx={disabled:!1,...wi},Px={valid(n){return n===null?null:n?{[kp.valid]:""}:{[kp.invalid]:""}}},Tx=E.createContext({invalid:void 0,name:void 0,validityData:{state:_x,errors:[],error:"",value:"",initialValue:null},setValidityData:Bt,disabled:void 0,touched:wi.touched,setTouched:Bt,dirty:wi.dirty,setDirty:Bt,filled:wi.filled,setFilled:Bt,focused:wi.focused,setFocused:Bt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:Rx,markedDirtyRef:{current:!1},validation:{getValidationProps:(n=gt)=>n,getInputValidationProps:(n=gt)=>n,inputRef:{current:null},commit:async()=>{}}});function Hm(n=!0){const o=E.useContext(Tx);if(o.setValidityData===Bt&&!n)throw new Error(Nn(28));return o}const Nx=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Bt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function jx(){return E.useContext(Nx)}const Mx={...gm};let bp=0;function Ox(n,o="mui"){const[i,l]=E.useState(n),u=n||i;return E.useEffect(()=>{i==null&&(bp+=1,l(`${o}-${bp}`))},[i,o]),u}const Ep=Mx.useId;function bl(n,o){if(Ep!==void 0){const i=Ep();return n??(o?`${o}-${i}`:i)}return Ox(n,o)}function El(n){return bl(n,"base-ui")}const Ix=E.createContext({controlId:void 0,registerControlId:Bt,labelId:void 0,setLabelId:Bt,messageIds:[],setMessageIds:Bt,getDescriptionProps:n=>n});function Wm(){return E.useContext(Ix)}const Lx=[];function Cl(n){E.useEffect(n,Lx)}const xi=0;class Yn{constructor(){rt(this,"currentId",xi);rt(this,"clear",()=>{this.currentId!==xi&&(clearTimeout(this.currentId),this.currentId=xi)});rt(this,"disposeEffect",()=>this.clear)}static create(){return new Yn}start(o,i){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xi,i()},o)}isStarted(){return this.currentId!==xi}}function Pi(){const n=Ot(Yn.create).current;return Cl(n.disposeEffect),n}function Ax(n,o){return{...n,state:{...n.state,valid:!o&&n.state.valid}}}function _l(){return typeof window<"u"}function Oo(n){return lc(n)?(n.nodeName||"").toLowerCase():"#document"}function yt(n){var o;return(n==null||(o=n.ownerDocument)==null?void 0:o.defaultView)||window}function jn(n){var o;return(o=(lc(n)?n.ownerDocument:n.document)||window.document)==null?void 0:o.documentElement}function lc(n){return _l()?n instanceof Node||n instanceof yt(n).Node:!1}function Oe(n){return _l()?n instanceof Element||n instanceof yt(n).Element:!1}function bt(n){return _l()?n instanceof HTMLElement||n instanceof yt(n).HTMLElement:!1}function pl(n){return!_l()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof yt(n).ShadowRoot}function Ai(n){const{overflow:o,overflowX:i,overflowY:l,display:u}=Ht(n);return/auto|scroll|overlay|hidden|clip/.test(o+l+i)&&u!=="inline"&&u!=="contents"}function zx(n){return/^(table|td|th)$/.test(Oo(n))}function Rl(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const Dx=/transform|translate|scale|rotate|perspective|filter/,Fx=/paint|layout|strict|content/,Ur=n=>!!n&&n!=="none";let Pu;function ac(n){const o=Oe(n)?Ht(n):n;return Ur(o.transform)||Ur(o.translate)||Ur(o.scale)||Ur(o.rotate)||Ur(o.perspective)||!Pl()&&(Ur(o.backdropFilter)||Ur(o.filter))||Dx.test(o.willChange||"")||Fx.test(o.contain||"")}function Vx(n){let o=Gn(n);for(;bt(o)&&!Kn(o);){if(ac(o))return o;if(Rl(o))return null;o=Gn(o)}return null}function Pl(){return Pu==null&&(Pu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Pu}function Kn(n){return/^(html|body|#document)$/.test(Oo(n))}function Ht(n){return yt(n).getComputedStyle(n)}function Tl(n){return Oe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Gn(n){if(Oo(n)==="html")return n;const o=n.assignedSlot||n.parentNode||pl(n)&&n.host||jn(n);return pl(o)?o.host:o}function Km(n){const o=Gn(n);return Kn(o)?n.ownerDocument?n.ownerDocument.body:n.body:bt(o)&&Ai(o)?o:Km(o)}function Ti(n,o,i){var l;o===void 0&&(o=[]),i===void 0&&(i=!0);const u=Km(n),c=u===((l=n.ownerDocument)==null?void 0:l.body),f=yt(u);if(c){const p=Gu(f);return o.concat(f,f.visualViewport||[],Ai(u)?u:[],p&&i?Ti(p):[])}else return o.concat(u,Ti(u,[],i))}function Gu(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Qn(n){return(n==null?void 0:n.ownerDocument)||document}const zi=typeof navigator<"u",Tu=Kx(),$x=Gx(),Ux=Yx();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Tu.platform==="MacIntel"&&Tu.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Tu.platform);const Bx=zi&&/apple/i.test(navigator.vendor),Hx=zi&&$x.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Wx=Ux.includes("jsdom/");function Kx(){if(!zi)return{platform:"",maxTouchPoints:-1};const n=navigator.userAgentData;return n!=null&&n.platform?{platform:n.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Yx(){if(!zi)return"";const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(({brand:o,version:i})=>`${o}/${i}`).join(" "):navigator.userAgent}function Gx(){if(!zi)return"";const n=navigator.userAgentData;return n!=null&&n.platform?n.platform:navigator.platform??""}const Qx="data-base-ui-focusable",Ym="active",Gm="selected",Qm="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Nu="ArrowLeft",ju="ArrowRight",Xx="ArrowUp",qx="ArrowDown";function Qu(n){var i;let o=n.activeElement;for(;((i=o==null?void 0:o.shadowRoot)==null?void 0:i.activeElement)!=null;)o=o.shadowRoot.activeElement;return o}function St(n,o){var l;if(!n||!o)return!1;const i=(l=o.getRootNode)==null?void 0:l.call(o);if(n.contains(o))return!0;if(i&&pl(i)){let u=o;for(;u;){if(n===u)return!0;u=u.parentNode||u.host}}return!1}function ml(n,o){if(!Oe(n))return!1;const i=n;if(o.hasElement(i))return!i.hasAttribute("data-trigger-disabled");for(const[,l]of o.entries())if(St(l,i))return!l.hasAttribute("data-trigger-disabled");return!1}function Rn(n){return"composedPath"in n?n.composedPath()[0]:n.target}function gn(n,o){if(o==null)return!1;if("composedPath"in n)return n.composedPath().includes(o);const i=n;return i.target!=null&&o.contains(i.target)}function Zx(n){return n.matches("html,body")}function Jx(n){return bt(n)&&n.matches(Qm)}function e0(n){if(!n||Wx)return!0;try{return n.matches(":focus-visible")}catch{return!0}}function Wr(n,o,i=!0){return n.filter(u=>{var c;return u.parentId===o&&(!i||((c=u.context)==null?void 0:c.open))}).flatMap(u=>[u,...Wr(n,u.id,i)])}function Mu(n){n.preventDefault(),n.stopPropagation()}function t0(n){return"nativeEvent"in n}function hl(n,o){const i=["mouse","pen"];return i.push("",void 0),i.includes(n)}function n0(n){const o=n.type;return o==="click"||o==="mousedown"||o==="keydown"||o==="keyup"}const r0=["top","right","bottom","left"],No=Math.min,Ut=Math.max,gl=Math.round,Br=Math.floor,Tn=n=>({x:n,y:n}),o0={left:"right",right:"left",bottom:"top",top:"bottom"};function Xu(n,o,i){return Ut(n,No(o,i))}function Xn(n,o){return typeof n=="function"?n(o):n}function Mt(n){return n.split("-")[0]}function br(n){return n.split("-")[1]}function uc(n){return n==="x"?"y":"x"}function cc(n){return n==="y"?"height":"width"}function nn(n){const o=n[0];return o==="t"||o==="b"?"y":"x"}function dc(n){return uc(nn(n))}function i0(n,o,i){i===void 0&&(i=!1);const l=br(n),u=dc(n),c=cc(u);let f=u==="x"?l===(i?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[c]>o.floating[c]&&(f=vl(f)),[f,vl(f)]}function s0(n){const o=vl(n);return[qu(n),o,qu(o)]}function qu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Cp=["left","right"],_p=["right","left"],l0=["top","bottom"],a0=["bottom","top"];function u0(n,o,i){switch(n){case"top":case"bottom":return i?o?_p:Cp:o?Cp:_p;case"left":case"right":return o?l0:a0;default:return[]}}function c0(n,o,i,l){const u=br(n);let c=u0(Mt(n),i==="start",l);return u&&(c=c.map(f=>f+"-"+u),o&&(c=c.concat(c.map(qu)))),c}function vl(n){const o=Mt(n);return o0[o]+n.slice(o.length)}function d0(n){return{top:0,right:0,bottom:0,left:0,...n}}function Xm(n){return typeof n!="number"?d0(n):{top:n,right:n,bottom:n,left:n}}function yl(n){const{x:o,y:i,width:l,height:u}=n;return{width:l,height:u,top:i,left:o,right:o+l,bottom:i+u,x:o,y:i}}function Xs(n,o,i){return Math.floor(n/o)!==i}function Zu(n,o){return o<0||o>=n.current.length}function f0(n,o){return tn(n,{disabledIndices:o})}function p0(n,o){return tn(n,{decrement:!0,startingIndex:n.current.length,disabledIndices:o})}function tn(n,{startingIndex:o=-1,decrement:i=!1,disabledIndices:l,amount:u=1}={}){let c=o;do c+=i?-u:u;while(c>=0&&c<=n.current.length-1&&Ro(n,c,l));return c}function m0(n,{event:o,orientation:i,loopFocus:l,rtl:u,cols:c,disabledIndices:f,minIndex:p,maxIndex:h,prevIndex:m,stopEvent:v=!1}){let g=m,S;if(o.key===Xx?S="up":o.key===qx&&(S="down"),S){const b=[],k=[];let C=!1,w=0;{let A=null,$=-1;n.current.forEach((ne,te)=>{if(ne==null)return;w+=1;const L=ne.closest('[role="row"]');L&&(C=!0),(L!==A||$===-1)&&(A=L,$+=1,b[$]=[]),b[$].push(te),k[te]=$})}let N=!1,D=0;if(C)for(const A of b){const $=A.length;$>D&&(D=$),$!==c&&(N=!0)}const T=N&&w{if(!N||m===-1)return;const $=k[m];if($==null)return;const ne=b[$].indexOf(m),te=A==="up"?-1:1;for(let L=$+te,K=0;K=b.length){if(!l||T)return;L=L<0?b.length-1:0}const G=b[L];for(let z=Math.min(ne,G.length-1);z>=0;z-=1){const X=G[z];if(!Ro(n,X,f))return X}}},F=A=>{if(!T||m===-1)return;const $=m%O,ne=A==="up"?-O:O,te=h-h%O,L=Br(h/O)+1;for(let K=m-$+ne,G=0;Gh){if(!l)return;K=K<0?te:0}const z=Math.min(K+O-1,h);for(let X=Math.min(K+$,z);X>=K;X-=1)if(!Ro(n,X,f))return X}};v&&Mu(o);const W=j(S)??F(S);if(W!==void 0)g=W;else if(m===-1)g=S==="up"?h:p;else if(g=tn(n,{startingIndex:m,amount:O,decrement:S==="up",disabledIndices:f}),l){if(S==="up"&&(m-OA?ne:ne-O}S==="down"&&m+O>h&&(g=tn(n,{startingIndex:m%O-O,amount:O,disabledIndices:f}))}Zu(n,g)&&(g=m)}if(i==="both"){const b=Br(m/c);o.key===(u?Nu:ju)&&(v&&Mu(o),m%c!==c-1?(g=tn(n,{startingIndex:m,disabledIndices:f}),l&&Xs(g,c,b)&&(g=tn(n,{startingIndex:m-m%c-1,disabledIndices:f}))):l&&(g=tn(n,{startingIndex:m-m%c-1,disabledIndices:f})),Xs(g,c,b)&&(g=m)),o.key===(u?ju:Nu)&&(v&&Mu(o),m%c!==0?(g=tn(n,{startingIndex:m,decrement:!0,disabledIndices:f}),l&&Xs(g,c,b)&&(g=tn(n,{startingIndex:m+(c-m%c),decrement:!0,disabledIndices:f}))):l&&(g=tn(n,{startingIndex:m+(c-m%c),decrement:!0,disabledIndices:f})),Xs(g,c,b)&&(g=m));const k=Br(h/c)===b;Zu(n,g)&&(l&&k?g=o.key===(u?ju:Nu)?h:tn(n,{startingIndex:m-m%c-1,disabledIndices:f}):g=m)}return g}function h0(n,o,i){const l=[];let u=0;return n.forEach(({width:c,height:f},p)=>{let h=!1;for(i&&(u=0);!h;){const m=[];for(let v=0;vl[v]==null)?(m.forEach(v=>{l[v]=p}),h=!0):u+=1}}),[...l]}function g0(n,o,i,l,u){if(n===-1)return-1;const c=i.indexOf(n),f=o[n];switch(u){case"tl":return c;case"tr":return f?c+f.width-1:c;case"bl":return f?c+(f.height-1)*l:c;case"br":return i.lastIndexOf(n);default:return-1}}function v0(n,o){return o.flatMap((i,l)=>n.includes(i)?[l]:[])}function Ro(n,o,i){if(typeof i=="function"?i(o):(i==null?void 0:i.includes(o))??!1)return!0;const u=n.current[o];return u?y0(u)?!i&&(u.hasAttribute("disabled")||u.getAttribute("aria-disabled")==="true"):!0:!1}function y0(n){return Ht(n).display!=="none"}const x0=()=>{},ke=typeof document<"u"?E.useLayoutEffect:x0;var Zr=vm();const qs=null;class w0{constructor(){rt(this,"callbacks",[]);rt(this,"callbacksCount",0);rt(this,"nextId",1);rt(this,"startId",1);rt(this,"isScheduled",!1);rt(this,"tick",o=>{var u;this.isScheduled=!1;const i=this.callbacks,l=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,l>0)for(let c=0;c=this.callbacks.length||(this.callbacks[i]=null,this.callbacksCount-=1)}}const Zs=new w0;class Ze{constructor(){rt(this,"currentId",qs);rt(this,"cancel",()=>{this.currentId!==qs&&(Zs.cancel(this.currentId),this.currentId=qs)});rt(this,"disposeEffect",()=>this.cancel)}static create(){return new Ze}static request(o){return Zs.request(o)}static cancel(o){return Zs.cancel(o)}request(o){this.cancel(),this.currentId=Zs.request(()=>{this.currentId=qs,o()})}}function qm(){const n=Ot(Ze.create).current;return Cl(n.disposeEffect),n}function S0(n){return n==null?n:"current"in n?n.current:n}let Yr=(function(n){return n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n})({});const k0={[Yr.startingStyle]:""},b0={[Yr.endingStyle]:""},fc={transitionStatus(n){return n==="starting"?k0:n==="ending"?b0:null}};function Zm(n,o=!1,i=!0){const l=qm();return Ee((u,c=null)=>{l.cancel();function f(){Zr.flushSync(u)}const p=S0(n);if(p==null)return;const h=p;if(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)u();else{let g=function(){const b=Yr.startingStyle;if(!h.hasAttribute(b)){l.request(S);return}const k=new MutationObserver(()=>{h.hasAttribute(b)||(k.disconnect(),S())});k.observe(h,{attributes:!0,attributeFilter:[b]}),c==null||c.addEventListener("abort",()=>k.disconnect(),{once:!0})},S=function(){Promise.all(h.getAnimations().map(b=>b.finished)).then(()=>{c!=null&&c.aborted||f()}).catch(()=>{const b=h.getAnimations();if(i){if(c!=null&&c.aborted)return;f()}else b.length>0&&b.some(k=>k.pending||k.playState!=="finished")&&S()})};var m=g,v=S;if(o){g();return}l.request(S)}})}function pc(n){const{enabled:o=!0,open:i,ref:l,onComplete:u}=n,c=Ee(u),f=Zm(l,i,!1);E.useEffect(()=>{if(!o)return;const p=new AbortController;return f(c,p.signal),()=>{p.abort()}},[o,i,c,f])}function Jm(n,o=!1,i=!1){const[l,u]=E.useState(n&&o?"idle":void 0),[c,f]=E.useState(n);return n&&!c&&(f(!0),u("starting")),!n&&c&&l!=="ending"&&!i&&u("ending"),!n&&!c&&l==="ending"&&u(void 0),ke(()=>{if(!n&&c&&l!=="ending"&&i){const p=Ze.request(()=>{u("ending")});return()=>{Ze.cancel(p)}}},[n,c,l,i]),ke(()=>{if(!n||o)return;const p=Ze.request(()=>{u(void 0)});return()=>{Ze.cancel(p)}},[o,n]),ke(()=>{if(!n||!o)return;n&&c&&l!=="idle"&&u("starting");const p=Ze.request(()=>{u("idle")});return()=>{Ze.cancel(p)}},[o,n,c,u,l]),E.useMemo(()=>({mounted:c,setMounted:f,transitionStatus:l}),[c,l])}function Nl({controlled:n,default:o,name:i,state:l="value"}){const{current:u}=E.useRef(n!==void 0),[c,f]=E.useState(o),p=u?n:c,h=E.useCallback(m=>{u||f(m)},[]);return[p,h]}function E0(n={}){const{id:o,implicit:i=!1,controlRef:l}=n,{controlId:u,registerControlId:c}=Wm(),f=El(o),p=i?u:void 0,h=Ot(()=>Symbol("labelable-control")),m=E.useRef(!1),v=E.useRef(o!=null),g=Ee(()=>{!m.current||c===Bt||(m.current=!1,c(h.current,void 0))});return ke(()=>{if(c===Bt)return;let S;if(i){const b=l==null?void 0:l.current;Oe(b)&&b.closest("label")!=null?S=o??null:S=p??f}else if(o!=null)v.current=!0,S=o;else if(v.current)S=f;else{g();return}if(S===void 0){g();return}m.current=!0,c(h.current,S)},[o,l,p,c,i,f,h,g]),E.useEffect(()=>g,[g]),u??f}function C0(n){const{enabled:o=!0,value:i,id:l,name:u,controlRef:c,commit:f}=n,{formRef:p}=jx(),{invalid:h,markedDirtyRef:m,validityData:v,setValidityData:g}=Hm(),S=Ee(n.getValue);ke(()=>{if(!o)return;let b=i;b===void 0&&(b=S()),v.initialValue===null&&b!==null&&g(k=>({...k,initialValue:b}))},[o,g,i,v.initialValue,S]),ke(()=>{!o||!l||p.current.fields.set(l,{getValue:S,name:u,controlRef:c,validityData:Ax(v,h),validate(b=!0){let k=i;k===void 0&&(k=S()),m.current=!0,b?Zr.flushSync(()=>f(k)):f(k)}})},[f,c,o,p,S,l,h,m,u,v,i]),ke(()=>{const b=p.current.fields;return()=>{l&&b.delete(l)}},[p,l])}const Di="none",Ni="trigger-press",Pn="trigger-hover",al="trigger-focus",_0="outside-press",mc="escape-key",R0="disabled",P0="imperative-action";function Qe(n,o,i,l){let u=!1,c=!1;const f=gt;return{reason:n,event:o??new Event("base-ui"),cancel(){u=!0},allowPropagation(){c=!0},get isCanceled(){return u},get isPropagationAllowed(){return c},trigger:i,...f}}const T0=E.forwardRef(function(o,i){const{render:l,className:u,id:c,name:f,value:p,disabled:h=!1,onValueChange:m,defaultValue:v,autoFocus:g=!1,...S}=o,{state:b,name:k,disabled:C,setTouched:w,setDirty:N,validityData:D,setFocused:T,setFilled:O,validationMode:j,validation:F}=Hm(),W=C||h,A=k??f,$={...b,disabled:W},{labelId:ne}=Wm(),te=E0({id:c});ke(()=>{var I;const Q=p!=null;(I=F.inputRef.current)!=null&&I.value||Q&&p!==""?O(!0):Q&&p===""&&O(!1)},[F.inputRef,O,p]);const L=E.useRef(null);ke(()=>{g&&L.current===Qu(Qn(L.current))&&T(!0)},[g,T]);const[K]=Nl({controlled:p,default:v,name:"FieldControl",state:"value"}),G=p!==void 0,z=G?K:void 0;return C0({id:te,name:A,commit:F.commit,value:z,getValue:()=>{var Q;return(Q=F.inputRef.current)==null?void 0:Q.value},controlRef:F.inputRef}),kt("input",o,{ref:[i,L],state:$,props:[{id:te,disabled:W,name:A,ref:F.inputRef,"aria-labelledby":ne,autoFocus:g,...G?{value:z}:{defaultValue:v},onChange(Q){const I=Q.currentTarget.value;m==null||m(I,Qe(Di,Q.nativeEvent)),N(I!==D.initialValue),O(I!=="")},onFocus(){T(!0)},onBlur(Q){w(!0),T(!1),j==="onBlur"&&F.commit(Q.currentTarget.value)},onKeyDown(Q){Q.currentTarget.tagName==="INPUT"&&Q.key==="Enter"&&(w(!0),F.commit(Q.currentTarget.value))}},F.getInputValidationProps(),S],stateAttributesMapping:Px})}),N0=E.forwardRef(function(o,i){return y.jsx(T0,{ref:i,...o})});function j0({className:n,type:o,...i}){return y.jsx(N0,{type:o,"data-slot":"input",className:Pe("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),...i})}function Co({className:n,...o}){return y.jsx("div",{"data-slot":"skeleton",className:Pe("animate-pulse rounded-md bg-muted",n),...o})}function M0({className:n,size:o="default",...i}){return y.jsx("div",{"data-slot":"card","data-size":o,className:Pe("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",n),...i})}function O0({className:n,...o}){return y.jsx("div",{"data-slot":"card-header",className:Pe("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",n),...o})}function I0({className:n,...o}){return y.jsx("div",{"data-slot":"card-title",className:Pe("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",n),...o})}function L0({className:n,...o}){return y.jsx("div",{"data-slot":"card-description",className:Pe("text-sm text-muted-foreground",n),...o})}function A0({className:n,...o}){return y.jsx("div",{"data-slot":"card-content",className:Pe("px-4 group-data-[size=sm]/card:px-3",n),...o})}const z0=oc("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function D0({className:n,variant:o,...i}){return y.jsx("div",{"data-slot":"alert",role:"alert",className:Pe(z0({variant:o}),n),...i})}function F0({className:n,...o}){return y.jsx("div",{"data-slot":"alert-title",className:Pe("font-heading font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",n),...o})}function V0({className:n,...o}){return y.jsx("div",{"data-slot":"alert-description",className:Pe("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),...o})}/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eh=(...n)=>n.filter((o,i,l)=>!!o&&o.trim()!==""&&l.indexOf(o)===i).join(" ").trim();/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $0=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U0=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,i,l)=>l?l.toUpperCase():i.toLowerCase());/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rp=n=>{const o=U0(n);return o.charAt(0).toUpperCase()+o.slice(1)};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Ou={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B0=n=>{for(const o in n)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1},H0=E.createContext({}),W0=()=>E.useContext(H0),K0=E.forwardRef(({color:n,size:o,strokeWidth:i,absoluteStrokeWidth:l,className:u="",children:c,iconNode:f,...p},h)=>{const{size:m=24,strokeWidth:v=2,absoluteStrokeWidth:g=!1,color:S="currentColor",className:b=""}=W0()??{},k=l??g?Number(i??v)*24/Number(o??m):i??v;return E.createElement("svg",{ref:h,...Ou,width:o??m??Ou.width,height:o??m??Ou.height,stroke:n??S,strokeWidth:k,className:eh("lucide",b,u),...!c&&!B0(p)&&{"aria-hidden":"true"},...p},[...f.map(([C,w])=>E.createElement(C,w)),...Array.isArray(c)?c:[c]])});/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Er=(n,o)=>{const i=E.forwardRef(({className:l,...u},c)=>E.createElement(K0,{ref:c,iconNode:o,className:eh(`lucide-${$0(Rp(n))}`,`lucide-${n}`,l),...u}));return i.displayName=Rp(n),i};/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jl=Er("chevron-down",Y0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ml=Er("chevron-right",G0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q0=[["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"}]],X0=Er("external-link",Q0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q0=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Z0=Er("file-code-corner",q0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J0=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],ew=Er("flag",J0);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tw=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],nw=Er("folder-tree",tw);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],th=Er("info",rw);/** + * @license lucide-react v1.6.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ow=[["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"}]],iw=Er("triangle-alert",ow);function Ol({title:n,description:o,children:i}){return y.jsxs(M0,{className:"animate-in fade-in slide-in-from-bottom-1 duration-200",children:[y.jsxs(O0,{children:[y.jsx(I0,{children:n}),o?y.jsx(L0,{className:"max-w-prose",children:o}):null]}),y.jsx(A0,{children:i})]})}function sw({items:n}){return y.jsx("section",{className:"grid grid-cols-[repeat(auto-fit,minmax(110px,1fr))] gap-px rounded-xl overflow-hidden bg-border mb-4","aria-label":"Key numbers",children:n.map(o=>y.jsxs("article",{className:"bg-card px-4 py-3.5 flex flex-col gap-1",children:[y.jsx("span",{className:"text-[0.68rem] font-medium uppercase tracking-wider text-muted-foreground",children:o.label}),y.jsx("strong",{className:"text-[1.85rem] leading-none font-bold tabular-nums tracking-tight",children:o.value})]},o.label))})}function It({href:n,children:o}){return y.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-sm text-primary hover:underline whitespace-nowrap",children:[o,y.jsx(X0,{className:"size-3"})]})}function vn({label:n,active:o,direction:i,onClick:l}){return y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:y.jsxs("button",{type:"button",className:Pe("inline-flex items-center gap-1 cursor-pointer",o&&"text-foreground"),onClick:l,children:[n,y.jsx("span",{className:"text-muted-foreground text-[0.75em]",children:o?i==="desc"?"↓":"↑":"↕"})]})})}const lw={high:"risk-high",medium:"risk-medium",low:"risk-low",neutral:"outline"};function Js({label:n,value:o,tone:i}){return y.jsxs(vt,{variant:lw[i],children:[y.jsx("span",{className:"text-muted-foreground",children:n}),y.jsx("strong",{className:"font-medium",children:o})]})}function nh({level:n}){return n==="low"||n==="neutral"?null:y.jsxs("span",{className:Pe("inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wide",n==="high"?"text-destructive":"text-warning"),children:[y.jsx(ew,{className:"size-3"}),n," risk"]})}function aw({contributor:n,inline:o}){return n?y.jsxs("div",{className:Pe("flex flex-wrap gap-1.5",o&&"mt-1.5"),children:[jo(void 0,n)?y.jsx(Js,{label:"Contributor",value:"known",tone:"low"}):null,Mo(void 0,n)?y.jsx(Js,{label:"Contributor",value:"first contribution",tone:"high"}):null,y.jsx(Js,{label:"Automation",value:n.automation_risk_signal??"unknown",tone:To(n.automation_risk_signal)}),y.jsx(Js,{label:"Follow-through",value:n.follow_through_score??"unknown",tone:To(n.follow_through_score)})]}):y.jsx("div",{className:Pe("flex flex-wrap gap-1.5",o&&"mt-1.5"),children:"No contributor profile"})}function Il({contributor:n,compact:o}){return n?y.jsx("div",{className:Pe("text-muted-foreground",o&&"text-xs mt-0.5"),children:cy(n,o)}):null}function uw({clusterId:n,onOpenCluster:o}){return y.jsx(vt,{variant:"cluster",render:y.jsx("button",{type:"button",onClick:()=>o(n)}),children:n})}function rh({value:n,onChange:o,placeholder:i}){return y.jsx(j0,{type:"search",value:n,onChange:l=>o(l.target.value),placeholder:i??"Search…",className:"w-56 max-w-full"})}function cw(){return y.jsxs("div",{className:"flex flex-col gap-4 pt-4","aria-busy":"true","aria-label":"Loading",children:[y.jsx(Co,{className:"h-8 w-64"}),y.jsx(Co,{className:"h-4 w-96"}),y.jsx("div",{className:"grid grid-cols-6 gap-px rounded-xl overflow-hidden",children:Array.from({length:6},(n,o)=>y.jsx(Co,{className:"h-[72px] rounded-none"},o))}),y.jsx(Co,{className:"h-14 w-full"}),y.jsx(Co,{className:"h-14 w-full"}),y.jsx(Co,{className:"h-14 w-full"})]})}function dw({message:n}){return y.jsxs(D0,{variant:"destructive",children:[y.jsx(iw,{}),y.jsx(F0,{children:"Could not load dashboard data"}),y.jsxs(V0,{children:[y.jsx("pre",{className:"mt-2 overflow-auto text-xs font-mono",children:n}),y.jsxs("p",{className:"mt-2",children:["Generate data with ",y.jsx("code",{className:"text-destructive",children:"uv run slop-farmer dashboard-data"})," into ",y.jsx("code",{className:"text-destructive",children:"web/public/data"}),"."]})]})]})}function fw(n,o,i,l,u){const c=u==="desc"?-1:1,f=Pp(n,i,l),p=Pp(o,i,l);return fp?1*c:o.number-n.number}function Pp(n,o,i){var l;switch(i){case"updated_at":return n.updated_at??n.created_at??"";case"size":return Li(n);case"automation_risk":return Bu(((l=o.get(n.author??""))==null?void 0:l.automation_risk_signal)??null,["low","medium","high"])}}function pw(n){return"desc"}function mw(n,o,i,l){const u=l==="desc"?-1:1,c=Tp(n,i),f=Tp(o,i);return cf?1*u:n.author.localeCompare(o.author)}function Tp(n,o){switch(o){case"recent_pr_count":return n.recent_pr_count;case"snapshot_pr_count":return n.snapshot_pr_count;case"cluster_count":return n.cluster_count;case"status":return ty(n);case"follow_through_score":return Bu(n.follow_through_score,["weak","mixed","strong"]);case"automation_risk_signal":return Bu(n.automation_risk_signal,["low","medium","high"]);case"public_pr_count_42d":return n.public_pr_count_42d??-1;case"public_repo_count_42d":return n.public_repo_count_42d??-1}}function hw(n){return"desc"}function gw(n,o,i,l,u){const c=Np(n,i,l,u),f=Np(o,i,l,u);return cf?-1:(o.last_activity_at??"").localeCompare(n.last_activity_at??"")}function Np(n,o,i,l){switch(o){case"recent_pr_count":return n.recent_pr_count;case"pr_count":return n.pr_count;case"last_activity_at":return n.last_activity_at??"";case"flagged_prs":return iy(n,i,l)}}function vw(n,o,i){const l=jp(n,i),u=jp(o,i);return lu?-1:(o.last_activity_at??"").localeCompare(n.last_activity_at??"")}function jp(n,o){switch(o){case"recent_pr_count":return n.recent_pr_count;case"pr_count":return n.pr_count;case"average_similarity":return n.average_similarity;case"last_activity_at":return n.last_activity_at??""}}function yw(n){const{open:o,defaultOpen:i,onOpenChange:l,disabled:u}=n,c=o!==void 0,[f,p]=Nl({controlled:o,default:i,name:"Collapsible",state:"open"}),{mounted:h,setMounted:m,transitionStatus:v}=Jm(f,!0,!0),[g,S]=E.useState(f),[{height:b,width:k},C]=E.useState({height:void 0,width:void 0}),w=El(),[N,D]=E.useState(),T=N??w,[O,j]=E.useState(!1),[F,W]=E.useState(!1),A=E.useRef(null),$=E.useRef(null),ne=E.useRef(null),te=E.useRef(null),L=Zm(te,!1),K=Ee(G=>{const z=!f,X=Qe(Ni,G.nativeEvent);if(l(z,X),X.isCanceled)return;const Q=te.current;$.current==="css-animation"&&Q!=null&&Q.style.removeProperty("animation-name"),!O&&!F&&($.current!=null&&$.current!=="css-animation"&&!h&&z&&m(!0),$.current==="css-animation"&&(!g&&z&&S(!0),!h&&z&&m(!0))),p(z),$.current==="none"&&h&&!z&&m(!1)});return ke(()=>{c&&$.current==="none"&&!F&&!f&&m(!1)},[c,F,f,o,m]),E.useMemo(()=>({abortControllerRef:A,animationTypeRef:$,disabled:u,handleTrigger:K,height:b,mounted:h,open:f,panelId:T,panelRef:te,runOnceAnimationsFinish:L,setDimensions:C,setHiddenUntilFound:j,setKeepMounted:W,setMounted:m,setOpen:p,setPanelIdState:D,setVisible:S,transitionDimensionRef:ne,transitionStatus:v,visible:g,width:k}),[A,$,u,K,b,h,f,T,te,L,C,j,W,m,p,S,ne,v,g,k])}const oh=E.createContext(void 0);function ih(){const n=E.useContext(oh);if(n===void 0)throw new Error(Nn(15));return n}let ki=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=Yr.startingStyle]="startingStyle",n[n.endingStyle=Yr.endingStyle]="endingStyle",n})({}),xw=(function(n){return n.panelOpen="data-panel-open",n})({});const ww={[ki.open]:""},Sw={[ki.closed]:""},kw={open(n){return n?{[xw.panelOpen]:""}:null}},bw={open(n){return n?ww:Sw}},sh={...bw,...fc},Ew=E.forwardRef(function(o,i){const{render:l,className:u,defaultOpen:c=!1,disabled:f=!1,onOpenChange:p,open:h,...m}=o,v=Ee(p),g=yw({open:h,defaultOpen:c,onOpenChange:v,disabled:f}),S=E.useMemo(()=>({open:g.open,disabled:g.disabled,transitionStatus:g.transitionStatus}),[g.open,g.disabled,g.transitionStatus]),b=E.useMemo(()=>({...g,onOpenChange:v,state:S}),[g,v,S]),k=kt("div",o,{state:S,ref:i,props:m,stateAttributesMapping:sh});return y.jsx(oh.Provider,{value:b,children:k})}),lh=E.createContext(void 0);function ah(n=!1){const o=E.useContext(lh);if(o===void 0&&!n)throw new Error(Nn(16));return o}function Cw(n){const{focusableWhenDisabled:o,disabled:i,composite:l=!1,tabIndex:u=0,isNativeButton:c}=n,f=l&&o!==!1,p=l&&o===!1;return{props:E.useMemo(()=>{const m={onKeyDown(v){i&&o&&v.key!=="Tab"&&v.preventDefault()}};return l||(m.tabIndex=u,!c&&i&&(m.tabIndex=o?u:-1)),(c&&(o||f)||!c&&i)&&(m["aria-disabled"]=i),c&&(!o||p)&&(m.disabled=i),m},[l,i,o,f,p,c,u])}}function uh(n={}){const{disabled:o=!1,focusableWhenDisabled:i,tabIndex:l=0,native:u=!0,composite:c}=n,f=E.useRef(null),p=ah(!0),h=c??p!==void 0,{props:m}=Cw({focusableWhenDisabled:i,disabled:o,composite:h,tabIndex:l,isNativeButton:u}),v=E.useCallback(()=>{const b=f.current;Iu(b)&&h&&o&&m.disabled===void 0&&b.disabled&&(b.disabled=!1)},[o,m.disabled,h]);ke(v,[v]);const g=E.useCallback((b={})=>{const{onClick:k,onMouseDown:C,onKeyUp:w,onKeyDown:N,onPointerDown:D,...T}=b;return rc({type:u?"button":void 0,onClick(j){if(o){j.preventDefault();return}k==null||k(j)},onMouseDown(j){o||C==null||C(j)},onKeyDown(j){if(o||(Ku(j),N==null||N(j),j.baseUIHandlerPrevented))return;const F=j.target===j.currentTarget,W=j.currentTarget,A=Iu(W),$=!u&&_w(W),ne=F&&(u?A:!$),te=j.key==="Enter",L=j.key===" ",K=W.getAttribute("role"),G=(K==null?void 0:K.startsWith("menuitem"))||K==="option"||K==="gridcell";if(F&&h&&L){if(j.defaultPrevented&&G)return;j.preventDefault(),$||u&&A?(W.click(),j.preventBaseUIHandler()):ne&&(k==null||k(j),j.preventBaseUIHandler());return}ne&&(!u&&(L||te)&&j.preventDefault(),!u&&te&&(k==null||k(j)))},onKeyUp(j){if(!o){if(Ku(j),w==null||w(j),j.target===j.currentTarget&&u&&h&&Iu(j.currentTarget)&&j.key===" "){j.preventDefault();return}j.baseUIHandlerPrevented||j.target===j.currentTarget&&!u&&!h&&j.key===" "&&(k==null||k(j))}},onPointerDown(j){if(o){j.preventDefault();return}D==null||D(j)}},u?void 0:{role:"button"},m,T)},[o,m,h,u]),S=Ee(b=>{f.current=b,v()});return{getButtonProps:g,buttonRef:S}}function Iu(n){return bt(n)&&n.tagName==="BUTTON"}function _w(n){return!!((n==null?void 0:n.tagName)==="A"&&(n!=null&&n.href))}const Rw={...kw,...fc},Pw=E.forwardRef(function(o,i){const{panelId:l,open:u,handleTrigger:c,state:f,disabled:p}=ih(),{className:h,disabled:m=p,id:v,render:g,nativeButton:S=!0,...b}=o,{getButtonProps:k,buttonRef:C}=uh({disabled:m,focusableWhenDisabled:!0,native:S}),w=E.useMemo(()=>({"aria-controls":u?l:void 0,"aria-expanded":u,onClick:c}),[l,u,c]);return kt("button",o,{state:f,ref:[i,C],props:[w,b,k],stateAttributesMapping:Rw})});let Tw=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n})({});function Nw(n){const{abortControllerRef:o,animationTypeRef:i,externalRef:l,height:u,hiddenUntilFound:c,keepMounted:f,id:p,mounted:h,onOpenChange:m,open:v,panelRef:g,runOnceAnimationsFinish:S,setDimensions:b,setMounted:k,setOpen:C,setVisible:w,transitionDimensionRef:N,visible:D,width:T}=n,O=E.useRef(!1),j=E.useRef(null),F=E.useRef(v),W=E.useRef(v),A=qm(),$=E.useMemo(()=>i.current==="css-animation"?!D:!v&&!h,[v,h,D,i]),ne=Ee(L=>{if(!L)return;if(i.current==null||N.current==null){const z=getComputedStyle(L),X=z.animationName!=="none"&&z.animationName!=="",Q=z.transitionDuration!=="0s"&&z.transitionDuration!=="";X&&Q||(z.animationName==="none"&&z.transitionDuration!=="0s"?i.current="css-transition":z.animationName!=="none"&&z.transitionDuration==="0s"?i.current="css-animation":i.current="none"),L.getAttribute(Tw.orientation)==="horizontal"||z.transitionProperty.indexOf("width")>-1?N.current="width":N.current="height"}if(i.current!=="css-transition")return;(u===void 0||T===void 0)&&(b({height:L.scrollHeight,width:L.scrollWidth}),W.current&&L.style.setProperty("transition-duration","0s"));let K=-1,G=-1;return K=Ze.request(()=>{W.current=!1,G=Ze.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})}),()=>{Ze.cancel(K),Ze.cancel(G)}}),te=Ri(l,g,ne);return ke(()=>{if(i.current!=="css-transition")return;const L=g.current;if(!L)return;let K=-1;if(o.current!=null&&(o.current.abort(),o.current=null),v){const G={"justify-content":L.style.justifyContent,"align-items":L.style.alignItems,"align-content":L.style.alignContent,"justify-items":L.style.justifyItems};Object.keys(G).forEach(z=>{L.style.setProperty(z,"initial","important")}),!W.current&&!f&&L.setAttribute(ki.startingStyle,""),b({height:L.scrollHeight,width:L.scrollWidth}),K=Ze.request(()=>{Object.entries(G).forEach(([z,X])=>{X===""?L.style.removeProperty(z):L.style.setProperty(z,X)})})}else{if(L.scrollHeight===0&&L.scrollWidth===0)return;b({height:L.scrollHeight,width:L.scrollWidth});const G=new AbortController;o.current=G;const z=G.signal;let X=null;const Q=ki.endingStyle;return X=new MutationObserver(I=>{I.some(B=>B.type==="attributes"&&B.attributeName===Q)&&(X==null||X.disconnect(),X=null,S(()=>{b({height:0,width:0}),L.style.removeProperty("content-visibility"),k(!1),o.current===G&&(o.current=null)},z))}),X.observe(L,{attributes:!0,attributeFilter:[Q]}),()=>{X==null||X.disconnect(),A.cancel(),o.current===G&&(G.abort(),o.current=null)}}return()=>{Ze.cancel(K)}},[o,i,A,c,f,h,v,g,S,b,k]),ke(()=>{if(i.current!=="css-animation")return;const L=g.current;L&&(j.current=L.style.animationName||j.current,L.style.setProperty("animation-name","none"),b({height:L.scrollHeight,width:L.scrollWidth}),!F.current&&!O.current&&L.style.removeProperty("animation-name"),v?(o.current!=null&&(o.current.abort(),o.current=null),k(!0),w(!0)):(o.current=new AbortController,S(()=>{k(!1),w(!1),o.current=null},o.current.signal)))},[o,i,v,g,S,b,k,w,D]),Cl(()=>{const L=Ze.request(()=>{F.current=!1});return()=>Ze.cancel(L)}),ke(()=>{if(!c)return;const L=g.current;if(!L)return;let K=-1,G=-1;return v&&O.current&&(L.style.transitionDuration="0s",b({height:L.scrollHeight,width:L.scrollWidth}),K=Ze.request(()=>{O.current=!1,G=Ze.request(()=>{setTimeout(()=>{L.style.removeProperty("transition-duration")})})})),()=>{Ze.cancel(K),Ze.cancel(G)}},[c,v,g,b]),ke(()=>{const L=g.current;L&&c&&$&&(L.setAttribute("hidden","until-found"),i.current==="css-transition"&&L.setAttribute(ki.startingStyle,""))},[c,$,i,g]),E.useEffect(function(){const K=g.current;if(!K)return;function G(z){O.current=!0,C(!0),m(!0,Qe(Di,z))}return K.addEventListener("beforematch",G),()=>{K.removeEventListener("beforematch",G)}},[m,g,C]),E.useMemo(()=>({props:{hidden:$,id:p,ref:te}}),[$,p,te])}let Mp=(function(n){return n.collapsiblePanelHeight="--collapsible-panel-height",n.collapsiblePanelWidth="--collapsible-panel-width",n})({});const jw=E.forwardRef(function(o,i){const{className:l,hiddenUntilFound:u,keepMounted:c,render:f,id:p,...h}=o,{abortControllerRef:m,animationTypeRef:v,height:g,mounted:S,onOpenChange:b,open:k,panelId:C,panelRef:w,runOnceAnimationsFinish:N,setDimensions:D,setHiddenUntilFound:T,setKeepMounted:O,setMounted:j,setPanelIdState:F,setOpen:W,setVisible:A,state:$,transitionDimensionRef:ne,visible:te,width:L,transitionStatus:K}=ih(),G=u??!1,z=c??!1;ke(()=>{if(p)return F(p),()=>{F(void 0)}},[p,F]),ke(()=>{T(G)},[T,G]),ke(()=>{O(z)},[O,z]);const{props:X}=Nw({abortControllerRef:m,animationTypeRef:v,externalRef:i,height:g,hiddenUntilFound:G,id:C,keepMounted:z,mounted:S,onOpenChange:b,open:k,panelRef:w,runOnceAnimationsFinish:N,setDimensions:D,setMounted:j,setOpen:W,setVisible:A,transitionDimensionRef:ne,visible:te,width:L});pc({open:k&&K==="idle",ref:w,onComplete(){k&&D({height:void 0,width:void 0})}});const Q=E.useMemo(()=>({...$,transitionStatus:K}),[$,K]),I=kt("div",o,{state:Q,ref:[i,w],props:[X,{style:{[Mp.collapsiblePanelHeight]:g===void 0?"auto":`${g}px`,[Mp.collapsiblePanelWidth]:L===void 0?"auto":`${L}px`}},h],stateAttributesMapping:sh});return z||G||!z&&S?I:null});function ch({...n}){return y.jsx(Ew,{"data-slot":"collapsible",...n})}function dh({...n}){return y.jsx(Pw,{"data-slot":"collapsible-trigger",...n})}function fh({...n}){return y.jsx(jw,{"data-slot":"collapsible-content",...n})}const Ju=[];let ec;function Mw(){return ec}function Ow(n){Ju.push(n)}function ph(n){const o=(i,l)=>{const u=Ot(Lw).current;let c;try{ec=u;for(const f of Ju)f.before(u);c=n(i,l);for(const f of Ju)f.after(u);u.didInitialize=!0}finally{ec=void 0}return c};return o.displayName=n.displayName||n.name,o}function Iw(n){return E.forwardRef(ph(n))}function Lw(){return{didInitialize:!1}}function Aw(n){const o=E.useRef(!0);o.current&&(o.current=!1,n())}const mh=E.createContext(void 0);function Fi(n){const o=E.useContext(mh);if(o===void 0&&!n)throw new Error(Nn(72));return o}function zw(n,o){return o!=null&&!hl(o)?0:typeof n=="function"?n():n}function bi(n,o,i){const l=zw(n,i);return typeof l=="number"?l:l==null?void 0:l[o]}function Op(n){return typeof n=="function"?n():n}function hh(n,o){return o||n==="click"||n==="mousedown"}const gh=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Yn,currentIdRef:{current:null},currentContextRef:{current:null}});function Dw(n){const{children:o,delay:i,timeoutMs:l=0}=n,u=E.useRef(i),c=E.useRef(i),f=E.useRef(null),p=E.useRef(null),h=Pi();return y.jsx(gh.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:u,initialDelayRef:c,currentIdRef:f,timeoutMs:l,currentContextRef:p,timeout:h}),[l,h]),children:o})}function Fw(n,o={open:!1}){const i="rootStore"in n?n.rootStore:n,l=i.useState("floatingId"),{open:u}=o,c=E.useContext(gh),{currentIdRef:f,delayRef:p,timeoutMs:h,initialDelayRef:m,currentContextRef:v,hasProvider:g,timeout:S}=c,[b,k]=E.useState(!1);return ke(()=>{function C(){var w;k(!1),(w=v.current)==null||w.setIsInstantPhase(!1),f.current=null,v.current=null,p.current=m.current}if(f.current&&!u&&f.current===l){if(k(!1),h){const w=l;return S.start(h,()=>{i.select("open")||f.current&&f.current!==w||C()}),()=>{S.clear()}}C()}},[u,l,f,p,h,m,v,S,i]),ke(()=>{if(!u)return;const C=v.current,w=f.current;S.clear(),v.current={onOpenChange:i.setOpen,setIsInstantPhase:k},f.current=l,p.current={open:0,close:bi(m.current,"close")},w!==null&&w!==l?(k(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,Qe(Di))):(k(!1),C==null||C.setIsInstantPhase(!1))},[u,l,i,f,p,h,m,v,S]),ke(()=>()=>{v.current=null},[v]),E.useMemo(()=>({hasProvider:g,delayRef:p,isInstantPhase:b}),[g,p,b])}function Hr(n){const o=Ot(Vw,n).current;return o.next=n,ke(o.effect),o}function Vw(n){const o={current:n,next:n,effect:()=>{o.current=o.next}};return o}function hc(n){return`data-base-ui-${n}`}const $w=E.createContext(null),Uw=()=>E.useContext($w),Bw=hc("portal");function Hw(n={}){const{ref:o,container:i,componentProps:l=gt,elementProps:u}=n,c=bl(),f=Uw(),p=f==null?void 0:f.portalNode,[h,m]=E.useState(null),[v,g]=E.useState(null),S=Ee(w=>{w!==null&&g(w)}),b=E.useRef(null);ke(()=>{if(i===null){b.current&&(b.current=null,g(null),m(null));return}if(c==null)return;const w=(i&&(lc(i)?i:i.current))??p??document.body;if(w==null){b.current&&(b.current=null,g(null),m(null));return}b.current!==w&&(b.current=w,g(null),m(w))},[i,p,c]);const k=kt("div",l,{ref:[o,S],props:[{id:c,[Bw]:""},u]});return{portalNode:v,portalSubtree:h&&k?Zr.createPortal(k,h):null}}function Ww(){const n=new Map;return{emit(o,i){var l;(l=n.get(o))==null||l.forEach(u=>u(i))},on(o,i){n.has(o)||n.set(o,new Set),n.get(o).add(i)},off(o,i){var l;(l=n.get(o))==null||l.delete(i)}}}const Kw=E.createContext(null),Yw=E.createContext(null),gc=()=>{var n;return((n=E.useContext(Kw))==null?void 0:n.id)||null},Ll=n=>{const o=E.useContext(Yw);return n??o};function Gw(n,o){let i=null,l=null,u=!1;return{contextElement:n||void 0,getBoundingClientRect(){var b;const c=(n==null?void 0:n.getBoundingClientRect())||{width:0,height:0,x:0,y:0},f=o.axis==="x"||o.axis==="both",p=o.axis==="y"||o.axis==="both",h=["mouseenter","mousemove"].includes(((b=o.dataRef.current.openEvent)==null?void 0:b.type)||"")&&o.pointerType!=="touch";let m=c.width,v=c.height,g=c.x,S=c.y;return i==null&&o.x&&f&&(i=c.x-o.x),l==null&&o.y&&p&&(l=c.y-o.y),g-=i||0,S-=l||0,m=0,v=0,!u||h?(m=o.axis==="y"?c.width:0,v=o.axis==="x"?c.height:0,g=f&&o.x!=null?o.x:g,S=p&&o.y!=null?o.y:S):u&&!h&&(v=o.axis==="x"?c.height:v,m=o.axis==="y"?c.width:m),u=!0,{width:m,height:v,x:g,y:S,top:S,right:g+m,bottom:S+v,left:g}}}}function Ip(n){return n!=null&&n.clientX!=null}function Qw(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),u=i.useState("floatingElement"),c=i.useState("domReferenceElement"),f=i.context.dataRef,{enabled:p=!0,axis:h="both"}=o,m=E.useRef(!1),v=E.useRef(null),[g,S]=E.useState(),[b,k]=E.useState([]),C=Ee((O,j,F)=>{m.current||f.current.openEvent&&!Ip(f.current.openEvent)||i.set("positionReference",Gw(F??c,{x:O,y:j,axis:h,dataRef:f,pointerType:g}))}),w=Ee(O=>{l?v.current||k([]):C(O.clientX,O.clientY,O.currentTarget)}),N=hl(g)?u:l,D=E.useCallback(()=>{if(!N||!p)return;const O=yt(u);function j(F){const W=Rn(F);St(u,W)?(O.removeEventListener("mousemove",j),v.current=null):C(F.clientX,F.clientY)}if(!f.current.openEvent||Ip(f.current.openEvent)){O.addEventListener("mousemove",j);const F=()=>{O.removeEventListener("mousemove",j),v.current=null};return v.current=F,F}i.set("positionReference",c)},[N,p,u,f,c,i,C]);E.useEffect(()=>D(),[D,b]),E.useEffect(()=>{p&&!u&&(m.current=!1)},[p,u]),E.useEffect(()=>{!p&&l&&(m.current=!0)},[p,l]);const T=E.useMemo(()=>{function O(j){S(j.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:w,onMouseEnter:w}},[w]);return E.useMemo(()=>p?{reference:T,trigger:T}:{},[p,T])}const Xw={intentional:"onClick",sloppy:"onPointerDown"};function qw(){return!1}function Zw(n){return{escapeKey:typeof n=="boolean"?n:(n==null?void 0:n.escapeKey)??!1,outsidePress:typeof n=="boolean"?n:(n==null?void 0:n.outsidePress)??!0}}function Jw(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),u=i.useState("floatingElement"),{dataRef:c}=i.context,{enabled:f=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="sloppy",referencePress:v=qw,referencePressEvent:g="sloppy",bubbles:S,externalTree:b}=o,k=Ll(b),C=Ee(typeof h=="function"?h:()=>!1),w=typeof h=="function"?C:h,N=w!==!1,D=Ee(()=>m),T=E.useRef(!1),O=E.useRef(!1),j=E.useRef(!1),{escapeKey:F,outsidePress:W}=Zw(S),A=E.useRef(null),$=Pi(),ne=Pi(),te=Ee(()=>{ne.clear(),c.current.insideReactTree=!1}),L=E.useRef(!1),K=E.useRef(""),G=Ee(v),z=Ee(R=>{var oe;if(!l||!f||!p||R.key!=="Escape"||L.current)return;const Y=(oe=c.current.floatingContext)==null?void 0:oe.nodeId,ue=k?Wr(k.nodesRef.current,Y):[];if(!F&&ue.length>0){let he=!0;if(ue.forEach(xe=>{var fe;(fe=xe.context)!=null&&fe.open&&!xe.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const ce=t0(R)?R.nativeEvent:R,le=Qe(mc,ce);i.setOpen(!1,le),!F&&!le.isPropagationAllowed&&R.stopPropagation()}),X=Ee(()=>{c.current.insideReactTree=!0,ne.start(0,te)});E.useEffect(()=>{if(!l||!f)return;c.current.__escapeKeyBubbles=F,c.current.__outsidePressBubbles=W;const R=new Yn,Y=new Yn;function ue(){R.clear(),L.current=!0}function ce(){R.start(Pl()?5:0,()=>{L.current=!1})}function le(){j.current=!0,Y.start(0,()=>{j.current=!1})}function oe(){T.current=!1,O.current=!1}function he(){const ie=K.current,se=ie==="pen"||!ie?"mouse":ie,Ie=D(),Fe=typeof Ie=="function"?Ie():Ie;return typeof Fe=="string"?Fe:Fe[se]}function xe(ie){const se=he();return se==="intentional"&&ie.type!=="click"||se==="sloppy"&&ie.type==="click"}function fe(ie){var Fe;const se=(Fe=c.current.floatingContext)==null?void 0:Fe.nodeId,Ie=k&&Wr(k.nodesRef.current,se).some(At=>{var on;return gn(ie,(on=At.context)==null?void 0:on.elements.floating)});return gn(ie,i.select("floatingElement"))||gn(ie,i.select("domReferenceElement"))||Ie}function Te(ie){var zt;if(xe(ie)){te();return}if(c.current.insideReactTree){te();return}const se=Rn(ie),Ie=`[${hc("inert")}]`;let Fe=Array.from(Qn(i.select("floatingElement")).querySelectorAll(Ie));const At=Oe(se)?se.getRootNode():null;pl(At)&&(Fe=Fe.concat(Array.from(At.querySelectorAll(Ie))));const on=i.context.triggerElements;if(se&&(on.hasElement(se)||on.hasMatchingElement(Ve=>St(Ve,se))))return;let Yt=Oe(se)?se:null;for(;Yt&&!Kn(Yt);){const Ve=Gn(Yt);if(Kn(Ve)||!Oe(Ve))break;Yt=Ve}if(Fe.length&&Oe(se)&&!Zx(se)&&!St(se,i.select("floatingElement"))&&Fe.every(Ve=>!St(Yt,Ve)))return;if(bt(se)&&!("touches"in ie)){const Ve=Kn(se),sn=Ht(se),ln=/auto|scroll/,_r=Ve||ln.test(sn.overflowX),Jr=Ve||ln.test(sn.overflowY),Zn=_r&&se.clientWidth>0&&se.scrollWidth>se.clientWidth,Jn=Jr&&se.clientHeight>0&&se.scrollHeight>se.clientHeight,er=sn.direction==="rtl",je=Jn&&(er?ie.offsetX<=se.offsetWidth-se.clientWidth:ie.offsetX>se.clientWidth),Ye=Zn&&ie.offsetY>se.clientHeight;if(je||Ye)return}if(fe(ie))return;if(he()==="intentional"&&j.current){Y.clear(),j.current=!1;return}if(typeof w=="function"&&!w(ie))return;const yn=(zt=c.current.floatingContext)==null?void 0:zt.nodeId,qn=k?Wr(k.nodesRef.current,yn):[];if(qn.length>0){let Ve=!0;if(qn.forEach(sn=>{var ln;(ln=sn.context)!=null&&ln.open&&!sn.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}i.setOpen(!1,Qe(_0,ie)),te()}function Ke(ie){he()!=="sloppy"||ie.pointerType==="touch"||!i.select("open")||!f||gn(ie,i.select("floatingElement"))||gn(ie,i.select("domReferenceElement"))||Te(ie)}function Wt(ie){if(he()!=="sloppy"||!i.select("open")||!f||gn(ie,i.select("floatingElement"))||gn(ie,i.select("domReferenceElement")))return;const se=ie.touches[0];se&&(A.current={startTime:Date.now(),startX:se.clientX,startY:se.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},$.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function Et(ie){K.current="touch";const se=Rn(ie);function Ie(){Wt(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function it(ie){if($.clear(),ie.type==="pointerdown"&&(K.current=ie.pointerType),ie.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const se=Rn(ie);function Ie(){ie.type==="pointerdown"?Ke(ie):Te(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function Lt(ie){if(!T.current)return;const se=O.current;if(oe(),he()==="intentional"){if(ie.type==="pointercancel"){se&&le();return}if(!fe(ie)){if(se){le();return}typeof w=="function"&&!w(ie)||(Y.clear(),j.current=!0,te())}}}function rn(ie){if(he()!=="sloppy"||!A.current||gn(ie,i.select("floatingElement"))||gn(ie,i.select("domReferenceElement")))return;const se=ie.touches[0];if(!se)return;const Ie=Math.abs(se.clientX-A.current.startX),Fe=Math.abs(se.clientY-A.current.startY),At=Math.sqrt(Ie*Ie+Fe*Fe);At>5&&(A.current.dismissOnTouchEnd=!0),At>10&&(Te(ie),$.clear(),A.current=null)}function Kt(ie){const se=Rn(ie);function Ie(){rn(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}function Cr(ie){he()!=="sloppy"||!A.current||gn(ie,i.select("floatingElement"))||gn(ie,i.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&Te(ie),$.clear(),A.current=null)}function Mn(ie){const se=Rn(ie);function Ie(){Cr(ie),se==null||se.removeEventListener(ie.type,Ie)}se==null||se.addEventListener(ie.type,Ie)}const Re=Qn(u);return p&&(Re.addEventListener("keydown",z),Re.addEventListener("compositionstart",ue),Re.addEventListener("compositionend",ce)),N&&(Re.addEventListener("click",it,!0),Re.addEventListener("pointerdown",it,!0),Re.addEventListener("pointerup",Lt,!0),Re.addEventListener("pointercancel",Lt,!0),Re.addEventListener("mousedown",it,!0),Re.addEventListener("mouseup",Lt,!0),Re.addEventListener("touchstart",Et,!0),Re.addEventListener("touchmove",Kt,!0),Re.addEventListener("touchend",Mn,!0)),()=>{p&&(Re.removeEventListener("keydown",z),Re.removeEventListener("compositionstart",ue),Re.removeEventListener("compositionend",ce)),N&&(Re.removeEventListener("click",it,!0),Re.removeEventListener("pointerdown",it,!0),Re.removeEventListener("pointerup",Lt,!0),Re.removeEventListener("pointercancel",Lt,!0),Re.removeEventListener("mousedown",it,!0),Re.removeEventListener("mouseup",Lt,!0),Re.removeEventListener("touchstart",Et,!0),Re.removeEventListener("touchmove",Kt,!0),Re.removeEventListener("touchend",Mn,!0)),R.clear(),Y.clear(),oe(),j.current=!1}},[c,u,p,N,w,l,f,F,W,z,te,D,k,i,$]),E.useEffect(te,[w,te]);const Q=E.useMemo(()=>({onKeyDown:z,[Xw[g]]:R=>{G()&&i.setOpen(!1,Qe(Ni,R.nativeEvent))},...g!=="intentional"&&{onClick(R){G()&&i.setOpen(!1,Qe(Ni,R.nativeEvent))}}}),[z,i,g,G]),I=Ee(R=>{if(!l||!f||R.button!==0)return;const Y=Rn(R.nativeEvent);St(i.select("floatingElement"),Y)&&(T.current||(T.current=!0,O.current=!1))}),q=Ee(R=>{!l||!f||(R.defaultPrevented||R.nativeEvent.defaultPrevented)&&T.current&&(O.current=!0)}),B=E.useMemo(()=>({onKeyDown:z,onPointerDown:q,onMouseDown:q,onClickCapture:X,onMouseDownCapture(R){X(),I(R)},onPointerDownCapture(R){X(),I(R)},onMouseUpCapture:X,onTouchEndCapture:X,onTouchMoveCapture:X}),[z,X,I,q]);return E.useMemo(()=>f?{reference:Q,floating:B,trigger:Q}:{},[f,Q,B])}function Lp(n,o,i){let{reference:l,floating:u}=n;const c=nn(o),f=dc(o),p=cc(f),h=Mt(o),m=c==="y",v=l.x+l.width/2-u.width/2,g=l.y+l.height/2-u.height/2,S=l[p]/2-u[p]/2;let b;switch(h){case"top":b={x:v,y:l.y-u.height};break;case"bottom":b={x:v,y:l.y+l.height};break;case"right":b={x:l.x+l.width,y:g};break;case"left":b={x:l.x-u.width,y:g};break;default:b={x:l.x,y:l.y}}switch(br(o)){case"start":b[f]-=S*(i&&m?-1:1);break;case"end":b[f]+=S*(i&&m?-1:1);break}return b}async function eS(n,o){var i;o===void 0&&(o={});const{x:l,y:u,platform:c,rects:f,elements:p,strategy:h}=n,{boundary:m="clippingAncestors",rootBoundary:v="viewport",elementContext:g="floating",altBoundary:S=!1,padding:b=0}=Xn(o,n),k=Xm(b),w=p[S?g==="floating"?"reference":"floating":g],N=yl(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(w)))==null||i?w:w.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(p.floating)),boundary:m,rootBoundary:v,strategy:h})),D=g==="floating"?{x:l,y:u,width:f.floating.width,height:f.floating.height}:f.reference,T=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p.floating)),O=await(c.isElement==null?void 0:c.isElement(T))?await(c.getScale==null?void 0:c.getScale(T))||{x:1,y:1}:{x:1,y:1},j=yl(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:T,strategy:h}):D);return{top:(N.top-j.top+k.top)/O.y,bottom:(j.bottom-N.bottom+k.bottom)/O.y,left:(N.left-j.left+k.left)/O.x,right:(j.right-N.right+k.right)/O.x}}const tS=50,nS=async(n,o,i)=>{const{placement:l="bottom",strategy:u="absolute",middleware:c=[],platform:f}=i,p=f.detectOverflow?f:{...f,detectOverflow:eS},h=await(f.isRTL==null?void 0:f.isRTL(o));let m=await f.getElementRects({reference:n,floating:o,strategy:u}),{x:v,y:g}=Lp(m,l,h),S=l,b=0;const k={};for(let C=0;CG<=0)){var te,L;const G=(((te=c.flip)==null?void 0:te.index)||0)+1,z=W[G];if(z&&(!(g==="alignment"?D!==nn(z):!1)||ne.every(I=>nn(I.placement)===D?I.overflows[0]>0:!0)))return{data:{index:G,overflows:ne},reset:{placement:z}};let X=(L=ne.filter(Q=>Q.overflows[0]<=0).sort((Q,I)=>Q.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(b){case"bestFit":{var K;const Q=(K=ne.filter(I=>{if(F){const q=nn(I.placement);return q===D||q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(q=>q>0).reduce((q,B)=>q+B,0)]).sort((I,q)=>I[1]-q[1])[0])==null?void 0:K[0];Q&&(X=Q);break}case"initialPlacement":X=p;break}if(u!==X)return{reset:{placement:X}}}return{}}}};function Ap(n,o){return{top:n.top-o.height,right:n.right-o.width,bottom:n.bottom-o.height,left:n.left-o.width}}function zp(n){return r0.some(o=>n[o]>=0)}const oS=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(o){const{rects:i,platform:l}=o,{strategy:u="referenceHidden",...c}=Xn(n,o);switch(u){case"referenceHidden":{const f=await l.detectOverflow(o,{...c,elementContext:"reference"}),p=Ap(f,i.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:zp(p)}}}case"escaped":{const f=await l.detectOverflow(o,{...c,altBoundary:!0}),p=Ap(f,i.floating);return{data:{escapedOffsets:p,escaped:zp(p)}}}default:return{}}}}},vh=new Set(["left","top"]);async function iS(n,o){const{placement:i,platform:l,elements:u}=n,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Mt(i),p=br(i),h=nn(i)==="y",m=vh.has(f)?-1:1,v=c&&h?-1:1,g=Xn(o,n);let{mainAxis:S,crossAxis:b,alignmentAxis:k}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return p&&typeof k=="number"&&(b=p==="end"?k*-1:k),h?{x:b*v,y:S*m}:{x:S*m,y:b*v}}const sS=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(o){var i,l;const{x:u,y:c,placement:f,middlewareData:p}=o,h=await iS(o,n);return f===((i=p.offset)==null?void 0:i.placement)&&(l=p.arrow)!=null&&l.alignmentOffset?{}:{x:u+h.x,y:c+h.y,data:{...h,placement:f}}}}},lS=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(o){const{x:i,y:l,placement:u,platform:c}=o,{mainAxis:f=!0,crossAxis:p=!1,limiter:h={fn:N=>{let{x:D,y:T}=N;return{x:D,y:T}}},...m}=Xn(n,o),v={x:i,y:l},g=await c.detectOverflow(o,m),S=nn(Mt(u)),b=uc(S);let k=v[b],C=v[S];if(f){const N=b==="y"?"top":"left",D=b==="y"?"bottom":"right",T=k+g[N],O=k-g[D];k=Xu(T,k,O)}if(p){const N=S==="y"?"top":"left",D=S==="y"?"bottom":"right",T=C+g[N],O=C-g[D];C=Xu(T,C,O)}const w=h.fn({...o,[b]:k,[S]:C});return{...w,data:{x:w.x-i,y:w.y-l,enabled:{[b]:f,[S]:p}}}}}},aS=function(n){return n===void 0&&(n={}),{options:n,fn(o){const{x:i,y:l,placement:u,rects:c,middlewareData:f}=o,{offset:p=0,mainAxis:h=!0,crossAxis:m=!0}=Xn(n,o),v={x:i,y:l},g=nn(u),S=uc(g);let b=v[S],k=v[g];const C=Xn(p,o),w=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const T=S==="y"?"height":"width",O=c.reference[S]-c.floating[T]+w.mainAxis,j=c.reference[S]+c.reference[T]-w.mainAxis;bj&&(b=j)}if(m){var N,D;const T=S==="y"?"width":"height",O=vh.has(Mt(u)),j=c.reference[g]-c.floating[T]+(O&&((N=f.offset)==null?void 0:N[g])||0)+(O?0:w.crossAxis),F=c.reference[g]+c.reference[T]+(O?0:((D=f.offset)==null?void 0:D[g])||0)-(O?w.crossAxis:0);kF&&(k=F)}return{[S]:b,[g]:k}}}},uS=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(o){var i,l;const{placement:u,rects:c,platform:f,elements:p}=o,{apply:h=()=>{},...m}=Xn(n,o),v=await f.detectOverflow(o,m),g=Mt(u),S=br(u),b=nn(u)==="y",{width:k,height:C}=c.floating;let w,N;g==="top"||g==="bottom"?(w=g,N=S===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(N=g,w=S==="end"?"top":"bottom");const D=C-v.top-v.bottom,T=k-v.left-v.right,O=No(C-v[w],D),j=No(k-v[N],T),F=!o.middlewareData.shift;let W=O,A=j;if((i=o.middlewareData.shift)!=null&&i.enabled.x&&(A=T),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(W=D),F&&!S){const ne=Ut(v.left,0),te=Ut(v.right,0),L=Ut(v.top,0),K=Ut(v.bottom,0);b?A=k-2*(ne!==0||te!==0?ne+te:Ut(v.left,v.right)):W=C-2*(L!==0||K!==0?L+K:Ut(v.top,v.bottom))}await h({...o,availableWidth:A,availableHeight:W});const $=await f.getDimensions(p.floating);return k!==$.width||C!==$.height?{reset:{rects:!0}}:{}}}};function yh(n){const o=Ht(n);let i=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const u=bt(n),c=u?n.offsetWidth:i,f=u?n.offsetHeight:l,p=gl(i)!==c||gl(l)!==f;return p&&(i=c,l=f),{width:i,height:l,$:p}}function vc(n){return Oe(n)?n:n.contextElement}function Po(n){const o=vc(n);if(!bt(o))return Tn(1);const i=o.getBoundingClientRect(),{width:l,height:u,$:c}=yh(o);let f=(c?gl(i.width):i.width)/l,p=(c?gl(i.height):i.height)/u;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const cS=Tn(0);function xh(n){const o=yt(n);return!Pl()||!o.visualViewport?cS:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function dS(n,o,i){return o===void 0&&(o=!1),!i||o&&i!==yt(n)?!1:o}function Gr(n,o,i,l){o===void 0&&(o=!1),i===void 0&&(i=!1);const u=n.getBoundingClientRect(),c=vc(n);let f=Tn(1);o&&(l?Oe(l)&&(f=Po(l)):f=Po(n));const p=dS(c,i,l)?xh(c):Tn(0);let h=(u.left+p.x)/f.x,m=(u.top+p.y)/f.y,v=u.width/f.x,g=u.height/f.y;if(c){const S=yt(c),b=l&&Oe(l)?yt(l):l;let k=S,C=Gu(k);for(;C&&l&&b!==k;){const w=Po(C),N=C.getBoundingClientRect(),D=Ht(C),T=N.left+(C.clientLeft+parseFloat(D.paddingLeft))*w.x,O=N.top+(C.clientTop+parseFloat(D.paddingTop))*w.y;h*=w.x,m*=w.y,v*=w.x,g*=w.y,h+=T,m+=O,k=yt(C),C=Gu(k)}}return yl({width:v,height:g,x:h,y:m})}function Al(n,o){const i=Tl(n).scrollLeft;return o?o.left+i:Gr(jn(n)).left+i}function wh(n,o){const i=n.getBoundingClientRect(),l=i.left+o.scrollLeft-Al(n,i),u=i.top+o.scrollTop;return{x:l,y:u}}function fS(n){let{elements:o,rect:i,offsetParent:l,strategy:u}=n;const c=u==="fixed",f=jn(l),p=o?Rl(o.floating):!1;if(l===f||p&&c)return i;let h={scrollLeft:0,scrollTop:0},m=Tn(1);const v=Tn(0),g=bt(l);if((g||!g&&!c)&&((Oo(l)!=="body"||Ai(f))&&(h=Tl(l)),g)){const b=Gr(l);m=Po(l),v.x=b.x+l.clientLeft,v.y=b.y+l.clientTop}const S=f&&!g&&!c?wh(f,h):Tn(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-h.scrollLeft*m.x+v.x+S.x,y:i.y*m.y-h.scrollTop*m.y+v.y+S.y}}function pS(n){return Array.from(n.getClientRects())}function mS(n){const o=jn(n),i=Tl(n),l=n.ownerDocument.body,u=Ut(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),c=Ut(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let f=-i.scrollLeft+Al(n);const p=-i.scrollTop;return Ht(l).direction==="rtl"&&(f+=Ut(o.clientWidth,l.clientWidth)-u),{width:u,height:c,x:f,y:p}}const Dp=25;function hS(n,o){const i=yt(n),l=jn(n),u=i.visualViewport;let c=l.clientWidth,f=l.clientHeight,p=0,h=0;if(u){c=u.width,f=u.height;const v=Pl();(!v||v&&o==="fixed")&&(p=u.offsetLeft,h=u.offsetTop)}const m=Al(l);if(m<=0){const v=l.ownerDocument,g=v.body,S=getComputedStyle(g),b=v.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,k=Math.abs(l.clientWidth-g.clientWidth-b);k<=Dp&&(c-=k)}else m<=Dp&&(c+=m);return{width:c,height:f,x:p,y:h}}function gS(n,o){const i=Gr(n,!0,o==="fixed"),l=i.top+n.clientTop,u=i.left+n.clientLeft,c=bt(n)?Po(n):Tn(1),f=n.clientWidth*c.x,p=n.clientHeight*c.y,h=u*c.x,m=l*c.y;return{width:f,height:p,x:h,y:m}}function Fp(n,o,i){let l;if(o==="viewport")l=hS(n,i);else if(o==="document")l=mS(jn(n));else if(Oe(o))l=gS(o,i);else{const u=xh(n);l={x:o.x-u.x,y:o.y-u.y,width:o.width,height:o.height}}return yl(l)}function Sh(n,o){const i=Gn(n);return i===o||!Oe(i)||Kn(i)?!1:Ht(i).position==="fixed"||Sh(i,o)}function vS(n,o){const i=o.get(n);if(i)return i;let l=Ti(n,[],!1).filter(p=>Oe(p)&&Oo(p)!=="body"),u=null;const c=Ht(n).position==="fixed";let f=c?Gn(n):n;for(;Oe(f)&&!Kn(f);){const p=Ht(f),h=ac(f);!h&&p.position==="fixed"&&(u=null),(c?!h&&!u:!h&&p.position==="static"&&!!u&&(u.position==="absolute"||u.position==="fixed")||Ai(f)&&!h&&Sh(n,f))?l=l.filter(v=>v!==f):u=p,f=Gn(f)}return o.set(n,l),l}function yS(n){let{element:o,boundary:i,rootBoundary:l,strategy:u}=n;const f=[...i==="clippingAncestors"?Rl(o)?[]:vS(o,this._c):[].concat(i),l],p=Fp(o,f[0],u);let h=p.top,m=p.right,v=p.bottom,g=p.left;for(let S=1;S{f(!1,1e-7)},1e3)}W===1&&!bh(m,n.getBoundingClientRect())&&f(),O=!1}try{i=new IntersectionObserver(j,{...T,root:u.ownerDocument})}catch{i=new IntersectionObserver(j,T)}i.observe(n)}return f(!0),c}function $p(n,o,i,l){l===void 0&&(l={});const{ancestorScroll:u=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=l,m=vc(n),v=u||c?[...m?Ti(m):[],...o?Ti(o):[]]:[];v.forEach(N=>{u&&N.addEventListener("scroll",i,{passive:!0}),c&&N.addEventListener("resize",i)});const g=m&&p?ES(m,i):null;let S=-1,b=null;f&&(b=new ResizeObserver(N=>{let[D]=N;D&&D.target===m&&b&&o&&(b.unobserve(o),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(o)})),i()}),m&&!h&&b.observe(m),o&&b.observe(o));let k,C=h?Gr(n):null;h&&w();function w(){const N=Gr(n);C&&!bh(C,N)&&i(),C=N,k=requestAnimationFrame(w)}return i(),()=>{var N;v.forEach(D=>{u&&D.removeEventListener("scroll",i),c&&D.removeEventListener("resize",i)}),g==null||g(),(N=b)==null||N.disconnect(),b=null,h&&cancelAnimationFrame(k)}}const CS=sS,_S=lS,RS=rS,PS=uS,TS=oS,NS=aS,jS=(n,o,i)=>{const l=new Map,u={platform:bS,...i},c={...u.platform,_c:l};return nS(n,o,{...u,platform:c})};var MS=typeof document<"u",OS=function(){},ul=MS?E.useLayoutEffect:OS;function xl(n,o){if(n===o)return!0;if(typeof n!=typeof o)return!1;if(typeof n=="function"&&n.toString()===o.toString())return!0;let i,l,u;if(n&&o&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==o.length)return!1;for(l=i;l--!==0;)if(!xl(n[l],o[l]))return!1;return!0}if(u=Object.keys(n),i=u.length,i!==Object.keys(o).length)return!1;for(l=i;l--!==0;)if(!{}.hasOwnProperty.call(o,u[l]))return!1;for(l=i;l--!==0;){const c=u[l];if(!(c==="_owner"&&n.$$typeof)&&!xl(n[c],o[c]))return!1}return!0}return n!==n&&o!==o}function Eh(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Up(n,o){const i=Eh(n);return Math.round(o*i)/i}function Au(n){const o=E.useRef(n);return ul(()=>{o.current=n}),o}function IS(n){n===void 0&&(n={});const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:u,elements:{reference:c,floating:f}={},transform:p=!0,whileElementsMounted:h,open:m}=n,[v,g]=E.useState({x:0,y:0,strategy:i,placement:o,middlewareData:{},isPositioned:!1}),[S,b]=E.useState(l);xl(S,l)||b(l);const[k,C]=E.useState(null),[w,N]=E.useState(null),D=E.useCallback(I=>{I!==F.current&&(F.current=I,C(I))},[]),T=E.useCallback(I=>{I!==W.current&&(W.current=I,N(I))},[]),O=c||k,j=f||w,F=E.useRef(null),W=E.useRef(null),A=E.useRef(v),$=h!=null,ne=Au(h),te=Au(u),L=Au(m),K=E.useCallback(()=>{if(!F.current||!W.current)return;const I={placement:o,strategy:i,middleware:S};te.current&&(I.platform=te.current),jS(F.current,W.current,I).then(q=>{const B={...q,isPositioned:L.current!==!1};G.current&&!xl(A.current,B)&&(A.current=B,Zr.flushSync(()=>{g(B)}))})},[S,o,i,te,L]);ul(()=>{m===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,g(I=>({...I,isPositioned:!1})))},[m]);const G=E.useRef(!1);ul(()=>(G.current=!0,()=>{G.current=!1}),[]),ul(()=>{if(O&&(F.current=O),j&&(W.current=j),O&&j){if(ne.current)return ne.current(O,j,K);K()}},[O,j,K,ne,$]);const z=E.useMemo(()=>({reference:F,floating:W,setReference:D,setFloating:T}),[D,T]),X=E.useMemo(()=>({reference:O,floating:j}),[O,j]),Q=E.useMemo(()=>{const I={position:i,left:0,top:0};if(!X.floating)return I;const q=Up(X.floating,v.x),B=Up(X.floating,v.y);return p?{...I,transform:"translate("+q+"px, "+B+"px)",...Eh(X.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:q,top:B}},[i,p,X.floating,v.x,v.y]);return E.useMemo(()=>({...v,update:K,refs:z,elements:X,floatingStyles:Q}),[v,K,z,X,Q])}const LS=(n,o)=>{const i=CS(n);return{name:i.name,fn:i.fn,options:[n,o]}},AS=(n,o)=>{const i=_S(n);return{name:i.name,fn:i.fn,options:[n,o]}},zS=(n,o)=>({fn:NS(n).fn,options:[n,o]}),DS=(n,o)=>{const i=RS(n);return{name:i.name,fn:i.fn,options:[n,o]}},FS=(n,o)=>{const i=PS(n);return{name:i.name,fn:i.fn,options:[n,o]}},VS=(n,o)=>{const i=TS(n);return{name:i.name,fn:i.fn,options:[n,o]}};var wl=Symbol("NOT_FOUND");function $S(n,o=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(o)}function US(n,o=`expected an object, instead received ${typeof n}`){if(typeof n!="object")throw new TypeError(o)}function BS(n,o="expected all items to be functions, instead received the following types: "){if(!n.every(i=>typeof i=="function")){const i=n.map(l=>typeof l=="function"?`function ${l.name||"unnamed"}()`:typeof l).join(", ");throw new TypeError(`${o}[${i}]`)}}var Bp=n=>Array.isArray(n)?n:[n];function HS(n){const o=Array.isArray(n[0])?n[0]:n;return BS(o,"createSelector expects all input-selectors to be functions, but received the following types: "),o}function WS(n,o){const i=[],{length:l}=n;for(let u=0;uo(p,m.key));if(h>-1){const m=i[h];return h>0&&(i.splice(h,1),i.unshift(m)),m.value}return wl}function u(p,h){l(p)===wl&&(i.unshift({key:p,value:h}),i.length>n&&i.pop())}function c(){return i}function f(){i=[]}return{get:l,put:u,getEntries:c,clear:f}}var GS=(n,o)=>n===o;function QS(n){return function(i,l){if(i===null||l===null||i.length!==l.length)return!1;const{length:u}=i;for(let c=0;cc(b.value,v));S&&(v=S.value,p!==0&&p--)}h.put(arguments,v)}return v}return m.clearCache=()=>{h.clear(),m.resetResultsCount()},m.resultsCount=()=>p,m.resetResultsCount=()=>{p=0},m}var qS=class{constructor(n){this.value=n}deref(){return this.value}},ZS=typeof WeakRef<"u"?WeakRef:qS,JS=0,Hp=1;function el(){return{s:JS,v:void 0,o:null,p:null}}function Ch(n,o={}){let i=el();const{resultEqualityCheck:l}=o;let u,c=0;function f(){var g;let p=i;const{length:h}=arguments;for(let S=0,b=h;S{i=el(),f.resetResultsCount()},f.resultsCount=()=>c,f.resetResultsCount=()=>{c=0},f}function _h(n,...o){const i=typeof n=="function"?{memoize:n,memoizeOptions:o}:n,l=(...u)=>{let c=0,f=0,p,h={},m=u.pop();typeof m=="object"&&(h=m,m=u.pop()),$S(m,`createSelector expects an output function after the inputs, but received: [${typeof m}]`);const v={...i,...h},{memoize:g,memoizeOptions:S=[],argsMemoize:b=Ch,argsMemoizeOptions:k=[]}=v,C=Bp(S),w=Bp(k),N=HS(u),D=g(function(){return c++,m.apply(null,arguments)},...C),T=b(function(){f++;const j=WS(N,arguments);return p=D.apply(null,j),p},...w);return Object.assign(T,{resultFunc:m,memoizedResultFunc:D,dependencies:N,dependencyRecomputations:()=>f,resetDependencyRecomputations:()=>{f=0},lastResult:()=>p,recomputations:()=>c,resetRecomputations:()=>{c=0},memoize:g,argsMemoize:b})};return Object.assign(l,{withTypes:()=>l}),l}var e1=_h(Ch),t1=Object.assign((n,o=e1)=>{US(n,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof n}`);const i=Object.keys(n),l=i.map(c=>n[c]);return o(l,(...c)=>c.reduce((f,p,h)=>(f[i[h]]=p,f),{}))},{withTypes:()=>t1});_h({memoize:XS,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ae=(n,o,i,l,u,c,...f)=>{if(f.length>0)throw new Error(Nn(1));let p;if(n)p=n;else throw new Error("Missing arguments");return p};var zu={exports:{}},Du={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wp;function n1(){if(Wp)return Du;Wp=1;var n=Ii();function o(g,S){return g===S&&(g!==0||1/g===1/S)||g!==g&&S!==S}var i=typeof Object.is=="function"?Object.is:o,l=n.useState,u=n.useEffect,c=n.useLayoutEffect,f=n.useDebugValue;function p(g,S){var b=S(),k=l({inst:{value:b,getSnapshot:S}}),C=k[0].inst,w=k[1];return c(function(){C.value=b,C.getSnapshot=S,h(C)&&w({inst:C})},[g,b,S]),u(function(){return h(C)&&w({inst:C}),g(function(){h(C)&&w({inst:C})})},[g]),f(b),b}function h(g){var S=g.getSnapshot;g=g.value;try{var b=S();return!i(g,b)}catch{return!0}}function m(g,S){return S()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:p;return Du.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,Du}var Kp;function Rh(){return Kp||(Kp=1,zu.exports=n1()),zu.exports}var Ph=Rh(),Fu={exports:{}},Vu={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yp;function r1(){if(Yp)return Vu;Yp=1;var n=Ii(),o=Rh();function i(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var l=typeof Object.is=="function"?Object.is:i,u=o.useSyncExternalStore,c=n.useRef,f=n.useEffect,p=n.useMemo,h=n.useDebugValue;return Vu.useSyncExternalStoreWithSelector=function(m,v,g,S,b){var k=c(null);if(k.current===null){var C={hasValue:!1,value:null};k.current=C}else C=k.current;k=p(function(){function N(F){if(!D){if(D=!0,T=F,F=S(F),b!==void 0&&C.hasValue){var W=C.value;if(b(W,F))return O=W}return O=F}if(W=O,l(T,F))return W;var A=S(F);return b!==void 0&&b(W,A)?(T=F,W):(T=F,O=A)}var D=!1,T,O,j=g===void 0?null:g;return[function(){return N(v())},j===null?void 0:function(){return N(j())}]},[v,g,S,b]);var w=u(m,k[0],k[1]);return f(function(){C.hasValue=!0,C.value=w},[w]),h(w),w},Vu}var Gp;function o1(){return Gp||(Gp=1,Fu.exports=r1()),Fu.exports}var i1=o1();const s1=Rm(19),l1=s1?u1:c1;function Th(n,o,i,l,u){return l1(n,o,i,l,u)}function a1(n,o,i,l,u){const c=E.useCallback(()=>o(n.getSnapshot(),i,l,u),[n,o,i,l,u]);return Ph.useSyncExternalStore(n.subscribe,c,c)}Ow({before(n){n.syncIndex=0,n.didInitialize||(n.syncTick=1,n.syncHooks=[],n.didChangeStore=!0,n.getSnapshot=()=>{let o=!1;for(let i=0;i0&&(n.didChangeStore&&(n.didChangeStore=!1,n.subscribe=o=>{const i=new Set;for(const u of n.syncHooks)i.add(u.store);const l=[];for(const u of i)l.push(u.subscribe(o));return()=>{for(const u of l)u()}}),Ph.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot))}});function u1(n,o,i,l,u){const c=Mw();if(!c)return a1(n,o,i,l,u);const f=c.syncIndex;c.syncIndex+=1;let p;return c.didInitialize?(p=c.syncHooks[f],(p.store!==n||p.selector!==o||!Object.is(p.a1,i)||!Object.is(p.a2,l)||!Object.is(p.a3,u))&&(p.store!==n&&(c.didChangeStore=!0),p.store=n,p.selector=o,p.a1=i,p.a2=l,p.a3=u,p.didChange=!0)):(p={store:n,selector:o,a1:i,a2:l,a3:u,value:o(n.getSnapshot(),i,l,u),didChange:!1},c.syncHooks.push(p)),p.value}function c1(n,o,i,l,u){return i1.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,c=>o(c,i,l,u))}class d1{constructor(o){rt(this,"subscribe",o=>(this.listeners.add(o),()=>{this.listeners.delete(o)}));rt(this,"getSnapshot",()=>this.state);this.state=o,this.listeners=new Set,this.updateTick=0}setState(o){if(this.state===o)return;this.state=o,this.updateTick+=1;const i=this.updateTick;for(const l of this.listeners){if(i!==this.updateTick)return;l(o)}}update(o){for(const i in o)if(!Object.is(this.state[i],o[i])){this.setState({...this.state,...o});return}}set(o,i){Object.is(this.state[o],i)||this.setState({...this.state,[o]:i})}notifyAll(){const o={...this.state};this.setState(o)}use(o,i,l,u){return Th(this,o,i,l,u)}}class Nh extends d1{constructor(o,i={},l){super(o),this.context=i,this.selectors=l}useSyncedValue(o,i){E.useDebugValue(o),ke(()=>{this.state[o]!==i&&this.set(o,i)},[o,i])}useSyncedValueWithCleanup(o,i){const l=this;ke(()=>(l.state[o]!==i&&l.set(o,i),()=>{l.set(o,void 0)}),[l,o,i])}useSyncedValues(o){const i=this,l=Object.values(o);ke(()=>{i.update(o)},[i,...l])}useControlledProp(o,i){E.useDebugValue(o);const l=i!==void 0;ke(()=>{l&&!Object.is(this.state[o],i)&&super.setState({...this.state,[o]:i})},[o,i,l])}select(o,i,l,u){const c=this.selectors[o];return c(this.state,i,l,u)}useState(o,i,l,u){return E.useDebugValue(o),Th(this,this.selectors[o],i,l,u)}useContextCallback(o,i){E.useDebugValue(o);const l=Ee(i??Bt);this.context[o]=l}useStateSetter(o){const i=E.useRef(void 0);return i.current===void 0&&(i.current=l=>{this.set(o,l)}),i.current}observe(o,i){let l;typeof o=="function"?l=o:l=this.selectors[o];let u=l(this.state);return i(u,u,this),this.subscribe(c=>{const f=l(c);if(!Object.is(u,f)){const p=u;u=f,i(f,p,this)}})}}const f1={open:Ae(n=>n.open),domReferenceElement:Ae(n=>n.domReferenceElement),referenceElement:Ae(n=>n.positionReference??n.referenceElement),floatingElement:Ae(n=>n.floatingElement),floatingId:Ae(n=>n.floatingId)};class yc extends Nh{constructor(i){const{nested:l,noEmit:u,onOpenChange:c,triggerElements:f,...p}=i;super({...p,positionReference:p.referenceElement,domReferenceElement:p.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:Ww(),nested:l,noEmit:u,triggerElements:f},f1);rt(this,"setOpen",(i,l)=>{var u,c;if((!i||!this.state.open||n0(l.event))&&(this.context.dataRef.current.openEvent=i?l.event:void 0),!this.context.noEmit){const f={open:i,reason:l.reason,nativeEvent:l.event,nested:this.context.nested,triggerElement:l.trigger};this.context.events.emit("openchange",f)}(c=(u=this.context).onOpenChange)==null||c.call(u,i,l)})}}function p1(n,o){const i=E.useRef(null),l=E.useRef(null);return E.useCallback(u=>{if(n!==void 0){if(i.current!==null){const c=i.current,f=l.current,p=o.context.triggerElements.getById(c);f&&p===f&&o.context.triggerElements.delete(c),i.current=null,l.current=null}u!==null&&(i.current=n,l.current=u,o.context.triggerElements.add(n,u))}},[o,n])}function m1(n,o,i,l){const u=i.useState("isMountedByTrigger",n),c=p1(n,i),f=Ee(p=>{if(c(p),!p||!i.select("open"))return;const h=i.select("activeTriggerId");if(h===n){i.update({activeTriggerElement:p,...l});return}h==null&&i.update({activeTriggerId:n,activeTriggerElement:p,...l})});return ke(()=>{u&&i.update({activeTriggerElement:o.current,...l})},[u,i,o,...Object.values(l)]),{registerTrigger:f,isMountedByThisTrigger:u}}function h1(n){const o=n.useState("open");ke(()=>{if(o&&!n.select("activeTriggerId")&&n.context.triggerElements.size===1){const i=n.context.triggerElements.entries().next();if(!i.done){const[l,u]=i.value;n.update({activeTriggerId:l,activeTriggerElement:u})}}},[o,n])}function g1(n,o,i){const{mounted:l,setMounted:u,transitionStatus:c}=Jm(n);o.useSyncedValues({mounted:l,transitionStatus:c});const f=Ee(()=>{var h,m;u(!1),o.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),(m=(h=o.context).onOpenChangeComplete)==null||m.call(h,!1)}),p=o.useState("preventUnmountingOnClose");return pc({enabled:!p,open:n,ref:o.context.popupRef,onComplete(){n||f()}}),{forceUnmount:f,transitionStatus:c}}class xc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(o,i){const l=this.idMap.get(o);l!==i&&(l!==void 0&&this.elementsSet.delete(l),this.elementsSet.add(i),this.idMap.set(o,i))}delete(o){const i=this.idMap.get(o);i&&(this.elementsSet.delete(i),this.idMap.delete(o))}hasElement(o){return this.elementsSet.has(o)}hasMatchingElement(o){for(const i of this.elementsSet)if(o(i))return!0;return!1}getById(o){return this.idMap.get(o)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function v1(){return new yc({open:!1,floatingElement:null,referenceElement:null,triggerElements:new xc,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function y1(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:v1(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:gt,inactiveTriggerProps:gt,popupProps:gt}}const tl=Ae(n=>n.triggerIdProp??n.activeTriggerId),x1={open:Ae(n=>n.openProp??n.open),mounted:Ae(n=>n.mounted),transitionStatus:Ae(n=>n.transitionStatus),floatingRootContext:Ae(n=>n.floatingRootContext),preventUnmountingOnClose:Ae(n=>n.preventUnmountingOnClose),payload:Ae(n=>n.payload),activeTriggerId:tl,activeTriggerElement:Ae(n=>n.mounted?n.activeTriggerElement:null),isTriggerActive:Ae((n,o)=>o!==void 0&&tl(n)===o),isOpenedByTrigger:Ae((n,o)=>o!==void 0&&tl(n)===o&&n.open),isMountedByTrigger:Ae((n,o)=>o!==void 0&&tl(n)===o&&n.mounted),triggerProps:Ae((n,o)=>o?n.activeTriggerProps:n.inactiveTriggerProps),popupProps:Ae(n=>n.popupProps),popupElement:Ae(n=>n.popupElement),positionerElement:Ae(n=>n.positionerElement)};function w1(n){const{open:o=!1,onOpenChange:i,elements:l={}}=n,u=bl(),c=gc()!=null,f=Ot(()=>new yc({open:o,onOpenChange:i,referenceElement:l.reference??null,floatingElement:l.floating??null,triggerElements:new xc,floatingId:u,nested:c,noEmit:!1})).current;return ke(()=>{const p={open:o,floatingId:u};l.reference!==void 0&&(p.referenceElement=l.reference,p.domReferenceElement=Oe(l.reference)?l.reference:null),l.floating!==void 0&&(p.floatingElement=l.floating),f.update(p)},[o,u,l.reference,l.floating,f]),f.context.onOpenChange=i,f.context.nested=c,f.context.noEmit=!1,f}function S1(n={}){const{nodeId:o,externalTree:i}=n,l=w1(n),u=n.rootContext||l,c={reference:u.useState("referenceElement"),floating:u.useState("floatingElement"),domReference:u.useState("domReferenceElement")},[f,p]=E.useState(null),h=E.useRef(null),m=Ll(i);ke(()=>{c.domReference&&(h.current=c.domReference)},[c.domReference]);const v=IS({...n,elements:{...c,...f&&{reference:f}}}),g=E.useCallback(W=>{const A=Oe(W)?{getBoundingClientRect:()=>W.getBoundingClientRect(),getClientRects:()=>W.getClientRects(),contextElement:W}:W;p(A),v.refs.setReference(A)},[v.refs]),[S,b]=E.useState(null),[k,C]=E.useState(null);u.useSyncedValue("referenceElement",S),u.useSyncedValue("domReferenceElement",Oe(S)?S:null),u.useSyncedValue("floatingElement",k);const w=E.useCallback(W=>{(Oe(W)||W===null)&&(h.current=W,b(W)),(Oe(v.refs.reference.current)||v.refs.reference.current===null||W!==null&&!Oe(W))&&v.refs.setReference(W)},[v.refs,b]),N=E.useCallback(W=>{C(W),v.refs.setFloating(W)},[v.refs]),D=E.useMemo(()=>({...v.refs,setReference:w,setFloating:N,setPositionReference:g,domReference:h}),[v.refs,w,N,g]),T=E.useMemo(()=>({...v.elements,domReference:c.domReference}),[v.elements,c.domReference]),O=u.useState("open"),j=u.useState("floatingId"),F=E.useMemo(()=>({...v,dataRef:u.context.dataRef,open:O,onOpenChange:u.setOpen,events:u.context.events,floatingId:j,refs:D,elements:T,nodeId:o,rootStore:u}),[v,D,T,o,u,O,j]);return ke(()=>{u.context.dataRef.current.floatingContext=F;const W=m==null?void 0:m.nodesRef.current.find(A=>A.id===o);W&&(W.context=F)}),E.useMemo(()=>({...v,context:F,refs:D,elements:T,rootStore:u}),[v,D,T,F,u])}function k1(n){const{popupStore:o,noEmit:i=!1,treatPopupAsFloatingElement:l=!1,onOpenChange:u}=n,c=bl(),f=gc()!=null,p=o.useState("open"),h=o.useState("activeTriggerElement"),m=o.useState(l?"popupElement":"positionerElement"),v=o.context.triggerElements,g=Ot(()=>new yc({open:p,referenceElement:h,floatingElement:m,triggerElements:v,onOpenChange:u,floatingId:c,nested:f,noEmit:i})).current;return ke(()=>{const S={open:p,floatingId:c,referenceElement:h,floatingElement:m};Oe(h)&&(S.domReferenceElement=h),g.state.positionReference===g.state.referenceElement&&(S.positionReference=h),g.update(S)},[p,c,h,m,g]),g.context.onOpenChange=u,g.context.nested=f,g.context.noEmit=i,g}const $u=Hx&&Bx;function b1(n,o={}){const i="rootStore"in n?n.rootStore:n,{events:l,dataRef:u}=i.context,{enabled:c=!0,delay:f}=o,p=E.useRef(!1),h=E.useRef(null),m=Pi(),v=E.useRef(!0);E.useEffect(()=>{const S=i.select("domReferenceElement");if(!c)return;const b=yt(S);function k(){const N=i.select("domReferenceElement");!i.select("open")&&bt(N)&&N===Qu(Qn(N))&&(p.current=!0)}function C(){v.current=!0}function w(){v.current=!1}return b.addEventListener("blur",k),$u&&(b.addEventListener("keydown",C,!0),b.addEventListener("pointerdown",w,!0)),()=>{b.removeEventListener("blur",k),$u&&(b.removeEventListener("keydown",C,!0),b.removeEventListener("pointerdown",w,!0))}},[i,c]),E.useEffect(()=>{if(!c)return;function S(b){if(b.reason===Ni||b.reason===mc){const k=i.select("domReferenceElement");Oe(k)&&(h.current=k,p.current=!0)}}return l.on("openchange",S),()=>{l.off("openchange",S)}},[l,c,i]);const g=E.useMemo(()=>({onMouseLeave(){p.current=!1,h.current=null},onFocus(S){const b=S.currentTarget;if(p.current){if(h.current===b)return;p.current=!1,h.current=null}const k=Rn(S.nativeEvent);if(Oe(k)){if($u&&!S.relatedTarget){if(!v.current&&!Jx(k))return}else if(!e0(k))return}const C=ml(S.relatedTarget,i.context.triggerElements),{nativeEvent:w,currentTarget:N}=S,D=typeof f=="function"?f():f;if(i.select("open")&&C||D===0||D===void 0){i.setOpen(!0,Qe(al,w,N));return}m.start(D,()=>{p.current||i.setOpen(!0,Qe(al,w,N))})},onBlur(S){p.current=!1,h.current=null;const b=S.relatedTarget,k=S.nativeEvent,C=Oe(b)&&b.hasAttribute(hc("focus-guard"))&&b.getAttribute("data-type")==="outside";m.start(0,()=>{var T;const w=i.select("domReferenceElement"),N=Qu(w?w.ownerDocument:document);!b&&N===w||St((T=u.current.floatingContext)==null?void 0:T.refs.floating.current,N)||St(w,N)||C||ml(b??N,i.context.triggerElements)||i.setOpen(!1,Qe(al,k))})}}),[u,i,m,f]);return E.useMemo(()=>c?{reference:g,trigger:g}:{},[c,g])}const E1=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${Qm}`;function C1(n){return n?!!n.closest(E1):!1}class wc{constructor(){rt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});rt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Yn,this.restTimeout=new Yn,this.handleCloseOptions=void 0}static create(){return new wc}}function Sc(n){var o,i,l;n.performedPointerEventsMutation&&((o=n.pointerEventsScopeElement)==null||o.style.removeProperty("pointer-events"),(i=n.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(l=n.pointerEventsFloatingElement)==null||l.style.removeProperty("pointer-events"),n.performedPointerEventsMutation=!1,n.pointerEventsScopeElement=null,n.pointerEventsReferenceElement=null,n.pointerEventsFloatingElement=null)}function _1(n,o){const{scopeElement:i,referenceElement:l,floatingElement:u}=o;Sc(n),n.performedPointerEventsMutation=!0,n.pointerEventsScopeElement=i,n.pointerEventsReferenceElement=l,n.pointerEventsFloatingElement=u,i.style.pointerEvents="none",l.style.pointerEvents="auto",u.style.pointerEvents="auto"}function jh(n){const o=Ot(wc.create).current,i=n.context.dataRef.current;return i.hoverInteractionState||(i.hoverInteractionState=o),Cl(i.hoverInteractionState.disposeEffect),i.hoverInteractionState}function R1(n,o={}){const i="rootStore"in n?n.rootStore:n,l=i.useState("open"),u=i.useState("floatingElement"),c=i.useState("domReferenceElement"),{dataRef:f}=i.context,{enabled:p=!0,closeDelay:h=0}=o,m=jh(i),v=Ll(),g=gc(),S=Ee(()=>{var T;return hh((T=f.current.openEvent)==null?void 0:T.type,m.interactedInside)}),b=Ee(()=>{var O;const T=(O=f.current.openEvent)==null?void 0:O.type;return(T==null?void 0:T.includes("mouse"))&&T!=="mousedown"}),k=Ee(T=>ml(T,i.context.triggerElements)),C=E.useCallback(T=>{const O=bi(h,"close",m.pointerType),j=()=>{i.setOpen(!1,Qe(Pn,T)),v==null||v.events.emit("floating.closed",T)};O?m.openChangeTimeout.start(O,j):(m.openChangeTimeout.clear(),j())},[h,i,m,v]),w=Ee(()=>{Sc(m)}),N=Ee(T=>{const O=Rn(T);if(!C1(O)){m.interactedInside=!1;return}m.interactedInside=(O==null?void 0:O.closest("[aria-haspopup]"))!=null});ke(()=>{l||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w())},[l,m,w]),E.useEffect(()=>w,[w]),ke(()=>{var T,O,j,F,W;if(p&&l&&(T=m.handleCloseOptions)!=null&&T.blockPointerEvents&&b()&&Oe(c)&&u){const A=c,$=u,ne=Qn(u),te=(j=(O=v==null?void 0:v.nodesRef.current.find(K=>K.id===g))==null?void 0:O.context)==null?void 0:j.elements.floating;te&&(te.style.pointerEvents="");const L=((W=(F=m.handleCloseOptions)==null?void 0:F.getScope)==null?void 0:W.call(F))??m.pointerEventsScopeElement??te??A.closest("[data-rootownerid]")??ne.body;return _1(m,{scopeElement:L,referenceElement:A,floatingElement:$}),()=>{w()}}},[p,l,c,u,m,b,v,g,w]);const D=Pi();E.useEffect(()=>{if(!p)return;function T(){m.openChangeTimeout.clear(),D.clear(),v==null||v.events.off("floating.closed",j),w()}function O(W){if(v&&g&&Wr(v.nodesRef.current,g).length>0){v.events.on("floating.closed",j);return}if(!k(W.relatedTarget)){if(m.handler){m.handler(W);return}w(),S()||C(W)}}function j(W){!v||!g||Wr(v.nodesRef.current,g).length>0||D.start(0,()=>{v.events.off("floating.closed",j),i.setOpen(!1,Qe(Pn,W)),v.events.emit("floating.closed",W)})}const F=u;return F&&(F.addEventListener("mouseenter",T),F.addEventListener("mouseleave",O),F.addEventListener("pointerdown",N,!0)),()=>{F&&(F.removeEventListener("mouseenter",T),F.removeEventListener("mouseleave",O),F.removeEventListener("pointerdown",N,!0)),v==null||v.events.off("floating.closed",j)}},[p,u,i,f,S,k,C,w,N,m,v,g,D])}const P1={current:null};function T1(n,o={}){var te;const i="rootStore"in n?n.rootStore:n,{dataRef:l,events:u}=i.context,{enabled:c=!0,delay:f=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:v=!0,triggerElementRef:g=P1,externalTree:S,isActiveTrigger:b=!0,getHandleCloseContext:k}=o,C=Ll(S),w=jh(i),N=Hr(p),D=Hr(f),T=Hr(m),O=Hr(c);b&&(w.handleCloseOptions=(te=N.current)==null?void 0:te.__options);const j=Ee(()=>{var L;return hh((L=l.current.openEvent)==null?void 0:L.type,w.interactedInside)}),F=Ee(L=>ml(L,i.context.triggerElements)),W=Ee((L,K,G)=>{const z=i.context.triggerElements;if(z.hasElement(K))return!L||!St(L,K);if(!Oe(G))return!1;const X=G;return z.hasMatchingElement(Q=>St(Q,X))&&(!L||!St(L,X))}),A=E.useCallback((L,K=!0)=>{const G=bi(D.current,"close",w.pointerType);G?w.openChangeTimeout.start(G,()=>{i.setOpen(!1,Qe(Pn,L)),C==null||C.events.emit("floating.closed",L)}):K&&(w.openChangeTimeout.clear(),i.setOpen(!1,Qe(Pn,L)),C==null||C.events.emit("floating.closed",L))},[D,i,w,C]),$=Ee(()=>{if(!w.handler)return;Qn(i.select("domReferenceElement")).removeEventListener("mousemove",w.handler),w.handler=void 0});E.useEffect(()=>$,[$]);const ne=Ee(()=>{Sc(w)});return E.useEffect(()=>{if(!c)return;function L(K){K.open||($(),w.openChangeTimeout.clear(),w.restTimeout.clear(),w.blockMouseMove=!0,w.restTimeoutPending=!1)}return u.on("openchange",L),()=>{u.off("openchange",L)}},[c,u,w,$]),E.useEffect(()=>{if(!c)return;const L=g.current??(b?i.select("domReferenceElement"):null);if(!Oe(L))return;function K(z){if(w.openChangeTimeout.clear(),w.blockMouseMove=!1,h&&!hl(w.pointerType)||Op(T.current)>0&&!bi(D.current,"open"))return;const Q=bi(D.current,"open",w.pointerType),I=z.currentTarget??null,q=i.select("domReferenceElement"),B=I==null?!1:W(q,I,z.target),R=i.select("open"),Y=!R||B;B&&R?i.setOpen(!0,Qe(Pn,z,I)):Q?w.openChangeTimeout.start(Q,()=>{Y&&i.setOpen(!0,Qe(Pn,z,I))}):Y&&i.setOpen(!0,Qe(Pn,z,I))}function G(z){if(j()){ne();return}$();const X=i.select("domReferenceElement"),Q=Qn(X);w.restTimeout.clear(),w.restTimeoutPending=!1;const I=l.current.floatingContext??(k==null?void 0:k());if(F(z.relatedTarget))return;if(N.current&&I){i.select("open")||w.openChangeTimeout.clear();const R=g.current;w.handler=N.current({...I,tree:C,x:z.clientX,y:z.clientY,onClose(){ne(),$(),O.current&&!j()&&R===i.select("domReferenceElement")&&A(z,!0)}}),Q.addEventListener("mousemove",w.handler),w.handler(z);return}(w.pointerType==="touch"?!St(i.select("floatingElement"),z.relatedTarget):!0)&&A(z)}return v&&L.addEventListener("mousemove",K,{once:!0}),L.addEventListener("mouseenter",K),L.addEventListener("mouseleave",G),()=>{v&&L.removeEventListener("mousemove",K),L.removeEventListener("mouseenter",K),L.removeEventListener("mouseleave",G)}},[$,ne,l,D,A,i,c,N,w,b,W,j,F,h,v,T,g,C,O,k]),E.useMemo(()=>{if(!c)return;function L(K){w.pointerType=K.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove(K){const{nativeEvent:G}=K,z=K.currentTarget,X=i.select("domReferenceElement"),Q=i.select("open"),I=W(X,z,K.target);if(h&&!hl(w.pointerType))return;const q=Op(T.current);if(Q&&!I||q===0||!I&&w.restTimeoutPending&&K.movementX**2+K.movementY**2<2)return;w.restTimeout.clear();function B(){if(w.restTimeoutPending=!1,j())return;const R=i.select("open");!w.blockMouseMove&&(!R||I)&&i.setOpen(!0,Qe(Pn,G,z))}w.pointerType==="touch"?Zr.flushSync(()=>{B()}):I&&Q?B():(w.restTimeoutPending=!0,w.restTimeout.start(q,B))}}},[c,w,j,W,h,i,T])}function N1(n=[]){const o=n.map(m=>m==null?void 0:m.reference),i=n.map(m=>m==null?void 0:m.floating),l=n.map(m=>m==null?void 0:m.item),u=n.map(m=>m==null?void 0:m.trigger),c=E.useCallback(m=>nl(m,n,"reference"),o),f=E.useCallback(m=>nl(m,n,"floating"),i),p=E.useCallback(m=>nl(m,n,"item"),l),h=E.useCallback(m=>nl(m,n,"trigger"),u);return E.useMemo(()=>({getReferenceProps:c,getFloatingProps:f,getItemProps:p,getTriggerProps:h}),[c,f,p,h])}function nl(n,o,i){var f;const l=new Map,u=i==="item",c={};i==="floating"&&(c.tabIndex=-1,c[Qx]="");for(const p in n)u&&n&&(p===Ym||p===Gm)||(c[p]=n[p]);for(let p=0;p{var h;return(h=l.get(c))==null?void 0:h.map(m=>m(...p)).find(m=>m!==void 0)})):n[c]=f)}}const Xp=.1,j1=Xp*Xp,ze=.5;function rl(n,o,i,l,u,c){return l>=o!=c>=o&&n<=(u-i)*(o-l)/(c-l)+i}function ol(n,o,i,l,u,c,f,p,h,m){let v=!1;return rl(n,o,i,l,u,c)&&(v=!v),rl(n,o,u,c,f,p)&&(v=!v),rl(n,o,f,p,h,m)&&(v=!v),rl(n,o,h,m,i,l)&&(v=!v),v}function M1(n,o,i){return n>=i.x&&n<=i.x+i.width&&o>=i.y&&o<=i.y+i.height}function il(n,o,i,l,u,c){const f=Math.min(i,u),p=Math.max(i,u),h=Math.min(l,c),m=Math.max(l,c);return n>=f&&n<=p&&o>=h&&o<=m}function O1(n={}){const{blockPointerEvents:o=!1}=n,i=new Yn,l=({x:u,y:c,placement:f,elements:p,onClose:h,nodeId:m,tree:v})=>{const g=f==null?void 0:f.split("-")[0];let S=!1,b=null,k=null,C=typeof performance<"u"?performance.now():0;function w(D,T){const O=performance.now(),j=O-C;if(b===null||k===null||j===0)return b=D,k=T,C=O,!1;const F=D-b,W=T-k,A=F*F+W*W,$=j*j*j1;return b=D,k=T,C=O,A<$}function N(){i.clear(),h()}return function(T){i.clear();const O=p.domReference,j=p.floating;if(!O||!j||g==null||u==null||c==null)return;const{clientX:F,clientY:W}=T,A=Rn(T),$=T.type==="mouseleave",ne=St(j,A),te=St(O,A);if(ne&&(S=!0,!$))return;if(te&&(S=!1,!$)){S=!0;return}if($&&Oe(T.relatedTarget)&&St(j,T.relatedTarget))return;function L(){return!!(v&&Wr(v.nodesRef.current,m).length>0)}function K(){L()||N()}if(L())return;const G=O.getBoundingClientRect(),z=j.getBoundingClientRect(),X=u>z.right-z.width/2,Q=c>z.bottom-z.height/2,I=z.width>G.width,q=z.height>G.height,B=(I?G:z).left,R=(I?G:z).right,Y=(q?G:z).top,ue=(q?G:z).bottom;if(g==="top"&&c>=G.bottom-1||g==="bottom"&&c<=G.top+1||g==="left"&&u>=G.right-1||g==="right"&&u<=G.left+1){K();return}let ce=!1;switch(g){case"top":ce=il(F,W,B,G.top+1,R,z.bottom-1);break;case"bottom":ce=il(F,W,B,z.top+1,R,G.bottom-1);break;case"left":ce=il(F,W,z.right-1,ue,G.left+1,Y);break;case"right":ce=il(F,W,G.right-1,ue,z.left+1,Y);break}if(ce)return;if(S&&!M1(F,W,G)){K();return}if(!$&&w(F,W)){K();return}let le=!1;switch(g){case"top":{const oe=I?ze/2:ze*4,he=I||X?u+oe:u-oe,xe=I?u-oe:X?u+oe:u-oe,fe=c+ze+1,Te=X||I?z.bottom-ze:z.top,Ke=X?I?z.bottom-ze:z.top:z.bottom-ze;le=ol(F,W,he,fe,xe,fe,z.left,Te,z.right,Ke);break}case"bottom":{const oe=I?ze/2:ze*4,he=I||X?u+oe:u-oe,xe=I?u-oe:X?u+oe:u-oe,fe=c-ze,Te=X||I?z.top+ze:z.bottom,Ke=X?I?z.top+ze:z.bottom:z.top+ze;le=ol(F,W,he,fe,xe,fe,z.left,Te,z.right,Ke);break}case"left":{const oe=q?ze/2:ze*4,he=q||Q?c+oe:c-oe,xe=q?c-oe:Q?c+oe:c-oe,fe=u+ze+1,Te=Q||q?z.right-ze:z.left,Ke=Q?q?z.right-ze:z.left:z.right-ze;le=ol(F,W,Te,z.top,Ke,z.bottom,fe,he,fe,xe);break}case"right":{const oe=q?ze/2:ze*4,he=q||Q?c+oe:c-oe,xe=q?c-oe:Q?c+oe:c-oe,fe=u-ze,Te=Q||q?z.left+ze:z.right,Ke=Q?q?z.left+ze:z.right:z.left+ze;le=ol(F,W,fe,he,fe,xe,Te,z.top,Ke,z.bottom);break}}le?S||i.start(40,K):K()}};return l.__options={blockPointerEvents:o},l}const I1={...x1,disabled:Ae(n=>n.disabled),instantType:Ae(n=>n.instantType),isInstantPhase:Ae(n=>n.isInstantPhase),trackCursorAxis:Ae(n=>n.trackCursorAxis),disableHoverablePopup:Ae(n=>n.disableHoverablePopup),lastOpenChangeReason:Ae(n=>n.openChangeReason),closeOnClick:Ae(n=>n.closeOnClick),closeDelay:Ae(n=>n.closeDelay),hasViewport:Ae(n=>n.hasViewport)};class kc extends Nh{constructor(i){super({...L1(),...i},{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new xc},I1);rt(this,"setOpen",(i,l)=>{var m,v;const u=l.reason,c=u===Pn,f=i&&u===al,p=!i&&(u===Ni||u===mc);if(l.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(v=(m=this.context).onOpenChange)==null||v.call(m,i,l),l.isCanceled)return;const h=()=>{var b;const g={open:i,openChangeReason:u};f?g.instantType="focus":p?g.instantType="dismiss":u===Pn&&(g.instantType=void 0);const S=((b=l.trigger)==null?void 0:b.id)??null;(S||i)&&(g.activeTriggerId=S,g.activeTriggerElement=l.trigger??null),this.update(g)};c?Zr.flushSync(h):h()})}static useStore(i,l){const u=Ot(()=>new kc(l)).current,c=i??u,f=k1({popupStore:c,onOpenChange:c.setOpen});return c.state.floatingRootContext=f,c}}function L1(){return{...y1(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}const A1=ph(function(o){const{disabled:i=!1,defaultOpen:l=!1,open:u,disableHoverablePopup:c=!1,trackCursorAxis:f="none",actionsRef:p,onOpenChange:h,onOpenChangeComplete:m,handle:v,triggerId:g,defaultTriggerId:S=null,children:b}=o,k=kc.useStore(v==null?void 0:v.store,{open:l,openProp:u,activeTriggerId:S,triggerIdProp:g});Aw(()=>{u===void 0&&k.state.open===!1&&l===!0&&k.update({open:!0,activeTriggerId:S})}),k.useControlledProp("openProp",u),k.useControlledProp("triggerIdProp",g),k.useContextCallback("onOpenChange",h),k.useContextCallback("onOpenChangeComplete",m);const C=k.useState("open"),w=!i&&C,N=k.useState("activeTriggerId"),D=k.useState("payload");k.useSyncedValues({trackCursorAxis:f,disableHoverablePopup:c}),ke(()=>{C&&i&&k.setOpen(!1,Qe(R0))},[C,i,k]),k.useSyncedValue("disabled",i),h1(k);const{forceUnmount:T,transitionStatus:O}=g1(w,k),j=k.useState("isInstantPhase"),F=k.useState("instantType"),W=k.useState("lastOpenChangeReason"),A=E.useRef(null);ke(()=>{O==="ending"&&W===Di||O!=="ending"&&j?(F!=="delay"&&(A.current=F),k.set("instantType","delay")):A.current!==null&&(k.set("instantType",A.current),A.current=null)},[O,j,W,F,k]),ke(()=>{w&&N==null&&k.set("payload",void 0)},[k,N,w]);const $=E.useCallback(()=>{k.setOpen(!1,z1(k,P0))},[k]);E.useImperativeHandle(p,()=>({unmount:T,close:$}),[T,$]);const ne=k.useState("floatingRootContext"),te=Jw(ne,{enabled:!i,referencePress:()=>k.select("closeOnClick")}),L=Qw(ne,{enabled:!i&&f!=="none",axis:f==="none"?void 0:f}),{getReferenceProps:K,getFloatingProps:G,getTriggerProps:z}=N1([te,L]),X=E.useMemo(()=>K(),[K]),Q=E.useMemo(()=>z(),[z]),I=E.useMemo(()=>G(),[G]);return k.useSyncedValues({activeTriggerProps:X,inactiveTriggerProps:Q,popupProps:I}),y.jsx(mh.Provider,{value:k,children:typeof b=="function"?b({payload:D}):b})});function z1(n,o){const i=Qe(o);return i.preventUnmountOnClose=()=>{n.set("preventUnmountingOnClose",!0)},i}let bc=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=Yr.startingStyle]="startingStyle",n[n.endingStyle=Yr.endingStyle]="endingStyle",n.anchorHidden="data-anchor-hidden",n.side="data-side",n.align="data-align",n})({}),Mh=(function(n){return n.popupOpen="data-popup-open",n.pressed="data-pressed",n})({});const D1={[Mh.popupOpen]:""},F1={[bc.open]:""},V1={[bc.closed]:""},$1={[bc.anchorHidden]:""},U1={open(n){return n?D1:null}},Ec={open(n){return n?F1:V1},anchorHidden(n){return n?$1:null}},Oh=E.createContext(void 0);function B1(){return E.useContext(Oh)}let H1=(function(n){return n[n.popupOpen=Mh.popupOpen]="popupOpen",n.triggerDisabled="data-trigger-disabled",n})({});const W1=600,K1=Iw(function(o,i){const{className:l,render:u,handle:c,payload:f,disabled:p,delay:h,closeOnClick:m=!0,closeDelay:v,id:g,...S}=o,b=Fi(!0),k=(c==null?void 0:c.store)??b;if(!k)throw new Error(Nn(82));const C=El(g),w=k.useState("isTriggerActive",C),N=k.useState("isOpenedByTrigger",C),D=k.useState("floatingRootContext"),T=E.useRef(null),O=h??W1,j=v??0,{registerTrigger:F,isMountedByThisTrigger:W}=m1(C,T,k,{payload:f,closeOnClick:m,closeDelay:j}),A=B1(),{delayRef:$,isInstantPhase:ne,hasProvider:te}=Fw(D,{open:N});k.useSyncedValue("isInstantPhase",ne);const L=k.useState("disabled"),K=p??L,G=k.useState("trackCursorAxis"),z=k.useState("disableHoverablePopup"),X=T1(D,{enabled:!K,mouseOnly:!0,move:!1,handleClose:!z&&G!=="both"?O1():null,restMs(){const R=A==null?void 0:A.delay,Y=typeof $.current=="object"?$.current.open:void 0;let ue=O;return te&&(Y!==0?ue=h??R??O:ue=0),ue},delay(){const R=typeof $.current=="object"?$.current.close:void 0;let Y=j;return v==null&&te&&(Y=R),{close:Y}},triggerElementRef:T,isActiveTrigger:w}),Q=b1(D,{enabled:!K}).reference,I={open:N},q=k.useState("triggerProps",W);return kt("button",o,{state:I,ref:[i,F,T],props:[X,Q,q,{onPointerDown(){k.set("closeOnClick",m)},id:C,[H1.triggerDisabled]:K?"":void 0},S],stateAttributesMapping:U1})}),Ih=E.createContext(void 0);function Y1(){const n=E.useContext(Ih);if(n===void 0)throw new Error(Nn(70));return n}const G1=E.forwardRef(function(o,i){const{children:l,container:u,className:c,render:f,...p}=o,{portalNode:h,portalSubtree:m}=Hw({container:u,ref:i,componentProps:o,elementProps:p});return!m&&!h?null:y.jsxs(E.Fragment,{children:[m,h&&Zr.createPortal(l,h)]})}),Q1=E.forwardRef(function(o,i){const{keepMounted:l=!1,...u}=o;return Fi().useState("mounted")||l?y.jsx(Ih.Provider,{value:l,children:y.jsx(G1,{ref:i,...u})}):null}),Lh=E.createContext(void 0);function Ah(){const n=E.useContext(Lh);if(n===void 0)throw new Error(Nn(71));return n}const X1=E.createContext(void 0);function zh(){const n=E.useContext(X1);return(n==null?void 0:n.direction)??"ltr"}const q1=n=>({name:"arrow",options:n,async fn(o){var q,B;const{x:i,y:l,placement:u,rects:c,platform:f,elements:p,middlewareData:h}=o,{element:m,padding:v=0,offsetParent:g="real"}=Xn(n,o)||{};if(m==null)return{};const S=Xm(v),b={x:i,y:l},k=dc(u),C=cc(k),w=await f.getDimensions(m),N=k==="y",D=N?"top":"left",T=N?"bottom":"right",O=N?"clientHeight":"clientWidth",j=c.reference[C]+c.reference[k]-b[k]-c.floating[C],F=b[k]-c.reference[k],W=g==="real"?await((q=f.getOffsetParent)==null?void 0:q.call(f,m)):p.floating;let A=p.floating[O]||c.floating[C];(!A||!await((B=f.isElement)==null?void 0:B.call(f,W)))&&(A=p.floating[O]||c.floating[C]);const $=j/2-F/2,ne=A/2-w[C]/2-1,te=Math.min(S[D],ne),L=Math.min(S[T],ne),K=te,G=A-w[C]-L,z=A/2-w[C]/2+$,X=Xu(K,z,G),Q=!h.arrow&&br(u)!=null&&z!==X&&c.reference[C]/2-(z({...q1(n),options:[n,o]}),J1={name:"hide",async fn(n){var p;const{width:o,height:i,x:l,y:u}=n.rects.reference,c=o===0&&i===0&&l===0&&u===0;return{data:{referenceHidden:((p=(await VS().fn(n)).data)==null?void 0:p.referenceHidden)||c}}}},cl={sideX:"left",sideY:"top"},ek={name:"adaptiveOrigin",async fn(n){var D,T;const{x:o,y:i,rects:{floating:l},elements:{floating:u},platform:c,strategy:f,placement:p}=n,h=yt(u),m=h.getComputedStyle(u);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:o,y:i,data:cl};const g=await((D=c.getOffsetParent)==null?void 0:D.call(c,u));let S={width:0,height:0};if(f==="fixed"&&(h!=null&&h.visualViewport))S={width:h.visualViewport.width,height:h.visualViewport.height};else if(g===h){const O=Qn(u);S={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await((T=c.isElement)==null?void 0:T.call(c,g))&&(S=await c.getDimensions(g));const b=Mt(p);let k=o,C=i;b==="left"&&(k=S.width-(o+l.width)),b==="top"&&(C=S.height-(i+l.height));const w=b==="left"?"right":cl.sideX,N=b==="top"?"bottom":cl.sideY;return{x:k,y:C,data:{sideX:w,sideY:N}}}};function Dh(n,o,i){const l=n==="inline-start"||n==="inline-end";return{top:"top",right:l?i?"inline-start":"inline-end":"right",bottom:"bottom",left:l?i?"inline-end":"inline-start":"left"}[o]}function qp(n,o,i){const{rects:l,placement:u}=n;return{side:Dh(o,Mt(u),i),align:br(u)||"center",anchor:{width:l.reference.width,height:l.reference.height},positioner:{width:l.floating.width,height:l.floating.height}}}function tk(n){var Jn,er;const{anchor:o,positionMethod:i="absolute",side:l="bottom",sideOffset:u=0,align:c="center",alignOffset:f=0,collisionBoundary:p,collisionPadding:h=5,sticky:m=!1,arrowPadding:v=5,disableAnchorTracking:g=!1,keepMounted:S=!1,floatingRootContext:b,mounted:k,collisionAvoidance:C,shiftCrossAxis:w=!1,nodeId:N,adaptiveOrigin:D,lazyFlip:T=!1,externalTree:O}=n,[j,F]=E.useState(null);!k&&j!==null&&F(null);const W=C.side||"flip",A=C.align||"flip",$=C.fallbackAxisSide||"end",ne=typeof o=="function"?o:void 0,te=Ee(ne),L=ne?te:o,K=Hr(o),z=zh()==="rtl",X=j||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":z?"left":"right","inline-start":z?"right":"left"}[l],Q=c==="center"?X:`${X}-${c}`;let I=h;const q=1,B=l==="bottom"?q:0,R=l==="top"?q:0,Y=l==="right"?q:0,ue=l==="left"?q:0;typeof I=="number"?I={top:I+B,right:I+ue,bottom:I+R,left:I+Y}:I&&(I={top:(I.top||0)+B,right:(I.right||0)+ue,bottom:(I.bottom||0)+R,left:(I.left||0)+Y});const ce={boundary:p==="clipping-ancestors"?"clippingAncestors":p,padding:I},le=E.useRef(null),oe=Hr(u),he=Hr(f),Te=[LS(je=>{const Ye=qp(je,l,z),ut=typeof oe.current=="function"?oe.current(Ye):oe.current,et=typeof he.current=="function"?he.current(Ye):he.current;return{mainAxis:ut,crossAxis:et,alignmentAxis:et}},[typeof u!="function"?u:0,typeof f!="function"?f:0,z,l])],Ke=A==="none"&&W!=="shift",Wt=!Ke&&(m||w||W==="shift"),Et=W==="none"?null:DS({...ce,padding:{top:I.top+q,right:I.right+q,bottom:I.bottom+q,left:I.left+q},mainAxis:!w&&W==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:$}),it=Ke?null:AS(je=>{const Ye=Qn(je.elements.floating).documentElement;return{...ce,rootBoundary:w?{x:0,y:0,width:Ye.clientWidth,height:Ye.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:Wt,limiter:m||w?void 0:zS(ut=>{if(!le.current)return{};const{width:et,height:Gt}=le.current.getBoundingClientRect(),Ct=nn(Mt(ut.placement)),xn=Ct==="y"?et:Gt,On=Ct==="y"?I.left+I.right:I.top+I.bottom;return{offset:xn/2+On/2}})}},[ce,m,w,I,A]);W==="shift"||A==="shift"||c==="center"?Te.push(it,Et):Te.push(Et,it),Te.push(FS({...ce,apply({elements:{floating:je},availableWidth:Ye,availableHeight:ut,rects:et}){const Gt=je.style;Gt.setProperty("--available-width",`${Ye}px`),Gt.setProperty("--available-height",`${ut}px`);const Ct=window.devicePixelRatio||1,{x:xn,y:On,width:an,height:Rr}=et.reference,eo=(Math.round((xn+an)*Ct)-Math.round(xn*Ct))/Ct,In=(Math.round((On+Rr)*Ct)-Math.round(On*Ct))/Ct;Gt.setProperty("--anchor-width",`${eo}px`),Gt.setProperty("--anchor-height",`${In}px`)}}),Z1(()=>({element:le.current||document.createElement("div"),padding:v,offsetParent:"floating"}),[v]),{name:"transformOrigin",fn(je){var $i,Sn,Ao;const{elements:Ye,middlewareData:ut,placement:et,rects:Gt,y:Ct}=je,xn=Mt(et),On=nn(xn),an=le.current,Rr=(($i=ut.arrow)==null?void 0:$i.x)||0,eo=((Sn=ut.arrow)==null?void 0:Sn.y)||0,In=(an==null?void 0:an.clientWidth)||0,Io=(an==null?void 0:an.clientHeight)||0,Ln=Rr+In/2,Vi=eo+Io/2,Pr=Math.abs(((Ao=ut.shift)==null?void 0:Ao.y)||0),to=Gt.reference.height/2,wn=typeof u=="function"?u(qp(je,l,z)):u,Lo=Pr>wn,Fl={top:`${Ln}px calc(100% + ${wn}px)`,bottom:`${Ln}px ${-wn}px`,left:`calc(100% + ${wn}px) ${Vi}px`,right:`${-wn}px ${Vi}px`}[xn],Vl=`${Ln}px ${Gt.reference.y+to-Ct}px`;return Ye.floating.style.setProperty("--transform-origin",Wt&&On==="y"&&Lo?Vl:Fl),{}}},J1,D),ke(()=>{!k&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[k,b]);const Lt=E.useMemo(()=>({elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:rn,elements:Kt,x:Cr,y:Mn,middlewareData:Re,update:ie,placement:se,context:Ie,isPositioned:Fe,floatingStyles:At}=S1({rootContext:b,placement:Q,middleware:Te,strategy:i,whileElementsMounted:S?void 0:(...je)=>$p(...je,Lt),nodeId:N,externalTree:O}),{sideX:on,sideY:Yt}=Re.adaptiveOrigin||cl,yn=Fe?i:"fixed",qn=E.useMemo(()=>{const je=D?{position:yn,[on]:Cr,[Yt]:Mn}:{position:yn,...At};return Fe||(je.opacity=0),je},[D,yn,on,Cr,Yt,Mn,At,Fe]),zt=E.useRef(null);ke(()=>{if(!k)return;const je=K.current,Ye=typeof je=="function"?je():je,et=(Zp(Ye)?Ye.current:Ye)||null||null;et!==zt.current&&(rn.setPositionReference(et),zt.current=et)},[k,rn,L,K]),E.useEffect(()=>{if(!k)return;const je=K.current;typeof je!="function"&&Zp(je)&&je.current!==zt.current&&(rn.setPositionReference(je.current),zt.current=je.current)},[k,rn,L,K]),E.useEffect(()=>{if(S&&k&&Kt.domReference&&Kt.floating)return $p(Kt.domReference,Kt.floating,ie,Lt)},[S,k,Kt,ie,Lt]);const Ve=Mt(se),sn=Dh(l,Ve,z),ln=br(se)||"center",_r=!!((Jn=Re.hide)!=null&&Jn.referenceHidden);ke(()=>{T&&k&&Fe&&F(Ve)},[T,k,Fe,Ve]);const Jr=E.useMemo(()=>{var je,Ye;return{position:"absolute",top:(je=Re.arrow)==null?void 0:je.y,left:(Ye=Re.arrow)==null?void 0:Ye.x}},[Re.arrow]),Zn=((er=Re.arrow)==null?void 0:er.centerOffset)!==0;return E.useMemo(()=>({positionerStyles:qn,arrowStyles:Jr,arrowRef:le,arrowUncentered:Zn,side:sn,align:ln,physicalSide:Ve,anchorHidden:_r,refs:rn,context:Ie,isPositioned:Fe,update:ie}),[qn,Jr,le,Zn,sn,ln,Ve,_r,rn,Ie,Fe,ie])}function Zp(n){return n!=null&&"current"in n}function Fh(n){return n==="starting"?_y:gt}const nk=E.forwardRef(function(o,i){const{render:l,className:u,anchor:c,positionMethod:f="absolute",side:p="top",align:h="center",sideOffset:m=0,alignOffset:v=0,collisionBoundary:g="clipping-ancestors",collisionPadding:S=5,arrowPadding:b=5,sticky:k=!1,disableAnchorTracking:C=!1,collisionAvoidance:w=Ry,...N}=o,D=Fi(),T=Y1(),O=D.useState("open"),j=D.useState("mounted"),F=D.useState("trackCursorAxis"),W=D.useState("disableHoverablePopup"),A=D.useState("floatingRootContext"),$=D.useState("instantType"),ne=D.useState("transitionStatus"),te=D.useState("hasViewport"),L=tk({anchor:c,positionMethod:f,floatingRootContext:A,mounted:j,side:p,sideOffset:m,align:h,alignOffset:v,collisionBoundary:g,collisionPadding:S,sticky:k,arrowPadding:b,disableAnchorTracking:C,keepMounted:T,collisionAvoidance:w,adaptiveOrigin:te?ek:void 0}),K=E.useMemo(()=>{const Q={};return(!O||F==="both"||W)&&(Q.pointerEvents="none"),{role:"presentation",hidden:!j,style:{...L.positionerStyles,...Q}}},[O,F,W,j,L.positionerStyles]),G=E.useMemo(()=>({open:O,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:F!=="none"?"tracking-cursor":$}),[O,L.side,L.align,L.anchorHidden,F,$]),z=E.useMemo(()=>({...G,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[G,L.arrowRef,L.arrowStyles,L.arrowUncentered]),X=kt("div",o,{state:G,props:[K,Fh(ne),N],ref:[i,D.useStateSetter("positionerElement")],stateAttributesMapping:Ec});return y.jsx(Lh.Provider,{value:z,children:X})}),rk={...Ec,...fc},ok=E.forwardRef(function(o,i){const{className:l,render:u,...c}=o,f=Fi(),{side:p,align:h}=Ah(),m=f.useState("open"),v=f.useState("instantType"),g=f.useState("transitionStatus"),S=f.useState("popupProps"),b=f.useState("floatingRootContext");pc({open:m,ref:f.context.popupRef,onComplete(){var D,T;m&&((T=(D=f.context).onOpenChangeComplete)==null||T.call(D,!0))}});const k=f.useState("disabled"),C=f.useState("closeDelay");return R1(b,{enabled:!k,closeDelay:C}),kt("div",o,{state:{open:m,side:p,align:h,instant:v,transitionStatus:g},ref:[i,f.context.popupRef,f.useStateSetter("popupElement")],props:[S,Fh(g),c],stateAttributesMapping:rk})}),ik=E.forwardRef(function(o,i){const{className:l,render:u,...c}=o,p=Fi().useState("instantType"),{open:h,arrowRef:m,side:v,align:g,arrowUncentered:S,arrowStyles:b}=Ah();return kt("div",o,{state:{open:h,side:v,align:g,uncentered:S,instant:p},ref:[i,m],props:[{style:b,"aria-hidden":!0},c],stateAttributesMapping:Ec})}),sk=function(o){const{delay:i,closeDelay:l,timeout:u=400}=o,c=E.useMemo(()=>({delay:i,closeDelay:l}),[i,l]),f=E.useMemo(()=>({open:i,close:l}),[i,l]);return y.jsx(Oh.Provider,{value:c,children:y.jsx(Dw,{delay:f,timeoutMs:u,children:o.children})})};function lk({delay:n=0,...o}){return y.jsx(sk,{"data-slot":"tooltip-provider",delay:n,...o})}function ji({...n}){return y.jsx(A1,{"data-slot":"tooltip",...n})}function Mi({...n}){return y.jsx(K1,{"data-slot":"tooltip-trigger",...n})}function Oi({className:n,side:o="top",sideOffset:i=4,align:l="center",alignOffset:u=0,children:c,...f}){return y.jsx(Q1,{children:y.jsx(nk,{align:l,alignOffset:u,side:o,sideOffset:i,className:"isolate z-50",children:y.jsxs(ok,{"data-slot":"tooltip-content",className:Pe("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),...f,children:[c,y.jsx(ik,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const Vh=E.createContext(void 0);function ak(n=!0){const o=E.useContext(Vh);if(o===void 0&&!n)throw new Error(Nn(7));return o}const $h=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function uk(){return E.useContext($h)}let ck=(function(n){return n[n.None=0]="None",n[n.GuessFromOrder=1]="GuessFromOrder",n})({});function dk(n={}){const{label:o,metadata:i,textRef:l,indexGuessBehavior:u,index:c}=n,{register:f,unregister:p,subscribeMapChange:h,elementsRef:m,labelsRef:v,nextIndexRef:g}=uk(),S=E.useRef(-1),[b,k]=E.useState(c??(u===ck.GuessFromOrder?()=>{if(S.current===-1){const N=g.current;g.current+=1,S.current=N}return S.current}:-1)),C=E.useRef(null),w=E.useCallback(N=>{var D;if(C.current=N,b!==-1&&N!==null&&(m.current[b]=N,v)){const T=o!==void 0;v.current[b]=T?o:((D=l==null?void 0:l.current)==null?void 0:D.textContent)??N.textContent}},[b,m,v,o,l]);return ke(()=>{if(c!=null)return;const N=C.current;if(N)return f(N,i),()=>{p(N)}},[c,f,p,i]),ke(()=>{if(c==null)return h(N=>{var T;const D=C.current?(T=N.get(C.current))==null?void 0:T.index:null;D!=null&&k(D)})},[c,h,k]),E.useMemo(()=>({ref:w,index:b}),[b,w])}function fk(n={}){const{highlightItemOnHover:o,highlightedIndex:i,onHighlightedIndexChange:l}=ah(),{ref:u,index:c}=dk(n),f=i===c,p=E.useRef(null),h=Ri(u,p);return{compositeProps:E.useMemo(()=>({tabIndex:f?0:-1,onFocus(){l(c)},onMouseMove(){const v=p.current;if(!o||!v)return;const g=v.hasAttribute("disabled")||v.ariaDisabled==="true";!f&&!g&&v.focus()}}),[f,l,c,o]),compositeRef:h,index:c}}function pk(n){const{render:o,className:i,state:l=gt,props:u=dl,refs:c=dl,metadata:f,stateAttributesMapping:p,tag:h="div",...m}=n,{compositeProps:v,compositeRef:g}=fk({metadata:f});return kt(h,n,{state:l,ref:[...c,g],props:[v,...u,m],stateAttributesMapping:p})}const mk=E.forwardRef(function(o,i){const{className:l,defaultPressed:u=!1,disabled:c=!1,form:f,onPressedChange:p,pressed:h,render:m,type:v,value:g,nativeButton:S=!0,...b}=o,k=El(g||void 0),C=ak(),w=(C==null?void 0:C.value)??[],N=C?void 0:u,D=(c||(C==null?void 0:C.disabled))??!1,[T,O]=Nl({controlled:C?k!==void 0&&w.indexOf(k)>-1:h,default:N,name:"Toggle",state:"pressed"}),j=Ee((L,K)=>{var G;k&&((G=C==null?void 0:C.setGroupValue)==null||G.call(C,k,L,K)),p==null||p(L,K)}),{getButtonProps:F,buttonRef:W}=uh({disabled:D,native:S}),A={disabled:D,pressed:T},$=[W,i],ne=[{"aria-pressed":T,onClick(L){const K=!T,G=Qe(Di,L.nativeEvent);j(K,G),!G.isCanceled&&O(K)}},b,F],te=kt("button",o,{enabled:!C,state:A,ref:$,props:ne});return C?y.jsx(pk,{tag:"button",render:m,className:l,state:A,refs:$,props:ne}):te});function hk(n){const{children:o,elementsRef:i,labelsRef:l,onMapChange:u}=n,c=Ee(u),f=E.useRef(0),p=Ot(vk).current,h=Ot(gk).current,[m,v]=E.useState(0),g=E.useRef(m),S=Ee((N,D)=>{h.set(N,D??null),g.current+=1,v(g.current)}),b=Ee(N=>{h.delete(N),g.current+=1,v(g.current)}),k=E.useMemo(()=>{const N=new Map;return Array.from(h.keys()).filter(T=>T.isConnected).sort(yk).forEach((T,O)=>{const j=h.get(T)??{};N.set(T,{...j,index:O})}),N},[h,m]);ke(()=>{if(typeof MutationObserver!="function"||k.size===0)return;const N=new MutationObserver(D=>{const T=new Set,O=j=>T.has(j)?T.delete(j):T.add(j);D.forEach(j=>{j.removedNodes.forEach(O),j.addedNodes.forEach(O)}),T.size===0&&(g.current+=1,v(g.current))});return k.forEach((D,T)=>{T.parentElement&&N.observe(T.parentElement,{childList:!0})}),()=>{N.disconnect()}},[k]),ke(()=>{g.current===m&&(i.current.length!==k.size&&(i.current.length=k.size),l&&l.current.length!==k.size&&(l.current.length=k.size),f.current=k.size),c(k)},[c,k,i,l,m]),ke(()=>()=>{i.current=[]},[i]),ke(()=>()=>{l&&(l.current=[])},[l]);const C=Ee(N=>(p.add(N),()=>{p.delete(N)}));ke(()=>{p.forEach(N=>N(k))},[p,k]);const w=E.useMemo(()=>({register:S,unregister:b,subscribeMapChange:C,elementsRef:i,labelsRef:l,nextIndexRef:f}),[S,b,C,i,l,f]);return y.jsx($h.Provider,{value:w,children:o})}function gk(){return new Map}function vk(){return new Set}function yk(n,o){const i=n.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING||i&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:i&Node.DOCUMENT_POSITION_PRECEDING||i&Node.DOCUMENT_POSITION_CONTAINS?1:0}function xk(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}const Ei="ArrowUp",_o="ArrowDown",Sl="ArrowLeft",Ci="ArrowRight",zl="Home",Dl="End",Uh=new Set([Sl,Ci]),wk=new Set([Sl,Ci,zl,Dl]),Bh=new Set([Ei,_o]),Sk=new Set([Ei,_o,zl,Dl]),Hh=new Set([...Uh,...Bh]),kk=new Set([...Hh,zl,Dl]),bk="Shift",Ek="Control",Ck="Alt",_k="Meta",Rk=new Set([bk,Ek,Ck,_k]);function Pk(n){return bt(n)&&n.tagName==="INPUT"}function Jp(n){return!!(Pk(n)&&n.selectionStart!=null||bt(n)&&n.tagName==="TEXTAREA")}function em(n,o,i,l){if(!n||!o||!o.scrollTo)return;let u=n.scrollLeft,c=n.scrollTop;const f=n.clientWidthn.scrollLeft+n.clientWidth-m.scrollPaddingRight?u=h+o.offsetWidth+v.scrollMarginRight-n.clientWidth+m.scrollPaddingRight:h-v.scrollMarginLeftn.scrollLeft+n.clientWidth-m.scrollPaddingRight&&(u=h+o.offsetWidth+v.scrollMarginRight-n.clientWidth+m.scrollPaddingRight))}if(p&&l!=="horizontal"){const h=tm(n,o,"top"),m=sl(n),v=sl(o);h-v.scrollMarginTopn.scrollTop+n.clientHeight-m.scrollPaddingBottom&&(c=h+o.offsetHeight+v.scrollMarginBottom-n.clientHeight+m.scrollPaddingBottom)}n.scrollTo({left:u,top:c,behavior:"auto"})}function tm(n,o,i){const l=i==="left"?"offsetLeft":"offsetTop";let u=0;for(;o.offsetParent&&(u+=o[l],o.offsetParent!==n);)o=o.offsetParent;return u}function sl(n){const o=getComputedStyle(n);return{scrollMarginTop:parseFloat(o.scrollMarginTop)||0,scrollMarginRight:parseFloat(o.scrollMarginRight)||0,scrollMarginBottom:parseFloat(o.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(o.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(o.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(o.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(o.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(o.scrollPaddingLeft)||0}}const Tk="data-composite-item-active",Nk=[];function jk(n){const{itemSizes:o,cols:i=1,loopFocus:l=!0,dense:u=!1,orientation:c="both",direction:f,highlightedIndex:p,onHighlightedIndexChange:h,rootRef:m,enableHomeAndEndKeys:v=!1,stopEventPropagation:g=!1,disabledIndices:S,modifierKeys:b=Nk}=n,[k,C]=E.useState(0),w=i>1,N=E.useRef(null),D=Ri(N,m),T=E.useRef([]),O=E.useRef(!1),j=p??k,F=Ee(($,ne=!1)=>{if((h??C)($),ne){const te=T.current[$];em(N.current,te,f,c)}}),W=Ee($=>{if($.size===0||O.current)return;O.current=!0;const ne=Array.from($.keys()),te=ne.find(K=>K==null?void 0:K.hasAttribute(Tk))??null,L=te?ne.indexOf(te):-1;L!==-1&&F(L),em(N.current,te,f,c)}),A=E.useMemo(()=>({"aria-orientation":c==="both"?void 0:c,ref:D,onFocus($){!N.current||!Jp($.target)||$.target.setSelectionRange(0,$.target.value.length??0)},onKeyDown($){const ne=v?kk:Hh;if(!ne.has($.key)||Mk($,b)||!N.current)return;const L=f==="rtl",K=L?Sl:Ci,G={horizontal:K,vertical:_o,both:K}[c],z=L?Ci:Sl,X={horizontal:z,vertical:Ei,both:z}[c];if(Jp($.target)&&!xk($.target)){const ue=$.target.selectionStart,ce=$.target.selectionEnd,le=$.target.value??"";if(ue==null||$.shiftKey||ue!==ce||$.key!==X&&ue0)return}let Q=j;const I=f0(T,S),q=p0(T,S);if(w){const ue=o||Array.from({length:T.current.length},()=>({width:1,height:1})),ce=h0(ue,i,u),le=ce.findIndex(he=>he!=null&&!Ro(T,he,S)),oe=ce.reduce((he,xe,fe)=>xe!=null&&!Ro(T,xe,S)?fe:he,-1);Q=ce[m0({current:ce.map(he=>he?T.current[he]:null)},{event:$,orientation:c,loopFocus:l,cols:i,disabledIndices:v0([...S||T.current.map((he,xe)=>Ro(T,xe)?xe:void 0),void 0],ce),minIndex:le,maxIndex:oe,prevIndex:g0(j>q?I:j,ue,ce,i,$.key===_o?"bl":$.key===Ci?"tr":"tl"),rtl:L})]}const B={horizontal:[K],vertical:[_o],both:[K,_o]}[c],R={horizontal:[z],vertical:[Ei],both:[z,Ei]}[c],Y=w?ne:{horizontal:v?wk:Uh,vertical:v?Sk:Bh,both:ne}[c];v&&($.key===zl?Q=I:$.key===Dl&&(Q=q)),Q===j&&(B.includes($.key)||R.includes($.key))&&(l&&Q===q&&B.includes($.key)?Q=I:l&&Q===I&&R.includes($.key)?Q=q:Q=tn(T,{startingIndex:Q,decrement:R.includes($.key),disabledIndices:S})),Q!==j&&!Zu(T,Q)&&(g&&$.stopPropagation(),Y.has($.key)&&$.preventDefault(),F(Q,!0),queueMicrotask(()=>{var ue;(ue=T.current[Q])==null||ue.focus()}))}}),[i,u,f,S,T,v,j,w,o,l,D,b,F,c,g]);return E.useMemo(()=>({props:A,highlightedIndex:j,onHighlightedIndexChange:F,elementsRef:T,disabledIndices:S,onMapChange:W,relayKeyboardEvent:A.onKeyDown}),[A,j,F,T,S,W])}function Mk(n,o){for(const i of Rk.values())if(!o.includes(i)&&n.getModifierState(i))return!0;return!1}function Ok(n){const{render:o,className:i,refs:l=dl,props:u=dl,state:c=gt,stateAttributesMapping:f,highlightedIndex:p,onHighlightedIndexChange:h,orientation:m,dense:v,itemSizes:g,loopFocus:S,cols:b,enableHomeAndEndKeys:k,onMapChange:C,stopEventPropagation:w=!0,rootRef:N,disabledIndices:D,modifierKeys:T,highlightItemOnHover:O=!1,tag:j="div",...F}=n,W=zh(),{props:A,highlightedIndex:$,onHighlightedIndexChange:ne,elementsRef:te,onMapChange:L,relayKeyboardEvent:K}=jk({itemSizes:g,cols:b,loopFocus:S,dense:v,orientation:m,highlightedIndex:p,onHighlightedIndexChange:h,rootRef:N,stopEventPropagation:w,enableHomeAndEndKeys:k,direction:W,disabledIndices:D,modifierKeys:T}),G=kt(j,n,{state:c,ref:l,props:[A,...u,F],stateAttributesMapping:f}),z=E.useMemo(()=>({highlightedIndex:$,onHighlightedIndexChange:ne,highlightItemOnHover:O,relayKeyboardEvent:K}),[$,ne,O,K]);return y.jsx(lh.Provider,{value:z,children:y.jsx(hk,{elementsRef:te,onMapChange:X=>{C==null||C(X),L(X)},children:G})})}const Ik=E.createContext(void 0);function Lk(n){return E.useContext(Ik)}let Ak=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n.multiple="data-multiple",n})({});const nm={multiple(n){return n?{[Ak.multiple]:""}:null}},zk=E.forwardRef(function(o,i){const{defaultValue:l,disabled:u=!1,loopFocus:c=!0,onValueChange:f,orientation:p="horizontal",multiple:h=!1,value:m,className:v,render:g,...S}=o,b=Lk(),k=E.useMemo(()=>{if(m===void 0)return l??[]},[m,l]),C=E.useMemo(()=>m!==void 0||l!==void 0,[m,l]),w=((b==null?void 0:b.disabled)??!1)||u,[N,D]=Nl({controlled:m,default:k,name:"ToggleGroup",state:"value"}),T=Ee((A,$,ne)=>{let te;if(h?(te=N.slice(),$?te.push(A):te.splice(N.indexOf(A),1)):te=$?[A]:[],Array.isArray(te)){if(f==null||f(te,ne),ne.isCanceled)return;D(te)}}),O={disabled:w,multiple:h,orientation:p},j=E.useMemo(()=>({disabled:w,orientation:p,setGroupValue:T,value:N,isValueInitialized:C}),[w,p,T,N,C]),F={role:"group"},W=kt("div",o,{enabled:!!b,state:O,ref:i,props:[F,S],stateAttributesMapping:nm});return y.jsx(Vh.Provider,{value:j,children:b?W:y.jsx(Ok,{render:g,className:v,state:O,refs:[i],props:[F,S],stateAttributesMapping:nm,loopFocus:c,enableHomeAndEndKeys:!0})})}),Dk=oc("group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-8 min-w-8 px-2",sm:"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]",lg:"h-9 min-w-9 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),Wh=E.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function Qr({className:n,variant:o,size:i,spacing:l=0,orientation:u="horizontal",children:c,...f}){return y.jsx(zk,{"data-slot":"toggle-group","data-variant":o,"data-size":i,"data-spacing":l,"data-orientation":u,style:{"--gap":l},className:Pe("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",n),...f,children:y.jsx(Wh.Provider,{value:{variant:o,size:i,spacing:l,orientation:u},children:c})})}function Xr({className:n,children:o,variant:i="default",size:l="default",...u}){const c=E.useContext(Wh);return y.jsx(mk,{"data-slot":"toggle-group-item","data-variant":c.variant||i,"data-size":c.size||l,"data-spacing":c.spacing,className:Pe("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",Dk({variant:c.variant||i,size:c.size||l}),n),...u,children:o})}const Fk=15,Vk={high:"border-l-risk-high",medium:"border-l-risk-medium",low:"border-l-risk-low",neutral:"border-l-border"},$k={high:"bg-risk-high",medium:"bg-risk-medium",low:"bg-risk-low",neutral:"bg-border"},rm={"mat-none":"bg-muted/30 text-muted-foreground","mat-low":"bg-sim-low","mat-med":"bg-sim-med","mat-high":"bg-sim-high","mat-vhigh":"bg-sim-vhigh text-sim-vhigh-foreground"},Uk=[{value:"recent_pr_count",label:"recent PRs"},{value:"flagged_prs",label:"flagged PRs"},{value:"last_activity_at",label:"latest activity"},{value:"pr_count",label:"total PRs"}],Bk=[{value:"open",label:"open PRs"},{value:"all",label:"all PRs"}];function om(n,o){return o==="all"?!0:Kh(n)}function Hk(n){const{clusters:o,prByNumber:i,contributorByAuthor:l,focusMode:u,windowDays:c,selectedClusterId:f,onSelectCluster:p,sortKey:h,onSortKeyChange:m}=n,[v,g]=E.useState(()=>new Set(f?[f]:[])),[S,b]=E.useState("open"),k=E.useCallback(w=>g(N=>{const D=new Set(N);return D.has(w)?D.delete(w):D.add(w),D}),[]),C=E.useMemo(()=>{const w=[...o];if(w.sort((D,T)=>gw(D,T,h,i,l)),!f)return w;const N=w.find(D=>D.cluster_id===f);return N?[N,...w.filter(D=>D.cluster_id!==f)]:w},[o,l,i,f,h]);return y.jsxs(Ol,{title:"Issue Clusters",description:"Issue-centered groups of PRs and issues tied together by references, shared targets, and soft similarity.",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Sort by"}),y.jsx(Qr,{value:[h],onValueChange:w=>{w.length&&m(w[0])},spacing:2,size:"sm",children:Uk.map(w=>y.jsx(Xr,{value:w.value,children:w.label},w.value))})]}),y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Show"}),y.jsx(Qr,{value:[S],onValueChange:w=>{w.length&&b(w[0])},spacing:2,size:"sm",children:Bk.map(w=>y.jsx(Xr,{value:w.value,children:w.label},w.value))})]}),y.jsx("div",{className:"flex flex-col gap-3",children:C.map(w=>y.jsx(Wk,{cluster:w,prByNumber:i,contributorByAuthor:l,focusMode:u,windowDays:c,selected:w.cluster_id===f,open:v.has(w.cluster_id),onToggle:()=>k(w.cluster_id),onSelect:()=>p(w.cluster_id),prStateFilter:S},w.cluster_id))})]})}function Wk({cluster:n,prByNumber:o,contributorByAuthor:i,focusMode:l,windowDays:u,selected:c,open:f,onToggle:p,prStateFilter:h}){const m=ey(n,i),v=E.useMemo(()=>n.recent_pr_numbers.map(w=>o.get(w)).filter(w=>!!w).filter(w=>nc(w,i.get(w.author??""),l)).filter(w=>om(w,h)).sort((w,N)=>Uu(w,N,n.canonical_pr_number)),[n,o,i,l,h]),g=E.useMemo(()=>n.outside_window_prs.filter(w=>om(w,h)).sort((w,N)=>Uu(w,N,n.canonical_pr_number)),[n.canonical_pr_number,n.outside_window_prs,h]),S=E.useMemo(()=>[...v,...g].sort((w,N)=>Uu(w,N,n.canonical_pr_number)),[n.canonical_pr_number,g,v]),b=v.length+g.length,k=Math.max(n.recent_pr_count-v.length,0),C=E.useMemo(()=>(n.pairwise_similarity??[]).filter(w=>_i(w)>=.5).length,[n]);return y.jsx(ch,{open:f,onOpenChange:p,children:y.jsxs("article",{id:`cluster-${n.cluster_id}`,className:Pe("rounded-lg border border-l-[3px] overflow-hidden transition-colors",Vk[m],c&&"ring-1 ring-primary/40"),children:[y.jsxs(dh,{className:Pe("flex w-full items-start justify-between gap-3 p-4 text-left cursor-pointer","bg-secondary/40 hover:bg-secondary/60 transition-colors"),children:[y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsx("strong",{className:"text-sm",children:n.title}),y.jsxs(vt,{variant:"count",children:[b," PR",b!==1?"s":""]}),y.jsxs(vt,{variant:"outline",children:[n.pr_count," total"]}),n.outside_window_prs.length>0?y.jsxs(vt,{variant:"outline",children:[n.outside_window_prs.length," outside ",u,"d window"]}):null,C>0?y.jsxs(vt,{variant:"warning",title:"PR pairs in this issue cluster where at least one metric is high (≥ 0.50): code, size, files, areas, or patch.",children:[C," Similar Pair",C>1?"s":""]}):null]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[n.authors.slice(0,6).join(", "),n.authors.length>6?` +${n.authors.length-6}`:""," · ",n.evidence_types.join(", ")," · status ",n.status??"—"]}),n.summary?y.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-prose",children:n.summary}):null]}),y.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[n.github_url?y.jsx("span",{onClick:w=>w.stopPropagation(),children:y.jsx(It,{href:n.github_url,children:"Reference"})}):null,f?y.jsx(jl,{className:"size-4 text-muted-foreground"}):y.jsx(Ml,{className:"size-4 text-muted-foreground"})]})]}),y.jsxs(fh,{keepMounted:!0,children:[y.jsx(Gk,{cluster:n,rows:S}),y.jsxs("div",{className:"px-4 flex flex-col",children:[v.map(w=>y.jsx(Kk,{row:w,contributor:i.get(w.author??""),reference:n.canonical_pr_number===w.number,similarity:n.pr_similarity[String(w.number)],peerMatches:dp(n,w.number)},w.number)),g.length>0?y.jsxs("div",{className:"text-xs text-muted-foreground pt-3 pb-1",children:[g.length," PR",g.length!==1?"s were":" was"," created before the ",u,"-day created-at window and ",g.length!==1?"are":"is"," shown below with limited details."]}):null,g.map(w=>y.jsx(Yk,{row:w,reference:n.canonical_pr_number===w.number,peerMatches:dp(n,w.number),windowDays:u},`outside-${w.number}`))]}),k>0?y.jsxs("p",{className:"text-xs text-muted-foreground px-4 pb-3 mt-2",children:["+",k," in-window PR",k!==1?"s":""," hidden by focus or PR state filter."]}):null]})]})})}function Kk({row:n,contributor:o,reference:i,similarity:l,peerMatches:u}){const c=To(o==null?void 0:o.automation_risk_signal),f=ry(l);return y.jsxs("div",{className:"grid grid-cols-[4px_minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[y.jsx("div",{className:Pe("rounded-sm",$k[c]),"aria-hidden":!0}),y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsxs("strong",{className:Pe("text-sm",!kl(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),i?y.jsx(vt,{variant:"reference",children:"reference"}):null,y.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:Li(n)}),f!==null?y.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["sim ",f.toFixed(2)]}):null,y.jsx(nh,{level:c})]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · ",Kr(n.updated_at)," · ",n.changed_files??0," files · +",n.additions??0,"/-",n.deletions??0]}),u.length>0?y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Similar to"," ",u.map((p,h)=>y.jsxs("span",{children:[h>0?", ":"","#",p.otherPrNumber," (",p.similarity.toFixed(2),")"]},p.otherPrNumber))]}):null,n.author?y.jsx(Il,{contributor:o,compact:!0}):null,n.body_excerpt?y.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-prose",children:n.body_excerpt}):null]}),y.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url?y.jsx(It,{href:n.html_url,children:"PR"}):null,n.files_url?y.jsx(It,{href:n.files_url,children:"Files"}):null]})]})}function Yk({row:n,reference:o,peerMatches:i,windowDays:l}){const u=(n.additions??0)+(n.deletions??0);return y.jsxs("div",{className:"grid grid-cols-[4px_minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[y.jsx("div",{className:"rounded-sm bg-border","aria-hidden":!0}),y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsxs("strong",{className:Pe("text-sm",!Kh(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),o?y.jsx(vt,{variant:"reference",children:"reference"}):null,y.jsxs(vt,{variant:"outline",children:["outside ",l,"d window"]}),y.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:u})]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · created ",Kr(n.created_at)," · updated ",Kr(n.updated_at)," · ",n.changed_files??0," files · +",n.additions??0,"/-",n.deletions??0]}),i.length>0?y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Similar to"," ",i.map((c,f)=>y.jsxs("span",{children:[f>0?", ":"","#",c.otherPrNumber," (",c.similarity.toFixed(2),")"]},c.otherPrNumber))]}):null]}),y.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url?y.jsx(It,{href:n.html_url,children:"PR"}):null,n.files_url?y.jsx(It,{href:n.files_url,children:"Files"}):null]})]})}function Gk({cluster:n,rows:o}){const[i,l]=E.useState(!0),u=o.slice(0,Fk);if(u.length<2)return null;const c=u.length>8,f=(n.pairwise_similarity??[]).filter(p=>_i(p)>=.5).length;return y.jsxs("div",{className:"px-4 py-2.5",children:[y.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:()=>l(p=>!p),children:[i?y.jsx(jl,{className:"size-3"}):y.jsx(Ml,{className:"size-3"}),"Pairwise comparison",o.length>u.length?` (first ${u.length} of ${o.length})`:"",f>0?` · ${f} pair${f>1?"s":""} ≥ 0.50`:""]}),y.jsxs(ji,{children:[y.jsx(Mi,{className:"ml-1.5 cursor-help align-middle",children:y.jsx(th,{className:"size-3.5 text-muted-foreground hover:text-foreground"})}),y.jsx(Oi,{side:"right",className:"text-xs max-w-xs",children:"Compares every PR pair in this issue cluster. Metrics: code (composite of size, file overlap, area overlap, patch overlap), size, files, areas, and patch. High values can come from size similarity alone."})]}),i?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"sim-grid mt-2",style:{"--sim-cols":`72px repeat(${u.length}, minmax(${c?"38px":"48px"}, 1fr))`},children:[y.jsx("div",{className:"min-h-8 rounded bg-muted/20"}),u.map(p=>y.jsx(sm,{row:p,isLarge:c},`c-${p.number}`)),u.map(p=>y.jsxs(E.Fragment,{children:[y.jsx(sm,{row:p,isLarge:c}),u.map(h=>{if(p.number===h.number)return y.jsx("div",{className:Pe("min-h-8 rounded bg-muted/20 flex items-center justify-center font-mono text-muted-foreground",c?"text-[0.65rem]":"text-xs"),children:"—"},`${p.number}-${h.number}`);const m=oy(n,p.number,h.number),v=Qk(n,p.number,h.number);return y.jsxs(ji,{children:[y.jsx(Mi,{render:y.jsx("div",{className:Pe("min-h-8 rounded flex items-center justify-center font-mono border border-border/40",c?"text-[0.65rem]":"text-xs",rm[xm(m)])}),children:m.toFixed(2)}),y.jsxs(Oi,{side:"top",className:"font-mono text-xs",children:["#",p.number," ↔ #",h.number,v?y.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["patch ",v.patch_similarity.toFixed(2)," · code ",v.code_similarity.toFixed(2)," · size ",v.size_similarity.toFixed(2)," · file ",v.file_overlap.toFixed(2)," · area ",v.area_overlap.toFixed(2)]}):null]})]},`${p.number}-${h.number}`)})]},`rg-${p.number}`))]}),y.jsx("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:["mat-none","mat-low","mat-med","mat-high","mat-vhigh"].map((p,h)=>y.jsxs(E.Fragment,{children:[y.jsx("span",{className:Pe("inline-block size-3.5 rounded-sm border border-border/40",rm[p])}),["0","<.10","<.25","<.50","≥.50"][h]]},p))})]}):null]})}function Qk(n,o,i){return(n.pairwise_similarity??[]).find(l=>l.left_pr_number===o&&l.right_pr_number===i||l.left_pr_number===i&&l.right_pr_number===o)}function Uu(n,o,i){return i===n.number?-1:i===o.number?1:im(n)-im(o)}function im(n){return"cluster_ids"in n?Li(n):(n.additions??0)+(n.deletions??0)}function Kh(n){return n.state==="open"&&!n.merged}function sm({row:n,isLarge:o}){const i=y.jsxs("span",{className:Pe("min-h-8 rounded bg-muted/20 flex items-center justify-center font-mono text-muted-foreground px-0.5 truncate hover:bg-muted/35 hover:text-foreground transition-colors",o?"text-[0.65rem]":"text-xs"),title:n.files_url?`Open #${n.number} files`:n.title??void 0,children:["#",n.number]});return n.files_url?y.jsx("a",{href:n.files_url,target:"_blank",rel:"noreferrer",title:n.title??void 0,children:i}):i}const Xk={high:"border-l-[3px] border-l-risk-high bg-risk-high/[0.07]",medium:"border-l-[3px] border-l-risk-medium bg-risk-medium/[0.05]",low:"border-l-[3px] border-l-transparent",neutral:"border-l-[3px] border-l-transparent"},qk=[{value:"open",label:"open"},{value:"all",label:"all"},{value:"merged",label:"merged"},{value:"flagged",label:"flagged",tip:"PRs whose author has medium or high automation risk"},{value:"clustered",label:"clustered"},{value:"unclustered",label:"unclustered"}];function Zk(n){const{rows:o,contributorByAuthor:i,onOpenCluster:l,sortKey:u,sortDirection:c,onSortKeyChange:f,onSortDirectionChange:p,filterKey:h,onFilterKeyChange:m,focusLabel:v}=n,[g,S]=E.useState(""),b=E.useMemo(()=>o.filter(w=>ay(w,i,h)).filter(w=>km(g,w.title,w.author,w.body_excerpt)),[o,i,h,g]),k=E.useMemo(()=>[...b].sort((w,N)=>fw(w,N,i,u,c)),[b,i,u,c]);function C(w){w===u?p(c==="desc"?"asc":"desc"):(f(w),p(pw()))}return y.jsxs(Ol,{title:"Recent PRs",description:`Queue view for ${v} — hand off to GitHub for full review.`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[y.jsx(Qr,{value:[h],onValueChange:w=>{w.length&&m(w[0])},spacing:2,size:"sm",children:qk.map(w=>y.jsx(Xr,{value:w.value,title:w.tip,children:w.label},w.value))}),y.jsx(rh,{value:g,onChange:S,placeholder:"Filter by title, author…"})]}),y.jsxs("div",{className:"w-full overflow-x-auto",children:[y.jsxs("table",{className:"w-full border-collapse text-sm",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"border-b border-border",children:[y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"PR"}),y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Author"}),y.jsx(vn,{label:"Signal",active:u==="automation_risk",direction:c,onClick:()=>C("automation_risk")}),y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Cluster"}),y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Status"}),y.jsx(vn,{label:"Updated",active:u==="updated_at",direction:c,onClick:()=>C("updated_at")}),y.jsx(vn,{label:"Size",active:u==="size",direction:c,onClick:()=>C("size")}),y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Links"})]})}),y.jsx("tbody",{children:k.map(w=>{const N=tc(w,i);return y.jsxs("tr",{className:Pe("border-b border-border last:border-b-0 transition-colors hover:bg-accent",Xk[N]),children:[y.jsxs("td",{className:"px-2 py-2.5 align-top",children:[y.jsxs("span",{className:Pe(!kl(w)&&"line-through decoration-muted-foreground"),children:[y.jsxs("strong",{children:["#",w.number]})," ",w.title]}),w.body_excerpt?y.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:w.body_excerpt}):null]}),y.jsxs("td",{className:"px-2 py-2.5 align-top",children:[y.jsx("strong",{children:w.author??"—"}),w.author?y.jsx(Il,{contributor:i.get(w.author),compact:!0}):null,w.author_association?y.jsxs("div",{className:"text-xs text-muted-foreground",children:["association · ",w.author_association]}):null]}),y.jsx("td",{className:"px-2 py-2.5 align-top",children:w.author?y.jsx(aw,{contributor:i.get(w.author)}):"—"}),y.jsx("td",{className:"px-2 py-2.5 align-top",children:w.cluster_id?y.jsx(uw,{clusterId:w.cluster_id,onOpenCluster:l}):y.jsx("span",{className:"text-muted-foreground",children:"—"})}),y.jsxs("td",{className:"px-2 py-2.5 align-top text-sm whitespace-nowrap",children:[w.merged?"merged":w.state,w.draft?" · draft":""]}),y.jsx("td",{className:"px-2 py-2.5 align-top text-sm whitespace-nowrap",children:Kr(w.updated_at)}),y.jsxs("td",{className:"px-2 py-2.5 align-top font-mono text-xs whitespace-nowrap tabular-nums",children:[w.changed_files??0,"f +",w.additions??0,"/-",w.deletions??0]}),y.jsx("td",{className:"px-2 py-2.5 align-top",children:y.jsxs("div",{className:"flex gap-2",children:[w.html_url?y.jsx(It,{href:w.html_url,children:"PR"}):null,w.files_url?y.jsx(It,{href:w.files_url,children:"Files"}):null]})})]},w.number)})})]}),k.length===0?y.jsxs("p",{className:"text-center text-muted-foreground py-8",children:["No PRs match the current filter",g?" and search":"","."]}):null]})]})}const Jk=15,lm={"mat-none":"bg-muted/30 text-muted-foreground","mat-low":"bg-sim-low","mat-med":"bg-sim-med","mat-high":"bg-sim-high","mat-vhigh":"bg-sim-vhigh text-sim-vhigh-foreground"},eb=[{value:"average_similarity",label:"avg similarity"},{value:"recent_pr_count",label:"recent PRs"},{value:"last_activity_at",label:"latest activity"},{value:"pr_count",label:"total PRs"}],tb=[{value:"open",label:"open PRs"},{value:"all",label:"all PRs"}];function nb(n){const{clusters:o,prByNumber:i,contributorByAuthor:l,focusMode:u,windowDays:c,sortKey:f,onSortKeyChange:p}=n,[h,m]=E.useState("open"),[v,g]=E.useState(new Set),S=E.useCallback(k=>g(C=>{const w=new Set(C);return w.has(k)?w.delete(k):w.add(k),w}),[]),b=E.useMemo(()=>{const k=[...o];return k.sort((C,w)=>vw(C,w,f)),k},[o,f]);return y.jsxs(Ol,{title:"Code Clusters",description:"Groups of PRs with similar change scope — overlapping files, directories, and diff areas that may indicate competing or related work.",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[y.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.length," code cluster",o.length!==1?"s":""]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Sort by"}),y.jsx(Qr,{value:[f],onValueChange:k=>{k.length&&p(k[0])},spacing:2,size:"sm",children:eb.map(k=>y.jsx(Xr,{value:k.value,children:k.label},k.value))})]})]}),y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap mb-3",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Show"}),y.jsx(Qr,{value:[h],onValueChange:k=>{k.length&&m(k[0])},spacing:2,size:"sm",children:tb.map(k=>y.jsx(Xr,{value:k.value,children:k.label},k.value))})]}),y.jsx("div",{className:"flex flex-col gap-3",children:b.map(k=>y.jsx(rb,{cluster:k,prByNumber:i,contributorByAuthor:l,focusMode:u,windowDays:c,open:v.has(k.cluster_id),onToggle:()=>S(k.cluster_id),prStateFilter:h},k.cluster_id))})]})}function rb({cluster:n,prByNumber:o,contributorByAuthor:i,focusMode:l,windowDays:u,open:c,onToggle:f,prStateFilter:p}){const h=Sm(n),m=E.useMemo(()=>n.recent_pr_numbers.map(C=>o.get(C)).filter(C=>!!C).filter(C=>nc(C,i.get(C.author??""),l)).filter(C=>p==="all"||kl(C)).sort((C,w)=>am(C,w,n.representative_pr_number)),[n,o,i,l,p]),v=E.useMemo(()=>n.outside_window_prs.filter(C=>p==="all"||Yh(C)),[n,p]),g=E.useMemo(()=>[...m,...v].sort((C,w)=>am(C,w,n.representative_pr_number)),[n.representative_pr_number,m,v]),S=m.length+v.length,b=Math.max(n.recent_pr_count-m.length,0),k=n.average_similarity>=.6?"border-l-risk-high":n.average_similarity>=.4?"border-l-risk-medium":"border-l-primary/40";return y.jsx(ch,{open:c,onOpenChange:f,children:y.jsxs("article",{className:Pe("rounded-lg border border-l-[3px] overflow-hidden transition-colors",k),children:[y.jsxs(dh,{className:Pe("flex w-full items-start justify-between gap-3 p-4 text-left cursor-pointer","bg-secondary/40 hover:bg-secondary/60 transition-colors"),children:[y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsx("strong",{className:"text-sm",children:n.title}),y.jsxs(vt,{variant:"count",children:[S," PR",S!==1?"s":""]}),y.jsxs(vt,{variant:"outline",children:["avg ",n.average_similarity.toFixed(2)]}),n.outside_window_prs.length>0?y.jsxs(vt,{variant:"outline",children:[n.outside_window_prs.length," outside ",u,"d window"]}):null,h>0&&y.jsxs(vt,{variant:"warning",title:"PR pairs in this code cluster with high overall scope similarity (≥ 0.50) based on changed files, directories, diff areas, and change shape.",children:[h," High Scope Similarity"]})]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[n.authors.slice(0,6).join(", "),n.authors.length>6?` +${n.authors.length-6}`:""]}),n.summary&&y.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-prose",children:n.summary})]}),y.jsxs("div",{className:"flex items-center gap-2.5 shrink-0",children:[y.jsx(It,{href:n.representative_url,children:"Representative PR"}),c?y.jsx(jl,{className:"size-4 text-muted-foreground"}):y.jsx(Ml,{className:"size-4 text-muted-foreground"})]})]}),y.jsxs(fh,{keepMounted:!0,children:[y.jsx(ob,{directories:n.shared_directories,filenames:n.shared_filenames}),y.jsx(lb,{cluster:n,rows:g}),y.jsxs("div",{className:"px-4 flex flex-col",children:[m.map(C=>y.jsx(ib,{row:C,contributor:i.get(C.author??""),representative:C.number===n.representative_pr_number,cluster:n},C.number)),v.length>0?y.jsxs("div",{className:"text-xs text-muted-foreground pt-3 pb-1",children:[v.length," PR",v.length!==1?"s were":" was"," created before the ",u,"-day created-at window and ",v.length!==1?"are":"is"," shown below with limited details."]}):null,v.map(C=>y.jsx(sb,{row:C,representative:C.number===n.representative_pr_number,cluster:n,windowDays:u},`outside-${C.number}`))]}),b>0?y.jsxs("p",{className:"text-xs text-muted-foreground px-4 pb-3 mt-2",children:["+",b," in-window PR",b!==1?"s":""," hidden by focus or PR state filter."]}):null]})]})})}function ob({directories:n,filenames:o}){return!n.length&&!o.length?null:y.jsxs("div",{className:"px-4 pt-2.5 pb-1 flex flex-wrap gap-1.5",children:[o.slice(0,5).map(i=>y.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-primary/10 text-primary text-xs font-mono px-1.5 py-0.5",children:[y.jsx(Z0,{className:"size-3 shrink-0"}),i.split("/").pop()]},i)),n.slice(0,4).map(i=>y.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-muted text-muted-foreground text-xs font-mono px-1.5 py-0.5",children:[y.jsx(nw,{className:"size-3 shrink-0"}),i]},i))]})}function ib({row:n,contributor:o,representative:i,cluster:l}){const u=To(o==null?void 0:o.automation_risk_signal),c=wm(l,n.number);return y.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsxs("strong",{className:Pe("text-sm",!kl(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),i?y.jsx(vt,{variant:"reference",children:"representative"}):null,y.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:Li(n)}),y.jsx(nh,{level:u})]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · ",Kr(n.updated_at)," · ",n.changed_files??0," files · +",n.additions??0,"/-",n.deletions??0]}),c.length>0&&y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Overlaps with"," ",c.map((f,p)=>y.jsxs("span",{children:[p>0?", ":"","#",f.otherPrNumber," (",f.similarity.toFixed(2),")"]},f.otherPrNumber))]}),n.author&&y.jsx(Il,{contributor:o,compact:!0})]}),y.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url&&y.jsx(It,{href:n.html_url,children:"PR"}),n.files_url&&y.jsx(It,{href:n.files_url,children:"Files"})]})]})}function sb({row:n,representative:o,cluster:i,windowDays:l}){const u=wm(i,n.number),c=(n.additions??0)+(n.deletions??0);return y.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] gap-2.5 py-2.5 border-b border-border last:border-b-0",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsxs("strong",{className:Pe("text-sm",!Yh(n)&&"line-through decoration-muted-foreground"),children:["#",n.number," ",n.title]}),o?y.jsx(vt,{variant:"reference",children:"representative"}):null,y.jsxs(vt,{variant:"outline",children:["outside ",l,"d window"]}),y.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["±",c]})]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:[n.author??"unknown"," · created ",Kr(n.created_at)," · updated ",Kr(n.updated_at)," · ",n.changed_files??0," files"]}),u.length>0&&y.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5",children:["Overlaps with"," ",u.map((f,p)=>y.jsxs("span",{children:[p>0?", ":"","#",f.otherPrNumber," (",f.similarity.toFixed(2),")"]},f.otherPrNumber))]})]}),y.jsxs("div",{className:"flex gap-2 shrink-0",children:[n.html_url&&y.jsx(It,{href:n.html_url,children:"PR"}),n.files_url&&y.jsx(It,{href:n.files_url,children:"Files"})]})]})}function lb({cluster:n,rows:o}){const[i,l]=E.useState(!0),u=o.slice(0,Jk);if(u.length<2)return null;const c=Sm(n);return y.jsxs("div",{className:"px-4 py-2.5",children:[y.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:()=>l(f=>!f),children:[i?y.jsx(jl,{className:"size-3"}):y.jsx(Ml,{className:"size-3"}),"Pairwise scope similarity",o.length>u.length?` (first ${u.length} of ${o.length})`:"",c>0?` · ${c} pair${c>1?"s":""} ≥ 0.50`:""]}),y.jsxs(ji,{children:[y.jsx(Mi,{className:"ml-1.5 cursor-help align-middle",children:y.jsx(th,{className:"size-3.5 text-muted-foreground hover:text-foreground"})}),y.jsx(Oi,{side:"right",className:"text-xs max-w-xs",children:"Compares PRs by change scope. Blends: content (file/directory/diff-area overlap), size (total changed lines), breadth (file-count and directory-count), and concentration (how focused the change is). This is a change-footprint comparison, not a semantic review."})]}),i&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"sim-grid mt-2",style:{"--sim-cols":`72px repeat(${u.length}, minmax(38px, 1fr))`},children:[y.jsx("div",{className:"min-h-8 rounded bg-muted/20"}),u.map(f=>y.jsx(cm,{row:f},`c-${f.number}`)),u.map(f=>y.jsxs(E.Fragment,{children:[y.jsx(cm,{row:f}),u.map(p=>{if(f.number===p.number)return y.jsx("div",{className:"min-h-8 rounded bg-muted/20 flex items-center justify-center text-[0.65rem] font-mono text-muted-foreground",children:"—"},`${f.number}-${p.number}`);const h=sy(n,f.number,p.number),m=(h==null?void 0:h.similarity)??0;return y.jsxs(ji,{children:[y.jsx(Mi,{render:y.jsx("div",{className:Pe("min-h-8 rounded flex items-center justify-center text-[0.65rem] font-mono border border-border/40",lm[xm(m)])}),children:m.toFixed(2)}),y.jsxs(Oi,{side:"top",className:"font-mono text-xs max-w-xs",children:[y.jsxs("div",{children:["#",f.number," ↔ #",p.number]}),h&&y.jsxs(y.Fragment,{children:[y.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["content ",h.content_similarity.toFixed(2)," · breadth ",h.breadth_similarity.toFixed(2)," · concentration ",h.concentration_similarity.toFixed(2)," · size ",h.size_similarity.toFixed(2)]}),h.shared_filenames.length>0&&y.jsxs("span",{className:"block mt-0.5 text-muted-foreground",children:["files: ",h.shared_filenames.slice(0,3).map(v=>v.split("/").pop()).join(", "),h.shared_filenames.length>3?` +${h.shared_filenames.length-3}`:""]})]})]})]},`${f.number}-${p.number}`)})]},`rg-${f.number}`))]}),y.jsx("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:["mat-none","mat-low","mat-med","mat-high","mat-vhigh"].map((f,p)=>y.jsxs(E.Fragment,{children:[y.jsx("span",{className:Pe("inline-block size-3.5 rounded-sm border border-border/40",lm[f])}),["0","<.10","<.25","<.50","≥.50"][p]]},f))})]})]})}function am(n,o,i){return n.number===i?-1:o.number===i?1:um(n)-um(o)}function um(n){return"cluster_ids"in n?Li(n):(n.additions??0)+(n.deletions??0)}function Yh(n){return n.state==="open"&&!n.merged}function cm({row:n}){const o=y.jsxs("span",{className:"min-h-8 rounded bg-muted/20 flex items-center justify-center text-[0.65rem] font-mono text-muted-foreground px-0.5 truncate hover:bg-muted/35 hover:text-foreground transition-colors",title:n.files_url?`Open #${n.number} files`:n.title??void 0,children:["#",n.number]});return n.files_url?y.jsx("a",{href:n.files_url,target:"_blank",rel:"noreferrer",title:n.title??void 0,children:o}):o}function ab(n){const{rows:o,sortKey:i,sortDirection:l,onSortKeyChange:u,onSortDirectionChange:c,focusLabel:f}=n,[p,h]=E.useState(""),m=E.useMemo(()=>o.filter(S=>km(p,S.author,S.name,S.heuristic_note)),[o,p]),v=E.useMemo(()=>[...m].sort((S,b)=>mw(S,b,i,l)),[m,i,l]);function g(S){S===i?c(l==="desc"?"asc":"desc"):(u(S),c(hw()))}return y.jsxs(Ol,{title:"Contributors",description:`Contributor ranking under ${f}.`,children:[y.jsx("div",{className:"flex items-center justify-end gap-3 flex-wrap mb-3",children:y.jsx(rh,{value:p,onChange:h,placeholder:"Filter by name…"})}),y.jsxs("div",{className:"w-full overflow-x-auto",children:[y.jsxs("table",{className:"w-full border-collapse text-sm",children:[y.jsx("thead",{children:y.jsxs("tr",{className:"border-b border-border",children:[y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Contributor"}),y.jsx(vn,{label:"Repo PRs (14d)",active:i==="recent_pr_count",direction:l,onClick:()=>g("recent_pr_count")}),y.jsx(vn,{label:"Repo PRs (snapshot)",active:i==="snapshot_pr_count",direction:l,onClick:()=>g("snapshot_pr_count")}),y.jsx(vn,{label:"Public PRs (42d)",active:i==="public_pr_count_42d",direction:l,onClick:()=>g("public_pr_count_42d")}),y.jsx(vn,{label:"Repos (42d)",active:i==="public_repo_count_42d",direction:l,onClick:()=>g("public_repo_count_42d")}),y.jsx(vn,{label:"Clusters",active:i==="cluster_count",direction:l,onClick:()=>g("cluster_count")}),y.jsx(vn,{label:"Status",active:i==="status",direction:l,onClick:()=>g("status")}),y.jsx(vn,{label:"Follow-through",active:i==="follow_through_score",direction:l,onClick:()=>g("follow_through_score")}),y.jsx(vn,{label:"Automation risk",active:i==="automation_risk_signal",direction:l,onClick:()=>g("automation_risk_signal")}),y.jsx("th",{className:"text-left text-xs font-semibold uppercase tracking-wider text-primary whitespace-nowrap px-2 py-2.5",children:"Links"})]})}),y.jsx("tbody",{children:v.map(S=>y.jsxs("tr",{className:"border-b border-border last:border-b-0 transition-colors hover:bg-accent",children:[y.jsxs("td",{className:"px-2 py-2.5 align-top",children:[y.jsx("strong",{children:S.author}),S.name?y.jsx("div",{className:"text-xs text-muted-foreground",children:S.name}):null,y.jsx(Il,{contributor:S,compact:!0})]}),y.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:S.recent_pr_count}),y.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:S.snapshot_pr_count}),y.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:S.public_pr_count_42d??"—"}),y.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:S.public_repo_count_42d??"—"}),y.jsx("td",{className:"px-2 py-2.5 align-top font-mono text-xs tabular-nums",children:S.cluster_count}),y.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:ny(S)}),y.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:S.follow_through_score??"—"}),y.jsx(ub,{row:S}),y.jsx("td",{className:"px-2 py-2.5 align-top",children:y.jsxs("div",{className:"flex gap-2",children:[S.profile_url?y.jsx(It,{href:S.profile_url,children:"Profile"}):null,S.repo_pull_requests_url?y.jsx(It,{href:S.repo_pull_requests_url,children:"PRs"}):null]})})]},S.author))})]}),v.length===0?y.jsxs("p",{className:"text-center text-muted-foreground py-8",children:["No contributors match",p?" the search":"","."]}):null]})]})}function ub({row:n}){const o=n.automation_risk_signal??"—";if(!(n.heuristic_note||n.account_age_days!=null||n.public_pr_count_42d!=null))return y.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:o});const l=[];return n.account_age_days!=null&&l.push(`Account age: ${n.account_age_days}d`),n.public_pr_count_42d!=null&&l.push(`Public PRs (42d): ${n.public_pr_count_42d}`),n.public_repo_count_42d!=null&&l.push(`Repos (42d): ${n.public_repo_count_42d}`),n.breadth_score&&l.push(`Breadth: ${n.breadth_score}`),n.heuristic_note&&l.push(n.heuristic_note),y.jsx("td",{className:"px-2 py-2.5 align-top text-sm",children:y.jsxs(ji,{children:[y.jsx(Mi,{className:"underline decoration-dotted underline-offset-4 cursor-help",children:o}),y.jsx(Oi,{side:"top",className:"text-xs max-w-xs whitespace-pre-wrap",children:l.join(` +`)})]})})}const cb=E.forwardRef(function(o,i){const{className:l,render:u,orientation:c="horizontal",...f}=o;return kt("div",o,{state:{orientation:c},ref:i,props:[{role:"separator","aria-orientation":c},f]})});function dm({className:n,orientation:o="horizontal",...i}){return y.jsx(cb,{"data-slot":"separator",orientation:o,className:Pe("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),...i})}const fm=[{key:"all",label:"Everyone",tip:"Full recent queue regardless of familiarity."},{key:"first",label:"Unknown / first",tip:"Prioritise newly-seen contributors and first-snapshot activity."},{key:"known",label:"Known",tip:"Only established or org-linked contributors."}];function db(){const{data:n,error:o}=Xv(),i=Jv(),l=!!(n!=null&&n.summary.pr_scope_available&&n.prScopeClusters.length),u=E.useMemo(()=>{const g=[{key:"prs",label:"PRs"},{key:"clusters",label:"Issue Clusters"}];return l&&g.push({key:"pr_scope",label:"Code Clusters"}),g.push({key:"contributors",label:"Contributors"}),g},[l]),c=E.useMemo(()=>new Map(((n==null?void 0:n.contributors)??[]).map(g=>[g.author,g])),[n]),f=E.useMemo(()=>new Map(((n==null?void 0:n.prs)??[]).map(g=>[g.number,g])),[n]),p=E.useMemo(()=>((n==null?void 0:n.prs)??[]).filter(g=>nc(g,c.get(g.author??""),i.focusMode)),[n,c,i.focusMode]),h=E.useMemo(()=>((n==null?void 0:n.contributors)??[]).filter(g=>ly(g,i.focusMode)),[n,i.focusMode]),m=fm.find(g=>g.key===i.focusMode).label.toLowerCase();if(E.useEffect(()=>{if(i.activeTab!=="clusters"||!i.selectedClusterId)return;const g=requestAnimationFrame(()=>{var S;(S=document.getElementById(`cluster-${i.selectedClusterId}`))==null||S.scrollIntoView({block:"start",behavior:"smooth"})});return()=>cancelAnimationFrame(g)},[i.activeTab,i.selectedClusterId]),o)return y.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[y.jsx(pm,{}),y.jsx(dw,{message:o})]});if(!n)return y.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[y.jsx(pm,{}),y.jsx(cw,{})]});const v=[{label:"Recent PRs",value:n.summary.pr_count},{label:"Issue clusters",value:n.summary.cluster_count},{label:"Clustered PRs",value:n.summary.clustered_pr_count},{label:"Contributors",value:n.summary.contributor_count},{label:"Open",value:n.summary.open_pr_count},{label:"Merged",value:n.summary.merged_pr_count}];return n.summary.pr_scope_cluster_count!=null&&v.push({label:"Code clusters",value:n.summary.pr_scope_cluster_count}),y.jsxs("main",{className:"max-w-7xl mx-auto px-6 pt-5 pb-14",children:[y.jsxs("header",{className:"pb-4 mb-3",children:[y.jsx("p",{className:"text-[0.68rem] font-semibold uppercase tracking-[0.10em] text-primary mb-1.5",children:"Repository dashboard"}),y.jsx("h1",{className:"text-[clamp(1.5rem,3vw,2.2rem)] font-bold leading-tight tracking-tight",children:n.summary.repo}),y.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Snapshot ",y.jsx("code",{className:"text-primary/80",children:n.summary.snapshot_id})," · ",n.summary.window_days,"-day window · refreshed ",uy(n.summary.generated_at)]})]}),y.jsx(dm,{className:"mb-3"}),y.jsx(sw,{items:v}),y.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap py-2.5 mb-4",children:[y.jsx(Qr,{value:[i.activeTab],onValueChange:g=>{g.length&&i.setActiveTab(g[0])},spacing:2,children:u.map(g=>y.jsx(Xr,{value:g.key,children:g.label},g.key))}),y.jsxs("div",{className:"flex items-center gap-2",role:"group","aria-label":"Contributor focus",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Focus:"}),y.jsx(Qr,{value:[i.focusMode],onValueChange:g=>{g.length&&i.setFocusMode(g[0])},spacing:2,size:"sm",children:fm.map(g=>y.jsx(Xr,{value:g.key,title:g.tip,children:g.label},g.key))})]})]}),y.jsx(dm,{className:"mb-4"}),i.activeTab==="prs"?y.jsx(Zk,{rows:p,contributorByAuthor:c,onOpenCluster:g=>{i.setSelectedClusterId(g),i.setActiveTab("clusters")},sortKey:i.prSortKey,sortDirection:i.prSortDirection,onSortKeyChange:i.setPrSortKey,onSortDirectionChange:i.setPrSortDirection,filterKey:i.prFilter,onFilterKeyChange:i.setPrFilter,focusLabel:m}):null,i.activeTab==="clusters"?y.jsx(Hk,{clusters:n.clusters,prByNumber:f,contributorByAuthor:c,focusMode:i.focusMode,windowDays:n.summary.window_days,selectedClusterId:i.selectedClusterId,onSelectCluster:i.setSelectedClusterId,sortKey:i.clusterSortKey,onSortKeyChange:i.setClusterSortKey}):null,i.activeTab==="pr_scope"&&l?y.jsx(nb,{clusters:n.prScopeClusters,prByNumber:f,contributorByAuthor:c,focusMode:i.focusMode,windowDays:n.summary.window_days,sortKey:i.prScopeSortKey,onSortKeyChange:i.setPrScopeSortKey}):null,i.activeTab==="contributors"?y.jsx(ab,{rows:h,sortKey:i.contributorSortKey,sortDirection:i.contributorSortDirection,onSortKeyChange:i.setContributorSortKey,onSortDirectionChange:i.setContributorSortDirection,focusLabel:m}):null]})}function pm(){return y.jsxs("header",{className:"pb-4 mb-3",children:[y.jsx("p",{className:"text-[0.68rem] font-semibold uppercase tracking-[0.10em] text-primary mb-1.5",children:"Repository dashboard"}),y.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"slop-farmer"})]})}Qv.createRoot(document.getElementById("root")).render(y.jsx(hm.StrictMode,{children:y.jsx(lk,{children:y.jsx(db,{})})}));